當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript jb.compName方法代碼示例

本文整理匯總了TypeScript中jb-core.jb.compName方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript jb.compName方法的具體用法?TypeScript jb.compName怎麽用?TypeScript jb.compName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jb-core.jb的用法示例。


在下文中一共展示了jb.compName方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: isCompNameOfType

	isCompNameOfType(name,type) {
		var _jbart = jbart_base().comps[name] ? jbart_base() : jbart;
		if (name && _jbart.comps[name]) {
			while (!_jbart.comps[name].type && jb.compName(jbart.comps[name].impl))
				name = jb.compName(_jbart.comps[name].impl);
			return (_jbart.comps[name].type || '').indexOf(type) == 0;
		}
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:8,代碼來源:studio-tgp-model.ts

示例2: getStyleComp

	getStyleComp(path) {
	    var style = this.val(path);
	    var compName = jb.compName(style);
	    if (compName == 'customStyle')
	      return { type: 'inner', path: path, style : style }
		var comp = compName && getComp(compName);
		if (jb.compName(comp.impl) == 'customStyle') 
	      return { type: 'global', path: compName, style: comp.impl, innerPath: path }
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:9,代碼來源:studio-tgp-model.ts

示例3: nonControlParams

	nonControlParams(path) {
		var prof = profileFromPath(path);
		if (!prof) return [];
		var params = jb_compParams(getComp(jb.compName(prof)));
		return params.filter(p=>
				(p.type||'').indexOf('control')==-1)
			.map(p=>p.id)
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:8,代碼來源:studio-tgp-model.ts

示例4: simpleRun

  simpleRun() {
      var _win = jbart.previewWindow || window;
      if (model.isCompNameOfType(jb.compName(this.circuit),'control'))
        this.circuitType = 'control'
      else if (model.isCompNameOfType(jb.compName(this.circuit),'action'))
        this.circuitType = 'action'
      else if (model.isCompNameOfType(jb.compName(this.circuit),'data'))
        this.circuitType = 'data'
      else
        this.circuitType = 'unknown';

      if (this.circuitType == 'control') // running circuit in a group to get the 'ready' event
        return testControl(this.context, this.forTests);
      else if (this.circuitType != 'action')
        return Promise.resolve(_win.jb_run(this.context));
      
  }
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:17,代碼來源:studio-probe.ts

示例5: paramDef

	paramDef(path) {
		if (!parentPath(path)) // no param def for root
			return;
		if (!isNaN(Number(path.split('~').pop()))) // array elements
			path = parentPath(path);
		var parent_prof = profileFromPath(parentPath(path),true);
		var comp = parent_prof && getComp(jb.compName(parent_prof));
		var params = jb_compParams(comp);
		var paramName = path.split('~').pop();
		return params.filter(p=>p.id==paramName)[0] || {};
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:11,代碼來源:studio-tgp-model.ts

示例6: jbEditorMoreParams

	jbEditorMoreParams(path) {
		var val = profileFromPath(path);
		var comp = getComp(jb.compName(val||{}));
		if (comp) {
			var existing = this.jbEditorSubNodes(path);
			return jb_compParams(comp)
					.map(p=> path + '~' + p.id)
					.filter(p=> existing.indexOf(p) == -1)
		}
		return [];
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:11,代碼來源:studio-tgp-model.ts

示例7: jbEditorSubNodes

	jbEditorSubNodes(path) {
		var val = profileFromPath(path);
		if (!val || typeof val != 'object') return [];
		var compName = jb.compName(val);
		var comp = getComp(compName);
		if (Array.isArray(val))
			return Object.getOwnPropertyNames(val)
				.map(x=>x=='length'? val.length : x)
				.map(k=> path +'~'+k)
		else if (val['$'+compName]) { // sugar
			var arr = val['$'+compName];
			var res_path = path + '~$' + compName;
			if (Array.isArray(arr)) // sugar array. e.g. $pipeline: [ .. ]
				return Object.getOwnPropertyNames(arr)
					.map(x=>x=='length'? arr.length : x)
					.map(k=> res_path +'~'+k)

			return [res_path];
		} else if (comp) {
			var composite = jb_compParams(comp)
				.filter(p=>
					p.composite)
				.map(p=>flattenArray(p.id));

			return (composite[0] || []).concat(jb_compParams(comp)
					.filter(p=>!p.composite)
					.map(p=> ({ path: path + '~' + p.id, param: p}))
					.filter(e=>profileFromPath(e.path) != null || e.param.essential)
					.map(e=>e.path)
				)
		}

		function flattenArray(prop) {
			var innerVal = val[prop];
			if (Array.isArray(innerVal))
				return Object.getOwnPropertyNames(innerVal)
					.map(x=>x=='length'? innerVal.length : x)
					.map(k=> path +'~'+prop + '~' + k)
			else
				return [path + '~' + prop]
		}

	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:43,代碼來源:studio-tgp-model.ts

示例8: jbEditorTitle

	jbEditorTitle(path, collapsed) { 
		var val = profileFromPath(path);
		var compName = jb.compName(val||{});
		var prop = path.split('~').pop();
		if (!isNaN(Number(prop))) // array value - title as a[i]
			prop = path.split('~').slice(-2).join('[') + ']';
		if (Array.isArray(val) && this.paramType(path) == 'data')
			compName = `pipeline (${val.length})`;
		if (Array.isArray(val) && this.paramType(path) == 'action')
			compName = `actions (${val.length})`;
		var summary = '';
		if (collapsed && typeof val == 'object')
			summary = ': ' + this.summary(path).substr(0,20);

		if (compName)
			return prop + `= <span class="treenode-val">${compName}${summary}</span>`;
		else if (typeof val == 'string')
			return prop + (collapsed ? `: <span class="treenode-val" title="${val}">${val}</span>` : '');
		return prop + (Array.isArray(val) ? ` (${val.length})` : '');
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:20,代碼來源:studio-tgp-model.ts

示例9: controlParams

	controlParams(path) {
		var prof = profileFromPath(path,true);
		if (!prof) return [];
		var params = jb_compParams(getComp(jb.compName(prof)));
		return params.filter(p=>(p.type||'').match(/control|options|menu/)).map(p=>p.id)
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:6,代碼來源:studio-tgp-model.ts

示例10: compName

	compName(path) {
		var val = profileFromPath(path);
		return val && jb.compName(val);
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:4,代碼來源:studio-tgp-model.ts


注:本文中的jb-core.jb.compName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。