@farris/ui-vue 1.5.8 → 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 (62) hide show
  1. package/components/avatar/index.esm.js +1 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/component/index.esm.js +1 -1
  4. package/components/component/index.umd.cjs +1 -1
  5. package/components/condition/index.esm.js +1 -1
  6. package/components/condition/index.umd.cjs +1 -1
  7. package/components/content-container/index.esm.js +1 -1
  8. package/components/content-container/index.umd.cjs +1 -1
  9. package/components/designer-canvas/index.esm.js +904 -893
  10. package/components/designer-canvas/index.umd.cjs +1 -1
  11. package/components/dynamic-form/index.esm.js +1 -1
  12. package/components/dynamic-form/index.umd.cjs +1 -1
  13. package/components/dynamic-view/index.esm.js +1 -1
  14. package/components/dynamic-view/index.umd.cjs +1 -1
  15. package/components/events-editor/index.esm.js +1 -1
  16. package/components/events-editor/index.umd.cjs +1 -1
  17. package/components/filter-bar/index.esm.js +1 -1
  18. package/components/filter-bar/index.umd.cjs +1 -1
  19. package/components/flow-canvas/index.esm.js +1 -1
  20. package/components/flow-canvas/index.umd.cjs +1 -1
  21. package/components/number-range/index.esm.js +1 -1
  22. package/components/number-range/index.umd.cjs +1 -1
  23. package/components/number-spinner/index.esm.js +1 -1
  24. package/components/number-spinner/index.umd.cjs +1 -1
  25. package/components/page-header/index.esm.js +795 -2822
  26. package/components/page-header/index.umd.cjs +1 -1
  27. package/components/property-panel/index.esm.js +1 -1
  28. package/components/property-panel/index.umd.cjs +1 -1
  29. package/components/query-solution/index.esm.js +1 -1
  30. package/components/query-solution/index.umd.cjs +1 -1
  31. package/components/response-layout/index.esm.js +1 -1
  32. package/components/response-layout/index.umd.cjs +1 -1
  33. package/components/section/index.esm.js +119 -7475
  34. package/components/section/index.umd.cjs +1 -1
  35. package/components/time-picker/index.esm.js +1 -1
  36. package/components/time-picker/index.umd.cjs +1 -1
  37. package/components/video/index.esm.js +1 -1
  38. package/components/video/index.umd.cjs +1 -1
  39. package/designer/data-grid/index.esm.js +1 -1
  40. package/designer/data-grid/index.umd.cjs +1 -1
  41. package/designer/farris-designer.all.esm.js +946 -934
  42. package/designer/farris-designer.all.umd.cjs +4 -4
  43. package/designer/radio-group/index.esm.js +1 -1
  44. package/designer/radio-group/index.umd.cjs +1 -1
  45. package/designer/section/index.esm.js +744 -0
  46. package/designer/section/index.umd.cjs +1 -0
  47. package/farris.all.esm.js +10489 -10488
  48. package/farris.all.umd.cjs +16 -16
  49. package/package.json +1 -1
  50. package/types/designer-canvas/index.d.ts +2 -2
  51. package/types/section/designer.d.ts +26 -0
  52. package/types/section/index.d.ts +1 -0
  53. package/types/section/src/designer/section-header.design.component.d.ts +2 -2
  54. package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
  55. package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
  56. package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
  57. package/types/section/src/designer/section.design.props.d.ts +11 -0
  58. package/types/section/src/designer/use-designer-rules.d.ts +1 -2
  59. package/types/section/src/property-config/section.property-config.d.ts +1 -1
  60. package/types/section/src/schema/schema-resolver.d.ts +1 -1
  61. package/types/section/src/section.props.d.ts +0 -10
  62. package/components/section/index.css +0 -1
