当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript jb-core.jb类代码示例

本文整理汇总了TypeScript中jb-core.jb的典型用法代码示例。如果您正苦于以下问题:TypeScript jb类的具体用法?TypeScript jb怎么用?TypeScript jb使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了jb类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: addProperty

	addProperty(path) {
		var parent = profileFromPath(parentPath(path));
		if (this.paramType(path) == 'data')
			return jb.writeValue(profileRefFromPath(path),'');
		var param = this.paramDef(path);
		jb.writeValue(profileRefFromPath(path),param.defaultValue || {$: ''});
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:7,代码来源:studio-tgp-model.ts

示例2: restoreWindowEvent

export function restoreWindowEvent(events) {
	events = jb.toarray(events);
	for (var i = 0; i < events.length; i++) {
		window['on' + events[i]] = jb.path(jbart, ['windowOrigEvents', events[i]]);
		jb.path(jbart, ['windowOrigEvents', events[i]], null);
	}
}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:7,代码来源:jb-ui-utils.ts

示例3: wrap

	wrap(path,args) {
		var comp = getComp(args.compName);
		var firstParam = jb_compParams(comp).filter(p=>p.composite)[0];
		if (firstParam) {
			var result = jb.extend({ $: args.compName }, jb.obj(firstParam.id, [profileFromPath(path)]));
			jb.writeValue(profileRefFromPath(path),result);
		}
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:8,代码来源:studio-tgp-model.ts

示例4: 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

示例5: 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

示例6: closest

	impl: (ctx,pathRef) => {
		var path = jb.val(pathRef);
		var closest_path = closest(path);

		if (path && path != closest_path) {
			jb.writeValue(pathRef,closest_path);
//			jb_ui.apply(ctx);
		}
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:9,代码来源:studio-path.ts

示例7: addArrayItem

	addArrayItem(path,args) {
		var val = profileFromPath(path);
		var toAdd = args.toAdd || {$:''};
		if (Array.isArray(val)) {
			val.push(toAdd);
			return { newPath: path + '~' + (val.length-1) }
		}
		else if (!val) {
			jb.writeValue(profileRefFromPath(path),toAdd);
		} else {
			jb.writeValue(profileRefFromPath(path),[val].concat(toAdd));
			return { newPath: path + '~1' }
		}
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:14,代码来源:studio-tgp-model.ts

示例8: Probe

  impl: (ctx,control,staticPath,expectedDynamicCounter,probeCheck)=> {

    // var probProf = findProbeProfile(control.profile);
    // if (!probProf)
    //   return failure('no prob prof');
     // ********** dynamic counter
    var testId = ctx.vars.testID;
    var full_path = testId + '~' + staticPath;
    var probeRes = new Probe(jb.ctx(ctx,{ profile: control.profile, comp: testId, path: '' } ),true)
      .runCircuit(full_path);
    return probeRes.then(res=>{
          try {
            var match = Array.from(res.element.querySelectorAll('[jb-ctx]'))
            .filter(e=> {
              var ctx2 = jbart.ctxDictionary[e.getAttribute('jb-ctx')];
              return ctx2.path == full_path || (ctx2.componentContext && ctx2.componentContext.callerPath == full_path)
            })
            if (match.length != expectedDynamicCounter)
              return failure('dynamic counter', 'jb-path error: ' + staticPath + ' found ' + (match || []).length +' times. expecting ' + expectedDynamicCounter + ' occurrences');
            if (!res.finalResult[0] || !probeCheck(res.finalResult[0].in) )
                return failure('probe');
          } catch(e) {
            return failure('exception');
          }
          return success();
    })

    function failure(part,reason) { return { id: testId, title: testId + '- ' + part, success:false, reason: reason } };
    function success() { return { id: testId, title: testId, success: true } };

  }
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:31,代码来源:studio-testers.ts

示例9: wrapWithArray

	wrapWithArray(path) {
		var val = profileFromPath(path);
		if (val && !Array.isArray(val)) {
			jb.writeValue(profileRefFromPath(path),[val]);
			return { newPath: path + '~0' }
		}
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:7,代码来源:studio-tgp-model.ts

示例10: makeLocal

	makeLocal(path) {
		var compName = this.compName(path);
		var comp = compName && getComp(compName);
		if (!compName || !comp || typeof comp.impl != 'object') return;
		var res = JSON.stringify(comp.impl, (key, val) => typeof val === 'function' ? ''+val : val , 4);

		var profile = profileFromPath(path);
		// inject conditional param values
		jb_compParams(comp).forEach(p=>{ 
				var pUsage = '%$'+p.id+'%';
				var pVal = '' + (profile[p.id] || p.defaultValue || '');
				res = res.replace(new RegExp('{\\?(.*?)\\?}','g'),(match,condition_exp)=>{ // conditional exp
						if (condition_exp.indexOf(pUsage) != -1)
							return pVal ? condition_exp : '';
						return match;
					});
		});
		// inject param values 
		jb_compParams(comp).forEach(p=>{ 
				var pVal = '' + (profile[p.id] || p.defaultValue || ''); // only primitives
				res = res.replace(new RegExp(`%\\$${p.id}%`,'g') , pVal);
		});

		jb.writeValue(profileRefFromPath(path),evalProfile(res));
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:25,代码来源:studio-tgp-model.ts


注:本文中的jb-core.jb类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。