@oinone/kunlun-vue-widget 6.3.8 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{instantiate as e,uniqueKeyGenerator as t,StringHelper as i,CastHelper as o,BooleanHelper as n}from"@oinone/kunlun-shared";import{BehaviorSubject as r,Subject as s}from"@oinone/kunlun-state";import{translateValueByKey as d,genStaticPath as a,RuntimeContextManager as c,ComputeContextManager as l,ROOT_HANDLE as u,ActiveRecordsOperator as p,ViewVM as h}from"@oinone/kunlun-engine";import{defineComponent as g,createVNode as v,Fragment as y,effectScope as f,computed as m,ref as W,watch as R,isRef as b,toRaw as D,nextTick as C,h as S,Suspense as A,withCtx as M,resolveDynamicComponent as O,inject as j,onBeforeMount as P,onMounted as $,onUnmounted as w,provide as N}from"vue";import{isNil as E,isBoolean as I,isString as V,intersection as H,isFunction as _}from"lodash-es";import{XMLTemplateParser as x,DEFAULT_SLOT_NAME as B,DslDefinitionHelper as k,DslSlotUtils as U,DslDefinitionType as F,UnknownDslDefinition as T}from"@oinone/kunlun-dsl";import{getMergeConfig as z}from"@oinone/kunlun-config";import{PropRecordHelper as L,StableSlotProp as G}from"@oinone/kunlun-vue-ui-common";import{isDev as K,useMatched as Q}from"@oinone/kunlun-router";import{InjectionToken as Z,SPI as q}from"@oinone/kunlun-spi";import{LifeCycleTypes as J}from"@oinone/kunlun-event";import{createViewElement as X}from"@oinone/kunlun-meta";class Widget{constructor(e){this.subscriptionMap=new Map,this.childrenInstance=[],this.children=[],this.childrenWidget=[],this.config={},this.initialized=!1,this.parent=null,this.childrenInstance=[],this.handle=e||Widget.createHandle(this.constructor.name),this.name="default",this.self=this}static createHandle(e=""){return`${e||"oio-widget"}-${this.widgetCount++}`}static Attribute(e){return(t,i,o)=>{const n=t.constructor,r=this.attributeMap.get(n)||new Map;r.set(e&&e.displayName||i,i),this.attributeMap.set(n,r),o&&o.get&&(t[`$compute$${i}`]={get:o.get,set:o.set});const s=n.prototype.$$props||[];e&&!1===e.render||s.push(e&&e.displayName||i),t.$$props=s}}static Watch(e,t){return(i,o,n)=>{const r=i.constructor,s=Widget.watchMap.get(r)||[];s.push({path:e,handler:n.value,options:t}),Widget.watchMap.set(r,s)}}static Sub(e,t,i){return(o,n)=>{const r=this.nameContextMap.get(e);if(r)r&&!r.paramName_NameMap.get(n)&&r.paramName_NameMap.set(n,e);else{const o=new t(i),r=new Map;r.set(n,e),this.nameContextMap.set(e,{paramName_NameMap:r,subject:o,value:i})}}}static BehaviorSubContext(e,t){return Widget.Sub(e,r,t)}static SubContext(e,t){return Widget.Sub(e,s,t)}static Reactive(e){return Widget.Attribute(e)}static Method(e){return Widget.Attribute(e?{displayName:e}:void 0)}static select(e){return Widget.widgetMap.get(e)}static Inject(e){return(t,i)=>{let o=Reflect.get(t,"injection")||{name:this,list:new Map};if(o.name!==t.constructor){const e=o;o={name:t.constructor,list:new Map},e.list.forEach((e,t)=>o.list.set(t,e)),Reflect.set(t,"injection",o)}o.list.get(e||i)||o.list.set(e||i,i)}}static Provide(e){return(t,i)=>{let o=Reflect.get(t,"provider")||{name:this,list:new Map};if(o.name!==t.constructor){const e=o;o={name:t.constructor,list:new Map},e.list.forEach((e,t)=>o.list.set(t,e)),Reflect.set(t,"provider",o)}o.list.get(e||i)||o.list.set(e||i,i)}}getSelf(){return this.self}getOperator(){return this}initialize(e={}){if(this.initialized)throw new Error(`error: reInitializeWidget:${this.getWidgetType()}:${this.getHandle()}`);const t={},i=(Reflect.get(this,"injection")||{list:new Map}).list,o=this.getAttributes();if(i&&i.forEach((e,i)=>{if(void 0!==this.getShared(i).host){Reflect.set(t,e,{get:()=>this.getShared(i).value,configurable:!0});let n="";o.forEach((t,i)=>t===e?n=i:""),""!==n&&Reflect.set(this,`$compute$${e}`,{get:()=>this.getShared(i).value})}}),Object.defineProperties(this,t),this.initialized=!0,this.config=e,Widget.widgetMap.set(this.getHandle(),this),Widget.nameContextMap.forEach(e=>{const{subject:t,paramName_NameMap:i}=e,o={subscribe:e=>{const i=t.subscribe(t=>{e(t)});return this.subscriptionMap.set(Symbol("random"),i),i},subject:t};i.forEach((e,t)=>{this[t]=o})}),this.$$innerWidgetType){const e=this.getParentWidget();e&&e.$$innerWidgetType&&e.childrenWidget.push(this)}return this}dispose(e=!1){var t,i;this.releaseInjection();const o=null===(t=this.parent)||void 0===t?void 0:t.children;if(o){const e=o.findIndex(e=>e.getHandle()===this.getHandle());-1!==e&&(o.splice(e,1),null===(i=this.parent)||void 0===i||i.childrenInstance.splice(e,1))}for(;this.children.length;)this.children[0].dispose(e);Widget.widgetMap.delete(this.getHandle()),this.subscriptionMap.forEach(e=>{e.unsubscribe()}),this.subscriptionMap.clear(),this.self=null,this.childrenInstance=[],this.children=[],this.childrenWidget=[],this.parent=null,e&&(this.$$props=void 0)}createWidget(t,i,o,n){const r=e(t);r.parent=this;const s=r.initialize(o),d=s&&s.getOperator();return void 0!==n&&n>=0?this.children[n]=d:this.children.push(d),i&&(r.name=i),d}getHandle(){return this.handle}deleteWidget(e){const{length:t}=this.children;return this.children.forEach((t,i)=>{t.getHandle()===e&&t.dispose()}),this.children.length!==t}moveChildWidget(e,t){this.parent&&(this.children[e]=this.children.splice(t,1,this.children[e])[0],this.childrenInstance[e]=this.childrenInstance.splice(t,1,this.childrenInstance[e])[0])}insertWidget(e,t){this.parent&&(this.children.splice(t,0,e),this.childrenInstance.splice(t,0,e))}deleteWidgetByIndex(e,t){const{length:i}=this.children,o=t||this.children[e].getHandle();return this.children.forEach((t,i)=>{t.getHandle()===o&&i===e&&t.dispose()}),this.children.length!==i}getConfig(e){return this.config[e]}getAllConfig(){return this.config}getSibling(){if(!this.$$innerWidgetType)return null;const e=this.getParentWidget();return e?e.getChildrenWidget():null}previousWidgetSibling(){const e=this.getSibling();if(!e)return null;const t=e.findIndex(e=>e.getHandle()===this.getHandle());return t>0?e[t-1]:null}nextWidgetSibling(){const e=this.getSibling();if(!e)return null;const t=e.findIndex(e=>e.getHandle()===this.getHandle());return t>=0&&t<e.length-1?e[t+1]:null}getParentWidget(){if(this.$$innerWidgetType){let e=this.parent;if(!e)return null;for(;e;){if(e.$$innerWidgetType)return e;e=e.parent}}return this.parent}getChildrenWidget(){return this.childrenWidget.length?this.childrenWidget:this.getChildrenInstance()}getParent(){return this.parent}getName(){return this.name}getWidgetType(){return this.constructor.name}static getProtoChains(e){let t=Widget.protoChainsCache.get(e);if(t)return t;t=[];let i=e;for(;""!==i.name;)t.push(i),i=Object.getPrototypeOf(i);return Widget.protoChainsCache.set(e,t),t}getAttributes(){if(this.currentAttributeMapCache)return this.currentAttributeMapCache;const e=Widget.getProtoChains(this.constructor),t=new Map;return e.forEach(e=>{const i=Widget.attributeMap.get(e);i&&i.forEach((e,i)=>{t.set(i,e)})}),this.currentAttributeMapCache=t}getWatchers(){const e=[];return Widget.getProtoChains(this.constructor).forEach(t=>{const i=Widget.watchMap.get(t);i&&i.forEach(t=>e.push(t))}),e}getChildren(){return this.children}getChildrenInstance(){return this.childrenInstance}addChildrenInstance(e){this.childrenInstance.push(e)}getShared(e){let t=this.getParent(),i="";for(;t;){const o=(Reflect.get(t,"provider")||{list:new Map}).list;if(o&&o.get(e)){i=o.get(e);break}t=t.getParent()}if(t){let e=Reflect.get(t,i);return"function"==typeof e&&(e=e.bind(t)),{host:t,value:e}}return{}}releaseInjection(){const e=Reflect.get(this,"injection");e&&(e.list.forEach(e=>{const t=this.getSelf();t&&Reflect.deleteProperty(t,e)}),Reflect.set(this,"injection",null))}getComputeHandler(e){return Reflect.get(this,`$compute$${e}`)}getProps(){return this.$$props||[]}}
1
+ import{instantiate as e,uniqueKeyGenerator as t,StringHelper as i,CastHelper as n,BooleanHelper as o}from"@oinone/kunlun-shared";import{BehaviorSubject as r,Subject as s}from"@oinone/kunlun-state";import{translateValueByKey as d,genStaticPath as a,RuntimeContextManager as c,ComputeContextManager as l,ROOT_HANDLE as u,ActiveRecordsOperator as p,ViewVM as h}from"@oinone/kunlun-engine";import{defineComponent as g,createVNode as v,Fragment as f,effectScope as y,computed as m,ref as W,watch as b,isRef as R,toRaw as D,nextTick as S,h as C,Suspense as w,withCtx as A,resolveDynamicComponent as $,provide as O,inject as M,reactive as j,onBeforeMount as P,onMounted as N,onUnmounted as V}from"vue";import{isNil as I,isBoolean as H,isString as _,intersection as E,isFunction as x}from"lodash-es";import{XMLTemplateParser as B,DEFAULT_SLOT_NAME as k,DslDefinitionHelper as U,DslSlotUtils as T,DslDefinitionType as F,UnknownDslDefinition as z}from"@oinone/kunlun-dsl";import{getMergeConfig as L}from"@oinone/kunlun-config";import{PropRecordHelper as G,StableSlotProp as K}from"@oinone/kunlun-vue-ui-common";import{isDev as Q,useMatched as Z}from"@oinone/kunlun-router";import{ViewType as q,createViewElement as J}from"@oinone/kunlun-meta";import{InjectionToken as X,SPI as Y}from"@oinone/kunlun-spi";import{LifeCycleTypes as ee}from"@oinone/kunlun-event";class Widget{constructor(e){this.subscriptionMap=new Map,this.childrenInstance=[],this.children=[],this.childrenWidget=[],this.config={},this.initialized=!1,this.parent=null,this.childrenInstance=[],this.handle=e||Widget.createHandle(this.constructor.name),this.name="default",this.self=this}static createHandle(e=""){return`${e||"oio-widget"}-${this.widgetCount++}`}static Attribute(e){return(t,i,n)=>{const o=t.constructor,r=this.attributeMap.get(o)||new Map;r.set(e&&e.displayName||i,i),this.attributeMap.set(o,r),n&&n.get&&(t[`$compute$${i}`]={get:n.get,set:n.set});const s=o.prototype.$$props||[];e&&!1===e.render||s.push(e&&e.displayName||i),t.$$props=s}}static Watch(e,t){return(i,n,o)=>{const r=i.constructor,s=Widget.watchMap.get(r)||[];s.push({path:e,handler:o.value,options:t}),Widget.watchMap.set(r,s)}}static Sub(e,t,i,n){return(o,r)=>{const s=this.nameContextMap.get(e);if(s)s&&!s.paramName_NameMap.get(r)&&s.paramName_NameMap.set(r,e);else{const o=new t(i),s=new Map;s.set(r,e),this.nameContextMap.set(e,{paramName_NameMap:s,subject:o,value:i,option:n})}const d=o.constructor.prototype.$$subNames||[];d.includes(r)||d.push(r),o.$$subNames=d}}static BehaviorSubContext(e,t,i){return Widget.Sub(e,r,t,i)}static SubContext(e,t,i){return Widget.Sub(e,s,t,i)}static Reactive(e){return Widget.Attribute(e)}static Method(e){return Widget.Attribute(e?{displayName:e}:void 0)}static select(e){return Widget.widgetMap.get(e)}static Inject(e){return(t,i)=>{let n=Reflect.get(t,"injection")||{name:this,list:new Map};if(n.name!==t.constructor){const e=n;n={name:t.constructor,list:new Map},e.list.forEach((e,t)=>n.list.set(t,e)),Reflect.set(t,"injection",n)}n.list.get(e||i)||n.list.set(e||i,i)}}static Provide(e){return(t,i)=>{let n=Reflect.get(t,"provider")||{name:this,list:new Map};if(n.name!==t.constructor){const e=n;n={name:t.constructor,list:new Map},e.list.forEach((e,t)=>n.list.set(t,e)),Reflect.set(t,"provider",n)}n.list.get(e||i)||n.list.set(e||i,i)}}getSelf(){return this.self}getOperator(){return this}initialize(e={}){if(this.initialized)throw new Error(`error: reInitializeWidget:${this.getWidgetType()}:${this.getHandle()}`);const t={},i=(Reflect.get(this,"injection")||{list:new Map}).list,n=this.getAttributes();if(i&&i.forEach((e,i)=>{if(void 0!==this.getShared(i).host){Reflect.set(t,e,{get:()=>this.getShared(i).value,configurable:!0});let o="";n.forEach((t,i)=>t===e?o=i:""),""!==o&&Reflect.set(this,`$compute$${e}`,{get:()=>this.getShared(i).value})}}),Object.defineProperties(this,t),this.initialized=!0,this.config=e,Widget.widgetMap.set(this.getHandle(),this),this.$$innerWidgetType){const e=this.getParentWidget();e&&e.$$innerWidgetType&&e.childrenWidget.push(this)}return this.startSubscription(),this}startSubscription(){var e,t;if(null===(e=this.$$subNames)||void 0===e?void 0:e.length)for(const[,e]of Widget.nameContextMap)for(const[i]of e.paramName_NameMap)(null===(t=this.$$subNames)||void 0===t?void 0:t.includes(i))&&(this[i]=this.createWidgetSubjection(e))}wrapSubjectWithScope(e,t){if(!t)return e;const i=e.next,n=this;e.next=function(t){i.call(e,t.__publisherWidget?t:{payload:t,__publisherWidget:n})};const o=e;if(o.getValue){const e=o.getValue;o.getValue=function(){const t=e.call(o);return t.__publisherWidget?t.payload:t}}return e}createWidgetSubjection(e){const{subject:t,option:i}=e;return{subscribe:e=>{const n=t.subscribe(t=>{(null==i?void 0:i.scope)&&(null==t?void 0:t.__publisherWidget)?this.isSameScopeWidget(t.__publisherWidget,null==i?void 0:i.scope)&&e(t.payload):e((null==i?void 0:i.scope)&&(null==t?void 0:t.__publisherWidget)?t.payload:t)});return this.subscriptionMap.set(Symbol("random"),n),n},subject:this.wrapSubjectWithScope(t,null==i?void 0:i.scope)}}isSameScopeWidget(e,t){const i=this.getParentWidgetByType(t),n=e.getParentWidgetByType(t);return i===n&&null!==i||this.getHandle()===(null==n?void 0:n.getHandle())}dispose(e=!1){var t,i;this.releaseInjection();const n=null===(t=this.parent)||void 0===t?void 0:t.children;if(n){const e=n.findIndex(e=>e.getHandle()===this.getHandle());-1!==e&&(n.splice(e,1),null===(i=this.parent)||void 0===i||i.childrenInstance.splice(e,1))}for(;this.children.length;)this.children[0].dispose(e);Widget.widgetMap.delete(this.getHandle()),this.subscriptionMap.forEach(e=>{e.unsubscribe()}),this.subscriptionMap.clear(),this.self=null,this.childrenInstance=[],this.children=[],this.childrenWidget=[],this.parent=null,e&&(this.$$props=void 0)}createWidget(t,i,n,o){const r=e(t);r.parent=this;const s=r.initialize(n),d=s&&s.getOperator();return void 0!==o&&o>=0?this.children[o]=d:this.children.push(d),i&&(r.name=i),d}getHandle(){return this.handle}deleteWidget(e){const{length:t}=this.children;return this.children.forEach((t,i)=>{t.getHandle()===e&&t.dispose()}),this.children.length!==t}moveChildWidget(e,t){this.parent&&(this.children[e]=this.children.splice(t,1,this.children[e])[0],this.childrenInstance[e]=this.childrenInstance.splice(t,1,this.childrenInstance[e])[0])}insertWidget(e,t){this.parent&&(this.children.splice(t,0,e),this.childrenInstance.splice(t,0,e))}deleteWidgetByIndex(e,t){const{length:i}=this.children,n=t||this.children[e].getHandle();return this.children.forEach((t,i)=>{t.getHandle()===n&&i===e&&t.dispose()}),this.children.length!==i}getConfig(e){return this.config[e]}getAllConfig(){return this.config}getSibling(){if(!this.$$innerWidgetType)return null;const e=this.getParentWidget();return e?e.getChildrenWidget():null}previousWidgetSibling(){const e=this.getSibling();if(!e)return null;const t=e.findIndex(e=>e.getHandle()===this.getHandle());return t>0?e[t-1]:null}nextWidgetSibling(){const e=this.getSibling();if(!e)return null;const t=e.findIndex(e=>e.getHandle()===this.getHandle());return t>=0&&t<e.length-1?e[t+1]:null}getParentWidget(){if(this.$$innerWidgetType){let e=this.parent;if(!e)return null;for(;e;){if(e.$$innerWidgetType)return e;e=e.parent}}return this.parent}getParentWidgetByType(e){let t=this.parent;for(;t;){if(t.$$innerWidgetType===e)return t;t=t.parent}return null}getChildrenWidget(){return this.childrenWidget.length?this.childrenWidget:this.getChildrenInstance()}getParent(){return this.parent}getName(){return this.name}getWidgetType(){return this.constructor.name}static getProtoChains(e){let t=Widget.protoChainsCache.get(e);if(t)return t;t=[];let i=e;for(;""!==i.name;)t.push(i),i=Object.getPrototypeOf(i);return Widget.protoChainsCache.set(e,t),t}getAttributes(){if(this.currentAttributeMapCache)return this.currentAttributeMapCache;const e=Widget.getProtoChains(this.constructor),t=new Map;return e.forEach(e=>{const i=Widget.attributeMap.get(e);i&&i.forEach((e,i)=>{t.set(i,e)})}),this.currentAttributeMapCache=t}getWatchers(){const e=[];return Widget.getProtoChains(this.constructor).forEach(t=>{const i=Widget.watchMap.get(t);i&&i.forEach(t=>e.push(t))}),e}getChildren(){return this.children}getChildrenInstance(){return this.childrenInstance}addChildrenInstance(e){this.childrenInstance.push(e)}getShared(e){let t=this.getParent(),i="";for(;t;){const n=(Reflect.get(t,"provider")||{list:new Map}).list;if(n&&n.get(e)){i=n.get(e);break}t=t.getParent()}if(t){let e=Reflect.get(t,i);return"function"==typeof e&&(e=e.bind(t)),{host:t,value:e}}return{}}releaseInjection(){const e=Reflect.get(this,"injection");e&&(e.list.forEach(e=>{const t=this.getSelf();t&&Reflect.deleteProperty(t,e)}),Reflect.set(this,"injection",null))}getComputeHandler(e){return Reflect.get(this,`$compute$${e}`)}getProps(){return this.$$props||[]}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- function Y(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function ee(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function te(e,t,i,o){return new(i||(i=Promise))(function(n,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function d(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,d)}a((o=o.apply(e,t||[])).next())})}Widget.widgetCount=0,Widget.widgetMap=new Map,Widget.attributeMap=new Map,Widget.protoChainsCache=new WeakMap,Widget.watchMap=new Map,Widget.nameContextMap=new Map;var ie,oe=g({name:"VueFragment",inheritAttrs:!1,render(){var e,t;return v(y,void 0,(null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))||[])}});oe.__file="src/basic/VueFragment.vue",function(e){e.beforeCreated="beforeCreated",e.created="created",e.beforeMount="beforeMount",e.mounted="mounted",e.beforeUpdate="beforeUpdate",e.updated="updated",e.activated="activated",e.deactivated="deactivated",e.beforeUnmount="beforeUnmount",e.unmounted="unmounted"}(ie||(ie={}));class VueWidget extends Widget{constructor(){super(...arguments),this.behaviorGroup={},this.node_code=this.revolveNodeCode()}revolveNodeCode(){return t()}setup(e){return(t,i)=>{this.__scope&&(this.__scope.stop(),this.__scope=null),this.__scope=f();let o={};return this.__scope.run(()=>{const{opt:n}=this;this.getAttributes().forEach((e,t)=>{const i=this.getComputeHandler(t);if(i)i.get&&(i.set?Reflect.set(o,t,m({get:i.get.bind(n),set:i.set.bind(n)})):Reflect.set(o,t,m(i.get.bind(n))));else{const i=Reflect.get(this,e);"function"==typeof i?Reflect.set(o,t,i.bind(n)):Reflect.set(o,t,W(i))}});this.getWatchers().forEach(e=>{const t=e.path.split("."),i=o[t[0]];i&&(1===t.length?R(i,e.handler.bind(n),e.options):R(()=>{let e=i.value||{};for(let i=1;i<t.length&&(e=e[t[i]],e);i++);return e},e.handler.bind(n),e.options))});const r=e&&e(t,i,o);r&&(o=Object.assign(Object.assign({},o),r)),this.res=o}),o}}static HookHost(){return(e,t)=>{const i=VueWidget.hookHosts.get(e.constructor)||[];i.push(t),VueWidget.hookHosts.set(e.constructor,i)}}static getHookHosts(e){const t=[];return(()=>{const t=[];let i=e.constructor,{name:o}=i;for(;""!==o;)o=i.name,t.push(i),i=Object.getPrototypeOf(i);return t})().forEach(e=>{const i=VueWidget.hookHosts.get(e);i&&i.forEach(e=>t.push(e))}),t}static getHooks(e,t,i){const o=(e=>{const t=[];let i=e;for(;""!==i.name;)t.push(i.name),i=Object.getPrototypeOf(i);return t})(Widget.select(e).constructor),n=[];return o.forEach(e=>{let o;o="after"===i?VueWidget.afterHooks.get(e):VueWidget.beforeHooks.get(e);(o&&o.get(t)||[]).forEach(e=>n.push(e))}),n}static BeforeHook(e){return(t,i,o)=>{const n=VueWidget.beforeHooks.get(t.constructor.name)||new Map,r=n.get(e)||[];r.push(o.value),n.set(e,r),VueWidget.beforeHooks.set(t.constructor.name,n)}}static AfterHook(e){return(t,i,o)=>{const n=VueWidget.afterHooks.get(t.constructor.name)||new Map,r=n.get(e)||[];r.push(o.value),n.set(e,r),VueWidget.afterHooks.set(t.constructor.name,n)}}getNodeCode(){return this.node_code}getNodeCodeRef(){return this.res.node_code}getOperator(){const{opt:e}=this;return e||this}createWidget(e,t,i,o,n=!1){const r=this.getOperator(),s=super.createWidget.bind(r)(e,t,i||{},o);n&&(r.node_code=this.revolveNodeCode());const d=s&&s.getOperator();return void 0!==o&&o>=0?this.getChildrenInstance()[o]=s.getOperator():this.addChildrenInstance(d),d}deleteWidget(e){const t=super.deleteWidget(e);return this.getOperator().node_code=this.revolveNodeCode(),t}insertWidget(e,t){super.insertWidget(e,t);this.getOperator().node_code=this.revolveNodeCode()}moveChildWidget(e,t){super.moveChildWidget(e,t);this.getOperator().node_code=this.revolveNodeCode()}deleteWidgetByIndex(e,t){const i=super.deleteWidgetByIndex(e,t);return this.getOperator().node_code=this.revolveNodeCode(),i}initialize(e={}){return super.initialize(e),this.component=oe,this.buildOperator(),this}buildOperator(){const e=new Proxy(this,{get:(e,t)=>{if("isProxy"===t)return!0;if("constructor"===t)return this.constructor;const i=this.res||{},o=Reflect.get(i,t);return o?b(o)?(o.value,o.value):o:Reflect.get(e,t)},set:(e,t,i)=>{const o=this.res||{},n=Reflect.get(o,t);return"function"==typeof n?Reflect.set(o,t,i):b(n)?(n.value=i,!0):Reflect.set(e,t,i)}});this.opt=e,this.initialize=this.initialize.bind(e);return VueWidget.getHookHosts(this).forEach(t=>{const i=Reflect.get(this,t);Reflect.set(this,t,(...o)=>{if("render"===t)return i.apply(e,o);const n=e.executeBeforeHooks(t,o),r=i.apply(e,n);return e.executeAfterHooks(t,r)})}),e}getWidgetComponent(e=!1){let t=this.widgetComponent;return!t&&e&&(t=this.buildWidgetComponent(),this.widgetComponent=t),t}setWidgetComponent(e){this.widgetComponent=e}renderExpandComponent(){}getMixinComponent(){return this.mixinComponent}setMixinComponent(e){e&&(e=Object.assign({inheritAttrs:!1},e)),this.mixinComponent=e}render(e,t){return this.widgetComponent||(this.widgetComponent=this.buildWidgetComponent()),this.widgetComponent?this.renderWidgetComponent(this.widgetComponent,e,t):[]}getWidgetComponentName(){const{name:e}=this.constructor;return e}buildWidgetComponent(){let e=this.getComponent();if(!e)return;e=D(e);const t=this.getOperator(),i=this.getUsingComponents();return g({name:this.getWidgetComponentName(),components:i,inheritAttrs:!1,setup:this.setup(this.setupHook.bind(this)),beforeMount:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.beforeMount])||void 0===i||i.call(e),this.$$beforeMount.call(t),this.beforeMount.call(t)},mounted:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.mounted])||void 0===i||i.call(e),this.$$mounted.call(t),this.mounted.call(t)},beforeUpdate:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.beforeUpdate])||void 0===i||i.call(e),this.$$beforeUpdate.call(t),this.beforeUpdate.call(t)},updated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.updated])||void 0===i||i.call(e),this.$$updated.call(t),this.updated.call(t)},activated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.activated])||void 0===i||i.call(e),this.$$activated.call(t),this.activated.call(t)},deactivated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.deactivated])||void 0===i||i.call(e),this.$$deactivated.call(t),this.deactivated.call(t)},beforeUnmount:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.beforeUnmount])||void 0===i||i.call(e),this.$$beforeUnmount.call(t),this.beforeUnmount.call(t)},unmounted:()=>{var e,i;null===(i=(e=this.behaviorGroup)[ie.unmounted])||void 0===i||i.call(e),this.unmounted.call(t),this.$$unmounted.call(t),this.$$unmountedAfterProperties.call(t)},render:t=>{const i=this.buildProps(t),{$slots:o}=t,n=this.resolveProps(e,i),r=o&&Object.keys(o).length?o:this.resolveChildren(),s=this.renderExpandComponent(),d={};if(s){const e=r.default?r.default():[];d.default=()=>[...e,s]}return this.renderMixinComponent(v(e,n,Object.assign(Object.assign({},r),d)),i)}})}resolveProps(e,t){return t}renderMixinComponent(e,t){const i=this.getMixinComponent();if(i){const o=e,n=this.resolveProps(i,t);e=v(i,n,{default:()=>o})}return e}renderWidgetComponent(e,t,i){return v(e,{},i)}buildProps(e){const t={},i=this.getAttributes(),o=this.getProps();return i.forEach((i,n)=>{o.includes(i)&&Reflect.set(t,i,Reflect.get(e,n))}),t["data-handle"]=this.getHandle(),t}buildPropsStrs(){const e=this.getProps(),t=[];return e.forEach(e=>t.push(e)),t}resolveChildren(){const e={},t=[],i=this.getChildren();return i.forEach(e=>{t.includes(e.getName())||t.push(e.getName())}),t.forEach(t=>{Reflect.set(e,t,(...e)=>i.filter(e=>e.getName()===t).map(t=>t.render(...e)))}),e}setupHook(e,t,i){var o,n,r,s;return null===(n=(o=this.behaviorGroup)[ie.beforeCreated])||void 0===n||n.call(o),this.$$beforeCreated(),this.beforeCreated(),null===(s=(r=this.behaviorGroup)[ie.created])||void 0===s||s.call(r),this.$$created(),this.created(),{}}setComponent(e){this.component=Object.assign({inheritAttrs:!1},e)}dispose(e=!1){super.dispose(e),this.opt=void 0;const t=null;this.__scope&&(this.__scope.stop(),this.__scope=t),this.component=t,this.mixinComponent=t,this.widgetComponent=t,e&&C(()=>{this.res={},this.__proto__=null})}getComponent(){const{name:e,__render__:t,__name__:i}=this.constructor;return t&&(this.component=g({name:i||e,props:this.buildPropsStrs(),render:t,components:this.getUsingComponents()})),this.component}getUsingComponents(){return{}}executeAfterHooks(e,t){const i=VueWidget.getHooks(this.getHandle(),e,"after");let o=0;const n={result:t},r=()=>{o<i.length&&i[o++].apply(this,[r,n])};return r(),n.result}executeBeforeHooks(e,...t){const i=VueWidget.getHooks(this.getHandle(),e,"before");let o=0;const n={args:t},r=()=>{o<i.length&&i[o++].apply(this,[r,n])};return r(),n.args}beforeCreated(){}$$beforeCreated(){}created(){}$$created(){}beforeMount(){}$$beforeMount(){}mounted(){}$$mounted(){}beforeUpdate(){}$$beforeUpdate(){}updated(){}$$updated(){}activated(){}$$activated(){}deactivated(){}$$deactivated(){}beforeUnmount(){}$$beforeUnmount(){}unmounted(){}$$unmounted(){}$$unmountedAfterProperties(){this.dispose()}registryBehavior(e,t){this.behaviorGroup[e]=t}reset(){this.widgetComponent=void 0,this.getParent().node_code=this.revolveNodeCode()}translate(e,t={}){const i=Reflect.get(window,"translate"),o=i?i(e):"";if(o===e||0===Object.keys(t).length)return o;return o.replace(/\{\s*([A-Z0-9_]+)\s*\}/gi,(e,i)=>t[i])}translateByI18n(e){return d(e)||e}genStaticPath(e){return a(e)}forceUpdate(){const e=this.getOperator();e&&(e.node_code=this.revolveNodeCode())}}VueWidget.beforeHooks=new Map,VueWidget.afterHooks=new Map,VueWidget.hookHosts=new Map,Y([Widget.Reactive(),ee("design:type",String)],VueWidget.prototype,"node_code",void 0),Y([VueWidget.HookHost(),ee("design:type",Function),ee("design:paramtypes",[Object,Object]),ee("design:returntype",Object)],VueWidget.prototype,"render",null),Y([Widget.Reactive(),ee("design:type",Function),ee("design:paramtypes",[Object,Object]),ee("design:returntype",String)],VueWidget.prototype,"translate",null),Y([Widget.Reactive(),ee("design:type",Function),ee("design:paramtypes",[String]),ee("design:returntype",String)],VueWidget.prototype,"translateByI18n",null),Y([Widget.Method(),ee("design:type",Function),ee("design:paramtypes",[String]),ee("design:returntype",void 0)],VueWidget.prototype,"genStaticPath",null);class AsyncVueWidget extends VueWidget{setup(e){const t=super.setup();return(i,o)=>te(this,void 0,void 0,function*(){const n=t(i,o),r=e&&(yield e(i,o))||{};for(const e in r)Reflect.set(n,e,Reflect.get(r,e));return n})}render(e){return S("div",S(A,super.render(e)))}setupHook(e,t,i){return te(this,void 0,void 0,function*(){return yield this.beforeCreated(),yield this.created(),{}})}}class DslNodeWidget extends VueWidget{get widgetPath(){let e=this.parentPath||"";const{subPath:t,subIndex:i}=this;return t&&(e=e?`${e}.${t}`:t),null!=i&&(e=`${e}[${i}]`),e}get variables(){return x.resolveVariables(this.getDsl())}initialize(e){var t;super.initialize(e),this.dslNode=e.dslNode,this.metadataHandle=e.metadataHandle,this.rootHandle=e.rootHandle,this.template=e.template,this.slotName=e.slotName,this.widgetInline=e.widgetInline,this.currentHandle=this.getHandle();const{subPath:i,subIndex:o}=e;return this.subPath=i||(null===(t=this.template)||void 0===t?void 0:t.dslNodeType)||"",E(o)?this.subIndex=e.__index:this.subIndex=o,this}getDsl(){return this.dslNode||{}}getSlotName(){return this.slotName}getDslChildrenByLabel(e){return this.dslNode?(this.dslNode.children||[]).find(t=>t.tagName===e.toUpperCase()):null}get metadataRuntimeContext(){const{metadataHandle:e}=this;if(e)return c.get(e)}get rootRuntimeContext(){const{rootHandle:e}=this;if(e)return c.get(e)}}function ne(e){const t=null==e?void 0:e.invisible;return!E(t)&&(I(t)?t:t())}function re(e){return!e||!e.length||e.every(e=>ne(e))}Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"metadataHandle",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"rootHandle",void 0),Y([Widget.Reactive(),ee("design:type",String)],DslNodeWidget.prototype,"currentHandle",void 0),Y([Widget.Reactive({render:!1}),ee("design:type",Object)],DslNodeWidget.prototype,"dslNode",void 0),Y([Widget.Reactive({render:!1}),ee("design:type",Object)],DslNodeWidget.prototype,"template",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"slotName",void 0),Y([Widget.Reactive(),Widget.Inject("path"),ee("design:type",Object)],DslNodeWidget.prototype,"parentPath",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"subPath",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"subIndex",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[])],DslNodeWidget.prototype,"widgetPath",null),Y([Widget.Reactive(),ee("design:type",Object)],DslNodeWidget.prototype,"widgetInline",void 0),Y([Widget.Reactive(),ee("design:type",Object),ee("design:paramtypes",[])],DslNodeWidget.prototype,"variables",null);const se="oinone",de="__slots",ae="__render__options",ce="slotContext",le=["div","a","span","table","form","detail","ul","li","h1","h2","h3","h4","h5","h6","p","thead","tbody","tr","th","td"];function ue(e,t,i){let o=e[t];if(delete e[t],!o&&i){o=i;const{dslDefinition:n}=e;n&&(n[t]=i)}return o}class DslRender{static render(e,t=B,i,o){const n=DslRender.fetchComponent(e);if(n)return DslRender.createVNodeWithDslDefinition(n,e,t,i,o)}static renderSlots(e){const t={};for(const i in e)t[i]=M(t=>{var o;return DslRender.createVNodeChildren(null===(o=e[i])||void 0===o?void 0:o.widgets,i,t)});return t}static fetchVNodeSlots(e,t){var i;if(!e)return;const o=e[de];if(o)return o;if(!t){const o=[B];null===(i=e.widgets)||void 0===i||i.forEach(e=>{if(k.isTemplate(e)){let t=e.slot;t||(t=B),o.push(t)}}),t=[...new Set(o)]}const n=U.fetchSlotsBySlotNames(e,t);return DslRender.renderSlots(n)}static fetchComponent(e){let t,{dslNodeType:i}=e||{};switch(i||(i=F.ELEMENT),i){case F.VIEW:t=O(`${se}-${e.dslNodeType}`);break;case F.PACK:{const i=e;t=DslRender.resolveWidgetComponent(`${i.widget||"group"}`),"string"==typeof t&&(t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`));break}case F.ELEMENT:{const i=e;t=DslRender.resolveWidgetComponent(`${i.widget}`),"string"==typeof t&&(t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`));break}case F.ACTION:case F.FIELD:t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`);break;case F.UNKNOWN:case F.SLOT:case F.TEMPLATE:t=null;break;default:t=DslRender.resolveCommonWidgetComponent(i)}return t}static createVNodeChildren(e,t,i,o){const n=[];if(!e)return n;t||(t=B),E(o)&&(o=0);const{length:r}=e;for(let s=0;s<r;s++){const r=e[s],d=DslRender.fetchComponent(r);if(d)n.push(DslRender.createVNodeWithDslDefinition(d,r,t,V(d)?DslRender.fetchVNodeSlots(r):void 0,i?{slotContext:i}:void 0,s+o));else if(null===d){const{dslNodeType:e}=r;switch(e){case F.SLOT:{const e=DslRender.createVNodeChildren(r.widgets,t,i,s+o);o+=e.length,e.forEach(e=>n.push(e));break}case F.UNKNOWN:case F.TEMPLATE:continue;default:console.error("Invalid component.")}}}return n}static createVNodeWithDslDefinition(e,i,o,n,r,s){var d;E(s)||i.__index===s||(i.__index=s);const a=V(e),c=a?L.collectionBasicProps(i):Object.assign(Object.assign({},i),{dslDefinition:Object.assign({},i),slotName:o});let l;l=a&&i.__content||ue(c,de,n);const u=ue(c,ae,r),p=null==u?void 0:u.slotContext;if(p){const e=null==r?void 0:r.slotContext;e&&(u.slotContext=e),c.slotContext=p}if(DslRenderHelper.predictIsUpdateKey(i,u)){const e=t();i.key=e,c.key=e}DslRenderHelper.predictIsRecursion(u)&&!l&&(null===(d=i.widgets)||void 0===d?void 0:d.length)&&(l=DslRender.fetchVNodeSlots(i));let h=null==u?void 0:u.dynamicProps;return p&&(h=H(h||[],[ce])),v(e,c,l,null==u?void 0:u.patchFlag,h,null==u?void 0:u.isBlockNode)}static resolveCommonWidgetComponent(e){let t=DslRender.resolveCommonComponentCache[e];return t||(le.includes(e)?e:(t=O(`${se}-${i.camelCaseToKebabCase(e)}`),"string"==typeof t&&(t=O(e)),DslRender.resolveCommonComponentCache[e]=t,t))}static resolveWidgetComponent(e){let t=DslRender.resolveComponentCache[e];if(t)return t;if(le.includes(e))return e;if(t=O(e),"string"==typeof t)for(const i of DslRender.resolveMethods){const o=i(e);if(o){const e=O(o);if("string"!=typeof e){t=e;break}}}return DslRender.resolveComponentCache[e]=t,t}}DslRender.resolveComponentCache={},DslRender.resolveCommonComponentCache={},DslRender.resolveMethods=[e=>{if(-1===e.indexOf("-")){const t=e.charCodeAt(0);if(t>=i.UPPER_A_ASCLL&&t<=i.UPPER_Z_ASCLL)return`${e[0].toLowerCase()}${e.substring(1)}`}},e=>{if(-1===e.indexOf("-")){const t=e.charCodeAt(0);if(t>=i.LOWER_A_ASCLL&&t<=i.LOWER_Z_ASCLL)return`${e[0].toUpperCase()}${e.substring(1)}`}},e=>i.camelCaseToKebabCase(e)];class DslRenderHelper{static predictIsUpdateKey(e,t){const i=(null==t?void 0:t.dynamicKey)||!1,o=(null==t?void 0:t.focusUpdate)||!1;if(e.key){if(o)return!0}else if(i)return!0;return!1}static predictIsRecursion(e){return(null==e?void 0:e.recursion)||!1}}function pe(e,t){t||(t=e.name);const i=c.createOrReplace().frameworkInstance;t?"string"==typeof t?i.component(t,e):t.forEach(t=>i.component(t,e)):K()&&console.warn("component install error. reason: name is blank.",e)}function he(e,t){c.createOrReplace().frameworkInstance.directive(t,e)}function ge(e,...t){c.createOrReplace().frameworkInstance.use(e,...t)}function ve(e,t,i){let o;const{length:n}=e;for(let r=n-1;r>=0;r--){const n=e[r];if(o){const e=Array.isArray(o)?o:[o];o=n.render(t,Object.assign({default:()=>e},G))}else o=n.render(t,Object.assign(Object.assign({},i),G))}return o}function ye(){return new VueWidget}function fe(e){return o.cast(Widget.select(e))}function me(e){return fe(e)||ye()}class DslRenderWidget extends VueWidget{constructor(){super(...arguments),this.internal=!1}initialize(e){return super.initialize(e),this.internal=e.internal||!1,this.template=e.template,this.slotName=e.slotName,this.supportedSlotNames=e.slotNames||[],this.template&&this.supportedSlotNames.length&&(this.dslSlots=U.fetchSlotsBySlotNames(this.template,this.supportedSlotNames)),this}getDsl(){return this.template||T}getSlotName(){return this.slotName}render(e,t){return this.template&&(void 0===this.slots&&(this.internal?this.slots=this.internalRender(t)||null:this.slots=this.commonRender(t)||null),this.slots)?this.rawRender(e,this.slots):this.rawRender(e,t)}rawRender(e,t){return super.render(e,t)}internalRender(e){return e&&Object.keys(e).length?e:this.dslSlots&&Object.keys(this.dslSlots).length?DslRender.renderSlots(this.dslSlots):void 0}commonRender(e){return this.dslSlots&&Object.keys(this.dslSlots).length?DslRender.renderSlots(this.dslSlots):e&&Object.keys(e).length?e:void 0}}Y([Widget.Reactive(),ee("design:type",Object)],DslRenderWidget.prototype,"internal",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslRenderWidget.prototype,"template",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslRenderWidget.prototype,"slotName",void 0);class DslDefinitionWidget extends DslRenderWidget{constructor(e){super(e),this.automatic=!1,this.defaultAllInvisible=!1,this.invisibleState=!1,this.currentHandle=this.getHandle()}getMetadataHandle(){return this.metadataHandle}getRootHandle(){return this.rootHandle}getCurrentHandle(){return this.currentHandle}get allInvisible(){const{allInvisible:e}=this.getDsl();return E(e)?this.defaultAllInvisible:n.toBoolean(e)}get invisible(){let{invisible:e}=this.getDsl();return e=!E(e)&&this.invisibleProcess(e),e||!!this.allInvisible&&(this.invisibleState=this.childrenInvisibleProcess(),this.invisibleState)}get parentInvisibleProvider(){return this.parentInvisible||this.invisible}initialize(e){return super.initialize(e),this.metadataHandle=e.metadataHandle,this.rootHandle=e.rootHandle,this.automatic=e.automatic||!1,this.inline=e.inline,this}get metadataRuntimeContext(){const{metadataHandle:e}=this;let t;if(e&&(t=c.get(e)),!t)throw new Error("Invalid metadata runtime context.");return t}get rootRuntimeContext(){const{rootHandle:e}=this;let t;if(e&&(t=c.get(e)),!t)throw new Error("Invalid root runtime context.");return t}get rootComputeContext(){const{rootHandle:e}=this;let t;return e&&(t=l.get(e)),t}get rootViewRuntimeContext(){var e,t,i;const o=[];let n=this.rootRuntimeContext,r=null===(e=null==n?void 0:n.parentContext)||void 0===e?void 0:e.field;for(;r&&n;){o.push(r);const e=null===(t=null==n?void 0:n.parentContext)||void 0===t?void 0:t.handle;if(!e)throw new Error("Invalid field runtime context handle");const s=null===(i=Widget.select(e))||void 0===i?void 0:i.rootRuntimeContext,d=null==s?void 0:s.parentContext;if(!d||d.handle===u)break;r=d.field,n=s}return{runtimeContext:n,fields:o}}getMergeConfig(...e){if(this.cacheConfigProxy)return this.cacheConfigProxy;const t=z(e,{defaultValue:void 0});return this.cacheConfigProxy=new Proxy(this.getDsl(),{get:(e,i)=>i in e?e[i]:t[i]}),this.cacheConfigProxy}invisibleProcess(e){return n.toBoolean(e)}childrenInvisibleProcess(){return re(this.getChildren())}resetInvisible(){this.allInvisible&&(this.invisibleState=this.childrenInvisibleProcess())}resetParentInvisible(){var e,t;null===(t=null===(e=this.getParent())||void 0===e?void 0:e.resetInvisible)||void 0===t||t.call(e)}$$mounted(){super.$$mounted(),this.resetInvisible(),this.lastedInvisibleState=this.invisible}$$updated(){super.$$updated();const{lastedInvisibleState:e,invisible:t}=this;this.lastedInvisibleState=t,e!==t&&this.resetParentInvisible()}$$unmountedAfterProperties(){super.$$unmountedAfterProperties(),this.automatic||this.metadataHandle!==this.rootHandle||c.delete(this.metadataHandle)}allMounted(){this.resetInvisible()}}Y([Widget.Reactive(),ee("design:type",Object)],DslDefinitionWidget.prototype,"automatic",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslDefinitionWidget.prototype,"metadataHandle",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslDefinitionWidget.prototype,"rootHandle",void 0),Y([Widget.Reactive(),ee("design:type",String)],DslDefinitionWidget.prototype,"currentHandle",void 0),Y([Widget.Reactive(),ee("design:type",Object)],DslDefinitionWidget.prototype,"inline",void 0),Y([Widget.Reactive(),ee("design:type",Object),ee("design:paramtypes",[])],DslDefinitionWidget.prototype,"allInvisible",null),Y([Widget.Reactive(),ee("design:type",Object)],DslDefinitionWidget.prototype,"invisibleState",void 0),Y([Widget.Reactive(),Widget.Inject(),ee("design:type",Object)],DslDefinitionWidget.prototype,"parentInvisible",void 0),Y([Widget.Reactive(),ee("design:type",Boolean),ee("design:paramtypes",[])],DslDefinitionWidget.prototype,"invisible",null),Y([Widget.Reactive(),Widget.Provide("parentInvisible"),ee("design:type",Object),ee("design:paramtypes",[])],DslDefinitionWidget.prototype,"parentInvisibleProvider",null),Y([Widget.Method(),ee("design:type",Function),ee("design:paramtypes",[]),ee("design:returntype",void 0)],DslDefinitionWidget.prototype,"allMounted",null);class PathWidget extends DslDefinitionWidget{get path(){const{parentPath:e,subPath:t,subIndex:i,currentPath:o}=this;if(E(o)){let o=e||"";return this.internal||t&&(o=o?`${o}.${t}`:t,null!=i&&(o=`${o}[${i}]`)),o}return o}initialize(e){var t;super.initialize(e);const{subPath:i,subIndex:o,path:n}=e;return this.currentPath=n,this.subPath=i||(null===(t=this.template)||void 0===t?void 0:t.dslNodeType)||"",E(o)?this.subIndex=e.__index:this.subIndex=o,this}}Y([Widget.Reactive(),Widget.Inject("path"),ee("design:type",Object)],PathWidget.prototype,"parentPath",void 0),Y([Widget.Reactive(),ee("design:type",Object)],PathWidget.prototype,"subPath",void 0),Y([Widget.Reactive(),ee("design:type",Object)],PathWidget.prototype,"subIndex",void 0),Y([Widget.Reactive(),ee("design:type",Object)],PathWidget.prototype,"currentPath",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[])],PathWidget.prototype,"path",null);class ActiveRecordsWidget extends PathWidget{initialize(e){super.initialize(e);const{dataSource:t,activeRecords:i}=e;return this.setCurrentDataSource(t),this.setCurrentActiveRecords(i),this}get submitCache(){var e;return null===(e=this.metadataRuntimeContext.field)||void 0===e?void 0:e.submitCache}get rootData(){return this.currentRootData||this.parentRootData}set rootData(e){this.currentRootData=e}getCurrentRootData(){return this.currentRootData}setCurrentRootData(e){this.currentRootData=p.repairRecordsNullable(e)}reloadRootData(e){this.parentReloadRootData&&void 0===this.currentRootData?this.parentReloadRootData(e):this.setCurrentRootData(e)}get dataSource(){return this.currentDataSource||this.parentDataSource}set dataSource(e){this.currentDataSource=e}getCurrentDataSource(){return this.currentDataSource}setCurrentDataSource(e){this.currentDataSource=p.repairRecordsNullable(e),this.parentRootData||(this.currentRootData=this.currentDataSource||void 0)}reloadDataSource(e){this.parentReloadDataSource&&void 0===this.getCurrentDataSource()?this.parentReloadDataSource(e):this.setCurrentDataSource(e)}pushDataSource(e,t){if(this.parentPushDataSource&&void 0===this.getCurrentDataSource())this.parentPushDataSource(e,t);else{let i=t;const{submitCache:o}=this;o&&!i&&(i=p.defaultPushPredict.bind(o));const n=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).push(e,i).get();o||this.setCurrentDataSource(n)}}updateDataSource(e){if(this.parentUpdateDataSource&&void 0===this.getCurrentDataSource())this.parentUpdateDataSource(e);else{const t=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).update(e).get();this.submitCache||this.setCurrentDataSource(t)}}updateDataSourceByEntity(e,t){if(this.parentUpdateDataSourceByEntity&&void 0===this.getCurrentDataSource())this.parentUpdateDataSourceByEntity(e,t);else{const i=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).updateByEntity(e,t).get();this.submitCache||this.setCurrentDataSource(i)}}deleteDataSource(e){if(this.parentDeleteDataSource&&void 0===this.getCurrentDataSource())this.parentDeleteDataSource(e);else{const t=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).delete(e).get();this.submitCache||this.setCurrentDataSource(t)}}deleteDataSourceByEntity(e,t){if(this.parentDeleteDataSourceByEntity&&void 0===this.getCurrentDataSource())this.parentDeleteDataSourceByEntity(e,t);else{const i=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).deleteByEntity(e,t).get();this.submitCache||this.setCurrentDataSource(i)}}createDataSourceByEntity(e,t){if(this.parentCreateDataSourceByEntity&&void 0===this.getCurrentDataSource())this.parentCreateDataSourceByEntity(e,t);else{const t=Array.isArray(e)?e:[e],i=this.getCurrentDataSource()||[];this.setCurrentDataSource([...t,...i])}}flushDataSource(){var e;null===(e=this.parentFlushDataSource)||void 0===e||e.call(this)}get activeRecords(){return this.currentActiveRecords||this.parentActiveRecords}set activeRecords(e){this.currentActiveRecords=e}getCurrentActiveRecords(){return this.currentActiveRecords}setCurrentActiveRecords(e){e!==this.currentActiveRecords&&(this.currentActiveRecords=p.repairRecordsNullable(e))}reloadActiveRecords(e){this.parentReloadActiveRecords&&void 0===this.getCurrentDataSource()?this.parentReloadActiveRecords(e):this.setCurrentActiveRecords(e)}pushActiveRecords(e,t){this.parentPushActiveRecords&&void 0===this.getCurrentDataSource()?this.parentPushActiveRecords(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).push(e,t).get()}updateActiveRecords(e){this.parentUpdateActiveRecords&&void 0===this.getCurrentDataSource()?this.parentUpdateActiveRecords(e):this.currentActiveRecords=p.operator(this.currentActiveRecords).update(e).get()}updateActiveRecordsByEntity(e,t){this.parentUpdateActiveRecordsByEntity&&void 0===this.getCurrentDataSource()?this.parentUpdateActiveRecordsByEntity(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).updateByEntity(e,t).get()}deleteActiveRecords(e){this.parentDeleteActiveRecords&&void 0===this.getCurrentDataSource()?this.parentDeleteActiveRecords(e):this.currentActiveRecords=p.operator(this.currentActiveRecords).delete(e).get()}deleteActiveRecordsByEntity(e,t){this.parentDeleteActiveRecordsByEntity&&void 0===this.getCurrentDataSource()?this.parentDeleteActiveRecordsByEntity(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).deleteByEntity(e,t).get()}flushActiveRecords(){this.parentFlushActiveRecords&&void 0===this.getCurrentDataSource()?this.parentFlushActiveRecords():this.currentActiveRecords=[]}}Y([Widget.Reactive(),Widget.Inject("rootData"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentRootData",void 0),Y([Widget.Reactive(),ee("design:type",Object)],ActiveRecordsWidget.prototype,"currentRootData",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"rootData",null),Y([Widget.Method(),Widget.Inject("reloadRootData"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadRootData",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadRootData",null),Y([Widget.Reactive(),Widget.Inject("dataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentDataSource",void 0),Y([Widget.Reactive(),ee("design:type",Object)],ActiveRecordsWidget.prototype,"currentDataSource",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"dataSource",null),Y([Widget.Method(),Widget.Inject("reloadDataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadDataSource",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadDataSource",null),Y([Widget.Method(),Widget.Inject("pushDataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentPushDataSource",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"pushDataSource",null),Y([Widget.Method(),Widget.Inject("updateDataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateDataSource",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Array]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateDataSource",null),Y([Widget.Method(),Widget.Inject("updateDataSourceByEntity"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateDataSourceByEntity",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateDataSourceByEntity",null),Y([Widget.Method(),Widget.Inject("deleteDataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteDataSource",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Array]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteDataSource",null),Y([Widget.Method(),Widget.Inject("deleteDataSourceByEntity"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteDataSourceByEntity",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteDataSourceByEntity",null),Y([Widget.Method(),Widget.Inject("createDataSourceByEntity"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentCreateDataSourceByEntity",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"createDataSourceByEntity",null),Y([Widget.Method(),Widget.Inject("flushDataSource"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentFlushDataSource",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"flushDataSource",null),Y([Widget.Reactive(),Widget.Inject("activeRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentActiveRecords",void 0),Y([Widget.Reactive(),Widget.Inject("parentViewActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentViewActiveRecords",void 0),Y([Widget.Reactive(),ee("design:type",Object)],ActiveRecordsWidget.prototype,"currentActiveRecords",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"activeRecords",null),Y([Widget.Method(),Widget.Inject("reloadActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadActiveRecords",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadActiveRecords",null),Y([Widget.Method(),Widget.Inject("pushActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentPushActiveRecords",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"pushActiveRecords",null),Y([Widget.Method(),Widget.Inject("updateActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateActiveRecords",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Array]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateActiveRecords",null),Y([Widget.Method(),Widget.Inject("updateActiveRecordsByEntity"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateActiveRecordsByEntity",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateActiveRecordsByEntity",null),Y([Widget.Method(),Widget.Inject("deleteActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteActiveRecords",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Array]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteActiveRecords",null),Y([Widget.Method(),Widget.Inject("deleteActiveRecordsByEntity"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteActiveRecordsByEntity",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[Object,Function]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteActiveRecordsByEntity",null),Y([Widget.Method(),Widget.Inject("flushActiveRecords"),ee("design:type",Object)],ActiveRecordsWidget.prototype,"parentFlushActiveRecords",void 0),Y([Widget.Method(),Widget.Provide(),ee("design:type",Function),ee("design:paramtypes",[]),ee("design:returntype",void 0)],ActiveRecordsWidget.prototype,"flushActiveRecords",null);const We={reportBeforeMount:()=>{},reportMounted:()=>{},reportUnmounted:()=>{},reportAllBeforeMount:()=>{},reportAllMounted:()=>{},reportAllUnmounted:()=>{}},Re=Symbol("AllMountedContext"),be=e=>{N(Re,Object.assign(Object.assign({},We),e))},De=()=>j(Re,We);function Ce(e,t){return!!Object.values(e).every(e=>e)&&(t(),!0)}let Se=0;function Ae(e){if(!e)return void console.warn("all mounted method or object is required.");let t,i;_(e)?t=e:i=e;const{reportAllBeforeMount:o,reportAllMounted:n,reportAllUnmounted:r}=De(),s="all-mounted#"+Se++,d={},a={};be({reportBeforeMount:e=>{const t=d[e];E(t)&&(d[e]=!1),null==o||o(s)},reportMounted:e=>{const o=d[e];E(o)||o||(d[e]=!0,Ce(d,(null==i?void 0:i.allMounted)||t||(()=>({})))&&(null==n||n(s)))},reportUnmounted:e=>{delete d[e],null==r||r(s)},reportAllBeforeMount:e=>{const t=a[e];E(t)&&(a[e]=!1)},reportAllMounted:e=>{const t=a[e];E(t)||t||(a[e]=!0,Ce(a,(null==i?void 0:i.allMountedUpdate)||(()=>({}))))},reportAllUnmounted:e=>{delete a[e]}})}let Me=0;function Oe(e){const{reportBeforeMount:t,reportMounted:i,reportUnmounted:o}=De(),n="mounted-#"+Me++;P(()=>{var i;const o=null===(i=null==e?void 0:e.onBeforeMount)||void 0===i?void 0:i.call(e);o instanceof Promise?o.then(()=>{null==t||t(n)}):null==t||t(n)}),$(()=>{var t;const o=null===(t=null==e?void 0:e.onMounted)||void 0===t?void 0:t.call(e);o instanceof Promise?o.then(()=>{null==i||i(n)}):null==i||i(n)}),w(()=>{var t;const i=null===(t=null==e?void 0:e.onUnmounted)||void 0===t?void 0:t.call(e);i instanceof Promise?i.then(()=>{null==o||o(n)}):null==o||o(n)}),be({})}const je=e=>Z(`[vue-kunlun]: ${e}`),Pe={handle:{type:String},dslDefinition:{type:Object},slotName:{type:String},inline:{type:Boolean,default:void 0},slotContext:{type:Object}};var $e;!function(e){e.Action="Action",e.Field="Field",e.Element="Element",e.View="View",e.Mask="Mask"}($e||($e={}));let we=class ViewWidget extends DslNodeWidget{constructor(){super(...arguments),this.loading=!1,this.currentRoute={},this.domain="",this.isRootView=!0,this.isDialogView=!1,this.selfHandleStr="",this.model=null,this.type="UNKNOWN",this.initQueryParams=null}getVM(){return this.$$vm}setVM(e){this.$$vm=e}setBusy(e){this.getVM().setBusy(e)}getUrlParams(){const{page:e={}}=Q().matched.segmentParams;return e}getBusy(){return this.loading}initialize(e){return null==e.isRootView&&(e.isRootView=!0),super.initialize(e),this.isRootView=e.isRootView||!1,e.view&&(this.view=e.view),null==this.rootHandleStr&&e.isRootWidget&&(this.currentRootHandlerStr=this.getHandle()),this.selfHandleStr=this.getHandle(),this.isDialogView=e.isDialogView||!1,this.model=e.model,this.setVM(new h({view:e.view,dslNode:e.dslNode,model:e.model,isRootWidget:!1!==e.isRootWidget||e.isRootWidget,isDialogView:e.isDialogView||!1,isRootView:e.isRootView})),this.getVM().isRootWidget=this.isRoot,this.getVM().isDialogView=this.isDialogView,this}get rootHandleStr(){return this.currentRootHandlerStr||this.parentRootHandlerStr}on(e,t){this.getVM().on(e,t)}watch(e,t){this.getVM().watch(e,t)}filterWatchData(e,t,i){return this.getVM().filterWatchData(e,t,i)}get isRoot(){return this.rootHandleStr===this.getHandle()}get useConstruct(){return this.isRoot||this.isDialogView}get viewElement(){return X(this.dslNode)}resolveTemplate(){}fetchData(e,t,i){return{}}onRowsChange(e){}loadData(e,t){return{}}loadRootData(e){this.getVM().setRootData(e)}setRootDataByKey(e,t){const i=this.getVM().getRootData();i&&(i[e]=t,this.getVM().setRootData(i))}submit(){return{}}getData(){return this.getVM().getData()}setData(e){this.getVM().setData(e)}validator(){return te(this,void 0,void 0,function*(){return[]})}loadMetadata(e,t,i,o){this.getVM().loadMetadata(e,t,i,o),this.model=this.getVM().getModel(),this.view=this.getVM().getView(),this.dslNode||(this.dslNode=t||this.getVM().getDslNode())}getActiveRecords(){return[]}setDomain(e){this.domain=e}getDomain(){return this.domain}setFilter(e){this.filter=e}getFilter(){return this.filter}getModel(){return this.getVM().getModel()}getView(){return this.getVM().getView()}getPath(){return this.path}notify(e){this.getVM().notify(e)}$$beforeCreated(){const{initQueryParams:e="{}"}=this.getUrlParams();try{const t=JSON.parse(e);this.initQueryParams=Object.keys(t).length?t:null}catch(e){this.initQueryParams=null}this.notify(J.ON_VIEW_BEFORE_CREATED)}$$created(){this.notify(J.ON_VIEW_CREATED)}$$beforeMount(){this.notify(J.ON_VIEW_BEFORE_MOUNT)}$$mounted(){this.getVM().setPageViewState("mount"),this.getVM().watchLoading(e=>{this.loading=e});const{getMatched$:e}=Q();this.subjectRoute$=e().subscribe(e=>{this.currentRoute=e}),this.notify(J.ON_VIEW_MOUNTED)}$$beforeUpdate(){this.notify(J.ON_VIEW_BEFORE_UPDATE)}$$updated(){this.notify(J.ON_VIEW_UPDATED)}$$beforeUnmount(){this.notify(J.ON_VIEW_BEFORE_UNMOUNT)}$$unmounted(){this.getVM().setPageViewState("unmount");const e=setTimeout(()=>{"unmount"===this.getVM().getPageViewState()&&(this.notify(J.ON_VIEW_UNMOUNTED),this.getVM().unsubscribe()),clearTimeout(e)})}};Y([Widget.Reactive(),ee("design:type",Object)],we.prototype,"loading",void 0),Y([Widget.Inject(),Widget.Reactive(),ee("design:type",String)],we.prototype,"filter",void 0),Y([Widget.Reactive(),Widget.Inject("rootHandleStr"),ee("design:type",Object)],we.prototype,"parentRootHandlerStr",void 0),Y([Widget.Reactive(),ee("design:type",Object)],we.prototype,"currentRootHandlerStr",void 0),Y([Widget.Reactive(),Widget.Provide(),ee("design:type",Object),ee("design:paramtypes",[])],we.prototype,"rootHandleStr",null),Y([Widget.Reactive(),ee("design:type",Object)],we.prototype,"isRootView",void 0),Y([Widget.Reactive(),ee("design:type",Object),ee("design:paramtypes",[])],we.prototype,"isRoot",null),Y([Widget.Reactive(),ee("design:type",Object),ee("design:paramtypes",[])],we.prototype,"useConstruct",null),Y([Widget.Provide(),ee("design:type",Object)],we.prototype,"selfHandleStr",void 0),Y([Widget.Reactive(),Widget.Provide("view"),ee("design:type",Object)],we.prototype,"view",void 0),Y([Widget.Reactive(),Widget.Provide("viewModel"),ee("design:type",Object)],we.prototype,"model",void 0),Y([Widget.Reactive(),ee("design:type",String)],we.prototype,"path",void 0),we=Y([q.Base("View",["id","name","type","model","widget","tagName"])],we);const Ne=Symbol("view");export{ActiveRecordsWidget,AsyncVueWidget,se as DEFAULT_TAG_PREFIX,DslDefinitionWidget,DslNodeWidget,DslRender,DslRenderWidget,$e as InnerWidgetType,PathWidget,ae as RENDER_OPTIONS_KEY,de as SLOTS_KEY,ce as SLOT_CONTEXT_KEY,Ne as ViewSubSymbol,we as ViewWidget,VueWidget,Widget,Pe as WidgetTagProps,pe as componentInstall,he as directiveInstall,ne as executeInvisible,je as genToken,fe as getWidget,me as getWidgetNotNull,re as isAllInvisible,ye as newVueWidget,Ae as onAllMounted,ge as pluginInstall,ve as renderWidgets,Oe as reportAllMounted};
16
+ function te(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function ie(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function ne(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function d(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,d)}a((n=n.apply(e,t||[])).next())})}Widget.widgetCount=0,Widget.widgetMap=new Map,Widget.attributeMap=new Map,Widget.protoChainsCache=new WeakMap,Widget.watchMap=new Map,Widget.nameContextMap=new Map;var oe,re=g({name:"VueFragment",inheritAttrs:!1,render(){var e,t;return v(f,void 0,(null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))||[])}});re.__file="src/basic/VueFragment.vue",function(e){e.beforeCreated="beforeCreated",e.created="created",e.beforeMount="beforeMount",e.mounted="mounted",e.beforeUpdate="beforeUpdate",e.updated="updated",e.activated="activated",e.deactivated="deactivated",e.beforeUnmount="beforeUnmount",e.unmounted="unmounted"}(oe||(oe={}));class VueWidget extends Widget{constructor(){super(...arguments),this.behaviorGroup={},this.node_code=this.revolveNodeCode()}revolveNodeCode(){return t()}setup(e){return(t,i)=>{this.__scope&&(this.__scope.stop(),this.__scope=null),this.__scope=y();let n={};return this.__scope.run(()=>{const{opt:o}=this;this.getAttributes().forEach((e,t)=>{const i=this.getComputeHandler(t);if(i)i.get&&(i.set?Reflect.set(n,t,m({get:i.get.bind(o),set:i.set.bind(o)})):Reflect.set(n,t,m(i.get.bind(o))));else{const i=Reflect.get(this,e);"function"==typeof i?Reflect.set(n,t,i.bind(o)):Reflect.set(n,t,W(i))}});this.getWatchers().forEach(e=>{const t=e.path.split("."),i=n[t[0]];i&&(1===t.length?b(i,e.handler.bind(o),e.options):b(()=>{let e=i.value||{};for(let i=1;i<t.length&&(e=e[t[i]],e);i++);return e},e.handler.bind(o),e.options))});const r=e&&e(t,i,n);r&&(n=Object.assign(Object.assign({},n),r)),this.res=n}),n}}static HookHost(){return(e,t)=>{const i=VueWidget.hookHosts.get(e.constructor)||[];i.push(t),VueWidget.hookHosts.set(e.constructor,i)}}static getHookHosts(e){const t=[];return(()=>{const t=[];let i=e.constructor,{name:n}=i;for(;""!==n;)n=i.name,t.push(i),i=Object.getPrototypeOf(i);return t})().forEach(e=>{const i=VueWidget.hookHosts.get(e);i&&i.forEach(e=>t.push(e))}),t}static getHooks(e,t,i){const n=(e=>{const t=[];let i=e;for(;""!==i.name;)t.push(i.name),i=Object.getPrototypeOf(i);return t})(Widget.select(e).constructor),o=[];return n.forEach(e=>{let n;n="after"===i?VueWidget.afterHooks.get(e):VueWidget.beforeHooks.get(e);(n&&n.get(t)||[]).forEach(e=>o.push(e))}),o}static BeforeHook(e){return(t,i,n)=>{const o=VueWidget.beforeHooks.get(t.constructor.name)||new Map,r=o.get(e)||[];r.push(n.value),o.set(e,r),VueWidget.beforeHooks.set(t.constructor.name,o)}}static AfterHook(e){return(t,i,n)=>{const o=VueWidget.afterHooks.get(t.constructor.name)||new Map,r=o.get(e)||[];r.push(n.value),o.set(e,r),VueWidget.afterHooks.set(t.constructor.name,o)}}getNodeCode(){return this.node_code}getNodeCodeRef(){return this.res.node_code}getOperator(){const{opt:e}=this;return e||this}createWidget(e,t,i,n,o=!1){const r=this.getOperator(),s=super.createWidget.bind(r)(e,t,i||{},n);o&&(r.node_code=this.revolveNodeCode());const d=s&&s.getOperator();return void 0!==n&&n>=0?this.getChildrenInstance()[n]=s.getOperator():this.addChildrenInstance(d),d}deleteWidget(e){const t=super.deleteWidget(e);return this.getOperator().node_code=this.revolveNodeCode(),t}insertWidget(e,t){super.insertWidget(e,t);this.getOperator().node_code=this.revolveNodeCode()}moveChildWidget(e,t){super.moveChildWidget(e,t);this.getOperator().node_code=this.revolveNodeCode()}deleteWidgetByIndex(e,t){const i=super.deleteWidgetByIndex(e,t);return this.getOperator().node_code=this.revolveNodeCode(),i}initialize(e={}){return super.initialize(e),this.component=re,this.buildOperator(),this}buildOperator(){const e=new Proxy(this,{get:(e,t)=>{if("isProxy"===t)return!0;if("constructor"===t)return this.constructor;const i=this.res||{},n=Reflect.get(i,t);return n?R(n)?(n.value,n.value):n:Reflect.get(e,t)},set:(e,t,i)=>{const n=this.res||{},o=Reflect.get(n,t);return"function"==typeof o?Reflect.set(n,t,i):R(o)?(o.value=i,!0):Reflect.set(e,t,i)}});this.opt=e,this.initialize=this.initialize.bind(e);return VueWidget.getHookHosts(this).forEach(t=>{const i=Reflect.get(this,t);Reflect.set(this,t,(...n)=>{if("render"===t)return i.apply(e,n);const o=e.executeBeforeHooks(t,n),r=i.apply(e,o);return e.executeAfterHooks(t,r)})}),e}getWidgetComponent(e=!1){let t=this.widgetComponent;return!t&&e&&(t=this.buildWidgetComponent(),this.widgetComponent=t),t}setWidgetComponent(e){this.widgetComponent=e}renderExpandComponent(){}getMixinComponent(){return this.mixinComponent}setMixinComponent(e){e&&(e=Object.assign({inheritAttrs:!1},e)),this.mixinComponent=e}render(e,t){return this.widgetComponent||(this.widgetComponent=this.buildWidgetComponent()),this.widgetComponent?this.renderWidgetComponent(this.widgetComponent,e,t):[]}getWidgetComponentName(){const{name:e}=this.constructor;return e}buildWidgetComponent(){let e=this.getComponent();if(!e)return;e=D(e);const t=this.getOperator(),i=this.getUsingComponents();return g({name:this.getWidgetComponentName(),components:i,inheritAttrs:!1,setup:this.setup(this.setupHook.bind(this)),beforeMount:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.beforeMount])||void 0===i||i.call(e),this.$$beforeMount.call(t),this.beforeMount.call(t)},mounted:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.mounted])||void 0===i||i.call(e),this.$$mounted.call(t),this.mounted.call(t)},beforeUpdate:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.beforeUpdate])||void 0===i||i.call(e),this.$$beforeUpdate.call(t),this.beforeUpdate.call(t)},updated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.updated])||void 0===i||i.call(e),this.$$updated.call(t),this.updated.call(t)},activated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.activated])||void 0===i||i.call(e),this.$$activated.call(t),this.activated.call(t)},deactivated:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.deactivated])||void 0===i||i.call(e),this.$$deactivated.call(t),this.deactivated.call(t)},beforeUnmount:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.beforeUnmount])||void 0===i||i.call(e),this.$$beforeUnmount.call(t),this.beforeUnmount.call(t)},unmounted:()=>{var e,i;null===(i=(e=this.behaviorGroup)[oe.unmounted])||void 0===i||i.call(e),this.unmounted.call(t),this.$$unmounted.call(t),this.$$unmountedAfterProperties.call(t)},render:t=>{const i=this.buildProps(t),{$slots:n}=t,o=this.resolveProps(e,i),r=n&&Object.keys(n).length?n:this.resolveChildren(),s=this.renderExpandComponent(),d={};if(s){const e=r.default?r.default():[];d.default=()=>[...e,s]}return this.renderMixinComponent(v(e,o,Object.assign(Object.assign({},r),d)),i)}})}resolveProps(e,t){return t}renderMixinComponent(e,t){const i=this.getMixinComponent();if(i){const n=e,o=this.resolveProps(i,t);e=v(i,o,{default:()=>n})}return e}renderWidgetComponent(e,t,i){return v(e,{},i)}buildProps(e){const t={},i=this.getAttributes(),n=this.getProps();return i.forEach((i,o)=>{n.includes(i)&&Reflect.set(t,i,Reflect.get(e,o))}),t["data-handle"]=this.getHandle(),t}buildPropsStrs(){const e=this.getProps(),t=[];return e.forEach(e=>t.push(e)),t}resolveChildren(){const e={},t=[],i=this.getChildren();return i.forEach(e=>{t.includes(e.getName())||t.push(e.getName())}),t.forEach(t=>{Reflect.set(e,t,(...e)=>i.filter(e=>e.getName()===t).map(t=>t.render(...e)))}),e}setupHook(e,t,i){var n,o,r,s;return null===(o=(n=this.behaviorGroup)[oe.beforeCreated])||void 0===o||o.call(n),this.$$beforeCreated(),this.beforeCreated(),null===(s=(r=this.behaviorGroup)[oe.created])||void 0===s||s.call(r),this.$$created(),this.created(),{}}setComponent(e){this.component=Object.assign({inheritAttrs:!1},e)}dispose(e=!1){super.dispose(e),this.opt=void 0;const t=null;this.__scope&&(this.__scope.stop(),this.__scope=t),this.component=t,this.mixinComponent=t,this.widgetComponent=t,e&&S(()=>{this.res={},this.__proto__=null})}getComponent(){const{name:e,__render__:t,__name__:i}=this.constructor;return t&&(this.component=g({name:i||e,props:this.buildPropsStrs(),render:t,components:this.getUsingComponents()})),this.component}getUsingComponents(){return{}}executeAfterHooks(e,t){const i=VueWidget.getHooks(this.getHandle(),e,"after");let n=0;const o={result:t},r=()=>{n<i.length&&i[n++].apply(this,[r,o])};return r(),o.result}executeBeforeHooks(e,...t){const i=VueWidget.getHooks(this.getHandle(),e,"before");let n=0;const o={args:t},r=()=>{n<i.length&&i[n++].apply(this,[r,o])};return r(),o.args}beforeCreated(){}$$beforeCreated(){}created(){}$$created(){}beforeMount(){}$$beforeMount(){}mounted(){}$$mounted(){}beforeUpdate(){}$$beforeUpdate(){}updated(){}$$updated(){}activated(){}$$activated(){}deactivated(){}$$deactivated(){}beforeUnmount(){}$$beforeUnmount(){}unmounted(){}$$unmounted(){}$$unmountedAfterProperties(){this.dispose()}registryBehavior(e,t){this.behaviorGroup[e]=t}reset(){this.widgetComponent=void 0,this.getParent().node_code=this.revolveNodeCode()}translate(e,t={}){const i=Reflect.get(window,"translate"),n=i?i(e):"";if(n===e||0===Object.keys(t).length)return n;return n.replace(/\{\s*([A-Z0-9_]+)\s*\}/gi,(e,i)=>t[i])}translateByI18n(e){return d(e)||e}genStaticPath(e){return a(e)}forceUpdate(){const e=this.getOperator();e&&(e.node_code=this.revolveNodeCode())}}VueWidget.beforeHooks=new Map,VueWidget.afterHooks=new Map,VueWidget.hookHosts=new Map,te([Widget.Reactive(),ie("design:type",String)],VueWidget.prototype,"node_code",void 0),te([VueWidget.HookHost(),ie("design:type",Function),ie("design:paramtypes",[Object,Object]),ie("design:returntype",Object)],VueWidget.prototype,"render",null),te([Widget.Reactive(),ie("design:type",Function),ie("design:paramtypes",[Object,Object]),ie("design:returntype",String)],VueWidget.prototype,"translate",null),te([Widget.Reactive(),ie("design:type",Function),ie("design:paramtypes",[String]),ie("design:returntype",String)],VueWidget.prototype,"translateByI18n",null),te([Widget.Method(),ie("design:type",Function),ie("design:paramtypes",[String]),ie("design:returntype",void 0)],VueWidget.prototype,"genStaticPath",null);class AsyncVueWidget extends VueWidget{setup(e){const t=super.setup();return(i,n)=>ne(this,void 0,void 0,function*(){const o=t(i,n),r=e&&(yield e(i,n))||{};for(const e in r)Reflect.set(o,e,Reflect.get(r,e));return o})}render(e){return C("div",C(w,super.render(e)))}setupHook(e,t,i){return ne(this,void 0,void 0,function*(){return yield this.beforeCreated(),yield this.created(),{}})}}class DslNodeWidget extends VueWidget{get widgetPath(){let e=this.parentPath||"";const{subPath:t,subIndex:i}=this;return t&&(e=e?`${e}.${t}`:t),null!=i&&(e=`${e}[${i}]`),e}get variables(){return B.resolveVariables(this.getDsl())}initialize(e){var t;super.initialize(e),this.dslNode=e.dslNode,this.metadataHandle=e.metadataHandle,this.rootHandle=e.rootHandle,this.template=e.template,this.slotName=e.slotName,this.widgetInline=e.widgetInline,this.currentHandle=this.getHandle();const{subPath:i,subIndex:n}=e;return this.subPath=i||(null===(t=this.template)||void 0===t?void 0:t.dslNodeType)||"",I(n)?this.subIndex=e.__index:this.subIndex=n,this}getDsl(){return this.dslNode||{}}getSlotName(){return this.slotName}getDslChildrenByLabel(e){return this.dslNode?(this.dslNode.children||[]).find(t=>t.tagName===e.toUpperCase()):null}get metadataRuntimeContext(){const{metadataHandle:e}=this;if(e)return c.get(e)}get rootRuntimeContext(){const{rootHandle:e}=this;if(e)return c.get(e)}}function se(e){const t=null==e?void 0:e.invisible;return!I(t)&&(H(t)?t:t())}function de(e){return!e||!e.length||e.every(e=>se(e))}te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"metadataHandle",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"rootHandle",void 0),te([Widget.Reactive(),ie("design:type",String)],DslNodeWidget.prototype,"currentHandle",void 0),te([Widget.Reactive({render:!1}),ie("design:type",Object)],DslNodeWidget.prototype,"dslNode",void 0),te([Widget.Reactive({render:!1}),ie("design:type",Object)],DslNodeWidget.prototype,"template",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"slotName",void 0),te([Widget.Reactive(),Widget.Inject("path"),ie("design:type",Object)],DslNodeWidget.prototype,"parentPath",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"subPath",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"subIndex",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[])],DslNodeWidget.prototype,"widgetPath",null),te([Widget.Reactive(),ie("design:type",Object)],DslNodeWidget.prototype,"widgetInline",void 0),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],DslNodeWidget.prototype,"variables",null);const ae="oinone",ce="__slots",le="__render__options",ue="slotContext",pe=["div","a","span","table","form","detail","ul","li","h1","h2","h3","h4","h5","h6","p","thead","tbody","tr","th","td"];function he(e,t,i){let n=e[t];if(delete e[t],!n&&i){n=i;const{dslDefinition:o}=e;o&&(o[t]=i)}return n}class DslRender{static render(e,t=k,i,n){const o=DslRender.fetchComponent(e);if(o)return DslRender.createVNodeWithDslDefinition(o,e,t,i,n)}static renderSlots(e){const t={};for(const i in e)t[i]=A(t=>{var n;return DslRender.createVNodeChildren(null===(n=e[i])||void 0===n?void 0:n.widgets,i,t)});return t}static fetchVNodeSlots(e,t){var i;if(!e)return;const n=e[ce];if(n)return n;if(!t){const n=[k];null===(i=e.widgets)||void 0===i||i.forEach(e=>{if(U.isTemplate(e)){let t=e.slot;t||(t=k),n.push(t)}}),t=[...new Set(n)]}const o=T.fetchSlotsBySlotNames(e,t);return DslRender.renderSlots(o)}static fetchComponent(e){let t,{dslNodeType:i}=e||{};switch(i||(i=F.ELEMENT),i){case F.VIEW:t=$(`${ae}-${e.dslNodeType}`);break;case F.PACK:{const i=e;t=DslRender.resolveWidgetComponent(`${i.widget||"group"}`),"string"==typeof t&&(t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`));break}case F.ELEMENT:{const i=e;t=DslRender.resolveWidgetComponent(`${i.widget}`),"string"==typeof t&&(t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`));break}case F.ACTION:case F.FIELD:t=DslRender.resolveWidgetComponent(`${e.dslNodeType}`);break;case F.UNKNOWN:case F.SLOT:case F.TEMPLATE:t=null;break;default:t=DslRender.resolveCommonWidgetComponent(i)}return t}static createVNodeChildren(e,t,i,n){const o=[];if(!e)return o;t||(t=k),I(n)&&(n=0);const{length:r}=e;for(let s=0;s<r;s++){const r=e[s],d=DslRender.fetchComponent(r);if(d)o.push(DslRender.createVNodeWithDslDefinition(d,r,t,_(d)?DslRender.fetchVNodeSlots(r):void 0,i?{slotContext:i}:void 0,s+n));else if(null===d){const{dslNodeType:e}=r;switch(e){case F.SLOT:{const e=DslRender.createVNodeChildren(r.widgets,t,i,s+n);n+=e.length,e.forEach(e=>o.push(e));break}case F.UNKNOWN:case F.TEMPLATE:continue;default:console.error("Invalid component.")}}}return o}static createVNodeWithDslDefinition(e,i,n,o,r,s){var d;I(s)||i.__index===s||(i.__index=s);const a=_(e),c=a?G.collectionBasicProps(i):Object.assign(Object.assign({},i),{dslDefinition:Object.assign({},i),slotName:n});let l;l=a&&i.__content||he(c,ce,o);const u=he(c,le,r),p=null==u?void 0:u.slotContext;if(p){const e=null==r?void 0:r.slotContext;e&&(u.slotContext=e),c.slotContext=p}if(DslRenderHelper.predictIsUpdateKey(i,u)){const e=t();i.key=e,c.key=e}DslRenderHelper.predictIsRecursion(u)&&!l&&(null===(d=i.widgets)||void 0===d?void 0:d.length)&&(l=DslRender.fetchVNodeSlots(i));let h=null==u?void 0:u.dynamicProps;return p&&(h=E(h||[],[ue])),v(e,c,l,null==u?void 0:u.patchFlag,h,null==u?void 0:u.isBlockNode)}static resolveCommonWidgetComponent(e){let t=DslRender.resolveCommonComponentCache[e];return t||(pe.includes(e)?e:(t=$(`${ae}-${i.camelCaseToKebabCase(e)}`),"string"==typeof t&&(t=$(e)),DslRender.resolveCommonComponentCache[e]=t,t))}static resolveWidgetComponent(e){let t=DslRender.resolveComponentCache[e];if(t)return t;if(pe.includes(e))return e;if(t=$(e),"string"==typeof t)for(const i of DslRender.resolveMethods){const n=i(e);if(n){const e=$(n);if("string"!=typeof e){t=e;break}}}return DslRender.resolveComponentCache[e]=t,t}}DslRender.resolveComponentCache={},DslRender.resolveCommonComponentCache={},DslRender.resolveMethods=[e=>{if(-1===e.indexOf("-")){const t=e.charCodeAt(0);if(t>=i.UPPER_A_ASCLL&&t<=i.UPPER_Z_ASCLL)return`${e[0].toLowerCase()}${e.substring(1)}`}},e=>{if(-1===e.indexOf("-")){const t=e.charCodeAt(0);if(t>=i.LOWER_A_ASCLL&&t<=i.LOWER_Z_ASCLL)return`${e[0].toUpperCase()}${e.substring(1)}`}},e=>i.camelCaseToKebabCase(e)];class DslRenderHelper{static predictIsUpdateKey(e,t){const i=(null==t?void 0:t.dynamicKey)||!1,n=(null==t?void 0:t.focusUpdate)||!1;if(e.key){if(n)return!0}else if(i)return!0;return!1}static predictIsRecursion(e){return(null==e?void 0:e.recursion)||!1}}function ge(e,t){t||(t=e.name);const i=c.createOrReplace().frameworkInstance;t?"string"==typeof t?i.component(t,e):t.forEach(t=>i.component(t,e)):Q()&&console.warn("component install error. reason: name is blank.",e)}function ve(e,t){c.createOrReplace().frameworkInstance.directive(t,e)}function fe(e,...t){c.createOrReplace().frameworkInstance.use(e,...t)}function ye(e,t,i){let n;const{length:o}=e;for(let r=o-1;r>=0;r--){const o=e[r];if(n){const e=Array.isArray(n)?n:[n];n=o.render(t,Object.assign({default:()=>e},K))}else n=o.render(t,Object.assign(Object.assign({},i),K))}return n}function me(){return new VueWidget}function We(e){return n.cast(Widget.select(e))}function be(e){return We(e)||me()}class DslRenderWidget extends VueWidget{constructor(){super(...arguments),this.internal=!1}initialize(e){return super.initialize(e),this.internal=e.internal||!1,this.template=e.template,this.slotName=e.slotName,this.supportedSlotNames=e.slotNames||[],this.template&&this.supportedSlotNames.length&&(this.dslSlots=T.fetchSlotsBySlotNames(this.template,this.supportedSlotNames)),this}getDsl(){return this.template||z}getSlotName(){return this.slotName}render(e,t){return this.template&&(void 0===this.slots&&(this.internal?this.slots=this.internalRender(t)||null:this.slots=this.commonRender(t)||null),this.slots)?this.rawRender(e,this.slots):this.rawRender(e,t)}rawRender(e,t){return super.render(e,t)}internalRender(e){return e&&Object.keys(e).length?e:this.dslSlots&&Object.keys(this.dslSlots).length?DslRender.renderSlots(this.dslSlots):void 0}commonRender(e){return this.dslSlots&&Object.keys(this.dslSlots).length?DslRender.renderSlots(this.dslSlots):e&&Object.keys(e).length?e:void 0}}te([Widget.Reactive(),ie("design:type",Object)],DslRenderWidget.prototype,"internal",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslRenderWidget.prototype,"template",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslRenderWidget.prototype,"slotName",void 0);class DslDefinitionWidget extends DslRenderWidget{constructor(e){super(e),this.automatic=!1,this.defaultAllInvisible=!1,this.invisibleState=!1,this.currentHandle=this.getHandle()}getMetadataHandle(){return this.metadataHandle}get class(){return this.getDsl().class}get style(){return this.getDsl().style}getRootHandle(){return this.rootHandle}getCurrentHandle(){return this.currentHandle}get allInvisible(){const{allInvisible:e}=this.getDsl();return I(e)?this.defaultAllInvisible:o.toBoolean(e)}get invisible(){let{invisible:e}=this.getDsl();return e=!I(e)&&this.invisibleProcess(e),e||!!this.allInvisible&&(this.invisibleState=this.childrenInvisibleProcess(),this.invisibleState)}get parentInvisibleProvider(){return this.parentInvisible||this.invisible}initialize(e){return super.initialize(e),this.metadataHandle=e.metadataHandle,this.rootHandle=e.rootHandle,this.automatic=e.automatic||!1,this.inline=e.inline,this}get metadataRuntimeContext(){const e=this.metadataRuntimeContextNullable;if(!e)throw new Error("Invalid metadata runtime context.");return e}get metadataRuntimeContextNullable(){const{metadataHandle:e}=this;let t;return e&&(t=c.get(e)),t}get rootRuntimeContext(){const e=this.rootRuntimeContextNullable;if(!e)throw new Error("Invalid root runtime context.");return e}get rootRuntimeContextNullable(){const{rootHandle:e}=this;let t;return e&&(t=c.get(e)),t}get rootComputeContext(){const{rootHandle:e}=this;let t;return e&&(t=l.get(e)),t}get rootViewRuntimeContext(){var e,t,i;const n=[];let o=this.rootRuntimeContext,r=null===(e=null==o?void 0:o.parentContext)||void 0===e?void 0:e.field;for(;r&&o;){n.push(r);const e=null===(t=null==o?void 0:o.parentContext)||void 0===t?void 0:t.handle;if(!e)throw new Error("Invalid field runtime context handle");const s=null===(i=Widget.select(e))||void 0===i?void 0:i.rootRuntimeContext,d=null==s?void 0:s.parentContext;if(!d||d.handle===u)break;r=d.field,o=s}return{runtimeContext:o,fields:n}}getMergeConfig(...e){if(this.cacheConfigProxy)return this.cacheConfigProxy;const t=L(e,{defaultValue:void 0});return this.cacheConfigProxy=new Proxy(this.getDsl(),{get:(e,i)=>i in e?e[i]:t[i]}),this.cacheConfigProxy}invisibleProcess(e){return o.toBoolean(e)}childrenInvisibleProcess(){return de(this.getChildren())}resetInvisible(){this.allInvisible&&(this.invisibleState=this.childrenInvisibleProcess())}resetParentInvisible(){var e,t;null===(t=null===(e=this.getParent())||void 0===e?void 0:e.resetInvisible)||void 0===t||t.call(e)}$$mounted(){super.$$mounted(),this.resetInvisible(),this.lastedInvisibleState=this.invisible}$$updated(){super.$$updated();const{lastedInvisibleState:e,invisible:t}=this;this.lastedInvisibleState=t,e!==t&&this.resetParentInvisible()}$$unmountedAfterProperties(){super.$$unmountedAfterProperties(),this.automatic||this.metadataHandle!==this.rootHandle||c.delete(this.metadataHandle)}allMounted(){this.resetInvisible()}}te([Widget.Reactive(),ie("design:type",Object)],DslDefinitionWidget.prototype,"automatic",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslDefinitionWidget.prototype,"metadataHandle",void 0),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],DslDefinitionWidget.prototype,"class",null),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],DslDefinitionWidget.prototype,"style",null),te([Widget.Reactive(),ie("design:type",Object)],DslDefinitionWidget.prototype,"rootHandle",void 0),te([Widget.Reactive(),ie("design:type",String)],DslDefinitionWidget.prototype,"currentHandle",void 0),te([Widget.Reactive(),ie("design:type",Object)],DslDefinitionWidget.prototype,"inline",void 0),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],DslDefinitionWidget.prototype,"allInvisible",null),te([Widget.Reactive(),ie("design:type",Object)],DslDefinitionWidget.prototype,"invisibleState",void 0),te([Widget.Reactive(),Widget.Inject(),ie("design:type",Object)],DslDefinitionWidget.prototype,"parentInvisible",void 0),te([Widget.Reactive(),ie("design:type",Boolean),ie("design:paramtypes",[])],DslDefinitionWidget.prototype,"invisible",null),te([Widget.Reactive(),Widget.Provide("parentInvisible"),ie("design:type",Object),ie("design:paramtypes",[])],DslDefinitionWidget.prototype,"parentInvisibleProvider",null),te([Widget.Method(),ie("design:type",Function),ie("design:paramtypes",[]),ie("design:returntype",void 0)],DslDefinitionWidget.prototype,"allMounted",null);class PathWidget extends DslDefinitionWidget{get path(){const{parentPath:e,subPath:t,subIndex:i,currentPath:n}=this;if(I(n)){let n=e||"";return this.internal||t&&(n=n?`${n}.${t}`:t,null!=i&&(n=`${n}[${i}]`)),n}return n}initialize(e){var t;super.initialize(e);const{subPath:i,subIndex:n,path:o}=e;return this.currentPath=o,this.subPath=i||(null===(t=this.template)||void 0===t?void 0:t.dslNodeType)||"",I(n)?this.subIndex=e.__index:this.subIndex=n,this}}function Re(e){return e.viewType===q.Table}function De(e){return e.viewType===q.Search}function Se(e){return e.viewType===q.Form}function Ce(e){return e.viewType===q.Detail}function we(e){return e.viewType===q.Gallery}function Ae(e){return e.viewType===q.Tree}function $e(e){return e.viewType===q.Table||e.viewType===q.Gallery}function Oe(e){return e.viewType===q.Form||e.viewType===q.Detail||e.viewType===q.Search}function Me(e){const{viewType:t}=e;return!!t&&(t===q.Table||t===q.Form||t===q.Detail)}function je(e){const{viewType:t}=e;return!!t&&t!==q.Search}function Pe(e){const{viewType:t}=e;return!!t&&(t===q.Table||t===q.Gallery)}te([Widget.Reactive(),Widget.Inject("path"),ie("design:type",Object)],PathWidget.prototype,"parentPath",void 0),te([Widget.Reactive(),ie("design:type",Object)],PathWidget.prototype,"subPath",void 0),te([Widget.Reactive(),ie("design:type",Object)],PathWidget.prototype,"subIndex",void 0),te([Widget.Reactive(),ie("design:type",Object)],PathWidget.prototype,"currentPath",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[])],PathWidget.prototype,"path",null);const Ne={viewType:m(()=>q.Form),model:m(()=>""),modelName:m(()=>""),module:m(()=>""),moduleName:m(()=>""),metadataHandle:m(()=>""),rootHandle:m(()=>""),parentHandle:m(()=>""),slotName:m(()=>{}),inline:m(()=>!1)},Ve=Symbol("MetaContext"),Ie=e=>{O(Ve,Object.assign(Object.assign({},Ne),e))},He=()=>M(Ve,Ne);const _e=j({fullscreen:!1});function Ee(e,t){var i;if(null==t){if(Me(e))return e}else if(we(e))return null===(i=e.cards)||void 0===i?void 0:i[t]}const xe={},Be={pushField:function(e,t){const i=Ee(this,t);if(!i)return;const{fields:n,fieldWidgets:o}=i;n&&(n.some(t=>t===e)||(n.push(e),i.fields=[...n]))},popField:function(e,t){const i=Ee(this,t);if(!i)return;const{fields:n}=i;if(!n)return;const o=n.findIndex(t=>t===e);-1!==o&&(n.splice(o,1),i.fields=[...n])},createActionBarState:function(e){const t=Object.assign({actions:[],visibleActions:[]},e);return Object.defineProperty(t,"visibleActions",{get(){return this.actions.filter(e=>{const t=Widget.select(e);return!!t&&!se(t)})}}),j(t)},getActionBarState:function(e){var t;if(null==e){const e=this.__position[this.__position.length-1];if(null==e)return console.warn("Please call getActionBarState method in the vue lifecycle."),this.actionBar;const{slotName:t}=e;if(t&&t!==k){if(je(this))return this.actionBars[t]}else if(je(this))return this.actionBar}else if(Pe(this))return null===(t=this.inlineActionBars)||void 0===t?void 0:t[e]},pushAction:function(e,t){const i=this.getActionBarState(t);if(!i)return;const{actions:n}=i;n&&(n.some(t=>t===e)||(n.push(e),i.actions=[...n]))},popAction:function(e,t){const i=this.getActionBarState(t);if(!i)return;const{actions:n}=i;if(!n)return;const o=n.findIndex(t=>t===e);-1!==o&&(n.splice(o,1),i.actions=[...n])}};function ke(e){const t={get handle(){return e},fullscreen:!1,__position:[]},i=j(t);for(const[e,n]of Object.entries(Be))t[e]=n.bind(i);return i}function Ue(e){var t;if(e||(e=null===(t=He())||void 0===t?void 0:t.rootHandle.value))return xe[e];console.warn("Invalid root handle.")}function Te(e){var t;if(!e&&!(e=null===(t=He())||void 0===t?void 0:t.rootHandle.value))return void console.warn("Invalid root handle.");const i=xe[e];return delete xe[e],i}function Fe(e){return e?{globalState:_e,viewState:Ue(e),createViewState:()=>{const t=ke(e);return function(e){xe[e.handle]=e}(t),t},getViewState:()=>Ue(e),clearViewState:()=>Te(e)}:{globalState:_e,viewState:Ue(),createViewState:ke,getViewState:Ue,clearViewState:Te}}class ActiveRecordsWidget extends PathWidget{getViewState(){return this.viewState}setViewState(e){this.viewState=e}initialize(e){super.initialize(e);const{dataSource:t,activeRecords:i}=e;return this.setCurrentDataSource(t),this.setCurrentActiveRecords(i),this}get submitCache(){var e;return null===(e=this.metadataRuntimeContext.field)||void 0===e?void 0:e.submitCache}get rootData(){return this.currentRootData||this.parentRootData}set rootData(e){this.currentRootData=e}getCurrentRootData(){return this.currentRootData}setCurrentRootData(e){this.currentRootData=p.repairRecordsNullable(e)}reloadRootData(e){this.parentReloadRootData&&void 0===this.currentRootData?this.parentReloadRootData(e):this.setCurrentRootData(e)}get dataSource(){return this.currentDataSource||this.parentDataSource}set dataSource(e){this.currentDataSource=e}getCurrentDataSource(){return this.currentDataSource}setCurrentDataSource(e){this.currentDataSource=p.repairRecordsNullable(e),this.parentRootData||(this.currentRootData=this.currentDataSource||void 0)}reloadDataSource(e){this.parentReloadDataSource&&void 0===this.getCurrentDataSource()?this.parentReloadDataSource(e):this.setCurrentDataSource(e)}pushDataSource(e,t,i){if(this.parentPushDataSource&&void 0===this.getCurrentDataSource())this.parentPushDataSource(e,t);else{let n=t;const{submitCache:o}=this;o&&!n&&(n=p.defaultPushPredict.bind(o));const r=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).push(e,n,i).get();o||this.setCurrentDataSource(r)}}updateDataSource(e){if(this.parentUpdateDataSource&&void 0===this.getCurrentDataSource())this.parentUpdateDataSource(e);else{const t=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).update(e).get();this.submitCache||this.setCurrentDataSource(t)}}updateDataSourceByEntity(e,t){if(this.parentUpdateDataSourceByEntity&&void 0===this.getCurrentDataSource())this.parentUpdateDataSourceByEntity(e,t);else{const i=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).updateByEntity(e,t).get();this.submitCache||this.setCurrentDataSource(i)}}deleteDataSource(e){if(this.parentDeleteDataSource&&void 0===this.getCurrentDataSource())this.parentDeleteDataSource(e);else{const t=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).delete(e).get();this.submitCache||this.setCurrentDataSource(t)}}deleteDataSourceByEntity(e,t){if(this.parentDeleteDataSourceByEntity&&void 0===this.getCurrentDataSource())this.parentDeleteDataSourceByEntity(e,t);else{const i=p.operator(this.getCurrentDataSource()||void 0,this.submitCache).deleteByEntity(e,t).get();this.submitCache||this.setCurrentDataSource(i)}}flushDataSource(){var e;null===(e=this.parentFlushDataSource)||void 0===e||e.call(this)}get activeRecords(){return this.currentActiveRecords||this.parentActiveRecords}set activeRecords(e){this.currentActiveRecords=e}getCurrentActiveRecords(){return this.currentActiveRecords}setCurrentActiveRecords(e){e!==this.currentActiveRecords&&(this.currentActiveRecords=p.repairRecordsNullable(e))}reloadActiveRecords(e){this.parentReloadActiveRecords&&void 0===this.getCurrentDataSource()?this.parentReloadActiveRecords(e):this.setCurrentActiveRecords(e)}pushActiveRecords(e,t){this.parentPushActiveRecords&&void 0===this.getCurrentDataSource()?this.parentPushActiveRecords(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).push(e,t).get()}updateActiveRecords(e){this.parentUpdateActiveRecords&&void 0===this.getCurrentDataSource()?this.parentUpdateActiveRecords(e):this.currentActiveRecords=p.operator(this.currentActiveRecords).update(e).get()}updateActiveRecordsByEntity(e,t){this.parentUpdateActiveRecordsByEntity&&void 0===this.getCurrentDataSource()?this.parentUpdateActiveRecordsByEntity(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).updateByEntity(e,t).get()}deleteActiveRecords(e){this.parentDeleteActiveRecords&&void 0===this.getCurrentDataSource()?this.parentDeleteActiveRecords(e):this.currentActiveRecords=p.operator(this.currentActiveRecords).delete(e).get()}deleteActiveRecordsByEntity(e,t){this.parentDeleteActiveRecordsByEntity&&void 0===this.getCurrentDataSource()?this.parentDeleteActiveRecordsByEntity(e,t):this.currentActiveRecords=p.operator(this.currentActiveRecords).deleteByEntity(e,t).get()}flushActiveRecords(){this.parentFlushActiveRecords&&void 0===this.getCurrentDataSource()?this.parentFlushActiveRecords():this.currentActiveRecords=[]}$$initViewStatePosition(e){}$$clearViewStatePosition(e){}$$initViewState(e){}$$clearViewState(e){}$$beforeMount(){super.$$beforeMount();let e=!1;this.viewState||(this.viewState=Fe().viewState,this.viewState&&(e=!0,this.$$initViewStatePosition(this.viewState),this.$$initViewState(this.viewState))),this.viewState&&!e&&this.$$initViewStatePosition(this.viewState)}$$mounted(){super.$$mounted(),this.viewState&&(this.$$clearViewStatePosition(this.viewState),this.$$clearViewState(this.viewState))}$$beforeUnmount(){super.$$beforeUnmount(),this.viewState&&this.$$initViewStatePosition(this.viewState)}$$unmounted(){super.$$unmounted(),this.viewState&&this.$$clearViewStatePosition(this.viewState)}}te([Widget.Reactive(),Widget.Inject("rootData"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentRootData",void 0),te([Widget.Reactive(),ie("design:type",Object)],ActiveRecordsWidget.prototype,"currentRootData",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"rootData",null),te([Widget.Method(),Widget.Inject("reloadRootData"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadRootData",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadRootData",null),te([Widget.Reactive(),Widget.Inject("dataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentDataSource",void 0),te([Widget.Reactive(),ie("design:type",Object)],ActiveRecordsWidget.prototype,"currentDataSource",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"dataSource",null),te([Widget.Method(),Widget.Inject("reloadDataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadDataSource",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadDataSource",null),te([Widget.Method(),Widget.Inject("pushDataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentPushDataSource",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function,Number]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"pushDataSource",null),te([Widget.Method(),Widget.Inject("updateDataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateDataSource",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Array]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateDataSource",null),te([Widget.Method(),Widget.Inject("updateDataSourceByEntity"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateDataSourceByEntity",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateDataSourceByEntity",null),te([Widget.Method(),Widget.Inject("deleteDataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteDataSource",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Array]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteDataSource",null),te([Widget.Method(),Widget.Inject("deleteDataSourceByEntity"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteDataSourceByEntity",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteDataSourceByEntity",null),te([Widget.Method(),Widget.Inject("flushDataSource"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentFlushDataSource",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"flushDataSource",null),te([Widget.Reactive(),Widget.Inject("activeRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentActiveRecords",void 0),te([Widget.Reactive(),Widget.Inject("parentViewActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentViewActiveRecords",void 0),te([Widget.Reactive(),ie("design:type",Object)],ActiveRecordsWidget.prototype,"currentActiveRecords",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[Object])],ActiveRecordsWidget.prototype,"activeRecords",null),te([Widget.Method(),Widget.Inject("reloadActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentReloadActiveRecords",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"reloadActiveRecords",null),te([Widget.Method(),Widget.Inject("pushActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentPushActiveRecords",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"pushActiveRecords",null),te([Widget.Method(),Widget.Inject("updateActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateActiveRecords",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Array]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateActiveRecords",null),te([Widget.Method(),Widget.Inject("updateActiveRecordsByEntity"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentUpdateActiveRecordsByEntity",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"updateActiveRecordsByEntity",null),te([Widget.Method(),Widget.Inject("deleteActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteActiveRecords",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Array]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteActiveRecords",null),te([Widget.Method(),Widget.Inject("deleteActiveRecordsByEntity"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentDeleteActiveRecordsByEntity",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[Object,Function]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"deleteActiveRecordsByEntity",null),te([Widget.Method(),Widget.Inject("flushActiveRecords"),ie("design:type",Object)],ActiveRecordsWidget.prototype,"parentFlushActiveRecords",void 0),te([Widget.Method(),Widget.Provide(),ie("design:type",Function),ie("design:paramtypes",[]),ie("design:returntype",void 0)],ActiveRecordsWidget.prototype,"flushActiveRecords",null);const ze={reportBeforeMount:()=>{},reportMounted:()=>{},reportUnmounted:()=>{},reportAllBeforeMount:()=>{},reportAllMounted:()=>{},reportAllUnmounted:()=>{}},Le=Symbol("AllMountedContext"),Ge=e=>{O(Le,Object.assign(Object.assign({},ze),e))},Ke=()=>M(Le,ze);function Qe(e,t){return!!Object.values(e).every(e=>e)&&(t(),!0)}let Ze=0;function qe(e){if(!e)return void console.warn("all mounted method or object is required.");let t,i;x(e)?t=e:i=e;const{reportAllBeforeMount:n,reportAllMounted:o,reportAllUnmounted:r}=Ke(),s="all-mounted#"+Ze++,d={},a={};Ge({reportBeforeMount:e=>{const t=d[e];I(t)&&(d[e]=!1),null==n||n(s)},reportMounted:e=>{const n=d[e];I(n)||n||(d[e]=!0,Qe(d,(null==i?void 0:i.allMounted)||t||(()=>({})))&&(null==o||o(s)))},reportUnmounted:e=>{delete d[e],null==r||r(s)},reportAllBeforeMount:e=>{const t=a[e];I(t)&&(a[e]=!1)},reportAllMounted:e=>{const t=a[e];I(t)||t||(a[e]=!0,Qe(a,(null==i?void 0:i.allMountedUpdate)||(()=>({}))))},reportAllUnmounted:e=>{delete a[e]}})}let Je=0;function Xe(e){const{reportBeforeMount:t,reportMounted:i,reportUnmounted:n}=Ke(),o="mounted-#"+Je++;P(()=>{var i;const n=null===(i=null==e?void 0:e.onBeforeMount)||void 0===i?void 0:i.call(e);n instanceof Promise?n.then(()=>{null==t||t(o)}):null==t||t(o)}),N(()=>{var t;const n=null===(t=null==e?void 0:e.onMounted)||void 0===t?void 0:t.call(e);n instanceof Promise?n.then(()=>{null==i||i(o)}):null==i||i(o)}),V(()=>{var t;const i=null===(t=null==e?void 0:e.onUnmounted)||void 0===t?void 0:t.call(e);i instanceof Promise?i.then(()=>{null==n||n(o)}):null==n||n(o)}),Ge({})}const Ye=e=>X(`[vue-kunlun]: ${e}`),et={handle:{type:String},dslDefinition:{type:Object},slotName:{type:String},inline:{type:Boolean,default:void 0},slotContext:{type:Object}};var tt;!function(e){e.Action="Action",e.Field="Field",e.Element="Element",e.View="View",e.Mask="Mask"}(tt||(tt={}));let it=class ViewWidget extends DslNodeWidget{constructor(){super(...arguments),this.loading=!1,this.currentRoute={},this.domain="",this.isRootView=!0,this.isDialogView=!1,this.selfHandleStr="",this.model=null,this.type="UNKNOWN",this.initQueryParams=null}getVM(){return this.$$vm}setVM(e){this.$$vm=e}setBusy(e){this.getVM().setBusy(e)}getUrlParams(){const{page:e={}}=Z().matched.segmentParams;return e}getBusy(){return this.loading}initialize(e){return null==e.isRootView&&(e.isRootView=!0),super.initialize(e),this.isRootView=e.isRootView||!1,e.view&&(this.view=e.view),null==this.rootHandleStr&&e.isRootWidget&&(this.currentRootHandlerStr=this.getHandle()),this.selfHandleStr=this.getHandle(),this.isDialogView=e.isDialogView||!1,this.model=e.model,this.setVM(new h({view:e.view,dslNode:e.dslNode,model:e.model,isRootWidget:!1!==e.isRootWidget||e.isRootWidget,isDialogView:e.isDialogView||!1,isRootView:e.isRootView})),this.getVM().isRootWidget=this.isRoot,this.getVM().isDialogView=this.isDialogView,this}get rootHandleStr(){return this.currentRootHandlerStr||this.parentRootHandlerStr}on(e,t){this.getVM().on(e,t)}watch(e,t){this.getVM().watch(e,t)}filterWatchData(e,t,i){return this.getVM().filterWatchData(e,t,i)}get isRoot(){return this.rootHandleStr===this.getHandle()}get useConstruct(){return this.isRoot||this.isDialogView}get viewElement(){return J(this.dslNode)}resolveTemplate(){}fetchData(e,t,i){return{}}onRowsChange(e){}loadData(e,t){return{}}loadRootData(e){this.getVM().setRootData(e)}setRootDataByKey(e,t){const i=this.getVM().getRootData();i&&(i[e]=t,this.getVM().setRootData(i))}submit(){return{}}getData(){return this.getVM().getData()}setData(e){this.getVM().setData(e)}validator(){return ne(this,void 0,void 0,function*(){return[]})}loadMetadata(e,t,i,n){this.getVM().loadMetadata(e,t,i,n),this.model=this.getVM().getModel(),this.view=this.getVM().getView(),this.dslNode||(this.dslNode=t||this.getVM().getDslNode())}getActiveRecords(){return[]}setDomain(e){this.domain=e}getDomain(){return this.domain}setFilter(e){this.filter=e}getFilter(){return this.filter}getModel(){return this.getVM().getModel()}getView(){return this.getVM().getView()}getPath(){return this.path}notify(e){this.getVM().notify(e)}$$beforeCreated(){const{initQueryParams:e="{}"}=this.getUrlParams();try{const t=JSON.parse(e);this.initQueryParams=Object.keys(t).length?t:null}catch(e){this.initQueryParams=null}this.notify(ee.ON_VIEW_BEFORE_CREATED)}$$created(){this.notify(ee.ON_VIEW_CREATED)}$$beforeMount(){this.notify(ee.ON_VIEW_BEFORE_MOUNT)}$$mounted(){this.getVM().setPageViewState("mount"),this.getVM().watchLoading(e=>{this.loading=e});const{getMatched$:e}=Z();this.subjectRoute$=e().subscribe(e=>{this.currentRoute=e}),this.notify(ee.ON_VIEW_MOUNTED)}$$beforeUpdate(){this.notify(ee.ON_VIEW_BEFORE_UPDATE)}$$updated(){this.notify(ee.ON_VIEW_UPDATED)}$$beforeUnmount(){this.notify(ee.ON_VIEW_BEFORE_UNMOUNT)}$$unmounted(){this.getVM().setPageViewState("unmount");const e=setTimeout(()=>{"unmount"===this.getVM().getPageViewState()&&(this.notify(ee.ON_VIEW_UNMOUNTED),this.getVM().unsubscribe()),clearTimeout(e)})}};te([Widget.Reactive(),ie("design:type",Object)],it.prototype,"loading",void 0),te([Widget.Inject(),Widget.Reactive(),ie("design:type",String)],it.prototype,"filter",void 0),te([Widget.Reactive(),Widget.Inject("rootHandleStr"),ie("design:type",Object)],it.prototype,"parentRootHandlerStr",void 0),te([Widget.Reactive(),ie("design:type",Object)],it.prototype,"currentRootHandlerStr",void 0),te([Widget.Reactive(),Widget.Provide(),ie("design:type",Object),ie("design:paramtypes",[])],it.prototype,"rootHandleStr",null),te([Widget.Reactive(),ie("design:type",Object)],it.prototype,"isRootView",void 0),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],it.prototype,"isRoot",null),te([Widget.Reactive(),ie("design:type",Object),ie("design:paramtypes",[])],it.prototype,"useConstruct",null),te([Widget.Provide(),ie("design:type",Object)],it.prototype,"selfHandleStr",void 0),te([Widget.Reactive(),Widget.Provide("view"),ie("design:type",Object)],it.prototype,"view",void 0),te([Widget.Reactive(),Widget.Provide("viewModel"),ie("design:type",Object)],it.prototype,"model",void 0),te([Widget.Reactive(),ie("design:type",String)],it.prototype,"path",void 0),it=te([Y.Base("View",["id","name","type","model","widget","tagName"])],it);const nt=Symbol("view");export{ActiveRecordsWidget,AsyncVueWidget,ae as DEFAULT_TAG_PREFIX,DslDefinitionWidget,DslNodeWidget,DslRender,DslRenderWidget,tt as InnerWidgetType,PathWidget,le as RENDER_OPTIONS_KEY,ce as SLOTS_KEY,ue as SLOT_CONTEXT_KEY,nt as ViewSubSymbol,it as ViewWidget,VueWidget,Widget,et as WidgetTagProps,ge as componentInstall,Ne as defaultMetaContext,ve as directiveInstall,se as executeInvisible,Ye as genToken,We as getWidget,be as getWidgetNotNull,je as hasActionBarViewState,Me as hasFieldsViewState,Pe as hasRowActionBarViewState,de as isAllInvisible,Ce as isDetailViewState,Se as isFormViewState,we as isGalleryViewState,$e as isListViewState,Oe as isObjectViewState,De as isSearchViewState,Re as isTableViewState,Ae as isTreeViewState,me as newVueWidget,qe as onAllMounted,fe as pluginInstall,ye as renderWidgets,Xe as reportAllMounted,He as useInjectMetaContext,Fe as useOioState,Ie as useProviderMetaContext};
@@ -1,6 +1,7 @@
1
1
  import { IWidget, WidgetConstructor, WidgetProps } from '@oinone/kunlun-engine';
2
2
  import { BehaviorSubject, Subject, Subscription } from '@oinone/kunlun-state';
3
3
  import { InnerWidgetType } from '../typing/typing';
4
+ declare type WidgetTypeKey = keyof typeof InnerWidgetType;
4
5
  interface BaseWidgetSubjection<T> {
5
6
  subscribe: (func: (data: T) => void) => Subscription;
6
7
  subject: BehaviorSubject<T> | Subject<T>;
@@ -29,6 +30,7 @@ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R
29
30
  private static nameContextMap;
30
31
  private subscriptionMap;
31
32
  private $$props?;
33
+ private $$subNames?;
32
34
  private static Attribute;
33
35
  /**
34
36
  * 添加事件监听
@@ -54,6 +56,7 @@ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R
54
56
  *
55
57
  * @param {Symbol} name 唯一标示
56
58
  * @param {unknown} value? 默认值
59
+ * @param {scope?: WidgetTypeKey} option? 作用域检查,如果设置了该值,那么发布的时候会携带发布者的widget实例,订阅的时候会检查发布者的widget实例是否和订阅者在同一个作用域下,如果是,那么才会触发订阅函数
57
60
  *
58
61
  * @example
59
62
  *
@@ -79,14 +82,19 @@ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R
79
82
  * }
80
83
  *
81
84
  */
82
- protected static BehaviorSubContext(name: Symbol, value?: unknown): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
85
+ protected static BehaviorSubContext(name: Symbol, value?: unknown, option?: {
86
+ scope?: WidgetTypeKey;
87
+ }): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
83
88
  /**
84
89
  * 与 `BehaviorSubContext` 一样,区别在于第一次不会发射默认值
85
90
  *
86
91
  * @param {Symbol} name 唯一标示
87
92
  * @param {unknown} value? 默认值
93
+ * @param {scope?: WidgetTypeKey} option? 作用域检查,如果设置了该值,那么发布订阅只会在同一个作用域下的widget之间进行
88
94
  */
89
- protected static SubContext(name: Symbol, value?: unknown): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
95
+ protected static SubContext(name: Symbol, value?: unknown, option?: {
96
+ scope?: WidgetTypeKey;
97
+ }): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
90
98
  /**
91
99
  * 将数据绑定为响应式,并且组件中可以获取该值
92
100
  */
@@ -151,6 +159,20 @@ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R
151
159
  protected getSelf(): Widget<WidgetProps, unknown> | null;
152
160
  getOperator(): this;
153
161
  initialize(config?: Props): Widget;
162
+ /**
163
+ * 启动订阅
164
+ */
165
+ private startSubscription;
166
+ /**
167
+ * 包装发布者事件
168
+ * 如果启动了作用域检查,那么发布的时候会携带发布者的widget实例
169
+ **/
170
+ private wrapSubjectWithScope;
171
+ /**
172
+ * 创建发布订阅对象
173
+ */
174
+ private createWidgetSubjection;
175
+ private isSameScopeWidget;
154
176
  /**
155
177
  * 销毁widget
156
178
  *
@@ -189,6 +211,7 @@ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R
189
211
  * 获取父元素
190
212
  */
191
213
  getParentWidget(): Widget | null;
214
+ private getParentWidgetByType;
192
215
  /**
193
216
  * 获取子元素
194
217
  */
@@ -1,4 +1,5 @@
1
1
  import { ActiveRecord, ActiveRecords, DeleteActiveRecordsByEntityFunction, DeleteActiveRecordsByEntityPredict, DeleteActiveRecordsFunction, FlushActiveRecordsFunction, PushActiveRecordsFunction, PushActiveRecordsPredict, ReloadActiveRecordsFunction, SubmitCacheManager, UpdateActiveRecordsByEntityFunction, UpdateActiveRecordsByEntityPredict, UpdateActiveRecordsFunction, UpdateEntity } from '@oinone/kunlun-engine';
2
+ import { OioAnyViewState } from '../state';
2
3
  import { PathWidget, PathWidgetProps } from './PathWidget';
3
4
  export interface ActiveRecordsWidgetProps extends PathWidgetProps {
4
5
  dataSource?: ActiveRecords | null;
@@ -8,6 +9,13 @@ export interface ActiveRecordsWidgetProps extends PathWidgetProps {
8
9
  * 数据记录组件
9
10
  */
10
11
  export declare class ActiveRecordsWidget<Props extends ActiveRecordsWidgetProps = ActiveRecordsWidgetProps> extends PathWidget<Props> {
12
+ /**
13
+ * 视图级别状态, 在 beforeMounted 后可获取到有效值
14
+ * @protected
15
+ */
16
+ protected viewState: OioAnyViewState | undefined;
17
+ getViewState(): OioAnyViewState | undefined;
18
+ setViewState(state: OioAnyViewState): void;
11
19
  initialize(props: Props): this;
12
20
  /**
13
21
  * 提交缓存管理器
@@ -75,8 +83,9 @@ export declare class ActiveRecordsWidget<Props extends ActiveRecordsWidgetProps
75
83
  *
76
84
  * @param records 数据
77
85
  * @param predict 推送判定
86
+ * @param index 推送到指定位置; 0 表示插入到数组头; 未传入或-1 表示插入到数组尾;
78
87
  */
79
- pushDataSource(records: ActiveRecords, predict?: PushActiveRecordsPredict): void;
88
+ pushDataSource(records: ActiveRecords, predict?: PushActiveRecordsPredict, index?: number): void;
80
89
  protected parentUpdateDataSource: UpdateActiveRecordsFunction | undefined;
81
90
  /**
82
91
  * 根据索引更新数据源
@@ -127,8 +136,6 @@ export declare class ActiveRecordsWidget<Props extends ActiveRecordsWidgetProps
127
136
  * @param predict 删除判定
128
137
  */
129
138
  deleteDataSourceByEntity(records: ActiveRecords, predict?: DeleteActiveRecordsByEntityPredict): void;
130
- protected parentCreateDataSourceByEntity: PushActiveRecordsFunction | undefined;
131
- createDataSourceByEntity(records: ActiveRecords, predict?: PushActiveRecordsPredict): void;
132
139
  protected parentFlushDataSource: FlushActiveRecordsFunction | undefined;
133
140
  /**
134
141
  * 刷新数据源(数据向上提交)
@@ -243,4 +250,12 @@ export declare class ActiveRecordsWidget<Props extends ActiveRecordsWidgetProps
243
250
  * </pre>
244
251
  */
245
252
  flushActiveRecords(): void;
253
+ protected $$initViewStatePosition(state: OioAnyViewState): void;
254
+ protected $$clearViewStatePosition(state: OioAnyViewState): void;
255
+ protected $$initViewState(state: OioAnyViewState): void;
256
+ protected $$clearViewState(state: OioAnyViewState): void;
257
+ protected $$beforeMount(): void;
258
+ protected $$mounted(): void;
259
+ protected $$beforeUnmount(): void;
260
+ protected $$unmounted(): void;
246
261
  }
@@ -1,4 +1,5 @@
1
1
  import { ComputeContext, RuntimeContext, RuntimeModelField } from '@oinone/kunlun-engine';
2
+ import { CSSClass, CSSStyle } from '@oinone/kunlun-shared';
2
3
  import { InvisibleSupported } from '../feature';
3
4
  import { DslRenderWidget, DslRenderWidgetProps } from './DslRenderWidget';
4
5
  /**
@@ -18,7 +19,7 @@ export interface DslDefinitionWidgetProps extends DslRenderWidgetProps {
18
19
  */
19
20
  inline?: boolean;
20
21
  /**
21
- * 自动组件
22
+ * 自动渲染组件
22
23
  */
23
24
  automatic?: boolean;
24
25
  }
@@ -29,6 +30,8 @@ export declare class DslDefinitionWidget<Props extends DslDefinitionWidgetProps
29
30
  protected automatic: boolean;
30
31
  protected metadataHandle: string | undefined;
31
32
  getMetadataHandle(): string | undefined;
33
+ protected get class(): CSSClass | undefined;
34
+ protected get style(): string | Partial<CSSStyle> | undefined;
32
35
  protected rootHandle: string | undefined;
33
36
  getRootHandle(): string | undefined;
34
37
  protected readonly currentHandle: string;
@@ -44,7 +47,9 @@ export declare class DslDefinitionWidget<Props extends DslDefinitionWidgetProps
44
47
  constructor(handle?: string);
45
48
  initialize(props: Props): this;
46
49
  get metadataRuntimeContext(): RuntimeContext;
50
+ get metadataRuntimeContextNullable(): RuntimeContext | undefined;
47
51
  get rootRuntimeContext(): RuntimeContext;
52
+ get rootRuntimeContextNullable(): RuntimeContext | undefined;
48
53
  get rootComputeContext(): ComputeContext | undefined;
49
54
  get rootViewRuntimeContext(): {
50
55
  runtimeContext: RuntimeContext;
@@ -3,6 +3,7 @@ export * from './data';
3
3
  export * from './dsl';
4
4
  export * from './feature';
5
5
  export * from './hooks';
6
+ export * from './state';
6
7
  export * from './token';
7
8
  export * from './typing';
8
9
  export * from './util';
@@ -0,0 +1,41 @@
1
+ import { ViewType } from '@oinone/kunlun-meta';
2
+ import { ComputedRef } from 'vue';
3
+ /**
4
+ * 元数据上下文
5
+ */
6
+ export interface MetaContext {
7
+ viewType: ComputedRef<ViewType>;
8
+ model: ComputedRef<string>;
9
+ modelName: ComputedRef<string>;
10
+ module: ComputedRef<string>;
11
+ moduleName: ComputedRef<string>;
12
+ metadataHandle: ComputedRef<string>;
13
+ rootHandle: ComputedRef<string>;
14
+ parentHandle: ComputedRef<string>;
15
+ slotName: ComputedRef<string | undefined>;
16
+ inline: ComputedRef<boolean>;
17
+ }
18
+ /**
19
+ * 默认元数据上下文
20
+ */
21
+ export declare const defaultMetaContext: {
22
+ viewType: ComputedRef<ViewType>;
23
+ model: ComputedRef<string>;
24
+ modelName: ComputedRef<string>;
25
+ module: ComputedRef<string>;
26
+ moduleName: ComputedRef<string>;
27
+ metadataHandle: ComputedRef<string>;
28
+ rootHandle: ComputedRef<string>;
29
+ parentHandle: ComputedRef<string>;
30
+ slotName: ComputedRef<undefined>;
31
+ inline: ComputedRef<boolean>;
32
+ };
33
+ /**
34
+ * 提供元数据上下文
35
+ * @param state 元数据可选项
36
+ */
37
+ export declare const useProviderMetaContext: (state: Partial<MetaContext>) => void;
38
+ /**
39
+ * 获取元数据上下文
40
+ */
41
+ export declare const useInjectMetaContext: () => MetaContext;
@@ -0,0 +1,4 @@
1
+ export interface OioGlobalState {
2
+ fullscreen: boolean;
3
+ }
4
+ export declare const globalState: OioGlobalState;
@@ -0,0 +1,3 @@
1
+ export * from './typing';
2
+ export * from './context';
3
+ export * from './use-state';
@@ -0,0 +1,18 @@
1
+ import { OioActionBarState, OioAnyViewState } from '../typing';
2
+ export declare function createActionBarState(this: OioAnyViewState, options: {
3
+ handle: string;
4
+ } & Partial<Omit<OioActionBarState, 'handle'>>): {
5
+ [x: string]: any;
6
+ inline?: boolean | undefined;
7
+ actions: string[];
8
+ visibleActions: string[];
9
+ bizStyle?: string | undefined;
10
+ getActionBarBizStyle?: ((actionHandle: string) => {
11
+ type: import("@oinone/kunlun-vue-ui-common").ButtonType;
12
+ bizStyle: import("@oinone/kunlun-vue-ui-common").ButtonBizStyle;
13
+ } | undefined) | undefined;
14
+ readonly handle: string;
15
+ };
16
+ export declare function getActionBarState(this: OioAnyViewState, rowIndex?: number): OioActionBarState | undefined;
17
+ export declare function pushAction(this: OioAnyViewState, handle: string, rowIndex?: number): void;
18
+ export declare function popAction(this: OioAnyViewState, handle: string, rowIndex?: number): void;
@@ -0,0 +1,3 @@
1
+ import { OioAnyViewState } from '../typing';
2
+ export declare function pushField(this: OioAnyViewState, handle: string, rowIndex?: number): void;
3
+ export declare function popField(this: OioAnyViewState, handle: string, rowIndex?: number): void;
@@ -0,0 +1,2 @@
1
+ export * from './action';
2
+ export * from './field';