@farris/ui-vue 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +1 -1
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +2 -2
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +7 -5
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +1 -1
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +3 -2
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +1 -1
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +498 -495
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +833 -832
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1 -1
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +3 -2
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1 -1
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +256 -254
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +416 -394
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +388 -386
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +1 -1
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +77 -76
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +4 -2
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +118 -118
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +80 -81
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +237 -237
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +1 -1
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +1 -1
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +9 -3
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +114 -112
- package/components/order/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1 -1
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +1 -1
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +485 -463
- package/components/query-solution/index.umd.cjs +3 -3
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +1 -1
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +544 -545
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +6 -4
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/section/index.esm.js +1 -1
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +9 -7
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +77 -78
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +5 -3
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +1 -1
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +2 -2
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/video/index.esm.js +1 -1
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.esm.js +211 -211
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/checkbox/index.esm.js +1 -1
- package/designer/checkbox/index.umd.cjs +1 -1
- package/designer/checkbox-group/index.esm.js +25 -26
- package/designer/checkbox-group/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +15 -9
- package/designer/data-grid/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +917 -916
- package/designer/farris-designer.all.umd.cjs +5 -5
- package/designer/input-group/index.esm.js +2 -1
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +685 -689
- package/designer/list-view/index.umd.cjs +3 -3
- package/designer/radio-group/index.esm.js +7 -3
- package/designer/radio-group/index.umd.cjs +1 -1
- package/farris.all.esm.js +5641 -5603
- package/farris.all.umd.cjs +21 -21
- package/locales/data-grid/ui/en.json +2 -1
- package/locales/data-grid/ui/zh-CHS.json +2 -1
- package/locales/data-grid/ui/zh-CHT.json +2 -1
- package/locales/designer/en.json +2 -1
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +2 -1
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(oe,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("lodash-es"),require("vue-i18n"),require("../locale/index.umd.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","vue-i18n","../locale/index.umd.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../notify/index.umd.js"],r):(oe=typeof globalThis<"u"?globalThis:oe||self,r(oe["content-container"]={},oe.Vue,oe.LodashES,oe.vueI18n,oe.locale,oe.common,oe.VueUseCore,oe.dataView,oe.dynamicResolver))})(this,function(oe,r,ie,pt,ot,Ne,Jt,X,rt){"use strict";var Lo=Object.defineProperty;var zo=(oe,r,ie)=>r in oe?Lo(oe,r,{enumerable:!0,configurable:!0,writable:!0,value:ie}):oe[r]=ie;var Z=(oe,r,ie)=>zo(oe,typeof r!="symbol"?r+"":r,ie);function Bt(n,e){let t;function o(d){const{properties:h,title:m,ignore:f}=d,v=f&&Array.isArray(f),b=Object.keys(h).reduce((x,k)=>((!v||!f.find(L=>L===k))&&(x[k]=h[k].type==="object"&&h[k].properties?o(h[k]):ie.cloneDeep(h[k].default)),x),{});if(m&&(!v||!f.find(x=>x==="id"))){const x=m.toLowerCase().replace(/-/g,"_");b.id=`${x}_${Math.random().toString().slice(2,6)}`}return b}function i(d){const{properties:h,title:m,required:f}=d;if(f&&Array.isArray(f)){const v=f.reduce((b,x)=>(b[x]=h[x].type==="object"&&h[x].properties?o(h[x]):ie.cloneDeep(h[x].default),b),{});if(m&&f.find(b=>b==="id")){const b=m.toLowerCase().replace(/-/g,"_");v.id=`${b}_${Math.random().toString().slice(2,6)}`}return v}return{type:m}}function a(d,h={},m){const f=n[d];if(f){let v=i(f);const b=e[d];return v=b?b({getSchemaByType:a},v,h,m):v,t!=null&&t.appendIdentifyForNewControl&&t.appendIdentifyForNewControl(v),v}return null}function s(d,h){const m=o(h);return Object.keys(m).reduce((f,v)=>(Object.prototype.hasOwnProperty.call(d,v)&&(f[v]&&ie.isPlainObject(f[v])&&ie.isPlainObject(d[v]||!d[v])?Object.assign(f[v],d[v]||{}):f[v]=d[v]),f),m),m}function u(d,h){return Object.keys(d).filter(f=>d[f]!=null).reduce((f,v)=>{if(h.has(v)){const b=h.get(v);if(typeof b=="string")f[b]=d[v];else{const x=b(v,d[v],d);Object.assign(f,x)}}else f[v]=d[v];return f},{})}function l(d,h,m=new Map){const f=s(d,h);return u(f,m)}function c(d){var m;const h=d.type;if(h){const f=n[h];if(!f)return d;const v=s(d,f),b=((m=d.editor)==null?void 0:m.type)||"";if(b){const x=n[b],k=s(d.editor,x);v.editor=k}return v}return d}function p(d){t=d}return{getSchemaByType:a,resolveSchemaWithDefaultValue:c,resolveSchemaToProps:l,mappingSchemaToProps:u,setDesignerContext:p}}const Ot={},It={},{getSchemaByType:Ao,resolveSchemaWithDefaultValue:Zt,resolveSchemaToProps:Kt,mappingSchemaToProps:en,setDesignerContext:Ho}=Bt(Ot,It);function tn(n={}){function e(c,p,d,h){if(typeof d=="number")return h[c].length===d;if(typeof d=="object"){const m=Object.keys(d)[0],f=d[m];if(m==="not")return Number(h[c].length)!==Number(f);if(m==="moreThan")return Number(h[c].length)>=Number(f);if(m==="lessThan")return Number(h[c].length)<=Number(f)}return!1}function t(c,p,d,h){return h[c]&&h[c].propertyValue&&String(h[c].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((c,p)=>(c.set(p,n[p]),c),o);function i(c,p){const d=c;return typeof p=="number"?[{target:d,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:d,operator:"getProperty",param:c,value:!!p}]:typeof p=="object"?Object.keys(p).map(h=>{if(h==="length")return{target:d,operator:"length",param:null,value:p[h]};const m=h,f=p[h];return{target:d,operator:"getProperty",param:m,value:f}}):[]}function a(c){return Object.keys(c).reduce((d,h)=>{const m=i(h,c[h]);return d.push(...m),d},[])}function s(c,p){if(o.has(c.operator)){const d=o.get(c.operator);return d&&d(c.target,c.param,c.value,p)||!1}return!1}function u(c,p){return a(c).reduce((m,f)=>m&&s(f,p),!0)}function l(c,p){const d=Object.keys(c),h=d.includes("allOf"),m=d.includes("anyOf"),f=h||m,x=(f?c[f?h?"allOf":"anyOf":"allOf"]:[c]).map(L=>u(L,p));return h?!x.includes(!1):x.includes(!0)}return{parseValueSchema:l}}const nn={convertTo:(n,e,t,o)=>{n.appearance||(n.appearance={}),n.appearance[e]=t},convertFrom:(n,e,t)=>n.appearance?n.appearance[e]:n[e]},on={convertFrom:(n,e,t)=>n.buttons&&n.buttons.length?`共 ${n.buttons.length} 项`:"无"},rn={convertTo:(n,e,t,o)=>{n.editor&&(n.editor[e]=t)},convertFrom:(n,e,t)=>n.editor&&Object.prototype.hasOwnProperty.call(n.editor,e)?n.editor[e]:n[e]},T={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:"列表导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"}},an={convertFrom:(n,e,t)=>{var i;const o=n.editor&&n.editor[e]?n.editor[e]:n[e];return((i=T[o])==null?void 0:i.name)||o}},sn={convertTo:(n,e,t,o)=>{n[e]=n[e]},convertFrom:(n,e,t)=>n.editor?t.getRealEditorType(n.editor.type):""},ln={convertTo:(n,e,t,o)=>{(n.type==="data-grid-column"||n.type==="tree-grid-column")&&(n.formatter?n.formatter[e]=t:n.formatter={[e]:t})},convertFrom:(n,e,t)=>{if(n.formatter){if(e==="trueText")return n.formatter.trueText;if(e==="falseText")return n.formatter.falseText;if(e==="prefix")return n.formatter.prefix;if(e==="suffix")return n.formatter.suffix;if(e==="precision")return n.formatter.precision;if(e==="decimal")return n.formatter.decimal;if(e==="thousand")return n.formatter.thousand;if(e==="dateFormat")return n.formatter.dateFormat||"yyyy-MM-dd";if(e==="customFormat")return n.formatter.customFormat;if(e==="type")return n.formatter.type||"none"}return"none"}},cn={convertTo:(n,e,t,o)=>{n.command?n.command[e]=t:n.command={[e]:t},e==="enable"&&t&&(n.command.commands||(n.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(n,e,t)=>n.command&&e==="enable"?n.command.enable:""},un={convertTo:(n,e,t,o)=>{n.column?n.column[e]=t:n.column={[e]:t},e==="fitColumns"&&t&&(n.column.fitMode||(n.column.fitMode="average"))},convertFrom:(n,e,t)=>{if(n.column){if(e==="fitColumns")return n.column.fitColumns;if(e==="fitMode")return n.column.fitMode}return""}},dn={convertTo:(n,e,t,o)=>{n.summary?n.summary[e]=t:n.summary={[e]:t},e==="enable"&&t&&(n.summary?n.summary.groupFields||(n.summary.groupFields=[]):n.summary={enable:t,groupFields:[]})},convertFrom:(n,e,t)=>n.summary&&e==="enable"?n.summary.enable:n.type==="data-grid-column"?n.enableSummary===void 0?!1:n.enableSummary:""},fn={convertTo:(n,e,t,o)=>{n.group?n.group[e]=t:n.group={[e]:t},e==="enable"&&t&&(n.group?n.group.groupFields||(n.group.groupFields=[]):n.group={enable:t,groupFields:[],showSummary:!1})},convertFrom:(n,e,t)=>{if(n.group){if(e==="enable")return n.group.enable;if(e==="showSummary")return n.group.showSummary}}},pn={convertFrom:(n,e)=>n.binding?n.binding.path:"",convertTo:(n,e,t)=>{if(t&&t.length>0){const o=t[0];n.binding||(n.binding={}),n.binding.type="Form",n.binding.path=o.bindingField,n.binding.field=o.id,n.binding.fullPath=o.path,n.path=o.bindingPath}}},mn={convertTo:(n,e,t,o)=>{n.pagination||(n.pagination={}),n.pagination[e]=t},convertFrom:(n,e,t)=>n.pagination?n.pagination[e]:n[e]},hn={convertTo:(n,e,t,o)=>{n.rowNumber||(n.rowNumber={}),n.rowNumber[e]=t},convertFrom:(n,e,t)=>n.rowNumber?n.rowNumber[e]:n[e]},vn={convertTo:(n,e,t,o)=>{n.selection||(n.selection={}),n.selection[e]=t},convertFrom:(n,e,t)=>{var o,i;return e==="showCheckbox"?(o=n.selection)!=null&&o.multiSelect?!0:(i=n.selection)==null?void 0:i.showCheckbox:n.selection?n.selection[e]:n[e]}},gn={convertFrom:(n,e,t)=>n[e]&&n[e].length?`共 ${n[e].length} 项`:""},yn={convertFrom:(n,e)=>n[e]||"",convertTo:(n,e,t)=>{n[e]=t}},bn={convertTo:(n,e,t,o)=>{n.size||(n.size={}),n.size[e]=t},convertFrom:(n,e,t)=>n.size?n.size[e]:n[e]},wn={convertFrom:(n,e,t)=>{var o,i;return(o=n.formatter)!=null&&o.data&&e==="formatterEnumData"&&!n.formatterEnumData?(i=n.formatter)==null?void 0:i.data:n.formatterEnumData}},Cn={convertTo:(n,e,t,o)=>{n.sort||(n.sort={}),n.sort[e]=t},convertFrom:(n,e,t)=>{var o,i;if(e==="mode")return((o=n.sort)==null?void 0:o.mode)||"client";if(e==="multiSort")return!!((i=n.sort)!=null&&i.multiSort)}},xn={convertTo:(n,e,t,o)=>{n.filter||(n.filter={}),n.filter[e]=t},convertFrom:(n,e,t)=>{var o;if(e==="mode")return((o=n.filter)==null?void 0:o.mode)||"client"}},Sn={convertTo:(n,e,t,o)=>{n.rowOption?n.rowOption[e]=t:n.rowOption={[e]:t}},convertFrom:(n,e,t)=>{if(n.rowOption){if(e==="customRowStyle")return n.rowOption.customRowStyle;if(e==="customCellStyle")return n.rowOption.customCellStyle}return""}};function Vt(n,e,t){const o=new Map([["/converter/appearance.converter",nn],["/converter/buttons.converter",on],["/converter/property-editor.converter",rn],["/converter/items-count.converter",gn],["/converter/type.converter",an],["/converter/change-editor.converter",sn],["/converter/change-formatter.converter",ln],["/converter/column-command.converter",cn],["/converter/column-option.converter",un],["/converter/summary.converter",dn],["/converter/group.converter",fn],["/converter/form-group-label.converter",yn],["/converter/field-selector.converter",pn],["/converter/pagination.converter",mn],["/converter/row-number.converter",hn],["/converter/grid-selection.converter",vn],["/converter/size.converter",bn],["/converter/change-formatter-enum.converter",wn],["/converter/grid-sort.converter",Cn],["/converter/grid-filter.converter",xn],["/converter/row-option.converter",Sn]]),i=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),a=tn();function s(f,v){return()=>a.parseValueSchema(f,v)}function u(f,v,b){return f.includes("visible")&&v.visible!==void 0?typeof v.visible=="boolean"?()=>!!v.visible:v.visible===void 0?!0:s(v.visible,b):()=>!0}function l(f,v,b){return f.includes("readonly")&&v.readonly!==void 0?typeof v.readonly=="boolean"?()=>!!v.readonly:s(v.readonly,b):()=>!1}function c(f,v){const b=f.$converter||v;return typeof b=="string"&&b&&o.has(b)?o.get(b)||null:b||null}function p(f,v,b,x,k,L="",P=""){return Object.keys(f).map(y=>{const M=r.ref(1),j=y,B=f[y],A=Object.keys(B),w=B.title,S=B.type,O=i.get(S)||{type:"input-group",enableClear:!1},N=B.editor?Object.assign({},O,B.editor):Object.assign({},O),$=u(A,B,v),U=l(A,B,v);N.readonly=N.readonly===void 0?U():N.readonly;const K=B.type==="cascade"?p(B.properties,v,b,x,k,L,P):[],I=!0;let F=c(B,P);const _=r.computed({get(){if(M.value){if(["class","style"].find(ce=>ce===j)&&!F&&(F=o.get("/converter/appearance.converter")||null),F&&F.convertFrom)return F.convertFrom(b,y,k,L);const re=b[y];return Object.prototype.hasOwnProperty.call(B,"defaultValue")&&(re===void 0||typeof re=="string"&&re==="")?B.type==="boolean"?B.defaultValue:B.defaultValue||"":re}return null},set(re){M.value+=1,F&&F.convertTo?(F.convertTo(x,y,re,k,L),F.convertTo(b,y,re,k,L)):(x[y]=re,b[y]=re)}}),{refreshPanelAfterChanged:R,description:ee,isExpand:ve,parentPropertyID:ge}=B,G={propertyID:j,propertyName:w,propertyType:S,propertyValue:_,editor:N,visible:$,readonly:U,cascadeConfig:K,hideCascadeTitle:I,refreshPanelAfterChanged:R,description:ee,isExpand:ve,parentPropertyID:ge};return v[j]=G,G})}function d(f,v,b={}){const x={},k=n[f];return k&&k.categories?Object.keys(k.categories).map(P=>{const C=k.categories[P],y=C==null?void 0:C.title,M=p(C.properties||{},x,{},b,v);return{categoryId:P,categoryName:y,properties:M}}):[]}function h(f,v,b,x,k=""){const L=v.$ref.schema,P=v.$ref.converter,C=b[L],y=C.type,M=t(C),j={},B=n[y];if(B&&B.categories){const A=B.categories[f],w=A==null?void 0:A.title;P&&Object.keys(A.properties).forEach(N=>{A.properties[N].$converter=P});const S=(A==null?void 0:A.properties)||{},O=p(S,j,M,C,x,k);return{categoryId:f,categoryName:w,properties:O}}return{categoryId:f,categoryName:"",properties:[]}}function m(f,v,b,x,k){const L=f.type,P=t(f),C={};let y=k||n[L];if(y&&Object.keys(y).length===0&&b&&b.getPropConfig&&(y=b.getPropConfig(x)),y&&y.categories){const M=[];return Object.keys(y.categories).map(j=>{const B=y.categories[j];if(B.$ref){M.push(h(j,B,f,v,x));return}const A=B==null?void 0:B.title,w=B==null?void 0:B.tabId,S=B==null?void 0:B.tabName,O=B==null?void 0:B.hide,N=B==null?void 0:B.hideTitle,$=p(B.properties||{},C,P,f,v,x,B.$converter),{setPropertyRelates:U}=B,K=B==null?void 0:B.parentPropertyID;M.push({categoryId:j,categoryName:A,tabId:w,tabName:S,hide:O,properties:$,hideTitle:N,setPropertyRelates:U,parentPropertyID:K})}),M}return[]}return{getPropertyConfigBySchema:m,getPropertyConfigByType:d,propertyConverterMap:o}}const Pt={},$t={};Vt(Pt,$t,Zt);const Dt={},Rt={},{getSchemaByType:Uo,resolveSchemaWithDefaultValue:Tn,resolveSchemaToProps:_o,mappingSchemaToProps:Wo,setDesignerContext:Go}=Bt(Dt,Rt),qt={},Lt={};Vt(qt,Lt,Tn);function Qe(n,e,t=new Map,o=(s,u,l,c)=>u,i={},a=s=>s){return Ot[e.title]=e,It[e.title]=o,Pt[e.title]=i,$t[e.title]=a,Dt[e.title]=e,Rt[e.title]=o,qt[e.title]=i,Lt[e.title]=a,(s={},u=!0)=>{if(!u)return en(s,t);const l=Kt(s,e,t),c=Object.keys(n).reduce((p,d)=>(p[d]=n[d].default,p),{});return Object.assign(c,l)}}function mt(n,e){return{customClass:e.class,customStyle:e.style}}const jn=new Map([["appearance",mt]]),Mn={$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 En(n,e,t){return e}const it={customClass:{type:String,default:""},customStyle:{type:String,default:""},visible:{type:Boolean,default:!0}},ht=Qe(it,Mn,jn,En),at=r.defineComponent({name:"FContentContainer",props:it,emits:[],setup(n,e){return()=>n.visible&&r.createVNode("div",{class:n.customClass,style:n.customStyle},[e.slots.default&&e.slots.default()])}});function kn(){function n(e,t){var s;if(!e)return!1;const o=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!o)return!1;const i=o.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(o.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![T["response-layout-item"].type,T["response-form"].type,T.fieldset.type].includes(i)||(e.componentType===T.tabs.type||e.componentType===T.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![T["content-container"].type,T["splitter-pane"].type,T["response-layout-item"].type].includes(i))||[T["query-solution"].type,T["filter-bar"].type].includes(e.componentType)||e.componentType===T.fieldset.type&&i!==T["response-form"].type)}return{basalDragulaRuleForContainer:n}}class Fn{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,i=o==null?void 0:o.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:p,canAccept:d}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(c,s),a.canDelete=a.canDelete&&this.resolveRuleValue(p,s),a.canAccept=a.canAccept&&this.resolveRuleValue(d,s)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let i=!0;for(const a of o){const{firstLevelChild:s,secondLevelChild:u,parent:l,...c}=a;if(c&&t.component){let p=!0;for(const d of Object.keys(c))if(c[d]!==t.component[d]){p=!1;break}if(!p){i=!1;continue}}if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:p}=t;if(p&&!p.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:p}=t;if(!p||p.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:p}=t;if(p&&!p.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:p}=t;if(!p||p.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:p}=t;if(p&&!p.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:p}=t;if(p&&p.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(e){var v,b,x,k;const t=e.schema,o=t.appearance&&t.appearance.class||"",i=o.split(" ")||[],a=t.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],c=(v=s==null?void 0:s.contents)!=null&&v.length?s==null?void 0:s.contents[0]:null,p=c&&c.appearance?c.appearance.class:"",d=p?p.split(" "):[],h=t.type==="component"?(x=(b=e.parent)==null?void 0:b.parent)==null?void 0:x.schema:(k=e.parent)==null?void 0:k.schema,m=h&&h.appearance&&h.appearance.class||"",f=m?m.split(" "):[];return{componentClass:o,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:p,secondLevelChildClassList:d,parentSchema:h,parentClass:m,parentClassList:f,component:t}}}const Nn=r.ref(0);var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bn={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(o,i,a){function s(c,p){if(!i[c]){if(!o[c]){var d=typeof st=="function"&&st;if(!p&&d)return d(c,!0);if(u)return u(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=i[c]={exports:{}};o[c][0].call(m.exports,function(f){var v=o[c][1][f];return s(v||f)},m,m.exports,t,o,i,a)}return i[c].exports}for(var u=typeof st=="function"&&st,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,o,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(d){var h=a[d];return h?h.lastIndex=0:a[d]=h=new RegExp(s+d+u,"g"),h}function c(d,h){var m=d.className;m.length?l(h).test(m)||(d.className+=" "+h):d.className=h}function p(d,h){d.className=d.className.replace(l(h)," ").trim()}o.exports={add:c,rm:p}},{}],2:[function(t,o,i){(function(a){var s=t("contra/emitter"),u=t("crossvent"),l=t("./classes"),c=document,p=c.documentElement;function d(w,S){var O=arguments.length;O===1&&Array.isArray(w)===!1&&(S=w,w=[]);var N,$,U,K,I,F,_,R,ee,ve=null,ge,G,re=!1,ce=0,te,z=S||{};z.moves===void 0&&(z.moves=k),z.accepts===void 0&&(z.accepts=k),z.invalid===void 0&&(z.invalid=Ze),z.containers===void 0&&(z.containers=w||[]),z.isContainer===void 0&&(z.isContainer=x),z.copy===void 0&&(z.copy=!1),z.copySortSource===void 0&&(z.copySortSource=!1),z.revertOnSpill===void 0&&(z.revertOnSpill=!1),z.removeOnSpill===void 0&&(z.removeOnSpill=!1),z.direction===void 0&&(z.direction="vertical"),z.ignoreInputTextSelection===void 0&&(z.ignoreInputTextSelection=!0),z.mirrorContainer===void 0&&(z.mirrorContainer=c.body);var ne=s({containers:z.containers,start:je,end:ze,cancel:E,remove:Xe,destroy:Le,canMove:Ve,dragging:!1});return z.removeOnSpill===!0&&ne.on("over",wt).on("out",Ct),Oe(),ne;function qe(g){return ne.containers.indexOf(g)!==-1||z.isContainer(g)}function Oe(g){var V=g?"remove":"add";f(p,V,"mousedown",se),f(p,V,"mouseup",$e)}function Te(g){var V=g?"remove":"add";f(p,V,"mousemove",Je)}function We(g){var V=g?"remove":"add";u[V](p,"selectstart",Ge),u[V](p,"click",Ge)}function Le(){Oe(!0),$e({})}function Ge(g){ge&&g.preventDefault()}function se(g){K=g.clientX,I=g.clientY;var V=v(g)!==1||g.metaKey||g.ctrlKey;if(!V){var D=g.target,H=Ie(D);H&&(ge=H,Te(),g.type==="mousedown"&&(y(D)?D.focus():g.preventDefault()))}}function Je(g){if(ge){if(v(g)===0){$e({});return}if(!(g.clientX!==void 0&&Math.abs(g.clientX-K)<=(z.slideFactorX||0)&&g.clientY!==void 0&&Math.abs(g.clientY-I)<=(z.slideFactorY||0))){if(z.ignoreInputTextSelection){var V=A("clientX",g)||0,D=A("clientY",g)||0,H=c.elementFromPoint(V,D);if(y(H))return}var Q=ge;Te(!0),We(),ze(),Pe(Q),l.add(R||U,"gu-transit"),St(),xt(),ce=0,Fe(g)}}}function Ie(g){if(!(ne.dragging&&N)&&!qe(g)){for(var V=g;C(g)&&qe(C(g))===!1;)if(z.invalid(g,V)||(g=C(g),!g))return;var D=C(g);if(D&&!z.invalid(g,V)){var H=z.moves(g,D,V,j(g));if(H)return{item:g,source:D}}}}function Ve(g){return!!Ie(g)}function je(g){var V=Ie(g);V&&Pe(V)}function Pe(g){Nt(g.item,g.source)&&(R=g.item.cloneNode(!0),ne.emit("cloned",R,g.item,"copy")),$=g.source,U=g.item,F=_=j(g.item),ne.dragging=!0,ne.emit("drag",U,$)}function Ze(){return!1}function ze(){if(ne.dragging){var g=R||U;Ye(g,C(g))}}function ke(){ge=!1,Te(!0),We(!0)}function $e(g){if(ke(),!!ne.dragging){var V=R||U,D=A("clientX",g)||0,H=A("clientY",g)||0,Q=b(N,D,H),J=ue(Q,D,H);J&&(R&&z.copySortSource||!R||J!==$)?Ye(V,J):z.removeOnSpill?Xe():E()}}function Ye(g,V){var D=C(g);R&&z.copySortSource&&V===$&&D.removeChild(U),le(V)?ne.emit("cancel",g,$):ne.emit("drop",g,V,$,_),Y()}function Xe(){if(ne.dragging){var g=R||U,V=C(g);V&&V.removeChild(g),ne.emit(R?"cancel":"remove",g,V,$),Y()}}function E(g){if(ne.dragging){var V=arguments.length>0?g:z.revertOnSpill,D=R||U,H=C(D),Q=le(H);Q===!1&&V&&(R?H&&H.removeChild(R):$.insertBefore(D,F)),Q||V?ne.emit("cancel",D,$,$):ne.emit("drop",D,H,$,_),Y()}}function Y(){var g=R||U;ke(),Tt(),jt(),g&&l.rm(g,"gu-transit"),ee&&clearTimeout(ee),ne.dragging=!1,ve&&ne.emit("out",g,ve,$),ne.emit("dragend",g,ce),$=U=R=F=_=ee=ve=null}function le(g,V){var D;return V!==void 0?D=V:N?D=_:D=j(R||U),g===$&&D===F}function ue(g,V,D){for(var H=g;H&&!Q();)H=C(H);return H;function Q(){var J=qe(H);if(J===!1)return!1;var xe=dt(H,g),ye=ft(H,xe,V,D),be=le(H,ye);return be?!0:z.accepts(U,H,$,ye)}}function Fe(g){if(!N)return;g.preventDefault();var V=A("clientX",g)||0,D=A("clientY",g)||0;N.style.left=V-2+"px",N.style.top=D-2+"px";var H=R||U,Q=b(N,V,D),J=ue(Q,V,D),xe=J!==null&&J!==ve;(xe||J===null)&&(we(),ve=J,Ee()),Ft(Q,D);var ye=C(H);if(J===$&&R&&!z.copySortSource){ye&&ye.removeChild(H);return}var be,Me=dt(J,Q);if(re=Ke(Me,J),Me!==null)be=ft(J,Me,V,D);else if(z.revertOnSpill===!0&&!R)be=F,J=$;else{R&&ye&&ye.removeChild(H),R&&G&&(G.style.display="none");return}G.style.display="block",bt(be,H,xe),be?Et(Me,be):kt(J);function de(me){ne.emit(me,H,ve,$)}function Ee(){xe&&de("over")}function we(){ve&&de("out")}}function bt(g,V,D){(g===V||g===j(V))&&(_=j(V)),(g===null&&D||g!==V&&g!==j(V))&&(_=g)}function wt(g){l.rm(g,"gu-hide")}function Ct(g){ne.dragging&&l.add(g,"gu-hide")}function xt(){N||(N=document.createElement("div"),N.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;",N.innerHTML=z.getMirrorText&&z.getMirrorText(U)||"控件",l.add(N,"gu-mirror"),z.mirrorContainer.appendChild(N),f(p,"add","mousemove",Fe),l.add(z.mirrorContainer,"gu-unselectable"),ne.emit("cloned",N,U,"mirror"))}function St(){if(G=document.createElement("div"),l.add(G,"gu-insertion"),U){var g=U.getBoundingClientRect();G.style.left=g.left+"px",G.style.top=g.top+"px"}re=!1,z.mirrorContainer.appendChild(G)}function Tt(){N&&(l.rm(z.mirrorContainer,"gu-unselectable"),f(p,"remove","mousemove",Fe),C(N).removeChild(N),N=null)}function jt(){G&&(C(G).removeChild(G),G=null)}function dt(g,V){for(var D=V;D!==g&&C(D)!==g;)D=C(D);return D===p?null:D}function Ke(g,V){if(!V)return re;var D=g||V&&V.lastElementChild;if(!D)return!0;var H=getComputedStyle(g),Q=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(Q)return!0;if(V){var J=getComputedStyle(V),xe=J.getPropertyValue("display");if(/flex$/.test(xe)){var ye=J.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!Mt(V)}return!1}return!0}function Mt(g){if(!g.children||!g.children.length)return!1;for(const V of Array.from(g.children)){const H=(V.className&&V.className.split(" ")||[]).filter(Q=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Q));if(!H.length)return!1;for(const Q of H){const J=Q.slice(Q.lastIndexOf("-")+1);if(parseInt(J,10)!==12)return!1}}return!0}function Et(g,V){const D=V.getBoundingClientRect();if(G.style.left=D.left+"px",G.style.top=D.top+"px",re){if(G.style.height=D.height+"px",G.style.width="4px",g){const H=g.getBoundingClientRect();H.top!==D.top&&(G.style.left=H.right+"px",G.style.top=H.top+"px",G.style.height=H.height+"px")}}else if(G.style.height="4px",G.style.width=D.width+"px",te){const H=te.getBoundingClientRect();D.top<H.top&&(G.style.display="none")}V===U&&U&&(G.style.display="none")}function kt(g){_=null;var V=g.lastElementChild;if(V){var D=V.getBoundingClientRect();re?(G.style.left=D.right+"px",G.style.top=D.top+"px",G.style.height=D.height+"px",G.style.width="4px"):(G.style.left=D.left+"px",G.style.top=D.bottom+"px",G.style.height="4px",G.style.width=D.width+"px"),V===U&&U&&(G.style.display="none")}else G.style.display="none"}function Ft(g,V){if(!z.mirrorContainer.contains(g)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(te=h(g),!te||!te.contains(g)))return;const D=document.querySelector(".dgComponentSelected"),H=te.getBoundingClientRect();if(V-30<H.top&&te.scrollTop>0){let Q=te.scrollTop<10?te.scrollTop:10;te.scrollBy(0,-1*Q),D&&te.contains(D)&&(ce=ce+-1*Q)}if(V+30>H.bottom&&te.scrollTop<te.scrollHeight-te.clientHeight){const Q=te.scrollHeight-te.clientHeight-te.scrollTop;let J=Q<10?Q:10;te.scrollBy(0,J),D&&te.contains(D)&&(ce=ce+J)}}function ft(g,V,D,H){var Q=z.direction==="horizontal",J=z.direction==="mixed",xe=V!==g?be():ye();return xe;function ye(){var de=g.children.length,Ee,we,me;for(Ee=0;Ee<de;Ee++)if(we=g.children[Ee],me=we.getBoundingClientRect(),Q&&me.left+me.width/2>D||!J&&!Q&&me.top+me.height/2>H||J&&me.left+me.width>D&&me.top+me.height>H)return we;return null}function be(){var de=V.getBoundingClientRect();if(J){var Ee=H-de.top,we=D-de.left,me=de.bottom-H,et=de.right-D,tt=Math.min(we,et,Ee,me),nt;return re?nt=et<we:nt=me===tt||et===tt||we===tt,Me(nt)}return Me(Q?D>de.left+L(de)/2:H>de.top+P(de)/2)}function Me(de){return de?j(V):V}}function Nt(g,V){return typeof z.copy=="boolean"?z.copy:z.copy(g,V)}}function h(w){const S=Array.from(window.scrollContainerList);if(S.length===1){const N=Array.from(window.scrollContainerList)[0];return document.getElementById(N)}const O=m(S);for(const N of O)if(N.contains(w))return N;return null}function m(w){const S=[];return w.forEach(O=>{const N=document.getElementById(O);N&&S.push(N)}),S.sort((O,N)=>O.contains(N)?1:N.contains(O)?-1:0),S}function f(w,S,O,N){var $={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},U={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[S](w,U[O],N):a.navigator.msPointerEnabled?u[S](w,K[O],N):(u[S](w,$[O],N),u[S](w,O,N))}function v(w){if(w.touches!==void 0)return w.touches.length;if(w.which!==void 0&&w.which!==0)return w.which;if(w.buttons!==void 0)return w.buttons;var S=w.button;if(S!==void 0)return S&1?1:S&2?3:S&4?2:0}function b(w,S,O){w=w||{};var N=w.className||"",$;return w.className+=" gu-hide",$=c.elementFromPoint(S,O),w.className=N,$}function x(){return!1}function k(){return!0}function L(w){return w.width||w.right-w.left}function P(w){return w.height||w.bottom-w.top}function C(w){return w.parentNode===c?null:w.parentNode}function y(w){return w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="SELECT"||M(w)}function M(w){return!w||w.contentEditable==="false"?!1:w.contentEditable==="true"?!0:M(C(w))}function j(w){return w.nextElementSibling||S();function S(){var O=w;do O=O.nextSibling;while(O&&O.nodeType!==1);return O}}function B(w){return w.targetTouches&&w.targetTouches.length?w.targetTouches[0]:w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:w}function A(w,S){var O=B(S),N={pageX:"clientX",pageY:"clientY"};return w in N&&!(w in O)&&N[w]in O&&(w=N[w]),O[w]}o.exports=d}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,i){o.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(t,o,i){var a=t("ticky");o.exports=function(u,l,c){u&&a(function(){u.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,o,i){var a=t("atoa"),s=t("./debounce");o.exports=function(l,c){var p=c||{},d={};return l===void 0&&(l={}),l.on=function(h,m){return d[h]?d[h].push(m):d[h]=[m],l},l.once=function(h,m){return m._once=!0,l.on(h,m),l},l.off=function(h,m){var f=arguments.length;if(f===1)delete d[h];else if(f===0)d={};else{var v=d[h];if(!v)return l;v.splice(v.indexOf(m),1)}return l},l.emit=function(){var h=a(arguments);return l.emitterSnapshot(h.shift()).apply(this,h)},l.emitterSnapshot=function(h){var m=(d[h]||[]).slice(0);return function(){var f=a(arguments),v=this||l;if(h==="error"&&p.throws!==!1&&!m.length)throw f.length===1?f[0]:f;return m.forEach(function(x){p.async?s(x,f,v):x.apply(v,f),x._once&&l.off(h,x)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,i){(function(a){var s=t("custom-event"),u=t("./eventmap"),l=a.document,c=h,p=f,d=[];a.addEventListener||(c=m,p=v),o.exports={add:c,remove:p,fabricate:b};function h(C,y,M,j){return C.addEventListener(y,M,j)}function m(C,y,M){return C.attachEvent("on"+y,k(C,y,M))}function f(C,y,M,j){return C.removeEventListener(y,M,j)}function v(C,y,M){var j=L(C,y,M);if(j)return C.detachEvent("on"+y,j)}function b(C,y,M){var j=u.indexOf(y)===-1?A():B();C.dispatchEvent?C.dispatchEvent(j):C.fireEvent("on"+y,j);function B(){var w;return l.createEvent?(w=l.createEvent("Event"),w.initEvent(y,!0,!0)):l.createEventObject&&(w=l.createEventObject()),w}function A(){return new s(y,{detail:M})}}function x(C,y,M){return function(B){var A=B||a.event;A.target=A.target||A.srcElement,A.preventDefault=A.preventDefault||function(){A.returnValue=!1},A.stopPropagation=A.stopPropagation||function(){A.cancelBubble=!0},A.which=A.which||A.keyCode,M.call(C,A)}}function k(C,y,M){var j=L(C,y,M)||x(C,y,M);return d.push({wrapper:j,element:C,type:y,fn:M}),j}function L(C,y,M){var j=P(C,y,M);if(j){var B=d[j].wrapper;return d.splice(j,1),B}}function P(C,y,M){var j,B;for(j=0;j<d.length;j++)if(B=d[j],B.element===C&&B.type===y&&B.fn===M)return j}}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));o.exports=s}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,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}o.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(c,p){var d=document.createEvent("CustomEvent");return p?d.initCustomEvent(c,p.bubbles,p.cancelable,p.detail):d.initCustomEvent(c,!1,!1,void 0),d}:function(c,p){var d=document.createEventObject();return d.type=c,p?(d.bubbles=!!p.bubbles,d.cancelable=!!p.cancelable,d.detail=p.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,i){var a=o.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 p(P){if(s===setTimeout)return setTimeout(P,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(P,0);try{return s(P,0)}catch{try{return s.call(null,P,0)}catch{return s.call(this,P,0)}}}function d(P){if(u===clearTimeout)return clearTimeout(P);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(P);try{return u(P)}catch{try{return u.call(null,P)}catch{return u.call(this,P)}}}var h=[],m=!1,f,v=-1;function b(){!m||!f||(m=!1,f.length?h=f.concat(h):v=-1,h.length&&x())}function x(){if(!m){var P=p(b);m=!0;for(var C=h.length;C;){for(f=h,h=[];++v<C;)f&&f[v].run();v=-1,C=h.length}f=null,m=!1,d(P)}}a.nextTick=function(P){var C=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)C[y-1]=arguments[y];h.push(new k(P,C)),h.length===1&&!m&&p(x)};function k(P,C){this.fun=P,this.array=C}k.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function L(){}a.on=L,a.addListener=L,a.once=L,a.off=L,a.removeListener=L,a.removeAllListeners=L,a.emit=L,a.prependListener=L,a.prependOnceListener=L,a.listeners=function(P){return[]},a.binding=function(P){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(P){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,o,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},o.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,i){(function(a,s){var u=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,p={},d=0;i.setTimeout=function(){return new h(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new h(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(m){m.close()};function h(m,f){this._id=m,this._clearFn=f}h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(m,f){clearTimeout(m._idleTimeoutId),m._idleTimeout=f},i.unenroll=function(m){clearTimeout(m._idleTimeoutId),m._idleTimeout=-1},i._unrefActive=i.active=function(m){clearTimeout(m._idleTimeoutId);var f=m._idleTimeout;f>=0&&(m._idleTimeoutId=setTimeout(function(){m._onTimeout&&m._onTimeout()},f))},i.setImmediate=typeof a=="function"?a:function(m){var f=d++,v=arguments.length<2?!1:c.call(arguments,1);return p[f]=!0,u(function(){p[f]&&(v?m.apply(null,v):m.call(null),i.clearImmediate(f))}),f},i.clearImmediate=typeof s=="function"?s:function(m){delete p[m]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Bn);const On={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}},In={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},vt=r.defineComponent({name:"Toast",props:In,emits:["close","click"],setup:(n,e)=>{const{locale:t,t:o}=pt.useI18n(),i=r.ref(n.animate),a="fadeOut",s=r.computed(()=>n.options),u=r.ref(!1),l=r.computed(()=>s.value.title&&s.value.message),c=r.computed(()=>!s.value.title&&s.value.message),p=r.computed(()=>{const P={animated:u.value,toast:!0,"toast--only-content":!l.value};return P[n.animate]=!1,P[a]=u.value,P["toasty-type-"+s.value.type]=!0,s.value.theme&&(P[s.value.theme]=!0),P}),d=r.computed(()=>{const y=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,M={"f-icon":!0};return M[y]=!0,M}),h=r.computed(()=>s.value.title||s.value.message),m=r.computed(()=>n.showCloseButton),f=r.computed(()=>!!s.value.buttons||!!e.slots.default),v=r.computed(()=>t.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b(P){P.stopPropagation(),P.preventDefault(),u.value=!1,setTimeout(()=>{e.emit("close",s.value)},200)}function x(P,C){}function k(P){return`f-preten-link ${P.customClass?P.customClass:""}`}r.watch(i,()=>{i.value});const L=()=>{var P;return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((P=s.value.buttons)==null?void 0:P.map(C=>r.createVNode("span",{class:k(C),onClick:y=>void 0},[C.text]))),e.slots.default&&e.slots.default()])])};return()=>r.createVNode("div",{class:p.value,style:"min-height:44px"},[m.value&&r.createVNode("button",{title:o("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:b},[r.createVNode("span",{class:"f-icon modal_close"},null)]),h.value&&r.createVNode("section",{class:"modal-tips"},[!l.value&&r.createVNode("div",{class:"float-left modal-tips-iconwrap"},[r.createVNode("span",{class:d.value},null)]),r.createVNode("div",{class:"modal-tips-content"},[l.value&&r.createVNode(r.Fragment,null,[r.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:s.value.title},null),r.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:v.value},null),f.value&&L()]),c.value&&(s.value.buttons?r.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:v.value,innerHTML:s.value.message},null),r.createVNode("div",{class:"after-toast-title text-right ml-auto"},[L()])]):r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:v.value,innerHTML:s.value.message},null))])])])}}),lt=r.defineComponent({name:"Notify",props:On,emits:["close","empty"],setup(n,e){const t=r.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},i=r.ref(),a=r.ref(n.options),s=r.ref(n.showCloseButton),u=r.computed(()=>n.position||"bottom-right"),l=r.computed(()=>n.timeout!=null?n.timeout:3e3),c=r.computed(()=>{const h=n.bottom?n.bottom:o.bottom,m=n.top?n.top:o.top,f={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:u.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:u.value.indexOf("top")>-1?`${m}px`:"",bottom:u.value.indexOf("bottom")>-1?`${h}px`:""};return u.value.indexOf("center")>-1&&(f.left="50%",f.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(f.top="50%",f.transform="translate(-50%, -50%)")),f});function p(h){e.emit("close")}l.value&&setTimeout(()=>{p()},l.value),e.expose({closeToast:p,container:i,notifyPosition:u});function d(h,m){p()}return()=>r.createVNode("div",{class:t.value,style:c.value,ref:i},[r.createVNode(vt,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>d(h,a.value)},null)])}});class Vn{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",r.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").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=r.createApp({setup(){var c;const u=r.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 p=t.getNotifyInstances(i.position),d=p[p.length-1];if(d){const h=d.value.container.getBoundingClientRect();i.top=h.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=t.escapeAllHtml(i.options.message)),r.onUnmounted(()=>{document.body.removeChild(a)}),r.onMounted(()=>{t.updateNotifyPositionForCreate(i,u)}),()=>r.createVNode(r.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[r.createVNode(lt,r.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(ot.LocaleService.i18n),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 o=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+o-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=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"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",i="",a,s,u;typeof t=="string"?o=t:t&&(o=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:o,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 Pn=Symbol("NOTIFY_SERVICE_TOKEN");lt.install=n=>{n.component(lt.name,lt),n.component(vt.name,vt);const e=new Vn;n.provide(Pn,e),n.provide("FNotifyService",e)},`${ot.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const $n={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:ot.LocaleService.getLocaleValue("datagrid.lineNumberTitle")}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}}};function Dn(n,e,t,o,i,a,s,u,l,c,p,d,h,m,f,v,b){const{calculateCellPositionInRow:x}=a,{columnContext:k,hasLeftFixedColumn:L,hasRightFixedColumn:P}=s,{gridDataStyle:C,leftFixedGridDataStyle:y,rightFixedGridDataStyle:M}=m,{renderDataRow:j}=X.getHierarchyRow(n,e,k,b,u,l,c,p,d,h,m,f,v),B=[j];function A($,U){const K=x($);return b.value.filter(I=>I.visible!==!1).map((I,F)=>B[I.type](I,K,U,F))}function w(){return r.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[r.createVNode("div",{class:"fv-grid-data",style:y.value},[A(k.value.leftColumns.filter($=>$.visible),"left")])])}function S(){return r.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[r.createVNode("div",{class:"fv-grid-data",style:C.value},[A(k.value.primaryColumns.filter($=>$.visible),"primary")])])}function O(){return r.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[r.createVNode("div",{class:"fv-grid-data",style:M.value},[A(k.value.rightColumns.filter($=>$.visible),"right")])])}function N(){const $=[];return L.value&&$.push(w()),$.push(S()),P.value&&$.push(O()),$}return{renderDataArea:N}}const Rn=r.defineComponent({name:"FTreeGrid",props:$n,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,e){var Yt,Xt;const o=((Yt=n.rowOption)==null?void 0:Yt.height)||28,i=r.ref(20),a=r.ref(n.columns),s=X.useIdentify(n),{idField:u}=s,l=r.ref(),c=r.ref(),p=r.ref(),d=r.ref(),h=r.ref(),m=r.ref([]),f=r.ref(!1),v=r.ref(((Xt=n.rowOption)==null?void 0:Xt.wrapContent)||!1),b=X.useGroupData(n,s),x=X.useFilter(n,e),k=X.useHierarchy(n),{collapseField:L}=k,{showLoading:P,renderLoading:C}=X.useLoading(n,l),y=X.useDataView(n,new Map,x,k,s),{dataView:M}=y,j=X.useSelection(n,y,s,m,e),{showSelection:B,selectedValues:A}=j,w=X.useSelectHierarchyItem(n,m,y,s,j,e),S=r.computed(()=>n.disabled),O=r.computed(()=>n.virtualized?Math.min(y.dataView.value.length,i.value):y.dataView.value.length),N=X.usePagination(n,y),{shouldRenderPagination:$}=N,{containerStyleObject:U}=X.useDataViewContainerStyle(n),K=X.useCommandColumn(n),{applyCommands:I}=K;I(a);const{applyColumnSetting:F,removeColumnSetting:_}=X.useSettingColumn(n);n.showSetting&&F(a);const R=X.useColumn(n,e),ee=X.useSort(n),{applyColumnSorter:ve,columnContext:ge,updateColumnRenderContext:G}=R;ve(y,ee);const re=X.useGroupColumn(n,ge),ce=X.useRow(n,e,j,s),te=X.useEdit(n,e,s,ce,m),z=X.useVisualDataBound(n),ne=X.useVisualDataCell(n,te,z),qe=X.useVisualDataRow(n,y,te,k,s,z,ne),Oe=X.useVisualData(n,a,y,O,0,qe),{getVisualData:Te}=Oe,We=X.useCellPosition(n,ge),Le=X.useSidebar(n,j),{sidebarWidth:Ge}=Le,se=X.useVirtualScroll(n,y,m,ge,Oe,O,0,Ge),{onWheel:Je,dataGridWidth:Ie,viewPortHeight:Ve,viewPortWidth:je,resetScroll:Pe,updateVisibleRowsOnLatestVisibleScope:Ze}=se,ze=X.useFitColumn(n,ge,c,je,re),{calculateColumnsSize:ke}=ze,$e=X.useFilterHistory(),Ye=X.useColumnFilter(c,h,y,$e,se),Xe=X.useDragColumn(n,e,R,y,re,b,se),E=r.computed(()=>{const q={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return Ne.getCustomClass(q,n.customClass)}),Y=r.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":f.value,"fv-grid-wrap-content":v.value})),{renderDataArea:le}=Dn(n,e,p,d,h,We,R,y,te,k,ce,j,w,se,Oe,z,m),{renderGridHeader:ue,renderGridColumnResizeOverlay:Fe,shouldShowHeader:bt}=X.getColumnHeader(n,e,c,d,h,R,y,Xe,Ye,x,$e,ze,re,j,Le,ee,se,je,m),{renderDataGridSidebar:wt}=X.getSidebar(n,ce,j,Le,se),{renderDisableMask:Ct}=X.getDisableMask(),{renderHorizontalScrollbar:xt}=X.getHorizontalScrollbar(n,c,se),{renderVerticalScrollbar:St}=X.getVerticalScrollbar(n,c,se);function Tt(){var q,W,fe;if(c.value&&c.value.clientHeight>0&&((q=c.value)==null?void 0:q.clientWidth)>0){const he=Math.ceil(c.value.clientHeight/o);he>i.value&&(i.value=he,Ze()),Ve.value=((W=p.value)==null?void 0:W.clientHeight)||0,Ie.value=((fe=c.value)==null?void 0:fe.clientWidth)||0,ke()}}r.onMounted(()=>{c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/o),i.value),m.value=Te(0,O.value+0-1),Jt.useResizeObserver(c.value,Tt),ke(),r.nextTick(()=>{c.value&&(Ie.value=c.value.clientWidth),p.value&&(je.value=p.value.clientWidth,Ve.value=p.value.clientHeight)})),P.value&&C()}),r.onUnmounted(()=>{}),r.watch(je,()=>{c.value&&ke()});function jt(q){y.collapseTo(q),y.reOrderVisibleIndex(),Pe()}function dt(q){y.expandTo(q),y.reOrderVisibleIndex(),Pe()}function Ke(){const q=j.getSelectionRow();return q?q.dataIndex-1:-1}function Mt(){const q=Ke();y.insertNewDataItem(q),m.value=Te(0,O.value+0-1)}function Et(){const q=Ke();y.insertNewChildDataItem(q),m.value=Te(0,O.value+0-1)}function kt(q,W){const fe=m.value.find(Ce=>Ce.raw[u.value]===W),he=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(q,he)}function Ft(){const q=Ke(),W=w.getNextSelectableHierarchyItemId(q);y.removeHierarchyDataItem(q),m.value=Te(0,O.value+0-1),W&&w.selectItemById(W)}function ft(q){te.onEditingRow(q)}function Nt(q){te.acceptEditingRow(q)}function g(q){te.cancelEditingRow(q)}function V(q){q&&(a.value=q,I(a),G(a.value),ve(y,ee),ke())}r.watch(()=>n.columns,q=>{V(q)});function D(q,W){q&&(y.load(q),y.reOrderVisibleIndex(),W!=null&&W.keepScrollPosition?se.scrollTo(se.offsetY.value):Pe())}function H(q){w.selectItemById(q)}function Q(q){const W=m.value.find(fe=>fe.raw[s.idField.value]===q);W&&ce.clickRowItem(W)}function J(q){ce.activeRowById(q)}function xe(q){w.selectItemByIds(q)}function ye(){return j.getSelectedItems()}function be(){j.clearSelection()}const Me=r.computed(()=>!m.value||!m.value.length),{renderEmpty:de}=X.getEmpty(n,e);function Ee(){return j.getSelectionRow()}function we(q){w.unSelectItemByIds(q)}function me(){return j.currentSelectedDataId.value}function et(q,W,fe){const he=M.value.find(Ce=>Ce[u.value]===q);if(he){if(Object.keys(he).forEach(pe=>{Object.prototype.hasOwnProperty.call(W,pe)&&(he[pe]=W[pe])}),fe){const{collapseField:pe,disabledField:Ae,checkedField:He,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(he.__fv_collapse__=W[pe]),He&&!ie.isUndefined(W[He])&&(he.__fv_checked__=W[He]),Ae&&!ie.isUndefined(W[Ae])&&(he.__fv_disabled__=W[Ae]),Ue&&!ie.isUndefined(W[Ue])&&(he.__fv_visible__=W[Ue])}const Ce=m.value.find(pe=>pe.raw[u.value]===q),Qt=m.value.findIndex(pe=>pe.raw[u.value]===q);if(Ce){if(Ce.raw=he,Object.keys(Ce.data).forEach(pe=>{Ce.data[pe].updateData(he)}),fe){const{collapseField:pe,disabledField:Ae,checkedField:He,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(Ce.collapse=W[pe]),He&&!ie.isUndefined(W[He])&&(Ce.checked=W[He]),Ae&&!ie.isUndefined(W[Ae])&&(Ce.disabled=W[Ae]),Ue&&!ie.isUndefined(W[Ue])&&(Ce.visible=W[Ue])}m.value=[...m.value.slice(0,Qt),Ce,...m.value.slice(Qt+1)],y.updateSummary()}}}function tt(q){return Object.prototype.hasOwnProperty.call(q,"raw")?y.hasRealChildren(q.raw):y.hasRealChildren(q)}function nt(q){const W=y.dataView.value.find(fe=>fe[u.value]===q);return W?W[L.value]:""}function Bo(){return L.value}r.watch(()=>n.showSetting,(q,W)=>{q!==W&&(q?F(a):_(a),V(a.value))});function Oo(q){return m.value.filter(W=>q.includes(W.raw[n.idField]))}function Io(q){const W=s.idField.value,fe=m.value.find(he=>he.raw[W]===q);fe&&ce.changeRow(fe)}function Vo(){j.keepSelectingOnPaging.value||be(),y.updateVisibleDataSummary(m.value)}e.expose({activeRowById:J,addNewDataItem:Mt,addNewChildDataItem:Et,addChildrenToNode:kt,collapseTo:jt,expandTo:dt,removeDataItem:Ft,editDataItem:ft,acceptDataItem:Nt,cancelDataItem:g,updateColumns:V,updateDataSource:D,selectItemById:H,selectItemByIds:xe,getSelectedItems:ye,clearSelection:be,getSelectionRow:Ee,clickRowItemById:Q,unSelectItemByIds:we,getCurrentRowId:me,reassignRowData:et,hasChildren:tt,getCollapseField:Bo,getCollapseStatusById:nt,getVisibleDataByIds:Oo,selectRowById:Io,updateDerivedData:Vo});const Po=r.computed(()=>{const q={};return se.shouldShowHorizontalScrollbar.value&&(q.paddingBottom="10px"),se.shouldShowVirticalScrollbar.value&&(q.paddingRight="10px"),q}),$o=r.computed(()=>({...U.value,borderRadius:"5px"}));X.getPagination(n,e,y,se,N,j);const Do=r.computed(()=>({"d-flex":!0,"justify-content-between":$.value&&B.value,"justify-content-end":$.value&&!B.value,"position-relative":!0})),Ro=r.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:qo}=X.getSummary(n,y,R);return()=>r.createVNode("div",{ref:l,class:E.value,style:$o.value,onWheel:Je},[c.value&&bt.value&&ue(),r.createVNode("div",{ref:c,class:Y.value,onMouseover:()=>f.value=!0,onMouseleave:()=>f.value=!1,style:Po.value},[c.value&&wt(m),c.value&&le(),c.value&&Me.value&&de(),c.value&&xt(),c.value&&St()]),c.value&&qo(),B.value&&r.createVNode("div",{class:Do.value},[B.value&&r.createVNode("div",{class:Ro.value},[r.createVNode("div",null,["已选:"+A.value.length,r.createTextVNode(" 条")])])]),Fe(),S.value&&Ct()])}});Ne.withInstall(Rn);const qn=new Map([["appearance",mt]]);function Ln(n,e,t){return e}Qe({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"]},qn,Ln,{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 zn(n,e,t){var w;const o=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=r.ref();let s;function u(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function l(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function p(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function d(S){if(!S||!S.value)return null;if(S.value.schema&&S.value.schema.type==="component")return S.value;const O=r.ref(S==null?void 0:S.value.parent),N=d(O);return N||null}function h(S=e){var U;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(S);const{componentInstance:O,designerItemElementRef:N}=S;if(!O||!O.value)return null;const{getCustomButtons:$}=O.value;return O.value.canMove||$&&((U=$())!=null&&U.length)?N:h(S.parent)}function m(S){return!!t&&t.canAccepts(S)}function f(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function b(S,O){var N;!S||!O||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(S,O),(N=e==null?void 0:e.setupContext)==null||N.emit("dragEnd"))}function x(S,O){const{componentType:N}=S;let $=rt.getSchemaByTypeForDesigner(N,S,O);t&&t.onResolveNewComponentSchema&&($=t.onResolveNewComponentSchema(S,$));const U=N.toLowerCase().replace(/-/g,"_");return $&&!$.id&&$.type===N&&($.id=`${U}_${Math.random().toString().slice(2,6)}`),$}function k(S){S&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(S)}function L(...S){if(t&&t.getPropsConfig)return t.getPropsConfig(...S)}function P(S){if(!S)return;const O=e==null?void 0:e.schema,{formSchemaUtils:N}=S;if(O&&N.getExpressions().length){const $=N.getExpressions().findIndex(U=>U.target===O.id);$>-1&&N.getExpressions().splice($,1)}}function C(S){if(!S||!(e!=null&&e.schema))return;const O=e.schema,{formSchemaUtils:N}=S;N.removeCommunicationInComponent(O)}function y(S){t&&t.onRemoveComponent&&t.onRemoveComponent(),P(S),C(S),e!=null&&e.schema.contents&&e.schema.contents.map(O=>{let N=O.id;O.type==="component-ref"&&(N=O.component);const $=n.value.querySelectorAll(`#${N}-design-item`);$!=null&&$.length&&Array.from($).map(U=>{var K;(K=U==null?void 0:U.componentInstance)!=null&&K.value.onRemoveComponent&&U.componentInstance.value.onRemoveComponent(S)})})}function M(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function j(S){var N,$;if(!((N=e==null?void 0:e.schema)!=null&&N.id))return;if(!s&&S&&(s=S.formSchemaUtils),t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let O="";if(t!=null&&t.getComponentTitle)O=t.getComponentTitle();else{const{text:U,title:K,label:I,mainTitle:F,name:_,type:R}=e.schema;O=U||K||I||F||_||(($=T[R])==null?void 0:$.name)}O&&s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:O,parentPathName:O})}function B(S){var U;const{changeObject:O}=S,{propertyID:N,propertyValue:$}=O;if(["text","title","label","name","mainTitle"].includes((U=S==null?void 0:S.changeObject)==null?void 0:U.propertyID)&&N&&$&&(j(),s)){const K=s.getControlBasicInfoMap(),I=K.keys().toArray().filter(F=>{var _,R;return((_=K.get(F))==null?void 0:_.reliedComponentId)===((R=e==null?void 0:e.schema)==null?void 0:R.id)});I!=null&&I.length&&I.forEach(F=>{const _=K.get(F).parentPathName.split(" > ");_[0]=$,K.get(F).parentPathName=_.join(" > ")})}}function A(S){if(B(S),t&&t.onPropertyChanged)return t.onPropertyChanged(S)}return a.value={canMove:u(),canSelectParent:l(),canDelete:c(),canNested:!p(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(w=e==null?void 0:e.parent)==null?void 0:w.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:i,canAccepts:m,getBelongedComponentInstance:d,getDraggableDesignItemElement:h,getDraggingDisplayText:f,getPropConfig:L,getDragScopeElement:v,onAcceptMovedChildElement:b,onChildElementMovedOut:k,addNewChildComponentSchema:x,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||r.ref(!1),onRemoveComponent:y,getCustomButtons:M,onPropertyChanged:A,setComponentBasicInfoMap:j,updateContextSchema:e==null?void 0:e.updateContextSchema},a}const gt=new Map([["appearance",mt]]),An=new Map([]),Hn="root-viewmodel";class Un{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),o=this.createComponentNode(e),i=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),t.contents=[o];const{selectedFields:a}=e;a==null||a.forEach(u=>{if(u.$type===Ne.FormSchemaEntityField$Type.SimpleField){const l=ie.cloneDeep(u),c=this.resolveControlClassByFormColumns(e),p=this.controlCreatorUtils.setFormFieldProperty(l,"",c);p&&i.push(p)}});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:Hn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(i=>{if(i.$type===Ne.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===Ne.FormSchemaEntityFieldTypeName.Enum||s===Ne.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),t}}function _n(n,e,t,o){var a,s,u,l,c,p;const i=t.parentComponentInstance;if(i&&o){const d=(a=i.schema)==null?void 0:a.type,m={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:d==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(p=t.bindingSourceContext)==null?void 0:p.bindingEntityFields};return new Un(n,o).createComponent(m)}else return e}function Wn(n,e,t){return e}Qe({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},gt,_n);const zt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null},name:{description:"The name string of form group component",type:"string",default:"form group"},showLabelType:{description:"",type:"string",default:"visible"}},required:["id","type","editor"]};Qe({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},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}},zt,gt,void 0);const Gn=r.ref(0);function Yn(){Gn.value++}function Xn(n){const{formSchemaUtils:e,formStateMachineUtils:t}=n;function o(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function i(l,c=""){return e.getViewModelById(l).states.map(d=>o(d,c))}function a(l){const c=e.getRootViewModelId(),p=i(l);if(l===c)return p;const d=i(c,"root-component.");return[...p,...d]}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 Qn{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:(o,i,a,s)=>{const u=a.getExpressionRuleValue(e,t||i);return u&&u.value||""},convertTo:(o,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(d=>d.id===c&&d.value))?o.dictPickingExpressionId=c:delete o.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const i=o.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(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const i=[];return o.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t,type:"field"}}buildEntityFieldsTreeData(e=null,t){const o=[];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])),o.push({data:a,children:s,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(i=>{var l,c;const a=this.createTreeNode(i,t);a.type="entity";const 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)),o.push({data:a,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),i=this.buildChildEntityTreeData(t.type.entities,[t.code]);return i!=null&&i.length&&(o==null||o.push(...i)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const i=o==="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,o,i){const{expression:a,message:s,messageType:u}=t,l={id:`${e}_${o}`,type:o,value:a};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=s),o==="dataPicking"&&(l.messageType=u),o==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,i){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,o,i,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(p=>p.targetType===t&&p.target===a);const c=p=>p.value.trim()==="";if(l){const p=l.rules.find(d=>d.id===s.id);if(p)c(s)?l.rules=l.rules.filter(d=>d.id!==s.id):(Object.assign(p,s),i==="validate"&&e.type==="form-group"&&(p.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,o,i){return o.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),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:p=>{const d=this.updateExpression(e,t,p,s);if(i){const h=this.buildRule(u,p,s);i(h)}return d}}},a},{})}getExpressionInfo(e,t,o){const i=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,o),s={value:a&&a.value,targetId:i,targetType:t,expressionType:o};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,o=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,t,o,i)}}}getExpressionOptions(e,t,o){const i=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:i}}}class Jn{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,"designerContext");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService,this.designerContext=t.designerContext}getFormDesignerInstance(){var e,t;return(t=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:t.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:T[e.type]&&T[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in 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":{Nn.value++;break}}o&&o(s,e,u)}}}}getPropertyEditorParams(e,t=[],o="visible",i={},a={},s=""){const{getVariables:u,getControlName:l,getStateMachines:c}=Xn(this.designerHostService),p=this.getRealTargetType(e),d=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:d};return d.map(m=>{switch(m){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":h.expressionConfig=this.getExpressionOptions(e,p,s||o);break;case"StateMachine":h.stateMachines=c();break;case"Variable":Object.assign(h,{controlName:l(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),onBeforeOpenVariables:f=>{f.value=u(this.viewModelId)}},a);break}}),h}getVisibleProperty(e,t=""){var a;let o=["Const","Variable","StateMachine","Expression"];return t==="gridFieldEditor"?o=["Const","Expression"]:t==="form-group"&&!((a=e.binding)!=null&&a.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,t="",o={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in o)s[l]=Object.assign(s[l]||{},o[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 o=t&&t.parent&&t.parent.schema;if(!o)return;const i=o.contents.findIndex(s=>s.id===e),a=ie.cloneDeep(o.contents[i]);o.contents.splice(i,1),o.contents.splice(i,0,a),Yn()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.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:p,message:d}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:m}=h;let f=m.find(b=>b.target===u);f||(f={target:u,rules:[],targetType:l},m.push(f));const v=f.rules.find(b=>b.type===c);if(v)v.value=p,v.message=d;else{const b={id:a,type:c,value:p,message:d};f.rules.push(b)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.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,o){return new Qn(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const t={};return t[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var i;((i=o.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},t}}const _e=class _e{static getEditorTypesByMDataType(e,t=!1,o=""){if(t)return[{key:T["language-textbox"].type,value:T["language-textbox"].name}];let i=_e.fieldControlTypeMapping[e];if(o==="data-grid-column"&&(i!=null&&i.length)){const a=[T["check-group"].type,T["radio-group"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const e=[];for(const t in _e.fieldControlTypeMapping)_e.fieldControlTypeMapping[t].forEach(o=>{e.find(i=>i.key===o.key&&i.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var a;const o=(a=e.editor)==null?void 0:a.type,i=[];return(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&t&&t.categoryId&&t.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(o===T["input-group"].type||o===T.textarea.type||o===T["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),o===T["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===T["combo-list"].type||o===T["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===T["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),o===T["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),o===T.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};Z(_e,"fieldControlTypeMapping",{String:[{key:T["input-group"].type,value:T["input-group"].name},{key:T.lookup.type,value:T.lookup.name},{key:T["date-picker"].type,value:T["date-picker"].name},{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name},{key:T["check-group"].type,value:T["check-group"].name},{key:T["radio-group"].type,value:T["radio-group"].name},{key:T["combo-list"].type,value:T["combo-list"].name},{key:T.textarea.type,value:T.textarea.name},{key:T["time-picker"].type,value:T["time-picker"].name}],Text:[{key:T.textarea.type,value:T.textarea.name},{key:T.lookup.type,value:T.lookup.name}],Decimal:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Integer:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Number:[{key:T["number-spinner"].type,value:T["number-spinner"].name},{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name}],BigNumber:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Date:[{key:T["date-picker"].type,value:T["date-picker"].name}],DateTime:[{key:T["date-picker"].type,value:T["date-picker"].name}],Boolean:[{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name}],Enum:[{key:T["combo-list"].type,value:T["combo-list"].name},{key:T["radio-group"].type,value:T["radio-group"].name}],Object:[{key:T.lookup.type,value:T.lookup.name},{key:T["combo-list"].type,value:T["combo-list"].name},{key:T["radio-group"].type,value:T["radio-group"].name}]});let At=_e;Qe({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},zt,gt,void 0);const Zn={$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"]},Kn={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};rt.createPropsResolver(Kn,Zn,An,Wn);const eo={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function yt(){return new DOMException("The request is not allowed","NotAllowedError")}async function to(n){if(!navigator.clipboard)throw yt();return navigator.clipboard.writeText(n)}async function no(n){const e=document.createElement("span");e.textContent=n,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let i=!1;try{i=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!i)throw yt()}async function oo(n){try{await to(n)}catch(e){try{await no(n)}catch(t){throw t||e||yt()}}}function ro(){async function n(e){await oo(e)}return{onCopy:n}}function io(n,e,t,o){const i=r.ref(14),a=r.ref(140),s=r.ref(""),u=r.ref(o.value.length),l=r.computed(()=>o.value),c=r.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function p(d){if(d.currentTarget){const h=d.currentTarget.value||"";u.value=h.length}}return()=>r.createVNode(r.Fragment,null,[r.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:a.value,onInput:d=>p(d)},[l.value]),r.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 ao(n,e,t,o){const i=io(n,e,t,o),a=new Map([["text-area",i]]);function s(u){return a.get(u)||null}return{getEditorRender:s}}function so(){const n=r.ref(!1),e=r.ref("复制成功");return{feedbackStyle:r.computed(()=>{const o={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return o.opacity=n.value?"0.8":"0",o.display=n.value?"":"none",o}),feedbackMessage:e,toShowFeedback:n}}function lo(n,e){const t=e.getEditorRender(n.promptEditorType);return()=>t&&t()}function co(n,e){function t(m){if(m==null)return 0;let f=0;for(let v=0;v<m.length;v++){const b=m.charCodeAt(v);b>=0&&b<=128?f++:f=f+2}return f}function o(m,f){if(m!==""&&m!==void 0&&m!==null){m=""+m;const v=m.length;let b="",x=0;for(let k=0;k<v;k++){const L=m.charAt(k);if(x++,encodeURI(L).length>4&&x++,b=b.concat(L),x>=f)return b=b.concat("..."),b}if(x<f)return m}return""}const i=r.computed(()=>!!n.value&&!!n.value.date),a=r.computed(()=>{const m=n.value&&n.value.date||"";return`${e.exception.happend} : ${m}`}),s=r.computed(()=>!!n.value&&!!n.value.detail),u=r.computed(()=>n.value?t(n.value.detail)>160:!1),l=r.ref(!1),c=r.computed(()=>l.value?e.exception.collapse:e.exception.expand),p=r.computed(()=>{const m=e.exception.detail+" : "+(n.value&&n.value.detail)||"";return l.value?m:o(m,160)}),d=r.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function h(){l.value=!l.value}return()=>r.createVNode("div",{class:"toast-msg-detail"},[i.value&&r.createVNode("div",null,[a.value]),s.value&&r.createVNode("div",{class:"exception_wrap"},[r.createVNode("div",{class:"exception_error_msg"},[r.createVNode("div",{innerHTML:p.value},null),u.value&&r.createVNode("span",{style:d.value,onClick:h},[c.value])])])])}function uo(n){return()=>r.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function fo(n,e,t,o,i){const a=r.ref(n.exceptionInfo),s=r.computed(()=>{const f=e.value==="question"?"warning":e.value,v={"f-icon":!0},b=`f-icon-${f}`;return v[b]=!0,v}),u=r.computed(()=>t.value||a.value&&a.value.message),l=r.computed(()=>o.value),c=r.computed(()=>!!o.value),p=r.computed(()=>!!a.value);function d(){return p.value?co(a,i):c.value?uo(l):()=>null}const h=d(),m=r.computed(()=>i.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"float-left modal-tips-iconwrap"},[r.createVNode("span",{class:s.value},null)]),r.createVNode("div",{class:"modal-tips-content"},[r.createVNode("p",{class:"toast-msg-title",innerHTML:u.value,style:m.value},null),h()])])}function po(n,e,t,o){const{onCopy:i}=e,{toShowFeedback:a}=t,s=r.ref(o.exception.copySuccess||"复制成功"),u=r.ref(o.exception.copy||"复制详细信息"),l=r.ref(n.exceptionInfo||{date:"",message:"",detail:""}),c=r.computed(()=>l.value&&l.value.detail||"");function p(d){i(c.value).catch(h=>{s.value=o.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>r.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[r.createVNode("span",{onClick:p,style:"cursor: pointer;"},[u.value])])}function mo(n,e,t,o,i){const a=r.ref(n.type),s=r.ref(n.buttons),u=r.ref(n.exceptionInfo),l=r.ref(i.ok||n.okButtonText),c=r.ref(i.cancel||n.cancelButtonText),p=r.ref(n.showCancelButton),d=r.ref(n.showOkButton),h=r.computed(()=>!!(s.value&&s.value.length)),m=r.computed(()=>u.value&&u.value.message&&u.value.detail),f=r.computed(()=>!(s.value&&s.value.length)&&(d.value||p.value)),v=po(n,t,o,i);l.value==="关闭"?l.value=i.close:l.value==="知道了"&&(l.value=i.exception.roger);function b(k){a.value==="question"&&e.emit("reject"),e.emit("close")}function x(k){a.value==="question"&&e.emit("accept"),e.emit("close")}return()=>r.createVNode("div",{class:"modal-footer"},[m.value&&v(),f.value&&p.value&&r.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[c.value]),f.value&&d.value&&r.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:x},[l.value]),h.value&&s.value.length&&s.value.map(k=>r.createVNode("button",{type:"button",onClick:k.handle,class:k.class},[k.iconClass&&r.createVNode("span",{class:k.iconClass},null),k.text]))])}function ho(n){const{t:e,locale:t}=pt.useI18n();function o(i,a,s){return a===s?e(i):a}return{yes:o("messageBox.yes")||"是",no:o("messageBox.no")||"否",close:o("messageBox.close")||"关闭",ok:o("messageBox.ok",n.okButtonText,"确定")||"确定",cancel:o("messageBox.cancel",n.cancelButtonText,"取消")||"取消",title:o("messageBox.title")||"系统提示",errorTitle:o("messageBox.errorTitle")||"错误提示",exception:{expand:o("messageBox.exception.expand")||"展开",collapse:o("messageBox.exception.collapse")||"收起",happend:o("messageBox.exception.happend")||"发生时间",detail:o("messageBox.exception.detail")||"详细信息",copy:o("messageBox.exception.copy")||"复制详细信息",copySuccess:o("messageBox.exception.copySuccess")||"复制成功",copyFailed:o("messageBox.exception.copyFailed")||"复制失败",roger:o("messageBox.exception.roger")||"知道了"},locale:t.value}}const ct=r.defineComponent({name:"FMessageBox",props:eo,emits:["accept","reject","close"],setup(n,e){const t=ho(n),o=r.ref(n.type),i=r.ref(n.title),a=r.ref(n.detail),s=r.computed(()=>{const x={"modal-tips":!0,"d-flex":!0,"flex-row":!0},k=`messager-type-${o.value}`;return x[k]=!0,x}),u=r.computed(()=>{const x={cursor:"default"};return o.value==="prompt"?x.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(x.padding="0.5rem 1.5rem 1rem 1.5rem"),x}),l=ro(),c=ao(n,o,i,a),p=so(),{feedbackStyle:d,feedbackMessage:h}=p;h.value=t.exception.copySuccess;function m(){return r.createVNode("div",{style:d.value},[h.value])}function f(){switch(o.value){case"prompt":return lo(n,c);default:return fo(n,o,i,a,t)}}const v=f(),b=mo(n,e,l,p,t);return()=>r.createVNode("div",{class:"farris-messager"},[!n.exceptionInfo&&r.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),r.createVNode("section",{class:s.value,style:u.value},[v()]),b(),m()])}}),vo={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/modal.schema.json",title:"modal",description:"弹窗组件",type:"object",properties:{id:{description:"组件唯一标识",type:"string"},type:{description:"组件类型",type:"string",default:"modal"},appearance:{description:"组件外观",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},name:{description:"名称",type:"string",default:null},title:{description:"标题",type:"string"},width:{description:"窗口宽度",type:"number",default:900},height:{description:"窗口高度",type:"number",default:600},contents:{description:"弹窗子组件集合",type:"array",default:[]},modelValue:{description:"是否显示",type:"boolean",default:!1},showCloseButton:{description:"显示关闭按钮",type:"boolean",default:!0},showMaxButton:{description:"显示最大化按钮",type:"boolean",default:!0},enableEsc:{description:"允许ESC关闭",type:"boolean",default:!0},resizeable:{description:"允许调整窗口尺寸",type:"boolean",default:!0},fitContent:{description:"是否自适应",type:"boolean",default:!1},showButtons:{description:"是否显示底部按钮",type:"boolean",default:!0},mask:{description:"是否模态",type:"boolean",default:!0},draggable:{description:"是否允许拖拽调整位置",type:"boolean",default:!0},onAccept:{description:"确定事件",type:"object",default:null},onCancel:{description:"取消事件",type:"object",default:null},beforeClose:{description:"关闭前事件",type:"object",default:null}},required:["id","type"],events:{onAccept:"确定事件",onCancel:"取消事件",beforeClose:"关闭前回调"}},go=new Map([["appearance",rt.resolveAppearance]]);function yo(n,e,t){return e}function bo(){function n(e,t){const o={};return o.beforeClose=i=>t.call("beforeClose",[i,e]),o}return{resolve:n}}const Ht={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"}},wo=rt.createPropsResolver(Ht,vo,go,yo),Co=bo();class ae{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const i=parseInt(o[4],10),a=parseInt(o[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ae(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ae(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ae(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ae(0,0);if(window){const o=window.getComputedStyle(e);if(o){const i=parseInt(o.getPropertyValue("left"),10),a=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(i)?0:i,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new ae(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 De{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new De(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new De(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function xo(n,e){const t=r.ref(),o=r.ref(),i=r.ref(),a=r.ref(),s=r.ref(),u=r.ref(),l=r.ref(),c=r.ref(),p=r.ref(),d=r.ref(),h=r.ref(),m=r.ref(n.resizeable),f=r.ref(),v=r.ref(n.draggable),b=r.ref(!1);function x(){const I=o.value||document.body,F=window.getComputedStyle(I);if(!F||!t.value)return;const _=ae.getTransformInfo(t.value),R={};l.value&&(R.deltaL=t.value.offsetLeft-l.value.x,R.deltaT=t.value.offsetTop-l.value.y);const ee=F.getPropertyValue("position");R.width=I.clientWidth,R.height=I.clientHeight,R.pr=parseInt(F.getPropertyValue("padding-right"),10),R.pb=parseInt(F.getPropertyValue("padding-bottom"),10),R.position=F.getPropertyValue("position"),ee==="static"&&(I.style.position="relative"),R.translateX=_.x,R.translateY=_.y,d.value=R}function k(I){if(t.value){a.value=De.getCurrent(t.value),s.value=ae.getCurrent(t.value),u.value=a.value?De.copy(a.value):null,l.value=s.value?ae.copy(s.value):null,x();const F=I.target.getAttribute("type")||"";c.value={n:!!F.match(/n/),s:!!F.match(/s/),w:!!F.match(/w/),e:!!F.match(/e/)}}}function L(){var I,F,_,R;if(t.value){const ee=t.value;c.value&&((c.value.n||c.value.s)&&((I=u.value)!=null&&I.height)&&(ee.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((F=u.value)!=null&&F.width)&&(ee.style.width=u.value.width+"px"),l.value&&((_=l.value)!=null&&_.x&&(ee.style.left=l.value.x+"px"),(R=l.value)!=null&&R.y&&(ee.style.top=l.value.y+"px")))}}function P(){const I=n.minHeight?n.minHeight:1,F=n.minWidth?n.minWidth:1;u.value&&l.value&&c.value&&a.value&&(u.value.height<I&&(u.value.height=I,c.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-I))),u.value.width<F&&(u.value.width=F,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-F))),n.maxHeight&&u.value.height>n.maxHeight&&(u.value.height=n.maxHeight,s.value&&c.value.n&&(l.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&u.value.width>n.maxWidth&&(u.value.width=n.maxWidth,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-n.maxWidth))))}function C(){if(o.value){const I=d.value;if(l.value&&u.value&&c.value&&a.value){const F=I.width-I.pr-I.deltaL-I.translateX-l.value.x,_=I.height-I.pb-I.deltaT-I.translateY-l.value.y;c.value.n&&l.value.y+I.translateY<0&&s.value&&(l.value.y=-I.translateY,u.value.height=a.value.height+s.value.y+I.translateY),c.value.w&&l.value.x+I.translateX<0&&s.value&&(l.value.x=-I.translateX,u.value.width=a.value.width+s.value.x+I.translateX),u.value.width>F&&(u.value.width=F),u.value.height>_&&(u.value.height=_)}}}function y(I){if(!i.value||!a.value||!s.value||!c.value)return;I.subtract(i.value);const F=I.x,_=I.y;c.value.n?(l.value.y=s.value.y+_,u.value.height=a.value.height-_):c.value.s&&(u.value.height=a.value.height+_),c.value.e?u.value.width=a.value.width+F:c.value.w&&(u.value.width=a.value.width-F,l.value.x=s.value.x+F),C(),P(),L()}function M(I){if(!p.value)return;const F=ae.fromEvent(I);F&&y(F)}function j(){if(t.value){const{width:I,height:F,x:_,y:R}=t.value.getBoundingClientRect(),ee=ae.getTransformInfo(t.value);return{size:{width:I,height:F},position:{x:_-ee.x,y:R-ee.y}}}return null}function B(I){if(t.value){const F=j();h.value=F}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,c.value=null,p.value=null,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",B)}function A(){document.addEventListener("mousemove",M),document.addEventListener("mouseup",B)}function w(I){I instanceof MouseEvent&&I.button===2||v.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),i.value=ae.fromEvent(I),p.value=I.target,k(I),A())}function S(I){return t.value=I,m.value&&r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:F=>w(F)},null)])}function O(I=!0){document.body.click();const F=o.value||document.body,_=De.getCurrent(F),R=t.value;I&&R&&(f.value=j(),f.value.transform=R.style.transform),_&&R&&(u.value=_,u.value.height-=14,u.value.width-=14,R.style.height=u.value.height+"px",R.style.width=u.value.width+"px",R.style.left="7px",R.style.top="7px",R.style.transform="",h.value={size:u.value,position:{x:0,y:0}},v.value=!1,b.value=!0)}function N(){var I,F;if(document.body.click(),f.value){const _={width:f.value.size.width||0,height:f.value.size.height||0},R={x:(window.innerWidth-_.width)/2,y:(window.innerHeight-_.height)/2};(I=u.value)==null||I.set(_),(F=l.value)==null||F.set(R);const ee=t.value;ee.style.height=_.height+"px",ee.style.width=_.width+"px",ee.style.left=`${R.x}px`,ee.style.top=`${R.y}px`,ee.style.transform="",h.value={size:_,position:R},v.value=n.draggable,b.value=!1}}function $(){if(t.value){const I=De.getCurrent(t.value);if(I){const{width:F,height:_}=I;t.value.style.left=`${(window.innerWidth-F)/2}px`,t.value.style.top=`${(window.innerHeight-_)/2}px`,t.value.style.transform=""}}}function U(){const I=()=>{b.value?O(!1):$(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const K=U();return{renderResizeBar:S,boundingElement:o,resizedEventParam:h,maximize:O,restore:N,allowDrag:v,isMaximized:b,unWindowResizeHandle:K,moveToCenter:$}}function So(n,e,t){const o=r.ref(),i=r.ref(n.draggable),a=r.ref(n.lockAxis),s=r.ref(),u=r.ref(),l=r.ref(!1),c=r.ref(new ae(0,0)),p=r.ref(new ae(0,0)),d=r.ref(new ae(0,0)),h=r.ref(new ae(0,0));r.watch(()=>t.value,M=>{s.value.style.cursor=M?"move":"default"});function m(M,j){if(j.tagName==="BUTTON")return!1;if(j===M)return!0;for(const B in j.children)if(Object.prototype.hasOwnProperty.call(j.children,B)&&m(M,j.children[B]))return!0;return!1}function f(){var A,w;let M=d.value.x+p.value.x,j=d.value.y+p.value.y;a.value==="x"?(M=((A=c.value)==null?void 0:A.x)||0,d.value.x=0):a.value==="y"&&(j=((w=c.value)==null?void 0:w.y)||0,d.value.y=0);const B=`translate3d(${Math.round(M)}px, ${Math.round(j)}px, 0px)`;o.value&&(o.value.style.transform=B),h.value.x=M,h.value.y=j}function v(){if(!u.value||!o.value)return null;const M=u.value.getBoundingClientRect(),j=o.value.getBoundingClientRect(),B={top:M.top<j.top,right:M.right>j.right,bottom:M.bottom>j.bottom,left:M.left<j.left};return B.top||(d.value.y-=j.top-M.top),B.bottom||(d.value.y-=j.bottom-M.bottom),B.right||(d.value.x-=j.right-M.right),B.left||(d.value.x-=j.left-M.left),f(),B}function b(M){M&&(c.value&&M.subtract(c.value),d.value.set(M),f(),v())}function x(M){l.value&&i.value&&(M.stopPropagation(),M.preventDefault(),b(ae.fromEvent(M,s.value)))}function k(){var M;l.value&&(l.value=!1,p.value.add(d.value),d.value.reset(),(M=o.value)==null||M.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k))}function L(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",x),document.addEventListener("mouseup",k))}function P(){if(o.value){const M=ae.getTransformInfo(o.value);p.value.set(M);return}p.value.reset()}function C(M){if(!t.value||M instanceof MouseEvent&&M.button===2)return;const j=M.target||M.srcElement;s.value!==void 0&&j&&!m(j,s.value)||i.value!==!1&&(document.body.click(),M.stopPropagation(),M.preventDefault(),c.value=ae.fromEvent(M,o.value),P(),L())}function y(M,j,B){if(i.value&&j){if(M)s.value=M;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const A=j.querySelector(n.dragHandle);A&&(s.value=A)}}o.value=j,u.value=B,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",C)):i.value=!1}}return{registerDraggle:y,resetTranslate:P}}function Ut(n,e){if(n){const t=o=>{o.key.toLowerCase()===n.toLowerCase()&&e({event:o,key:n})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function To(n,e){const t=r.ref(n.enableEsc);let o=null;return t.value?(o=Ut("Escape",i=>{e.emit("esc",{event:i.event,type:"esc"})}),{remove:o}):null}function jo(n,e){const t=r.ref(n.enableEnter);let o=null;return t.value?(o=Ut("Enter",i=>{e.emit("enter",{event:i.event,type:"enter"})}),{remove:o}):null}const Re=r.defineComponent({name:"FModal",props:Ht,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,e){const t=r.ref(n.width||300),o=r.ref(n.height||200),i=r.ref(n.modelValue),a=r.ref(""),s=r.ref(n.class),u=r.ref(n.fitContent),l=r.ref(n.showHeader),c=r.ref(""),p=r.ref(n.showCloseButton),d=r.ref(n.showMaxButton),h=r.ref(!1),m=r.ref(n.dialogType),f=r.ref(n.src),v=r.ref(""),b=r.ref(n.showButtons),x=r.ref(n.title),k=r.ref(n.containment||null),L=r.ref(),{t:P}=pt.useI18n();x.value==="错误提示"&&(x.value=P("messageBox.errorTitle"));const C=r.ref(!1);function y(E,Y){const le=Y?"accept":"cancel";Promise.resolve().then(()=>{var ue;return(ue=n.beforeClose)==null?void 0:ue.call(n,{closeType:le})}).then(ue=>{ue&&(i.value=!1,e.emit("update:modelValue",!1),Y!=null&&e.emit(Y?"accept":"cancel"),e.emit("closed",E))})}const M=[{name:"cancel",text:P("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:E=>{y(E,!1)}},{name:"accept",text:P("messageBox.ok")||"确定",class:"btn btn-primary",handle:E=>{y(E,!0)}}],j=r.ref(n.buttons&&n.buttons.length?n.buttons:M),B=r.computed(()=>!!c.value),A=r.computed(()=>!!b.value&&!!j.value),w=r.ref(),S=r.ref(),O=r.ref(!1),{renderResizeBar:N,maximize:$,restore:U,boundingElement:K,resizedEventParam:I,allowDrag:F,unWindowResizeHandle:_,moveToCenter:R}=xo(n),{registerDraggle:ee}=So(n,e,F);function ve(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ge(){const E=document.querySelectorAll(".farris-modal").length;(!E||E-1<=0)&&document.body.classList.remove("modal-open"),L.value&&L.value.classList.remove("show")}r.watch(()=>n.title,(E,Y)=>{E!==Y&&(x.value=E)}),r.watch(()=>n.modelValue,(E,Y)=>{E!==Y&&(i.value=E,i.value&&n.draggable&&r.nextTick(()=>{S.value&&!k.value&&(k.value=S.value.parentElement,K.value=k.value,ee(w.value,S.value,K.value),R())}),E||(k.value&&(k.value=null),ge())),i.value?C.value=ve():(O.value=!1,F.value=n.draggable)}),r.watch(()=>n.showHeader,(E,Y)=>{E!==Y&&(l.value=E)}),r.watch(()=>n.showButtons,(E,Y)=>{E!==Y&&(b.value=E)}),r.watch(()=>I.value,(E,Y)=>{const le=E||{},ue=Y||{};JSON.stringify(le)!==JSON.stringify(ue)&&e.emit("resize",{newSize:E,oldSize:Y,isMaximized:O.value})});const G=r.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),re=r.computed(()=>{var le;const E={modal:!0,"farris-modal":!0,fade:!0};E["f-modal-fitContent"]=!!u.value,E.show=!!G.value;const Y=(le=n.maskClass)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,Fe)=>(ue[Fe]=!0,ue),E),E}),ce=r.computed(()=>{var le;const E={"modal-dialog":!0},Y=(le=s.value)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,Fe)=>(ue[Fe]=!0,ue),E),E}),te=r.computed(()=>{const E={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${o.value}px`};return n.mask||(E.pointerEvents="auto"),E}),z=()=>Ne.getMaxZIndex()||1040,ne=r.computed(()=>{const E={display:"block",zIndex:z()};return n.mask||(E.pointerEvents="none",E.backgroundColor="transparent"),C.value&&(E.backgroundColor="transparent"),E}),qe=r.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Oe=r.computed(()=>{const E={display:l.value?"":"none"};return E["pointer-events"]=F.value?"auto":"none",E}),Te=r.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:O.value})),We=r.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function Le(){return{height:`${n.footerHeight||60}px`}}const Ge=r.computed(()=>{const E={textAlgin:v.value},Y=Le();return Object.assign(E,Y)});function se(E){if(E==null||E.stopPropagation(),O.value){O.value=!1,U();return}$(),O.value=!0}async function Je(E,Y){E.handle&&await E.handle(Y,E)&&e.emit("closed",Y)}function Ie(E){E.width&&(t.value=E.width),E.height&&(o.value=E.height),E.buttons&&(j.value=E.buttons),E.title&&(x.value=E.title)}let Ve=null,je=null;r.onBeforeMount(()=>{C.value=ve()}),r.onMounted(()=>{S.value&&!k.value&&(k.value=S.value.parentElement,K.value=k.value,ee(w.value,S.value,K.value)),G.value&&document.body.classList.add("modal-open"),Ve=To(n,e),je=jo(n,e)}),r.onUnmounted(()=>{_&&_(),Ve&&Ve.remove(),je&&je.remove()}),e.expose({modalElementRef:S,updateModalOptions:Ie,close:y,maxDialog:se,isMaximized:O});function Pe(){return r.createVNode("ul",null,[h.value&&r.createVNode("li",{class:"f-btn-icon f-bare"},[r.createVNode("span",{class:"f-icon modal_minimize"},null)]),d.value&&r.createVNode("li",{onClick:se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[r.createVNode("span",{class:Te.value},null)]),p.value&&r.createVNode("li",{class:"f-btn-icon f-bare",onClick:E=>y(E,!1),style:"pointer-events: auto;"},[r.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ze(){return r.createVNode("div",{class:"modal-footer",style:Ge.value},[j.value&&j.value.map(E=>{const Y=r.ref(E.disabled);return r.createVNode("button",{name:E.name,type:"button",disabled:Y.value,class:E.class+(E.iconClass?" btn-icontext":""),onClick:le=>{Je(E,le)}},[!!E.iconClass&&r.createVNode("i",{class:E.iconClass},null),E.text])})])}function ze(){return r.createVNode("div",{ref:w,class:"modal-header",style:Oe.value},[e.slots.headerTemplate?e.slots.headerTemplate():r.createVNode("div",{class:"modal-title"},[B.value&&r.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),r.createVNode("span",{class:"modal-title-label"},[x.value])]),r.createVNode("div",{class:"actions"},[Pe()])])}function ke(){return e.slots.footerTemplate?e.slots.footerTemplate():A.value&&Ze()}function $e(E){if(E.stopPropagation(),n.allowClickMaskToClose){if(E.target!==L.value)return;y(E,!1)}}function Ye(){var E,Y;return r.createVNode("div",{id:a.value,class:ce.value,style:te.value,ref:S},[r.createVNode("div",{class:qe.value},[l.value&&ze(),r.createVNode("div",{class:We.value},[(Y=(E=e.slots).default)==null?void 0:Y.call(E),m.value==="iframe"&&r.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:f.value},null)]),ke()]),!u.value&&S.value&&!O.value&&N(S.value)])}function Xe(E){return E||"body"}return()=>r.createVNode(r.Teleport,{to:Xe(n.host)},{default:()=>[G.value&&r.createVNode(r.Transition,{name:"fade",appear:!0},{default:()=>[r.createVNode("div",{ref:L,class:re.value,style:ne.value,onClick:$e},[Ye()])]})]})}});function _t(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Mo(n){const e=document.createElement("div");e.style.display="contents";const t=r.createApp({setup(o,i){r.onUnmounted(()=>{document.body.removeChild(e)});const a=r.ref(),s=r.ref(n.class||""),u=r.ref(!!n.showButtons),l=r.ref(!!n.showHeader),c=r.ref(n.showCloseButton==null?!0:n.showCloseButton),p=r.ref(!0),d=r.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),f=n.closedCallback||(L=>{}),v=n.resizeHandle||(L=>{}),b=n.stopMoveHandle||(L=>{}),x=_t(n),k=L=>{p.value=!1,t.unmount(),f(L)};return r.onMounted(()=>{}),i.expose({modalRef:a}),()=>r.createVNode(Re,{ref:a,class:s.value,modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,title:d.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:k,onResize:v,onStopMove:b},{default:()=>[x&&x(t)]})}});return document.body.appendChild(e),t.use(ot.LocaleService.i18n),t.mount(e),t}class Wt{constructor(e){Z(this,"appContext",null);Z(this,"modalRef",r.ref());Z(this,"activeModalIndex",r.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",r.ref(!1));Z(this,"activeModalInstance",r.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:i}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),i<t&&(t=i-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Mo(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=r.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),i=r.ref(!0),a=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((C,y)=>{}),l=o.value.resizeHandle||(C=>{}),c=e.stopMoveHandle||(C=>{});let p;const d=_t(o.value),h=C=>{var M;i.value=!1;const y=(M=C==null?void 0:C.target)==null?void 0:M.classList.contains("modal_close");u(C,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},m=C=>{h(C),p&&r.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],r.render(null,t),p=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(M=>Number(M));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},f=C=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(C==null?void 0:C.event))},{width:v,height:b}=o.value,x=this.adaptToWindow(v||500,b||320);Object.assign(o.value,x);const k=()=>r.createVNode(Re,r.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":C=>i.value=C},o.value,{onAccept:a,onCancel:s,onClosed:m,onResize:l,onEsc:f,onStopMove:c}),{default:()=>[d&&d(this.app)]});return p=(C=>{const y=r.h(k,C);return y.appContext=this.appContext,r.render(y,t),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:C=>{o.value={...o.value,...C},p&&r.render(r.cloneVNode(p,{...o}),t)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Eo=Symbol("FModalService");Re.install=n=>{n.component(Re.name,Re);const e=new Wt(n);n.provide(Eo,e),n.provide("FModalService",e)},Re.register=(n,e,t,o)=>{n.modal=Re,e.modal=wo,o.modal={callbackResolver:Co}};const Se=class Se{static show(e){const t=r.reactive({...e}),o=!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 Wt(Se.app);const p=()=>{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:o,showHeader:i,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>r.createVNode(ct,r.mergeProps(t,{onAccept:s,onReject:u,onClose:p}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const o=r.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Se.show(o)}static warning(e,t){const o=r.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Se.show(o)}static success(e,t){const o=r.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",showCancelButton:!1});Se.show(o)}static error(e,t,o){const i=r.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:e,detail:t}});Se.show(i)}static prompt(e,t){const o=r.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Se.show(o)}static question(e,t,o,i){const a=r.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:i});Se.show(a)}};Z(Se,"app",null);let ut=Se;ct.install=n=>{n.component(ct.name,ct),ut.app=n,n.provide("FMessageBoxService",ut)};class ko extends Jn{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 Fo(n,e){const t=n.schema,o=new Fn;function i(f){var k;const{componentType:v,sourceType:b,sourceElement:x}=f;return!!(b==="control"&&v===T["query-solution"].type||b==="move"&&v===T.section.type&&((k=x==null?void 0:x.className)!=null&&k.includes("f-section-scheme")))}function a(){const f=e==null?void 0:e.formSchemaUtils;return f.selectNode(t,b=>{if(b.type==="component-ref"){const x=f.getComponentById(b.component);if((x==null?void 0:x.componentType)==="data-grid"&&f.selectNode(x,L=>L.type==="data-grid"&&!L.fieldEditable))return!0}})}function s(){const f=e==null?void 0:e.formSchemaUtils;return f.selectNode(t,b=>{if(b.type==="component-ref"){const x=f.getComponentById(b.component);if((x==null?void 0:x.componentType)==="data-grid"&&f.selectNode(x,L=>L.contents&&L.contents.find(P=>P.type===T["filter-bar"].type)))return!0}})}function u(f){var k;const v=(k=t.appearance)==null?void 0:k.class,{sourceType:b}=f;return v&&v.includes("f-page-is-managelist")?b==="control"?!(t.contents&&t.contents.find(P=>{var C,y;return P.type===T.section.type&&((y=(C=P.appearance)==null?void 0:C.class)==null?void 0:y.includes("f-section-scheme"))}))&&a()&&!s():b==="move":!1}function l(f){if(i(f))return u(f);if(!kn().basalDragulaRuleForContainer(f,e))return!1;const{canAccept:b}=o.getTemplateRule(n,e);return b}function c(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function p(){const{canMove:f}=o.getTemplateRule(n,e);return f}function d(){const{canDelete:f}=o.getTemplateRule(n,e);return f}function h(){const{canMove:f,canDelete:v}=o.getTemplateRule(n,e);return!f&&!v}function m(f){const v=new ko(f,e),{schema:b}=n;return v.getPropertyConfig(b)}return{canAccepts:l,getStyles:c,checkCanMoveComponent:p,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:h,getPropsConfig:m}}const Gt=r.defineComponent({name:"FContentContainerDesign",props:it,emits:[],setup(n,e){const t=r.ref(),o=r.inject("designer-host-service"),i=r.inject("design-item-context"),a=Fo(i,o),s=zn(t,i,a),u=r.computed(()=>{const l={"drag-container":!0};return Ne.getCustomClass(l,n==null?void 0:n.customClass)});return r.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>r.createVNode("div",{ref:t,class:u.value,style:n.customStyle,"data-dragref":`${i.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),No={install(n){n.component(at.name,at)},register(n,e,t,o){n["content-container"]=at,e["content-container"]=ht},registerDesigner(n,e,t){n["content-container"]=Gt,e["content-container"]=ht}};oe.ContentContainer=at,oe.ContentContainerDesign=Gt,oe.contentContainerProps=it,oe.default=No,oe.propsResolver=ht,Object.defineProperties(oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(oe,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("lodash-es"),require("vue-i18n"),require("../locale/index.umd.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","vue-i18n","../locale/index.umd.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../notify/index.umd.js"],r):(oe=typeof globalThis<"u"?globalThis:oe||self,r(oe["content-container"]={},oe.Vue,oe.LodashES,oe.vueI18n,oe.locale,oe.common,oe.VueUseCore,oe.dataView,oe.dynamicResolver))})(this,function(oe,r,ie,pt,ot,Ne,Jt,X,rt){"use strict";var Lo=Object.defineProperty;var zo=(oe,r,ie)=>r in oe?Lo(oe,r,{enumerable:!0,configurable:!0,writable:!0,value:ie}):oe[r]=ie;var Z=(oe,r,ie)=>zo(oe,typeof r!="symbol"?r+"":r,ie);function Bt(n,e){let t;function o(d){const{properties:h,title:m,ignore:f}=d,v=f&&Array.isArray(f),b=Object.keys(h).reduce((x,k)=>((!v||!f.find(L=>L===k))&&(x[k]=h[k].type==="object"&&h[k].properties?o(h[k]):ie.cloneDeep(h[k].default)),x),{});if(m&&(!v||!f.find(x=>x==="id"))){const x=m.toLowerCase().replace(/-/g,"_");b.id=`${x}_${Math.random().toString().slice(2,6)}`}return b}function i(d){const{properties:h,title:m,required:f}=d;if(f&&Array.isArray(f)){const v=f.reduce((b,x)=>(b[x]=h[x].type==="object"&&h[x].properties?o(h[x]):ie.cloneDeep(h[x].default),b),{});if(m&&f.find(b=>b==="id")){const b=m.toLowerCase().replace(/-/g,"_");v.id=`${b}_${Math.random().toString().slice(2,6)}`}return v}return{type:m}}function a(d,h={},m){const f=n[d];if(f){let v=i(f);const b=e[d];return v=b?b({getSchemaByType:a},v,h,m):v,t!=null&&t.appendIdentifyForNewControl&&t.appendIdentifyForNewControl(v),v}return null}function s(d,h){const m=o(h);return Object.keys(m).reduce((f,v)=>(Object.prototype.hasOwnProperty.call(d,v)&&(f[v]&&ie.isPlainObject(f[v])&&ie.isPlainObject(d[v]||!d[v])?Object.assign(f[v],d[v]||{}):f[v]=d[v]),f),m),m}function u(d,h){return Object.keys(d).filter(f=>d[f]!=null).reduce((f,v)=>{if(h.has(v)){const b=h.get(v);if(typeof b=="string")f[b]=d[v];else{const x=b(v,d[v],d);Object.assign(f,x)}}else f[v]=d[v];return f},{})}function l(d,h,m=new Map){const f=s(d,h);return u(f,m)}function c(d){var m;const h=d.type;if(h){const f=n[h];if(!f)return d;const v=s(d,f),b=((m=d.editor)==null?void 0:m.type)||"";if(b){const x=n[b],k=s(d.editor,x);v.editor=k}return v}return d}function p(d){t=d}return{getSchemaByType:a,resolveSchemaWithDefaultValue:c,resolveSchemaToProps:l,mappingSchemaToProps:u,setDesignerContext:p}}const Ot={},It={},{getSchemaByType:Ao,resolveSchemaWithDefaultValue:Zt,resolveSchemaToProps:Kt,mappingSchemaToProps:en,setDesignerContext:Ho}=Bt(Ot,It);function tn(n={}){function e(c,p,d,h){if(typeof d=="number")return h[c].length===d;if(typeof d=="object"){const m=Object.keys(d)[0],f=d[m];if(m==="not")return Number(h[c].length)!==Number(f);if(m==="moreThan")return Number(h[c].length)>=Number(f);if(m==="lessThan")return Number(h[c].length)<=Number(f)}return!1}function t(c,p,d,h){return h[c]&&h[c].propertyValue&&String(h[c].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((c,p)=>(c.set(p,n[p]),c),o);function i(c,p){const d=c;return typeof p=="number"?[{target:d,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:d,operator:"getProperty",param:c,value:!!p}]:typeof p=="object"?Object.keys(p).map(h=>{if(h==="length")return{target:d,operator:"length",param:null,value:p[h]};const m=h,f=p[h];return{target:d,operator:"getProperty",param:m,value:f}}):[]}function a(c){return Object.keys(c).reduce((d,h)=>{const m=i(h,c[h]);return d.push(...m),d},[])}function s(c,p){if(o.has(c.operator)){const d=o.get(c.operator);return d&&d(c.target,c.param,c.value,p)||!1}return!1}function u(c,p){return a(c).reduce((m,f)=>m&&s(f,p),!0)}function l(c,p){const d=Object.keys(c),h=d.includes("allOf"),m=d.includes("anyOf"),f=h||m,x=(f?c[f?h?"allOf":"anyOf":"allOf"]:[c]).map(L=>u(L,p));return h?!x.includes(!1):x.includes(!0)}return{parseValueSchema:l}}const nn={convertTo:(n,e,t,o)=>{n.appearance||(n.appearance={}),n.appearance[e]=t},convertFrom:(n,e,t)=>n.appearance?n.appearance[e]:n[e]},on={convertFrom:(n,e,t)=>n.buttons&&n.buttons.length?`共 ${n.buttons.length} 项`:"无"},rn={convertTo:(n,e,t,o)=>{n.editor&&(n.editor[e]=t)},convertFrom:(n,e,t)=>n.editor&&Object.prototype.hasOwnProperty.call(n.editor,e)?n.editor[e]:n[e]},T={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:"列表导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"}},an={convertFrom:(n,e,t)=>{var i;const o=n.editor&&n.editor[e]?n.editor[e]:n[e];return((i=T[o])==null?void 0:i.name)||o}},sn={convertTo:(n,e,t,o)=>{n[e]=n[e]},convertFrom:(n,e,t)=>n.editor?t.getRealEditorType(n.editor.type):""},ln={convertTo:(n,e,t,o)=>{(n.type==="data-grid-column"||n.type==="tree-grid-column")&&(n.formatter?n.formatter[e]=t:n.formatter={[e]:t})},convertFrom:(n,e,t)=>{if(n.formatter){if(e==="trueText")return n.formatter.trueText;if(e==="falseText")return n.formatter.falseText;if(e==="prefix")return n.formatter.prefix;if(e==="suffix")return n.formatter.suffix;if(e==="precision")return n.formatter.precision;if(e==="decimal")return n.formatter.decimal;if(e==="thousand")return n.formatter.thousand;if(e==="dateFormat")return n.formatter.dateFormat||"yyyy-MM-dd";if(e==="customFormat")return n.formatter.customFormat;if(e==="type")return n.formatter.type||"none"}return"none"}},cn={convertTo:(n,e,t,o)=>{n.command?n.command[e]=t:n.command={[e]:t},e==="enable"&&t&&(n.command.commands||(n.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(n,e,t)=>n.command&&e==="enable"?n.command.enable:""},un={convertTo:(n,e,t,o)=>{n.column?n.column[e]=t:n.column={[e]:t},e==="fitColumns"&&t&&(n.column.fitMode||(n.column.fitMode="average"))},convertFrom:(n,e,t)=>{if(n.column){if(e==="fitColumns")return n.column.fitColumns;if(e==="fitMode")return n.column.fitMode}return""}},dn={convertTo:(n,e,t,o)=>{n.summary?n.summary[e]=t:n.summary={[e]:t},e==="enable"&&t&&(n.summary?n.summary.groupFields||(n.summary.groupFields=[]):n.summary={enable:t,groupFields:[]})},convertFrom:(n,e,t)=>n.summary&&e==="enable"?n.summary.enable:n.type==="data-grid-column"?n.enableSummary===void 0?!1:n.enableSummary:""},fn={convertTo:(n,e,t,o)=>{n.group?n.group[e]=t:n.group={[e]:t},e==="enable"&&t&&(n.group?n.group.groupFields||(n.group.groupFields=[]):n.group={enable:t,groupFields:[],showSummary:!1})},convertFrom:(n,e,t)=>{if(n.group){if(e==="enable")return n.group.enable;if(e==="showSummary")return n.group.showSummary}}},pn={convertFrom:(n,e)=>n.binding?n.binding.path:"",convertTo:(n,e,t)=>{if(t&&t.length>0){const o=t[0];n.binding||(n.binding={}),n.binding.type="Form",n.binding.path=o.bindingField,n.binding.field=o.id,n.binding.fullPath=o.path,n.path=o.bindingPath}}},mn={convertTo:(n,e,t,o)=>{n.pagination||(n.pagination={}),n.pagination[e]=t},convertFrom:(n,e,t)=>n.pagination?n.pagination[e]:n[e]},hn={convertTo:(n,e,t,o)=>{n.rowNumber||(n.rowNumber={}),n.rowNumber[e]=t},convertFrom:(n,e,t)=>n.rowNumber?n.rowNumber[e]:n[e]},vn={convertTo:(n,e,t,o)=>{n.selection||(n.selection={}),n.selection[e]=t},convertFrom:(n,e,t)=>{var o,i;return e==="showCheckbox"?(o=n.selection)!=null&&o.multiSelect?!0:(i=n.selection)==null?void 0:i.showCheckbox:n.selection?n.selection[e]:n[e]}},gn={convertFrom:(n,e,t)=>n[e]&&n[e].length?`共 ${n[e].length} 项`:""},yn={convertFrom:(n,e)=>n[e]||"",convertTo:(n,e,t)=>{n[e]=t}},bn={convertTo:(n,e,t,o)=>{n.size||(n.size={}),n.size[e]=t},convertFrom:(n,e,t)=>n.size?n.size[e]:n[e]},wn={convertFrom:(n,e,t)=>{var o,i;return(o=n.formatter)!=null&&o.data&&e==="formatterEnumData"&&!n.formatterEnumData?(i=n.formatter)==null?void 0:i.data:n.formatterEnumData}},Cn={convertTo:(n,e,t,o)=>{n.sort||(n.sort={}),n.sort[e]=t},convertFrom:(n,e,t)=>{var o,i;if(e==="mode")return((o=n.sort)==null?void 0:o.mode)||"client";if(e==="multiSort")return!!((i=n.sort)!=null&&i.multiSort)}},xn={convertTo:(n,e,t,o)=>{n.filter||(n.filter={}),n.filter[e]=t},convertFrom:(n,e,t)=>{var o;if(e==="mode")return((o=n.filter)==null?void 0:o.mode)||"client"}},Sn={convertTo:(n,e,t,o)=>{n.rowOption?n.rowOption[e]=t:n.rowOption={[e]:t}},convertFrom:(n,e,t)=>{if(n.rowOption){if(e==="customRowStyle")return n.rowOption.customRowStyle;if(e==="customCellStyle")return n.rowOption.customCellStyle}return""}};function Vt(n,e,t){const o=new Map([["/converter/appearance.converter",nn],["/converter/buttons.converter",on],["/converter/property-editor.converter",rn],["/converter/items-count.converter",gn],["/converter/type.converter",an],["/converter/change-editor.converter",sn],["/converter/change-formatter.converter",ln],["/converter/column-command.converter",cn],["/converter/column-option.converter",un],["/converter/summary.converter",dn],["/converter/group.converter",fn],["/converter/form-group-label.converter",yn],["/converter/field-selector.converter",pn],["/converter/pagination.converter",mn],["/converter/row-number.converter",hn],["/converter/grid-selection.converter",vn],["/converter/size.converter",bn],["/converter/change-formatter-enum.converter",wn],["/converter/grid-sort.converter",Cn],["/converter/grid-filter.converter",xn],["/converter/row-option.converter",Sn]]),i=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),a=tn();function s(f,v){return()=>a.parseValueSchema(f,v)}function u(f,v,b){return f.includes("visible")&&v.visible!==void 0?typeof v.visible=="boolean"?()=>!!v.visible:v.visible===void 0?!0:s(v.visible,b):()=>!0}function l(f,v,b){return f.includes("readonly")&&v.readonly!==void 0?typeof v.readonly=="boolean"?()=>!!v.readonly:s(v.readonly,b):()=>!1}function c(f,v){const b=f.$converter||v;return typeof b=="string"&&b&&o.has(b)?o.get(b)||null:b||null}function p(f,v,b,x,k,L="",P=""){return Object.keys(f).map(y=>{const M=r.ref(1),j=y,B=f[y],A=Object.keys(B),w=B.title,S=B.type,O=i.get(S)||{type:"input-group",enableClear:!1},N=B.editor?Object.assign({},O,B.editor):Object.assign({},O),$=u(A,B,v),U=l(A,B,v);N.readonly=N.readonly===void 0?U():N.readonly;const K=B.type==="cascade"?p(B.properties,v,b,x,k,L,P):[],I=!0;let F=c(B,P);const _=r.computed({get(){if(M.value){if(["class","style"].find(ce=>ce===j)&&!F&&(F=o.get("/converter/appearance.converter")||null),F&&F.convertFrom)return F.convertFrom(b,y,k,L);const re=b[y];return Object.prototype.hasOwnProperty.call(B,"defaultValue")&&(re===void 0||typeof re=="string"&&re==="")?B.type==="boolean"?B.defaultValue:B.defaultValue||"":re}return null},set(re){M.value+=1,F&&F.convertTo?(F.convertTo(x,y,re,k,L),F.convertTo(b,y,re,k,L)):(x[y]=re,b[y]=re)}}),{refreshPanelAfterChanged:R,description:ee,isExpand:ve,parentPropertyID:ge}=B,G={propertyID:j,propertyName:w,propertyType:S,propertyValue:_,editor:N,visible:$,readonly:U,cascadeConfig:K,hideCascadeTitle:I,refreshPanelAfterChanged:R,description:ee,isExpand:ve,parentPropertyID:ge};return v[j]=G,G})}function d(f,v,b={}){const x={},k=n[f];return k&&k.categories?Object.keys(k.categories).map(P=>{const C=k.categories[P],y=C==null?void 0:C.title,M=p(C.properties||{},x,{},b,v);return{categoryId:P,categoryName:y,properties:M}}):[]}function h(f,v,b,x,k=""){const L=v.$ref.schema,P=v.$ref.converter,C=b[L],y=C.type,M=t(C),j={},B=n[y];if(B&&B.categories){const A=B.categories[f],w=A==null?void 0:A.title;P&&Object.keys(A.properties).forEach(N=>{A.properties[N].$converter=P});const S=(A==null?void 0:A.properties)||{},O=p(S,j,M,C,x,k);return{categoryId:f,categoryName:w,properties:O}}return{categoryId:f,categoryName:"",properties:[]}}function m(f,v,b,x,k){const L=f.type,P=t(f),C={};let y=k||n[L];if(y&&Object.keys(y).length===0&&b&&b.getPropConfig&&(y=b.getPropConfig(x)),y&&y.categories){const M=[];return Object.keys(y.categories).map(j=>{const B=y.categories[j];if(B.$ref){M.push(h(j,B,f,v,x));return}const A=B==null?void 0:B.title,w=B==null?void 0:B.tabId,S=B==null?void 0:B.tabName,O=B==null?void 0:B.hide,N=B==null?void 0:B.hideTitle,$=p(B.properties||{},C,P,f,v,x,B.$converter),{setPropertyRelates:U}=B,K=B==null?void 0:B.parentPropertyID;M.push({categoryId:j,categoryName:A,tabId:w,tabName:S,hide:O,properties:$,hideTitle:N,setPropertyRelates:U,parentPropertyID:K})}),M}return[]}return{getPropertyConfigBySchema:m,getPropertyConfigByType:d,propertyConverterMap:o}}const Pt={},$t={};Vt(Pt,$t,Zt);const Dt={},Rt={},{getSchemaByType:Uo,resolveSchemaWithDefaultValue:Tn,resolveSchemaToProps:_o,mappingSchemaToProps:Wo,setDesignerContext:Go}=Bt(Dt,Rt),qt={},Lt={};Vt(qt,Lt,Tn);function Qe(n,e,t=new Map,o=(s,u,l,c)=>u,i={},a=s=>s){return Ot[e.title]=e,It[e.title]=o,Pt[e.title]=i,$t[e.title]=a,Dt[e.title]=e,Rt[e.title]=o,qt[e.title]=i,Lt[e.title]=a,(s={},u=!0)=>{if(!u)return en(s,t);const l=Kt(s,e,t),c=Object.keys(n).reduce((p,d)=>(p[d]=n[d].default,p),{});return Object.assign(c,l)}}function mt(n,e){return{customClass:e.class,customStyle:e.style}}const jn=new Map([["appearance",mt]]),Mn={$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 En(n,e,t){return e}const it={customClass:{type:String,default:""},customStyle:{type:String,default:""},visible:{type:Boolean,default:!0}},ht=Qe(it,Mn,jn,En),at=r.defineComponent({name:"FContentContainer",props:it,emits:[],setup(n,e){return()=>n.visible&&r.createVNode("div",{class:n.customClass,style:n.customStyle},[e.slots.default&&e.slots.default()])}});function kn(){function n(e,t){var s;if(!e)return!1;const o=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!o)return!1;const i=o.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(o.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![T["response-layout-item"].type,T["response-form"].type,T.fieldset.type].includes(i)||(e.componentType===T.tabs.type||e.componentType===T.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![T["content-container"].type,T["splitter-pane"].type,T["response-layout-item"].type].includes(i))||[T["query-solution"].type,T["filter-bar"].type].includes(e.componentType)||e.componentType===T.fieldset.type&&i!==T["response-form"].type)}return{basalDragulaRuleForContainer:n}}class Fn{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,i=o==null?void 0:o.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:p,canAccept:d}=i[l];a.canMove=a.canMove&&this.resolveRuleValue(c,s),a.canDelete=a.canDelete&&this.resolveRuleValue(p,s),a.canAccept=a.canAccept&&this.resolveRuleValue(d,s)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let i=!0;for(const a of o){const{firstLevelChild:s,secondLevelChild:u,parent:l,...c}=a;if(c&&t.component){let p=!0;for(const d of Object.keys(c))if(c[d]!==t.component[d]){p=!1;break}if(!p){i=!1;continue}}if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:p}=t;if(p&&!p.includes(a.firstLevelChild.class)){i=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:p}=t;if(!p||p.type!==a.firstLevelChild.type){i=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:p}=t;if(p&&!p.includes(a.secondLevelChild.class)){i=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:p}=t;if(!p||p.type!==a.secondLevelChild.type){i=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:p}=t;if(p&&!p.includes(a.parent.class)){i=!1;continue}}if(a.parent.type){const{parentSchema:p}=t;if(p&&p.type!==a.parent.type){i=!1;continue}}}i=!0;break}return!i}getComponentContext(e){var v,b,x,k;const t=e.schema,o=t.appearance&&t.appearance.class||"",i=o.split(" ")||[],a=t.contents||[],s=a.length?a[0]:null,u=s&&s.appearance?s.appearance.class:"",l=u?u.split(" "):[],c=(v=s==null?void 0:s.contents)!=null&&v.length?s==null?void 0:s.contents[0]:null,p=c&&c.appearance?c.appearance.class:"",d=p?p.split(" "):[],h=t.type==="component"?(x=(b=e.parent)==null?void 0:b.parent)==null?void 0:x.schema:(k=e.parent)==null?void 0:k.schema,m=h&&h.appearance&&h.appearance.class||"",f=m?m.split(" "):[];return{componentClass:o,componentClassList:i,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:u,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:p,secondLevelChildClassList:d,parentSchema:h,parentClass:m,parentClassList:f,component:t}}}const Nn=r.ref(0);var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bn={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(o,i,a){function s(c,p){if(!i[c]){if(!o[c]){var d=typeof st=="function"&&st;if(!p&&d)return d(c,!0);if(u)return u(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=i[c]={exports:{}};o[c][0].call(m.exports,function(f){var v=o[c][1][f];return s(v||f)},m,m.exports,t,o,i,a)}return i[c].exports}for(var u=typeof st=="function"&&st,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,o,i){var a={},s="(?:^|\\s)",u="(?:\\s|$)";function l(d){var h=a[d];return h?h.lastIndex=0:a[d]=h=new RegExp(s+d+u,"g"),h}function c(d,h){var m=d.className;m.length?l(h).test(m)||(d.className+=" "+h):d.className=h}function p(d,h){d.className=d.className.replace(l(h)," ").trim()}o.exports={add:c,rm:p}},{}],2:[function(t,o,i){(function(a){var s=t("contra/emitter"),u=t("crossvent"),l=t("./classes"),c=document,p=c.documentElement;function d(w,S){var O=arguments.length;O===1&&Array.isArray(w)===!1&&(S=w,w=[]);var N,$,U,K,I,F,_,R,ee,ve=null,ge,G,re=!1,ce=0,te,z=S||{};z.moves===void 0&&(z.moves=k),z.accepts===void 0&&(z.accepts=k),z.invalid===void 0&&(z.invalid=Ze),z.containers===void 0&&(z.containers=w||[]),z.isContainer===void 0&&(z.isContainer=x),z.copy===void 0&&(z.copy=!1),z.copySortSource===void 0&&(z.copySortSource=!1),z.revertOnSpill===void 0&&(z.revertOnSpill=!1),z.removeOnSpill===void 0&&(z.removeOnSpill=!1),z.direction===void 0&&(z.direction="vertical"),z.ignoreInputTextSelection===void 0&&(z.ignoreInputTextSelection=!0),z.mirrorContainer===void 0&&(z.mirrorContainer=c.body);var ne=s({containers:z.containers,start:je,end:ze,cancel:E,remove:Xe,destroy:Le,canMove:Ve,dragging:!1});return z.removeOnSpill===!0&&ne.on("over",wt).on("out",Ct),Oe(),ne;function qe(g){return ne.containers.indexOf(g)!==-1||z.isContainer(g)}function Oe(g){var V=g?"remove":"add";f(p,V,"mousedown",se),f(p,V,"mouseup",$e)}function Te(g){var V=g?"remove":"add";f(p,V,"mousemove",Je)}function We(g){var V=g?"remove":"add";u[V](p,"selectstart",Ge),u[V](p,"click",Ge)}function Le(){Oe(!0),$e({})}function Ge(g){ge&&g.preventDefault()}function se(g){K=g.clientX,I=g.clientY;var V=v(g)!==1||g.metaKey||g.ctrlKey;if(!V){var D=g.target,H=Ie(D);H&&(ge=H,Te(),g.type==="mousedown"&&(y(D)?D.focus():g.preventDefault()))}}function Je(g){if(ge){if(v(g)===0){$e({});return}if(!(g.clientX!==void 0&&Math.abs(g.clientX-K)<=(z.slideFactorX||0)&&g.clientY!==void 0&&Math.abs(g.clientY-I)<=(z.slideFactorY||0))){if(z.ignoreInputTextSelection){var V=A("clientX",g)||0,D=A("clientY",g)||0,H=c.elementFromPoint(V,D);if(y(H))return}var Q=ge;Te(!0),We(),ze(),Pe(Q),l.add(R||U,"gu-transit"),St(),xt(),ce=0,Fe(g)}}}function Ie(g){if(!(ne.dragging&&N)&&!qe(g)){for(var V=g;C(g)&&qe(C(g))===!1;)if(z.invalid(g,V)||(g=C(g),!g))return;var D=C(g);if(D&&!z.invalid(g,V)){var H=z.moves(g,D,V,j(g));if(H)return{item:g,source:D}}}}function Ve(g){return!!Ie(g)}function je(g){var V=Ie(g);V&&Pe(V)}function Pe(g){Nt(g.item,g.source)&&(R=g.item.cloneNode(!0),ne.emit("cloned",R,g.item,"copy")),$=g.source,U=g.item,F=_=j(g.item),ne.dragging=!0,ne.emit("drag",U,$)}function Ze(){return!1}function ze(){if(ne.dragging){var g=R||U;Ye(g,C(g))}}function ke(){ge=!1,Te(!0),We(!0)}function $e(g){if(ke(),!!ne.dragging){var V=R||U,D=A("clientX",g)||0,H=A("clientY",g)||0,Q=b(N,D,H),J=ue(Q,D,H);J&&(R&&z.copySortSource||!R||J!==$)?Ye(V,J):z.removeOnSpill?Xe():E()}}function Ye(g,V){var D=C(g);R&&z.copySortSource&&V===$&&D.removeChild(U),le(V)?ne.emit("cancel",g,$):ne.emit("drop",g,V,$,_),Y()}function Xe(){if(ne.dragging){var g=R||U,V=C(g);V&&V.removeChild(g),ne.emit(R?"cancel":"remove",g,V,$),Y()}}function E(g){if(ne.dragging){var V=arguments.length>0?g:z.revertOnSpill,D=R||U,H=C(D),Q=le(H);Q===!1&&V&&(R?H&&H.removeChild(R):$.insertBefore(D,F)),Q||V?ne.emit("cancel",D,$,$):ne.emit("drop",D,H,$,_),Y()}}function Y(){var g=R||U;ke(),Tt(),jt(),g&&l.rm(g,"gu-transit"),ee&&clearTimeout(ee),ne.dragging=!1,ve&&ne.emit("out",g,ve,$),ne.emit("dragend",g,ce),$=U=R=F=_=ee=ve=null}function le(g,V){var D;return V!==void 0?D=V:N?D=_:D=j(R||U),g===$&&D===F}function ue(g,V,D){for(var H=g;H&&!Q();)H=C(H);return H;function Q(){var J=qe(H);if(J===!1)return!1;var xe=dt(H,g),ye=ft(H,xe,V,D),be=le(H,ye);return be?!0:z.accepts(U,H,$,ye)}}function Fe(g){if(!N)return;g.preventDefault();var V=A("clientX",g)||0,D=A("clientY",g)||0;N.style.left=V-2+"px",N.style.top=D-2+"px";var H=R||U,Q=b(N,V,D),J=ue(Q,V,D),xe=J!==null&&J!==ve;(xe||J===null)&&(we(),ve=J,Ee()),Ft(Q,D);var ye=C(H);if(J===$&&R&&!z.copySortSource){ye&&ye.removeChild(H);return}var be,Me=dt(J,Q);if(re=Ke(Me,J),Me!==null)be=ft(J,Me,V,D);else if(z.revertOnSpill===!0&&!R)be=F,J=$;else{R&&ye&&ye.removeChild(H),R&&G&&(G.style.display="none");return}G.style.display="block",bt(be,H,xe),be?Et(Me,be):kt(J);function de(me){ne.emit(me,H,ve,$)}function Ee(){xe&&de("over")}function we(){ve&&de("out")}}function bt(g,V,D){(g===V||g===j(V))&&(_=j(V)),(g===null&&D||g!==V&&g!==j(V))&&(_=g)}function wt(g){l.rm(g,"gu-hide")}function Ct(g){ne.dragging&&l.add(g,"gu-hide")}function xt(){N||(N=document.createElement("div"),N.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;",N.innerHTML=z.getMirrorText&&z.getMirrorText(U)||"控件",l.add(N,"gu-mirror"),z.mirrorContainer.appendChild(N),f(p,"add","mousemove",Fe),l.add(z.mirrorContainer,"gu-unselectable"),ne.emit("cloned",N,U,"mirror"))}function St(){if(G=document.createElement("div"),l.add(G,"gu-insertion"),U){var g=U.getBoundingClientRect();G.style.left=g.left+"px",G.style.top=g.top+"px"}re=!1,z.mirrorContainer.appendChild(G)}function Tt(){N&&(l.rm(z.mirrorContainer,"gu-unselectable"),f(p,"remove","mousemove",Fe),C(N).removeChild(N),N=null)}function jt(){G&&(C(G).removeChild(G),G=null)}function dt(g,V){for(var D=V;D!==g&&C(D)!==g;)D=C(D);return D===p?null:D}function Ke(g,V){if(!V)return re;var D=g||V&&V.lastElementChild;if(!D)return!0;var H=getComputedStyle(g),Q=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(Q)return!0;if(V){var J=getComputedStyle(V),xe=J.getPropertyValue("display");if(/flex$/.test(xe)){var ye=J.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!Mt(V)}return!1}return!0}function Mt(g){if(!g.children||!g.children.length)return!1;for(const V of Array.from(g.children)){const H=(V.className&&V.className.split(" ")||[]).filter(Q=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Q));if(!H.length)return!1;for(const Q of H){const J=Q.slice(Q.lastIndexOf("-")+1);if(parseInt(J,10)!==12)return!1}}return!0}function Et(g,V){const D=V.getBoundingClientRect();if(G.style.left=D.left+"px",G.style.top=D.top+"px",re){if(G.style.height=D.height+"px",G.style.width="4px",g){const H=g.getBoundingClientRect();H.top!==D.top&&(G.style.left=H.right+"px",G.style.top=H.top+"px",G.style.height=H.height+"px")}}else if(G.style.height="4px",G.style.width=D.width+"px",te){const H=te.getBoundingClientRect();D.top<H.top&&(G.style.display="none")}V===U&&U&&(G.style.display="none")}function kt(g){_=null;var V=g.lastElementChild;if(V){var D=V.getBoundingClientRect();re?(G.style.left=D.right+"px",G.style.top=D.top+"px",G.style.height=D.height+"px",G.style.width="4px"):(G.style.left=D.left+"px",G.style.top=D.bottom+"px",G.style.height="4px",G.style.width=D.width+"px"),V===U&&U&&(G.style.display="none")}else G.style.display="none"}function Ft(g,V){if(!z.mirrorContainer.contains(g)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(te=h(g),!te||!te.contains(g)))return;const D=document.querySelector(".dgComponentSelected"),H=te.getBoundingClientRect();if(V-30<H.top&&te.scrollTop>0){let Q=te.scrollTop<10?te.scrollTop:10;te.scrollBy(0,-1*Q),D&&te.contains(D)&&(ce=ce+-1*Q)}if(V+30>H.bottom&&te.scrollTop<te.scrollHeight-te.clientHeight){const Q=te.scrollHeight-te.clientHeight-te.scrollTop;let J=Q<10?Q:10;te.scrollBy(0,J),D&&te.contains(D)&&(ce=ce+J)}}function ft(g,V,D,H){var Q=z.direction==="horizontal",J=z.direction==="mixed",xe=V!==g?be():ye();return xe;function ye(){var de=g.children.length,Ee,we,me;for(Ee=0;Ee<de;Ee++)if(we=g.children[Ee],me=we.getBoundingClientRect(),Q&&me.left+me.width/2>D||!J&&!Q&&me.top+me.height/2>H||J&&me.left+me.width>D&&me.top+me.height>H)return we;return null}function be(){var de=V.getBoundingClientRect();if(J){var Ee=H-de.top,we=D-de.left,me=de.bottom-H,et=de.right-D,tt=Math.min(we,et,Ee,me),nt;return re?nt=et<we:nt=me===tt||et===tt||we===tt,Me(nt)}return Me(Q?D>de.left+L(de)/2:H>de.top+P(de)/2)}function Me(de){return de?j(V):V}}function Nt(g,V){return typeof z.copy=="boolean"?z.copy:z.copy(g,V)}}function h(w){const S=Array.from(window.scrollContainerList);if(S.length===1){const N=Array.from(window.scrollContainerList)[0];return document.getElementById(N)}const O=m(S);for(const N of O)if(N.contains(w))return N;return null}function m(w){const S=[];return w.forEach(O=>{const N=document.getElementById(O);N&&S.push(N)}),S.sort((O,N)=>O.contains(N)?1:N.contains(O)?-1:0),S}function f(w,S,O,N){var $={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},U={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?u[S](w,U[O],N):a.navigator.msPointerEnabled?u[S](w,K[O],N):(u[S](w,$[O],N),u[S](w,O,N))}function v(w){if(w.touches!==void 0)return w.touches.length;if(w.which!==void 0&&w.which!==0)return w.which;if(w.buttons!==void 0)return w.buttons;var S=w.button;if(S!==void 0)return S&1?1:S&2?3:S&4?2:0}function b(w,S,O){w=w||{};var N=w.className||"",$;return w.className+=" gu-hide",$=c.elementFromPoint(S,O),w.className=N,$}function x(){return!1}function k(){return!0}function L(w){return w.width||w.right-w.left}function P(w){return w.height||w.bottom-w.top}function C(w){return w.parentNode===c?null:w.parentNode}function y(w){return w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="SELECT"||M(w)}function M(w){return!w||w.contentEditable==="false"?!1:w.contentEditable==="true"?!0:M(C(w))}function j(w){return w.nextElementSibling||S();function S(){var O=w;do O=O.nextSibling;while(O&&O.nodeType!==1);return O}}function B(w){return w.targetTouches&&w.targetTouches.length?w.targetTouches[0]:w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:w}function A(w,S){var O=B(S),N={pageX:"clientX",pageY:"clientY"};return w in N&&!(w in O)&&N[w]in O&&(w=N[w]),O[w]}o.exports=d}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,i){o.exports=function(s,u){return Array.prototype.slice.call(s,u)}},{}],4:[function(t,o,i){var a=t("ticky");o.exports=function(u,l,c){u&&a(function(){u.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,o,i){var a=t("atoa"),s=t("./debounce");o.exports=function(l,c){var p=c||{},d={};return l===void 0&&(l={}),l.on=function(h,m){return d[h]?d[h].push(m):d[h]=[m],l},l.once=function(h,m){return m._once=!0,l.on(h,m),l},l.off=function(h,m){var f=arguments.length;if(f===1)delete d[h];else if(f===0)d={};else{var v=d[h];if(!v)return l;v.splice(v.indexOf(m),1)}return l},l.emit=function(){var h=a(arguments);return l.emitterSnapshot(h.shift()).apply(this,h)},l.emitterSnapshot=function(h){var m=(d[h]||[]).slice(0);return function(){var f=a(arguments),v=this||l;if(h==="error"&&p.throws!==!1&&!m.length)throw f.length===1?f[0]:f;return m.forEach(function(x){p.async?s(x,f,v):x.apply(v,f),x._once&&l.off(h,x)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,i){(function(a){var s=t("custom-event"),u=t("./eventmap"),l=a.document,c=h,p=f,d=[];a.addEventListener||(c=m,p=v),o.exports={add:c,remove:p,fabricate:b};function h(C,y,M,j){return C.addEventListener(y,M,j)}function m(C,y,M){return C.attachEvent("on"+y,k(C,y,M))}function f(C,y,M,j){return C.removeEventListener(y,M,j)}function v(C,y,M){var j=L(C,y,M);if(j)return C.detachEvent("on"+y,j)}function b(C,y,M){var j=u.indexOf(y)===-1?A():B();C.dispatchEvent?C.dispatchEvent(j):C.fireEvent("on"+y,j);function B(){var w;return l.createEvent?(w=l.createEvent("Event"),w.initEvent(y,!0,!0)):l.createEventObject&&(w=l.createEventObject()),w}function A(){return new s(y,{detail:M})}}function x(C,y,M){return function(B){var A=B||a.event;A.target=A.target||A.srcElement,A.preventDefault=A.preventDefault||function(){A.returnValue=!1},A.stopPropagation=A.stopPropagation||function(){A.cancelBubble=!0},A.which=A.which||A.keyCode,M.call(C,A)}}function k(C,y,M){var j=L(C,y,M)||x(C,y,M);return d.push({wrapper:j,element:C,type:y,fn:M}),j}function L(C,y,M){var j=P(C,y,M);if(j){var B=d[j].wrapper;return d.splice(j,1),B}}function P(C,y,M){var j,B;for(j=0;j<d.length;j++)if(B=d[j],B.element===C&&B.type===y&&B.fn===M)return j}}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,i){(function(a){var s=[],u="",l=/^on/;for(u in a)l.test(u)&&s.push(u.slice(2));o.exports=s}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,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}o.exports=u()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(c,p){var d=document.createEvent("CustomEvent");return p?d.initCustomEvent(c,p.bubbles,p.cancelable,p.detail):d.initCustomEvent(c,!1,!1,void 0),d}:function(c,p){var d=document.createEventObject();return d.type=c,p?(d.bubbles=!!p.bubbles,d.cancelable=!!p.cancelable,d.detail=p.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof Be<"u"?Be:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,i){var a=o.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 p(P){if(s===setTimeout)return setTimeout(P,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(P,0);try{return s(P,0)}catch{try{return s.call(null,P,0)}catch{return s.call(this,P,0)}}}function d(P){if(u===clearTimeout)return clearTimeout(P);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(P);try{return u(P)}catch{try{return u.call(null,P)}catch{return u.call(this,P)}}}var h=[],m=!1,f,v=-1;function b(){!m||!f||(m=!1,f.length?h=f.concat(h):v=-1,h.length&&x())}function x(){if(!m){var P=p(b);m=!0;for(var C=h.length;C;){for(f=h,h=[];++v<C;)f&&f[v].run();v=-1,C=h.length}f=null,m=!1,d(P)}}a.nextTick=function(P){var C=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)C[y-1]=arguments[y];h.push(new k(P,C)),h.length===1&&!m&&p(x)};function k(P,C){this.fun=P,this.array=C}k.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function L(){}a.on=L,a.addListener=L,a.once=L,a.off=L,a.removeListener=L,a.removeAllListeners=L,a.emit=L,a.prependListener=L,a.prependOnceListener=L,a.listeners=function(P){return[]},a.binding=function(P){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(P){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,o,i){(function(a){var s=typeof a=="function",u;s?u=function(l){a(l)}:u=function(l){setTimeout(l,0)},o.exports=u}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,i){(function(a,s){var u=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,p={},d=0;i.setTimeout=function(){return new h(l.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new h(l.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(m){m.close()};function h(m,f){this._id=m,this._clearFn=f}h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(m,f){clearTimeout(m._idleTimeoutId),m._idleTimeout=f},i.unenroll=function(m){clearTimeout(m._idleTimeoutId),m._idleTimeout=-1},i._unrefActive=i.active=function(m){clearTimeout(m._idleTimeoutId);var f=m._idleTimeout;f>=0&&(m._idleTimeoutId=setTimeout(function(){m._onTimeout&&m._onTimeout()},f))},i.setImmediate=typeof a=="function"?a:function(m){var f=d++,v=arguments.length<2?!1:c.call(arguments,1);return p[f]=!0,u(function(){p[f]&&(v?m.apply(null,v):m.call(null),i.clearImmediate(f))}),f},i.clearImmediate=typeof s=="function"?s:function(m){delete p[m]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Bn);const On={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}},In={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},vt=r.defineComponent({name:"Toast",props:In,emits:["close","click"],setup:(n,e)=>{const{locale:t,t:o}=pt.useI18n(),i=r.ref(n.animate),a="fadeOut",s=r.computed(()=>n.options),u=r.ref(!1),l=r.computed(()=>s.value.title&&s.value.message),c=r.computed(()=>!s.value.title&&s.value.message),p=r.computed(()=>{const P={animated:u.value,toast:!0,"toast--only-content":!l.value};return P[n.animate]=!1,P[a]=u.value,P["toasty-type-"+s.value.type]=!0,s.value.theme&&(P[s.value.theme]=!0),P}),d=r.computed(()=>{const y=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,M={"f-icon":!0};return M[y]=!0,M}),h=r.computed(()=>s.value.title||s.value.message),m=r.computed(()=>n.showCloseButton),f=r.computed(()=>!!s.value.buttons||!!e.slots.default),v=r.computed(()=>t.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b(P){P.stopPropagation(),P.preventDefault(),u.value=!1,setTimeout(()=>{e.emit("close",s.value)},200)}function x(P,C){}function k(P){return`f-preten-link ${P.customClass?P.customClass:""}`}r.watch(i,()=>{i.value});const L=()=>{var P;return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((P=s.value.buttons)==null?void 0:P.map(C=>r.createVNode("span",{class:k(C),onClick:y=>void 0},[C.text]))),e.slots.default&&e.slots.default()])])};return()=>r.createVNode("div",{class:p.value,style:"min-height:44px"},[m.value&&r.createVNode("button",{title:o("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:b},[r.createVNode("span",{class:"f-icon modal_close"},null)]),h.value&&r.createVNode("section",{class:"modal-tips"},[!l.value&&r.createVNode("div",{class:"float-left modal-tips-iconwrap"},[r.createVNode("span",{class:d.value},null)]),r.createVNode("div",{class:"modal-tips-content"},[l.value&&r.createVNode(r.Fragment,null,[r.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:s.value.title},null),r.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:v.value},null),f.value&&L()]),c.value&&(s.value.buttons?r.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:v.value,innerHTML:s.value.message},null),r.createVNode("div",{class:"after-toast-title text-right ml-auto"},[L()])]):r.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:v.value,innerHTML:s.value.message},null))])])])}}),lt=r.defineComponent({name:"Notify",props:On,emits:["close","empty"],setup(n,e){const t=r.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},i=r.ref(),a=r.ref(n.options),s=r.ref(n.showCloseButton),u=r.computed(()=>n.position||"bottom-right"),l=r.computed(()=>n.timeout!=null?n.timeout:3e3),c=r.computed(()=>{const h=n.bottom?n.bottom:o.bottom,m=n.top?n.top:o.top,f={transition:"all 0.2s ease",left:u.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:u.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:u.value.indexOf("top")>-1?`${m}px`:"",bottom:u.value.indexOf("bottom")>-1?`${h}px`:""};return u.value.indexOf("center")>-1&&(f.left="50%",f.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(f.top="50%",f.transform="translate(-50%, -50%)")),f});function p(h){e.emit("close")}l.value&&setTimeout(()=>{p()},l.value),e.expose({closeToast:p,container:i,notifyPosition:u});function d(h,m){p()}return()=>r.createVNode("div",{class:t.value,style:c.value,ref:i},[r.createVNode(vt,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>d(h,a.value)},null)])}});class Vn{constructor(){Z(this,"notifyRefs",[]);Z(this,"globalConfig",r.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").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=r.createApp({setup(){var c;const u=r.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 p=t.getNotifyInstances(i.position),d=p[p.length-1];if(d){const h=d.value.container.getBoundingClientRect();i.top=h.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=t.escapeAllHtml(i.options.message)),r.onUnmounted(()=>{document.body.removeChild(a)}),r.onMounted(()=>{t.updateNotifyPositionForCreate(i,u)}),()=>r.createVNode(r.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[r.createVNode(lt,r.mergeProps({ref:u},i,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(ot.LocaleService.i18n),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 o=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+o-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=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"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",i="",a,s,u;typeof t=="string"?o=t:t&&(o=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:o,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 Pn=Symbol("NOTIFY_SERVICE_TOKEN");lt.install=n=>{n.component(lt.name,lt),n.component(vt.name,vt);const e=new Vn;n.provide(Pn,e),n.provide("FNotifyService",e)},`${ot.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const $n={customClass:{type:String,default:""},sort:{type:Object},filter:{type:Object},autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loadData:{type:Function},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:ot.LocaleService.getLocaleValue("datagrid.lineNumberTitle")}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!1}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1},emptyTemplate:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}}};function Dn(n,e,t,o,i,a,s,u,l,c,p,d,h,m,f,v,b){const{calculateCellPositionInRow:x}=a,{columnContext:k,hasLeftFixedColumn:L,hasRightFixedColumn:P}=s,{gridDataStyle:C,leftFixedGridDataStyle:y,rightFixedGridDataStyle:M}=m,{renderDataRow:j}=X.getHierarchyRow(n,e,k,b,u,l,c,p,d,h,m,f,v),B=[j];function A($,U){const K=x($);return b.value.filter(I=>I.visible!==!1).map((I,F)=>B[I.type](I,K,U,F))}function w(){return r.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[r.createVNode("div",{class:"fv-grid-data",style:y.value},[A(k.value.leftColumns.filter($=>$.visible),"left")])])}function S(){return r.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[r.createVNode("div",{class:"fv-grid-data",style:C.value},[A(k.value.primaryColumns.filter($=>$.visible),"primary")])])}function O(){return r.createVNode("div",{ref:i,class:"fv-grid-content-right-fixed"},[r.createVNode("div",{class:"fv-grid-data",style:M.value},[A(k.value.rightColumns.filter($=>$.visible),"right")])])}function N(){const $=[];return L.value&&$.push(w()),$.push(S()),P.value&&$.push(O()),$}return{renderDataArea:N}}const Rn=r.defineComponent({name:"FTreeGrid",props:$n,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,e){var Yt,Xt;const o=((Yt=n.rowOption)==null?void 0:Yt.height)||28,i=r.ref(20),a=r.ref(n.columns),s=X.useIdentify(n),{idField:u}=s,l=r.ref(),c=r.ref(),p=r.ref(),d=r.ref(),h=r.ref(),m=r.ref([]),f=r.ref(!1),v=r.ref(((Xt=n.rowOption)==null?void 0:Xt.wrapContent)||!1),b=X.useGroupData(n,s),x=X.useFilter(n,e),k=X.useHierarchy(n),{collapseField:L}=k,{showLoading:P,renderLoading:C}=X.useLoading(n,l),y=X.useDataView(n,new Map,x,k,s),{dataView:M}=y,j=X.useSelection(n,y,s,m,e),{showSelection:B,selectedValues:A}=j,w=X.useSelectHierarchyItem(n,m,y,s,j,e),S=r.computed(()=>n.disabled),O=r.computed(()=>n.virtualized?Math.min(y.dataView.value.length,i.value):y.dataView.value.length),N=X.usePagination(n,y),{shouldRenderPagination:$}=N,{containerStyleObject:U}=X.useDataViewContainerStyle(n),K=X.useCommandColumn(n),{applyCommands:I}=K;I(a);const{applyColumnSetting:F,removeColumnSetting:_}=X.useSettingColumn(n);n.showSetting&&F(a);const R=X.useColumn(n,e),ee=X.useSort(n),{applyColumnSorter:ve,columnContext:ge,updateColumnRenderContext:G}=R;ve(y,ee);const re=X.useGroupColumn(n,ge),ce=X.useRow(n,e,j,s),te=X.useEdit(n,e,s,ce,m),z=X.useVisualDataBound(n),ne=X.useVisualDataCell(n,te,z),qe=X.useVisualDataRow(n,y,te,k,s,z,ne),Oe=X.useVisualData(n,a,y,O,0,qe),{getVisualData:Te}=Oe,We=X.useCellPosition(n,ge),Le=X.useSidebar(n,j),{sidebarWidth:Ge}=Le,se=X.useVirtualScroll(n,y,m,ge,Oe,O,0,Ge),{onWheel:Je,dataGridWidth:Ie,viewPortHeight:Ve,viewPortWidth:je,resetScroll:Pe,updateVisibleRowsOnLatestVisibleScope:Ze}=se,ze=X.useFitColumn(n,ge,c,je,re),{calculateColumnsSize:ke}=ze,$e=X.useFilterHistory(),Ye=X.useColumnFilter(c,h,y,$e,se),Xe=X.useDragColumn(n,e,R,y,re,b,se),E=r.computed(()=>{const q={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return Ne.getCustomClass(q,n.customClass)}),Y=r.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":f.value,"fv-grid-wrap-content":v.value})),{renderDataArea:le}=Dn(n,e,p,d,h,We,R,y,te,k,ce,j,w,se,Oe,z,m),{renderGridHeader:ue,renderGridColumnResizeOverlay:Fe,shouldShowHeader:bt}=X.getColumnHeader(n,e,c,d,h,R,y,Xe,Ye,x,$e,ze,re,j,Le,ee,se,je,m),{renderDataGridSidebar:wt}=X.getSidebar(n,ce,j,Le,se),{renderDisableMask:Ct}=X.getDisableMask(),{renderHorizontalScrollbar:xt}=X.getHorizontalScrollbar(n,c,se),{renderVerticalScrollbar:St}=X.getVerticalScrollbar(n,c,se);function Tt(){var q,W,fe;if(c.value&&c.value.clientHeight>0&&((q=c.value)==null?void 0:q.clientWidth)>0){const he=Math.ceil(c.value.clientHeight/o);he>i.value&&(i.value=he,Ze()),Ve.value=((W=p.value)==null?void 0:W.clientHeight)||0,Ie.value=((fe=c.value)==null?void 0:fe.clientWidth)||0,ke()}}r.onMounted(()=>{c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/o),i.value),m.value=Te(0,O.value+0-1),Jt.useResizeObserver(c.value,Tt),ke(),r.nextTick(()=>{c.value&&(Ie.value=c.value.clientWidth),p.value&&(je.value=p.value.clientWidth,Ve.value=p.value.clientHeight)})),P.value&&C()}),r.onUnmounted(()=>{}),r.watch(je,()=>{c.value&&ke()});function jt(q){y.collapseTo(q),y.reOrderVisibleIndex(),Pe()}function dt(q){y.expandTo(q),y.reOrderVisibleIndex(),Pe()}function Ke(){const q=j.getSelectionRow();return q?q.dataIndex-1:-1}function Mt(){const q=Ke();y.insertNewDataItem(q),m.value=Te(0,O.value+0-1)}function Et(){const q=Ke();y.insertNewChildDataItem(q),m.value=Te(0,O.value+0-1)}function kt(q,W){const fe=m.value.find(Ce=>Ce.raw[u.value]===W),he=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(q,he)}function Ft(){const q=Ke(),W=w.getNextSelectableHierarchyItemId(q);y.removeHierarchyDataItem(q),m.value=Te(0,O.value+0-1),W&&w.selectItemById(W)}function ft(q){te.onEditingRow(q)}function Nt(q){te.acceptEditingRow(q)}function g(q){te.cancelEditingRow(q)}function V(q){q&&(a.value=q,I(a),G(a.value),ve(y,ee),ke())}r.watch(()=>n.columns,q=>{V(q)});function D(q,W){q&&(y.load(q),y.reOrderVisibleIndex(),W!=null&&W.keepScrollPosition?se.scrollTo(se.offsetY.value):Pe())}function H(q){w.selectItemById(q)}function Q(q){const W=m.value.find(fe=>fe.raw[s.idField.value]===q);W&&ce.clickRowItem(W)}function J(q){ce.activeRowById(q)}function xe(q){w.selectItemByIds(q)}function ye(){return j.getSelectedItems()}function be(){j.clearSelection()}const Me=r.computed(()=>!m.value||!m.value.length),{renderEmpty:de}=X.getEmpty(n,e);function Ee(){return j.getSelectionRow()}function we(q){w.unSelectItemByIds(q)}function me(){return j.currentSelectedDataId.value}function et(q,W,fe){const he=M.value.find(Ce=>Ce[u.value]===q);if(he){if(Object.keys(he).forEach(pe=>{Object.prototype.hasOwnProperty.call(W,pe)&&(he[pe]=W[pe])}),fe){const{collapseField:pe,disabledField:Ae,checkedField:He,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(he.__fv_collapse__=W[pe]),He&&!ie.isUndefined(W[He])&&(he.__fv_checked__=W[He]),Ae&&!ie.isUndefined(W[Ae])&&(he.__fv_disabled__=W[Ae]),Ue&&!ie.isUndefined(W[Ue])&&(he.__fv_visible__=W[Ue])}const Ce=m.value.find(pe=>pe.raw[u.value]===q),Qt=m.value.findIndex(pe=>pe.raw[u.value]===q);if(Ce){if(Ce.raw=he,Object.keys(Ce.data).forEach(pe=>{Ce.data[pe].updateData(he)}),fe){const{collapseField:pe,disabledField:Ae,checkedField:He,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(Ce.collapse=W[pe]),He&&!ie.isUndefined(W[He])&&(Ce.checked=W[He]),Ae&&!ie.isUndefined(W[Ae])&&(Ce.disabled=W[Ae]),Ue&&!ie.isUndefined(W[Ue])&&(Ce.visible=W[Ue])}m.value=[...m.value.slice(0,Qt),Ce,...m.value.slice(Qt+1)],y.updateSummary()}}}function tt(q){return Object.prototype.hasOwnProperty.call(q,"raw")?y.hasRealChildren(q.raw):y.hasRealChildren(q)}function nt(q){const W=y.dataView.value.find(fe=>fe[u.value]===q);return W?W[L.value]:""}function Bo(){return L.value}r.watch(()=>n.showSetting,(q,W)=>{q!==W&&(q?F(a):_(a),V(a.value))});function Oo(q){return m.value.filter(W=>q.includes(W.raw[n.idField]))}function Io(q){const W=s.idField.value,fe=m.value.find(he=>he.raw[W]===q);fe&&ce.changeRow(fe)}function Vo(){j.keepSelectingOnPaging.value||be(),y.updateVisibleDataSummary(m.value)}e.expose({activeRowById:J,addNewDataItem:Mt,addNewChildDataItem:Et,addChildrenToNode:kt,collapseTo:jt,expandTo:dt,removeDataItem:Ft,editDataItem:ft,acceptDataItem:Nt,cancelDataItem:g,updateColumns:V,updateDataSource:D,selectItemById:H,selectItemByIds:xe,getSelectedItems:ye,clearSelection:be,getSelectionRow:Ee,clickRowItemById:Q,unSelectItemByIds:we,getCurrentRowId:me,reassignRowData:et,hasChildren:tt,getCollapseField:Bo,getCollapseStatusById:nt,getVisibleDataByIds:Oo,selectRowById:Io,updateDerivedData:Vo});const Po=r.computed(()=>{const q={};return se.shouldShowHorizontalScrollbar.value&&(q.paddingBottom="10px"),se.shouldShowVirticalScrollbar.value&&(q.paddingRight="10px"),q}),$o=r.computed(()=>({...U.value,borderRadius:"5px"}));X.getPagination(n,e,y,se,N,j);const Do=r.computed(()=>({"d-flex":!0,"justify-content-between":$.value&&B.value,"justify-content-end":$.value&&!B.value,"position-relative":!0})),Ro=r.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:qo}=X.getSummary(n,y,R);return()=>r.createVNode("div",{ref:l,class:E.value,style:$o.value,onWheel:Je},[c.value&&bt.value&&ue(),r.createVNode("div",{ref:c,class:Y.value,onMouseover:()=>f.value=!0,onMouseleave:()=>f.value=!1,style:Po.value},[c.value&&wt(m),c.value&&le(),c.value&&Me.value&&de(),c.value&&xt(),c.value&&St()]),c.value&&qo(),B.value&&r.createVNode("div",{class:Do.value},[B.value&&r.createVNode("div",{class:Ro.value},[r.createVNode("div",null,["已选:"+A.value.length,r.createTextVNode(" 条")])])]),Fe(),S.value&&Ct()])}});Ne.withInstall(Rn);const qn=new Map([["appearance",mt]]);function Ln(n,e,t){return e}Qe({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"]},qn,Ln,{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 zn(n,e,t){var w;const o=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=r.ref();let s;function u(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function l(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function p(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function d(S){if(!S||!S.value)return null;if(S.value.schema&&S.value.schema.type==="component")return S.value;const O=r.ref(S==null?void 0:S.value.parent),N=d(O);return N||null}function h(S=e){var U;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(S);const{componentInstance:O,designerItemElementRef:N}=S;if(!O||!O.value)return null;const{getCustomButtons:$}=O.value;return O.value.canMove||$&&((U=$())!=null&&U.length)?N:h(S.parent)}function m(S){return!!t&&t.canAccepts(S)}function f(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function b(S,O){var N;!S||!O||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(S,O),(N=e==null?void 0:e.setupContext)==null||N.emit("dragEnd"))}function x(S,O){const{componentType:N}=S;let $=rt.getSchemaByTypeForDesigner(N,S,O);t&&t.onResolveNewComponentSchema&&($=t.onResolveNewComponentSchema(S,$));const U=N.toLowerCase().replace(/-/g,"_");return $&&!$.id&&$.type===N&&($.id=`${U}_${Math.random().toString().slice(2,6)}`),$}function k(S){S&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(S)}function L(...S){if(t&&t.getPropsConfig)return t.getPropsConfig(...S)}function P(S){if(!S)return;const O=e==null?void 0:e.schema,{formSchemaUtils:N}=S;if(O&&N.getExpressions().length){const $=N.getExpressions().findIndex(U=>U.target===O.id);$>-1&&N.getExpressions().splice($,1)}}function C(S){if(!S||!(e!=null&&e.schema))return;const O=e.schema,{formSchemaUtils:N}=S;N.removeCommunicationInComponent(O)}function y(S){t&&t.onRemoveComponent&&t.onRemoveComponent(),P(S),C(S),e!=null&&e.schema.contents&&e.schema.contents.map(O=>{let N=O.id;O.type==="component-ref"&&(N=O.component);const $=n.value.querySelectorAll(`#${N}-design-item`);$!=null&&$.length&&Array.from($).map(U=>{var K;(K=U==null?void 0:U.componentInstance)!=null&&K.value.onRemoveComponent&&U.componentInstance.value.onRemoveComponent(S)})})}function M(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function j(S){var N,$;if(!((N=e==null?void 0:e.schema)!=null&&N.id))return;if(!s&&S&&(s=S.formSchemaUtils),t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let O="";if(t!=null&&t.getComponentTitle)O=t.getComponentTitle();else{const{text:U,title:K,label:I,mainTitle:F,name:_,type:R}=e.schema;O=U||K||I||F||_||(($=T[R])==null?void 0:$.name)}O&&s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:O,parentPathName:O})}function B(S){var U;const{changeObject:O}=S,{propertyID:N,propertyValue:$}=O;if(["text","title","label","name","mainTitle"].includes((U=S==null?void 0:S.changeObject)==null?void 0:U.propertyID)&&N&&$&&(j(),s)){const K=s.getControlBasicInfoMap(),I=K.keys().toArray().filter(F=>{var _,R;return((_=K.get(F))==null?void 0:_.reliedComponentId)===((R=e==null?void 0:e.schema)==null?void 0:R.id)});I!=null&&I.length&&I.forEach(F=>{const _=K.get(F).parentPathName.split(" > ");_[0]=$,K.get(F).parentPathName=_.join(" > ")})}}function A(S){if(B(S),t&&t.onPropertyChanged)return t.onPropertyChanged(S)}return a.value={canMove:u(),canSelectParent:l(),canDelete:c(),canNested:!p(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(w=e==null?void 0:e.parent)==null?void 0:w.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:i,canAccepts:m,getBelongedComponentInstance:d,getDraggableDesignItemElement:h,getDraggingDisplayText:f,getPropConfig:L,getDragScopeElement:v,onAcceptMovedChildElement:b,onChildElementMovedOut:k,addNewChildComponentSchema:x,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||r.ref(!1),onRemoveComponent:y,getCustomButtons:M,onPropertyChanged:A,setComponentBasicInfoMap:j,updateContextSchema:e==null?void 0:e.updateContextSchema},a}const gt=new Map([["appearance",mt]]),An=new Map([]),Hn="root-viewmodel";class Un{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),o=this.createComponentNode(e),i=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(i),a.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),i=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i}),t.contents=[o];const{selectedFields:a}=e;a==null||a.forEach(u=>{if(u.$type===Ne.FormSchemaEntityField$Type.SimpleField){const l=ie.cloneDeep(u),c=this.resolveControlClassByFormColumns(e),p=this.controlCreatorUtils.setFormFieldProperty(l,"",c);p&&i.push(p)}});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:Hn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(i=>{if(i.$type===Ne.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=i.type.name;(s===Ne.FormSchemaEntityFieldTypeName.Enum||s===Ne.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),t}}function _n(n,e,t,o){var a,s,u,l,c,p;const i=t.parentComponentInstance;if(i&&o){const d=(a=i.schema)==null?void 0:a.type,m={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:d==="splitter-pane"?1:4,parentContainerId:i.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(p=t.bindingSourceContext)==null?void 0:p.bindingEntityFields};return new Un(n,o).createComponent(m)}else return e}function Wn(n,e,t){return e}Qe({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},gt,_n);const zt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null},name:{description:"The name string of form group component",type:"string",default:"form group"},showLabelType:{description:"",type:"string",default:"visible"}},required:["id","type","editor"]};Qe({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},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}},zt,gt,void 0);const Gn=r.ref(0);function Yn(){Gn.value++}function Xn(n){const{formSchemaUtils:e,formStateMachineUtils:t}=n;function o(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function i(l,c=""){return e.getViewModelById(l).states.map(d=>o(d,c))}function a(l){const c=e.getRootViewModelId(),p=i(l);if(l===c)return p;const d=i(c,"root-component.");return[...p,...d]}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 Qn{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:(o,i,a,s)=>{const u=a.getExpressionRuleValue(e,t||i);return u&&u.value||""},convertTo:(o,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(d=>d.id===c&&d.value))?o.dictPickingExpressionId=c:delete o.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const i=o.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(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const i=[];return o.states.forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t,type:"field"}}buildEntityFieldsTreeData(e=null,t){const o=[];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])),o.push({data:a,children:s,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(i=>{var l,c;const a=this.createTreeNode(i,t);a.type="entity";const 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)),o.push({data:a,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),i=this.buildChildEntityTreeData(t.type.entities,[t.code]);return i!=null&&i.length&&(o==null||o.push(...i)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const i=o==="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,o,i){const{expression:a,message:s,messageType:u}=t,l={id:`${e}_${o}`,type:o,value:a};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=s),o==="dataPicking"&&(l.messageType=u),o==="validate"&&i&&(l.elementId=i),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,i){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,o,i,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(p=>p.targetType===t&&p.target===a);const c=p=>p.value.trim()==="";if(l){const p=l.rules.find(d=>d.id===s.id);if(p)c(s)?l.rules=l.rules.filter(d=>d.id!==s.id):(Object.assign(p,s),i==="validate"&&e.type==="form-group"&&(p.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,o,i){return o.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),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:p=>{const d=this.updateExpression(e,t,p,s);if(i){const h=this.buildRule(u,p,s);i(h)}return d}}},a},{})}getExpressionInfo(e,t,o){const i=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(i,o),s={value:a&&a.value,targetId:i,targetType:t,expressionType:o};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,o=["compute","dependency","validate"],i){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,t,o,i)}}}getExpressionOptions(e,t,o){const i=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:i}}}class Jn{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,"designerContext");Z(this,"schemaService",null);Z(this,"metadataService",null);Z(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService,this.designerContext=t.designerContext}getFormDesignerInstance(){var e,t;return(t=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:t.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:T[e.type]&&T[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in 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":{Nn.value++;break}}o&&o(s,e,u)}}}}getPropertyEditorParams(e,t=[],o="visible",i={},a={},s=""){const{getVariables:u,getControlName:l,getStateMachines:c}=Xn(this.designerHostService),p=this.getRealTargetType(e),d=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:d};return d.map(m=>{switch(m){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":h.expressionConfig=this.getExpressionOptions(e,p,s||o);break;case"StateMachine":h.stateMachines=c();break;case"Variable":Object.assign(h,{controlName:l(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),onBeforeOpenVariables:f=>{f.value=u(this.viewModelId)}},a);break}}),h}getVisibleProperty(e,t=""){var a;let o=["Const","Variable","StateMachine","Expression"];return t==="gridFieldEditor"?o=["Const","Expression"]:t==="form-group"&&!((a=e.binding)!=null&&a.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,t="",o={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in o)s[l]=Object.assign(s[l]||{},o[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 o=t&&t.parent&&t.parent.schema;if(!o)return;const i=o.contents.findIndex(s=>s.id===e),a=ie.cloneDeep(o.contents[i]);o.contents.splice(i,1),o.contents.splice(i,0,a),Yn()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.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:p,message:d}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:m}=h;let f=m.find(b=>b.target===u);f||(f={target:u,rules:[],targetType:l},m.push(f));const v=f.rules.find(b=>b.type===c);if(v)v.value=p,v.message=d;else{const b={id:a,type:c,value:p,message:d};f.rules.push(b)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.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,o){return new Qn(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const t={};return t[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var i;((i=o.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},t}}const _e=class _e{static getEditorTypesByMDataType(e,t=!1,o=""){if(t)return[{key:T["language-textbox"].type,value:T["language-textbox"].name}];let i=_e.fieldControlTypeMapping[e];if(o==="data-grid-column"&&(i!=null&&i.length)){const a=[T["check-group"].type,T["radio-group"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const e=[];for(const t in _e.fieldControlTypeMapping)_e.fieldControlTypeMapping[t].forEach(o=>{e.find(i=>i.key===o.key&&i.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var a;const o=(a=e.editor)==null?void 0:a.type,i=[];return(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&t&&t.categoryId&&t.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(o===T["input-group"].type||o===T.textarea.type||o===T["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),o===T["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===T["combo-list"].type||o===T["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===T["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),o===T["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),o===T.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===T["data-grid-column"].type||e.type===T["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};Z(_e,"fieldControlTypeMapping",{String:[{key:T["input-group"].type,value:T["input-group"].name},{key:T.lookup.type,value:T.lookup.name},{key:T["date-picker"].type,value:T["date-picker"].name},{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name},{key:T["check-group"].type,value:T["check-group"].name},{key:T["radio-group"].type,value:T["radio-group"].name},{key:T["combo-list"].type,value:T["combo-list"].name},{key:T.textarea.type,value:T.textarea.name},{key:T["time-picker"].type,value:T["time-picker"].name}],Text:[{key:T.textarea.type,value:T.textarea.name},{key:T.lookup.type,value:T.lookup.name}],Decimal:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Integer:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Number:[{key:T["number-spinner"].type,value:T["number-spinner"].name},{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name}],BigNumber:[{key:T["number-spinner"].type,value:T["number-spinner"].name}],Date:[{key:T["date-picker"].type,value:T["date-picker"].name}],DateTime:[{key:T["date-picker"].type,value:T["date-picker"].name}],Boolean:[{key:T.switch.type,value:T.switch.name},{key:T["check-box"].type,value:T["check-box"].name}],Enum:[{key:T["combo-list"].type,value:T["combo-list"].name},{key:T["radio-group"].type,value:T["radio-group"].name}],Object:[{key:T.lookup.type,value:T.lookup.name},{key:T["combo-list"].type,value:T["combo-list"].name},{key:T["radio-group"].type,value:T["radio-group"].name}]});let At=_e;Qe({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},zt,gt,void 0);const Zn={$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"]},Kn={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};rt.createPropsResolver(Kn,Zn,An,Wn);const eo={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function yt(){return new DOMException("The request is not allowed","NotAllowedError")}async function to(n){if(!navigator.clipboard)throw yt();return navigator.clipboard.writeText(n)}async function no(n){const e=document.createElement("span");e.textContent=n,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let i=!1;try{i=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!i)throw yt()}async function oo(n){try{await to(n)}catch(e){try{await no(n)}catch(t){throw t||e||yt()}}}function ro(){async function n(e){await oo(e)}return{onCopy:n}}function io(n,e,t,o){const i=r.ref(14),a=r.ref(140),s=r.ref(""),u=r.ref(o.value.length),l=r.computed(()=>o.value),c=r.computed(()=>({"font-size":`${i.value}px`,height:"100%"}));function p(d){if(d.currentTarget){const h=d.currentTarget.value||"";u.value=h.length}}return()=>r.createVNode(r.Fragment,null,[r.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:a.value,onInput:d=>p(d)},[l.value]),r.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 ao(n,e,t,o){const i=io(n,e,t,o),a=new Map([["text-area",i]]);function s(u){return a.get(u)||null}return{getEditorRender:s}}function so(){const n=r.ref(!1),e=r.ref("复制成功");return{feedbackStyle:r.computed(()=>{const o={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return o.opacity=n.value?"0.8":"0",o.display=n.value?"":"none",o}),feedbackMessage:e,toShowFeedback:n}}function lo(n,e){const t=e.getEditorRender(n.promptEditorType);return()=>t&&t()}function co(n,e){function t(m){if(m==null)return 0;let f=0;for(let v=0;v<m.length;v++){const b=m.charCodeAt(v);b>=0&&b<=128?f++:f=f+2}return f}function o(m,f){if(m!==""&&m!==void 0&&m!==null){m=""+m;const v=m.length;let b="",x=0;for(let k=0;k<v;k++){const L=m.charAt(k);if(x++,encodeURI(L).length>4&&x++,b=b.concat(L),x>=f)return b=b.concat("..."),b}if(x<f)return m}return""}const i=r.computed(()=>!!n.value&&!!n.value.date),a=r.computed(()=>{const m=n.value&&n.value.date||"";return`${e.exception.happend} : ${m}`}),s=r.computed(()=>!!n.value&&!!n.value.detail),u=r.computed(()=>n.value?t(n.value.detail)>160:!1),l=r.ref(!1),c=r.computed(()=>l.value?e.exception.collapse:e.exception.expand),p=r.computed(()=>{const m=e.exception.detail+" : "+(n.value&&n.value.detail)||"";return l.value?m:o(m,160)}),d=r.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function h(){l.value=!l.value}return()=>r.createVNode("div",{class:"toast-msg-detail"},[i.value&&r.createVNode("div",null,[a.value]),s.value&&r.createVNode("div",{class:"exception_wrap"},[r.createVNode("div",{class:"exception_error_msg"},[r.createVNode("div",{innerHTML:p.value},null),u.value&&r.createVNode("span",{style:d.value,onClick:h},[c.value])])])])}function uo(n){return()=>r.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function fo(n,e,t,o,i){const a=r.ref(n.exceptionInfo),s=r.computed(()=>{const f=e.value==="question"?"warning":e.value,v={"f-icon":!0},b=`f-icon-${f}`;return v[b]=!0,v}),u=r.computed(()=>t.value||a.value&&a.value.message),l=r.computed(()=>o.value),c=r.computed(()=>!!o.value),p=r.computed(()=>!!a.value);function d(){return p.value?co(a,i):c.value?uo(l):()=>null}const h=d(),m=r.computed(()=>i.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"float-left modal-tips-iconwrap"},[r.createVNode("span",{class:s.value},null)]),r.createVNode("div",{class:"modal-tips-content"},[r.createVNode("p",{class:"toast-msg-title",innerHTML:u.value,style:m.value},null),h()])])}function po(n,e,t,o){const{onCopy:i}=e,{toShowFeedback:a}=t,s=r.ref(o.exception.copySuccess||"复制成功"),u=r.ref(o.exception.copy||"复制详细信息"),l=r.ref(n.exceptionInfo||{date:"",message:"",detail:""}),c=r.computed(()=>l.value&&l.value.detail||"");function p(d){i(c.value).catch(h=>{s.value=o.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>r.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[r.createVNode("span",{onClick:p,style:"cursor: pointer;"},[u.value])])}function mo(n,e,t,o,i){const a=r.ref(n.type),s=r.ref(n.buttons),u=r.ref(n.exceptionInfo),l=r.ref(i.ok||n.okButtonText),c=r.ref(i.cancel||n.cancelButtonText),p=r.ref(n.showCancelButton),d=r.ref(n.showOkButton),h=r.computed(()=>!!(s.value&&s.value.length)),m=r.computed(()=>!!(u.value&&u.value.detail)),f=r.computed(()=>!(s.value&&s.value.length)&&(d.value||p.value)),v=po(n,t,o,i);l.value==="关闭"?l.value=i.close:l.value==="知道了"&&(l.value=i.exception.roger);function b(k){a.value==="question"&&e.emit("reject"),e.emit("close")}function x(k){a.value==="question"&&e.emit("accept"),e.emit("close")}return()=>r.createVNode("div",{class:"modal-footer"},[m.value&&v(),f.value&&p.value&&r.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[c.value]),f.value&&d.value&&r.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:x},[l.value]),h.value&&s.value.length&&s.value.map(k=>r.createVNode("button",{type:"button",onClick:k.handle,class:k.class},[k.iconClass&&r.createVNode("span",{class:k.iconClass},null),k.text]))])}function ho(n){const{t:e,locale:t}=pt.useI18n();function o(i,a,s){return a===s?e(i):a}return{yes:o("messageBox.yes")||"是",no:o("messageBox.no")||"否",close:o("messageBox.close")||"关闭",ok:o("messageBox.ok",n.okButtonText,"确定")||"确定",cancel:o("messageBox.cancel",n.cancelButtonText,"取消")||"取消",title:o("messageBox.title")||"系统提示",errorTitle:o("messageBox.errorTitle")||"错误提示",exception:{expand:o("messageBox.exception.expand")||"展开",collapse:o("messageBox.exception.collapse")||"收起",happend:o("messageBox.exception.happend")||"发生时间",detail:o("messageBox.exception.detail")||"详细信息",copy:o("messageBox.exception.copy")||"复制详细信息",copySuccess:o("messageBox.exception.copySuccess")||"复制成功",copyFailed:o("messageBox.exception.copyFailed")||"复制失败",roger:o("messageBox.exception.roger")||"知道了"},locale:t.value}}const ct=r.defineComponent({name:"FMessageBox",props:eo,emits:["accept","reject","close"],setup(n,e){const t=ho(n),o=r.ref(n.type),i=r.ref(n.title),a=r.ref(n.detail),s=r.computed(()=>{const x={"modal-tips":!0,"d-flex":!0,"flex-row":!0},k=`messager-type-${o.value}`;return x[k]=!0,x}),u=r.computed(()=>{const x={cursor:"default"};return o.value==="prompt"?x.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(x.padding="0.5rem 1.5rem 1rem 1.5rem"),x}),l=ro(),c=ao(n,o,i,a),p=so(),{feedbackStyle:d,feedbackMessage:h}=p;h.value=t.exception.copySuccess;function m(){return r.createVNode("div",{style:d.value},[h.value])}function f(){switch(o.value){case"prompt":return lo(n,c);default:return fo(n,o,i,a,t)}}const v=f(),b=mo(n,e,l,p,t);return()=>r.createVNode("div",{class:"farris-messager"},[!n.exceptionInfo&&r.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),r.createVNode("section",{class:s.value,style:u.value},[v()]),b(),m()])}}),vo={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/modal.schema.json",title:"modal",description:"弹窗组件",type:"object",properties:{id:{description:"组件唯一标识",type:"string"},type:{description:"组件类型",type:"string",default:"modal"},appearance:{description:"组件外观",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},name:{description:"名称",type:"string",default:null},title:{description:"标题",type:"string"},width:{description:"窗口宽度",type:"number",default:900},height:{description:"窗口高度",type:"number",default:600},contents:{description:"弹窗子组件集合",type:"array",default:[]},modelValue:{description:"是否显示",type:"boolean",default:!1},showCloseButton:{description:"显示关闭按钮",type:"boolean",default:!0},showMaxButton:{description:"显示最大化按钮",type:"boolean",default:!0},enableEsc:{description:"允许ESC关闭",type:"boolean",default:!0},resizeable:{description:"允许调整窗口尺寸",type:"boolean",default:!0},fitContent:{description:"是否自适应",type:"boolean",default:!1},showButtons:{description:"是否显示底部按钮",type:"boolean",default:!0},mask:{description:"是否模态",type:"boolean",default:!0},draggable:{description:"是否允许拖拽调整位置",type:"boolean",default:!0},onAccept:{description:"确定事件",type:"object",default:null},onCancel:{description:"取消事件",type:"object",default:null},beforeClose:{description:"关闭前事件",type:"object",default:null}},required:["id","type"],events:{onAccept:"确定事件",onCancel:"取消事件",beforeClose:"关闭前回调"}},go=new Map([["appearance",rt.resolveAppearance]]);function yo(n,e,t){return e}function bo(){function n(e,t){const o={};return o.beforeClose=i=>t.call("beforeClose",[i,e]),o}return{resolve:n}}const Ht={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"}},wo=rt.createPropsResolver(Ht,vo,go,yo),Co=bo();class ae{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const i=parseInt(o[4],10),a=parseInt(o[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ae(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ae(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ae(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ae(0,0);if(window){const o=window.getComputedStyle(e);if(o){const i=parseInt(o.getPropertyValue("left"),10),a=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(i)?0:i,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new ae(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 De{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new De(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new De(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function xo(n,e){const t=r.ref(),o=r.ref(),i=r.ref(),a=r.ref(),s=r.ref(),u=r.ref(),l=r.ref(),c=r.ref(),p=r.ref(),d=r.ref(),h=r.ref(),m=r.ref(n.resizeable),f=r.ref(),v=r.ref(n.draggable),b=r.ref(!1);function x(){const I=o.value||document.body,F=window.getComputedStyle(I);if(!F||!t.value)return;const _=ae.getTransformInfo(t.value),R={};l.value&&(R.deltaL=t.value.offsetLeft-l.value.x,R.deltaT=t.value.offsetTop-l.value.y);const ee=F.getPropertyValue("position");R.width=I.clientWidth,R.height=I.clientHeight,R.pr=parseInt(F.getPropertyValue("padding-right"),10),R.pb=parseInt(F.getPropertyValue("padding-bottom"),10),R.position=F.getPropertyValue("position"),ee==="static"&&(I.style.position="relative"),R.translateX=_.x,R.translateY=_.y,d.value=R}function k(I){if(t.value){a.value=De.getCurrent(t.value),s.value=ae.getCurrent(t.value),u.value=a.value?De.copy(a.value):null,l.value=s.value?ae.copy(s.value):null,x();const F=I.target.getAttribute("type")||"";c.value={n:!!F.match(/n/),s:!!F.match(/s/),w:!!F.match(/w/),e:!!F.match(/e/)}}}function L(){var I,F,_,R;if(t.value){const ee=t.value;c.value&&((c.value.n||c.value.s)&&((I=u.value)!=null&&I.height)&&(ee.style.height=u.value.height+"px"),(c.value.w||c.value.e)&&((F=u.value)!=null&&F.width)&&(ee.style.width=u.value.width+"px"),l.value&&((_=l.value)!=null&&_.x&&(ee.style.left=l.value.x+"px"),(R=l.value)!=null&&R.y&&(ee.style.top=l.value.y+"px")))}}function P(){const I=n.minHeight?n.minHeight:1,F=n.minWidth?n.minWidth:1;u.value&&l.value&&c.value&&a.value&&(u.value.height<I&&(u.value.height=I,c.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-I))),u.value.width<F&&(u.value.width=F,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-F))),n.maxHeight&&u.value.height>n.maxHeight&&(u.value.height=n.maxHeight,s.value&&c.value.n&&(l.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&u.value.width>n.maxWidth&&(u.value.width=n.maxWidth,c.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-n.maxWidth))))}function C(){if(o.value){const I=d.value;if(l.value&&u.value&&c.value&&a.value){const F=I.width-I.pr-I.deltaL-I.translateX-l.value.x,_=I.height-I.pb-I.deltaT-I.translateY-l.value.y;c.value.n&&l.value.y+I.translateY<0&&s.value&&(l.value.y=-I.translateY,u.value.height=a.value.height+s.value.y+I.translateY),c.value.w&&l.value.x+I.translateX<0&&s.value&&(l.value.x=-I.translateX,u.value.width=a.value.width+s.value.x+I.translateX),u.value.width>F&&(u.value.width=F),u.value.height>_&&(u.value.height=_)}}}function y(I){if(!i.value||!a.value||!s.value||!c.value)return;I.subtract(i.value);const F=I.x,_=I.y;c.value.n?(l.value.y=s.value.y+_,u.value.height=a.value.height-_):c.value.s&&(u.value.height=a.value.height+_),c.value.e?u.value.width=a.value.width+F:c.value.w&&(u.value.width=a.value.width-F,l.value.x=s.value.x+F),C(),P(),L()}function M(I){if(!p.value)return;const F=ae.fromEvent(I);F&&y(F)}function j(){if(t.value){const{width:I,height:F,x:_,y:R}=t.value.getBoundingClientRect(),ee=ae.getTransformInfo(t.value);return{size:{width:I,height:F},position:{x:_-ee.x,y:R-ee.y}}}return null}function B(I){if(t.value){const F=j();h.value=F}i.value=void 0,a.value=null,s.value=null,u.value=null,l.value=null,c.value=null,p.value=null,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",B)}function A(){document.addEventListener("mousemove",M),document.addEventListener("mouseup",B)}function w(I){I instanceof MouseEvent&&I.button===2||v.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),i.value=ae.fromEvent(I),p.value=I.target,k(I),A())}function S(I){return t.value=I,m.value&&r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:F=>w(F)},null),r.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:F=>w(F)},null)])}function O(I=!0){document.body.click();const F=o.value||document.body,_=De.getCurrent(F),R=t.value;I&&R&&(f.value=j(),f.value.transform=R.style.transform),_&&R&&(u.value=_,u.value.height-=14,u.value.width-=14,R.style.height=u.value.height+"px",R.style.width=u.value.width+"px",R.style.left="7px",R.style.top="7px",R.style.transform="",h.value={size:u.value,position:{x:0,y:0}},v.value=!1,b.value=!0)}function N(){var I,F;if(document.body.click(),f.value){const _={width:f.value.size.width||0,height:f.value.size.height||0},R={x:(window.innerWidth-_.width)/2,y:(window.innerHeight-_.height)/2};(I=u.value)==null||I.set(_),(F=l.value)==null||F.set(R);const ee=t.value;ee.style.height=_.height+"px",ee.style.width=_.width+"px",ee.style.left=`${R.x}px`,ee.style.top=`${R.y}px`,ee.style.transform="",h.value={size:_,position:R},v.value=n.draggable,b.value=!1}}function $(){if(t.value){const I=De.getCurrent(t.value);if(I){const{width:F,height:_}=I;t.value.style.left=`${(window.innerWidth-F)/2}px`,t.value.style.top=`${(window.innerHeight-_)/2}px`,t.value.style.transform=""}}}function U(){const I=()=>{b.value?O(!1):$(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const K=U();return{renderResizeBar:S,boundingElement:o,resizedEventParam:h,maximize:O,restore:N,allowDrag:v,isMaximized:b,unWindowResizeHandle:K,moveToCenter:$}}function So(n,e,t){const o=r.ref(),i=r.ref(n.draggable),a=r.ref(n.lockAxis),s=r.ref(),u=r.ref(),l=r.ref(!1),c=r.ref(new ae(0,0)),p=r.ref(new ae(0,0)),d=r.ref(new ae(0,0)),h=r.ref(new ae(0,0));r.watch(()=>t.value,M=>{s.value.style.cursor=M?"move":"default"});function m(M,j){if(j.tagName==="BUTTON")return!1;if(j===M)return!0;for(const B in j.children)if(Object.prototype.hasOwnProperty.call(j.children,B)&&m(M,j.children[B]))return!0;return!1}function f(){var A,w;let M=d.value.x+p.value.x,j=d.value.y+p.value.y;a.value==="x"?(M=((A=c.value)==null?void 0:A.x)||0,d.value.x=0):a.value==="y"&&(j=((w=c.value)==null?void 0:w.y)||0,d.value.y=0);const B=`translate3d(${Math.round(M)}px, ${Math.round(j)}px, 0px)`;o.value&&(o.value.style.transform=B),h.value.x=M,h.value.y=j}function v(){if(!u.value||!o.value)return null;const M=u.value.getBoundingClientRect(),j=o.value.getBoundingClientRect(),B={top:M.top<j.top,right:M.right>j.right,bottom:M.bottom>j.bottom,left:M.left<j.left};return B.top||(d.value.y-=j.top-M.top),B.bottom||(d.value.y-=j.bottom-M.bottom),B.right||(d.value.x-=j.right-M.right),B.left||(d.value.x-=j.left-M.left),f(),B}function b(M){M&&(c.value&&M.subtract(c.value),d.value.set(M),f(),v())}function x(M){l.value&&i.value&&(M.stopPropagation(),M.preventDefault(),b(ae.fromEvent(M,s.value)))}function k(){var M;l.value&&(l.value=!1,p.value.add(d.value),d.value.reset(),(M=o.value)==null||M.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k))}function L(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",x),document.addEventListener("mouseup",k))}function P(){if(o.value){const M=ae.getTransformInfo(o.value);p.value.set(M);return}p.value.reset()}function C(M){if(!t.value||M instanceof MouseEvent&&M.button===2)return;const j=M.target||M.srcElement;s.value!==void 0&&j&&!m(j,s.value)||i.value!==!1&&(document.body.click(),M.stopPropagation(),M.preventDefault(),c.value=ae.fromEvent(M,o.value),P(),L())}function y(M,j,B){if(i.value&&j){if(M)s.value=M;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const A=j.querySelector(n.dragHandle);A&&(s.value=A)}}o.value=j,u.value=B,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",C)):i.value=!1}}return{registerDraggle:y,resetTranslate:P}}function Ut(n,e){if(n){const t=o=>{o.key.toLowerCase()===n.toLowerCase()&&e({event:o,key:n})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function To(n,e){const t=r.ref(n.enableEsc);let o=null;return t.value?(o=Ut("Escape",i=>{e.emit("esc",{event:i.event,type:"esc"})}),{remove:o}):null}function jo(n,e){const t=r.ref(n.enableEnter);let o=null;return t.value?(o=Ut("Enter",i=>{e.emit("enter",{event:i.event,type:"enter"})}),{remove:o}):null}const Re=r.defineComponent({name:"FModal",props:Ht,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,e){const t=r.ref(n.width||300),o=r.ref(n.height||200),i=r.ref(n.modelValue),a=r.ref(""),s=r.ref(n.class),u=r.ref(n.fitContent),l=r.ref(n.showHeader),c=r.ref(""),p=r.ref(n.showCloseButton),d=r.ref(n.showMaxButton),h=r.ref(!1),m=r.ref(n.dialogType),f=r.ref(n.src),v=r.ref(""),b=r.ref(n.showButtons),x=r.ref(n.title),k=r.ref(n.containment||null),L=r.ref(),{t:P}=pt.useI18n();x.value==="错误提示"&&(x.value=P("messageBox.errorTitle"));const C=r.ref(!1);function y(E,Y){const le=Y?"accept":"cancel";Promise.resolve().then(()=>{var ue;return(ue=n.beforeClose)==null?void 0:ue.call(n,{closeType:le})}).then(ue=>{ue&&(i.value=!1,e.emit("update:modelValue",!1),Y!=null&&e.emit(Y?"accept":"cancel"),e.emit("closed",E))})}const M=[{name:"cancel",text:P("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:E=>{y(E,!1)}},{name:"accept",text:P("messageBox.ok")||"确定",class:"btn btn-primary",handle:E=>{y(E,!0)}}],j=r.ref(n.buttons&&n.buttons.length?n.buttons:M),B=r.computed(()=>!!c.value),A=r.computed(()=>!!b.value&&!!j.value),w=r.ref(),S=r.ref(),O=r.ref(!1),{renderResizeBar:N,maximize:$,restore:U,boundingElement:K,resizedEventParam:I,allowDrag:F,unWindowResizeHandle:_,moveToCenter:R}=xo(n),{registerDraggle:ee}=So(n,e,F);function ve(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ge(){const E=document.querySelectorAll(".farris-modal").length;(!E||E-1<=0)&&document.body.classList.remove("modal-open"),L.value&&L.value.classList.remove("show")}r.watch(()=>n.title,(E,Y)=>{E!==Y&&(x.value=E)}),r.watch(()=>n.modelValue,(E,Y)=>{E!==Y&&(i.value=E,i.value&&n.draggable&&r.nextTick(()=>{S.value&&!k.value&&(k.value=S.value.parentElement,K.value=k.value,ee(w.value,S.value,K.value),R())}),E||(k.value&&(k.value=null),ge())),i.value?C.value=ve():(O.value=!1,F.value=n.draggable)}),r.watch(()=>n.showHeader,(E,Y)=>{E!==Y&&(l.value=E)}),r.watch(()=>n.showButtons,(E,Y)=>{E!==Y&&(b.value=E)}),r.watch(()=>I.value,(E,Y)=>{const le=E||{},ue=Y||{};JSON.stringify(le)!==JSON.stringify(ue)&&e.emit("resize",{newSize:E,oldSize:Y,isMaximized:O.value})});const G=r.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),re=r.computed(()=>{var le;const E={modal:!0,"farris-modal":!0,fade:!0};E["f-modal-fitContent"]=!!u.value,E.show=!!G.value;const Y=(le=n.maskClass)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,Fe)=>(ue[Fe]=!0,ue),E),E}),ce=r.computed(()=>{var le;const E={"modal-dialog":!0},Y=(le=s.value)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,Fe)=>(ue[Fe]=!0,ue),E),E}),te=r.computed(()=>{const E={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:u.value?"auto":`${o.value}px`};return n.mask||(E.pointerEvents="auto"),E}),z=()=>Ne.getMaxZIndex()||1040,ne=r.computed(()=>{const E={display:"block",zIndex:z()};return n.mask||(E.pointerEvents="none",E.backgroundColor="transparent"),C.value&&(E.backgroundColor="transparent"),E}),qe=r.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Oe=r.computed(()=>{const E={display:l.value?"":"none"};return E["pointer-events"]=F.value?"auto":"none",E}),Te=r.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:O.value})),We=r.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function Le(){return{height:`${n.footerHeight||60}px`}}const Ge=r.computed(()=>{const E={textAlgin:v.value},Y=Le();return Object.assign(E,Y)});function se(E){if(E==null||E.stopPropagation(),O.value){O.value=!1,U();return}$(),O.value=!0}async function Je(E,Y){E.handle&&await E.handle(Y,E)&&e.emit("closed",Y)}function Ie(E){E.width&&(t.value=E.width),E.height&&(o.value=E.height),E.buttons&&(j.value=E.buttons),E.title&&(x.value=E.title)}let Ve=null,je=null;r.onBeforeMount(()=>{C.value=ve()}),r.onMounted(()=>{S.value&&!k.value&&(k.value=S.value.parentElement,K.value=k.value,ee(w.value,S.value,K.value)),G.value&&document.body.classList.add("modal-open"),Ve=To(n,e),je=jo(n,e)}),r.onUnmounted(()=>{_&&_(),Ve&&Ve.remove(),je&&je.remove()}),e.expose({modalElementRef:S,updateModalOptions:Ie,close:y,maxDialog:se,isMaximized:O});function Pe(){return r.createVNode("ul",null,[h.value&&r.createVNode("li",{class:"f-btn-icon f-bare"},[r.createVNode("span",{class:"f-icon modal_minimize"},null)]),d.value&&r.createVNode("li",{onClick:se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[r.createVNode("span",{class:Te.value},null)]),p.value&&r.createVNode("li",{class:"f-btn-icon f-bare",onClick:E=>y(E,!1),style:"pointer-events: auto;"},[r.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ze(){return r.createVNode("div",{class:"modal-footer",style:Ge.value},[j.value&&j.value.map(E=>{const Y=r.ref(E.disabled);return r.createVNode("button",{name:E.name,type:"button",disabled:Y.value,class:E.class+(E.iconClass?" btn-icontext":""),onClick:le=>{Je(E,le)}},[!!E.iconClass&&r.createVNode("i",{class:E.iconClass},null),E.text])})])}function ze(){return r.createVNode("div",{ref:w,class:"modal-header",style:Oe.value},[e.slots.headerTemplate?e.slots.headerTemplate():r.createVNode("div",{class:"modal-title"},[B.value&&r.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),r.createVNode("span",{class:"modal-title-label"},[x.value])]),r.createVNode("div",{class:"actions"},[Pe()])])}function ke(){return e.slots.footerTemplate?e.slots.footerTemplate():A.value&&Ze()}function $e(E){if(E.stopPropagation(),n.allowClickMaskToClose){if(E.target!==L.value)return;y(E,!1)}}function Ye(){var E,Y;return r.createVNode("div",{id:a.value,class:ce.value,style:te.value,ref:S},[r.createVNode("div",{class:qe.value},[l.value&&ze(),r.createVNode("div",{class:We.value},[(Y=(E=e.slots).default)==null?void 0:Y.call(E),m.value==="iframe"&&r.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:f.value},null)]),ke()]),!u.value&&S.value&&!O.value&&N(S.value)])}function Xe(E){return E||"body"}return()=>r.createVNode(r.Teleport,{to:Xe(n.host)},{default:()=>[G.value&&r.createVNode(r.Transition,{name:"fade",appear:!0},{default:()=>[r.createVNode("div",{ref:L,class:re.value,style:ne.value,onClick:$e},[Ye()])]})]})}});function _t(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Mo(n){const e=document.createElement("div");e.style.display="contents";const t=r.createApp({setup(o,i){r.onUnmounted(()=>{document.body.removeChild(e)});const a=r.ref(),s=r.ref(n.class||""),u=r.ref(!!n.showButtons),l=r.ref(!!n.showHeader),c=r.ref(n.showCloseButton==null?!0:n.showCloseButton),p=r.ref(!0),d=r.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),f=n.closedCallback||(L=>{}),v=n.resizeHandle||(L=>{}),b=n.stopMoveHandle||(L=>{}),x=_t(n),k=L=>{p.value=!1,t.unmount(),f(L)};return r.onMounted(()=>{}),i.expose({modalRef:a}),()=>r.createVNode(Re,{ref:a,class:s.value,modelValue:p.value,"onUpdate:modelValue":L=>p.value=L,title:d.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":c.value,"show-max-button":!1,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:k,onResize:v,onStopMove:b},{default:()=>[x&&x(t)]})}});return document.body.appendChild(e),t.use(ot.LocaleService.i18n),t.mount(e),t}class Wt{constructor(e){Z(this,"appContext",null);Z(this,"modalRef",r.ref());Z(this,"activeModalIndex",r.ref(0));Z(this,"modalRefs",{});Z(this,"isUseEscCloseModal",r.ref(!1));Z(this,"activeModalInstance",r.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:i}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),i<t&&(t=i-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Mo(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=r.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),i=r.ref(!0),a=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((C,y)=>{}),l=o.value.resizeHandle||(C=>{}),c=e.stopMoveHandle||(C=>{});let p;const d=_t(o.value),h=C=>{var M;i.value=!1;const y=(M=C==null?void 0:C.target)==null?void 0:M.classList.contains("modal_close");u(C,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},m=C=>{h(C),p&&r.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],r.render(null,t),p=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(M=>Number(M));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},f=C=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(C==null?void 0:C.event))},{width:v,height:b}=o.value,x=this.adaptToWindow(v||500,b||320);Object.assign(o.value,x);const k=()=>r.createVNode(Re,r.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":C=>i.value=C},o.value,{onAccept:a,onCancel:s,onClosed:m,onResize:l,onEsc:f,onStopMove:c}),{default:()=>[d&&d(this.app)]});return p=(C=>{const y=r.h(k,C);return y.appContext=this.appContext,r.render(y,t),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:C=>{o.value={...o.value,...C},p&&r.render(r.cloneVNode(p,{...o}),t)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Eo=Symbol("FModalService");Re.install=n=>{n.component(Re.name,Re);const e=new Wt(n);n.provide(Eo,e),n.provide("FModalService",e)},Re.register=(n,e,t,o)=>{n.modal=Re,e.modal=wo,o.modal={callbackResolver:Co}};const Se=class Se{static show(e){const t=r.reactive({...e}),o=!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 Wt(Se.app);const p=()=>{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:o,showHeader:i,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>r.createVNode(ct,r.mergeProps(t,{onAccept:s,onReject:u,onClose:p}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const o=r.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Se.show(o)}static warning(e,t){const o=r.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Se.show(o)}static success(e,t){const o=r.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",showCancelButton:!1});Se.show(o)}static error(e,t,o){const i=r.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:e,detail:t}});Se.show(i)}static prompt(e,t){const o=r.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Se.show(o)}static question(e,t,o,i){const a=r.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:i});Se.show(a)}};Z(Se,"app",null);let ut=Se;ct.install=n=>{n.component(ct.name,ct),ut.app=n,n.provide("FMessageBoxService",ut)};class ko extends Jn{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 Fo(n,e){const t=n.schema,o=new Fn;function i(f){var k;const{componentType:v,sourceType:b,sourceElement:x}=f;return!!(b==="control"&&v===T["query-solution"].type||b==="move"&&v===T.section.type&&((k=x==null?void 0:x.className)!=null&&k.includes("f-section-scheme")))}function a(){const f=e==null?void 0:e.formSchemaUtils;return f.selectNode(t,b=>{if(b.type==="component-ref"){const x=f.getComponentById(b.component);if((x==null?void 0:x.componentType)==="data-grid"&&f.selectNode(x,L=>L.type==="data-grid"&&!L.fieldEditable))return!0}})}function s(){const f=e==null?void 0:e.formSchemaUtils;return f.selectNode(t,b=>{if(b.type==="component-ref"){const x=f.getComponentById(b.component);if((x==null?void 0:x.componentType)==="data-grid"&&f.selectNode(x,L=>L.contents&&L.contents.find(P=>P.type===T["filter-bar"].type)))return!0}})}function u(f){var k;const v=(k=t.appearance)==null?void 0:k.class,{sourceType:b}=f;return v&&v.includes("f-page-is-managelist")?b==="control"?!(t.contents&&t.contents.find(P=>{var C,y;return P.type===T.section.type&&((y=(C=P.appearance)==null?void 0:C.class)==null?void 0:y.includes("f-section-scheme"))}))&&a()&&!s():b==="move":!1}function l(f){if(i(f))return u(f);if(!kn().basalDragulaRuleForContainer(f,e))return!1;const{canAccept:b}=o.getTemplateRule(n,e);return b}function c(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function p(){const{canMove:f}=o.getTemplateRule(n,e);return f}function d(){const{canDelete:f}=o.getTemplateRule(n,e);return f}function h(){const{canMove:f,canDelete:v}=o.getTemplateRule(n,e);return!f&&!v}function m(f){const v=new ko(f,e),{schema:b}=n;return v.getPropertyConfig(b)}return{canAccepts:l,getStyles:c,checkCanMoveComponent:p,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:h,getPropsConfig:m}}const Gt=r.defineComponent({name:"FContentContainerDesign",props:it,emits:[],setup(n,e){const t=r.ref(),o=r.inject("designer-host-service"),i=r.inject("design-item-context"),a=Fo(i,o),s=zn(t,i,a),u=r.computed(()=>{const l={"drag-container":!0};return Ne.getCustomClass(l,n==null?void 0:n.customClass)});return r.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>r.createVNode("div",{ref:t,class:u.value,style:n.customStyle,"data-dragref":`${i.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),No={install(n){n.component(at.name,at)},register(n,e,t,o){n["content-container"]=at,e["content-container"]=ht},registerDesigner(n,e,t){n["content-container"]=Gt,e["content-container"]=ht}};oe.ContentContainer=at,oe.ContentContainerDesign=Gt,oe.contentContainerProps=it,oe.default=No,oe.propsResolver=ht,Object.defineProperties(oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|