@farris/ui-vue 1.5.7 → 1.5.9

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 (128) hide show
  1. package/components/avatar/index.esm.js +5 -5
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/component/index.esm.js +5 -5
  4. package/components/component/index.umd.cjs +1 -1
  5. package/components/condition/index.esm.js +5 -5
  6. package/components/condition/index.umd.cjs +1 -1
  7. package/components/content-container/index.esm.js +5 -5
  8. package/components/content-container/index.umd.cjs +1 -1
  9. package/components/date-picker/index.esm.js +1082 -1421
  10. package/components/date-picker/index.umd.cjs +1 -1
  11. package/components/designer-canvas/index.esm.js +908 -897
  12. package/components/designer-canvas/index.umd.cjs +1 -1
  13. package/components/dynamic-form/index.esm.js +5 -5
  14. package/components/dynamic-form/index.umd.cjs +1 -1
  15. package/components/dynamic-view/index.esm.js +5 -5
  16. package/components/dynamic-view/index.umd.cjs +1 -1
  17. package/components/events-editor/index.esm.js +5 -5
  18. package/components/events-editor/index.umd.cjs +1 -1
  19. package/components/filter-bar/index.esm.js +13 -12
  20. package/components/filter-bar/index.umd.cjs +1 -1
  21. package/components/flow-canvas/index.esm.js +5 -5
  22. package/components/flow-canvas/index.umd.cjs +1 -1
  23. package/components/number-range/index.esm.js +5 -5
  24. package/components/number-range/index.umd.cjs +1 -1
  25. package/components/number-spinner/index.esm.js +5 -5
  26. package/components/number-spinner/index.umd.cjs +1 -1
  27. package/components/page-header/index.esm.js +862 -3625
  28. package/components/page-header/index.umd.cjs +1 -1
  29. package/components/property-panel/index.esm.js +5 -5
  30. package/components/property-panel/index.umd.cjs +1 -1
  31. package/components/query-solution/index.esm.js +77 -76
  32. package/components/query-solution/index.umd.cjs +6 -6
  33. package/components/response-layout/index.esm.js +5 -5
  34. package/components/response-layout/index.umd.cjs +1 -1
  35. package/components/response-toolbar/index.esm.js +500 -3662
  36. package/components/response-toolbar/index.umd.cjs +1 -1
  37. package/components/schema-selector/index.esm.js +3008 -7347
  38. package/components/schema-selector/index.umd.cjs +6 -6
  39. package/components/section/index.esm.js +117 -7544
  40. package/components/section/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +545 -4943
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/components/textarea/index.esm.js +100 -5841
  44. package/components/textarea/index.umd.cjs +2 -2
  45. package/components/time-picker/index.esm.js +5 -5
  46. package/components/time-picker/index.umd.cjs +1 -1
  47. package/components/video/index.esm.js +5 -5
  48. package/components/video/index.umd.cjs +1 -1
  49. package/designer/button-edit/index.css +1 -0
  50. package/designer/button-edit/index.esm.js +1556 -0
  51. package/designer/button-edit/index.umd.cjs +1 -0
  52. package/designer/checkbox/index.esm.js +207 -0
  53. package/designer/checkbox/index.umd.cjs +1 -0
  54. package/designer/checkbox-group/index.esm.js +377 -0
  55. package/designer/checkbox-group/index.umd.cjs +1 -0
  56. package/designer/data-grid/index.css +1 -0
  57. package/designer/data-grid/index.esm.js +14332 -0
  58. package/designer/data-grid/index.umd.cjs +20 -0
  59. package/designer/data-view/index.esm.js +271 -0
  60. package/designer/data-view/index.umd.cjs +1 -0
  61. package/designer/date-picker/index.esm.js +1879 -0
  62. package/designer/date-picker/index.umd.cjs +1 -0
  63. package/designer/drawer/index.css +1 -0
  64. package/designer/drawer/index.esm.js +463 -0
  65. package/designer/drawer/index.umd.cjs +1 -0
  66. package/designer/farris-designer.all.esm.js +16827 -0
  67. package/designer/farris-designer.all.umd.cjs +32 -0
  68. package/designer/index.css +1 -0
  69. package/designer/input-group/index.esm.js +647 -0
  70. package/designer/input-group/index.umd.cjs +1 -0
  71. package/designer/radio-group/index.esm.js +6959 -0
  72. package/designer/radio-group/index.umd.cjs +1 -0
  73. package/designer/response-toolbar/index.esm.js +3015 -0
  74. package/designer/response-toolbar/index.umd.cjs +1 -0
  75. package/designer/section/index.esm.js +744 -0
  76. package/designer/section/index.umd.cjs +1 -0
  77. package/designer/tabs/index.esm.js +2200 -0
  78. package/designer/tabs/index.umd.cjs +1 -0
  79. package/designer/textarea/index.esm.js +249 -0
  80. package/designer/textarea/index.umd.cjs +1 -0
  81. package/designer/tree-grid/index.css +1 -0
  82. package/designer/tree-grid/index.esm.js +1673 -0
  83. package/designer/tree-grid/index.umd.cjs +1 -0
  84. package/farris.all.esm.js +30447 -30444
  85. package/farris.all.umd.cjs +16 -16
  86. package/package.json +1 -1
  87. package/types/date-picker/designer.d.ts +29 -0
  88. package/types/date-picker/index.d.ts +2 -1
  89. package/types/date-picker/src/date-picker.props.d.ts +0 -5
  90. package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
  91. package/types/designer-canvas/index.d.ts +2 -2
  92. package/types/response-toolbar/designer.d.ts +37 -0
  93. package/types/response-toolbar/index.d.ts +6 -5
  94. package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
  95. package/types/response-toolbar/src/composition/types.d.ts +1 -1
  96. package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
  97. package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
  98. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
  99. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
  100. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
  101. package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
  102. package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
  103. package/types/section/designer.d.ts +26 -0
  104. package/types/section/index.d.ts +1 -0
  105. package/types/section/src/designer/section-header.design.component.d.ts +2 -2
  106. package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
  107. package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
  108. package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
  109. package/types/section/src/designer/section.design.props.d.ts +11 -0
  110. package/types/section/src/designer/use-designer-rules.d.ts +1 -2
  111. package/types/section/src/property-config/section.property-config.d.ts +1 -1
  112. package/types/section/src/schema/schema-resolver.d.ts +1 -1
  113. package/types/section/src/section.props.d.ts +0 -10
  114. package/types/tabs/designer.d.ts +28 -0
  115. package/types/tabs/index.d.ts +1 -0
  116. package/types/tabs/src/components/tab-page.props.d.ts +0 -1
  117. package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
  118. package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
  119. package/types/tabs/src/tabs.props.d.ts +0 -11
  120. package/types/textarea/designer.d.ts +28 -0
  121. package/types/textarea/index.d.ts +0 -15
  122. package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
  123. package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
  124. package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
  125. package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
  126. package/types/textarea/src/textarea.props.d.ts +0 -5
  127. package/components/textarea/index.css +0 -1
  128. /package/{components/section → designer/radio-group}/index.css +0 -0
