@farris/ui-vue 1.6.5 → 1.6.6

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 (108) hide show
  1. package/components/avatar/index.esm.js +1 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/button-edit/index.esm.js +2 -2
  4. package/components/button-edit/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +7 -5
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/common/index.esm.js +1 -1
  8. package/components/common/index.umd.cjs +1 -1
  9. package/components/component/index.esm.js +1 -1
  10. package/components/component/index.umd.cjs +1 -1
  11. package/components/condition/index.esm.js +3 -2
  12. package/components/condition/index.umd.cjs +1 -1
  13. package/components/content-container/index.esm.js +1 -1
  14. package/components/content-container/index.umd.cjs +1 -1
  15. package/components/data-view/index.esm.js +498 -495
  16. package/components/data-view/index.umd.cjs +1 -1
  17. package/components/date-picker/index.esm.js +833 -832
  18. package/components/date-picker/index.umd.cjs +1 -1
  19. package/components/designer-canvas/index.esm.js +1 -1
  20. package/components/designer-canvas/index.umd.cjs +1 -1
  21. package/components/dynamic-form/index.esm.js +3 -2
  22. package/components/dynamic-form/index.umd.cjs +1 -1
  23. package/components/events-editor/index.esm.js +1 -1
  24. package/components/events-editor/index.umd.cjs +1 -1
  25. package/components/expression-editor/index.esm.js +256 -254
  26. package/components/expression-editor/index.umd.cjs +2 -2
  27. package/components/filter-bar/index.esm.js +416 -394
  28. package/components/filter-bar/index.umd.cjs +1 -1
  29. package/components/filter-condition-editor/index.esm.js +388 -386
  30. package/components/filter-condition-editor/index.umd.cjs +1 -1
  31. package/components/flow-canvas/index.esm.js +1 -1
  32. package/components/flow-canvas/index.umd.cjs +1 -1
  33. package/components/language-textbox/index.esm.js +77 -76
  34. package/components/language-textbox/index.umd.cjs +1 -1
  35. package/components/list-nav/index.esm.js +4 -2
  36. package/components/list-nav/index.umd.cjs +1 -1
  37. package/components/lookup/index.esm.js +118 -118
  38. package/components/lookup/index.umd.cjs +1 -1
  39. package/components/mapping-editor/index.esm.js +80 -81
  40. package/components/mapping-editor/index.umd.cjs +1 -1
  41. package/components/message-box/index.esm.js +237 -237
  42. package/components/message-box/index.umd.cjs +1 -1
  43. package/components/modal/index.esm.js +1 -1
  44. package/components/modal/index.umd.cjs +1 -1
  45. package/components/number-range/index.esm.js +1 -1
  46. package/components/number-range/index.umd.cjs +1 -1
  47. package/components/number-spinner/index.esm.js +9 -3
  48. package/components/number-spinner/index.umd.cjs +1 -1
  49. package/components/order/index.esm.js +114 -112
  50. package/components/order/index.umd.cjs +1 -1
  51. package/components/page-header/index.esm.js +1 -1
  52. package/components/page-header/index.umd.cjs +1 -1
  53. package/components/property-panel/index.esm.js +1 -1
  54. package/components/property-panel/index.umd.cjs +1 -1
  55. package/components/query-solution/index.esm.js +485 -463
  56. package/components/query-solution/index.umd.cjs +3 -3
  57. package/components/radio-group/index.esm.js +30 -30
  58. package/components/radio-group/index.umd.cjs +1 -1
  59. package/components/response-layout/index.esm.js +1 -1
  60. package/components/response-layout/index.umd.cjs +1 -1
  61. package/components/response-layout-editor/index.esm.js +544 -545
  62. package/components/response-layout-editor/index.umd.cjs +1 -1
  63. package/components/response-toolbar/index.esm.js +1 -1
  64. package/components/response-toolbar/index.umd.cjs +1 -1
  65. package/components/schema-selector/index.esm.js +6 -4
  66. package/components/schema-selector/index.umd.cjs +2 -2
  67. package/components/section/index.esm.js +1 -1
  68. package/components/section/index.umd.cjs +1 -1
  69. package/components/sort-condition-editor/index.esm.js +9 -7
  70. package/components/sort-condition-editor/index.umd.cjs +1 -1
  71. package/components/switch/index.esm.js +77 -78
  72. package/components/switch/index.umd.cjs +1 -1
  73. package/components/tabs/index.esm.js +5 -3
  74. package/components/tabs/index.umd.cjs +1 -1
  75. package/components/textarea/index.esm.js +1 -1
  76. package/components/textarea/index.umd.cjs +1 -1
  77. package/components/time-picker/index.esm.js +2 -2
  78. package/components/time-picker/index.umd.cjs +1 -1
  79. package/components/video/index.esm.js +1 -1
  80. package/components/video/index.umd.cjs +1 -1
  81. package/designer/button-edit/index.esm.js +211 -211
  82. package/designer/button-edit/index.umd.cjs +1 -1
  83. package/designer/checkbox/index.esm.js +1 -1
  84. package/designer/checkbox/index.umd.cjs +1 -1
  85. package/designer/checkbox-group/index.esm.js +25 -26
  86. package/designer/checkbox-group/index.umd.cjs +1 -1
  87. package/designer/data-grid/index.esm.js +15 -9
  88. package/designer/data-grid/index.umd.cjs +2 -2
  89. package/designer/farris-designer.all.esm.js +917 -916
  90. package/designer/farris-designer.all.umd.cjs +5 -5
  91. package/designer/input-group/index.esm.js +2 -1
  92. package/designer/input-group/index.umd.cjs +1 -1
  93. package/designer/list-view/index.esm.js +685 -689
  94. package/designer/list-view/index.umd.cjs +3 -3
  95. package/designer/radio-group/index.esm.js +7 -3
  96. package/designer/radio-group/index.umd.cjs +1 -1
  97. package/farris.all.esm.js +5641 -5603
  98. package/farris.all.umd.cjs +21 -21
  99. package/locales/data-grid/ui/en.json +2 -1
  100. package/locales/data-grid/ui/zh-CHS.json +2 -1
  101. package/locales/data-grid/ui/zh-CHT.json +2 -1
  102. package/locales/designer/en.json +2 -1
  103. package/locales/designer/zh-CHS.json +2 -1
  104. package/locales/designer/zh-CHT.json +2 -1
  105. package/locales/ui/en.json +2 -1
  106. package/locales/ui/zh-CHS.json +2 -1
  107. package/locales/ui/zh-CHT.json +2 -1
  108. package/package.json +1 -1
@@ -3,4 +3,4 @@
3
3
  <div style="color: black; ">${t.elementConfig.propertyName}</div>
4
4
  <div style="color: gray; ">ID:${t.elementConfig.propertyID}</div>
5
5
  ${l}
