@farris/ui-vue 1.7.1 → 1.7.3

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.
Files changed (39) hide show
  1. package/components/component/index.esm.js +2 -2
  2. package/components/component/index.umd.cjs +1 -1
  3. package/components/designer-canvas/index.esm.js +2 -2
  4. package/components/designer-canvas/index.umd.cjs +1 -1
  5. package/components/dynamic-form/index.esm.js +199 -199
  6. package/components/dynamic-form/index.umd.cjs +1 -1
  7. package/components/dynamic-view/index.esm.js +464 -422
  8. package/components/dynamic-view/index.umd.cjs +1 -1
  9. package/components/query-solution/index.esm.js +1 -0
  10. package/components/query-solution/index.umd.cjs +5 -5
  11. package/designer/component/index.esm.js +2 -2
  12. package/designer/component/index.umd.cjs +1 -1
  13. package/designer/condition/index.esm.js +2 -2
  14. package/designer/condition/index.umd.cjs +1 -1
  15. package/designer/dynamic-form/index.esm.js +2 -2
  16. package/designer/dynamic-form/index.umd.cjs +1 -1
  17. package/designer/farris-designer.all.esm.js +784 -783
  18. package/designer/farris-designer.all.umd.cjs +5 -5
  19. package/designer/tabs/index.esm.js +2 -2
  20. package/designer/tabs/index.umd.cjs +1 -1
  21. package/farris.all.esm.js +49832 -49294
  22. package/farris.all.umd.cjs +29 -29
  23. package/index.css +1 -1
  24. package/package.json +1 -1
  25. package/types/components.d.ts +2 -0
  26. package/types/layout/designer.d.ts +32 -0
  27. package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +2 -0
  28. package/types/layout/src/designer/layout-pane.design.component.d.ts +8 -0
  29. package/types/layout/src/designer/layout-use-designer-rules.d.ts +2 -0
  30. package/types/layout/src/designer/layout.design.component.d.ts +8 -0
  31. package/types/layout/src/schema/schema-mapper.d.ts +2 -0
  32. package/types/layout/src/schema/schema-resolver.d.ts +2 -0
  33. package/types/list-nav/designer.d.ts +6 -0
  34. package/types/list-nav/src/designer/list-nav.design.component.d.ts +8 -0
  35. package/types/list-nav/src/designer/use-designer-rules.d.ts +2 -0
  36. package/types/list-nav/src/property-config/list-nav.property-config.d.ts +8 -0
  37. package/types/list-nav/src/schema/schema-mapper.d.ts +2 -0
  38. package/types/list-nav/src/schema/schema-resolver.d.ts +2 -0
  39. package/types/query-solution/index.d.ts +2 -1
