UNPKG

tfp

Version:

A Web UI framework for TaskBuilder

1 lines 63.2 kB
!function r(i,o,a){function s(n,e){if(!o[n]){if(!i[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(l)return l(n,!0);throw new Error("Cannot find module '"+n+"'")}e=o[n]={exports:{}};i[n][0].call(e.exports,function(e){var t=i[n][1][e];return s(t||e)},e,e.exports,r,i,o,a)}return o[n].exports}for(var l="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,n){t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},t.exports.__esModule=!0,t.exports.default=t.exports},{}],2:[function(e,t,n){function l(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}t.exports=function(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=s.apply(e,a);function i(e){l(r,t,n,i,o,"next",e)}function o(e){l(r,t,n,i,o,"throw",e)}i(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],3:[function(e,t,n){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},{}],4:[function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},t.exports.__esModule=!0,t.exports.default=t.exports},{}],5:[function(e,t,n){var i=e("./superPropBase.js");function r(){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=r=Reflect.get:t.exports=r=function(e,t,n){var r=i(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value},t.exports.__esModule=!0,t.exports.default=t.exports,r.apply(this,arguments)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},{"./superPropBase.js":11}],6:[function(e,t,n){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},{}],7:[function(e,t,n){var r=e("./setPrototypeOf.js");t.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./setPrototypeOf.js":10}],8:[function(e,t,n){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],9:[function(e,t,n){var r=e("./typeof.js").default,i=e("./assertThisInitialized.js");t.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./assertThisInitialized.js":1,"./typeof.js":12}],10:[function(e,n,t){function r(e,t){return n.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n.exports.__esModule=!0,n.exports.default=n.exports,r(e,t)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports},{}],11:[function(e,t,n){var r=e("./getPrototypeOf.js");t.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},t.exports.__esModule=!0,t.exports.default=t.exports},{"./getPrototypeOf.js":6}],12:[function(e,t,n){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},{}],13:[function(e,t,n){t.exports=e("regenerator-runtime")},{"regenerator-runtime":14}],14:[function(e,t,n){t=function(a){"use strict";var l,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i,o,a,s,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),r=new O(r||[]);return t._invoke=(i=e,o=n,a=r,s=p,function(e,t){if(s===f)throw new Error("Generator is already running");if(s===h){if("throw"===e)throw t;return j()}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var r=t.iterator[n.method];if(r===l){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}r=d(r,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,g;r=r.arg;if(!r)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g;{if(!r.done)return r;n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l)}n.delegate=null;return g}(n,a);if(n){if(n===g)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===p)throw s=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;n=d(i,o,a);if("normal"===n.type){if(s=a.done?h:c,n.arg!==g)return{value:n.arg,done:a.done}}else"throw"===n.type&&(s=h,a.method="throw",a.arg=n.arg)}}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var p="suspendedStart",c="suspendedYield",f="executing",h="completed",g={};function m(){}function y(){}function v(){}var t={},b=(o(t,r,function(){return this}),Object.getPrototypeOf),b=b&&b(b(k([]))),w=(b&&b!==e&&u.call(b,r)&&(t=b),v.prototype=m.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function _(a,s){var t;this._invoke=function(n,r){function e(){return new s(function(e,t){!function t(e,n,r,i){var o,e=d(a[e],a,n);if("throw"!==e.type)return(n=(o=e.arg).value)&&"object"==typeof n&&u.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)}):s.resolve(n).then(function(e){o.value=e,r(o)},function(e){return t("throw",e,r,i)});i(e.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function k(t){if(t){var n,e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(u.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=l,e.done=!0,e}).next=e}return{next:j}}function j(){return{value:l,done:!0}}return o(w,"constructor",y.prototype=v),o(v,"constructor",y),y.displayName=o(v,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,o(e,i,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},x(_.prototype),o(_.prototype,n,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new _(s(e,t,n,r),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},x(w),o(w,i,"Generator"),o(w,r,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),a.keys=function(n){var e,r=[];for(e in n)r.push(e);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=k,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return o.type="throw",o.arg=n,r.next=e,t&&(r.method="next",r.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=u.call(i,"catchLoc"),s=u.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&u.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(n=i.completion).type&&(r=n.arg,C(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=l),g}},a}("object"==typeof t?t.exports:{});try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},{}],15:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_inherits2=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisibleComponent=exports.InvisibleComponent=exports.FormInput=exports.ContainerComponent=exports.Component=void 0,_interopRequireDefault(require("@babel/runtime/helpers/inherits"))),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));function _createSuper(n){var r=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return e=r?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,e)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var _parent=Symbol("parent"),Component=function(){function Component(e,t,n,r){if((0,_classCallCheck2.default)(this,Component),!e)throw new Error("请提供tfp对象!");if(!t)throw console.log(n),new Error("请提供组件类型!");if(this._tfp=e,this.level=0,this.index=0,n)this.dataModel=n,this.dataModel.type||(this.dataModel.type=t);else{var i=this._tfp.type(t);if(!i)throw new Error("请提供正确的组件类型!");this.dataModel={type:t},this.dataModel.id=this.dataModel.type.substr(0,1).toLowerCase()+this.dataModel.type.substr(1)+this._tfp.getNewCptIndex(this.dataModel.type);for(var o=this.attrTypes,a=0;a<o.length;a++){var s=o[a];!s.default&&0!=s.default&&0!=s.default||("string"==s.type.toLowerCase()?this.dataModel[s.name]=s.default.replace("{id}",this.id):this.dataModel[s.name]=s.default)}if(i.defaultStyles)for(var l in this.dataModel.styles={},i.defaultStyles)this.dataModel.styles[l]=i.defaultStyles[l]}if(this.dataModel.id||(this.dataModel.id=this.dataModel.type.substr(0,1).toLowerCase()+this.dataModel.type.substr(1)+this._tfp.getNewCptIndex(this.dataModel.type)),(this._tfp.components[this.dataModel.id]=this)._tfp.isRuntime&&(window[this.dataModel.id]=this),r&&(this[_parent]=r,this.level=r.level+1,!this._tfp.isLoadingPage)){r.dataModel.components||(r.dataModel.components=[]);for(var u=!1,d=0;d<r.dataModel.components.length;d++){var p=r.dataModel.components[d];p.id==this.dataModel.id?u=!0:p.index>=this.index&&(this.index=p.index+1)}u||r.dataModel.components.push(this.dataModel)}}return(0,_createClass2.default)(Component,[{key:"id",get:function(){return this.dataModel.id},set:function(e){if(e){var t=this.dataModel.id;if(t!=e){for(var n in this._tfp.components)if(n==e)throw new Error("ID为的"+e+"组件已存在!");this.dataModel.id=e,delete this._tfp.components[t],(this._tfp.components[this.dataModel.id]=this)._tfp.isRuntime&&(delete window[t],window[this.dataModel.id]=this),0<$("#"+t).length&&$("#"+t).attr("id",this.dataModel.id)}}}},{key:"type",get:function(){return this.dataModel.type},set:function(e){}},{key:"metadata",get:function(){return this._tfp.type(this.dataModel.type)},set:function(e){}},{key:"parent",get:function(){return this[_parent]},set:function(e){if(this[_parent]){if(this[_parent].id==e.id)return;this[_parent].dataModel.components.remove(this.dataModel)}this[_parent]=e,this[_parent].dataModel.components||(this[_parent].dataModel.components=[]),this[_parent].dataModel.components.push(this.dataModel),this.level=this[_parent].level+1;for(var t=0;t<this[_parent].dataModel.components.length;t++){var n=this[_parent].dataModel.components[t];n.index>=this.index&&(this.index=n.index+1)}}},{key:"attrTypes",get:function(){var e=[],t=this._tfp.type(this.type);if(t.attrs)for(var n=0;n<t.attrs.length;n++){var r=t.attrs[n];if("group"==r.type||r.items)for(var i=0;i<r.items.length;i++)e.push(r.items[i]);else e.push(r)}return e},set:function(e){}},{key:"attr",value:function(e,t){if(0!=arguments.length)return 1==arguments.length?this[e]:void(this[e]=t)}},{key:"getAttrTypeInfo",value:function(e){if(!this.metadata)throw new Error("没有找到组件类型定义信息,请先引用类型信息!");if(this.metadata.attrs)for(var t=0;t<this.metadata.attrs.length;t++){var n=this.metadata.attrs[t];if("group"==n.type||n.items){for(var r=0;r<n.items.length;r++)if(n.items[r].name==e)return n.items[r]}else if(this.metadata.attrs[t].name==e)return this.metadata.attrs[t]}return null}},{key:"checkAttrOption",value:function(e,t){e=this.getAttrTypeInfo(e);if(e){var n=e.options;if(n)for(var r=0;r<n.length;r++)if(n[r].value==t)return!0}return!1}},{key:"exeEventHandler",value:function exeEventHandler(eventName){if(!this._tfp.isDesigning){var ret;if(this[eventName]&&"function"==typeof this[eventName])ret=this[eventName](arguments);else if(this.dataModel[eventName]){var funcStr=this.dataModel[eventName];if(0<funcStr.indexOf("(")){var funcName=funcStr.substr(0,funcStr.indexOf("("));if("function"==typeof window[funcName]){var args=[];if(1<arguments.length)for(var i=1;i<arguments.length;i++)args.push(arguments[i]);var func=window[funcName],ret=func.apply(window,args)}else ret=eval(funcStr)}else ret=eval(funcStr)}return ret||void 0}}}]),Component}(),InvisibleComponent=(exports.Component=Component,function(){(0,_inherits2.default)(o,Component);var i=_createSuper(o);function o(e,t,n,r){return(0,_classCallCheck2.default)(this,o),i.call(this,e,t,n,r)}return(0,_createClass2.default)(o,[{key:"isInvisible",get:function(){return!0},set:function(e){}},{key:"render",value:function(){this._tfp.isDesigning&&(window.parent.uiDesigner.addInvisibleComponent(this),this._tfp.initCptDesignSetting(this))}}]),o}()),VisibleComponent=(exports.InvisibleComponent=InvisibleComponent,function(){(0,_inherits2.default)(o,Component);var i=_createSuper(o);function o(e,t,n,r){return(0,_classCallCheck2.default)(this,o),(e=i.call(this,e,t,n,r))._jqObj=null,e.el=null,e.isRendered=!1,e}return(0,_createClass2.default)(o,[{key:"isInvisible",get:function(){return!1},set:function(e){}},{key:"isContainer",get:function(){return!1},set:function(e){}},{key:"styles",get:function(){return this.dataModel.styles},set:function(e){}},{key:"style",get:function(){return this.dataModel.style},set:function(e){if(this.dataModel.style=e=e||"",this._jqObj){var t=e.trim();if(""==t||t.endsWith(";")||(t+=";"),this.dataModel.styles)for(var n in this.dataModel.styles)t+=n+": "+this.dataModel.styles[n]+";";e=this._jqObj.css("outline");this._jqObj.attr("style",t),this._jqObj.css("outline",e)}}},{key:"class",get:function(){return this.dataModel.class},set:function(e){this.dataModel.class=e=e||"",this._jqObj&&this._jqObj.attr("class",e)}},{key:"indent",get:function(){for(var e="",t=0;t<this.level;t++)e+="\t";return e},set:function(e){}},{key:"css",value:function(e,t){if(0!=arguments.length){if(1==arguments.length)return this.dataModel.styles?this.dataModel.styles[e]:null;this._jqObj&&this._jqObj.css(e,t),this.dataModel.styles||(this.dataModel.styles={}),""==t||null==t?delete this.dataModel.styles[e]:this.dataModel.styles[e]=t}}},{key:"val",value:function(e){if(0==arguments.length)return this.value;this.value=e}},{key:"show",value:function(){this._jqObj&&this._jqObj.show()}},{key:"hide",value:function(){this._jqObj&&this._jqObj.hide()}},{key:"toggle",value:function(){this._jqObj&&this._jqObj.toggle()}},{key:"focus",value:function(){this._jqObj&&this._jqObj.focus()}},{key:"getHtmlIndent",value:function(){if(this.indent)return this.indent;for(var e="",t=0;t<this.level;t++)e+="\t";return e}},{key:"render",value:function(){if(this.parent&&this.parent.containerEl||"Page"==this.type){var e=new this._tfp.renders[this.type](this._tfp,this.dataModel,this.level);if("Page"==this.type?(this.dataModel.pageElId&&this._tfp.isRuntime?this._jqObj=$("#"+this.dataModel.pageElId):this._jqObj=$("body"),this._jqObj.append(e.getHtml()),this._tfp.curPage=this):($(this.parent.containerEl).append(e.getHtml()),this._jqObj=$("#"+this.id)),0<this._jqObj.length&&(this.el=this._jqObj.get(0)),!this.isRendered&&this._tfp.isDesigning&&this._tfp.initCptDesignSetting(this),"undefined"==typeof window||this._tfp.isDesigning||(window[this.id]=this),this.dataModel.components)for(var t=0;t<this.dataModel.components.length;t++){var n=this.dataModel.components[t];this._tfp.render(n,this)}this.initDesigning&&this.initDesigning(),this.isRendered=!0}}},{key:"clear",value:function(){if(this.dataModel.components)for(var e=0;e<this.dataModel.components.length;e++){var t=this.dataModel.components[e],t=this._tfp.get(t.id);t.clear(),t._jqObj&&t._jqObj.remove(),delete this._tfp.components[t.id]}}}]),o}()),ContainerComponent=(exports.VisibleComponent=VisibleComponent,function(){(0,_inherits2.default)(o,VisibleComponent);var i=_createSuper(o);function o(e,t,n,r){return(0,_classCallCheck2.default)(this,o),(e=i.call(this,e,t,n,r)).dataModel.components||(e.dataModel.components=[]),e}return(0,_createClass2.default)(o,[{key:"isContainer",get:function(){return!0},set:function(e){}},{key:"containerEl",get:function(){return this.el},set:function(e){this.el=e}},{key:"components",get:function(){return this.dataModel.components},set:function(e){}},{key:"addChild",value:function(e){e.parent=this}},{key:"removeChild",value:function(e){for(var t=0;t<this.dataModel.components.length;t++){var n=this.dataModel.components[t];if(n.id==e)return(n=this._tfp.components[n.id]).clear(),n._jqObj&&n._jqObj.remove(),this._tfp.isRuntime&&(delete this._tfp.components[n.id],delete window[n.id]),void(n=null)}}},{key:"clearChildren",value:function(){for(var e=0;e<this.dataModel.components.length;e++){var t=this.dataModel.components[e],t=this._tfp.components[t.id];t.clear(),t._jqObj&&t._jqObj.remove(),delete this._tfp.components[t.id],this._tfp.isRuntime&&delete window[t.id],t=null}this.dataModel.components=[]}}]),o}()),FormInput=(exports.ContainerComponent=ContainerComponent,function(_VisibleComponent2){(0,_inherits2.default)(FormInput,_VisibleComponent2);var _super4=_createSuper(FormInput);function FormInput(e,t,n,r){return(0,_classCallCheck2.default)(this,FormInput),_super4.call(this,e,t,n,r)}return(0,_createClass2.default)(FormInput,[{key:"isFormInput",get:function(){return!0}},{key:"comment",get:function(){return this.dataModel.comment},set:function(e){this.dataModel.comment=e}},{key:"dataBindingFormat",get:function(){return this.dataModel.dataBindingFormat},set:function(e){this.dataModel.dataBindingFormat=e}},{key:"required",get:function(){return this.dataModel.required},set:function(e){this.dataModel.required=!!e}},{key:"readonly",get:function(){return this.dataModel.readonly},set:function(e){this.dataModel.readonly=!!e,this.dataModel.readonly||delete this.dataModel.readonly,this._jqObj&&0<this._jqObj.length&&!this._tfp.isDesigning&&("INPUT"==(e=this._jqObj.get(0)).tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName?e.readOnly=this.dataModel.readonly:"DIV"==e.tagName&&this._jqObj.find("input").each(function(){$(this).get(0).readOnly=this.dataModel.readonly}))}},{key:"disabled",get:function(){return this.dataModel.disabled},set:function(e){this.dataModel.disabled=!!e,this.dataModel.disabled||delete this.dataModel.disabled,this._jqObj&&0<this._jqObj.length&&!this._tfp.isDesigning&&("INPUT"==(e=this._jqObj.get(0)).tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName?e.disabled=this.dataModel.disabled:"DIV"==e.tagName&&this._jqObj.find("input").each(function(){$(this).get(0).disabled=this.dataModel.disabled}))}},{key:"formula",get:function(){return this.dataModel.formula},set:function(e){isNull(e)?delete this.dataModel.formula:this.dataModel.formula=e}},{key:"valueOnChange",value:function(){this._tfp.iptValueOnChange(this)}},{key:"exeFormula",value:function exeFormula(){if(this.dataModel.formula){for(var val=this.dataModel.formula,ipts=this.dataModel.formula.match(/\$\{[\w]+\}/g),i=0;i<ipts.length;i++){var iptId=ipts[i].substr(2,ipts[i].length-3),ipt=this._tfp.components[iptId],iptVal;ipt&&(iptVal=ipt.value,"Text"==ipt.type&&isNull(iptVal)?iptVal="0":"DataSet"==ipt.type&&(iptVal=ipt.id),val=val.replaceAll("${"+iptId+"}",iptVal))}try{this.value=eval(val)}catch(err){console.error("执行计算表达式出错:"+err.message)}}}},{key:"setOptions",value:function(e){if(e){var t=[];if("string"==typeof e)for(var n=e.split(","),r=0;r<n.length;r++){var i=n[r];""!=i.trim()&&t.push({value:i,text:i})}else if(Array.isArray(e))for(r=0;r<e.length;r++){var o=e[r];"[object Object]"===Object.prototype.toString.call(o)?t.push(o):t.push({value:o,text:o})}this.dataModel.options=t}}}]),FormInput}(VisibleComponent));exports.FormInput=FormInput},{"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],16:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_classCallCheck2=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"))),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_get2=_interopRequireDefault(require("@babel/runtime/helpers/get")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_controller=require("../controller.js");function _createSuper(n){var r=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return e=r?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,e)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var Page=function(_ContainerComponent){(0,_inherits2.default)(Page,_ContainerComponent);var _super=_createSuper(Page);function Page(e,t){var n;if((0,_classCallCheck2.default)(this,Page),n=_super.call(this,e,"Page",t),e.isRuntime&&"mini"!=t.client&&(t.pageElId?n._jqObj=$("#"+t.pageElId):n._jqObj=$("body"),n.el=n._jqObj.get(0),n.dataModel.title&&$("title").text(n.dataModel.title),n.dataModel.styles))for(var r in n.dataModel.styles)n._jqObj.css(r,n.dataModel.styles[r]);return n}return(0,_createClass2.default)(Page,[{key:"client",get:function(){return this.dataModel.client}},{key:"positionType",get:function(){return this.dataModel.positionType}},{key:"framework",get:function(){return this.dataModel.framework}},{key:"pageType",get:function(){return this.dataModel.pageType}},{key:"cssFiles",get:function(){return this.dataModel.cssFiles},set:function(e){this.dataModel.cssFiles=e}},{key:"jsFiles",get:function(){return this.dataModel.jsFiles},set:function(e){this.dataModel.jsFiles=e}},{key:"styleSheets",get:function(){return this.dataModel.styleSheets},set:function(e){this.dataModel.styleSheets=e}},{key:"title",get:function(){return this.dataModel.title},set:function(e){this.dataModel.title=e,$("title").text(e),this._tfp.isDesigning&&("phone"==this.client||"mini"==this.client?window.parent.$("#uiDesignerPageTitle").html(e):"dialog"==this.pageType&&window.parent.$("#uiDesignerPageTitle").html("&nbsp;&nbsp;"+e))}},{key:"bgColorMode",get:function(){return this.dataModel.bgColorMode},set:function(e){this.dataModel.bgColorMode=e}},{key:"contentColorMode",get:function(){return"dark"==this.dataModel.bgColorMode?"light":"dark"},set:function(e){}},{key:"width",get:function(){return"dialog"==this.dataModel.pageType?this.dataModel.width:null},set:function(e){e&&"dialog"==this.dataModel.pageType&&((e=(this.dataModel.width=e)+"").indexOf("px")<0&&e.indexOf("%")<0&&(e+="px"),this._tfp.isDesigning?"dialog"==this.pageType&&(window.parent.$("#uiDesignerFrame").css("width",e),window.parent.$("#uiDesignerFrame").find("iframe").css("width",e)):this._tfp.isRuntime)}},{key:"height",get:function(){return"dialog"==this.dataModel.pageType?this.dataModel.height:null},set:function(e){e&&"dialog"==this.dataModel.pageType&&((e=(this.dataModel.height=e)+"").indexOf("px")<0&&e.indexOf("%")<0&&(e+="px"),this._tfp.isDesigning?"dialog"==this.pageType&&(window.parent.$("#uiDesignerFrame").css("height",e),window.parent.$("#uiDesignerFrame").find("iframe").css("height",parseInt(e.replace("px",""))-31+"px")):this._tfp.isRuntime)}},{key:"render",value:function(){if((0,_get2.default)((0,_getPrototypeOf2.default)(Page.prototype),"render",this).call(this),this._tfp.isDesigning){if(this.dataModel.style&&$("body").attr("style",this.dataModel.style),this.dataModel.styles)for(var e in this.dataModel.styles)$("body").css(e,this.dataModel.styles[e]);if(this.dataModel.class&&$("body").attr("class",this.dataModel.class),this.dataModel.styleSheets){for(var t="",n=0;n<this.dataModel.styleSheets.length;n++){var r=this.dataModel.styleSheets[n];t+="\t"+r.id+" {";for(var i=0;i<r.styles.length;i++){var o=r.styles[i];t+=o.name+": "+o.value+";"}t+="}\r\n"}$("head").append('<style id="_tfpPageStyleSetting">\r\n'+t+"</style>")}if(this.dataModel.cssFiles)for(n=0;n<this.dataModel.cssFiles.length;n++){var a=this.dataModel.cssFiles[n];$("head").append('<link rel="stylesheet" type="text/css" href="'+a+'">')}}}},{key:"initRuntime",value:function initRuntime(){this.dataModel.onLoad&&eval(this.dataModel.onLoad)}}]),Page}(_controller.ContainerComponent);exports.default=Page},{"../controller.js":15,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/get":5,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={name:"Page",comment:"页面",attrs:[{name:"common",comment:"页面信息",type:"group",items:[{name:"client",comment:"终端类型",type:"Select",readonly:!0,options:[{value:"pc",text:"电脑端"},{value:"phone",text:"手机端"}]},{name:"positionType",comment:"组件默认定位方式",type:"Select",readonly:!0,options:[{value:"float",text:"浮动定位"},{value:"absolute",text:"绝对定位"}]},{name:"framework",comment:"前端UI框架",type:"String",readonly:!0},{name:"pageType",comment:"页面类型",type:"Select",readonly:!0,options:[{value:"page",text:"普通页面"},{value:"dialog",text:"弹出窗口"}]},{name:"title",comment:"标题",type:"String"},{name:"bgColorMode",comment:"页面背景颜色模式",type:"Select",options:[{value:"light",text:"浅色背景"},{value:"dark",text:"深色背景"}],default:"light"}]},{name:"dialog",comment:"对话框属性",type:"group",hidden:"'{pageType}'=='page'",items:[{name:"width",comment:"宽度",type:"String"},{name:"height",comment:"高度",type:"String"}]}],styles:["font","background","margin","border"],events:[{name:"onLoad",comment:"页面加载时"},{name:"onClick",comment:"点击页面时"}]}},{}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={name:"Page",comment:"页面",attrs:[{name:"common",comment:"页面信息",type:"group",items:[{name:"client",comment:"终端类型",type:"Select",readonly:!0,options:[{value:"pc",text:"电脑端"},{value:"phone",text:"手机端"}]},{name:"positionType",comment:"组件默认定位方式",type:"Select",readonly:!0,options:[{value:"float",text:"浮动定位"},{value:"absolute",text:"绝对定位"}]},{name:"framework",comment:"前端UI框架",type:"String",readonly:!0},{name:"pageType",comment:"页面类型",type:"Select",readonly:!0,options:[{value:"page",text:"普通页面"},{value:"dialog",text:"弹出窗口"}]},{name:"title",comment:"标题",type:"String"},{name:"bgColorMode",comment:"页面背景颜色模式",type:"Select",options:[{value:"light",text:"浅色背景"},{value:"dark",text:"深色背景"}],default:"light"}]},{name:"dialog",comment:"对话框属性",type:"group",hidden:"'{pageType}'=='page'",items:[{name:"width",comment:"宽度",type:"String"},{name:"height",comment:"高度",type:"String"}]}],styles:["font","background","margin","border"],events:[{name:"onLoad",args:[{name:"cb"}],eventArgs:"",comment:"页面加载时"},{name:"onShow",eventArgs:"",comment:"页面显示时"},{name:"onRefresh",eventArgs:"",comment:"页面刷新时"}]}},{}],19:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault"),o=(Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,r(e("@babel/runtime/helpers/classCallCheck"))),a=r(e("@babel/runtime/helpers/createClass")),s=r(e("@babel/runtime/helpers/inherits")),i=r(e("@babel/runtime/helpers/possibleConstructorReturn")),l=r(e("@babel/runtime/helpers/getPrototypeOf"));function u(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=(0,l.default)(n);return e=r?(e=(0,l.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,i.default)(this,e)}}r=function(e){(0,s.default)(i,e);var r=u(i);function i(e,t,n){return(0,o.default)(this,i),r.call(this,e,t,n)}return(0,a.default)(i,[{key:"getHtml",value:function(e){return e?this.getComponentsHtml(e):""}},{key:"getWX",value:function(e){return e?this.getComponentsWX(e):""}}]),i}(r(e("../render.js")).default);n.default=r},{"../render.js":20,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],20:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault"),i=(Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,r(e("@babel/runtime/helpers/classCallCheck"))),o=r(e("@babel/runtime/helpers/createClass")),r=function(){function r(e,t,n){if((0,i.default)(this,r),!e)throw new Error("请提供tfp对象!");if(!t)throw new Error("请提供组件数据模型!");this._tfp=e,this.dataModel=t,this.metadata=this._tfp.type(this.dataModel.type),this.level=0,n&&(this.level=n)}return(0,o.default)(r,[{key:"cpt",get:function(){return this._tfp.components[this.dataModel.id]}},{key:"isContainer",get:function(){return this._tfp.components[this.dataModel.id].isContainer}},{key:"getHtmlIndent",value:function(){return this.cpt.getHtmlIndent()}},{key:"getAttrHtml",value:function(e){for(var t="",n=this.metadata.attrs,r=[],i=0;i<n.length;i++){var o=n[i];if("group"==o.type)for(var a=0;a<o.items.length;a++)r.push(o.items[a]);else r.push(o)}for(var s=0;s<r.length;s++){var l,u=r[s];(u.isHtmlAttr||u.attrName)&&u.name in this.dataModel&&(l=this.dataModel[u.name])&&0!=l&&"false"!=l&&(u.special&&this.getCustomAttrHtml?t+=this.getCustomAttrHtml(u.name):"string"==typeof l&&(0<=l.indexOf("{")&&0<l.indexOf("}")||0<=l.indexOf("#[")&&0<l.indexOf("]"))&&!(this._tfp.isDesigning&&"value"==u.name||e)||this._tfp.isDesigning&&"disabled"==u.name||("disabled"==u.name||"readonly"==u.name?(t+=" "+u.name,0!=l&&"false"!=l||(t+='="false"')):(l=this.dataModel[u.name],u.attrName?t+=" "+u.attrName.toLowerCase()+'="'+l+'"':t+=" "+u.name.toLowerCase()+'="'+l+'"')))}if(!this._tfp.isDesigning&&this.metadata.events)for(var d=0;d<this.metadata.events.length;d++){var p=this.metadata.events[d];if(!p.isNotHtmlEvent&&("onchange"!=p.name.toLowerCase()&&("Page"!=this.cpt.type||"onload"!=p.name.toLowerCase())))for(var c in this.dataModel)if(p.name.toLowerCase()==c.toLowerCase()){c=this.dataModel[c];if(e||!(0<=c.indexOf("{")&&0<c.indexOf("}")||0<=c.indexOf("#[")&&0<c.indexOf("]"))){""!=p.eventArgs&&(c.indexOf("(")<0||c.indexOf(")")<0)&&(c+="()"),t+=" "+p.name.toLowerCase()+'="'+c+'"';break}}}return t}},{key:"getStyleHtml",value:function(e,t){var n="";if(this.dataModel.styles)for(var r in this.dataModel.styles)n+=" "+r+":"+this.dataModel.styles[r]+";";return this.dataModel.style&&!(0<=this.dataModel.style.indexOf("{")&&0<this.dataModel.style.indexOf("}")||0<=this.dataModel.style.indexOf("#[")&&0<this.dataModel.style.indexOf("]"))&&(n+=this.dataModel.style),this.getCustomStyleHtml&&(n+=this.getCustomStyleHtml()),this._tfp.isDesigning&&(n+="user-select:none;",this.isContainer||this.dataModel.components)&&n.indexOf("border:")<0&&n.indexOf("border-width:")<0&&(n+="outline:#cccccc dashed 1px;"),n=e?n:this._tfp.isDesigning||t?' style="'+n+' "':""}},{key:"getComponentsHtml",value:function(e,t,n){var r="";t=t||"";for(var i=0;i<this.dataModel.components.length;i++){var o=this.dataModel.components[i],a=this._tfp.renders[o.type];a&&(r+=new a(this._tfp,o,this.level+1).getHtml(e,t,n))}return r}},{key:"getHtml",value:function(e,t,n,r){var i;return e?(i=this.getHtmlIndent(),n&&(this.indent=i=n+"\t"),n=i+"<"+e+' id="'+this.dataModel.id+'" class="',"mini"!=this._tfp.curPage.dataModel.client?(n+="tfp-"+this.dataModel.type.toLowerCase().replace("_","-"),this.getSpecialClass&&(n+=this.getSpecialClass())):n+="w-"+this.dataModel.id+" wx-"+this.dataModel.type.toLowerCase().replace("_","-"),this.dataModel.class&&!(0<=this.dataModel.class.indexOf("{")&&0<this.dataModel.class.indexOf("}")||0<=this.dataModel.class.indexOf("#[")&&0<this.dataModel.class.indexOf("]"))&&(n+=" "+this.dataModel.class),n=(n+='"')+(this.getAttrHtml(r)+this.getStyleHtml(!1,r)),this.getBodyHtml?n=(n+=">")+this.getBodyHtml(t,r)+"</"+e+">\r\n":this.isContainer||this.dataModel.components?(n+=">\r\n",t&&this.dataModel.components&&(n+=this.getComponentsHtml(t,i,r)),n+=i+"</"+e+">\r\n"):n+="/>\r\n",n):""}},{key:"getComponentsWX",value:function(e,t,n,r){var i={wxjson:"",wxjs:"",wxml:"",wxss:""};if(t=t||"",this.dataModel.components)for(var o=0;o<this.dataModel.components.length;o++){var a=this.dataModel.components[o],s=this._tfp.renders[a.type];s&&(s=new s(this._tfp,a,this.level+1).getWX(e,t,n,r),i.wxjson+=s.wxjson,i.wxjs+=s.wxjs,i.wxml+=s.wxml,i.wxss+=s.wxss)}return i}},{key:"getWX",value:function(e,t,n,r,i){var o,a;return e?(o=this.getHtmlIndent(),n&&(this.indent=o=n+"\t"),(n={wxjson:"",wxjs:"",wxml:"",wxss:""}).wxml+=o+"<"+e,i&&i.gridContainer?n.wxml+=' id="'+this.dataModel.id+'_{{index}}"':n.wxml+=' id="'+this.dataModel.id+'"',n.wxml+=' class="',n.wxml+="w-"+this.dataModel.id+" ","mini"!=this._tfp.curPage.dataModel.client?(n.wxml+="tfp-"+this.dataModel.type.toLowerCase().replace("_","-"),this.getSpecialClass&&(n.wxml+=this.getSpecialClass())):n.wxml+="wx-"+this.dataModel.type.toLowerCase().replace("_","-"),this.dataModel.class&&!(0<=this.dataModel.class.indexOf("{")&&0<this.dataModel.class.indexOf("}")||0<=this.dataModel.class.indexOf("#[")&&0<this.dataModel.class.indexOf("]"))&&(n.wxml+=" "+this.dataModel.class),n.wxml+='"',n.wxml+=this.getAttrHtml(r,i)+this.getStyleHtml(!1,r,i),this.getBodyWX?(n.wxml+=">",a=this.getBodyWX(t,r,i),n.wxml+=a.wxml,n.wxml+="</"+e+">\r\n",n.wxjs+=a.wxjs):this.isContainer||this.dataModel.components?(n.wxml+=">\r\n",t&&this.dataModel.components&&(a=this.getComponentsWX(t,o,r,i),n.wxml+=a.wxml,n.wxjs+=a.wxjs),n.wxml+=o,n.wxml+="</"+e+">\r\n"):n.wxml+="/>\r\n",n):""}}]),r}();n.default=r},{"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/interopRequireDefault":8}],21:[function(e,t,n){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault"),i=(Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,r(e("./tfp.js"))),o=r(e("./components/page/metadata.js")),a=r(e("./components/page/metadata.mini.js")),s=r(e("./components/page/controller.js")),r=r(e("./components/page/render.js")),e=new i.default;0<=parent.location.search.indexOf("?path=/mini")?e.metaDatas.Page=a.default:e.metaDatas.Page=o.default,e.controllers.Page=s.default,e.renders.Page=r.default,"undefined"!=typeof window&&((window.tfp=e).extendSysObj(),e.isDesigning)&&(e.rootPath="../tfp"),n.default=e},{"./components/page/controller.js":16,"./components/page/metadata.js":17,"./components/page/metadata.mini.js":18,"./components/page/render.js":19,"./tfp.js":22,"@babel/runtime/helpers/interopRequireDefault":8}],22:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof3=require("@babel/runtime/helpers/typeof"),_regenerator=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,_interopRequireDefault(require("@babel/runtime/regenerator"))),_typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));function _getRequireWildcardCache(e){var t,n;return"function"!=typeof WeakMap?null:(t=new WeakMap,n=new WeakMap,(_getRequireWildcardCache=function(e){return e?n:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof3(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,r,i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((r=o?Object.getOwnPropertyDescriptor(e,n):null)&&(r.get||r.set)?Object.defineProperty(i,n,r):i[n]=e[n]);return i.default=e,t&&t.set(e,i),i}function importJsFile(r){return new Promise(function(e,t){var n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=function(){"loaded"!=n.readyState&&"complete"!=n.readyState||(n.onreadystatechange=null,e())}:n.onload=function(){e()},n.src=r,document.body.appendChild(n)})}function importModules(e,t){_importModules.apply(this,arguments)}function _importModules(){return(_importModules=(0,_asyncToGenerator2.default)(_regenerator.default.mark(function e(t,n){var r,i,o;return _regenerator.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=[],"string"==typeof(r=t)&&(r=[r]),o=0;case 4:if(o<r.length)return e.t0=i,e.next=8,Promise.resolve("".concat(r[o])).then(function(e){return _interopRequireWildcard(require(e))});e.next=13;break;case 8:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 10:o++,e.next=4;break;case 13:n&&n(i);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}function getNeedImportCptType(e,t,n){var r=e.metaDatas[t];if(r){var i=[];if(r.dependencies&&("string"==typeof r.dependencies?i.push(r.dependencies):Array.isArray(r.dependencies)&&i.push.apply(i,r.dependencies)),0<i.length)for(var o=0;o<i.length;o++)getNeedImportCptType(e,i[o],n);n.includes(t)||n.push(t)}}function importCptFiles(e,t,n,r){_importCptFiles.apply(this,arguments)}function _importCptFiles(){return(_importCptFiles=(0,_asyncToGenerator2.default)(_regenerator.default.mark(function e(t,n,r,i){var o,a,s,l,u,d,p,c,f,h,g,m,y,v,b,w,x,_,M,C;return _regenerator.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(o=[],a=0;a<r.length;a++)getNeedImportCptType(t,r[a],o);s=0;case 3:if(!(s<o.length)){e.next=80;break}if(l=o[s],u=t.metaDatas[l]){e.next=8;break}return e.abrupt("continue",77);case 8:if(m="./components/"+l.toLowerCase()+"/metadata",d="./components/"+l.toLowerCase()+"/controller",p="./components/"+l.toLowerCase()+"/render","tb"==(c=n.client)&&(c="pc"),u.matchAllClient||(m+="."+c,d+="."+c,p+="."+c),m+=".js",d+=".js",p+=".js",u.isLoaded){e.next=31;break}return f=u.matchAllClient,h=u.isInvisible,g=null,u.dependencies&&(g=u.dependencies),e.next=24,Promise.resolve("".concat(m)).then(function(e){return _interopRequireWildcard(require(e))});case 24:m=e.sent,(u=m.default).isLoaded=!0,f&&(u.matchAllClient=f),h&&(u.isInvisible=h),g&&(u.dependencies=g),t.metaDatas[l]=u;case 31:if(t.controllers[l]){e.next=36;break}return e.next=34,Promise.resolve("".concat(d)).then(function(e){return _interopRequireWildcard(require(e))});case 34:y=e.sent,t.controllers[l]=y.default;case 36:if(t.renders[l]){e.next=41;break}return e.next=39,Promise.resolve("".concat(p)).then(function(e){return _interopRequireWildcard(require(e))});case 39:y=e.sent,t.renders[l]=y.default;case 41:if("undefined"==typeof window){e.next=77;break}t.rootPath,v=[],u.cssFiles&&("string"==typeof u.cssFiles?v=[u.cssFiles]:Array.isArray(u.cssFiles)&&(v=u.cssFiles)),b="light","dark"==n.bgColorMode&&(b="dark"),w=0;case 48:if(w<v.length)if((x=v[w]).onlyRuntime){if(t.isDesigning)return e.abrupt("continue",58);e.next=53}else e.next=54;else e.next=61;break;case 53:x=x.src;case 54:x=(x=x.replace("{client}",c)).replace("{bgColorMode}",b),x=t.getCptIncludeFile(x,l),0==$("link[href='"+x+"']").length&&(x.endsWith(".less")?$("head").append('<link href="'+x+'" rel="stylesheet/less" type="text/css" />'):$("head").append('<link href="'+x+'" rel="stylesheet" type="text/css" />'));case 58:w++,e.next=48;break;case 61:_=[],u.jsFiles&&("string"==typeof u.jsFiles?_=[u.jsFiles]:Array.isArray(u.jsFiles)&&(_=u.jsFiles)),M=0;case 64:if(M<_.length)if((C=_[M]).onlyRuntime){if(t.isDesigning)return e.abrupt("continue",74);e.next=69}else e.next=70;else e.next=77;break;case 69:C=C.src;case 70:if(C=t.getCptIncludeFile(C,l),0==$("script[src='"+C+"']").length)return e.next=74,importJsFile(C);e.next=74;break;case 74:M++,e.next=64;break;case 77:s++,e.next=3;break;case 80:i&&i();case 81:case"end":return e.stop()}},e)}))).apply(this,arguments)}var TaskFrontPage=function(){function TaskFrontPage(){(0,_classCallCheck2.default)(this,TaskFrontPage),this.metaDatas={},this.controllers={},this.renders={},this.curPage=null,this.components={},this.cbOpenDialog=null,this.rootPath="/node_modules/tfp"}return(0,_createClass2.default)(TaskFrontPage,[{key:"extendSysObj",value:function(){void 0===String.prototype.startsWith&&(String.prototype.startWith=String.prototype.startsWith=function(e){return 0===this.indexOf(e)}),void 0===String.prototype.endsWith&&(String.prototype.endWith=String.prototype.endsWith=function(e){return this.match(e+"$")==e}),void 0===String.prototype.replaceAll&&(String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"gm"),t)}),void 0===String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}),void 0===String.prototype.toDate&&(String.prototype.toDate=function(){return new Date(this.replace(/-/g,"/"))}),String.prototype.gblen=function(){for(var e=0,t=0;t<this.length;t++)127<this.charCodeAt(t)||94==this.charCodeAt(t)?e+=2:e++;return e},void 0===Date.prototype.format&&(Date.prototype.format=function(e){var t=this.getFullYear(),n=(n="0"+(this.getMonth()+1)).substring(n.length-2),r=(r="0"+this.getDate()).substring(r.length-2),i=(i="0"+this.getHours()).substring(i.length-2),o=(12<=(o=this.getHours())&&(o-=12),(o="0"+o).substring(o.length-2)),a=(a="0"+this.getMinutes()).substring(a.length-2),s=(s="0"+this.getSeconds()).substring(s.length-2),l=(l="00"+this.getMilliseconds()).substring(l.length-3),e=(e+"").replaceAll("yyyy",t);return e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll("yy",(t+"").substring(2))).replaceAll("MM",n)).replaceAll("dd",r)).replaceAll("HH",i)).replaceAll("hh",o)).replaceAll("mm",a)).replaceAll("ss",s)).replaceAll("SSS",l)}),void 0===Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return this.format("yyyy-MM-dd HH:mm:ss")}),void 0===Array.prototype.remove&&(Array.prototype.remove=function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return void this.splice(t,1)}),void 0===Array.prototype.contains&&(Array.prototype.contains=function(e){for(var t=this.length;t--;)if(this[t]===e)return!0;return!1}),void 0===window.isNull&&(window.isNull=function(e){return null==e||"string"==typeof e&&""==e.trim()}),void 0===window.isInt&&(window.isInt=function(e){return e==parseInt(e)}),void 0===window.isObj&&(window.isObj=function(e){return"[object Object]"===Object.prototype.toString.call(e)})}},{key:"isDesigning",get:function(){var e=!1;try{e=window.parent&&void 0!==window.parent.uiDesigner}catch(e){}return"undefined"!=typeof window&&e}},{key:"isRuntime",get:function(){return"undefined"!=typeof window&&!this.isDesigning}},{key:"isNull",value:function(e){return null==e||"string"==typeof e&&""==e.trim()}},{key:"isInt",value:function(e){return e==parseInt(e)}},{key:"isMobile",value:function(){return/Android|webOS|iPhone|iPad|Windows Phone|iPod|BlackBerry|SymbianOS|Nokia|Mobile/i.test(navigator.userAgent)}},{key:"prefixInteger",value:function(e,t){return(Array(t).join(0)+e).slice(-t)}},{key:"formatMoney",value:function(e,t,n){if(t=0<t&&t<=20?t:2,e=parseFloat((e+"").replace(/[^\d\.-]/g,"")).toFixed(t)+"",!n)return e;for(var r=e.split(".")[0].split("").reverse(),t=e.split(".")[1],n="",i=0;i<r.length;i++)n+=r[i]+((i+1)%3==0&&i+1!=r.length?",":"");return n.split("").reverse().join("")+"."+t}},{key:"formatDecimal",value:function(e,t,n){if(!e&&0!=e)return e;e=parseFloat(e);if(n||0==n){n=parseInt(n);if(0==n)return parseInt(e);"trunc"==t?e=Math.trunc(e):"toFixed"==t?e=e.toFixed(n):"toPrecision"==t?e=e.toPrecision(n):"ceil"==t?e=Math.ceil(e):"floor"==t?e=Math.floor(e):"abs"==t?e=Math.abs(e):"round"==t&&(e*=t=Math.pow(10,n),e=Math.round(e),e=(e/=t).toFixed(n))}return e}},{key:"formatDate",value:function(e,t){return("number"==typeof e?new Date(e):new Date(Date.parse(e.replace("T"," ").replace("+08:00"," ").replace(/-/g,"/")))).format(t)}},{key:"formatFileSize",value:function(e){var t;return 0===e?"0 B":(t=Math.floor(Math.log(e)/Math.log(1e3)),(e/Math.pow(1e3,t)).toPrecision(3)+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t])}},{key:"formatPx",value:function(e){return this.isNull(e)?"":(e+"").indexOf("px")<0?e+"px":e}},{key:"getPixel",value:function(e){return this.getPx(e)}},{key:"getPx",value:function(e){return this.isNull(e)?0:parseInt(new String(e+"").replace("px",""))}},{key:"rgbToHex",value:function(e){e=e.split(",");return"#"+((1<<24)+65536*+e[0].split("(")[1]+256*+e[1]+ +e[2].split(")")[0]).toString(16).slice(1)}},{key:"getUrlArgs",value:function(e){var t={},n=e.indexOf("?");if(!(n<0))for(var r=e.substr(n+1).split("&"),i=0;i<r.length;i++){var o=r[i].substr(0,r[i].indexOf("=")),a=r[i].substr(r[i].indexOf("=")+1);t[o]=a}return t}},{key:"getUrlArg",value:function(e){var t=window.location.href,n=t.indexOf("?");if(!(n<0))for(var r=t.substr(n+1).split("&"),i=0;i<r.length;i++)if(r[i].substr(0,r[i].indexOf("="))==e)return decodeURIComponent(r[i].substr(r[i].indexOf("=")+1));return null}},{key:"replaceDataField",value:function(e,t){if(!e||!t&&0!=t)return"";var n,r={};for(n in e)r[n.toLowerCase()]=e[n];for(var i=new RegExp("{([\\w|.|\\u4E00-\\u9FA5]*)}","ig"),o=i.exec(t);null!=o;){var a=o[0],s=a=a.substring(1,a.length-1),l="",u=(0<a.indexOf(",")&&(l=a.substr(a.indexOf(",")+1),s=a.substr(0,a.indexOf(","))),r[s=s.replace(/ /g,"").toLowerCase()]);if(u||0==u)if("object"==(0,_typeof2.default)(u)){if(t=="{"+s+"}")return u;t=t.replace("{"+a+"}",JSON.stringify(u))}else t="datetime"==l?t.replace("{"+a+"}",new Date(u).format("yyyy-MM-dd HH:mm:ss")):"date"==l?t.replace("{"+a+"}",new Date(u).format("yyyy-MM-dd")):"time"==l?t.replace("{"+a+"}",new Date(u).format("HH:mm:ss")):(0<=l.indexOf('"')||0<=l.ind