6
- </div>`,placement:"left"}),g=o.ref("");return g.value=`${e.value}-${r.value}`,()=>o.createVNode("div",{class:s.value},[t.elementConfig.propertyName&&o.withDirectives(o.createVNode("label",{class:`col-form-label ${g.value}`},[o.createVNode("span",{class:"farris-label-text"},[i.value])]),[[o.resolveDirective("tooltip"),d]]),o.createVNode(pr,{id:g.value,showLabel:!1,editor:t.elementConfig.editor,modelValue:a.value,onChange:f,editorParams:t.elementConfig.editorParams},null)])}}),gr=o.defineComponent({name:"FPropertyPanelItemList",props:nr,emits:["valueChanged","submitModal","triggerRefreshPanel"],setup(t,n){const e=o.ref(t.category);function r(u){if(!u.hideCascadeTitle)return o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("input",{title:"summary",type:"input",class:"form-control form-control-sm",value:u.cascadeSummary,readonly:!0},null)])}function i(u,p){p.isExpand=!p.isExpand}function a(u){return o.createVNode("div",{class:"landscape"},[o.createVNode("button",{title:"expand-button",class:["btn f-btn-collapse-expand f-btn-mx px-1",{"f-state-expand":u.isExpand}],onClick:p=>i(p,u)},[o.createVNode("span",null,null)])])}function s(u){return o.createVNode("div",{class:`f-section-formgroup-legend ${e.value.categoryId}-${u.propertyID}`},[o.createVNode("div",{class:"f-header px-0 my-0 col-form-label",style:"font-size: inherit;"},[o.createVNode("div",{class:"wrap"},[o.createVNode("span",{class:["f-icon mr-1",{"f-icon-arrow-60-right":!u.isExpand,"f-icon-arrow-60-down":u.isExpand}]},null),o.createVNode("span",{class:"farris-label-text"},[u.propertyName])])])])}function f(u){return`${t.categoryKey}_${u.propertyID}`}function l(u,p){u.categoryId=e.value.categoryId,e.value.enableCascade&&(u.propertyPath=e.value.parentPropertyID),e.value.setPropertyRelates&&e.value.setPropertyRelates(u,t.propertyData,p),n.emit("valueChanged",{changeObject:u})}function d(){n.emit("triggerRefreshPanel")}function g(u){return o.createVNode("div",{class:"px-2 mb-2"},[o.createVNode(mr,{key:f(u),elementConfig:u,category:e.value,onPropertyChange:l,onTriggerRefreshPanel:d},null)])}function c(u){var p;return o.createVNode("div",{class:"propertyCascadeItem farris-panel px-2 mb-2"},[o.createVNode("div",{class:["farris-panel-item card",{hidden:!u.isExpand}]},[o.createVNode("div",{class:"card-header",onClick:h=>i(h,u)},[o.createVNode("div",{class:"panel-item-title"},[o.createVNode("div",{class:"form-group farris-form-group line-item"},[s(u),r(u),a(u)])])]),o.createVNode("div",{class:["card-body",{hidden:!u.isExpand}]},[(p=u.cascadeConfig)==null?void 0:p.map(h=>g(h))])])])}o.watch(()=>t.category,()=>{e.value=t.category});function m(u){return u.propertyType==="cascade"?c:g}return()=>o.createVNode(o.Fragment,null,[e.value.properties.map(u=>m(u)(u))])}}),xt=o.defineComponent({name:"FPropertyPanel",props:Dt,emits:["propertyChanged"],setup(t,n){const e=o.ref(t.width),r=o.ref(t.isWidePanel),i=o.ref(t.enableSearch),a=o.ref(t.mode),s=o.ref(t.isPersitOpenState),f=o.ref(t.isShowPanel),l=o.ref(),d=o.ref(),g=o.ref(t.showCloseBtn),c=o.ref(t.selectedTabId),m=o.ref(!0),u=o.ref(t.isWhiteTheme);let p=[],h=[];const y=o.ref(""),T=o.ref(),E=o.ref(),D=o.inject("SchemaService");let N=[],x=null,b="";const C=o.ref(),w=o.ref(0),V=o.computed(()=>p.map(G=>!G.hide).length===1),O=o.inject("designerContext");function S(){h=[],C.value&&C.value.categoryList&&Array.isArray(C.value.categoryList)&&C.value.categoryList.length>0&&C.value.categoryList.forEach(X=>{if(X.properties&&Array.isArray(X.properties)&&X.properties.length>0){const _=X.properties.map(ie=>(ie.category=X,ie.propertyType==="cascade"&&ie.cascadeConfig&&ie.cascadeConfig.map(ue=>{ue.category=X,ue.cascadeParent=ie,h=h.concat(ue)}),ie));h=h.concat(_)}})}function Y(G){let X=G.offsetTop,_=G.offsetParent;for(;_!==null;)X+=_.offsetTop,_=_.offsetParent;return X}function W(G,X){G&&X&&Object.keys(X).length>0&&Object.keys(X).forEach(_=>{var ue;const ie=X[_];(ue=G.style)==null||ue.setProperty(_,ie)})}function z(){return h.filter(X=>{if(typeof X.visible=="function"&&!X.visible()||typeof X.visible=="boolean"&&!X.visible)return!1;const _=X.propertyID.toLowerCase(),ie=X.propertyName.toLowerCase();return!!(_&&_.includes(y.value.toLowerCase())||ie&&ie.includes(y.value.toLowerCase()))})}function J(G,X,_){if(G===0){const ie=Y(X),Ne=Y(_)-ie-5;X==null||X.scroll({top:Ne,behavior:"smooth"})}}function oe(G){N&&N.length>0&&(N.forEach(_=>{_.style.cssText=""}),N=[]);const X=E.value;if(!y.value)T.value&&X&&(X.scrollTop=0);else if(S(),h&&h.length>0){const _=z();_&&_.length>0&&setTimeout(()=>{let ie=null,ue=-1,Ne=!1;_.forEach((Te,Xe)=>{const I=Te.propertyType==="cascade"?`.${Te.category.categoryId}-${Te.propertyID} .farris-label-text`:`.property-item .${Te.category.categoryId}-${Te.propertyID}.col-form-label`,te=document.querySelector(I);te&&(Te.category.status!=="open"&&(Te.category.status="open",Ne=ue<0),Te.cascadeParent&&(Te.cascadeParent.isExpand=!0),ue<0&&(ie=te,ue=Xe),W(te,{color:"#5B89FE"}),N.push(te))}),ue>-1&&(Ne?o.nextTick(()=>{J(ue,X,ie)}):J(ue,X,ie))},50)}}function fe(G){oe()}const R=me.debounce(fe,200);function M(G){const{value:X}=G.target;R(X)}function K(G){fe(y.value)}function A(){s.value||(m.value=!1),n.emit("closePropertyPanel")}function ae(G){y.value="",oe()}function Ce(G){!G.status||G.status==="open"?G.status="closed":G.status="open"}function ge(){var G,X;if(p=[],!l.value||l.value.length===0){p=[{tabId:"default",tabName:"属性",categoryList:[]}],C.value=null;return}if((G=l==null?void 0:l.value)==null||G.forEach(_=>{if(_.tabId){const ie=p.find(ue=>ue.tabId===_.tabId);ie?(ie.categoryList.push(_),ie.hide&&(ie.hide=_.hide||_.properties.length===0)):p.push({tabId:_.tabId,tabName:_.tabName,categoryList:[_],hide:_.hide||_.properties.length===0})}else{const ie=p.find(ue=>ue.tabId==="default");ie?ie.categoryList.push(_):p.push({tabId:"default",tabName:"属性",categoryList:[_]})}}),c.value){const _=p==null?void 0:p.find(ie=>ie.tabId===c.value&&!ie.hide);C.value=_||p[0]}else C.value=p[0];c.value=(X=C.value)==null?void 0:X.tabId}o.watch(()=>[t.schema,t.isShowPanel],()=>{d.value=t.schema,!t.schema||!t.schema.type?l.value=[]:(l.value=bt(d.value,D,x,b),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value))),ge(),ae(y.value),w.value++}),o.onMounted(()=>{ge()});function ee(G,X,_=!0){(!d.value||X)&&(d.value=X||t.schema),l.value=bt(d.value,D,x,b,G),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value)),ge(),i.value&&ae(y.value),_&&w.value++}function pe(G,X){x=G,b=X}function he(){a.value=a.value==="panel"?"sidebar":"panel",a.value==="panel"?(setTimeout(()=>{fe()},100),e.value="300px"):e.value="41px"}function le(){if(g.value)return o.createVNode("div",{class:"title-actions"},[o.createVNode("div",{class:"monaco-toolbar"},[o.createVNode("div",{class:"monaco-action-bar animated"},[o.createVNode("ul",{class:"actions-container",role:"toolbar"},[o.createVNode("li",{class:"action-item",onClick:A},[o.createVNode("span",{class:"f-icon f-icon-close"},null)])])])])])}function U(){l.value=bt(d.value,D,x,b),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value)),ge()}function de(){var G;if(i.value&&((G=C.value)==null?void 0:G.tabId)!=="commands")return o.createVNode("div",{class:"search"},[o.createVNode("div",{class:"input-group f-state-editable border-left-0 border-right-0"},[o.withDirectives(o.createVNode("input",{class:"form-control f-utils-fill text-left pt-3 pb-3 textbox",type:"text",placeholder:"输入属性名称或编号快速定位",autocomplete:"off",onKeyup:X=>M(X),"onUpdate:modelValue":X=>y.value=X},null),[[o.vModelText,y.value]]),o.createVNode("div",{class:"input-group-append",style:"margin-left: 0px; background:none;"},[o.createVNode("span",{class:"input-group-text input-group-clear",style:[{display:y.value&&y.value.length>0?"":"none"}],onClick:X=>ae()},[o.createVNode("i",{class:"f-icon modal_close"},null)]),o.createVNode("span",{class:"input-group-text input-group-clear",onClick:X=>K()},[o.createVNode("i",{class:"f-icon f-icon-search"},null)])])])])}function Ae(G){return`${t.propertyName}_${G.categoryId}`}function $e(G){n.emit("propertyChanged",{...G,designerItem:x})}function Be(){var G,X;if(C.value)return o.createVNode("div",{class:"panel-body",ref:E},[o.createVNode("ul",{class:["property-grid",{"wide-panel":r.value}]},[(X=(G=C.value)==null?void 0:G.categoryList)==null?void 0:X.map(_=>!_.hide&&o.createVNode("li",{key:Ae(_),"data-category-id":_==null?void 0:_.categoryId},[!_.hideTitle&&o.createVNode("span",{class:"group-label",onClick:()=>Ce(_)},[o.createVNode("span",{class:["f-icon mr-2",{"f-legend-show":_.status==="closed"},{"f-legend-collapse":_.status==="open"||_.status===void 0}]},null),_.categoryName]),o.createVNode("div",{hidden:_.status==="closed"},[o.createVNode(gr,{key:`${_==null?void 0:_.categoryId}-${w.value}`,category:_,propertyData:d.value,onTriggerRefreshPanel:U,onValueChanged:$e},null)])]))])])}function We(){if(a.value==="sidebar")return o.createVNode("div",{class:"side-panel h-100",onClick:he},[o.createVNode("i",{class:"f-icon f-icon-engineering w-100 icon"},null),o.createVNode("span",null,[o.createTextVNode("属性")])])}function ze(){return{display:m.value?"block":"none",width:e.value}}function Ge(){return o.createVNode("div",{class:"switcher"},[o.createVNode("i",{class:"f-icon f-icon-exhale-discount",style:[{transform:a.value==="sidebar"?"none":"rotate(180deg)"}],onClick:he},null)])}function ye(G){C.value&&C.value.tabId===G.tabId||(C.value=G,c.value=C.value.tabId,y.value="")}function Qe(){return p.map(G=>o.createVNode("div",{class:["title-label",{active:C.value&&C.value.tabId===G.tabId},{"d-none":G.hide}],onClick:()=>ye(G)},[o.createVNode("span",null,[G.tabName])]))}o.onMounted(()=>{fe(y.value)}),o.onBeforeMount(()=>{s.value&&(m.value=f.value),ge(),fe(y.value)});function Le(){w.value++}function qe(){U()}return n.expose({updatePropertyConfig:ee,updateDesignerItem:pe,reloadPropertyPanel:Le,refreshPanel:qe}),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{ref:T,class:["property-panel",{"white-theme":u.value}],style:ze()},[o.createVNode("div",{class:"propertyPanel panel flex-column",hidden:a.value!=="panel"},[o.createVNode("div",{class:["title d-flex",{"p-right":g.value},{only:V.value}]},[Qe(),le()]),de(),Be()]),Ge(),We()])])}}),hr=o.ref(0);function yr(){hr.value++}const dt=o.ref(0);function vr(t){const{formSchemaUtils:n,formStateMachineUtils:e}=t;function r(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function i(l,d=""){return n.getViewModelById(l).states.map(c=>r(c,d))}function a(l){const d=n.getRootViewModelId(),g=i(l);if(l===d)return g;const c=i(d,"root-component.");return[...g,...c]}function s(l){return l.binding&&l.binding.path||l.id||""}function f(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:f}}class wt{constructor(n){Z(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'"}]);Z(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Z(this,"getExpressionConverter",(n,e)=>({convertFrom:(r,i,a,s)=>{const f=a.getExpressionRuleValue(n,e||i);return f&&f.value||""},convertTo:(r,i,a,s,f)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const d=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(c=>c.id===d&&c.value))?r.dictPickingExpressionId=d:delete r.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=n}getExpressionRule(n,e){const r=this.formSchemaService.getExpressions();if(!r)return"";const i=r.find(s=>s.target===n);if(!i)return"";const a=i.rules.find(s=>s.type===e);return a||""}getContextFormVariables(){const{module:n}=this.formSchemaService.getFormSchema();if(!n.viewmodels||n.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),r=this.formSchemaService.getViewModelById(e);if(!r||!r.states||r.states.length===0)return[];const i=[];return r.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(n,e,r="label"){return{id:n.id,name:n.name,bindingPath:n[r],parents:e,type:"field"}}buildEntityFieldsTreeData(n=null,e){const r=[];return n==null||n.forEach(i=>{var f;const a=this.createTreeNode(i,e);let s=[];(f=i.type)!=null&&f.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...e,i.label])),r.push({data:a,children:s,expanded:!0})}),r}buildChildEntityTreeData(n=null,e){const r=[];return n==null||n.forEach(i=>{var l,d;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...e,i.label]),f=this.buildChildEntityTreeData((d=i.type)==null?void 0:d.entities,[...e,i.label]);f!=null&&f.length&&(s==null||s.push(...f)),r.push({data:a,children:s||[],expanded:!0})}),r}getEntitiesTreeData(){const n=this.formSchemaService.getSchemaEntities();if(!(n!=null&&n.length))return[];const e=n[0];if(!(e!=null&&e.type))return[];const r=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),i=this.buildChildEntityTreeData(e.type.entities,[e.code]);return i!=null&&i.length&&(r==null||r.push(...i)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:r||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(n,e,r){const i=r==="Field"?n.binding.field:n.id,a=this.getExpressionRule(i,e),s=this.getEntitiesAndVariables(),f={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(f.messageType=a.messageType),f}buildRule(n,e,r,i){const{expression:a,message:s,messageType:f}=e,l={id:`${n}_${r}`,type:r,value:a};return(r==="validate"||r==="dataPicking"||r==="required")&&(l.message=s),r==="dataPicking"&&(l.messageType=f),r==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:n}=this.formSchemaService.getFormSchema().module;return n||[]}updateExpression(n,e,r,i){const a=e==="Field"?n.binding.field:n.id,s=this.buildRule(a,r,i,n.type==="form-group"?n.id:"");let l=this.getExpressionData().find(g=>g.targetType===e&&g.target===a);const d=g=>g.value.trim()==="";if(l){const g=l.rules.find(c=>c.id===s.id);if(g)d(s)?l.rules=l.rules.filter(c=>c.id!==s.id):(Object.assign(g,s),i==="validate"&&n.type==="form-group"&&(g.elementId=n.id));else{if(d(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(d(s))return null;l={target:`${a}`,rules:[s],targetType:e}}return l}getExpressionEditorOptions(n,e,r,i){return r.reduce((a,s)=>{var l,d;const f=e==="Field"?(l=n==null?void 0:n.binding)==null?void 0:l.field:n.id;return a[s]={hide:e==="Field"?!!((d=n==null?void 0:n.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(f),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(n,s,e),onSubmitModal:g=>{const c=this.updateExpression(n,e,g,s);if(i){const m=this.buildRule(f,g,s);i(m)}return c}}},a},{})}getExpressionInfo(n,e,r){const i=e==="Field"?n.binding.field:n.id,a=this.getExpressionRule(i,r),s={value:a&&a.value,targetId:i,targetType:e,expressionType:r};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(n,e,r=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",hide:!n.binding,properties:{...this.getExpressionEditorOptions(n,e,r,i)}}}getExpressionOptions(n,e,r){const i=this.getExpressionInfo(n,e,r);return{dialogTitle:`${this.expressionNames[r]}编辑器`,singleExpand:!1,showMessage:r==="required",beforeOpen:()=>this.onBeforeOpenExpression(n,r,e),expressionInfo:i}}}class nn{constructor(n,e){Z(this,"componentId");Z(this,"viewModelId");Z(this,"eventsEditorUtils");Z(this,"formSchemaUtils");Z(this,"formMetadataConverter");Z(this,"designViewModelUtils");Z(this,"designViewModelField");Z(this,"controlCreatorUtils");Z(this,"designerHostService");Z(this,"designerContext");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=n,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(n))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext}getFormDesignerInstance(){var n,e;return(e=(n=this.designerContext)==null?void 0:n.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var n;return(n=this.schemaService)==null?void 0:n.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(n){var r;const e=n.binding&&n.binding.type==="Form"&&n.binding.field;if(e){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===e)}n.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}getBasicPropConfig(n){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:n.type,name:P[n.type]&&P[n.type].name}]}}}}}getAppearanceConfig(n=null,e={},r){const i={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 s in e)a[s]=Object.assign(a[s]||{},e[s]);return{...i,properties:{...a},setPropertyRelates(s,f){if(s){switch(s&&s.propertyID){case"class":case"style":{dt.value++;break}}r&&r(s,n,f)}}}}getPropertyEditorParams(n,e=[],r="visible",i={},a={},s=""){const{getVariables:f,getControlName:l,getStateMachines:d}=vr(this.designerHostService),g=this.getRealTargetType(n),c=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],m={type:"property-editor",propertyTypes:c};return c.map(u=>{switch(u){case"Const":Object.assign(m,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":m.expressionConfig=this.getExpressionOptions(n,g,s||r);break;case"StateMachine":m.stateMachines=d();break;case"Variable":Object.assign(m,{controlName:l(n),newVariablePrefix:"is",newVariableType:"Boolean",variables:f(this.viewModelId),onBeforeOpenVariables:p=>{p.value=f(this.viewModelId)}},a);break}}),m}getVisibleProperty(n,e=""){var a;let r=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?r=["Const","Expression"]:e==="form-group"&&!((a=n.binding)!=null&&a.field)&&(r=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(n,r,"visible")}}}getBehaviorConfig(n,e="",r={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(n,e);for(const l in r)s[l]=Object.assign(s[l]||{},r[l]);const f=this;return{...a,properties:{...s},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":f.afterMutilEditorChanged(n,l);break}i&&i(l,d)}}}}afterMutilEditorChanged(n,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,n)}updateElementByParentContainer(n,e){const r=e&&e.parent&&e.parent.schema;if(!r)return;const i=r.contents.findIndex(s=>s.id===n),a=me.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a),yr()}addNewVariableToViewModel(n,e){const r=n.propertyValue;if(!(r&&typeof r=="object")||!(r.type==="Variable"&&r.isNewVariable))return;const s={id:r.field,category:"locale",code:r.fullPath,name:r.fullPath,type:r.newVariableType||"String"};delete r.newVariableType,delete r.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(e).states.push(s)}updateExpressionValue(n){const e=n.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:a,expressionInfo:s}=e,{targetId:f,targetType:l,expressionType:d,value:g,message:c}=s,m=this.formSchemaUtils.getModule();m.expressions=m.expressions||[];const{expressions:u}=m;let p=u.find(y=>y.target===f);p||(p={target:f,rules:[],targetType:l},u.push(p));const h=p.rules.find(y=>y.type===d);if(h)h.value=g,h.message=c;else{const y={id:a,type:d,value:g,message:c};p.rules.push(y)}delete e.expressionInfo}clearExpression(n,e){const r=n.propertyValue;if(r&&r.type==="Expression")return;const a=n.propertyID,s=this.formSchemaUtils.getExpressions(),f=e.binding?e.binding.field:e.id,l=s.find(d=>d.target===f);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==a))}getExpressionOptions(n,e,r){return new wt(this.formSchemaUtils).getExpressionOptions(n,e,r)}getRealTargetType(n){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(n.type)>-1?"Button":n.binding&&n.binding.field?"Field":"Container"}createBaseEventProperty(n){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:n,viewSourceHandle:r=>{var i;((i=r.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(r)}}},e}}const tt=class tt{static getEditorTypesByMDataType(n,e=!1,r=""){if(e)return[{key:P["language-textbox"].type,value:P["language-textbox"].name}];let i=tt.fieldControlTypeMapping[n];if(r==="data-grid-column"&&(i!=null&&i.length)){const a=[P["check-group"].type,P["radio-group"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const n=[];for(const e in tt.fieldControlTypeMapping)tt.fieldControlTypeMapping[e].forEach(r=>{n.find(i=>i.key===r.key&&i.value===r.value)||n.push({key:r.key,value:r.value})});return n}static mappingDomPropAndSchemaProp(n,e){var a;const r=(a=n.editor)==null?void 0:a.type,i=[];return(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(r===P["input-group"].type||r===P.textarea.type||r===P["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),r===P["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(r===P["combo-list"].type||r===P["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),r===P["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),r===P["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),r===P.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};Z(tt,"fieldControlTypeMapping",{String:[{key:P["input-group"].type,value:P["input-group"].name},{key:P.lookup.type,value:P.lookup.name},{key:P["date-picker"].type,value:P["date-picker"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name},{key:P["check-group"].type,value:P["check-group"].name},{key:P["radio-group"].type,value:P["radio-group"].name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P.textarea.type,value:P.textarea.name},{key:P["time-picker"].type,value:P["time-picker"].name}],Text:[{key:P.textarea.type,value:P.textarea.name},{key:P.lookup.type,value:P.lookup.name}],Decimal:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Integer:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Number:[{key:P["number-spinner"].type,value:P["number-spinner"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],BigNumber:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Date:[{key:P["date-picker"].type,value:P["date-picker"].name}],DateTime:[{key:P["date-picker"].type,value:P["date-picker"].name}],Boolean:[{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],Enum:[{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}],Object:[{key:P.lookup.type,value:P.lookup.name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}]});let nt=tt;var on=(t=>(t.string="string",t.boolean="boolean",t.number="number",t.select="select",t.boolOrExp="boolOrExp",t.editableSelect="editableSelect",t.multiSelect="multiSelect",t.date="date",t.datetime="datetime",t.modal="modal",t.cascade="cascade",t.custom="custom",t.unity="unity",t.events="events",t.switch="switch",t.multiLanguage="multiLanguage",t))(on||{}),ot=(t=>(t.Form="Form",t.Variable="Variable",t))(ot||{});class br{constructor(){Z(this,"label","");Z(this,"id","");Z(this,"columnInSM",12);Z(this,"columnInMD",6);Z(this,"columnInLG",3);Z(this,"columnInEL",2);Z(this,"displayWidthInSM",1);Z(this,"displayWidthInMD",1);Z(this,"displayWidthInLG",1);Z(this,"displayWidthInEL",1);Z(this,"displayColumnCountAtBreakPoint","md");Z(this,"tagRow",0);Z(this,"showTopBorder",0);Z(this,"group",1);Z(this,"isSupportedClass",!0);Z(this,"fieldSetId","")}}function Cr(t){let n,e;const r=new Map;let i=[];function a(g,c){const u=g.split(" ").filter(E=>E.startsWith("col-"));if(u.length===0){c.isSupportedClass=!1;return}let p=u.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),h=u.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),y=u.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),T=u.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),h=h||"col-md-"+c.columnInSM,c.columnInMD=parseInt(h.replace("col-md-",""),10),c.displayWidthInMD=c.columnInMD/6,[1,2].includes(c.displayWidthInMD)||(c.isSupportedClass=!1),y=y||"col-xl-"+c.columnInMD,c.columnInLG=parseInt(y.replace("col-xl-",""),10),c.displayWidthInLG=c.columnInLG/3,[1,2,3,4].includes(c.displayWidthInLG)||(c.isSupportedClass=!1),T=T||"col-el-"+c.columnInLG,c.columnInEL=parseInt(T.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function s(g,c,m,u=!1){let p=!1;g.contents.forEach(h=>{if(h.type==="fieldset"){m+=1,s(h,c,m,!0),p=!0;return}p&&(m+=1,p=!1);const y=h.appearance&&h.appearance.class,T=new br;y?a(y,T):T.isSupportedClass=!1,T.label=h.label||h.id,T.id=h.id,T.group=m,u&&(T.fieldSetId=g.id),e===h.id&&(n=m),r.set(h.id,h),c.push(T)})}function f(g){const c=t.getComponentById(g);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const m=t.selectNode(c,u=>u.type===qt.DgControl["response-form"].type);return!m||!m.contents||m.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:m}}function l(g,c){c=c||g.id;const{result:m,message:u,formNode:p}=f(c);if(!m)return{result:m,message:u};e=g.id,i=[],r.clear();const h=p.contents[0].type===qt.DgControl.fieldset.type?0:1;s(p,i,h);const y=i.find(E=>!E.isSupportedClass);return{defaultState:{defaultGroupNumber:n||1,model:y?"customize":"standard"},importData:i}}function d(g,c){c=c;const{result:m,formNode:u}=f(c);if(!m)return"";const p=[];return g.forEach(h=>{var E;const y=r.get(h.id),T=y.appearance&&y.appearance.class;if(T){const N=T.split(" ").filter(O=>!O.startsWith("col-")),x="col-"+h.columnInSM,b="col-md-"+h.columnInMD,C="col-xl-"+h.columnInLG,w="col-el-"+h.columnInEL,V=[x,b,C,w].concat(N);y.appearance.class=V.join(" ")}if(h.fieldSetId){const D=u.contents.find(x=>x.id===h.fieldSetId),N=p.find(x=>x.id===h.fieldSetId);N?(E=N.contents)==null||E.push(y):(p.push(D),D.contents=[y])}else p.push(y)}),u.contents=p,u.id}return{checkCanFindFormNode:f,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:s}}var _e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var xr={exports:{}};(function(t,n){(function(e){t.exports=e()})(function(){return function(){function e(r,i,a){function s(d,g){if(!i[d]){if(!r[d]){var c=typeof ut=="function"&&ut;if(!g&&c)return c(d,!0);if(f)return f(d,!0);var m=new Error("Cannot find module '"+d+"'");throw m.code="MODULE_NOT_FOUND",m}var u=i[d]={exports:{}};r[d][0].call(u.exports,function(p){var h=r[d][1][p];return s(h||p)},u,u.exports,e,r,i,a)}return i[d].exports}for(var f=typeof ut=="function"&&ut,l=0;l<a.length;l++)s(a[l]);return s}return e}()({1:[function(e,r,i){var a={},s="(?:^|\\s)",f="(?:\\s|$)";function l(c){var m=a[c];return m?m.lastIndex=0:a[c]=m=new RegExp(s+c+f,"g"),m}function d(c,m){var u=c.className;u.length?l(m).test(u)||(c.className+=" "+m):c.className=m}function g(c,m){c.className=c.className.replace(l(m)," ").trim()}r.exports={add:d,rm:g}},{}],2:[function(e,r,i){(function(a){var s=e("contra/emitter"),f=e("crossvent"),l=e("./classes"),d=document,g=d.documentElement;function c(S,Y){var W=arguments.length;W===1&&Array.isArray(S)===!1&&(Y=S,S=[]);var z,J,oe,fe,R,M,K,A,ae,Ce=null,ge,ee,pe=!1,he=0,le,U=Y||{};U.moves===void 0&&(U.moves=E),U.accepts===void 0&&(U.accepts=E),U.invalid===void 0&&(U.invalid=_),U.containers===void 0&&(U.containers=S||[]),U.isContainer===void 0&&(U.isContainer=T),U.copy===void 0&&(U.copy=!1),U.copySortSource===void 0&&(U.copySortSource=!1),U.revertOnSpill===void 0&&(U.revertOnSpill=!1),U.removeOnSpill===void 0&&(U.removeOnSpill=!1),U.direction===void 0&&(U.direction="vertical"),U.ignoreInputTextSelection===void 0&&(U.ignoreInputTextSelection=!0),U.mirrorContainer===void 0&&(U.mirrorContainer=d.body);var de=s({containers:U.containers,start:G,end:ie,cancel:I,remove:Xe,destroy:ze,canMove:qe,dragging:!1});return U.removeOnSpill===!0&&de.on("over",Et).on("out",It),$e(),de;function Ae(v){return de.containers.indexOf(v)!==-1||U.isContainer(v)}function $e(v){var k=v?"remove":"add";p(g,k,"mousedown",ye),p(g,k,"mouseup",Ne)}function Be(v){var k=v?"remove":"add";p(g,k,"mousemove",Qe)}function We(v){var k=v?"remove":"add";f[k](g,"selectstart",Ge),f[k](g,"click",Ge)}function ze(){$e(!0),Ne({})}function Ge(v){ge&&v.preventDefault()}function ye(v){fe=v.clientX,R=v.clientY;var k=h(v)!==1||v.metaKey||v.ctrlKey;if(!k){var q=v.target,Q=Le(q);Q&&(ge=Q,Be(),v.type==="mousedown"&&(b(q)?q.focus():v.preventDefault()))}}function Qe(v){if(ge){if(h(v)===0){Ne({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-fe)<=(U.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-R)<=(U.slideFactorY||0))){if(U.ignoreInputTextSelection){var k=O("clientX",v)||0,q=O("clientY",v)||0,Q=d.elementFromPoint(k,q);if(b(Q))return}var se=ge;Be(!0),We(),ie(),X(se),l.add(A||oe,"gu-transit"),Nt(),Vt(),he=0,Ue(v)}}}function Le(v){if(!(de.dragging&&z)&&!Ae(v)){for(var k=v;x(v)&&Ae(x(v))===!1;)if(U.invalid(v,k)||(v=x(v),!v))return;var q=x(v);if(q&&!U.invalid(v,k)){var Q=U.moves(v,q,k,w(v));if(Q)return{item:v,source:q}}}}function qe(v){return!!Le(v)}function G(v){var k=Le(v);k&&X(k)}function X(v){Rt(v.item,v.source)&&(A=v.item.cloneNode(!0),de.emit("cloned",A,v.item,"copy")),J=v.source,oe=v.item,M=K=w(v.item),de.dragging=!0,de.emit("drag",oe,J)}function _(){return!1}function ie(){if(de.dragging){var v=A||oe;Te(v,x(v))}}function ue(){ge=!1,Be(!0),We(!0)}function Ne(v){if(ue(),!!de.dragging){var k=A||oe,q=O("clientX",v)||0,Q=O("clientY",v)||0,se=y(z,q,Q),ce=xe(se,q,Q);ce&&(A&&U.copySortSource||!A||ce!==J)?Te(k,ce):U.removeOnSpill?Xe():I()}}function Te(v,k){var q=x(v);A&&U.copySortSource&&k===J&&q.removeChild(oe),be(k)?de.emit("cancel",v,J):de.emit("drop",v,k,J,K),te()}function Xe(){if(de.dragging){var v=A||oe,k=x(v);k&&k.removeChild(v),de.emit(A?"cancel":"remove",v,k,J),te()}}function I(v){if(de.dragging){var k=arguments.length>0?v:U.revertOnSpill,q=A||oe,Q=x(q),se=be(Q);se===!1&&k&&(A?Q&&Q.removeChild(A):J.insertBefore(q,M)),se||k?de.emit("cancel",q,J,J):de.emit("drop",q,Q,J,K),te()}}function te(){var v=A||oe;ue(),Mt(),kt(),v&&l.rm(v,"gu-transit"),ae&&clearTimeout(ae),de.dragging=!1,Ce&&de.emit("out",v,Ce,J),de.emit("dragend",v,he),J=oe=A=M=K=ae=Ce=null}function be(v,k){var q;return k!==void 0?q=k:z?q=K:q=w(A||oe),v===J&&q===M}function xe(v,k,q){for(var Q=v;Q&&!se();)Q=x(Q);return Q;function se(){var ce=Ae(Q);if(ce===!1)return!1;var je=gt(Q,v),Ve=ht(Q,je,k,q),Me=be(Q,Ve);return Me?!0:U.accepts(oe,Q,J,Ve)}}function Ue(v){if(!z)return;v.preventDefault();var k=O("clientX",v)||0,q=O("clientY",v)||0;z.style.left=k-2+"px",z.style.top=q-2+"px";var Q=A||oe,se=y(z,k,q),ce=xe(se,k,q),je=ce!==null&&ce!==Ce;(je||ce===null)&&(ke(),Ce=ce,He()),Ot(se,q);var Ve=x(Q);if(ce===J&&A&&!U.copySortSource){Ve&&Ve.removeChild(Q);return}var Me,De=gt(ce,se);if(pe=rt(De,ce),De!==null)Me=ht(ce,De,k,q);else if(U.revertOnSpill===!0&&!A)Me=M,ce=J;else{A&&Ve&&Ve.removeChild(Q),A&&ee&&(ee.style.display="none");return}ee.style.display="block",Tt(Me,Q,je),Me?Bt(De,Me):jt(ce);function we(Ee){de.emit(Ee,Q,Ce,J)}function He(){je&&we("over")}function ke(){Ce&&we("out")}}function Tt(v,k,q){(v===k||v===w(k))&&(K=w(k)),(v===null&&q||v!==k&&v!==w(k))&&(K=v)}function Et(v){l.rm(v,"gu-hide")}function It(v){de.dragging&&l.add(v,"gu-hide")}function Vt(){z||(z=document.createElement("div"),z.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;",z.innerHTML=U.getMirrorText&&U.getMirrorText(oe)||"控件",l.add(z,"gu-mirror"),U.mirrorContainer.appendChild(z),p(g,"add","mousemove",Ue),l.add(U.mirrorContainer,"gu-unselectable"),de.emit("cloned",z,oe,"mirror"))}function Nt(){if(ee=document.createElement("div"),l.add(ee,"gu-insertion"),oe){var v=oe.getBoundingClientRect();ee.style.left=v.left+"px",ee.style.top=v.top+"px"}pe=!1,U.mirrorContainer.appendChild(ee)}function Mt(){z&&(l.rm(U.mirrorContainer,"gu-unselectable"),p(g,"remove","mousemove",Ue),x(z).removeChild(z),z=null)}function kt(){ee&&(x(ee).removeChild(ee),ee=null)}function gt(v,k){for(var q=k;q!==v&&x(q)!==v;)q=x(q);return q===g?null:q}function rt(v,k){if(!k)return pe;var q=v||k&&k.lastElementChild;if(!q)return!0;var Q=getComputedStyle(v),se=/^inline/.test(Q.getPropertyValue("display"))||/^(left|right)$/.test(Q.getPropertyValue("float"));if(se)return!0;if(k){var ce=getComputedStyle(k),je=ce.getPropertyValue("display");if(/flex$/.test(je)){var Ve=ce.getPropertyValue("flex-direction")||"row";if(Ve==="row"||Ve==="row-reverse")return!Pt(k)}return!1}return!0}function Pt(v){if(!v.children||!v.children.length)return!1;for(const k of Array.from(v.children)){const Q=(k.className&&k.className.split(" ")||[]).filter(se=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(se));if(!Q.length)return!1;for(const se of Q){const ce=se.slice(se.lastIndexOf("-")+1);if(parseInt(ce,10)!==12)return!1}}return!0}function Bt(v,k){const q=k.getBoundingClientRect();if(ee.style.left=q.left+"px",ee.style.top=q.top+"px",pe){if(ee.style.height=q.height+"px",ee.style.width="4px",v){const Q=v.getBoundingClientRect();Q.top!==q.top&&(ee.style.left=Q.right+"px",ee.style.top=Q.top+"px",ee.style.height=Q.height+"px")}}else if(ee.style.height="4px",ee.style.width=q.width+"px",le){const Q=le.getBoundingClientRect();q.top<Q.top&&(ee.style.display="none")}k===oe&&oe&&(ee.style.display="none")}function jt(v){K=null;var k=v.lastElementChild;if(k){var q=k.getBoundingClientRect();pe?(ee.style.left=q.right+"px",ee.style.top=q.top+"px",ee.style.height=q.height+"px",ee.style.width="4px"):(ee.style.left=q.left+"px",ee.style.top=q.bottom+"px",ee.style.height="4px",ee.style.width=q.width+"px"),k===oe&&oe&&(ee.style.display="none")}else ee.style.display="none"}function Ot(v,k){if(!U.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(le=m(v),!le||!le.contains(v)))return;const q=document.querySelector(".dgComponentSelected"),Q=le.getBoundingClientRect();if(k-30<Q.top&&le.scrollTop>0){let se=le.scrollTop<10?le.scrollTop:10;le.scrollBy(0,-1*se),q&&le.contains(q)&&(he=he+-1*se)}if(k+30>Q.bottom&&le.scrollTop<le.scrollHeight-le.clientHeight){const se=le.scrollHeight-le.clientHeight-le.scrollTop;let ce=se<10?se:10;le.scrollBy(0,ce),q&&le.contains(q)&&(he=he+ce)}}function ht(v,k,q,Q){var se=U.direction==="horizontal",ce=U.direction==="mixed",je=k!==v?Me():Ve();return je;function Ve(){var we=v.children.length,He,ke,Ee;for(He=0;He<we;He++)if(ke=v.children[He],Ee=ke.getBoundingClientRect(),se&&Ee.left+Ee.width/2>q||!ce&&!se&&Ee.top+Ee.height/2>Q||ce&&Ee.left+Ee.width>q&&Ee.top+Ee.height>Q)return ke;return null}function Me(){var we=k.getBoundingClientRect();if(ce){var He=Q-we.top,ke=q-we.left,Ee=we.bottom-Q,it=we.right-q,at=Math.min(ke,it,He,Ee),st;return pe?st=it<ke:st=Ee===at||it===at||ke===at,De(st)}return De(se?q>we.left+D(we)/2:Q>we.top+N(we)/2)}function De(we){return we?w(k):k}}function Rt(v,k){return typeof U.copy=="boolean"?U.copy:U.copy(v,k)}}function m(S){const Y=Array.from(window.scrollContainerList);if(Y.length===1){const z=Array.from(window.scrollContainerList)[0];return document.getElementById(z)}const W=u(Y);for(const z of W)if(z.contains(S))return z;return null}function u(S){const Y=[];return S.forEach(W=>{const z=document.getElementById(W);z&&Y.push(z)}),Y.sort((W,z)=>W.contains(z)?1:z.contains(W)?-1:0),Y}function p(S,Y,W,z){var J={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},oe={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},fe={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?f[Y](S,oe[W],z):a.navigator.msPointerEnabled?f[Y](S,fe[W],z):(f[Y](S,J[W],z),f[Y](S,W,z))}function h(S){if(S.touches!==void 0)return S.touches.length;if(S.which!==void 0&&S.which!==0)return S.which;if(S.buttons!==void 0)return S.buttons;var Y=S.button;if(Y!==void 0)return Y&1?1:Y&2?3:Y&4?2:0}function y(S,Y,W){S=S||{};var z=S.className||"",J;return S.className+=" gu-hide",J=d.elementFromPoint(Y,W),S.className=z,J}function T(){return!1}function E(){return!0}function D(S){return S.width||S.right-S.left}function N(S){return S.height||S.bottom-S.top}function x(S){return S.parentNode===d?null:S.parentNode}function b(S){return S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.tagName==="SELECT"||C(S)}function C(S){return!S||S.contentEditable==="false"?!1:S.contentEditable==="true"?!0:C(x(S))}function w(S){return S.nextElementSibling||Y();function Y(){var W=S;do W=W.nextSibling;while(W&&W.nodeType!==1);return W}}function V(S){return S.targetTouches&&S.targetTouches.length?S.targetTouches[0]:S.changedTouches&&S.changedTouches.length?S.changedTouches[0]:S}function O(S,Y){var W=V(Y),z={pageX:"clientX",pageY:"clientY"};return S in z&&!(S in W)&&z[S]in W&&(S=z[S]),W[S]}r.exports=c}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,r,i){r.exports=function(s,f){return Array.prototype.slice.call(s,f)}},{}],4:[function(e,r,i){var a=e("ticky");r.exports=function(f,l,d){f&&a(function(){f.apply(d||null,l||[])})}},{ticky:10}],5:[function(e,r,i){var a=e("atoa"),s=e("./debounce");r.exports=function(l,d){var g=d||{},c={};return l===void 0&&(l={}),l.on=function(m,u){return c[m]?c[m].push(u):c[m]=[u],l},l.once=function(m,u){return u._once=!0,l.on(m,u),l},l.off=function(m,u){var p=arguments.length;if(p===1)delete c[m];else if(p===0)c={};else{var h=c[m];if(!h)return l;h.splice(h.indexOf(u),1)}return l},l.emit=function(){var m=a(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var u=(c[m]||[]).slice(0);return function(){var p=a(arguments),h=this||l;if(m==="error"&&g.throws!==!1&&!u.length)throw p.length===1?p[0]:p;return u.forEach(function(T){g.async?s(T,p,h):T.apply(h,p),T._once&&l.off(m,T)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(e,r,i){(function(a){var s=e("custom-event"),f=e("./eventmap"),l=a.document,d=m,g=p,c=[];a.addEventListener||(d=u,g=h),r.exports={add:d,remove:g,fabricate:y};function m(x,b,C,w){return x.addEventListener(b,C,w)}function u(x,b,C){return x.attachEvent("on"+b,E(x,b,C))}function p(x,b,C,w){return x.removeEventListener(b,C,w)}function h(x,b,C){var w=D(x,b,C);if(w)return x.detachEvent("on"+b,w)}function y(x,b,C){var w=f.indexOf(b)===-1?O():V();x.dispatchEvent?x.dispatchEvent(w):x.fireEvent("on"+b,w);function V(){var S;return l.createEvent?(S=l.createEvent("Event"),S.initEvent(b,!0,!0)):l.createEventObject&&(S=l.createEventObject()),S}function O(){return new s(b,{detail:C})}}function T(x,b,C){return function(V){var O=V||a.event;O.target=O.target||O.srcElement,O.preventDefault=O.preventDefault||function(){O.returnValue=!1},O.stopPropagation=O.stopPropagation||function(){O.cancelBubble=!0},O.which=O.which||O.keyCode,C.call(x,O)}}function E(x,b,C){var w=D(x,b,C)||T(x,b,C);return c.push({wrapper:w,element:x,type:b,fn:C}),w}function D(x,b,C){var w=N(x,b,C);if(w){var V=c[w].wrapper;return c.splice(w,1),V}}function N(x,b,C){var w,V;for(w=0;w<c.length;w++)if(V=c[w],V.element===x&&V.type===b&&V.fn===C)return w}}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,r,i){(function(a){var s=[],f="",l=/^on/;for(f in a)l.test(f)&&s.push(f.slice(2));r.exports=s}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,r,i){(function(a){var s=a.CustomEvent;function f(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}r.exports=f()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(d,g){var c=document.createEvent("CustomEvent");return g?c.initCustomEvent(d,g.bubbles,g.cancelable,g.detail):c.initCustomEvent(d,!1,!1,void 0),c}:function(d,g){var c=document.createEventObject();return c.type=d,g?(c.bubbles=!!g.bubbles,c.cancelable=!!g.cancelable,c.detail=g.detail):(c.bubbles=!1,c.cancelable=!1,c.detail=void 0),c}}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,r,i){var a=r.exports={},s,f;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?f=clearTimeout:f=d}catch{f=d}})();function g(N){if(s===setTimeout)return setTimeout(N,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(N,0);try{return s(N,0)}catch{try{return s.call(null,N,0)}catch{return s.call(this,N,0)}}}function c(N){if(f===clearTimeout)return clearTimeout(N);if((f===d||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(N);try{return f(N)}catch{try{return f.call(null,N)}catch{return f.call(this,N)}}}var m=[],u=!1,p,h=-1;function y(){!u||!p||(u=!1,p.length?m=p.concat(m):h=-1,m.length&&T())}function T(){if(!u){var N=g(y);u=!0;for(var x=m.length;x;){for(p=m,m=[];++h<x;)p&&p[h].run();h=-1,x=m.length}p=null,u=!1,c(N)}}a.nextTick=function(N){var x=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)x[b-1]=arguments[b];m.push(new E(N,x)),m.length===1&&!u&&g(T)};function E(N,x){this.fun=N,this.array=x}E.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function D(){}a.on=D,a.addListener=D,a.once=D,a.off=D,a.removeListener=D,a.removeAllListeners=D,a.emit=D,a.prependListener=D,a.prependOnceListener=D,a.listeners=function(N){return[]},a.binding=function(N){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(N){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(e,r,i){(function(a){var s=typeof a=="function",f;s?f=function(l){a(l)}:f=function(l){setTimeout(l,0)},r.exports=f}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,r,i){(function(a,s){var f=e("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,g={},c=0;i.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(u){u.close()};function m(u,p){this._id=u,this._clearFn=p}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(u,p){clearTimeout(u._idleTimeoutId),u._idleTimeout=p},i.unenroll=function(u){clearTimeout(u._idleTimeoutId),u._idleTimeout=-1},i._unrefActive=i.active=function(u){clearTimeout(u._idleTimeoutId);var p=u._idleTimeout;p>=0&&(u._idleTimeoutId=setTimeout(function(){u._onTimeout&&u._onTimeout()},p))},i.setImmediate=typeof a=="function"?a:function(u){var p=c++,h=arguments.length<2?!1:d.call(arguments,1);return g[p]=!0,f(function(){g[p]&&(h?u.apply(null,h):u.call(null),i.clearImmediate(p))}),p},i.clearImmediate=typeof s=="function"?s:function(u){delete g[u]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(xr);const wr={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}},Sr={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},St=o.defineComponent({name:"Toast",props:Sr,emits:["close","click"],setup:(t,n)=>{const{locale:e,t:r}=yt.useI18n(),i=o.ref(t.animate),a="fadeOut",s=o.computed(()=>t.options),f=o.ref(!1),l=o.computed(()=>s.value.title&&s.value.message),d=o.computed(()=>!s.value.title&&s.value.message),g=o.computed(()=>{const N={animated:f.value,toast:!0,"toast--only-content":!l.value};return N[t.animate]=!1,N[a]=f.value,N["toasty-type-"+s.value.type]=!0,s.value.theme&&(N[s.value.theme]=!0),N}),c=o.computed(()=>{const b=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,C={"f-icon":!0};return C[b]=!0,C}),m=o.computed(()=>s.value.title||s.value.message),u=o.computed(()=>t.showCloseButton),p=o.computed(()=>!!s.value.buttons||!!n.slots.default),h=o.computed(()=>e.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function y(N){N.stopPropagation(),N.preventDefault(),f.value=!1,setTimeout(()=>{n.emit("close",s.value)},200)}function T(N,x){}function E(N){return`f-preten-link ${N.customClass?N.customClass:""}`}o.watch(i,()=>{i.value});const D=()=>{var N;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!n.slots.default&&((N=s.value.buttons)==null?void 0:N.map(x=>o.createVNode("span",{class:E(x),onClick:b=>void 0},[x.text]))),n.slots.default&&n.slots.default()])])};return()=>o.createVNode("div",{class:g.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:r("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:y},[o.createVNode("span",{class:"f-icon modal_close"},null)]),m.value&&o.createVNode("section",{class:"modal-tips"},[!l.value&&o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[l.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:s.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:h.value},null),p.value&&D()]),d.value&&(s.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:s.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[D()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:s.value.message},null))])])])}}),ft=o.defineComponent({name:"Notify",props:wr,emits:["close","empty"],setup(t,n){const e=o.computed(()=>({"farris-notify":!0})),r={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(t.options),s=o.ref(t.showCloseButton),f=o.computed(()=>t.position||"bottom-right"),l=o.computed(()=>t.timeout!=null?t.timeout:3e3),d=o.computed(()=>{const m=t.bottom?t.bottom:r.bottom,u=t.top?t.top:r.top,p={transition:"all 0.2s ease",left:f.value.indexOf("left")>-1?`${t.left?t.left:r.left}px`:"",right:f.value.indexOf("right")>-1?`${t.right?t.right:r.right}px`:"",top:f.value.indexOf("top")>-1?`${u}px`:"",bottom:f.value.indexOf("bottom")>-1?`${m}px`:""};return f.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",f.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function g(m){n.emit("close")}l.value&&setTimeout(()=>{g()},l.value),n.expose({closeToast:g,container:i,notifyPosition:f});function c(m,u){g()}return()=>o.createVNode("div",{class:e.value,style:d.value,ref:i},[o.createVNode(St,{options:a.value,showCloseButton:s.value,animate:t.animate,onClose:m=>c(m,a.value)},null)])}});class Fr{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",o.reactive({}))}escapeAllHtml(n){if(typeof n!="string"||!n)return"";const e=document.createElement("div");return e.textContent=n||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(n){const e=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...n}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var d;const f=o.ref();function l(){f.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,f),s.unmount()},220)}if(i.position.indexOf("top")>-1){const g=e.getNotifyInstances(i.position),c=g[g.length-1];if(c){const m=c.value.container.getBoundingClientRect();i.top=m.bottom}}return i.safeHtml&&((d=i.options)!=null&&d.message)&&(i.options.message=e.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{e.updateNotifyPositionForCreate(i,f)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(ft,o.mergeProps({ref:f},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(lt.LocaleService.i18n),s.mount(a),s}getNotifyInstances(n){return this.notifyRefs.filter(e=>e.value.notifyPosition===n)}updateNotifyPositionForCreate(n,e){if(this.notifyRefs&&this.notifyRefs.length){const r=window.innerHeight;n.position.indexOf("bottom")>-1&&this.getNotifyInstances(n.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+r-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(n,e){const r=this.notifyRefs.indexOf(e);if(n.position.indexOf("top")>-1){const i=this.getNotifyInstances(n.position),a=i.indexOf(e);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(n){return this.createNotifyInstance(n)}buildNotifyProps(n,e){let r="",i="",a,s,f;typeof e=="string"?r=e:e&&(r=e.message||"",i=e.title||"",s=e.position||null,f=e.showCloseButton!=null?e.showCloseButton:null,a=e.timeout!=null?e.timeout:null);const d={options:{type:n,message:r,title:i}};return s!=null&&(d.position=s),f!=null&&(d.showCloseButton=f),a!=null&&(d.timeout=a),d}info(n){const e=this.buildNotifyProps("info",n);return this.show(e)}success(n){const e=this.buildNotifyProps("success",n);return this.show(e)}warning(n){const e=this.buildNotifyProps("warning",n);return this.show(e)}error(n){const e=this.buildNotifyProps("error",n);return this.show(e)}close(n){n&&n.unmount()}closeAll(){this.notifyRefs.forEach(n=>{n==null||n.value.closeToast()}),this.notifyRefs.length=0}}const Tr=Symbol("NOTIFY_SERVICE_TOKEN");ft.install=t=>{t.component(ft.name,ft),t.component(St.name,St);const n=new Fr;t.provide(Tr,n),t.provide("FNotifyService",n)},`${lt.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const Er={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:32,heading:lt.LocaleService.getLocaleValue("datagrid.lineNumberTitle")}},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"]}}};function Ir(t,n,e,r,i,a,s,f,l,d,g,c,m,u,p,h,y){const{calculateCellPositionInRow:T}=a,{columnContext:E,hasLeftFixedColumn:D,hasRightFixedColumn:N}=s,{gridDataStyle:x,leftFixedGridDataStyle:b,rightFixedGridDataStyle:C}=u,{renderDataRow:w}=re.getHierarchyRow(t,n,E,y,f,l,d,g,c,m,u,p,h),V=[w];function O(J,oe){const fe=T(J);return y.value.filter(R=>R.visible!==!1).map((R,M)=>V[R.type](R,fe,oe,M))}function S(){return o.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:b.value},[O(E.value.leftColumns.filter(J=>J.visible),"left")])])}function Y(){return o.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:x.value},[O(E.value.primaryColumns.filter(J=>J.visible),"primary")])])}function W(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:C.value},[O(E.value.rightColumns.filter(J=>J.visible),"right")])])}function z(){const J=[];return D.value&&J.push(S()),J.push(Y()),N.value&&J.push(W()),J}return{renderDataArea:z}}const Vr=o.defineComponent({name:"FTreeGrid",props:Er,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(t,n){var cn,dn;const r=((cn=t.rowOption)==null?void 0:cn.height)||28,i=o.ref(20),a=o.ref(t.columns),s=re.useIdentify(t),{idField:f}=s,l=o.ref(),d=o.ref(),g=o.ref(),c=o.ref(),m=o.ref(),u=o.ref([]),p=o.ref(!1),h=o.ref(((dn=t.rowOption)==null?void 0:dn.wrapContent)||!1),y=re.useGroupData(t,s),T=re.useFilter(t,n),E=re.useHierarchy(t),{collapseField:D}=E,{showLoading:N,renderLoading:x}=re.useLoading(t,l),b=re.useDataView(t,new Map,T,E,s),{dataView:C}=b,w=re.useSelection(t,b,s,u,n),{showSelection:V,selectedValues:O}=w,S=re.useSelectHierarchyItem(t,u,b,s,w,n),Y=o.computed(()=>t.disabled),W=o.computed(()=>t.virtualized?Math.min(b.dataView.value.length,i.value):b.dataView.value.length),z=re.usePagination(t,b),{shouldRenderPagination:J}=z,{containerStyleObject:oe}=re.useDataViewContainerStyle(t),fe=re.useCommandColumn(t),{applyCommands:R}=fe;R(a);const{applyColumnSetting:M,removeColumnSetting:K}=re.useSettingColumn(t);t.showSetting&&M(a);const A=re.useColumn(t,n),ae=re.useSort(t),{applyColumnSorter:Ce,columnContext:ge,updateColumnRenderContext:ee}=A;Ce(b,ae);const pe=re.useGroupColumn(t,ge),he=re.useRow(t,n,w,s),le=re.useEdit(t,n,s,he,u),U=re.useVisualDataBound(t),de=re.useVisualDataCell(t,le,U),Ae=re.useVisualDataRow(t,b,le,E,s,U,de),$e=re.useVisualData(t,a,b,W,0,Ae),{getVisualData:Be}=$e,We=re.useCellPosition(t,ge),ze=re.useSidebar(t,w),{sidebarWidth:Ge}=ze,ye=re.useVirtualScroll(t,b,u,ge,$e,W,0,Ge),{onWheel:Qe,dataGridWidth:Le,viewPortHeight:qe,viewPortWidth:G,resetScroll:X,updateVisibleRowsOnLatestVisibleScope:_}=ye,ie=re.useFitColumn(t,ge,d,G,pe),{calculateColumnsSize:ue}=ie,Ne=re.useFilterHistory(),Te=re.useColumnFilter(d,m,b,Ne,ye),Xe=re.useDragColumn(t,n,A,b,pe,y,ye),I=o.computed(()=>{const H={"fv-grid":!0,"fv-grid-bordered":t.showBorder,"fv-grid-horizontal-bordered":t.showHorizontalLines,"fv-datagrid-strip":t.showStripe};return Oe.getCustomClass(H,t.customClass)}),te=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":h.value})),{renderDataArea:be}=Ir(t,n,g,c,m,We,A,b,le,E,he,w,S,ye,$e,U,u),{renderGridHeader:xe,renderGridColumnResizeOverlay:Ue,shouldShowHeader:Tt}=re.getColumnHeader(t,n,d,c,m,A,b,Xe,Te,T,Ne,ie,pe,w,ze,ae,ye,G,u),{renderDataGridSidebar:Et}=re.getSidebar(t,he,w,ze,ye),{renderDisableMask:It}=re.getDisableMask(),{renderHorizontalScrollbar:Vt}=re.getHorizontalScrollbar(t,d,ye),{renderVerticalScrollbar:Nt}=re.getVerticalScrollbar(t,d,ye);function Mt(){var H,ne,Se;if(d.value&&d.value.clientHeight>0&&((H=d.value)==null?void 0:H.clientWidth)>0){const Ie=Math.ceil(d.value.clientHeight/r);Ie>i.value&&(i.value=Ie,_()),qe.value=((ne=g.value)==null?void 0:ne.clientHeight)||0,Le.value=((Se=d.value)==null?void 0:Se.clientWidth)||0,ue()}}o.onMounted(()=>{d.value&&(i.value=Math.max(Math.ceil(d.value.clientHeight/r),i.value),u.value=Be(0,W.value+0-1),Po.useResizeObserver(d.value,Mt),ue(),o.nextTick(()=>{d.value&&(Le.value=d.value.clientWidth),g.value&&(G.value=g.value.clientWidth,qe.value=g.value.clientHeight)})),N.value&&x()}),o.onUnmounted(()=>{}),o.watch(G,()=>{d.value&&ue()});function kt(H){b.collapseTo(H),b.reOrderVisibleIndex(),X()}function gt(H){b.expandTo(H),b.reOrderVisibleIndex(),X()}function rt(){const H=w.getSelectionRow();return H?H.dataIndex-1:-1}function Pt(){const H=rt();b.insertNewDataItem(H),u.value=Be(0,W.value+0-1)}function Bt(){const H=rt();b.insertNewChildDataItem(H),u.value=Be(0,W.value+0-1)}function jt(H,ne){const Se=u.value.find(Pe=>Pe.raw[f.value]===ne),Ie=Se?Se.dataIndex-1:-1;b.insertNewChildDataItems(H,Ie)}function Ot(){const H=rt(),ne=S.getNextSelectableHierarchyItemId(H);b.removeHierarchyDataItem(H),u.value=Be(0,W.value+0-1),ne&&S.selectItemById(ne)}function ht(H){le.onEditingRow(H)}function Rt(H){le.acceptEditingRow(H)}function v(H){le.cancelEditingRow(H)}function k(H){H&&(a.value=H,R(a),ee(a.value),Ce(b,ae),ue())}o.watch(()=>t.columns,H=>{k(H)});function q(H,ne){H&&(b.load(H),b.reOrderVisibleIndex(),ne!=null&&ne.keepScrollPosition?ye.scrollTo(ye.offsetY.value):X())}function Q(H){S.selectItemById(H)}function se(H){const ne=u.value.find(Se=>Se.raw[s.idField.value]===H);ne&&he.clickRowItem(ne)}function ce(H){he.activeRowById(H)}function je(H){S.selectItemByIds(H)}function Ve(){return w.getSelectedItems()}function Me(){w.clearSelection()}const De=o.computed(()=>!u.value||!u.value.length),{renderEmpty:we}=re.getEmpty(t,n);function He(){return w.getSelectionRow()}function ke(H){S.unSelectItemByIds(H)}function Ee(){return w.currentSelectedDataId.value}function it(H,ne,Se){const Ie=C.value.find(Pe=>Pe[f.value]===H);if(Ie){if(Object.keys(Ie).forEach(Fe=>{Object.prototype.hasOwnProperty.call(ne,Fe)&&(Ie[Fe]=ne[Fe])}),Se){const{collapseField:Fe,disabledField:Ze,checkedField:Ke,visibleField:et}=Se;Fe&&!me.isUndefined(ne[Fe])&&(Ie.__fv_collapse__=ne[Fe]),Ke&&!me.isUndefined(ne[Ke])&&(Ie.__fv_checked__=ne[Ke]),Ze&&!me.isUndefined(ne[Ze])&&(Ie.__fv_disabled__=ne[Ze]),et&&!me.isUndefined(ne[et])&&(Ie.__fv_visible__=ne[et])}const Pe=u.value.find(Fe=>Fe.raw[f.value]===H),un=u.value.findIndex(Fe=>Fe.raw[f.value]===H);if(Pe){if(Pe.raw=Ie,Object.keys(Pe.data).forEach(Fe=>{Pe.data[Fe].updateData(Ie)}),Se){const{collapseField:Fe,disabledField:Ze,checkedField:Ke,visibleField:et}=Se;Fe&&!me.isUndefined(ne[Fe])&&(Pe.collapse=ne[Fe]),Ke&&!me.isUndefined(ne[Ke])&&(Pe.checked=ne[Ke]),Ze&&!me.isUndefined(ne[Ze])&&(Pe.disabled=ne[Ze]),et&&!me.isUndefined(ne[et])&&(Pe.visible=ne[et])}u.value=[...u.value.slice(0,un),Pe,...u.value.slice(un+1)],b.updateSummary()}}}function at(H){return Object.prototype.hasOwnProperty.call(H,"raw")?b.hasRealChildren(H.raw):b.hasRealChildren(H)}function st(H){const ne=b.dataView.value.find(Se=>Se[f.value]===H);return ne?ne[D.value]:""}function fi(){return D.value}o.watch(()=>t.showSetting,(H,ne)=>{H!==ne&&(H?M(a):K(a),k(a.value))});function pi(H){return u.value.filter(ne=>H.includes(ne.raw[t.idField]))}function mi(H){const ne=s.idField.value,Se=u.value.find(Ie=>Ie.raw[ne]===H);Se&&he.changeRow(Se)}function gi(){w.keepSelectingOnPaging.value||Me(),b.updateVisibleDataSummary(u.value)}n.expose({activeRowById:ce,addNewDataItem:Pt,addNewChildDataItem:Bt,addChildrenToNode:jt,collapseTo:kt,expandTo:gt,removeDataItem:Ot,editDataItem:ht,acceptDataItem:Rt,cancelDataItem:v,updateColumns:k,updateDataSource:q,selectItemById:Q,selectItemByIds:je,getSelectedItems:Ve,clearSelection:Me,getSelectionRow:He,clickRowItemById:se,unSelectItemByIds:ke,getCurrentRowId:Ee,reassignRowData:it,hasChildren:at,getCollapseField:fi,getCollapseStatusById:st,getVisibleDataByIds:pi,selectRowById:mi,updateDerivedData:gi});const hi=o.computed(()=>{const H={};return ye.shouldShowHorizontalScrollbar.value&&(H.paddingBottom="10px"),ye.shouldShowVirticalScrollbar.value&&(H.paddingRight="10px"),H}),yi=o.computed(()=>({...oe.value,borderRadius:"5px"}));re.getPagination(t,n,b,ye,z,w);const vi=o.computed(()=>({"d-flex":!0,"justify-content-between":J.value&&V.value,"justify-content-end":J.value&&!V.value,"position-relative":!0})),bi=o.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:Ci}=re.getSummary(t,b,A);return()=>o.createVNode("div",{ref:l,class:I.value,style:yi.value,onWheel:Qe},[d.value&&Tt.value&&xe(),o.createVNode("div",{ref:d,class:te.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:hi.value},[d.value&&Et(u),d.value&&be(),d.value&&De.value&&we(),d.value&&Vt(),d.value&&Nt()]),d.value&&Ci(),V.value&&o.createVNode("div",{class:vi.value},[V.value&&o.createVNode("div",{class:bi.value},[o.createVNode("div",null,["已选:"+O.value.length,o.createTextVNode(" 条")])])]),Ue(),Y.value&&It()])}});Oe.withInstall(Vr);const Nr=new Map([["appearance",Zt]]);function Mr(t,n,e){return n}ct({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:()=>{}}},{$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"]},Nr,Mr,{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:[]}}}}}});const kr="root-viewmodel";class Pr{constructor(n,e){Z(this,"formSchemaUtils");Z(this,"controlCreatorUtils");Z(this,"designViewModelUtils");this.resolver=n,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(n){const e=this.createComponentRefNode(n),r=this.createComponentNode(n),i=this.createViewModeNode(n),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(r),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(n){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${n.componentId}-component-ref`,component:`${n.componentId}-component`}),e}createComponentNode(n){const e=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(n);return Object.assign(e,{id:`${n.componentId}-component`,viewModel:`${n.componentId}-component-viewmodel`,componentType:n.componentType,appearance:{class:this.getFormComponentClass()},formColumns:n.formColumns,contents:r}),e}getFormComponentClass(){const{templateId:n}=this.formSchemaUtils.getFormSchema().module;return n==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(n){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:n.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:n.componentName});const r=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(r,{id:n.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),e.contents=[r];const{selectedFields:a}=n;a==null||a.forEach(f=>{if(f.$type===Oe.FormSchemaEntityField$Type.SimpleField){const l=me.cloneDeep(f),d=this.resolveControlClassByFormColumns(n),g=this.controlCreatorUtils.setFormFieldProperty(l,"",d);g&&i.push(g)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(n){let e="";switch(n.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(n){return{id:`${n.componentId}-component-viewmodel`,code:`${n.componentId}-component-viewmodel`,name:n.componentName,bindTo:n.bindTo,parent:kr,fields:this.assembleViewModelFields(n),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(n){const e=[],{selectedFields:r}=n;return r==null||r.forEach(i=>{if(i.$type===Oe.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===Oe.FormSchemaEntityFieldTypeName.Enum||s===Oe.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),e.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),e}}function Br(t,n,e,r){var a,s,f,l,d,g;const i=e.parentComponentInstance;if(i&&r){const c=(a=i.schema)==null?void 0:a.type,u={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=e.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(f=e.bindingSourceContext)==null?void 0:f.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((d=e.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(g=e.bindingSourceContext)==null?void 0:g.bindingEntityFields};return new Pr(t,r).createComponent(u)}else return n}function jr(t,n,e){return n}ct({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},Ct,Br),ct({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Kt,Ct,void 0);const Or={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},Rr={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};vt.createPropsResolver(Rr,Or,ar,jr);const $r={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Ft(){return new DOMException("The request is not allowed","NotAllowedError")}async function Lr(t){if(!navigator.clipboard)throw Ft();return navigator.clipboard.writeText(t)}async function qr(t){const n=document.createElement("span");n.textContent=t,n.style.whiteSpace="pre",n.style.webkitUserSelect="auto",n.style.userSelect="all",document.body.appendChild(n);const e=window.getSelection(),r=window.document.createRange();e==null||e.removeAllRanges(),r.selectNode(n),e==null||e.addRange(r);let i=!1;try{i=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(n)}if(!i)throw Ft()}async function Dr(t){try{await Lr(t)}catch(n){try{await qr(t)}catch(e){throw e||n||Ft()}}}function Hr(){async function t(n){await Dr(n)}return{onCopy:t}}function Ar(t,n,e,r){const i=o.ref(14),a=o.ref(140),s=o.ref(""),f=o.ref(r.value.length),l=o.computed(()=>r.value),d=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function g(c){if(c.currentTarget){const m=c.currentTarget.value||"";f.value=m.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:a.value,onInput:c=>g(c)},[l.value]),o.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[f.value+" / "+a.value])])}function zr(t,n,e,r){const i=Ar(t,n,e,r),a=new Map([["text-area",i]]);function s(f){return a.get(f)||null}return{getEditorRender:s}}function Ur(){const t=o.ref(!1),n=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const r={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return r.opacity=t.value?"0.8":"0",r.display=t.value?"":"none",r}),feedbackMessage:n,toShowFeedback:t}}function _r(t,n){const e=n.getEditorRender(t.promptEditorType);return()=>e&&e()}function Wr(t,n){function e(u){if(u==null)return 0;let p=0;for(let h=0;h<u.length;h++){const y=u.charCodeAt(h);y>=0&&y<=128?p++:p=p+2}return p}function r(u,p){if(u!==""&&u!==void 0&&u!==null){u=""+u;const h=u.length;let y="",T=0;for(let E=0;E<h;E++){const D=u.charAt(E);if(T++,encodeURI(D).length>4&&T++,y=y.concat(D),T>=p)return y=y.concat("..."),y}if(T<p)return u}return""}const i=o.computed(()=>!!t.value&&!!t.value.date),a=o.computed(()=>{const u=t.value&&t.value.date||"";return`${n.exception.happend} : ${u}`}),s=o.computed(()=>!!t.value&&!!t.value.detail),f=o.computed(()=>t.value?e(t.value.detail)>160:!1),l=o.ref(!1),d=o.computed(()=>l.value?n.exception.collapse:n.exception.expand),g=o.computed(()=>{const u=n.exception.detail+" : "+(t.value&&t.value.detail)||"";return l.value?u:r(u,160)}),c=o.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function m(){l.value=!l.value}return()=>o.createVNode("div",{class:"toast-msg-detail"},[i.value&&o.createVNode("div",null,[a.value]),s.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("div",{innerHTML:g.value},null),f.value&&o.createVNode("span",{style:c.value,onClick:m},[d.value])])])])}function Gr(t){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value},null)}function Xr(t,n,e,r,i){const a=o.ref(t.exceptionInfo),s=o.computed(()=>{const p=n.value==="question"?"warning":n.value,h={"f-icon":!0},y=`f-icon-${p}`;return h[y]=!0,h}),f=o.computed(()=>e.value||a.value&&a.value.message),l=o.computed(()=>r.value),d=o.computed(()=>!!r.value),g=o.computed(()=>!!a.value);function c(){return g.value?Wr(a,i):d.value?Gr(l):()=>null}const m=c(),u=o.computed(()=>i.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:s.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:f.value,style:u.value},null),m()])])}function Yr(t,n,e,r){const{onCopy:i}=n,{toShowFeedback:a}=e,s=o.ref(r.exception.copySuccess||"复制成功"),f=o.ref(r.exception.copy||"复制详细信息"),l=o.ref(t.exceptionInfo||{date:"",message:"",detail:""}),d=o.computed(()=>l.value&&l.value.detail||"");function g(c){i(d.value).catch(m=>{s.value=r.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:g,style:"cursor: pointer;"},[f.value])])}function Jr(t,n,e,r,i){const a=o.ref(t.type),s=o.ref(t.buttons),f=o.ref(t.exceptionInfo),l=o.ref(i.ok||t.okButtonText),d=o.ref(i.cancel||t.cancelButtonText),g=o.ref(t.showCancelButton),c=o.ref(t.showOkButton),m=o.computed(()=>!!(s.value&&s.value.length)),u=o.computed(()=>f.value&&f.value.message&&f.value.detail),p=o.computed(()=>!(s.value&&s.value.length)&&(c.value||g.value)),h=Yr(t,e,r,i);l.value==="关闭"?l.value=i.close:l.value==="知道了"&&(l.value=i.exception.roger);function y(E){a.value==="question"&&n.emit("reject"),n.emit("close")}function T(E){a.value==="question"&&n.emit("accept"),n.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[u.value&&h(),p.value&&g.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[d.value]),p.value&&c.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[l.value]),m.value&&s.value.length&&s.value.map(E=>o.createVNode("button",{type:"button",onClick:E.handle,class:E.class},[E.iconClass&&o.createVNode("span",{class:E.iconClass},null),E.text]))])}function Qr(t){const{t:n,locale:e}=yt.useI18n();function r(i,a,s){return a===s?n(i):a}return{yes:r("messageBox.yes")||"是",no:r("messageBox.no")||"否",close:r("messageBox.close")||"关闭",ok:r("messageBox.ok",t.okButtonText,"确定")||"确定",cancel:r("messageBox.cancel",t.cancelButtonText,"取消")||"取消",title:r("messageBox.title")||"系统提示",errorTitle:r("messageBox.errorTitle")||"错误提示",exception:{expand:r("messageBox.exception.expand")||"展开",collapse:r("messageBox.exception.collapse")||"收起",happend:r("messageBox.exception.happend")||"发生时间",detail:r("messageBox.exception.detail")||"详细信息",copy:r("messageBox.exception.copy")||"复制详细信息",copySuccess:r("messageBox.exception.copySuccess")||"复制成功",copyFailed:r("messageBox.exception.copyFailed")||"复制失败",roger:r("messageBox.exception.roger")||"知道了"},locale:e.value}}const pt=o.defineComponent({name:"FMessageBox",props:$r,emits:["accept","reject","close"],setup(t,n){const e=Qr(t),r=o.ref(t.type),i=o.ref(t.title),a=o.ref(t.detail),s=o.computed(()=>{const T={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${r.value}`;return T[E]=!0,T}),f=o.computed(()=>{const T={cursor:"default"};return r.value==="prompt"?T.padding="0.5rem 0.5rem 1rem 1.5rem":r.value==="error"&&(T.padding="0.5rem 1.5rem 1rem 1.5rem"),T}),l=Hr(),d=zr(t,r,i,a),g=Ur(),{feedbackStyle:c,feedbackMessage:m}=g;m.value=e.exception.copySuccess;function u(){return o.createVNode("div",{style:c.value},[m.value])}function p(){switch(r.value){case"prompt":return _r(t,d);default:return Xr(t,r,i,a,e)}}const h=p(),y=Jr(t,n,l,g,e);return()=>o.createVNode("div",{class:"farris-messager"},[!t.exceptionInfo&&o.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),o.createVNode("section",{class:s.value,style:f.value},[h()]),y(),u()])}}),Zr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/modal.schema.json",title:"modal",description:"弹窗组件",type:"object",properties:{id:{description:"组件唯一标识",type:"string"},type:{description:"组件类型",type:"string",default:"modal"},appearance:{description:"组件外观",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},name:{description:"名称",type:"string",default:null},title:{description:"标题",type:"string"},width:{description:"窗口宽度",type:"number",default:900},height:{description:"窗口高度",type:"number",default:600},contents:{description:"弹窗子组件集合",type:"array",default:[]},modelValue:{description:"是否显示",type:"boolean",default:!1},showCloseButton:{description:"显示关闭按钮",type:"boolean",default:!0},showMaxButton:{description:"显示最大化按钮",type:"boolean",default:!0},enableEsc:{description:"允许ESC关闭",type:"boolean",default:!0},resizeable:{description:"允许调整窗口尺寸",type:"boolean",default:!0},fitContent:{description:"是否自适应",type:"boolean",default:!1},showButtons:{description:"是否显示底部按钮",type:"boolean",default:!0},mask:{description:"是否模态",type:"boolean",default:!0},draggable:{description:"是否允许拖拽调整位置",type:"boolean",default:!0},onAccept:{description:"确定事件",type:"object",default:null},onCancel:{description:"取消事件",type:"object",default:null},beforeClose:{description:"关闭前事件",type:"object",default:null}},required:["id","type"],events:{onAccept:"确定事件",onCancel:"取消事件",beforeClose:"关闭前回调"}},Kr=new Map([["appearance",vt.resolveAppearance]]);function ei(t,n,e){return n}function ti(){function t(n,e){const r={};return r.beforeClose=i=>e.call("beforeClose",[i,n]),r}return{resolve:t}}const rn={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"}},ni=vt.createPropsResolver(rn,Zr,Kr,ei),oi=ti();class ve{constructor(n,e){this.x=n,this.y=e}static getTransformInfo(n){const r=window.getComputedStyle(n).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(r.length>=6){const i=parseInt(r[4],10),a=parseInt(r[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(n,e=null){if(this.isMouseEvent(n))return new ve(n.clientX,n.clientY);if(e===null||n.changedTouches.length===1)return new ve(n.changedTouches[0].clientX,n.changedTouches[0].clientY);for(let r=0;r<n.changedTouches.length;r++)if(n.changedTouches[r].target===e)return new ve(n.changedTouches[r].clientX,n.changedTouches[r].clientY)}static isMouseEvent(n){return Object.prototype.toString.apply(n).indexOf("MouseEvent")===8}static isIPosition(n){return!!n&&"x"in n&&"y"in n}static getCurrent(n){const e=new ve(0,0);if(window){const r=window.getComputedStyle(n);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);e.x=isNaN(i)?0:i,e.y=isNaN(a)?0:a}return e}return null}static copy(n){return new ve(0,0).set(n)}get value(){return{x:this.x,y:this.y}}add(n){return this.x+=n.x,this.y+=n.y,this}subtract(n){return this.x-=n.x,this.y-=n.y,this}multiply(n){this.x*=n,this.y*=n}divide(n){this.x/=n,this.y/=n}reset(){return this.x=0,this.y=0,this}set(n){return this.x=n.x,this.y=n.y,this}}class Ye{constructor(n,e){this.width=n,this.height=e}static getCurrent(n){const e=new Ye(0,0);if(window){const r=window.getComputedStyle(n);return r&&(e.width=parseInt(r.getPropertyValue("width"),10),e.height=parseInt(r.getPropertyValue("height"),10)),e}return null}static copy(n){return new Ye(0,0).set(n)}set(n){return this.width=n.width,this.height=n.height,this}}function ri(t,n){const e=o.ref(),r=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),f=o.ref(),l=o.ref(),d=o.ref(),g=o.ref(),c=o.ref(),m=o.ref(),u=o.ref(t.resizeable),p=o.ref(),h=o.ref(t.draggable),y=o.ref(!1);function T(){const R=r.value||document.body,M=window.getComputedStyle(R);if(!M||!e.value)return;const K=ve.getTransformInfo(e.value),A={};l.value&&(A.deltaL=e.value.offsetLeft-l.value.x,A.deltaT=e.value.offsetTop-l.value.y);const ae=M.getPropertyValue("position");A.width=R.clientWidth,A.height=R.clientHeight,A.pr=parseInt(M.getPropertyValue("padding-right"),10),A.pb=parseInt(M.getPropertyValue("padding-bottom"),10),A.position=M.getPropertyValue("position"),ae==="static"&&(R.style.position="relative"),A.translateX=K.x,A.translateY=K.y,c.value=A}function E(R){if(e.value){a.value=Ye.getCurrent(e.value),s.value=ve.getCurrent(e.value),f.value=a.value?Ye.copy(a.value):null,l.value=s.value?ve.copy(s.value):null,T();const M=R.target.getAttribute("type")||"";d.value={n:!!M.match(/n/),s:!!M.match(/s/),w:!!M.match(/w/),e:!!M.match(/e/)}}}function D(){var R,M,K,A;if(e.value){const ae=e.value;d.value&&((d.value.n||d.value.s)&&((R=f.value)!=null&&R.height)&&(ae.style.height=f.value.height+"px"),(d.value.w||d.value.e)&&((M=f.value)!=null&&M.width)&&(ae.style.width=f.value.width+"px"),l.value&&((K=l.value)!=null&&K.x&&(ae.style.left=l.value.x+"px"),(A=l.value)!=null&&A.y&&(ae.style.top=l.value.y+"px")))}}function N(){const R=t.minHeight?t.minHeight:1,M=t.minWidth?t.minWidth:1;f.value&&l.value&&d.value&&a.value&&(f.value.height<R&&(f.value.height=R,d.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-R))),f.value.width<M&&(f.value.width=M,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-M))),t.maxHeight&&f.value.height>t.maxHeight&&(f.value.height=t.maxHeight,s.value&&d.value.n&&(l.value.y=s.value.y+(a.value.height-t.maxHeight))),t.maxWidth&&f.value.width>t.maxWidth&&(f.value.width=t.maxWidth,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-t.maxWidth))))}function x(){if(r.value){const R=c.value;if(l.value&&f.value&&d.value&&a.value){const M=R.width-R.pr-R.deltaL-R.translateX-l.value.x,K=R.height-R.pb-R.deltaT-R.translateY-l.value.y;d.value.n&&l.value.y+R.translateY<0&&s.value&&(l.value.y=-R.translateY,f.value.height=a.value.height+s.value.y+R.translateY),d.value.w&&l.value.x+R.translateX<0&&s.value&&(l.value.x=-R.translateX,f.value.width=a.value.width+s.value.x+R.translateX),f.value.width>M&&(f.value.width=M),f.value.height>K&&(f.value.height=K)}}}function b(R){if(!i.value||!a.value||!s.value||!d.value)return;R.subtract(i.value);const M=R.x,K=R.y;d.value.n?(l.value.y=s.value.y+K,f.value.height=a.value.height-K):d.value.s&&(f.value.height=a.value.height+K),d.value.e?f.value.width=a.value.width+M:d.value.w&&(f.value.width=a.value.width-M,l.value.x=s.value.x+M),x(),N(),D()}function C(R){if(!g.value)return;const M=ve.fromEvent(R);M&&b(M)}function w(){if(e.value){const{width:R,height:M,x:K,y:A}=e.value.getBoundingClientRect(),ae=ve.getTransformInfo(e.value);return{size:{width:R,height:M},position:{x:K-ae.x,y:A-ae.y}}}return null}function V(R){if(e.value){const M=w();m.value=M}i.value=void 0,a.value=null,s.value=null,f.value=null,l.value=null,d.value=null,g.value=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",V)}function O(){document.addEventListener("mousemove",C),document.addEventListener("mouseup",V)}function S(R){R instanceof MouseEvent&&R.button===2||h.value&&(document.body.click(),R.stopPropagation(),R.preventDefault(),i.value=ve.fromEvent(R),g.value=R.target,E(R),O())}function Y(R){return e.value=R,u.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:M=>S(M)},null)])}function W(R=!0){document.body.click();const M=r.value||document.body,K=Ye.getCurrent(M),A=e.value;R&&A&&(p.value=w(),p.value.transform=A.style.transform),K&&A&&(f.value=K,f.value.height-=14,f.value.width-=14,A.style.height=f.value.height+"px",A.style.width=f.value.width+"px",A.style.left="7px",A.style.top="7px",A.style.transform="",m.value={size:f.value,position:{x:0,y:0}},h.value=!1,y.value=!0)}function z(){var R,M;if(document.body.click(),p.value){const K={width:p.value.size.width||0,height:p.value.size.height||0},A={x:(window.innerWidth-K.width)/2,y:(window.innerHeight-K.height)/2};(R=f.value)==null||R.set(K),(M=l.value)==null||M.set(A);const ae=e.value;ae.style.height=K.height+"px",ae.style.width=K.width+"px",ae.style.left=`${A.x}px`,ae.style.top=`${A.y}px`,ae.style.transform="",m.value={size:K,position:A},h.value=t.draggable,y.value=!1}}function J(){if(e.value){const R=Ye.getCurrent(e.value);if(R){const{width:M,height:K}=R;e.value.style.left=`${(window.innerWidth-M)/2}px`,e.value.style.top=`${(window.innerHeight-K)/2}px`,e.value.style.transform=""}}}function oe(){const R=()=>{y.value?W(!1):J(),document.body.click()};return window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}}const fe=oe();return{renderResizeBar:Y,boundingElement:r,resizedEventParam:m,maximize:W,restore:z,allowDrag:h,isMaximized:y,unWindowResizeHandle:fe,moveToCenter:J}}function ii(t,n,e){const r=o.ref(),i=o.ref(t.draggable),a=o.ref(t.lockAxis),s=o.ref(),f=o.ref(),l=o.ref(!1),d=o.ref(new ve(0,0)),g=o.ref(new ve(0,0)),c=o.ref(new ve(0,0)),m=o.ref(new ve(0,0));o.watch(()=>e.value,C=>{s.value.style.cursor=C?"move":"default"});function u(C,w){if(w.tagName==="BUTTON")return!1;if(w===C)return!0;for(const V in w.children)if(Object.prototype.hasOwnProperty.call(w.children,V)&&u(C,w.children[V]))return!0;return!1}function p(){var O,S;let C=c.value.x+g.value.x,w=c.value.y+g.value.y;a.value==="x"?(C=((O=d.value)==null?void 0:O.x)||0,c.value.x=0):a.value==="y"&&(w=((S=d.value)==null?void 0:S.y)||0,c.value.y=0);const V=`translate3d(${Math.round(C)}px, ${Math.round(w)}px, 0px)`;r.value&&(r.value.style.transform=V),m.value.x=C,m.value.y=w}function h(){if(!f.value||!r.value)return null;const C=f.value.getBoundingClientRect(),w=r.value.getBoundingClientRect(),V={top:C.top<w.top,right:C.right>w.right,bottom:C.bottom>w.bottom,left:C.left<w.left};return V.top||(c.value.y-=w.top-C.top),V.bottom||(c.value.y-=w.bottom-C.bottom),V.right||(c.value.x-=w.right-C.right),V.left||(c.value.x-=w.left-C.left),p(),V}function y(C){C&&(d.value&&C.subtract(d.value),c.value.set(C),p(),h())}function T(C){l.value&&i.value&&(C.stopPropagation(),C.preventDefault(),y(ve.fromEvent(C,s.value)))}function E(){var C;l.value&&(l.value=!1,g.value.add(c.value),c.value.reset(),(C=r.value)==null||C.classList.remove("ng-dragging"),n.emit("stopMove"),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",E))}function D(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",T),document.addEventListener("mouseup",E))}function N(){if(r.value){const C=ve.getTransformInfo(r.value);g.value.set(C);return}g.value.reset()}function x(C){if(!e.value||C instanceof MouseEvent&&C.button===2)return;const w=C.target||C.srcElement;s.value!==void 0&&w&&!u(w,s.value)||i.value!==!1&&(document.body.click(),C.stopPropagation(),C.preventDefault(),d.value=ve.fromEvent(C,r.value),N(),D())}function b(C,w,V){if(i.value&&w){if(C)s.value=C;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)s.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const O=w.querySelector(t.dragHandle);O&&(s.value=O)}}r.value=w,f.value=V,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",x)):i.value=!1}}return{registerDraggle:b,resetTranslate:N}}function an(t,n){if(t){const e=r=>{r.key.toLowerCase()===t.toLowerCase()&&n({event:r,key:t})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function ai(t,n){const e=o.ref(t.enableEsc);let r=null;return e.value?(r=an("Escape",i=>{n.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function si(t,n){const e=o.ref(t.enableEnter);let r=null;return e.value?(r=an("Enter",i=>{n.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const Je=o.defineComponent({name:"FModal",props:rn,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(t,n){const e=o.ref(t.width||300),r=o.ref(t.height||200),i=o.ref(t.modelValue),a=o.ref(""),s=o.ref(t.class),f=o.ref(t.fitContent),l=o.ref(t.showHeader),d=o.ref(""),g=o.ref(t.showCloseButton),c=o.ref(t.showMaxButton),m=o.ref(!1),u=o.ref(t.dialogType),p=o.ref(t.src),h=o.ref(""),y=o.ref(t.showButtons),T=o.ref(t.title),E=o.ref(t.containment||null),D=o.ref(),{t:N}=yt.useI18n();T.value==="错误提示"&&(T.value=N("messageBox.errorTitle"));const x=o.ref(!1);function b(I,te){const be=te?"accept":"cancel";Promise.resolve().then(()=>{var xe;return(xe=t.beforeClose)==null?void 0:xe.call(t,{closeType:be})}).then(xe=>{xe&&(i.value=!1,n.emit("update:modelValue",!1),te!=null&&n.emit(te?"accept":"cancel"),n.emit("closed",I))})}const C=[{name:"cancel",text:N("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:I=>{b(I,!1)}},{name:"accept",text:N("messageBox.ok")||"确定",class:"btn btn-primary",handle:I=>{b(I,!0)}}],w=o.ref(t.buttons&&t.buttons.length?t.buttons:C),V=o.computed(()=>!!d.value),O=o.computed(()=>!!y.value&&!!w.value),S=o.ref(),Y=o.ref(),W=o.ref(!1),{renderResizeBar:z,maximize:J,restore:oe,boundingElement:fe,resizedEventParam:R,allowDrag:M,unWindowResizeHandle:K,moveToCenter:A}=ri(t),{registerDraggle:ae}=ii(t,n,M);function Ce(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ge(){const I=document.querySelectorAll(".farris-modal").length;(!I||I-1<=0)&&document.body.classList.remove("modal-open"),D.value&&D.value.classList.remove("show")}o.watch(()=>t.title,(I,te)=>{I!==te&&(T.value=I)}),o.watch(()=>t.modelValue,(I,te)=>{I!==te&&(i.value=I,i.value&&t.draggable&&o.nextTick(()=>{Y.value&&!E.value&&(E.value=Y.value.parentElement,fe.value=E.value,ae(S.value,Y.value,fe.value),A())}),I||(E.value&&(E.value=null),ge())),i.value?x.value=Ce():(W.value=!1,M.value=t.draggable)}),o.watch(()=>t.showHeader,(I,te)=>{I!==te&&(l.value=I)}),o.watch(()=>t.showButtons,(I,te)=>{I!==te&&(y.value=I)}),o.watch(()=>R.value,(I,te)=>{const be=I||{},xe=te||{};JSON.stringify(be)!==JSON.stringify(xe)&&n.emit("resize",{newSize:I,oldSize:te,isMaximized:W.value})});const ee=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),pe=o.computed(()=>{var be;const I={modal:!0,"farris-modal":!0,fade:!0};I["f-modal-fitContent"]=!!f.value,I.show=!!ee.value;const te=(be=t.maskClass)==null?void 0:be.split(" ");return te==null||te.reduce((xe,Ue)=>(xe[Ue]=!0,xe),I),I}),he=o.computed(()=>{var be;const I={"modal-dialog":!0},te=(be=s.value)==null?void 0:be.split(" ");return te==null||te.reduce((xe,Ue)=>(xe[Ue]=!0,xe),I),I}),le=o.computed(()=>{const I={position:"absolute",top:`${(window.innerHeight-r.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:f.value?"auto":`${r.value}px`};return t.mask||(I.pointerEvents="auto"),I}),U=()=>Oe.getMaxZIndex()||1040,de=o.computed(()=>{const I={display:"block",zIndex:U()};return t.mask||(I.pointerEvents="none",I.backgroundColor="transparent"),x.value&&(I.backgroundColor="transparent"),I}),Ae=o.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),$e=o.computed(()=>{const I={display:l.value?"":"none"};return I["pointer-events"]=M.value?"auto":"none",I}),Be=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:W.value})),We=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":u.value==="iframe","f-utils-fill":!0}));function ze(){return{height:`${t.footerHeight||60}px`}}const Ge=o.computed(()=>{const I={textAlgin:h.value},te=ze();return Object.assign(I,te)});function ye(I){if(I==null||I.stopPropagation(),W.value){W.value=!1,oe();return}J(),W.value=!0}async function Qe(I,te){I.handle&&await I.handle(te,I)&&n.emit("closed",te)}function Le(I){I.width&&(e.value=I.width),I.height&&(r.value=I.height),I.buttons&&(w.value=I.buttons),I.title&&(T.value=I.title)}let qe=null,G=null;o.onBeforeMount(()=>{x.value=Ce()}),o.onMounted(()=>{Y.value&&!E.value&&(E.value=Y.value.parentElement,fe.value=E.value,ae(S.value,Y.value,fe.value)),ee.value&&document.body.classList.add("modal-open"),qe=ai(t,n),G=si(t,n)}),o.onUnmounted(()=>{K&&K(),qe&&qe.remove(),G&&G.remove()}),n.expose({modalElementRef:Y,updateModalOptions:Le,close:b,maxDialog:ye,isMaximized:W});function X(){return o.createVNode("ul",null,[m.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&o.createVNode("li",{onClick:ye,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Be.value},null)]),g.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:I=>b(I,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function _(){return o.createVNode("div",{class:"modal-footer",style:Ge.value},[w.value&&w.value.map(I=>{const te=o.ref(I.disabled);return o.createVNode("button",{name:I.name,type:"button",disabled:te.value,class:I.class+(I.iconClass?" btn-icontext":""),onClick:be=>{Qe(I,be)}},[!!I.iconClass&&o.createVNode("i",{class:I.iconClass},null),I.text])})])}function ie(){return o.createVNode("div",{ref:S,class:"modal-header",style:$e.value},[n.slots.headerTemplate?n.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[V.value&&o.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[T.value])]),o.createVNode("div",{class:"actions"},[X()])])}function ue(){return n.slots.footerTemplate?n.slots.footerTemplate():O.value&&_()}function Ne(I){if(I.stopPropagation(),t.allowClickMaskToClose){if(I.target!==D.value)return;b(I,!1)}}function Te(){var I,te;return o.createVNode("div",{id:a.value,class:he.value,style:le.value,ref:Y},[o.createVNode("div",{class:Ae.value},[l.value&&ie(),o.createVNode("div",{class:We.value},[(te=(I=n.slots).default)==null?void 0:te.call(I),u.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),ue()]),!f.value&&Y.value&&!W.value&&z(Y.value)])}function Xe(I){return I||"body"}return()=>o.createVNode(o.Teleport,{to:Xe(t.host)},{default:()=>[ee.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:D,class:pe.value,style:de.value,onClick:Ne},[Te()])]})]})}});function sn(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function li(t){const n=document.createElement("div");n.style.display="contents";const e=o.createApp({setup(r,i){o.onUnmounted(()=>{document.body.removeChild(n)});const a=o.ref(),s=o.ref(t.class||""),f=o.ref(!!t.showButtons),l=o.ref(!!t.showHeader),d=o.ref(t.showCloseButton==null?!0:t.showCloseButton),g=o.ref(!0),c=o.ref(t.title||""),m=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{}),p=t.closedCallback||(D=>{}),h=t.resizeHandle||(D=>{}),y=t.stopMoveHandle||(D=>{}),T=sn(t),E=D=>{g.value=!1,e.unmount(),p(D)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(Je,{ref:a,class:s.value,modelValue:g.value,"onUpdate:modelValue":D=>g.value=D,title:c.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":l.value,"show-buttons":f.value,"show-close-button":d.value,"show-max-button":!1,onAccept:m,onCancel:u,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:E,onResize:h,onStopMove:y},{default:()=>[T&&T(e)]})}});return document.body.appendChild(n),e.use(lt.LocaleService.i18n),e.mount(n),e}class ln{constructor(n){Z(this,"appContext",null);Z(this,"modalRef",o.ref());Z(this,"activeModalIndex",o.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",o.ref(!1));Z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=n,this.appContext=n?n._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(n,e){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<n&&(n=r-14),i<e&&(e=i-14),{width:n,height:e}}static show(n){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return li(e)}close(n){var e,r;n?(r=n.value)==null||r.close():(e=this.getCurrentModal())==null||e.close()}open(n){const e=document.createDocumentFragment();n.showMaxButton&&n.fitContent&&(n.showMaxButton=!1);const r=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},n)),i=o.ref(!0),a=r.value.acceptCallback||(()=>{}),s=r.value.rejectCallback||(()=>{}),f=r.value.closedCallback||((x,b)=>{}),l=r.value.resizeHandle||(x=>{}),d=n.stopMoveHandle||(x=>{});let g;const c=sn(r.value),m=x=>{var C;i.value=!1;const b=(C=x==null?void 0:x.target)==null?void 0:C.classList.contains("modal_close");f(x,this.isUseEscCloseModal.value?"esc":b?"icon":"button")},u=x=>{m(x),g&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),g=null,this.modalRef.value=null,this.modalRefs){const b=Object.keys(this.modalRefs).map(C=>Number(C));b.length>0?this.activeModalIndex.value=Math.max(...b):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=x=>{var b;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((b=this.activeModalInstance.value)==null||b.close(x==null?void 0:x.event))},{width:h,height:y}=r.value,T=this.adaptToWindow(h||500,y||320);Object.assign(r.value,T);const E=()=>o.createVNode(Je,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":x=>i.value=x},r.value,{onAccept:a,onCancel:s,onClosed:u,onResize:l,onEsc:p,onStopMove:d}),{default:()=>[c&&c(this.app)]});return g=(x=>{const b=o.h(E,x);return b.appContext=this.appContext,o.render(b,e),b})({...r.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:x=>{r.value={...r.value,...x},g&&o.render(o.cloneVNode(g,{...r}),e)},destroy:u,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ci=Symbol("FModalService");Je.install=t=>{t.component(Je.name,Je);const n=new ln(t);t.provide(ci,n),t.provide("FModalService",n)},Je.register=(t,n,e,r)=>{t.modal=Je,n.modal=ni,r.modal={callbackResolver:oi}};const Re=class Re{static show(n){const e=o.reactive({...n}),r=!1,i=e.type==="error"||e.type==="prompt",a=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",s=e.acceptCallback||(()=>{}),f=e.rejectCallback||(()=>{});let l=null,d=new ln(Re.app);const g=()=>{l&&(l==null||l.destroy(),d=null)};return l=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:a,showButtons:r,showHeader:i,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>o.createVNode(pt,o.mergeProps(e,{onAccept:s,onReject:f,onClose:g}),null)}),d==null?void 0:d.getCurrentModal()}static info(n,e){const r=o.reactive({type:"info",title:n,detail:e,okButtonText:"知道了",showCancelButton:!1});Re.show(r)}static warning(n,e){const r=o.reactive({type:"warning",title:n,detail:e,okButtonText:"知道了",showCancelButton:!1});Re.show(r)}static success(n,e){const r=o.reactive({type:"success",title:n,detail:e,okButtonText:"关闭",showCancelButton:!1});Re.show(r)}static error(n,e,r){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:r,message:n,detail:e}});Re.show(i)}static prompt(n,e){const r=o.reactive({type:"prompt",title:n,detail:e,okButtonText:"确定",cancelButtonText:"取消"});Re.show(r)}static question(n,e,r,i){const a=o.reactive({type:"question",title:n,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:r,rejectCallback:i});Re.show(a)}};Z(Re,"app",null);let mt=Re;pt.install=t=>{t.component(pt.name,pt),mt.app=t,t.provide("FMessageBoxService",mt)};class di extends nn{constructor(e,r){super(e,r);Z(this,"responseLayoutEditorFunction");Z(this,"bindingVarible");Z(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=Cr(this.formSchemaUtils)}getCommonPropertyConfig(e,r,i="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(e,r,i),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,r),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group")}getPropertyConfig(e,r){return this.getCommonPropertyConfig(e,r,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(e,r){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,r,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,r,i="Card"){const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:f}=this.getAvailableEditorType(e),l={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:f,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(d,g,c){if(d)switch(d&&d.propertyID){case"type":{a.changeControlType(e,d,r);break}case"label":{d.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,d,c);break}}}};return i.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(e,r){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==Oe.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a;const r=this.checkCanChangeControlType(e,this.viewModelId);if(!r)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((a=P[e.editor.type])==null?void 0:a.name)||e.editor.type}]};let i=[];return this.designViewModelField&&this.designViewModelField.$type===Oe.FormSchemaEntityField$Type.SimpleField?i=nt.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=nt.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:r,editorTypeList:i}}changeBindingField(e,r,i){r.needRefreshEntityTree=!0}getAppearanceProperties(e,r){const i=this;return{title:"外观",description:"Appearance",properties:{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"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,i.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||e.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(e.id,r),delete e.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,e.id,this.componentId),dt.value++;break;case"style":{dt.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,r,i){const a=r.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const f=s.contents.findIndex(g=>g.id===e.id);if(f===-1)return;const l=s.contents[f];let d;if(this.designViewModelField){const m=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};m.editor||(m.editor={}),m.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,m,!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}d||(d=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(d,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(d,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(g=>{Object.prototype.hasOwnProperty.call(l.editor,g)&&(d.editor[g]=l.editor[g])}),i!=null&&i.updateContextSchema?i.updateContextSchema(d):(i.schema=Object.assign(l,d),Object.assign(e,d)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(g=>g.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused")),dt.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,r={},i={},a){var m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},r),f=(m=e.binding)!=null&&m.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(e,f,"readonly"),d=this.getPropertyEditorParams(e,f,"required"),g={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:d},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const u in i)g[u]=Object.assign(g[u]||{},i[u]);const c=this;return{...s,properties:{...g},setPropertyRelates(u,p){if(u){switch(u.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(e,u);break}a&&a.bind(c)(u,e,p)}}}}updateUnifiedLayoutAfterControlChanged(e,r,i){const a=e.split(" ");let s=a.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),f=a.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=a.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),d=a.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));s=s||"col-12",f=f||"col-md-"+s.replace("col-",""),l=l||"col-xl-"+f.replace("col-md-",""),d=d||"col-el-"+l.replace("col-xl-","");const g={id:r,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(f.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,g)}updateUnifiedLayoutAfterResponseLayoutChanged(e,r){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),r){const p=a.find(h=>h.id===r.id);Object.assign(p||{},r)}const s=a.map(p=>p.columnInSM),f=a.map(p=>p.columnInMD),l=a.map(p=>p.columnInLG),d=a.map(p=>p.columnInEL),g=this.checkIsUniqueColumn(s)?s[0]:null,c=this.checkIsUniqueColumn(f)?f[0]:null,m=this.checkIsUniqueColumn(l)?l[0]:null,u=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:g,uniqueColClassInMD:c,uniqueColClassInLG:m,uniqueColClassInEL:u})}checkIsUniqueColumn(e){const r=new Set(e);return Array.from(r).length===1}getItemCollectionEditor(e,r,i){return r=r||"value",i=i||"name",{editor:{columns:[{field:r,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:r,nameField:i,requiredFields:[r,i],uniqueFields:[r,i],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===Oe.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,r){e.binding&&e.binding.type===ot.Form&&e.binding.field?(r.find(s=>s.label==="fieldValueChanging")||r.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),r.find(s=>s.label==="fieldValueChanged")||r.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):r=r.filter(i=>i.label!=="fieldValueChanging"&&i.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case ot.Form:return e.binding.path||e.type;case ot.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,r="card",i,a){const s=this;let f=[];i&&(f=f.concat(i)),this.appendFieldValueChangeEvents(e,f);const l=s.eventsEditorUtils.formProperties(e,s.viewModelId,f);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,m){const u=c.propertyValue;delete e[s.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,u.controlInfo={type:s.getControlMethodType(e),name:e.title},s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,u.events,u)),a&&a(c,m,u);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:e.fieldValueChanging,valueChanged:e.fieldValueChanged})}}}getExpressionConfig(e,r,i=["compute","dependency","validate"],a){return new wt(this.formSchemaUtils).getExpressionConfig(e,r,i,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,r,i){var a;e.editor[r]!==i?e.editor[r]=i:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(e,r,i){let a=i;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(r==="trueValue"?"true":"false"));const f=r==="trueValue"?"falseValue":"trueValue";e.editor[f]===a&&(a=a+1),this.updatePropertyValue(e,r,a)}getBooleanValueConverter(){return{convertFrom:(e,r)=>e.editor[r],convertTo:(e,r,i)=>{this.setBooleanValue(e,r,i)}}}}const ui={install(t){t.component(xt.name,xt)}};F.BaseControlProperty=nn,F.ExpressionProperty=wt,F.FPropertyPanel=xt,F.FormBindingType=ot,F.InputBaseProperty=di,F.PropertyType=on,F.SchemaDOMMapping=nt,F.default=ui,F.propertyPanelItemProps=Gt,F.propertyPanelProps=Dt,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
6
+ </div>`,placement:"left"}),g=o.ref("");return g.value=`${e.value}-${r.value}`,()=>o.createVNode("div",{class:s.value},[t.elementConfig.propertyName&&o.withDirectives(o.createVNode("label",{class:`col-form-label ${g.value}`},[o.createVNode("span",{class:"farris-label-text"},[i.value])]),[[o.resolveDirective("tooltip"),d]]),o.createVNode(pr,{id:g.value,showLabel:!1,editor:t.elementConfig.editor,modelValue:a.value,onChange:f,editorParams:t.elementConfig.editorParams},null)])}}),gr=o.defineComponent({name:"FPropertyPanelItemList",props:nr,emits:["valueChanged","submitModal","triggerRefreshPanel"],setup(t,n){const e=o.ref(t.category);function r(u){if(!u.hideCascadeTitle)return o.createVNode("div",{class:"farris-input-wrap"},[o.createVNode("input",{title:"summary",type:"input",class:"form-control form-control-sm",value:u.cascadeSummary,readonly:!0},null)])}function i(u,p){p.isExpand=!p.isExpand}function a(u){return o.createVNode("div",{class:"landscape"},[o.createVNode("button",{title:"expand-button",class:["btn f-btn-collapse-expand f-btn-mx px-1",{"f-state-expand":u.isExpand}],onClick:p=>i(p,u)},[o.createVNode("span",null,null)])])}function s(u){return o.createVNode("div",{class:`f-section-formgroup-legend ${e.value.categoryId}-${u.propertyID}`},[o.createVNode("div",{class:"f-header px-0 my-0 col-form-label",style:"font-size: inherit;"},[o.createVNode("div",{class:"wrap"},[o.createVNode("span",{class:["f-icon mr-1",{"f-icon-arrow-60-right":!u.isExpand,"f-icon-arrow-60-down":u.isExpand}]},null),o.createVNode("span",{class:"farris-label-text"},[u.propertyName])])])])}function f(u){return`${t.categoryKey}_${u.propertyID}`}function l(u,p){u.categoryId=e.value.categoryId,e.value.enableCascade&&(u.propertyPath=e.value.parentPropertyID),e.value.setPropertyRelates&&e.value.setPropertyRelates(u,t.propertyData,p),n.emit("valueChanged",{changeObject:u})}function d(){n.emit("triggerRefreshPanel")}function g(u){return o.createVNode("div",{class:"px-2 mb-2"},[o.createVNode(mr,{key:f(u),elementConfig:u,category:e.value,onPropertyChange:l,onTriggerRefreshPanel:d},null)])}function c(u){var p;return o.createVNode("div",{class:"propertyCascadeItem farris-panel px-2 mb-2"},[o.createVNode("div",{class:["farris-panel-item card",{hidden:!u.isExpand}]},[o.createVNode("div",{class:"card-header",onClick:h=>i(h,u)},[o.createVNode("div",{class:"panel-item-title"},[o.createVNode("div",{class:"form-group farris-form-group line-item"},[s(u),r(u),a(u)])])]),o.createVNode("div",{class:["card-body",{hidden:!u.isExpand}]},[(p=u.cascadeConfig)==null?void 0:p.map(h=>g(h))])])])}o.watch(()=>t.category,()=>{e.value=t.category});function m(u){return u.propertyType==="cascade"?c:g}return()=>o.createVNode(o.Fragment,null,[e.value.properties.map(u=>m(u)(u))])}}),xt=o.defineComponent({name:"FPropertyPanel",props:Dt,emits:["propertyChanged"],setup(t,n){const e=o.ref(t.width),r=o.ref(t.isWidePanel),i=o.ref(t.enableSearch),a=o.ref(t.mode),s=o.ref(t.isPersitOpenState),f=o.ref(t.isShowPanel),l=o.ref(),d=o.ref(),g=o.ref(t.showCloseBtn),c=o.ref(t.selectedTabId),m=o.ref(!0),u=o.ref(t.isWhiteTheme);let p=[],h=[];const y=o.ref(""),T=o.ref(),E=o.ref(),D=o.inject("SchemaService");let N=[],x=null,b="";const C=o.ref(),w=o.ref(0),V=o.computed(()=>p.map(G=>!G.hide).length===1),O=o.inject("designerContext");function S(){h=[],C.value&&C.value.categoryList&&Array.isArray(C.value.categoryList)&&C.value.categoryList.length>0&&C.value.categoryList.forEach(X=>{if(X.properties&&Array.isArray(X.properties)&&X.properties.length>0){const _=X.properties.map(ie=>(ie.category=X,ie.propertyType==="cascade"&&ie.cascadeConfig&&ie.cascadeConfig.map(ue=>{ue.category=X,ue.cascadeParent=ie,h=h.concat(ue)}),ie));h=h.concat(_)}})}function Y(G){let X=G.offsetTop,_=G.offsetParent;for(;_!==null;)X+=_.offsetTop,_=_.offsetParent;return X}function W(G,X){G&&X&&Object.keys(X).length>0&&Object.keys(X).forEach(_=>{var ue;const ie=X[_];(ue=G.style)==null||ue.setProperty(_,ie)})}function z(){return h.filter(X=>{if(typeof X.visible=="function"&&!X.visible()||typeof X.visible=="boolean"&&!X.visible)return!1;const _=X.propertyID.toLowerCase(),ie=X.propertyName.toLowerCase();return!!(_&&_.includes(y.value.toLowerCase())||ie&&ie.includes(y.value.toLowerCase()))})}function J(G,X,_){if(G===0){const ie=Y(X),Ne=Y(_)-ie-5;X==null||X.scroll({top:Ne,behavior:"smooth"})}}function oe(G){N&&N.length>0&&(N.forEach(_=>{_.style.cssText=""}),N=[]);const X=E.value;if(!y.value)T.value&&X&&(X.scrollTop=0);else if(S(),h&&h.length>0){const _=z();_&&_.length>0&&setTimeout(()=>{let ie=null,ue=-1,Ne=!1;_.forEach((Te,Xe)=>{const I=Te.propertyType==="cascade"?`.${Te.category.categoryId}-${Te.propertyID} .farris-label-text`:`.property-item .${Te.category.categoryId}-${Te.propertyID}.col-form-label`,te=document.querySelector(I);te&&(Te.category.status!=="open"&&(Te.category.status="open",Ne=ue<0),Te.cascadeParent&&(Te.cascadeParent.isExpand=!0),ue<0&&(ie=te,ue=Xe),W(te,{color:"#5B89FE"}),N.push(te))}),ue>-1&&(Ne?o.nextTick(()=>{J(ue,X,ie)}):J(ue,X,ie))},50)}}function fe(G){oe()}const R=me.debounce(fe,200);function M(G){const{value:X}=G.target;R(X)}function K(G){fe(y.value)}function A(){s.value||(m.value=!1),n.emit("closePropertyPanel")}function ae(G){y.value="",oe()}function Ce(G){!G.status||G.status==="open"?G.status="closed":G.status="open"}function ge(){var G,X;if(p=[],!l.value||l.value.length===0){p=[{tabId:"default",tabName:"属性",categoryList:[]}],C.value=null;return}if((G=l==null?void 0:l.value)==null||G.forEach(_=>{if(_.tabId){const ie=p.find(ue=>ue.tabId===_.tabId);ie?(ie.categoryList.push(_),ie.hide&&(ie.hide=_.hide||_.properties.length===0)):p.push({tabId:_.tabId,tabName:_.tabName,categoryList:[_],hide:_.hide||_.properties.length===0})}else{const ie=p.find(ue=>ue.tabId==="default");ie?ie.categoryList.push(_):p.push({tabId:"default",tabName:"属性",categoryList:[_]})}}),c.value){const _=p==null?void 0:p.find(ie=>ie.tabId===c.value&&!ie.hide);C.value=_||p[0]}else C.value=p[0];c.value=(X=C.value)==null?void 0:X.tabId}o.watch(()=>[t.schema,t.isShowPanel],()=>{d.value=t.schema,!t.schema||!t.schema.type?l.value=[]:(l.value=bt(d.value,D,x,b),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value))),ge(),ae(y.value),w.value++}),o.onMounted(()=>{ge()});function ee(G,X,_=!0){(!d.value||X)&&(d.value=X||t.schema),l.value=bt(d.value,D,x,b,G),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value)),ge(),i.value&&ae(y.value),_&&w.value++}function pe(G,X){x=G,b=X}function he(){a.value=a.value==="panel"?"sidebar":"panel",a.value==="panel"?(setTimeout(()=>{fe()},100),e.value="300px"):e.value="41px"}function le(){if(g.value)return o.createVNode("div",{class:"title-actions"},[o.createVNode("div",{class:"monaco-toolbar"},[o.createVNode("div",{class:"monaco-action-bar animated"},[o.createVNode("ul",{class:"actions-container",role:"toolbar"},[o.createVNode("li",{class:"action-item",onClick:A},[o.createVNode("span",{class:"f-icon f-icon-close"},null)])])])])])}function U(){l.value=bt(d.value,D,x,b),O.filterPropertyEntity&&(l.value=O.filterPropertyEntity(l.value,d.value)),ge()}function de(){var G;if(i.value&&((G=C.value)==null?void 0:G.tabId)!=="commands")return o.createVNode("div",{class:"search"},[o.createVNode("div",{class:"input-group f-state-editable border-left-0 border-right-0"},[o.withDirectives(o.createVNode("input",{class:"form-control f-utils-fill text-left pt-3 pb-3 textbox",type:"text",placeholder:"输入属性名称或编号快速定位",autocomplete:"off",onKeyup:X=>M(X),"onUpdate:modelValue":X=>y.value=X},null),[[o.vModelText,y.value]]),o.createVNode("div",{class:"input-group-append",style:"margin-left: 0px; background:none;"},[o.createVNode("span",{class:"input-group-text input-group-clear",style:[{display:y.value&&y.value.length>0?"":"none"}],onClick:X=>ae()},[o.createVNode("i",{class:"f-icon modal_close"},null)]),o.createVNode("span",{class:"input-group-text input-group-clear",onClick:X=>K()},[o.createVNode("i",{class:"f-icon f-icon-search"},null)])])])])}function Ae(G){return`${t.propertyName}_${G.categoryId}`}function $e(G){n.emit("propertyChanged",{...G,designerItem:x})}function Be(){var G,X;if(C.value)return o.createVNode("div",{class:"panel-body",ref:E},[o.createVNode("ul",{class:["property-grid",{"wide-panel":r.value}]},[(X=(G=C.value)==null?void 0:G.categoryList)==null?void 0:X.map(_=>!_.hide&&o.createVNode("li",{key:Ae(_),"data-category-id":_==null?void 0:_.categoryId},[!_.hideTitle&&o.createVNode("span",{class:"group-label",onClick:()=>Ce(_)},[o.createVNode("span",{class:["f-icon mr-2",{"f-legend-show":_.status==="closed"},{"f-legend-collapse":_.status==="open"||_.status===void 0}]},null),_.categoryName]),o.createVNode("div",{hidden:_.status==="closed"},[o.createVNode(gr,{key:`${_==null?void 0:_.categoryId}-${w.value}`,category:_,propertyData:d.value,onTriggerRefreshPanel:U,onValueChanged:$e},null)])]))])])}function We(){if(a.value==="sidebar")return o.createVNode("div",{class:"side-panel h-100",onClick:he},[o.createVNode("i",{class:"f-icon f-icon-engineering w-100 icon"},null),o.createVNode("span",null,[o.createTextVNode("属性")])])}function ze(){return{display:m.value?"block":"none",width:e.value}}function Ge(){return o.createVNode("div",{class:"switcher"},[o.createVNode("i",{class:"f-icon f-icon-exhale-discount",style:[{transform:a.value==="sidebar"?"none":"rotate(180deg)"}],onClick:he},null)])}function ye(G){C.value&&C.value.tabId===G.tabId||(C.value=G,c.value=C.value.tabId,y.value="")}function Qe(){return p.map(G=>o.createVNode("div",{class:["title-label",{active:C.value&&C.value.tabId===G.tabId},{"d-none":G.hide}],onClick:()=>ye(G)},[o.createVNode("span",null,[G.tabName])]))}o.onMounted(()=>{fe(y.value)}),o.onBeforeMount(()=>{s.value&&(m.value=f.value),ge(),fe(y.value)});function Le(){w.value++}function qe(){U()}return n.expose({updatePropertyConfig:ee,updateDesignerItem:pe,reloadPropertyPanel:Le,refreshPanel:qe}),()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{ref:T,class:["property-panel",{"white-theme":u.value}],style:ze()},[o.createVNode("div",{class:"propertyPanel panel flex-column",hidden:a.value!=="panel"},[o.createVNode("div",{class:["title d-flex",{"p-right":g.value},{only:V.value}]},[Qe(),le()]),de(),Be()]),Ge(),We()])])}}),hr=o.ref(0);function yr(){hr.value++}const dt=o.ref(0);function vr(t){const{formSchemaUtils:n,formStateMachineUtils:e}=t;function r(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function i(l,d=""){return n.getViewModelById(l).states.map(c=>r(c,d))}function a(l){const d=n.getRootViewModelId(),g=i(l);if(l===d)return g;const c=i(d,"root-component.");return[...g,...c]}function s(l){return l.binding&&l.binding.path||l.id||""}function f(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:f}}class wt{constructor(n){Z(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'"}]);Z(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Z(this,"getExpressionConverter",(n,e)=>({convertFrom:(r,i,a,s)=>{const f=a.getExpressionRuleValue(n,e||i);return f&&f.value||""},convertTo:(r,i,a,s,f)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const d=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(c=>c.id===d&&c.value))?r.dictPickingExpressionId=d:delete r.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=n}getExpressionRule(n,e){const r=this.formSchemaService.getExpressions();if(!r)return"";const i=r.find(s=>s.target===n);if(!i)return"";const a=i.rules.find(s=>s.type===e);return a||""}getContextFormVariables(){const{module:n}=this.formSchemaService.getFormSchema();if(!n.viewmodels||n.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),r=this.formSchemaService.getViewModelById(e);if(!r||!r.states||r.states.length===0)return[];const i=[];return r.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(n,e,r="label"){return{id:n.id,name:n.name,bindingPath:n[r],parents:e,type:"field"}}buildEntityFieldsTreeData(n=null,e){const r=[];return n==null||n.forEach(i=>{var f;const a=this.createTreeNode(i,e);let s=[];(f=i.type)!=null&&f.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...e,i.label])),r.push({data:a,children:s,expanded:!0})}),r}buildChildEntityTreeData(n=null,e){const r=[];return n==null||n.forEach(i=>{var l,d;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...e,i.label]),f=this.buildChildEntityTreeData((d=i.type)==null?void 0:d.entities,[...e,i.label]);f!=null&&f.length&&(s==null||s.push(...f)),r.push({data:a,children:s||[],expanded:!0})}),r}getEntitiesTreeData(){const n=this.formSchemaService.getSchemaEntities();if(!(n!=null&&n.length))return[];const e=n[0];if(!(e!=null&&e.type))return[];const r=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),i=this.buildChildEntityTreeData(e.type.entities,[e.code]);return i!=null&&i.length&&(r==null||r.push(...i)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:r||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(n,e,r){const i=r==="Field"?n.binding.field:n.id,a=this.getExpressionRule(i,e),s=this.getEntitiesAndVariables(),f={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(f.messageType=a.messageType),f}buildRule(n,e,r,i){const{expression:a,message:s,messageType:f}=e,l={id:`${n}_${r}`,type:r,value:a};return(r==="validate"||r==="dataPicking"||r==="required")&&(l.message=s),r==="dataPicking"&&(l.messageType=f),r==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:n}=this.formSchemaService.getFormSchema().module;return n||[]}updateExpression(n,e,r,i){const a=e==="Field"?n.binding.field:n.id,s=this.buildRule(a,r,i,n.type==="form-group"?n.id:"");let l=this.getExpressionData().find(g=>g.targetType===e&&g.target===a);const d=g=>g.value.trim()==="";if(l){const g=l.rules.find(c=>c.id===s.id);if(g)d(s)?l.rules=l.rules.filter(c=>c.id!==s.id):(Object.assign(g,s),i==="validate"&&n.type==="form-group"&&(g.elementId=n.id));else{if(d(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(d(s))return null;l={target:`${a}`,rules:[s],targetType:e}}return l}getExpressionEditorOptions(n,e,r,i){return r.reduce((a,s)=>{var l,d;const f=e==="Field"?(l=n==null?void 0:n.binding)==null?void 0:l.field:n.id;return a[s]={hide:e==="Field"?!!((d=n==null?void 0:n.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(f),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(n,s,e),onSubmitModal:g=>{const c=this.updateExpression(n,e,g,s);if(i){const m=this.buildRule(f,g,s);i(m)}return c}}},a},{})}getExpressionInfo(n,e,r){const i=e==="Field"?n.binding.field:n.id,a=this.getExpressionRule(i,r),s={value:a&&a.value,targetId:i,targetType:e,expressionType:r};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(n,e,r=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",hide:!n.binding,properties:{...this.getExpressionEditorOptions(n,e,r,i)}}}getExpressionOptions(n,e,r){const i=this.getExpressionInfo(n,e,r);return{dialogTitle:`${this.expressionNames[r]}编辑器`,singleExpand:!1,showMessage:r==="required",beforeOpen:()=>this.onBeforeOpenExpression(n,r,e),expressionInfo:i}}}class nn{constructor(n,e){Z(this,"componentId");Z(this,"viewModelId");Z(this,"eventsEditorUtils");Z(this,"formSchemaUtils");Z(this,"formMetadataConverter");Z(this,"designViewModelUtils");Z(this,"designViewModelField");Z(this,"controlCreatorUtils");Z(this,"designerHostService");Z(this,"designerContext");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=n,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(n))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext}getFormDesignerInstance(){var n,e;return(e=(n=this.designerContext)==null?void 0:n.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var n;return(n=this.schemaService)==null?void 0:n.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(n){var r;const e=n.binding&&n.binding.type==="Form"&&n.binding.field;if(e){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===e)}n.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}getBasicPropConfig(n){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:n.type,name:P[n.type]&&P[n.type].name}]}}}}}getAppearanceConfig(n=null,e={},r){const i={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 s in e)a[s]=Object.assign(a[s]||{},e[s]);return{...i,properties:{...a},setPropertyRelates(s,f){if(s){switch(s&&s.propertyID){case"class":case"style":{dt.value++;break}}r&&r(s,n,f)}}}}getPropertyEditorParams(n,e=[],r="visible",i={},a={},s=""){const{getVariables:f,getControlName:l,getStateMachines:d}=vr(this.designerHostService),g=this.getRealTargetType(n),c=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],m={type:"property-editor",propertyTypes:c};return c.map(u=>{switch(u){case"Const":Object.assign(m,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":m.expressionConfig=this.getExpressionOptions(n,g,s||r);break;case"StateMachine":m.stateMachines=d();break;case"Variable":Object.assign(m,{controlName:l(n),newVariablePrefix:"is",newVariableType:"Boolean",variables:f(this.viewModelId),onBeforeOpenVariables:p=>{p.value=f(this.viewModelId)}},a);break}}),m}getVisibleProperty(n,e=""){var a;let r=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?r=["Const","Expression"]:e==="form-group"&&!((a=n.binding)!=null&&a.field)&&(r=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(n,r,"visible")}}}getBehaviorConfig(n,e="",r={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(n,e);for(const l in r)s[l]=Object.assign(s[l]||{},r[l]);const f=this;return{...a,properties:{...s},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":f.afterMutilEditorChanged(n,l);break}i&&i(l,d)}}}}afterMutilEditorChanged(n,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,n)}updateElementByParentContainer(n,e){const r=e&&e.parent&&e.parent.schema;if(!r)return;const i=r.contents.findIndex(s=>s.id===n),a=me.cloneDeep(r.contents[i]);r.contents.splice(i,1),r.contents.splice(i,0,a),yr()}addNewVariableToViewModel(n,e){const r=n.propertyValue;if(!(r&&typeof r=="object")||!(r.type==="Variable"&&r.isNewVariable))return;const s={id:r.field,category:"locale",code:r.fullPath,name:r.fullPath,type:r.newVariableType||"String"};delete r.newVariableType,delete r.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(e).states.push(s)}updateExpressionValue(n){const e=n.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:a,expressionInfo:s}=e,{targetId:f,targetType:l,expressionType:d,value:g,message:c}=s,m=this.formSchemaUtils.getModule();m.expressions=m.expressions||[];const{expressions:u}=m;let p=u.find(y=>y.target===f);p||(p={target:f,rules:[],targetType:l},u.push(p));const h=p.rules.find(y=>y.type===d);if(h)h.value=g,h.message=c;else{const y={id:a,type:d,value:g,message:c};p.rules.push(y)}delete e.expressionInfo}clearExpression(n,e){const r=n.propertyValue;if(r&&r.type==="Expression")return;const a=n.propertyID,s=this.formSchemaUtils.getExpressions(),f=e.binding?e.binding.field:e.id,l=s.find(d=>d.target===f);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==a))}getExpressionOptions(n,e,r){return new wt(this.formSchemaUtils).getExpressionOptions(n,e,r)}getRealTargetType(n){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(n.type)>-1?"Button":n.binding&&n.binding.field?"Field":"Container"}createBaseEventProperty(n){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:n,viewSourceHandle:r=>{var i;((i=r.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(r)}}},e}}const tt=class tt{static getEditorTypesByMDataType(n,e=!1,r=""){if(e)return[{key:P["language-textbox"].type,value:P["language-textbox"].name}];let i=tt.fieldControlTypeMapping[n];if(r==="data-grid-column"&&(i!=null&&i.length)){const a=[P["check-group"].type,P["radio-group"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const n=[];for(const e in tt.fieldControlTypeMapping)tt.fieldControlTypeMapping[e].forEach(r=>{n.find(i=>i.key===r.key&&i.value===r.value)||n.push({key:r.key,value:r.value})});return n}static mappingDomPropAndSchemaProp(n,e){var a;const r=(a=n.editor)==null?void 0:a.type,i=[];return(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(r===P["input-group"].type||r===P.textarea.type||r===P["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),r===P["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(r===P["combo-list"].type||r===P["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),r===P["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),r===P["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),r===P.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(n.type===P["data-grid-column"].type||n.type===P["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};Z(tt,"fieldControlTypeMapping",{String:[{key:P["input-group"].type,value:P["input-group"].name},{key:P.lookup.type,value:P.lookup.name},{key:P["date-picker"].type,value:P["date-picker"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name},{key:P["check-group"].type,value:P["check-group"].name},{key:P["radio-group"].type,value:P["radio-group"].name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P.textarea.type,value:P.textarea.name},{key:P["time-picker"].type,value:P["time-picker"].name}],Text:[{key:P.textarea.type,value:P.textarea.name},{key:P.lookup.type,value:P.lookup.name}],Decimal:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Integer:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Number:[{key:P["number-spinner"].type,value:P["number-spinner"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],BigNumber:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Date:[{key:P["date-picker"].type,value:P["date-picker"].name}],DateTime:[{key:P["date-picker"].type,value:P["date-picker"].name}],Boolean:[{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],Enum:[{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}],Object:[{key:P.lookup.type,value:P.lookup.name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}]});let nt=tt;var on=(t=>(t.string="string",t.boolean="boolean",t.number="number",t.select="select",t.boolOrExp="boolOrExp",t.editableSelect="editableSelect",t.multiSelect="multiSelect",t.date="date",t.datetime="datetime",t.modal="modal",t.cascade="cascade",t.custom="custom",t.unity="unity",t.events="events",t.switch="switch",t.multiLanguage="multiLanguage",t))(on||{}),ot=(t=>(t.Form="Form",t.Variable="Variable",t))(ot||{});class br{constructor(){Z(this,"label","");Z(this,"id","");Z(this,"columnInSM",12);Z(this,"columnInMD",6);Z(this,"columnInLG",3);Z(this,"columnInEL",2);Z(this,"displayWidthInSM",1);Z(this,"displayWidthInMD",1);Z(this,"displayWidthInLG",1);Z(this,"displayWidthInEL",1);Z(this,"displayColumnCountAtBreakPoint","md");Z(this,"tagRow",0);Z(this,"showTopBorder",0);Z(this,"group",1);Z(this,"isSupportedClass",!0);Z(this,"fieldSetId","")}}function Cr(t){let n,e;const r=new Map;let i=[];function a(g,c){const u=g.split(" ").filter(E=>E.startsWith("col-"));if(u.length===0){c.isSupportedClass=!1;return}let p=u.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),h=u.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),y=u.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),T=u.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),h=h||"col-md-"+c.columnInSM,c.columnInMD=parseInt(h.replace("col-md-",""),10),c.displayWidthInMD=c.columnInMD/6,[1,2].includes(c.displayWidthInMD)||(c.isSupportedClass=!1),y=y||"col-xl-"+c.columnInMD,c.columnInLG=parseInt(y.replace("col-xl-",""),10),c.displayWidthInLG=c.columnInLG/3,[1,2,3,4].includes(c.displayWidthInLG)||(c.isSupportedClass=!1),T=T||"col-el-"+c.columnInLG,c.columnInEL=parseInt(T.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function s(g,c,m,u=!1){let p=!1;g.contents.forEach(h=>{if(h.type==="fieldset"){m+=1,s(h,c,m,!0),p=!0;return}p&&(m+=1,p=!1);const y=h.appearance&&h.appearance.class,T=new br;y?a(y,T):T.isSupportedClass=!1,T.label=h.label||h.id,T.id=h.id,T.group=m,u&&(T.fieldSetId=g.id),e===h.id&&(n=m),r.set(h.id,h),c.push(T)})}function f(g){const c=t.getComponentById(g);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const m=t.selectNode(c,u=>u.type===qt.DgControl["response-form"].type);return!m||!m.contents||m.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:m}}function l(g,c){c=c||g.id;const{result:m,message:u,formNode:p}=f(c);if(!m)return{result:m,message:u};e=g.id,i=[],r.clear();const h=p.contents[0].type===qt.DgControl.fieldset.type?0:1;s(p,i,h);const y=i.find(E=>!E.isSupportedClass);return{defaultState:{defaultGroupNumber:n||1,model:y?"customize":"standard"},importData:i}}function d(g,c){c=c;const{result:m,formNode:u}=f(c);if(!m)return"";const p=[];return g.forEach(h=>{var E;const y=r.get(h.id),T=y.appearance&&y.appearance.class;if(T){const N=T.split(" ").filter(O=>!O.startsWith("col-")),x="col-"+h.columnInSM,b="col-md-"+h.columnInMD,C="col-xl-"+h.columnInLG,w="col-el-"+h.columnInEL,V=[x,b,C,w].concat(N);y.appearance.class=V.join(" ")}if(h.fieldSetId){const D=u.contents.find(x=>x.id===h.fieldSetId),N=p.find(x=>x.id===h.fieldSetId);N?(E=N.contents)==null||E.push(y):(p.push(D),D.contents=[y])}else p.push(y)}),u.contents=p,u.id}return{checkCanFindFormNode:f,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:s}}var _e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var xr={exports:{}};(function(t,n){(function(e){t.exports=e()})(function(){return function(){function e(r,i,a){function s(d,g){if(!i[d]){if(!r[d]){var c=typeof ut=="function"&&ut;if(!g&&c)return c(d,!0);if(f)return f(d,!0);var m=new Error("Cannot find module '"+d+"'");throw m.code="MODULE_NOT_FOUND",m}var u=i[d]={exports:{}};r[d][0].call(u.exports,function(p){var h=r[d][1][p];return s(h||p)},u,u.exports,e,r,i,a)}return i[d].exports}for(var f=typeof ut=="function"&&ut,l=0;l<a.length;l++)s(a[l]);return s}return e}()({1:[function(e,r,i){var a={},s="(?:^|\\s)",f="(?:\\s|$)";function l(c){var m=a[c];return m?m.lastIndex=0:a[c]=m=new RegExp(s+c+f,"g"),m}function d(c,m){var u=c.className;u.length?l(m).test(u)||(c.className+=" "+m):c.className=m}function g(c,m){c.className=c.className.replace(l(m)," ").trim()}r.exports={add:d,rm:g}},{}],2:[function(e,r,i){(function(a){var s=e("contra/emitter"),f=e("crossvent"),l=e("./classes"),d=document,g=d.documentElement;function c(S,Y){var W=arguments.length;W===1&&Array.isArray(S)===!1&&(Y=S,S=[]);var z,J,oe,fe,R,M,K,A,ae,Ce=null,ge,ee,pe=!1,he=0,le,U=Y||{};U.moves===void 0&&(U.moves=E),U.accepts===void 0&&(U.accepts=E),U.invalid===void 0&&(U.invalid=_),U.containers===void 0&&(U.containers=S||[]),U.isContainer===void 0&&(U.isContainer=T),U.copy===void 0&&(U.copy=!1),U.copySortSource===void 0&&(U.copySortSource=!1),U.revertOnSpill===void 0&&(U.revertOnSpill=!1),U.removeOnSpill===void 0&&(U.removeOnSpill=!1),U.direction===void 0&&(U.direction="vertical"),U.ignoreInputTextSelection===void 0&&(U.ignoreInputTextSelection=!0),U.mirrorContainer===void 0&&(U.mirrorContainer=d.body);var de=s({containers:U.containers,start:G,end:ie,cancel:I,remove:Xe,destroy:ze,canMove:qe,dragging:!1});return U.removeOnSpill===!0&&de.on("over",Et).on("out",It),$e(),de;function Ae(v){return de.containers.indexOf(v)!==-1||U.isContainer(v)}function $e(v){var k=v?"remove":"add";p(g,k,"mousedown",ye),p(g,k,"mouseup",Ne)}function Be(v){var k=v?"remove":"add";p(g,k,"mousemove",Qe)}function We(v){var k=v?"remove":"add";f[k](g,"selectstart",Ge),f[k](g,"click",Ge)}function ze(){$e(!0),Ne({})}function Ge(v){ge&&v.preventDefault()}function ye(v){fe=v.clientX,R=v.clientY;var k=h(v)!==1||v.metaKey||v.ctrlKey;if(!k){var q=v.target,Q=Le(q);Q&&(ge=Q,Be(),v.type==="mousedown"&&(b(q)?q.focus():v.preventDefault()))}}function Qe(v){if(ge){if(h(v)===0){Ne({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-fe)<=(U.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-R)<=(U.slideFactorY||0))){if(U.ignoreInputTextSelection){var k=O("clientX",v)||0,q=O("clientY",v)||0,Q=d.elementFromPoint(k,q);if(b(Q))return}var se=ge;Be(!0),We(),ie(),X(se),l.add(A||oe,"gu-transit"),Nt(),Vt(),he=0,Ue(v)}}}function Le(v){if(!(de.dragging&&z)&&!Ae(v)){for(var k=v;x(v)&&Ae(x(v))===!1;)if(U.invalid(v,k)||(v=x(v),!v))return;var q=x(v);if(q&&!U.invalid(v,k)){var Q=U.moves(v,q,k,w(v));if(Q)return{item:v,source:q}}}}function qe(v){return!!Le(v)}function G(v){var k=Le(v);k&&X(k)}function X(v){Rt(v.item,v.source)&&(A=v.item.cloneNode(!0),de.emit("cloned",A,v.item,"copy")),J=v.source,oe=v.item,M=K=w(v.item),de.dragging=!0,de.emit("drag",oe,J)}function _(){return!1}function ie(){if(de.dragging){var v=A||oe;Te(v,x(v))}}function ue(){ge=!1,Be(!0),We(!0)}function Ne(v){if(ue(),!!de.dragging){var k=A||oe,q=O("clientX",v)||0,Q=O("clientY",v)||0,se=y(z,q,Q),ce=xe(se,q,Q);ce&&(A&&U.copySortSource||!A||ce!==J)?Te(k,ce):U.removeOnSpill?Xe():I()}}function Te(v,k){var q=x(v);A&&U.copySortSource&&k===J&&q.removeChild(oe),be(k)?de.emit("cancel",v,J):de.emit("drop",v,k,J,K),te()}function Xe(){if(de.dragging){var v=A||oe,k=x(v);k&&k.removeChild(v),de.emit(A?"cancel":"remove",v,k,J),te()}}function I(v){if(de.dragging){var k=arguments.length>0?v:U.revertOnSpill,q=A||oe,Q=x(q),se=be(Q);se===!1&&k&&(A?Q&&Q.removeChild(A):J.insertBefore(q,M)),se||k?de.emit("cancel",q,J,J):de.emit("drop",q,Q,J,K),te()}}function te(){var v=A||oe;ue(),Mt(),kt(),v&&l.rm(v,"gu-transit"),ae&&clearTimeout(ae),de.dragging=!1,Ce&&de.emit("out",v,Ce,J),de.emit("dragend",v,he),J=oe=A=M=K=ae=Ce=null}function be(v,k){var q;return k!==void 0?q=k:z?q=K:q=w(A||oe),v===J&&q===M}function xe(v,k,q){for(var Q=v;Q&&!se();)Q=x(Q);return Q;function se(){var ce=Ae(Q);if(ce===!1)return!1;var je=gt(Q,v),Ve=ht(Q,je,k,q),Me=be(Q,Ve);return Me?!0:U.accepts(oe,Q,J,Ve)}}function Ue(v){if(!z)return;v.preventDefault();var k=O("clientX",v)||0,q=O("clientY",v)||0;z.style.left=k-2+"px",z.style.top=q-2+"px";var Q=A||oe,se=y(z,k,q),ce=xe(se,k,q),je=ce!==null&&ce!==Ce;(je||ce===null)&&(ke(),Ce=ce,He()),Ot(se,q);var Ve=x(Q);if(ce===J&&A&&!U.copySortSource){Ve&&Ve.removeChild(Q);return}var Me,De=gt(ce,se);if(pe=rt(De,ce),De!==null)Me=ht(ce,De,k,q);else if(U.revertOnSpill===!0&&!A)Me=M,ce=J;else{A&&Ve&&Ve.removeChild(Q),A&&ee&&(ee.style.display="none");return}ee.style.display="block",Tt(Me,Q,je),Me?Bt(De,Me):jt(ce);function we(Ee){de.emit(Ee,Q,Ce,J)}function He(){je&&we("over")}function ke(){Ce&&we("out")}}function Tt(v,k,q){(v===k||v===w(k))&&(K=w(k)),(v===null&&q||v!==k&&v!==w(k))&&(K=v)}function Et(v){l.rm(v,"gu-hide")}function It(v){de.dragging&&l.add(v,"gu-hide")}function Vt(){z||(z=document.createElement("div"),z.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;",z.innerHTML=U.getMirrorText&&U.getMirrorText(oe)||"控件",l.add(z,"gu-mirror"),U.mirrorContainer.appendChild(z),p(g,"add","mousemove",Ue),l.add(U.mirrorContainer,"gu-unselectable"),de.emit("cloned",z,oe,"mirror"))}function Nt(){if(ee=document.createElement("div"),l.add(ee,"gu-insertion"),oe){var v=oe.getBoundingClientRect();ee.style.left=v.left+"px",ee.style.top=v.top+"px"}pe=!1,U.mirrorContainer.appendChild(ee)}function Mt(){z&&(l.rm(U.mirrorContainer,"gu-unselectable"),p(g,"remove","mousemove",Ue),x(z).removeChild(z),z=null)}function kt(){ee&&(x(ee).removeChild(ee),ee=null)}function gt(v,k){for(var q=k;q!==v&&x(q)!==v;)q=x(q);return q===g?null:q}function rt(v,k){if(!k)return pe;var q=v||k&&k.lastElementChild;if(!q)return!0;var Q=getComputedStyle(v),se=/^inline/.test(Q.getPropertyValue("display"))||/^(left|right)$/.test(Q.getPropertyValue("float"));if(se)return!0;if(k){var ce=getComputedStyle(k),je=ce.getPropertyValue("display");if(/flex$/.test(je)){var Ve=ce.getPropertyValue("flex-direction")||"row";if(Ve==="row"||Ve==="row-reverse")return!Pt(k)}return!1}return!0}function Pt(v){if(!v.children||!v.children.length)return!1;for(const k of Array.from(v.children)){const Q=(k.className&&k.className.split(" ")||[]).filter(se=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(se));if(!Q.length)return!1;for(const se of Q){const ce=se.slice(se.lastIndexOf("-")+1);if(parseInt(ce,10)!==12)return!1}}return!0}function Bt(v,k){const q=k.getBoundingClientRect();if(ee.style.left=q.left+"px",ee.style.top=q.top+"px",pe){if(ee.style.height=q.height+"px",ee.style.width="4px",v){const Q=v.getBoundingClientRect();Q.top!==q.top&&(ee.style.left=Q.right+"px",ee.style.top=Q.top+"px",ee.style.height=Q.height+"px")}}else if(ee.style.height="4px",ee.style.width=q.width+"px",le){const Q=le.getBoundingClientRect();q.top<Q.top&&(ee.style.display="none")}k===oe&&oe&&(ee.style.display="none")}function jt(v){K=null;var k=v.lastElementChild;if(k){var q=k.getBoundingClientRect();pe?(ee.style.left=q.right+"px",ee.style.top=q.top+"px",ee.style.height=q.height+"px",ee.style.width="4px"):(ee.style.left=q.left+"px",ee.style.top=q.bottom+"px",ee.style.height="4px",ee.style.width=q.width+"px"),k===oe&&oe&&(ee.style.display="none")}else ee.style.display="none"}function Ot(v,k){if(!U.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(le=m(v),!le||!le.contains(v)))return;const q=document.querySelector(".dgComponentSelected"),Q=le.getBoundingClientRect();if(k-30<Q.top&&le.scrollTop>0){let se=le.scrollTop<10?le.scrollTop:10;le.scrollBy(0,-1*se),q&&le.contains(q)&&(he=he+-1*se)}if(k+30>Q.bottom&&le.scrollTop<le.scrollHeight-le.clientHeight){const se=le.scrollHeight-le.clientHeight-le.scrollTop;let ce=se<10?se:10;le.scrollBy(0,ce),q&&le.contains(q)&&(he=he+ce)}}function ht(v,k,q,Q){var se=U.direction==="horizontal",ce=U.direction==="mixed",je=k!==v?Me():Ve();return je;function Ve(){var we=v.children.length,He,ke,Ee;for(He=0;He<we;He++)if(ke=v.children[He],Ee=ke.getBoundingClientRect(),se&&Ee.left+Ee.width/2>q||!ce&&!se&&Ee.top+Ee.height/2>Q||ce&&Ee.left+Ee.width>q&&Ee.top+Ee.height>Q)return ke;return null}function Me(){var we=k.getBoundingClientRect();if(ce){var He=Q-we.top,ke=q-we.left,Ee=we.bottom-Q,it=we.right-q,at=Math.min(ke,it,He,Ee),st;return pe?st=it<ke:st=Ee===at||it===at||ke===at,De(st)}return De(se?q>we.left+D(we)/2:Q>we.top+N(we)/2)}function De(we){return we?w(k):k}}function Rt(v,k){return typeof U.copy=="boolean"?U.copy:U.copy(v,k)}}function m(S){const Y=Array.from(window.scrollContainerList);if(Y.length===1){const z=Array.from(window.scrollContainerList)[0];return document.getElementById(z)}const W=u(Y);for(const z of W)if(z.contains(S))return z;return null}function u(S){const Y=[];return S.forEach(W=>{const z=document.getElementById(W);z&&Y.push(z)}),Y.sort((W,z)=>W.contains(z)?1:z.contains(W)?-1:0),Y}function p(S,Y,W,z){var J={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},oe={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},fe={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?f[Y](S,oe[W],z):a.navigator.msPointerEnabled?f[Y](S,fe[W],z):(f[Y](S,J[W],z),f[Y](S,W,z))}function h(S){if(S.touches!==void 0)return S.touches.length;if(S.which!==void 0&&S.which!==0)return S.which;if(S.buttons!==void 0)return S.buttons;var Y=S.button;if(Y!==void 0)return Y&1?1:Y&2?3:Y&4?2:0}function y(S,Y,W){S=S||{};var z=S.className||"",J;return S.className+=" gu-hide",J=d.elementFromPoint(Y,W),S.className=z,J}function T(){return!1}function E(){return!0}function D(S){return S.width||S.right-S.left}function N(S){return S.height||S.bottom-S.top}function x(S){return S.parentNode===d?null:S.parentNode}function b(S){return S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.tagName==="SELECT"||C(S)}function C(S){return!S||S.contentEditable==="false"?!1:S.contentEditable==="true"?!0:C(x(S))}function w(S){return S.nextElementSibling||Y();function Y(){var W=S;do W=W.nextSibling;while(W&&W.nodeType!==1);return W}}function V(S){return S.targetTouches&&S.targetTouches.length?S.targetTouches[0]:S.changedTouches&&S.changedTouches.length?S.changedTouches[0]:S}function O(S,Y){var W=V(Y),z={pageX:"clientX",pageY:"clientY"};return S in z&&!(S in W)&&z[S]in W&&(S=z[S]),W[S]}r.exports=c}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,r,i){r.exports=function(s,f){return Array.prototype.slice.call(s,f)}},{}],4:[function(e,r,i){var a=e("ticky");r.exports=function(f,l,d){f&&a(function(){f.apply(d||null,l||[])})}},{ticky:10}],5:[function(e,r,i){var a=e("atoa"),s=e("./debounce");r.exports=function(l,d){var g=d||{},c={};return l===void 0&&(l={}),l.on=function(m,u){return c[m]?c[m].push(u):c[m]=[u],l},l.once=function(m,u){return u._once=!0,l.on(m,u),l},l.off=function(m,u){var p=arguments.length;if(p===1)delete c[m];else if(p===0)c={};else{var h=c[m];if(!h)return l;h.splice(h.indexOf(u),1)}return l},l.emit=function(){var m=a(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var u=(c[m]||[]).slice(0);return function(){var p=a(arguments),h=this||l;if(m==="error"&&g.throws!==!1&&!u.length)throw p.length===1?p[0]:p;return u.forEach(function(T){g.async?s(T,p,h):T.apply(h,p),T._once&&l.off(m,T)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(e,r,i){(function(a){var s=e("custom-event"),f=e("./eventmap"),l=a.document,d=m,g=p,c=[];a.addEventListener||(d=u,g=h),r.exports={add:d,remove:g,fabricate:y};function m(x,b,C,w){return x.addEventListener(b,C,w)}function u(x,b,C){return x.attachEvent("on"+b,E(x,b,C))}function p(x,b,C,w){return x.removeEventListener(b,C,w)}function h(x,b,C){var w=D(x,b,C);if(w)return x.detachEvent("on"+b,w)}function y(x,b,C){var w=f.indexOf(b)===-1?O():V();x.dispatchEvent?x.dispatchEvent(w):x.fireEvent("on"+b,w);function V(){var S;return l.createEvent?(S=l.createEvent("Event"),S.initEvent(b,!0,!0)):l.createEventObject&&(S=l.createEventObject()),S}function O(){return new s(b,{detail:C})}}function T(x,b,C){return function(V){var O=V||a.event;O.target=O.target||O.srcElement,O.preventDefault=O.preventDefault||function(){O.returnValue=!1},O.stopPropagation=O.stopPropagation||function(){O.cancelBubble=!0},O.which=O.which||O.keyCode,C.call(x,O)}}function E(x,b,C){var w=D(x,b,C)||T(x,b,C);return c.push({wrapper:w,element:x,type:b,fn:C}),w}function D(x,b,C){var w=N(x,b,C);if(w){var V=c[w].wrapper;return c.splice(w,1),V}}function N(x,b,C){var w,V;for(w=0;w<c.length;w++)if(V=c[w],V.element===x&&V.type===b&&V.fn===C)return w}}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,r,i){(function(a){var s=[],f="",l=/^on/;for(f in a)l.test(f)&&s.push(f.slice(2));r.exports=s}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,r,i){(function(a){var s=a.CustomEvent;function f(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}r.exports=f()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(d,g){var c=document.createEvent("CustomEvent");return g?c.initCustomEvent(d,g.bubbles,g.cancelable,g.detail):c.initCustomEvent(d,!1,!1,void 0),c}:function(d,g){var c=document.createEventObject();return c.type=d,g?(c.bubbles=!!g.bubbles,c.cancelable=!!g.cancelable,c.detail=g.detail):(c.bubbles=!1,c.cancelable=!1,c.detail=void 0),c}}).call(this,typeof _e<"u"?_e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,r,i){var a=r.exports={},s,f;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?f=clearTimeout:f=d}catch{f=d}})();function g(N){if(s===setTimeout)return setTimeout(N,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(N,0);try{return s(N,0)}catch{try{return s.call(null,N,0)}catch{return s.call(this,N,0)}}}function c(N){if(f===clearTimeout)return clearTimeout(N);if((f===d||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(N);try{return f(N)}catch{try{return f.call(null,N)}catch{return f.call(this,N)}}}var m=[],u=!1,p,h=-1;function y(){!u||!p||(u=!1,p.length?m=p.concat(m):h=-1,m.length&&T())}function T(){if(!u){var N=g(y);u=!0;for(var x=m.length;x;){for(p=m,m=[];++h<x;)p&&p[h].run();h=-1,x=m.length}p=null,u=!1,c(N)}}a.nextTick=function(N){var x=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)x[b-1]=arguments[b];m.push(new E(N,x)),m.length===1&&!u&&g(T)};function E(N,x){this.fun=N,this.array=x}E.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function D(){}a.on=D,a.addListener=D,a.once=D,a.off=D,a.removeListener=D,a.removeAllListeners=D,a.emit=D,a.prependListener=D,a.prependOnceListener=D,a.listeners=function(N){return[]},a.binding=function(N){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(N){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(e,r,i){(function(a){var s=typeof a=="function",f;s?f=function(l){a(l)}:f=function(l){setTimeout(l,0)},r.exports=f}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,r,i){(function(a,s){var f=e("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,g={},c=0;i.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(u){u.close()};function m(u,p){this._id=u,this._clearFn=p}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(u,p){clearTimeout(u._idleTimeoutId),u._idleTimeout=p},i.unenroll=function(u){clearTimeout(u._idleTimeoutId),u._idleTimeout=-1},i._unrefActive=i.active=function(u){clearTimeout(u._idleTimeoutId);var p=u._idleTimeout;p>=0&&(u._idleTimeoutId=setTimeout(function(){u._onTimeout&&u._onTimeout()},p))},i.setImmediate=typeof a=="function"?a:function(u){var p=c++,h=arguments.length<2?!1:d.call(arguments,1);return g[p]=!0,f(function(){g[p]&&(h?u.apply(null,h):u.call(null),i.clearImmediate(p))}),p},i.clearImmediate=typeof s=="function"?s:function(u){delete g[u]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(xr);const wr={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}},Sr={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},St=o.defineComponent({name:"Toast",props:Sr,emits:["close","click"],setup:(t,n)=>{const{locale:e,t:r}=yt.useI18n(),i=o.ref(t.animate),a="fadeOut",s=o.computed(()=>t.options),f=o.ref(!1),l=o.computed(()=>s.value.title&&s.value.message),d=o.computed(()=>!s.value.title&&s.value.message),g=o.computed(()=>{const N={animated:f.value,toast:!0,"toast--only-content":!l.value};return N[t.animate]=!1,N[a]=f.value,N["toasty-type-"+s.value.type]=!0,s.value.theme&&(N[s.value.theme]=!0),N}),c=o.computed(()=>{const b=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,C={"f-icon":!0};return C[b]=!0,C}),m=o.computed(()=>s.value.title||s.value.message),u=o.computed(()=>t.showCloseButton),p=o.computed(()=>!!s.value.buttons||!!n.slots.default),h=o.computed(()=>e.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function y(N){N.stopPropagation(),N.preventDefault(),f.value=!1,setTimeout(()=>{n.emit("close",s.value)},200)}function T(N,x){}function E(N){return`f-preten-link ${N.customClass?N.customClass:""}`}o.watch(i,()=>{i.value});const D=()=>{var N;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!n.slots.default&&((N=s.value.buttons)==null?void 0:N.map(x=>o.createVNode("span",{class:E(x),onClick:b=>void 0},[x.text]))),n.slots.default&&n.slots.default()])])};return()=>o.createVNode("div",{class:g.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:r("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:y},[o.createVNode("span",{class:"f-icon modal_close"},null)]),m.value&&o.createVNode("section",{class:"modal-tips"},[!l.value&&o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[l.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:s.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:h.value},null),p.value&&D()]),d.value&&(s.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:s.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[D()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:s.value.message},null))])])])}}),ft=o.defineComponent({name:"Notify",props:wr,emits:["close","empty"],setup(t,n){const e=o.computed(()=>({"farris-notify":!0})),r={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(t.options),s=o.ref(t.showCloseButton),f=o.computed(()=>t.position||"bottom-right"),l=o.computed(()=>t.timeout!=null?t.timeout:3e3),d=o.computed(()=>{const m=t.bottom?t.bottom:r.bottom,u=t.top?t.top:r.top,p={transition:"all 0.2s ease",left:f.value.indexOf("left")>-1?`${t.left?t.left:r.left}px`:"",right:f.value.indexOf("right")>-1?`${t.right?t.right:r.right}px`:"",top:f.value.indexOf("top")>-1?`${u}px`:"",bottom:f.value.indexOf("bottom")>-1?`${m}px`:""};return f.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",f.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function g(m){n.emit("close")}l.value&&setTimeout(()=>{g()},l.value),n.expose({closeToast:g,container:i,notifyPosition:f});function c(m,u){g()}return()=>o.createVNode("div",{class:e.value,style:d.value,ref:i},[o.createVNode(St,{options:a.value,showCloseButton:s.value,animate:t.animate,onClose:m=>c(m,a.value)},null)])}});class Fr{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",o.reactive({}))}escapeAllHtml(n){if(typeof n!="string"||!n)return"";const e=document.createElement("div");return e.textContent=n||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(n){const e=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...n}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var d;const f=o.ref();function l(){f.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,f),s.unmount()},220)}if(i.position.indexOf("top")>-1){const g=e.getNotifyInstances(i.position),c=g[g.length-1];if(c){const m=c.value.container.getBoundingClientRect();i.top=m.bottom}}return i.safeHtml&&((d=i.options)!=null&&d.message)&&(i.options.message=e.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{e.updateNotifyPositionForCreate(i,f)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(ft,o.mergeProps({ref:f},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(lt.LocaleService.i18n),s.mount(a),s}getNotifyInstances(n){return this.notifyRefs.filter(e=>e.value.notifyPosition===n)}updateNotifyPositionForCreate(n,e){if(this.notifyRefs&&this.notifyRefs.length){const r=window.innerHeight;n.position.indexOf("bottom")>-1&&this.getNotifyInstances(n.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+r-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(n,e){const r=this.notifyRefs.indexOf(e);if(n.position.indexOf("top")>-1){const i=this.getNotifyInstances(n.position),a=i.indexOf(e);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(n){return this.createNotifyInstance(n)}buildNotifyProps(n,e){let r="",i="",a,s,f;typeof e=="string"?r=e:e&&(r=e.message||"",i=e.title||"",s=e.position||null,f=e.showCloseButton!=null?e.showCloseButton:null,a=e.timeout!=null?e.timeout:null);const d={options:{type:n,message:r,title:i}};return s!=null&&(d.position=s),f!=null&&(d.showCloseButton=f),a!=null&&(d.timeout=a),d}info(n){const e=this.buildNotifyProps("info",n);return this.show(e)}success(n){const e=this.buildNotifyProps("success",n);return this.show(e)}warning(n){const e=this.buildNotifyProps("warning",n);return this.show(e)}error(n){const e=this.buildNotifyProps("error",n);return this.show(e)}close(n){n&&n.unmount()}closeAll(){this.notifyRefs.forEach(n=>{n==null||n.value.closeToast()}),this.notifyRefs.length=0}}const Tr=Symbol("NOTIFY_SERVICE_TOKEN");ft.install=t=>{t.component(ft.name,ft),t.component(St.name,St);const n=new Fr;t.provide(Tr,n),t.provide("FNotifyService",n)},`${lt.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const Er={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:32,heading:lt.LocaleService.getLocaleValue("datagrid.lineNumberTitle")}},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"]}}};function Ir(t,n,e,r,i,a,s,f,l,d,g,c,m,u,p,h,y){const{calculateCellPositionInRow:T}=a,{columnContext:E,hasLeftFixedColumn:D,hasRightFixedColumn:N}=s,{gridDataStyle:x,leftFixedGridDataStyle:b,rightFixedGridDataStyle:C}=u,{renderDataRow:w}=re.getHierarchyRow(t,n,E,y,f,l,d,g,c,m,u,p,h),V=[w];function O(J,oe){const fe=T(J);return y.value.filter(R=>R.visible!==!1).map((R,M)=>V[R.type](R,fe,oe,M))}function S(){return o.createVNode("div",{ref:r,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:b.value},[O(E.value.leftColumns.filter(J=>J.visible),"left")])])}function Y(){return o.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:x.value},[O(E.value.primaryColumns.filter(J=>J.visible),"primary")])])}function W(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:C.value},[O(E.value.rightColumns.filter(J=>J.visible),"right")])])}function z(){const J=[];return D.value&&J.push(S()),J.push(Y()),N.value&&J.push(W()),J}return{renderDataArea:z}}const Vr=o.defineComponent({name:"FTreeGrid",props:Er,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(t,n){var cn,dn;const r=((cn=t.rowOption)==null?void 0:cn.height)||28,i=o.ref(20),a=o.ref(t.columns),s=re.useIdentify(t),{idField:f}=s,l=o.ref(),d=o.ref(),g=o.ref(),c=o.ref(),m=o.ref(),u=o.ref([]),p=o.ref(!1),h=o.ref(((dn=t.rowOption)==null?void 0:dn.wrapContent)||!1),y=re.useGroupData(t,s),T=re.useFilter(t,n),E=re.useHierarchy(t),{collapseField:D}=E,{showLoading:N,renderLoading:x}=re.useLoading(t,l),b=re.useDataView(t,new Map,T,E,s),{dataView:C}=b,w=re.useSelection(t,b,s,u,n),{showSelection:V,selectedValues:O}=w,S=re.useSelectHierarchyItem(t,u,b,s,w,n),Y=o.computed(()=>t.disabled),W=o.computed(()=>t.virtualized?Math.min(b.dataView.value.length,i.value):b.dataView.value.length),z=re.usePagination(t,b),{shouldRenderPagination:J}=z,{containerStyleObject:oe}=re.useDataViewContainerStyle(t),fe=re.useCommandColumn(t),{applyCommands:R}=fe;R(a);const{applyColumnSetting:M,removeColumnSetting:K}=re.useSettingColumn(t);t.showSetting&&M(a);const A=re.useColumn(t,n),ae=re.useSort(t),{applyColumnSorter:Ce,columnContext:ge,updateColumnRenderContext:ee}=A;Ce(b,ae);const pe=re.useGroupColumn(t,ge),he=re.useRow(t,n,w,s),le=re.useEdit(t,n,s,he,u),U=re.useVisualDataBound(t),de=re.useVisualDataCell(t,le,U),Ae=re.useVisualDataRow(t,b,le,E,s,U,de),$e=re.useVisualData(t,a,b,W,0,Ae),{getVisualData:Be}=$e,We=re.useCellPosition(t,ge),ze=re.useSidebar(t,w),{sidebarWidth:Ge}=ze,ye=re.useVirtualScroll(t,b,u,ge,$e,W,0,Ge),{onWheel:Qe,dataGridWidth:Le,viewPortHeight:qe,viewPortWidth:G,resetScroll:X,updateVisibleRowsOnLatestVisibleScope:_}=ye,ie=re.useFitColumn(t,ge,d,G,pe),{calculateColumnsSize:ue}=ie,Ne=re.useFilterHistory(),Te=re.useColumnFilter(d,m,b,Ne,ye),Xe=re.useDragColumn(t,n,A,b,pe,y,ye),I=o.computed(()=>{const H={"fv-grid":!0,"fv-grid-bordered":t.showBorder,"fv-grid-horizontal-bordered":t.showHorizontalLines,"fv-datagrid-strip":t.showStripe};return Oe.getCustomClass(H,t.customClass)}),te=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":h.value})),{renderDataArea:be}=Ir(t,n,g,c,m,We,A,b,le,E,he,w,S,ye,$e,U,u),{renderGridHeader:xe,renderGridColumnResizeOverlay:Ue,shouldShowHeader:Tt}=re.getColumnHeader(t,n,d,c,m,A,b,Xe,Te,T,Ne,ie,pe,w,ze,ae,ye,G,u),{renderDataGridSidebar:Et}=re.getSidebar(t,he,w,ze,ye),{renderDisableMask:It}=re.getDisableMask(),{renderHorizontalScrollbar:Vt}=re.getHorizontalScrollbar(t,d,ye),{renderVerticalScrollbar:Nt}=re.getVerticalScrollbar(t,d,ye);function Mt(){var H,ne,Se;if(d.value&&d.value.clientHeight>0&&((H=d.value)==null?void 0:H.clientWidth)>0){const Ie=Math.ceil(d.value.clientHeight/r);Ie>i.value&&(i.value=Ie,_()),qe.value=((ne=g.value)==null?void 0:ne.clientHeight)||0,Le.value=((Se=d.value)==null?void 0:Se.clientWidth)||0,ue()}}o.onMounted(()=>{d.value&&(i.value=Math.max(Math.ceil(d.value.clientHeight/r),i.value),u.value=Be(0,W.value+0-1),Po.useResizeObserver(d.value,Mt),ue(),o.nextTick(()=>{d.value&&(Le.value=d.value.clientWidth),g.value&&(G.value=g.value.clientWidth,qe.value=g.value.clientHeight)})),N.value&&x()}),o.onUnmounted(()=>{}),o.watch(G,()=>{d.value&&ue()});function kt(H){b.collapseTo(H),b.reOrderVisibleIndex(),X()}function gt(H){b.expandTo(H),b.reOrderVisibleIndex(),X()}function rt(){const H=w.getSelectionRow();return H?H.dataIndex-1:-1}function Pt(){const H=rt();b.insertNewDataItem(H),u.value=Be(0,W.value+0-1)}function Bt(){const H=rt();b.insertNewChildDataItem(H),u.value=Be(0,W.value+0-1)}function jt(H,ne){const Se=u.value.find(Pe=>Pe.raw[f.value]===ne),Ie=Se?Se.dataIndex-1:-1;b.insertNewChildDataItems(H,Ie)}function Ot(){const H=rt(),ne=S.getNextSelectableHierarchyItemId(H);b.removeHierarchyDataItem(H),u.value=Be(0,W.value+0-1),ne&&S.selectItemById(ne)}function ht(H){le.onEditingRow(H)}function Rt(H){le.acceptEditingRow(H)}function v(H){le.cancelEditingRow(H)}function k(H){H&&(a.value=H,R(a),ee(a.value),Ce(b,ae),ue())}o.watch(()=>t.columns,H=>{k(H)});function q(H,ne){H&&(b.load(H),b.reOrderVisibleIndex(),ne!=null&&ne.keepScrollPosition?ye.scrollTo(ye.offsetY.value):X())}function Q(H){S.selectItemById(H)}function se(H){const ne=u.value.find(Se=>Se.raw[s.idField.value]===H);ne&&he.clickRowItem(ne)}function ce(H){he.activeRowById(H)}function je(H){S.selectItemByIds(H)}function Ve(){return w.getSelectedItems()}function Me(){w.clearSelection()}const De=o.computed(()=>!u.value||!u.value.length),{renderEmpty:we}=re.getEmpty(t,n);function He(){return w.getSelectionRow()}function ke(H){S.unSelectItemByIds(H)}function Ee(){return w.currentSelectedDataId.value}function it(H,ne,Se){const Ie=C.value.find(Pe=>Pe[f.value]===H);if(Ie){if(Object.keys(Ie).forEach(Fe=>{Object.prototype.hasOwnProperty.call(ne,Fe)&&(Ie[Fe]=ne[Fe])}),Se){const{collapseField:Fe,disabledField:Ze,checkedField:Ke,visibleField:et}=Se;Fe&&!me.isUndefined(ne[Fe])&&(Ie.__fv_collapse__=ne[Fe]),Ke&&!me.isUndefined(ne[Ke])&&(Ie.__fv_checked__=ne[Ke]),Ze&&!me.isUndefined(ne[Ze])&&(Ie.__fv_disabled__=ne[Ze]),et&&!me.isUndefined(ne[et])&&(Ie.__fv_visible__=ne[et])}const Pe=u.value.find(Fe=>Fe.raw[f.value]===H),un=u.value.findIndex(Fe=>Fe.raw[f.value]===H);if(Pe){if(Pe.raw=Ie,Object.keys(Pe.data).forEach(Fe=>{Pe.data[Fe].updateData(Ie)}),Se){const{collapseField:Fe,disabledField:Ze,checkedField:Ke,visibleField:et}=Se;Fe&&!me.isUndefined(ne[Fe])&&(Pe.collapse=ne[Fe]),Ke&&!me.isUndefined(ne[Ke])&&(Pe.checked=ne[Ke]),Ze&&!me.isUndefined(ne[Ze])&&(Pe.disabled=ne[Ze]),et&&!me.isUndefined(ne[et])&&(Pe.visible=ne[et])}u.value=[...u.value.slice(0,un),Pe,...u.value.slice(un+1)],b.updateSummary()}}}function at(H){return Object.prototype.hasOwnProperty.call(H,"raw")?b.hasRealChildren(H.raw):b.hasRealChildren(H)}function st(H){const ne=b.dataView.value.find(Se=>Se[f.value]===H);return ne?ne[D.value]:""}function fi(){return D.value}o.watch(()=>t.showSetting,(H,ne)=>{H!==ne&&(H?M(a):K(a),k(a.value))});function pi(H){return u.value.filter(ne=>H.includes(ne.raw[t.idField]))}function mi(H){const ne=s.idField.value,Se=u.value.find(Ie=>Ie.raw[ne]===H);Se&&he.changeRow(Se)}function gi(){w.keepSelectingOnPaging.value||Me(),b.updateVisibleDataSummary(u.value)}n.expose({activeRowById:ce,addNewDataItem:Pt,addNewChildDataItem:Bt,addChildrenToNode:jt,collapseTo:kt,expandTo:gt,removeDataItem:Ot,editDataItem:ht,acceptDataItem:Rt,cancelDataItem:v,updateColumns:k,updateDataSource:q,selectItemById:Q,selectItemByIds:je,getSelectedItems:Ve,clearSelection:Me,getSelectionRow:He,clickRowItemById:se,unSelectItemByIds:ke,getCurrentRowId:Ee,reassignRowData:it,hasChildren:at,getCollapseField:fi,getCollapseStatusById:st,getVisibleDataByIds:pi,selectRowById:mi,updateDerivedData:gi});const hi=o.computed(()=>{const H={};return ye.shouldShowHorizontalScrollbar.value&&(H.paddingBottom="10px"),ye.shouldShowVirticalScrollbar.value&&(H.paddingRight="10px"),H}),yi=o.computed(()=>({...oe.value,borderRadius:"5px"}));re.getPagination(t,n,b,ye,z,w);const vi=o.computed(()=>({"d-flex":!0,"justify-content-between":J.value&&V.value,"justify-content-end":J.value&&!V.value,"position-relative":!0})),bi=o.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:Ci}=re.getSummary(t,b,A);return()=>o.createVNode("div",{ref:l,class:I.value,style:yi.value,onWheel:Qe},[d.value&&Tt.value&&xe(),o.createVNode("div",{ref:d,class:te.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:hi.value},[d.value&&Et(u),d.value&&be(),d.value&&De.value&&we(),d.value&&Vt(),d.value&&Nt()]),d.value&&Ci(),V.value&&o.createVNode("div",{class:vi.value},[V.value&&o.createVNode("div",{class:bi.value},[o.createVNode("div",null,["已选:"+O.value.length,o.createTextVNode(" 条")])])]),Ue(),Y.value&&It()])}});Oe.withInstall(Vr);const Nr=new Map([["appearance",Zt]]);function Mr(t,n,e){return n}ct({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:()=>{}}},{$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"]},Nr,Mr,{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:[]}}}}}});const kr="root-viewmodel";class Pr{constructor(n,e){Z(this,"formSchemaUtils");Z(this,"controlCreatorUtils");Z(this,"designViewModelUtils");this.resolver=n,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(n){const e=this.createComponentRefNode(n),r=this.createComponentNode(n),i=this.createViewModeNode(n),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(r),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(n){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${n.componentId}-component-ref`,component:`${n.componentId}-component`}),e}createComponentNode(n){const e=this.resolver.getSchemaByType("component"),r=this.createFormComponentContents(n);return Object.assign(e,{id:`${n.componentId}-component`,viewModel:`${n.componentId}-component-viewmodel`,componentType:n.componentType,appearance:{class:this.getFormComponentClass()},formColumns:n.formColumns,contents:r}),e}getFormComponentClass(){const{templateId:n}=this.formSchemaUtils.getFormSchema().module;return n==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(n){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:n.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:n.componentName});const r=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(r,{id:n.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),e.contents=[r];const{selectedFields:a}=n;a==null||a.forEach(f=>{if(f.$type===Oe.FormSchemaEntityField$Type.SimpleField){const l=me.cloneDeep(f),d=this.resolveControlClassByFormColumns(n),g=this.controlCreatorUtils.setFormFieldProperty(l,"",d);g&&i.push(g)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(n){let e="";switch(n.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(n){return{id:`${n.componentId}-component-viewmodel`,code:`${n.componentId}-component-viewmodel`,name:n.componentName,bindTo:n.bindTo,parent:kr,fields:this.assembleViewModelFields(n),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(n){const e=[],{selectedFields:r}=n;return r==null||r.forEach(i=>{if(i.$type===Oe.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===Oe.FormSchemaEntityFieldTypeName.Enum||s===Oe.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),e.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),e}}function Br(t,n,e,r){var a,s,f,l,d,g;const i=e.parentComponentInstance;if(i&&r){const c=(a=i.schema)==null?void 0:a.type,u={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=e.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(f=e.bindingSourceContext)==null?void 0:f.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((d=e.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(g=e.bindingSourceContext)==null?void 0:g.bindingEntityFields};return new Pr(t,r).createComponent(u)}else return n}function jr(t,n,e){return n}ct({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},Ct,Br),ct({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Kt,Ct,void 0);const Or={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},Rr={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};vt.createPropsResolver(Rr,Or,ar,jr);const $r={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Ft(){return new DOMException("The request is not allowed","NotAllowedError")}async function Lr(t){if(!navigator.clipboard)throw Ft();return navigator.clipboard.writeText(t)}async function qr(t){const n=document.createElement("span");n.textContent=t,n.style.whiteSpace="pre",n.style.webkitUserSelect="auto",n.style.userSelect="all",document.body.appendChild(n);const e=window.getSelection(),r=window.document.createRange();e==null||e.removeAllRanges(),r.selectNode(n),e==null||e.addRange(r);let i=!1;try{i=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(n)}if(!i)throw Ft()}async function Dr(t){try{await Lr(t)}catch(n){try{await qr(t)}catch(e){throw e||n||Ft()}}}function Hr(){async function t(n){await Dr(n)}return{onCopy:t}}function Ar(t,n,e,r){const i=o.ref(14),a=o.ref(140),s=o.ref(""),f=o.ref(r.value.length),l=o.computed(()=>r.value),d=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function g(c){if(c.currentTarget){const m=c.currentTarget.value||"";f.value=m.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:a.value,onInput:c=>g(c)},[l.value]),o.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[f.value+" / "+a.value])])}function zr(t,n,e,r){const i=Ar(t,n,e,r),a=new Map([["text-area",i]]);function s(f){return a.get(f)||null}return{getEditorRender:s}}function Ur(){const t=o.ref(!1),n=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const r={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return r.opacity=t.value?"0.8":"0",r.display=t.value?"":"none",r}),feedbackMessage:n,toShowFeedback:t}}function _r(t,n){const e=n.getEditorRender(t.promptEditorType);return()=>e&&e()}function Wr(t,n){function e(u){if(u==null)return 0;let p=0;for(let h=0;h<u.length;h++){const y=u.charCodeAt(h);y>=0&&y<=128?p++:p=p+2}return p}function r(u,p){if(u!==""&&u!==void 0&&u!==null){u=""+u;const h=u.length;let y="",T=0;for(let E=0;E<h;E++){const D=u.charAt(E);if(T++,encodeURI(D).length>4&&T++,y=y.concat(D),T>=p)return y=y.concat("..."),y}if(T<p)return u}return""}const i=o.computed(()=>!!t.value&&!!t.value.date),a=o.computed(()=>{const u=t.value&&t.value.date||"";return`${n.exception.happend} : ${u}`}),s=o.computed(()=>!!t.value&&!!t.value.detail),f=o.computed(()=>t.value?e(t.value.detail)>160:!1),l=o.ref(!1),d=o.computed(()=>l.value?n.exception.collapse:n.exception.expand),g=o.computed(()=>{const u=n.exception.detail+" : "+(t.value&&t.value.detail)||"";return l.value?u:r(u,160)}),c=o.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function m(){l.value=!l.value}return()=>o.createVNode("div",{class:"toast-msg-detail"},[i.value&&o.createVNode("div",null,[a.value]),s.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("div",{innerHTML:g.value},null),f.value&&o.createVNode("span",{style:c.value,onClick:m},[d.value])])])])}function Gr(t){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value},null)}function Xr(t,n,e,r,i){const a=o.ref(t.exceptionInfo),s=o.computed(()=>{const p=n.value==="question"?"warning":n.value,h={"f-icon":!0},y=`f-icon-${p}`;return h[y]=!0,h}),f=o.computed(()=>e.value||a.value&&a.value.message),l=o.computed(()=>r.value),d=o.computed(()=>!!r.value),g=o.computed(()=>!!a.value);function c(){return g.value?Wr(a,i):d.value?Gr(l):()=>null}const m=c(),u=o.computed(()=>i.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:s.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:f.value,style:u.value},null),m()])])}function Yr(t,n,e,r){const{onCopy:i}=n,{toShowFeedback:a}=e,s=o.ref(r.exception.copySuccess||"复制成功"),f=o.ref(r.exception.copy||"复制详细信息"),l=o.ref(t.exceptionInfo||{date:"",message:"",detail:""}),d=o.computed(()=>l.value&&l.value.detail||"");function g(c){i(d.value).catch(m=>{s.value=r.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:g,style:"cursor: pointer;"},[f.value])])}function Jr(t,n,e,r,i){const a=o.ref(t.type),s=o.ref(t.buttons),f=o.ref(t.exceptionInfo),l=o.ref(i.ok||t.okButtonText),d=o.ref(i.cancel||t.cancelButtonText),g=o.ref(t.showCancelButton),c=o.ref(t.showOkButton),m=o.computed(()=>!!(s.value&&s.value.length)),u=o.computed(()=>!!(f.value&&f.value.detail)),p=o.computed(()=>!(s.value&&s.value.length)&&(c.value||g.value)),h=Yr(t,e,r,i);l.value==="关闭"?l.value=i.close:l.value==="知道了"&&(l.value=i.exception.roger);function y(E){a.value==="question"&&n.emit("reject"),n.emit("close")}function T(E){a.value==="question"&&n.emit("accept"),n.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[u.value&&h(),p.value&&g.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[d.value]),p.value&&c.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[l.value]),m.value&&s.value.length&&s.value.map(E=>o.createVNode("button",{type:"button",onClick:E.handle,class:E.class},[E.iconClass&&o.createVNode("span",{class:E.iconClass},null),E.text]))])}function Qr(t){const{t:n,locale:e}=yt.useI18n();function r(i,a,s){return a===s?n(i):a}return{yes:r("messageBox.yes")||"是",no:r("messageBox.no")||"否",close:r("messageBox.close")||"关闭",ok:r("messageBox.ok",t.okButtonText,"确定")||"确定",cancel:r("messageBox.cancel",t.cancelButtonText,"取消")||"取消",title:r("messageBox.title")||"系统提示",errorTitle:r("messageBox.errorTitle")||"错误提示",exception:{expand:r("messageBox.exception.expand")||"展开",collapse:r("messageBox.exception.collapse")||"收起",happend:r("messageBox.exception.happend")||"发生时间",detail:r("messageBox.exception.detail")||"详细信息",copy:r("messageBox.exception.copy")||"复制详细信息",copySuccess:r("messageBox.exception.copySuccess")||"复制成功",copyFailed:r("messageBox.exception.copyFailed")||"复制失败",roger:r("messageBox.exception.roger")||"知道了"},locale:e.value}}const pt=o.defineComponent({name:"FMessageBox",props:$r,emits:["accept","reject","close"],setup(t,n){const e=Qr(t),r=o.ref(t.type),i=o.ref(t.title),a=o.ref(t.detail),s=o.computed(()=>{const T={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${r.value}`;return T[E]=!0,T}),f=o.computed(()=>{const T={cursor:"default"};return r.value==="prompt"?T.padding="0.5rem 0.5rem 1rem 1.5rem":r.value==="error"&&(T.padding="0.5rem 1.5rem 1rem 1.5rem"),T}),l=Hr(),d=zr(t,r,i,a),g=Ur(),{feedbackStyle:c,feedbackMessage:m}=g;m.value=e.exception.copySuccess;function u(){return o.createVNode("div",{style:c.value},[m.value])}function p(){switch(r.value){case"prompt":return _r(t,d);default:return Xr(t,r,i,a,e)}}const h=p(),y=Jr(t,n,l,g,e);return()=>o.createVNode("div",{class:"farris-messager"},[!t.exceptionInfo&&o.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),o.createVNode("section",{class:s.value,style:f.value},[h()]),y(),u()])}}),Zr={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/modal.schema.json",title:"modal",description:"弹窗组件",type:"object",properties:{id:{description:"组件唯一标识",type:"string"},type:{description:"组件类型",type:"string",default:"modal"},appearance:{description:"组件外观",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},name:{description:"名称",type:"string",default:null},title:{description:"标题",type:"string"},width:{description:"窗口宽度",type:"number",default:900},height:{description:"窗口高度",type:"number",default:600},contents:{description:"弹窗子组件集合",type:"array",default:[]},modelValue:{description:"是否显示",type:"boolean",default:!1},showCloseButton:{description:"显示关闭按钮",type:"boolean",default:!0},showMaxButton:{description:"显示最大化按钮",type:"boolean",default:!0},enableEsc:{description:"允许ESC关闭",type:"boolean",default:!0},resizeable:{description:"允许调整窗口尺寸",type:"boolean",default:!0},fitContent:{description:"是否自适应",type:"boolean",default:!1},showButtons:{description:"是否显示底部按钮",type:"boolean",default:!0},mask:{description:"是否模态",type:"boolean",default:!0},draggable:{description:"是否允许拖拽调整位置",type:"boolean",default:!0},onAccept:{description:"确定事件",type:"object",default:null},onCancel:{description:"取消事件",type:"object",default:null},beforeClose:{description:"关闭前事件",type:"object",default:null}},required:["id","type"],events:{onAccept:"确定事件",onCancel:"取消事件",beforeClose:"关闭前回调"}},Kr=new Map([["appearance",vt.resolveAppearance]]);function ei(t,n,e){return n}function ti(){function t(n,e){const r={};return r.beforeClose=i=>e.call("beforeClose",[i,n]),r}return{resolve:t}}const rn={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"}},ni=vt.createPropsResolver(rn,Zr,Kr,ei),oi=ti();class ve{constructor(n,e){this.x=n,this.y=e}static getTransformInfo(n){const r=window.getComputedStyle(n).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(r.length>=6){const i=parseInt(r[4],10),a=parseInt(r[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(n,e=null){if(this.isMouseEvent(n))return new ve(n.clientX,n.clientY);if(e===null||n.changedTouches.length===1)return new ve(n.changedTouches[0].clientX,n.changedTouches[0].clientY);for(let r=0;r<n.changedTouches.length;r++)if(n.changedTouches[r].target===e)return new ve(n.changedTouches[r].clientX,n.changedTouches[r].clientY)}static isMouseEvent(n){return Object.prototype.toString.apply(n).indexOf("MouseEvent")===8}static isIPosition(n){return!!n&&"x"in n&&"y"in n}static getCurrent(n){const e=new ve(0,0);if(window){const r=window.getComputedStyle(n);if(r){const i=parseInt(r.getPropertyValue("left"),10),a=parseInt(r.getPropertyValue("top"),10);e.x=isNaN(i)?0:i,e.y=isNaN(a)?0:a}return e}return null}static copy(n){return new ve(0,0).set(n)}get value(){return{x:this.x,y:this.y}}add(n){return this.x+=n.x,this.y+=n.y,this}subtract(n){return this.x-=n.x,this.y-=n.y,this}multiply(n){this.x*=n,this.y*=n}divide(n){this.x/=n,this.y/=n}reset(){return this.x=0,this.y=0,this}set(n){return this.x=n.x,this.y=n.y,this}}class Ye{constructor(n,e){this.width=n,this.height=e}static getCurrent(n){const e=new Ye(0,0);if(window){const r=window.getComputedStyle(n);return r&&(e.width=parseInt(r.getPropertyValue("width"),10),e.height=parseInt(r.getPropertyValue("height"),10)),e}return null}static copy(n){return new Ye(0,0).set(n)}set(n){return this.width=n.width,this.height=n.height,this}}function ri(t,n){const e=o.ref(),r=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),f=o.ref(),l=o.ref(),d=o.ref(),g=o.ref(),c=o.ref(),m=o.ref(),u=o.ref(t.resizeable),p=o.ref(),h=o.ref(t.draggable),y=o.ref(!1);function T(){const R=r.value||document.body,M=window.getComputedStyle(R);if(!M||!e.value)return;const K=ve.getTransformInfo(e.value),A={};l.value&&(A.deltaL=e.value.offsetLeft-l.value.x,A.deltaT=e.value.offsetTop-l.value.y);const ae=M.getPropertyValue("position");A.width=R.clientWidth,A.height=R.clientHeight,A.pr=parseInt(M.getPropertyValue("padding-right"),10),A.pb=parseInt(M.getPropertyValue("padding-bottom"),10),A.position=M.getPropertyValue("position"),ae==="static"&&(R.style.position="relative"),A.translateX=K.x,A.translateY=K.y,c.value=A}function E(R){if(e.value){a.value=Ye.getCurrent(e.value),s.value=ve.getCurrent(e.value),f.value=a.value?Ye.copy(a.value):null,l.value=s.value?ve.copy(s.value):null,T();const M=R.target.getAttribute("type")||"";d.value={n:!!M.match(/n/),s:!!M.match(/s/),w:!!M.match(/w/),e:!!M.match(/e/)}}}function D(){var R,M,K,A;if(e.value){const ae=e.value;d.value&&((d.value.n||d.value.s)&&((R=f.value)!=null&&R.height)&&(ae.style.height=f.value.height+"px"),(d.value.w||d.value.e)&&((M=f.value)!=null&&M.width)&&(ae.style.width=f.value.width+"px"),l.value&&((K=l.value)!=null&&K.x&&(ae.style.left=l.value.x+"px"),(A=l.value)!=null&&A.y&&(ae.style.top=l.value.y+"px")))}}function N(){const R=t.minHeight?t.minHeight:1,M=t.minWidth?t.minWidth:1;f.value&&l.value&&d.value&&a.value&&(f.value.height<R&&(f.value.height=R,d.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-R))),f.value.width<M&&(f.value.width=M,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-M))),t.maxHeight&&f.value.height>t.maxHeight&&(f.value.height=t.maxHeight,s.value&&d.value.n&&(l.value.y=s.value.y+(a.value.height-t.maxHeight))),t.maxWidth&&f.value.width>t.maxWidth&&(f.value.width=t.maxWidth,d.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-t.maxWidth))))}function x(){if(r.value){const R=c.value;if(l.value&&f.value&&d.value&&a.value){const M=R.width-R.pr-R.deltaL-R.translateX-l.value.x,K=R.height-R.pb-R.deltaT-R.translateY-l.value.y;d.value.n&&l.value.y+R.translateY<0&&s.value&&(l.value.y=-R.translateY,f.value.height=a.value.height+s.value.y+R.translateY),d.value.w&&l.value.x+R.translateX<0&&s.value&&(l.value.x=-R.translateX,f.value.width=a.value.width+s.value.x+R.translateX),f.value.width>M&&(f.value.width=M),f.value.height>K&&(f.value.height=K)}}}function b(R){if(!i.value||!a.value||!s.value||!d.value)return;R.subtract(i.value);const M=R.x,K=R.y;d.value.n?(l.value.y=s.value.y+K,f.value.height=a.value.height-K):d.value.s&&(f.value.height=a.value.height+K),d.value.e?f.value.width=a.value.width+M:d.value.w&&(f.value.width=a.value.width-M,l.value.x=s.value.x+M),x(),N(),D()}function C(R){if(!g.value)return;const M=ve.fromEvent(R);M&&b(M)}function w(){if(e.value){const{width:R,height:M,x:K,y:A}=e.value.getBoundingClientRect(),ae=ve.getTransformInfo(e.value);return{size:{width:R,height:M},position:{x:K-ae.x,y:A-ae.y}}}return null}function V(R){if(e.value){const M=w();m.value=M}i.value=void 0,a.value=null,s.value=null,f.value=null,l.value=null,d.value=null,g.value=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",V)}function O(){document.addEventListener("mousemove",C),document.addEventListener("mouseup",V)}function S(R){R instanceof MouseEvent&&R.button===2||h.value&&(document.body.click(),R.stopPropagation(),R.preventDefault(),i.value=ve.fromEvent(R),g.value=R.target,E(R),O())}function Y(R){return e.value=R,u.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:M=>S(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:M=>S(M)},null)])}function W(R=!0){document.body.click();const M=r.value||document.body,K=Ye.getCurrent(M),A=e.value;R&&A&&(p.value=w(),p.value.transform=A.style.transform),K&&A&&(f.value=K,f.value.height-=14,f.value.width-=14,A.style.height=f.value.height+"px",A.style.width=f.value.width+"px",A.style.left="7px",A.style.top="7px",A.style.transform="",m.value={size:f.value,position:{x:0,y:0}},h.value=!1,y.value=!0)}function z(){var R,M;if(document.body.click(),p.value){const K={width:p.value.size.width||0,height:p.value.size.height||0},A={x:(window.innerWidth-K.width)/2,y:(window.innerHeight-K.height)/2};(R=f.value)==null||R.set(K),(M=l.value)==null||M.set(A);const ae=e.value;ae.style.height=K.height+"px",ae.style.width=K.width+"px",ae.style.left=`${A.x}px`,ae.style.top=`${A.y}px`,ae.style.transform="",m.value={size:K,position:A},h.value=t.draggable,y.value=!1}}function J(){if(e.value){const R=Ye.getCurrent(e.value);if(R){const{width:M,height:K}=R;e.value.style.left=`${(window.innerWidth-M)/2}px`,e.value.style.top=`${(window.innerHeight-K)/2}px`,e.value.style.transform=""}}}function oe(){const R=()=>{y.value?W(!1):J(),document.body.click()};return window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}}const fe=oe();return{renderResizeBar:Y,boundingElement:r,resizedEventParam:m,maximize:W,restore:z,allowDrag:h,isMaximized:y,unWindowResizeHandle:fe,moveToCenter:J}}function ii(t,n,e){const r=o.ref(),i=o.ref(t.draggable),a=o.ref(t.lockAxis),s=o.ref(),f=o.ref(),l=o.ref(!1),d=o.ref(new ve(0,0)),g=o.ref(new ve(0,0)),c=o.ref(new ve(0,0)),m=o.ref(new ve(0,0));o.watch(()=>e.value,C=>{s.value.style.cursor=C?"move":"default"});function u(C,w){if(w.tagName==="BUTTON")return!1;if(w===C)return!0;for(const V in w.children)if(Object.prototype.hasOwnProperty.call(w.children,V)&&u(C,w.children[V]))return!0;return!1}function p(){var O,S;let C=c.value.x+g.value.x,w=c.value.y+g.value.y;a.value==="x"?(C=((O=d.value)==null?void 0:O.x)||0,c.value.x=0):a.value==="y"&&(w=((S=d.value)==null?void 0:S.y)||0,c.value.y=0);const V=`translate3d(${Math.round(C)}px, ${Math.round(w)}px, 0px)`;r.value&&(r.value.style.transform=V),m.value.x=C,m.value.y=w}function h(){if(!f.value||!r.value)return null;const C=f.value.getBoundingClientRect(),w=r.value.getBoundingClientRect(),V={top:C.top<w.top,right:C.right>w.right,bottom:C.bottom>w.bottom,left:C.left<w.left};return V.top||(c.value.y-=w.top-C.top),V.bottom||(c.value.y-=w.bottom-C.bottom),V.right||(c.value.x-=w.right-C.right),V.left||(c.value.x-=w.left-C.left),p(),V}function y(C){C&&(d.value&&C.subtract(d.value),c.value.set(C),p(),h())}function T(C){l.value&&i.value&&(C.stopPropagation(),C.preventDefault(),y(ve.fromEvent(C,s.value)))}function E(){var C;l.value&&(l.value=!1,g.value.add(c.value),c.value.reset(),(C=r.value)==null||C.classList.remove("ng-dragging"),n.emit("stopMove"),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",E))}function D(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",T),document.addEventListener("mouseup",E))}function N(){if(r.value){const C=ve.getTransformInfo(r.value);g.value.set(C);return}g.value.reset()}function x(C){if(!e.value||C instanceof MouseEvent&&C.button===2)return;const w=C.target||C.srcElement;s.value!==void 0&&w&&!u(w,s.value)||i.value!==!1&&(document.body.click(),C.stopPropagation(),C.preventDefault(),d.value=ve.fromEvent(C,r.value),N(),D())}function b(C,w,V){if(i.value&&w){if(C)s.value=C;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)s.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const O=w.querySelector(t.dragHandle);O&&(s.value=O)}}r.value=w,f.value=V,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",x)):i.value=!1}}return{registerDraggle:b,resetTranslate:N}}function an(t,n){if(t){const e=r=>{r.key.toLowerCase()===t.toLowerCase()&&n({event:r,key:t})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function ai(t,n){const e=o.ref(t.enableEsc);let r=null;return e.value?(r=an("Escape",i=>{n.emit("esc",{event:i.event,type:"esc"})}),{remove:r}):null}function si(t,n){const e=o.ref(t.enableEnter);let r=null;return e.value?(r=an("Enter",i=>{n.emit("enter",{event:i.event,type:"enter"})}),{remove:r}):null}const Je=o.defineComponent({name:"FModal",props:rn,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(t,n){const e=o.ref(t.width||300),r=o.ref(t.height||200),i=o.ref(t.modelValue),a=o.ref(""),s=o.ref(t.class),f=o.ref(t.fitContent),l=o.ref(t.showHeader),d=o.ref(""),g=o.ref(t.showCloseButton),c=o.ref(t.showMaxButton),m=o.ref(!1),u=o.ref(t.dialogType),p=o.ref(t.src),h=o.ref(""),y=o.ref(t.showButtons),T=o.ref(t.title),E=o.ref(t.containment||null),D=o.ref(),{t:N}=yt.useI18n();T.value==="错误提示"&&(T.value=N("messageBox.errorTitle"));const x=o.ref(!1);function b(I,te){const be=te?"accept":"cancel";Promise.resolve().then(()=>{var xe;return(xe=t.beforeClose)==null?void 0:xe.call(t,{closeType:be})}).then(xe=>{xe&&(i.value=!1,n.emit("update:modelValue",!1),te!=null&&n.emit(te?"accept":"cancel"),n.emit("closed",I))})}const C=[{name:"cancel",text:N("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:I=>{b(I,!1)}},{name:"accept",text:N("messageBox.ok")||"确定",class:"btn btn-primary",handle:I=>{b(I,!0)}}],w=o.ref(t.buttons&&t.buttons.length?t.buttons:C),V=o.computed(()=>!!d.value),O=o.computed(()=>!!y.value&&!!w.value),S=o.ref(),Y=o.ref(),W=o.ref(!1),{renderResizeBar:z,maximize:J,restore:oe,boundingElement:fe,resizedEventParam:R,allowDrag:M,unWindowResizeHandle:K,moveToCenter:A}=ri(t),{registerDraggle:ae}=ii(t,n,M);function Ce(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ge(){const I=document.querySelectorAll(".farris-modal").length;(!I||I-1<=0)&&document.body.classList.remove("modal-open"),D.value&&D.value.classList.remove("show")}o.watch(()=>t.title,(I,te)=>{I!==te&&(T.value=I)}),o.watch(()=>t.modelValue,(I,te)=>{I!==te&&(i.value=I,i.value&&t.draggable&&o.nextTick(()=>{Y.value&&!E.value&&(E.value=Y.value.parentElement,fe.value=E.value,ae(S.value,Y.value,fe.value),A())}),I||(E.value&&(E.value=null),ge())),i.value?x.value=Ce():(W.value=!1,M.value=t.draggable)}),o.watch(()=>t.showHeader,(I,te)=>{I!==te&&(l.value=I)}),o.watch(()=>t.showButtons,(I,te)=>{I!==te&&(y.value=I)}),o.watch(()=>R.value,(I,te)=>{const be=I||{},xe=te||{};JSON.stringify(be)!==JSON.stringify(xe)&&n.emit("resize",{newSize:I,oldSize:te,isMaximized:W.value})});const ee=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),pe=o.computed(()=>{var be;const I={modal:!0,"farris-modal":!0,fade:!0};I["f-modal-fitContent"]=!!f.value,I.show=!!ee.value;const te=(be=t.maskClass)==null?void 0:be.split(" ");return te==null||te.reduce((xe,Ue)=>(xe[Ue]=!0,xe),I),I}),he=o.computed(()=>{var be;const I={"modal-dialog":!0},te=(be=s.value)==null?void 0:be.split(" ");return te==null||te.reduce((xe,Ue)=>(xe[Ue]=!0,xe),I),I}),le=o.computed(()=>{const I={position:"absolute",top:`${(window.innerHeight-r.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:f.value?"auto":`${r.value}px`};return t.mask||(I.pointerEvents="auto"),I}),U=()=>Oe.getMaxZIndex()||1040,de=o.computed(()=>{const I={display:"block",zIndex:U()};return t.mask||(I.pointerEvents="none",I.backgroundColor="transparent"),x.value&&(I.backgroundColor="transparent"),I}),Ae=o.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),$e=o.computed(()=>{const I={display:l.value?"":"none"};return I["pointer-events"]=M.value?"auto":"none",I}),Be=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:W.value})),We=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":u.value==="iframe","f-utils-fill":!0}));function ze(){return{height:`${t.footerHeight||60}px`}}const Ge=o.computed(()=>{const I={textAlgin:h.value},te=ze();return Object.assign(I,te)});function ye(I){if(I==null||I.stopPropagation(),W.value){W.value=!1,oe();return}J(),W.value=!0}async function Qe(I,te){I.handle&&await I.handle(te,I)&&n.emit("closed",te)}function Le(I){I.width&&(e.value=I.width),I.height&&(r.value=I.height),I.buttons&&(w.value=I.buttons),I.title&&(T.value=I.title)}let qe=null,G=null;o.onBeforeMount(()=>{x.value=Ce()}),o.onMounted(()=>{Y.value&&!E.value&&(E.value=Y.value.parentElement,fe.value=E.value,ae(S.value,Y.value,fe.value)),ee.value&&document.body.classList.add("modal-open"),qe=ai(t,n),G=si(t,n)}),o.onUnmounted(()=>{K&&K(),qe&&qe.remove(),G&&G.remove()}),n.expose({modalElementRef:Y,updateModalOptions:Le,close:b,maxDialog:ye,isMaximized:W});function X(){return o.createVNode("ul",null,[m.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&o.createVNode("li",{onClick:ye,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Be.value},null)]),g.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:I=>b(I,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function _(){return o.createVNode("div",{class:"modal-footer",style:Ge.value},[w.value&&w.value.map(I=>{const te=o.ref(I.disabled);return o.createVNode("button",{name:I.name,type:"button",disabled:te.value,class:I.class+(I.iconClass?" btn-icontext":""),onClick:be=>{Qe(I,be)}},[!!I.iconClass&&o.createVNode("i",{class:I.iconClass},null),I.text])})])}function ie(){return o.createVNode("div",{ref:S,class:"modal-header",style:$e.value},[n.slots.headerTemplate?n.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[V.value&&o.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[T.value])]),o.createVNode("div",{class:"actions"},[X()])])}function ue(){return n.slots.footerTemplate?n.slots.footerTemplate():O.value&&_()}function Ne(I){if(I.stopPropagation(),t.allowClickMaskToClose){if(I.target!==D.value)return;b(I,!1)}}function Te(){var I,te;return o.createVNode("div",{id:a.value,class:he.value,style:le.value,ref:Y},[o.createVNode("div",{class:Ae.value},[l.value&&ie(),o.createVNode("div",{class:We.value},[(te=(I=n.slots).default)==null?void 0:te.call(I),u.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),ue()]),!f.value&&Y.value&&!W.value&&z(Y.value)])}function Xe(I){return I||"body"}return()=>o.createVNode(o.Teleport,{to:Xe(t.host)},{default:()=>[ee.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:D,class:pe.value,style:de.value,onClick:Ne},[Te()])]})]})}});function sn(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function li(t){const n=document.createElement("div");n.style.display="contents";const e=o.createApp({setup(r,i){o.onUnmounted(()=>{document.body.removeChild(n)});const a=o.ref(),s=o.ref(t.class||""),f=o.ref(!!t.showButtons),l=o.ref(!!t.showHeader),d=o.ref(t.showCloseButton==null?!0:t.showCloseButton),g=o.ref(!0),c=o.ref(t.title||""),m=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{}),p=t.closedCallback||(D=>{}),h=t.resizeHandle||(D=>{}),y=t.stopMoveHandle||(D=>{}),T=sn(t),E=D=>{g.value=!1,e.unmount(),p(D)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(Je,{ref:a,class:s.value,modelValue:g.value,"onUpdate:modelValue":D=>g.value=D,title:c.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":l.value,"show-buttons":f.value,"show-close-button":d.value,"show-max-button":!1,onAccept:m,onCancel:u,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:E,onResize:h,onStopMove:y},{default:()=>[T&&T(e)]})}});return document.body.appendChild(n),e.use(lt.LocaleService.i18n),e.mount(n),e}class ln{constructor(n){Z(this,"appContext",null);Z(this,"modalRef",o.ref());Z(this,"activeModalIndex",o.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",o.ref(!1));Z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=n,this.appContext=n?n._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(n,e){const{width:r,height:i}={width:window.innerWidth,height:window.innerHeight};return r<n&&(n=r-14),i<e&&(e=i-14),{width:n,height:e}}static show(n){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return li(e)}close(n){var e,r;n?(r=n.value)==null||r.close():(e=this.getCurrentModal())==null||e.close()}open(n){const e=document.createDocumentFragment();n.showMaxButton&&n.fitContent&&(n.showMaxButton=!1);const r=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},n)),i=o.ref(!0),a=r.value.acceptCallback||(()=>{}),s=r.value.rejectCallback||(()=>{}),f=r.value.closedCallback||((x,b)=>{}),l=r.value.resizeHandle||(x=>{}),d=n.stopMoveHandle||(x=>{});let g;const c=sn(r.value),m=x=>{var C;i.value=!1;const b=(C=x==null?void 0:x.target)==null?void 0:C.classList.contains("modal_close");f(x,this.isUseEscCloseModal.value?"esc":b?"icon":"button")},u=x=>{m(x),g&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),g=null,this.modalRef.value=null,this.modalRefs){const b=Object.keys(this.modalRefs).map(C=>Number(C));b.length>0?this.activeModalIndex.value=Math.max(...b):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=x=>{var b;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((b=this.activeModalInstance.value)==null||b.close(x==null?void 0:x.event))},{width:h,height:y}=r.value,T=this.adaptToWindow(h||500,y||320);Object.assign(r.value,T);const E=()=>o.createVNode(Je,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":x=>i.value=x},r.value,{onAccept:a,onCancel:s,onClosed:u,onResize:l,onEsc:p,onStopMove:d}),{default:()=>[c&&c(this.app)]});return g=(x=>{const b=o.h(E,x);return b.appContext=this.appContext,o.render(b,e),b})({...r.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:x=>{r.value={...r.value,...x},g&&o.render(o.cloneVNode(g,{...r}),e)},destroy:u,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ci=Symbol("FModalService");Je.install=t=>{t.component(Je.name,Je);const n=new ln(t);t.provide(ci,n),t.provide("FModalService",n)},Je.register=(t,n,e,r)=>{t.modal=Je,n.modal=ni,r.modal={callbackResolver:oi}};const Re=class Re{static show(n){const e=o.reactive({...n}),r=!1,i=e.type==="error"||e.type==="prompt",a=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",s=e.acceptCallback||(()=>{}),f=e.rejectCallback||(()=>{});let l=null,d=new ln(Re.app);const g=()=>{l&&(l==null||l.destroy(),d=null)};return l=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:a,showButtons:r,showHeader:i,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>o.createVNode(pt,o.mergeProps(e,{onAccept:s,onReject:f,onClose:g}),null)}),d==null?void 0:d.getCurrentModal()}static info(n,e){const r=o.reactive({type:"info",title:n,detail:e,okButtonText:"知道了",showCancelButton:!1});Re.show(r)}static warning(n,e){const r=o.reactive({type:"warning",title:n,detail:e,okButtonText:"知道了",showCancelButton:!1});Re.show(r)}static success(n,e){const r=o.reactive({type:"success",title:n,detail:e,okButtonText:"关闭",showCancelButton:!1});Re.show(r)}static error(n,e,r){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:r,message:n,detail:e}});Re.show(i)}static prompt(n,e){const r=o.reactive({type:"prompt",title:n,detail:e,okButtonText:"确定",cancelButtonText:"取消"});Re.show(r)}static question(n,e,r,i){const a=o.reactive({type:"question",title:n,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:r,rejectCallback:i});Re.show(a)}};Z(Re,"app",null);let mt=Re;pt.install=t=>{t.component(pt.name,pt),mt.app=t,t.provide("FMessageBoxService",mt)};class di extends nn{constructor(e,r){super(e,r);Z(this,"responseLayoutEditorFunction");Z(this,"bindingVarible");Z(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=Cr(this.formSchemaUtils)}getCommonPropertyConfig(e,r,i="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(e,r,i),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,r),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group")}getPropertyConfig(e,r){return this.getCommonPropertyConfig(e,r,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(e,r){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,r,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,r,i="Card"){const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:f}=this.getAvailableEditorType(e),l={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:f,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(d,g,c){if(d)switch(d&&d.propertyID){case"type":{a.changeControlType(e,d,r);break}case"label":{d.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,d,c);break}}}};return i.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(e,r){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==Oe.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a;const r=this.checkCanChangeControlType(e,this.viewModelId);if(!r)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((a=P[e.editor.type])==null?void 0:a.name)||e.editor.type}]};let i=[];return this.designViewModelField&&this.designViewModelField.$type===Oe.FormSchemaEntityField$Type.SimpleField?i=nt.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=nt.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:r,editorTypeList:i}}changeBindingField(e,r,i){r.needRefreshEntityTree=!0}getAppearanceProperties(e,r){const i=this;return{title:"外观",description:"Appearance",properties:{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"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,i.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||e.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(e.id,r),delete e.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,e.id,this.componentId),dt.value++;break;case"style":{dt.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,r,i){const a=r.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const f=s.contents.findIndex(g=>g.id===e.id);if(f===-1)return;const l=s.contents[f];let d;if(this.designViewModelField){const m=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};m.editor||(m.editor={}),m.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,m,!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}d||(d=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(d,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(d,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(g=>{Object.prototype.hasOwnProperty.call(l.editor,g)&&(d.editor[g]=l.editor[g])}),i!=null&&i.updateContextSchema?i.updateContextSchema(d):(i.schema=Object.assign(l,d),Object.assign(e,d)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(g=>g.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused")),dt.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,r={},i={},a){var m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},r),f=(m=e.binding)!=null&&m.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(e,f,"readonly"),d=this.getPropertyEditorParams(e,f,"required"),g={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:d},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const u in i)g[u]=Object.assign(g[u]||{},i[u]);const c=this;return{...s,properties:{...g},setPropertyRelates(u,p){if(u){switch(u.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(e,u);break}a&&a.bind(c)(u,e,p)}}}}updateUnifiedLayoutAfterControlChanged(e,r,i){const a=e.split(" ");let s=a.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),f=a.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=a.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),d=a.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));s=s||"col-12",f=f||"col-md-"+s.replace("col-",""),l=l||"col-xl-"+f.replace("col-md-",""),d=d||"col-el-"+l.replace("col-xl-","");const g={id:r,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(f.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,g)}updateUnifiedLayoutAfterResponseLayoutChanged(e,r){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),r){const p=a.find(h=>h.id===r.id);Object.assign(p||{},r)}const s=a.map(p=>p.columnInSM),f=a.map(p=>p.columnInMD),l=a.map(p=>p.columnInLG),d=a.map(p=>p.columnInEL),g=this.checkIsUniqueColumn(s)?s[0]:null,c=this.checkIsUniqueColumn(f)?f[0]:null,m=this.checkIsUniqueColumn(l)?l[0]:null,u=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:g,uniqueColClassInMD:c,uniqueColClassInLG:m,uniqueColClassInEL:u})}checkIsUniqueColumn(e){const r=new Set(e);return Array.from(r).length===1}getItemCollectionEditor(e,r,i){return r=r||"value",i=i||"name",{editor:{columns:[{field:r,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:r,nameField:i,requiredFields:[r,i],uniqueFields:[r,i],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===Oe.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,r){e.binding&&e.binding.type===ot.Form&&e.binding.field?(r.find(s=>s.label==="fieldValueChanging")||r.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),r.find(s=>s.label==="fieldValueChanged")||r.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):r=r.filter(i=>i.label!=="fieldValueChanging"&&i.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case ot.Form:return e.binding.path||e.type;case ot.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,r="card",i,a){const s=this;let f=[];i&&(f=f.concat(i)),this.appendFieldValueChangeEvents(e,f);const l=s.eventsEditorUtils.formProperties(e,s.viewModelId,f);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,m){const u=c.propertyValue;delete e[s.viewModelId],u&&(u.setPropertyRelates=this.setPropertyRelates,u.controlInfo={type:s.getControlMethodType(e),name:e.title},s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,u.events,u)),a&&a(c,m,u);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:e.fieldValueChanging,valueChanged:e.fieldValueChanged})}}}getExpressionConfig(e,r,i=["compute","dependency","validate"],a){return new wt(this.formSchemaUtils).getExpressionConfig(e,r,i,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,r,i){var a;e.editor[r]!==i?e.editor[r]=i:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(e,r,i){let a=i;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(r==="trueValue"?"true":"false"));const f=r==="trueValue"?"falseValue":"trueValue";e.editor[f]===a&&(a=a+1),this.updatePropertyValue(e,r,a)}getBooleanValueConverter(){return{convertFrom:(e,r)=>e.editor[r],convertTo:(e,r,i)=>{this.setBooleanValue(e,r,i)}}}}const ui={install(t){t.component(xt.name,xt)}};F.BaseControlProperty=nn,F.ExpressionProperty=wt,F.FPropertyPanel=xt,F.FormBindingType=ot,F.InputBaseProperty=di,F.PropertyType=on,F.SchemaDOMMapping=nt,F.default=ui,F.propertyPanelItemProps=Gt,F.propertyPanelProps=Dt,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});