@@ -1 +1 @@
1
- (function(ie,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("@vueuse/core"),require("../dynamic-resolver/index.umd.js"),require("../data-view/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","@vueuse/core","../dynamic-resolver/index.umd.js","../data-view/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../notify/index.umd.js"],n):(ie=typeof globalThis<"u"?globalThis:ie||self,n(ie["response-layout"]={},ie.Vue,ie.LodashES,ie.common,ie.VueUseCore,ie.dynamicResolver,ie.dataView,ie.designerCanvas,ie.propertyPanel))})(this,function(ie,n,le,We,Qt,ve,K,He,Oe){"use strict";var go=Object.defineProperty;var vo=(ie,n,le)=>n in ie?go(ie,n,{enumerable:!0,configurable:!0,writable:!0,value:le}):ie[n]=le;var H=(ie,n,le)=>vo(ie,typeof n!="symbol"?n+"":n,le);const Vt={},kt={};function pt(i){const{properties:e,title:t,ignore:o}=i,r=o&&Array.isArray(o),s=Object.keys(e).reduce((a,u)=>((!r||!o.find(c=>c===u))&&(a[u]=e[u].type==="object"&&e[u].properties?pt(e[u]):le.cloneDeep(e[u].default)),a),{});if(t&&(!r||!o.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");s.id=`${a}_${Math.random().toString().slice(2,6)}`}return s}function Zt(i){const{properties:e,title:t,required:o}=i;if(o&&Array.isArray(o)){const r=o.reduce((s,a)=>(s[a]=e[a].type==="object"&&e[a].properties?pt(e[a]):le.cloneDeep(e[a].default),s),{});if(t&&o.find(s=>s==="id")){const s=t.toLowerCase().replace(/-/g,"_");r.id=`${s}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function tt(i,e={},t){const o=Vt[i];if(o){let r=Zt(o);const s=kt[i];return r=s?s({getSchemaByType:tt},r,e,t):r,r}return null}function Kt(i,e){const t=pt(e);return Object.keys(t).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(i,r)&&(o[r]&&le.isPlainObject(o[r])&&le.isPlainObject(i[r]||!i[r])?Object.assign(o[r],i[r]||{}):o[r]=i[r]),o),t),t}function $t(i,e){return Object.keys(i).filter(o=>i[o]!=null).reduce((o,r)=>{if(e.has(r)){const s=e.get(r);if(typeof s=="string")o[s]=i[r];else{const a=s(r,i[r],i);Object.assign(o,a)}}else o[r]=i[r];return o},{})}function en(i,e,t=new Map){const o=Kt(i,e);return $t(o,t)}function tn(i={}){function e(l,p,d,m){if(typeof d=="number")return m[l].length===d;if(typeof d=="object"){const f=Object.keys(d)[0],h=d[f];if(f==="not")return Number(m[l].length)!==Number(h);if(f==="moreThan")return Number(m[l].length)>=Number(h);if(f==="lessThan")return Number(m[l].length)<=Number(h)}return!1}function t(l,p,d,m){return m[l]&&m[l].propertyValue&&String(m[l].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(i).reduce((l,p)=>(l.set(p,i[p]),l),o);function r(l,p){const d=l;return typeof p=="number"?[{target:d,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:d,operator:"getProperty",param:l,value:!!p}]:typeof p=="object"?Object.keys(p).map(m=>{if(m==="length")return{target:d,operator:"length",param:null,value:p[m]};const f=m,h=p[m];return{target:d,operator:"getProperty",param:f,value:h}}):[]}function s(l){return Object.keys(l).reduce((d,m)=>{const f=r(m,l[m]);return d.push(...f),d},[])}function a(l,p){if(o.has(l.operator)){const d=o.get(l.operator);return d&&d(l.target,l.param,l.value,p)||!1}return!1}function u(l,p){return s(l).reduce((f,h)=>f&&a(h,p),!0)}function c(l,p){const d=Object.keys(l),m=d.includes("allOf"),f=d.includes("anyOf"),h=m||f,I=(h?l[h?m?"allOf":"anyOf":"allOf"]:[l]).map(L=>u(L,p));return m?!I.includes(!1):I.includes(!0)}return{parseValueSchema:c}}const me={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},nn={},on={};tn();function Xe(i,e,t=new Map,o=(a,u,c,l)=>u,r={},s=a=>a){return Vt[e.title]=e,kt[e.title]=o,nn[e.title]=r,on[e.title]=s,(a={},u=!0)=>{if(!u)return $t(a,t);const c=en(a,e,t),l=Object.keys(i).reduce((p,d)=>(p[d]=i[d].default,p),{});return Object.assign(l,c)}}function ft(i,e){return{customClass:e.class,customStyle:e.style}}const Ot=new Map([["appearance",ft]]);function rn(i,e,t){if(t.componentFeature){const o=JSON.parse(t.componentFeature);e.appearance={class:"bg-white"},e.contents=String(o.splitter).split(":").map(r=>{const s=i.getSchemaByType("response-layout-item");return s.appearance={class:`h-100 col-${r} px-0`},s})}return e}const sn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout.schema.json",title:"response-layout",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout",type:"string"},type:{description:"The type string of Respnse Layout component",type:"string",default:"response-layout"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},nt={customClass:{type:String,default:""},customStyle:{type:String,default:""}},mt=Xe(nt,sn,Ot,rn),ot=n.defineComponent({name:"FResponseLayout",props:nt,emits:[],setup(i,e){function t(r,s){r&&s&&s.split(" ").reduce((u,c)=>(u[c]=!0,u),r)}const o=n.computed(()=>{const r={"d-flex":!0};return t(r,i.customClass),r});return()=>n.createVNode("div",{class:o.value,style:i.customStyle},[e.slots.default&&e.slots.default()])}}),an={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout-item.schema.json",title:"response-layout-item",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout Item",type:"string"},type:{description:"The type string of Respnse Layout Item component",type:"string",default:"response-layout-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},ht={customClass:{type:String,default:""},customStyle:{type:String,default:""}},Lt=Xe(ht,an,Ot),it=n.defineComponent({name:"FResponseLayoutItem",props:ht,emits:[],setup(i,e){return()=>n.createVNode("div",{class:i.customClass,style:i.customStyle},[e.slots.default&&e.slots.default()])}});function Dt(i,e,t){var N;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=n.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function u(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function p(C){if(!C||!C.value)return null;if(C.value.schema&&C.value.schema.type==="component")return C.value;const A=n.ref(C==null?void 0:C.value.parent),q=p(A);return q||null}function d(C=e){var z;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(C);const{componentInstance:A,designerItemElementRef:q}=C;if(!A||!A.value)return null;const{getCustomButtons:g}=A.value;return A.value.canMove||g&&((z=g())!=null&&z.length)?q:d(C.parent)}function m(C){return!!t&&t.canAccepts(C)}function f(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function h(){}function b(C,A){var q;!C||!A||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(C,A),(q=e==null?void 0:e.setupContext)==null||q.emit("dragEnd"))}function j(C,A){const{componentType:q}=C;let g=tt(q,C,A);t&&t.onResolveNewComponentSchema&&(g=t.onResolveNewComponentSchema(C,g));const z=q.toLowerCase().replace(/-/g,"_");return g&&!g.id&&g.type===q&&(g.id=`${z}_${Math.random().toString().slice(2,6)}`),g}function I(C){C&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(C)}function k(...C){if(t&&t.getPropsConfig)return t.getPropsConfig(...C)}function L(C){if(!C)return;const A=e==null?void 0:e.schema,{formSchemaUtils:q}=C;if(A&&q.getExpressions().length){const g=q.getExpressions().findIndex(z=>z.target===A.id);g>-1&&q.getExpressions().splice(g,1)}}function R(C){t&&t.onRemoveComponent&&t.onRemoveComponent(),L(C),e!=null&&e.schema.contents&&e.schema.contents.map(A=>{let q=A.id;A.type==="component-ref"&&(q=A.component);const g=i.value.querySelectorAll(`#${q}-design-item`);g!=null&&g.length&&Array.from(g).map(z=>{var Y;(Y=z==null?void 0:z.componentInstance)!=null&&Y.value.onRemoveComponent&&z.componentInstance.value.onRemoveComponent(C)})})}function S(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function E(C){if(t&&t.onPropertyChanged)return t.onPropertyChanged(C)}return s.value={canMove:a(),canSelectParent:u(),canDelete:c(),canNested:!l(),contents:e==null?void 0:e.schema.contents,elementRef:i,parent:(N=e==null?void 0:e.parent)==null?void 0:N.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:m,getBelongedComponentInstance:p,getDraggableDesignItemElement:d,getDraggingDisplayText:f,getPropConfig:k,getDragScopeElement:h,onAcceptMovedChildElement:b,onChildElementMovedOut:I,addNewChildComponentSchema:j,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:R,getCustomButtons:S,onPropertyChanged:E},s}const Pt=n.ref(0),ln=n.ref(0);function Rt(){ln.value++}function cn(i){const{formSchemaUtils:e,formStateMachineUtils:t}=i;function o(c,l=""){return{path:l+c.code,field:c.id,fullPath:c.code}}function r(c,l=""){return e.getViewModelById(c).states.map(d=>o(d,l))}function s(c){const l=e.getRootViewModelId(),p=r(c);if(c===l)return p;const d=r(l,"root-component.");return[...p,...d]}function a(c){return c.binding&&c.binding.path||c.id||""}function u(){return t&&t.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:u}}class un{constructor(e){H(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'"}]);H(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});H(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,s,a)=>{const u=s.getExpressionRuleValue(e,t||r);return u&&u.value||""},convertTo:(o,r,s,a,u)=>{var c;if(r==="dataPicking"&&(s!=null&&s.target)){const l=`${s.target}_dataPicking`;((c=s.rules)==null?void 0:c.some(d=>d.id===l&&d.value))?o.dictPickingExpressionId=l:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===e);if(!r)return"";const s=r.rules.find(a=>a.type===t);return s||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var u;const s=this.createTreeNode(r,t);let a=[];(u=r.type)!=null&&u.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var c,l;const s=this.createTreeNode(r,t),a=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...t,r.label]),u=this.buildChildEntityTreeData((l=r.type)==null?void 0:l.entities,[...t,r.label]);u!=null&&u.length&&(a==null||a.push(...u)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,t),a=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(t)&&s?s.message:"",...a};return s.messageType!=null&&(u.messageType=s.messageType),u}buildRule(e,t,o,r){const{expression:s,message:a,messageType:u}=t,c={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=a),o==="dataPicking"&&(c.messageType=u),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const s=t==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let c=this.getExpressionData().find(p=>p.targetType===t&&p.target===s);const l=p=>p.value.trim()==="";if(c){const p=c.rules.find(d=>d.id===a.id);if(p)l(a)?c.rules=c.rules.filter(d=>d.id!==a.id):(Object.assign(p,a),r==="validate"&&e.type==="form-group"&&(p.elementId=e.id));else{if(l(a))return null;c.rules=c.rules||[],c.rules.push(a)}}else{if(l(a))return null;c={target:`${s}`,rules:[a],targetType:t}}return c}getExpressionEditorOptions(e,t,o,r){return o.reduce((s,a)=>{var c,l;const u=t==="Field"?(c=e==null?void 0:e.binding)==null?void 0:c.field:e.id;return s[a]={hide:t==="Field"?!!((l=e==null?void 0:e.binding)!=null&&l.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(u),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,a,t),onSubmitModal:p=>{const d=this.updateExpression(e,t,p,a);if(r){const m=this.buildRule(u,p,a);r(m)}return d}}},s},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:t,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class yt{constructor(e,t){H(this,"componentId");H(this,"viewModelId");H(this,"eventsEditorUtils");H(this,"formSchemaUtils");H(this,"formMetadataConverter");H(this,"designViewModelUtils");H(this,"designViewModelField");H(this,"controlCreatorUtils");H(this,"designerHostService");H(this,"schemaService",null);H(this,"metadataService",null);H(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:me[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},s={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const a in t)s[a]=Object.assign(s[a]||{},t[a]);return{...r,properties:{...s},setPropertyRelates(a,u){if(a){switch(a&&a.propertyID){case"class":case"style":{Pt.value++;break}}o&&o(a,e,u)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},s={}){const{getVariables:a,getControlName:u,getStateMachines:c}=cn(this.designerHostService),l=this.getRealTargetType(e),p=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],d={type:"property-editor",propertyTypes:p};return p.map(m=>{switch(m){case"Const":Object.assign(d,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":d.expressionConfig=this.getExpressionOptions(e,l,o);break;case"StateMachine":d.stateMachines=c();break;case"Variable":Object.assign(d,{controlName:u(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:a(this.viewModelId),onBeforeOpenVariables:f=>{f.value=a(this.viewModelId)}},s);break}}),d}getVisibleProperty(e,t=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,t==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(e,t="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,t);for(const c in o)a[c]=Object.assign(a[c]||{},o[c]);const u=this;return{...s,properties:{...a},setPropertyRelates(c,l){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,c);break}r&&r(c,l)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===e),s=le.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),Rt()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(t).states.push(a)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:s,expressionInfo:a}=t,{targetId:u,targetType:c,expressionType:l,value:p,message:d}=a,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:f}=m;let h=f.find(j=>j.target===u);h||(h={target:u,rules:[],targetType:c},f.push(h));const b=h.rules.find(j=>j.type===l);if(b)b.value=p,b.message=d;else{const j={id:s,type:l,value:p,message:d};h.rules.push(j)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),u=t.binding?t.binding.field:t.id,c=a.find(l=>l.target===u);!c||!c.rules||(c.rules=c.rules.filter(l=>l.type!==s))}getExpressionOptions(e,t,o){return new un(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}class dn extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.propertyConfig.categories.layout=this.getLayoutPropConfig(e,this.viewModelId),this.propertyConfig}getLayoutPropConfig(e,t){return{title:"布局",description:"layout",properties:{layout:{title:"",type:"select",description:"配置布局容器内区块个数及比例。",editor:{type:"response-layout-splitter",layout:e.contents||[]}}},setPropertyRelates(o,r){Pt.value++}}}}function pn(i,e){const t=i.schema;function o(u){return!1}function r(u){return new dn(u,e).getPropertyConfig(t)}function s(){var l;const u=i.designerItemElementRef.value.querySelector(`#${t.id}`);if(!u)return;const c=((l=i.schema.contents)==null?void 0:l.map(p=>p.id))||[];Array.from(u.children).map(p=>{var m;const d=(m=p.componentInstance)==null?void 0:m.value;d!=null&&d.schema&&!c.includes(d.schema.id)&&d.onRemoveComponent&&d.onRemoveComponent(e)})}function a(u){var c;u&&((c=u==null?void 0:u.changeObject)==null?void 0:c.propertyID)==="layout"&&s()}return{canAccepts:o,getPropsConfig:r,onPropertyChanged:a}}const fn=n.defineComponent({name:"FResponseLayoutDesign",props:nt,emits:[],setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=pn(o,r),a=Dt(t,o,s);n.onMounted(()=>{t.value.componentInstance=a}),e.expose(a.value);function u(l,p){l&&p&&p.split(" ").reduce((m,f)=>(m[f]=!0,m),l)}const c=n.computed(()=>{const l={"d-flex":!0,"response-layout":!0};return u(l,i.customClass),l});return()=>n.createVNode("div",{ref:t,class:c.value,style:"height:inherit;"},[e.slots.default&&e.slots.default()])}});var Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mn={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(){return function(){function t(o,r,s){function a(l,p){if(!r[l]){if(!o[l]){var d=typeof rt=="function"&&rt;if(!p&&d)return d(l,!0);if(u)return u(l,!0);var m=new Error("Cannot find module '"+l+"'");throw m.code="MODULE_NOT_FOUND",m}var f=r[l]={exports:{}};o[l][0].call(f.exports,function(h){var b=o[l][1][h];return a(b||h)},f,f.exports,t,o,r,s)}return r[l].exports}for(var u=typeof rt=="function"&&rt,c=0;c<s.length;c++)a(s[c]);return a}return t}()({1:[function(t,o,r){var s={},a="(?:^|\\s)",u="(?:\\s|$)";function c(d){var m=s[d];return m?m.lastIndex=0:s[d]=m=new RegExp(a+d+u,"g"),m}function l(d,m){var f=d.className;f.length?c(m).test(f)||(d.className+=" "+m):d.className=m}function p(d,m){d.className=d.className.replace(c(m)," ").trim()}o.exports={add:l,rm:p}},{}],2:[function(t,o,r){(function(s){var a=t("contra/emitter"),u=t("crossvent"),c=t("./classes"),l=document,p=l.documentElement;function d(g,z){var Y=arguments.length;Y===1&&Array.isArray(g)===!1&&(z=g,g=[]);var y,w,B,_,x,T,O,M,V,X=null,ee,W,se=!1,re=0,Q,D=z||{};D.moves===void 0&&(D.moves=k),D.accepts===void 0&&(D.accepts=k),D.invalid===void 0&&(D.invalid=Qe),D.containers===void 0&&(D.containers=g||[]),D.isContainer===void 0&&(D.isContainer=I),D.copy===void 0&&(D.copy=!1),D.copySortSource===void 0&&(D.copySortSource=!1),D.revertOnSpill===void 0&&(D.revertOnSpill=!1),D.removeOnSpill===void 0&&(D.removeOnSpill=!1),D.direction===void 0&&(D.direction="vertical"),D.ignoreInputTextSelection===void 0&&(D.ignoreInputTextSelection=!0),D.mirrorContainer===void 0&&(D.mirrorContainer=l.body);var oe=a({containers:D.containers,start:Je,end:Ge,cancel:be,remove:ae,destroy:Ve,canMove:Ue,dragging:!1});return D.removeOnSpill===!0&&oe.on("over",xt).on("out",et),Ae(),oe;function ue(v){return oe.containers.indexOf(v)!==-1||D.isContainer(v)}function Ae(v){var $=v?"remove":"add";h(p,$,"mousedown",De),h(p,$,"mouseup",F)}function Be(v){var $=v?"remove":"add";h(p,$,"mousemove",$e)}function Fe(v){var $=v?"remove":"add";u[$](p,"selectstart",ke),u[$](p,"click",ke)}function Ve(){Ae(!0),F({})}function ke(v){ee&&v.preventDefault()}function De(v){_=v.clientX,x=v.clientY;var $=b(v)!==1||v.metaKey||v.ctrlKey;if(!$){var P=v.target,G=Te(P);G&&(ee=G,Be(),v.type==="mousedown"&&(E(P)?P.focus():v.preventDefault()))}}function $e(v){if(ee){if(b(v)===0){F({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-_)<=(D.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-x)<=(D.slideFactorY||0))){if(D.ignoreInputTextSelection){var $=q("clientX",v)||0,P=q("clientY",v)||0,G=l.elementFromPoint($,P);if(E(G))return}var te=ee;Be(!0),Fe(),Ge(),ze(te),c.add(M||B,"gu-transit"),Tt(),It(),re=0,Ke(v)}}}function Te(v){if(!(oe.dragging&&y)&&!ue(v)){for(var $=v;S(v)&&ue(S(v))===!1;)if(D.invalid(v,$)||(v=S(v),!v))return;var P=S(v);if(P&&!D.invalid(v,$)){var G=D.moves(v,P,$,C(v));if(G)return{item:v,source:P}}}}function Ue(v){return!!Te(v)}function Je(v){var $=Te(v);$&&ze($)}function ze(v){Ft(v.item,v.source)&&(M=v.item.cloneNode(!0),oe.emit("cloned",M,v.item,"copy")),w=v.source,B=v.item,T=O=C(v.item),oe.dragging=!0,oe.emit("drag",B,w)}function Qe(){return!1}function Ge(){if(oe.dragging){var v=M||B;Z(v,S(v))}}function _e(){ee=!1,Be(!0),Fe(!0)}function F(v){if(_e(),!!oe.dragging){var $=M||B,P=q("clientX",v)||0,G=q("clientY",v)||0,te=j(y,P,G),ne=lt(te,P,G);ne&&(M&&D.copySortSource||!M||ne!==w)?Z($,ne):D.removeOnSpill?ae():be()}}function Z(v,$){var P=S(v);M&&D.copySortSource&&$===w&&P.removeChild(B),Ze($)?oe.emit("cancel",v,w):oe.emit("drop",v,$,w,O),je()}function ae(){if(oe.dragging){var v=M||B,$=S(v);$&&$.removeChild(v),oe.emit(M?"cancel":"remove",v,$,w),je()}}function be(v){if(oe.dragging){var $=arguments.length>0?v:D.revertOnSpill,P=M||B,G=S(P),te=Ze(G);te===!1&&$&&(M?G&&G.removeChild(M):w.insertBefore(P,T)),te||$?oe.emit("cancel",P,w,w):oe.emit("drop",P,G,w,O),je()}}function je(){var v=M||B;_e(),Mt(),St(),v&&c.rm(v,"gu-transit"),V&&clearTimeout(V),oe.dragging=!1,X&&oe.emit("out",v,X,w),oe.emit("dragend",v,re),w=B=M=T=O=V=X=null}function Ze(v,$){var P;return $!==void 0?P=$:y?P=O:P=C(M||B),v===w&&P===T}function lt(v,$,P){for(var G=v;G&&!te();)G=S(G);return G;function te(){var ne=ue(G);if(ne===!1)return!1;var xe=ct(G,v),ye=dt(G,xe,$,P),Ce=Ze(G,ye);return Ce?!0:D.accepts(B,G,w,ye)}}function Ke(v){if(!y)return;v.preventDefault();var $=q("clientX",v)||0,P=q("clientY",v)||0;y.style.left=$-2+"px",y.style.top=P-2+"px";var G=M||B,te=j(y,$,P),ne=lt(te,$,P),xe=ne!==null&&ne!==X;(xe||ne===null)&&(ge(),X=ne,Se()),Bt(te,P);var ye=S(G);if(ne===w&&M&&!D.copySortSource){ye&&ye.removeChild(G);return}var Ce,Me=ct(ne,te);if(se=jt(Me,ne),Me!==null)Ce=dt(ne,Me,$,P);else if(D.revertOnSpill===!0&&!M)Ce=T,ne=w;else{M&&ye&&ye.removeChild(G),M&&W&&(W.style.display="none");return}W.style.display="block",wt(Ce,G,xe),Ce?Et(Me,Ce):Nt(ne);function de(pe){oe.emit(pe,G,X,w)}function Se(){xe&&de("over")}function ge(){X&&de("out")}}function wt(v,$,P){(v===$||v===C($))&&(O=C($)),(v===null&&P||v!==$&&v!==C($))&&(O=v)}function xt(v){c.rm(v,"gu-hide")}function et(v){oe.dragging&&c.add(v,"gu-hide")}function It(){y||(y=document.createElement("div"),y.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;",y.innerHTML=D.getMirrorText&&D.getMirrorText(B)||"控件",c.add(y,"gu-mirror"),D.mirrorContainer.appendChild(y),h(p,"add","mousemove",Ke),c.add(D.mirrorContainer,"gu-unselectable"),oe.emit("cloned",y,B,"mirror"))}function Tt(){if(W=document.createElement("div"),c.add(W,"gu-insertion"),B){var v=B.getBoundingClientRect();W.style.left=v.left+"px",W.style.top=v.top+"px"}se=!1,D.mirrorContainer.appendChild(W)}function Mt(){y&&(c.rm(D.mirrorContainer,"gu-unselectable"),h(p,"remove","mousemove",Ke),S(y).removeChild(y),y=null)}function St(){W&&(S(W).removeChild(W),W=null)}function ct(v,$){for(var P=$;P!==v&&S(P)!==v;)P=S(P);return P===p?null:P}function jt(v,$){if(!$)return se;var P=v||$&&$.lastElementChild;if(!P)return!0;var G=getComputedStyle(v),te=/^inline/.test(G.getPropertyValue("display"))||/^(left|right)$/.test(G.getPropertyValue("float"));if(te)return!0;if($){var ne=getComputedStyle($),xe=ne.getPropertyValue("display");if(/flex$/.test(xe)){var ye=ne.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!ut($)}return!1}return!0}function ut(v){if(!v.children||!v.children.length)return!1;for(const $ of Array.from(v.children)){const G=($.className&&$.className.split(" ")||[]).filter(te=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(te));if(!G.length)return!1;for(const te of G){const ne=te.slice(te.lastIndexOf("-")+1);if(parseInt(ne,10)!==12)return!1}}return!0}function Et(v,$){const P=$.getBoundingClientRect();if(W.style.left=P.left+"px",W.style.top=P.top+"px",se){if(W.style.height=P.height+"px",W.style.width="4px",v){const G=v.getBoundingClientRect();G.top!==P.top&&(W.style.left=G.right+"px",W.style.top=G.top+"px",W.style.height=G.height+"px")}}else if(W.style.height="4px",W.style.width=P.width+"px",Q){const G=Q.getBoundingClientRect();P.top<G.top&&(W.style.display="none")}$===B&&B&&(W.style.display="none")}function Nt(v){O=null;var $=v.lastElementChild;if($){var P=$.getBoundingClientRect();se?(W.style.left=P.right+"px",W.style.top=P.top+"px",W.style.height=P.height+"px",W.style.width="4px"):(W.style.left=P.left+"px",W.style.top=P.bottom+"px",W.style.height="4px",W.style.width=P.width+"px"),$===B&&B&&(W.style.display="none")}else W.style.display="none"}function Bt(v,$){if(!D.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(Q=m(v),!Q||!Q.contains(v)))return;const P=document.querySelector(".dgComponentSelected"),G=Q.getBoundingClientRect();if($-30<G.top&&Q.scrollTop>0){let te=Q.scrollTop<10?Q.scrollTop:10;Q.scrollBy(0,-1*te),P&&Q.contains(P)&&(re=re+-1*te)}if($+30>G.bottom&&Q.scrollTop<Q.scrollHeight-Q.clientHeight){const te=Q.scrollHeight-Q.clientHeight-Q.scrollTop;let ne=te<10?te:10;Q.scrollBy(0,ne),P&&Q.contains(P)&&(re=re+ne)}}function dt(v,$,P,G){var te=D.direction==="horizontal",ne=D.direction==="mixed",xe=$!==v?Ce():ye();return xe;function ye(){var de=v.children.length,Se,ge,pe;for(Se=0;Se<de;Se++)if(ge=v.children[Se],pe=ge.getBoundingClientRect(),te&&pe.left+pe.width/2>P||!ne&&!te&&pe.top+pe.height/2>G||ne&&pe.left+pe.width>P&&pe.top+pe.height>G)return ge;return null}function Ce(){var de=$.getBoundingClientRect();if(ne){var Se=G-de.top,ge=P-de.left,pe=de.bottom-G,U=de.right-P,J=Math.min(ge,U,Se,pe),he;return se?he=U<ge:he=pe===J||U===J||ge===J,Me(he)}return Me(te?P>de.left+L(de)/2:G>de.top+R(de)/2)}function Me(de){return de?C($):$}}function Ft(v,$){return typeof D.copy=="boolean"?D.copy:D.copy(v,$)}}function m(g){const z=Array.from(window.scrollContainerList);if(z.length===1){const y=Array.from(window.scrollContainerList)[0];return document.getElementById(y)}const Y=f(z);for(const y of Y)if(y.contains(g))return y;return null}function f(g){const z=[];return g.forEach(Y=>{const y=document.getElementById(Y);y&&z.push(y)}),z.sort((Y,y)=>Y.contains(y)?1:y.contains(Y)?-1:0),z}function h(g,z,Y,y){var w={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},_={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?u[z](g,B[Y],y):s.navigator.msPointerEnabled?u[z](g,_[Y],y):(u[z](g,w[Y],y),u[z](g,Y,y))}function b(g){if(g.touches!==void 0)return g.touches.length;if(g.which!==void 0&&g.which!==0)return g.which;if(g.buttons!==void 0)return g.buttons;var z=g.button;if(z!==void 0)return z&1?1:z&2?3:z&4?2:0}function j(g,z,Y){g=g||{};var y=g.className||"",w;return g.className+=" gu-hide",w=l.elementFromPoint(z,Y),g.className=y,w}function I(){return!1}function k(){return!0}function L(g){return g.width||g.right-g.left}function R(g){return g.height||g.bottom-g.top}function S(g){return g.parentNode===l?null:g.parentNode}function E(g){return g.tagName==="INPUT"||g.tagName==="TEXTAREA"||g.tagName==="SELECT"||N(g)}function N(g){return!g||g.contentEditable==="false"?!1:g.contentEditable==="true"?!0:N(S(g))}function C(g){return g.nextElementSibling||z();function z(){var Y=g;do Y=Y.nextSibling;while(Y&&Y.nodeType!==1);return Y}}function A(g){return g.targetTouches&&g.targetTouches.length?g.targetTouches[0]:g.changedTouches&&g.changedTouches.length?g.changedTouches[0]:g}function q(g,z){var Y=A(z),y={pageX:"clientX",pageY:"clientY"};return g in y&&!(g in Y)&&y[g]in Y&&(g=y[g]),Y[g]}o.exports=d}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(a,u){return Array.prototype.slice.call(a,u)}},{}],4:[function(t,o,r){var s=t("ticky");o.exports=function(u,c,l){u&&s(function(){u.apply(l||null,c||[])})}},{ticky:10}],5:[function(t,o,r){var s=t("atoa"),a=t("./debounce");o.exports=function(c,l){var p=l||{},d={};return c===void 0&&(c={}),c.on=function(m,f){return d[m]?d[m].push(f):d[m]=[f],c},c.once=function(m,f){return f._once=!0,c.on(m,f),c},c.off=function(m,f){var h=arguments.length;if(h===1)delete d[m];else if(h===0)d={};else{var b=d[m];if(!b)return c;b.splice(b.indexOf(f),1)}return c},c.emit=function(){var m=s(arguments);return c.emitterSnapshot(m.shift()).apply(this,m)},c.emitterSnapshot=function(m){var f=(d[m]||[]).slice(0);return function(){var h=s(arguments),b=this||c;if(m==="error"&&p.throws!==!1&&!f.length)throw h.length===1?h[0]:h;return f.forEach(function(I){p.async?a(I,h,b):I.apply(b,h),I._once&&c.off(m,I)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(s){var a=t("custom-event"),u=t("./eventmap"),c=s.document,l=m,p=h,d=[];s.addEventListener||(l=f,p=b),o.exports={add:l,remove:p,fabricate:j};function m(S,E,N,C){return S.addEventListener(E,N,C)}function f(S,E,N){return S.attachEvent("on"+E,k(S,E,N))}function h(S,E,N,C){return S.removeEventListener(E,N,C)}function b(S,E,N){var C=L(S,E,N);if(C)return S.detachEvent("on"+E,C)}function j(S,E,N){var C=u.indexOf(E)===-1?q():A();S.dispatchEvent?S.dispatchEvent(C):S.fireEvent("on"+E,C);function A(){var g;return c.createEvent?(g=c.createEvent("Event"),g.initEvent(E,!0,!0)):c.createEventObject&&(g=c.createEventObject()),g}function q(){return new a(E,{detail:N})}}function I(S,E,N){return function(A){var q=A||s.event;q.target=q.target||q.srcElement,q.preventDefault=q.preventDefault||function(){q.returnValue=!1},q.stopPropagation=q.stopPropagation||function(){q.cancelBubble=!0},q.which=q.which||q.keyCode,N.call(S,q)}}function k(S,E,N){var C=L(S,E,N)||I(S,E,N);return d.push({wrapper:C,element:S,type:E,fn:N}),C}function L(S,E,N){var C=R(S,E,N);if(C){var A=d[C].wrapper;return d.splice(C,1),A}}function R(S,E,N){var C,A;for(C=0;C<d.length;C++)if(A=d[C],A.element===S&&A.type===E&&A.fn===N)return C}}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(s){var a=[],u="",c=/^on/;for(u in s)c.test(u)&&a.push(u.slice(2));o.exports=a}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(s){var a=s.CustomEvent;function u(){try{var c=new a("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=u()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(l,p){var d=document.createEvent("CustomEvent");return p?d.initCustomEvent(l,p.bubbles,p.cancelable,p.detail):d.initCustomEvent(l,!1,!1,void 0),d}:function(l,p){var d=document.createEventObject();return d.type=l,p?(d.bubbles=!!p.bubbles,d.cancelable=!!p.cancelable,d.detail=p.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var s=o.exports={},a,u;function c(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=c}catch{a=c}try{typeof clearTimeout=="function"?u=clearTimeout:u=l}catch{u=l}})();function p(R){if(a===setTimeout)return setTimeout(R,0);if((a===c||!a)&&setTimeout)return a=setTimeout,setTimeout(R,0);try{return a(R,0)}catch{try{return a.call(null,R,0)}catch{return a.call(this,R,0)}}}function d(R){if(u===clearTimeout)return clearTimeout(R);if((u===l||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(R);try{return u(R)}catch{try{return u.call(null,R)}catch{return u.call(this,R)}}}var m=[],f=!1,h,b=-1;function j(){!f||!h||(f=!1,h.length?m=h.concat(m):b=-1,m.length&&I())}function I(){if(!f){var R=p(j);f=!0;for(var S=m.length;S;){for(h=m,m=[];++b<S;)h&&h[b].run();b=-1,S=m.length}h=null,f=!1,d(R)}}s.nextTick=function(R){var S=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)S[E-1]=arguments[E];m.push(new k(R,S)),m.length===1&&!f&&p(I)};function k(R,S){this.fun=R,this.array=S}k.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function L(){}s.on=L,s.addListener=L,s.once=L,s.off=L,s.removeListener=L,s.removeAllListeners=L,s.emit=L,s.prependListener=L,s.prependOnceListener=L,s.listeners=function(R){return[]},s.binding=function(R){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(R){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(t,o,r){(function(s){var a=typeof s=="function",u;a?u=function(c){s(c)}:u=function(c){setTimeout(c,0)},o.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(s,a){var u=t("process/browser.js").nextTick,c=Function.prototype.apply,l=Array.prototype.slice,p={},d=0;r.setTimeout=function(){return new m(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new m(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function m(f,h){this._id=f,this._clearFn=h}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(f,h){clearTimeout(f._idleTimeoutId),f._idleTimeout=h},r.unenroll=function(f){clearTimeout(f._idleTimeoutId),f._idleTimeout=-1},r._unrefActive=r.active=function(f){clearTimeout(f._idleTimeoutId);var h=f._idleTimeout;h>=0&&(f._idleTimeoutId=setTimeout(function(){f._onTimeout&&f._onTimeout()},h))},r.setImmediate=typeof s=="function"?s:function(f){var h=d++,b=arguments.length<2?!1:l.call(arguments,1);return p[h]=!0,u(function(){p[h]&&(b?f.apply(null,b):f.call(null),r.clearImmediate(h))}),h},r.clearImmediate=typeof a=="function"?a:function(f){delete p[f]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(mn);const hn={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}},yn={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},gt=n.defineComponent({name:"Toast",props:yn,emits:["close","click"],setup:(i,e)=>{const t=n.ref(i.animate),o="fadeOut",r=n.computed(()=>i.options),s=n.ref(!1),a=n.computed(()=>{const I={animated:s.value,toast:!0};return I[i.animate]=!1,I[o]=s.value,I[r.value.type]=!0,r.value.theme&&(I[r.value.theme]=!0),I}),u=n.computed(()=>{const L=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,R={"f-icon":!0};return R[L]=!0,R}),c=n.computed(()=>r.value.title||r.value.message),l=n.computed(()=>r.value.title&&r.value.message),p=n.computed(()=>!r.value.title&&r.value.message),d=n.computed(()=>i.showCloseButton),m=n.computed(()=>!!r.value.buttons||!!e.slots.default);function f(I){I.stopPropagation(),I.preventDefault(),s.value=!1,setTimeout(()=>{e.emit("close",r.value)},200)}function h(I,k){}function b(I){return`f-preten-link ${I.customClass?I.customClass:""}`}n.watch(t,()=>{t.value});const j=()=>{var I;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((I=r.value.buttons)==null?void 0:I.map(k=>n.createVNode("span",{class:b(k),onClick:L=>void 0},[k.text]))),e.slots.default&&e.slots.default()])])};return()=>n.createVNode("div",{class:a.value,style:"min-height:44px"},[d.value&&n.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:f},[n.createVNode("span",{class:"f-icon modal_close"},null)]),c.value&&n.createVNode("section",{class:"modal-tips"},[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:u.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[l.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),m.value&&j()]),p.value&&(r.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[j()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),st=n.defineComponent({name:"Notify",props:hn,emits:["close","empty"],setup(i,e){const t=n.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=n.ref(),s=n.ref(i.options),a=n.ref(i.showCloseButton),u=n.computed(()=>i.position||"bottom-right"),c=n.computed(()=>i.timeout!=null?i.timeout:3e3),l=n.computed(()=>{const m=i.bottom?i.bottom:o.bottom,f=i.top?i.top:o.top,h={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${i.left?i.left:o.left}px`:"",right:u.value.indexOf("right")>-1?`${i.right?i.right:o.right}px`:"",top:u.value.indexOf("top")>-1?`${f}px`:"",bottom:u.value.indexOf("bottom")>-1?`${m}px`:""};return u.value.indexOf("center")>-1&&(h.left="50%",h.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(h.top="50%",h.transform="translate(-50%, -50%)")),h});function p(m){e.emit("close")}c.value&&setTimeout(()=>{p()},c.value),e.expose({closeToast:p,container:r,notifyPosition:u});function d(m,f){p()}return()=>n.createVNode("div",{class:t.value,style:l.value,ref:r},[n.createVNode(gt,{options:s.value,showCloseButton:a.value,animate:i.animate,onClose:m=>d(m,s.value)},null)])}});class gn{constructor(){H(this,"notifyRefs",[]);H(this,"globalConfig",n.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),s=document.createElement("div");s.style.display="contents";const a=n.createApp({setup(){var l;const u=n.ref();function c(){u.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,u),a.unmount()},220)}if(r.position.indexOf("top")>-1){const p=t.getNotifyInstances(r.position),d=p[p.length-1];if(d){const m=d.value.container.getBoundingClientRect();r.top=m.bottom}}return r.safeHtml&&((l=r.options)!=null&&l.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),n.onUnmounted(()=>{document.body.removeChild(s)}),n.onMounted(()=>{t.updateNotifyPositionForCreate(r,u)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(st,n.mergeProps({ref:u},r,{onClose:c}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.mount(s),a}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),s=r.indexOf(t);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",s,a,u;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",a=t.position||null,u=t.showCloseButton!=null?t.showCloseButton:null,s=t.timeout!=null?t.timeout:null);const l={options:{type:e,message:o,title:r}};return a!=null&&(l.position=a),u!=null&&(l.showCloseButton=u),s!=null&&(l.timeout=s),l}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const vn=Symbol("NOTIFY_SERVICE_TOKEN");st.install=i=>{i.component(st.name,st),i.component(gt.name,gt);const e=new gn;i.provide(vn,e),i.provide("FNotifyService",e)};const qt=new Map([["appearance",ve.resolveAppearance],["column","columnOption"]]);function bn(i,e,t){var d;const o=t.parentComponentInstance,r=o.schema.type,s=String(((d=o.schema.appearance)==null?void 0:d.class)||"").split(" "),a=r==="section"||r==="tab-page",u=s.includes("f-page-content-nav"),c=s.includes("f-page-main"),l=i.getSchemaByType("component");l.id=`${e.id}-component`,l.componentType="data-grid";let p="";return p+=a?"f-struct-data-grid-in-card f-struct-is-subgrid":"",p+=u?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",p+=c?"f-struct-data-grid f-struct-wrapper":"",l.appearance={class:p},l.contents=[e],l}function Cn(i,e,t){const o=t.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),s=r.includes("f-page-content-nav"),a=r.includes("f-page-main"),u=i.getSchemaByType("section");u.id=`${e.id}-section`;let c="";return c+=s?"f-section-in-nav ":"",c+=a?"f-section-in-managelist ":"",c+="f-section-grid",u.appearance={class:c},u.contents=[e],u}function wn(i,e,t){const o=i.getSchemaByType("content-container");return o.id=`${e.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[e],o}function At(i,e,t){const r=t.parentComponentInstance.schema.type,s=r==="section"||r==="tab-page";e.appearance={class:"f-component-grid"};const u=(s?wn:Cn)(i,e,t);return bn(i,u,t)}const Ut={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",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:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},vt={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},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:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},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}};ve.createPropsResolver(vt,Ut,qt,At),ve.createTreeGridSelectionItemResolver(),ve.createTreeGridBindingResolver();const xn=Object.assign({},vt,{componentId:{type:String,default:""}});ve.createPropsResolver(xn,Ut,qt,At),ve.createDataViewUpdateColumnsResolver();function In(i,e,t,o,r,s,a,u,c,l,p,d,m,f,h,b,j){const{calculateCellPositionInRow:I}=s,{columnContext:k,hasLeftFixedColumn:L,hasRightFixedColumn:R}=a,{gridDataStyle:S,leftFixedGridDataStyle:E,rightFixedGridDataStyle:N}=f,{renderDataRow:C}=K.getHierarchyRow(i,e,k,j,u,c,l,p,d,m,f,h,b),A=[C];function q(w,B){const _=I(w);return j.value.filter(x=>x.visible!==!1).map((x,T)=>A[x.type](x,_,B,T))}function g(){return n.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:E.value},[q(k.value.leftColumns.filter(w=>w.visible),"left")])])}function z(){return n.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:S.value},[q(k.value.primaryColumns.filter(w=>w.visible),"primary")])])}function Y(){return n.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:N.value},[q(k.value.rightColumns.filter(w=>w.visible),"right")])])}function y(){const w=[];return L.value&&w.push(g()),w.push(z()),R.value&&w.push(Y()),w}return{renderDataArea:y}}const Tn=n.defineComponent({name:"FTreeGrid",props:vt,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(i,e){var ge,pe;const o=((ge=i.rowOption)==null?void 0:ge.height)||28,r=n.ref(20),s=n.ref(i.columns),a=K.useIdentify(i),{idField:u}=a,c=n.ref(),l=n.ref(),p=n.ref(),d=n.ref(),m=n.ref(),f=n.ref([]),h=n.ref(!1),b=n.ref(((pe=i.rowOption)==null?void 0:pe.wrapContent)||!1),j=K.useGroupData(i,a),I=K.useFilter(),k=K.useHierarchy(i),{collapseField:L}=k,{showLoading:R,renderLoading:S}=K.useLoading(i,c),E=K.useDataView(i,new Map,I,k,a),{dataView:N}=E,C=K.useSelection(i,E,a,f,e),A=K.useSelectHierarchyItem(i,f,E,a,C,e),q=n.computed(()=>i.disabled),g=n.computed(()=>i.virtualized?Math.min(E.dataView.value.length,r.value):E.dataView.value.length),{containerStyleObject:z}=K.useDataViewContainerStyle(i),Y=K.useCommandColumn(i),{applyCommands:y}=Y;y(s);const w=K.useColumn(i),B=K.useSort(i),{applyColumnSorter:_,columnContext:x,updateColumnRenderContext:T}=w;_(E,B);const O=K.useGroupColumn(i,x),M=K.useRow(i,e,C,a),V=K.useEdit(i,e,a,M,f),X=K.useVisualDataBound(i),ee=K.useVisualDataCell(i,V,X),W=K.useVisualDataRow(i,E,V,k,a,X,ee),se=K.useVisualData(i,s,E,g,0,W),{getVisualData:re}=se,Q=K.useCellPosition(i,x),D=K.useSidebar(i,C),{sidebarWidth:oe}=D,ue=K.useVirtualScroll(i,E,f,x,se,g,0,oe),{onWheel:Ae,dataGridWidth:Be,viewPortHeight:Fe,viewPortWidth:Ve,resetScroll:ke,updateVisibleRowsOnLatestVisibleScope:De}=ue,$e=K.useFitColumn(i,x,l,Ve,O),{calculateColumnsSize:Te}=$e,Ue=K.useFilterHistory(),Je=K.useColumnFilter(l,m,E,Ue,ue),ze=K.useDragColumn(i,e,w,E,O,j,ue),Qe=n.computed(()=>({"fv-grid":!0,"fv-grid-bordered":i.showBorder,"fv-grid-horizontal-bordered":i.showHorizontalLines,"fv-datagrid-strip":i.showStripe})),Ge=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":h.value,"fv-grid-wrap-content":b.value})),{renderDataArea:_e}=In(i,e,p,d,m,Q,w,E,V,k,M,C,A,ue,se,X,f),{renderGridHeader:F,renderGridColumnResizeOverlay:Z,shouldShowHeader:ae}=K.getColumnHeader(i,e,l,d,m,w,E,ze,Je,I,Ue,$e,O,C,D,B,ue,Ve,f),{renderDataGridSidebar:be}=K.getSidebar(i,M,C,D,ue),{renderDisableMask:je}=K.getDisableMask(),{renderHorizontalScrollbar:Ze}=K.getHorizontalScrollbar(i,l,ue),{renderVerticalScrollbar:lt}=K.getVerticalScrollbar(i,l,ue);function Ke(){var U,J,he;if(l.value&&l.value.clientHeight>0&&((U=l.value)==null?void 0:U.clientWidth)>0){const we=Math.ceil(l.value.clientHeight/o);we>r.value&&(r.value=we,De()),Fe.value=((J=p.value)==null?void 0:J.clientHeight)||0,Be.value=((he=l.value)==null?void 0:he.clientWidth)||0,Te()}}n.onMounted(()=>{l.value&&(r.value=Math.max(Math.ceil(l.value.clientHeight/o),r.value),f.value=re(0,g.value+0-1),Qt.useResizeObserver(l.value,Ke),Te(),n.nextTick(()=>{l.value&&(Be.value=l.value.clientWidth),p.value&&(Ve.value=p.value.clientWidth,Fe.value=p.value.clientHeight)})),R.value&&S()}),n.onUnmounted(()=>{}),n.watch(Ve,()=>{l.value&&Te()});function wt(U){E.collapseTo(U),E.reOrderVisibleIndex(),ke()}function xt(U){E.expandTo(U),E.reOrderVisibleIndex(),ke()}function et(){const U=C.getSelectionRow();return U?U.dataIndex-1:-1}function It(){const U=et();E.insertNewDataItem(U),f.value=re(0,g.value+0-1)}function Tt(){const U=et();E.insertNewChildDataItem(U),f.value=re(0,g.value+0-1)}function Mt(){const U=et(),J=A.getNextSelectableHierarchyItemId(U);E.removeHierarchyDataItem(U),f.value=re(0,g.value+0-1),J&&C.selectItemById(J)}function St(U){V.onEditingRow(U)}function ct(U){V.acceptEditingRow(U)}function jt(U){V.cancelEditingRow(U)}function ut(U){U&&(s.value=U,y(s),T(s.value),_(E,B),Te())}n.watch(()=>i.columns,U=>{ut(U)});function Et(U,J){U&&(E.load(U),E.reOrderVisibleIndex(),J!=null&&J.keepScrollPosition?ue.scrollTo(ue.offsetY.value):ke())}function Nt(U){C.selectItemById(U)}function Bt(U){const J=f.value.find(he=>he.raw[a.idField.value]===U);J&&M.clickRowItem(J)}function dt(U){M.activeRowById(U)}function Ft(U){C.selectItemByIds(U)}function v(){return C.getSelectedItems()}function $(){C.clearSelection()}const P=n.computed(()=>!f.value||!f.value.length),{renderEmpty:G}=K.getEmpty(e);function te(){return C.getSelectionRow()}function ne(U){C.unSelectItemByIds(U)}function xe(){return C.currentSelectedDataId.value}function ye(U,J,he){const we=N.value.find(Ie=>Ie[u.value]===U);if(we){if(Object.keys(we).forEach(fe=>{Object.prototype.hasOwnProperty.call(J,fe)&&(we[fe]=J[fe])}),he){const{collapseField:fe,disabledField:Pe,checkedField:Re,visibleField:qe}=he;fe&&!le.isUndefined(J[fe])&&(we.__fv_collapse__=J[fe]),Re&&!le.isUndefined(J[Re])&&(we.__fv_checked__=J[Re]),Pe&&!le.isUndefined(J[Pe])&&(we.__fv_disabled__=J[Pe]),qe&&!le.isUndefined(J[qe])&&(we.__fv_visible__=J[qe])}const Ie=f.value.find(fe=>fe.raw[u.value]===U),Jt=f.value.findIndex(fe=>fe.raw[u.value]===U);if(Ie){if(Ie.raw=we,Object.keys(Ie.data).forEach(fe=>{Ie.data[fe].updateData(we)}),he){const{collapseField:fe,disabledField:Pe,checkedField:Re,visibleField:qe}=he;fe&&!le.isUndefined(J[fe])&&(Ie.collapse=J[fe]),Re&&!le.isUndefined(J[Re])&&(Ie.checked=J[Re]),Pe&&!le.isUndefined(J[Pe])&&(Ie.disabled=J[Pe]),qe&&!le.isUndefined(J[qe])&&(Ie.visible=J[qe])}f.value=[...f.value.slice(0,Jt),Ie,...f.value.slice(Jt+1)]}}}function Ce(U){const J=E.dataView.value.find(he=>he[u.value]===U);return J?J[L.value]:""}function Me(){return L.value}e.expose({activeRowById:dt,addNewDataItem:It,addNewChildDataItem:Tt,collapseTo:wt,expandTo:xt,removeDataItem:Mt,editDataItem:St,acceptDataItem:ct,cancelDataItem:jt,updateColumns:ut,updateDataSource:Et,selectItemById:Nt,selectItemByIds:Ft,getSelectedItems:v,clearSelection:$,getSelectionRow:te,clickRowItemById:Bt,unSelectItemByIds:ne,getCurrentRowId:xe,reassignRowData:ye,getCollapseField:Me,getCollapseStatusById:Ce});const de=n.computed(()=>{const U={};return ue.shouldShowHorizontalScrollbar.value&&(U.paddingBottom="10px"),ue.shouldShowVirticalScrollbar.value&&(U.paddingRight="10px"),U}),Se=n.computed(()=>({...z.value,borderRadius:"5px"}));return()=>n.createVNode("div",{ref:c,class:Qe.value,style:Se.value,onWheel:Ae},[l.value&&ae.value&&F(),n.createVNode("div",{ref:l,class:Ge.value,onMouseover:()=>h.value=!0,onMouseleave:()=>h.value=!1,style:de.value},[l.value&&be(f),l.value&&_e(),l.value&&P.value&&G(),l.value&&Ze(),l.value&&lt()]),Z(),q.value&&je()])}});We.withInstall(Tn);const Mn=new Map([["appearance",ft]]);function Sn(i,e,t){return e}Xe({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"]},Mn,Sn,{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 bt=new Map([["appearance",ft]]),jn=new Map([]),En="root-viewmodel";class Nn{constructor(e,t){H(this,"formSchemaUtils");H(this,"controlCreatorUtils");H(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:s}=e;s==null||s.forEach(u=>{const c=le.cloneDeep(u),l=this.resolveControlClassByFormColumns(e),p=this.controlCreatorUtils.setFormFieldProperty(c,"",l);p&&r.push(p)});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:En,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{let s="blur";const a=r.type.name;(a===We.FormSchemaEntityFieldTypeName.Enum||a===We.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}),t}}function Bn(i,e,t,o){var s,a,u,c,l,p;const r=t.parentComponentInstance;if(r&&o){const d=(s=r.schema)==null?void 0:s.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=t.bindingSourceContext)==null?void 0:a.entityTitle)||((c=(u=t.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:c.name)||"标题",componentType:"form",formColumns:d==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((l=t.bindingSourceContext)==null?void 0:l.bindTo)||"/",selectedFields:(p=t.bindingSourceContext)==null?void 0:p.bindingEntityFields};return new Nn(i,o).createComponent(f)}else return e}function Fn(i,e,t){return e}Xe({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{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}},required:["id","type","contents"]},bt,Bn);const zt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input 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:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Vn={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}};ve.createPropsResolver(Vn,zt,bt,void 0),ve.createFormGroupEditorResolver();function kn(){function i(e,t){var a;if(!e)return!1;const o=((a=e.targetContainer)==null?void 0:a.componentInstance)&&e.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,s=t==null?void 0:t.formSchemaUtils.getComponentById(o.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![me["response-layout-item"].type,me["response-form"].type,me.fieldset.type].includes(r)||(e.componentType===me.tabs.type||e.componentType===me.section.type)&&((s==null?void 0:s.componentType)!=="frame"||![me["content-container"].type,me["splitter-pane"].type,me["response-layout-item"].type].includes(r))||e.componentType===me["query-solution"].type||e.componentType===me.fieldset.type&&r!==me["response-form"].type)}return{basalDragulaRuleForContainer:i}}class $n{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),s={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return s;const a=this.getComponentContext(e),{componentClassList:u}=a;return u.forEach(c=>{if(!c||!r[c])return;const{canMove:l,canDelete:p,canAccept:d}=r[c];s.canMove=s.canMove&&this.resolveRuleValue(l,a),s.canDelete=s.canDelete&&this.resolveRuleValue(p,a),s.canAccept=s.canAccept&&this.resolveRuleValue(d,a)}),s}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let r=!0;for(const s of o){if(s.firstLevelChild){if(s.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(s.firstLevelChild.class)){r=!1;continue}}if(s.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==s.firstLevelChild.type){r=!1;continue}}}if(s.secondLevelChild){if(s.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(s.secondLevelChild.class)){r=!1;continue}}if(s.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==s.secondLevelChild.type){r=!1;continue}}}if(s.parent){if(s.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(s.parent.class)){r=!1;continue}}if(s.parent.type){const{parentSchema:a}=t;if(a&&a.type!==s.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,j,I,k;const t=e.schema,o=t.appearance&&t.appearance.class||"",r=o.split(" ")||[],s=t.contents||[],a=s.length?s[0]:null,u=a&&a.appearance?a.appearance.class:"",c=u?u.split(" "):[],l=(b=a==null?void 0:a.contents)!=null&&b.length?a==null?void 0:a.contents[0]:null,p=l&&l.appearance?l.appearance.class:"",d=p?p.split(" "):[],m=t.type==="component"?(I=(j=e.parent)==null?void 0:j.parent)==null?void 0:I.schema:(k=e.parent)==null?void 0:k.schema,f=m&&m.appearance&&m.appearance.class||"",h=f?f.split(" "):[];return{componentClass:o,componentClassList:r,childContents:s,firstLevelChildSchema:a,firstLevelChildClass:u,firstLevelChildClassList:c,secondLevelChildSchema:l,secondLevelChildClass:p,secondLevelChildClassList:d,parentSchema:m,parentClass:f,parentClassList:h}}}class On{constructor(){H(this,"label","");H(this,"id","");H(this,"columnInSM",12);H(this,"columnInMD",6);H(this,"columnInLG",3);H(this,"columnInEL",2);H(this,"displayWidthInSM",1);H(this,"displayWidthInMD",1);H(this,"displayWidthInLG",1);H(this,"displayWidthInEL",1);H(this,"displayColumnCountAtBreakPoint","md");H(this,"tagRow",0);H(this,"showTopBorder",0);H(this,"group",1);H(this,"isSupportedClass",!0);H(this,"fieldSetId","")}}function Ln(i){let e,t;const o=new Map;let r=[];function s(p,d){const f=p.split(" ").filter(k=>k.startsWith("col-"));if(f.length===0){d.isSupportedClass=!1;return}let h=f.find(k=>/^col-([1-9]|10|11|12)$/.test(k)),b=f.find(k=>/^col-md-([1-9]|10|11|12)$/.test(k)),j=f.find(k=>/^col-xl-([1-9]|10|11|12)$/.test(k)),I=f.find(k=>/^col-el-([1-9]|10|11|12)$/.test(k));h=h||"col-12",d.columnInSM=parseInt(h.replace("col-",""),10),d.displayWidthInSM=d.columnInSM/12,d.displayWidthInSM!==1&&(d.isSupportedClass=!1),b=b||"col-md-"+d.columnInSM,d.columnInMD=parseInt(b.replace("col-md-",""),10),d.displayWidthInMD=d.columnInMD/6,[1,2].includes(d.displayWidthInMD)||(d.isSupportedClass=!1),j=j||"col-xl-"+d.columnInMD,d.columnInLG=parseInt(j.replace("col-xl-",""),10),d.displayWidthInLG=d.columnInLG/3,[1,2,3,4].includes(d.displayWidthInLG)||(d.isSupportedClass=!1),I=I||"col-el-"+d.columnInLG,d.columnInEL=parseInt(I.replace("col-el-",""),10),d.displayWidthInEL=d.columnInEL/2,[1,2,3,4,5,6].includes(d.displayWidthInEL)||(d.isSupportedClass=!1)}function a(p,d,m,f=!1){let h=!1;p.contents.forEach(b=>{if(b.type==="fieldset"){m+=1,a(b,d,m,!0),h=!0;return}h&&(m+=1,h=!1);const j=b.appearance&&b.appearance.class,I=new On;j?s(j,I):I.isSupportedClass=!1,I.label=b.label||b.id,I.id=b.id,I.group=m,f&&(I.fieldSetId=p.id),t===b.id&&(e=m),o.set(b.id,b),d.push(I)})}function u(p){const d=i.getComponentById(p);if(!d||!d.componentType||!d.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const m=i.selectNode(d,f=>f.type===He.DgControl["response-form"].type);return!m||!m.contents||m.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:m}}function c(p,d){d=d||p.id;const{result:m,message:f,formNode:h}=u(d);if(!m)return{result:m,message:f};t=p.id,r=[],o.clear();const b=h.contents[0].type===He.DgControl.fieldset.type?0:1;a(h,r,b);const j=r.find(k=>!k.isSupportedClass);return{defaultState:{defaultGroupNumber:e||1,model:j?"customize":"standard"},importData:r}}function l(p,d){d=d;const{result:m,formNode:f}=u(d);if(!m)return"";const h=[];return p.forEach(b=>{var k;const j=o.get(b.id),I=j.appearance&&j.appearance.class;if(I){const R=I.split(" ").filter(q=>!q.startsWith("col-")),S="col-"+b.columnInSM,E="col-md-"+b.columnInMD,N="col-xl-"+b.columnInLG,C="col-el-"+b.columnInEL,A=[S,E,N,C].concat(R);j.appearance.class=A.join(" ")}if(b.fieldSetId){const L=f.contents.find(S=>S.id===b.fieldSetId),R=h.find(S=>S.id===b.fieldSetId);R?(k=R.contents)==null||k.push(j):(h.push(L),L.contents=[j])}else h.push(j)}),f.contents=h,f.id}return{checkCanFindFormNode:u,checkCanOpenLayoutEditor:c,changeFormControlsByResponseLayoutConfig:l,getResonseFormLayoutConfig:a}}function Dn(i,e){function t(c,l=null){if(l)return l;const p=i.getComponentById(e);return i.selectNode(p,d=>d.id===c)}function o(c){const l=i.getComponentById(c);return!(!l||!l.componentType||!l.componentType.startsWith("form"))}function r(c){const l=new Set(c);return Array.from(l).length===1}function s(c){const l=t(c.id),p=Ln(i),d=[];p.getResonseFormLayoutConfig(l,d,1);const m=d.map(R=>R.columnInSM),f=d.map(R=>R.columnInMD),h=d.map(R=>R.columnInLG),b=d.map(R=>R.columnInEL),j=r(m)?m[0]:0,I=r(f)?f[0]:0,k=r(h)?h[0]:0,L=r(b)?b[0]:0;return{uniqueColClassInSM:j,uniqueColClassInMD:I,uniqueColClassInLG:k,uniqueColClassInEL:L}}function a(c,l){let p,d,m,f,h=[];if(c){const R=c.split(" "),S=R.filter(E=>E.startsWith("col-"));p=S.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),d=S.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),m=S.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),f=S.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E)),h=R.filter(E=>!E.startsWith("col-"))}const b=l.uniqueColClassInSM?"col-"+l.uniqueColClassInSM:p,j=l.uniqueColClassInMD?"col-md-"+l.uniqueColClassInMD:d,I=l.uniqueColClassInLG?"col-xl-"+l.uniqueColClassInLG:m,k=l.uniqueColClassInEL?"col-el-"+l.uniqueColClassInEL:f;return[b,j,I,k].concat(h).join(" ")}function u(c,l,p){c=t(p,c),c.contents.forEach(d=>{if(d.type===He.DgControl.fieldset.type){u(d,l,d.id);return}d.appearance||(d.appearance={});const m=d.appearance.class;d.appearance.class=a(m,l)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:s,changeFormControlsByUnifiedLayoutConfig:u}}class Pn extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e,t){const o=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(e);const{checkIsInFormComponent:r,assembleUnifiedLayoutContext:s,changeFormControlsByUnifiedLayoutConfig:a}=Dn(this.formSchemaUtils,this.componentId),u=this.getAppearanceConfig(e),c=r(this.componentId);return u.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",visible:c,type:"boolean"},u.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:c,refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:s(e)}},u.setPropertyRelates=function(l,p){if(l)switch(l&&l.propertyID){case"unifiedLayout":{a(null,l.propertyValue,e.id),o.updateElementByParentContainer(e.id,t);break}case"labelAutoOverflow":{o.setLabelAutoOverflow(e,l.propertyValue);break}}},this.propertyConfig.categories.appearance=u,this.propertyConfig.categories.behavior=this.getBehaviorConfig(e),this.propertyConfig}setLabelAutoOverflow(e,t){const o=this.formSchemaUtils.getComponentById(this.componentId),r=this.formSchemaUtils.selectNode(o,s=>s.id===e.id);r&&r.contents&&r.contents.length&&(r.contents.forEach(s=>{s.appearance||(s.appearance={class:""}),s.appearance.class||(s.appearance.class=""),t?s.appearance.class.includes("farris-group-multi-label")||(s.appearance.class=s.appearance.class+" farris-group-multi-label"):s.appearance.class=s.appearance.class.replace("farris-group-multi-label","").trim()}),Rt())}}function Gt(i,e){const t=i.schema,o=new $n,{canMove:r,canAccept:s,canDelete:a}=o.getTemplateRule(i,e);function u(y,w){const{sourceElement:B}=y,{componentInstance:_}=B,x=e==null?void 0:e.formSchemaUtils;if(!x)return!0;const T=x.getComponentById(_.value.belongedComponentId),O=x.getViewModelById(T.viewModel),M=x.getComponentById(i.componentInstance.value.belongedComponentId),V=x.getViewModelById(M.viewModel);return w?O!=null&&O.id&&(V!=null&&V.id)&&O.id!==V.id?O.bindTo===V.bindTo:!0:(O==null?void 0:O.id)===(V==null?void 0:V.id)}function c(y){const{bindingTargetId:w}=y;if(!e)return;const{formSchemaUtils:B,schemaService:_}=e,x=B.getComponentById(i.componentInstance.value.belongedComponentId),T=_.getFieldByIDAndVMID(w,x.viewModel);return!!(T!=null&&T.schemaField)}function l(y){const w=o.getComponentContext(i);if(w&&w.componentClassList&&w.componentClassList.includes("f-form-layout")&&w.componentClassList.includes("farris-form")){if(y.sourceType==="control"&&(y.componentCategory==="input"||y.componentType==="fieldset"))return!0;if(y.sourceType==="move"){if(y.componentType==="form-group")return u(y,!0);if(y.componentType==="fieldset")return u(y,!1)}return y.sourceType==="field"&&y.componentCategory==="input"?c(y):!1}return!0}function p(y){return!(!kn().basalDragulaRuleForContainer(y,e)||!s||!l(y))}function d(y){var V;const w=y.componentInstance,B=w.value.schema,_=e==null?void 0:e.formSchemaUtils,x=e==null?void 0:e.designViewModelUtils,T=_.getViewModelIdByComponentId(w.value.belongedComponentId),O=x.getDgViewModel(T),M=w.value.parent;if(M&&He.DgControl.fieldset&&((V=M.schema)==null?void 0:V.type)===He.DgControl.fieldset.type&&O){const X={groupId:null,groupName:null};switch(B.binding.type){case Oe.FormBindingType.Form:{O.changeField(B.binding.field,X);break}case Oe.FormBindingType.Variable:{_.modifyViewModelFieldById(T,B.binding.field,X,!0);break}}}}function m(y,w,B){const _=w.fields.find(V=>V.id===y),x=e==null?void 0:e.designViewModelUtils,T=x.getDgViewModel(w.id),O=T.fields.find(V=>V.id===y);T.removeField([y]);const M=x.getDgViewModel(B);M.addField(O),_.fieldSchema&&M.changeField(O.id,_.fieldSchema)}function f(y,w,B,_=[]){const x=w.id,T=y.binding.field,O=w.fields.findIndex(V=>V.id===T);if(O>-1&&(B.fields.push(w.fields[O]),w.fields.splice(O,1)),x==="root-viewmodel"&&B.id!=="root-viewmodel"){y.binding.path&&!y.binding.path.includes("root-component.")&&(y.binding.path="root-component."+y.binding.path);return}if(B.id==="root-viewmodel"&&x!=="root-viewmodel"&&y.binding.path&&y.binding.path.includes("root-component.")){y.binding.path=y.binding.path.replace("root-component.","");return}const M=w.states.find(V=>V.id===T);M&&(B.states=B.states?B.states:[],B.states.findIndex(V=>V.id===M.id)<0&&(B.states.push(M),_.push(M.id)))}function h(y,w,B,_=[]){var O;if(!y)return;const x=w.id==="root-viewmodel"&&B.id!=="root-viewmodel",T=B.id==="root-viewmodel"&&w.id!=="root-viewmodel";Object.keys(y).forEach(M=>{if(M==="binding")return;const V=y[M];if(V&&typeof V=="object"&&V.type===Oe.FormBindingType.Variable&&V.field){if(x){V.path&&!V.path.includes("root-component.")&&(V.path="root-component."+V.path);return}if(T&&V.path&&V.path.includes("root-component.")){V.path=V.path.replace("root-component.","");return}const X=w.states.find(ee=>ee.id===V.field);if(X){_.push(X.id),B.states=B.states?B.states:[];const ee=B.states.find(W=>W.code===X.code);if(ee)V.field=ee.id;else{const W=Object.assign({},{newId:We.useGuid().guid()},X);B.states.push(W),V.field=W.newId}}}}),(O=B.states)!=null&&O.length&&B.states.map(M=>{M.newId&&(M.id=M.newId,delete M.newId)})}function b(y,w,B){if(y&&(w(y,B),y.contents))for(const _ of y.contents)b(_,w,B)}function j(y=[],w){if(!y.length)return;const B=e==null?void 0:e.formSchemaUtils,_=B.getComponentByViewModelId(w),x=[],T=(M,V)=>{M&&(Object.keys(M).forEach(X=>{const ee=M[X];ee&&typeof ee=="object"&&ee.type===Oe.FormBindingType.Variable&&y.includes(ee.field)&&!V.includes(ee.field)&&V.push(ee.field)}),M.editor&&T(M.editor,V))};b(_,T,x);const O=B.getViewModelById(w);y.forEach(M=>{x.includes(M)||(O.states=O.states.filter(V=>V.id!==M))})}function I(y){const w=We.useGuid().guid(),B=Object.assign({},y,{id:w,code:y.code+w.slice(0,4),name:y.name+w.slice(0,4)}),T=(e==null?void 0:e.formSchemaUtils).getCommands().find(O=>O.id===y.cmpId);return T&&T.refedHandlers.push({host:w,handler:y.handlerName}),B}function k(y,w,B){var X,ee,W;const _={},x=y.type==="form-group"&&y.editor?y.editor.type:y.type,T=(X=ve.schemaMap[x])==null?void 0:X.events;if(!T)return;Object.keys(y).forEach(se=>{const re=Object.keys(T).find(Q=>Q===se);if(re&&y[re]){const Q=w.commands.find(D=>D.code===y[re]);if(Q){let D=_[Q.code];D||(D=I(Q),_[Q.code]=D,B.commands.push(D)),y[re]=D.code}}});const M=(e==null?void 0:e.designViewModelUtils).getDgViewModel(B.id),V=["valueChanging","valueChanged"];if(((ee=y.binding)==null?void 0:ee.type)===Oe.FormBindingType.Form){const se=(W=B.fields)==null?void 0:W.find(re=>re.id===y.binding.field);se&&V.forEach(re=>{if(se[re]){const Q=w.commands.find(D=>D.code===se[re]);if(!Q)return;if(_[Q.code])M.changeField(se.id,{[re]:_[Q.code].code});else{const D=I(Q);_[Q.code]=D,B.commands.push(D),M.changeField(se.id,{[re]:D.code})}}})}}function L(y){const w=e==null?void 0:e.formSchemaUtils,B=y.componentInstance,_=B.value.schema,x=w.getViewModelIdByComponentId(B.value.belongedComponentId),T=w.getViewModelById(x),O=w.getComponentById(i.componentInstance.value.belongedComponentId),M=w.getViewModelById(O.viewModel);if(x!==M.id){const V=_.binding.type,X=_.binding.field,ee=[];switch(V){case Oe.FormBindingType.Form:{m(X,T,M.id);break}case Oe.FormBindingType.Variable:{f(_,T,M,ee);break}}h(_,T,M,ee),h(_.editor,T,M,ee),k(_,T,M),x!=="root-viewmodel"&&j(ee,x)}}function R(y){if(!y||!y.componentInstance)return;const B=y.componentInstance.value.schema;!B.binding||!B.binding.field||(d(y),L(y))}function S(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function E(y){let w="";switch(y){case 1:{w="col-12";break}case 2:{w="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{w="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{w="col-12 col-md-6 col-xl-3 col-el-2";break}}return w}function N(y){const w=i.componentInstance.value.getBelongedComponentInstance(i.componentInstance);if(w&&w.schema&&w.schema.componentType){const{formColumns:B}=w.schema;let _=E(B);_=e==null?void 0:e.formSchemaUtils.getControlClassByFormUnifiedLayout(_,w.schema.id,i.schema),y.appearance||(y.appearance={}),y.appearance.class=_}}function C(y,w,B,_){const{bindingSourceContext:x,parentComponentInstance:T}=y;if(x!=null&&x.entityFieldNode&&T){const O=e==null?void 0:e.designViewModelUtils,V=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(T.belongedComponentId),X=O.getDgViewModel(V);X.removeField([x.entityFieldNode.id]),X.addField(x.designViewModelField),w&&X.changeField(x.entityFieldNode.id,{editor:{$type:w},groupId:B,groupName:_})}}function A(y,w){var T,O,M;const B=t;if((B.appearance&&B.appearance.class||"").split(" ").includes("f-form-layout")&&y.componentCategory==="input"){const{label:V}=y;let X;return(T=y.bindingSourceContext)!=null&&T.entityFieldNode?X=(e==null?void 0:e.controlCreatorUtils).setFormFieldProperty((O=y.bindingSourceContext)==null?void 0:O.entityFieldNode,w==null?void 0:w.type):(X=ve.getSchemaByType("form-group"),X.editor=w,X.label=V),N(X),C(y,(M=X.editor)==null?void 0:M.type),X}return w}function q(){return r}function g(){return a}function z(){return!1}function Y(y){return new Pn(y,e).getPropertyConfig(t,i.componentInstance.value)}return{canAccepts:p,checkCanDeleteComponent:g,checkCanMoveComponent:q,getStyles:S,getPropsConfig:Y,hideNestedPaddingInDesginerView:z,onAcceptMovedChildElement:R,onResolveNewComponentSchema:A,moveInputBetweenComponent:L,resolveFormGroupAppearance:N,syncFieldToViewModel:C}}const Rn={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};ve.createPropsResolver(Rn,zt,bt,void 0);const qn={$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"]},An={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};ve.createPropsResolver(An,qn,jn,Fn);const Un={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Ct(){return new DOMException("The request is not allowed","NotAllowedError")}async function zn(i){if(!navigator.clipboard)throw Ct();return navigator.clipboard.writeText(i)}async function Gn(i){const e=document.createElement("span");e.textContent=i,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw Ct()}async function _n(i){try{await zn(i)}catch(e){try{await Gn(i)}catch(t){throw t||e||Ct()}}}function Wn(){async function i(e){await _n(e)}return{onCopy:i}}function Hn(i,e,t,o){const r=n.ref(14),s=n.ref(140),a=n.ref(""),u=n.ref(o.value.length),c=n.computed(()=>o.value),l=n.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function p(d){if(d.currentTarget){const m=d.currentTarget.value||"";u.value=m.length}}return()=>n.createVNode(n.Fragment,null,[n.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:l.value,rows:"4",maxlength:s.value,onInput:d=>p(d)},[c.value]),n.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+s.value])])}function Xn(i,e,t,o){const r=Hn(i,e,t,o),s=new Map([["text-area",r]]);function a(u){return s.get(u)||null}return{getEditorRender:a}}function Yn(){const i=n.ref(!1),e=n.ref("复制成功");return{feedbackStyle:n.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",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"};return o.opacity=i.value?"0.8":"0",o.display=i.value?"":"none",o}),feedbackMessage:e,toShowFeedback:i}}function Jn(i,e){const t=e.getEditorRender(i.promptEditorType);return()=>t&&t()}function Qn(i){function e(m){if(m==null)return 0;let f=0;for(let h=0;h<m.length;h++){const b=m.charCodeAt(h);b>=0&&b<=128?f++:f=f+2}return f}function t(m,f){if(m!==""&&m!==void 0&&m!==null){m=""+m;const h=m.length;let b="",j=0;for(let I=0;I<h;I++){const k=m.charAt(I);if(j++,encodeURI(k).length>4&&j++,b=b.concat(k),j>=f)return b=b.concat("..."),b}if(j<f)return m}return""}const o=n.computed(()=>!!i.value&&!!i.value.date),r=n.computed(()=>`发生时间 : ${i.value&&i.value.date||""}`),s=n.computed(()=>!!i.value&&!!i.value.detail),a=n.computed(()=>i.value?e(i.value.detail)>160:!1),u=n.ref(!1),c=n.computed(()=>u.value?"收起":"展开"),l=n.computed(()=>{const m="详细信息 : "+(i.value&&i.value.detail)||"";return u.value?m:t(m,160)}),p=n.computed(()=>({position:"absolute",right:0,bottom:u.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function d(){u.value=!u.value}return()=>n.createVNode("div",{class:"toast-msg-detail"},[o.value&&n.createVNode("div",null,[r.value]),s.value&&n.createVNode("div",{class:"exception_wrap"},[n.createVNode("div",{class:"exception_error_msg"},[n.createVNode("div",{innerHTML:l.value},null),a.value&&n.createVNode("span",{style:p.value,onClick:d},[c.value])])])])}function Zn(i){return()=>n.createVNode("p",{class:"toast-msg-detail",innerHTML:i.value},null)}function Kn(i,e,t,o){const r=n.ref(i.exceptionInfo),s=n.computed(()=>{const m={"f-icon":!0},f=`f-icon-${e.value}`;return m[f]=!0,m}),a=n.computed(()=>t.value||r.value&&r.value.message),u=n.computed(()=>o.value),c=n.computed(()=>!!o.value),l=n.computed(()=>!!r.value);function p(){return l.value?Qn(r):c.value?Zn(u):()=>null}const d=p();return()=>n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:s.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[n.createVNode("p",{class:"toast-msg-title",innerHTML:a.value},null),d()])])}function eo(i,e,t){const{onCopy:o}=e,{toShowFeedback:r}=t,s=n.ref("复制成功"),a=n.ref("复制详细信息"),u=n.ref(i.exceptionInfo||{date:"",message:"",detail:""}),c=n.computed(()=>u.value&&u.value.detail||"");function l(p){o(c.value).catch(d=>{s.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>n.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[n.createVNode("span",{onClick:l,style:"cursor: pointer;"},[a.value])])}function to(i,e,t,o){const r=n.ref(i.type),s=n.ref(i.buttons),a=n.ref(i.exceptionInfo),u=n.ref(i.okButtonText),c=n.ref(i.cancelButtonText),l=n.ref(!0),p=n.ref(!0),d=n.computed(()=>!!(s.value&&s.value.length)),m=n.computed(()=>a.value&&a.value.date&&a.value.message&&a.value.detail),f=n.computed(()=>!(s.value&&s.value.length)&&(u.value||c.value)),h=n.computed(()=>p.value&&u.value),b=n.computed(()=>l.value&&c.value),j=eo(i,t,o);function I(L){r.value==="question"&&e.emit("reject"),e.emit("close")}function k(L){r.value==="question"&&e.emit("accept"),e.emit("close")}return()=>n.createVNode("div",{class:"modal-footer"},[m.value&&j(),f.value&&b.value&&n.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:I},[c.value]),f.value&&h.value&&n.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:k},[u.value]),d.value&&s.value.length&&s.value.map(L=>n.createVNode("button",{type:"button",onClick:L.handle,class:L.class},[L.iconClass&&n.createVNode("span",{class:L.iconClass},null),L.text]))])}const at=n.defineComponent({name:"FMessageBox",props:Un,emits:["accept","reject","close"],setup(i,e){const t=n.ref(i.type),o=n.ref(i.title),r=n.ref(i.detail),s=n.computed(()=>{const j={"modal-tips":!0,"d-flex":!0,"flex-row":!0},I=`messager-type-${t.value}`;return j[I]=!0,j}),a=n.computed(()=>{const j={};return t.value==="prompt"?j.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(j.padding="0.5rem 1.5rem 1rem 1.5rem"),j}),u=Wn(),c=Xn(i,t,o,r),l=Yn(),{feedbackStyle:p,feedbackMessage:d}=l;function m(){return n.createVNode("div",{style:p.value},[d.value])}function f(){switch(t.value){case"prompt":return Jn(i,c);default:return Kn(i,t,o,r)}}const h=f(),b=to(i,e,u,l);return()=>n.createVNode("div",{class:"farris-messager"},[n.createVNode("section",{class:s.value,style:a.value},[h()]),b(),m()])}}),no={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"}};class ce{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ce(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ce(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ce(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ce(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(s)?0:s}return t}return null}static copy(e){return new ce(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class Le{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new Le(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new Le(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function oo(i,e){const t=n.ref(),o=n.ref(),r=n.ref(),s=n.ref(),a=n.ref(),u=n.ref(),c=n.ref(),l=n.ref(),p=n.ref(),d=n.ref(),m=n.ref(),f=n.ref(i.resizeable),h=n.ref(),b=n.ref(i.draggable),j=n.ref(!1);function I(){const x=o.value||document.body,T=window.getComputedStyle(x);if(!T||!t.value)return;const O=ce.getTransformInfo(t.value),M={};c.value&&(M.deltaL=t.value.offsetLeft-c.value.x,M.deltaT=t.value.offsetTop-c.value.y);const V=T.getPropertyValue("position");M.width=x.clientWidth,M.height=x.clientHeight,M.pr=parseInt(T.getPropertyValue("padding-right"),10),M.pb=parseInt(T.getPropertyValue("padding-bottom"),10),M.position=T.getPropertyValue("position"),V==="static"&&(x.style.position="relative"),M.translateX=O.x,M.translateY=O.y,d.value=M}function k(x){if(t.value){s.value=Le.getCurrent(t.value),a.value=ce.getCurrent(t.value),u.value=s.value?Le.copy(s.value):null,c.value=a.value?ce.copy(a.value):null,I();const T=x.target.getAttribute("type")||"";l.value={n:!!T.match(/n/),s:!!T.match(/s/),w:!!T.match(/w/),e:!!T.match(/e/)}}}function L(){var x,T,O,M;if(t.value){const V=t.value;l.value&&((l.value.n||l.value.s)&&((x=u.value)!=null&&x.height)&&(V.style.height=u.value.height+"px"),(l.value.w||l.value.e)&&((T=u.value)!=null&&T.width)&&(V.style.width=u.value.width+"px"),c.value&&((O=c.value)!=null&&O.x&&(V.style.left=c.value.x+"px"),(M=c.value)!=null&&M.y&&(V.style.top=c.value.y+"px")))}}function R(){const x=i.minHeight?i.minHeight:1,T=i.minWidth?i.minWidth:1;u.value&&c.value&&l.value&&s.value&&(u.value.height<x&&(u.value.height=x,l.value.n&&a.value&&(c.value.y=a.value.y+(s.value.height-x))),u.value.width<T&&(u.value.width=T,l.value.w&&a.value&&(c.value.x=a.value.x+(s.value.width-T))),i.maxHeight&&u.value.height>i.maxHeight&&(u.value.height=i.maxHeight,a.value&&l.value.n&&(c.value.y=a.value.y+(s.value.height-i.maxHeight))),i.maxWidth&&u.value.width>i.maxWidth&&(u.value.width=i.maxWidth,l.value.w&&a.value&&(c.value.x=a.value.x+(s.value.width-i.maxWidth))))}function S(){if(o.value){const x=d.value;if(c.value&&u.value&&l.value&&s.value){const T=x.width-x.pr-x.deltaL-x.translateX-c.value.x,O=x.height-x.pb-x.deltaT-x.translateY-c.value.y;l.value.n&&c.value.y+x.translateY<0&&a.value&&(c.value.y=-x.translateY,u.value.height=s.value.height+a.value.y+x.translateY),l.value.w&&c.value.x+x.translateX<0&&a.value&&(c.value.x=-x.translateX,u.value.width=s.value.width+a.value.x+x.translateX),u.value.width>T&&(u.value.width=T),u.value.height>O&&(u.value.height=O)}}}function E(x){if(!r.value||!s.value||!a.value||!l.value)return;x.subtract(r.value);const T=x.x,O=x.y;l.value.n?(c.value.y=a.value.y+O,u.value.height=s.value.height-O):l.value.s&&(u.value.height=s.value.height+O),l.value.e?u.value.width=s.value.width+T:l.value.w&&(u.value.width=s.value.width-T,c.value.x=a.value.x+T),S(),R(),L()}function N(x){if(!p.value)return;const T=ce.fromEvent(x);T&&E(T)}function C(){if(t.value){const{width:x,height:T,x:O,y:M}=t.value.getBoundingClientRect(),V=ce.getTransformInfo(t.value);return{size:{width:x,height:T},position:{x:O-V.x,y:M-V.y}}}return null}function A(x){if(t.value){const T=C();m.value=T}r.value=void 0,s.value=null,a.value=null,u.value=null,c.value=null,l.value=null,p.value=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",A)}function q(){document.addEventListener("mousemove",N),document.addEventListener("mouseup",A)}function g(x){x instanceof MouseEvent&&x.button===2||b.value&&(document.body.click(),x.stopPropagation(),x.preventDefault(),r.value=ce.fromEvent(x),p.value=x.target,k(x),q())}function z(x){return t.value=x,f.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:T=>g(T)},null)])}function Y(x=!0){document.body.click();const T=o.value||document.body,O=Le.getCurrent(T),M=t.value;x&&M&&(h.value=C(),h.value.transform=M.style.transform),O&&M&&(u.value=O,u.value.height-=14,u.value.width-=14,M.style.height=u.value.height+"px",M.style.width=u.value.width+"px",M.style.left="7px",M.style.top="7px",M.style.transform="",m.value={size:u.value,position:{x:0,y:0}},b.value=!1,j.value=!0)}function y(){var x,T;if(document.body.click(),h.value){const O={width:h.value.size.width||0,height:h.value.size.height||0},M={x:(window.innerWidth-O.width)/2,y:(window.innerHeight-O.height)/2};(x=u.value)==null||x.set(O),(T=c.value)==null||T.set(M);const V=t.value;V.style.height=O.height+"px",V.style.width=O.width+"px",V.style.left=`${M.x}px`,V.style.top=`${M.y}px`,V.style.transform="",m.value={size:O,position:M},b.value=i.draggable,j.value=!1}}function w(){if(t.value){const x=Le.getCurrent(t.value);if(x){const{width:T,height:O}=x;t.value.style.left=`${(window.innerWidth-T)/2}px`,t.value.style.top=`${(window.innerHeight-O)/2}px`,t.value.style.transform=""}}}function B(){const x=()=>{j.value?Y(!1):w(),document.body.click()};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}}const _=B();return{renderResizeBar:z,boundingElement:o,resizedEventParam:m,maximize:Y,restore:y,allowDrag:b,isMaximized:j,unWindowResizeHandle:_}}function io(i,e,t){const o=n.ref(),r=n.ref(i.draggable),s=n.ref(i.lockAxis),a=n.ref(),u=n.ref(),c=n.ref(!1),l=n.ref(new ce(0,0)),p=n.ref(new ce(0,0)),d=n.ref(new ce(0,0)),m=n.ref(new ce(0,0));n.watch(()=>t.value,N=>{a.value.style.cursor=N?"move":"default"});function f(N,C){if(C.tagName==="BUTTON")return!1;if(C===N)return!0;for(const A in C.children)if(Object.prototype.hasOwnProperty.call(C.children,A)&&f(N,C.children[A]))return!0;return!1}function h(){var q,g;let N=d.value.x+p.value.x,C=d.value.y+p.value.y;s.value==="x"?(N=((q=l.value)==null?void 0:q.x)||0,d.value.x=0):s.value==="y"&&(C=((g=l.value)==null?void 0:g.y)||0,d.value.y=0);const A=`translate3d(${Math.round(N)}px, ${Math.round(C)}px, 0px)`;o.value&&(o.value.style.transform=A),m.value.x=N,m.value.y=C}function b(){if(!u.value||!o.value)return null;const N=u.value.getBoundingClientRect(),C=o.value.getBoundingClientRect(),A={top:N.top<C.top,right:N.right>C.right,bottom:N.bottom>C.bottom,left:N.left<C.left};return A.top||(d.value.y-=C.top-N.top),A.bottom||(d.value.y-=C.bottom-N.bottom),A.right||(d.value.x-=C.right-N.right),A.left||(d.value.x-=C.left-N.left),h(),A}function j(N){N&&(l.value&&N.subtract(l.value),d.value.set(N),h(),b())}function I(N){c.value&&r.value&&(N.stopPropagation(),N.preventDefault(),j(ce.fromEvent(N,a.value)))}function k(){var N;c.value&&(c.value=!1,p.value.add(d.value),d.value.reset(),(N=o.value)==null||N.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",k))}function L(){!c.value&&a.value&&(c.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",I),document.addEventListener("mouseup",k))}function R(){if(o.value){const N=ce.getTransformInfo(o.value);p.value.set(N);return}p.value.reset()}function S(N){if(!t.value||N instanceof MouseEvent&&N.button===2)return;const C=N.target||N.srcElement;a.value!==void 0&&C&&!f(C,a.value)||r.value!==!1&&(document.body.click(),N.stopPropagation(),N.preventDefault(),l.value=ce.fromEvent(N,o.value),R(),L())}function E(N,C,A){if(r.value&&C){if(N)a.value=N;else if(i.dragHandle){if(i.dragHandle instanceof HTMLElement)a.value=i.dragHandle;else if(typeof i.dragHandle=="string"){const q=C.querySelector(i.dragHandle);q&&(a.value=q)}}o.value=C,u.value=A,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",S)):r.value=!1}}return{registerDraggle:E,resetTranslate:R}}function _t(i,e){if(i){const t=o=>{o.key.toLowerCase()===i.toLowerCase()&&e({event:o,key:i})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function ro(i,e){const t=n.ref(i.enableEsc);let o=null;return t.value?(o=_t("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function so(i,e){const t=n.ref(i.enableEnter);let o=null;return t.value?(o=_t("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ye=n.defineComponent({name:"FModal",props:no,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(i,e){const t=n.ref(i.width||300),o=n.ref(i.height||200),r=n.ref(i.modelValue),s=n.ref(""),a=n.ref(i.class),u=n.ref(i.fitContent),c=n.ref(i.showHeader),l=n.ref(""),p=n.ref(i.showCloseButton),d=n.ref(i.showMaxButton),m=n.ref(!1),f=n.ref(i.dialogType),h=n.ref(i.src),b=n.ref(""),j=n.ref(i.showButtons),I=n.ref(i.title),k=n.ref(i.containment||null),L=n.ref(),R=n.ref(!1);function S(F,Z){Promise.resolve().then(()=>{var ae;return(ae=i.beforeClose)==null?void 0:ae.call(i)}).then(ae=>{ae&&(r.value=!1,e.emit("update:modelValue",!1),Z!=null&&e.emit(Z?"accept":"cancel"),e.emit("closed",F))})}const E=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:F=>{S(F,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:F=>{S(F,!0)}}],N=n.ref(i.buttons&&i.buttons.length?i.buttons:E),C=n.computed(()=>!!l.value),A=n.computed(()=>!!j.value&&!!N.value),q=n.ref(),g=n.ref(),z=n.ref(!1),{renderResizeBar:Y,maximize:y,restore:w,boundingElement:B,resizedEventParam:_,allowDrag:x,unWindowResizeHandle:T}=oo(i),{registerDraggle:O}=io(i,e,x);function M(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function V(){const F=document.querySelectorAll(".farris-modal").length;(!F||F-1<=0)&&document.body.classList.remove("modal-open"),L.value&&L.value.classList.remove("show")}n.watch(()=>i.title,(F,Z)=>{F!==Z&&(I.value=F)}),n.watch(()=>i.modelValue,(F,Z)=>{F!==Z&&(r.value=F,r.value&&i.draggable&&n.nextTick(()=>{g.value&&!k.value&&(k.value=g.value.parentElement,B.value=k.value,O(q.value,g.value,B.value))}),F||(k.value&&(k.value=null),V())),r.value&&(R.value=M())}),n.watch(()=>i.showHeader,(F,Z)=>{F!==Z&&(c.value=F)}),n.watch(()=>i.showButtons,(F,Z)=>{F!==Z&&(j.value=F)}),n.watch(()=>_.value,(F,Z)=>{const ae=F||{},be=Z||{};JSON.stringify(ae)!==JSON.stringify(be)&&e.emit("resize",{newSize:F,oldSize:Z,isMaximized:z.value})});const X=n.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ee=n.computed(()=>{var ae;const F={modal:!0,"farris-modal":!0,fade:!0};F["f-modal-fitContent"]=!!u.value,F.show=!!X.value;const Z=(ae=i.maskClass)==null?void 0:ae.split(" ");return Z==null||Z.reduce((be,je)=>(be[je]=!0,be),F),F}),W=n.computed(()=>{var ae;const F={"modal-dialog":!0},Z=(ae=a.value)==null?void 0:ae.split(" ");return Z==null||Z.reduce((be,je)=>(be[je]=!0,be),F),F}),se=n.computed(()=>{const F={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${o.value}px`};return i.mask||(F.pointerEvents="auto"),F}),re=n.computed(()=>{const F={display:"block"};return i.mask||(F.pointerEvents="none",F.backgroundColor="transparent"),R.value&&(F.backgroundColor="transparent"),F}),Q=n.computed(()=>({"modal-content":!0,"modal-content-has-header":c.value})),D=n.computed(()=>{const F={display:c.value?"":"none"};return F["pointer-events"]=x.value?"auto":"none",F}),oe=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:z.value})),ue=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function Ae(){return{height:`${i.footerHeight||60}px`}}const Be=n.computed(()=>{const F={textAlgin:b.value},Z=Ae();return Object.assign(F,Z)});function Fe(F){if(F.stopPropagation(),z.value){z.value=!1,w();return}y(),z.value=!0}async function Ve(F,Z){F.handle&&await F.handle(Z,F)&&e.emit("closed",Z)}function ke(F){F.width&&(t.value=F.width),F.height&&(o.value=F.height),F.buttons&&(N.value=F.buttons),F.title&&(I.value=F.title)}let De=null,$e=null;n.onBeforeMount(()=>{R.value=M()}),n.onMounted(()=>{g.value&&!k.value&&(k.value=g.value.parentElement,B.value=k.value,O(q.value,g.value,B.value)),X.value&&document.body.classList.add("modal-open"),De=ro(i,e),$e=so(i,e)}),n.onUnmounted(()=>{T&&T(),De&&De.remove(),$e&&$e.remove()}),e.expose({modalElementRef:g,updateModalOptions:ke,close:S,maxDialog:Fe,isMaximized:z});function Te(){return n.createVNode("ul",null,[m.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),d.value&&n.createVNode("li",{onClick:Fe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:oe.value},null)]),p.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:F=>S(F,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ue(){return n.createVNode("div",{class:"modal-footer",style:Be.value},[N.value&&N.value.map(F=>{const Z=n.ref(F.disabled);return n.createVNode("button",{name:F.name,type:"button",disabled:Z.value,class:F.class+(F.iconClass?" btn-icontext":""),onClick:ae=>{Ve(F,ae)}},[!!F.iconClass&&n.createVNode("i",{class:F.iconClass},null),F.text])})])}function Je(){return n.createVNode("div",{ref:q,class:"modal-header",style:D.value},[e.slots.headerTemplate?e.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[C.value&&n.createVNode("span",{class:l.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[I.value])]),n.createVNode("div",{class:"actions"},[Te()])])}function ze(){return e.slots.footerTemplate?e.slots.footerTemplate():A.value&&Ue()}function Qe(F){if(F.stopPropagation(),i.allowClickMaskToClose){if(F.target!==L.value)return;S(F,!1)}}function Ge(){var F,Z;return n.createVNode("div",{id:s.value,class:W.value,style:se.value,ref:g},[n.createVNode("div",{class:Q.value},[c.value&&Je(),n.createVNode("div",{class:ue.value},[(Z=(F=e.slots).default)==null?void 0:Z.call(F),f.value==="iframe"&&n.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:h.value},null)]),ze()]),!u.value&&g.value&&!z.value&&Y(g.value)])}function _e(F){return F||"body"}return()=>n.createVNode(n.Teleport,{to:_e(i.host)},{default:()=>[X.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:L,class:ee.value,style:re.value,onClick:Qe},[Ge()])]})]})}});function Wt(i){if(i.content&&i.content.render)return i.content.render;if(i.render&&typeof i.render=="function")return i.render}function ao(i){const e=document.createElement("div");e.style.display="contents";const t=n.createApp({setup(o,r){n.onUnmounted(()=>{document.body.removeChild(e)});const s=n.ref(),a=n.ref(i.class||""),u=n.ref(!!i.showButtons),c=n.ref(!!i.showHeader),l=n.ref(i.showCloseButton==null?!0:i.showCloseButton),p=n.ref(!0),d=n.ref(i.title||""),m=i.acceptCallback||(()=>{}),f=i.rejectCallback||(()=>{}),h=i.closedCallback||(L=>{}),b=i.resizeHandle||(L=>{}),j=i.stopMoveHandle||(L=>{}),I=Wt(i),k=L=>{p.value=!1,t.unmount(),h(L)};return n.onMounted(()=>{}),r.expose({modalRef:s}),()=>n.createVNode(Ye,{ref:s,class:a.value,modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,title:d.value,width:i.width,height:i.height,buttons:i.buttons,"show-header":c.value,"show-buttons":u.value,"show-close-button":l.value,"show-max-button":!1,onAccept:m,onCancel:f,fitContent:i.fitContent==null?!0:i.fitContent,onClosed:k,onResize:b,onStopMove:j},{default:()=>[I&&I(t)]})}});return document.body.appendChild(e),t.mount(e),t}class Ht{constructor(e){H(this,"appContext",null);H(this,"modalRef",n.ref());H(this,"activeModalIndex",n.ref(0));H(this,"modalRefs",{});H(this,"isUseEscCloseModal",n.ref(!1));H(this,"activeModalInstance",n.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return ao(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=n.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((S,E)=>{}),c=o.value.resizeHandle||(S=>{}),l=e.stopMoveHandle||(S=>{});let p;const d=Wt(o.value),m=S=>{var N;r.value=!1;const E=(N=S==null?void 0:S.target)==null?void 0:N.classList.contains("modal_close");u(S,this.isUseEscCloseModal.value?"esc":E?"icon":"button")},f=S=>{m(S),p&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,t),p=null,this.modalRef.value=null,this.modalRefs){const E=Object.keys(this.modalRefs).map(N=>Number(N));E.length>0?this.activeModalIndex.value=Math.max(...E):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},h=S=>{var E;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((E=this.activeModalInstance.value)==null||E.close(S==null?void 0:S.event))},{width:b,height:j}=o.value,I=this.adaptToWindow(b||500,j||320);Object.assign(o.value,I);const k=()=>n.createVNode(Ye,n.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":S=>r.value=S},o.value,{onAccept:s,onCancel:a,onClosed:f,onResize:c,onEsc:h,onStopMove:l}),{default:()=>[d&&d(this.app)]});return p=(S=>{const E=n.h(k,S);return E.appContext=this.appContext,n.render(E,t),E})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:S=>{o.value={...o.value,...S},p&&n.render(n.cloneVNode(p,{...o}),t)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const lo=Symbol("FModalService");Ye.install=i=>{i.component(Ye.name,Ye);const e=new Ht(i);i.provide(lo,e),i.provide("FModalService",e)};class Ne{static show(e){const t=n.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",s=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",a=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{});let c=null,l=new Ht(c);const p=()=>{c&&(c==null||c.destroy(),l=null)};return c=l==null?void 0:l.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>n.createVNode(at,n.mergeProps(t,{onAccept:a,onReject:u,onClose:p}),null)}),l==null?void 0:l.getCurrentModal()}static info(e,t){const o=n.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Ne.show(o)}static warning(e,t){const o=n.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Ne.show(o)}static success(e,t){const o=n.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Ne.show(o)}static error(e,t,o){const r=n.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:e,detail:t}});Ne.show(r)}static prompt(e,t){const o=n.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Ne.show(o)}static question(e,t,o,r){const s=n.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Ne.show(s)}}at.install=i=>{i.component(at.name,at),i.provide("FMessageBoxService",Ne)};class co extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.propertyConfig}}function uo(i,e){const t=i.schema;function o(f){var N,C,A;const{componentType:h,sourceType:b,bindingTargetId:j,sourceElement:I}=f,{schemaService:k,formSchemaUtils:L}=e,R=L.getViewModelIdByComponentId((C=(N=i.componentInstance)==null?void 0:N.value)==null?void 0:C.belongedComponentId),S=L.getViewModelById(R);if([me["response-layout"].type,me["query-solution"].type,me.fieldset.type].includes(h)||(A=t.contents)!=null&&A.length)return!1;if(b==="field"){const q=k.getFieldByIDAndVMID(j,R);if(!q||!q.schemaField)return!1}if(I&&I.componentInstance){const{componentInstance:q}=I,g=L.getViewModelIdByComponentId(q.value.belongedComponentId);if(g!==R&&h==="form-group")return L.getViewModelById(g).bindTo===S.bindTo}return!0}function r(){return!1}function s(){return!1}function a(){return!0}function u(f){return new co(f,e).getPropertyConfig(t)}function c(){t.appearance||(t.appearance={class:""}),t.appearance.class||(t.appearance.class=""),t.appearance.class.includes("farris-form")||(t.appearance.class+=" f-form-layout farris-form farris-form-controls-inline farris-form-auto")}function l(f,h){var b,j,I;if(f.componentCategory==="input"){const{label:k}=f;let L;return(b=f.bindingSourceContext)!=null&&b.entityFieldNode?L=(e==null?void 0:e.controlCreatorUtils).setFormFieldProperty((j=f.bindingSourceContext)==null?void 0:j.entityFieldNode,h==null?void 0:h.type,"col-12"):(L=tt("form-group"),L.editor=h,L.label=k,L.appearance={class:"col-12"}),c(),Gt(i,e).syncFieldToViewModel(f,(I=L.editor)==null?void 0:I.type),L}return h}function p(f,h){if(!f||!f.componentInstance||!e)return;const j=f.componentInstance.value.schema;if(!j.binding||!j.binding.field)return;j.type==="form-group"&&c();const I=Gt(i,e);I.onAcceptMovedChildElement&&I.onAcceptMovedChildElement(f,h)}function d(){!t.appearance||!t.appearance.class||(t.appearance.class=t.appearance.class.replace("f-form-layout",""),t.appearance.class=t.appearance.class.replace("farris-form",""),t.appearance.class=t.appearance.class.replace("farris-form-controls-inline",""),t.appearance.class=t.appearance.class.replace("farris-form-auto",""),t.appearance.class=t.appearance.class.trim())}function m(f){var h,b,j;f&&((j=(b=(h=f.componentInstance)==null?void 0:h.value)==null?void 0:b.schema)==null?void 0:j.type)==="form-group"&&d()}return{canAccepts:o,checkCanDeleteComponent:r,checkCanMoveComponent:s,hideNestedPaddingInDesginerView:a,getPropsConfig:u,onResolveNewComponentSchema:l,onAcceptMovedChildElement:p,onChildElementMovedOut:m}}const po=n.defineComponent({name:"FResponseLayoutItemDesign",props:ht,emits:[],setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=uo(o,r),a=Dt(t,o,s);return n.onMounted(()=>{t.value.componentInstance=a}),e.expose(a.value),()=>n.createVNode("div",{ref:t,class:i.customClass,style:"padding-right:8px;display:inherit;flex:1;","data-dragref":`${o.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),fo={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout-splitter.schema.json",title:"response-layout-splitter",description:"A Splitter Editor for Response Layout",type:"object",properties:{id:{description:"The unique identifier for response layout splitter editor",type:"string"},type:{description:"The type string of response layout splitter editor component",type:"string",default:"response-layout-splitter"},layout:{description:"",type:"object",default:{}}},required:["id","type"]},Xt={layout:{type:Array}},mo=Xe(Xt,fo);function ho(i,e){const t=n.inject("FMessageBoxService"),o=["12","6:6","3:9","9:3","4:4:4","3:6:3","3:3:6","3:3:3:3"],r=n.ref([]),s=n.ref(""),a=n.ref(i.layout||[]),u=n.ref(!0);function c(){o.forEach(f=>{r.value.push(f.split(":").map(h=>`col-${h}`))})}function l(){if(!(i!=null&&i.layout))return;if(!a.value.length){s.value="";return}u.value=!0;const f=[];a.value.forEach(h=>{h.appearance||(h.appearance={class:""});const j=(h.appearance.class||"").split(" ").find(I=>/^col-([1-9]|10|11|12)$/.test(I));j?f.push(parseInt(j.replace("col-",""),10)):f.push(0)}),s.value=f.join(":"),u.value=o.includes(s.value)}function p(f){for(let h=f.length;h<a.value.length;h++){const b=a.value[h];if(b&&b.contents&&b.contents.length)return!0}return!1}function d(f,h){u.value=!0,s.value=f;for(let b=0;b<h.length;b++){const j=a.value[b];if(j){let I=j.appearance&&j.appearance.class||"";const k=I.split(" ").find(L=>/^col-([1-9]|10|11|12)$/.test(L));k?(I=I.replace(k,`col-${h[b]}`),j.appearance.class=I):j.appearance.class+=` col-${h[b]}`}else{const I=tt("response-layout-item");I.id=`layout_${Math.random().toString().slice(2,6)}`,I.appearance={class:`h-100 col-${h[b]} px-0`},a.value.push(I)}}a.value.length=h.length,e.emit("change")}function m(f){const h=f.split(":");if(h.length<a.value.length&&p(h)){let b="应用XXX列布局将删除右侧区域内的控件,此操作不可撤销,确定应用?";b=b.replace("XXX",h.length+""),t==null||t.question(b,"",()=>{d(f,h)},()=>{})}else d(f,h)}return c(),l(),{standardLayouts:o,standardLayoutClass:r,selectedLayout:s,currentLayoutItems:a,isStandardLayout:u,onSelectColumnLayout:m}}const Yt=n.defineComponent({name:"FResponseLayoutSplitter",props:Xt,emits:["change"],setup(i,e){const{standardLayouts:t,standardLayoutClass:o,selectedLayout:r,isStandardLayout:s,onSelectColumnLayout:a}=ho(i,e),u=n.computed(()=>l=>({"columns-layout-option":!0,active:r.value===l}));function c(){return n.createVNode("ul",{class:"columns-layout-list"},[t.map((l,p)=>n.createVNode("li",{class:u.value(l),onClick:()=>a(l)},[n.createVNode("div",{class:"columns-layout-icon d-flex"},[o.value[p].map(d=>n.createVNode("div",{class:{"columns-layout-item":!0,[d]:!0}},[n.createTextVNode(" ")]))])])),s.value?"":n.createVNode("li",{class:"columns-layout-option active",title:"自定义布局"},[n.createVNode("div",{class:"columns-layout-icon icon-custom"},[n.createTextVNode(" ")])])])}return()=>n.createVNode("div",{class:"columns-layout"},[c(),s.value?n.createVNode("div",{class:"farris-group-wrap mt-2"},[n.createVNode("div",{class:"form-group farris-form-group d-flex"},[n.createVNode("label",{class:"col-form-label mb-0",style:"width: 89px;"},[n.createVNode("div",{class:"wrap"},[n.createVNode("span",{class:"farris-label-text"},[n.createTextVNode(" 布局比例 ")])])]),n.createVNode("div",{class:"farris-input-wrap"},[n.createVNode("input",{type:"input",class:"form-control form-control-sm",value:r.value,readonly:!0},null)])])]):""])}}),yo={install(i){i.component(ot.name,ot).component(it.name,it)},register(i,e,t,o){i["response-layout"]=ot,i["response-layout-item"]=it,e["response-layout"]=mt,e["response-layout-item"]=Lt,i["response-layout-splitter"]=Yt,e["response-layout-splitter"]=mo},registerDesigner(i,e,t){i["response-layout"]=fn,i["response-layout-item"]=po,e["response-layout"]=mt,e["response-layout-item"]=Lt}};ie.FResponseLayout=ot,ie.FResponseLayoutItem=it,ie.FResponseLayoutSplitter=Yt,ie.default=yo,ie.responseLayoutProps=nt,ie.responseLayoutPropsResolver=mt,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(ie,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("@vueuse/core"),require("../dynamic-resolver/index.umd.js"),require("../data-view/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","@vueuse/core","../dynamic-resolver/index.umd.js","../data-view/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../../designer/tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../notify/index.umd.js"],n):(ie=typeof globalThis<"u"?globalThis:ie||self,n(ie["response-layout"]={},ie.Vue,ie.LodashES,ie.common,ie.VueUseCore,ie.dynamicResolver,ie.dataView,ie.designerCanvas,ie.propertyPanel))})(this,function(ie,n,le,We,Qt,ve,K,He,Oe){"use strict";var go=Object.defineProperty;var vo=(ie,n,le)=>n in ie?go(ie,n,{enumerable:!0,configurable:!0,writable:!0,value:le}):ie[n]=le;var H=(ie,n,le)=>vo(ie,typeof n!="symbol"?n+"":n,le);const Vt={},kt={};function pt(i){const{properties:e,title:t,ignore:o}=i,r=o&&Array.isArray(o),s=Object.keys(e).reduce((a,u)=>((!r||!o.find(c=>c===u))&&(a[u]=e[u].type==="object"&&e[u].properties?pt(e[u]):le.cloneDeep(e[u].default)),a),{});if(t&&(!r||!o.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");s.id=`${a}_${Math.random().toString().slice(2,6)}`}return s}function Zt(i){const{properties:e,title:t,required:o}=i;if(o&&Array.isArray(o)){const r=o.reduce((s,a)=>(s[a]=e[a].type==="object"&&e[a].properties?pt(e[a]):le.cloneDeep(e[a].default),s),{});if(t&&o.find(s=>s==="id")){const s=t.toLowerCase().replace(/-/g,"_");r.id=`${s}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function tt(i,e={},t){const o=Vt[i];if(o){let r=Zt(o);const s=kt[i];return r=s?s({getSchemaByType:tt},r,e,t):r,r}return null}function Kt(i,e){const t=pt(e);return Object.keys(t).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(i,r)&&(o[r]&&le.isPlainObject(o[r])&&le.isPlainObject(i[r]||!i[r])?Object.assign(o[r],i[r]||{}):o[r]=i[r]),o),t),t}function $t(i,e){return Object.keys(i).filter(o=>i[o]!=null).reduce((o,r)=>{if(e.has(r)){const s=e.get(r);if(typeof s=="string")o[s]=i[r];else{const a=s(r,i[r],i);Object.assign(o,a)}}else o[r]=i[r];return o},{})}function en(i,e,t=new Map){const o=Kt(i,e);return $t(o,t)}function tn(i={}){function e(l,p,d,m){if(typeof d=="number")return m[l].length===d;if(typeof d=="object"){const f=Object.keys(d)[0],h=d[f];if(f==="not")return Number(m[l].length)!==Number(h);if(f==="moreThan")return Number(m[l].length)>=Number(h);if(f==="lessThan")return Number(m[l].length)<=Number(h)}return!1}function t(l,p,d,m){return m[l]&&m[l].propertyValue&&String(m[l].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(i).reduce((l,p)=>(l.set(p,i[p]),l),o);function r(l,p){const d=l;return typeof p=="number"?[{target:d,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:d,operator:"getProperty",param:l,value:!!p}]:typeof p=="object"?Object.keys(p).map(m=>{if(m==="length")return{target:d,operator:"length",param:null,value:p[m]};const f=m,h=p[m];return{target:d,operator:"getProperty",param:f,value:h}}):[]}function s(l){return Object.keys(l).reduce((d,m)=>{const f=r(m,l[m]);return d.push(...f),d},[])}function a(l,p){if(o.has(l.operator)){const d=o.get(l.operator);return d&&d(l.target,l.param,l.value,p)||!1}return!1}function u(l,p){return s(l).reduce((f,h)=>f&&a(h,p),!0)}function c(l,p){const d=Object.keys(l),m=d.includes("allOf"),f=d.includes("anyOf"),h=m||f,I=(h?l[h?m?"allOf":"anyOf":"allOf"]:[l]).map(L=>u(L,p));return m?!I.includes(!1):I.includes(!0)}return{parseValueSchema:c}}const me={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},nn={},on={};tn();function Xe(i,e,t=new Map,o=(a,u,c,l)=>u,r={},s=a=>a){return Vt[e.title]=e,kt[e.title]=o,nn[e.title]=r,on[e.title]=s,(a={},u=!0)=>{if(!u)return $t(a,t);const c=en(a,e,t),l=Object.keys(i).reduce((p,d)=>(p[d]=i[d].default,p),{});return Object.assign(l,c)}}function ft(i,e){return{customClass:e.class,customStyle:e.style}}const Ot=new Map([["appearance",ft]]);function rn(i,e,t){if(t.componentFeature){const o=JSON.parse(t.componentFeature);e.appearance={class:"bg-white"},e.contents=String(o.splitter).split(":").map(r=>{const s=i.getSchemaByType("response-layout-item");return s.appearance={class:`h-100 col-${r} px-0`},s})}return e}const sn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout.schema.json",title:"response-layout",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout",type:"string"},type:{description:"The type string of Respnse Layout component",type:"string",default:"response-layout"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},nt={customClass:{type:String,default:""},customStyle:{type:String,default:""}},mt=Xe(nt,sn,Ot,rn),ot=n.defineComponent({name:"FResponseLayout",props:nt,emits:[],setup(i,e){function t(r,s){r&&s&&s.split(" ").reduce((u,c)=>(u[c]=!0,u),r)}const o=n.computed(()=>{const r={"d-flex":!0};return t(r,i.customClass),r});return()=>n.createVNode("div",{class:o.value,style:i.customStyle},[e.slots.default&&e.slots.default()])}}),an={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout-item.schema.json",title:"response-layout-item",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout Item",type:"string"},type:{description:"The type string of Respnse Layout Item component",type:"string",default:"response-layout-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},ht={customClass:{type:String,default:""},customStyle:{type:String,default:""}},Lt=Xe(ht,an,Ot),it=n.defineComponent({name:"FResponseLayoutItem",props:ht,emits:[],setup(i,e){return()=>n.createVNode("div",{class:i.customClass,style:i.customStyle},[e.slots.default&&e.slots.default()])}});function Dt(i,e,t){var N;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=n.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function u(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function p(C){if(!C||!C.value)return null;if(C.value.schema&&C.value.schema.type==="component")return C.value;const A=n.ref(C==null?void 0:C.value.parent),q=p(A);return q||null}function d(C=e){var z;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(C);const{componentInstance:A,designerItemElementRef:q}=C;if(!A||!A.value)return null;const{getCustomButtons:g}=A.value;return A.value.canMove||g&&((z=g())!=null&&z.length)?q:d(C.parent)}function m(C){return!!t&&t.canAccepts(C)}function f(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function h(){}function b(C,A){var q;!C||!A||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(C,A),(q=e==null?void 0:e.setupContext)==null||q.emit("dragEnd"))}function j(C,A){const{componentType:q}=C;let g=tt(q,C,A);t&&t.onResolveNewComponentSchema&&(g=t.onResolveNewComponentSchema(C,g));const z=q.toLowerCase().replace(/-/g,"_");return g&&!g.id&&g.type===q&&(g.id=`${z}_${Math.random().toString().slice(2,6)}`),g}function I(C){C&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(C)}function k(...C){if(t&&t.getPropsConfig)return t.getPropsConfig(...C)}function L(C){if(!C)return;const A=e==null?void 0:e.schema,{formSchemaUtils:q}=C;if(A&&q.getExpressions().length){const g=q.getExpressions().findIndex(z=>z.target===A.id);g>-1&&q.getExpressions().splice(g,1)}}function R(C){t&&t.onRemoveComponent&&t.onRemoveComponent(),L(C),e!=null&&e.schema.contents&&e.schema.contents.map(A=>{let q=A.id;A.type==="component-ref"&&(q=A.component);const g=i.value.querySelectorAll(`#${q}-design-item`);g!=null&&g.length&&Array.from(g).map(z=>{var Y;(Y=z==null?void 0:z.componentInstance)!=null&&Y.value.onRemoveComponent&&z.componentInstance.value.onRemoveComponent(C)})})}function S(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function E(C){if(t&&t.onPropertyChanged)return t.onPropertyChanged(C)}return s.value={canMove:a(),canSelectParent:u(),canDelete:c(),canNested:!l(),contents:e==null?void 0:e.schema.contents,elementRef:i,parent:(N=e==null?void 0:e.parent)==null?void 0:N.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:m,getBelongedComponentInstance:p,getDraggableDesignItemElement:d,getDraggingDisplayText:f,getPropConfig:k,getDragScopeElement:h,onAcceptMovedChildElement:b,onChildElementMovedOut:I,addNewChildComponentSchema:j,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:R,getCustomButtons:S,onPropertyChanged:E},s}const Pt=n.ref(0),ln=n.ref(0);function Rt(){ln.value++}function cn(i){const{formSchemaUtils:e,formStateMachineUtils:t}=i;function o(c,l=""){return{path:l+c.code,field:c.id,fullPath:c.code}}function r(c,l=""){return e.getViewModelById(c).states.map(d=>o(d,l))}function s(c){const l=e.getRootViewModelId(),p=r(c);if(c===l)return p;const d=r(l,"root-component.");return[...p,...d]}function a(c){return c.binding&&c.binding.path||c.id||""}function u(){return t&&t.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:u}}class un{constructor(e){H(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'"}]);H(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});H(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,s,a)=>{const u=s.getExpressionRuleValue(e,t||r);return u&&u.value||""},convertTo:(o,r,s,a,u)=>{var c;if(r==="dataPicking"&&(s!=null&&s.target)){const l=`${s.target}_dataPicking`;((c=s.rules)==null?void 0:c.some(d=>d.id===l&&d.value))?o.dictPickingExpressionId=l:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===e);if(!r)return"";const s=r.rules.find(a=>a.type===t);return s||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var u;const s=this.createTreeNode(r,t);let a=[];(u=r.type)!=null&&u.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var c,l;const s=this.createTreeNode(r,t),a=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...t,r.label]),u=this.buildChildEntityTreeData((l=r.type)==null?void 0:l.entities,[...t,r.label]);u!=null&&u.length&&(a==null||a.push(...u)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,t),a=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(t)&&s?s.message:"",...a};return s.messageType!=null&&(u.messageType=s.messageType),u}buildRule(e,t,o,r){const{expression:s,message:a,messageType:u}=t,c={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=a),o==="dataPicking"&&(c.messageType=u),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const s=t==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let c=this.getExpressionData().find(p=>p.targetType===t&&p.target===s);const l=p=>p.value.trim()==="";if(c){const p=c.rules.find(d=>d.id===a.id);if(p)l(a)?c.rules=c.rules.filter(d=>d.id!==a.id):(Object.assign(p,a),r==="validate"&&e.type==="form-group"&&(p.elementId=e.id));else{if(l(a))return null;c.rules=c.rules||[],c.rules.push(a)}}else{if(l(a))return null;c={target:`${s}`,rules:[a],targetType:t}}return c}getExpressionEditorOptions(e,t,o,r){return o.reduce((s,a)=>{var c,l;const u=t==="Field"?(c=e==null?void 0:e.binding)==null?void 0:c.field:e.id;return s[a]={hide:t==="Field"?!!((l=e==null?void 0:e.binding)!=null&&l.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(u),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,a,t),onSubmitModal:p=>{const d=this.updateExpression(e,t,p,a);if(r){const m=this.buildRule(u,p,a);r(m)}return d}}},s},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:t,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class yt{constructor(e,t){H(this,"componentId");H(this,"viewModelId");H(this,"eventsEditorUtils");H(this,"formSchemaUtils");H(this,"formMetadataConverter");H(this,"designViewModelUtils");H(this,"designViewModelField");H(this,"controlCreatorUtils");H(this,"designerHostService");H(this,"schemaService",null);H(this,"metadataService",null);H(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:me[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},s={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const a in t)s[a]=Object.assign(s[a]||{},t[a]);return{...r,properties:{...s},setPropertyRelates(a,u){if(a){switch(a&&a.propertyID){case"class":case"style":{Pt.value++;break}}o&&o(a,e,u)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},s={}){const{getVariables:a,getControlName:u,getStateMachines:c}=cn(this.designerHostService),l=this.getRealTargetType(e),p=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],d={type:"property-editor",propertyTypes:p};return p.map(m=>{switch(m){case"Const":Object.assign(d,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":d.expressionConfig=this.getExpressionOptions(e,l,o);break;case"StateMachine":d.stateMachines=c();break;case"Variable":Object.assign(d,{controlName:u(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:a(this.viewModelId),onBeforeOpenVariables:f=>{f.value=a(this.viewModelId)}},s);break}}),d}getVisibleProperty(e,t=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,t==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(e,t="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,t);for(const c in o)a[c]=Object.assign(a[c]||{},o[c]);const u=this;return{...s,properties:{...a},setPropertyRelates(c,l){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,c);break}r&&r(c,l)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===e),s=le.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),Rt()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(t).states.push(a)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:s,expressionInfo:a}=t,{targetId:u,targetType:c,expressionType:l,value:p,message:d}=a,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:f}=m;let h=f.find(j=>j.target===u);h||(h={target:u,rules:[],targetType:c},f.push(h));const b=h.rules.find(j=>j.type===l);if(b)b.value=p,b.message=d;else{const j={id:s,type:l,value:p,message:d};h.rules.push(j)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),u=t.binding?t.binding.field:t.id,c=a.find(l=>l.target===u);!c||!c.rules||(c.rules=c.rules.filter(l=>l.type!==s))}getExpressionOptions(e,t,o){return new un(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}class dn extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.propertyConfig.categories.layout=this.getLayoutPropConfig(e,this.viewModelId),this.propertyConfig}getLayoutPropConfig(e,t){return{title:"布局",description:"layout",properties:{layout:{title:"",type:"select",description:"配置布局容器内区块个数及比例。",editor:{type:"response-layout-splitter",layout:e.contents||[]}}},setPropertyRelates(o,r){Pt.value++}}}}function pn(i,e){const t=i.schema;function o(u){return!1}function r(u){return new dn(u,e).getPropertyConfig(t)}function s(){var l;const u=i.designerItemElementRef.value.querySelector(`#${t.id}`);if(!u)return;const c=((l=i.schema.contents)==null?void 0:l.map(p=>p.id))||[];Array.from(u.children).map(p=>{var m;const d=(m=p.componentInstance)==null?void 0:m.value;d!=null&&d.schema&&!c.includes(d.schema.id)&&d.onRemoveComponent&&d.onRemoveComponent(e)})}function a(u){var c;u&&((c=u==null?void 0:u.changeObject)==null?void 0:c.propertyID)==="layout"&&s()}return{canAccepts:o,getPropsConfig:r,onPropertyChanged:a}}const fn=n.defineComponent({name:"FResponseLayoutDesign",props:nt,emits:[],setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=pn(o,r),a=Dt(t,o,s);n.onMounted(()=>{t.value.componentInstance=a}),e.expose(a.value);function u(l,p){l&&p&&p.split(" ").reduce((m,f)=>(m[f]=!0,m),l)}const c=n.computed(()=>{const l={"d-flex":!0,"response-layout":!0};return u(l,i.customClass),l});return()=>n.createVNode("div",{ref:t,class:c.value,style:"height:inherit;"},[e.slots.default&&e.slots.default()])}});var Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mn={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(){return function(){function t(o,r,s){function a(l,p){if(!r[l]){if(!o[l]){var d=typeof rt=="function"&&rt;if(!p&&d)return d(l,!0);if(u)return u(l,!0);var m=new Error("Cannot find module '"+l+"'");throw m.code="MODULE_NOT_FOUND",m}var f=r[l]={exports:{}};o[l][0].call(f.exports,function(h){var b=o[l][1][h];return a(b||h)},f,f.exports,t,o,r,s)}return r[l].exports}for(var u=typeof rt=="function"&&rt,c=0;c<s.length;c++)a(s[c]);return a}return t}()({1:[function(t,o,r){var s={},a="(?:^|\\s)",u="(?:\\s|$)";function c(d){var m=s[d];return m?m.lastIndex=0:s[d]=m=new RegExp(a+d+u,"g"),m}function l(d,m){var f=d.className;f.length?c(m).test(f)||(d.className+=" "+m):d.className=m}function p(d,m){d.className=d.className.replace(c(m)," ").trim()}o.exports={add:l,rm:p}},{}],2:[function(t,o,r){(function(s){var a=t("contra/emitter"),u=t("crossvent"),c=t("./classes"),l=document,p=l.documentElement;function d(g,z){var Y=arguments.length;Y===1&&Array.isArray(g)===!1&&(z=g,g=[]);var y,w,B,_,x,T,O,M,V,X=null,ee,W,se=!1,re=0,Q,D=z||{};D.moves===void 0&&(D.moves=k),D.accepts===void 0&&(D.accepts=k),D.invalid===void 0&&(D.invalid=Qe),D.containers===void 0&&(D.containers=g||[]),D.isContainer===void 0&&(D.isContainer=I),D.copy===void 0&&(D.copy=!1),D.copySortSource===void 0&&(D.copySortSource=!1),D.revertOnSpill===void 0&&(D.revertOnSpill=!1),D.removeOnSpill===void 0&&(D.removeOnSpill=!1),D.direction===void 0&&(D.direction="vertical"),D.ignoreInputTextSelection===void 0&&(D.ignoreInputTextSelection=!0),D.mirrorContainer===void 0&&(D.mirrorContainer=l.body);var oe=a({containers:D.containers,start:Je,end:Ge,cancel:be,remove:ae,destroy:Ve,canMove:Ue,dragging:!1});return D.removeOnSpill===!0&&oe.on("over",xt).on("out",et),Ae(),oe;function ue(v){return oe.containers.indexOf(v)!==-1||D.isContainer(v)}function Ae(v){var $=v?"remove":"add";h(p,$,"mousedown",De),h(p,$,"mouseup",F)}function Be(v){var $=v?"remove":"add";h(p,$,"mousemove",$e)}function Fe(v){var $=v?"remove":"add";u[$](p,"selectstart",ke),u[$](p,"click",ke)}function Ve(){Ae(!0),F({})}function ke(v){ee&&v.preventDefault()}function De(v){_=v.clientX,x=v.clientY;var $=b(v)!==1||v.metaKey||v.ctrlKey;if(!$){var P=v.target,G=Te(P);G&&(ee=G,Be(),v.type==="mousedown"&&(E(P)?P.focus():v.preventDefault()))}}function $e(v){if(ee){if(b(v)===0){F({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-_)<=(D.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-x)<=(D.slideFactorY||0))){if(D.ignoreInputTextSelection){var $=q("clientX",v)||0,P=q("clientY",v)||0,G=l.elementFromPoint($,P);if(E(G))return}var te=ee;Be(!0),Fe(),Ge(),ze(te),c.add(M||B,"gu-transit"),Tt(),It(),re=0,Ke(v)}}}function Te(v){if(!(oe.dragging&&y)&&!ue(v)){for(var $=v;S(v)&&ue(S(v))===!1;)if(D.invalid(v,$)||(v=S(v),!v))return;var P=S(v);if(P&&!D.invalid(v,$)){var G=D.moves(v,P,$,C(v));if(G)return{item:v,source:P}}}}function Ue(v){return!!Te(v)}function Je(v){var $=Te(v);$&&ze($)}function ze(v){Ft(v.item,v.source)&&(M=v.item.cloneNode(!0),oe.emit("cloned",M,v.item,"copy")),w=v.source,B=v.item,T=O=C(v.item),oe.dragging=!0,oe.emit("drag",B,w)}function Qe(){return!1}function Ge(){if(oe.dragging){var v=M||B;Z(v,S(v))}}function _e(){ee=!1,Be(!0),Fe(!0)}function F(v){if(_e(),!!oe.dragging){var $=M||B,P=q("clientX",v)||0,G=q("clientY",v)||0,te=j(y,P,G),ne=lt(te,P,G);ne&&(M&&D.copySortSource||!M||ne!==w)?Z($,ne):D.removeOnSpill?ae():be()}}function Z(v,$){var P=S(v);M&&D.copySortSource&&$===w&&P.removeChild(B),Ze($)?oe.emit("cancel",v,w):oe.emit("drop",v,$,w,O),je()}function ae(){if(oe.dragging){var v=M||B,$=S(v);$&&$.removeChild(v),oe.emit(M?"cancel":"remove",v,$,w),je()}}function be(v){if(oe.dragging){var $=arguments.length>0?v:D.revertOnSpill,P=M||B,G=S(P),te=Ze(G);te===!1&&$&&(M?G&&G.removeChild(M):w.insertBefore(P,T)),te||$?oe.emit("cancel",P,w,w):oe.emit("drop",P,G,w,O),je()}}function je(){var v=M||B;_e(),Mt(),St(),v&&c.rm(v,"gu-transit"),V&&clearTimeout(V),oe.dragging=!1,X&&oe.emit("out",v,X,w),oe.emit("dragend",v,re),w=B=M=T=O=V=X=null}function Ze(v,$){var P;return $!==void 0?P=$:y?P=O:P=C(M||B),v===w&&P===T}function lt(v,$,P){for(var G=v;G&&!te();)G=S(G);return G;function te(){var ne=ue(G);if(ne===!1)return!1;var xe=ct(G,v),ye=dt(G,xe,$,P),Ce=Ze(G,ye);return Ce?!0:D.accepts(B,G,w,ye)}}function Ke(v){if(!y)return;v.preventDefault();var $=q("clientX",v)||0,P=q("clientY",v)||0;y.style.left=$-2+"px",y.style.top=P-2+"px";var G=M||B,te=j(y,$,P),ne=lt(te,$,P),xe=ne!==null&&ne!==X;(xe||ne===null)&&(ge(),X=ne,Se()),Bt(te,P);var ye=S(G);if(ne===w&&M&&!D.copySortSource){ye&&ye.removeChild(G);return}var Ce,Me=ct(ne,te);if(se=jt(Me,ne),Me!==null)Ce=dt(ne,Me,$,P);else if(D.revertOnSpill===!0&&!M)Ce=T,ne=w;else{M&&ye&&ye.removeChild(G),M&&W&&(W.style.display="none");return}W.style.display="block",wt(Ce,G,xe),Ce?Et(Me,Ce):Nt(ne);function de(pe){oe.emit(pe,G,X,w)}function Se(){xe&&de("over")}function ge(){X&&de("out")}}function wt(v,$,P){(v===$||v===C($))&&(O=C($)),(v===null&&P||v!==$&&v!==C($))&&(O=v)}function xt(v){c.rm(v,"gu-hide")}function et(v){oe.dragging&&c.add(v,"gu-hide")}function It(){y||(y=document.createElement("div"),y.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;",y.innerHTML=D.getMirrorText&&D.getMirrorText(B)||"控件",c.add(y,"gu-mirror"),D.mirrorContainer.appendChild(y),h(p,"add","mousemove",Ke),c.add(D.mirrorContainer,"gu-unselectable"),oe.emit("cloned",y,B,"mirror"))}function Tt(){if(W=document.createElement("div"),c.add(W,"gu-insertion"),B){var v=B.getBoundingClientRect();W.style.left=v.left+"px",W.style.top=v.top+"px"}se=!1,D.mirrorContainer.appendChild(W)}function Mt(){y&&(c.rm(D.mirrorContainer,"gu-unselectable"),h(p,"remove","mousemove",Ke),S(y).removeChild(y),y=null)}function St(){W&&(S(W).removeChild(W),W=null)}function ct(v,$){for(var P=$;P!==v&&S(P)!==v;)P=S(P);return P===p?null:P}function jt(v,$){if(!$)return se;var P=v||$&&$.lastElementChild;if(!P)return!0;var G=getComputedStyle(v),te=/^inline/.test(G.getPropertyValue("display"))||/^(left|right)$/.test(G.getPropertyValue("float"));if(te)return!0;if($){var ne=getComputedStyle($),xe=ne.getPropertyValue("display");if(/flex$/.test(xe)){var ye=ne.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!ut($)}return!1}return!0}function ut(v){if(!v.children||!v.children.length)return!1;for(const $ of Array.from(v.children)){const G=($.className&&$.className.split(" ")||[]).filter(te=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(te));if(!G.length)return!1;for(const te of G){const ne=te.slice(te.lastIndexOf("-")+1);if(parseInt(ne,10)!==12)return!1}}return!0}function Et(v,$){const P=$.getBoundingClientRect();if(W.style.left=P.left+"px",W.style.top=P.top+"px",se){if(W.style.height=P.height+"px",W.style.width="4px",v){const G=v.getBoundingClientRect();G.top!==P.top&&(W.style.left=G.right+"px",W.style.top=G.top+"px",W.style.height=G.height+"px")}}else if(W.style.height="4px",W.style.width=P.width+"px",Q){const G=Q.getBoundingClientRect();P.top<G.top&&(W.style.display="none")}$===B&&B&&(W.style.display="none")}function Nt(v){O=null;var $=v.lastElementChild;if($){var P=$.getBoundingClientRect();se?(W.style.left=P.right+"px",W.style.top=P.top+"px",W.style.height=P.height+"px",W.style.width="4px"):(W.style.left=P.left+"px",W.style.top=P.bottom+"px",W.style.height="4px",W.style.width=P.width+"px"),$===B&&B&&(W.style.display="none")}else W.style.display="none"}function Bt(v,$){if(!D.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(Q=m(v),!Q||!Q.contains(v)))return;const P=document.querySelector(".dgComponentSelected"),G=Q.getBoundingClientRect();if($-30<G.top&&Q.scrollTop>0){let te=Q.scrollTop<10?Q.scrollTop:10;Q.scrollBy(0,-1*te),P&&Q.contains(P)&&(re=re+-1*te)}if($+30>G.bottom&&Q.scrollTop<Q.scrollHeight-Q.clientHeight){const te=Q.scrollHeight-Q.clientHeight-Q.scrollTop;let ne=te<10?te:10;Q.scrollBy(0,ne),P&&Q.contains(P)&&(re=re+ne)}}function dt(v,$,P,G){var te=D.direction==="horizontal",ne=D.direction==="mixed",xe=$!==v?Ce():ye();return xe;function ye(){var de=v.children.length,Se,ge,pe;for(Se=0;Se<de;Se++)if(ge=v.children[Se],pe=ge.getBoundingClientRect(),te&&pe.left+pe.width/2>P||!ne&&!te&&pe.top+pe.height/2>G||ne&&pe.left+pe.width>P&&pe.top+pe.height>G)return ge;return null}function Ce(){var de=$.getBoundingClientRect();if(ne){var Se=G-de.top,ge=P-de.left,pe=de.bottom-G,U=de.right-P,J=Math.min(ge,U,Se,pe),he;return se?he=U<ge:he=pe===J||U===J||ge===J,Me(he)}return Me(te?P>de.left+L(de)/2:G>de.top+R(de)/2)}function Me(de){return de?C($):$}}function Ft(v,$){return typeof D.copy=="boolean"?D.copy:D.copy(v,$)}}function m(g){const z=Array.from(window.scrollContainerList);if(z.length===1){const y=Array.from(window.scrollContainerList)[0];return document.getElementById(y)}const Y=f(z);for(const y of Y)if(y.contains(g))return y;return null}function f(g){const z=[];return g.forEach(Y=>{const y=document.getElementById(Y);y&&z.push(y)}),z.sort((Y,y)=>Y.contains(y)?1:y.contains(Y)?-1:0),z}function h(g,z,Y,y){var w={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},_={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?u[z](g,B[Y],y):s.navigator.msPointerEnabled?u[z](g,_[Y],y):(u[z](g,w[Y],y),u[z](g,Y,y))}function b(g){if(g.touches!==void 0)return g.touches.length;if(g.which!==void 0&&g.which!==0)return g.which;if(g.buttons!==void 0)return g.buttons;var z=g.button;if(z!==void 0)return z&1?1:z&2?3:z&4?2:0}function j(g,z,Y){g=g||{};var y=g.className||"",w;return g.className+=" gu-hide",w=l.elementFromPoint(z,Y),g.className=y,w}function I(){return!1}function k(){return!0}function L(g){return g.width||g.right-g.left}function R(g){return g.height||g.bottom-g.top}function S(g){return g.parentNode===l?null:g.parentNode}function E(g){return g.tagName==="INPUT"||g.tagName==="TEXTAREA"||g.tagName==="SELECT"||N(g)}function N(g){return!g||g.contentEditable==="false"?!1:g.contentEditable==="true"?!0:N(S(g))}function C(g){return g.nextElementSibling||z();function z(){var Y=g;do Y=Y.nextSibling;while(Y&&Y.nodeType!==1);return Y}}function A(g){return g.targetTouches&&g.targetTouches.length?g.targetTouches[0]:g.changedTouches&&g.changedTouches.length?g.changedTouches[0]:g}function q(g,z){var Y=A(z),y={pageX:"clientX",pageY:"clientY"};return g in y&&!(g in Y)&&y[g]in Y&&(g=y[g]),Y[g]}o.exports=d}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(a,u){return Array.prototype.slice.call(a,u)}},{}],4:[function(t,o,r){var s=t("ticky");o.exports=function(u,c,l){u&&s(function(){u.apply(l||null,c||[])})}},{ticky:10}],5:[function(t,o,r){var s=t("atoa"),a=t("./debounce");o.exports=function(c,l){var p=l||{},d={};return c===void 0&&(c={}),c.on=function(m,f){return d[m]?d[m].push(f):d[m]=[f],c},c.once=function(m,f){return f._once=!0,c.on(m,f),c},c.off=function(m,f){var h=arguments.length;if(h===1)delete d[m];else if(h===0)d={};else{var b=d[m];if(!b)return c;b.splice(b.indexOf(f),1)}return c},c.emit=function(){var m=s(arguments);return c.emitterSnapshot(m.shift()).apply(this,m)},c.emitterSnapshot=function(m){var f=(d[m]||[]).slice(0);return function(){var h=s(arguments),b=this||c;if(m==="error"&&p.throws!==!1&&!f.length)throw h.length===1?h[0]:h;return f.forEach(function(I){p.async?a(I,h,b):I.apply(b,h),I._once&&c.off(m,I)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(s){var a=t("custom-event"),u=t("./eventmap"),c=s.document,l=m,p=h,d=[];s.addEventListener||(l=f,p=b),o.exports={add:l,remove:p,fabricate:j};function m(S,E,N,C){return S.addEventListener(E,N,C)}function f(S,E,N){return S.attachEvent("on"+E,k(S,E,N))}function h(S,E,N,C){return S.removeEventListener(E,N,C)}function b(S,E,N){var C=L(S,E,N);if(C)return S.detachEvent("on"+E,C)}function j(S,E,N){var C=u.indexOf(E)===-1?q():A();S.dispatchEvent?S.dispatchEvent(C):S.fireEvent("on"+E,C);function A(){var g;return c.createEvent?(g=c.createEvent("Event"),g.initEvent(E,!0,!0)):c.createEventObject&&(g=c.createEventObject()),g}function q(){return new a(E,{detail:N})}}function I(S,E,N){return function(A){var q=A||s.event;q.target=q.target||q.srcElement,q.preventDefault=q.preventDefault||function(){q.returnValue=!1},q.stopPropagation=q.stopPropagation||function(){q.cancelBubble=!0},q.which=q.which||q.keyCode,N.call(S,q)}}function k(S,E,N){var C=L(S,E,N)||I(S,E,N);return d.push({wrapper:C,element:S,type:E,fn:N}),C}function L(S,E,N){var C=R(S,E,N);if(C){var A=d[C].wrapper;return d.splice(C,1),A}}function R(S,E,N){var C,A;for(C=0;C<d.length;C++)if(A=d[C],A.element===S&&A.type===E&&A.fn===N)return C}}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(s){var a=[],u="",c=/^on/;for(u in s)c.test(u)&&a.push(u.slice(2));o.exports=a}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(s){var a=s.CustomEvent;function u(){try{var c=new a("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=u()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(l,p){var d=document.createEvent("CustomEvent");return p?d.initCustomEvent(l,p.bubbles,p.cancelable,p.detail):d.initCustomEvent(l,!1,!1,void 0),d}:function(l,p){var d=document.createEventObject();return d.type=l,p?(d.bubbles=!!p.bubbles,d.cancelable=!!p.cancelable,d.detail=p.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof Ee<"u"?Ee:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var s=o.exports={},a,u;function c(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=c}catch{a=c}try{typeof clearTimeout=="function"?u=clearTimeout:u=l}catch{u=l}})();function p(R){if(a===setTimeout)return setTimeout(R,0);if((a===c||!a)&&setTimeout)return a=setTimeout,setTimeout(R,0);try{return a(R,0)}catch{try{return a.call(null,R,0)}catch{return a.call(this,R,0)}}}function d(R){if(u===clearTimeout)return clearTimeout(R);if((u===l||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(R);try{return u(R)}catch{try{return u.call(null,R)}catch{return u.call(this,R)}}}var m=[],f=!1,h,b=-1;function j(){!f||!h||(f=!1,h.length?m=h.concat(m):b=-1,m.length&&I())}function I(){if(!f){var R=p(j);f=!0;for(var S=m.length;S;){for(h=m,m=[];++b<S;)h&&h[b].run();b=-1,S=m.length}h=null,f=!1,d(R)}}s.nextTick=function(R){var S=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)S[E-1]=arguments[E];m.push(new k(R,S)),m.length===1&&!f&&p(I)};function k(R,S){this.fun=R,this.array=S}k.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function L(){}s.on=L,s.addListener=L,s.once=L,s.off=L,s.removeListener=L,s.removeAllListeners=L,s.emit=L,s.prependListener=L,s.prependOnceListener=L,s.listeners=function(R){return[]},s.binding=function(R){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(R){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(t,o,r){(function(s){var a=typeof s=="function",u;a?u=function(c){s(c)}:u=function(c){setTimeout(c,0)},o.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(s,a){var u=t("process/browser.js").nextTick,c=Function.prototype.apply,l=Array.prototype.slice,p={},d=0;r.setTimeout=function(){return new m(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new m(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function m(f,h){this._id=f,this._clearFn=h}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(f,h){clearTimeout(f._idleTimeoutId),f._idleTimeout=h},r.unenroll=function(f){clearTimeout(f._idleTimeoutId),f._idleTimeout=-1},r._unrefActive=r.active=function(f){clearTimeout(f._idleTimeoutId);var h=f._idleTimeout;h>=0&&(f._idleTimeoutId=setTimeout(function(){f._onTimeout&&f._onTimeout()},h))},r.setImmediate=typeof s=="function"?s:function(f){var h=d++,b=arguments.length<2?!1:l.call(arguments,1);return p[h]=!0,u(function(){p[h]&&(b?f.apply(null,b):f.call(null),r.clearImmediate(h))}),h},r.clearImmediate=typeof a=="function"?a:function(f){delete p[f]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(mn);const hn={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}},yn={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},gt=n.defineComponent({name:"Toast",props:yn,emits:["close","click"],setup:(i,e)=>{const t=n.ref(i.animate),o="fadeOut",r=n.computed(()=>i.options),s=n.ref(!1),a=n.computed(()=>{const I={animated:s.value,toast:!0};return I[i.animate]=!1,I[o]=s.value,I[r.value.type]=!0,r.value.theme&&(I[r.value.theme]=!0),I}),u=n.computed(()=>{const L=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,R={"f-icon":!0};return R[L]=!0,R}),c=n.computed(()=>r.value.title||r.value.message),l=n.computed(()=>r.value.title&&r.value.message),p=n.computed(()=>!r.value.title&&r.value.message),d=n.computed(()=>i.showCloseButton),m=n.computed(()=>!!r.value.buttons||!!e.slots.default);function f(I){I.stopPropagation(),I.preventDefault(),s.value=!1,setTimeout(()=>{e.emit("close",r.value)},200)}function h(I,k){}function b(I){return`f-preten-link ${I.customClass?I.customClass:""}`}n.watch(t,()=>{t.value});const j=()=>{var I;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((I=r.value.buttons)==null?void 0:I.map(k=>n.createVNode("span",{class:b(k),onClick:L=>void 0},[k.text]))),e.slots.default&&e.slots.default()])])};return()=>n.createVNode("div",{class:a.value,style:"min-height:44px"},[d.value&&n.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:f},[n.createVNode("span",{class:"f-icon modal_close"},null)]),c.value&&n.createVNode("section",{class:"modal-tips"},[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:u.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[l.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),m.value&&j()]),p.value&&(r.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[j()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),st=n.defineComponent({name:"Notify",props:hn,emits:["close","empty"],setup(i,e){const t=n.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=n.ref(),s=n.ref(i.options),a=n.ref(i.showCloseButton),u=n.computed(()=>i.position||"bottom-right"),c=n.computed(()=>i.timeout!=null?i.timeout:3e3),l=n.computed(()=>{const m=i.bottom?i.bottom:o.bottom,f=i.top?i.top:o.top,h={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${i.left?i.left:o.left}px`:"",right:u.value.indexOf("right")>-1?`${i.right?i.right:o.right}px`:"",top:u.value.indexOf("top")>-1?`${f}px`:"",bottom:u.value.indexOf("bottom")>-1?`${m}px`:""};return u.value.indexOf("center")>-1&&(h.left="50%",h.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(h.top="50%",h.transform="translate(-50%, -50%)")),h});function p(m){e.emit("close")}c.value&&setTimeout(()=>{p()},c.value),e.expose({closeToast:p,container:r,notifyPosition:u});function d(m,f){p()}return()=>n.createVNode("div",{class:t.value,style:l.value,ref:r},[n.createVNode(gt,{options:s.value,showCloseButton:a.value,animate:i.animate,onClose:m=>d(m,s.value)},null)])}});class gn{constructor(){H(this,"notifyRefs",[]);H(this,"globalConfig",n.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),s=document.createElement("div");s.style.display="contents";const a=n.createApp({setup(){var l;const u=n.ref();function c(){u.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,u),a.unmount()},220)}if(r.position.indexOf("top")>-1){const p=t.getNotifyInstances(r.position),d=p[p.length-1];if(d){const m=d.value.container.getBoundingClientRect();r.top=m.bottom}}return r.safeHtml&&((l=r.options)!=null&&l.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),n.onUnmounted(()=>{document.body.removeChild(s)}),n.onMounted(()=>{t.updateNotifyPositionForCreate(r,u)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(st,n.mergeProps({ref:u},r,{onClose:c}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.mount(s),a}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),s=r.indexOf(t);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",s,a,u;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",a=t.position||null,u=t.showCloseButton!=null?t.showCloseButton:null,s=t.timeout!=null?t.timeout:null);const l={options:{type:e,message:o,title:r}};return a!=null&&(l.position=a),u!=null&&(l.showCloseButton=u),s!=null&&(l.timeout=s),l}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const vn=Symbol("NOTIFY_SERVICE_TOKEN");st.install=i=>{i.component(st.name,st),i.component(gt.name,gt);const e=new gn;i.provide(vn,e),i.provide("FNotifyService",e)};const qt=new Map([["appearance",ve.resolveAppearance],["column","columnOption"]]);function bn(i,e,t){var d;const o=t.parentComponentInstance,r=o.schema.type,s=String(((d=o.schema.appearance)==null?void 0:d.class)||"").split(" "),a=r==="section"||r==="tab-page",u=s.includes("f-page-content-nav"),c=s.includes("f-page-main"),l=i.getSchemaByType("component");l.id=`${e.id}-component`,l.componentType="data-grid";let p="";return p+=a?"f-struct-data-grid-in-card f-struct-is-subgrid":"",p+=u?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",p+=c?"f-struct-data-grid f-struct-wrapper":"",l.appearance={class:p},l.contents=[e],l}function Cn(i,e,t){const o=t.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),s=r.includes("f-page-content-nav"),a=r.includes("f-page-main"),u=i.getSchemaByType("section");u.id=`${e.id}-section`;let c="";return c+=s?"f-section-in-nav ":"",c+=a?"f-section-in-managelist ":"",c+="f-section-grid",u.appearance={class:c},u.contents=[e],u}function wn(i,e,t){const o=i.getSchemaByType("content-container");return o.id=`${e.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[e],o}function At(i,e,t){const r=t.parentComponentInstance.schema.type,s=r==="section"||r==="tab-page";e.appearance={class:"f-component-grid"};const u=(s?wn:Cn)(i,e,t);return bn(i,u,t)}const Ut={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",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:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},vt={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},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:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},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}};ve.createPropsResolver(vt,Ut,qt,At),ve.createTreeGridSelectionItemResolver(),ve.createTreeGridBindingResolver();const xn=Object.assign({},vt,{componentId:{type:String,default:""}});ve.createPropsResolver(xn,Ut,qt,At),ve.createDataViewUpdateColumnsResolver();function In(i,e,t,o,r,s,a,u,c,l,p,d,m,f,h,b,j){const{calculateCellPositionInRow:I}=s,{columnContext:k,hasLeftFixedColumn:L,hasRightFixedColumn:R}=a,{gridDataStyle:S,leftFixedGridDataStyle:E,rightFixedGridDataStyle:N}=f,{renderDataRow:C}=K.getHierarchyRow(i,e,k,j,u,c,l,p,d,m,f,h,b),A=[C];function q(w,B){const _=I(w);return j.value.filter(x=>x.visible!==!1).map((x,T)=>A[x.type](x,_,B,T))}function g(){return n.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:E.value},[q(k.value.leftColumns.filter(w=>w.visible),"left")])])}function z(){return n.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:S.value},[q(k.value.primaryColumns.filter(w=>w.visible),"primary")])])}function Y(){return n.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:N.value},[q(k.value.rightColumns.filter(w=>w.visible),"right")])])}function y(){const w=[];return L.value&&w.push(g()),w.push(z()),R.value&&w.push(Y()),w}return{renderDataArea:y}}const Tn=n.defineComponent({name:"FTreeGrid",props:vt,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(i,e){var ge,pe;const o=((ge=i.rowOption)==null?void 0:ge.height)||28,r=n.ref(20),s=n.ref(i.columns),a=K.useIdentify(i),{idField:u}=a,c=n.ref(),l=n.ref(),p=n.ref(),d=n.ref(),m=n.ref(),f=n.ref([]),h=n.ref(!1),b=n.ref(((pe=i.rowOption)==null?void 0:pe.wrapContent)||!1),j=K.useGroupData(i,a),I=K.useFilter(),k=K.useHierarchy(i),{collapseField:L}=k,{showLoading:R,renderLoading:S}=K.useLoading(i,c),E=K.useDataView(i,new Map,I,k,a),{dataView:N}=E,C=K.useSelection(i,E,a,f,e),A=K.useSelectHierarchyItem(i,f,E,a,C,e),q=n.computed(()=>i.disabled),g=n.computed(()=>i.virtualized?Math.min(E.dataView.value.length,r.value):E.dataView.value.length),{containerStyleObject:z}=K.useDataViewContainerStyle(i),Y=K.useCommandColumn(i),{applyCommands:y}=Y;y(s);const w=K.useColumn(i),B=K.useSort(i),{applyColumnSorter:_,columnContext:x,updateColumnRenderContext:T}=w;_(E,B);const O=K.useGroupColumn(i,x),M=K.useRow(i,e,C,a),V=K.useEdit(i,e,a,M,f),X=K.useVisualDataBound(i),ee=K.useVisualDataCell(i,V,X),W=K.useVisualDataRow(i,E,V,k,a,X,ee),se=K.useVisualData(i,s,E,g,0,W),{getVisualData:re}=se,Q=K.useCellPosition(i,x),D=K.useSidebar(i,C),{sidebarWidth:oe}=D,ue=K.useVirtualScroll(i,E,f,x,se,g,0,oe),{onWheel:Ae,dataGridWidth:Be,viewPortHeight:Fe,viewPortWidth:Ve,resetScroll:ke,updateVisibleRowsOnLatestVisibleScope:De}=ue,$e=K.useFitColumn(i,x,l,Ve,O),{calculateColumnsSize:Te}=$e,Ue=K.useFilterHistory(),Je=K.useColumnFilter(l,m,E,Ue,ue),ze=K.useDragColumn(i,e,w,E,O,j,ue),Qe=n.computed(()=>({"fv-grid":!0,"fv-grid-bordered":i.showBorder,"fv-grid-horizontal-bordered":i.showHorizontalLines,"fv-datagrid-strip":i.showStripe})),Ge=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":h.value,"fv-grid-wrap-content":b.value})),{renderDataArea:_e}=In(i,e,p,d,m,Q,w,E,V,k,M,C,A,ue,se,X,f),{renderGridHeader:F,renderGridColumnResizeOverlay:Z,shouldShowHeader:ae}=K.getColumnHeader(i,e,l,d,m,w,E,ze,Je,I,Ue,$e,O,C,D,B,ue,Ve,f),{renderDataGridSidebar:be}=K.getSidebar(i,M,C,D,ue),{renderDisableMask:je}=K.getDisableMask(),{renderHorizontalScrollbar:Ze}=K.getHorizontalScrollbar(i,l,ue),{renderVerticalScrollbar:lt}=K.getVerticalScrollbar(i,l,ue);function Ke(){var U,J,he;if(l.value&&l.value.clientHeight>0&&((U=l.value)==null?void 0:U.clientWidth)>0){const we=Math.ceil(l.value.clientHeight/o);we>r.value&&(r.value=we,De()),Fe.value=((J=p.value)==null?void 0:J.clientHeight)||0,Be.value=((he=l.value)==null?void 0:he.clientWidth)||0,Te()}}n.onMounted(()=>{l.value&&(r.value=Math.max(Math.ceil(l.value.clientHeight/o),r.value),f.value=re(0,g.value+0-1),Qt.useResizeObserver(l.value,Ke),Te(),n.nextTick(()=>{l.value&&(Be.value=l.value.clientWidth),p.value&&(Ve.value=p.value.clientWidth,Fe.value=p.value.clientHeight)})),R.value&&S()}),n.onUnmounted(()=>{}),n.watch(Ve,()=>{l.value&&Te()});function wt(U){E.collapseTo(U),E.reOrderVisibleIndex(),ke()}function xt(U){E.expandTo(U),E.reOrderVisibleIndex(),ke()}function et(){const U=C.getSelectionRow();return U?U.dataIndex-1:-1}function It(){const U=et();E.insertNewDataItem(U),f.value=re(0,g.value+0-1)}function Tt(){const U=et();E.insertNewChildDataItem(U),f.value=re(0,g.value+0-1)}function Mt(){const U=et(),J=A.getNextSelectableHierarchyItemId(U);E.removeHierarchyDataItem(U),f.value=re(0,g.value+0-1),J&&C.selectItemById(J)}function St(U){V.onEditingRow(U)}function ct(U){V.acceptEditingRow(U)}function jt(U){V.cancelEditingRow(U)}function ut(U){U&&(s.value=U,y(s),T(s.value),_(E,B),Te())}n.watch(()=>i.columns,U=>{ut(U)});function Et(U,J){U&&(E.load(U),E.reOrderVisibleIndex(),J!=null&&J.keepScrollPosition?ue.scrollTo(ue.offsetY.value):ke())}function Nt(U){C.selectItemById(U)}function Bt(U){const J=f.value.find(he=>he.raw[a.idField.value]===U);J&&M.clickRowItem(J)}function dt(U){M.activeRowById(U)}function Ft(U){C.selectItemByIds(U)}function v(){return C.getSelectedItems()}function $(){C.clearSelection()}const P=n.computed(()=>!f.value||!f.value.length),{renderEmpty:G}=K.getEmpty(e);function te(){return C.getSelectionRow()}function ne(U){C.unSelectItemByIds(U)}function xe(){return C.currentSelectedDataId.value}function ye(U,J,he){const we=N.value.find(Ie=>Ie[u.value]===U);if(we){if(Object.keys(we).forEach(fe=>{Object.prototype.hasOwnProperty.call(J,fe)&&(we[fe]=J[fe])}),he){const{collapseField:fe,disabledField:Pe,checkedField:Re,visibleField:qe}=he;fe&&!le.isUndefined(J[fe])&&(we.__fv_collapse__=J[fe]),Re&&!le.isUndefined(J[Re])&&(we.__fv_checked__=J[Re]),Pe&&!le.isUndefined(J[Pe])&&(we.__fv_disabled__=J[Pe]),qe&&!le.isUndefined(J[qe])&&(we.__fv_visible__=J[qe])}const Ie=f.value.find(fe=>fe.raw[u.value]===U),Jt=f.value.findIndex(fe=>fe.raw[u.value]===U);if(Ie){if(Ie.raw=we,Object.keys(Ie.data).forEach(fe=>{Ie.data[fe].updateData(we)}),he){const{collapseField:fe,disabledField:Pe,checkedField:Re,visibleField:qe}=he;fe&&!le.isUndefined(J[fe])&&(Ie.collapse=J[fe]),Re&&!le.isUndefined(J[Re])&&(Ie.checked=J[Re]),Pe&&!le.isUndefined(J[Pe])&&(Ie.disabled=J[Pe]),qe&&!le.isUndefined(J[qe])&&(Ie.visible=J[qe])}f.value=[...f.value.slice(0,Jt),Ie,...f.value.slice(Jt+1)]}}}function Ce(U){const J=E.dataView.value.find(he=>he[u.value]===U);return J?J[L.value]:""}function Me(){return L.value}e.expose({activeRowById:dt,addNewDataItem:It,addNewChildDataItem:Tt,collapseTo:wt,expandTo:xt,removeDataItem:Mt,editDataItem:St,acceptDataItem:ct,cancelDataItem:jt,updateColumns:ut,updateDataSource:Et,selectItemById:Nt,selectItemByIds:Ft,getSelectedItems:v,clearSelection:$,getSelectionRow:te,clickRowItemById:Bt,unSelectItemByIds:ne,getCurrentRowId:xe,reassignRowData:ye,getCollapseField:Me,getCollapseStatusById:Ce});const de=n.computed(()=>{const U={};return ue.shouldShowHorizontalScrollbar.value&&(U.paddingBottom="10px"),ue.shouldShowVirticalScrollbar.value&&(U.paddingRight="10px"),U}),Se=n.computed(()=>({...z.value,borderRadius:"5px"}));return()=>n.createVNode("div",{ref:c,class:Qe.value,style:Se.value,onWheel:Ae},[l.value&&ae.value&&F(),n.createVNode("div",{ref:l,class:Ge.value,onMouseover:()=>h.value=!0,onMouseleave:()=>h.value=!1,style:de.value},[l.value&&be(f),l.value&&_e(),l.value&&P.value&&G(),l.value&&Ze(),l.value&&lt()]),Z(),q.value&&je()])}});We.withInstall(Tn);const Mn=new Map([["appearance",ft]]);function Sn(i,e,t){return e}Xe({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"]},Mn,Sn,{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 bt=new Map([["appearance",ft]]),jn=new Map([]),En="root-viewmodel";class Nn{constructor(e,t){H(this,"formSchemaUtils");H(this,"controlCreatorUtils");H(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:s}=e;s==null||s.forEach(u=>{const c=le.cloneDeep(u),l=this.resolveControlClassByFormColumns(e),p=this.controlCreatorUtils.setFormFieldProperty(c,"",l);p&&r.push(p)});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:En,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{let s="blur";const a=r.type.name;(a===We.FormSchemaEntityFieldTypeName.Enum||a===We.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}),t}}function Bn(i,e,t,o){var s,a,u,c,l,p;const r=t.parentComponentInstance;if(r&&o){const d=(s=r.schema)==null?void 0:s.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=t.bindingSourceContext)==null?void 0:a.entityTitle)||((c=(u=t.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:c.name)||"标题",componentType:"form",formColumns:d==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((l=t.bindingSourceContext)==null?void 0:l.bindTo)||"/",selectedFields:(p=t.bindingSourceContext)==null?void 0:p.bindingEntityFields};return new Nn(i,o).createComponent(f)}else return e}function Fn(i,e,t){return e}Xe({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{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}},required:["id","type","contents"]},bt,Bn);const zt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input 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:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Vn={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}};ve.createPropsResolver(Vn,zt,bt,void 0),ve.createFormGroupEditorResolver();function kn(){function i(e,t){var a;if(!e)return!1;const o=((a=e.targetContainer)==null?void 0:a.componentInstance)&&e.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,s=t==null?void 0:t.formSchemaUtils.getComponentById(o.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![me["response-layout-item"].type,me["response-form"].type,me.fieldset.type].includes(r)||(e.componentType===me.tabs.type||e.componentType===me.section.type)&&((s==null?void 0:s.componentType)!=="frame"||![me["content-container"].type,me["splitter-pane"].type,me["response-layout-item"].type].includes(r))||e.componentType===me["query-solution"].type||e.componentType===me.fieldset.type&&r!==me["response-form"].type)}return{basalDragulaRuleForContainer:i}}class $n{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),s={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return s;const a=this.getComponentContext(e),{componentClassList:u}=a;return u.forEach(c=>{if(!c||!r[c])return;const{canMove:l,canDelete:p,canAccept:d}=r[c];s.canMove=s.canMove&&this.resolveRuleValue(l,a),s.canDelete=s.canDelete&&this.resolveRuleValue(p,a),s.canAccept=s.canAccept&&this.resolveRuleValue(d,a)}),s}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let r=!0;for(const s of o){if(s.firstLevelChild){if(s.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(s.firstLevelChild.class)){r=!1;continue}}if(s.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==s.firstLevelChild.type){r=!1;continue}}}if(s.secondLevelChild){if(s.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(s.secondLevelChild.class)){r=!1;continue}}if(s.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==s.secondLevelChild.type){r=!1;continue}}}if(s.parent){if(s.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(s.parent.class)){r=!1;continue}}if(s.parent.type){const{parentSchema:a}=t;if(a&&a.type!==s.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,j,I,k;const t=e.schema,o=t.appearance&&t.appearance.class||"",r=o.split(" ")||[],s=t.contents||[],a=s.length?s[0]:null,u=a&&a.appearance?a.appearance.class:"",c=u?u.split(" "):[],l=(b=a==null?void 0:a.contents)!=null&&b.length?a==null?void 0:a.contents[0]:null,p=l&&l.appearance?l.appearance.class:"",d=p?p.split(" "):[],m=t.type==="component"?(I=(j=e.parent)==null?void 0:j.parent)==null?void 0:I.schema:(k=e.parent)==null?void 0:k.schema,f=m&&m.appearance&&m.appearance.class||"",h=f?f.split(" "):[];return{componentClass:o,componentClassList:r,childContents:s,firstLevelChildSchema:a,firstLevelChildClass:u,firstLevelChildClassList:c,secondLevelChildSchema:l,secondLevelChildClass:p,secondLevelChildClassList:d,parentSchema:m,parentClass:f,parentClassList:h}}}class On{constructor(){H(this,"label","");H(this,"id","");H(this,"columnInSM",12);H(this,"columnInMD",6);H(this,"columnInLG",3);H(this,"columnInEL",2);H(this,"displayWidthInSM",1);H(this,"displayWidthInMD",1);H(this,"displayWidthInLG",1);H(this,"displayWidthInEL",1);H(this,"displayColumnCountAtBreakPoint","md");H(this,"tagRow",0);H(this,"showTopBorder",0);H(this,"group",1);H(this,"isSupportedClass",!0);H(this,"fieldSetId","")}}function Ln(i){let e,t;const o=new Map;let r=[];function s(p,d){const f=p.split(" ").filter(k=>k.startsWith("col-"));if(f.length===0){d.isSupportedClass=!1;return}let h=f.find(k=>/^col-([1-9]|10|11|12)$/.test(k)),b=f.find(k=>/^col-md-([1-9]|10|11|12)$/.test(k)),j=f.find(k=>/^col-xl-([1-9]|10|11|12)$/.test(k)),I=f.find(k=>/^col-el-([1-9]|10|11|12)$/.test(k));h=h||"col-12",d.columnInSM=parseInt(h.replace("col-",""),10),d.displayWidthInSM=d.columnInSM/12,d.displayWidthInSM!==1&&(d.isSupportedClass=!1),b=b||"col-md-"+d.columnInSM,d.columnInMD=parseInt(b.replace("col-md-",""),10),d.displayWidthInMD=d.columnInMD/6,[1,2].includes(d.displayWidthInMD)||(d.isSupportedClass=!1),j=j||"col-xl-"+d.columnInMD,d.columnInLG=parseInt(j.replace("col-xl-",""),10),d.displayWidthInLG=d.columnInLG/3,[1,2,3,4].includes(d.displayWidthInLG)||(d.isSupportedClass=!1),I=I||"col-el-"+d.columnInLG,d.columnInEL=parseInt(I.replace("col-el-",""),10),d.displayWidthInEL=d.columnInEL/2,[1,2,3,4,5,6].includes(d.displayWidthInEL)||(d.isSupportedClass=!1)}function a(p,d,m,f=!1){let h=!1;p.contents.forEach(b=>{if(b.type==="fieldset"){m+=1,a(b,d,m,!0),h=!0;return}h&&(m+=1,h=!1);const j=b.appearance&&b.appearance.class,I=new On;j?s(j,I):I.isSupportedClass=!1,I.label=b.label||b.id,I.id=b.id,I.group=m,f&&(I.fieldSetId=p.id),t===b.id&&(e=m),o.set(b.id,b),d.push(I)})}function u(p){const d=i.getComponentById(p);if(!d||!d.componentType||!d.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const m=i.selectNode(d,f=>f.type===He.DgControl["response-form"].type);return!m||!m.contents||m.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:m}}function c(p,d){d=d||p.id;const{result:m,message:f,formNode:h}=u(d);if(!m)return{result:m,message:f};t=p.id,r=[],o.clear();const b=h.contents[0].type===He.DgControl.fieldset.type?0:1;a(h,r,b);const j=r.find(k=>!k.isSupportedClass);return{defaultState:{defaultGroupNumber:e||1,model:j?"customize":"standard"},importData:r}}function l(p,d){d=d;const{result:m,formNode:f}=u(d);if(!m)return"";const h=[];return p.forEach(b=>{var k;const j=o.get(b.id),I=j.appearance&&j.appearance.class;if(I){const R=I.split(" ").filter(q=>!q.startsWith("col-")),S="col-"+b.columnInSM,E="col-md-"+b.columnInMD,N="col-xl-"+b.columnInLG,C="col-el-"+b.columnInEL,A=[S,E,N,C].concat(R);j.appearance.class=A.join(" ")}if(b.fieldSetId){const L=f.contents.find(S=>S.id===b.fieldSetId),R=h.find(S=>S.id===b.fieldSetId);R?(k=R.contents)==null||k.push(j):(h.push(L),L.contents=[j])}else h.push(j)}),f.contents=h,f.id}return{checkCanFindFormNode:u,checkCanOpenLayoutEditor:c,changeFormControlsByResponseLayoutConfig:l,getResonseFormLayoutConfig:a}}function Dn(i,e){function t(c,l=null){if(l)return l;const p=i.getComponentById(e);return i.selectNode(p,d=>d.id===c)}function o(c){const l=i.getComponentById(c);return!(!l||!l.componentType||!l.componentType.startsWith("form"))}function r(c){const l=new Set(c);return Array.from(l).length===1}function s(c){const l=t(c.id),p=Ln(i),d=[];p.getResonseFormLayoutConfig(l,d,1);const m=d.map(R=>R.columnInSM),f=d.map(R=>R.columnInMD),h=d.map(R=>R.columnInLG),b=d.map(R=>R.columnInEL),j=r(m)?m[0]:0,I=r(f)?f[0]:0,k=r(h)?h[0]:0,L=r(b)?b[0]:0;return{uniqueColClassInSM:j,uniqueColClassInMD:I,uniqueColClassInLG:k,uniqueColClassInEL:L}}function a(c,l){let p,d,m,f,h=[];if(c){const R=c.split(" "),S=R.filter(E=>E.startsWith("col-"));p=S.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),d=S.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),m=S.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),f=S.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E)),h=R.filter(E=>!E.startsWith("col-"))}const b=l.uniqueColClassInSM?"col-"+l.uniqueColClassInSM:p,j=l.uniqueColClassInMD?"col-md-"+l.uniqueColClassInMD:d,I=l.uniqueColClassInLG?"col-xl-"+l.uniqueColClassInLG:m,k=l.uniqueColClassInEL?"col-el-"+l.uniqueColClassInEL:f;return[b,j,I,k].concat(h).join(" ")}function u(c,l,p){c=t(p,c),c.contents.forEach(d=>{if(d.type===He.DgControl.fieldset.type){u(d,l,d.id);return}d.appearance||(d.appearance={});const m=d.appearance.class;d.appearance.class=a(m,l)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:s,changeFormControlsByUnifiedLayoutConfig:u}}class Pn extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e,t){const o=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(e);const{checkIsInFormComponent:r,assembleUnifiedLayoutContext:s,changeFormControlsByUnifiedLayoutConfig:a}=Dn(this.formSchemaUtils,this.componentId),u=this.getAppearanceConfig(e),c=r(this.componentId);return u.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",visible:c,type:"boolean"},u.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:c,refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:s(e)}},u.setPropertyRelates=function(l,p){if(l)switch(l&&l.propertyID){case"unifiedLayout":{a(null,l.propertyValue,e.id),o.updateElementByParentContainer(e.id,t);break}case"labelAutoOverflow":{o.setLabelAutoOverflow(e,l.propertyValue);break}}},this.propertyConfig.categories.appearance=u,this.propertyConfig.categories.behavior=this.getBehaviorConfig(e),this.propertyConfig}setLabelAutoOverflow(e,t){const o=this.formSchemaUtils.getComponentById(this.componentId),r=this.formSchemaUtils.selectNode(o,s=>s.id===e.id);r&&r.contents&&r.contents.length&&(r.contents.forEach(s=>{s.appearance||(s.appearance={class:""}),s.appearance.class||(s.appearance.class=""),t?s.appearance.class.includes("farris-group-multi-label")||(s.appearance.class=s.appearance.class+" farris-group-multi-label"):s.appearance.class=s.appearance.class.replace("farris-group-multi-label","").trim()}),Rt())}}function Gt(i,e){const t=i.schema,o=new $n,{canMove:r,canAccept:s,canDelete:a}=o.getTemplateRule(i,e);function u(y,w){const{sourceElement:B}=y,{componentInstance:_}=B,x=e==null?void 0:e.formSchemaUtils;if(!x)return!0;const T=x.getComponentById(_.value.belongedComponentId),O=x.getViewModelById(T.viewModel),M=x.getComponentById(i.componentInstance.value.belongedComponentId),V=x.getViewModelById(M.viewModel);return w?O!=null&&O.id&&(V!=null&&V.id)&&O.id!==V.id?O.bindTo===V.bindTo:!0:(O==null?void 0:O.id)===(V==null?void 0:V.id)}function c(y){const{bindingTargetId:w}=y;if(!e)return;const{formSchemaUtils:B,schemaService:_}=e,x=B.getComponentById(i.componentInstance.value.belongedComponentId),T=_.getFieldByIDAndVMID(w,x.viewModel);return!!(T!=null&&T.schemaField)}function l(y){const w=o.getComponentContext(i);if(w&&w.componentClassList&&w.componentClassList.includes("f-form-layout")&&w.componentClassList.includes("farris-form")){if(y.sourceType==="control"&&(y.componentCategory==="input"||y.componentType==="fieldset"))return!0;if(y.sourceType==="move"){if(y.componentType==="form-group")return u(y,!0);if(y.componentType==="fieldset")return u(y,!1)}return y.sourceType==="field"&&y.componentCategory==="input"?c(y):!1}return!0}function p(y){return!(!kn().basalDragulaRuleForContainer(y,e)||!s||!l(y))}function d(y){var V;const w=y.componentInstance,B=w.value.schema,_=e==null?void 0:e.formSchemaUtils,x=e==null?void 0:e.designViewModelUtils,T=_.getViewModelIdByComponentId(w.value.belongedComponentId),O=x.getDgViewModel(T),M=w.value.parent;if(M&&He.DgControl.fieldset&&((V=M.schema)==null?void 0:V.type)===He.DgControl.fieldset.type&&O){const X={groupId:null,groupName:null};switch(B.binding.type){case Oe.FormBindingType.Form:{O.changeField(B.binding.field,X);break}case Oe.FormBindingType.Variable:{_.modifyViewModelFieldById(T,B.binding.field,X,!0);break}}}}function m(y,w,B){const _=w.fields.find(V=>V.id===y),x=e==null?void 0:e.designViewModelUtils,T=x.getDgViewModel(w.id),O=T.fields.find(V=>V.id===y);T.removeField([y]);const M=x.getDgViewModel(B);M.addField(O),_.fieldSchema&&M.changeField(O.id,_.fieldSchema)}function f(y,w,B,_=[]){const x=w.id,T=y.binding.field,O=w.fields.findIndex(V=>V.id===T);if(O>-1&&(B.fields.push(w.fields[O]),w.fields.splice(O,1)),x==="root-viewmodel"&&B.id!=="root-viewmodel"){y.binding.path&&!y.binding.path.includes("root-component.")&&(y.binding.path="root-component."+y.binding.path);return}if(B.id==="root-viewmodel"&&x!=="root-viewmodel"&&y.binding.path&&y.binding.path.includes("root-component.")){y.binding.path=y.binding.path.replace("root-component.","");return}const M=w.states.find(V=>V.id===T);M&&(B.states=B.states?B.states:[],B.states.findIndex(V=>V.id===M.id)<0&&(B.states.push(M),_.push(M.id)))}function h(y,w,B,_=[]){var O;if(!y)return;const x=w.id==="root-viewmodel"&&B.id!=="root-viewmodel",T=B.id==="root-viewmodel"&&w.id!=="root-viewmodel";Object.keys(y).forEach(M=>{if(M==="binding")return;const V=y[M];if(V&&typeof V=="object"&&V.type===Oe.FormBindingType.Variable&&V.field){if(x){V.path&&!V.path.includes("root-component.")&&(V.path="root-component."+V.path);return}if(T&&V.path&&V.path.includes("root-component.")){V.path=V.path.replace("root-component.","");return}const X=w.states.find(ee=>ee.id===V.field);if(X){_.push(X.id),B.states=B.states?B.states:[];const ee=B.states.find(W=>W.code===X.code);if(ee)V.field=ee.id;else{const W=Object.assign({},{newId:We.useGuid().guid()},X);B.states.push(W),V.field=W.newId}}}}),(O=B.states)!=null&&O.length&&B.states.map(M=>{M.newId&&(M.id=M.newId,delete M.newId)})}function b(y,w,B){if(y&&(w(y,B),y.contents))for(const _ of y.contents)b(_,w,B)}function j(y=[],w){if(!y.length)return;const B=e==null?void 0:e.formSchemaUtils,_=B.getComponentByViewModelId(w),x=[],T=(M,V)=>{M&&(Object.keys(M).forEach(X=>{const ee=M[X];ee&&typeof ee=="object"&&ee.type===Oe.FormBindingType.Variable&&y.includes(ee.field)&&!V.includes(ee.field)&&V.push(ee.field)}),M.editor&&T(M.editor,V))};b(_,T,x);const O=B.getViewModelById(w);y.forEach(M=>{x.includes(M)||(O.states=O.states.filter(V=>V.id!==M))})}function I(y){const w=We.useGuid().guid(),B=Object.assign({},y,{id:w,code:y.code+w.slice(0,4),name:y.name+w.slice(0,4)}),T=(e==null?void 0:e.formSchemaUtils).getCommands().find(O=>O.id===y.cmpId);return T&&T.refedHandlers.push({host:w,handler:y.handlerName}),B}function k(y,w,B){var X,ee,W;const _={},x=y.type==="form-group"&&y.editor?y.editor.type:y.type,T=(X=ve.schemaMap[x])==null?void 0:X.events;if(!T)return;Object.keys(y).forEach(se=>{const re=Object.keys(T).find(Q=>Q===se);if(re&&y[re]){const Q=w.commands.find(D=>D.code===y[re]);if(Q){let D=_[Q.code];D||(D=I(Q),_[Q.code]=D,B.commands.push(D)),y[re]=D.code}}});const M=(e==null?void 0:e.designViewModelUtils).getDgViewModel(B.id),V=["valueChanging","valueChanged"];if(((ee=y.binding)==null?void 0:ee.type)===Oe.FormBindingType.Form){const se=(W=B.fields)==null?void 0:W.find(re=>re.id===y.binding.field);se&&V.forEach(re=>{if(se[re]){const Q=w.commands.find(D=>D.code===se[re]);if(!Q)return;if(_[Q.code])M.changeField(se.id,{[re]:_[Q.code].code});else{const D=I(Q);_[Q.code]=D,B.commands.push(D),M.changeField(se.id,{[re]:D.code})}}})}}function L(y){const w=e==null?void 0:e.formSchemaUtils,B=y.componentInstance,_=B.value.schema,x=w.getViewModelIdByComponentId(B.value.belongedComponentId),T=w.getViewModelById(x),O=w.getComponentById(i.componentInstance.value.belongedComponentId),M=w.getViewModelById(O.viewModel);if(x!==M.id){const V=_.binding.type,X=_.binding.field,ee=[];switch(V){case Oe.FormBindingType.Form:{m(X,T,M.id);break}case Oe.FormBindingType.Variable:{f(_,T,M,ee);break}}h(_,T,M,ee),h(_.editor,T,M,ee),k(_,T,M),x!=="root-viewmodel"&&j(ee,x)}}function R(y){if(!y||!y.componentInstance)return;const B=y.componentInstance.value.schema;!B.binding||!B.binding.field||(d(y),L(y))}function S(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function E(y){let w="";switch(y){case 1:{w="col-12";break}case 2:{w="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{w="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{w="col-12 col-md-6 col-xl-3 col-el-2";break}}return w}function N(y){const w=i.componentInstance.value.getBelongedComponentInstance(i.componentInstance);if(w&&w.schema&&w.schema.componentType){const{formColumns:B}=w.schema;let _=E(B);_=e==null?void 0:e.formSchemaUtils.getControlClassByFormUnifiedLayout(_,w.schema.id,i.schema),y.appearance||(y.appearance={}),y.appearance.class=_}}function C(y,w,B,_){const{bindingSourceContext:x,parentComponentInstance:T}=y;if(x!=null&&x.entityFieldNode&&T){const O=e==null?void 0:e.designViewModelUtils,V=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(T.belongedComponentId),X=O.getDgViewModel(V);X.removeField([x.entityFieldNode.id]),X.addField(x.designViewModelField),w&&X.changeField(x.entityFieldNode.id,{editor:{$type:w},groupId:B,groupName:_})}}function A(y,w){var T,O,M;const B=t;if((B.appearance&&B.appearance.class||"").split(" ").includes("f-form-layout")&&y.componentCategory==="input"){const{label:V}=y;let X;return(T=y.bindingSourceContext)!=null&&T.entityFieldNode?X=(e==null?void 0:e.controlCreatorUtils).setFormFieldProperty((O=y.bindingSourceContext)==null?void 0:O.entityFieldNode,w==null?void 0:w.type):(X=ve.getSchemaByType("form-group"),X.editor=w,X.label=V),N(X),C(y,(M=X.editor)==null?void 0:M.type),X}return w}function q(){return r}function g(){return a}function z(){return!1}function Y(y){return new Pn(y,e).getPropertyConfig(t,i.componentInstance.value)}return{canAccepts:p,checkCanDeleteComponent:g,checkCanMoveComponent:q,getStyles:S,getPropsConfig:Y,hideNestedPaddingInDesginerView:z,onAcceptMovedChildElement:R,onResolveNewComponentSchema:A,moveInputBetweenComponent:L,resolveFormGroupAppearance:N,syncFieldToViewModel:C}}const Rn={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};ve.createPropsResolver(Rn,zt,bt,void 0);const qn={$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"]},An={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};ve.createPropsResolver(An,qn,jn,Fn);const Un={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Ct(){return new DOMException("The request is not allowed","NotAllowedError")}async function zn(i){if(!navigator.clipboard)throw Ct();return navigator.clipboard.writeText(i)}async function Gn(i){const e=document.createElement("span");e.textContent=i,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw Ct()}async function _n(i){try{await zn(i)}catch(e){try{await Gn(i)}catch(t){throw t||e||Ct()}}}function Wn(){async function i(e){await _n(e)}return{onCopy:i}}function Hn(i,e,t,o){const r=n.ref(14),s=n.ref(140),a=n.ref(""),u=n.ref(o.value.length),c=n.computed(()=>o.value),l=n.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function p(d){if(d.currentTarget){const m=d.currentTarget.value||"";u.value=m.length}}return()=>n.createVNode(n.Fragment,null,[n.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:l.value,rows:"4",maxlength:s.value,onInput:d=>p(d)},[c.value]),n.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+s.value])])}function Xn(i,e,t,o){const r=Hn(i,e,t,o),s=new Map([["text-area",r]]);function a(u){return s.get(u)||null}return{getEditorRender:a}}function Yn(){const i=n.ref(!1),e=n.ref("复制成功");return{feedbackStyle:n.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",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"};return o.opacity=i.value?"0.8":"0",o.display=i.value?"":"none",o}),feedbackMessage:e,toShowFeedback:i}}function Jn(i,e){const t=e.getEditorRender(i.promptEditorType);return()=>t&&t()}function Qn(i){function e(m){if(m==null)return 0;let f=0;for(let h=0;h<m.length;h++){const b=m.charCodeAt(h);b>=0&&b<=128?f++:f=f+2}return f}function t(m,f){if(m!==""&&m!==void 0&&m!==null){m=""+m;const h=m.length;let b="",j=0;for(let I=0;I<h;I++){const k=m.charAt(I);if(j++,encodeURI(k).length>4&&j++,b=b.concat(k),j>=f)return b=b.concat("..."),b}if(j<f)return m}return""}const o=n.computed(()=>!!i.value&&!!i.value.date),r=n.computed(()=>`发生时间 : ${i.value&&i.value.date||""}`),s=n.computed(()=>!!i.value&&!!i.value.detail),a=n.computed(()=>i.value?e(i.value.detail)>160:!1),u=n.ref(!1),c=n.computed(()=>u.value?"收起":"展开"),l=n.computed(()=>{const m="详细信息 : "+(i.value&&i.value.detail)||"";return u.value?m:t(m,160)}),p=n.computed(()=>({position:"absolute",right:0,bottom:u.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function d(){u.value=!u.value}return()=>n.createVNode("div",{class:"toast-msg-detail"},[o.value&&n.createVNode("div",null,[r.value]),s.value&&n.createVNode("div",{class:"exception_wrap"},[n.createVNode("div",{class:"exception_error_msg"},[n.createVNode("div",{innerHTML:l.value},null),a.value&&n.createVNode("span",{style:p.value,onClick:d},[c.value])])])])}function Zn(i){return()=>n.createVNode("p",{class:"toast-msg-detail",innerHTML:i.value},null)}function Kn(i,e,t,o){const r=n.ref(i.exceptionInfo),s=n.computed(()=>{const m={"f-icon":!0},f=`f-icon-${e.value}`;return m[f]=!0,m}),a=n.computed(()=>t.value||r.value&&r.value.message),u=n.computed(()=>o.value),c=n.computed(()=>!!o.value),l=n.computed(()=>!!r.value);function p(){return l.value?Qn(r):c.value?Zn(u):()=>null}const d=p();return()=>n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:s.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[n.createVNode("p",{class:"toast-msg-title",innerHTML:a.value},null),d()])])}function eo(i,e,t){const{onCopy:o}=e,{toShowFeedback:r}=t,s=n.ref("复制成功"),a=n.ref("复制详细信息"),u=n.ref(i.exceptionInfo||{date:"",message:"",detail:""}),c=n.computed(()=>u.value&&u.value.detail||"");function l(p){o(c.value).catch(d=>{s.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>n.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[n.createVNode("span",{onClick:l,style:"cursor: pointer;"},[a.value])])}function to(i,e,t,o){const r=n.ref(i.type),s=n.ref(i.buttons),a=n.ref(i.exceptionInfo),u=n.ref(i.okButtonText),c=n.ref(i.cancelButtonText),l=n.ref(!0),p=n.ref(!0),d=n.computed(()=>!!(s.value&&s.value.length)),m=n.computed(()=>a.value&&a.value.date&&a.value.message&&a.value.detail),f=n.computed(()=>!(s.value&&s.value.length)&&(u.value||c.value)),h=n.computed(()=>p.value&&u.value),b=n.computed(()=>l.value&&c.value),j=eo(i,t,o);function I(L){r.value==="question"&&e.emit("reject"),e.emit("close")}function k(L){r.value==="question"&&e.emit("accept"),e.emit("close")}return()=>n.createVNode("div",{class:"modal-footer"},[m.value&&j(),f.value&&b.value&&n.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:I},[c.value]),f.value&&h.value&&n.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:k},[u.value]),d.value&&s.value.length&&s.value.map(L=>n.createVNode("button",{type:"button",onClick:L.handle,class:L.class},[L.iconClass&&n.createVNode("span",{class:L.iconClass},null),L.text]))])}const at=n.defineComponent({name:"FMessageBox",props:Un,emits:["accept","reject","close"],setup(i,e){const t=n.ref(i.type),o=n.ref(i.title),r=n.ref(i.detail),s=n.computed(()=>{const j={"modal-tips":!0,"d-flex":!0,"flex-row":!0},I=`messager-type-${t.value}`;return j[I]=!0,j}),a=n.computed(()=>{const j={};return t.value==="prompt"?j.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(j.padding="0.5rem 1.5rem 1rem 1.5rem"),j}),u=Wn(),c=Xn(i,t,o,r),l=Yn(),{feedbackStyle:p,feedbackMessage:d}=l;function m(){return n.createVNode("div",{style:p.value},[d.value])}function f(){switch(t.value){case"prompt":return Jn(i,c);default:return Kn(i,t,o,r)}}const h=f(),b=to(i,e,u,l);return()=>n.createVNode("div",{class:"farris-messager"},[n.createVNode("section",{class:s.value,style:a.value},[h()]),b(),m()])}}),no={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"}};class ce{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ce(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ce(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ce(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ce(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(s)?0:s}return t}return null}static copy(e){return new ce(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class Le{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new Le(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new Le(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function oo(i,e){const t=n.ref(),o=n.ref(),r=n.ref(),s=n.ref(),a=n.ref(),u=n.ref(),c=n.ref(),l=n.ref(),p=n.ref(),d=n.ref(),m=n.ref(),f=n.ref(i.resizeable),h=n.ref(),b=n.ref(i.draggable),j=n.ref(!1);function I(){const x=o.value||document.body,T=window.getComputedStyle(x);if(!T||!t.value)return;const O=ce.getTransformInfo(t.value),M={};c.value&&(M.deltaL=t.value.offsetLeft-c.value.x,M.deltaT=t.value.offsetTop-c.value.y);const V=T.getPropertyValue("position");M.width=x.clientWidth,M.height=x.clientHeight,M.pr=parseInt(T.getPropertyValue("padding-right"),10),M.pb=parseInt(T.getPropertyValue("padding-bottom"),10),M.position=T.getPropertyValue("position"),V==="static"&&(x.style.position="relative"),M.translateX=O.x,M.translateY=O.y,d.value=M}function k(x){if(t.value){s.value=Le.getCurrent(t.value),a.value=ce.getCurrent(t.value),u.value=s.value?Le.copy(s.value):null,c.value=a.value?ce.copy(a.value):null,I();const T=x.target.getAttribute("type")||"";l.value={n:!!T.match(/n/),s:!!T.match(/s/),w:!!T.match(/w/),e:!!T.match(/e/)}}}function L(){var x,T,O,M;if(t.value){const V=t.value;l.value&&((l.value.n||l.value.s)&&((x=u.value)!=null&&x.height)&&(V.style.height=u.value.height+"px"),(l.value.w||l.value.e)&&((T=u.value)!=null&&T.width)&&(V.style.width=u.value.width+"px"),c.value&&((O=c.value)!=null&&O.x&&(V.style.left=c.value.x+"px"),(M=c.value)!=null&&M.y&&(V.style.top=c.value.y+"px")))}}function R(){const x=i.minHeight?i.minHeight:1,T=i.minWidth?i.minWidth:1;u.value&&c.value&&l.value&&s.value&&(u.value.height<x&&(u.value.height=x,l.value.n&&a.value&&(c.value.y=a.value.y+(s.value.height-x))),u.value.width<T&&(u.value.width=T,l.value.w&&a.value&&(c.value.x=a.value.x+(s.value.width-T))),i.maxHeight&&u.value.height>i.maxHeight&&(u.value.height=i.maxHeight,a.value&&l.value.n&&(c.value.y=a.value.y+(s.value.height-i.maxHeight))),i.maxWidth&&u.value.width>i.maxWidth&&(u.value.width=i.maxWidth,l.value.w&&a.value&&(c.value.x=a.value.x+(s.value.width-i.maxWidth))))}function S(){if(o.value){const x=d.value;if(c.value&&u.value&&l.value&&s.value){const T=x.width-x.pr-x.deltaL-x.translateX-c.value.x,O=x.height-x.pb-x.deltaT-x.translateY-c.value.y;l.value.n&&c.value.y+x.translateY<0&&a.value&&(c.value.y=-x.translateY,u.value.height=s.value.height+a.value.y+x.translateY),l.value.w&&c.value.x+x.translateX<0&&a.value&&(c.value.x=-x.translateX,u.value.width=s.value.width+a.value.x+x.translateX),u.value.width>T&&(u.value.width=T),u.value.height>O&&(u.value.height=O)}}}function E(x){if(!r.value||!s.value||!a.value||!l.value)return;x.subtract(r.value);const T=x.x,O=x.y;l.value.n?(c.value.y=a.value.y+O,u.value.height=s.value.height-O):l.value.s&&(u.value.height=s.value.height+O),l.value.e?u.value.width=s.value.width+T:l.value.w&&(u.value.width=s.value.width-T,c.value.x=a.value.x+T),S(),R(),L()}function N(x){if(!p.value)return;const T=ce.fromEvent(x);T&&E(T)}function C(){if(t.value){const{width:x,height:T,x:O,y:M}=t.value.getBoundingClientRect(),V=ce.getTransformInfo(t.value);return{size:{width:x,height:T},position:{x:O-V.x,y:M-V.y}}}return null}function A(x){if(t.value){const T=C();m.value=T}r.value=void 0,s.value=null,a.value=null,u.value=null,c.value=null,l.value=null,p.value=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",A)}function q(){document.addEventListener("mousemove",N),document.addEventListener("mouseup",A)}function g(x){x instanceof MouseEvent&&x.button===2||b.value&&(document.body.click(),x.stopPropagation(),x.preventDefault(),r.value=ce.fromEvent(x),p.value=x.target,k(x),q())}function z(x){return t.value=x,f.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:T=>g(T)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:T=>g(T)},null)])}function Y(x=!0){document.body.click();const T=o.value||document.body,O=Le.getCurrent(T),M=t.value;x&&M&&(h.value=C(),h.value.transform=M.style.transform),O&&M&&(u.value=O,u.value.height-=14,u.value.width-=14,M.style.height=u.value.height+"px",M.style.width=u.value.width+"px",M.style.left="7px",M.style.top="7px",M.style.transform="",m.value={size:u.value,position:{x:0,y:0}},b.value=!1,j.value=!0)}function y(){var x,T;if(document.body.click(),h.value){const O={width:h.value.size.width||0,height:h.value.size.height||0},M={x:(window.innerWidth-O.width)/2,y:(window.innerHeight-O.height)/2};(x=u.value)==null||x.set(O),(T=c.value)==null||T.set(M);const V=t.value;V.style.height=O.height+"px",V.style.width=O.width+"px",V.style.left=`${M.x}px`,V.style.top=`${M.y}px`,V.style.transform="",m.value={size:O,position:M},b.value=i.draggable,j.value=!1}}function w(){if(t.value){const x=Le.getCurrent(t.value);if(x){const{width:T,height:O}=x;t.value.style.left=`${(window.innerWidth-T)/2}px`,t.value.style.top=`${(window.innerHeight-O)/2}px`,t.value.style.transform=""}}}function B(){const x=()=>{j.value?Y(!1):w(),document.body.click()};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}}const _=B();return{renderResizeBar:z,boundingElement:o,resizedEventParam:m,maximize:Y,restore:y,allowDrag:b,isMaximized:j,unWindowResizeHandle:_}}function io(i,e,t){const o=n.ref(),r=n.ref(i.draggable),s=n.ref(i.lockAxis),a=n.ref(),u=n.ref(),c=n.ref(!1),l=n.ref(new ce(0,0)),p=n.ref(new ce(0,0)),d=n.ref(new ce(0,0)),m=n.ref(new ce(0,0));n.watch(()=>t.value,N=>{a.value.style.cursor=N?"move":"default"});function f(N,C){if(C.tagName==="BUTTON")return!1;if(C===N)return!0;for(const A in C.children)if(Object.prototype.hasOwnProperty.call(C.children,A)&&f(N,C.children[A]))return!0;return!1}function h(){var q,g;let N=d.value.x+p.value.x,C=d.value.y+p.value.y;s.value==="x"?(N=((q=l.value)==null?void 0:q.x)||0,d.value.x=0):s.value==="y"&&(C=((g=l.value)==null?void 0:g.y)||0,d.value.y=0);const A=`translate3d(${Math.round(N)}px, ${Math.round(C)}px, 0px)`;o.value&&(o.value.style.transform=A),m.value.x=N,m.value.y=C}function b(){if(!u.value||!o.value)return null;const N=u.value.getBoundingClientRect(),C=o.value.getBoundingClientRect(),A={top:N.top<C.top,right:N.right>C.right,bottom:N.bottom>C.bottom,left:N.left<C.left};return A.top||(d.value.y-=C.top-N.top),A.bottom||(d.value.y-=C.bottom-N.bottom),A.right||(d.value.x-=C.right-N.right),A.left||(d.value.x-=C.left-N.left),h(),A}function j(N){N&&(l.value&&N.subtract(l.value),d.value.set(N),h(),b())}function I(N){c.value&&r.value&&(N.stopPropagation(),N.preventDefault(),j(ce.fromEvent(N,a.value)))}function k(){var N;c.value&&(c.value=!1,p.value.add(d.value),d.value.reset(),(N=o.value)==null||N.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",k))}function L(){!c.value&&a.value&&(c.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",I),document.addEventListener("mouseup",k))}function R(){if(o.value){const N=ce.getTransformInfo(o.value);p.value.set(N);return}p.value.reset()}function S(N){if(!t.value||N instanceof MouseEvent&&N.button===2)return;const C=N.target||N.srcElement;a.value!==void 0&&C&&!f(C,a.value)||r.value!==!1&&(document.body.click(),N.stopPropagation(),N.preventDefault(),l.value=ce.fromEvent(N,o.value),R(),L())}function E(N,C,A){if(r.value&&C){if(N)a.value=N;else if(i.dragHandle){if(i.dragHandle instanceof HTMLElement)a.value=i.dragHandle;else if(typeof i.dragHandle=="string"){const q=C.querySelector(i.dragHandle);q&&(a.value=q)}}o.value=C,u.value=A,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",S)):r.value=!1}}return{registerDraggle:E,resetTranslate:R}}function _t(i,e){if(i){const t=o=>{o.key.toLowerCase()===i.toLowerCase()&&e({event:o,key:i})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function ro(i,e){const t=n.ref(i.enableEsc);let o=null;return t.value?(o=_t("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function so(i,e){const t=n.ref(i.enableEnter);let o=null;return t.value?(o=_t("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ye=n.defineComponent({name:"FModal",props:no,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(i,e){const t=n.ref(i.width||300),o=n.ref(i.height||200),r=n.ref(i.modelValue),s=n.ref(""),a=n.ref(i.class),u=n.ref(i.fitContent),c=n.ref(i.showHeader),l=n.ref(""),p=n.ref(i.showCloseButton),d=n.ref(i.showMaxButton),m=n.ref(!1),f=n.ref(i.dialogType),h=n.ref(i.src),b=n.ref(""),j=n.ref(i.showButtons),I=n.ref(i.title),k=n.ref(i.containment||null),L=n.ref(),R=n.ref(!1);function S(F,Z){Promise.resolve().then(()=>{var ae;return(ae=i.beforeClose)==null?void 0:ae.call(i)}).then(ae=>{ae&&(r.value=!1,e.emit("update:modelValue",!1),Z!=null&&e.emit(Z?"accept":"cancel"),e.emit("closed",F))})}const E=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:F=>{S(F,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:F=>{S(F,!0)}}],N=n.ref(i.buttons&&i.buttons.length?i.buttons:E),C=n.computed(()=>!!l.value),A=n.computed(()=>!!j.value&&!!N.value),q=n.ref(),g=n.ref(),z=n.ref(!1),{renderResizeBar:Y,maximize:y,restore:w,boundingElement:B,resizedEventParam:_,allowDrag:x,unWindowResizeHandle:T}=oo(i),{registerDraggle:O}=io(i,e,x);function M(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function V(){const F=document.querySelectorAll(".farris-modal").length;(!F||F-1<=0)&&document.body.classList.remove("modal-open"),L.value&&L.value.classList.remove("show")}n.watch(()=>i.title,(F,Z)=>{F!==Z&&(I.value=F)}),n.watch(()=>i.modelValue,(F,Z)=>{F!==Z&&(r.value=F,r.value&&i.draggable&&n.nextTick(()=>{g.value&&!k.value&&(k.value=g.value.parentElement,B.value=k.value,O(q.value,g.value,B.value))}),F||(k.value&&(k.value=null),V())),r.value&&(R.value=M())}),n.watch(()=>i.showHeader,(F,Z)=>{F!==Z&&(c.value=F)}),n.watch(()=>i.showButtons,(F,Z)=>{F!==Z&&(j.value=F)}),n.watch(()=>_.value,(F,Z)=>{const ae=F||{},be=Z||{};JSON.stringify(ae)!==JSON.stringify(be)&&e.emit("resize",{newSize:F,oldSize:Z,isMaximized:z.value})});const X=n.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ee=n.computed(()=>{var ae;const F={modal:!0,"farris-modal":!0,fade:!0};F["f-modal-fitContent"]=!!u.value,F.show=!!X.value;const Z=(ae=i.maskClass)==null?void 0:ae.split(" ");return Z==null||Z.reduce((be,je)=>(be[je]=!0,be),F),F}),W=n.computed(()=>{var ae;const F={"modal-dialog":!0},Z=(ae=a.value)==null?void 0:ae.split(" ");return Z==null||Z.reduce((be,je)=>(be[je]=!0,be),F),F}),se=n.computed(()=>{const F={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${o.value}px`};return i.mask||(F.pointerEvents="auto"),F}),re=n.computed(()=>{const F={display:"block"};return i.mask||(F.pointerEvents="none",F.backgroundColor="transparent"),R.value&&(F.backgroundColor="transparent"),F}),Q=n.computed(()=>({"modal-content":!0,"modal-content-has-header":c.value})),D=n.computed(()=>{const F={display:c.value?"":"none"};return F["pointer-events"]=x.value?"auto":"none",F}),oe=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:z.value})),ue=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function Ae(){return{height:`${i.footerHeight||60}px`}}const Be=n.computed(()=>{const F={textAlgin:b.value},Z=Ae();return Object.assign(F,Z)});function Fe(F){if(F.stopPropagation(),z.value){z.value=!1,w();return}y(),z.value=!0}async function Ve(F,Z){F.handle&&await F.handle(Z,F)&&e.emit("closed",Z)}function ke(F){F.width&&(t.value=F.width),F.height&&(o.value=F.height),F.buttons&&(N.value=F.buttons),F.title&&(I.value=F.title)}let De=null,$e=null;n.onBeforeMount(()=>{R.value=M()}),n.onMounted(()=>{g.value&&!k.value&&(k.value=g.value.parentElement,B.value=k.value,O(q.value,g.value,B.value)),X.value&&document.body.classList.add("modal-open"),De=ro(i,e),$e=so(i,e)}),n.onUnmounted(()=>{T&&T(),De&&De.remove(),$e&&$e.remove()}),e.expose({modalElementRef:g,updateModalOptions:ke,close:S,maxDialog:Fe,isMaximized:z});function Te(){return n.createVNode("ul",null,[m.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),d.value&&n.createVNode("li",{onClick:Fe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:oe.value},null)]),p.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:F=>S(F,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ue(){return n.createVNode("div",{class:"modal-footer",style:Be.value},[N.value&&N.value.map(F=>{const Z=n.ref(F.disabled);return n.createVNode("button",{name:F.name,type:"button",disabled:Z.value,class:F.class+(F.iconClass?" btn-icontext":""),onClick:ae=>{Ve(F,ae)}},[!!F.iconClass&&n.createVNode("i",{class:F.iconClass},null),F.text])})])}function Je(){return n.createVNode("div",{ref:q,class:"modal-header",style:D.value},[e.slots.headerTemplate?e.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[C.value&&n.createVNode("span",{class:l.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[I.value])]),n.createVNode("div",{class:"actions"},[Te()])])}function ze(){return e.slots.footerTemplate?e.slots.footerTemplate():A.value&&Ue()}function Qe(F){if(F.stopPropagation(),i.allowClickMaskToClose){if(F.target!==L.value)return;S(F,!1)}}function Ge(){var F,Z;return n.createVNode("div",{id:s.value,class:W.value,style:se.value,ref:g},[n.createVNode("div",{class:Q.value},[c.value&&Je(),n.createVNode("div",{class:ue.value},[(Z=(F=e.slots).default)==null?void 0:Z.call(F),f.value==="iframe"&&n.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:h.value},null)]),ze()]),!u.value&&g.value&&!z.value&&Y(g.value)])}function _e(F){return F||"body"}return()=>n.createVNode(n.Teleport,{to:_e(i.host)},{default:()=>[X.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:L,class:ee.value,style:re.value,onClick:Qe},[Ge()])]})]})}});function Wt(i){if(i.content&&i.content.render)return i.content.render;if(i.render&&typeof i.render=="function")return i.render}function ao(i){const e=document.createElement("div");e.style.display="contents";const t=n.createApp({setup(o,r){n.onUnmounted(()=>{document.body.removeChild(e)});const s=n.ref(),a=n.ref(i.class||""),u=n.ref(!!i.showButtons),c=n.ref(!!i.showHeader),l=n.ref(i.showCloseButton==null?!0:i.showCloseButton),p=n.ref(!0),d=n.ref(i.title||""),m=i.acceptCallback||(()=>{}),f=i.rejectCallback||(()=>{}),h=i.closedCallback||(L=>{}),b=i.resizeHandle||(L=>{}),j=i.stopMoveHandle||(L=>{}),I=Wt(i),k=L=>{p.value=!1,t.unmount(),h(L)};return n.onMounted(()=>{}),r.expose({modalRef:s}),()=>n.createVNode(Ye,{ref:s,class:a.value,modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,title:d.value,width:i.width,height:i.height,buttons:i.buttons,"show-header":c.value,"show-buttons":u.value,"show-close-button":l.value,"show-max-button":!1,onAccept:m,onCancel:f,fitContent:i.fitContent==null?!0:i.fitContent,onClosed:k,onResize:b,onStopMove:j},{default:()=>[I&&I(t)]})}});return document.body.appendChild(e),t.mount(e),t}class Ht{constructor(e){H(this,"appContext",null);H(this,"modalRef",n.ref());H(this,"activeModalIndex",n.ref(0));H(this,"modalRefs",{});H(this,"isUseEscCloseModal",n.ref(!1));H(this,"activeModalInstance",n.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return ao(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=n.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((S,E)=>{}),c=o.value.resizeHandle||(S=>{}),l=e.stopMoveHandle||(S=>{});let p;const d=Wt(o.value),m=S=>{var N;r.value=!1;const E=(N=S==null?void 0:S.target)==null?void 0:N.classList.contains("modal_close");u(S,this.isUseEscCloseModal.value?"esc":E?"icon":"button")},f=S=>{m(S),p&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,t),p=null,this.modalRef.value=null,this.modalRefs){const E=Object.keys(this.modalRefs).map(N=>Number(N));E.length>0?this.activeModalIndex.value=Math.max(...E):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},h=S=>{var E;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((E=this.activeModalInstance.value)==null||E.close(S==null?void 0:S.event))},{width:b,height:j}=o.value,I=this.adaptToWindow(b||500,j||320);Object.assign(o.value,I);const k=()=>n.createVNode(Ye,n.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":S=>r.value=S},o.value,{onAccept:s,onCancel:a,onClosed:f,onResize:c,onEsc:h,onStopMove:l}),{default:()=>[d&&d(this.app)]});return p=(S=>{const E=n.h(k,S);return E.appContext=this.appContext,n.render(E,t),E})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:S=>{o.value={...o.value,...S},p&&n.render(n.cloneVNode(p,{...o}),t)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const lo=Symbol("FModalService");Ye.install=i=>{i.component(Ye.name,Ye);const e=new Ht(i);i.provide(lo,e),i.provide("FModalService",e)};class Ne{static show(e){const t=n.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",s=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",a=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{});let c=null,l=new Ht(c);const p=()=>{c&&(c==null||c.destroy(),l=null)};return c=l==null?void 0:l.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>n.createVNode(at,n.mergeProps(t,{onAccept:a,onReject:u,onClose:p}),null)}),l==null?void 0:l.getCurrentModal()}static info(e,t){const o=n.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Ne.show(o)}static warning(e,t){const o=n.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Ne.show(o)}static success(e,t){const o=n.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Ne.show(o)}static error(e,t,o){const r=n.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:e,detail:t}});Ne.show(r)}static prompt(e,t){const o=n.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Ne.show(o)}static question(e,t,o,r){const s=n.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Ne.show(s)}}at.install=i=>{i.component(at.name,at),i.provide("FMessageBoxService",Ne)};class co extends yt{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.propertyConfig}}function uo(i,e){const t=i.schema;function o(f){var N,C,A;const{componentType:h,sourceType:b,bindingTargetId:j,sourceElement:I}=f,{schemaService:k,formSchemaUtils:L}=e,R=L.getViewModelIdByComponentId((C=(N=i.componentInstance)==null?void 0:N.value)==null?void 0:C.belongedComponentId),S=L.getViewModelById(R);if([me["response-layout"].type,me["query-solution"].type,me.fieldset.type].includes(h)||(A=t.contents)!=null&&A.length)return!1;if(b==="field"){const q=k.getFieldByIDAndVMID(j,R);if(!q||!q.schemaField)return!1}if(I&&I.componentInstance){const{componentInstance:q}=I,g=L.getViewModelIdByComponentId(q.value.belongedComponentId);if(g!==R&&h==="form-group")return L.getViewModelById(g).bindTo===S.bindTo}return!0}function r(){return!1}function s(){return!1}function a(){return!0}function u(f){return new co(f,e).getPropertyConfig(t)}function c(){t.appearance||(t.appearance={class:""}),t.appearance.class||(t.appearance.class=""),t.appearance.class.includes("farris-form")||(t.appearance.class+=" f-form-layout farris-form farris-form-controls-inline farris-form-auto")}function l(f,h){var b,j,I;if(f.componentCategory==="input"){const{label:k}=f;let L;return(b=f.bindingSourceContext)!=null&&b.entityFieldNode?L=(e==null?void 0:e.controlCreatorUtils).setFormFieldProperty((j=f.bindingSourceContext)==null?void 0:j.entityFieldNode,h==null?void 0:h.type,"col-12"):(L=tt("form-group"),L.editor=h,L.label=k,L.appearance={class:"col-12"}),c(),Gt(i,e).syncFieldToViewModel(f,(I=L.editor)==null?void 0:I.type),L}return h}function p(f,h){if(!f||!f.componentInstance||!e)return;const j=f.componentInstance.value.schema;if(!j.binding||!j.binding.field)return;j.type==="form-group"&&c();const I=Gt(i,e);I.onAcceptMovedChildElement&&I.onAcceptMovedChildElement(f,h)}function d(){!t.appearance||!t.appearance.class||(t.appearance.class=t.appearance.class.replace("f-form-layout",""),t.appearance.class=t.appearance.class.replace("farris-form",""),t.appearance.class=t.appearance.class.replace("farris-form-controls-inline",""),t.appearance.class=t.appearance.class.replace("farris-form-auto",""),t.appearance.class=t.appearance.class.trim())}function m(f){var h,b,j;f&&((j=(b=(h=f.componentInstance)==null?void 0:h.value)==null?void 0:b.schema)==null?void 0:j.type)==="form-group"&&d()}return{canAccepts:o,checkCanDeleteComponent:r,checkCanMoveComponent:s,hideNestedPaddingInDesginerView:a,getPropsConfig:u,onResolveNewComponentSchema:l,onAcceptMovedChildElement:p,onChildElementMovedOut:m}}const po=n.defineComponent({name:"FResponseLayoutItemDesign",props:ht,emits:[],setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=uo(o,r),a=Dt(t,o,s);return n.onMounted(()=>{t.value.componentInstance=a}),e.expose(a.value),()=>n.createVNode("div",{ref:t,class:i.customClass,style:"padding-right:8px;display:inherit;flex:1;","data-dragref":`${o.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),fo={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout-splitter.schema.json",title:"response-layout-splitter",description:"A Splitter Editor for Response Layout",type:"object",properties:{id:{description:"The unique identifier for response layout splitter editor",type:"string"},type:{description:"The type string of response layout splitter editor component",type:"string",default:"response-layout-splitter"},layout:{description:"",type:"object",default:{}}},required:["id","type"]},Xt={layout:{type:Array}},mo=Xe(Xt,fo);function ho(i,e){const t=n.inject("FMessageBoxService"),o=["12","6:6","3:9","9:3","4:4:4","3:6:3","3:3:6","3:3:3:3"],r=n.ref([]),s=n.ref(""),a=n.ref(i.layout||[]),u=n.ref(!0);function c(){o.forEach(f=>{r.value.push(f.split(":").map(h=>`col-${h}`))})}function l(){if(!(i!=null&&i.layout))return;if(!a.value.length){s.value="";return}u.value=!0;const f=[];a.value.forEach(h=>{h.appearance||(h.appearance={class:""});const j=(h.appearance.class||"").split(" ").find(I=>/^col-([1-9]|10|11|12)$/.test(I));j?f.push(parseInt(j.replace("col-",""),10)):f.push(0)}),s.value=f.join(":"),u.value=o.includes(s.value)}function p(f){for(let h=f.length;h<a.value.length;h++){const b=a.value[h];if(b&&b.contents&&b.contents.length)return!0}return!1}function d(f,h){u.value=!0,s.value=f;for(let b=0;b<h.length;b++){const j=a.value[b];if(j){let I=j.appearance&&j.appearance.class||"";const k=I.split(" ").find(L=>/^col-([1-9]|10|11|12)$/.test(L));k?(I=I.replace(k,`col-${h[b]}`),j.appearance.class=I):j.appearance.class+=` col-${h[b]}`}else{const I=tt("response-layout-item");I.id=`layout_${Math.random().toString().slice(2,6)}`,I.appearance={class:`h-100 col-${h[b]} px-0`},a.value.push(I)}}a.value.length=h.length,e.emit("change")}function m(f){const h=f.split(":");if(h.length<a.value.length&&p(h)){let b="应用XXX列布局将删除右侧区域内的控件,此操作不可撤销,确定应用?";b=b.replace("XXX",h.length+""),t==null||t.question(b,"",()=>{d(f,h)},()=>{})}else d(f,h)}return c(),l(),{standardLayouts:o,standardLayoutClass:r,selectedLayout:s,currentLayoutItems:a,isStandardLayout:u,onSelectColumnLayout:m}}const Yt=n.defineComponent({name:"FResponseLayoutSplitter",props:Xt,emits:["change"],setup(i,e){const{standardLayouts:t,standardLayoutClass:o,selectedLayout:r,isStandardLayout:s,onSelectColumnLayout:a}=ho(i,e),u=n.computed(()=>l=>({"columns-layout-option":!0,active:r.value===l}));function c(){return n.createVNode("ul",{class:"columns-layout-list"},[t.map((l,p)=>n.createVNode("li",{class:u.value(l),onClick:()=>a(l)},[n.createVNode("div",{class:"columns-layout-icon d-flex"},[o.value[p].map(d=>n.createVNode("div",{class:{"columns-layout-item":!0,[d]:!0}},[n.createTextVNode(" ")]))])])),s.value?"":n.createVNode("li",{class:"columns-layout-option active",title:"自定义布局"},[n.createVNode("div",{class:"columns-layout-icon icon-custom"},[n.createTextVNode(" ")])])])}return()=>n.createVNode("div",{class:"columns-layout"},[c(),s.value?n.createVNode("div",{class:"farris-group-wrap mt-2"},[n.createVNode("div",{class:"form-group farris-form-group d-flex"},[n.createVNode("label",{class:"col-form-label mb-0",style:"width: 89px;"},[n.createVNode("div",{class:"wrap"},[n.createVNode("span",{class:"farris-label-text"},[n.createTextVNode(" 布局比例 ")])])]),n.createVNode("div",{class:"farris-input-wrap"},[n.createVNode("input",{type:"input",class:"form-control form-control-sm",value:r.value,readonly:!0},null)])])]):""])}}),yo={install(i){i.component(ot.name,ot).component(it.name,it)},register(i,e,t,o){i["response-layout"]=ot,i["response-layout-item"]=it,e["response-layout"]=mt,e["response-layout-item"]=Lt,i["response-layout-splitter"]=Yt,e["response-layout-splitter"]=mo},registerDesigner(i,e,t){i["response-layout"]=fn,i["response-layout-item"]=po,e["response-layout"]=mt,e["response-layout-item"]=Lt}};ie.FResponseLayout=ot,ie.FResponseLayoutItem=it,ie.FResponseLayoutSplitter=Yt,ie.default=yo,ie.responseLayoutProps=nt,ie.responseLayoutPropsResolver=mt,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});