@@ -1 +1 @@
1
- (function(te,o){typeof exports=="object"&&typeof module<"u"?o(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("../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","../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"],o):(te=typeof globalThis<"u"?globalThis:te||self,o(te["content-container"]={},te.Vue,te.LodashES,te.common,te.VueUseCore,te.dynamicResolver,te.dataView))})(this,function(te,o,oe,Je,qt,xe,Y){"use strict";var Jn=Object.defineProperty;var Zn=(te,o,oe)=>o in te?Jn(te,o,{enumerable:!0,configurable:!0,writable:!0,value:oe}):te[o]=oe;var Z=(te,o,oe)=>Zn(te,typeof o!="symbol"?o+"":o,oe);const Mt={},Et={};function st(r){const{properties:e,title:t,ignore:n}=r,i=n&&Array.isArray(n),a=Object.keys(e).reduce((s,u)=>((!i||!n.find(l=>l===u))&&(s[u]=e[u].type==="object"&&e[u].properties?st(e[u]):oe.cloneDeep(e[u].default)),s),{});if(t&&(!i||!n.find(s=>s==="id"))){const s=t.toLowerCase().replace(/-/g,"_");a.id=`${s}_${Math.random().toString().slice(2,6)}`}return a}function Lt(r){const{properties:e,title:t,required:n}=r;if(n&&Array.isArray(n)){const i=n.reduce((a,s)=>(a[s]=e[s].type==="object"&&e[s].properties?st(e[s]):oe.cloneDeep(e[s].default),a),{});if(t&&n.find(a=>a==="id")){const a=t.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}return{type:t}}function Nt(r,e={},t){const n=Mt[r];if(n){let i=Lt(n);const a=Et[r];return i=a?a({getSchemaByType:Nt},i,e,t):i,i}return null}function zt(r,e){const t=st(e);return Object.keys(t).reduce((n,i)=>(Object.prototype.hasOwnProperty.call(r,i)&&(n[i]&&oe.isPlainObject(n[i])&&oe.isPlainObject(r[i]||!r[i])?Object.assign(n[i],r[i]||{}):n[i]=r[i]),n),t),t}function Bt(r,e){return Object.keys(r).filter(n=>r[n]!=null).reduce((n,i)=>{if(e.has(i)){const a=e.get(i);if(typeof a=="string")n[a]=r[i];else{const s=a(i,r[i],r);Object.assign(n,s)}}else n[i]=r[i];return n},{})}function Ht(r,e,t=new Map){const n=zt(r,e);return Bt(n,t)}function At(r={}){function e(c,d,f,m){if(typeof f=="number")return m[c].length===f;if(typeof f=="object"){const p=Object.keys(f)[0],v=f[p];if(p==="not")return Number(m[c].length)!==Number(v);if(p==="moreThan")return Number(m[c].length)>=Number(v);if(p==="lessThan")return Number(m[c].length)<=Number(v)}return!1}function t(c,d,f,m){return m[c]&&m[c].propertyValue&&String(m[c].propertyValue.value)===String(f)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((c,d)=>(c.set(d,r[d]),c),n);function i(c,d){const f=c;return typeof d=="number"?[{target:f,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:f,operator:"getProperty",param:c,value:!!d}]:typeof d=="object"?Object.keys(d).map(m=>{if(m==="length")return{target:f,operator:"length",param:null,value:d[m]};const p=m,v=d[m];return{target:f,operator:"getProperty",param:p,value:v}}):[]}function a(c){return Object.keys(c).reduce((f,m)=>{const p=i(m,c[m]);return f.push(...p),f},[])}function s(c,d){if(n.has(c.operator)){const f=n.get(c.operator);return f&&f(c.target,c.param,c.value,d)||!1}return!1}function u(c,d){return a(c).reduce((p,v)=>p&&s(v,d),!0)}function l(c,d){const f=Object.keys(c),m=f.includes("allOf"),p=f.includes("anyOf"),v=m||p,E=(v?c[v?m?"allOf":"anyOf":"allOf"]:[c]).map($=>u($,d));return m?!E.includes(!1):E.includes(!0)}return{parseValueSchema:l}}const ce={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:"筛选条"}},Ut={},_t={};At();function lt(r,e,t=new Map,n=(s,u,l,c)=>u,i={},a=s=>s){return Mt[e.title]=e,Et[e.title]=n,Ut[e.title]=i,_t[e.title]=a,(s={},u=!0)=>{if(!u)return Bt(s,t);const l=Ht(s,e,t),c=Object.keys(r).reduce((d,f)=>(d[f]=r[f].default,d),{});return Object.assign(c,l)}}function ct(r,e){return{customClass:e.class,customStyle:e.style}}const Gt=new Map([["appearance",ct]]),Wt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/content-container.schema.json",title:"content-container",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"content-container"},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"]};function Yt(r,e,t){return e}const Ze={customClass:{type:String,default:""},customStyle:{type:String,default:""},visible:{type:Boolean,default:!0}},ut=lt(Ze,Wt,Gt,Yt),Ke=o.defineComponent({name:"FContentContainer",props:Ze,emits:[],setup(r,e){return()=>r.visible&&o.createVNode("div",{class:r.customClass,style:r.customStyle},[e.slots.default&&e.slots.default()])}});function Xt(){function r(e,t){var s;if(!e)return!1;const n=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const i=n.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(n.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![ce["response-layout-item"].type,ce["response-form"].type,ce.fieldset.type].includes(i)||(e.componentType===ce.tabs.type||e.componentType===ce.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![ce["content-container"].type,ce["splitter-pane"].type,ce["response-layout-item"].type].includes(i))||e.componentType===ce["query-solution"].type||e.componentType===ce.fieldset.type&&i!==ce["response-form"].type)}return{basalDragulaRuleForContainer:r}}class Qt{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,i=n==null?void 0:n.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!i)return a;const s=this.getComponentContext(e),{componentClassList:u}=s;return u.forEach(l=>{if(!l||!i[l])return;const{canMove:c,canDelete:d,canAccept:f}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(c,s),a.canDelete=a.canDelete&&this.resolveRuleValue(d,s),a.canAccept=a.canAccept&&this.resolveRuleValue(f,s)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let i=!0;for(const a of n){if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:s}=t;if(s&&!s.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:s}=t;if(!s||s.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:s}=t;if(s&&!s.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:s}=t;if(!s||s.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:s}=t;if(s&&!s.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:s}=t;if(s&&s.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(e){var S,B,E,F;const t=e.schema,n=t.appearance&&t.appearance.class||"",i=n.split(" ")||[],a=t.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],c=(S=s==null?void 0:s.contents)!=null&&S.length?s==null?void 0:s.contents[0]:null,d=c&&c.appearance?c.appearance.class:"",f=d?d.split(" "):[],m=t.type==="component"?(E=(B=e.parent)==null?void 0:B.parent)==null?void 0:E.schema:(F=e.parent)==null?void 0:F.schema,p=m&&m.appearance&&m.appearance.class||"",v=p?p.split(" "):[];return{componentClass:n,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:d,secondLevelChildClassList:f,parentSchema:m,parentClass:p,parentClassList:v}}}const Jt=o.ref(0);var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function et(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zt={exports:{}};(function(r,e){(function(t){r.exports=t()})(function(){return function(){function t(n,i,a){function s(c,d){if(!i[c]){if(!n[c]){var f=typeof et=="function"&&et;if(!d&&f)return f(c,!0);if(u)return u(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var p=i[c]={exports:{}};n[c][0].call(p.exports,function(v){var S=n[c][1][v];return s(S||v)},p,p.exports,t,n,i,a)}return i[c].exports}for(var u=typeof et=="function"&&et,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,n,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(f){var m=a[f];return m?m.lastIndex=0:a[f]=m=new RegExp(s+f+u,"g"),m}function c(f,m){var p=f.className;p.length?l(m).test(p)||(f.className+=" "+m):f.className=m}function d(f,m){f.className=f.className.replace(l(m)," ").trim()}n.exports={add:c,rm:d}},{}],2:[function(t,n,i){(function(a){var s=t("contra/emitter"),u=t("crossvent"),l=t("./classes"),c=document,d=c.documentElement;function f(y,D){var U=arguments.length;U===1&&Array.isArray(y)===!1&&(D=y,y=[]);var q,z,G,me,j,N,H,k,J,ue=null,Me,_,ye=!1,he=0,ee,V=D||{};V.moves===void 0&&(V.moves=F),V.accepts===void 0&&(V.accepts=F),V.invalid===void 0&&(V.invalid=We),V.containers===void 0&&(V.containers=y||[]),V.isContainer===void 0&&(V.isContainer=E),V.copy===void 0&&(V.copy=!1),V.copySortSource===void 0&&(V.copySortSource=!1),V.revertOnSpill===void 0&&(V.revertOnSpill=!1),V.removeOnSpill===void 0&&(V.removeOnSpill=!1),V.direction===void 0&&(V.direction="vertical"),V.ignoreInputTextSelection===void 0&&(V.ignoreInputTextSelection=!0),V.mirrorContainer===void 0&&(V.mirrorContainer=c.body);var K=s({containers:V.containers,start:Ge,end:Ae,cancel:ge,remove:ne,destroy:Ve,canMove:ze,dragging:!1});return V.removeOnSpill===!0&&K.on("over",yt).on("out",Qe),Le(),K;function ie(h){return K.containers.indexOf(h)!==-1||V.isContainer(h)}function Le(h){var T=h?"remove":"add";v(d,T,"mousedown",Pe),v(d,T,"mouseup",b)}function ke(h){var T=h?"remove":"add";v(d,T,"mousemove",Fe)}function Ie(h){var T=h?"remove":"add";u[T](d,"selectstart",Oe),u[T](d,"click",Oe)}function Ve(){Le(!0),b({})}function Oe(h){Me&&h.preventDefault()}function Pe(h){me=h.clientX,j=h.clientY;var T=S(h)!==1||h.metaKey||h.ctrlKey;if(!T){var M=h.target,R=Se(M);R&&(Me=R,ke(),h.type==="mousedown"&&(x(M)?M.focus():h.preventDefault()))}}function Fe(h){if(Me){if(S(h)===0){b({});return}if(!(h.clientX!==void 0&&Math.abs(h.clientX-me)<=(V.slideFactorX||0)&&h.clientY!==void 0&&Math.abs(h.clientY-j)<=(V.slideFactorY||0))){if(V.ignoreInputTextSelection){var T=I("clientX",h)||0,M=I("clientY",h)||0,R=c.elementFromPoint(T,M);if(x(R))return}var X=Me;ke(!0),Ie(),Ae(),He(X),l.add(k||G,"gu-transit"),vt(),gt(),he=0,Xe(h)}}}function Se(h){if(!(K.dragging&&q)&&!ie(h)){for(var T=h;w(h)&&ie(w(h))===!1;)if(V.invalid(h,T)||(h=w(h),!h))return;var M=w(h);if(M&&!V.invalid(h,T)){var R=V.moves(h,M,T,g(h));if(R)return{item:h,source:M}}}}function ze(h){return!!Se(h)}function Ge(h){var T=Se(h);T&&He(T)}function He(h){jt(h.item,h.source)&&(k=h.item.cloneNode(!0),K.emit("cloned",k,h.item,"copy")),z=h.source,G=h.item,N=H=g(h.item),K.dragging=!0,K.emit("drag",G,z)}function We(){return!1}function Ae(){if(K.dragging){var h=k||G;W(h,w(h))}}function Ue(){Me=!1,ke(!0),Ie(!0)}function b(h){if(Ue(),!!K.dragging){var T=k||G,M=I("clientX",h)||0,R=I("clientY",h)||0,X=B(q,M,R),Q=ot(X,M,R);Q&&(k&&V.copySortSource||!k||Q!==z)?W(T,Q):V.removeOnSpill?ne():ge()}}function W(h,T){var M=w(h);k&&V.copySortSource&&T===z&&M.removeChild(G),Ye(T)?K.emit("cancel",h,z):K.emit("drop",h,T,z,H),Ee()}function ne(){if(K.dragging){var h=k||G,T=w(h);T&&T.removeChild(h),K.emit(k?"cancel":"remove",h,T,z),Ee()}}function ge(h){if(K.dragging){var T=arguments.length>0?h:V.revertOnSpill,M=k||G,R=w(M),X=Ye(R);X===!1&&T&&(k?R&&R.removeChild(k):z.insertBefore(M,N)),X||T?K.emit("cancel",M,z,z):K.emit("drop",M,R,z,H),Ee()}}function Ee(){var h=k||G;Ue(),bt(),wt(),h&&l.rm(h,"gu-transit"),J&&clearTimeout(J),K.dragging=!1,ue&&K.emit("out",h,ue,z),K.emit("dragend",h,he),z=G=k=N=H=J=ue=null}function Ye(h,T){var M;return T!==void 0?M=T:q?M=H:M=g(k||G),h===z&&M===N}function ot(h,T,M){for(var R=h;R&&!X();)R=w(R);return R;function X(){var Q=ie(R);if(Q===!1)return!1;var we=rt(R,h),fe=at(R,we,T,M),ve=Ye(R,fe);return ve?!0:V.accepts(G,R,z,fe)}}function Xe(h){if(!q)return;h.preventDefault();var T=I("clientX",h)||0,M=I("clientY",h)||0;q.style.left=T-2+"px",q.style.top=M-2+"px";var R=k||G,X=B(q,T,M),Q=ot(X,T,M),we=Q!==null&&Q!==ue;(we||Q===null)&&(pe(),ue=Q,je()),Tt(X,M);var fe=w(R);if(Q===z&&k&&!V.copySortSource){fe&&fe.removeChild(R);return}var ve,Te=rt(Q,X);if(ye=Ct(Te,Q),Te!==null)ve=at(Q,Te,T,M);else if(V.revertOnSpill===!0&&!k)ve=N,Q=z;else{k&&fe&&fe.removeChild(R),k&&_&&(_.style.display="none");return}_.style.display="block",ht(ve,R,we),ve?xt(Te,ve):St(Q);function ae(se){K.emit(se,R,ue,z)}function je(){we&&ae("over")}function pe(){ue&&ae("out")}}function ht(h,T,M){(h===T||h===g(T))&&(H=g(T)),(h===null&&M||h!==T&&h!==g(T))&&(H=h)}function yt(h){l.rm(h,"gu-hide")}function Qe(h){K.dragging&&l.add(h,"gu-hide")}function gt(){q||(q=document.createElement("div"),q.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;",q.innerHTML=V.getMirrorText&&V.getMirrorText(G)||"控件",l.add(q,"gu-mirror"),V.mirrorContainer.appendChild(q),v(d,"add","mousemove",Xe),l.add(V.mirrorContainer,"gu-unselectable"),K.emit("cloned",q,G,"mirror"))}function vt(){if(_=document.createElement("div"),l.add(_,"gu-insertion"),G){var h=G.getBoundingClientRect();_.style.left=h.left+"px",_.style.top=h.top+"px"}ye=!1,V.mirrorContainer.appendChild(_)}function bt(){q&&(l.rm(V.mirrorContainer,"gu-unselectable"),v(d,"remove","mousemove",Xe),w(q).removeChild(q),q=null)}function wt(){_&&(w(_).removeChild(_),_=null)}function rt(h,T){for(var M=T;M!==h&&w(M)!==h;)M=w(M);return M===d?null:M}function Ct(h,T){if(!T)return ye;var M=h||T&&T.lastElementChild;if(!M)return!0;var R=getComputedStyle(h),X=/^inline/.test(R.getPropertyValue("display"))||/^(left|right)$/.test(R.getPropertyValue("float"));if(X)return!0;if(T){var Q=getComputedStyle(T),we=Q.getPropertyValue("display");if(/flex$/.test(we)){var fe=Q.getPropertyValue("flex-direction")||"row";if(fe==="row"||fe==="row-reverse")return!it(T)}return!1}return!0}function it(h){if(!h.children||!h.children.length)return!1;for(const T of Array.from(h.children)){const R=(T.className&&T.className.split(" ")||[]).filter(X=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(X));if(!R.length)return!1;for(const X of R){const Q=X.slice(X.lastIndexOf("-")+1);if(parseInt(Q,10)!==12)return!1}}return!0}function xt(h,T){const M=T.getBoundingClientRect();if(_.style.left=M.left+"px",_.style.top=M.top+"px",ye){if(_.style.height=M.height+"px",_.style.width="4px",h){const R=h.getBoundingClientRect();R.top!==M.top&&(_.style.left=R.right+"px",_.style.top=R.top+"px",_.style.height=R.height+"px")}}else if(_.style.height="4px",_.style.width=M.width+"px",ee){const R=ee.getBoundingClientRect();M.top<R.top&&(_.style.display="none")}T===G&&G&&(_.style.display="none")}function St(h){H=null;var T=h.lastElementChild;if(T){var M=T.getBoundingClientRect();ye?(_.style.left=M.right+"px",_.style.top=M.top+"px",_.style.height=M.height+"px",_.style.width="4px"):(_.style.left=M.left+"px",_.style.top=M.bottom+"px",_.style.height="4px",_.style.width=M.width+"px"),T===G&&G&&(_.style.display="none")}else _.style.display="none"}function Tt(h,T){if(!V.mirrorContainer.contains(h)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ee=m(h),!ee||!ee.contains(h)))return;const M=document.querySelector(".dgComponentSelected"),R=ee.getBoundingClientRect();if(T-30<R.top&&ee.scrollTop>0){let X=ee.scrollTop<10?ee.scrollTop:10;ee.scrollBy(0,-1*X),M&&ee.contains(M)&&(he=he+-1*X)}if(T+30>R.bottom&&ee.scrollTop<ee.scrollHeight-ee.clientHeight){const X=ee.scrollHeight-ee.clientHeight-ee.scrollTop;let Q=X<10?X:10;ee.scrollBy(0,Q),M&&ee.contains(M)&&(he=he+Q)}}function at(h,T,M,R){var X=V.direction==="horizontal",Q=V.direction==="mixed",we=T!==h?ve():fe();return we;function fe(){var ae=h.children.length,je,pe,se;for(je=0;je<ae;je++)if(pe=h.children[je],se=pe.getBoundingClientRect(),X&&se.left+se.width/2>M||!Q&&!X&&se.top+se.height/2>R||Q&&se.left+se.width>M&&se.top+se.height>R)return pe;return null}function ve(){var ae=T.getBoundingClientRect();if(Q){var je=R-ae.top,pe=M-ae.left,se=ae.bottom-R,O=ae.right-M,A=Math.min(pe,O,je,se),de;return ye?de=O<pe:de=se===A||O===A||pe===A,Te(de)}return Te(X?M>ae.left+$(ae)/2:R>ae.top+L(ae)/2)}function Te(ae){return ae?g(T):T}}function jt(h,T){return typeof V.copy=="boolean"?V.copy:V.copy(h,T)}}function m(y){const D=Array.from(window.scrollContainerList);if(D.length===1){const q=Array.from(window.scrollContainerList)[0];return document.getElementById(q)}const U=p(D);for(const q of U)if(q.contains(y))return q;return null}function p(y){const D=[];return y.forEach(U=>{const q=document.getElementById(U);q&&D.push(q)}),D.sort((U,q)=>U.contains(q)?1:q.contains(U)?-1:0),D}function v(y,D,U,q){var z={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},G={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},me={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[D](y,G[U],q):a.navigator.msPointerEnabled?u[D](y,me[U],q):(u[D](y,z[U],q),u[D](y,U,q))}function S(y){if(y.touches!==void 0)return y.touches.length;if(y.which!==void 0&&y.which!==0)return y.which;if(y.buttons!==void 0)return y.buttons;var D=y.button;if(D!==void 0)return D&1?1:D&2?3:D&4?2:0}function B(y,D,U){y=y||{};var q=y.className||"",z;return y.className+=" gu-hide",z=c.elementFromPoint(D,U),y.className=q,z}function E(){return!1}function F(){return!0}function $(y){return y.width||y.right-y.left}function L(y){return y.height||y.bottom-y.top}function w(y){return y.parentNode===c?null:y.parentNode}function x(y){return y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||C(y)}function C(y){return!y||y.contentEditable==="false"?!1:y.contentEditable==="true"?!0:C(w(y))}function g(y){return y.nextElementSibling||D();function D(){var U=y;do U=U.nextSibling;while(U&&U.nodeType!==1);return U}}function P(y){return y.targetTouches&&y.targetTouches.length?y.targetTouches[0]:y.changedTouches&&y.changedTouches.length?y.changedTouches[0]:y}function I(y,D){var U=P(D),q={pageX:"clientX",pageY:"clientY"};return y in q&&!(y in U)&&q[y]in U&&(y=q[y]),U[y]}n.exports=f}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,n,i){n.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(t,n,i){var a=t("ticky");n.exports=function(u,l,c){u&&a(function(){u.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,n,i){var a=t("atoa"),s=t("./debounce");n.exports=function(l,c){var d=c||{},f={};return l===void 0&&(l={}),l.on=function(m,p){return f[m]?f[m].push(p):f[m]=[p],l},l.once=function(m,p){return p._once=!0,l.on(m,p),l},l.off=function(m,p){var v=arguments.length;if(v===1)delete f[m];else if(v===0)f={};else{var S=f[m];if(!S)return l;S.splice(S.indexOf(p),1)}return l},l.emit=function(){var m=a(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var p=(f[m]||[]).slice(0);return function(){var v=a(arguments),S=this||l;if(m==="error"&&d.throws!==!1&&!p.length)throw v.length===1?v[0]:v;return p.forEach(function(E){d.async?s(E,v,S):E.apply(S,v),E._once&&l.off(m,E)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,n,i){(function(a){var s=t("custom-event"),u=t("./eventmap"),l=a.document,c=m,d=v,f=[];a.addEventListener||(c=p,d=S),n.exports={add:c,remove:d,fabricate:B};function m(w,x,C,g){return w.addEventListener(x,C,g)}function p(w,x,C){return w.attachEvent("on"+x,F(w,x,C))}function v(w,x,C,g){return w.removeEventListener(x,C,g)}function S(w,x,C){var g=$(w,x,C);if(g)return w.detachEvent("on"+x,g)}function B(w,x,C){var g=u.indexOf(x)===-1?I():P();w.dispatchEvent?w.dispatchEvent(g):w.fireEvent("on"+x,g);function P(){var y;return l.createEvent?(y=l.createEvent("Event"),y.initEvent(x,!0,!0)):l.createEventObject&&(y=l.createEventObject()),y}function I(){return new s(x,{detail:C})}}function E(w,x,C){return function(P){var I=P||a.event;I.target=I.target||I.srcElement,I.preventDefault=I.preventDefault||function(){I.returnValue=!1},I.stopPropagation=I.stopPropagation||function(){I.cancelBubble=!0},I.which=I.which||I.keyCode,C.call(w,I)}}function F(w,x,C){var g=$(w,x,C)||E(w,x,C);return f.push({wrapper:g,element:w,type:x,fn:C}),g}function $(w,x,C){var g=L(w,x,C);if(g){var P=f[g].wrapper;return f.splice(g,1),P}}function L(w,x,C){var g,P;for(g=0;g<f.length;g++)if(P=f[g],P.element===w&&P.type===x&&P.fn===C)return g}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,n,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));n.exports=s}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,n,i){(function(a){var s=a.CustomEvent;function u(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}n.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(c,d){var f=document.createEvent("CustomEvent");return d?f.initCustomEvent(c,d.bubbles,d.cancelable,d.detail):f.initCustomEvent(c,!1,!1,void 0),f}:function(c,d){var f=document.createEventObject();return f.type=c,d?(f.bubbles=!!d.bubbles,f.cancelable=!!d.cancelable,f.detail=d.detail):(f.bubbles=!1,f.cancelable=!1,f.detail=void 0),f}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,n,i){var a=n.exports={},s,u;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=c}catch{u=c}})();function d(L){if(s===setTimeout)return setTimeout(L,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(L,0);try{return s(L,0)}catch{try{return s.call(null,L,0)}catch{return s.call(this,L,0)}}}function f(L){if(u===clearTimeout)return clearTimeout(L);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(L);try{return u(L)}catch{try{return u.call(null,L)}catch{return u.call(this,L)}}}var m=[],p=!1,v,S=-1;function B(){!p||!v||(p=!1,v.length?m=v.concat(m):S=-1,m.length&&E())}function E(){if(!p){var L=d(B);p=!0;for(var w=m.length;w;){for(v=m,m=[];++S<w;)v&&v[S].run();S=-1,w=m.length}v=null,p=!1,f(L)}}a.nextTick=function(L){var w=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)w[x-1]=arguments[x];m.push(new F(L,w)),m.length===1&&!p&&d(E)};function F(L,w){this.fun=L,this.array=w}F.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function $(){}a.on=$,a.addListener=$,a.once=$,a.off=$,a.removeListener=$,a.removeAllListeners=$,a.emit=$,a.prependListener=$,a.prependOnceListener=$,a.listeners=function(L){return[]},a.binding=function(L){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(L){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,n,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},n.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,n,i){(function(a,s){var u=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,d={},f=0;i.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(p){p.close()};function m(p,v){this._id=p,this._clearFn=v}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(p,v){clearTimeout(p._idleTimeoutId),p._idleTimeout=v},i.unenroll=function(p){clearTimeout(p._idleTimeoutId),p._idleTimeout=-1},i._unrefActive=i.active=function(p){clearTimeout(p._idleTimeoutId);var v=p._idleTimeout;v>=0&&(p._idleTimeoutId=setTimeout(function(){p._onTimeout&&p._onTimeout()},v))},i.setImmediate=typeof a=="function"?a:function(p){var v=f++,S=arguments.length<2?!1:c.call(arguments,1);return d[v]=!0,u(function(){d[v]&&(S?p.apply(null,S):p.call(null),i.clearImmediate(v))}),v},i.clearImmediate=typeof s=="function"?s:function(p){delete d[p]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Zt);const Kt={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},en={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},dt=o.defineComponent({name:"Toast",props:en,emits:["close","click"],setup:(r,e)=>{const t=o.ref(r.animate),n="fadeOut",i=o.computed(()=>r.options),a=o.ref(!1),s=o.computed(()=>{const E={animated:a.value,toast:!0};return E[r.animate]=!1,E[n]=a.value,E[i.value.type]=!0,i.value.theme&&(E[i.value.theme]=!0),E}),u=o.computed(()=>{const $=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,L={"f-icon":!0};return L[$]=!0,L}),l=o.computed(()=>i.value.title||i.value.message),c=o.computed(()=>i.value.title&&i.value.message),d=o.computed(()=>!i.value.title&&i.value.message),f=o.computed(()=>r.showCloseButton),m=o.computed(()=>!!i.value.buttons||!!e.slots.default);function p(E){E.stopPropagation(),E.preventDefault(),a.value=!1,setTimeout(()=>{e.emit("close",i.value)},200)}function v(E,F){}function S(E){return`f-preten-link ${E.customClass?E.customClass:""}`}o.watch(t,()=>{t.value});const B=()=>{var E;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((E=i.value.buttons)==null?void 0:E.map(F=>o.createVNode("span",{class:S(F),onClick:$=>void 0},[F.text]))),e.slots.default&&e.slots.default()])])};return()=>o.createVNode("div",{class:s.value,style:"min-height:44px"},[f.value&&o.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:p},[o.createVNode("span",{class:"f-icon modal_close"},null)]),l.value&&o.createVNode("section",{class:"modal-tips"},[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:u.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[c.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message},null),m.value&&B()]),d.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[B()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null))])])])}}),tt=o.defineComponent({name:"Notify",props:Kt,emits:["close","empty"],setup(r,e){const t=o.computed(()=>({"farris-notify":!0})),n={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(r.options),s=o.ref(r.showCloseButton),u=o.computed(()=>r.position||"bottom-right"),l=o.computed(()=>r.timeout!=null?r.timeout:3e3),c=o.computed(()=>{const m=r.bottom?r.bottom:n.bottom,p=r.top?r.top:n.top,v={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${r.left?r.left:n.left}px`:"",right:u.value.indexOf("right")>-1?`${r.right?r.right:n.right}px`:"",top:u.value.indexOf("top")>-1?`${p}px`:"",bottom:u.value.indexOf("bottom")>-1?`${m}px`:""};return u.value.indexOf("center")>-1&&(v.left="50%",v.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(v.top="50%",v.transform="translate(-50%, -50%)")),v});function d(m){e.emit("close")}l.value&&setTimeout(()=>{d()},l.value),e.expose({closeToast:d,container:i,notifyPosition:u});function f(m,p){d()}return()=>o.createVNode("div",{class:t.value,style:c.value,ref:i},[o.createVNode(dt,{options:a.value,showCloseButton:s.value,animate:r.animate,onClose:m=>f(m,a.value)},null)])}});class tn{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",o.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,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var c;const u=o.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(i,u),s.unmount()},220)}if(i.position.indexOf("top")>-1){const d=t.getNotifyInstances(i.position),f=d[d.length-1];if(f){const m=f.value.container.getBoundingClientRect();i.top=m.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=t.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{t.updateNotifyPositionForCreate(i,u)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(tt,o.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.mount(a),s}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const n=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+n-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const n=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const i=this.getNotifyInstances(e.position),a=i.indexOf(t);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}n>-1&&this.notifyRefs.splice(n,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let n="",i="",a,s,u;typeof t=="string"?n=t:t&&(n=t.message||"",i=t.title||"",s=t.position||null,u=t.showCloseButton!=null?t.showCloseButton:null,a=t.timeout!=null?t.timeout:null);const c={options:{type:e,message:n,title:i}};return s!=null&&(c.position=s),u!=null&&(c.showCloseButton=u),a!=null&&(c.timeout=a),c}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 nn=Symbol("NOTIFY_SERVICE_TOKEN");tt.install=r=>{r.component(tt.name,tt),r.component(dt.name,dt);const e=new tn;r.provide(nn,e),r.provide("FNotifyService",e)};const kt=new Map([["appearance",xe.resolveAppearance],["column","columnOption"]]);function on(r,e,t){var f;const n=t.parentComponentInstance,i=n.schema.type,a=String(((f=n.schema.appearance)==null?void 0:f.class)||"").split(" "),s=i==="section"||i==="tab-page",u=a.includes("f-page-content-nav"),l=a.includes("f-page-main"),c=r.getSchemaByType("component");c.id=`${e.id}-component`,c.componentType="data-grid";let d="";return d+=s?"f-struct-data-grid-in-card f-struct-is-subgrid":"",d+=u?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",d+=l?"f-struct-data-grid f-struct-wrapper":"",c.appearance={class:d},c.contents=[e],c}function rn(r,e,t){const n=t.parentComponentInstance,i=String(n.schema.appearance.class||"").split(" "),a=i.includes("f-page-content-nav"),s=i.includes("f-page-main"),u=r.getSchemaByType("section");u.id=`${e.id}-section`;let l="";return l+=a?"f-section-in-nav ":"",l+=s?"f-section-in-managelist ":"",l+="f-section-grid",u.appearance={class:l},u.contents=[e],u}function an(r,e,t){const n=r.getSchemaByType("content-container");return n.id=`${e.id}-layout`,n.appearance={class:"f-grid-is-sub f-utils-flex-column"},n.contents=[e],n}function It(r,e,t){const i=t.parentComponentInstance.schema.type,a=i==="section"||i==="tab-page";e.appearance={class:"f-component-grid"};const u=(a?an:rn)(r,e,t);return on(r,u,t)}const Vt={$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:"行点击事件"}},ft={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}};xe.createPropsResolver(ft,Vt,kt,It),xe.createTreeGridSelectionItemResolver(),xe.createTreeGridBindingResolver();const sn=Object.assign({},ft,{componentId:{type:String,default:""}});xe.createPropsResolver(sn,Vt,kt,It),xe.createDataViewUpdateColumnsResolver();function ln(r,e,t,n,i,a,s,u,l,c,d,f,m,p,v,S,B){const{calculateCellPositionInRow:E}=a,{columnContext:F,hasLeftFixedColumn:$,hasRightFixedColumn:L}=s,{gridDataStyle:w,leftFixedGridDataStyle:x,rightFixedGridDataStyle:C}=p,{renderDataRow:g}=Y.getHierarchyRow(r,e,F,B,u,l,c,d,f,m,p,v,S),P=[g];function I(z,G){const me=E(z);return B.value.filter(j=>j.visible!==!1).map((j,N)=>P[j.type](j,me,G,N))}function y(){return o.createVNode("div",{ref:n,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:x.value},[I(F.value.leftColumns.filter(z=>z.visible),"left")])])}function D(){return o.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:w.value},[I(F.value.primaryColumns.filter(z=>z.visible),"primary")])])}function U(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:C.value},[I(F.value.rightColumns.filter(z=>z.visible),"right")])])}function q(){const z=[];return $.value&&z.push(y()),z.push(D()),L.value&&z.push(U()),z}return{renderDataArea:q}}const cn=o.defineComponent({name:"FTreeGrid",props:ft,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(r,e){var pe,se;const n=((pe=r.rowOption)==null?void 0:pe.height)||28,i=o.ref(20),a=o.ref(r.columns),s=Y.useIdentify(r),{idField:u}=s,l=o.ref(),c=o.ref(),d=o.ref(),f=o.ref(),m=o.ref(),p=o.ref([]),v=o.ref(!1),S=o.ref(((se=r.rowOption)==null?void 0:se.wrapContent)||!1),B=Y.useGroupData(r,s),E=Y.useFilter(),F=Y.useHierarchy(r),{collapseField:$}=F,{showLoading:L,renderLoading:w}=Y.useLoading(r,l),x=Y.useDataView(r,new Map,E,F,s),{dataView:C}=x,g=Y.useSelection(r,x,s,p,e),P=Y.useSelectHierarchyItem(r,p,x,s,g,e),I=o.computed(()=>r.disabled),y=o.computed(()=>r.virtualized?Math.min(x.dataView.value.length,i.value):x.dataView.value.length),{containerStyleObject:D}=Y.useDataViewContainerStyle(r),U=Y.useCommandColumn(r),{applyCommands:q}=U;q(a);const z=Y.useColumn(r),G=Y.useSort(r),{applyColumnSorter:me,columnContext:j,updateColumnRenderContext:N}=z;me(x,G);const H=Y.useGroupColumn(r,j),k=Y.useRow(r,e,g,s),J=Y.useEdit(r,e,s,k,p),ue=Y.useVisualDataBound(r),Me=Y.useVisualDataCell(r,J,ue),_=Y.useVisualDataRow(r,x,J,F,s,ue,Me),ye=Y.useVisualData(r,a,x,y,0,_),{getVisualData:he}=ye,ee=Y.useCellPosition(r,j),V=Y.useSidebar(r,g),{sidebarWidth:K}=V,ie=Y.useVirtualScroll(r,x,p,j,ye,y,0,K),{onWheel:Le,dataGridWidth:ke,viewPortHeight:Ie,viewPortWidth:Ve,resetScroll:Oe,updateVisibleRowsOnLatestVisibleScope:Pe}=ie,Fe=Y.useFitColumn(r,j,c,Ve,H),{calculateColumnsSize:Se}=Fe,ze=Y.useFilterHistory(),Ge=Y.useColumnFilter(c,m,x,ze,ie),He=Y.useDragColumn(r,e,z,x,H,B,ie),We=o.computed(()=>({"fv-grid":!0,"fv-grid-bordered":r.showBorder,"fv-grid-horizontal-bordered":r.showHorizontalLines,"fv-datagrid-strip":r.showStripe})),Ae=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":v.value,"fv-grid-wrap-content":S.value})),{renderDataArea:Ue}=ln(r,e,d,f,m,ee,z,x,J,F,k,g,P,ie,ye,ue,p),{renderGridHeader:b,renderGridColumnResizeOverlay:W,shouldShowHeader:ne}=Y.getColumnHeader(r,e,c,f,m,z,x,He,Ge,E,ze,Fe,H,g,V,G,ie,Ve,p),{renderDataGridSidebar:ge}=Y.getSidebar(r,k,g,V,ie),{renderDisableMask:Ee}=Y.getDisableMask(),{renderHorizontalScrollbar:Ye}=Y.getHorizontalScrollbar(r,c,ie),{renderVerticalScrollbar:ot}=Y.getVerticalScrollbar(r,c,ie);function Xe(){var O,A,de;if(c.value&&c.value.clientHeight>0&&((O=c.value)==null?void 0:O.clientWidth)>0){const be=Math.ceil(c.value.clientHeight/n);be>i.value&&(i.value=be,Pe()),Ie.value=((A=d.value)==null?void 0:A.clientHeight)||0,ke.value=((de=c.value)==null?void 0:de.clientWidth)||0,Se()}}o.onMounted(()=>{c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/n),i.value),p.value=he(0,y.value+0-1),qt.useResizeObserver(c.value,Xe),Se(),o.nextTick(()=>{c.value&&(ke.value=c.value.clientWidth),d.value&&(Ve.value=d.value.clientWidth,Ie.value=d.value.clientHeight)})),L.value&&w()}),o.onUnmounted(()=>{}),o.watch(Ve,()=>{c.value&&Se()});function ht(O){x.collapseTo(O),x.reOrderVisibleIndex(),Oe()}function yt(O){x.expandTo(O),x.reOrderVisibleIndex(),Oe()}function Qe(){const O=g.getSelectionRow();return O?O.dataIndex-1:-1}function gt(){const O=Qe();x.insertNewDataItem(O),p.value=he(0,y.value+0-1)}function vt(){const O=Qe();x.insertNewChildDataItem(O),p.value=he(0,y.value+0-1)}function bt(){const O=Qe(),A=P.getNextSelectableHierarchyItemId(O);x.removeHierarchyDataItem(O),p.value=he(0,y.value+0-1),A&&g.selectItemById(A)}function wt(O){J.onEditingRow(O)}function rt(O){J.acceptEditingRow(O)}function Ct(O){J.cancelEditingRow(O)}function it(O){O&&(a.value=O,q(a),N(a.value),me(x,G),Se())}o.watch(()=>r.columns,O=>{it(O)});function xt(O,A){O&&(x.load(O),x.reOrderVisibleIndex(),A!=null&&A.keepScrollPosition?ie.scrollTo(ie.offsetY.value):Oe())}function St(O){g.selectItemById(O)}function Tt(O){const A=p.value.find(de=>de.raw[s.idField.value]===O);A&&k.clickRowItem(A)}function at(O){k.activeRowById(O)}function jt(O){g.selectItemByIds(O)}function h(){return g.getSelectedItems()}function T(){g.clearSelection()}const M=o.computed(()=>!p.value||!p.value.length),{renderEmpty:R}=Y.getEmpty(e);function X(){return g.getSelectionRow()}function Q(O){g.unSelectItemByIds(O)}function we(){return g.currentSelectedDataId.value}function fe(O,A,de){const be=C.value.find(Ce=>Ce[u.value]===O);if(be){if(Object.keys(be).forEach(le=>{Object.prototype.hasOwnProperty.call(A,le)&&(be[le]=A[le])}),de){const{collapseField:le,disabledField:Re,checkedField:De,visibleField:qe}=de;le&&!oe.isUndefined(A[le])&&(be.__fv_collapse__=A[le]),De&&!oe.isUndefined(A[De])&&(be.__fv_checked__=A[De]),Re&&!oe.isUndefined(A[Re])&&(be.__fv_disabled__=A[Re]),qe&&!oe.isUndefined(A[qe])&&(be.__fv_visible__=A[qe])}const Ce=p.value.find(le=>le.raw[u.value]===O),Dt=p.value.findIndex(le=>le.raw[u.value]===O);if(Ce){if(Ce.raw=be,Object.keys(Ce.data).forEach(le=>{Ce.data[le].updateData(be)}),de){const{collapseField:le,disabledField:Re,checkedField:De,visibleField:qe}=de;le&&!oe.isUndefined(A[le])&&(Ce.collapse=A[le]),De&&!oe.isUndefined(A[De])&&(Ce.checked=A[De]),Re&&!oe.isUndefined(A[Re])&&(Ce.disabled=A[Re]),qe&&!oe.isUndefined(A[qe])&&(Ce.visible=A[qe])}p.value=[...p.value.slice(0,Dt),Ce,...p.value.slice(Dt+1)]}}}function ve(O){const A=x.dataView.value.find(de=>de[u.value]===O);return A?A[$.value]:""}function Te(){return $.value}e.expose({activeRowById:at,addNewDataItem:gt,addNewChildDataItem:vt,collapseTo:ht,expandTo:yt,removeDataItem:bt,editDataItem:wt,acceptDataItem:rt,cancelDataItem:Ct,updateColumns:it,updateDataSource:xt,selectItemById:St,selectItemByIds:jt,getSelectedItems:h,clearSelection:T,getSelectionRow:X,clickRowItemById:Tt,unSelectItemByIds:Q,getCurrentRowId:we,reassignRowData:fe,getCollapseField:Te,getCollapseStatusById:ve});const ae=o.computed(()=>{const O={};return ie.shouldShowHorizontalScrollbar.value&&(O.paddingBottom="10px"),ie.shouldShowVirticalScrollbar.value&&(O.paddingRight="10px"),O}),je=o.computed(()=>({...D.value,borderRadius:"5px"}));return()=>o.createVNode("div",{ref:l,class:We.value,style:je.value,onWheel:Le},[c.value&&ne.value&&b(),o.createVNode("div",{ref:c,class:Ae.value,onMouseover:()=>v.value=!0,onMouseleave:()=>v.value=!1,style:ae.value},[c.value&&ge(p),c.value&&Ue(),c.value&&M.value&&R(),c.value&&Ye(),c.value&&ot()]),W(),I.value&&Ee()])}});Je.withInstall(cn);const un=new Map([["appearance",ct]]);function dn(r,e,t){return e}lt({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"]},un,dn,{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:[]}}}}}});function fn(r,e,t){var C;const n=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=o.ref();function s(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function u(){return!1}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function d(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const P=o.ref(g==null?void 0:g.value.parent),I=d(P);return I||null}function f(g=e){var D;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(g);const{componentInstance:P,designerItemElementRef:I}=g;if(!P||!P.value)return null;const{getCustomButtons:y}=P.value;return P.value.canMove||y&&((D=y())!=null&&D.length)?I:f(g.parent)}function m(g){return!!t&&t.canAccepts(g)}function p(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function S(g,P){var I;!g||!P||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(g,P),(I=e==null?void 0:e.setupContext)==null||I.emit("dragEnd"))}function B(g,P){const{componentType:I}=g;let y=Nt(I,g,P);t&&t.onResolveNewComponentSchema&&(y=t.onResolveNewComponentSchema(g,y));const D=I.toLowerCase().replace(/-/g,"_");return y&&!y.id&&y.type===I&&(y.id=`${D}_${Math.random().toString().slice(2,6)}`),y}function E(g){g&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(g)}function F(...g){if(t&&t.getPropsConfig)return t.getPropsConfig(...g)}function $(g){if(!g)return;const P=e==null?void 0:e.schema,{formSchemaUtils:I}=g;if(P&&I.getExpressions().length){const y=I.getExpressions().findIndex(D=>D.target===P.id);y>-1&&I.getExpressions().splice(y,1)}}function L(g){t&&t.onRemoveComponent&&t.onRemoveComponent(),$(g),e!=null&&e.schema.contents&&e.schema.contents.map(P=>{let I=P.id;P.type==="component-ref"&&(I=P.component);const y=r.value.querySelectorAll(`#${I}-design-item`);y!=null&&y.length&&Array.from(y).map(D=>{var U;(U=D==null?void 0:D.componentInstance)!=null&&U.value.onRemoveComponent&&D.componentInstance.value.onRemoveComponent(g)})})}function w(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function x(g){if(t&&t.onPropertyChanged)return t.onPropertyChanged(g)}return a.value={canMove:s(),canSelectParent:u(),canDelete:l(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:i,canAccepts:m,getBelongedComponentInstance:d,getDraggableDesignItemElement:f,getDraggingDisplayText:p,getPropConfig:F,getDragScopeElement:v,onAcceptMovedChildElement:S,onChildElementMovedOut:E,addNewChildComponentSchema:B,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1),onRemoveComponent:L,getCustomButtons:w,onPropertyChanged:x},a}const pt=new Map([["appearance",ct]]),pn=new Map([]),mn="root-viewmodel";class hn{constructor(e,t){Z(this,"formSchemaUtils");Z(this,"controlCreatorUtils");Z(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),n=this.createComponentNode(e),i=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(n),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"),n=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:n}),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 n=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(n,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),t.contents=[n];const{selectedFields:a}=e;a==null||a.forEach(u=>{const l=oe.cloneDeep(u),c=this.resolveControlClassByFormColumns(e),d=this.controlCreatorUtils.setFormFieldProperty(l,"",c);d&&i.push(d)});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="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:mn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:n}=e;return n==null||n.forEach(i=>{let a="blur";const s=i.type.name;(s===Je.FormSchemaEntityFieldTypeName.Enum||s===Je.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}),t}}function yn(r,e,t,n){var a,s,u,l,c,d;const i=t.parentComponentInstance;if(i&&n){const f=(a=i.schema)==null?void 0:a.type,p={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=t.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(u=t.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:f==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(d=t.bindingSourceContext)==null?void 0:d.bindingEntityFields};return new hn(r,n).createComponent(p)}else return e}function gn(r,e,t){return e}lt({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"]},pt,yn);const Ot={$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}};xe.createPropsResolver(vn,Ot,pt,void 0),xe.createFormGroupEditorResolver();const bn=o.ref(0);function wn(){bn.value++}function Cn(r){const{formSchemaUtils:e,formStateMachineUtils:t}=r;function n(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function i(l,c=""){return e.getViewModelById(l).states.map(f=>n(f,c))}function a(l){const c=e.getRootViewModelId(),d=i(l);if(l===c)return d;const f=i(c,"root-component.");return[...d,...f]}function s(l){return l.binding&&l.binding.path||l.id||""}function u(){return t&&t.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:u}}class xn{constructor(e){Z(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);Z(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Z(this,"getExpressionConverter",(e,t)=>({convertFrom:(n,i,a,s)=>{const u=a.getExpressionRuleValue(e,t||i);return u&&u.value||""},convertTo:(n,i,a,s,u)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(f=>f.id===c&&f.value))?n.dictPickingExpressionId=c:delete n.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const n=this.formSchemaService.getExpressions();if(!n)return"";const i=n.find(s=>s.target===e);if(!i)return"";const a=i.rules.find(s=>s.type===t);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),n=this.formSchemaService.getViewModelById(t);if(!n||!n.states||n.states.length===0)return[];const i=[];return n.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(e,t,n="label"){return{id:e.id,name:e.name,bindingPath:e[n],parents:t}}buildEntityFieldsTreeData(e=null,t){const n=[];return e==null||e.forEach(i=>{var u;const a=this.createTreeNode(i,t);let s=[];(u=i.type)!=null&&u.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...t,i.label])),n.push({data:a,children:s,expanded:!0})}),n}buildChildEntityTreeData(e=null,t){const n=[];return e==null||e.forEach(i=>{var l,c;const a=this.createTreeNode(i,t),s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...t,i.label]),u=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...t,i.label]);u!=null&&u.length&&(s==null||s.push(...u)),n.push({data:a,children:s||[],expanded:!0})}),n}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const n=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),i=this.buildChildEntityTreeData(t.type.entities,[t.code]);return i!=null&&i.length&&(n==null||n.push(...i)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:n||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,n){const i=n==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,t),s=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(t)&&a?a.message:"",...s};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(e,t,n,i){const{expression:a,message:s,messageType:u}=t,l={id:`${e}_${n}`,type:n,value:a};return(n==="validate"||n==="dataPicking"||n==="required")&&(l.message=s),n==="dataPicking"&&(l.messageType=u),n==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,n,i){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,n,i,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(d=>d.targetType===t&&d.target===a);const c=d=>d.value.trim()==="";if(l){const d=l.rules.find(f=>f.id===s.id);if(d)c(s)?l.rules=l.rules.filter(f=>f.id!==s.id):(Object.assign(d,s),i==="validate"&&e.type==="form-group"&&(d.elementId=e.id));else{if(c(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(c(s))return null;l={target:`${a}`,rules:[s],targetType:t}}return l}getExpressionEditorOptions(e,t,n,i){return n.reduce((a,s)=>{var l,c;const u=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return a[s]={hide:t==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(u),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:d=>{const f=this.updateExpression(e,t,d,s);if(i){const m=this.buildRule(u,d,s);i(m)}return f}}},a},{})}getExpressionInfo(e,t,n){const i=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,n),s={value:a&&a.value,targetId:i,targetType:t,expressionType:n};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,n=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,n,i)}}}getExpressionOptions(e,t,n){const i=this.getExpressionInfo(e,t,n);return{dialogTitle:`${this.expressionNames[n]}编辑器`,singleExpand:!1,showMessage:n==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,n,t),expressionInfo:i}}}class Sn{constructor(e,t){Z(this,"componentId");Z(this,"viewModelId");Z(this,"eventsEditorUtils");Z(this,"formSchemaUtils");Z(this,"formMetadataConverter");Z(this,"designViewModelUtils");Z(this,"designViewModelField");Z(this,"controlCreatorUtils");Z(this,"designerHostService");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.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 n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.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:ce[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},n){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in t)a[s]=Object.assign(a[s]||{},t[s]);return{...i,properties:{...a},setPropertyRelates(s,u){if(s){switch(s&&s.propertyID){case"class":case"style":{Jt.value++;break}}n&&n(s,e,u)}}}}getPropertyEditorParams(e,t=[],n="visible",i={},a={}){const{getVariables:s,getControlName:u,getStateMachines:l}=Cn(this.designerHostService),c=this.getRealTargetType(e),d=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:d};return d.map(m=>{switch(m){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,c,n);break;case"StateMachine":f.stateMachines=l();break;case"Variable":Object.assign(f,{controlName:u(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:s(this.viewModelId),onBeforeOpenVariables:p=>{p.value=s(this.viewModelId)}},a);break}}),f}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="",n={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in n)s[l]=Object.assign(s[l]||{},n[l]);const u=this;return{...a,properties:{...s},setPropertyRelates(l,c){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,l);break}i&&i(l,c)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const i=n.contents.findIndex(s=>s.id===e),a=oe.cloneDeep(n.contents[i]);n.contents.splice(i,1),n.contents.splice(i,0,a),wn()}addNewVariableToViewModel(e,t){const n=e.propertyValue;if(!(n&&typeof n=="object")||!(n.type==="Variable"&&n.isNewVariable))return;const s={id:n.field,category:"locale",code:n.fullPath,name:n.fullPath,type:n.newVariableType||"String"};delete n.newVariableType,delete n.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(t).states.push(s)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:a,expressionInfo:s}=t,{targetId:u,targetType:l,expressionType:c,value:d,message:f}=s,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:p}=m;let v=p.find(B=>B.target===u);v||(v={target:u,rules:[],targetType:l},p.push(v));const S=v.rules.find(B=>B.type===c);if(S)S.value=d,S.message=f;else{const B={id:a,type:c,value:d,message:f};v.rules.push(B)}delete t.expressionInfo}clearExpression(e,t){const n=e.propertyValue;if(n&&n.type==="Expression")return;const a=e.propertyID,s=this.formSchemaUtils.getExpressions(),u=t.binding?t.binding.field:t.id,l=s.find(c=>c.target===u);!l||!l.rules||(l.rules=l.rules.filter(c=>c.type!==a))}getExpressionOptions(e,t,n){return new xn(this.formSchemaUtils).getExpressionOptions(e,t,n)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}const Tn={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};xe.createPropsResolver(Tn,Ot,pt,void 0);const jn={$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"]},Mn={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};xe.createPropsResolver(Mn,jn,pn,gn);const En={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 mt(){return new DOMException("The request is not allowed","NotAllowedError")}async function Nn(r){if(!navigator.clipboard)throw mt();return navigator.clipboard.writeText(r)}async function Bn(r){const e=document.createElement("span");e.textContent=r,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),n=window.document.createRange();t==null||t.removeAllRanges(),n.selectNode(e),t==null||t.addRange(n);let i=!1;try{i=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!i)throw mt()}async function kn(r){try{await Nn(r)}catch(e){try{await Bn(r)}catch(t){throw t||e||mt()}}}function In(){async function r(e){await kn(e)}return{onCopy:r}}function Vn(r,e,t,n){const i=o.ref(14),a=o.ref(140),s=o.ref(""),u=o.ref(n.value.length),l=o.computed(()=>n.value),c=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function d(f){if(f.currentTarget){const m=f.currentTarget.value||"";u.value=m.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:a.value,onInput:f=>d(f)},[l.value]),o.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+a.value])])}function On(r,e,t,n){const i=Vn(r,e,t,n),a=new Map([["text-area",i]]);function s(u){return a.get(u)||null}return{getEditorRender:s}}function Fn(){const r=o.ref(!1),e=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const n={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 n.opacity=r.value?"0.8":"0",n.display=r.value?"":"none",n}),feedbackMessage:e,toShowFeedback:r}}function $n(r,e){const t=e.getEditorRender(r.promptEditorType);return()=>t&&t()}function Pn(r){function e(m){if(m==null)return 0;let p=0;for(let v=0;v<m.length;v++){const S=m.charCodeAt(v);S>=0&&S<=128?p++:p=p+2}return p}function t(m,p){if(m!==""&&m!==void 0&&m!==null){m=""+m;const v=m.length;let S="",B=0;for(let E=0;E<v;E++){const F=m.charAt(E);if(B++,encodeURI(F).length>4&&B++,S=S.concat(F),B>=p)return S=S.concat("..."),S}if(B<p)return m}return""}const n=o.computed(()=>!!r.value&&!!r.value.date),i=o.computed(()=>`发生时间 : ${r.value&&r.value.date||""}`),a=o.computed(()=>!!r.value&&!!r.value.detail),s=o.computed(()=>r.value?e(r.value.detail)>160:!1),u=o.ref(!1),l=o.computed(()=>u.value?"收起":"展开"),c=o.computed(()=>{const m="详细信息 : "+(r.value&&r.value.detail)||"";return u.value?m:t(m,160)}),d=o.computed(()=>({position:"absolute",right:0,bottom:u.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function f(){u.value=!u.value}return()=>o.createVNode("div",{class:"toast-msg-detail"},[n.value&&o.createVNode("div",null,[i.value]),a.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("div",{innerHTML:c.value},null),s.value&&o.createVNode("span",{style:d.value,onClick:f},[l.value])])])])}function Rn(r){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:r.value},null)}function Dn(r,e,t,n){const i=o.ref(r.exceptionInfo),a=o.computed(()=>{const m={"f-icon":!0},p=`f-icon-${e.value}`;return m[p]=!0,m}),s=o.computed(()=>t.value||i.value&&i.value.message),u=o.computed(()=>n.value),l=o.computed(()=>!!n.value),c=o.computed(()=>!!i.value);function d(){return c.value?Pn(i):l.value?Rn(u):()=>null}const f=d();return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:a.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:s.value},null),f()])])}function qn(r,e,t){const{onCopy:n}=e,{toShowFeedback:i}=t,a=o.ref("复制成功"),s=o.ref("复制详细信息"),u=o.ref(r.exceptionInfo||{date:"",message:"",detail:""}),l=o.computed(()=>u.value&&u.value.detail||"");function c(d){n(l.value).catch(f=>{a.value="复制失败"}).finally(()=>{i.value=!0,setTimeout(()=>{i.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:c,style:"cursor: pointer;"},[s.value])])}function Ln(r,e,t,n){const i=o.ref(r.type),a=o.ref(r.buttons),s=o.ref(r.exceptionInfo),u=o.ref(r.okButtonText),l=o.ref(r.cancelButtonText),c=o.ref(!0),d=o.ref(!0),f=o.computed(()=>!!(a.value&&a.value.length)),m=o.computed(()=>s.value&&s.value.date&&s.value.message&&s.value.detail),p=o.computed(()=>!(a.value&&a.value.length)&&(u.value||l.value)),v=o.computed(()=>d.value&&u.value),S=o.computed(()=>c.value&&l.value),B=qn(r,t,n);function E($){i.value==="question"&&e.emit("reject"),e.emit("close")}function F($){i.value==="question"&&e.emit("accept"),e.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[m.value&&B(),p.value&&S.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:E},[l.value]),p.value&&v.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:F},[u.value]),f.value&&a.value.length&&a.value.map($=>o.createVNode("button",{type:"button",onClick:$.handle,class:$.class},[$.iconClass&&o.createVNode("span",{class:$.iconClass},null),$.text]))])}const nt=o.defineComponent({name:"FMessageBox",props:En,emits:["accept","reject","close"],setup(r,e){const t=o.ref(r.type),n=o.ref(r.title),i=o.ref(r.detail),a=o.computed(()=>{const B={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${t.value}`;return B[E]=!0,B}),s=o.computed(()=>{const B={};return t.value==="prompt"?B.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(B.padding="0.5rem 1.5rem 1rem 1.5rem"),B}),u=In(),l=On(r,t,n,i),c=Fn(),{feedbackStyle:d,feedbackMessage:f}=c;function m(){return o.createVNode("div",{style:d.value},[f.value])}function p(){switch(t.value){case"prompt":return $n(r,l);default:return Dn(r,t,n,i)}}const v=p(),S=Ln(r,e,u,c);return()=>o.createVNode("div",{class:"farris-messager"},[o.createVNode("section",{class:a.value,style:s.value},[v()]),S(),m()])}}),zn={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 re{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const n=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(n.length>=6){const i=parseInt(n[4],10),a=parseInt(n[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new re(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new re(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let n=0;n<e.changedTouches.length;n++)if(e.changedTouches[n].target===t)return new re(e.changedTouches[n].clientX,e.changedTouches[n].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 re(0,0);if(window){const n=window.getComputedStyle(e);if(n){const i=parseInt(n.getPropertyValue("left"),10),a=parseInt(n.getPropertyValue("top"),10);t.x=isNaN(i)?0:i,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new re(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 $e{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new $e(0,0);if(window){const n=window.getComputedStyle(e);return n&&(t.width=parseInt(n.getPropertyValue("width"),10),t.height=parseInt(n.getPropertyValue("height"),10)),t}return null}static copy(e){return new $e(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function Hn(r,e){const t=o.ref(),n=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),u=o.ref(),l=o.ref(),c=o.ref(),d=o.ref(),f=o.ref(),m=o.ref(),p=o.ref(r.resizeable),v=o.ref(),S=o.ref(r.draggable),B=o.ref(!1);function E(){const j=n.value||document.body,N=window.getComputedStyle(j);if(!N||!t.value)return;const H=re.getTransformInfo(t.value),k={};l.value&&(k.deltaL=t.value.offsetLeft-l.value.x,k.deltaT=t.value.offsetTop-l.value.y);const J=N.getPropertyValue("position");k.width=j.clientWidth,k.height=j.clientHeight,k.pr=parseInt(N.getPropertyValue("padding-right"),10),k.pb=parseInt(N.getPropertyValue("padding-bottom"),10),k.position=N.getPropertyValue("position"),J==="static"&&(j.style.position="relative"),k.translateX=H.x,k.translateY=H.y,f.value=k}function F(j){if(t.value){a.value=$e.getCurrent(t.value),s.value=re.getCurrent(t.value),u.value=a.value?$e.copy(a.value):null,l.value=s.value?re.copy(s.value):null,E();const N=j.target.getAttribute("type")||"";c.value={n:!!N.match(/n/),s:!!N.match(/s/),w:!!N.match(/w/),e:!!N.match(/e/)}}}function $(){var j,N,H,k;if(t.value){const J=t.value;c.value&&((c.value.n||c.value.s)&&((j=u.value)!=null&&j.height)&&(J.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((N=u.value)!=null&&N.width)&&(J.style.width=u.value.width+"px"),l.value&&((H=l.value)!=null&&H.x&&(J.style.left=l.value.x+"px"),(k=l.value)!=null&&k.y&&(J.style.top=l.value.y+"px")))}}function L(){const j=r.minHeight?r.minHeight:1,N=r.minWidth?r.minWidth:1;u.value&&l.value&&c.value&&a.value&&(u.value.height<j&&(u.value.height=j,c.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-j))),u.value.width<N&&(u.value.width=N,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-N))),r.maxHeight&&u.value.height>r.maxHeight&&(u.value.height=r.maxHeight,s.value&&c.value.n&&(l.value.y=s.value.y+(a.value.height-r.maxHeight))),r.maxWidth&&u.value.width>r.maxWidth&&(u.value.width=r.maxWidth,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-r.maxWidth))))}function w(){if(n.value){const j=f.value;if(l.value&&u.value&&c.value&&a.value){const N=j.width-j.pr-j.deltaL-j.translateX-l.value.x,H=j.height-j.pb-j.deltaT-j.translateY-l.value.y;c.value.n&&l.value.y+j.translateY<0&&s.value&&(l.value.y=-j.translateY,u.value.height=a.value.height+s.value.y+j.translateY),c.value.w&&l.value.x+j.translateX<0&&s.value&&(l.value.x=-j.translateX,u.value.width=a.value.width+s.value.x+j.translateX),u.value.width>N&&(u.value.width=N),u.value.height>H&&(u.value.height=H)}}}function x(j){if(!i.value||!a.value||!s.value||!c.value)return;j.subtract(i.value);const N=j.x,H=j.y;c.value.n?(l.value.y=s.value.y+H,u.value.height=a.value.height-H):c.value.s&&(u.value.height=a.value.height+H),c.value.e?u.value.width=a.value.width+N:c.value.w&&(u.value.width=a.value.width-N,l.value.x=s.value.x+N),w(),L(),$()}function C(j){if(!d.value)return;const N=re.fromEvent(j);N&&x(N)}function g(){if(t.value){const{width:j,height:N,x:H,y:k}=t.value.getBoundingClientRect(),J=re.getTransformInfo(t.value);return{size:{width:j,height:N},position:{x:H-J.x,y:k-J.y}}}return null}function P(j){if(t.value){const N=g();m.value=N}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,c.value=null,d.value=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",P)}function I(){document.addEventListener("mousemove",C),document.addEventListener("mouseup",P)}function y(j){j instanceof MouseEvent&&j.button===2||S.value&&(document.body.click(),j.stopPropagation(),j.preventDefault(),i.value=re.fromEvent(j),d.value=j.target,F(j),I())}function D(j){return t.value=j,p.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:N=>y(N)},null)])}function U(j=!0){document.body.click();const N=n.value||document.body,H=$e.getCurrent(N),k=t.value;j&&k&&(v.value=g(),v.value.transform=k.style.transform),H&&k&&(u.value=H,u.value.height-=14,u.value.width-=14,k.style.height=u.value.height+"px",k.style.width=u.value.width+"px",k.style.left="7px",k.style.top="7px",k.style.transform="",m.value={size:u.value,position:{x:0,y:0}},S.value=!1,B.value=!0)}function q(){var j,N;if(document.body.click(),v.value){const H={width:v.value.size.width||0,height:v.value.size.height||0},k={x:(window.innerWidth-H.width)/2,y:(window.innerHeight-H.height)/2};(j=u.value)==null||j.set(H),(N=l.value)==null||N.set(k);const J=t.value;J.style.height=H.height+"px",J.style.width=H.width+"px",J.style.left=`${k.x}px`,J.style.top=`${k.y}px`,J.style.transform="",m.value={size:H,position:k},S.value=r.draggable,B.value=!1}}function z(){if(t.value){const j=$e.getCurrent(t.value);if(j){const{width:N,height:H}=j;t.value.style.left=`${(window.innerWidth-N)/2}px`,t.value.style.top=`${(window.innerHeight-H)/2}px`,t.value.style.transform=""}}}function G(){const j=()=>{B.value?U(!1):z(),document.body.click()};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}}const me=G();return{renderResizeBar:D,boundingElement:n,resizedEventParam:m,maximize:U,restore:q,allowDrag:S,isMaximized:B,unWindowResizeHandle:me}}function An(r,e,t){const n=o.ref(),i=o.ref(r.draggable),a=o.ref(r.lockAxis),s=o.ref(),u=o.ref(),l=o.ref(!1),c=o.ref(new re(0,0)),d=o.ref(new re(0,0)),f=o.ref(new re(0,0)),m=o.ref(new re(0,0));o.watch(()=>t.value,C=>{s.value.style.cursor=C?"move":"default"});function p(C,g){if(g.tagName==="BUTTON")return!1;if(g===C)return!0;for(const P in g.children)if(Object.prototype.hasOwnProperty.call(g.children,P)&&p(C,g.children[P]))return!0;return!1}function v(){var I,y;let C=f.value.x+d.value.x,g=f.value.y+d.value.y;a.value==="x"?(C=((I=c.value)==null?void 0:I.x)||0,f.value.x=0):a.value==="y"&&(g=((y=c.value)==null?void 0:y.y)||0,f.value.y=0);const P=`translate3d(${Math.round(C)}px, ${Math.round(g)}px, 0px)`;n.value&&(n.value.style.transform=P),m.value.x=C,m.value.y=g}function S(){if(!u.value||!n.value)return null;const C=u.value.getBoundingClientRect(),g=n.value.getBoundingClientRect(),P={top:C.top<g.top,right:C.right>g.right,bottom:C.bottom>g.bottom,left:C.left<g.left};return P.top||(f.value.y-=g.top-C.top),P.bottom||(f.value.y-=g.bottom-C.bottom),P.right||(f.value.x-=g.right-C.right),P.left||(f.value.x-=g.left-C.left),v(),P}function B(C){C&&(c.value&&C.subtract(c.value),f.value.set(C),v(),S())}function E(C){l.value&&i.value&&(C.stopPropagation(),C.preventDefault(),B(re.fromEvent(C,s.value)))}function F(){var C;l.value&&(l.value=!1,d.value.add(f.value),f.value.reset(),(C=n.value)==null||C.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",F))}function $(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",E),document.addEventListener("mouseup",F))}function L(){if(n.value){const C=re.getTransformInfo(n.value);d.value.set(C);return}d.value.reset()}function w(C){if(!t.value||C instanceof MouseEvent&&C.button===2)return;const g=C.target||C.srcElement;s.value!==void 0&&g&&!p(g,s.value)||i.value!==!1&&(document.body.click(),C.stopPropagation(),C.preventDefault(),c.value=re.fromEvent(C,n.value),L(),$())}function x(C,g,P){if(i.value&&g){if(C)s.value=C;else if(r.dragHandle){if(r.dragHandle instanceof HTMLElement)s.value=r.dragHandle;else if(typeof r.dragHandle=="string"){const I=g.querySelector(r.dragHandle);I&&(s.value=I)}}n.value=g,u.value=P,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",w)):i.value=!1}}return{registerDraggle:x,resetTranslate:L}}function Ft(r,e){if(r){const t=n=>{n.key.toLowerCase()===r.toLowerCase()&&e({event:n,key:r})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Un(r,e){const t=o.ref(r.enableEsc);let n=null;return t.value?(n=Ft("Escape",i=>{e.emit("esc",{event:i.event,type:"esc"})}),{remove:n}):null}function _n(r,e){const t=o.ref(r.enableEnter);let n=null;return t.value?(n=Ft("Enter",i=>{e.emit("enter",{event:i.event,type:"enter"})}),{remove:n}):null}const _e=o.defineComponent({name:"FModal",props:zn,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(r,e){const t=o.ref(r.width||300),n=o.ref(r.height||200),i=o.ref(r.modelValue),a=o.ref(""),s=o.ref(r.class),u=o.ref(r.fitContent),l=o.ref(r.showHeader),c=o.ref(""),d=o.ref(r.showCloseButton),f=o.ref(r.showMaxButton),m=o.ref(!1),p=o.ref(r.dialogType),v=o.ref(r.src),S=o.ref(""),B=o.ref(r.showButtons),E=o.ref(r.title),F=o.ref(r.containment||null),$=o.ref(),L=o.ref(!1);function w(b,W){Promise.resolve().then(()=>{var ne;return(ne=r.beforeClose)==null?void 0:ne.call(r)}).then(ne=>{ne&&(i.value=!1,e.emit("update:modelValue",!1),W!=null&&e.emit(W?"accept":"cancel"),e.emit("closed",b))})}const x=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:b=>{w(b,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:b=>{w(b,!0)}}],C=o.ref(r.buttons&&r.buttons.length?r.buttons:x),g=o.computed(()=>!!c.value),P=o.computed(()=>!!B.value&&!!C.value),I=o.ref(),y=o.ref(),D=o.ref(!1),{renderResizeBar:U,maximize:q,restore:z,boundingElement:G,resizedEventParam:me,allowDrag:j,unWindowResizeHandle:N}=Hn(r),{registerDraggle:H}=An(r,e,j);function k(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function J(){const b=document.querySelectorAll(".farris-modal").length;(!b||b-1<=0)&&document.body.classList.remove("modal-open"),$.value&&$.value.classList.remove("show")}o.watch(()=>r.title,(b,W)=>{b!==W&&(E.value=b)}),o.watch(()=>r.modelValue,(b,W)=>{b!==W&&(i.value=b,i.value&&r.draggable&&o.nextTick(()=>{y.value&&!F.value&&(F.value=y.value.parentElement,G.value=F.value,H(I.value,y.value,G.value))}),b||(F.value&&(F.value=null),J())),i.value&&(L.value=k())}),o.watch(()=>r.showHeader,(b,W)=>{b!==W&&(l.value=b)}),o.watch(()=>r.showButtons,(b,W)=>{b!==W&&(B.value=b)}),o.watch(()=>me.value,(b,W)=>{const ne=b||{},ge=W||{};JSON.stringify(ne)!==JSON.stringify(ge)&&e.emit("resize",{newSize:b,oldSize:W,isMaximized:D.value})});const ue=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Me=o.computed(()=>{var ne;const b={modal:!0,"farris-modal":!0,fade:!0};b["f-modal-fitContent"]=!!u.value,b.show=!!ue.value;const W=(ne=r.maskClass)==null?void 0:ne.split(" ");return W==null||W.reduce((ge,Ee)=>(ge[Ee]=!0,ge),b),b}),_=o.computed(()=>{var ne;const b={"modal-dialog":!0},W=(ne=s.value)==null?void 0:ne.split(" ");return W==null||W.reduce((ge,Ee)=>(ge[Ee]=!0,ge),b),b}),ye=o.computed(()=>{const b={position:"absolute",top:`${(window.innerHeight-n.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${n.value}px`};return r.mask||(b.pointerEvents="auto"),b}),he=o.computed(()=>{const b={display:"block"};return r.mask||(b.pointerEvents="none",b.backgroundColor="transparent"),L.value&&(b.backgroundColor="transparent"),b}),ee=o.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),V=o.computed(()=>{const b={display:l.value?"":"none"};return b["pointer-events"]=j.value?"auto":"none",b}),K=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:D.value})),ie=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":p.value==="iframe","f-utils-fill":!0}));function Le(){return{height:`${r.footerHeight||60}px`}}const ke=o.computed(()=>{const b={textAlgin:S.value},W=Le();return Object.assign(b,W)});function Ie(b){if(b.stopPropagation(),D.value){D.value=!1,z();return}q(),D.value=!0}async function Ve(b,W){b.handle&&await b.handle(W,b)&&e.emit("closed",W)}function Oe(b){b.width&&(t.value=b.width),b.height&&(n.value=b.height),b.buttons&&(C.value=b.buttons),b.title&&(E.value=b.title)}let Pe=null,Fe=null;o.onBeforeMount(()=>{L.value=k()}),o.onMounted(()=>{y.value&&!F.value&&(F.value=y.value.parentElement,G.value=F.value,H(I.value,y.value,G.value)),ue.value&&document.body.classList.add("modal-open"),Pe=Un(r,e),Fe=_n(r,e)}),o.onUnmounted(()=>{N&&N(),Pe&&Pe.remove(),Fe&&Fe.remove()}),e.expose({modalElementRef:y,updateModalOptions:Oe,close:w,maxDialog:Ie,isMaximized:D});function Se(){return o.createVNode("ul",null,[m.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&o.createVNode("li",{onClick:Ie,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:K.value},null)]),d.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:b=>w(b,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function ze(){return o.createVNode("div",{class:"modal-footer",style:ke.value},[C.value&&C.value.map(b=>{const W=o.ref(b.disabled);return o.createVNode("button",{name:b.name,type:"button",disabled:W.value,class:b.class+(b.iconClass?" btn-icontext":""),onClick:ne=>{Ve(b,ne)}},[!!b.iconClass&&o.createVNode("i",{class:b.iconClass},null),b.text])})])}function Ge(){return o.createVNode("div",{ref:I,class:"modal-header",style:V.value},[e.slots.headerTemplate?e.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[g.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[E.value])]),o.createVNode("div",{class:"actions"},[Se()])])}function He(){return e.slots.footerTemplate?e.slots.footerTemplate():P.value&&ze()}function We(b){if(b.stopPropagation(),r.allowClickMaskToClose){if(b.target!==$.value)return;w(b,!1)}}function Ae(){var b,W;return o.createVNode("div",{id:a.value,class:_.value,style:ye.value,ref:y},[o.createVNode("div",{class:ee.value},[l.value&&Ge(),o.createVNode("div",{class:ie.value},[(W=(b=e.slots).default)==null?void 0:W.call(b),p.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:v.value},null)]),He()]),!u.value&&y.value&&!D.value&&U(y.value)])}function Ue(b){return b||"body"}return()=>o.createVNode(o.Teleport,{to:Ue(r.host)},{default:()=>[ue.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:$,class:Me.value,style:he.value,onClick:We},[Ae()])]})]})}});function $t(r){if(r.content&&r.content.render)return r.content.render;if(r.render&&typeof r.render=="function")return r.render}function Gn(r){const e=document.createElement("div");e.style.display="contents";const t=o.createApp({setup(n,i){o.onUnmounted(()=>{document.body.removeChild(e)});const a=o.ref(),s=o.ref(r.class||""),u=o.ref(!!r.showButtons),l=o.ref(!!r.showHeader),c=o.ref(r.showCloseButton==null?!0:r.showCloseButton),d=o.ref(!0),f=o.ref(r.title||""),m=r.acceptCallback||(()=>{}),p=r.rejectCallback||(()=>{}),v=r.closedCallback||($=>{}),S=r.resizeHandle||($=>{}),B=r.stopMoveHandle||($=>{}),E=$t(r),F=$=>{d.value=!1,t.unmount(),v($)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(_e,{ref:a,class:s.value,modelValue:d.value,"onUpdate:modelValue":$=>d.value=$,title:f.value,width:r.width,height:r.height,buttons:r.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:m,onCancel:p,fitContent:r.fitContent==null?!0:r.fitContent,onClosed:F,onResize:S,onStopMove:B},{default:()=>[E&&E(t)]})}});return document.body.appendChild(e),t.mount(e),t}class Pt{constructor(e){Z(this,"appContext",null);Z(this,"modalRef",o.ref());Z(this,"activeModalIndex",o.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",o.ref(!1));Z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:n,height:i}={width:window.innerWidth,height:window.innerHeight};return n<e&&(e=n-14),i<t&&(t=i-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Gn(t)}close(e){var t,n;e?(n=e.value)==null||n.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const n=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),i=o.ref(!0),a=n.value.acceptCallback||(()=>{}),s=n.value.rejectCallback||(()=>{}),u=n.value.closedCallback||((w,x)=>{}),l=n.value.resizeHandle||(w=>{}),c=e.stopMoveHandle||(w=>{});let d;const f=$t(n.value),m=w=>{var C;i.value=!1;const x=(C=w==null?void 0:w.target)==null?void 0:C.classList.contains("modal_close");u(w,this.isUseEscCloseModal.value?"esc":x?"icon":"button")},p=w=>{m(w),d&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,t),d=null,this.modalRef.value=null,this.modalRefs){const x=Object.keys(this.modalRefs).map(C=>Number(C));x.length>0?this.activeModalIndex.value=Math.max(...x):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},v=w=>{var x;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((x=this.activeModalInstance.value)==null||x.close(w==null?void 0:w.event))},{width:S,height:B}=n.value,E=this.adaptToWindow(S||500,B||320);Object.assign(n.value,E);const F=()=>o.createVNode(_e,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":w=>i.value=w},n.value,{onAccept:a,onCancel:s,onClosed:p,onResize:l,onEsc:v,onStopMove:c}),{default:()=>[f&&f(this.app)]});return d=(w=>{const x=o.h(F,w);return x.appContext=this.appContext,o.render(x,t),x})({...n.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{n.value={...n.value,...w},d&&o.render(o.cloneVNode(d,{...n}),t)},destroy:p,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Wn=Symbol("FModalService");_e.install=r=>{r.component(_e.name,_e);const e=new Pt(r);r.provide(Wn,e),r.provide("FModalService",e)};class Be{static show(e){const t=o.reactive({...e}),n=!1,i=t.type==="error"||t.type==="prompt",a=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",s=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{});let l=null,c=new Pt(l);const d=()=>{l&&(l==null||l.destroy(),c=null)};return l=c==null?void 0:c.open({class:"modal-message modal-message-type-info",title:a,showButtons:n,showHeader:i,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>o.createVNode(nt,o.mergeProps(t,{onAccept:s,onReject:u,onClose:d}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const n=o.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(n)}static warning(e,t){const n=o.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(n)}static success(e,t){const n=o.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Be.show(n)}static error(e,t,n){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:n,message:e,detail:t}});Be.show(i)}static prompt(e,t){const n=o.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Be.show(n)}static question(e,t,n,i){const a=o.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:n,rejectCallback:i});Be.show(a)}}nt.install=r=>{r.component(nt.name,nt),r.provide("FMessageBoxService",Be)};class Yn extends Sn{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.behavior=this.getBehaviorConfig(e),this.propertyConfig}}function Xn(r,e){const t=r.schema,n=new Qt;function i(p){var E;const{componentType:v,sourceType:S,sourceElement:B}=p;return!!(S==="control"&&v===ce["query-solution"].type||S==="move"&&v===ce.section.type&&((E=B==null?void 0:B.className)!=null&&E.includes("f-section-scheme")))}function a(){const p=e==null?void 0:e.formSchemaUtils;return p.selectNode(t,S=>{if(S.type==="component-ref"){const B=p.getComponentById(S.component);if((B==null?void 0:B.componentType)==="data-grid"&&p.selectNode(B,F=>F.type==="data-grid"&&!F.fieldEditable))return!0}})}function s(p){var E;const v=(E=t.appearance)==null?void 0:E.class,{sourceType:S}=p;return v&&v.includes("f-page-is-managelist")?S==="control"?!(t.contents&&t.contents.find($=>{var L,w;return $.type===ce.section.type&&((w=(L=$.appearance)==null?void 0:L.class)==null?void 0:w.includes("f-section-scheme"))}))&&a():S==="move":!1}function u(p){if(i(p))return s(p);if(!Xt().basalDragulaRuleForContainer(p,e))return!1;const{canAccept:S}=n.getTemplateRule(r,e);return S}function l(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function c(){const{canMove:p}=n.getTemplateRule(r,e);return p}function d(){const{canDelete:p}=n.getTemplateRule(r,e);return p}function f(){const{canMove:p,canDelete:v}=n.getTemplateRule(r,e);return!p&&!v}function m(p){const v=new Yn(p,e),{schema:S}=r;return v.getPropertyConfig(S)}return{canAccepts:u,getStyles:l,checkCanMoveComponent:c,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:f,getPropsConfig:m}}const Rt=o.defineComponent({name:"FContentContainerDesign",props:Ze,emits:[],setup(r,e){const t=o.ref(),n=o.inject("designer-host-service"),i=o.inject("design-item-context"),a=Xn(i,n),s=fn(t,i,a),u=o.computed(()=>{const l={"drag-container":!0};return Je.getCustomClass(l,r==null?void 0:r.customClass)});return o.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>o.createVNode("div",{ref:t,class:u.value,style:r.customStyle,"data-dragref":`${i.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),Qn={install(r){r.component(Ke.name,Ke)},register(r,e,t,n){r["content-container"]=Ke,e["content-container"]=ut},registerDesigner(r,e,t){r["content-container"]=Rt,e["content-container"]=ut}};te.ContentContainer=Ke,te.ContentContainerDesign=Rt,te.contentContainerProps=Ze,te.default=Qn,te.propsResolver=ut,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(te,o){typeof exports=="object"&&typeof module<"u"?o(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"],o):(te=typeof globalThis<"u"?globalThis:te||self,o(te["content-container"]={},te.Vue,te.LodashES,te.common,te.VueUseCore,te.dynamicResolver,te.dataView))})(this,function(te,o,oe,Je,qt,xe,Y){"use strict";var Jn=Object.defineProperty;var Zn=(te,o,oe)=>o in te?Jn(te,o,{enumerable:!0,configurable:!0,writable:!0,value:oe}):te[o]=oe;var Z=(te,o,oe)=>Zn(te,typeof o!="symbol"?o+"":o,oe);const Mt={},Et={};function st(r){const{properties:e,title:t,ignore:n}=r,i=n&&Array.isArray(n),a=Object.keys(e).reduce((s,u)=>((!i||!n.find(l=>l===u))&&(s[u]=e[u].type==="object"&&e[u].properties?st(e[u]):oe.cloneDeep(e[u].default)),s),{});if(t&&(!i||!n.find(s=>s==="id"))){const s=t.toLowerCase().replace(/-/g,"_");a.id=`${s}_${Math.random().toString().slice(2,6)}`}return a}function Lt(r){const{properties:e,title:t,required:n}=r;if(n&&Array.isArray(n)){const i=n.reduce((a,s)=>(a[s]=e[s].type==="object"&&e[s].properties?st(e[s]):oe.cloneDeep(e[s].default),a),{});if(t&&n.find(a=>a==="id")){const a=t.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}return{type:t}}function Nt(r,e={},t){const n=Mt[r];if(n){let i=Lt(n);const a=Et[r];return i=a?a({getSchemaByType:Nt},i,e,t):i,i}return null}function zt(r,e){const t=st(e);return Object.keys(t).reduce((n,i)=>(Object.prototype.hasOwnProperty.call(r,i)&&(n[i]&&oe.isPlainObject(n[i])&&oe.isPlainObject(r[i]||!r[i])?Object.assign(n[i],r[i]||{}):n[i]=r[i]),n),t),t}function Bt(r,e){return Object.keys(r).filter(n=>r[n]!=null).reduce((n,i)=>{if(e.has(i)){const a=e.get(i);if(typeof a=="string")n[a]=r[i];else{const s=a(i,r[i],r);Object.assign(n,s)}}else n[i]=r[i];return n},{})}function Ht(r,e,t=new Map){const n=zt(r,e);return Bt(n,t)}function At(r={}){function e(c,d,f,m){if(typeof f=="number")return m[c].length===f;if(typeof f=="object"){const p=Object.keys(f)[0],v=f[p];if(p==="not")return Number(m[c].length)!==Number(v);if(p==="moreThan")return Number(m[c].length)>=Number(v);if(p==="lessThan")return Number(m[c].length)<=Number(v)}return!1}function t(c,d,f,m){return m[c]&&m[c].propertyValue&&String(m[c].propertyValue.value)===String(f)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((c,d)=>(c.set(d,r[d]),c),n);function i(c,d){const f=c;return typeof d=="number"?[{target:f,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:f,operator:"getProperty",param:c,value:!!d}]:typeof d=="object"?Object.keys(d).map(m=>{if(m==="length")return{target:f,operator:"length",param:null,value:d[m]};const p=m,v=d[m];return{target:f,operator:"getProperty",param:p,value:v}}):[]}function a(c){return Object.keys(c).reduce((f,m)=>{const p=i(m,c[m]);return f.push(...p),f},[])}function s(c,d){if(n.has(c.operator)){const f=n.get(c.operator);return f&&f(c.target,c.param,c.value,d)||!1}return!1}function u(c,d){return a(c).reduce((p,v)=>p&&s(v,d),!0)}function l(c,d){const f=Object.keys(c),m=f.includes("allOf"),p=f.includes("anyOf"),v=m||p,E=(v?c[v?m?"allOf":"anyOf":"allOf"]:[c]).map($=>u($,d));return m?!E.includes(!1):E.includes(!0)}return{parseValueSchema:l}}const ce={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:"筛选条"}},Ut={},_t={};At();function lt(r,e,t=new Map,n=(s,u,l,c)=>u,i={},a=s=>s){return Mt[e.title]=e,Et[e.title]=n,Ut[e.title]=i,_t[e.title]=a,(s={},u=!0)=>{if(!u)return Bt(s,t);const l=Ht(s,e,t),c=Object.keys(r).reduce((d,f)=>(d[f]=r[f].default,d),{});return Object.assign(c,l)}}function ct(r,e){return{customClass:e.class,customStyle:e.style}}const Gt=new Map([["appearance",ct]]),Wt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/content-container.schema.json",title:"content-container",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"content-container"},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"]};function Yt(r,e,t){return e}const Ze={customClass:{type:String,default:""},customStyle:{type:String,default:""},visible:{type:Boolean,default:!0}},ut=lt(Ze,Wt,Gt,Yt),Ke=o.defineComponent({name:"FContentContainer",props:Ze,emits:[],setup(r,e){return()=>r.visible&&o.createVNode("div",{class:r.customClass,style:r.customStyle},[e.slots.default&&e.slots.default()])}});function Xt(){function r(e,t){var s;if(!e)return!1;const n=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const i=n.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(n.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![ce["response-layout-item"].type,ce["response-form"].type,ce.fieldset.type].includes(i)||(e.componentType===ce.tabs.type||e.componentType===ce.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![ce["content-container"].type,ce["splitter-pane"].type,ce["response-layout-item"].type].includes(i))||e.componentType===ce["query-solution"].type||e.componentType===ce.fieldset.type&&i!==ce["response-form"].type)}return{basalDragulaRuleForContainer:r}}class Qt{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,i=n==null?void 0:n.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!i)return a;const s=this.getComponentContext(e),{componentClassList:u}=s;return u.forEach(l=>{if(!l||!i[l])return;const{canMove:c,canDelete:d,canAccept:f}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(c,s),a.canDelete=a.canDelete&&this.resolveRuleValue(d,s),a.canAccept=a.canAccept&&this.resolveRuleValue(f,s)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let i=!0;for(const a of n){if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:s}=t;if(s&&!s.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:s}=t;if(!s||s.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:s}=t;if(s&&!s.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:s}=t;if(!s||s.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:s}=t;if(s&&!s.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:s}=t;if(s&&s.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(e){var S,B,E,F;const t=e.schema,n=t.appearance&&t.appearance.class||"",i=n.split(" ")||[],a=t.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],c=(S=s==null?void 0:s.contents)!=null&&S.length?s==null?void 0:s.contents[0]:null,d=c&&c.appearance?c.appearance.class:"",f=d?d.split(" "):[],m=t.type==="component"?(E=(B=e.parent)==null?void 0:B.parent)==null?void 0:E.schema:(F=e.parent)==null?void 0:F.schema,p=m&&m.appearance&&m.appearance.class||"",v=p?p.split(" "):[];return{componentClass:n,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:d,secondLevelChildClassList:f,parentSchema:m,parentClass:p,parentClassList:v}}}const Jt=o.ref(0);var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function et(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zt={exports:{}};(function(r,e){(function(t){r.exports=t()})(function(){return function(){function t(n,i,a){function s(c,d){if(!i[c]){if(!n[c]){var f=typeof et=="function"&&et;if(!d&&f)return f(c,!0);if(u)return u(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var p=i[c]={exports:{}};n[c][0].call(p.exports,function(v){var S=n[c][1][v];return s(S||v)},p,p.exports,t,n,i,a)}return i[c].exports}for(var u=typeof et=="function"&&et,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,n,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(f){var m=a[f];return m?m.lastIndex=0:a[f]=m=new RegExp(s+f+u,"g"),m}function c(f,m){var p=f.className;p.length?l(m).test(p)||(f.className+=" "+m):f.className=m}function d(f,m){f.className=f.className.replace(l(m)," ").trim()}n.exports={add:c,rm:d}},{}],2:[function(t,n,i){(function(a){var s=t("contra/emitter"),u=t("crossvent"),l=t("./classes"),c=document,d=c.documentElement;function f(y,D){var U=arguments.length;U===1&&Array.isArray(y)===!1&&(D=y,y=[]);var q,z,G,me,j,N,H,k,J,ue=null,Me,_,ye=!1,he=0,ee,V=D||{};V.moves===void 0&&(V.moves=F),V.accepts===void 0&&(V.accepts=F),V.invalid===void 0&&(V.invalid=We),V.containers===void 0&&(V.containers=y||[]),V.isContainer===void 0&&(V.isContainer=E),V.copy===void 0&&(V.copy=!1),V.copySortSource===void 0&&(V.copySortSource=!1),V.revertOnSpill===void 0&&(V.revertOnSpill=!1),V.removeOnSpill===void 0&&(V.removeOnSpill=!1),V.direction===void 0&&(V.direction="vertical"),V.ignoreInputTextSelection===void 0&&(V.ignoreInputTextSelection=!0),V.mirrorContainer===void 0&&(V.mirrorContainer=c.body);var K=s({containers:V.containers,start:Ge,end:Ae,cancel:ge,remove:ne,destroy:Ve,canMove:ze,dragging:!1});return V.removeOnSpill===!0&&K.on("over",yt).on("out",Qe),Le(),K;function ie(h){return K.containers.indexOf(h)!==-1||V.isContainer(h)}function Le(h){var T=h?"remove":"add";v(d,T,"mousedown",Pe),v(d,T,"mouseup",b)}function ke(h){var T=h?"remove":"add";v(d,T,"mousemove",Fe)}function Ie(h){var T=h?"remove":"add";u[T](d,"selectstart",Oe),u[T](d,"click",Oe)}function Ve(){Le(!0),b({})}function Oe(h){Me&&h.preventDefault()}function Pe(h){me=h.clientX,j=h.clientY;var T=S(h)!==1||h.metaKey||h.ctrlKey;if(!T){var M=h.target,R=Se(M);R&&(Me=R,ke(),h.type==="mousedown"&&(x(M)?M.focus():h.preventDefault()))}}function Fe(h){if(Me){if(S(h)===0){b({});return}if(!(h.clientX!==void 0&&Math.abs(h.clientX-me)<=(V.slideFactorX||0)&&h.clientY!==void 0&&Math.abs(h.clientY-j)<=(V.slideFactorY||0))){if(V.ignoreInputTextSelection){var T=I("clientX",h)||0,M=I("clientY",h)||0,R=c.elementFromPoint(T,M);if(x(R))return}var X=Me;ke(!0),Ie(),Ae(),He(X),l.add(k||G,"gu-transit"),vt(),gt(),he=0,Xe(h)}}}function Se(h){if(!(K.dragging&&q)&&!ie(h)){for(var T=h;w(h)&&ie(w(h))===!1;)if(V.invalid(h,T)||(h=w(h),!h))return;var M=w(h);if(M&&!V.invalid(h,T)){var R=V.moves(h,M,T,g(h));if(R)return{item:h,source:M}}}}function ze(h){return!!Se(h)}function Ge(h){var T=Se(h);T&&He(T)}function He(h){jt(h.item,h.source)&&(k=h.item.cloneNode(!0),K.emit("cloned",k,h.item,"copy")),z=h.source,G=h.item,N=H=g(h.item),K.dragging=!0,K.emit("drag",G,z)}function We(){return!1}function Ae(){if(K.dragging){var h=k||G;W(h,w(h))}}function Ue(){Me=!1,ke(!0),Ie(!0)}function b(h){if(Ue(),!!K.dragging){var T=k||G,M=I("clientX",h)||0,R=I("clientY",h)||0,X=B(q,M,R),Q=ot(X,M,R);Q&&(k&&V.copySortSource||!k||Q!==z)?W(T,Q):V.removeOnSpill?ne():ge()}}function W(h,T){var M=w(h);k&&V.copySortSource&&T===z&&M.removeChild(G),Ye(T)?K.emit("cancel",h,z):K.emit("drop",h,T,z,H),Ee()}function ne(){if(K.dragging){var h=k||G,T=w(h);T&&T.removeChild(h),K.emit(k?"cancel":"remove",h,T,z),Ee()}}function ge(h){if(K.dragging){var T=arguments.length>0?h:V.revertOnSpill,M=k||G,R=w(M),X=Ye(R);X===!1&&T&&(k?R&&R.removeChild(k):z.insertBefore(M,N)),X||T?K.emit("cancel",M,z,z):K.emit("drop",M,R,z,H),Ee()}}function Ee(){var h=k||G;Ue(),bt(),wt(),h&&l.rm(h,"gu-transit"),J&&clearTimeout(J),K.dragging=!1,ue&&K.emit("out",h,ue,z),K.emit("dragend",h,he),z=G=k=N=H=J=ue=null}function Ye(h,T){var M;return T!==void 0?M=T:q?M=H:M=g(k||G),h===z&&M===N}function ot(h,T,M){for(var R=h;R&&!X();)R=w(R);return R;function X(){var Q=ie(R);if(Q===!1)return!1;var we=rt(R,h),fe=at(R,we,T,M),ve=Ye(R,fe);return ve?!0:V.accepts(G,R,z,fe)}}function Xe(h){if(!q)return;h.preventDefault();var T=I("clientX",h)||0,M=I("clientY",h)||0;q.style.left=T-2+"px",q.style.top=M-2+"px";var R=k||G,X=B(q,T,M),Q=ot(X,T,M),we=Q!==null&&Q!==ue;(we||Q===null)&&(pe(),ue=Q,je()),Tt(X,M);var fe=w(R);if(Q===z&&k&&!V.copySortSource){fe&&fe.removeChild(R);return}var ve,Te=rt(Q,X);if(ye=Ct(Te,Q),Te!==null)ve=at(Q,Te,T,M);else if(V.revertOnSpill===!0&&!k)ve=N,Q=z;else{k&&fe&&fe.removeChild(R),k&&_&&(_.style.display="none");return}_.style.display="block",ht(ve,R,we),ve?xt(Te,ve):St(Q);function ae(se){K.emit(se,R,ue,z)}function je(){we&&ae("over")}function pe(){ue&&ae("out")}}function ht(h,T,M){(h===T||h===g(T))&&(H=g(T)),(h===null&&M||h!==T&&h!==g(T))&&(H=h)}function yt(h){l.rm(h,"gu-hide")}function Qe(h){K.dragging&&l.add(h,"gu-hide")}function gt(){q||(q=document.createElement("div"),q.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;",q.innerHTML=V.getMirrorText&&V.getMirrorText(G)||"控件",l.add(q,"gu-mirror"),V.mirrorContainer.appendChild(q),v(d,"add","mousemove",Xe),l.add(V.mirrorContainer,"gu-unselectable"),K.emit("cloned",q,G,"mirror"))}function vt(){if(_=document.createElement("div"),l.add(_,"gu-insertion"),G){var h=G.getBoundingClientRect();_.style.left=h.left+"px",_.style.top=h.top+"px"}ye=!1,V.mirrorContainer.appendChild(_)}function bt(){q&&(l.rm(V.mirrorContainer,"gu-unselectable"),v(d,"remove","mousemove",Xe),w(q).removeChild(q),q=null)}function wt(){_&&(w(_).removeChild(_),_=null)}function rt(h,T){for(var M=T;M!==h&&w(M)!==h;)M=w(M);return M===d?null:M}function Ct(h,T){if(!T)return ye;var M=h||T&&T.lastElementChild;if(!M)return!0;var R=getComputedStyle(h),X=/^inline/.test(R.getPropertyValue("display"))||/^(left|right)$/.test(R.getPropertyValue("float"));if(X)return!0;if(T){var Q=getComputedStyle(T),we=Q.getPropertyValue("display");if(/flex$/.test(we)){var fe=Q.getPropertyValue("flex-direction")||"row";if(fe==="row"||fe==="row-reverse")return!it(T)}return!1}return!0}function it(h){if(!h.children||!h.children.length)return!1;for(const T of Array.from(h.children)){const R=(T.className&&T.className.split(" ")||[]).filter(X=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(X));if(!R.length)return!1;for(const X of R){const Q=X.slice(X.lastIndexOf("-")+1);if(parseInt(Q,10)!==12)return!1}}return!0}function xt(h,T){const M=T.getBoundingClientRect();if(_.style.left=M.left+"px",_.style.top=M.top+"px",ye){if(_.style.height=M.height+"px",_.style.width="4px",h){const R=h.getBoundingClientRect();R.top!==M.top&&(_.style.left=R.right+"px",_.style.top=R.top+"px",_.style.height=R.height+"px")}}else if(_.style.height="4px",_.style.width=M.width+"px",ee){const R=ee.getBoundingClientRect();M.top<R.top&&(_.style.display="none")}T===G&&G&&(_.style.display="none")}function St(h){H=null;var T=h.lastElementChild;if(T){var M=T.getBoundingClientRect();ye?(_.style.left=M.right+"px",_.style.top=M.top+"px",_.style.height=M.height+"px",_.style.width="4px"):(_.style.left=M.left+"px",_.style.top=M.bottom+"px",_.style.height="4px",_.style.width=M.width+"px"),T===G&&G&&(_.style.display="none")}else _.style.display="none"}function Tt(h,T){if(!V.mirrorContainer.contains(h)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ee=m(h),!ee||!ee.contains(h)))return;const M=document.querySelector(".dgComponentSelected"),R=ee.getBoundingClientRect();if(T-30<R.top&&ee.scrollTop>0){let X=ee.scrollTop<10?ee.scrollTop:10;ee.scrollBy(0,-1*X),M&&ee.contains(M)&&(he=he+-1*X)}if(T+30>R.bottom&&ee.scrollTop<ee.scrollHeight-ee.clientHeight){const X=ee.scrollHeight-ee.clientHeight-ee.scrollTop;let Q=X<10?X:10;ee.scrollBy(0,Q),M&&ee.contains(M)&&(he=he+Q)}}function at(h,T,M,R){var X=V.direction==="horizontal",Q=V.direction==="mixed",we=T!==h?ve():fe();return we;function fe(){var ae=h.children.length,je,pe,se;for(je=0;je<ae;je++)if(pe=h.children[je],se=pe.getBoundingClientRect(),X&&se.left+se.width/2>M||!Q&&!X&&se.top+se.height/2>R||Q&&se.left+se.width>M&&se.top+se.height>R)return pe;return null}function ve(){var ae=T.getBoundingClientRect();if(Q){var je=R-ae.top,pe=M-ae.left,se=ae.bottom-R,O=ae.right-M,A=Math.min(pe,O,je,se),de;return ye?de=O<pe:de=se===A||O===A||pe===A,Te(de)}return Te(X?M>ae.left+$(ae)/2:R>ae.top+L(ae)/2)}function Te(ae){return ae?g(T):T}}function jt(h,T){return typeof V.copy=="boolean"?V.copy:V.copy(h,T)}}function m(y){const D=Array.from(window.scrollContainerList);if(D.length===1){const q=Array.from(window.scrollContainerList)[0];return document.getElementById(q)}const U=p(D);for(const q of U)if(q.contains(y))return q;return null}function p(y){const D=[];return y.forEach(U=>{const q=document.getElementById(U);q&&D.push(q)}),D.sort((U,q)=>U.contains(q)?1:q.contains(U)?-1:0),D}function v(y,D,U,q){var z={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},G={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},me={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[D](y,G[U],q):a.navigator.msPointerEnabled?u[D](y,me[U],q):(u[D](y,z[U],q),u[D](y,U,q))}function S(y){if(y.touches!==void 0)return y.touches.length;if(y.which!==void 0&&y.which!==0)return y.which;if(y.buttons!==void 0)return y.buttons;var D=y.button;if(D!==void 0)return D&1?1:D&2?3:D&4?2:0}function B(y,D,U){y=y||{};var q=y.className||"",z;return y.className+=" gu-hide",z=c.elementFromPoint(D,U),y.className=q,z}function E(){return!1}function F(){return!0}function $(y){return y.width||y.right-y.left}function L(y){return y.height||y.bottom-y.top}function w(y){return y.parentNode===c?null:y.parentNode}function x(y){return y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||C(y)}function C(y){return!y||y.contentEditable==="false"?!1:y.contentEditable==="true"?!0:C(w(y))}function g(y){return y.nextElementSibling||D();function D(){var U=y;do U=U.nextSibling;while(U&&U.nodeType!==1);return U}}function P(y){return y.targetTouches&&y.targetTouches.length?y.targetTouches[0]:y.changedTouches&&y.changedTouches.length?y.changedTouches[0]:y}function I(y,D){var U=P(D),q={pageX:"clientX",pageY:"clientY"};return y in q&&!(y in U)&&q[y]in U&&(y=q[y]),U[y]}n.exports=f}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,n,i){n.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(t,n,i){var a=t("ticky");n.exports=function(u,l,c){u&&a(function(){u.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,n,i){var a=t("atoa"),s=t("./debounce");n.exports=function(l,c){var d=c||{},f={};return l===void 0&&(l={}),l.on=function(m,p){return f[m]?f[m].push(p):f[m]=[p],l},l.once=function(m,p){return p._once=!0,l.on(m,p),l},l.off=function(m,p){var v=arguments.length;if(v===1)delete f[m];else if(v===0)f={};else{var S=f[m];if(!S)return l;S.splice(S.indexOf(p),1)}return l},l.emit=function(){var m=a(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var p=(f[m]||[]).slice(0);return function(){var v=a(arguments),S=this||l;if(m==="error"&&d.throws!==!1&&!p.length)throw v.length===1?v[0]:v;return p.forEach(function(E){d.async?s(E,v,S):E.apply(S,v),E._once&&l.off(m,E)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,n,i){(function(a){var s=t("custom-event"),u=t("./eventmap"),l=a.document,c=m,d=v,f=[];a.addEventListener||(c=p,d=S),n.exports={add:c,remove:d,fabricate:B};function m(w,x,C,g){return w.addEventListener(x,C,g)}function p(w,x,C){return w.attachEvent("on"+x,F(w,x,C))}function v(w,x,C,g){return w.removeEventListener(x,C,g)}function S(w,x,C){var g=$(w,x,C);if(g)return w.detachEvent("on"+x,g)}function B(w,x,C){var g=u.indexOf(x)===-1?I():P();w.dispatchEvent?w.dispatchEvent(g):w.fireEvent("on"+x,g);function P(){var y;return l.createEvent?(y=l.createEvent("Event"),y.initEvent(x,!0,!0)):l.createEventObject&&(y=l.createEventObject()),y}function I(){return new s(x,{detail:C})}}function E(w,x,C){return function(P){var I=P||a.event;I.target=I.target||I.srcElement,I.preventDefault=I.preventDefault||function(){I.returnValue=!1},I.stopPropagation=I.stopPropagation||function(){I.cancelBubble=!0},I.which=I.which||I.keyCode,C.call(w,I)}}function F(w,x,C){var g=$(w,x,C)||E(w,x,C);return f.push({wrapper:g,element:w,type:x,fn:C}),g}function $(w,x,C){var g=L(w,x,C);if(g){var P=f[g].wrapper;return f.splice(g,1),P}}function L(w,x,C){var g,P;for(g=0;g<f.length;g++)if(P=f[g],P.element===w&&P.type===x&&P.fn===C)return g}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,n,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));n.exports=s}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,n,i){(function(a){var s=a.CustomEvent;function u(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}n.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(c,d){var f=document.createEvent("CustomEvent");return d?f.initCustomEvent(c,d.bubbles,d.cancelable,d.detail):f.initCustomEvent(c,!1,!1,void 0),f}:function(c,d){var f=document.createEventObject();return f.type=c,d?(f.bubbles=!!d.bubbles,f.cancelable=!!d.cancelable,f.detail=d.detail):(f.bubbles=!1,f.cancelable=!1,f.detail=void 0),f}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,n,i){var a=n.exports={},s,u;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=c}catch{u=c}})();function d(L){if(s===setTimeout)return setTimeout(L,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(L,0);try{return s(L,0)}catch{try{return s.call(null,L,0)}catch{return s.call(this,L,0)}}}function f(L){if(u===clearTimeout)return clearTimeout(L);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(L);try{return u(L)}catch{try{return u.call(null,L)}catch{return u.call(this,L)}}}var m=[],p=!1,v,S=-1;function B(){!p||!v||(p=!1,v.length?m=v.concat(m):S=-1,m.length&&E())}function E(){if(!p){var L=d(B);p=!0;for(var w=m.length;w;){for(v=m,m=[];++S<w;)v&&v[S].run();S=-1,w=m.length}v=null,p=!1,f(L)}}a.nextTick=function(L){var w=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)w[x-1]=arguments[x];m.push(new F(L,w)),m.length===1&&!p&&d(E)};function F(L,w){this.fun=L,this.array=w}F.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function $(){}a.on=$,a.addListener=$,a.once=$,a.off=$,a.removeListener=$,a.removeAllListeners=$,a.emit=$,a.prependListener=$,a.prependOnceListener=$,a.listeners=function(L){return[]},a.binding=function(L){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(L){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,n,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},n.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,n,i){(function(a,s){var u=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,d={},f=0;i.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(p){p.close()};function m(p,v){this._id=p,this._clearFn=v}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(p,v){clearTimeout(p._idleTimeoutId),p._idleTimeout=v},i.unenroll=function(p){clearTimeout(p._idleTimeoutId),p._idleTimeout=-1},i._unrefActive=i.active=function(p){clearTimeout(p._idleTimeoutId);var v=p._idleTimeout;v>=0&&(p._idleTimeoutId=setTimeout(function(){p._onTimeout&&p._onTimeout()},v))},i.setImmediate=typeof a=="function"?a:function(p){var v=f++,S=arguments.length<2?!1:c.call(arguments,1);return d[v]=!0,u(function(){d[v]&&(S?p.apply(null,S):p.call(null),i.clearImmediate(v))}),v},i.clearImmediate=typeof s=="function"?s:function(p){delete d[p]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Zt);const Kt={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},en={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},dt=o.defineComponent({name:"Toast",props:en,emits:["close","click"],setup:(r,e)=>{const t=o.ref(r.animate),n="fadeOut",i=o.computed(()=>r.options),a=o.ref(!1),s=o.computed(()=>{const E={animated:a.value,toast:!0};return E[r.animate]=!1,E[n]=a.value,E[i.value.type]=!0,i.value.theme&&(E[i.value.theme]=!0),E}),u=o.computed(()=>{const $=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,L={"f-icon":!0};return L[$]=!0,L}),l=o.computed(()=>i.value.title||i.value.message),c=o.computed(()=>i.value.title&&i.value.message),d=o.computed(()=>!i.value.title&&i.value.message),f=o.computed(()=>r.showCloseButton),m=o.computed(()=>!!i.value.buttons||!!e.slots.default);function p(E){E.stopPropagation(),E.preventDefault(),a.value=!1,setTimeout(()=>{e.emit("close",i.value)},200)}function v(E,F){}function S(E){return`f-preten-link ${E.customClass?E.customClass:""}`}o.watch(t,()=>{t.value});const B=()=>{var E;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((E=i.value.buttons)==null?void 0:E.map(F=>o.createVNode("span",{class:S(F),onClick:$=>void 0},[F.text]))),e.slots.default&&e.slots.default()])])};return()=>o.createVNode("div",{class:s.value,style:"min-height:44px"},[f.value&&o.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:p},[o.createVNode("span",{class:"f-icon modal_close"},null)]),l.value&&o.createVNode("section",{class:"modal-tips"},[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:u.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[c.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message},null),m.value&&B()]),d.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[B()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:i.value.message},null))])])])}}),tt=o.defineComponent({name:"Notify",props:Kt,emits:["close","empty"],setup(r,e){const t=o.computed(()=>({"farris-notify":!0})),n={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(r.options),s=o.ref(r.showCloseButton),u=o.computed(()=>r.position||"bottom-right"),l=o.computed(()=>r.timeout!=null?r.timeout:3e3),c=o.computed(()=>{const m=r.bottom?r.bottom:n.bottom,p=r.top?r.top:n.top,v={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${r.left?r.left:n.left}px`:"",right:u.value.indexOf("right")>-1?`${r.right?r.right:n.right}px`:"",top:u.value.indexOf("top")>-1?`${p}px`:"",bottom:u.value.indexOf("bottom")>-1?`${m}px`:""};return u.value.indexOf("center")>-1&&(v.left="50%",v.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(v.top="50%",v.transform="translate(-50%, -50%)")),v});function d(m){e.emit("close")}l.value&&setTimeout(()=>{d()},l.value),e.expose({closeToast:d,container:i,notifyPosition:u});function f(m,p){d()}return()=>o.createVNode("div",{class:t.value,style:c.value,ref:i},[o.createVNode(dt,{options:a.value,showCloseButton:s.value,animate:r.animate,onClose:m=>f(m,a.value)},null)])}});class tn{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",o.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,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var c;const u=o.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(i,u),s.unmount()},220)}if(i.position.indexOf("top")>-1){const d=t.getNotifyInstances(i.position),f=d[d.length-1];if(f){const m=f.value.container.getBoundingClientRect();i.top=m.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=t.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{t.updateNotifyPositionForCreate(i,u)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(tt,o.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.mount(a),s}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const n=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+n-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const n=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const i=this.getNotifyInstances(e.position),a=i.indexOf(t);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}n>-1&&this.notifyRefs.splice(n,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let n="",i="",a,s,u;typeof t=="string"?n=t:t&&(n=t.message||"",i=t.title||"",s=t.position||null,u=t.showCloseButton!=null?t.showCloseButton:null,a=t.timeout!=null?t.timeout:null);const c={options:{type:e,message:n,title:i}};return s!=null&&(c.position=s),u!=null&&(c.showCloseButton=u),a!=null&&(c.timeout=a),c}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 nn=Symbol("NOTIFY_SERVICE_TOKEN");tt.install=r=>{r.component(tt.name,tt),r.component(dt.name,dt);const e=new tn;r.provide(nn,e),r.provide("FNotifyService",e)};const kt=new Map([["appearance",xe.resolveAppearance],["column","columnOption"]]);function on(r,e,t){var f;const n=t.parentComponentInstance,i=n.schema.type,a=String(((f=n.schema.appearance)==null?void 0:f.class)||"").split(" "),s=i==="section"||i==="tab-page",u=a.includes("f-page-content-nav"),l=a.includes("f-page-main"),c=r.getSchemaByType("component");c.id=`${e.id}-component`,c.componentType="data-grid";let d="";return d+=s?"f-struct-data-grid-in-card f-struct-is-subgrid":"",d+=u?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",d+=l?"f-struct-data-grid f-struct-wrapper":"",c.appearance={class:d},c.contents=[e],c}function rn(r,e,t){const n=t.parentComponentInstance,i=String(n.schema.appearance.class||"").split(" "),a=i.includes("f-page-content-nav"),s=i.includes("f-page-main"),u=r.getSchemaByType("section");u.id=`${e.id}-section`;let l="";return l+=a?"f-section-in-nav ":"",l+=s?"f-section-in-managelist ":"",l+="f-section-grid",u.appearance={class:l},u.contents=[e],u}function an(r,e,t){const n=r.getSchemaByType("content-container");return n.id=`${e.id}-layout`,n.appearance={class:"f-grid-is-sub f-utils-flex-column"},n.contents=[e],n}function It(r,e,t){const i=t.parentComponentInstance.schema.type,a=i==="section"||i==="tab-page";e.appearance={class:"f-component-grid"};const u=(a?an:rn)(r,e,t);return on(r,u,t)}const Vt={$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:"行点击事件"}},ft={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}};xe.createPropsResolver(ft,Vt,kt,It),xe.createTreeGridSelectionItemResolver(),xe.createTreeGridBindingResolver();const sn=Object.assign({},ft,{componentId:{type:String,default:""}});xe.createPropsResolver(sn,Vt,kt,It),xe.createDataViewUpdateColumnsResolver();function ln(r,e,t,n,i,a,s,u,l,c,d,f,m,p,v,S,B){const{calculateCellPositionInRow:E}=a,{columnContext:F,hasLeftFixedColumn:$,hasRightFixedColumn:L}=s,{gridDataStyle:w,leftFixedGridDataStyle:x,rightFixedGridDataStyle:C}=p,{renderDataRow:g}=Y.getHierarchyRow(r,e,F,B,u,l,c,d,f,m,p,v,S),P=[g];function I(z,G){const me=E(z);return B.value.filter(j=>j.visible!==!1).map((j,N)=>P[j.type](j,me,G,N))}function y(){return o.createVNode("div",{ref:n,class:"fv-grid-content-left-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:x.value},[I(F.value.leftColumns.filter(z=>z.visible),"left")])])}function D(){return o.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[o.createVNode("div",{class:"fv-grid-data",style:w.value},[I(F.value.primaryColumns.filter(z=>z.visible),"primary")])])}function U(){return o.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[o.createVNode("div",{class:"fv-grid-data",style:C.value},[I(F.value.rightColumns.filter(z=>z.visible),"right")])])}function q(){const z=[];return $.value&&z.push(y()),z.push(D()),L.value&&z.push(U()),z}return{renderDataArea:q}}const cn=o.defineComponent({name:"FTreeGrid",props:ft,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(r,e){var pe,se;const n=((pe=r.rowOption)==null?void 0:pe.height)||28,i=o.ref(20),a=o.ref(r.columns),s=Y.useIdentify(r),{idField:u}=s,l=o.ref(),c=o.ref(),d=o.ref(),f=o.ref(),m=o.ref(),p=o.ref([]),v=o.ref(!1),S=o.ref(((se=r.rowOption)==null?void 0:se.wrapContent)||!1),B=Y.useGroupData(r,s),E=Y.useFilter(),F=Y.useHierarchy(r),{collapseField:$}=F,{showLoading:L,renderLoading:w}=Y.useLoading(r,l),x=Y.useDataView(r,new Map,E,F,s),{dataView:C}=x,g=Y.useSelection(r,x,s,p,e),P=Y.useSelectHierarchyItem(r,p,x,s,g,e),I=o.computed(()=>r.disabled),y=o.computed(()=>r.virtualized?Math.min(x.dataView.value.length,i.value):x.dataView.value.length),{containerStyleObject:D}=Y.useDataViewContainerStyle(r),U=Y.useCommandColumn(r),{applyCommands:q}=U;q(a);const z=Y.useColumn(r),G=Y.useSort(r),{applyColumnSorter:me,columnContext:j,updateColumnRenderContext:N}=z;me(x,G);const H=Y.useGroupColumn(r,j),k=Y.useRow(r,e,g,s),J=Y.useEdit(r,e,s,k,p),ue=Y.useVisualDataBound(r),Me=Y.useVisualDataCell(r,J,ue),_=Y.useVisualDataRow(r,x,J,F,s,ue,Me),ye=Y.useVisualData(r,a,x,y,0,_),{getVisualData:he}=ye,ee=Y.useCellPosition(r,j),V=Y.useSidebar(r,g),{sidebarWidth:K}=V,ie=Y.useVirtualScroll(r,x,p,j,ye,y,0,K),{onWheel:Le,dataGridWidth:ke,viewPortHeight:Ie,viewPortWidth:Ve,resetScroll:Oe,updateVisibleRowsOnLatestVisibleScope:Pe}=ie,Fe=Y.useFitColumn(r,j,c,Ve,H),{calculateColumnsSize:Se}=Fe,ze=Y.useFilterHistory(),Ge=Y.useColumnFilter(c,m,x,ze,ie),He=Y.useDragColumn(r,e,z,x,H,B,ie),We=o.computed(()=>({"fv-grid":!0,"fv-grid-bordered":r.showBorder,"fv-grid-horizontal-bordered":r.showHorizontalLines,"fv-datagrid-strip":r.showStripe})),Ae=o.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":v.value,"fv-grid-wrap-content":S.value})),{renderDataArea:Ue}=ln(r,e,d,f,m,ee,z,x,J,F,k,g,P,ie,ye,ue,p),{renderGridHeader:b,renderGridColumnResizeOverlay:W,shouldShowHeader:ne}=Y.getColumnHeader(r,e,c,f,m,z,x,He,Ge,E,ze,Fe,H,g,V,G,ie,Ve,p),{renderDataGridSidebar:ge}=Y.getSidebar(r,k,g,V,ie),{renderDisableMask:Ee}=Y.getDisableMask(),{renderHorizontalScrollbar:Ye}=Y.getHorizontalScrollbar(r,c,ie),{renderVerticalScrollbar:ot}=Y.getVerticalScrollbar(r,c,ie);function Xe(){var O,A,de;if(c.value&&c.value.clientHeight>0&&((O=c.value)==null?void 0:O.clientWidth)>0){const be=Math.ceil(c.value.clientHeight/n);be>i.value&&(i.value=be,Pe()),Ie.value=((A=d.value)==null?void 0:A.clientHeight)||0,ke.value=((de=c.value)==null?void 0:de.clientWidth)||0,Se()}}o.onMounted(()=>{c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/n),i.value),p.value=he(0,y.value+0-1),qt.useResizeObserver(c.value,Xe),Se(),o.nextTick(()=>{c.value&&(ke.value=c.value.clientWidth),d.value&&(Ve.value=d.value.clientWidth,Ie.value=d.value.clientHeight)})),L.value&&w()}),o.onUnmounted(()=>{}),o.watch(Ve,()=>{c.value&&Se()});function ht(O){x.collapseTo(O),x.reOrderVisibleIndex(),Oe()}function yt(O){x.expandTo(O),x.reOrderVisibleIndex(),Oe()}function Qe(){const O=g.getSelectionRow();return O?O.dataIndex-1:-1}function gt(){const O=Qe();x.insertNewDataItem(O),p.value=he(0,y.value+0-1)}function vt(){const O=Qe();x.insertNewChildDataItem(O),p.value=he(0,y.value+0-1)}function bt(){const O=Qe(),A=P.getNextSelectableHierarchyItemId(O);x.removeHierarchyDataItem(O),p.value=he(0,y.value+0-1),A&&g.selectItemById(A)}function wt(O){J.onEditingRow(O)}function rt(O){J.acceptEditingRow(O)}function Ct(O){J.cancelEditingRow(O)}function it(O){O&&(a.value=O,q(a),N(a.value),me(x,G),Se())}o.watch(()=>r.columns,O=>{it(O)});function xt(O,A){O&&(x.load(O),x.reOrderVisibleIndex(),A!=null&&A.keepScrollPosition?ie.scrollTo(ie.offsetY.value):Oe())}function St(O){g.selectItemById(O)}function Tt(O){const A=p.value.find(de=>de.raw[s.idField.value]===O);A&&k.clickRowItem(A)}function at(O){k.activeRowById(O)}function jt(O){g.selectItemByIds(O)}function h(){return g.getSelectedItems()}function T(){g.clearSelection()}const M=o.computed(()=>!p.value||!p.value.length),{renderEmpty:R}=Y.getEmpty(e);function X(){return g.getSelectionRow()}function Q(O){g.unSelectItemByIds(O)}function we(){return g.currentSelectedDataId.value}function fe(O,A,de){const be=C.value.find(Ce=>Ce[u.value]===O);if(be){if(Object.keys(be).forEach(le=>{Object.prototype.hasOwnProperty.call(A,le)&&(be[le]=A[le])}),de){const{collapseField:le,disabledField:Re,checkedField:De,visibleField:qe}=de;le&&!oe.isUndefined(A[le])&&(be.__fv_collapse__=A[le]),De&&!oe.isUndefined(A[De])&&(be.__fv_checked__=A[De]),Re&&!oe.isUndefined(A[Re])&&(be.__fv_disabled__=A[Re]),qe&&!oe.isUndefined(A[qe])&&(be.__fv_visible__=A[qe])}const Ce=p.value.find(le=>le.raw[u.value]===O),Dt=p.value.findIndex(le=>le.raw[u.value]===O);if(Ce){if(Ce.raw=be,Object.keys(Ce.data).forEach(le=>{Ce.data[le].updateData(be)}),de){const{collapseField:le,disabledField:Re,checkedField:De,visibleField:qe}=de;le&&!oe.isUndefined(A[le])&&(Ce.collapse=A[le]),De&&!oe.isUndefined(A[De])&&(Ce.checked=A[De]),Re&&!oe.isUndefined(A[Re])&&(Ce.disabled=A[Re]),qe&&!oe.isUndefined(A[qe])&&(Ce.visible=A[qe])}p.value=[...p.value.slice(0,Dt),Ce,...p.value.slice(Dt+1)]}}}function ve(O){const A=x.dataView.value.find(de=>de[u.value]===O);return A?A[$.value]:""}function Te(){return $.value}e.expose({activeRowById:at,addNewDataItem:gt,addNewChildDataItem:vt,collapseTo:ht,expandTo:yt,removeDataItem:bt,editDataItem:wt,acceptDataItem:rt,cancelDataItem:Ct,updateColumns:it,updateDataSource:xt,selectItemById:St,selectItemByIds:jt,getSelectedItems:h,clearSelection:T,getSelectionRow:X,clickRowItemById:Tt,unSelectItemByIds:Q,getCurrentRowId:we,reassignRowData:fe,getCollapseField:Te,getCollapseStatusById:ve});const ae=o.computed(()=>{const O={};return ie.shouldShowHorizontalScrollbar.value&&(O.paddingBottom="10px"),ie.shouldShowVirticalScrollbar.value&&(O.paddingRight="10px"),O}),je=o.computed(()=>({...D.value,borderRadius:"5px"}));return()=>o.createVNode("div",{ref:l,class:We.value,style:je.value,onWheel:Le},[c.value&&ne.value&&b(),o.createVNode("div",{ref:c,class:Ae.value,onMouseover:()=>v.value=!0,onMouseleave:()=>v.value=!1,style:ae.value},[c.value&&ge(p),c.value&&Ue(),c.value&&M.value&&R(),c.value&&Ye(),c.value&&ot()]),W(),I.value&&Ee()])}});Je.withInstall(cn);const un=new Map([["appearance",ct]]);function dn(r,e,t){return e}lt({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"]},un,dn,{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:[]}}}}}});function fn(r,e,t){var C;const n=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=o.ref();function s(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function u(){return!1}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function d(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const P=o.ref(g==null?void 0:g.value.parent),I=d(P);return I||null}function f(g=e){var D;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(g);const{componentInstance:P,designerItemElementRef:I}=g;if(!P||!P.value)return null;const{getCustomButtons:y}=P.value;return P.value.canMove||y&&((D=y())!=null&&D.length)?I:f(g.parent)}function m(g){return!!t&&t.canAccepts(g)}function p(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function S(g,P){var I;!g||!P||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(g,P),(I=e==null?void 0:e.setupContext)==null||I.emit("dragEnd"))}function B(g,P){const{componentType:I}=g;let y=Nt(I,g,P);t&&t.onResolveNewComponentSchema&&(y=t.onResolveNewComponentSchema(g,y));const D=I.toLowerCase().replace(/-/g,"_");return y&&!y.id&&y.type===I&&(y.id=`${D}_${Math.random().toString().slice(2,6)}`),y}function E(g){g&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(g)}function F(...g){if(t&&t.getPropsConfig)return t.getPropsConfig(...g)}function $(g){if(!g)return;const P=e==null?void 0:e.schema,{formSchemaUtils:I}=g;if(P&&I.getExpressions().length){const y=I.getExpressions().findIndex(D=>D.target===P.id);y>-1&&I.getExpressions().splice(y,1)}}function L(g){t&&t.onRemoveComponent&&t.onRemoveComponent(),$(g),e!=null&&e.schema.contents&&e.schema.contents.map(P=>{let I=P.id;P.type==="component-ref"&&(I=P.component);const y=r.value.querySelectorAll(`#${I}-design-item`);y!=null&&y.length&&Array.from(y).map(D=>{var U;(U=D==null?void 0:D.componentInstance)!=null&&U.value.onRemoveComponent&&D.componentInstance.value.onRemoveComponent(g)})})}function w(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function x(g){if(t&&t.onPropertyChanged)return t.onPropertyChanged(g)}return a.value={canMove:s(),canSelectParent:u(),canDelete:l(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:i,canAccepts:m,getBelongedComponentInstance:d,getDraggableDesignItemElement:f,getDraggingDisplayText:p,getPropConfig:F,getDragScopeElement:v,onAcceptMovedChildElement:S,onChildElementMovedOut:E,addNewChildComponentSchema:B,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1),onRemoveComponent:L,getCustomButtons:w,onPropertyChanged:x},a}const pt=new Map([["appearance",ct]]),pn=new Map([]),mn="root-viewmodel";class hn{constructor(e,t){Z(this,"formSchemaUtils");Z(this,"controlCreatorUtils");Z(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),n=this.createComponentNode(e),i=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(n),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"),n=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:n}),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 n=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(n,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),t.contents=[n];const{selectedFields:a}=e;a==null||a.forEach(u=>{const l=oe.cloneDeep(u),c=this.resolveControlClassByFormColumns(e),d=this.controlCreatorUtils.setFormFieldProperty(l,"",c);d&&i.push(d)});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="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:mn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:n}=e;return n==null||n.forEach(i=>{let a="blur";const s=i.type.name;(s===Je.FormSchemaEntityFieldTypeName.Enum||s===Je.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}),t}}function yn(r,e,t,n){var a,s,u,l,c,d;const i=t.parentComponentInstance;if(i&&n){const f=(a=i.schema)==null?void 0:a.type,p={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=t.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(u=t.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:f==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(d=t.bindingSourceContext)==null?void 0:d.bindingEntityFields};return new hn(r,n).createComponent(p)}else return e}function gn(r,e,t){return e}lt({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"]},pt,yn);const Ot={$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}};xe.createPropsResolver(vn,Ot,pt,void 0),xe.createFormGroupEditorResolver();const bn=o.ref(0);function wn(){bn.value++}function Cn(r){const{formSchemaUtils:e,formStateMachineUtils:t}=r;function n(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function i(l,c=""){return e.getViewModelById(l).states.map(f=>n(f,c))}function a(l){const c=e.getRootViewModelId(),d=i(l);if(l===c)return d;const f=i(c,"root-component.");return[...d,...f]}function s(l){return l.binding&&l.binding.path||l.id||""}function u(){return t&&t.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:u}}class xn{constructor(e){Z(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);Z(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Z(this,"getExpressionConverter",(e,t)=>({convertFrom:(n,i,a,s)=>{const u=a.getExpressionRuleValue(e,t||i);return u&&u.value||""},convertTo:(n,i,a,s,u)=>{var l;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(f=>f.id===c&&f.value))?n.dictPickingExpressionId=c:delete n.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const n=this.formSchemaService.getExpressions();if(!n)return"";const i=n.find(s=>s.target===e);if(!i)return"";const a=i.rules.find(s=>s.type===t);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),n=this.formSchemaService.getViewModelById(t);if(!n||!n.states||n.states.length===0)return[];const i=[];return n.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(e,t,n="label"){return{id:e.id,name:e.name,bindingPath:e[n],parents:t}}buildEntityFieldsTreeData(e=null,t){const n=[];return e==null||e.forEach(i=>{var u;const a=this.createTreeNode(i,t);let s=[];(u=i.type)!=null&&u.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...t,i.label])),n.push({data:a,children:s,expanded:!0})}),n}buildChildEntityTreeData(e=null,t){const n=[];return e==null||e.forEach(i=>{var l,c;const a=this.createTreeNode(i,t),s=this.buildEntityFieldsTreeData((l=i.type)==null?void 0:l.fields,[...t,i.label]),u=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...t,i.label]);u!=null&&u.length&&(s==null||s.push(...u)),n.push({data:a,children:s||[],expanded:!0})}),n}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const n=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),i=this.buildChildEntityTreeData(t.type.entities,[t.code]);return i!=null&&i.length&&(n==null||n.push(...i)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:n||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,n){const i=n==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,t),s=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(t)&&a?a.message:"",...s};return a.messageType!=null&&(u.messageType=a.messageType),u}buildRule(e,t,n,i){const{expression:a,message:s,messageType:u}=t,l={id:`${e}_${n}`,type:n,value:a};return(n==="validate"||n==="dataPicking"||n==="required")&&(l.message=s),n==="dataPicking"&&(l.messageType=u),n==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,n,i){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,n,i,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(d=>d.targetType===t&&d.target===a);const c=d=>d.value.trim()==="";if(l){const d=l.rules.find(f=>f.id===s.id);if(d)c(s)?l.rules=l.rules.filter(f=>f.id!==s.id):(Object.assign(d,s),i==="validate"&&e.type==="form-group"&&(d.elementId=e.id));else{if(c(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(c(s))return null;l={target:`${a}`,rules:[s],targetType:t}}return l}getExpressionEditorOptions(e,t,n,i){return n.reduce((a,s)=>{var l,c;const u=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return a[s]={hide:t==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(u),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:d=>{const f=this.updateExpression(e,t,d,s);if(i){const m=this.buildRule(u,d,s);i(m)}return f}}},a},{})}getExpressionInfo(e,t,n){const i=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,n),s={value:a&&a.value,targetId:i,targetType:t,expressionType:n};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,n=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,n,i)}}}getExpressionOptions(e,t,n){const i=this.getExpressionInfo(e,t,n);return{dialogTitle:`${this.expressionNames[n]}编辑器`,singleExpand:!1,showMessage:n==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,n,t),expressionInfo:i}}}class Sn{constructor(e,t){Z(this,"componentId");Z(this,"viewModelId");Z(this,"eventsEditorUtils");Z(this,"formSchemaUtils");Z(this,"formMetadataConverter");Z(this,"designViewModelUtils");Z(this,"designViewModelField");Z(this,"controlCreatorUtils");Z(this,"designerHostService");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.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 n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.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:ce[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},n){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in t)a[s]=Object.assign(a[s]||{},t[s]);return{...i,properties:{...a},setPropertyRelates(s,u){if(s){switch(s&&s.propertyID){case"class":case"style":{Jt.value++;break}}n&&n(s,e,u)}}}}getPropertyEditorParams(e,t=[],n="visible",i={},a={}){const{getVariables:s,getControlName:u,getStateMachines:l}=Cn(this.designerHostService),c=this.getRealTargetType(e),d=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:d};return d.map(m=>{switch(m){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,c,n);break;case"StateMachine":f.stateMachines=l();break;case"Variable":Object.assign(f,{controlName:u(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:s(this.viewModelId),onBeforeOpenVariables:p=>{p.value=s(this.viewModelId)}},a);break}}),f}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="",n={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in n)s[l]=Object.assign(s[l]||{},n[l]);const u=this;return{...a,properties:{...s},setPropertyRelates(l,c){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(e,l);break}i&&i(l,c)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const i=n.contents.findIndex(s=>s.id===e),a=oe.cloneDeep(n.contents[i]);n.contents.splice(i,1),n.contents.splice(i,0,a),wn()}addNewVariableToViewModel(e,t){const n=e.propertyValue;if(!(n&&typeof n=="object")||!(n.type==="Variable"&&n.isNewVariable))return;const s={id:n.field,category:"locale",code:n.fullPath,name:n.fullPath,type:n.newVariableType||"String"};delete n.newVariableType,delete n.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(t).states.push(s)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:a,expressionInfo:s}=t,{targetId:u,targetType:l,expressionType:c,value:d,message:f}=s,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:p}=m;let v=p.find(B=>B.target===u);v||(v={target:u,rules:[],targetType:l},p.push(v));const S=v.rules.find(B=>B.type===c);if(S)S.value=d,S.message=f;else{const B={id:a,type:c,value:d,message:f};v.rules.push(B)}delete t.expressionInfo}clearExpression(e,t){const n=e.propertyValue;if(n&&n.type==="Expression")return;const a=e.propertyID,s=this.formSchemaUtils.getExpressions(),u=t.binding?t.binding.field:t.id,l=s.find(c=>c.target===u);!l||!l.rules||(l.rules=l.rules.filter(c=>c.type!==a))}getExpressionOptions(e,t,n){return new xn(this.formSchemaUtils).getExpressionOptions(e,t,n)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}const Tn={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};xe.createPropsResolver(Tn,Ot,pt,void 0);const jn={$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"]},Mn={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};xe.createPropsResolver(Mn,jn,pn,gn);const En={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 mt(){return new DOMException("The request is not allowed","NotAllowedError")}async function Nn(r){if(!navigator.clipboard)throw mt();return navigator.clipboard.writeText(r)}async function Bn(r){const e=document.createElement("span");e.textContent=r,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),n=window.document.createRange();t==null||t.removeAllRanges(),n.selectNode(e),t==null||t.addRange(n);let i=!1;try{i=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!i)throw mt()}async function kn(r){try{await Nn(r)}catch(e){try{await Bn(r)}catch(t){throw t||e||mt()}}}function In(){async function r(e){await kn(e)}return{onCopy:r}}function Vn(r,e,t,n){const i=o.ref(14),a=o.ref(140),s=o.ref(""),u=o.ref(n.value.length),l=o.computed(()=>n.value),c=o.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function d(f){if(f.currentTarget){const m=f.currentTarget.value||"";u.value=m.length}}return()=>o.createVNode(o.Fragment,null,[o.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:a.value,onInput:f=>d(f)},[l.value]),o.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+a.value])])}function On(r,e,t,n){const i=Vn(r,e,t,n),a=new Map([["text-area",i]]);function s(u){return a.get(u)||null}return{getEditorRender:s}}function Fn(){const r=o.ref(!1),e=o.ref("复制成功");return{feedbackStyle:o.computed(()=>{const n={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 n.opacity=r.value?"0.8":"0",n.display=r.value?"":"none",n}),feedbackMessage:e,toShowFeedback:r}}function $n(r,e){const t=e.getEditorRender(r.promptEditorType);return()=>t&&t()}function Pn(r){function e(m){if(m==null)return 0;let p=0;for(let v=0;v<m.length;v++){const S=m.charCodeAt(v);S>=0&&S<=128?p++:p=p+2}return p}function t(m,p){if(m!==""&&m!==void 0&&m!==null){m=""+m;const v=m.length;let S="",B=0;for(let E=0;E<v;E++){const F=m.charAt(E);if(B++,encodeURI(F).length>4&&B++,S=S.concat(F),B>=p)return S=S.concat("..."),S}if(B<p)return m}return""}const n=o.computed(()=>!!r.value&&!!r.value.date),i=o.computed(()=>`发生时间 : ${r.value&&r.value.date||""}`),a=o.computed(()=>!!r.value&&!!r.value.detail),s=o.computed(()=>r.value?e(r.value.detail)>160:!1),u=o.ref(!1),l=o.computed(()=>u.value?"收起":"展开"),c=o.computed(()=>{const m="详细信息 : "+(r.value&&r.value.detail)||"";return u.value?m:t(m,160)}),d=o.computed(()=>({position:"absolute",right:0,bottom:u.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function f(){u.value=!u.value}return()=>o.createVNode("div",{class:"toast-msg-detail"},[n.value&&o.createVNode("div",null,[i.value]),a.value&&o.createVNode("div",{class:"exception_wrap"},[o.createVNode("div",{class:"exception_error_msg"},[o.createVNode("div",{innerHTML:c.value},null),s.value&&o.createVNode("span",{style:d.value,onClick:f},[l.value])])])])}function Rn(r){return()=>o.createVNode("p",{class:"toast-msg-detail",innerHTML:r.value},null)}function Dn(r,e,t,n){const i=o.ref(r.exceptionInfo),a=o.computed(()=>{const m={"f-icon":!0},p=`f-icon-${e.value}`;return m[p]=!0,m}),s=o.computed(()=>t.value||i.value&&i.value.message),u=o.computed(()=>n.value),l=o.computed(()=>!!n.value),c=o.computed(()=>!!i.value);function d(){return c.value?Pn(i):l.value?Rn(u):()=>null}const f=d();return()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:a.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[o.createVNode("p",{class:"toast-msg-title",innerHTML:s.value},null),f()])])}function qn(r,e,t){const{onCopy:n}=e,{toShowFeedback:i}=t,a=o.ref("复制成功"),s=o.ref("复制详细信息"),u=o.ref(r.exceptionInfo||{date:"",message:"",detail:""}),l=o.computed(()=>u.value&&u.value.detail||"");function c(d){n(l.value).catch(f=>{a.value="复制失败"}).finally(()=>{i.value=!0,setTimeout(()=>{i.value=!1},700)})}return()=>o.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[o.createVNode("span",{onClick:c,style:"cursor: pointer;"},[s.value])])}function Ln(r,e,t,n){const i=o.ref(r.type),a=o.ref(r.buttons),s=o.ref(r.exceptionInfo),u=o.ref(r.okButtonText),l=o.ref(r.cancelButtonText),c=o.ref(!0),d=o.ref(!0),f=o.computed(()=>!!(a.value&&a.value.length)),m=o.computed(()=>s.value&&s.value.date&&s.value.message&&s.value.detail),p=o.computed(()=>!(a.value&&a.value.length)&&(u.value||l.value)),v=o.computed(()=>d.value&&u.value),S=o.computed(()=>c.value&&l.value),B=qn(r,t,n);function E($){i.value==="question"&&e.emit("reject"),e.emit("close")}function F($){i.value==="question"&&e.emit("accept"),e.emit("close")}return()=>o.createVNode("div",{class:"modal-footer"},[m.value&&B(),p.value&&S.value&&o.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:E},[l.value]),p.value&&v.value&&o.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:F},[u.value]),f.value&&a.value.length&&a.value.map($=>o.createVNode("button",{type:"button",onClick:$.handle,class:$.class},[$.iconClass&&o.createVNode("span",{class:$.iconClass},null),$.text]))])}const nt=o.defineComponent({name:"FMessageBox",props:En,emits:["accept","reject","close"],setup(r,e){const t=o.ref(r.type),n=o.ref(r.title),i=o.ref(r.detail),a=o.computed(()=>{const B={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${t.value}`;return B[E]=!0,B}),s=o.computed(()=>{const B={};return t.value==="prompt"?B.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(B.padding="0.5rem 1.5rem 1rem 1.5rem"),B}),u=In(),l=On(r,t,n,i),c=Fn(),{feedbackStyle:d,feedbackMessage:f}=c;function m(){return o.createVNode("div",{style:d.value},[f.value])}function p(){switch(t.value){case"prompt":return $n(r,l);default:return Dn(r,t,n,i)}}const v=p(),S=Ln(r,e,u,c);return()=>o.createVNode("div",{class:"farris-messager"},[o.createVNode("section",{class:a.value,style:s.value},[v()]),S(),m()])}}),zn={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 re{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const n=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(n.length>=6){const i=parseInt(n[4],10),a=parseInt(n[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new re(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new re(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let n=0;n<e.changedTouches.length;n++)if(e.changedTouches[n].target===t)return new re(e.changedTouches[n].clientX,e.changedTouches[n].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 re(0,0);if(window){const n=window.getComputedStyle(e);if(n){const i=parseInt(n.getPropertyValue("left"),10),a=parseInt(n.getPropertyValue("top"),10);t.x=isNaN(i)?0:i,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new re(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 $e{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new $e(0,0);if(window){const n=window.getComputedStyle(e);return n&&(t.width=parseInt(n.getPropertyValue("width"),10),t.height=parseInt(n.getPropertyValue("height"),10)),t}return null}static copy(e){return new $e(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function Hn(r,e){const t=o.ref(),n=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),u=o.ref(),l=o.ref(),c=o.ref(),d=o.ref(),f=o.ref(),m=o.ref(),p=o.ref(r.resizeable),v=o.ref(),S=o.ref(r.draggable),B=o.ref(!1);function E(){const j=n.value||document.body,N=window.getComputedStyle(j);if(!N||!t.value)return;const H=re.getTransformInfo(t.value),k={};l.value&&(k.deltaL=t.value.offsetLeft-l.value.x,k.deltaT=t.value.offsetTop-l.value.y);const J=N.getPropertyValue("position");k.width=j.clientWidth,k.height=j.clientHeight,k.pr=parseInt(N.getPropertyValue("padding-right"),10),k.pb=parseInt(N.getPropertyValue("padding-bottom"),10),k.position=N.getPropertyValue("position"),J==="static"&&(j.style.position="relative"),k.translateX=H.x,k.translateY=H.y,f.value=k}function F(j){if(t.value){a.value=$e.getCurrent(t.value),s.value=re.getCurrent(t.value),u.value=a.value?$e.copy(a.value):null,l.value=s.value?re.copy(s.value):null,E();const N=j.target.getAttribute("type")||"";c.value={n:!!N.match(/n/),s:!!N.match(/s/),w:!!N.match(/w/),e:!!N.match(/e/)}}}function $(){var j,N,H,k;if(t.value){const J=t.value;c.value&&((c.value.n||c.value.s)&&((j=u.value)!=null&&j.height)&&(J.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((N=u.value)!=null&&N.width)&&(J.style.width=u.value.width+"px"),l.value&&((H=l.value)!=null&&H.x&&(J.style.left=l.value.x+"px"),(k=l.value)!=null&&k.y&&(J.style.top=l.value.y+"px")))}}function L(){const j=r.minHeight?r.minHeight:1,N=r.minWidth?r.minWidth:1;u.value&&l.value&&c.value&&a.value&&(u.value.height<j&&(u.value.height=j,c.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-j))),u.value.width<N&&(u.value.width=N,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-N))),r.maxHeight&&u.value.height>r.maxHeight&&(u.value.height=r.maxHeight,s.value&&c.value.n&&(l.value.y=s.value.y+(a.value.height-r.maxHeight))),r.maxWidth&&u.value.width>r.maxWidth&&(u.value.width=r.maxWidth,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-r.maxWidth))))}function w(){if(n.value){const j=f.value;if(l.value&&u.value&&c.value&&a.value){const N=j.width-j.pr-j.deltaL-j.translateX-l.value.x,H=j.height-j.pb-j.deltaT-j.translateY-l.value.y;c.value.n&&l.value.y+j.translateY<0&&s.value&&(l.value.y=-j.translateY,u.value.height=a.value.height+s.value.y+j.translateY),c.value.w&&l.value.x+j.translateX<0&&s.value&&(l.value.x=-j.translateX,u.value.width=a.value.width+s.value.x+j.translateX),u.value.width>N&&(u.value.width=N),u.value.height>H&&(u.value.height=H)}}}function x(j){if(!i.value||!a.value||!s.value||!c.value)return;j.subtract(i.value);const N=j.x,H=j.y;c.value.n?(l.value.y=s.value.y+H,u.value.height=a.value.height-H):c.value.s&&(u.value.height=a.value.height+H),c.value.e?u.value.width=a.value.width+N:c.value.w&&(u.value.width=a.value.width-N,l.value.x=s.value.x+N),w(),L(),$()}function C(j){if(!d.value)return;const N=re.fromEvent(j);N&&x(N)}function g(){if(t.value){const{width:j,height:N,x:H,y:k}=t.value.getBoundingClientRect(),J=re.getTransformInfo(t.value);return{size:{width:j,height:N},position:{x:H-J.x,y:k-J.y}}}return null}function P(j){if(t.value){const N=g();m.value=N}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,c.value=null,d.value=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",P)}function I(){document.addEventListener("mousemove",C),document.addEventListener("mouseup",P)}function y(j){j instanceof MouseEvent&&j.button===2||S.value&&(document.body.click(),j.stopPropagation(),j.preventDefault(),i.value=re.fromEvent(j),d.value=j.target,F(j),I())}function D(j){return t.value=j,p.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:N=>y(N)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:N=>y(N)},null)])}function U(j=!0){document.body.click();const N=n.value||document.body,H=$e.getCurrent(N),k=t.value;j&&k&&(v.value=g(),v.value.transform=k.style.transform),H&&k&&(u.value=H,u.value.height-=14,u.value.width-=14,k.style.height=u.value.height+"px",k.style.width=u.value.width+"px",k.style.left="7px",k.style.top="7px",k.style.transform="",m.value={size:u.value,position:{x:0,y:0}},S.value=!1,B.value=!0)}function q(){var j,N;if(document.body.click(),v.value){const H={width:v.value.size.width||0,height:v.value.size.height||0},k={x:(window.innerWidth-H.width)/2,y:(window.innerHeight-H.height)/2};(j=u.value)==null||j.set(H),(N=l.value)==null||N.set(k);const J=t.value;J.style.height=H.height+"px",J.style.width=H.width+"px",J.style.left=`${k.x}px`,J.style.top=`${k.y}px`,J.style.transform="",m.value={size:H,position:k},S.value=r.draggable,B.value=!1}}function z(){if(t.value){const j=$e.getCurrent(t.value);if(j){const{width:N,height:H}=j;t.value.style.left=`${(window.innerWidth-N)/2}px`,t.value.style.top=`${(window.innerHeight-H)/2}px`,t.value.style.transform=""}}}function G(){const j=()=>{B.value?U(!1):z(),document.body.click()};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}}const me=G();return{renderResizeBar:D,boundingElement:n,resizedEventParam:m,maximize:U,restore:q,allowDrag:S,isMaximized:B,unWindowResizeHandle:me}}function An(r,e,t){const n=o.ref(),i=o.ref(r.draggable),a=o.ref(r.lockAxis),s=o.ref(),u=o.ref(),l=o.ref(!1),c=o.ref(new re(0,0)),d=o.ref(new re(0,0)),f=o.ref(new re(0,0)),m=o.ref(new re(0,0));o.watch(()=>t.value,C=>{s.value.style.cursor=C?"move":"default"});function p(C,g){if(g.tagName==="BUTTON")return!1;if(g===C)return!0;for(const P in g.children)if(Object.prototype.hasOwnProperty.call(g.children,P)&&p(C,g.children[P]))return!0;return!1}function v(){var I,y;let C=f.value.x+d.value.x,g=f.value.y+d.value.y;a.value==="x"?(C=((I=c.value)==null?void 0:I.x)||0,f.value.x=0):a.value==="y"&&(g=((y=c.value)==null?void 0:y.y)||0,f.value.y=0);const P=`translate3d(${Math.round(C)}px, ${Math.round(g)}px, 0px)`;n.value&&(n.value.style.transform=P),m.value.x=C,m.value.y=g}function S(){if(!u.value||!n.value)return null;const C=u.value.getBoundingClientRect(),g=n.value.getBoundingClientRect(),P={top:C.top<g.top,right:C.right>g.right,bottom:C.bottom>g.bottom,left:C.left<g.left};return P.top||(f.value.y-=g.top-C.top),P.bottom||(f.value.y-=g.bottom-C.bottom),P.right||(f.value.x-=g.right-C.right),P.left||(f.value.x-=g.left-C.left),v(),P}function B(C){C&&(c.value&&C.subtract(c.value),f.value.set(C),v(),S())}function E(C){l.value&&i.value&&(C.stopPropagation(),C.preventDefault(),B(re.fromEvent(C,s.value)))}function F(){var C;l.value&&(l.value=!1,d.value.add(f.value),f.value.reset(),(C=n.value)==null||C.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",F))}function $(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",E),document.addEventListener("mouseup",F))}function L(){if(n.value){const C=re.getTransformInfo(n.value);d.value.set(C);return}d.value.reset()}function w(C){if(!t.value||C instanceof MouseEvent&&C.button===2)return;const g=C.target||C.srcElement;s.value!==void 0&&g&&!p(g,s.value)||i.value!==!1&&(document.body.click(),C.stopPropagation(),C.preventDefault(),c.value=re.fromEvent(C,n.value),L(),$())}function x(C,g,P){if(i.value&&g){if(C)s.value=C;else if(r.dragHandle){if(r.dragHandle instanceof HTMLElement)s.value=r.dragHandle;else if(typeof r.dragHandle=="string"){const I=g.querySelector(r.dragHandle);I&&(s.value=I)}}n.value=g,u.value=P,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",w)):i.value=!1}}return{registerDraggle:x,resetTranslate:L}}function Ft(r,e){if(r){const t=n=>{n.key.toLowerCase()===r.toLowerCase()&&e({event:n,key:r})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Un(r,e){const t=o.ref(r.enableEsc);let n=null;return t.value?(n=Ft("Escape",i=>{e.emit("esc",{event:i.event,type:"esc"})}),{remove:n}):null}function _n(r,e){const t=o.ref(r.enableEnter);let n=null;return t.value?(n=Ft("Enter",i=>{e.emit("enter",{event:i.event,type:"enter"})}),{remove:n}):null}const _e=o.defineComponent({name:"FModal",props:zn,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(r,e){const t=o.ref(r.width||300),n=o.ref(r.height||200),i=o.ref(r.modelValue),a=o.ref(""),s=o.ref(r.class),u=o.ref(r.fitContent),l=o.ref(r.showHeader),c=o.ref(""),d=o.ref(r.showCloseButton),f=o.ref(r.showMaxButton),m=o.ref(!1),p=o.ref(r.dialogType),v=o.ref(r.src),S=o.ref(""),B=o.ref(r.showButtons),E=o.ref(r.title),F=o.ref(r.containment||null),$=o.ref(),L=o.ref(!1);function w(b,W){Promise.resolve().then(()=>{var ne;return(ne=r.beforeClose)==null?void 0:ne.call(r)}).then(ne=>{ne&&(i.value=!1,e.emit("update:modelValue",!1),W!=null&&e.emit(W?"accept":"cancel"),e.emit("closed",b))})}const x=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:b=>{w(b,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:b=>{w(b,!0)}}],C=o.ref(r.buttons&&r.buttons.length?r.buttons:x),g=o.computed(()=>!!c.value),P=o.computed(()=>!!B.value&&!!C.value),I=o.ref(),y=o.ref(),D=o.ref(!1),{renderResizeBar:U,maximize:q,restore:z,boundingElement:G,resizedEventParam:me,allowDrag:j,unWindowResizeHandle:N}=Hn(r),{registerDraggle:H}=An(r,e,j);function k(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function J(){const b=document.querySelectorAll(".farris-modal").length;(!b||b-1<=0)&&document.body.classList.remove("modal-open"),$.value&&$.value.classList.remove("show")}o.watch(()=>r.title,(b,W)=>{b!==W&&(E.value=b)}),o.watch(()=>r.modelValue,(b,W)=>{b!==W&&(i.value=b,i.value&&r.draggable&&o.nextTick(()=>{y.value&&!F.value&&(F.value=y.value.parentElement,G.value=F.value,H(I.value,y.value,G.value))}),b||(F.value&&(F.value=null),J())),i.value&&(L.value=k())}),o.watch(()=>r.showHeader,(b,W)=>{b!==W&&(l.value=b)}),o.watch(()=>r.showButtons,(b,W)=>{b!==W&&(B.value=b)}),o.watch(()=>me.value,(b,W)=>{const ne=b||{},ge=W||{};JSON.stringify(ne)!==JSON.stringify(ge)&&e.emit("resize",{newSize:b,oldSize:W,isMaximized:D.value})});const ue=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Me=o.computed(()=>{var ne;const b={modal:!0,"farris-modal":!0,fade:!0};b["f-modal-fitContent"]=!!u.value,b.show=!!ue.value;const W=(ne=r.maskClass)==null?void 0:ne.split(" ");return W==null||W.reduce((ge,Ee)=>(ge[Ee]=!0,ge),b),b}),_=o.computed(()=>{var ne;const b={"modal-dialog":!0},W=(ne=s.value)==null?void 0:ne.split(" ");return W==null||W.reduce((ge,Ee)=>(ge[Ee]=!0,ge),b),b}),ye=o.computed(()=>{const b={position:"absolute",top:`${(window.innerHeight-n.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${n.value}px`};return r.mask||(b.pointerEvents="auto"),b}),he=o.computed(()=>{const b={display:"block"};return r.mask||(b.pointerEvents="none",b.backgroundColor="transparent"),L.value&&(b.backgroundColor="transparent"),b}),ee=o.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),V=o.computed(()=>{const b={display:l.value?"":"none"};return b["pointer-events"]=j.value?"auto":"none",b}),K=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:D.value})),ie=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":p.value==="iframe","f-utils-fill":!0}));function Le(){return{height:`${r.footerHeight||60}px`}}const ke=o.computed(()=>{const b={textAlgin:S.value},W=Le();return Object.assign(b,W)});function Ie(b){if(b.stopPropagation(),D.value){D.value=!1,z();return}q(),D.value=!0}async function Ve(b,W){b.handle&&await b.handle(W,b)&&e.emit("closed",W)}function Oe(b){b.width&&(t.value=b.width),b.height&&(n.value=b.height),b.buttons&&(C.value=b.buttons),b.title&&(E.value=b.title)}let Pe=null,Fe=null;o.onBeforeMount(()=>{L.value=k()}),o.onMounted(()=>{y.value&&!F.value&&(F.value=y.value.parentElement,G.value=F.value,H(I.value,y.value,G.value)),ue.value&&document.body.classList.add("modal-open"),Pe=Un(r,e),Fe=_n(r,e)}),o.onUnmounted(()=>{N&&N(),Pe&&Pe.remove(),Fe&&Fe.remove()}),e.expose({modalElementRef:y,updateModalOptions:Oe,close:w,maxDialog:Ie,isMaximized:D});function Se(){return o.createVNode("ul",null,[m.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&o.createVNode("li",{onClick:Ie,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:K.value},null)]),d.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:b=>w(b,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function ze(){return o.createVNode("div",{class:"modal-footer",style:ke.value},[C.value&&C.value.map(b=>{const W=o.ref(b.disabled);return o.createVNode("button",{name:b.name,type:"button",disabled:W.value,class:b.class+(b.iconClass?" btn-icontext":""),onClick:ne=>{Ve(b,ne)}},[!!b.iconClass&&o.createVNode("i",{class:b.iconClass},null),b.text])})])}function Ge(){return o.createVNode("div",{ref:I,class:"modal-header",style:V.value},[e.slots.headerTemplate?e.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[g.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[E.value])]),o.createVNode("div",{class:"actions"},[Se()])])}function He(){return e.slots.footerTemplate?e.slots.footerTemplate():P.value&&ze()}function We(b){if(b.stopPropagation(),r.allowClickMaskToClose){if(b.target!==$.value)return;w(b,!1)}}function Ae(){var b,W;return o.createVNode("div",{id:a.value,class:_.value,style:ye.value,ref:y},[o.createVNode("div",{class:ee.value},[l.value&&Ge(),o.createVNode("div",{class:ie.value},[(W=(b=e.slots).default)==null?void 0:W.call(b),p.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:v.value},null)]),He()]),!u.value&&y.value&&!D.value&&U(y.value)])}function Ue(b){return b||"body"}return()=>o.createVNode(o.Teleport,{to:Ue(r.host)},{default:()=>[ue.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:$,class:Me.value,style:he.value,onClick:We},[Ae()])]})]})}});function $t(r){if(r.content&&r.content.render)return r.content.render;if(r.render&&typeof r.render=="function")return r.render}function Gn(r){const e=document.createElement("div");e.style.display="contents";const t=o.createApp({setup(n,i){o.onUnmounted(()=>{document.body.removeChild(e)});const a=o.ref(),s=o.ref(r.class||""),u=o.ref(!!r.showButtons),l=o.ref(!!r.showHeader),c=o.ref(r.showCloseButton==null?!0:r.showCloseButton),d=o.ref(!0),f=o.ref(r.title||""),m=r.acceptCallback||(()=>{}),p=r.rejectCallback||(()=>{}),v=r.closedCallback||($=>{}),S=r.resizeHandle||($=>{}),B=r.stopMoveHandle||($=>{}),E=$t(r),F=$=>{d.value=!1,t.unmount(),v($)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(_e,{ref:a,class:s.value,modelValue:d.value,"onUpdate:modelValue":$=>d.value=$,title:f.value,width:r.width,height:r.height,buttons:r.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:m,onCancel:p,fitContent:r.fitContent==null?!0:r.fitContent,onClosed:F,onResize:S,onStopMove:B},{default:()=>[E&&E(t)]})}});return document.body.appendChild(e),t.mount(e),t}class Pt{constructor(e){Z(this,"appContext",null);Z(this,"modalRef",o.ref());Z(this,"activeModalIndex",o.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",o.ref(!1));Z(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:n,height:i}={width:window.innerWidth,height:window.innerHeight};return n<e&&(e=n-14),i<t&&(t=i-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Gn(t)}close(e){var t,n;e?(n=e.value)==null||n.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const n=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),i=o.ref(!0),a=n.value.acceptCallback||(()=>{}),s=n.value.rejectCallback||(()=>{}),u=n.value.closedCallback||((w,x)=>{}),l=n.value.resizeHandle||(w=>{}),c=e.stopMoveHandle||(w=>{});let d;const f=$t(n.value),m=w=>{var C;i.value=!1;const x=(C=w==null?void 0:w.target)==null?void 0:C.classList.contains("modal_close");u(w,this.isUseEscCloseModal.value?"esc":x?"icon":"button")},p=w=>{m(w),d&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,t),d=null,this.modalRef.value=null,this.modalRefs){const x=Object.keys(this.modalRefs).map(C=>Number(C));x.length>0?this.activeModalIndex.value=Math.max(...x):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},v=w=>{var x;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((x=this.activeModalInstance.value)==null||x.close(w==null?void 0:w.event))},{width:S,height:B}=n.value,E=this.adaptToWindow(S||500,B||320);Object.assign(n.value,E);const F=()=>o.createVNode(_e,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":w=>i.value=w},n.value,{onAccept:a,onCancel:s,onClosed:p,onResize:l,onEsc:v,onStopMove:c}),{default:()=>[f&&f(this.app)]});return d=(w=>{const x=o.h(F,w);return x.appContext=this.appContext,o.render(x,t),x})({...n.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{n.value={...n.value,...w},d&&o.render(o.cloneVNode(d,{...n}),t)},destroy:p,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Wn=Symbol("FModalService");_e.install=r=>{r.component(_e.name,_e);const e=new Pt(r);r.provide(Wn,e),r.provide("FModalService",e)};class Be{static show(e){const t=o.reactive({...e}),n=!1,i=t.type==="error"||t.type==="prompt",a=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",s=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{});let l=null,c=new Pt(l);const d=()=>{l&&(l==null||l.destroy(),c=null)};return l=c==null?void 0:c.open({class:"modal-message modal-message-type-info",title:a,showButtons:n,showHeader:i,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>o.createVNode(nt,o.mergeProps(t,{onAccept:s,onReject:u,onClose:d}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const n=o.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(n)}static warning(e,t){const n=o.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(n)}static success(e,t){const n=o.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Be.show(n)}static error(e,t,n){const i=o.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:n,message:e,detail:t}});Be.show(i)}static prompt(e,t){const n=o.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Be.show(n)}static question(e,t,n,i){const a=o.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:n,rejectCallback:i});Be.show(a)}}nt.install=r=>{r.component(nt.name,nt),r.provide("FMessageBoxService",Be)};class Yn extends Sn{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.behavior=this.getBehaviorConfig(e),this.propertyConfig}}function Xn(r,e){const t=r.schema,n=new Qt;function i(p){var E;const{componentType:v,sourceType:S,sourceElement:B}=p;return!!(S==="control"&&v===ce["query-solution"].type||S==="move"&&v===ce.section.type&&((E=B==null?void 0:B.className)!=null&&E.includes("f-section-scheme")))}function a(){const p=e==null?void 0:e.formSchemaUtils;return p.selectNode(t,S=>{if(S.type==="component-ref"){const B=p.getComponentById(S.component);if((B==null?void 0:B.componentType)==="data-grid"&&p.selectNode(B,F=>F.type==="data-grid"&&!F.fieldEditable))return!0}})}function s(p){var E;const v=(E=t.appearance)==null?void 0:E.class,{sourceType:S}=p;return v&&v.includes("f-page-is-managelist")?S==="control"?!(t.contents&&t.contents.find($=>{var L,w;return $.type===ce.section.type&&((w=(L=$.appearance)==null?void 0:L.class)==null?void 0:w.includes("f-section-scheme"))}))&&a():S==="move":!1}function u(p){if(i(p))return s(p);if(!Xt().basalDragulaRuleForContainer(p,e))return!1;const{canAccept:S}=n.getTemplateRule(r,e);return S}function l(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function c(){const{canMove:p}=n.getTemplateRule(r,e);return p}function d(){const{canDelete:p}=n.getTemplateRule(r,e);return p}function f(){const{canMove:p,canDelete:v}=n.getTemplateRule(r,e);return!p&&!v}function m(p){const v=new Yn(p,e),{schema:S}=r;return v.getPropertyConfig(S)}return{canAccepts:u,getStyles:l,checkCanMoveComponent:c,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:f,getPropsConfig:m}}const Rt=o.defineComponent({name:"FContentContainerDesign",props:Ze,emits:[],setup(r,e){const t=o.ref(),n=o.inject("designer-host-service"),i=o.inject("design-item-context"),a=Xn(i,n),s=fn(t,i,a),u=o.computed(()=>{const l={"drag-container":!0};return Je.getCustomClass(l,r==null?void 0:r.customClass)});return o.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>o.createVNode("div",{ref:t,class:u.value,style:r.customStyle,"data-dragref":`${i.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),Qn={install(r){r.component(Ke.name,Ke)},register(r,e,t,n){r["content-container"]=Ke,e["content-container"]=ut},registerDesigner(r,e,t){r["content-container"]=Rt,e["content-container"]=ut}};te.ContentContainer=Ke,te.ContentContainerDesign=Rt,te.contentContainerProps=Ze,te.default=Qn,te.propsResolver=ut,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});