@@ -1 +1 @@
1
- (function(Z,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("../component/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("lodash-es"),require("../locale/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../step/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../../designer/binding-selector/index.umd.js"),require("../notify/index.umd.js"),require("../../designer/accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../../designer/button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../../designer/color-picker/index.umd.js"),require("../../designer/combo-list/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/dropdown/index.umd.js"),require("../external-container/index.umd.js"),require("../filter-bar/index.umd.js"),require("../../designer/image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../language-textbox/index.umd.js"),require("../nav/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../../designer/number-range/index.umd.js"),require("../../designer/order/index.umd.js"),require("../page-header/index.umd.js"),require("../../designer/page-footer/index.umd.js"),require("../../designer/pagination/index.umd.js"),require("../../designer/progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../../designer/search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../../designer/smoke-detector/index.umd.js"),require("../../designer/splitter/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../../designer/text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../../designer/transfer/index.umd.js"),require("../../designer/tree-view/index.umd.js"),require("../../designer/uploader/index.umd.js"),require("../../designer/verify-detail/index.umd.js"),require("../../designer/component/index.umd.js"),require("../../designer/video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../fieldset/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../html-template/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../property-panel/index.umd.js"),require("../tree-grid/index.umd.js"),require("bignumber.js"),require("../tree-view/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../component/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","lodash-es","../locale/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../step/index.umd.js","../../designer/dynamic-form/index.umd.js","../../designer/binding-selector/index.umd.js","../notify/index.umd.js","../../designer/accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/button-edit/index.umd.js","../../designer/button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../../designer/color-picker/index.umd.js","../../designer/combo-list/index.umd.js","../content-container/index.umd.js","../../designer/data-grid/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/dropdown/index.umd.js","../external-container/index.umd.js","../filter-bar/index.umd.js","../../designer/image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../language-textbox/index.umd.js","../nav/index.umd.js","../../designer/number-spinner/index.umd.js","../../designer/number-range/index.umd.js","../../designer/order/index.umd.js","../page-header/index.umd.js","../../designer/page-footer/index.umd.js","../../designer/pagination/index.umd.js","../../designer/progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../../designer/search-box/index.umd.js","../../designer/section/index.umd.js","../../designer/smoke-detector/index.umd.js","../../designer/splitter/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../../designer/text/index.umd.js","../../designer/time-picker/index.umd.js","../../designer/transfer/index.umd.js","../../designer/tree-view/index.umd.js","../../designer/uploader/index.umd.js","../../designer/verify-detail/index.umd.js","../../designer/component/index.umd.js","../../designer/video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../fieldset/index.umd.js","../../designer/drawer/index.umd.js","../html-template/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../property-panel/index.umd.js","../tree-grid/index.umd.js","bignumber.js","../tree-view/index.umd.js"],t):(Z=typeof globalThis<"u"?globalThis:Z||self,t(Z.component={},Z.Vue,Z.component,Z.designerCanvas,Z.common,Z.LodashES,Z.locale,Z.VueUseCore,Z.dataView,Z.dynamicResolver,Z.FStep$1,Z.FDynamicForm,null,Z.notify,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,Z.propertyPanel,Z.FTreeGrid$1))})(this,function(Z,t,Ge,T,Ee,ye,Oe,zt,Q,$e,At,Nt,zn,Ht,An,Hn,_n,Gn,$n,Wn,Yn,Xn,Kn,Qn,Jn,Zn,eo,to,no,oo,io,lo,ro,ao,so,co,uo,fo,mo,po,ho,go,yo,vo,bo,wo,Co,xo,Io,To,Fo,So,Vo,No,Eo,Mo,ko,Bo,jo,Do,Ro,Oo,Po,qo,Lo,Uo,zo,Ao,Ho,_o,Go,$o,Wo,_t,Gt){"use strict";var Ln=Object.defineProperty;var Un=(Z,t,Ge)=>t in Z?Ln(Z,t,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):Z[t]=Ge;var te=(Z,t,Ge)=>Un(Z,typeof t!="symbol"?t+"":t,Ge);const Et={id:{type:String},customClass:{type:String,default:""},customStyle:{type:String,default:""},componentType:{type:String,default:""},formColumns:{type:Number,default:4},code:{type:String,default:""}},ft=t.defineComponent({name:"FComponent",props:Et,emits:["init","afterViewInit"],setup(o,e){const n=t.ref();return t.onBeforeMount(()=>{e.emit("init",o.id)}),t.onMounted(()=>{n.value&&o.code&&n.value.setAttribute("scope-"+o.code.toLowerCase(),""),e.emit("afterViewInit",o.id)}),()=>t.createVNode("div",{ref:n,class:o.id+" "+o.customClass,style:o.customStyle},[e.slots.default&&e.slots.default()])}});function $t(o){const{formSchemaUtils:e,formStateMachineUtils:n}=o;function i(s,c=""){return{path:c+s.code,field:s.id,fullPath:s.code}}function l(s,c=""){const g=e.getViewModelById(s);return g?g.states.map(v=>i(v,c)):[]}function a(s){const c=e.getRootViewModelId(),g=l(s);if(s===c)return g;const v=l(c,"root-component.");return[...g,...v]}function r(s){return s.binding&&s.binding.path||s.id||""}function u(){return n&&n.getRenderStates()||[]}return{getVariables:a,getControlName:r,getStateMachines:u}}class Wt{constructor(e){te(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);te(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});te(this,"getExpressionConverter",(e,n)=>({convertFrom:(i,l,a,r)=>{const u=a.getExpressionRuleValue(e,n||l);return u&&u.value||""},convertTo:(i,l,a,r,u)=>{var s;if(l==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((s=a.rules)==null?void 0:s.some(v=>v.id===c&&v.value))?i.dictPickingExpressionId=c:delete i.dictPickingExpressionId}r.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,n){const i=this.formSchemaService.getExpressions();if(!i)return"";const l=i.find(r=>r.target===e);if(!l)return"";const a=l.rules.find(r=>r.type===n);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const n=this.formSchemaService.getRootViewModelId(),i=this.formSchemaService.getViewModelById(n);if(!i||!i.states||i.states.length===0)return[];const l=[];return i.states.filter(a=>a.category==="remote").forEach(a=>{l.push({key:a.code,name:a.name,description:a.name,category:a.category})}),l}createTreeNode(e,n,i="label"){return{id:e.id,name:e.name,bindingPath:e[i],parents:n,type:"field"}}buildEntityFieldsTreeData(e=null,n){const i=[];return e==null||e.forEach(l=>{var u;const a=this.createTreeNode(l,n);let r=[];(u=l.type)!=null&&u.fields&&(r=this.buildEntityFieldsTreeData(l.type.fields,[...n,l.label])),i.push({data:a,children:r,expanded:!0})}),i}buildChildEntityTreeData(e=null,n){const i=[];return e==null||e.forEach(l=>{var s,c;const a=this.createTreeNode(l,n);a.type="entity";const r=this.buildEntityFieldsTreeData((s=l.type)==null?void 0:s.fields,[...n,l.label]),u=this.buildChildEntityTreeData((c=l.type)==null?void 0:c.entities,[...n,l.label]);u!=null&&u.length&&(r==null||r.push(...u)),i.push({data:a,children:r||[],expanded:!0})}),i}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const n=e[0];if(!(n!=null&&n.type))return[];const i=this.buildEntityFieldsTreeData(n.type.fields,[n.code]),l=this.buildChildEntityTreeData(n.type.entities,[n.code]);return l!=null&&l.length&&(i==null||i.push(...l)),{entityCode:n.code,fields:[{data:this.createTreeNode(n,[],"code"),children:i||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,n,i){const l=i==="Field"?e.binding.field:e.id,a=this.getExpressionRule(l,n),r=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(n)&&a?a.message:"",...r};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(e,n,i,l){const{expression:a,message:r,messageType:u}=n,s={id:`${e}_${i}`,type:i,value:a};return(i==="validate"||i==="dataPicking"||i==="required")&&(s.message=r),i==="dataPicking"&&(s.messageType=u),i==="validate"&&l&&(s.elementId=l),s}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,i,l){const a=n==="Field"?e.binding.field:e.id,r=this.buildRule(a,i,l,e.type==="form-group"?e.id:"");let s=this.getExpressionData().find(g=>g.targetType===n&&g.target===a);const c=g=>g.value.trim()==="";if(s){const g=s.rules.find(v=>v.id===r.id);if(g)c(r)?s.rules=s.rules.filter(v=>v.id!==r.id):(Object.assign(g,r),l==="validate"&&e.type==="form-group"&&(g.elementId=e.id));else{if(c(r))return null;s.rules=s.rules||[],s.rules.push(r)}}else{if(c(r))return null;s={target:`${a}`,rules:[r],targetType:n}}return s}getExpressionEditorOptions(e,n,i,l){return i.reduce((a,r)=>{var s,c;const u=n==="Field"?(s=e==null?void 0:e.binding)==null?void 0:s.field:e.id;return a[r]={hide:n==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[r],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[r]}编辑器`,showMessage:r==="validate"||r==="dataPicking"||r==="required",showMessageType:r==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,r,n),onSubmitModal:g=>{const v=this.updateExpression(e,n,g,r);if(l){const x=this.buildRule(u,g,r);l(x)}return v}}},a},{})}getExpressionInfo(e,n,i){const l=n==="Field"?e.binding.field:e.id,a=this.getExpressionRule(l,i),r={value:a&&a.value,targetId:l,targetType:n,expressionType:i};return a&&a.message&&(r.message=a.message),r}getExpressionConfig(e,n,i=["compute","dependency","validate"],l){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,n,i,l)}}}getExpressionOptions(e,n,i){const l=this.getExpressionInfo(e,n,i);return{dialogTitle:`${this.expressionNames[i]}编辑器`,singleExpand:!1,showMessage:i==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,i,n),expressionInfo:l}}}class Yt{constructor(e,n){te(this,"componentId");te(this,"viewModelId");te(this,"eventsEditorUtils");te(this,"formSchemaUtils");te(this,"formMetadataConverter");te(this,"designViewModelUtils");te(this,"designViewModelField");te(this,"controlCreatorUtils");te(this,"designerHostService");te(this,"designerContext");te(this,"schemaService",null);te(this,"metadataService",null);te(this,"propertyConfig",{type:"object",categories:{}});var i;this.componentId=e,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((i=this.formSchemaUtils)==null?void 0:i.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService,this.designerContext=n.designerContext}getFormDesignerInstance(){var e,n;return(n=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:n.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var i;const n=e.binding&&e.binding.type==="Form"&&e.binding.field;if(n){if(!this.designViewModelField){const l=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=l.fields.find(a=>a.id===n)}e.updateOn=(i=this.designViewModelField)==null?void 0:i.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:T.DgControl[e.type]&&T.DgControl[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},i){const l={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const r in n)a[r]=Object.assign(a[r]||{},n[r]);return{...l,properties:{...a},setPropertyRelates(r,u){if(r){switch(r&&r.propertyID){case"class":case"style":{T.canvasChanged.value++;break}}i&&i(r,e,u)}}}}getPropertyEditorParams(e,n=[],i="visible",l={},a={},r=""){const{getVariables:u,getControlName:s,getStateMachines:c}=$t(this.designerHostService),g=this.getRealTargetType(e),v=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],x={type:"property-editor",propertyTypes:v};return v.map(w=>{switch(w){case"Const":Object.assign(x,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},l);break;case"Expression":x.expressionConfig=this.getExpressionOptions(e,g,r||i);break;case"StateMachine":x.stateMachines=c();break;case"Variable":Object.assign(x,{controlName:s(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:C=>{C.value=u(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(x.newVariablePrefix="ext_"+x.newVariablePrefix);break}}),x}getVisibleProperty(e,n=""){var a;let i=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?i=["Const","Expression"]:n==="form-group"&&!((a=e.binding)!=null&&a.field)&&(i=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,i,"visible")}}}getBehaviorConfig(e,n="",i={},l){const a={title:"行为",description:""},r=this.getVisibleProperty(e,n);for(const s in i)r[s]=Object.assign(r[s]||{},i[s]);const u=this;return{...a,properties:{...r},setPropertyRelates(s,c){if(s){switch(s.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,s);break}l&&l(s,c)}}}}afterMutilEditorChanged(e,n){this.addNewVariableToViewModel(n,this.viewModelId),this.updateExpressionValue(n),this.clearExpression(n,e)}updateElementByParentContainer(e,n){const i=n&&n.parent&&n.parent.schema;if(!i)return;const l=i.contents.findIndex(r=>r.id===e),a=ye.cloneDeep(i.contents[l]);i.contents.splice(l,1),i.contents.splice(l,0,a),T.refreshCanvas()}addNewVariableToViewModel(e,n){const i=e.propertyValue;if(!(i&&typeof i=="object")||!(i.type==="Variable"&&i.isNewVariable))return;const r={id:i.field,category:"locale",code:i.fullPath,name:i.fullPath,type:i.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete i.newVariableType,delete i.isNewVariable,this.formSchemaUtils.getVariableByCode(r.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(r)}updateExpressionValue(e){const n=e.propertyValue;if(!((n&&n.type)==="Expression"&&n.expressionInfo))return;const{expressionId:a,expressionInfo:r}=n,{targetId:u,targetType:s,expressionType:c,value:g,message:v}=r,x=this.formSchemaUtils.getModule();x.expressions=x.expressions||[];const{expressions:w}=x;let C=w.find(M=>M.target===u);C||(C={target:u,rules:[],targetType:s},w.push(C));const k=C.rules.find(M=>M.type===c);if(k)k.value=g,k.message=v;else{const M={id:a,type:c,value:g,message:v};C.rules.push(M)}delete n.expressionInfo}clearExpression(e,n){const i=e.propertyValue;if(i&&i.type==="Expression")return;const a=e.propertyID,r=this.formSchemaUtils.getExpressions(),u=n.binding?n.binding.field:n.id,s=r.find(c=>c.target===u);!s||!s.rules||(s.rules=s.rules.filter(c=>c.type!==a))}getExpressionOptions(e,n,i){return new Wt(this.formSchemaUtils).getExpressionOptions(e,n,i)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const n={};return n[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:i=>{var l;((l=i.controller)==null?void 0:l.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(i)}}},n}}class Xt extends Yt{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearancePropConfig(e),this.getBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearancePropConfig(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId);e.name=n?n.name:null;const i=this;return this.getAppearanceConfig(e,{name:{title:"组件名称",type:"string",description:"组件名称",defaultValue:e.name}},(a,r,u)=>{switch(a.propertyID){case"name":i.syncChangesToViewModel({name:a.propertyValue}),delete r.name;break}})}getEventPropConfig(e){const n=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}];this.designerContext&&this.designerContext.responsiveForm&&e.componentType==="frame"&&n.push({label:"goBack",name:"原生返回事件"});const i=this,l=i.eventsEditorUtils.formProperties(e,i.viewModelId,n),a=i.createBaseEventProperty(l);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(r,u){const s=r.propertyValue;delete e[i.viewModelId],s&&(s.setPropertyRelates=this.setPropertyRelates,i.eventsEditorUtils.saveRelatedParameters(e,i.viewModelId,s.events,s))}}}getBehaviorConfig(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId),i=n?n.enableValidation:null,l=this;this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{enableValidation:{title:"启用校验",type:"boolean",description:"运行时组件是否启用校验",defaultValue:i}},setPropertyRelates:a=>{if(a)switch(a.propertyID){case"enableValidation":{l.syncChangesToViewModel({enableValidation:a.propertyValue}),delete e.enableValidation;break}}}}}syncChangesToViewModel(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId);n&&Object.assign(n,e)}}const Kt={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},Qt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},mt=t.defineComponent({name:"Toast",props:Qt,emits:["close","click"],setup:(o,e)=>{const n=t.ref(o.animate),i="fadeOut",l=t.computed(()=>o.options),a=t.ref(!1),r=t.computed(()=>l.value.title&&l.value.message),u=t.computed(()=>!l.value.title&&l.value.message),s=t.computed(()=>{const S={animated:a.value,toast:!0,"toast--only-content":!r.value};return S[o.animate]=!1,S[i]=a.value,S["toasty-type-"+l.value.type]=!0,l.value.theme&&(S[l.value.theme]=!0),S}),c=t.computed(()=>{const I=`f-icon-${l.value&&l.value.type?l.value.type.replace("toasty-type-",""):"default"}`,m={"f-icon":!0};return m[I]=!0,m}),g=t.computed(()=>l.value.title||l.value.message),v=t.computed(()=>o.showCloseButton),x=t.computed(()=>!!l.value.buttons||!!e.slots.default),w=t.computed(()=>Oe.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function C(S){S.stopPropagation(),S.preventDefault(),a.value=!1,setTimeout(()=>{e.emit("close",l.value)},200)}function k(S,B){}function M(S){return`f-preten-link ${S.customClass?S.customClass:""}`}t.watch(n,()=>{n.value});const j=()=>{var S;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((S=l.value.buttons)==null?void 0:S.map(B=>t.createVNode("span",{class:M(B),onClick:I=>void 0},[B.text]))),e.slots.default&&e.slots.default()])])};return()=>t.createVNode("div",{class:s.value,style:"min-height:44px"},[v.value&&t.createVNode("button",{title:Oe.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:C},[t.createVNode("span",{class:"f-icon modal_close"},null)]),g.value&&t.createVNode("section",{class:"modal-tips"},[!r.value&&t.createVNode("div",{class:"float-left modal-tips-iconwrap"},[t.createVNode("span",{class:c.value},null)]),t.createVNode("div",{class:"modal-tips-content"},[r.value&&t.createVNode(t.Fragment,null,[t.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:l.value.title},null),t.createVNode("p",{class:"toast-msg",innerHTML:l.value.message,style:w.value},null),x.value&&j()]),u.value&&(l.value.buttons?t.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:w.value,innerHTML:l.value.message},null),t.createVNode("div",{class:"after-toast-title text-right ml-auto"},[j()])]):t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:w.value,innerHTML:l.value.message},null))])])])}}),rt=t.defineComponent({name:"Notify",props:Kt,emits:["close","empty"],setup(o,e){const n=t.computed(()=>({"farris-notify":!0})),i={left:12,right:12,top:20,bottom:12},l=t.ref(),a=t.ref(o.options),r=t.ref(o.showCloseButton),u=t.computed(()=>o.position||"bottom-right"),s=t.computed(()=>o.timeout!=null?o.timeout:3e3),c=t.computed(()=>{const x=o.bottom?o.bottom:i.bottom,w=o.top?o.top:i.top,C={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${o.left?o.left:i.left}px`:"",right:u.value.indexOf("right")>-1?`${o.right?o.right:i.right}px`:"",top:u.value.indexOf("top")>-1?`${w}px`:"",bottom:u.value.indexOf("bottom")>-1?`${x}px`:""};return u.value.indexOf("center")>-1&&(C.left="50%",C.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(C.top="50%",C.transform="translate(-50%, -50%)")),C});function g(x){e.emit("close")}s.value&&setTimeout(()=>{g()},s.value),e.expose({closeToast:g,container:l,notifyPosition:u});function v(x,w){g()}return()=>t.createVNode("div",{class:n.value,style:c.value,ref:l},[t.createVNode(mt,{options:a.value,showCloseButton:r.value,animate:o.animate,onClose:x=>v(x,a.value)},null)])}});class pt{constructor(){te(this,"notifyRefs",[]);te(this,"globalConfig",t.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const n=document.createElement("div");return n.textContent=e||"",n.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const n=this,l=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const r=t.createApp({setup(){var c;const u=t.ref();function s(){u.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(l,u),r.unmount()},220)}if(l.position.indexOf("top")>-1){const g=n.getNotifyInstances(l.position),v=g[g.length-1];if(v){const x=v.value.container.getBoundingClientRect();l.top=x.bottom}}return l.safeHtml&&((c=l.options)!=null&&c.message)&&(l.options.message=n.escapeAllHtml(l.options.message)),t.onUnmounted(()=>{document.body.removeChild(a)}),t.onMounted(()=>{n.updateNotifyPositionForCreate(l,u)}),()=>t.createVNode(t.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[t.createVNode(rt,t.mergeProps({ref:u},l,{onClose:s}),null)]})}});return r.provide("NotifyService",this),document.body.appendChild(a),r.use(Oe.LocaleService.i18n),r.mount(a),r}getNotifyInstances(e){return this.notifyRefs.filter(n=>n.value.notifyPosition===e)}updateNotifyPositionForCreate(e,n){if(this.notifyRefs&&this.notifyRefs.length){const i=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(l=>{const a=l.value.container.getBoundingClientRect();l.value.container.style.bottom=a.height+i-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(e,n){const i=this.notifyRefs.indexOf(n);if(e.position.indexOf("top")>-1){const l=this.getNotifyInstances(e.position),a=l.indexOf(n);l.slice(a+1).forEach(r=>{r.value.container.style.top=r.value.container.offsetTop-r.value.container.offsetHeight+"px"})}i>-1&&this.notifyRefs.splice(i,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,n){let i="",l="",a,r,u;typeof n=="string"?i=n:n&&(i=n.message||"",l=n.title||"",r=n.position||null,u=n.showCloseButton!=null?n.showCloseButton:null,a=n.timeout!=null?n.timeout:null);const c={options:{type:e,message:i,title:l}};return r!=null&&(c.position=r),u!=null&&(c.showCloseButton=u),a!=null&&(c.timeout=a),c}info(e){const n=this.buildNotifyProps("info",e);return this.show(n)}success(e){const n=this.buildNotifyProps("success",e);return this.show(n)}warning(e){const n=this.buildNotifyProps("warning",e);return this.show(n)}error(e){const n=this.buildNotifyProps("error",e);return this.show(n)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const Jt=Symbol("NOTIFY_SERVICE_TOKEN");rt.install=o=>{o.component(rt.name,rt),o.component(mt.name,mt);const e=new pt;o.provide(Jt,e),o.provide("FNotifyService",e)};const Zt={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}},en={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}},autoHeight:{type:Boolean,default:!1}};function tn(o,e,n,i,l,a,r,u,s,c,g,v,x,w,C,k,M){const{calculateCellPositionInRow:j}=a,{columnContext:S,hasLeftFixedColumn:B,hasRightFixedColumn:I}=r,{gridDataStyle:m,leftFixedGridDataStyle:h,rightFixedGridDataStyle:F}=w,{renderDataRow:f}=Q.getHierarchyRow(o,e,S,M,u,s,c,g,v,x,w,C,k),y=[f];function p(P,_){const K=j(P);return M.value.filter(D=>D.visible!==!1).map((D,q)=>y[D.type](D,K,_,q))}function d(){return t.createVNode("div",{ref:i,class:"fv-grid-content-left-fixed"},[t.createVNode("div",{class:"fv-grid-data",style:h.value},[p(S.value.leftColumns.filter(P=>P.visible),"left")])])}function N(){return t.createVNode("div",{ref:n,class:"fv-grid-content-primary"},[t.createVNode("div",{class:"fv-grid-data",style:m.value},[p(S.value.primaryColumns.filter(P=>P.visible),"primary")])])}function O(){return t.createVNode("div",{ref:l,class:"fv-grid-content-right-fixed"},[t.createVNode("div",{class:"fv-grid-data",style:F.value},[p(S.value.rightColumns.filter(P=>P.visible),"right")])])}function E(){const P=[];return B.value&&P.push(d()),P.push(N()),I.value&&P.push(O()),P}return{renderDataArea:E}}const ht=t.defineComponent({name:"FTreeGrid",props:en,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(o,e){var qt,Lt;const i=((qt=o.rowOption)==null?void 0:qt.height)||28,l=t.ref(20),a=t.ref(o.columns),r=Q.useIdentify(o),{idField:u}=r,s=t.ref(),c=t.ref(),g=t.ref(),v=t.ref(),x=t.ref(),w=t.ref([]),C=t.ref(!1),k=t.ref(((Lt=o.rowOption)==null?void 0:Lt.wrapContent)||!1),M=Q.useGroupData(o,r),j=Q.useFilter(o,e),S=Q.useHierarchy(o),{collapseField:B}=S,{showLoading:I,renderLoading:m}=Q.useLoading(o,s),h=Q.useDataView(o,new Map,j,S,r),{dataView:F}=h,f=Q.useSelection(o,h,r,w,e),{showSelection:y,selectedValues:p}=f,d=Q.useSelectHierarchyItem(o,w,h,r,f,e),N=t.computed(()=>o.disabled),O=t.computed(()=>o.virtualized?Math.min(h.dataView.value.length,l.value):h.dataView.value.length),E=Q.usePagination(o,h),{shouldRenderPagination:P}=E,{containerStyleObject:_}=Q.useDataViewContainerStyle(o),K=Q.useCommandColumn(o),{applyCommands:D}=K;D(a);const{applyColumnSetting:q,removeColumnSetting:W}=Q.useSettingColumn(o);o.showSetting&&q(a);const z=Q.useColumn(o,e),$=Q.useSort(o),{applyColumnSorter:ie,columnContext:le,updateColumnRenderContext:Y}=z;ie(h,$);const xe=Q.useGroupColumn(o,le),me=Q.useRow(o,e,f,r),ne=Q.useEdit(o,e,r,me,w),A=Q.useVisualDataBound(o),oe=Q.useVisualDataCell(o,ne,A),Le=Q.useVisualDataRow(o,h,ne,S,r,A,oe),ke=Q.useVisualData(o,a,h,O,0,Le),{getVisualData:Te}=ke,Xe=Q.useCellPosition(o,le),Ue=Q.useSidebar(o,f),{sidebarWidth:Ke}=Ue,ce=Q.useVirtualScroll(o,h,w,le,ke,O,0,Ke),{onWheel:et,dataGridWidth:Be,viewPortHeight:je,viewPortWidth:Fe,resetScroll:De,updateVisibleRowsOnLatestVisibleScope:tt}=ce,ze=Q.useFitColumn(o,le,c,Fe,xe),{calculateColumnsSize:Se}=ze,Re=Q.useFilterHistory(),Qe=Q.useColumnFilter(c,x,h,Re,ce),Je=Q.useDragColumn(o,e,z,h,xe,M,ce),V=t.computed(()=>{const U={"fv-grid":!0,"fv-grid-bordered":o.showBorder,"fv-grid-horizontal-bordered":o.showHorizontalLines,"fv-datagrid-strip":o.showStripe};return Ee.getCustomClass(U,o.customClass)}),X=t.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":C.value,"fv-grid-wrap-content":k.value})),{renderDataArea:re}=tn(o,e,g,v,x,Xe,z,h,ne,S,me,f,d,ce,ke,A,w),{renderGridHeader:ae,renderGridColumnResizeOverlay:pe,shouldShowHeader:gt}=Q.getColumnHeader(o,e,c,v,x,z,h,Je,Qe,j,Re,ze,xe,f,Ue,$,ce,Fe,w),{renderDataGridSidebar:yt}=Q.getSidebar(o,me,f,Ue,ce),{renderDisableMask:vt}=Q.getDisableMask(),{renderHorizontalScrollbar:bt}=Q.getHorizontalScrollbar(o,c,ce),{renderVerticalScrollbar:wt}=Q.getVerticalScrollbar(o,c,ce);function Ct(){var U,G,de;if(c.value&&c.value.clientHeight>0&&((U=c.value)==null?void 0:U.clientWidth)>0){const ge=Math.ceil(c.value.clientHeight/i);ge>l.value&&(l.value=ge,tt()),je.value=((G=g.value)==null?void 0:G.clientHeight)||0,Be.value=((de=c.value)==null?void 0:de.clientWidth)||0}c.value&&(c.value.clientHeight>0||c.value.clientWidth>0)&&Se()}t.onMounted(()=>{c.value&&(l.value=Math.max(Math.ceil(c.value.clientHeight/i),l.value),w.value=Te(0,O.value+0-1),zt.useResizeObserver(c.value,Ct),Se(),t.nextTick(()=>{c.value&&(Be.value=c.value.clientWidth),g.value&&(Fe.value=g.value.clientWidth,je.value=g.value.clientHeight)})),I.value&&m()}),t.onUnmounted(()=>{}),t.watch(Fe,()=>{c.value&&Se()});function xt(U){h.collapseTo(U),h.reOrderVisibleIndex(),De()}function ut(U){h.expandTo(U),h.reOrderVisibleIndex(),De()}function nt(){const U=f.getSelectionRow();return U?U.dataIndex-1:-1}function It(){const U=nt();h.insertNewDataItem(U),w.value=Te(0,O.value+0-1)}function Tt(){const U=nt();h.insertNewChildDataItem(U),w.value=Te(0,O.value+0-1)}function Ft(U,G){const de=w.value.find(Ce=>Ce.raw[u.value]===G),ge=de?de.dataIndex-1:-1;h.insertNewChildDataItems(U,ge)}function St(){const U=nt(),G=d.getNextSelectableHierarchyItemId(U);h.removeHierarchyDataItem(U),w.value=Te(0,O.value+0-1),G&&d.selectItemById(G)}function dt(U){ne.onEditingRow(U)}function Vt(U){ne.acceptEditingRow(U)}function b(U){ne.cancelEditingRow(U)}function R(U){U&&(a.value=U,D(a),Y(a.value),ie(h,$),Se())}t.watch(()=>o.columns,U=>{R(U)});function L(U,G){U&&(h.load(U),h.reOrderVisibleIndex(),G!=null&&G.keepScrollPosition?ce.scrollTo(ce.offsetY.value):De())}function H(U){me.activeRowById(U)}function J(U,G={isCurrent:!0}){G!=null&&G.isCurrent&&H(U),d.selectItemById(U)}function ee(U){const G=w.value.find(de=>de.raw[r.idField.value]===U);G&&me.clickRowItem(G)}function Ie(U){d.selectItemByIds(U)}function ve(){return f.getSelectedItems()}function be(){f.clearSelection()}function Ve(){f.emptyCurrentRowId()}const ue=t.computed(()=>!w.value||!w.value.length),{renderEmpty:Ne}=Q.getEmpty(o,e);function we(){return f.getSelectionRow()}function he(U,G={clearCurrent:!0}){G!=null&&G.clearCurrent&&H(""),d.unSelectItemByIds(U)}function ot(){return f.currentSelectedDataId.value}function it(U,G,de){const ge=F.value.find(Ce=>Ce[u.value]===U);if(ge){if(Object.keys(ge).forEach(fe=>{Object.prototype.hasOwnProperty.call(G,fe)&&(ge[fe]=G[fe])}),de){const{collapseField:fe,disabledField:Ae,checkedField:He,visibleField:_e}=de;fe&&!ye.isUndefined(G[fe])&&(ge.__fv_collapse__=G[fe]),He&&!ye.isUndefined(G[He])&&(ge.__fv_checked__=G[He]),Ae&&!ye.isUndefined(G[Ae])&&(ge.__fv_disabled__=G[Ae]),_e&&!ye.isUndefined(G[_e])&&(ge.__fv_visible__=G[_e])}const Ce=w.value.find(fe=>fe.raw[u.value]===U),Ut=w.value.findIndex(fe=>fe.raw[u.value]===U);if(Ce){if(Ce.raw=ge,Object.keys(Ce.data).forEach(fe=>{Ce.data[fe].updateData(ge)}),de){const{collapseField:fe,disabledField:Ae,checkedField:He,visibleField:_e}=de;fe&&!ye.isUndefined(G[fe])&&(Ce.collapse=G[fe]),He&&!ye.isUndefined(G[He])&&(Ce.checked=G[He]),Ae&&!ye.isUndefined(G[Ae])&&(Ce.disabled=G[Ae]),_e&&!ye.isUndefined(G[_e])&&(Ce.visible=G[_e])}w.value=[...w.value.slice(0,Ut),Ce,...w.value.slice(Ut+1)],h.updateSummary()}}}function lt(U){return Object.prototype.hasOwnProperty.call(U,"raw")?h.hasRealChildren(U.raw):h.hasRealChildren(U)}function En(U){const G=h.dataView.value.find(de=>de[u.value]===U);return G?G[B.value]:""}function Mn(){return B.value}t.watch(()=>o.showSetting,(U,G)=>{U!==G&&(U?q(a):W(a),R(a.value))});function kn(U){return w.value.filter(G=>U.includes(G.raw[o.idField]))}function Bn(U){const G=r.idField.value,de=w.value.find(ge=>ge.raw[G]===U);de&&me.changeRow(de)}function jn(){f.keepSelectingOnPaging.value||be(),h.updateVisibleDataSummary(w.value)}e.expose({activeRowById:H,addNewDataItem:It,addNewChildDataItem:Tt,addChildrenToNode:Ft,collapseTo:xt,expandTo:ut,removeDataItem:St,editDataItem:dt,acceptDataItem:Vt,cancelDataItem:b,updateColumns:R,updateDataSource:L,selectItemById:J,selectItemByIds:Ie,getSelectedItems:ve,clearSelection:be,getSelectionRow:we,clickRowItemById:ee,unSelectItemByIds:he,getCurrentRowId:ot,reassignRowData:it,hasChildren:lt,getCollapseField:Mn,getCollapseStatusById:En,getVisibleDataByIds:kn,selectRowById:Bn,updateDerivedData:jn,emptyCurrentRowId:Ve,calculateColumnsSize:Se});const Dn=t.computed(()=>{const U={};return ce.shouldShowHorizontalScrollbar.value&&(U.paddingBottom="10px"),ce.shouldShowVirticalScrollbar.value&&(U.paddingRight="10px"),U}),Rn=t.computed(()=>({..._.value,borderRadius:"5px"})),{renderDataGridPagination:ri}=Q.getPagination(o,e,h,ce,E,f),On=t.computed(()=>({"d-flex":!0,"justify-content-between":P.value&&y.value,"justify-content-end":P.value&&!y.value,"position-relative":!0})),Pn=t.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:qn}=Q.getSummary(o,h,z);return()=>t.createVNode("div",{ref:s,class:V.value,style:Rn.value,onWheel:et},[c.value&&gt.value&&ae(),t.createVNode("div",{ref:c,class:X.value,onMouseover:()=>C.value=!0,onMouseleave:()=>C.value=!1,onTouchstart:U=>{U.stopPropagation(),C.value=!0,ce.onTouchstartScrollThumb(U,c)},onTouchend:U=>{C.value=!1},style:Dn.value},[c.value&&yt(w),c.value&&re(),c.value&&ue.value&&Ne(),c.value&&bt(),c.value&&wt()]),c.value&&qn(),y.value&&t.createVNode("div",{class:On.value},[y.value&&t.createVNode("div",{class:Pn.value},[t.createVNode("div",null,["已选:"+p.value.length,t.createTextVNode(" 条")])])]),pe(),N.value&&vt()])}});Ee.withInstall(ht),t.ref(0);var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function at(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nn={exports:{}};(function(o,e){(function(n){o.exports=n()})(function(){return function(){function n(i,l,a){function r(c,g){if(!l[c]){if(!i[c]){var v=typeof at=="function"&&at;if(!g&&v)return v(c,!0);if(u)return u(c,!0);var x=new Error("Cannot find module '"+c+"'");throw x.code="MODULE_NOT_FOUND",x}var w=l[c]={exports:{}};i[c][0].call(w.exports,function(C){var k=i[c][1][C];return r(k||C)},w,w.exports,n,i,l,a)}return l[c].exports}for(var u=typeof at=="function"&&at,s=0;s<a.length;s++)r(a[s]);return r}return n}()({1:[function(n,i,l){var a={},r="(?:^|\\s)",u="(?:\\s|$)";function s(v){var x=a[v];return x?x.lastIndex=0:a[v]=x=new RegExp(r+v+u,"g"),x}function c(v,x){var w=v.className;w.length?s(x).test(w)||(v.className+=" "+x):v.className=x}function g(v,x){v.className=v.className.replace(s(x)," ").trim()}i.exports={add:c,rm:g}},{}],2:[function(n,i,l){(function(a){var r=n("contra/emitter"),u=n("crossvent"),s=n("./classes"),c=document,g=c.documentElement;function v(d,N){var O=arguments.length;O===1&&Array.isArray(d)===!1&&(N=d,d=[]);var E,P,_,K,D,q,W,z,$,ie=null,le,Y,xe=!1,me=0,ne,A=N||{};A.moves===void 0&&(A.moves=S),A.accepts===void 0&&(A.accepts=S),A.invalid===void 0&&(A.invalid=tt),A.containers===void 0&&(A.containers=d||[]),A.isContainer===void 0&&(A.isContainer=j),A.copy===void 0&&(A.copy=!1),A.copySortSource===void 0&&(A.copySortSource=!1),A.revertOnSpill===void 0&&(A.revertOnSpill=!1),A.removeOnSpill===void 0&&(A.removeOnSpill=!1),A.direction===void 0&&(A.direction="vertical"),A.ignoreInputTextSelection===void 0&&(A.ignoreInputTextSelection=!0),A.mirrorContainer===void 0&&(A.mirrorContainer=c.body);var oe=r({containers:A.containers,start:Fe,end:ze,cancel:V,remove:Je,destroy:Ue,canMove:je,dragging:!1});return A.removeOnSpill===!0&&oe.on("over",yt).on("out",vt),ke(),oe;function Le(b){return oe.containers.indexOf(b)!==-1||A.isContainer(b)}function ke(b){var R=b?"remove":"add";C(g,R,"mousedown",ce),C(g,R,"mouseup",Re)}function Te(b){var R=b?"remove":"add";C(g,R,"mousemove",et)}function Xe(b){var R=b?"remove":"add";u[R](g,"selectstart",Ke),u[R](g,"click",Ke)}function Ue(){ke(!0),Re({})}function Ke(b){le&&b.preventDefault()}function ce(b){K=b.clientX,D=b.clientY;var R=k(b)!==1||b.metaKey||b.ctrlKey;if(!R){var L=b.target,H=Be(L);H&&(le=H,Te(),b.type==="mousedown"&&(h(L)?L.focus():b.preventDefault()))}}function et(b){if(le){if(k(b)===0){Re({});return}if(!(b.clientX!==void 0&&Math.abs(b.clientX-K)<=(A.slideFactorX||0)&&b.clientY!==void 0&&Math.abs(b.clientY-D)<=(A.slideFactorY||0))){if(A.ignoreInputTextSelection){var R=p("clientX",b)||0,L=p("clientY",b)||0,H=c.elementFromPoint(R,L);if(h(H))return}var J=le;Te(!0),Xe(),ze(),De(J),s.add(z||_,"gu-transit"),wt(),bt(),me=0,pe(b)}}}function Be(b){if(!(oe.dragging&&E)&&!Le(b)){for(var R=b;m(b)&&Le(m(b))===!1;)if(A.invalid(b,R)||(b=m(b),!b))return;var L=m(b);if(L&&!A.invalid(b,R)){var H=A.moves(b,L,R,f(b));if(H)return{item:b,source:L}}}}function je(b){return!!Be(b)}function Fe(b){var R=Be(b);R&&De(R)}function De(b){Vt(b.item,b.source)&&(z=b.item.cloneNode(!0),oe.emit("cloned",z,b.item,"copy")),P=b.source,_=b.item,q=W=f(b.item),oe.dragging=!0,oe.emit("drag",_,P)}function tt(){return!1}function ze(){if(oe.dragging){var b=z||_;Qe(b,m(b))}}function Se(){le=!1,Te(!0),Xe(!0)}function Re(b){if(Se(),!!oe.dragging){var R=z||_,L=p("clientX",b)||0,H=p("clientY",b)||0,J=M(E,L,H),ee=ae(J,L,H);ee&&(z&&A.copySortSource||!z||ee!==P)?Qe(R,ee):A.removeOnSpill?Je():V()}}function Qe(b,R){var L=m(b);z&&A.copySortSource&&R===P&&L.removeChild(_),re(R)?oe.emit("cancel",b,P):oe.emit("drop",b,R,P,W),X()}function Je(){if(oe.dragging){var b=z||_,R=m(b);R&&R.removeChild(b),oe.emit(z?"cancel":"remove",b,R,P),X()}}function V(b){if(oe.dragging){var R=arguments.length>0?b:A.revertOnSpill,L=z||_,H=m(L),J=re(H);J===!1&&R&&(z?H&&H.removeChild(z):P.insertBefore(L,q)),J||R?oe.emit("cancel",L,P,P):oe.emit("drop",L,H,P,W),X()}}function X(){var b=z||_;Se(),Ct(),xt(),b&&s.rm(b,"gu-transit"),$&&clearTimeout($),oe.dragging=!1,ie&&oe.emit("out",b,ie,P),oe.emit("dragend",b,me),P=_=z=q=W=$=ie=null}function re(b,R){var L;return R!==void 0?L=R:E?L=W:L=f(z||_),b===P&&L===q}function ae(b,R,L){for(var H=b;H&&!J();)H=m(H);return H;function J(){var ee=Le(H);if(ee===!1)return!1;var Ie=ut(H,b),ve=dt(H,Ie,R,L),be=re(H,ve);return be?!0:A.accepts(_,H,P,ve)}}function pe(b){if(!E)return;b.preventDefault();var R=p("clientX",b)||0,L=p("clientY",b)||0;E.style.left=R-2+"px",E.style.top=L-2+"px";var H=z||_,J=M(E,R,L),ee=ae(J,R,L),Ie=ee!==null&&ee!==ie;(Ie||ee===null)&&(we(),ie=ee,Ne()),St(J,L);var ve=m(H);if(ee===P&&z&&!A.copySortSource){ve&&ve.removeChild(H);return}var be,Ve=ut(ee,J);if(xe=nt(Ve,ee),Ve!==null)be=dt(ee,Ve,R,L);else if(A.revertOnSpill===!0&&!z)be=q,ee=P;else{z&&ve&&ve.removeChild(H),z&&Y&&(Y.style.display="none");return}Y.style.display="block",gt(be,H,Ie),be?Tt(Ve,be):Ft(ee);function ue(he){oe.emit(he,H,ie,P)}function Ne(){Ie&&ue("over")}function we(){ie&&ue("out")}}function gt(b,R,L){(b===R||b===f(R))&&(W=f(R)),(b===null&&L||b!==R&&b!==f(R))&&(W=b)}function yt(b){s.rm(b,"gu-hide")}function vt(b){oe.dragging&&s.add(b,"gu-hide")}function bt(){E||(E=document.createElement("div"),E.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",E.innerHTML=A.getMirrorText&&A.getMirrorText(_)||"控件",s.add(E,"gu-mirror"),A.mirrorContainer.appendChild(E),C(g,"add","mousemove",pe),s.add(A.mirrorContainer,"gu-unselectable"),oe.emit("cloned",E,_,"mirror"))}function wt(){if(Y=document.createElement("div"),s.add(Y,"gu-insertion"),_){var b=_.getBoundingClientRect();Y.style.left=b.left+"px",Y.style.top=b.top+"px"}xe=!1,A.mirrorContainer.appendChild(Y)}function Ct(){E&&(s.rm(A.mirrorContainer,"gu-unselectable"),C(g,"remove","mousemove",pe),m(E).removeChild(E),E=null)}function xt(){Y&&(m(Y).removeChild(Y),Y=null)}function ut(b,R){for(var L=R;L!==b&&m(L)!==b;)L=m(L);return L===g?null:L}function nt(b,R){if(!R)return xe;var L=b||R&&R.lastElementChild;if(!L)return!0;var H=getComputedStyle(b),J=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(J)return!0;if(R){var ee=getComputedStyle(R),Ie=ee.getPropertyValue("display");if(/flex$/.test(Ie)){var ve=ee.getPropertyValue("flex-direction")||"row";if(ve==="row"||ve==="row-reverse")return!It(R)}return!1}return!0}function It(b){if(!b.children||!b.children.length)return!1;for(const R of Array.from(b.children)){const H=(R.className&&R.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!H.length)return!1;for(const J of H){const ee=J.slice(J.lastIndexOf("-")+1);if(parseInt(ee,10)!==12)return!1}}return!0}function Tt(b,R){const L=R.getBoundingClientRect();if(Y.style.left=L.left+"px",Y.style.top=L.top+"px",xe){if(Y.style.height=L.height+"px",Y.style.width="4px",b){const H=b.getBoundingClientRect();H.top!==L.top&&(Y.style.left=H.right+"px",Y.style.top=H.top+"px",Y.style.height=H.height+"px")}}else if(Y.style.height="4px",Y.style.width=L.width+"px",ne){const H=ne.getBoundingClientRect();L.top<H.top&&(Y.style.display="none")}R===_&&_&&(Y.style.display="none")}function Ft(b){W=null;var R=b.lastElementChild;if(R){var L=R.getBoundingClientRect();xe?(Y.style.left=L.right+"px",Y.style.top=L.top+"px",Y.style.height=L.height+"px",Y.style.width="4px"):(Y.style.left=L.left+"px",Y.style.top=L.bottom+"px",Y.style.height="4px",Y.style.width=L.width+"px"),R===_&&_&&(Y.style.display="none")}else Y.style.display="none"}function St(b,R){if(!A.mirrorContainer.contains(b)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ne=x(b),!ne||!ne.contains(b)))return;const L=document.querySelector(".dgComponentSelected"),H=ne.getBoundingClientRect();if(R-30<H.top&&ne.scrollTop>0){let J=ne.scrollTop<10?ne.scrollTop:10;ne.scrollBy(0,-1*J),L&&ne.contains(L)&&(me=me+-1*J)}if(R+30>H.bottom&&ne.scrollTop<ne.scrollHeight-ne.clientHeight){const J=ne.scrollHeight-ne.clientHeight-ne.scrollTop;let ee=J<10?J:10;ne.scrollBy(0,ee),L&&ne.contains(L)&&(me=me+ee)}}function dt(b,R,L,H){var J=A.direction==="horizontal",ee=A.direction==="mixed",Ie=R!==b?be():ve();return Ie;function ve(){var ue=b.children.length,Ne,we,he;for(Ne=0;Ne<ue;Ne++)if(we=b.children[Ne],he=we.getBoundingClientRect(),J&&he.left+he.width/2>L||!ee&&!J&&he.top+he.height/2>H||ee&&he.left+he.width>L&&he.top+he.height>H)return we;return null}function be(){var ue=R.getBoundingClientRect();if(ee){var Ne=H-ue.top,we=L-ue.left,he=ue.bottom-H,ot=ue.right-L,it=Math.min(we,ot,Ne,he),lt;return xe?lt=ot<we:lt=he===it||ot===it||we===it,Ve(lt)}return Ve(J?L>ue.left+B(ue)/2:H>ue.top+I(ue)/2)}function Ve(ue){return ue?f(R):R}}function Vt(b,R){return typeof A.copy=="boolean"?A.copy:A.copy(b,R)}}function x(d){const N=Array.from(window.scrollContainerList);if(N.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const O=w(N);for(const E of O)if(E.contains(d))return E;return null}function w(d){const N=[];return d.forEach(O=>{const E=document.getElementById(O);E&&N.push(E)}),N.sort((O,E)=>O.contains(E)?1:E.contains(O)?-1:0),N}function C(d,N,O,E){var P={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},_={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[N](d,_[O],E):a.navigator.msPointerEnabled?u[N](d,K[O],E):(u[N](d,P[O],E),u[N](d,O,E))}function k(d){if(d.touches!==void 0)return d.touches.length;if(d.which!==void 0&&d.which!==0)return d.which;if(d.buttons!==void 0)return d.buttons;var N=d.button;if(N!==void 0)return N&1?1:N&2?3:N&4?2:0}function M(d,N,O){d=d||{};var E=d.className||"",P;return d.className+=" gu-hide",P=c.elementFromPoint(N,O),d.className=E,P}function j(){return!1}function S(){return!0}function B(d){return d.width||d.right-d.left}function I(d){return d.height||d.bottom-d.top}function m(d){return d.parentNode===c?null:d.parentNode}function h(d){return d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.tagName==="SELECT"||F(d)}function F(d){return!d||d.contentEditable==="false"?!1:d.contentEditable==="true"?!0:F(m(d))}function f(d){return d.nextElementSibling||N();function N(){var O=d;do O=O.nextSibling;while(O&&O.nodeType!==1);return O}}function y(d){return d.targetTouches&&d.targetTouches.length?d.targetTouches[0]:d.changedTouches&&d.changedTouches.length?d.changedTouches[0]:d}function p(d,N){var O=y(N),E={pageX:"clientX",pageY:"clientY"};return d in E&&!(d in O)&&E[d]in O&&(d=E[d]),O[d]}i.exports=v}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,i,l){i.exports=function(r,u){return Array.prototype.slice.call(r,u)}},{}],4:[function(n,i,l){var a=n("ticky");i.exports=function(u,s,c){u&&a(function(){u.apply(c||null,s||[])})}},{ticky:10}],5:[function(n,i,l){var a=n("atoa"),r=n("./debounce");i.exports=function(s,c){var g=c||{},v={};return s===void 0&&(s={}),s.on=function(x,w){return v[x]?v[x].push(w):v[x]=[w],s},s.once=function(x,w){return w._once=!0,s.on(x,w),s},s.off=function(x,w){var C=arguments.length;if(C===1)delete v[x];else if(C===0)v={};else{var k=v[x];if(!k)return s;k.splice(k.indexOf(w),1)}return s},s.emit=function(){var x=a(arguments);return s.emitterSnapshot(x.shift()).apply(this,x)},s.emitterSnapshot=function(x){var w=(v[x]||[]).slice(0);return function(){var C=a(arguments),k=this||s;if(x==="error"&&g.throws!==!1&&!w.length)throw C.length===1?C[0]:C;return w.forEach(function(j){g.async?r(j,C,k):j.apply(k,C),j._once&&s.off(x,j)}),s}},s}},{"./debounce":4,atoa:3}],6:[function(n,i,l){(function(a){var r=n("custom-event"),u=n("./eventmap"),s=a.document,c=x,g=C,v=[];a.addEventListener||(c=w,g=k),i.exports={add:c,remove:g,fabricate:M};function x(m,h,F,f){return m.addEventListener(h,F,f)}function w(m,h,F){return m.attachEvent("on"+h,S(m,h,F))}function C(m,h,F,f){return m.removeEventListener(h,F,f)}function k(m,h,F){var f=B(m,h,F);if(f)return m.detachEvent("on"+h,f)}function M(m,h,F){var f=u.indexOf(h)===-1?p():y();m.dispatchEvent?m.dispatchEvent(f):m.fireEvent("on"+h,f);function y(){var d;return s.createEvent?(d=s.createEvent("Event"),d.initEvent(h,!0,!0)):s.createEventObject&&(d=s.createEventObject()),d}function p(){return new r(h,{detail:F})}}function j(m,h,F){return function(y){var p=y||a.event;p.target=p.target||p.srcElement,p.preventDefault=p.preventDefault||function(){p.returnValue=!1},p.stopPropagation=p.stopPropagation||function(){p.cancelBubble=!0},p.which=p.which||p.keyCode,F.call(m,p)}}function S(m,h,F){var f=B(m,h,F)||j(m,h,F);return v.push({wrapper:f,element:m,type:h,fn:F}),f}function B(m,h,F){var f=I(m,h,F);if(f){var y=v[f].wrapper;return v.splice(f,1),y}}function I(m,h,F){var f,y;for(f=0;f<v.length;f++)if(y=v[f],y.element===m&&y.type===h&&y.fn===F)return f}}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,i,l){(function(a){var r=[],u="",s=/^on/;for(u in a)s.test(u)&&r.push(u.slice(2));i.exports=r}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,i,l){(function(a){var r=a.CustomEvent;function u(){try{var s=new r("cat",{detail:{foo:"bar"}});return s.type==="cat"&&s.detail.foo==="bar"}catch{}return!1}i.exports=u()?r:typeof document<"u"&&typeof document.createEvent=="function"?function(c,g){var v=document.createEvent("CustomEvent");return g?v.initCustomEvent(c,g.bubbles,g.cancelable,g.detail):v.initCustomEvent(c,!1,!1,void 0),v}:function(c,g){var v=document.createEventObject();return v.type=c,g?(v.bubbles=!!g.bubbles,v.cancelable=!!g.cancelable,v.detail=g.detail):(v.bubbles=!1,v.cancelable=!1,v.detail=void 0),v}}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,i,l){var a=i.exports={},r,u;function s(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s}catch{r=s}try{typeof clearTimeout=="function"?u=clearTimeout:u=c}catch{u=c}})();function g(I){if(r===setTimeout)return setTimeout(I,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(I,0);try{return r(I,0)}catch{try{return r.call(null,I,0)}catch{return r.call(this,I,0)}}}function v(I){if(u===clearTimeout)return clearTimeout(I);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(I);try{return u(I)}catch{try{return u.call(null,I)}catch{return u.call(this,I)}}}var x=[],w=!1,C,k=-1;function M(){!w||!C||(w=!1,C.length?x=C.concat(x):k=-1,x.length&&j())}function j(){if(!w){var I=g(M);w=!0;for(var m=x.length;m;){for(C=x,x=[];++k<m;)C&&C[k].run();k=-1,m=x.length}C=null,w=!1,v(I)}}a.nextTick=function(I){var m=new Array(arguments.length-1);if(arguments.length>1)for(var h=1;h<arguments.length;h++)m[h-1]=arguments[h];x.push(new S(I,m)),x.length===1&&!w&&g(j)};function S(I,m){this.fun=I,this.array=m}S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function B(){}a.on=B,a.addListener=B,a.once=B,a.off=B,a.removeListener=B,a.removeAllListeners=B,a.emit=B,a.prependListener=B,a.prependOnceListener=B,a.listeners=function(I){return[]},a.binding=function(I){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(I){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(n,i,l){(function(a){var r=typeof a=="function",u;r?u=function(s){a(s)}:u=function(s){setTimeout(s,0)},i.exports=u}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,i,l){(function(a,r){var u=n("process/browser.js").nextTick,s=Function.prototype.apply,c=Array.prototype.slice,g={},v=0;l.setTimeout=function(){return new x(s.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new x(s.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(w){w.close()};function x(w,C){this._id=w,this._clearFn=C}x.prototype.unref=x.prototype.ref=function(){},x.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(w,C){clearTimeout(w._idleTimeoutId),w._idleTimeout=C},l.unenroll=function(w){clearTimeout(w._idleTimeoutId),w._idleTimeout=-1},l._unrefActive=l.active=function(w){clearTimeout(w._idleTimeoutId);var C=w._idleTimeout;C>=0&&(w._idleTimeoutId=setTimeout(function(){w._onTimeout&&w._onTimeout()},C))},l.setImmediate=typeof a=="function"?a:function(w){var C=v++,k=arguments.length<2?!1:c.call(arguments,1);return g[C]=!0,u(function(){g[C]&&(k?w.apply(null,k):w.call(null),l.clearImmediate(C))}),C},l.clearImmediate=typeof r=="function"?r:function(w){delete g[w]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(nn);const st={"tree-grid":{type:"tree-grid"},"tab-page":{type:"tab-page"},section:{type:"section"},drawer:{type:"drawer"}},{globalStorageKey:Yo}=Ee.useThirdComponent(),on={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1}};class se{constructor(e,n){this.x=e,this.y=n}static getTransformInfo(e){const i=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(i.length>=6){const l=parseInt(i[4],10),a=parseInt(i[5],10);return{x:l,y:a}}return{x:0,y:0}}static fromEvent(e,n=null){if(this.isMouseEvent(e))return new se(e.clientX,e.clientY);if(n===null||e.changedTouches.length===1)return new se(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].target===n)return new se(e.changedTouches[i].clientX,e.changedTouches[i].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const n=new se(0,0);if(window){const i=window.getComputedStyle(e);if(i){const l=parseInt(i.getPropertyValue("left"),10),a=parseInt(i.getPropertyValue("top"),10);n.x=isNaN(l)?0:l,n.y=isNaN(a)?0:a}return n}return null}static copy(e){return new se(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class Pe{constructor(e,n){this.width=e,this.height=n}static getCurrent(e){const n=new Pe(0,0);if(window){const i=window.getComputedStyle(e);return i&&(n.width=parseInt(i.getPropertyValue("width"),10),n.height=parseInt(i.getPropertyValue("height"),10)),n}return null}static copy(e){return new Pe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function ln(o,e){const n=t.ref(),i=t.ref(),l=t.ref(),a=t.ref(),r=t.ref(),u=t.ref(),s=t.ref(),c=t.ref(),g=t.ref(),v=t.ref(),x=t.ref(),w=t.ref(o.resizeable),C=t.ref(),k=t.ref(o.draggable),M=t.ref(!1);function j(){const D=i.value||document.body,q=window.getComputedStyle(D);if(!q||!n.value)return;const W=se.getTransformInfo(n.value),z={};s.value&&(z.deltaL=n.value.offsetLeft-s.value.x,z.deltaT=n.value.offsetTop-s.value.y);const $=q.getPropertyValue("position");z.width=D.clientWidth,z.height=D.clientHeight,z.pr=parseInt(q.getPropertyValue("padding-right"),10),z.pb=parseInt(q.getPropertyValue("padding-bottom"),10),z.position=q.getPropertyValue("position"),$==="static"&&(D.style.position="relative"),z.translateX=W.x,z.translateY=W.y,v.value=z}function S(D){if(n.value){a.value=Pe.getCurrent(n.value),r.value=se.getCurrent(n.value),u.value=a.value?Pe.copy(a.value):null,s.value=r.value?se.copy(r.value):null,j();const q=D.target.getAttribute("type")||"";c.value={n:!!q.match(/n/),s:!!q.match(/s/),w:!!q.match(/w/),e:!!q.match(/e/)}}}function B(){var D,q,W,z;if(n.value){const $=n.value;c.value&&((c.value.n||c.value.s)&&((D=u.value)!=null&&D.height)&&($.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((q=u.value)!=null&&q.width)&&($.style.width=u.value.width+"px"),s.value&&((W=s.value)!=null&&W.x&&($.style.left=s.value.x+"px"),(z=s.value)!=null&&z.y&&($.style.top=s.value.y+"px")))}}function I(){const D=o.minHeight?o.minHeight:1,q=o.minWidth?o.minWidth:1;u.value&&s.value&&c.value&&a.value&&(u.value.height<D&&(u.value.height=D,c.value.n&&r.value&&(s.value.y=r.value.y+(a.value.height-D))),u.value.width<q&&(u.value.width=q,c.value.w&&r.value&&(s.value.x=r.value.x+(a.value.width-q))),o.maxHeight&&u.value.height>o.maxHeight&&(u.value.height=o.maxHeight,r.value&&c.value.n&&(s.value.y=r.value.y+(a.value.height-o.maxHeight))),o.maxWidth&&u.value.width>o.maxWidth&&(u.value.width=o.maxWidth,c.value.w&&r.value&&(s.value.x=r.value.x+(a.value.width-o.maxWidth))))}function m(){if(i.value){const D=v.value;if(s.value&&u.value&&c.value&&a.value){const q=D.width-D.pr-D.deltaL-D.translateX-s.value.x,W=D.height-D.pb-D.deltaT-D.translateY-s.value.y;c.value.n&&s.value.y+D.translateY<0&&r.value&&(s.value.y=-D.translateY,u.value.height=a.value.height+r.value.y+D.translateY),c.value.w&&s.value.x+D.translateX<0&&r.value&&(s.value.x=-D.translateX,u.value.width=a.value.width+r.value.x+D.translateX),u.value.width>q&&(u.value.width=q),u.value.height>W&&(u.value.height=W)}}}function h(D){if(!l.value||!a.value||!r.value||!c.value)return;D.subtract(l.value);const q=D.x,W=D.y;c.value.n?(s.value.y=r.value.y+W,u.value.height=a.value.height-W):c.value.s&&(u.value.height=a.value.height+W),c.value.e?u.value.width=a.value.width+q:c.value.w&&(u.value.width=a.value.width-q,s.value.x=r.value.x+q),m(),I(),B()}function F(D){if(!g.value)return;const q=se.fromEvent(D);q&&h(q)}function f(){if(n.value){const{width:D,height:q,x:W,y:z}=n.value.getBoundingClientRect(),$=se.getTransformInfo(n.value);return{size:{width:D,height:q},position:{x:W-$.x,y:z-$.y}}}return null}function y(D){if(n.value){const q=f();x.value=q}l.value=void 0,a.value=null,r.value=null,u.value=null,s.value=null,c.value=null,g.value=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",y)}function p(){document.addEventListener("mousemove",F),document.addEventListener("mouseup",y)}function d(D){D instanceof MouseEvent&&D.button===2||k.value&&(document.body.click(),D.stopPropagation(),D.preventDefault(),l.value=se.fromEvent(D),g.value=D.target,S(D),p())}function N(D){return n.value=D,w.value&&t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:q=>d(q)},null)])}function O(D=!0){document.body.click();const q=i.value||document.body,W=Pe.getCurrent(q),z=n.value;D&&z&&(C.value=f(),C.value.transform=z.style.transform),W&&z&&(u.value=W,u.value.height-=14,u.value.width-=14,z.style.height=u.value.height+"px",z.style.width=u.value.width+"px",z.style.left="7px",z.style.top="7px",z.style.transform="",x.value={size:u.value,position:{x:0,y:0}},k.value=!1,M.value=!0)}function E(){var D,q;if(document.body.click(),C.value){const W={width:C.value.size.width||0,height:C.value.size.height||0},z={x:(window.innerWidth-W.width)/2,y:(window.innerHeight-W.height)/2};(D=u.value)==null||D.set(W),(q=s.value)==null||q.set(z);const $=n.value;$.style.height=W.height+"px",$.style.width=W.width+"px",$.style.left=`${z.x}px`,$.style.top=`${z.y}px`,$.style.transform="",x.value={size:W,position:z},k.value=o.draggable,M.value=!1}}function P(){if(n.value){const D=Pe.getCurrent(n.value);if(D){const{width:q,height:W}=D;n.value.style.left=`${(window.innerWidth-q)/2}px`,n.value.style.top=`${(window.innerHeight-W)/2}px`,n.value.style.transform=""}}}function _(){const D=()=>{M.value?O(!1):P(),document.body.click()};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}}const K=_();return{renderResizeBar:N,boundingElement:i,resizedEventParam:x,maximize:O,restore:E,allowDrag:k,isMaximized:M,unWindowResizeHandle:K,moveToCenter:P}}function rn(o,e,n){const i=t.ref(),l=t.ref(o.draggable),a=t.ref(o.lockAxis),r=t.ref(),u=t.ref(),s=t.ref(!1),c=t.ref(new se(0,0)),g=t.ref(new se(0,0)),v=t.ref(new se(0,0)),x=t.ref(new se(0,0));t.watch(()=>n.value,F=>{r.value.style.cursor=F?"move":"default"});function w(F,f){if(f.tagName==="BUTTON")return!1;if(f===F)return!0;for(const y in f.children)if(Object.prototype.hasOwnProperty.call(f.children,y)&&w(F,f.children[y]))return!0;return!1}function C(){var p,d;let F=v.value.x+g.value.x,f=v.value.y+g.value.y;a.value==="x"?(F=((p=c.value)==null?void 0:p.x)||0,v.value.x=0):a.value==="y"&&(f=((d=c.value)==null?void 0:d.y)||0,v.value.y=0);const y=`translate3d(${Math.round(F)}px, ${Math.round(f)}px, 0px)`;i.value&&(i.value.style.transform=y),x.value.x=F,x.value.y=f}function k(){if(!u.value||!i.value)return null;const F=u.value.getBoundingClientRect(),f=i.value.getBoundingClientRect(),y={top:F.top<f.top,right:F.right>f.right,bottom:F.bottom>f.bottom,left:F.left<f.left};return y.top||(v.value.y-=f.top-F.top),y.bottom||(v.value.y-=f.bottom-F.bottom),y.right||(v.value.x-=f.right-F.right),y.left||(v.value.x-=f.left-F.left),C(),y}function M(F){F&&(c.value&&F.subtract(c.value),v.value.set(F),C(),k())}function j(F){s.value&&l.value&&(F.stopPropagation(),F.preventDefault(),M(se.fromEvent(F,r.value)))}function S(){var F;s.value&&(s.value=!1,g.value.add(v.value),v.value.reset(),(F=i.value)==null||F.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",S))}function B(){!s.value&&r.value&&(s.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",j),document.addEventListener("mouseup",S))}function I(){if(i.value){const F=se.getTransformInfo(i.value);g.value.set(F);return}g.value.reset()}function m(F){if(!n.value||F instanceof MouseEvent&&F.button===2)return;const f=F.target||F.srcElement;r.value!==void 0&&f&&!w(f,r.value)||l.value!==!1&&(document.body.click(),F.stopPropagation(),F.preventDefault(),c.value=se.fromEvent(F,i.value),I(),B())}function h(F,f,y){if(l.value&&f){if(F)r.value=F;else if(o.dragHandle){if(o.dragHandle instanceof HTMLElement)r.value=o.dragHandle;else if(typeof o.dragHandle=="string"){const p=f.querySelector(o.dragHandle);p&&(r.value=p)}}i.value=f,u.value=y,r.value?(r.value.classList.add("ng-draggable"),r.value.addEventListener("mousedown",m)):l.value=!1}}return{registerDraggle:h,resetTranslate:I}}function Mt(o,e){if(o){const n=i=>{i.key.toLowerCase()===o.toLowerCase()&&e({event:i,key:o})};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}}function an(o,e){const n=t.ref(o.enableEsc);let i=null;return n.value?(i=Mt("Escape",l=>{e.emit("esc",{event:l.event,type:"esc"})}),{remove:i}):null}function sn(o,e){const n=t.ref(o.enableEnter);let i=null;return n.value?(i=Mt("Enter",l=>{e.emit("enter",{event:l.event,type:"enter"})}),{remove:i}):null}const Ze=t.defineComponent({name:"FModal",props:on,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(o,e){const n=t.ref(o.width||300),i=t.ref(o.height||200),l=t.ref(o.modelValue),a=t.ref(""),r=t.ref(o.class),u=t.ref(o.fitContent),s=t.ref(o.showHeader),c=t.ref(""),g=t.ref(o.showCloseButton),v=t.ref(o.showMaxButton),x=t.ref(!1),w=t.ref(o.dialogType),C=t.ref(o.src),k=t.ref(""),M=t.ref(o.showButtons),j=t.ref(o.title),S=t.ref(o.containment||null),B=t.ref();j.value==="错误提示"&&(j.value=Oe.LocaleService.getLocaleValue("messageBox.errorTitle"));const I=t.ref(!1);function m(V,X){const re=X?"accept":"cancel";Promise.resolve().then(()=>{var ae;return(ae=o.beforeClose)==null?void 0:ae.call(o,{closeType:re})}).then(ae=>{ae&&(l.value=!1,e.emit("update:modelValue",!1),X!=null&&e.emit(X?"accept":"cancel"),e.emit("closed",V))})}const h=[{name:"cancel",text:Oe.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:V=>{m(V,!1)}},{name:"accept",text:Oe.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:V=>{m(V,!0)}}],F=t.ref(o.buttons&&o.buttons.length?o.buttons:h),f=t.computed(()=>!!c.value),y=t.computed(()=>!!M.value&&!!F.value),p=t.ref(),d=t.ref(),N=t.ref(!1),{renderResizeBar:O,maximize:E,restore:P,boundingElement:_,resizedEventParam:K,allowDrag:D,unWindowResizeHandle:q,moveToCenter:W}=ln(o),{registerDraggle:z}=rn(o,e,D);function $(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ie(){const V=document.querySelectorAll(".farris-modal").length;(!V||V-1<=0)&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}t.watch(()=>o.title,(V,X)=>{V!==X&&(j.value=V)}),t.watch(()=>o.modelValue,(V,X)=>{V!==X&&(l.value=V,l.value&&o.draggable&&t.nextTick(()=>{d.value&&!S.value&&(S.value=d.value.parentElement,_.value=S.value,z(p.value,d.value,_.value),W())}),V||(S.value&&(S.value=null),ie())),l.value?I.value=$():(N.value=!1,D.value=o.draggable)}),t.watch(()=>o.showHeader,(V,X)=>{V!==X&&(s.value=V)}),t.watch(()=>o.showButtons,(V,X)=>{V!==X&&(M.value=V)}),t.watch(()=>K.value,(V,X)=>{const re=V||{},ae=X||{};JSON.stringify(re)!==JSON.stringify(ae)&&e.emit("resize",{newSize:V,oldSize:X,isMaximized:N.value})}),t.watch([()=>o.width,()=>o.height],(V,X)=>{(V[0]!==X[0]||V[1]!==X[1])&&(n.value=V[0]||500,i.value=V[1]||600)}),t.watch(()=>o.class,(V,X)=>{r.value=V});const le=t.computed(()=>(l.value&&document.body.classList.add("modal-open"),l.value)),Y=t.computed(()=>{var re;const V={modal:!0,"farris-modal":!0,fade:!0};V["f-modal-fitContent"]=!!u.value,V.show=!!le.value;const X=(re=o.maskClass)==null?void 0:re.split(" ");return X==null||X.reduce((ae,pe)=>(ae[pe]=!0,ae),V),V}),xe=t.computed(()=>{var re;const V={"modal-dialog":!0},X=(re=r.value)==null?void 0:re.split(" ");return X==null||X.reduce((ae,pe)=>(ae[pe]=!0,ae),V),V}),me=()=>Ee.isMobilePhone()&&!o.isMessager,ne=t.computed(()=>{const V=document.documentElement.clientWidth,X=document.documentElement.clientHeight,re=Math.min(n.value,V),ae=u.value?"auto":`${Math.min(i.value,X-10)}px`,pe={position:"absolute",top:`${(window.innerHeight-parseInt(ae==="auto"?"0":ae))/2}px`,left:`${(window.innerWidth-re)/2}px`,width:`${re}px`,height:ae};return me()&&(pe.top="0px",pe.left="0px",pe.width=`${window.innerWidth}px`,pe.height=`${window.innerHeight}px`),o.mask||(pe.pointerEvents="auto"),pe}),A=t.ref(Ee.getMaxZIndex()||1050),oe=t.computed(()=>{const V={display:"block",overflow:"hidden"};return o.mask||(V.pointerEvents="none",V.backgroundColor="transparent"),I.value&&(V.backgroundColor="transparent"),V.zIndex=A.value,V}),Le=t.computed(()=>({"modal-content":!0,"modal-content-has-header":s.value,"is-mobile":me()})),ke=t.computed(()=>{const V={display:s.value?"":"none"};return V["pointer-events"]=D.value?"auto":"none",V}),Te=t.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:N.value})),Xe=t.computed(()=>({"modal-body":!0,"f-utils-flex-column":w.value==="iframe","f-utils-fill":!0}));function Ue(){return{height:`${o.footerHeight||60}px`}}const Ke=t.computed(()=>{const V={textAlgin:k.value},X=Ue();return Object.assign(V,X)});function ce(V){if(V==null||V.stopPropagation(),N.value){N.value=!1,P();return}E(),N.value=!0}async function et(V,X){V.handle&&await V.handle(X,V)&&e.emit("closed",X)}function Be(V){V.width&&(n.value=V.width),V.height&&(i.value=V.height),V.buttons&&(F.value=V.buttons),V.title&&(j.value=V.title)}let je=null,Fe=null;t.onBeforeMount(()=>{I.value=$()}),t.onMounted(()=>{d.value&&!S.value&&(S.value=d.value.parentElement,_.value=S.value,z(p.value,d.value,_.value)),le.value&&document.body.classList.add("modal-open"),je=an(o,e),Fe=sn(o,e)}),t.onUnmounted(()=>{q&&q(),je&&je.remove(),Fe&&Fe.remove()}),e.expose({modalElementRef:d,updateModalOptions:Be,close:m,maxDialog:ce,isMaximized:N});function De(){return t.createVNode("ul",null,[x.value&&t.createVNode("li",{class:"f-btn-icon f-bare"},[t.createVNode("span",{class:"f-icon modal_minimize"},null)]),v.value&&t.createVNode("li",{onClick:ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[t.createVNode("span",{class:Te.value},null)]),g.value&&t.createVNode("li",{class:"f-btn-icon f-bare",onClick:V=>m(V,!1),style:"pointer-events: auto;"},[t.createVNode("span",{class:"f-icon modal_close"},null)])])}function tt(){return t.createVNode("div",{class:"modal-footer",style:Ke.value},[F.value&&F.value.map(V=>{const X=t.ref(V.disabled);return t.createVNode("button",{name:V.name,type:"button",disabled:X.value,class:V.class+(V.iconClass?" btn-icontext":""),onClick:re=>{et(V,re)}},[!!V.iconClass&&t.createVNode("i",{class:V.iconClass},null),V.text])})])}function ze(){return t.createVNode("div",{ref:p,class:"modal-header",style:ke.value},[e.slots.headerTemplate?e.slots.headerTemplate():t.createVNode("div",{class:"modal-title"},[f.value&&t.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),t.createVNode("span",{class:"modal-title-label"},[j.value])]),t.createVNode("div",{class:"actions"},[De()])])}function Se(){return e.slots.footerTemplate?e.slots.footerTemplate():y.value&&tt()}function Re(V){if(V.stopPropagation(),o.allowClickMaskToClose){if(V.target!==B.value)return;m(V,!1)}}function Qe(){var V,X;return t.createVNode("div",{id:a.value,class:xe.value,style:ne.value,ref:d},[t.createVNode("div",{class:Le.value},[s.value&&ze(),t.createVNode("div",{class:Xe.value},[(X=(V=e.slots).default)==null?void 0:X.call(V),w.value==="iframe"&&t.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:C.value},null)]),Se()]),!u.value&&d.value&&!N.value&&O(d.value)])}function Je(V){return V||"body"}return t.watchEffect(()=>{le.value&&(A.value=Ee.getMaxZIndex()||1050)}),()=>t.createVNode(t.Teleport,{to:Je(o.host)},{default:()=>[le.value&&t.createVNode(t.Transition,{name:"fade",appear:!0},{default:()=>[t.createVNode("div",{ref:B,class:Y.value,style:oe.value,onClick:Re},[Qe()])]})]})}});function kt(o){if(o.content&&o.content.render)return o.content.render;if(o.render&&typeof o.render=="function")return o.render}function cn(o){const e=document.createElement("div");e.style.display="contents";const n=t.createApp({setup(i,l){t.onUnmounted(()=>{document.body.removeChild(e)});const a=t.ref(),r=t.ref(o.class||""),u=t.ref(!!o.showButtons),s=t.ref(!!o.showHeader),c=t.ref(o.showCloseButton==null?!0:o.showCloseButton),g=t.ref(!0),v=t.ref(o.title||""),x=o.acceptCallback||(()=>{}),w=o.rejectCallback||(()=>{}),C=o.closedCallback||(B=>{}),k=o.resizeHandle||(B=>{}),M=o.stopMoveHandle||(B=>{}),j=kt(o),S=B=>{g.value=!1,n.unmount(),C(B)};return t.onMounted(()=>{}),l.expose({modalRef:a}),()=>t.createVNode(Ze,{ref:a,class:r.value,modelValue:g.value,"onUpdate:modelValue":B=>g.value=B,title:v.value,width:o.width,height:o.height,buttons:o.buttons,"show-header":s.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:x,onCancel:w,fitContent:o.fitContent==null?!0:o.fitContent,onClosed:S,onResize:k,onStopMove:M},{default:()=>[j&&j(n)]})}});return document.body.appendChild(e),n.use(Oe.LocaleService.i18n),n.mount(e),n}class un{constructor(e){te(this,"appContext",null);te(this,"modalRef",t.ref());te(this,"activeModalIndex",t.ref(0));te(this,"modalRefs",{});te(this,"isUseEscCloseModal",t.ref(!1));te(this,"activeModalInstance",t.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,n){const{width:i,height:l}={width:window.innerWidth,height:window.innerHeight};return i<e&&(e=i-14),l<n&&(n=l-14),{width:e,height:n}}static show(e){const n=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return cn(n)}close(e){var n,i;e?(i=e.value)==null||i.close():(n=this.getCurrentModal())==null||n.close()}open(e){const n=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const i=t.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),l=t.ref(!0),a=i.value.acceptCallback||(()=>{}),r=i.value.rejectCallback||(()=>{}),u=i.value.closedCallback||((m,h)=>{}),s=i.value.resizeHandle||(m=>{}),c=e.stopMoveHandle||(m=>{});let g;const v=kt(i.value),x=m=>{var F;l.value=!1;const h=(F=m==null?void 0:m.target)==null?void 0:F.classList.contains("modal_close");u(m,this.isUseEscCloseModal.value?"esc":h?"icon":"button")},w=m=>{x(m),g&&t.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],t.render(null,n),g=null,this.modalRef.value=null,this.modalRefs){const h=Object.keys(this.modalRefs).map(F=>Number(F));h.length>0?this.activeModalIndex.value=Math.max(...h):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},C=m=>{var h;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((h=this.activeModalInstance.value)==null||h.close(m==null?void 0:m.event))},{width:k,height:M}=i.value,j=this.adaptToWindow(k||500,M||320);Object.assign(i.value,j);const S=()=>t.createVNode(Ze,t.mergeProps({ref:this.modalRef,modelValue:l.value,"onUpdate:modelValue":m=>l.value=m},i.value,{isMessager:i.value.class&&i.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:r,onClosed:w,onResize:s,onEsc:C,onStopMove:c}),{default:()=>[v&&v(this.app)]});return g=(m=>{const h=t.h(S,m);return h.appContext=this.appContext,t.render(h,n),h})({...i.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:m=>{i.value={...i.value,...m},g&&t.render(t.cloneVNode(g,{...i}),n)},destroy:w,modalRef:this.activeModalInstance,close:()=>this.close()}}}const dn=Symbol("FModalService");Ze.install=o=>{o.component(Ze.name,Ze);const e=new un(o);o.provide(dn,e),o.provide("FModalService",e)},t.ref(0);function Bt(o){const{designerHostService:e}=o,n=new Map,i=t.ref(),l=t.ref(),a=t.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),r={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u=t.ref(!1),s=t.ref(o.componentType);function c(M){const j=[];return M.forEach(S=>{let B=[];S.type&&S.type.fields&&S.type.fields.length>0&&(B=c(S.type.fields));const I=ye.cloneDeep(S),m=S.multiLanguage?"多语言":S.type.displayName,h=B.length?!1:!n.has(S.id);h&&(u.value=!0),j.push({data:Object.assign({displayedTypeName:m,selectable:h},I),children:B})}),j}function g(M){switch(M){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return M}}function v(M){var j,S;if(M&&(((j=M.schema)==null?void 0:j.type)===((S=st.drawer)==null?void 0:S.type)||M.parent&&v(M.parent)))return!0}function x(M){if(n.clear(),!M)return;const j=v(o.targetComponentInstance);let S=g(s.value);["frame","table","form"].includes(S)&&(S="form");const{formSchemaUtils:B,schemaService:I}=e;B.getFormSchema().module.viewmodels.forEach(m=>{if(!m.fields||m.fields.length===0)return;const h=B.getComponentByViewModelId(m.id);let F=h.componentType;["frame","table","form"].includes(F)&&(F="form");const f=I.getTableInfoByViewModelId(m.id);if(F!==S||!f||f.id!==M.id)return;const y=B.checkComponentExistInDrawer(h.id);j&&y&&m.fields.forEach(p=>{n.set(p.id,!0)}),!j&&!y&&m.fields.forEach(p=>{n.set(p.id,!0)})})}function w(M){x(M);const{fields:j}=M.type;u.value=!1,i.value=c(j),l.value&&l.value.updateDataSource(i.value)}const C={customRowStatus:M=>(M.disabled=!M.raw.selectable,M)};function k(){return l.value.getSelectedItems().map(j=>j.data)}return{fieldTreeGridRef:l,resolveFieldDataSource:w,occupiedFieldMap:n,fieldDataSource:i,fieldTreeRowOption:C,fieldColumns:a,fieldSelectionOption:r,checkAndGetSelectedFields:k,hasSelectableField:u,currentComponentType:s}}function fn(o){const{designerHostService:e}=o,n=new Map,i=t.ref(),l=t.ref(),a=t.ref([{field:"name",title:"实体名称"}]),r=t.ref(),u=t.ref(!1);function s(C){const k=Bt(o);return k.resolveFieldDataSource(C),k.hasSelectableField.value?(r.value=r.value||C,!0):!1}function c(C){return!(o.bindingEntityId&&o.bindingEntityId!==C.id||!s(C))}function g(C,k=""){var I;if(!C)return;const M=ye.cloneDeep(C),j=k?`${k}/${M.label}`:"/";n.set(M.label,j.replace("//","/"));const S=c(M),B={data:Object.assign({selectable:S},M),children:[]};if(M.type.entities&&M.type.entities.length){const m=M.type.entities.map(h=>g(h,j));B.children=B.children.concat(m)}return o.bindingEntityId===C.id&&(r.value=C),((I=r.value)==null?void 0:I.id)===C.id&&!k&&(u.value=!0),B}function v(){var j;const{formSchemaUtils:C}=e,k=(j=C.getFormSchema().module.entity[0])==null?void 0:j.entities[0];n.clear();const M=g(k);l.value=[M]}function x(){var k;const C=i.value.getSelectionRow();if(!C||!((k=C.raw)!=null&&k.data)){const M=new pt;M.globalConfig={position:"top-center"},M.warning({message:"请先选择实体"});return}return C.raw.data}return{entityTreeGridRef:i,entityDataSource:l,resolveEntityDataSource:v,entityBindToMap:n,checkAndGetSelectedEntity:x,entityColumns:a,entityTreeRowOption:{customRowStatus:C=>(C.disabled=!C.raw.selectable,C)},initialSelectedEntity:r,isMainEntityInitialSelected:u}}const mn=new Map([["appearance",$e.resolveAppearance]]);function pn(o,e,n){return e}const hn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},gn={title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},jt={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}},Dt=$e.createPropsResolver(jt,hn,mn,pn,gn),qe=t.defineComponent({name:"FStep",props:jt,emits:["click"],setup(o,e){const n=t.ref(o.direction),i=t.ref(o.fill),l=t.ref(o.height),a=t.ref(o.steps),r=t.ref(o.activeIndex),u=t.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&i.value,"f-progress-step-vertical-fill":n.value==="vertical"&&i.value})),s=t.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function c(I,m){const h={step:!0,active:m===r.value,clickable:o.clickable,current:m===r.value,finish:m<r.value};return I.status&&(h[I.status]=!0),Ee.getCustomClass(h,I.class||"")}function g(I,m){if(!o.clickable)return;const h={step:I,stepIndex:m};e.emit("click",h)}function v(I,m){const h={"f-progressstep-row":!0,"step-active":m===r.value,"step-current":m===r.value,"step-finish":m<r.value};return I.status&&(h["step-"+I.status]=!0),h}function x(I,m){const h={"step-icon":!0,"step-success":m,"f-icon":m,"f-icon-check":m};return Ee.getCustomClass(h,I.icon||"")}function w(I,m){const h=[];return I.icon?h.push(t.createVNode("span",{class:x(I,!1)},null)):m>=r.value?h.push(t.createVNode("span",{class:"step-icon"},[m+1])):h.push(t.createVNode("span",{class:x(I,!0)},null)),h}function C(I,m){return{"step-name":!0,"step-name-success":m<r.value}}function k(I,m){return t.createVNode("div",{class:"f-progress-step-title"},[t.createVNode("p",{class:C(I,m)},[I.title])])}function M(I,m){return{"f-progress-step-line":!0,"f-progress-step-line-success":m===r.value}}function j(I,m){return m!==a.value.length-1}const S=t.computed(()=>({triangle:!0,"":n.value==="vertical"}));function B(){return a.value.map((I,m)=>t.createVNode("li",{class:c(I,m),onClick:h=>g(I,m)},[t.createVNode("div",{class:v(I,m)},[t.createVNode("div",{class:"f-progress-step-content"},[w(I,m),k(I,m)]),j(I,m)&&t.createVNode("div",{class:M(I,m)},[t.createVNode("span",{class:S.value},null)])])]))}return t.watch(()=>o.activeIndex,()=>{o.activeIndex>-1&&o.activeIndex<=a.value.length&&(r.value=o.activeIndex,B())}),()=>t.createVNode("div",{class:"f-progress-step"},[t.createVNode("ul",{class:u.value,style:s.value},[B()])])}}),yn=t.defineComponent({name:"FStepDesign",props:At.stepProps,emits:[],setup(o,e){const n=t.ref(o.direction),i=t.ref(o.fill),l=t.ref(o.height),a=t.ref(o.steps),r=t.ref(0),u=t.ref(o.clickable),s=t.ref(0),c=t.ref(),g=t.inject("design-item-context"),v=T.useDesignerComponent(c,g);t.onMounted(()=>{c.value.componentInstance=v}),e.expose(v.value);const x=t.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&i.value,"f-progress-step-vertical-fill":n.value==="vertical"&&i.value})),w=t.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function C(y,p){const d={step:!0,active:p===r.value,clickable:u.value,"click-disable":y.disable,current:p===r.value};return p<r.value&&(d.finish=!0),y.status&&(d[y.status]=!0),y.hasOwnProperty("class")&&y.class.split(" ").reduce((N,O)=>(N[O]=!0,N),d),d}function k(y,p){}function M(y,p){const d={"f-progressstep-row":!0,"step-active":p===r.value,"step-current":p===r.value};return p<r.value&&(d["step-finish"]=!0),y.status&&(d["step-"+y.status]=!0),d}function j(y,p){const d={"step-icon":!0,"step-success":p,"k-icon":p,"k-i-check":p};return y.hasOwnProperty("icon")&&y.class.split(" ").reduce((N,O)=>(N[O]=!0,N),d),d}function S(y,p){const d=[];return y.icon?d.push(t.createVNode("span",{class:j(y,!1)},null)):p>=r.value||p===s.value?d.push(t.createVNode("span",{class:"step-icon"},[p+1])):d.push(t.createVNode("span",{class:j(y,!0)},null)),d}function B(y,p){return{"step-name":!0,"step-name-success":p<r.value}}function I(y,p){return t.createVNode("div",{class:"f-progress-step-title"},[t.createVNode("p",{class:B(y,p)},[y.title])])}function m(y,p){return{"f-progress-step-line":!0,"f-progress-step-line-success":p===r.value}}function h(y,p){return p!==a.value.length-1}const F=t.computed(()=>({triangle:!0,"":n.value==="vertical"}));function f(){return a.value.map((y,p)=>t.createVNode("li",{class:C(y,p),onClick:d=>void 0},[t.createVNode("div",{class:M(y,p)},[t.createVNode("div",{class:"f-progress-step-content"},[S(y,p),I(y,p)]),h(y,p)&&t.createVNode("div",{class:m(y,p)},[t.createVNode("span",{class:F.value},null)])])]))}return()=>t.createVNode("div",{ref:c,class:"f-progress-step"},[t.createVNode("ul",{class:x.value,style:w.value},[f()])])}});qe.install=o=>{o.component(qe.name,qe)},qe.register=(o,e,n,i)=>{o.step=qe,e.step=Dt},qe.registerDesigner=(o,e,n)=>{o.step=yn,e.step=Dt};const vn=t.defineComponent({name:"FEntityBindingSelector",props:Zt,emits:["submit","cancel"],setup(o,e){const n=fn(o),{entityColumns:i,entityTreeGridRef:l,entityDataSource:a,checkAndGetSelectedEntity:r,resolveEntityDataSource:u,entityTreeRowOption:s,initialSelectedEntity:c,isMainEntityInitialSelected:g}=n,v=Bt(o),{fieldColumns:x,resolveFieldDataSource:w,fieldDataSource:C,fieldTreeGridRef:k,fieldTreeRowOption:M,fieldSelectionOption:j,checkAndGetSelectedFields:S,currentComponentType:B}=v,I=new pt;I.globalConfig={position:"top-center"};const m=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],h=t.ref(),F=t.ref(""),f=t.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),y=t.ref(0),p=t.ref(""),d=t.computed(()=>$=>({"f-utils-fill":!0,border:$!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":f.value[y.value].id!==$}));function N(){o.bindingEntityId&&(c!=null&&c.value)&&(F.value=c.value.name),o.componentType||(h.value=g.value?"response-form":"data-grid")}function O(){const $=r();$&&(w($),k.value.updateDataSource(C.value))}t.onBeforeMount(()=>{o.steps&&(f.value=f.value.filter($=>o.steps.includes($.id))),p.value=f.value[0].id,u(),N()}),t.onMounted(()=>{var $,ie;l&&(($=c.value)!=null&&$.id)&&l.value.selectRowById((ie=c.value)==null?void 0:ie.id),f.value.length===1&&f.value[0].id==="selectFields"&&O()});function E($){var ie;(ie=k==null?void 0:k.value)!=null&&ie.emptyCurrentRowId&&k.value.emptyCurrentRowId()}function P(){return t.createVNode(ht,{key:1,ref:l,fit:!0,data:a.value,idField:"id",columns:i.value,rowNumber:{enable:!1},"row-option":s,columnOption:{fitColumns:!0}},null)}function _(){return t.createVNode(ht,{key:2,ref:k,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:C.value,idField:"id",columns:x.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":M,selection:j},null)}function K(){const $={editable:!1,type:"combo-list",data:m,idField:"value",valueField:"value",textField:"name"},ie={type:"input-group",enableClear:!1};return t.createVNode("div",null,[t.createVNode("div",{class:"f-utils-fill"},[t.createVNode("div",{class:"f-section py-0"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode("组件信息")])])]),t.createVNode("div",{class:"f-section-content"},[t.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[t.createVNode(Nt.FDynamicFormGroup,{label:"组件类型",customClass:"col-12",modelValue:h.value,"onUpdate:modelValue":le=>h.value=le,required:"true",editor:$,onChange:E},null),t.createVNode(Nt.FDynamicFormGroup,{label:"组件标题",customClass:"col-12",modelValue:F.value,"onUpdate:modelValue":le=>F.value=le,required:"true",editor:ie},null)])])])])])}function D(){y.value--,p.value=f.value[y.value].id}function q(){var $;switch(p.value){case"selectEntity":{O();break}case"selectComponentType":{if(!h.value){I.warning("请先选择组件类型");return}if(!(($=F.value)!=null&&$.trim())){I.warning("请先填写组件标题");return}B.value=h.value,w(c.value),k.value.updateDataSource(C.value);break}}y.value++,p.value=f.value[y.value].id}function W(){e.emit("cancel")}function z(){var le;const $=r(),ie=S();if($){const Y={bindingType:"entity"};Y.bindingEntity=$,Y.bindTo=n.entityBindToMap.get(((le=Y.bindingEntity)==null?void 0:le.label)||""),Y.bindingEntityFields=ie,Y.entityTitle=F.value,e.emit("submit",{bindingContext:Y,componentType:h.value})}}return()=>{var $;return t.createVNode("div",{class:"h-100 d-flex flex-column"},[(($=f.value)==null?void 0:$.length)>1?t.createVNode(qe,{steps:f,activeIndex:y,style:"align-self:center"},null):"",t.createVNode("div",{class:d.value("selectEntity"),style:"border-radius:10px;"},[P()]),t.createVNode("div",{class:d.value("selectComponentType"),style:"border-radius:10px;"},[K()]),t.createVNode("div",{class:d.value("selectFields"),style:"border-radius:10px;"},[_()]),t.createVNode("div",{class:"modal-footer"},[t.createVNode("button",{class:"btn btn-secondary",onClick:W},[t.createTextVNode("取消")]),y.value!==0?t.createVNode("button",{class:"btn btn-secondary",onClick:D},[t.createTextVNode("上一步")]):"",y.value!==f.value.length-1?t.createVNode("button",{class:"btn btn-primary",onClick:q},[t.createTextVNode("下一步")]):"",y.value===f.value.length-1?t.createVNode("button",{class:"btn btn-primary",onClick:z},[t.createTextVNode("确定")]):""])])}}});function bn(o,e){let n;function i(s){var C,k,M,j,S,B;const c=(k=(C=o.parent)==null?void 0:C.parent)==null?void 0:k.componentInstance;if(!((S=(j=(M=c==null?void 0:c.value)==null?void 0:M.schema)==null?void 0:j.contents)!=null&&S.length))return;const g={componentType:"response-form",bindingSourceContext:s,parentComponentInstance:c.value},v=c.value.addNewChildComponentSchema(g,e),x=(B=o.parent)==null?void 0:B.schema,w=c.value.schema.contents.findIndex(I=>I.id===(x==null?void 0:x.id));w>-1&&c.value.schema.contents.splice(w+1,0,v)}function l(s){var c,g;i(s.bindingContext),(c=n==null?void 0:n.modalRef)!=null&&c.value.close&&((g=n==null?void 0:n.modalRef)==null||g.value.close())}function a(){var s,c;(s=n==null?void 0:n.modalRef)!=null&&s.value.close&&((c=n==null?void 0:n.modalRef)==null||c.value.close())}function r(){if(!e)return;const{schemaService:s,formSchemaUtils:c}=e,{componentType:g}=o.schema,v=c.getViewModelIdByComponentId(o.componentInstance.value.belongedComponentId),x=s.getTableInfoByViewModelId(v),w=x==null?void 0:x.id,C=["selectFields"];return()=>t.createVNode(t.Fragment,null,[t.createVNode(vn,{componentType:g,bindingEntityId:w,steps:C,designerHostService:e,targetComponentInstance:o.parent,onSubmit:l,onCancel:a},{default:()=>[t.createTextVNode(" ")]}),t.createTextVNode(" ")])}function u(s){s.stopPropagation(),s.preventDefault(),e&&(n=e.modalService.open({title:"添加卡片",width:800,height:600,fitContent:!1,showButtons:!1,render:r(),enableEsc:!1,draggable:!0}))}return{addSiblingComponent:u}}const wn={componentId:{type:String,default:""},designerHostService:{type:Object,default:{}}},Ye=class Ye{static getEditorTypesByMDataType(e,n=!1,i=""){if(n)return[{key:T.DgControl["language-textbox"].type,value:T.DgControl["language-textbox"].name}];let l=Ye.fieldControlTypeMapping[e];if(i==="data-grid-column"&&(l!=null&&l.length)){const a=[T.DgControl["check-group"].type,T.DgControl["radio-group"].type,T.DgControl.image.type,T.DgControl["rich-text-editor"].type];l=l.filter(r=>!a.includes(r.key))}return l}static getAllInputTypes(){const e=[];for(const n in Ye.fieldControlTypeMapping)Ye.fieldControlTypeMapping[n].forEach(i=>{e.find(l=>l.key===i.key&&l.value===i.value)||e.push({key:i.key,value:i.value})});return e}static mappingDomPropAndSchemaProp(e,n){var a;const i=(a=e.editor)==null?void 0:a.type,l=[];return(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&n&&n.categoryId&&n.categoryId.indexOf("gridFieldEditor")<0&&l.push({domField:"title",schemaField:"name"}),l.push({domField:"label",schemaField:"name"}),l.push({domField:"editor.required",schemaField:"require"}),l.push({domField:"editor.readonly",schemaField:"readonly"}),(i===T.DgControl["input-group"].type||i===T.DgControl.textarea.type||i===T.DgControl["number-spinner"].type)&&l.push({domField:"editor.maxLength",schemaField:"type.length"}),i===T.DgControl["number-spinner"].type&&l.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"formatter.precision",schemaField:"type.precision"}),(i===T.DgControl["combo-list"].type||i===T.DgControl["radio-group"].type)&&l.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"formatter.data",schemaField:"type.enumValues"}),i===T.DgControl["date-picker"].type&&(l.push({domField:"editor.displayFormat",schemaField:"editor.format"}),l.push({domField:"editor.fieldType",schemaField:"type.name"})),i===T.DgControl["number-spinner"].type&&(l.push({domField:"editor.max",schemaField:"editor.maxValue"}),l.push({domField:"editor.min",schemaField:"editor.minValue"})),i===T.DgControl.lookup.type&&(l.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),l.push({domField:"editor.valueField",schemaField:"editor.valueField"}),l.push({domField:"editor.textField",schemaField:"editor.textField"}),l.push({domField:"editor.displayType",schemaField:"editor.displayType"}),l.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),l.push({domField:"editor.helpId",schemaField:"editor.helpId"})),l.push({domField:"path",schemaField:"bindingPath"}),l.push({domField:"binding.path",schemaField:"bindingField"}),l.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"field",schemaField:"bindingPath"}),l}};te(Ye,"fieldControlTypeMapping",{String:[{key:T.DgControl["input-group"].type,value:T.DgControl["input-group"].name},{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl.image.type,value:T.DgControl.image.name},{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name},{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name},{key:T.DgControl["check-group"].type,value:T.DgControl["check-group"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name},{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl.textarea.type,value:T.DgControl.textarea.name},{key:T.DgControl["time-picker"].type,value:T.DgControl["time-picker"].name}],Text:[{key:T.DgControl.textarea.type,value:T.DgControl.textarea.name},{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl.image.type,value:T.DgControl.image.name},{key:T.DgControl["rich-text-editor"].type,value:T.DgControl["rich-text-editor"].name}],Decimal:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Integer:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Number:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name},{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name}],BigNumber:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Date:[{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name}],DateTime:[{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name}],Boolean:[{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name}],Enum:[{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name}],Object:[{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name}]});let Rt=Ye;var ct=(o=>(o.Form="Form",o.Variable="Variable",o))(ct||{});class Cn{constructor(e,n){te(this,"controlsInfo",{});te(this,"formSchemaUtils");te(this,"designViewModelUtils");te(this,"viewModelId","");this.designerHostService=e,this.componentId=n,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils,this.viewModelId=this.formSchemaUtils.getViewModelIdByComponentId(this.componentId)}buildFieldTreeData(){const e=this.designViewModelUtils.getDgViewModel(this.viewModelId);if(!e)return[];const n=this.formSchemaUtils.getComponentById(this.componentId);if(!n)return[];const{componentType:i}=n,l=e.fields;if(i==="data-grid"||i==="form"){const a=this.getAllControlsInComponents(n);return this.controlsInfo.controls=a,this.buildFieldTreeDataByControls(l,a,i)}return[]}getAllControlsInComponents(e){const n=[],i=this.getFormLayoutInCmp(e.contents);if(this.controlsInfo.formLayout=i,i){const l=i.columns||i.contents;this.getAllControlsInLayout(l,n)}return n}buildFieldTreeDataByControls(e,n,i){const l=[],a=new Map,r=[];return n.forEach(u=>{if(u.type===T.DgControl.fieldset.type){r.push(u);return}const s=this.buildFieldTreeNodeFromControl(u,e,this.componentId,i,n);if(s)if(s.isInGroupNode){if(!a.has(s.groupId)){const g=this.buildFieldTreeGroupNodeWithBindingEntityField(u,e,r,s);g&&(a.set(s.groupId,g),l.push(g))}const c=a.get(s.groupId);c!=null&&c.children&&c.children.push(s)}else l.push(s)}),l}buildFieldTreeNodeFromControl(e,n,i,l,a){let r;return e.binding?e.binding.type===ct.Variable?r=this.buildFieldTreeNodeWithBindingVariable(e):r=this.buildFieldTreeNodeWithBindingEntityField(e,n,i,l):r=this.buildFieldTreeNodeWithoutControlBinding(e,a),r}buildFieldTreeNodeWithoutControlBinding(e,n){const i=n.find(l=>{if(l.type===T.DgControl.fieldset.type&&l.contents&&l.contents.length&&l.contents.find(r=>r.id===e.id))return!0});return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:e.id,name:e.title||e.text||e.label},groupId:i?i.id:"",groupName:i?i.title:"",expanded:!1,isBindVariable:!1,isComplexField:!1,isGroupNode:!1,isInGroupNode:!!i,isNoBinding:!0,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingVariable(e){const n=e.binding.field,i=this.formSchemaUtils.getVariableById(n),l=this.formSchemaUtils.getViewModelById(this.viewModelId),a=l==null?void 0:l.fields.find(u=>u.id===n),r=a&&a.groupId;return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:n,name:e.title||e.text||e.label,code:e.binding.fullPath||e.binding.path,controlType:e.type,type:i&&i.type,category:i&&i.category},groupId:r,expanded:!1,isBindVariable:!0,isComplexField:!1,isInGroupNode:!!r,isGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingEntityField(e,n,i,l){const a=e.binding.field,r=n.find(x=>x.id===a);if(!r)return;const{groupId:u}=r,s=r.isSchemaRemoved?{id:a,name:e.title||e.text||e.label}:r,c=r.isSchemaRemoved,g=!r.isSchemaRemoved,v=r.$type==="ComplexField";return{canChangeControlType:g,children:[],componentId:i,componentType:l,control:e,data:s,expanded:!1,groupId:u,isBindVariable:!1,isComplexField:v,isGroupNode:!1,isInGroupNode:!!u,isNoBinding:!1,isRemoved:!!c,nodeType:"field"}}buildFieldTreeGroupNodeWithBindingEntityField(e,n,i,l){let a,r;if(e.binding&&e.binding.type===ct.Form){const s=e.binding.field,c=n.find(g=>g.id===s);if(!c)return;a=c.groupId,r=c.groupName}else if(e.binding&&e.binding.type===ct.Variable){const s=e.binding.field,c=this.formSchemaUtils.getViewModelById(this.viewModelId),g=c==null?void 0:c.fields.find(v=>v.id===s);if(!g)return;a=g.groupId,r=g.groupName}else a=l==null?void 0:l.groupId,r=l==null?void 0:l.groupName;const u=i.find(s=>s.id===a);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:u,data:{id:a,name:r},groupId:a,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}getFormLayoutInCmp(e){if(!e)return{};for(const n of e){if([T.DgControl["data-grid"].type,T.DgControl["tree-grid"].type,T.DgControl["response-form"].type].includes(n.type))return n;if(n.contents){const l=this.getFormLayoutInCmp(n.contents);if(l)return l}}return null}getAllControlsInLayout(e,n){if(e)for(const i of e)i.type===T.DgControl.fieldset.type&&n.push(i),i.contents?this.getAllControlsInLayout(i.contents,n):n.push(i)}}const xn=t.defineComponent({name:"FSplitterFormComponent",props:wn,emits:["cancel","submit"],setup(o,e){const n=t.ref(""),i=t.ref(),l=t.ref(o.data),a=t.ref([{field:"name",title:"名称"},{field:"bindingPath",title:"绑定字段"}]),{schemaService:r,formSchemaUtils:u}=o.designerHostService,s=new Ht.FNotifyService;s.globalConfig={position:"top-center"};const c={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},g={cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}};t.onBeforeMount(()=>{const k=u.getViewModelIdByComponentId(o.componentId),{name:M}=r.getTableInfoByViewModelId(k);n.value=M;const j=new Cn(o.designerHostService,o.componentId);l.value=j.buildFieldTreeData()});function v(){e.emit("cancel")}function x(){if(!n.value){s.warning({message:"请填写组件标题"});return}const k=i.value.getSelectedItems();if(!k.length){s.warning("请选择字段");return}e.emit("submit",{selections:k,componentTitle:n.value})}function w(k,M){const j=M.raw;return t.createVNode(t.Fragment,null,[j.isRemoved?t.createVNode("span",{title:"绑定字段不存在,请在视图模型中手动移除。"},[t.createTextVNode("绑定字段不存在。 ")]):"",j.isBindVariable?t.createVNode("span",null,[t.createTextVNode("变量:"),j.code,t.createTextVNode(" ")]):"",j.isNoBinding?t.createVNode("span",null,[t.createTextVNode("控件没有绑定信息 ")]):"",!j.isRemoved&&!j.isBindVariable&&!j.isComplexField?t.createVNode("span",null,[j.bindingField,t.createTextVNode(" ")]):""])}function C(k){var j;const M=(j=k.raw)==null?void 0:j.control;return t.createVNode(t.Fragment,null,[t.createVNode("span",null,[M.label||M.title||M.id,t.createTextVNode(" ")])])}return()=>t.createVNode("div",{class:"h-100 d-flex flex-column flex-fill"},[t.createVNode("div",{class:"f-section pt-3 pl-4"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode(" 组件信息 ")])])]),t.createVNode("div",{class:"f-section-content"},[t.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[t.createVNode("div",{class:"col-12 farris-group-wrap"},[t.createVNode("div",{class:"form-group farris-form-group"},[t.createVNode("label",{class:"col-form-label",style:"justify-content: start !important; width: 80px !important;"},[t.createVNode("span",{class:"farris-label-info text-danger"},[t.createTextVNode("*")]),t.createVNode("span",{class:"farris-label-text"},[t.createTextVNode(" 组件标题")])]),t.createVNode("div",{class:"farris-input-wrap"},[t.withDirectives(t.createVNode("input",{class:"form-control",type:"input","onUpdate:modelValue":k=>n.value=k},null),[[t.vModelText,n.value]])])])])])])]),t.createVNode("div",{class:"f-section pl-4 f-utils-fill"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode(" 组件字段 ")])])]),t.createVNode("div",{class:"f-section-content border f-utils-fill"},[t.createVNode(Gt,{key:1,ref:i,fit:!0,data:l.value,idField:"id",columns:a.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},selection:c,hierarchy:g},{cellTemplate:({cell:k,row:M})=>k.field==="bindingPath"?w(k,M):C(M)})])]),t.createVNode("div",{class:"modal-footer"},[t.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:v},[t.createTextVNode("取消")]),t.createVNode("button",{type:"button",class:"btn btn-primary",onClick:x},[t.createTextVNode("确定")])])])}});function Ot(){function o(){const n=i=>{const l=Math.random()*16|0;return(i==="x"?l:l&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n)}function e(n,i){const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];let r;if(i=i||l.length,n)for(r=0;r<n;r++)a[r]=l[0|Math.random()*i];else{let u;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",r=0;r<36;r++)a[r]||(u=0|Math.random()*16,a[r]=l[r===19?u&3|8:u])}return a.join("")}return{guid:o,uuid:e}}const In=["moz","ms","webkit"];function Tn(){let o=0;return e=>{const n=new Date().getTime(),i=Math.max(0,16-(n-o)),l=setTimeout(()=>{e(n+i)},i);return o=n+i,l}}function Fn(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const o=In.filter(e=>`${e}RequestAnimationFrame`in window)[0];return o?window[`${o}RequestAnimationFrame`]:Tn()}Fn();function Sn(o,e){let n;const i=t.ref(""),l=t.ref([]),a=t.ref([]),r=t.ref([]),u=o.componentInstance.value.belongedComponentId;function s(f){f.forEach(y=>{y.isGroupNode||(y.isNoBinding||a.value.push(y.data.id),l.value.push(y.control))})}function c(f){var E;const y=o.componentInstance.value.schema;let p={};y.contents&&y.contents.length>0&&(p=y.contents.find(P=>P.type===T.DgControl.section.type)||{});const d=Object.assign({},p,{id:f+"-section",mainTitle:i.value,appearance:p.appearance?ye.cloneDeep(p.appearance):{class:"f-section-form f-section-in-mainsubcard"},contents:[]}),N=((E=p.contents)==null?void 0:E.find(P=>P.type===T.DgControl["response-form"].type))||{},O=$e.getSchemaByType(T.DgControl["response-form"].type);return Object.assign(O,N,{id:f+"-form",appearance:N.appearance?ye.cloneDeep(N.appearance):{class:"f-form-layout farris-form farris-form-controls-inline"},contents:l.value}),d.contents=[O],[d]}function g(f){var p;if(!((p=f.states)!=null&&p.length))return[];const y=[];return f.states.forEach(d=>{l.value.forEach(N=>{function O(E){Object.keys(E).forEach(P=>{const _=E[P];if(_&&_.type==="Variable"&&_.field===d.id){let K=y.find(D=>D.id===d.id);K||(K=Object.assign({},d,{newId:Ot().guid()}),y.push(K),r.value.push(d.id)),E[P].field=K.newId}})}O(N),N.editor&&O(N.editor)})}),y.map(d=>{d.id=d.newId,delete d.newId}),y}function v(f,y){const p=[];a.value.forEach(N=>{const O=y.fields.find(E=>E.id===N);p.push(Object.assign({},O,{groupId:null,groupName:null}))});const d=g(y);return{id:f+"-viewmodel",code:f+"-viewmodel",name:i.value,bindTo:y.bindTo,parent:y.parent,fields:p,commands:[],states:d,enableValidation:y.enableValidation}}function x(f,y,p){var E;if(!((E=o==null?void 0:o.parent)!=null&&E.parent)||!e)return;const N=o.parent.parent.componentInstance.value.schema;if(!(N!=null&&N.contents))return;const O=N.contents.findIndex(P=>P.component===u);if(O>-1){const{formSchemaUtils:P}=e;P.getComponents().push(f),P.getViewModels().push(p),N.contents.splice(O+1,0,y)}}function w(){if(!e)return;const f=o.componentInstance.value.schema,{schemaService:y,formSchemaUtils:p}=e,d=p.getViewModelIdByComponentId(u),N=p.getViewModelById(d),{code:O}=y.getTableInfoByViewModelId(d),E=O+"-"+Math.random().toString(36).slice(2,6),P=$e.getSchemaByType("component-ref");Object.assign(P,{id:E+"-component-ref",component:E+"-component"});const _=v(E,N),K=$e.getSchemaByType("component"),D=c(E);return Object.assign(K,{id:E+"-component",viewModel:E+"-viewmodel",componentType:f.componentType,appearance:f.appearance?ye.cloneDeep(f.appearance):null,formColumns:f.formColumns,contents:D}),x(K,P,_),_}function C(){if(!e)return;const{formSchemaUtils:f}=e,y=o.componentInstance.value.schema,p=l.value.map(N=>N.id),d=f.selectNode(y,N=>N.type===T.DgControl["response-form"].type);d.contents.forEach(N=>{N.type===T.DgControl.fieldset.type&&(N.contents=N.contents.filter(O=>!p.includes(O.id)))}),d.contents=d.contents.filter(N=>!(p.includes(N.id)||N.type===T.DgControl.fieldset.type&&N.contents&&N.contents.length===0))}function k(){if(!e)return;const{formSchemaUtils:f}=e,y=f.getViewModelIdByComponentId(u),p=f.getViewModelById(y);p&&p.fields&&(p.fields=p.fields.filter(d=>!a.value.includes(d.id)))}function M(f){if(!e)return;const{formSchemaUtils:y}=e,p=Ot().guid(),d=Object.assign({},f,{id:p,code:f.code+p.slice(0,4),name:f.name+p.slice(0,4)}),O=y.getCommands().find(E=>E.id===f.cmpId);return O&&O.refedHandlers.push({host:p,handler:f.handlerName}),d}function j(f){if(!e)return;const{formSchemaUtils:y}=e,p=y.getViewModelIdByComponentId(u),d=y.getViewModelById(p),N={};l.value.forEach(E=>{var K;const P=E.type==="form-group"&&E.editor?E.editor.type:E.type,_=(K=$e.schemaMap[P])==null?void 0:K.events;_&&Object.keys(E).forEach(D=>{const q=Object.keys(_).find(W=>W===D);if(q&&E[q]){const W=d.commands.find(z=>z.code===E[q]);if(W){let z=N[W.code];z||(z=M(W),N[W.code]=z,f.commands.push(z)),E[q]=z.code}}})});const O=["valueChanging","valueChanged"];f.fields.forEach(E=>{O.forEach(P=>{if(E[P]){const _=d.commands.find(K=>K.code===E[P]);if(N[_.code])E[P]=N[_.code].code;else{const K=M(_);N[_.code]=K,f.commands.push(K),E[P]=K.code}}})})}function S(f,y,p){if(f&&(y(f,p),f.contents))for(const d of f.contents)S(d,y,p)}function B(){if(!r.value.length)return;const f=e==null?void 0:e.formSchemaUtils,y=f.getComponentById(u),p=[],d=(E,P)=>{E&&(Object.keys(E).forEach(_=>{const K=E[_];K&&typeof K=="object"&&K.type===_t.FormBindingType.Variable&&r.value.includes(K.field)&&!P.includes(K.field)&&P.push(K.field)}),E.editor&&d(E.editor,P))};S(y,d,p);const N=f.getViewModelIdByComponentId(u),O=f.getViewModelById(N);r.value.forEach(E=>{p.includes(E)||(O.states=O.states.filter(P=>P.id!==E))})}function I(f){var d,N;const{selections:y}=f;i.value=f.componentTitle,s(y);const p=w();C(),k(),j(p),B(),(d=n==null?void 0:n.modalRef)!=null&&d.value.close&&((N=n==null?void 0:n.modalRef)==null||N.value.close()),T.canvasChanged.value++,t.nextTick(()=>{T.refreshCanvas()})}function m(){var f,y;(f=n==null?void 0:n.modalRef)!=null&&f.value.close&&((y=n==null?void 0:n.modalRef)==null||y.value.close())}function h(){if(e)return()=>t.createVNode(t.Fragment,null,[t.createVNode(xn,{componentId:o.componentInstance.value.belongedComponentId,designerHostService:e,onSubmit:I,onCancel:m},{default:()=>[t.createTextVNode(" ")]}),t.createTextVNode(" ")])}function F(f){f.stopPropagation(),f.preventDefault(),e&&(n=e.modalService.open({title:"拆分卡片",width:900,height:600,fitContent:!1,showButtons:!1,render:h(),enableEsc:!1,draggable:!0}))}return{openSplitComponentModal:F}}var We=(o=>(o.Frame="frame",o.dataGrid="data-grid",o.listView="list-view",o.form="form",o.uploader="uploader",o.calendar="calendar",o.page="page",o))(We||{});function Pt(o,e){const n=new T.UseTemplateDragAndDropRules,{canMove:i,canDelete:l}=n.getTemplateRule(o,e);function a(){return!1}function r(){return l}function u(){return i}function s(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function g(S){const B=new Xt(S,e),{schema:I}=o;return B.getPropertyConfig(I)}function v(){var h,F,f,y;const S=o==null?void 0:o.schema,I=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(S.id);if(S.componentType!=="data-grid"&&S.componentType!=="form"||!((h=o.componentInstance)!=null&&h.value.parent))return;const m=(F=o.componentInstance)==null?void 0:F.value.parent.schema;if((f=m==null?void 0:m.toolbar)!=null&&f.buttons&&m.toolbar.buttons.length){m.toolbar.buttons.forEach(d=>{const N=d.onClick,O=N&&N.split(".");if(!O||O.length<3)return;O[O.length-2]===I&&(d.needRemove=!0)}),m.toolbar.buttons=m.toolbar.buttons.filter(d=>!d.needRemove);const p=(y=o.componentInstance)==null?void 0:y.value.parent;p.parent&&p.parent.updateToolbarItems&&p.parent.updateToolbarItems()}}function x(){const S=e==null?void 0:e.designViewModelUtils,B=e==null?void 0:e.formSchemaUtils,I=o==null?void 0:o.schema;if(S&&B){const m=B.getViewModelIdByComponentId(I.id);S.deleteViewModelById(m),B.deleteComponent(I.id)}}function w(){const S=e==null?void 0:e.designViewModelUtils,B=e==null?void 0:e.formSchemaUtils,I=o==null?void 0:o.schema,m=B.getViewModelIdByComponentId(I.id),h=S.getDgViewModel(m);h!=null&&h.fields&&h.fields.forEach(F=>{const f=B.getExpressions();if(f!=null&&f.length){const y=f.findIndex(p=>p.target===F.id);y>-1&&B.getExpressions().splice(y,1)}})}function C(){v(),w(),x()}function k(){const{schema:S}=o,B=[];return S.componentType==="form"&&B.push({id:"splitFormComponent",title:"拆分卡片",icon:"f-icon fd-i-Family fd_pc-split-card",onClick:I=>{Sn(o,e).openSplitComponentModal(I)}},{id:"addSiblingComponent",title:"添加同级卡片",icon:"f-icon f-icon-plus",onClick:I=>{bn(o,e).addSiblingComponent(I)}}),B}function M(){if(!e||!(o!=null&&o.schema))return"组件";switch(o.schema.componentType){case We.Frame:return"根组件";case We.dataGrid:{const{formSchemaUtils:S}=e;return`${S.selectNode(o.schema,m=>m.type===st["tree-grid"].type)?"树表格":"表格"}组件`}case We.uploader:return"附件组件";case We.listView:return"列表视图组件";case We.calendar:return"日历组件";default:return"组件"}}function j(){var S,B,I;if(o&&e){const{formSchemaUtils:m}=e;let h="",F="";const f=m.getRootViewModelId(),y=m.getComponentByViewModelId(f),p=m.selectNode(y,N=>N.contents&&N.contents.find(O=>O.component===o.schema.id));(p==null?void 0:p.type)===((S=st["tab-page"])==null?void 0:S.type)&&((B=p==null?void 0:p.contents)!=null&&B.length)&&(h=p.title||""),(p==null?void 0:p.type)===((I=st.section)==null?void 0:I.type)&&(p==null?void 0:p.showHeader)!==!1&&(h=p.mainTitle||""),h=h?`${h} > `:"",F=h?p.id:"";const d=M();m.getControlBasicInfoMap().set(o.schema.id,{componentTitle:d,parentPathName:`${h}${d}`,reliedComponentId:F})}}return{canAccepts:a,checkCanDeleteComponent:r,checkCanMoveComponent:u,hideNestedPaddingInDesginerView:s,getStyles:c,getPropsConfig:g,onRemoveComponent:C,getCustomButtons:k,setComponentBasicInfoMap:j}}const Vn=t.defineComponent({name:"FComponetDesign",props:Ge.componentProps,emits:["init","afterViewInit"],setup(o,e){const n=t.ref(),i=t.inject("designer-host-service"),l=t.inject("design-item-context"),a=Pt(l,i),r=T.useDesignerComponent(n,l,a),u=t.computed(()=>{const s={"drag-container":!0};return Ee.getCustomClass(s,o==null?void 0:o.customClass)});return t.onMounted(()=>{var s,c,g,v;n.value.componentInstance=r,((c=(s=l.parent)==null?void 0:s.schema)==null?void 0:c.type)==="component-ref"&&(r.value.parent=(v=(g=l.parent)==null?void 0:g.parent)==null?void 0:v.componentInstance)}),e.expose(r.value),()=>t.createVNode("div",{ref:n,class:u.value,style:o.customStyle,"data-dragref":`${l.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),Nn={install(o){o.component(ft.name,ft)}};Z.Component=ft,Z.ComponentDesign=Vn,Z.componentProps=Et,Z.default=Nn,Z.useDesignerRules=Pt,Object.defineProperties(Z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(Z,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("../component/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("lodash-es"),require("../locale/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../step/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../../designer/binding-selector/index.umd.js"),require("../notify/index.umd.js"),require("../../designer/accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../../designer/button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../../designer/color-picker/index.umd.js"),require("../../designer/combo-list/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/dropdown/index.umd.js"),require("../external-container/index.umd.js"),require("../filter-bar/index.umd.js"),require("../../designer/image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../../designer/layout/index.umd.js"),require("../../designer/list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../language-textbox/index.umd.js"),require("../nav/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../../designer/number-range/index.umd.js"),require("../../designer/order/index.umd.js"),require("../page-header/index.umd.js"),require("../../designer/page-footer/index.umd.js"),require("../../designer/pagination/index.umd.js"),require("../../designer/progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../../designer/search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../../designer/smoke-detector/index.umd.js"),require("../../designer/splitter/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../../designer/text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../../designer/transfer/index.umd.js"),require("../../designer/tree-view/index.umd.js"),require("../../designer/uploader/index.umd.js"),require("../../designer/verify-detail/index.umd.js"),require("../../designer/component/index.umd.js"),require("../../designer/video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../fieldset/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../html-template/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../property-panel/index.umd.js"),require("../tree-grid/index.umd.js"),require("bignumber.js"),require("../tree-view/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../component/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","lodash-es","../locale/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../step/index.umd.js","../../designer/dynamic-form/index.umd.js","../../designer/binding-selector/index.umd.js","../notify/index.umd.js","../../designer/accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/button-edit/index.umd.js","../../designer/button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../../designer/color-picker/index.umd.js","../../designer/combo-list/index.umd.js","../content-container/index.umd.js","../../designer/data-grid/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/dropdown/index.umd.js","../external-container/index.umd.js","../filter-bar/index.umd.js","../../designer/image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../../designer/layout/index.umd.js","../../designer/list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../language-textbox/index.umd.js","../nav/index.umd.js","../../designer/number-spinner/index.umd.js","../../designer/number-range/index.umd.js","../../designer/order/index.umd.js","../page-header/index.umd.js","../../designer/page-footer/index.umd.js","../../designer/pagination/index.umd.js","../../designer/progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../../designer/search-box/index.umd.js","../../designer/section/index.umd.js","../../designer/smoke-detector/index.umd.js","../../designer/splitter/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../../designer/text/index.umd.js","../../designer/time-picker/index.umd.js","../../designer/transfer/index.umd.js","../../designer/tree-view/index.umd.js","../../designer/uploader/index.umd.js","../../designer/verify-detail/index.umd.js","../../designer/component/index.umd.js","../../designer/video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../fieldset/index.umd.js","../../designer/drawer/index.umd.js","../html-template/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../property-panel/index.umd.js","../tree-grid/index.umd.js","bignumber.js","../tree-view/index.umd.js"],t):(Z=typeof globalThis<"u"?globalThis:Z||self,t(Z.component={},Z.Vue,Z.component,Z.designerCanvas,Z.common,Z.LodashES,Z.locale,Z.VueUseCore,Z.dataView,Z.dynamicResolver,Z.FStep$1,Z.FDynamicForm,null,Z.notify,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,Z.propertyPanel,Z.FTreeGrid$1))})(this,function(Z,t,Ge,T,Ee,ye,Oe,zt,Q,$e,At,Nt,zn,Ht,An,Hn,_n,Gn,$n,Wn,Yn,Xn,Kn,Qn,Jn,Zn,eo,to,no,oo,io,lo,ro,ao,so,co,uo,fo,mo,po,ho,go,yo,vo,bo,wo,Co,xo,Io,To,Fo,So,Vo,No,Eo,Mo,ko,Bo,jo,Do,Ro,Oo,Po,qo,Lo,Uo,zo,Ao,Ho,_o,Go,$o,Wo,_t,Gt){"use strict";var Ln=Object.defineProperty;var Un=(Z,t,Ge)=>t in Z?Ln(Z,t,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):Z[t]=Ge;var te=(Z,t,Ge)=>Un(Z,typeof t!="symbol"?t+"":t,Ge);const Et={id:{type:String},customClass:{type:String,default:""},customStyle:{type:String,default:""},componentType:{type:String,default:""},formColumns:{type:Number,default:4},code:{type:String,default:""}},ft=t.defineComponent({name:"FComponent",props:Et,emits:["init","afterViewInit"],setup(o,e){const n=t.ref();return t.onBeforeMount(()=>{e.emit("init",o.id)}),t.onMounted(()=>{n.value&&o.code&&n.value.setAttribute("scope-"+o.code.toLowerCase(),""),e.emit("afterViewInit",o.id)}),()=>t.createVNode("div",{ref:n,class:o.id+" "+o.customClass,style:o.customStyle},[e.slots.default&&e.slots.default()])}});function $t(o){const{formSchemaUtils:e,formStateMachineUtils:n}=o;function i(s,c=""){return{path:c+s.code,field:s.id,fullPath:s.code}}function l(s,c=""){const g=e.getViewModelById(s);return g?g.states.map(v=>i(v,c)):[]}function a(s){const c=e.getRootViewModelId(),g=l(s);if(s===c)return g;const v=l(c,"root-component.");return[...g,...v]}function r(s){return s.binding&&s.binding.path||s.id||""}function u(){return n&&n.getRenderStates()||[]}return{getVariables:a,getControlName:r,getStateMachines:u}}class Wt{constructor(e){te(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);te(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});te(this,"getExpressionConverter",(e,n)=>({convertFrom:(i,l,a,r)=>{const u=a.getExpressionRuleValue(e,n||l);return u&&u.value||""},convertTo:(i,l,a,r,u)=>{var s;if(l==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((s=a.rules)==null?void 0:s.some(v=>v.id===c&&v.value))?i.dictPickingExpressionId=c:delete i.dictPickingExpressionId}r.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,n){const i=this.formSchemaService.getExpressions();if(!i)return"";const l=i.find(r=>r.target===e);if(!l)return"";const a=l.rules.find(r=>r.type===n);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const n=this.formSchemaService.getRootViewModelId(),i=this.formSchemaService.getViewModelById(n);if(!i||!i.states||i.states.length===0)return[];const l=[];return i.states.filter(a=>a.category==="remote").forEach(a=>{l.push({key:a.code,name:a.name,description:a.name,category:a.category})}),l}createTreeNode(e,n,i="label"){return{id:e.id,name:e.name,bindingPath:e[i],parents:n,type:"field"}}buildEntityFieldsTreeData(e=null,n){const i=[];return e==null||e.forEach(l=>{var u;const a=this.createTreeNode(l,n);let r=[];(u=l.type)!=null&&u.fields&&(r=this.buildEntityFieldsTreeData(l.type.fields,[...n,l.label])),i.push({data:a,children:r,expanded:!0})}),i}buildChildEntityTreeData(e=null,n){const i=[];return e==null||e.forEach(l=>{var s,c;const a=this.createTreeNode(l,n);a.type="entity";const r=this.buildEntityFieldsTreeData((s=l.type)==null?void 0:s.fields,[...n,l.label]),u=this.buildChildEntityTreeData((c=l.type)==null?void 0:c.entities,[...n,l.label]);u!=null&&u.length&&(r==null||r.push(...u)),i.push({data:a,children:r||[],expanded:!0})}),i}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const n=e[0];if(!(n!=null&&n.type))return[];const i=this.buildEntityFieldsTreeData(n.type.fields,[n.code]),l=this.buildChildEntityTreeData(n.type.entities,[n.code]);return l!=null&&l.length&&(i==null||i.push(...l)),{entityCode:n.code,fields:[{data:this.createTreeNode(n,[],"code"),children:i||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,n,i){const l=i==="Field"?e.binding.field:e.id,a=this.getExpressionRule(l,n),r=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(n)&&a?a.message:"",...r};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(e,n,i,l){const{expression:a,message:r,messageType:u}=n,s={id:`${e}_${i}`,type:i,value:a};return(i==="validate"||i==="dataPicking"||i==="required")&&(s.message=r),i==="dataPicking"&&(s.messageType=u),i==="validate"&&l&&(s.elementId=l),s}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,i,l){const a=n==="Field"?e.binding.field:e.id,r=this.buildRule(a,i,l,e.type==="form-group"?e.id:"");let s=this.getExpressionData().find(g=>g.targetType===n&&g.target===a);const c=g=>g.value.trim()==="";if(s){const g=s.rules.find(v=>v.id===r.id);if(g)c(r)?s.rules=s.rules.filter(v=>v.id!==r.id):(Object.assign(g,r),l==="validate"&&e.type==="form-group"&&(g.elementId=e.id));else{if(c(r))return null;s.rules=s.rules||[],s.rules.push(r)}}else{if(c(r))return null;s={target:`${a}`,rules:[r],targetType:n}}return s}getExpressionEditorOptions(e,n,i,l){return i.reduce((a,r)=>{var s,c;const u=n==="Field"?(s=e==null?void 0:e.binding)==null?void 0:s.field:e.id;return a[r]={hide:n==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[r],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[r]}编辑器`,showMessage:r==="validate"||r==="dataPicking"||r==="required",showMessageType:r==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,r,n),onSubmitModal:g=>{const v=this.updateExpression(e,n,g,r);if(l){const x=this.buildRule(u,g,r);l(x)}return v}}},a},{})}getExpressionInfo(e,n,i){const l=n==="Field"?e.binding.field:e.id,a=this.getExpressionRule(l,i),r={value:a&&a.value,targetId:l,targetType:n,expressionType:i};return a&&a.message&&(r.message=a.message),r}getExpressionConfig(e,n,i=["compute","dependency","validate"],l){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,n,i,l)}}}getExpressionOptions(e,n,i){const l=this.getExpressionInfo(e,n,i);return{dialogTitle:`${this.expressionNames[i]}编辑器`,singleExpand:!1,showMessage:i==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,i,n),expressionInfo:l}}}class Yt{constructor(e,n){te(this,"componentId");te(this,"viewModelId");te(this,"eventsEditorUtils");te(this,"formSchemaUtils");te(this,"formMetadataConverter");te(this,"designViewModelUtils");te(this,"designViewModelField");te(this,"controlCreatorUtils");te(this,"designerHostService");te(this,"designerContext");te(this,"schemaService",null);te(this,"metadataService",null);te(this,"propertyConfig",{type:"object",categories:{}});var i;this.componentId=e,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((i=this.formSchemaUtils)==null?void 0:i.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService,this.designerContext=n.designerContext}getFormDesignerInstance(){var e,n;return(n=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:n.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var i;const n=e.binding&&e.binding.type==="Form"&&e.binding.field;if(n){if(!this.designViewModelField){const l=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=l.fields.find(a=>a.id===n)}e.updateOn=(i=this.designViewModelField)==null?void 0:i.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:T.DgControl[e.type]&&T.DgControl[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},i){const l={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const r in n)a[r]=Object.assign(a[r]||{},n[r]);return{...l,properties:{...a},setPropertyRelates(r,u){if(r){switch(r&&r.propertyID){case"class":case"style":{T.canvasChanged.value++;break}}i&&i(r,e,u)}}}}getPropertyEditorParams(e,n=[],i="visible",l={},a={},r=""){const{getVariables:u,getControlName:s,getStateMachines:c}=$t(this.designerHostService),g=this.getRealTargetType(e),v=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],x={type:"property-editor",propertyTypes:v};return v.map(w=>{switch(w){case"Const":Object.assign(x,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},l);break;case"Expression":x.expressionConfig=this.getExpressionOptions(e,g,r||i);break;case"StateMachine":x.stateMachines=c();break;case"Variable":Object.assign(x,{controlName:s(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:C=>{C.value=u(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(x.newVariablePrefix="ext_"+x.newVariablePrefix);break}}),x}getVisibleProperty(e,n=""){var a;let i=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?i=["Const","Expression"]:n==="form-group"&&!((a=e.binding)!=null&&a.field)&&(i=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,i,"visible")}}}getBehaviorConfig(e,n="",i={},l){const a={title:"行为",description:""},r=this.getVisibleProperty(e,n);for(const s in i)r[s]=Object.assign(r[s]||{},i[s]);const u=this;return{...a,properties:{...r},setPropertyRelates(s,c){if(s){switch(s.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,s);break}l&&l(s,c)}}}}afterMutilEditorChanged(e,n){this.addNewVariableToViewModel(n,this.viewModelId),this.updateExpressionValue(n),this.clearExpression(n,e)}updateElementByParentContainer(e,n){const i=n&&n.parent&&n.parent.schema;if(!i)return;const l=i.contents.findIndex(r=>r.id===e),a=ye.cloneDeep(i.contents[l]);i.contents.splice(l,1),i.contents.splice(l,0,a),T.refreshCanvas()}addNewVariableToViewModel(e,n){const i=e.propertyValue;if(!(i&&typeof i=="object")||!(i.type==="Variable"&&i.isNewVariable))return;const r={id:i.field,category:"locale",code:i.fullPath,name:i.fullPath,type:i.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete i.newVariableType,delete i.isNewVariable,this.formSchemaUtils.getVariableByCode(r.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(r)}updateExpressionValue(e){const n=e.propertyValue;if(!((n&&n.type)==="Expression"&&n.expressionInfo))return;const{expressionId:a,expressionInfo:r}=n,{targetId:u,targetType:s,expressionType:c,value:g,message:v}=r,x=this.formSchemaUtils.getModule();x.expressions=x.expressions||[];const{expressions:w}=x;let C=w.find(M=>M.target===u);C||(C={target:u,rules:[],targetType:s},w.push(C));const k=C.rules.find(M=>M.type===c);if(k)k.value=g,k.message=v;else{const M={id:a,type:c,value:g,message:v};C.rules.push(M)}delete n.expressionInfo}clearExpression(e,n){const i=e.propertyValue;if(i&&i.type==="Expression")return;const a=e.propertyID,r=this.formSchemaUtils.getExpressions(),u=n.binding?n.binding.field:n.id,s=r.find(c=>c.target===u);!s||!s.rules||(s.rules=s.rules.filter(c=>c.type!==a))}getExpressionOptions(e,n,i){return new Wt(this.formSchemaUtils).getExpressionOptions(e,n,i)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const n={};return n[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:i=>{var l;((l=i.controller)==null?void 0:l.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(i)}}},n}}class Xt extends Yt{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearancePropConfig(e),this.getBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearancePropConfig(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId);e.name=n?n.name:null;const i=this;return this.getAppearanceConfig(e,{name:{title:"组件名称",type:"string",description:"组件名称",defaultValue:e.name}},(a,r,u)=>{switch(a.propertyID){case"name":i.syncChangesToViewModel({name:a.propertyValue}),delete r.name;break}})}getEventPropConfig(e){const n=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}];this.designerContext&&this.designerContext.responsiveForm&&e.componentType==="frame"&&n.push({label:"goBack",name:"原生返回事件"});const i=this,l=i.eventsEditorUtils.formProperties(e,i.viewModelId,n),a=i.createBaseEventProperty(l);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(r,u){const s=r.propertyValue;delete e[i.viewModelId],s&&(s.setPropertyRelates=this.setPropertyRelates,i.eventsEditorUtils.saveRelatedParameters(e,i.viewModelId,s.events,s))}}}getBehaviorConfig(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId),i=n?n.enableValidation:null,l=this;this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{enableValidation:{title:"启用校验",type:"boolean",description:"运行时组件是否启用校验",defaultValue:i}},setPropertyRelates:a=>{if(a)switch(a.propertyID){case"enableValidation":{l.syncChangesToViewModel({enableValidation:a.propertyValue}),delete e.enableValidation;break}}}}}syncChangesToViewModel(e){const n=this.formSchemaUtils.getViewModelById(this.viewModelId);n&&Object.assign(n,e)}}const Kt={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},Qt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},mt=t.defineComponent({name:"Toast",props:Qt,emits:["close","click"],setup:(o,e)=>{const n=t.ref(o.animate),i="fadeOut",l=t.computed(()=>o.options),a=t.ref(!1),r=t.computed(()=>l.value.title&&l.value.message),u=t.computed(()=>!l.value.title&&l.value.message),s=t.computed(()=>{const S={animated:a.value,toast:!0,"toast--only-content":!r.value};return S[o.animate]=!1,S[i]=a.value,S["toasty-type-"+l.value.type]=!0,l.value.theme&&(S[l.value.theme]=!0),S}),c=t.computed(()=>{const I=`f-icon-${l.value&&l.value.type?l.value.type.replace("toasty-type-",""):"default"}`,m={"f-icon":!0};return m[I]=!0,m}),g=t.computed(()=>l.value.title||l.value.message),v=t.computed(()=>o.showCloseButton),x=t.computed(()=>!!l.value.buttons||!!e.slots.default),w=t.computed(()=>Oe.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function C(S){S.stopPropagation(),S.preventDefault(),a.value=!1,setTimeout(()=>{e.emit("close",l.value)},200)}function k(S,B){}function M(S){return`f-preten-link ${S.customClass?S.customClass:""}`}t.watch(n,()=>{n.value});const j=()=>{var S;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((S=l.value.buttons)==null?void 0:S.map(B=>t.createVNode("span",{class:M(B),onClick:I=>void 0},[B.text]))),e.slots.default&&e.slots.default()])])};return()=>t.createVNode("div",{class:s.value,style:"min-height:44px"},[v.value&&t.createVNode("button",{title:Oe.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:C},[t.createVNode("span",{class:"f-icon modal_close"},null)]),g.value&&t.createVNode("section",{class:"modal-tips"},[!r.value&&t.createVNode("div",{class:"float-left modal-tips-iconwrap"},[t.createVNode("span",{class:c.value},null)]),t.createVNode("div",{class:"modal-tips-content"},[r.value&&t.createVNode(t.Fragment,null,[t.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:l.value.title},null),t.createVNode("p",{class:"toast-msg",innerHTML:l.value.message,style:w.value},null),x.value&&j()]),u.value&&(l.value.buttons?t.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:w.value,innerHTML:l.value.message},null),t.createVNode("div",{class:"after-toast-title text-right ml-auto"},[j()])]):t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:w.value,innerHTML:l.value.message},null))])])])}}),rt=t.defineComponent({name:"Notify",props:Kt,emits:["close","empty"],setup(o,e){const n=t.computed(()=>({"farris-notify":!0})),i={left:12,right:12,top:20,bottom:12},l=t.ref(),a=t.ref(o.options),r=t.ref(o.showCloseButton),u=t.computed(()=>o.position||"bottom-right"),s=t.computed(()=>o.timeout!=null?o.timeout:3e3),c=t.computed(()=>{const x=o.bottom?o.bottom:i.bottom,w=o.top?o.top:i.top,C={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${o.left?o.left:i.left}px`:"",right:u.value.indexOf("right")>-1?`${o.right?o.right:i.right}px`:"",top:u.value.indexOf("top")>-1?`${w}px`:"",bottom:u.value.indexOf("bottom")>-1?`${x}px`:""};return u.value.indexOf("center")>-1&&(C.left="50%",C.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(C.top="50%",C.transform="translate(-50%, -50%)")),C});function g(x){e.emit("close")}s.value&&setTimeout(()=>{g()},s.value),e.expose({closeToast:g,container:l,notifyPosition:u});function v(x,w){g()}return()=>t.createVNode("div",{class:n.value,style:c.value,ref:l},[t.createVNode(mt,{options:a.value,showCloseButton:r.value,animate:o.animate,onClose:x=>v(x,a.value)},null)])}});class pt{constructor(){te(this,"notifyRefs",[]);te(this,"globalConfig",t.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const n=document.createElement("div");return n.textContent=e||"",n.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const n=this,l=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const r=t.createApp({setup(){var c;const u=t.ref();function s(){u.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(l,u),r.unmount()},220)}if(l.position.indexOf("top")>-1){const g=n.getNotifyInstances(l.position),v=g[g.length-1];if(v){const x=v.value.container.getBoundingClientRect();l.top=x.bottom}}return l.safeHtml&&((c=l.options)!=null&&c.message)&&(l.options.message=n.escapeAllHtml(l.options.message)),t.onUnmounted(()=>{document.body.removeChild(a)}),t.onMounted(()=>{n.updateNotifyPositionForCreate(l,u)}),()=>t.createVNode(t.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[t.createVNode(rt,t.mergeProps({ref:u},l,{onClose:s}),null)]})}});return r.provide("NotifyService",this),document.body.appendChild(a),r.use(Oe.LocaleService.i18n),r.mount(a),r}getNotifyInstances(e){return this.notifyRefs.filter(n=>n.value.notifyPosition===e)}updateNotifyPositionForCreate(e,n){if(this.notifyRefs&&this.notifyRefs.length){const i=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(l=>{const a=l.value.container.getBoundingClientRect();l.value.container.style.bottom=a.height+i-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(e,n){const i=this.notifyRefs.indexOf(n);if(e.position.indexOf("top")>-1){const l=this.getNotifyInstances(e.position),a=l.indexOf(n);l.slice(a+1).forEach(r=>{r.value.container.style.top=r.value.container.offsetTop-r.value.container.offsetHeight+"px"})}i>-1&&this.notifyRefs.splice(i,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,n){let i="",l="",a,r,u;typeof n=="string"?i=n:n&&(i=n.message||"",l=n.title||"",r=n.position||null,u=n.showCloseButton!=null?n.showCloseButton:null,a=n.timeout!=null?n.timeout:null);const c={options:{type:e,message:i,title:l}};return r!=null&&(c.position=r),u!=null&&(c.showCloseButton=u),a!=null&&(c.timeout=a),c}info(e){const n=this.buildNotifyProps("info",e);return this.show(n)}success(e){const n=this.buildNotifyProps("success",e);return this.show(n)}warning(e){const n=this.buildNotifyProps("warning",e);return this.show(n)}error(e){const n=this.buildNotifyProps("error",e);return this.show(n)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const Jt=Symbol("NOTIFY_SERVICE_TOKEN");rt.install=o=>{o.component(rt.name,rt),o.component(mt.name,mt);const e=new pt;o.provide(Jt,e),o.provide("FNotifyService",e)};const Zt={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}},en={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}},autoHeight:{type:Boolean,default:!1}};function tn(o,e,n,i,l,a,r,u,s,c,g,v,x,w,C,k,M){const{calculateCellPositionInRow:j}=a,{columnContext:S,hasLeftFixedColumn:B,hasRightFixedColumn:I}=r,{gridDataStyle:m,leftFixedGridDataStyle:h,rightFixedGridDataStyle:F}=w,{renderDataRow:f}=Q.getHierarchyRow(o,e,S,M,u,s,c,g,v,x,w,C,k),y=[f];function p(P,_){const K=j(P);return M.value.filter(D=>D.visible!==!1).map((D,q)=>y[D.type](D,K,_,q))}function d(){return t.createVNode("div",{ref:i,class:"fv-grid-content-left-fixed"},[t.createVNode("div",{class:"fv-grid-data",style:h.value},[p(S.value.leftColumns.filter(P=>P.visible),"left")])])}function N(){return t.createVNode("div",{ref:n,class:"fv-grid-content-primary"},[t.createVNode("div",{class:"fv-grid-data",style:m.value},[p(S.value.primaryColumns.filter(P=>P.visible),"primary")])])}function O(){return t.createVNode("div",{ref:l,class:"fv-grid-content-right-fixed"},[t.createVNode("div",{class:"fv-grid-data",style:F.value},[p(S.value.rightColumns.filter(P=>P.visible),"right")])])}function E(){const P=[];return B.value&&P.push(d()),P.push(N()),I.value&&P.push(O()),P}return{renderDataArea:E}}const ht=t.defineComponent({name:"FTreeGrid",props:en,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(o,e){var qt,Lt;const i=((qt=o.rowOption)==null?void 0:qt.height)||28,l=t.ref(20),a=t.ref(o.columns),r=Q.useIdentify(o),{idField:u}=r,s=t.ref(),c=t.ref(),g=t.ref(),v=t.ref(),x=t.ref(),w=t.ref([]),C=t.ref(!1),k=t.ref(((Lt=o.rowOption)==null?void 0:Lt.wrapContent)||!1),M=Q.useGroupData(o,r),j=Q.useFilter(o,e),S=Q.useHierarchy(o),{collapseField:B}=S,{showLoading:I,renderLoading:m}=Q.useLoading(o,s),h=Q.useDataView(o,new Map,j,S,r),{dataView:F}=h,f=Q.useSelection(o,h,r,w,e),{showSelection:y,selectedValues:p}=f,d=Q.useSelectHierarchyItem(o,w,h,r,f,e),N=t.computed(()=>o.disabled),O=t.computed(()=>o.virtualized?Math.min(h.dataView.value.length,l.value):h.dataView.value.length),E=Q.usePagination(o,h),{shouldRenderPagination:P}=E,{containerStyleObject:_}=Q.useDataViewContainerStyle(o),K=Q.useCommandColumn(o),{applyCommands:D}=K;D(a);const{applyColumnSetting:q,removeColumnSetting:W}=Q.useSettingColumn(o);o.showSetting&&q(a);const z=Q.useColumn(o,e),$=Q.useSort(o),{applyColumnSorter:ie,columnContext:le,updateColumnRenderContext:Y}=z;ie(h,$);const xe=Q.useGroupColumn(o,le),me=Q.useRow(o,e,f,r),ne=Q.useEdit(o,e,r,me,w),A=Q.useVisualDataBound(o),oe=Q.useVisualDataCell(o,ne,A),Le=Q.useVisualDataRow(o,h,ne,S,r,A,oe),ke=Q.useVisualData(o,a,h,O,0,Le),{getVisualData:Te}=ke,Xe=Q.useCellPosition(o,le),Ue=Q.useSidebar(o,f),{sidebarWidth:Ke}=Ue,ce=Q.useVirtualScroll(o,h,w,le,ke,O,0,Ke),{onWheel:et,dataGridWidth:Be,viewPortHeight:je,viewPortWidth:Fe,resetScroll:De,updateVisibleRowsOnLatestVisibleScope:tt}=ce,ze=Q.useFitColumn(o,le,c,Fe,xe),{calculateColumnsSize:Se}=ze,Re=Q.useFilterHistory(),Qe=Q.useColumnFilter(c,x,h,Re,ce),Je=Q.useDragColumn(o,e,z,h,xe,M,ce),V=t.computed(()=>{const U={"fv-grid":!0,"fv-grid-bordered":o.showBorder,"fv-grid-horizontal-bordered":o.showHorizontalLines,"fv-datagrid-strip":o.showStripe};return Ee.getCustomClass(U,o.customClass)}),X=t.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":C.value,"fv-grid-wrap-content":k.value})),{renderDataArea:re}=tn(o,e,g,v,x,Xe,z,h,ne,S,me,f,d,ce,ke,A,w),{renderGridHeader:ae,renderGridColumnResizeOverlay:pe,shouldShowHeader:gt}=Q.getColumnHeader(o,e,c,v,x,z,h,Je,Qe,j,Re,ze,xe,f,Ue,$,ce,Fe,w),{renderDataGridSidebar:yt}=Q.getSidebar(o,me,f,Ue,ce),{renderDisableMask:vt}=Q.getDisableMask(),{renderHorizontalScrollbar:bt}=Q.getHorizontalScrollbar(o,c,ce),{renderVerticalScrollbar:wt}=Q.getVerticalScrollbar(o,c,ce);function Ct(){var U,G,de;if(c.value&&c.value.clientHeight>0&&((U=c.value)==null?void 0:U.clientWidth)>0){const ge=Math.ceil(c.value.clientHeight/i);ge>l.value&&(l.value=ge,tt()),je.value=((G=g.value)==null?void 0:G.clientHeight)||0,Be.value=((de=c.value)==null?void 0:de.clientWidth)||0}c.value&&(c.value.clientHeight>0||c.value.clientWidth>0)&&Se()}t.onMounted(()=>{c.value&&(l.value=Math.max(Math.ceil(c.value.clientHeight/i),l.value),w.value=Te(0,O.value+0-1),zt.useResizeObserver(c.value,Ct),Se(),t.nextTick(()=>{c.value&&(Be.value=c.value.clientWidth),g.value&&(Fe.value=g.value.clientWidth,je.value=g.value.clientHeight)})),I.value&&m()}),t.onUnmounted(()=>{}),t.watch(Fe,()=>{c.value&&Se()});function xt(U){h.collapseTo(U),h.reOrderVisibleIndex(),De()}function ut(U){h.expandTo(U),h.reOrderVisibleIndex(),De()}function nt(){const U=f.getSelectionRow();return U?U.dataIndex-1:-1}function It(){const U=nt();h.insertNewDataItem(U),w.value=Te(0,O.value+0-1)}function Tt(){const U=nt();h.insertNewChildDataItem(U),w.value=Te(0,O.value+0-1)}function Ft(U,G){const de=w.value.find(Ce=>Ce.raw[u.value]===G),ge=de?de.dataIndex-1:-1;h.insertNewChildDataItems(U,ge)}function St(){const U=nt(),G=d.getNextSelectableHierarchyItemId(U);h.removeHierarchyDataItem(U),w.value=Te(0,O.value+0-1),G&&d.selectItemById(G)}function dt(U){ne.onEditingRow(U)}function Vt(U){ne.acceptEditingRow(U)}function b(U){ne.cancelEditingRow(U)}function R(U){U&&(a.value=U,D(a),Y(a.value),ie(h,$),Se())}t.watch(()=>o.columns,U=>{R(U)});function L(U,G){U&&(h.load(U),h.reOrderVisibleIndex(),G!=null&&G.keepScrollPosition?ce.scrollTo(ce.offsetY.value):De())}function H(U){me.activeRowById(U)}function J(U,G={isCurrent:!0}){G!=null&&G.isCurrent&&H(U),d.selectItemById(U)}function ee(U){const G=w.value.find(de=>de.raw[r.idField.value]===U);G&&me.clickRowItem(G)}function Ie(U){d.selectItemByIds(U)}function ve(){return f.getSelectedItems()}function be(){f.clearSelection()}function Ve(){f.emptyCurrentRowId()}const ue=t.computed(()=>!w.value||!w.value.length),{renderEmpty:Ne}=Q.getEmpty(o,e);function we(){return f.getSelectionRow()}function he(U,G={clearCurrent:!0}){G!=null&&G.clearCurrent&&H(""),d.unSelectItemByIds(U)}function ot(){return f.currentSelectedDataId.value}function it(U,G,de){const ge=F.value.find(Ce=>Ce[u.value]===U);if(ge){if(Object.keys(ge).forEach(fe=>{Object.prototype.hasOwnProperty.call(G,fe)&&(ge[fe]=G[fe])}),de){const{collapseField:fe,disabledField:Ae,checkedField:He,visibleField:_e}=de;fe&&!ye.isUndefined(G[fe])&&(ge.__fv_collapse__=G[fe]),He&&!ye.isUndefined(G[He])&&(ge.__fv_checked__=G[He]),Ae&&!ye.isUndefined(G[Ae])&&(ge.__fv_disabled__=G[Ae]),_e&&!ye.isUndefined(G[_e])&&(ge.__fv_visible__=G[_e])}const Ce=w.value.find(fe=>fe.raw[u.value]===U),Ut=w.value.findIndex(fe=>fe.raw[u.value]===U);if(Ce){if(Ce.raw=ge,Object.keys(Ce.data).forEach(fe=>{Ce.data[fe].updateData(ge)}),de){const{collapseField:fe,disabledField:Ae,checkedField:He,visibleField:_e}=de;fe&&!ye.isUndefined(G[fe])&&(Ce.collapse=G[fe]),He&&!ye.isUndefined(G[He])&&(Ce.checked=G[He]),Ae&&!ye.isUndefined(G[Ae])&&(Ce.disabled=G[Ae]),_e&&!ye.isUndefined(G[_e])&&(Ce.visible=G[_e])}w.value=[...w.value.slice(0,Ut),Ce,...w.value.slice(Ut+1)],h.updateSummary()}}}function lt(U){return Object.prototype.hasOwnProperty.call(U,"raw")?h.hasRealChildren(U.raw):h.hasRealChildren(U)}function En(U){const G=h.dataView.value.find(de=>de[u.value]===U);return G?G[B.value]:""}function Mn(){return B.value}t.watch(()=>o.showSetting,(U,G)=>{U!==G&&(U?q(a):W(a),R(a.value))});function kn(U){return w.value.filter(G=>U.includes(G.raw[o.idField]))}function Bn(U){const G=r.idField.value,de=w.value.find(ge=>ge.raw[G]===U);de&&me.changeRow(de)}function jn(){f.keepSelectingOnPaging.value||be(),h.updateVisibleDataSummary(w.value)}e.expose({activeRowById:H,addNewDataItem:It,addNewChildDataItem:Tt,addChildrenToNode:Ft,collapseTo:xt,expandTo:ut,removeDataItem:St,editDataItem:dt,acceptDataItem:Vt,cancelDataItem:b,updateColumns:R,updateDataSource:L,selectItemById:J,selectItemByIds:Ie,getSelectedItems:ve,clearSelection:be,getSelectionRow:we,clickRowItemById:ee,unSelectItemByIds:he,getCurrentRowId:ot,reassignRowData:it,hasChildren:lt,getCollapseField:Mn,getCollapseStatusById:En,getVisibleDataByIds:kn,selectRowById:Bn,updateDerivedData:jn,emptyCurrentRowId:Ve,calculateColumnsSize:Se});const Dn=t.computed(()=>{const U={};return ce.shouldShowHorizontalScrollbar.value&&(U.paddingBottom="10px"),ce.shouldShowVirticalScrollbar.value&&(U.paddingRight="10px"),U}),Rn=t.computed(()=>({..._.value,borderRadius:"5px"})),{renderDataGridPagination:ri}=Q.getPagination(o,e,h,ce,E,f),On=t.computed(()=>({"d-flex":!0,"justify-content-between":P.value&&y.value,"justify-content-end":P.value&&!y.value,"position-relative":!0})),Pn=t.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:qn}=Q.getSummary(o,h,z);return()=>t.createVNode("div",{ref:s,class:V.value,style:Rn.value,onWheel:et},[c.value&&gt.value&&ae(),t.createVNode("div",{ref:c,class:X.value,onMouseover:()=>C.value=!0,onMouseleave:()=>C.value=!1,onTouchstart:U=>{U.stopPropagation(),C.value=!0,ce.onTouchstartScrollThumb(U,c)},onTouchend:U=>{C.value=!1},style:Dn.value},[c.value&&yt(w),c.value&&re(),c.value&&ue.value&&Ne(),c.value&&bt(),c.value&&wt()]),c.value&&qn(),y.value&&t.createVNode("div",{class:On.value},[y.value&&t.createVNode("div",{class:Pn.value},[t.createVNode("div",null,["已选:"+p.value.length,t.createTextVNode(" 条")])])]),pe(),N.value&&vt()])}});Ee.withInstall(ht),t.ref(0);var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function at(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nn={exports:{}};(function(o,e){(function(n){o.exports=n()})(function(){return function(){function n(i,l,a){function r(c,g){if(!l[c]){if(!i[c]){var v=typeof at=="function"&&at;if(!g&&v)return v(c,!0);if(u)return u(c,!0);var x=new Error("Cannot find module '"+c+"'");throw x.code="MODULE_NOT_FOUND",x}var w=l[c]={exports:{}};i[c][0].call(w.exports,function(C){var k=i[c][1][C];return r(k||C)},w,w.exports,n,i,l,a)}return l[c].exports}for(var u=typeof at=="function"&&at,s=0;s<a.length;s++)r(a[s]);return r}return n}()({1:[function(n,i,l){var a={},r="(?:^|\\s)",u="(?:\\s|$)";function s(v){var x=a[v];return x?x.lastIndex=0:a[v]=x=new RegExp(r+v+u,"g"),x}function c(v,x){var w=v.className;w.length?s(x).test(w)||(v.className+=" "+x):v.className=x}function g(v,x){v.className=v.className.replace(s(x)," ").trim()}i.exports={add:c,rm:g}},{}],2:[function(n,i,l){(function(a){var r=n("contra/emitter"),u=n("crossvent"),s=n("./classes"),c=document,g=c.documentElement;function v(d,N){var O=arguments.length;O===1&&Array.isArray(d)===!1&&(N=d,d=[]);var E,P,_,K,D,q,W,z,$,ie=null,le,Y,xe=!1,me=0,ne,A=N||{};A.moves===void 0&&(A.moves=S),A.accepts===void 0&&(A.accepts=S),A.invalid===void 0&&(A.invalid=tt),A.containers===void 0&&(A.containers=d||[]),A.isContainer===void 0&&(A.isContainer=j),A.copy===void 0&&(A.copy=!1),A.copySortSource===void 0&&(A.copySortSource=!1),A.revertOnSpill===void 0&&(A.revertOnSpill=!1),A.removeOnSpill===void 0&&(A.removeOnSpill=!1),A.direction===void 0&&(A.direction="vertical"),A.ignoreInputTextSelection===void 0&&(A.ignoreInputTextSelection=!0),A.mirrorContainer===void 0&&(A.mirrorContainer=c.body);var oe=r({containers:A.containers,start:Fe,end:ze,cancel:V,remove:Je,destroy:Ue,canMove:je,dragging:!1});return A.removeOnSpill===!0&&oe.on("over",yt).on("out",vt),ke(),oe;function Le(b){return oe.containers.indexOf(b)!==-1||A.isContainer(b)}function ke(b){var R=b?"remove":"add";C(g,R,"mousedown",ce),C(g,R,"mouseup",Re)}function Te(b){var R=b?"remove":"add";C(g,R,"mousemove",et)}function Xe(b){var R=b?"remove":"add";u[R](g,"selectstart",Ke),u[R](g,"click",Ke)}function Ue(){ke(!0),Re({})}function Ke(b){le&&b.preventDefault()}function ce(b){K=b.clientX,D=b.clientY;var R=k(b)!==1||b.metaKey||b.ctrlKey;if(!R){var L=b.target,H=Be(L);H&&(le=H,Te(),b.type==="mousedown"&&(h(L)?L.focus():b.preventDefault()))}}function et(b){if(le){if(k(b)===0){Re({});return}if(!(b.clientX!==void 0&&Math.abs(b.clientX-K)<=(A.slideFactorX||0)&&b.clientY!==void 0&&Math.abs(b.clientY-D)<=(A.slideFactorY||0))){if(A.ignoreInputTextSelection){var R=p("clientX",b)||0,L=p("clientY",b)||0,H=c.elementFromPoint(R,L);if(h(H))return}var J=le;Te(!0),Xe(),ze(),De(J),s.add(z||_,"gu-transit"),wt(),bt(),me=0,pe(b)}}}function Be(b){if(!(oe.dragging&&E)&&!Le(b)){for(var R=b;m(b)&&Le(m(b))===!1;)if(A.invalid(b,R)||(b=m(b),!b))return;var L=m(b);if(L&&!A.invalid(b,R)){var H=A.moves(b,L,R,f(b));if(H)return{item:b,source:L}}}}function je(b){return!!Be(b)}function Fe(b){var R=Be(b);R&&De(R)}function De(b){Vt(b.item,b.source)&&(z=b.item.cloneNode(!0),oe.emit("cloned",z,b.item,"copy")),P=b.source,_=b.item,q=W=f(b.item),oe.dragging=!0,oe.emit("drag",_,P)}function tt(){return!1}function ze(){if(oe.dragging){var b=z||_;Qe(b,m(b))}}function Se(){le=!1,Te(!0),Xe(!0)}function Re(b){if(Se(),!!oe.dragging){var R=z||_,L=p("clientX",b)||0,H=p("clientY",b)||0,J=M(E,L,H),ee=ae(J,L,H);ee&&(z&&A.copySortSource||!z||ee!==P)?Qe(R,ee):A.removeOnSpill?Je():V()}}function Qe(b,R){var L=m(b);z&&A.copySortSource&&R===P&&L.removeChild(_),re(R)?oe.emit("cancel",b,P):oe.emit("drop",b,R,P,W),X()}function Je(){if(oe.dragging){var b=z||_,R=m(b);R&&R.removeChild(b),oe.emit(z?"cancel":"remove",b,R,P),X()}}function V(b){if(oe.dragging){var R=arguments.length>0?b:A.revertOnSpill,L=z||_,H=m(L),J=re(H);J===!1&&R&&(z?H&&H.removeChild(z):P.insertBefore(L,q)),J||R?oe.emit("cancel",L,P,P):oe.emit("drop",L,H,P,W),X()}}function X(){var b=z||_;Se(),Ct(),xt(),b&&s.rm(b,"gu-transit"),$&&clearTimeout($),oe.dragging=!1,ie&&oe.emit("out",b,ie,P),oe.emit("dragend",b,me),P=_=z=q=W=$=ie=null}function re(b,R){var L;return R!==void 0?L=R:E?L=W:L=f(z||_),b===P&&L===q}function ae(b,R,L){for(var H=b;H&&!J();)H=m(H);return H;function J(){var ee=Le(H);if(ee===!1)return!1;var Ie=ut(H,b),ve=dt(H,Ie,R,L),be=re(H,ve);return be?!0:A.accepts(_,H,P,ve)}}function pe(b){if(!E)return;b.preventDefault();var R=p("clientX",b)||0,L=p("clientY",b)||0;E.style.left=R-2+"px",E.style.top=L-2+"px";var H=z||_,J=M(E,R,L),ee=ae(J,R,L),Ie=ee!==null&&ee!==ie;(Ie||ee===null)&&(we(),ie=ee,Ne()),St(J,L);var ve=m(H);if(ee===P&&z&&!A.copySortSource){ve&&ve.removeChild(H);return}var be,Ve=ut(ee,J);if(xe=nt(Ve,ee),Ve!==null)be=dt(ee,Ve,R,L);else if(A.revertOnSpill===!0&&!z)be=q,ee=P;else{z&&ve&&ve.removeChild(H),z&&Y&&(Y.style.display="none");return}Y.style.display="block",gt(be,H,Ie),be?Tt(Ve,be):Ft(ee);function ue(he){oe.emit(he,H,ie,P)}function Ne(){Ie&&ue("over")}function we(){ie&&ue("out")}}function gt(b,R,L){(b===R||b===f(R))&&(W=f(R)),(b===null&&L||b!==R&&b!==f(R))&&(W=b)}function yt(b){s.rm(b,"gu-hide")}function vt(b){oe.dragging&&s.add(b,"gu-hide")}function bt(){E||(E=document.createElement("div"),E.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",E.innerHTML=A.getMirrorText&&A.getMirrorText(_)||"控件",s.add(E,"gu-mirror"),A.mirrorContainer.appendChild(E),C(g,"add","mousemove",pe),s.add(A.mirrorContainer,"gu-unselectable"),oe.emit("cloned",E,_,"mirror"))}function wt(){if(Y=document.createElement("div"),s.add(Y,"gu-insertion"),_){var b=_.getBoundingClientRect();Y.style.left=b.left+"px",Y.style.top=b.top+"px"}xe=!1,A.mirrorContainer.appendChild(Y)}function Ct(){E&&(s.rm(A.mirrorContainer,"gu-unselectable"),C(g,"remove","mousemove",pe),m(E).removeChild(E),E=null)}function xt(){Y&&(m(Y).removeChild(Y),Y=null)}function ut(b,R){for(var L=R;L!==b&&m(L)!==b;)L=m(L);return L===g?null:L}function nt(b,R){if(!R)return xe;var L=b||R&&R.lastElementChild;if(!L)return!0;var H=getComputedStyle(b),J=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(J)return!0;if(R){var ee=getComputedStyle(R),Ie=ee.getPropertyValue("display");if(/flex$/.test(Ie)){var ve=ee.getPropertyValue("flex-direction")||"row";if(ve==="row"||ve==="row-reverse")return!It(R)}return!1}return!0}function It(b){if(!b.children||!b.children.length)return!1;for(const R of Array.from(b.children)){const H=(R.className&&R.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!H.length)return!1;for(const J of H){const ee=J.slice(J.lastIndexOf("-")+1);if(parseInt(ee,10)!==12)return!1}}return!0}function Tt(b,R){const L=R.getBoundingClientRect();if(Y.style.left=L.left+"px",Y.style.top=L.top+"px",xe){if(Y.style.height=L.height+"px",Y.style.width="4px",b){const H=b.getBoundingClientRect();H.top!==L.top&&(Y.style.left=H.right+"px",Y.style.top=H.top+"px",Y.style.height=H.height+"px")}}else if(Y.style.height="4px",Y.style.width=L.width+"px",ne){const H=ne.getBoundingClientRect();L.top<H.top&&(Y.style.display="none")}R===_&&_&&(Y.style.display="none")}function Ft(b){W=null;var R=b.lastElementChild;if(R){var L=R.getBoundingClientRect();xe?(Y.style.left=L.right+"px",Y.style.top=L.top+"px",Y.style.height=L.height+"px",Y.style.width="4px"):(Y.style.left=L.left+"px",Y.style.top=L.bottom+"px",Y.style.height="4px",Y.style.width=L.width+"px"),R===_&&_&&(Y.style.display="none")}else Y.style.display="none"}function St(b,R){if(!A.mirrorContainer.contains(b)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ne=x(b),!ne||!ne.contains(b)))return;const L=document.querySelector(".dgComponentSelected"),H=ne.getBoundingClientRect();if(R-30<H.top&&ne.scrollTop>0){let J=ne.scrollTop<10?ne.scrollTop:10;ne.scrollBy(0,-1*J),L&&ne.contains(L)&&(me=me+-1*J)}if(R+30>H.bottom&&ne.scrollTop<ne.scrollHeight-ne.clientHeight){const J=ne.scrollHeight-ne.clientHeight-ne.scrollTop;let ee=J<10?J:10;ne.scrollBy(0,ee),L&&ne.contains(L)&&(me=me+ee)}}function dt(b,R,L,H){var J=A.direction==="horizontal",ee=A.direction==="mixed",Ie=R!==b?be():ve();return Ie;function ve(){var ue=b.children.length,Ne,we,he;for(Ne=0;Ne<ue;Ne++)if(we=b.children[Ne],he=we.getBoundingClientRect(),J&&he.left+he.width/2>L||!ee&&!J&&he.top+he.height/2>H||ee&&he.left+he.width>L&&he.top+he.height>H)return we;return null}function be(){var ue=R.getBoundingClientRect();if(ee){var Ne=H-ue.top,we=L-ue.left,he=ue.bottom-H,ot=ue.right-L,it=Math.min(we,ot,Ne,he),lt;return xe?lt=ot<we:lt=he===it||ot===it||we===it,Ve(lt)}return Ve(J?L>ue.left+B(ue)/2:H>ue.top+I(ue)/2)}function Ve(ue){return ue?f(R):R}}function Vt(b,R){return typeof A.copy=="boolean"?A.copy:A.copy(b,R)}}function x(d){const N=Array.from(window.scrollContainerList);if(N.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const O=w(N);for(const E of O)if(E.contains(d))return E;return null}function w(d){const N=[];return d.forEach(O=>{const E=document.getElementById(O);E&&N.push(E)}),N.sort((O,E)=>O.contains(E)?1:E.contains(O)?-1:0),N}function C(d,N,O,E){var P={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},_={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[N](d,_[O],E):a.navigator.msPointerEnabled?u[N](d,K[O],E):(u[N](d,P[O],E),u[N](d,O,E))}function k(d){if(d.touches!==void 0)return d.touches.length;if(d.which!==void 0&&d.which!==0)return d.which;if(d.buttons!==void 0)return d.buttons;var N=d.button;if(N!==void 0)return N&1?1:N&2?3:N&4?2:0}function M(d,N,O){d=d||{};var E=d.className||"",P;return d.className+=" gu-hide",P=c.elementFromPoint(N,O),d.className=E,P}function j(){return!1}function S(){return!0}function B(d){return d.width||d.right-d.left}function I(d){return d.height||d.bottom-d.top}function m(d){return d.parentNode===c?null:d.parentNode}function h(d){return d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.tagName==="SELECT"||F(d)}function F(d){return!d||d.contentEditable==="false"?!1:d.contentEditable==="true"?!0:F(m(d))}function f(d){return d.nextElementSibling||N();function N(){var O=d;do O=O.nextSibling;while(O&&O.nodeType!==1);return O}}function y(d){return d.targetTouches&&d.targetTouches.length?d.targetTouches[0]:d.changedTouches&&d.changedTouches.length?d.changedTouches[0]:d}function p(d,N){var O=y(N),E={pageX:"clientX",pageY:"clientY"};return d in E&&!(d in O)&&E[d]in O&&(d=E[d]),O[d]}i.exports=v}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,i,l){i.exports=function(r,u){return Array.prototype.slice.call(r,u)}},{}],4:[function(n,i,l){var a=n("ticky");i.exports=function(u,s,c){u&&a(function(){u.apply(c||null,s||[])})}},{ticky:10}],5:[function(n,i,l){var a=n("atoa"),r=n("./debounce");i.exports=function(s,c){var g=c||{},v={};return s===void 0&&(s={}),s.on=function(x,w){return v[x]?v[x].push(w):v[x]=[w],s},s.once=function(x,w){return w._once=!0,s.on(x,w),s},s.off=function(x,w){var C=arguments.length;if(C===1)delete v[x];else if(C===0)v={};else{var k=v[x];if(!k)return s;k.splice(k.indexOf(w),1)}return s},s.emit=function(){var x=a(arguments);return s.emitterSnapshot(x.shift()).apply(this,x)},s.emitterSnapshot=function(x){var w=(v[x]||[]).slice(0);return function(){var C=a(arguments),k=this||s;if(x==="error"&&g.throws!==!1&&!w.length)throw C.length===1?C[0]:C;return w.forEach(function(j){g.async?r(j,C,k):j.apply(k,C),j._once&&s.off(x,j)}),s}},s}},{"./debounce":4,atoa:3}],6:[function(n,i,l){(function(a){var r=n("custom-event"),u=n("./eventmap"),s=a.document,c=x,g=C,v=[];a.addEventListener||(c=w,g=k),i.exports={add:c,remove:g,fabricate:M};function x(m,h,F,f){return m.addEventListener(h,F,f)}function w(m,h,F){return m.attachEvent("on"+h,S(m,h,F))}function C(m,h,F,f){return m.removeEventListener(h,F,f)}function k(m,h,F){var f=B(m,h,F);if(f)return m.detachEvent("on"+h,f)}function M(m,h,F){var f=u.indexOf(h)===-1?p():y();m.dispatchEvent?m.dispatchEvent(f):m.fireEvent("on"+h,f);function y(){var d;return s.createEvent?(d=s.createEvent("Event"),d.initEvent(h,!0,!0)):s.createEventObject&&(d=s.createEventObject()),d}function p(){return new r(h,{detail:F})}}function j(m,h,F){return function(y){var p=y||a.event;p.target=p.target||p.srcElement,p.preventDefault=p.preventDefault||function(){p.returnValue=!1},p.stopPropagation=p.stopPropagation||function(){p.cancelBubble=!0},p.which=p.which||p.keyCode,F.call(m,p)}}function S(m,h,F){var f=B(m,h,F)||j(m,h,F);return v.push({wrapper:f,element:m,type:h,fn:F}),f}function B(m,h,F){var f=I(m,h,F);if(f){var y=v[f].wrapper;return v.splice(f,1),y}}function I(m,h,F){var f,y;for(f=0;f<v.length;f++)if(y=v[f],y.element===m&&y.type===h&&y.fn===F)return f}}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,i,l){(function(a){var r=[],u="",s=/^on/;for(u in a)s.test(u)&&r.push(u.slice(2));i.exports=r}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,i,l){(function(a){var r=a.CustomEvent;function u(){try{var s=new r("cat",{detail:{foo:"bar"}});return s.type==="cat"&&s.detail.foo==="bar"}catch{}return!1}i.exports=u()?r:typeof document<"u"&&typeof document.createEvent=="function"?function(c,g){var v=document.createEvent("CustomEvent");return g?v.initCustomEvent(c,g.bubbles,g.cancelable,g.detail):v.initCustomEvent(c,!1,!1,void 0),v}:function(c,g){var v=document.createEventObject();return v.type=c,g?(v.bubbles=!!g.bubbles,v.cancelable=!!g.cancelable,v.detail=g.detail):(v.bubbles=!1,v.cancelable=!1,v.detail=void 0),v}}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,i,l){var a=i.exports={},r,u;function s(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s}catch{r=s}try{typeof clearTimeout=="function"?u=clearTimeout:u=c}catch{u=c}})();function g(I){if(r===setTimeout)return setTimeout(I,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(I,0);try{return r(I,0)}catch{try{return r.call(null,I,0)}catch{return r.call(this,I,0)}}}function v(I){if(u===clearTimeout)return clearTimeout(I);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(I);try{return u(I)}catch{try{return u.call(null,I)}catch{return u.call(this,I)}}}var x=[],w=!1,C,k=-1;function M(){!w||!C||(w=!1,C.length?x=C.concat(x):k=-1,x.length&&j())}function j(){if(!w){var I=g(M);w=!0;for(var m=x.length;m;){for(C=x,x=[];++k<m;)C&&C[k].run();k=-1,m=x.length}C=null,w=!1,v(I)}}a.nextTick=function(I){var m=new Array(arguments.length-1);if(arguments.length>1)for(var h=1;h<arguments.length;h++)m[h-1]=arguments[h];x.push(new S(I,m)),x.length===1&&!w&&g(j)};function S(I,m){this.fun=I,this.array=m}S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function B(){}a.on=B,a.addListener=B,a.once=B,a.off=B,a.removeListener=B,a.removeAllListeners=B,a.emit=B,a.prependListener=B,a.prependOnceListener=B,a.listeners=function(I){return[]},a.binding=function(I){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(I){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(n,i,l){(function(a){var r=typeof a=="function",u;r?u=function(s){a(s)}:u=function(s){setTimeout(s,0)},i.exports=u}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,i,l){(function(a,r){var u=n("process/browser.js").nextTick,s=Function.prototype.apply,c=Array.prototype.slice,g={},v=0;l.setTimeout=function(){return new x(s.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new x(s.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(w){w.close()};function x(w,C){this._id=w,this._clearFn=C}x.prototype.unref=x.prototype.ref=function(){},x.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(w,C){clearTimeout(w._idleTimeoutId),w._idleTimeout=C},l.unenroll=function(w){clearTimeout(w._idleTimeoutId),w._idleTimeout=-1},l._unrefActive=l.active=function(w){clearTimeout(w._idleTimeoutId);var C=w._idleTimeout;C>=0&&(w._idleTimeoutId=setTimeout(function(){w._onTimeout&&w._onTimeout()},C))},l.setImmediate=typeof a=="function"?a:function(w){var C=v++,k=arguments.length<2?!1:c.call(arguments,1);return g[C]=!0,u(function(){g[C]&&(k?w.apply(null,k):w.call(null),l.clearImmediate(C))}),C},l.clearImmediate=typeof r=="function"?r:function(w){delete g[w]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(nn);const st={"tree-grid":{type:"tree-grid"},"tab-page":{type:"tab-page"},section:{type:"section"},drawer:{type:"drawer"}},{globalStorageKey:Yo}=Ee.useThirdComponent(),on={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1}};class se{constructor(e,n){this.x=e,this.y=n}static getTransformInfo(e){const i=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(i.length>=6){const l=parseInt(i[4],10),a=parseInt(i[5],10);return{x:l,y:a}}return{x:0,y:0}}static fromEvent(e,n=null){if(this.isMouseEvent(e))return new se(e.clientX,e.clientY);if(n===null||e.changedTouches.length===1)return new se(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let i=0;i<e.changedTouches.length;i++)if(e.changedTouches[i].target===n)return new se(e.changedTouches[i].clientX,e.changedTouches[i].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const n=new se(0,0);if(window){const i=window.getComputedStyle(e);if(i){const l=parseInt(i.getPropertyValue("left"),10),a=parseInt(i.getPropertyValue("top"),10);n.x=isNaN(l)?0:l,n.y=isNaN(a)?0:a}return n}return null}static copy(e){return new se(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class Pe{constructor(e,n){this.width=e,this.height=n}static getCurrent(e){const n=new Pe(0,0);if(window){const i=window.getComputedStyle(e);return i&&(n.width=parseInt(i.getPropertyValue("width"),10),n.height=parseInt(i.getPropertyValue("height"),10)),n}return null}static copy(e){return new Pe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function ln(o,e){const n=t.ref(),i=t.ref(),l=t.ref(),a=t.ref(),r=t.ref(),u=t.ref(),s=t.ref(),c=t.ref(),g=t.ref(),v=t.ref(),x=t.ref(),w=t.ref(o.resizeable),C=t.ref(),k=t.ref(o.draggable),M=t.ref(!1);function j(){const D=i.value||document.body,q=window.getComputedStyle(D);if(!q||!n.value)return;const W=se.getTransformInfo(n.value),z={};s.value&&(z.deltaL=n.value.offsetLeft-s.value.x,z.deltaT=n.value.offsetTop-s.value.y);const $=q.getPropertyValue("position");z.width=D.clientWidth,z.height=D.clientHeight,z.pr=parseInt(q.getPropertyValue("padding-right"),10),z.pb=parseInt(q.getPropertyValue("padding-bottom"),10),z.position=q.getPropertyValue("position"),$==="static"&&(D.style.position="relative"),z.translateX=W.x,z.translateY=W.y,v.value=z}function S(D){if(n.value){a.value=Pe.getCurrent(n.value),r.value=se.getCurrent(n.value),u.value=a.value?Pe.copy(a.value):null,s.value=r.value?se.copy(r.value):null,j();const q=D.target.getAttribute("type")||"";c.value={n:!!q.match(/n/),s:!!q.match(/s/),w:!!q.match(/w/),e:!!q.match(/e/)}}}function B(){var D,q,W,z;if(n.value){const $=n.value;c.value&&((c.value.n||c.value.s)&&((D=u.value)!=null&&D.height)&&($.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((q=u.value)!=null&&q.width)&&($.style.width=u.value.width+"px"),s.value&&((W=s.value)!=null&&W.x&&($.style.left=s.value.x+"px"),(z=s.value)!=null&&z.y&&($.style.top=s.value.y+"px")))}}function I(){const D=o.minHeight?o.minHeight:1,q=o.minWidth?o.minWidth:1;u.value&&s.value&&c.value&&a.value&&(u.value.height<D&&(u.value.height=D,c.value.n&&r.value&&(s.value.y=r.value.y+(a.value.height-D))),u.value.width<q&&(u.value.width=q,c.value.w&&r.value&&(s.value.x=r.value.x+(a.value.width-q))),o.maxHeight&&u.value.height>o.maxHeight&&(u.value.height=o.maxHeight,r.value&&c.value.n&&(s.value.y=r.value.y+(a.value.height-o.maxHeight))),o.maxWidth&&u.value.width>o.maxWidth&&(u.value.width=o.maxWidth,c.value.w&&r.value&&(s.value.x=r.value.x+(a.value.width-o.maxWidth))))}function m(){if(i.value){const D=v.value;if(s.value&&u.value&&c.value&&a.value){const q=D.width-D.pr-D.deltaL-D.translateX-s.value.x,W=D.height-D.pb-D.deltaT-D.translateY-s.value.y;c.value.n&&s.value.y+D.translateY<0&&r.value&&(s.value.y=-D.translateY,u.value.height=a.value.height+r.value.y+D.translateY),c.value.w&&s.value.x+D.translateX<0&&r.value&&(s.value.x=-D.translateX,u.value.width=a.value.width+r.value.x+D.translateX),u.value.width>q&&(u.value.width=q),u.value.height>W&&(u.value.height=W)}}}function h(D){if(!l.value||!a.value||!r.value||!c.value)return;D.subtract(l.value);const q=D.x,W=D.y;c.value.n?(s.value.y=r.value.y+W,u.value.height=a.value.height-W):c.value.s&&(u.value.height=a.value.height+W),c.value.e?u.value.width=a.value.width+q:c.value.w&&(u.value.width=a.value.width-q,s.value.x=r.value.x+q),m(),I(),B()}function F(D){if(!g.value)return;const q=se.fromEvent(D);q&&h(q)}function f(){if(n.value){const{width:D,height:q,x:W,y:z}=n.value.getBoundingClientRect(),$=se.getTransformInfo(n.value);return{size:{width:D,height:q},position:{x:W-$.x,y:z-$.y}}}return null}function y(D){if(n.value){const q=f();x.value=q}l.value=void 0,a.value=null,r.value=null,u.value=null,s.value=null,c.value=null,g.value=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",y)}function p(){document.addEventListener("mousemove",F),document.addEventListener("mouseup",y)}function d(D){D instanceof MouseEvent&&D.button===2||k.value&&(document.body.click(),D.stopPropagation(),D.preventDefault(),l.value=se.fromEvent(D),g.value=D.target,S(D),p())}function N(D){return n.value=D,w.value&&t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:q=>d(q)},null),t.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:q=>d(q)},null)])}function O(D=!0){document.body.click();const q=i.value||document.body,W=Pe.getCurrent(q),z=n.value;D&&z&&(C.value=f(),C.value.transform=z.style.transform),W&&z&&(u.value=W,u.value.height-=14,u.value.width-=14,z.style.height=u.value.height+"px",z.style.width=u.value.width+"px",z.style.left="7px",z.style.top="7px",z.style.transform="",x.value={size:u.value,position:{x:0,y:0}},k.value=!1,M.value=!0)}function E(){var D,q;if(document.body.click(),C.value){const W={width:C.value.size.width||0,height:C.value.size.height||0},z={x:(window.innerWidth-W.width)/2,y:(window.innerHeight-W.height)/2};(D=u.value)==null||D.set(W),(q=s.value)==null||q.set(z);const $=n.value;$.style.height=W.height+"px",$.style.width=W.width+"px",$.style.left=`${z.x}px`,$.style.top=`${z.y}px`,$.style.transform="",x.value={size:W,position:z},k.value=o.draggable,M.value=!1}}function P(){if(n.value){const D=Pe.getCurrent(n.value);if(D){const{width:q,height:W}=D;n.value.style.left=`${(window.innerWidth-q)/2}px`,n.value.style.top=`${(window.innerHeight-W)/2}px`,n.value.style.transform=""}}}function _(){const D=()=>{M.value?O(!1):P(),document.body.click()};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}}const K=_();return{renderResizeBar:N,boundingElement:i,resizedEventParam:x,maximize:O,restore:E,allowDrag:k,isMaximized:M,unWindowResizeHandle:K,moveToCenter:P}}function rn(o,e,n){const i=t.ref(),l=t.ref(o.draggable),a=t.ref(o.lockAxis),r=t.ref(),u=t.ref(),s=t.ref(!1),c=t.ref(new se(0,0)),g=t.ref(new se(0,0)),v=t.ref(new se(0,0)),x=t.ref(new se(0,0));t.watch(()=>n.value,F=>{r.value.style.cursor=F?"move":"default"});function w(F,f){if(f.tagName==="BUTTON")return!1;if(f===F)return!0;for(const y in f.children)if(Object.prototype.hasOwnProperty.call(f.children,y)&&w(F,f.children[y]))return!0;return!1}function C(){var p,d;let F=v.value.x+g.value.x,f=v.value.y+g.value.y;a.value==="x"?(F=((p=c.value)==null?void 0:p.x)||0,v.value.x=0):a.value==="y"&&(f=((d=c.value)==null?void 0:d.y)||0,v.value.y=0);const y=`translate3d(${Math.round(F)}px, ${Math.round(f)}px, 0px)`;i.value&&(i.value.style.transform=y),x.value.x=F,x.value.y=f}function k(){if(!u.value||!i.value)return null;const F=u.value.getBoundingClientRect(),f=i.value.getBoundingClientRect(),y={top:F.top<f.top,right:F.right>f.right,bottom:F.bottom>f.bottom,left:F.left<f.left};return y.top||(v.value.y-=f.top-F.top),y.bottom||(v.value.y-=f.bottom-F.bottom),y.right||(v.value.x-=f.right-F.right),y.left||(v.value.x-=f.left-F.left),C(),y}function M(F){F&&(c.value&&F.subtract(c.value),v.value.set(F),C(),k())}function j(F){s.value&&l.value&&(F.stopPropagation(),F.preventDefault(),M(se.fromEvent(F,r.value)))}function S(){var F;s.value&&(s.value=!1,g.value.add(v.value),v.value.reset(),(F=i.value)==null||F.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",S))}function B(){!s.value&&r.value&&(s.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",j),document.addEventListener("mouseup",S))}function I(){if(i.value){const F=se.getTransformInfo(i.value);g.value.set(F);return}g.value.reset()}function m(F){if(!n.value||F instanceof MouseEvent&&F.button===2)return;const f=F.target||F.srcElement;r.value!==void 0&&f&&!w(f,r.value)||l.value!==!1&&(document.body.click(),F.stopPropagation(),F.preventDefault(),c.value=se.fromEvent(F,i.value),I(),B())}function h(F,f,y){if(l.value&&f){if(F)r.value=F;else if(o.dragHandle){if(o.dragHandle instanceof HTMLElement)r.value=o.dragHandle;else if(typeof o.dragHandle=="string"){const p=f.querySelector(o.dragHandle);p&&(r.value=p)}}i.value=f,u.value=y,r.value?(r.value.classList.add("ng-draggable"),r.value.addEventListener("mousedown",m)):l.value=!1}}return{registerDraggle:h,resetTranslate:I}}function Mt(o,e){if(o){const n=i=>{i.key.toLowerCase()===o.toLowerCase()&&e({event:i,key:o})};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}}function an(o,e){const n=t.ref(o.enableEsc);let i=null;return n.value?(i=Mt("Escape",l=>{e.emit("esc",{event:l.event,type:"esc"})}),{remove:i}):null}function sn(o,e){const n=t.ref(o.enableEnter);let i=null;return n.value?(i=Mt("Enter",l=>{e.emit("enter",{event:l.event,type:"enter"})}),{remove:i}):null}const Ze=t.defineComponent({name:"FModal",props:on,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(o,e){const n=t.ref(o.width||300),i=t.ref(o.height||200),l=t.ref(o.modelValue),a=t.ref(""),r=t.ref(o.class),u=t.ref(o.fitContent),s=t.ref(o.showHeader),c=t.ref(""),g=t.ref(o.showCloseButton),v=t.ref(o.showMaxButton),x=t.ref(!1),w=t.ref(o.dialogType),C=t.ref(o.src),k=t.ref(""),M=t.ref(o.showButtons),j=t.ref(o.title),S=t.ref(o.containment||null),B=t.ref();j.value==="错误提示"&&(j.value=Oe.LocaleService.getLocaleValue("messageBox.errorTitle"));const I=t.ref(!1);function m(V,X){const re=X?"accept":"cancel";Promise.resolve().then(()=>{var ae;return(ae=o.beforeClose)==null?void 0:ae.call(o,{closeType:re})}).then(ae=>{ae&&(l.value=!1,e.emit("update:modelValue",!1),X!=null&&e.emit(X?"accept":"cancel"),e.emit("closed",V))})}const h=[{name:"cancel",text:Oe.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:V=>{m(V,!1)}},{name:"accept",text:Oe.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:V=>{m(V,!0)}}],F=t.ref(o.buttons&&o.buttons.length?o.buttons:h),f=t.computed(()=>!!c.value),y=t.computed(()=>!!M.value&&!!F.value),p=t.ref(),d=t.ref(),N=t.ref(!1),{renderResizeBar:O,maximize:E,restore:P,boundingElement:_,resizedEventParam:K,allowDrag:D,unWindowResizeHandle:q,moveToCenter:W}=ln(o),{registerDraggle:z}=rn(o,e,D);function $(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ie(){const V=document.querySelectorAll(".farris-modal").length;(!V||V-1<=0)&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}t.watch(()=>o.title,(V,X)=>{V!==X&&(j.value=V)}),t.watch(()=>o.modelValue,(V,X)=>{V!==X&&(l.value=V,l.value&&o.draggable&&t.nextTick(()=>{d.value&&!S.value&&(S.value=d.value.parentElement,_.value=S.value,z(p.value,d.value,_.value),W())}),V||(S.value&&(S.value=null),ie())),l.value?I.value=$():(N.value=!1,D.value=o.draggable)}),t.watch(()=>o.showHeader,(V,X)=>{V!==X&&(s.value=V)}),t.watch(()=>o.showButtons,(V,X)=>{V!==X&&(M.value=V)}),t.watch(()=>K.value,(V,X)=>{const re=V||{},ae=X||{};JSON.stringify(re)!==JSON.stringify(ae)&&e.emit("resize",{newSize:V,oldSize:X,isMaximized:N.value})}),t.watch([()=>o.width,()=>o.height],(V,X)=>{(V[0]!==X[0]||V[1]!==X[1])&&(n.value=V[0]||500,i.value=V[1]||600)}),t.watch(()=>o.class,(V,X)=>{r.value=V});const le=t.computed(()=>(l.value&&document.body.classList.add("modal-open"),l.value)),Y=t.computed(()=>{var re;const V={modal:!0,"farris-modal":!0,fade:!0};V["f-modal-fitContent"]=!!u.value,V.show=!!le.value;const X=(re=o.maskClass)==null?void 0:re.split(" ");return X==null||X.reduce((ae,pe)=>(ae[pe]=!0,ae),V),V}),xe=t.computed(()=>{var re;const V={"modal-dialog":!0},X=(re=r.value)==null?void 0:re.split(" ");return X==null||X.reduce((ae,pe)=>(ae[pe]=!0,ae),V),V}),me=()=>Ee.isMobilePhone()&&!o.isMessager,ne=t.computed(()=>{const V=document.documentElement.clientWidth,X=document.documentElement.clientHeight,re=Math.min(n.value,V),ae=u.value?"auto":`${Math.min(i.value,X-10)}px`,pe={position:"absolute",top:`${(window.innerHeight-parseInt(ae==="auto"?"0":ae))/2}px`,left:`${(window.innerWidth-re)/2}px`,width:`${re}px`,height:ae};return me()&&(pe.top="0px",pe.left="0px",pe.width=`${window.innerWidth}px`,pe.height=`${window.innerHeight}px`),o.mask||(pe.pointerEvents="auto"),pe}),A=t.ref(Ee.getMaxZIndex()||1050),oe=t.computed(()=>{const V={display:"block",overflow:"hidden"};return o.mask||(V.pointerEvents="none",V.backgroundColor="transparent"),I.value&&(V.backgroundColor="transparent"),V.zIndex=A.value,V}),Le=t.computed(()=>({"modal-content":!0,"modal-content-has-header":s.value,"is-mobile":me()})),ke=t.computed(()=>{const V={display:s.value?"":"none"};return V["pointer-events"]=D.value?"auto":"none",V}),Te=t.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:N.value})),Xe=t.computed(()=>({"modal-body":!0,"f-utils-flex-column":w.value==="iframe","f-utils-fill":!0}));function Ue(){return{height:`${o.footerHeight||60}px`}}const Ke=t.computed(()=>{const V={textAlgin:k.value},X=Ue();return Object.assign(V,X)});function ce(V){if(V==null||V.stopPropagation(),N.value){N.value=!1,P();return}E(),N.value=!0}async function et(V,X){V.handle&&await V.handle(X,V)&&e.emit("closed",X)}function Be(V){V.width&&(n.value=V.width),V.height&&(i.value=V.height),V.buttons&&(F.value=V.buttons),V.title&&(j.value=V.title)}let je=null,Fe=null;t.onBeforeMount(()=>{I.value=$()}),t.onMounted(()=>{d.value&&!S.value&&(S.value=d.value.parentElement,_.value=S.value,z(p.value,d.value,_.value)),le.value&&document.body.classList.add("modal-open"),je=an(o,e),Fe=sn(o,e)}),t.onUnmounted(()=>{q&&q(),je&&je.remove(),Fe&&Fe.remove()}),e.expose({modalElementRef:d,updateModalOptions:Be,close:m,maxDialog:ce,isMaximized:N});function De(){return t.createVNode("ul",null,[x.value&&t.createVNode("li",{class:"f-btn-icon f-bare"},[t.createVNode("span",{class:"f-icon modal_minimize"},null)]),v.value&&t.createVNode("li",{onClick:ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[t.createVNode("span",{class:Te.value},null)]),g.value&&t.createVNode("li",{class:"f-btn-icon f-bare",onClick:V=>m(V,!1),style:"pointer-events: auto;"},[t.createVNode("span",{class:"f-icon modal_close"},null)])])}function tt(){return t.createVNode("div",{class:"modal-footer",style:Ke.value},[F.value&&F.value.map(V=>{const X=t.ref(V.disabled);return t.createVNode("button",{name:V.name,type:"button",disabled:X.value,class:V.class+(V.iconClass?" btn-icontext":""),onClick:re=>{et(V,re)}},[!!V.iconClass&&t.createVNode("i",{class:V.iconClass},null),V.text])})])}function ze(){return t.createVNode("div",{ref:p,class:"modal-header",style:ke.value},[e.slots.headerTemplate?e.slots.headerTemplate():t.createVNode("div",{class:"modal-title"},[f.value&&t.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),t.createVNode("span",{class:"modal-title-label"},[j.value])]),t.createVNode("div",{class:"actions"},[De()])])}function Se(){return e.slots.footerTemplate?e.slots.footerTemplate():y.value&&tt()}function Re(V){if(V.stopPropagation(),o.allowClickMaskToClose){if(V.target!==B.value)return;m(V,!1)}}function Qe(){var V,X;return t.createVNode("div",{id:a.value,class:xe.value,style:ne.value,ref:d},[t.createVNode("div",{class:Le.value},[s.value&&ze(),t.createVNode("div",{class:Xe.value},[(X=(V=e.slots).default)==null?void 0:X.call(V),w.value==="iframe"&&t.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:C.value},null)]),Se()]),!u.value&&d.value&&!N.value&&O(d.value)])}function Je(V){return V||"body"}return t.watchEffect(()=>{le.value&&(A.value=Ee.getMaxZIndex()||1050)}),()=>t.createVNode(t.Teleport,{to:Je(o.host)},{default:()=>[le.value&&t.createVNode(t.Transition,{name:"fade",appear:!0},{default:()=>[t.createVNode("div",{ref:B,class:Y.value,style:oe.value,onClick:Re},[Qe()])]})]})}});function kt(o){if(o.content&&o.content.render)return o.content.render;if(o.render&&typeof o.render=="function")return o.render}function cn(o){const e=document.createElement("div");e.style.display="contents";const n=t.createApp({setup(i,l){t.onUnmounted(()=>{document.body.removeChild(e)});const a=t.ref(),r=t.ref(o.class||""),u=t.ref(!!o.showButtons),s=t.ref(!!o.showHeader),c=t.ref(o.showCloseButton==null?!0:o.showCloseButton),g=t.ref(!0),v=t.ref(o.title||""),x=o.acceptCallback||(()=>{}),w=o.rejectCallback||(()=>{}),C=o.closedCallback||(B=>{}),k=o.resizeHandle||(B=>{}),M=o.stopMoveHandle||(B=>{}),j=kt(o),S=B=>{g.value=!1,n.unmount(),C(B)};return t.onMounted(()=>{}),l.expose({modalRef:a}),()=>t.createVNode(Ze,{ref:a,class:r.value,modelValue:g.value,"onUpdate:modelValue":B=>g.value=B,title:v.value,width:o.width,height:o.height,buttons:o.buttons,"show-header":s.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:x,onCancel:w,fitContent:o.fitContent==null?!0:o.fitContent,onClosed:S,onResize:k,onStopMove:M},{default:()=>[j&&j(n)]})}});return document.body.appendChild(e),n.use(Oe.LocaleService.i18n),n.mount(e),n}class un{constructor(e){te(this,"appContext",null);te(this,"modalRef",t.ref());te(this,"activeModalIndex",t.ref(0));te(this,"modalRefs",{});te(this,"isUseEscCloseModal",t.ref(!1));te(this,"activeModalInstance",t.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,n){const{width:i,height:l}={width:window.innerWidth,height:window.innerHeight};return i<e&&(e=i-14),l<n&&(n=l-14),{width:e,height:n}}static show(e){const n=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return cn(n)}close(e){var n,i;e?(i=e.value)==null||i.close():(n=this.getCurrentModal())==null||n.close()}open(e){const n=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const i=t.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),l=t.ref(!0),a=i.value.acceptCallback||(()=>{}),r=i.value.rejectCallback||(()=>{}),u=i.value.closedCallback||((m,h)=>{}),s=i.value.resizeHandle||(m=>{}),c=e.stopMoveHandle||(m=>{});let g;const v=kt(i.value),x=m=>{var F;l.value=!1;const h=(F=m==null?void 0:m.target)==null?void 0:F.classList.contains("modal_close");u(m,this.isUseEscCloseModal.value?"esc":h?"icon":"button")},w=m=>{x(m),g&&t.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],t.render(null,n),g=null,this.modalRef.value=null,this.modalRefs){const h=Object.keys(this.modalRefs).map(F=>Number(F));h.length>0?this.activeModalIndex.value=Math.max(...h):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},C=m=>{var h;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((h=this.activeModalInstance.value)==null||h.close(m==null?void 0:m.event))},{width:k,height:M}=i.value,j=this.adaptToWindow(k||500,M||320);Object.assign(i.value,j);const S=()=>t.createVNode(Ze,t.mergeProps({ref:this.modalRef,modelValue:l.value,"onUpdate:modelValue":m=>l.value=m},i.value,{isMessager:i.value.class&&i.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:r,onClosed:w,onResize:s,onEsc:C,onStopMove:c}),{default:()=>[v&&v(this.app)]});return g=(m=>{const h=t.h(S,m);return h.appContext=this.appContext,t.render(h,n),h})({...i.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:m=>{i.value={...i.value,...m},g&&t.render(t.cloneVNode(g,{...i}),n)},destroy:w,modalRef:this.activeModalInstance,close:()=>this.close()}}}const dn=Symbol("FModalService");Ze.install=o=>{o.component(Ze.name,Ze);const e=new un(o);o.provide(dn,e),o.provide("FModalService",e)},t.ref(0);function Bt(o){const{designerHostService:e}=o,n=new Map,i=t.ref(),l=t.ref(),a=t.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),r={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u=t.ref(!1),s=t.ref(o.componentType);function c(M){const j=[];return M.forEach(S=>{let B=[];S.type&&S.type.fields&&S.type.fields.length>0&&(B=c(S.type.fields));const I=ye.cloneDeep(S),m=S.multiLanguage?"多语言":S.type.displayName,h=B.length?!1:!n.has(S.id);h&&(u.value=!0),j.push({data:Object.assign({displayedTypeName:m,selectable:h},I),children:B})}),j}function g(M){switch(M){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return M}}function v(M){var j,S;if(M&&(((j=M.schema)==null?void 0:j.type)===((S=st.drawer)==null?void 0:S.type)||M.parent&&v(M.parent)))return!0}function x(M){if(n.clear(),!M)return;const j=v(o.targetComponentInstance);let S=g(s.value);["frame","table","form"].includes(S)&&(S="form");const{formSchemaUtils:B,schemaService:I}=e;B.getFormSchema().module.viewmodels.forEach(m=>{if(!m.fields||m.fields.length===0)return;const h=B.getComponentByViewModelId(m.id);let F=h.componentType;["frame","table","form"].includes(F)&&(F="form");const f=I.getTableInfoByViewModelId(m.id);if(F!==S||!f||f.id!==M.id)return;const y=B.checkComponentExistInDrawer(h.id);j&&y&&m.fields.forEach(p=>{n.set(p.id,!0)}),!j&&!y&&m.fields.forEach(p=>{n.set(p.id,!0)})})}function w(M){x(M);const{fields:j}=M.type;u.value=!1,i.value=c(j),l.value&&l.value.updateDataSource(i.value)}const C={customRowStatus:M=>(M.disabled=!M.raw.selectable,M)};function k(){return l.value.getSelectedItems().map(j=>j.data)}return{fieldTreeGridRef:l,resolveFieldDataSource:w,occupiedFieldMap:n,fieldDataSource:i,fieldTreeRowOption:C,fieldColumns:a,fieldSelectionOption:r,checkAndGetSelectedFields:k,hasSelectableField:u,currentComponentType:s}}function fn(o){const{designerHostService:e}=o,n=new Map,i=t.ref(),l=t.ref(),a=t.ref([{field:"name",title:"实体名称"}]),r=t.ref(),u=t.ref(!1);function s(C){const k=Bt(o);return k.resolveFieldDataSource(C),k.hasSelectableField.value?(r.value=r.value||C,!0):!1}function c(C){return!(o.bindingEntityId&&o.bindingEntityId!==C.id||!s(C))}function g(C,k=""){var I;if(!C)return;const M=ye.cloneDeep(C),j=k?`${k}/${M.label}`:"/";n.set(M.label,j.replace("//","/"));const S=c(M),B={data:Object.assign({selectable:S},M),children:[]};if(M.type.entities&&M.type.entities.length){const m=M.type.entities.map(h=>g(h,j));B.children=B.children.concat(m)}return o.bindingEntityId===C.id&&(r.value=C),((I=r.value)==null?void 0:I.id)===C.id&&!k&&(u.value=!0),B}function v(){var j;const{formSchemaUtils:C}=e,k=(j=C.getFormSchema().module.entity[0])==null?void 0:j.entities[0];n.clear();const M=g(k);l.value=[M]}function x(){var k;const C=i.value.getSelectionRow();if(!C||!((k=C.raw)!=null&&k.data)){const M=new pt;M.globalConfig={position:"top-center"},M.warning({message:"请先选择实体"});return}return C.raw.data}return{entityTreeGridRef:i,entityDataSource:l,resolveEntityDataSource:v,entityBindToMap:n,checkAndGetSelectedEntity:x,entityColumns:a,entityTreeRowOption:{customRowStatus:C=>(C.disabled=!C.raw.selectable,C)},initialSelectedEntity:r,isMainEntityInitialSelected:u}}const mn=new Map([["appearance",$e.resolveAppearance]]);function pn(o,e,n){return e}const hn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},gn={title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},jt={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}},Dt=$e.createPropsResolver(jt,hn,mn,pn,gn),qe=t.defineComponent({name:"FStep",props:jt,emits:["click"],setup(o,e){const n=t.ref(o.direction),i=t.ref(o.fill),l=t.ref(o.height),a=t.ref(o.steps),r=t.ref(o.activeIndex),u=t.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&i.value,"f-progress-step-vertical-fill":n.value==="vertical"&&i.value})),s=t.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function c(I,m){const h={step:!0,active:m===r.value,clickable:o.clickable,current:m===r.value,finish:m<r.value};return I.status&&(h[I.status]=!0),Ee.getCustomClass(h,I.class||"")}function g(I,m){if(!o.clickable)return;const h={step:I,stepIndex:m};e.emit("click",h)}function v(I,m){const h={"f-progressstep-row":!0,"step-active":m===r.value,"step-current":m===r.value,"step-finish":m<r.value};return I.status&&(h["step-"+I.status]=!0),h}function x(I,m){const h={"step-icon":!0,"step-success":m,"f-icon":m,"f-icon-check":m};return Ee.getCustomClass(h,I.icon||"")}function w(I,m){const h=[];return I.icon?h.push(t.createVNode("span",{class:x(I,!1)},null)):m>=r.value?h.push(t.createVNode("span",{class:"step-icon"},[m+1])):h.push(t.createVNode("span",{class:x(I,!0)},null)),h}function C(I,m){return{"step-name":!0,"step-name-success":m<r.value}}function k(I,m){return t.createVNode("div",{class:"f-progress-step-title"},[t.createVNode("p",{class:C(I,m)},[I.title])])}function M(I,m){return{"f-progress-step-line":!0,"f-progress-step-line-success":m===r.value}}function j(I,m){return m!==a.value.length-1}const S=t.computed(()=>({triangle:!0,"":n.value==="vertical"}));function B(){return a.value.map((I,m)=>t.createVNode("li",{class:c(I,m),onClick:h=>g(I,m)},[t.createVNode("div",{class:v(I,m)},[t.createVNode("div",{class:"f-progress-step-content"},[w(I,m),k(I,m)]),j(I,m)&&t.createVNode("div",{class:M(I,m)},[t.createVNode("span",{class:S.value},null)])])]))}return t.watch(()=>o.activeIndex,()=>{o.activeIndex>-1&&o.activeIndex<=a.value.length&&(r.value=o.activeIndex,B())}),()=>t.createVNode("div",{class:"f-progress-step"},[t.createVNode("ul",{class:u.value,style:s.value},[B()])])}}),yn=t.defineComponent({name:"FStepDesign",props:At.stepProps,emits:[],setup(o,e){const n=t.ref(o.direction),i=t.ref(o.fill),l=t.ref(o.height),a=t.ref(o.steps),r=t.ref(0),u=t.ref(o.clickable),s=t.ref(0),c=t.ref(),g=t.inject("design-item-context"),v=T.useDesignerComponent(c,g);t.onMounted(()=>{c.value.componentInstance=v}),e.expose(v.value);const x=t.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&i.value,"f-progress-step-vertical-fill":n.value==="vertical"&&i.value})),w=t.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function C(y,p){const d={step:!0,active:p===r.value,clickable:u.value,"click-disable":y.disable,current:p===r.value};return p<r.value&&(d.finish=!0),y.status&&(d[y.status]=!0),y.hasOwnProperty("class")&&y.class.split(" ").reduce((N,O)=>(N[O]=!0,N),d),d}function k(y,p){}function M(y,p){const d={"f-progressstep-row":!0,"step-active":p===r.value,"step-current":p===r.value};return p<r.value&&(d["step-finish"]=!0),y.status&&(d["step-"+y.status]=!0),d}function j(y,p){const d={"step-icon":!0,"step-success":p,"k-icon":p,"k-i-check":p};return y.hasOwnProperty("icon")&&y.class.split(" ").reduce((N,O)=>(N[O]=!0,N),d),d}function S(y,p){const d=[];return y.icon?d.push(t.createVNode("span",{class:j(y,!1)},null)):p>=r.value||p===s.value?d.push(t.createVNode("span",{class:"step-icon"},[p+1])):d.push(t.createVNode("span",{class:j(y,!0)},null)),d}function B(y,p){return{"step-name":!0,"step-name-success":p<r.value}}function I(y,p){return t.createVNode("div",{class:"f-progress-step-title"},[t.createVNode("p",{class:B(y,p)},[y.title])])}function m(y,p){return{"f-progress-step-line":!0,"f-progress-step-line-success":p===r.value}}function h(y,p){return p!==a.value.length-1}const F=t.computed(()=>({triangle:!0,"":n.value==="vertical"}));function f(){return a.value.map((y,p)=>t.createVNode("li",{class:C(y,p),onClick:d=>void 0},[t.createVNode("div",{class:M(y,p)},[t.createVNode("div",{class:"f-progress-step-content"},[S(y,p),I(y,p)]),h(y,p)&&t.createVNode("div",{class:m(y,p)},[t.createVNode("span",{class:F.value},null)])])]))}return()=>t.createVNode("div",{ref:c,class:"f-progress-step"},[t.createVNode("ul",{class:x.value,style:w.value},[f()])])}});qe.install=o=>{o.component(qe.name,qe)},qe.register=(o,e,n,i)=>{o.step=qe,e.step=Dt},qe.registerDesigner=(o,e,n)=>{o.step=yn,e.step=Dt};const vn=t.defineComponent({name:"FEntityBindingSelector",props:Zt,emits:["submit","cancel"],setup(o,e){const n=fn(o),{entityColumns:i,entityTreeGridRef:l,entityDataSource:a,checkAndGetSelectedEntity:r,resolveEntityDataSource:u,entityTreeRowOption:s,initialSelectedEntity:c,isMainEntityInitialSelected:g}=n,v=Bt(o),{fieldColumns:x,resolveFieldDataSource:w,fieldDataSource:C,fieldTreeGridRef:k,fieldTreeRowOption:M,fieldSelectionOption:j,checkAndGetSelectedFields:S,currentComponentType:B}=v,I=new pt;I.globalConfig={position:"top-center"};const m=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],h=t.ref(),F=t.ref(""),f=t.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),y=t.ref(0),p=t.ref(""),d=t.computed(()=>$=>({"f-utils-fill":!0,border:$!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":f.value[y.value].id!==$}));function N(){o.bindingEntityId&&(c!=null&&c.value)&&(F.value=c.value.name),o.componentType||(h.value=g.value?"response-form":"data-grid")}function O(){const $=r();$&&(w($),k.value.updateDataSource(C.value))}t.onBeforeMount(()=>{o.steps&&(f.value=f.value.filter($=>o.steps.includes($.id))),p.value=f.value[0].id,u(),N()}),t.onMounted(()=>{var $,ie;l&&(($=c.value)!=null&&$.id)&&l.value.selectRowById((ie=c.value)==null?void 0:ie.id),f.value.length===1&&f.value[0].id==="selectFields"&&O()});function E($){var ie;(ie=k==null?void 0:k.value)!=null&&ie.emptyCurrentRowId&&k.value.emptyCurrentRowId()}function P(){return t.createVNode(ht,{key:1,ref:l,fit:!0,data:a.value,idField:"id",columns:i.value,rowNumber:{enable:!1},"row-option":s,columnOption:{fitColumns:!0}},null)}function _(){return t.createVNode(ht,{key:2,ref:k,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:C.value,idField:"id",columns:x.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":M,selection:j},null)}function K(){const $={editable:!1,type:"combo-list",data:m,idField:"value",valueField:"value",textField:"name"},ie={type:"input-group",enableClear:!1};return t.createVNode("div",null,[t.createVNode("div",{class:"f-utils-fill"},[t.createVNode("div",{class:"f-section py-0"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode("组件信息")])])]),t.createVNode("div",{class:"f-section-content"},[t.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[t.createVNode(Nt.FDynamicFormGroup,{label:"组件类型",customClass:"col-12",modelValue:h.value,"onUpdate:modelValue":le=>h.value=le,required:"true",editor:$,onChange:E},null),t.createVNode(Nt.FDynamicFormGroup,{label:"组件标题",customClass:"col-12",modelValue:F.value,"onUpdate:modelValue":le=>F.value=le,required:"true",editor:ie},null)])])])])])}function D(){y.value--,p.value=f.value[y.value].id}function q(){var $;switch(p.value){case"selectEntity":{O();break}case"selectComponentType":{if(!h.value){I.warning("请先选择组件类型");return}if(!(($=F.value)!=null&&$.trim())){I.warning("请先填写组件标题");return}B.value=h.value,w(c.value),k.value.updateDataSource(C.value);break}}y.value++,p.value=f.value[y.value].id}function W(){e.emit("cancel")}function z(){var le;const $=r(),ie=S();if($){const Y={bindingType:"entity"};Y.bindingEntity=$,Y.bindTo=n.entityBindToMap.get(((le=Y.bindingEntity)==null?void 0:le.label)||""),Y.bindingEntityFields=ie,Y.entityTitle=F.value,e.emit("submit",{bindingContext:Y,componentType:h.value})}}return()=>{var $;return t.createVNode("div",{class:"h-100 d-flex flex-column"},[(($=f.value)==null?void 0:$.length)>1?t.createVNode(qe,{steps:f,activeIndex:y,style:"align-self:center"},null):"",t.createVNode("div",{class:d.value("selectEntity"),style:"border-radius:10px;"},[P()]),t.createVNode("div",{class:d.value("selectComponentType"),style:"border-radius:10px;"},[K()]),t.createVNode("div",{class:d.value("selectFields"),style:"border-radius:10px;"},[_()]),t.createVNode("div",{class:"modal-footer"},[t.createVNode("button",{class:"btn btn-secondary",onClick:W},[t.createTextVNode("取消")]),y.value!==0?t.createVNode("button",{class:"btn btn-secondary",onClick:D},[t.createTextVNode("上一步")]):"",y.value!==f.value.length-1?t.createVNode("button",{class:"btn btn-primary",onClick:q},[t.createTextVNode("下一步")]):"",y.value===f.value.length-1?t.createVNode("button",{class:"btn btn-primary",onClick:z},[t.createTextVNode("确定")]):""])])}}});function bn(o,e){let n;function i(s){var C,k,M,j,S,B;const c=(k=(C=o.parent)==null?void 0:C.parent)==null?void 0:k.componentInstance;if(!((S=(j=(M=c==null?void 0:c.value)==null?void 0:M.schema)==null?void 0:j.contents)!=null&&S.length))return;const g={componentType:"response-form",bindingSourceContext:s,parentComponentInstance:c.value},v=c.value.addNewChildComponentSchema(g,e),x=(B=o.parent)==null?void 0:B.schema,w=c.value.schema.contents.findIndex(I=>I.id===(x==null?void 0:x.id));w>-1&&c.value.schema.contents.splice(w+1,0,v)}function l(s){var c,g;i(s.bindingContext),(c=n==null?void 0:n.modalRef)!=null&&c.value.close&&((g=n==null?void 0:n.modalRef)==null||g.value.close())}function a(){var s,c;(s=n==null?void 0:n.modalRef)!=null&&s.value.close&&((c=n==null?void 0:n.modalRef)==null||c.value.close())}function r(){if(!e)return;const{schemaService:s,formSchemaUtils:c}=e,{componentType:g}=o.schema,v=c.getViewModelIdByComponentId(o.componentInstance.value.belongedComponentId),x=s.getTableInfoByViewModelId(v),w=x==null?void 0:x.id,C=["selectFields"];return()=>t.createVNode(t.Fragment,null,[t.createVNode(vn,{componentType:g,bindingEntityId:w,steps:C,designerHostService:e,targetComponentInstance:o.parent,onSubmit:l,onCancel:a},{default:()=>[t.createTextVNode(" ")]}),t.createTextVNode(" ")])}function u(s){s.stopPropagation(),s.preventDefault(),e&&(n=e.modalService.open({title:"添加卡片",width:800,height:600,fitContent:!1,showButtons:!1,render:r(),enableEsc:!1,draggable:!0}))}return{addSiblingComponent:u}}const wn={componentId:{type:String,default:""},designerHostService:{type:Object,default:{}}},Ye=class Ye{static getEditorTypesByMDataType(e,n=!1,i=""){if(n)return[{key:T.DgControl["language-textbox"].type,value:T.DgControl["language-textbox"].name}];let l=Ye.fieldControlTypeMapping[e];if(i==="data-grid-column"&&(l!=null&&l.length)){const a=[T.DgControl["check-group"].type,T.DgControl["radio-group"].type,T.DgControl.image.type,T.DgControl["rich-text-editor"].type];l=l.filter(r=>!a.includes(r.key))}return l}static getAllInputTypes(){const e=[];for(const n in Ye.fieldControlTypeMapping)Ye.fieldControlTypeMapping[n].forEach(i=>{e.find(l=>l.key===i.key&&l.value===i.value)||e.push({key:i.key,value:i.value})});return e}static mappingDomPropAndSchemaProp(e,n){var a;const i=(a=e.editor)==null?void 0:a.type,l=[];return(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&n&&n.categoryId&&n.categoryId.indexOf("gridFieldEditor")<0&&l.push({domField:"title",schemaField:"name"}),l.push({domField:"label",schemaField:"name"}),l.push({domField:"editor.required",schemaField:"require"}),l.push({domField:"editor.readonly",schemaField:"readonly"}),(i===T.DgControl["input-group"].type||i===T.DgControl.textarea.type||i===T.DgControl["number-spinner"].type)&&l.push({domField:"editor.maxLength",schemaField:"type.length"}),i===T.DgControl["number-spinner"].type&&l.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"formatter.precision",schemaField:"type.precision"}),(i===T.DgControl["combo-list"].type||i===T.DgControl["radio-group"].type)&&l.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"formatter.data",schemaField:"type.enumValues"}),i===T.DgControl["date-picker"].type&&(l.push({domField:"editor.displayFormat",schemaField:"editor.format"}),l.push({domField:"editor.fieldType",schemaField:"type.name"})),i===T.DgControl["number-spinner"].type&&(l.push({domField:"editor.max",schemaField:"editor.maxValue"}),l.push({domField:"editor.min",schemaField:"editor.minValue"})),i===T.DgControl.lookup.type&&(l.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),l.push({domField:"editor.valueField",schemaField:"editor.valueField"}),l.push({domField:"editor.textField",schemaField:"editor.textField"}),l.push({domField:"editor.displayType",schemaField:"editor.displayType"}),l.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),l.push({domField:"editor.helpId",schemaField:"editor.helpId"})),l.push({domField:"path",schemaField:"bindingPath"}),l.push({domField:"binding.path",schemaField:"bindingField"}),l.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===T.DgControl["data-grid-column"].type||e.type===T.DgControl["tree-grid-column"].type)&&l.push({domField:"field",schemaField:"bindingPath"}),l}};te(Ye,"fieldControlTypeMapping",{String:[{key:T.DgControl["input-group"].type,value:T.DgControl["input-group"].name},{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl.image.type,value:T.DgControl.image.name},{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name},{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name},{key:T.DgControl["check-group"].type,value:T.DgControl["check-group"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name},{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl.textarea.type,value:T.DgControl.textarea.name},{key:T.DgControl["time-picker"].type,value:T.DgControl["time-picker"].name}],Text:[{key:T.DgControl.textarea.type,value:T.DgControl.textarea.name},{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl.image.type,value:T.DgControl.image.name},{key:T.DgControl["rich-text-editor"].type,value:T.DgControl["rich-text-editor"].name}],Decimal:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Integer:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Number:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name},{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name}],BigNumber:[{key:T.DgControl["number-spinner"].type,value:T.DgControl["number-spinner"].name}],Date:[{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name}],DateTime:[{key:T.DgControl["date-picker"].type,value:T.DgControl["date-picker"].name}],Boolean:[{key:T.DgControl.switch.type,value:T.DgControl.switch.name},{key:T.DgControl["check-box"].type,value:T.DgControl["check-box"].name}],Enum:[{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name}],Object:[{key:T.DgControl.lookup.type,value:T.DgControl.lookup.name},{key:T.DgControl["combo-list"].type,value:T.DgControl["combo-list"].name},{key:T.DgControl["radio-group"].type,value:T.DgControl["radio-group"].name}]});let Rt=Ye;var ct=(o=>(o.Form="Form",o.Variable="Variable",o))(ct||{});class Cn{constructor(e,n){te(this,"controlsInfo",{});te(this,"formSchemaUtils");te(this,"designViewModelUtils");te(this,"viewModelId","");this.designerHostService=e,this.componentId=n,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils,this.viewModelId=this.formSchemaUtils.getViewModelIdByComponentId(this.componentId)}buildFieldTreeData(){const e=this.designViewModelUtils.getDgViewModel(this.viewModelId);if(!e)return[];const n=this.formSchemaUtils.getComponentById(this.componentId);if(!n)return[];const{componentType:i}=n,l=e.fields;if(i==="data-grid"||i==="form"){const a=this.getAllControlsInComponents(n);return this.controlsInfo.controls=a,this.buildFieldTreeDataByControls(l,a,i)}return[]}getAllControlsInComponents(e){const n=[],i=this.getFormLayoutInCmp(e.contents);if(this.controlsInfo.formLayout=i,i){const l=i.columns||i.contents;this.getAllControlsInLayout(l,n)}return n}buildFieldTreeDataByControls(e,n,i){const l=[],a=new Map,r=[];return n.forEach(u=>{if(u.type===T.DgControl.fieldset.type){r.push(u);return}const s=this.buildFieldTreeNodeFromControl(u,e,this.componentId,i,n);if(s)if(s.isInGroupNode){if(!a.has(s.groupId)){const g=this.buildFieldTreeGroupNodeWithBindingEntityField(u,e,r,s);g&&(a.set(s.groupId,g),l.push(g))}const c=a.get(s.groupId);c!=null&&c.children&&c.children.push(s)}else l.push(s)}),l}buildFieldTreeNodeFromControl(e,n,i,l,a){let r;return e.binding?e.binding.type===ct.Variable?r=this.buildFieldTreeNodeWithBindingVariable(e):r=this.buildFieldTreeNodeWithBindingEntityField(e,n,i,l):r=this.buildFieldTreeNodeWithoutControlBinding(e,a),r}buildFieldTreeNodeWithoutControlBinding(e,n){const i=n.find(l=>{if(l.type===T.DgControl.fieldset.type&&l.contents&&l.contents.length&&l.contents.find(r=>r.id===e.id))return!0});return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:e.id,name:e.title||e.text||e.label},groupId:i?i.id:"",groupName:i?i.title:"",expanded:!1,isBindVariable:!1,isComplexField:!1,isGroupNode:!1,isInGroupNode:!!i,isNoBinding:!0,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingVariable(e){const n=e.binding.field,i=this.formSchemaUtils.getVariableById(n),l=this.formSchemaUtils.getViewModelById(this.viewModelId),a=l==null?void 0:l.fields.find(u=>u.id===n),r=a&&a.groupId;return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:n,name:e.title||e.text||e.label,code:e.binding.fullPath||e.binding.path,controlType:e.type,type:i&&i.type,category:i&&i.category},groupId:r,expanded:!1,isBindVariable:!0,isComplexField:!1,isInGroupNode:!!r,isGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingEntityField(e,n,i,l){const a=e.binding.field,r=n.find(x=>x.id===a);if(!r)return;const{groupId:u}=r,s=r.isSchemaRemoved?{id:a,name:e.title||e.text||e.label}:r,c=r.isSchemaRemoved,g=!r.isSchemaRemoved,v=r.$type==="ComplexField";return{canChangeControlType:g,children:[],componentId:i,componentType:l,control:e,data:s,expanded:!1,groupId:u,isBindVariable:!1,isComplexField:v,isGroupNode:!1,isInGroupNode:!!u,isNoBinding:!1,isRemoved:!!c,nodeType:"field"}}buildFieldTreeGroupNodeWithBindingEntityField(e,n,i,l){let a,r;if(e.binding&&e.binding.type===ct.Form){const s=e.binding.field,c=n.find(g=>g.id===s);if(!c)return;a=c.groupId,r=c.groupName}else if(e.binding&&e.binding.type===ct.Variable){const s=e.binding.field,c=this.formSchemaUtils.getViewModelById(this.viewModelId),g=c==null?void 0:c.fields.find(v=>v.id===s);if(!g)return;a=g.groupId,r=g.groupName}else a=l==null?void 0:l.groupId,r=l==null?void 0:l.groupName;const u=i.find(s=>s.id===a);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:u,data:{id:a,name:r},groupId:a,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}getFormLayoutInCmp(e){if(!e)return{};for(const n of e){if([T.DgControl["data-grid"].type,T.DgControl["tree-grid"].type,T.DgControl["response-form"].type].includes(n.type))return n;if(n.contents){const l=this.getFormLayoutInCmp(n.contents);if(l)return l}}return null}getAllControlsInLayout(e,n){if(e)for(const i of e)i.type===T.DgControl.fieldset.type&&n.push(i),i.contents?this.getAllControlsInLayout(i.contents,n):n.push(i)}}const xn=t.defineComponent({name:"FSplitterFormComponent",props:wn,emits:["cancel","submit"],setup(o,e){const n=t.ref(""),i=t.ref(),l=t.ref(o.data),a=t.ref([{field:"name",title:"名称"},{field:"bindingPath",title:"绑定字段"}]),{schemaService:r,formSchemaUtils:u}=o.designerHostService,s=new Ht.FNotifyService;s.globalConfig={position:"top-center"};const c={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},g={cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}};t.onBeforeMount(()=>{const k=u.getViewModelIdByComponentId(o.componentId),{name:M}=r.getTableInfoByViewModelId(k);n.value=M;const j=new Cn(o.designerHostService,o.componentId);l.value=j.buildFieldTreeData()});function v(){e.emit("cancel")}function x(){if(!n.value){s.warning({message:"请填写组件标题"});return}const k=i.value.getSelectedItems();if(!k.length){s.warning("请选择字段");return}e.emit("submit",{selections:k,componentTitle:n.value})}function w(k,M){const j=M.raw;return t.createVNode(t.Fragment,null,[j.isRemoved?t.createVNode("span",{title:"绑定字段不存在,请在视图模型中手动移除。"},[t.createTextVNode("绑定字段不存在。 ")]):"",j.isBindVariable?t.createVNode("span",null,[t.createTextVNode("变量:"),j.code,t.createTextVNode(" ")]):"",j.isNoBinding?t.createVNode("span",null,[t.createTextVNode("控件没有绑定信息 ")]):"",!j.isRemoved&&!j.isBindVariable&&!j.isComplexField?t.createVNode("span",null,[j.bindingField,t.createTextVNode(" ")]):""])}function C(k){var j;const M=(j=k.raw)==null?void 0:j.control;return t.createVNode(t.Fragment,null,[t.createVNode("span",null,[M.label||M.title||M.id,t.createTextVNode(" ")])])}return()=>t.createVNode("div",{class:"h-100 d-flex flex-column flex-fill"},[t.createVNode("div",{class:"f-section pt-3 pl-4"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode(" 组件信息 ")])])]),t.createVNode("div",{class:"f-section-content"},[t.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[t.createVNode("div",{class:"col-12 farris-group-wrap"},[t.createVNode("div",{class:"form-group farris-form-group"},[t.createVNode("label",{class:"col-form-label",style:"justify-content: start !important; width: 80px !important;"},[t.createVNode("span",{class:"farris-label-info text-danger"},[t.createTextVNode("*")]),t.createVNode("span",{class:"farris-label-text"},[t.createTextVNode(" 组件标题")])]),t.createVNode("div",{class:"farris-input-wrap"},[t.withDirectives(t.createVNode("input",{class:"form-control",type:"input","onUpdate:modelValue":k=>n.value=k},null),[[t.vModelText,n.value]])])])])])])]),t.createVNode("div",{class:"f-section pl-4 f-utils-fill"},[t.createVNode("div",{class:"f-section-header"},[t.createVNode("div",{class:"f-title"},[t.createVNode("h4",{class:"f-title-text"},[t.createTextVNode(" 组件字段 ")])])]),t.createVNode("div",{class:"f-section-content border f-utils-fill"},[t.createVNode(Gt,{key:1,ref:i,fit:!0,data:l.value,idField:"id",columns:a.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},selection:c,hierarchy:g},{cellTemplate:({cell:k,row:M})=>k.field==="bindingPath"?w(k,M):C(M)})])]),t.createVNode("div",{class:"modal-footer"},[t.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:v},[t.createTextVNode("取消")]),t.createVNode("button",{type:"button",class:"btn btn-primary",onClick:x},[t.createTextVNode("确定")])])])}});function Ot(){function o(){const n=i=>{const l=Math.random()*16|0;return(i==="x"?l:l&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n)}function e(n,i){const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[];let r;if(i=i||l.length,n)for(r=0;r<n;r++)a[r]=l[0|Math.random()*i];else{let u;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",r=0;r<36;r++)a[r]||(u=0|Math.random()*16,a[r]=l[r===19?u&3|8:u])}return a.join("")}return{guid:o,uuid:e}}const In=["moz","ms","webkit"];function Tn(){let o=0;return e=>{const n=new Date().getTime(),i=Math.max(0,16-(n-o)),l=setTimeout(()=>{e(n+i)},i);return o=n+i,l}}function Fn(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const o=In.filter(e=>`${e}RequestAnimationFrame`in window)[0];return o?window[`${o}RequestAnimationFrame`]:Tn()}Fn();function Sn(o,e){let n;const i=t.ref(""),l=t.ref([]),a=t.ref([]),r=t.ref([]),u=o.componentInstance.value.belongedComponentId;function s(f){f.forEach(y=>{y.isGroupNode||(y.isNoBinding||a.value.push(y.data.id),l.value.push(y.control))})}function c(f){var E;const y=o.componentInstance.value.schema;let p={};y.contents&&y.contents.length>0&&(p=y.contents.find(P=>P.type===T.DgControl.section.type)||{});const d=Object.assign({},p,{id:f+"-section",mainTitle:i.value,appearance:p.appearance?ye.cloneDeep(p.appearance):{class:"f-section-form f-section-in-mainsubcard"},contents:[]}),N=((E=p.contents)==null?void 0:E.find(P=>P.type===T.DgControl["response-form"].type))||{},O=$e.getSchemaByType(T.DgControl["response-form"].type);return Object.assign(O,N,{id:f+"-form",appearance:N.appearance?ye.cloneDeep(N.appearance):{class:"f-form-layout farris-form farris-form-controls-inline"},contents:l.value}),d.contents=[O],[d]}function g(f){var p;if(!((p=f.states)!=null&&p.length))return[];const y=[];return f.states.forEach(d=>{l.value.forEach(N=>{function O(E){Object.keys(E).forEach(P=>{const _=E[P];if(_&&_.type==="Variable"&&_.field===d.id){let K=y.find(D=>D.id===d.id);K||(K=Object.assign({},d,{newId:Ot().guid()}),y.push(K),r.value.push(d.id)),E[P].field=K.newId}})}O(N),N.editor&&O(N.editor)})}),y.map(d=>{d.id=d.newId,delete d.newId}),y}function v(f,y){const p=[];a.value.forEach(N=>{const O=y.fields.find(E=>E.id===N);p.push(Object.assign({},O,{groupId:null,groupName:null}))});const d=g(y);return{id:f+"-viewmodel",code:f+"-viewmodel",name:i.value,bindTo:y.bindTo,parent:y.parent,fields:p,commands:[],states:d,enableValidation:y.enableValidation}}function x(f,y,p){var E;if(!((E=o==null?void 0:o.parent)!=null&&E.parent)||!e)return;const N=o.parent.parent.componentInstance.value.schema;if(!(N!=null&&N.contents))return;const O=N.contents.findIndex(P=>P.component===u);if(O>-1){const{formSchemaUtils:P}=e;P.getComponents().push(f),P.getViewModels().push(p),N.contents.splice(O+1,0,y)}}function w(){if(!e)return;const f=o.componentInstance.value.schema,{schemaService:y,formSchemaUtils:p}=e,d=p.getViewModelIdByComponentId(u),N=p.getViewModelById(d),{code:O}=y.getTableInfoByViewModelId(d),E=O+"-"+Math.random().toString(36).slice(2,6),P=$e.getSchemaByType("component-ref");Object.assign(P,{id:E+"-component-ref",component:E+"-component"});const _=v(E,N),K=$e.getSchemaByType("component"),D=c(E);return Object.assign(K,{id:E+"-component",viewModel:E+"-viewmodel",componentType:f.componentType,appearance:f.appearance?ye.cloneDeep(f.appearance):null,formColumns:f.formColumns,contents:D}),x(K,P,_),_}function C(){if(!e)return;const{formSchemaUtils:f}=e,y=o.componentInstance.value.schema,p=l.value.map(N=>N.id),d=f.selectNode(y,N=>N.type===T.DgControl["response-form"].type);d.contents.forEach(N=>{N.type===T.DgControl.fieldset.type&&(N.contents=N.contents.filter(O=>!p.includes(O.id)))}),d.contents=d.contents.filter(N=>!(p.includes(N.id)||N.type===T.DgControl.fieldset.type&&N.contents&&N.contents.length===0))}function k(){if(!e)return;const{formSchemaUtils:f}=e,y=f.getViewModelIdByComponentId(u),p=f.getViewModelById(y);p&&p.fields&&(p.fields=p.fields.filter(d=>!a.value.includes(d.id)))}function M(f){if(!e)return;const{formSchemaUtils:y}=e,p=Ot().guid(),d=Object.assign({},f,{id:p,code:f.code+p.slice(0,4),name:f.name+p.slice(0,4)}),O=y.getCommands().find(E=>E.id===f.cmpId);return O&&O.refedHandlers.push({host:p,handler:f.handlerName}),d}function j(f){if(!e)return;const{formSchemaUtils:y}=e,p=y.getViewModelIdByComponentId(u),d=y.getViewModelById(p),N={};l.value.forEach(E=>{var K;const P=E.type==="form-group"&&E.editor?E.editor.type:E.type,_=(K=$e.schemaMap[P])==null?void 0:K.events;_&&Object.keys(E).forEach(D=>{const q=Object.keys(_).find(W=>W===D);if(q&&E[q]){const W=d.commands.find(z=>z.code===E[q]);if(W){let z=N[W.code];z||(z=M(W),N[W.code]=z,f.commands.push(z)),E[q]=z.code}}})});const O=["valueChanging","valueChanged"];f.fields.forEach(E=>{O.forEach(P=>{if(E[P]){const _=d.commands.find(K=>K.code===E[P]);if(N[_.code])E[P]=N[_.code].code;else{const K=M(_);N[_.code]=K,f.commands.push(K),E[P]=K.code}}})})}function S(f,y,p){if(f&&(y(f,p),f.contents))for(const d of f.contents)S(d,y,p)}function B(){if(!r.value.length)return;const f=e==null?void 0:e.formSchemaUtils,y=f.getComponentById(u),p=[],d=(E,P)=>{E&&(Object.keys(E).forEach(_=>{const K=E[_];K&&typeof K=="object"&&K.type===_t.FormBindingType.Variable&&r.value.includes(K.field)&&!P.includes(K.field)&&P.push(K.field)}),E.editor&&d(E.editor,P))};S(y,d,p);const N=f.getViewModelIdByComponentId(u),O=f.getViewModelById(N);r.value.forEach(E=>{p.includes(E)||(O.states=O.states.filter(P=>P.id!==E))})}function I(f){var d,N;const{selections:y}=f;i.value=f.componentTitle,s(y);const p=w();C(),k(),j(p),B(),(d=n==null?void 0:n.modalRef)!=null&&d.value.close&&((N=n==null?void 0:n.modalRef)==null||N.value.close()),T.canvasChanged.value++,t.nextTick(()=>{T.refreshCanvas()})}function m(){var f,y;(f=n==null?void 0:n.modalRef)!=null&&f.value.close&&((y=n==null?void 0:n.modalRef)==null||y.value.close())}function h(){if(e)return()=>t.createVNode(t.Fragment,null,[t.createVNode(xn,{componentId:o.componentInstance.value.belongedComponentId,designerHostService:e,onSubmit:I,onCancel:m},{default:()=>[t.createTextVNode(" ")]}),t.createTextVNode(" ")])}function F(f){f.stopPropagation(),f.preventDefault(),e&&(n=e.modalService.open({title:"拆分卡片",width:900,height:600,fitContent:!1,showButtons:!1,render:h(),enableEsc:!1,draggable:!0}))}return{openSplitComponentModal:F}}var We=(o=>(o.Frame="frame",o.dataGrid="data-grid",o.listView="list-view",o.form="form",o.uploader="uploader",o.calendar="calendar",o.page="page",o))(We||{});function Pt(o,e){const n=new T.UseTemplateDragAndDropRules,{canMove:i,canDelete:l}=n.getTemplateRule(o,e);function a(){return!1}function r(){return l}function u(){return i}function s(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function g(S){const B=new Xt(S,e),{schema:I}=o;return B.getPropertyConfig(I)}function v(){var h,F,f,y;const S=o==null?void 0:o.schema,I=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(S.id);if(S.componentType!=="data-grid"&&S.componentType!=="form"||!((h=o.componentInstance)!=null&&h.value.parent))return;const m=(F=o.componentInstance)==null?void 0:F.value.parent.schema;if((f=m==null?void 0:m.toolbar)!=null&&f.buttons&&m.toolbar.buttons.length){m.toolbar.buttons.forEach(d=>{const N=d.onClick,O=N&&N.split(".");if(!O||O.length<3)return;O[O.length-2]===I&&(d.needRemove=!0)}),m.toolbar.buttons=m.toolbar.buttons.filter(d=>!d.needRemove);const p=(y=o.componentInstance)==null?void 0:y.value.parent;p.parent&&p.parent.updateToolbarItems&&p.parent.updateToolbarItems()}}function x(){const S=e==null?void 0:e.designViewModelUtils,B=e==null?void 0:e.formSchemaUtils,I=o==null?void 0:o.schema;if(S&&B){const m=B.getViewModelIdByComponentId(I.id);S.deleteViewModelById(m),B.deleteComponent(I.id)}}function w(){const S=e==null?void 0:e.designViewModelUtils,B=e==null?void 0:e.formSchemaUtils,I=o==null?void 0:o.schema,m=B.getViewModelIdByComponentId(I.id),h=S.getDgViewModel(m);h!=null&&h.fields&&h.fields.forEach(F=>{const f=B.getExpressions();if(f!=null&&f.length){const y=f.findIndex(p=>p.target===F.id);y>-1&&B.getExpressions().splice(y,1)}})}function C(){v(),w(),x()}function k(){const{schema:S}=o,B=[];return S.componentType==="form"&&B.push({id:"splitFormComponent",title:"拆分卡片",icon:"f-icon fd-i-Family fd_pc-split-card",onClick:I=>{Sn(o,e).openSplitComponentModal(I)}},{id:"addSiblingComponent",title:"添加同级卡片",icon:"f-icon f-icon-plus",onClick:I=>{bn(o,e).addSiblingComponent(I)}}),B}function M(){if(!e||!(o!=null&&o.schema))return"组件";switch(o.schema.componentType){case We.Frame:return"根组件";case We.dataGrid:{const{formSchemaUtils:S}=e;return`${S.selectNode(o.schema,m=>m.type===st["tree-grid"].type)?"树表格":"表格"}组件`}case We.uploader:return"附件组件";case We.listView:return"列表视图组件";case We.calendar:return"日历组件";default:return"组件"}}function j(){var S,B,I;if(o&&e){const{formSchemaUtils:m}=e;let h="",F="";const f=m.getRootViewModelId(),y=m.getComponentByViewModelId(f),p=m.selectNode(y,N=>N.contents&&N.contents.find(O=>O.component===o.schema.id));(p==null?void 0:p.type)===((S=st["tab-page"])==null?void 0:S.type)&&((B=p==null?void 0:p.contents)!=null&&B.length)&&(h=p.title||""),(p==null?void 0:p.type)===((I=st.section)==null?void 0:I.type)&&(p==null?void 0:p.showHeader)!==!1&&(h=p.mainTitle||""),h=h?`${h} > `:"",F=h?p.id:"";const d=M();m.getControlBasicInfoMap().set(o.schema.id,{componentTitle:d,parentPathName:`${h}${d}`,reliedComponentId:F})}}return{canAccepts:a,checkCanDeleteComponent:r,checkCanMoveComponent:u,hideNestedPaddingInDesginerView:s,getStyles:c,getPropsConfig:g,onRemoveComponent:C,getCustomButtons:k,setComponentBasicInfoMap:j}}const Vn=t.defineComponent({name:"FComponetDesign",props:Ge.componentProps,emits:["init","afterViewInit"],setup(o,e){const n=t.ref(),i=t.inject("designer-host-service"),l=t.inject("design-item-context"),a=Pt(l,i),r=T.useDesignerComponent(n,l,a),u=t.computed(()=>{const s={"drag-container":!0};return Ee.getCustomClass(s,o==null?void 0:o.customClass)});return t.onMounted(()=>{var s,c,g,v;n.value.componentInstance=r,((c=(s=l.parent)==null?void 0:s.schema)==null?void 0:c.type)==="component-ref"&&(r.value.parent=(v=(g=l.parent)==null?void 0:g.parent)==null?void 0:v.componentInstance)}),e.expose(r.value),()=>t.createVNode("div",{ref:n,class:u.value,style:o.customStyle,"data-dragref":`${l.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),Nn={install(o){o.component(ft.name,ft)}};Z.Component=ft,Z.ComponentDesign=Vn,Z.componentProps=Et,Z.default=Nn,Z.useDesignerRules=Pt,Object.defineProperties(Z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});