当前位置: 首页>>代码示例>>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;未经允许,请勿转载。