@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(ne,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../dynamic-resolver/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../locale/index.umd.js"),require("@vueuse/core"),require("../data-view/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","../dynamic-resolver/index.umd.js","vue-i18n","../designer-canvas/index.umd.js","../common/index.umd.js","../locale/index.umd.js","@vueuse/core","../data-view/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"],i):(ne=typeof globalThis<"u"?globalThis:ne||self,i(ne.avatar={},ne.Vue,ne.LodashES,ne.dynamicResolver,ne.vueI18n,ne.designerCanvas,ne.common,ne.locale,ne.VueUseCore,ne.dataView))})(this,function(ne,i,ie,it,rt,vt,we,st,tn,X){"use strict";var zo=Object.defineProperty;var Uo=(ne,i,ie)=>i in ne?zo(ne,i,{enumerable:!0,configurable:!0,writable:!0,value:ie}):ne[i]=ie;var U=(ne,i,ie)=>Uo(ne,typeof i!="symbol"?i+"":i,ie);function Vt(n,t){let e;function o(c){const{properties:g,title:f,ignore:p}=c,h=p&&Array.isArray(p),b=Object.keys(g).reduce((w,E)=>((!h||!p.find(R=>R===E))&&(w[E]=g[E].type==="object"&&g[E].properties?o(g[E]):ie.cloneDeep(g[E].default)),w),{});if(f&&(!h||!p.find(w=>w==="id"))){const w=f.toLowerCase().replace(/-/g,"_");b.id=`${w}_${Math.random().toString().slice(2,6)}`}return b}function r(c){const{properties:g,title:f,required:p}=c;if(p&&Array.isArray(p)){const h=p.reduce((b,w)=>(b[w]=g[w].type==="object"&&g[w].properties?o(g[w]):ie.cloneDeep(g[w].default),b),{});if(f&&p.find(b=>b==="id")){const b=f.toLowerCase().replace(/-/g,"_");h.id=`${b}_${Math.random().toString().slice(2,6)}`}return h}return{type:f}}function s(c,g={},f){const p=n[c];if(p){let h=r(p);const b=t[c];return h=b?b({getSchemaByType:s},h,g,f):h,e!=null&&e.appendIdentifyForNewControl&&e.appendIdentifyForNewControl(h),h}return null}function a(c,g){const f=o(g);return Object.keys(f).reduce((p,h)=>(Object.prototype.hasOwnProperty.call(c,h)&&(p[h]&&ie.isPlainObject(p[h])&&ie.isPlainObject(c[h]||!c[h])?Object.assign(p[h],c[h]||{}):p[h]=c[h]),p),f),f}function u(c,g){return Object.keys(c).filter(p=>c[p]!=null).reduce((p,h)=>{if(g.has(h)){const b=g.get(h);if(typeof b=="string")p[b]=c[h];else{const w=b(h,c[h],c);Object.assign(p,w)}}else p[h]=c[h];return p},{})}function l(c,g,f=new Map){const p=a(c,g);return u(p,f)}function d(c){var f;const g=c.type;if(g){const p=n[g];if(!p)return c;const h=a(c,p),b=((f=c.editor)==null?void 0:f.type)||"";if(b){const w=n[b],E=a(c.editor,w);h.editor=E}return h}return c}function m(c){e=c}return{getSchemaByType:s,resolveSchemaWithDefaultValue:d,resolveSchemaToProps:l,mappingSchemaToProps:u,setDesignerContext:m}}const Pt={},Rt={},{getSchemaByType:Wo,resolveSchemaWithDefaultValue:nn,resolveSchemaToProps:on,mappingSchemaToProps:rn,setDesignerContext:Go}=Vt(Pt,Rt);function sn(n={}){function t(d,m,c,g){if(typeof c=="number")return g[d].length===c;if(typeof c=="object"){const f=Object.keys(c)[0],p=c[f];if(f==="not")return Number(g[d].length)!==Number(p);if(f==="moreThan")return Number(g[d].length)>=Number(p);if(f==="lessThan")return Number(g[d].length)<=Number(p)}return!1}function e(d,m,c,g){return g[d]&&g[d].propertyValue&&String(g[d].propertyValue.value)===String(c)}const o=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((d,m)=>(d.set(m,n[m]),d),o);function r(d,m){const c=d;return typeof m=="number"?[{target:c,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:c,operator:"getProperty",param:d,value:!!m}]:typeof m=="object"?Object.keys(m).map(g=>{if(g==="length")return{target:c,operator:"length",param:null,value:m[g]};const f=g,p=m[g];return{target:c,operator:"getProperty",param:f,value:p}}):[]}function s(d){return Object.keys(d).reduce((c,g)=>{const f=r(g,d[g]);return c.push(...f),c},[])}function a(d,m){if(o.has(d.operator)){const c=o.get(d.operator);return c&&c(d.target,d.param,d.value,m)||!1}return!1}function u(d,m){return s(d).reduce((f,p)=>f&&a(p,m),!0)}function l(d,m){const c=Object.keys(d),g=c.includes("allOf"),f=c.includes("anyOf"),p=g||f,w=(p?d[p?g?"allOf":"anyOf":"allOf"]:[d]).map(R=>u(R,m));return g?!w.includes(!1):w.includes(!0)}return{parseValueSchema:l}}const an={convertTo:(n,t,e,o)=>{n.appearance||(n.appearance={}),n.appearance[t]=e},convertFrom:(n,t,e)=>n.appearance?n.appearance[t]:n[t]},ln={convertFrom:(n,t,e)=>n.buttons&&n.buttons.length?`共 ${n.buttons.length} 项`:"无"},cn={convertTo:(n,t,e,o)=>{n.editor&&(n.editor[t]=e)},convertFrom:(n,t,e)=>n.editor&&Object.prototype.hasOwnProperty.call(n.editor,t)?n.editor[t]:n[t]},M={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:"多语输入框"}},dn={convertFrom:(n,t,e)=>{var r;const o=n.editor&&n.editor[t]?n.editor[t]:n[t];return((r=M[o])==null?void 0:r.name)||o}},un={convertTo:(n,t,e,o)=>{n[t]=n[t]},convertFrom:(n,t,e)=>n.editor?e.getRealEditorType(n.editor.type):""},fn={convertTo:(n,t,e,o)=>{(n.type==="data-grid-column"||n.type==="tree-grid-column")&&(n.formatter?n.formatter[t]=e:n.formatter={[t]:e})},convertFrom:(n,t,e)=>{if(n.formatter){if(t==="trueText")return n.formatter.trueText;if(t==="falseText")return n.formatter.falseText;if(t==="prefix")return n.formatter.prefix;if(t==="suffix")return n.formatter.suffix;if(t==="precision")return n.formatter.precision;if(t==="decimal")return n.formatter.decimal;if(t==="thousand")return n.formatter.thousand;if(t==="dateFormat")return n.formatter.dateFormat||"yyyy-MM-dd";if(t==="customFormat")return n.formatter.customFormat;if(t==="type")return n.formatter.type||"none"}return"none"}},pn={convertTo:(n,t,e,o)=>{n.command?n.command[t]=e:n.command={[t]:e},t==="enable"&&e&&(n.command.commands||(n.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(n,t,e)=>n.command&&t==="enable"?n.command.enable:""},mn={convertTo:(n,t,e,o)=>{n.column?n.column[t]=e:n.column={[t]:e},t==="fitColumns"&&e&&(n.column.fitMode||(n.column.fitMode="average"))},convertFrom:(n,t,e)=>{if(n.column){if(t==="fitColumns")return n.column.fitColumns;if(t==="fitMode")return n.column.fitMode}return""}},gn={convertTo:(n,t,e,o)=>{n.summary?n.summary[t]=e:n.summary={[t]:e},t==="enable"&&e&&(n.summary?n.summary.groupFields||(n.summary.groupFields=[]):n.summary={enable:e,groupFields:[]})},convertFrom:(n,t,e)=>n.summary&&t==="enable"?n.summary.enable:n.type==="data-grid-column"?n.enableSummary===void 0?!1:n.enableSummary:""},hn={convertTo:(n,t,e,o)=>{n.group?n.group[t]=e:n.group={[t]:e},t==="enable"&&e&&(n.group?n.group.groupFields||(n.group.groupFields=[]):n.group={enable:e,groupFields:[],showSummary:!1})},convertFrom:(n,t,e)=>{if(n.group){if(t==="enable")return n.group.enable;if(t==="showSummary")return n.group.showSummary}}},vn={convertFrom:(n,t)=>n.binding?n.binding.path:"",convertTo:(n,t,e)=>{if(e&&e.length>0){const o=e[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}}},yn={convertTo:(n,t,e,o)=>{n.pagination||(n.pagination={}),n.pagination[t]=e},convertFrom:(n,t,e)=>n.pagination?n.pagination[t]:n[t]},bn={convertTo:(n,t,e,o)=>{n.rowNumber||(n.rowNumber={}),n.rowNumber[t]=e},convertFrom:(n,t,e)=>n.rowNumber?n.rowNumber[t]:n[t]},Cn={convertTo:(n,t,e,o)=>{n.selection||(n.selection={}),n.selection[t]=e},convertFrom:(n,t,e)=>{var o,r;return t==="showCheckbox"?(o=n.selection)!=null&&o.multiSelect?!0:(r=n.selection)==null?void 0:r.showCheckbox:n.selection?n.selection[t]:n[t]}},xn={convertFrom:(n,t,e)=>n[t]&&n[t].length?`共 ${n[t].length} 项`:""},wn={convertFrom:(n,t)=>n[t]||"",convertTo:(n,t,e)=>{n[t]=e}},Sn={convertTo:(n,t,e,o)=>{n.size||(n.size={}),n.size[t]=e},convertFrom:(n,t,e)=>n.size?n.size[t]:n[t]},An={convertFrom:(n,t,e)=>{var o,r;return(o=n.formatter)!=null&&o.data&&t==="formatterEnumData"&&!n.formatterEnumData?(r=n.formatter)==null?void 0:r.data:n.formatterEnumData}},Tn={convertTo:(n,t,e,o)=>{n.sort||(n.sort={}),n.sort[t]=e},convertFrom:(n,t,e)=>{var o,r;if(t==="mode")return((o=n.sort)==null?void 0:o.mode)||"client";if(t==="multiSort")return!!((r=n.sort)!=null&&r.multiSort)}},En={convertTo:(n,t,e,o)=>{n.filter||(n.filter={}),n.filter[t]=e},convertFrom:(n,t,e)=>{var o;if(t==="mode")return((o=n.filter)==null?void 0:o.mode)||"client"}},In={convertTo:(n,t,e,o)=>{n.rowOption?n.rowOption[t]=e:n.rowOption={[t]:e}},convertFrom:(n,t,e)=>{if(n.rowOption){if(t==="customRowStyle")return n.rowOption.customRowStyle;if(t==="customCellStyle")return n.rowOption.customCellStyle}return""}};function Ot(n,t,e){const o=new Map([["/converter/appearance.converter",an],["/converter/buttons.converter",ln],["/converter/property-editor.converter",cn],["/converter/items-count.converter",xn],["/converter/type.converter",dn],["/converter/change-editor.converter",un],["/converter/change-formatter.converter",fn],["/converter/column-command.converter",pn],["/converter/column-option.converter",mn],["/converter/summary.converter",gn],["/converter/group.converter",hn],["/converter/form-group-label.converter",wn],["/converter/field-selector.converter",vn],["/converter/pagination.converter",yn],["/converter/row-number.converter",bn],["/converter/grid-selection.converter",Cn],["/converter/size.converter",Sn],["/converter/change-formatter-enum.converter",An],["/converter/grid-sort.converter",Tn],["/converter/grid-filter.converter",En],["/converter/row-option.converter",In]]),r=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}]]),s=sn();function a(p,h){return()=>s.parseValueSchema(p,h)}function u(p,h,b){return p.includes("visible")&&h.visible!==void 0?typeof h.visible=="boolean"?()=>!!h.visible:h.visible===void 0?!0:a(h.visible,b):()=>!0}function l(p,h,b){return p.includes("readonly")&&h.readonly!==void 0?typeof h.readonly=="boolean"?()=>!!h.readonly:a(h.readonly,b):()=>!1}function d(p,h){const b=p.$converter||h;return typeof b=="string"&&b&&o.has(b)?o.get(b)||null:b||null}function m(p,h,b,w,E,R="",j=""){return Object.keys(p).map(y=>{const S=i.ref(1),A=y,I=p[y],$=Object.keys(I),x=I.title,D=I.type,L=r.get(D)||{type:"input-group",enableClear:!1},O=I.editor?Object.assign({},L,I.editor):Object.assign({},L),z=u($,I,h),Y=l($,I,h);O.readonly=O.readonly===void 0?Y():O.readonly;const se=I.type==="cascade"?m(I.properties,h,b,w,E,R,j):[],N=!0;let B=d(I,j);const G=i.computed({get(){if(S.value){if(["class","style"].find(ce=>ce===A)&&!B&&(B=o.get("/converter/appearance.converter")||null),B&&B.convertFrom)return B.convertFrom(b,y,E,R);const oe=b[y];return Object.prototype.hasOwnProperty.call(I,"defaultValue")&&(oe===void 0||typeof oe=="string"&&oe==="")?I.type==="boolean"?I.defaultValue:I.defaultValue||"":oe}return null},set(oe){S.value+=1,B&&B.convertTo?(B.convertTo(w,y,oe,E,R),B.convertTo(b,y,oe,E,R)):(w[y]=oe,b[y]=oe)}}),{refreshPanelAfterChanged:P,description:K,isExpand:he,parentPropertyID:ve}=I,Q={propertyID:A,propertyName:x,propertyType:D,propertyValue:G,editor:O,visible:z,readonly:Y,cascadeConfig:se,hideCascadeTitle:N,refreshPanelAfterChanged:P,description:K,isExpand:he,parentPropertyID:ve};return h[A]=Q,Q})}function c(p,h,b={}){const w={},E=n[p];return E&&E.categories?Object.keys(E.categories).map(j=>{const C=E.categories[j],y=C==null?void 0:C.title,S=m(C.properties||{},w,{},b,h);return{categoryId:j,categoryName:y,properties:S}}):[]}function g(p,h,b,w,E=""){const R=h.$ref.schema,j=h.$ref.converter,C=b[R],y=C.type,S=e(C),A={},I=n[y];if(I&&I.categories){const $=I.categories[p],x=$==null?void 0:$.title;j&&Object.keys($.properties).forEach(O=>{$.properties[O].$converter=j});const D=($==null?void 0:$.properties)||{},L=m(D,A,S,C,w,E);return{categoryId:p,categoryName:x,properties:L}}return{categoryId:p,categoryName:"",properties:[]}}function f(p,h,b,w,E){const R=p.type,j=e(p),C={};let y=E||n[R];if(y&&Object.keys(y).length===0&&b&&b.getPropConfig&&(y=b.getPropConfig(w)),y&&y.categories){const S=[];return Object.keys(y.categories).map(A=>{const I=y.categories[A];if(I.$ref){S.push(g(A,I,p,h,w));return}const $=I==null?void 0:I.title,x=I==null?void 0:I.tabId,D=I==null?void 0:I.tabName,L=I==null?void 0:I.hide,O=I==null?void 0:I.hideTitle,z=m(I.properties||{},C,j,p,h,w,I.$converter),{setPropertyRelates:Y}=I,se=I==null?void 0:I.parentPropertyID;S.push({categoryId:A,categoryName:$,tabId:x,tabName:D,hide:L,properties:z,hideTitle:O,setPropertyRelates:Y,parentPropertyID:se})}),S}return[]}return{getPropertyConfigBySchema:f,getPropertyConfigByType:c,propertyConverterMap:o}}const qt={},$t={};Ot(qt,$t,nn);const Ht={},Lt={},{getSchemaByType:Qo,resolveSchemaWithDefaultValue:Fn,resolveSchemaToProps:_o,mappingSchemaToProps:Xo,setDesignerContext:Yo}=Vt(Ht,Lt),Dt={},zt={};Ot(Dt,zt,Fn);function Ye(n,t,e=new Map,o=(a,u,l,d)=>u,r={},s=a=>a){return Pt[t.title]=t,Rt[t.title]=o,qt[t.title]=r,$t[t.title]=s,Ht[t.title]=t,Lt[t.title]=o,Dt[t.title]=r,zt[t.title]=s,(a={},u=!0)=>{if(!u)return rn(a,e);const l=on(a,t,e),d=Object.keys(n).reduce((m,c)=>(m[c]=n[c].default,m),{});return Object.assign(d,l)}}function Mn(n,t,e){return t}const Bn=new Map([["appearance",it.resolveAppearance]]),jn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/avatar.schema.json",title:"avatar",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for avatar",type:"string"},type:{description:"The type string of avatar",type:"string",default:"avatar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},avatarWidth:{description:"",type:"number",default:100},avatarHeight:{description:"",type:"number",default:100},readonly:{description:"",type:"boolean",default:!1},cover:{description:"",type:"string",default:""},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding","visible"]},at={avatarWidth:{type:Number,default:100},avatarHeight:{type:Number,default:100},cover:{type:String},readonly:{type:Boolean,default:!1},shape:{type:String,default:"circle"},maxSize:{type:Number,default:1},modelValue:{type:String,default:""},title:{type:String,default:""},imageType:{type:Array,default:["jpeg"]}},yt=Ye(at,jn,Bn,Mn);function Ut(n,t,e,o){const r="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaqAljLQDOiNWJQZNJ4KffEFIRYAsFkAkFkAJFFkAkNCLIAAAC6AguhoCCl3TW2TzugIHx4S788Z6wmWN4ZY3ysoA1pu+qAgpYCAAaIoDIoCaJZvVAQ03LUBlGqWAzYmimn3vAaRYA1IkWASKKACgirIgAsgBoBdJNbZNN9t3aeIHNw2vSccbZhPxLN27dJ68/Rx222u1/LjbNn8vi/ieHPm58N03SKN5bfa58c7jOzHd78XOyXfd98bqoCaScp8jSdk+SgLjlljdccssfK12w6TlN2cmXjN1/iuAD34Z47Sa43XTjLus82nz5bjl8WNss4WPXsNtNpNLuzk3zlZ2wHUsBBF5CAFgAhouiUGRUBErSAyffFamgKqKCqkUBYcgBpADiuhoAKeYA8fStp8WX4WPCfq8b2eT1bXObPZZZ8bJrJ23lHz5rpvutu+3tvOqAAAAAAAACy3HKZY3Sy6yoA+hs85tMJlN2vGdlaeTomem0+C/9pu849SAKlARQERrkgJUWoCUVKDIqb/ugqxFBVRQFFBFABRAUAHn6bl+XDGc7bfT/ANeV26XddvJ2Yz3tcVAAAAAAAAAAFxy+HKZTjLq+l+z5j6Gzuuywt54z9jRoEQAARSoCCoCIqAIJQaCLzBZxCAKC8wIAChOIAADxdL/+i/6z6uTt0yabfXtxnta4qAAAAAAAAAAD37H/AAbP/WPBwfQ2c02WE7MYaNAIIoAhzCggHMEqaNIDNPviHoAsRqcAFSKC8iIoHNUAUAAAHl6ZPzbPLtln1ed7el467DXu2X0+68SgAAAAAAAAABpru7bo+npy7Po8HR8fi2+M46XW+Ue4ABAAAQAQUvAEvBL6BQS8U3feqpv7fcFnBUUBUUBScQFRUBQAAATKTLG43nLL6vnaWWy8ZdL5x9J4ulY/DtrZwymvrzUcgAAAAAAAANdwPT0LH9Wd8MZ+9elnY4fh7HHG8prfOtIAABQAQAKi1AE5KlBD09hPl7gKjUAVFBeYTiAqKgKAAAA5dKw+PY2ya5Y/mn19nVQfMG9th+HtbjOF3zyrCgAAAAAA6dHw+PbSWfln5r6Ob29Gw+DZS2fmy33y5T6g7cbreaAgAAAAgqAcgqfIBOapQSnr7lPS/IEaScAFVFgKIoKioCgAABgADj0nZ/HstZvyx3zxnN4+T6b52ePw7TLGcJbIoyAAAAADex2f4m1mN1+Gb75Tl9H0PbweboeOmGWXO3T0n/r0AAIAAAACKgHJFpyBEpyARFT74gKnNQVeaRQF5IoKTiigCKAAACZWY4/FlZMZxt3SAvnuna+dnlM8885wyts8nXb9I/Elw2e7G7rleN8J4ePNxUAAAAAAeroeUuFx7LrPKvQ+djlcMpljdLHs2W3x2k0/Tl2W8fLtB1C8ewQAAEUBDmt4oBeJeCAIUARFvBN3gByVAFUIChzWcAOSpGdpnjs5rnlMdeHbfKcwb58x5c+l23TZ7P1y3e0+rldvtcuO0snZjJFHvtmM1ysnjbpHHLpOyx3TK5eGM1eKyW63W3tt1UHfPpeV3YYTGduW+/JwyuWd1zyuVnDXhPKcgAAAAAAAAAAB0w2+0w3TKZTsy3+7tj0vG/rxyxvbN8eUB9DDa7PP9OeNvZrpfdu8OD5mkvGNY55Y/pzyx8ruIPePJj0nazj8OU8ZpfZ1w6Ts8rJlrhfHfPmg7FKgAF4AgVARPW/NanoAsZaBVlZUFVF4g57fbfhY7pLld0l/e+EeO23K5ZW5ZXjb97o1tcvj22WXHS/DPKMqAAAAAAAAAAAAAAAAAAAAAAOux212d0ttwvGdnjHr3ceMfPevo2XxbLTu3T0B1TmHJAZVOYF4p98xPviBFScQGlRZxBdS3TG3slvsibS/8WX+t/YHhx/TPGaqk4TyVQAAAAAAAAAAAAAAAAAAAAAAd+iX82c7ZL9/Nwdui/5b/rfoD00vARAQqAhfvcVNfL3A1WMqDSxmVQVNr/iz4/pv7LDOXLDLGcbNPDeDxTh6DtOjZaafFju816tlf+2Puo4Dv1bPvY+51bLvY+5RwHfq2Xex9zquXex9yjgO/Vcu9j7nVc+9j7lHAd+q597H3Oq597H3BwHfqufex9zqufex9yjgO/Vc+9j7nVc+9j7lHAd+q597H3Oq597H3KOA79Vz72PudVz72PuUcB36rl3sfc6rn3sfco4DvejZd7H3OrZd7H3KOA79Wy72PudWz72PuDg7dG/y3/W/Q6tl3sfdvY7K7PO25S6yzSdoOqWlEBmhaBamt+6J6AnmqaqDQy0CxYyoNCKC6m/VAGhPJdQBOSgKi6+QGu41QBRAF1LUABbUABNdAVOYUC0tE13gIWloCcTXeloFQLQTmffMtT74gixOa6gqysrzBVSVQVdWdQGpRNV1BV10SUlBYIvIF1E1Ne0F5iAKIAohaCmqWgBaapqC2ohqC6pqWoC2paa70tAqCACACa+F+RanyAWJ/a8vkAuqT6fVf7AVOz0X+AXVYh2egNSifx9T+wVWefyX+PqCyrqn807PQFEn0+p/YKH9H37gAc/kC6onL0P5BRP6OV8vqC2of2l/gAOSAuqan9J/AKmon9AUtL9PqnP1oCWl5ehfv5gh635nP1qWg//Z",s=i.ref(n.readonly);function a(f){return f.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/)!=null}function u(f){return f.indexOf("data:image/")>-1}function l(f){return f?"data:image/jpeg;base64,"+f:""}const d=i.computed(()=>{var p;if(!n.imageType||!n.imageType.length)return"";const f=(p=n.imageType)==null?void 0:p.map(h=>(h==="jpg"&&(h="jpeg"),`image/${h}`));return!f||!f.length?"image/*":f.join(",")}),m=i.computed(()=>{const f=o.value||n.cover||r;return a(f)||u(f)?f:l(f)}),c=i.computed(()=>s.value?"":n.title);function g(){s.value||e&&e.value&&e.value.click()}return{acceptTypes:d,imageSource:m,imageTitle:c,onClickImage:g}}const Ze=i.defineComponent({name:"FAvatar",props:at,emits:["change","update:modelValue"],setup(n,t){rt.useI18n();const e=i.computed(()=>({"f-avatar":!0,"f-avatar-readonly":n.readonly,"f-avatar-circle":n.shape==="circle","f-avatar-square":n.shape==="square"})),o=i.ref(n.modelValue),r=i.computed(()=>({width:n.avatarWidth+"px",height:n.avatarHeight+"px"})),s=!1;function a(){return""}function u(){}const l=i.ref(null),{acceptTypes:d,imageSource:m,onClickImage:c}=Ut(n,t,l,o);return()=>i.createVNode("div",{class:e.value,style:r.value,onClick:c},[s,i.createVNode("img",{title:n.title,class:"f-avatar-image",src:m.value,onError:a},null),!n.readonly&&i.createVNode("div",{class:"f-avatar-icon"},[i.createVNode("span",{class:"f-icon f-icon-camera"},null)]),i.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:d.value,onChange:u,style:"display: none;"},null)])}}),Nn=i.ref(0);function kn(){Nn.value++}const lt=i.ref(0);function Vn(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function o(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function r(l,d=""){return t.getViewModelById(l).states.map(c=>o(c,d))}function s(l){const d=t.getRootViewModelId(),m=r(l);if(l===d)return m;const c=r(d,"root-component.");return[...m,...c]}function a(l){return l.binding&&l.binding.path||l.id||""}function u(){return e&&e.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:u}}class Wt{constructor(t){U(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'"}]);U(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});U(this,"getExpressionConverter",(t,e)=>({convertFrom:(o,r,s,a)=>{const u=s.getExpressionRuleValue(t,e||r);return u&&u.value||""},convertTo:(o,r,s,a,u)=>{var l;if(r==="dataPicking"&&(s!=null&&s.target)){const d=`${s.target}_dataPicking`;((l=s.rules)==null?void 0:l.some(c=>c.id===d&&c.value))?o.dictPickingExpressionId=d:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=t}getExpressionRule(t,e){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===t);if(!r)return"";const s=r.rules.find(a=>a.type===e);return s||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(e);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(t,e,o="label"){return{id:t.id,name:t.name,bindingPath:t[o],parents:e,type:"field"}}buildEntityFieldsTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var u;const s=this.createTreeNode(r,e);let a=[];(u=r.type)!=null&&u.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...e,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var l,d;const s=this.createTreeNode(r,e);s.type="entity";const a=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...e,r.label]),u=this.buildChildEntityTreeData((d=r.type)==null?void 0:d.entities,[...e,r.label]);u!=null&&u.length&&(a==null||a.push(...u)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const o=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),r=this.buildChildEntityTreeData(e.type.entities,[e.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,o){const r=o==="Field"?t.binding.field:t.id,s=this.getExpressionRule(r,e),a=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(e)&&s?s.message:"",...a};return s.messageType!=null&&(u.messageType=s.messageType),u}buildRule(t,e,o,r){const{expression:s,message:a,messageType:u}=e,l={id:`${t}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=a),o==="dataPicking"&&(l.messageType=u),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,o,r){const s=e==="Field"?t.binding.field:t.id,a=this.buildRule(s,o,r,t.type==="form-group"?t.id:"");let l=this.getExpressionData().find(m=>m.targetType===e&&m.target===s);const d=m=>m.value.trim()==="";if(l){const m=l.rules.find(c=>c.id===a.id);if(m)d(a)?l.rules=l.rules.filter(c=>c.id!==a.id):(Object.assign(m,a),r==="validate"&&t.type==="form-group"&&(m.elementId=t.id));else{if(d(a))return null;l.rules=l.rules||[],l.rules.push(a)}}else{if(d(a))return null;l={target:`${s}`,rules:[a],targetType:e}}return l}getExpressionEditorOptions(t,e,o,r){return o.reduce((s,a)=>{var l,d;const u=e==="Field"?(l=t==null?void 0:t.binding)==null?void 0:l.field:t.id;return s[a]={hide:e==="Field"?!!((d=t==null?void 0:t.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,a,e),onSubmitModal:m=>{const c=this.updateExpression(t,e,m,a);if(r){const g=this.buildRule(u,m,a);r(g)}return c}}},s},{})}getExpressionInfo(t,e,o){const r=e==="Field"?t.binding.field:t.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:e,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(t,e,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!t.binding,properties:{...this.getExpressionEditorOptions(t,e,o,r)}}}getExpressionOptions(t,e,o){const r=this.getExpressionInfo(t,e,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,o,e),expressionInfo:r}}}class Pn{constructor(t,e){U(this,"componentId");U(this,"viewModelId");U(this,"eventsEditorUtils");U(this,"formSchemaUtils");U(this,"formMetadataConverter");U(this,"designViewModelUtils");U(this,"designViewModelField");U(this,"controlCreatorUtils");U(this,"designerHostService");U(this,"designerContext");U(this,"schemaService",null);U(this,"metadataService",null);U(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext}getFormDesignerInstance(){var t,e;return(e=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var o;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===e)}t.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(t){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:t.type,name:M[t.type]&&M[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},o){const r={title:"外观",description:"Appearance"},s={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 a in e)s[a]=Object.assign(s[a]||{},e[a]);return{...r,properties:{...s},setPropertyRelates(a,u){if(a){switch(a&&a.propertyID){case"class":case"style":{lt.value++;break}}o&&o(a,t,u)}}}}getPropertyEditorParams(t,e=[],o="visible",r={},s={},a=""){const{getVariables:u,getControlName:l,getStateMachines:d}=Vn(this.designerHostService),m=this.getRealTargetType(t),c=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],g={type:"property-editor",propertyTypes:c};return c.map(f=>{switch(f){case"Const":Object.assign(g,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":g.expressionConfig=this.getExpressionOptions(t,m,a||o);break;case"StateMachine":g.stateMachines=d();break;case"Variable":Object.assign(g,{controlName:l(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),onBeforeOpenVariables:p=>{p.value=u(this.viewModelId)}},s);break}}),g}getVisibleProperty(t,e=""){var s;let o=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?o=["Const","Expression"]:e==="form-group"&&!((s=t.binding)!=null&&s.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,o,"visible")}}}getBehaviorConfig(t,e="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(t,e);for(const l in o)a[l]=Object.assign(a[l]||{},o[l]);const u=this;return{...s,properties:{...a},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(t,l);break}r&&r(l,d)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const o=e&&e.parent&&e.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===t),s=ie.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),kn()}addNewVariableToViewModel(t,e){const o=t.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(e).states.push(a)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:s,expressionInfo:a}=e,{targetId:u,targetType:l,expressionType:d,value:m,message:c}=a,g=this.formSchemaUtils.getModule();g.expressions=g.expressions||[];const{expressions:f}=g;let p=f.find(b=>b.target===u);p||(p={target:u,rules:[],targetType:l},f.push(p));const h=p.rules.find(b=>b.type===d);if(h)h.value=m,h.message=c;else{const b={id:s,type:d,value:m,message:c};p.rules.push(b)}delete e.expressionInfo}clearExpression(t,e){const o=t.propertyValue;if(o&&o.type==="Expression")return;const s=t.propertyID,a=this.formSchemaUtils.getExpressions(),u=e.binding?e.binding.field:e.id,l=a.find(d=>d.target===u);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==s))}getExpressionOptions(t,e,o){return new Wt(this.formSchemaUtils).getExpressionOptions(t,e,o)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},e}}const We=class We{static getEditorTypesByMDataType(t,e=!1,o=""){if(e)return[{key:M["language-textbox"].type,value:M["language-textbox"].name}];let r=We.fieldControlTypeMapping[t];if(o==="data-grid-column"&&(r!=null&&r.length)){const s=[M["check-group"].type,M["radio-group"].type];r=r.filter(a=>!s.includes(a.key))}return r}static getAllInputTypes(){const t=[];for(const e in We.fieldControlTypeMapping)We.fieldControlTypeMapping[e].forEach(o=>{t.find(r=>r.key===o.key&&r.value===o.value)||t.push({key:o.key,value:o.value})});return t}static mappingDomPropAndSchemaProp(t,e){var s;const o=(s=t.editor)==null?void 0:s.type,r=[];return(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===M["input-group"].type||o===M.textarea.type||o===M["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===M["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===M["combo-list"].type||o===M["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===M["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===M["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===M.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};U(We,"fieldControlTypeMapping",{String:[{key:M["input-group"].type,value:M["input-group"].name},{key:M.lookup.type,value:M.lookup.name},{key:M["date-picker"].type,value:M["date-picker"].name},{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name},{key:M["check-group"].type,value:M["check-group"].name},{key:M["radio-group"].type,value:M["radio-group"].name},{key:M["combo-list"].type,value:M["combo-list"].name},{key:M.textarea.type,value:M.textarea.name},{key:M["time-picker"].type,value:M["time-picker"].name}],Text:[{key:M.textarea.type,value:M.textarea.name},{key:M.lookup.type,value:M.lookup.name}],Decimal:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Integer:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Number:[{key:M["number-spinner"].type,value:M["number-spinner"].name},{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name}],BigNumber:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Date:[{key:M["date-picker"].type,value:M["date-picker"].name}],DateTime:[{key:M["date-picker"].type,value:M["date-picker"].name}],Boolean:[{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name}],Enum:[{key:M["combo-list"].type,value:M["combo-list"].name},{key:M["radio-group"].type,value:M["radio-group"].name}],Object:[{key:M.lookup.type,value:M.lookup.name},{key:M["combo-list"].type,value:M["combo-list"].name},{key:M["radio-group"].type,value:M["radio-group"].name}]});let ct=We;var dt=(n=>(n.Form="Form",n.Variable="Variable",n))(dt||{});class Rn{constructor(){U(this,"label","");U(this,"id","");U(this,"columnInSM",12);U(this,"columnInMD",6);U(this,"columnInLG",3);U(this,"columnInEL",2);U(this,"displayWidthInSM",1);U(this,"displayWidthInMD",1);U(this,"displayWidthInLG",1);U(this,"displayWidthInEL",1);U(this,"displayColumnCountAtBreakPoint","md");U(this,"tagRow",0);U(this,"showTopBorder",0);U(this,"group",1);U(this,"isSupportedClass",!0);U(this,"fieldSetId","")}}function On(n){let t,e;const o=new Map;let r=[];function s(m,c){const f=m.split(" ").filter(E=>E.startsWith("col-"));if(f.length===0){c.isSupportedClass=!1;return}let p=f.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),h=f.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),b=f.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),w=f.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),h=h||"col-md-"+c.columnInSM,c.columnInMD=parseInt(h.replace("col-md-",""),10),c.displayWidthInMD=c.columnInMD/6,[1,2].includes(c.displayWidthInMD)||(c.isSupportedClass=!1),b=b||"col-xl-"+c.columnInMD,c.columnInLG=parseInt(b.replace("col-xl-",""),10),c.displayWidthInLG=c.columnInLG/3,[1,2,3,4].includes(c.displayWidthInLG)||(c.isSupportedClass=!1),w=w||"col-el-"+c.columnInLG,c.columnInEL=parseInt(w.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function a(m,c,g,f=!1){let p=!1;m.contents.forEach(h=>{if(h.type==="fieldset"){g+=1,a(h,c,g,!0),p=!0;return}p&&(g+=1,p=!1);const b=h.appearance&&h.appearance.class,w=new Rn;b?s(b,w):w.isSupportedClass=!1,w.label=h.label||h.id,w.id=h.id,w.group=g,f&&(w.fieldSetId=m.id),e===h.id&&(t=g),o.set(h.id,h),c.push(w)})}function u(m){const c=n.getComponentById(m);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const g=n.selectNode(c,f=>f.type===vt.DgControl["response-form"].type);return!g||!g.contents||g.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:g}}function l(m,c){c=c||m.id;const{result:g,message:f,formNode:p}=u(c);if(!g)return{result:g,message:f};e=m.id,r=[],o.clear();const h=p.contents[0].type===vt.DgControl.fieldset.type?0:1;a(p,r,h);const b=r.find(E=>!E.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:b?"customize":"standard"},importData:r}}function d(m,c){c=c;const{result:g,formNode:f}=u(c);if(!g)return"";const p=[];return m.forEach(h=>{var E;const b=o.get(h.id),w=b.appearance&&b.appearance.class;if(w){const j=w.split(" ").filter($=>!$.startsWith("col-")),C="col-"+h.columnInSM,y="col-md-"+h.columnInMD,S="col-xl-"+h.columnInLG,A="col-el-"+h.columnInEL,I=[C,y,S,A].concat(j);b.appearance.class=I.join(" ")}if(h.fieldSetId){const R=f.contents.find(C=>C.id===h.fieldSetId),j=p.find(C=>C.id===h.fieldSetId);j?(E=j.contents)==null||E.push(b):(p.push(R),R.contents=[b])}else p.push(b)}),f.contents=p,f.id}return{checkCanFindFormNode:u,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:a}}var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(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 qn={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(o,r,s){function a(d,m){if(!r[d]){if(!o[d]){var c=typeof ut=="function"&&ut;if(!m&&c)return c(d,!0);if(u)return u(d,!0);var g=new Error("Cannot find module '"+d+"'");throw g.code="MODULE_NOT_FOUND",g}var f=r[d]={exports:{}};o[d][0].call(f.exports,function(p){var h=o[d][1][p];return a(h||p)},f,f.exports,e,o,r,s)}return r[d].exports}for(var u=typeof ut=="function"&&ut,l=0;l<s.length;l++)a(s[l]);return a}return e}()({1:[function(e,o,r){var s={},a="(?:^|\\s)",u="(?:\\s|$)";function l(c){var g=s[c];return g?g.lastIndex=0:s[c]=g=new RegExp(a+c+u,"g"),g}function d(c,g){var f=c.className;f.length?l(g).test(f)||(c.className+=" "+g):c.className=g}function m(c,g){c.className=c.className.replace(l(g)," ").trim()}o.exports={add:d,rm:m}},{}],2:[function(e,o,r){(function(s){var a=e("contra/emitter"),u=e("crossvent"),l=e("./classes"),d=document,m=d.documentElement;function c(x,D){var L=arguments.length;L===1&&Array.isArray(x)===!1&&(D=x,x=[]);var O,z,Y,se,N,B,G,P,K,he=null,ve,Q,oe=!1,ce=0,ee,q=D||{};q.moves===void 0&&(q.moves=E),q.accepts===void 0&&(q.accepts=E),q.invalid===void 0&&(q.invalid=Ke),q.containers===void 0&&(q.containers=x||[]),q.isContainer===void 0&&(q.isContainer=w),q.copy===void 0&&(q.copy=!1),q.copySortSource===void 0&&(q.copySortSource=!1),q.revertOnSpill===void 0&&(q.revertOnSpill=!1),q.removeOnSpill===void 0&&(q.removeOnSpill=!1),q.direction===void 0&&(q.direction="vertical"),q.ignoreInputTextSelection===void 0&&(q.ignoreInputTextSelection=!0),q.mirrorContainer===void 0&&(q.mirrorContainer=d.body);var te=a({containers:q.containers,start:Ee,end:Le,cancel:T,remove:Xe,destroy:He,canMove:Ve,dragging:!1});return q.removeOnSpill===!0&&te.on("over",St).on("out",At),Ne(),te;function $e(v){return te.containers.indexOf(v)!==-1||q.isContainer(v)}function Ne(v){var F=v?"remove":"add";p(m,F,"mousedown",ae),p(m,F,"mouseup",Re)}function Te(v){var F=v?"remove":"add";p(m,F,"mousemove",Je)}function Ge(v){var F=v?"remove":"add";u[F](m,"selectstart",Qe),u[F](m,"click",Qe)}function He(){Ne(!0),Re({})}function Qe(v){ve&&v.preventDefault()}function ae(v){se=v.clientX,N=v.clientY;var F=h(v)!==1||v.metaKey||v.ctrlKey;if(!F){var k=v.target,H=ke(k);H&&(ve=H,Te(),v.type==="mousedown"&&(y(k)?k.focus():v.preventDefault()))}}function Je(v){if(ve){if(h(v)===0){Re({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-se)<=(q.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-N)<=(q.slideFactorY||0))){if(q.ignoreInputTextSelection){var F=$("clientX",v)||0,k=$("clientY",v)||0,H=d.elementFromPoint(F,k);if(y(H))return}var Z=ve;Te(!0),Ge(),Le(),Pe(Z),l.add(P||Y,"gu-transit"),Et(),Tt(),ce=0,Be(v)}}}function ke(v){if(!(te.dragging&&O)&&!$e(v)){for(var F=v;C(v)&&$e(C(v))===!1;)if(q.invalid(v,F)||(v=C(v),!v))return;var k=C(v);if(k&&!q.invalid(v,F)){var H=q.moves(v,k,F,A(v));if(H)return{item:v,source:k}}}}function Ve(v){return!!ke(v)}function Ee(v){var F=ke(v);F&&Pe(F)}function Pe(v){kt(v.item,v.source)&&(P=v.item.cloneNode(!0),te.emit("cloned",P,v.item,"copy")),z=v.source,Y=v.item,B=G=A(v.item),te.dragging=!0,te.emit("drag",Y,z)}function Ke(){return!1}function Le(){if(te.dragging){var v=P||Y;_e(v,C(v))}}function Me(){ve=!1,Te(!0),Ge(!0)}function Re(v){if(Me(),!!te.dragging){var F=P||Y,k=$("clientX",v)||0,H=$("clientY",v)||0,Z=b(O,k,H),J=de(Z,k,H);J&&(P&&q.copySortSource||!P||J!==z)?_e(F,J):q.removeOnSpill?Xe():T()}}function _e(v,F){var k=C(v);P&&q.copySortSource&&F===z&&k.removeChild(Y),le(F)?te.emit("cancel",v,z):te.emit("drop",v,F,z,G),_()}function Xe(){if(te.dragging){var v=P||Y,F=C(v);F&&F.removeChild(v),te.emit(P?"cancel":"remove",v,F,z),_()}}function T(v){if(te.dragging){var F=arguments.length>0?v:q.revertOnSpill,k=P||Y,H=C(k),Z=le(H);Z===!1&&F&&(P?H&&H.removeChild(P):z.insertBefore(k,B)),Z||F?te.emit("cancel",k,z,z):te.emit("drop",k,H,z,G),_()}}function _(){var v=P||Y;Me(),It(),Ft(),v&&l.rm(v,"gu-transit"),K&&clearTimeout(K),te.dragging=!1,he&&te.emit("out",v,he,z),te.emit("dragend",v,ce),z=Y=P=B=G=K=he=null}function le(v,F){var k;return F!==void 0?k=F:O?k=G:k=A(P||Y),v===z&&k===B}function de(v,F,k){for(var H=v;H&&!Z();)H=C(H);return H;function Z(){var J=$e(H);if(J===!1)return!1;var Se=gt(H,v),ye=ht(H,Se,F,k),be=le(H,ye);return be?!0:q.accepts(Y,H,z,ye)}}function Be(v){if(!O)return;v.preventDefault();var F=$("clientX",v)||0,k=$("clientY",v)||0;O.style.left=F-2+"px",O.style.top=k-2+"px";var H=P||Y,Z=b(O,F,k),J=de(Z,F,k),Se=J!==null&&J!==he;(Se||J===null)&&(Ce(),he=J,Fe()),Nt(Z,k);var ye=C(H);if(J===z&&P&&!q.copySortSource){ye&&ye.removeChild(H);return}var be,Ie=gt(J,Z);if(oe=et(Ie,J),Ie!==null)be=ht(J,Ie,F,k);else if(q.revertOnSpill===!0&&!P)be=B,J=z;else{P&&ye&&ye.removeChild(H),P&&Q&&(Q.style.display="none");return}Q.style.display="block",wt(be,H,Se),be?Bt(Ie,be):jt(J);function ue(me){te.emit(me,H,he,z)}function Fe(){Se&&ue("over")}function Ce(){he&&ue("out")}}function wt(v,F,k){(v===F||v===A(F))&&(G=A(F)),(v===null&&k||v!==F&&v!==A(F))&&(G=v)}function St(v){l.rm(v,"gu-hide")}function At(v){te.dragging&&l.add(v,"gu-hide")}function Tt(){O||(O=document.createElement("div"),O.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;",O.innerHTML=q.getMirrorText&&q.getMirrorText(Y)||"控件",l.add(O,"gu-mirror"),q.mirrorContainer.appendChild(O),p(m,"add","mousemove",Be),l.add(q.mirrorContainer,"gu-unselectable"),te.emit("cloned",O,Y,"mirror"))}function Et(){if(Q=document.createElement("div"),l.add(Q,"gu-insertion"),Y){var v=Y.getBoundingClientRect();Q.style.left=v.left+"px",Q.style.top=v.top+"px"}oe=!1,q.mirrorContainer.appendChild(Q)}function It(){O&&(l.rm(q.mirrorContainer,"gu-unselectable"),p(m,"remove","mousemove",Be),C(O).removeChild(O),O=null)}function Ft(){Q&&(C(Q).removeChild(Q),Q=null)}function gt(v,F){for(var k=F;k!==v&&C(k)!==v;)k=C(k);return k===m?null:k}function et(v,F){if(!F)return oe;var k=v||F&&F.lastElementChild;if(!k)return!0;var H=getComputedStyle(v),Z=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(Z)return!0;if(F){var J=getComputedStyle(F),Se=J.getPropertyValue("display");if(/flex$/.test(Se)){var ye=J.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!Mt(F)}return!1}return!0}function Mt(v){if(!v.children||!v.children.length)return!1;for(const F of Array.from(v.children)){const H=(F.className&&F.className.split(" ")||[]).filter(Z=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Z));if(!H.length)return!1;for(const Z of H){const J=Z.slice(Z.lastIndexOf("-")+1);if(parseInt(J,10)!==12)return!1}}return!0}function Bt(v,F){const k=F.getBoundingClientRect();if(Q.style.left=k.left+"px",Q.style.top=k.top+"px",oe){if(Q.style.height=k.height+"px",Q.style.width="4px",v){const H=v.getBoundingClientRect();H.top!==k.top&&(Q.style.left=H.right+"px",Q.style.top=H.top+"px",Q.style.height=H.height+"px")}}else if(Q.style.height="4px",Q.style.width=k.width+"px",ee){const H=ee.getBoundingClientRect();k.top<H.top&&(Q.style.display="none")}F===Y&&Y&&(Q.style.display="none")}function jt(v){G=null;var F=v.lastElementChild;if(F){var k=F.getBoundingClientRect();oe?(Q.style.left=k.right+"px",Q.style.top=k.top+"px",Q.style.height=k.height+"px",Q.style.width="4px"):(Q.style.left=k.left+"px",Q.style.top=k.bottom+"px",Q.style.height="4px",Q.style.width=k.width+"px"),F===Y&&Y&&(Q.style.display="none")}else Q.style.display="none"}function Nt(v,F){if(!q.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ee=g(v),!ee||!ee.contains(v)))return;const k=document.querySelector(".dgComponentSelected"),H=ee.getBoundingClientRect();if(F-30<H.top&&ee.scrollTop>0){let Z=ee.scrollTop<10?ee.scrollTop:10;ee.scrollBy(0,-1*Z),k&&ee.contains(k)&&(ce=ce+-1*Z)}if(F+30>H.bottom&&ee.scrollTop<ee.scrollHeight-ee.clientHeight){const Z=ee.scrollHeight-ee.clientHeight-ee.scrollTop;let J=Z<10?Z:10;ee.scrollBy(0,J),k&&ee.contains(k)&&(ce=ce+J)}}function ht(v,F,k,H){var Z=q.direction==="horizontal",J=q.direction==="mixed",Se=F!==v?be():ye();return Se;function ye(){var ue=v.children.length,Fe,Ce,me;for(Fe=0;Fe<ue;Fe++)if(Ce=v.children[Fe],me=Ce.getBoundingClientRect(),Z&&me.left+me.width/2>k||!J&&!Z&&me.top+me.height/2>H||J&&me.left+me.width>k&&me.top+me.height>H)return Ce;return null}function be(){var ue=F.getBoundingClientRect();if(J){var Fe=H-ue.top,Ce=k-ue.left,me=ue.bottom-H,tt=ue.right-k,nt=Math.min(Ce,tt,Fe,me),ot;return oe?ot=tt<Ce:ot=me===nt||tt===nt||Ce===nt,Ie(ot)}return Ie(Z?k>ue.left+R(ue)/2:H>ue.top+j(ue)/2)}function Ie(ue){return ue?A(F):F}}function kt(v,F){return typeof q.copy=="boolean"?q.copy:q.copy(v,F)}}function g(x){const D=Array.from(window.scrollContainerList);if(D.length===1){const O=Array.from(window.scrollContainerList)[0];return document.getElementById(O)}const L=f(D);for(const O of L)if(O.contains(x))return O;return null}function f(x){const D=[];return x.forEach(L=>{const O=document.getElementById(L);O&&D.push(O)}),D.sort((L,O)=>L.contains(O)?1:O.contains(L)?-1:0),D}function p(x,D,L,O){var z={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},Y={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},se={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?u[D](x,Y[L],O):s.navigator.msPointerEnabled?u[D](x,se[L],O):(u[D](x,z[L],O),u[D](x,L,O))}function h(x){if(x.touches!==void 0)return x.touches.length;if(x.which!==void 0&&x.which!==0)return x.which;if(x.buttons!==void 0)return x.buttons;var D=x.button;if(D!==void 0)return D&1?1:D&2?3:D&4?2:0}function b(x,D,L){x=x||{};var O=x.className||"",z;return x.className+=" gu-hide",z=d.elementFromPoint(D,L),x.className=O,z}function w(){return!1}function E(){return!0}function R(x){return x.width||x.right-x.left}function j(x){return x.height||x.bottom-x.top}function C(x){return x.parentNode===d?null:x.parentNode}function y(x){return x.tagName==="INPUT"||x.tagName==="TEXTAREA"||x.tagName==="SELECT"||S(x)}function S(x){return!x||x.contentEditable==="false"?!1:x.contentEditable==="true"?!0:S(C(x))}function A(x){return x.nextElementSibling||D();function D(){var L=x;do L=L.nextSibling;while(L&&L.nodeType!==1);return L}}function I(x){return x.targetTouches&&x.targetTouches.length?x.targetTouches[0]:x.changedTouches&&x.changedTouches.length?x.changedTouches[0]:x}function $(x,D){var L=I(D),O={pageX:"clientX",pageY:"clientY"};return x in O&&!(x in L)&&O[x]in L&&(x=O[x]),L[x]}o.exports=c}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,o,r){o.exports=function(a,u){return Array.prototype.slice.call(a,u)}},{}],4:[function(e,o,r){var s=e("ticky");o.exports=function(u,l,d){u&&s(function(){u.apply(d||null,l||[])})}},{ticky:10}],5:[function(e,o,r){var s=e("atoa"),a=e("./debounce");o.exports=function(l,d){var m=d||{},c={};return l===void 0&&(l={}),l.on=function(g,f){return c[g]?c[g].push(f):c[g]=[f],l},l.once=function(g,f){return f._once=!0,l.on(g,f),l},l.off=function(g,f){var p=arguments.length;if(p===1)delete c[g];else if(p===0)c={};else{var h=c[g];if(!h)return l;h.splice(h.indexOf(f),1)}return l},l.emit=function(){var g=s(arguments);return l.emitterSnapshot(g.shift()).apply(this,g)},l.emitterSnapshot=function(g){var f=(c[g]||[]).slice(0);return function(){var p=s(arguments),h=this||l;if(g==="error"&&m.throws!==!1&&!f.length)throw p.length===1?p[0]:p;return f.forEach(function(w){m.async?a(w,p,h):w.apply(h,p),w._once&&l.off(g,w)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(e,o,r){(function(s){var a=e("custom-event"),u=e("./eventmap"),l=s.document,d=g,m=p,c=[];s.addEventListener||(d=f,m=h),o.exports={add:d,remove:m,fabricate:b};function g(C,y,S,A){return C.addEventListener(y,S,A)}function f(C,y,S){return C.attachEvent("on"+y,E(C,y,S))}function p(C,y,S,A){return C.removeEventListener(y,S,A)}function h(C,y,S){var A=R(C,y,S);if(A)return C.detachEvent("on"+y,A)}function b(C,y,S){var A=u.indexOf(y)===-1?$():I();C.dispatchEvent?C.dispatchEvent(A):C.fireEvent("on"+y,A);function I(){var x;return l.createEvent?(x=l.createEvent("Event"),x.initEvent(y,!0,!0)):l.createEventObject&&(x=l.createEventObject()),x}function $(){return new a(y,{detail:S})}}function w(C,y,S){return function(I){var $=I||s.event;$.target=$.target||$.srcElement,$.preventDefault=$.preventDefault||function(){$.returnValue=!1},$.stopPropagation=$.stopPropagation||function(){$.cancelBubble=!0},$.which=$.which||$.keyCode,S.call(C,$)}}function E(C,y,S){var A=R(C,y,S)||w(C,y,S);return c.push({wrapper:A,element:C,type:y,fn:S}),A}function R(C,y,S){var A=j(C,y,S);if(A){var I=c[A].wrapper;return c.splice(A,1),I}}function j(C,y,S){var A,I;for(A=0;A<c.length;A++)if(I=c[A],I.element===C&&I.type===y&&I.fn===S)return A}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,o,r){(function(s){var a=[],u="",l=/^on/;for(u in s)l.test(u)&&a.push(u.slice(2));o.exports=a}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,o,r){(function(s){var a=s.CustomEvent;function u(){try{var l=new a("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=u()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(d,m){var c=document.createEvent("CustomEvent");return m?c.initCustomEvent(d,m.bubbles,m.cancelable,m.detail):c.initCustomEvent(d,!1,!1,void 0),c}:function(d,m){var c=document.createEventObject();return c.type=d,m?(c.bubbles=!!m.bubbles,c.cancelable=!!m.cancelable,c.detail=m.detail):(c.bubbles=!1,c.cancelable=!1,c.detail=void 0),c}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,o,r){var s=o.exports={},a,u;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=l}catch{a=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=d}catch{u=d}})();function m(j){if(a===setTimeout)return setTimeout(j,0);if((a===l||!a)&&setTimeout)return a=setTimeout,setTimeout(j,0);try{return a(j,0)}catch{try{return a.call(null,j,0)}catch{return a.call(this,j,0)}}}function c(j){if(u===clearTimeout)return clearTimeout(j);if((u===d||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(j);try{return u(j)}catch{try{return u.call(null,j)}catch{return u.call(this,j)}}}var g=[],f=!1,p,h=-1;function b(){!f||!p||(f=!1,p.length?g=p.concat(g):h=-1,g.length&&w())}function w(){if(!f){var j=m(b);f=!0;for(var C=g.length;C;){for(p=g,g=[];++h<C;)p&&p[h].run();h=-1,C=g.length}p=null,f=!1,c(j)}}s.nextTick=function(j){var C=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)C[y-1]=arguments[y];g.push(new E(j,C)),g.length===1&&!f&&m(w)};function E(j,C){this.fun=j,this.array=C}E.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function R(){}s.on=R,s.addListener=R,s.once=R,s.off=R,s.removeListener=R,s.removeAllListeners=R,s.emit=R,s.prependListener=R,s.prependOnceListener=R,s.listeners=function(j){return[]},s.binding=function(j){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(j){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(e,o,r){(function(s){var a=typeof s=="function",u;a?u=function(l){s(l)}:u=function(l){setTimeout(l,0)},o.exports=u}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,o,r){(function(s,a){var u=e("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,m={},c=0;r.setTimeout=function(){return new g(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new g(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function g(f,p){this._id=f,this._clearFn=p}g.prototype.unref=g.prototype.ref=function(){},g.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(f,p){clearTimeout(f._idleTimeoutId),f._idleTimeout=p},r.unenroll=function(f){clearTimeout(f._idleTimeoutId),f._idleTimeout=-1},r._unrefActive=r.active=function(f){clearTimeout(f._idleTimeoutId);var p=f._idleTimeout;p>=0&&(f._idleTimeoutId=setTimeout(function(){f._onTimeout&&f._onTimeout()},p))},r.setImmediate=typeof s=="function"?s:function(f){var p=c++,h=arguments.length<2?!1:d.call(arguments,1);return m[p]=!0,u(function(){m[p]&&(h?f.apply(null,h):f.call(null),r.clearImmediate(p))}),p},r.clearImmediate=typeof a=="function"?a:function(f){delete m[f]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(qn);const $n={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}},Hn={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},bt=i.defineComponent({name:"Toast",props:Hn,emits:["close","click"],setup:(n,t)=>{const{locale:e,t:o}=rt.useI18n(),r=i.ref(n.animate),s="fadeOut",a=i.computed(()=>n.options),u=i.ref(!1),l=i.computed(()=>a.value.title&&a.value.message),d=i.computed(()=>!a.value.title&&a.value.message),m=i.computed(()=>{const j={animated:u.value,toast:!0,"toast--only-content":!l.value};return j[n.animate]=!1,j[s]=u.value,j["toasty-type-"+a.value.type]=!0,a.value.theme&&(j[a.value.theme]=!0),j}),c=i.computed(()=>{const y=`f-icon-${a.value&&a.value.type?a.value.type.replace("toasty-type-",""):"default"}`,S={"f-icon":!0};return S[y]=!0,S}),g=i.computed(()=>a.value.title||a.value.message),f=i.computed(()=>n.showCloseButton),p=i.computed(()=>!!a.value.buttons||!!t.slots.default),h=i.computed(()=>e.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b(j){j.stopPropagation(),j.preventDefault(),u.value=!1,setTimeout(()=>{t.emit("close",a.value)},200)}function w(j,C){}function E(j){return`f-preten-link ${j.customClass?j.customClass:""}`}i.watch(r,()=>{r.value});const R=()=>{var j;return i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((j=a.value.buttons)==null?void 0:j.map(C=>i.createVNode("span",{class:E(C),onClick:y=>void 0},[C.text]))),t.slots.default&&t.slots.default()])])};return()=>i.createVNode("div",{class:m.value,style:"min-height:44px"},[f.value&&i.createVNode("button",{title:o("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:b},[i.createVNode("span",{class:"f-icon modal_close"},null)]),g.value&&i.createVNode("section",{class:"modal-tips"},[!l.value&&i.createVNode("div",{class:"float-left modal-tips-iconwrap"},[i.createVNode("span",{class:c.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[l.value&&i.createVNode(i.Fragment,null,[i.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:a.value.title},null),i.createVNode("p",{class:"toast-msg",innerHTML:a.value.message,style:h.value},null),p.value&&R()]),d.value&&(a.value.buttons?i.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:a.value.message},null),i.createVNode("div",{class:"after-toast-title text-right ml-auto"},[R()])]):i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:a.value.message},null))])])])}}),ft=i.defineComponent({name:"Notify",props:$n,emits:["close","empty"],setup(n,t){const e=i.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=i.ref(),s=i.ref(n.options),a=i.ref(n.showCloseButton),u=i.computed(()=>n.position||"bottom-right"),l=i.computed(()=>n.timeout!=null?n.timeout:3e3),d=i.computed(()=>{const g=n.bottom?n.bottom:o.bottom,f=n.top?n.top:o.top,p={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?`${f}px`:"",bottom:u.value.indexOf("bottom")>-1?`${g}px`:""};return u.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function m(g){t.emit("close")}l.value&&setTimeout(()=>{m()},l.value),t.expose({closeToast:m,container:r,notifyPosition:u});function c(g,f){m()}return()=>i.createVNode("div",{class:e.value,style:d.value,ref:r},[i.createVNode(bt,{options:s.value,showCloseButton:a.value,animate:n.animate,onClose:g=>c(g,s.value)},null)])}});class Ln{constructor(){U(this,"notifyRefs",[]);U(this,"globalConfig",i.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),s=document.createElement("div");s.style.display="contents";const a=i.createApp({setup(){var d;const u=i.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(r,u),a.unmount()},220)}if(r.position.indexOf("top")>-1){const m=e.getNotifyInstances(r.position),c=m[m.length-1];if(c){const g=c.value.container.getBoundingClientRect();r.top=g.bottom}}return r.safeHtml&&((d=r.options)!=null&&d.message)&&(r.options.message=e.escapeAllHtml(r.options.message)),i.onUnmounted(()=>{document.body.removeChild(s)}),i.onMounted(()=>{e.updateNotifyPositionForCreate(r,u)}),()=>i.createVNode(i.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[i.createVNode(ft,i.mergeProps({ref:u},r,{onClose:l}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.use(st.LocaleService.i18n),a.mount(s),a}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const o=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const r=this.getNotifyInstances(t.position),s=r.indexOf(e);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let o="",r="",s,a,u;typeof e=="string"?o=e:e&&(o=e.message||"",r=e.title||"",a=e.position||null,u=e.showCloseButton!=null?e.showCloseButton:null,s=e.timeout!=null?e.timeout:null);const d={options:{type:t,message:o,title:r}};return a!=null&&(d.position=a),u!=null&&(d.showCloseButton=u),s!=null&&(d.timeout=s),d}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Dn=Symbol("NOTIFY_SERVICE_TOKEN");ft.install=n=>{n.component(ft.name,ft),n.component(bt.name,bt);const t=new Ln;n.provide(Dn,t),n.provide("FNotifyService",t)},`${st.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const zn={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:st.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 Un(n,t,e,o,r,s,a,u,l,d,m,c,g,f,p,h,b){const{calculateCellPositionInRow:w}=s,{columnContext:E,hasLeftFixedColumn:R,hasRightFixedColumn:j}=a,{gridDataStyle:C,leftFixedGridDataStyle:y,rightFixedGridDataStyle:S}=f,{renderDataRow:A}=X.getHierarchyRow(n,t,E,b,u,l,d,m,c,g,f,p,h),I=[A];function $(z,Y){const se=w(z);return b.value.filter(N=>N.visible!==!1).map((N,B)=>I[N.type](N,se,Y,B))}function x(){return i.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:y.value},[$(E.value.leftColumns.filter(z=>z.visible),"left")])])}function D(){return i.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[i.createVNode("div",{class:"fv-grid-data",style:C.value},[$(E.value.primaryColumns.filter(z=>z.visible),"primary")])])}function L(){return i.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:S.value},[$(E.value.rightColumns.filter(z=>z.visible),"right")])])}function O(){const z=[];return R.value&&z.push(x()),z.push(D()),j.value&&z.push(L()),z}return{renderDataArea:O}}const Wn=i.defineComponent({name:"FTreeGrid",props:zn,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,t){var Jt,Kt;const o=((Jt=n.rowOption)==null?void 0:Jt.height)||28,r=i.ref(20),s=i.ref(n.columns),a=X.useIdentify(n),{idField:u}=a,l=i.ref(),d=i.ref(),m=i.ref(),c=i.ref(),g=i.ref(),f=i.ref([]),p=i.ref(!1),h=i.ref(((Kt=n.rowOption)==null?void 0:Kt.wrapContent)||!1),b=X.useGroupData(n,a),w=X.useFilter(n,t),E=X.useHierarchy(n),{collapseField:R}=E,{showLoading:j,renderLoading:C}=X.useLoading(n,l),y=X.useDataView(n,new Map,w,E,a),{dataView:S}=y,A=X.useSelection(n,y,a,f,t),{showSelection:I,selectedValues:$}=A,x=X.useSelectHierarchyItem(n,f,y,a,A,t),D=i.computed(()=>n.disabled),L=i.computed(()=>n.virtualized?Math.min(y.dataView.value.length,r.value):y.dataView.value.length),O=X.usePagination(n,y),{shouldRenderPagination:z}=O,{containerStyleObject:Y}=X.useDataViewContainerStyle(n),se=X.useCommandColumn(n),{applyCommands:N}=se;N(s);const{applyColumnSetting:B,removeColumnSetting:G}=X.useSettingColumn(n);n.showSetting&&B(s);const P=X.useColumn(n,t),K=X.useSort(n),{applyColumnSorter:he,columnContext:ve,updateColumnRenderContext:Q}=P;he(y,K);const oe=X.useGroupColumn(n,ve),ce=X.useRow(n,t,A,a),ee=X.useEdit(n,t,a,ce,f),q=X.useVisualDataBound(n),te=X.useVisualDataCell(n,ee,q),$e=X.useVisualDataRow(n,y,ee,E,a,q,te),Ne=X.useVisualData(n,s,y,L,0,$e),{getVisualData:Te}=Ne,Ge=X.useCellPosition(n,ve),He=X.useSidebar(n,A),{sidebarWidth:Qe}=He,ae=X.useVirtualScroll(n,y,f,ve,Ne,L,0,Qe),{onWheel:Je,dataGridWidth:ke,viewPortHeight:Ve,viewPortWidth:Ee,resetScroll:Pe,updateVisibleRowsOnLatestVisibleScope:Ke}=ae,Le=X.useFitColumn(n,ve,d,Ee,oe),{calculateColumnsSize:Me}=Le,Re=X.useFilterHistory(),_e=X.useColumnFilter(d,g,y,Re,ae),Xe=X.useDragColumn(n,t,P,y,oe,b,ae),T=i.computed(()=>{const V={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return we.getCustomClass(V,n.customClass)}),_=i.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":h.value})),{renderDataArea:le}=Un(n,t,m,c,g,Ge,P,y,ee,E,ce,A,x,ae,Ne,q,f),{renderGridHeader:de,renderGridColumnResizeOverlay:Be,shouldShowHeader:wt}=X.getColumnHeader(n,t,d,c,g,P,y,Xe,_e,w,Re,Le,oe,A,He,K,ae,Ee,f),{renderDataGridSidebar:St}=X.getSidebar(n,ce,A,He,ae),{renderDisableMask:At}=X.getDisableMask(),{renderHorizontalScrollbar:Tt}=X.getHorizontalScrollbar(n,d,ae),{renderVerticalScrollbar:Et}=X.getVerticalScrollbar(n,d,ae);function It(){var V,W,fe;if(d.value&&d.value.clientHeight>0&&((V=d.value)==null?void 0:V.clientWidth)>0){const ge=Math.ceil(d.value.clientHeight/o);ge>r.value&&(r.value=ge,Ke()),Ve.value=((W=m.value)==null?void 0:W.clientHeight)||0,ke.value=((fe=d.value)==null?void 0:fe.clientWidth)||0,Me()}}i.onMounted(()=>{d.value&&(r.value=Math.max(Math.ceil(d.value.clientHeight/o),r.value),f.value=Te(0,L.value+0-1),tn.useResizeObserver(d.value,It),Me(),i.nextTick(()=>{d.value&&(ke.value=d.value.clientWidth),m.value&&(Ee.value=m.value.clientWidth,Ve.value=m.value.clientHeight)})),j.value&&C()}),i.onUnmounted(()=>{}),i.watch(Ee,()=>{d.value&&Me()});function Ft(V){y.collapseTo(V),y.reOrderVisibleIndex(),Pe()}function gt(V){y.expandTo(V),y.reOrderVisibleIndex(),Pe()}function et(){const V=A.getSelectionRow();return V?V.dataIndex-1:-1}function Mt(){const V=et();y.insertNewDataItem(V),f.value=Te(0,L.value+0-1)}function Bt(){const V=et();y.insertNewChildDataItem(V),f.value=Te(0,L.value+0-1)}function jt(V,W){const fe=f.value.find(xe=>xe.raw[u.value]===W),ge=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(V,ge)}function Nt(){const V=et(),W=x.getNextSelectableHierarchyItemId(V);y.removeHierarchyDataItem(V),f.value=Te(0,L.value+0-1),W&&x.selectItemById(W)}function ht(V){ee.onEditingRow(V)}function kt(V){ee.acceptEditingRow(V)}function v(V){ee.cancelEditingRow(V)}function F(V){V&&(s.value=V,N(s),Q(s.value),he(y,K),Me())}i.watch(()=>n.columns,V=>{F(V)});function k(V,W){V&&(y.load(V),y.reOrderVisibleIndex(),W!=null&&W.keepScrollPosition?ae.scrollTo(ae.offsetY.value):Pe())}function H(V){x.selectItemById(V)}function Z(V){const W=f.value.find(fe=>fe.raw[a.idField.value]===V);W&&ce.clickRowItem(W)}function J(V){ce.activeRowById(V)}function Se(V){x.selectItemByIds(V)}function ye(){return A.getSelectedItems()}function be(){A.clearSelection()}const Ie=i.computed(()=>!f.value||!f.value.length),{renderEmpty:ue}=X.getEmpty(n,t);function Fe(){return A.getSelectionRow()}function Ce(V){x.unSelectItemByIds(V)}function me(){return A.currentSelectedDataId.value}function tt(V,W,fe){const ge=S.value.find(xe=>xe[u.value]===V);if(ge){if(Object.keys(ge).forEach(pe=>{Object.prototype.hasOwnProperty.call(W,pe)&&(ge[pe]=W[pe])}),fe){const{collapseField:pe,disabledField:De,checkedField:ze,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(ge.__fv_collapse__=W[pe]),ze&&!ie.isUndefined(W[ze])&&(ge.__fv_checked__=W[ze]),De&&!ie.isUndefined(W[De])&&(ge.__fv_disabled__=W[De]),Ue&&!ie.isUndefined(W[Ue])&&(ge.__fv_visible__=W[Ue])}const xe=f.value.find(pe=>pe.raw[u.value]===V),en=f.value.findIndex(pe=>pe.raw[u.value]===V);if(xe){if(xe.raw=ge,Object.keys(xe.data).forEach(pe=>{xe.data[pe].updateData(ge)}),fe){const{collapseField:pe,disabledField:De,checkedField:ze,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(xe.collapse=W[pe]),ze&&!ie.isUndefined(W[ze])&&(xe.checked=W[ze]),De&&!ie.isUndefined(W[De])&&(xe.disabled=W[De]),Ue&&!ie.isUndefined(W[Ue])&&(xe.visible=W[Ue])}f.value=[...f.value.slice(0,en),xe,...f.value.slice(en+1)],y.updateSummary()}}}function nt(V){return Object.prototype.hasOwnProperty.call(V,"raw")?y.hasRealChildren(V.raw):y.hasRealChildren(V)}function ot(V){const W=y.dataView.value.find(fe=>fe[u.value]===V);return W?W[R.value]:""}function Vo(){return R.value}i.watch(()=>n.showSetting,(V,W)=>{V!==W&&(V?B(s):G(s),F(s.value))});function Po(V){return f.value.filter(W=>V.includes(W.raw[n.idField]))}function Ro(V){const W=a.idField.value,fe=f.value.find(ge=>ge.raw[W]===V);fe&&ce.changeRow(fe)}function Oo(){A.keepSelectingOnPaging.value||be(),y.updateVisibleDataSummary(f.value)}t.expose({activeRowById:J,addNewDataItem:Mt,addNewChildDataItem:Bt,addChildrenToNode:jt,collapseTo:Ft,expandTo:gt,removeDataItem:Nt,editDataItem:ht,acceptDataItem:kt,cancelDataItem:v,updateColumns:F,updateDataSource:k,selectItemById:H,selectItemByIds:Se,getSelectedItems:ye,clearSelection:be,getSelectionRow:Fe,clickRowItemById:Z,unSelectItemByIds:Ce,getCurrentRowId:me,reassignRowData:tt,hasChildren:nt,getCollapseField:Vo,getCollapseStatusById:ot,getVisibleDataByIds:Po,selectRowById:Ro,updateDerivedData:Oo});const qo=i.computed(()=>{const V={};return ae.shouldShowHorizontalScrollbar.value&&(V.paddingBottom="10px"),ae.shouldShowVirticalScrollbar.value&&(V.paddingRight="10px"),V}),$o=i.computed(()=>({...Y.value,borderRadius:"5px"}));X.getPagination(n,t,y,ae,O,A);const Ho=i.computed(()=>({"d-flex":!0,"justify-content-between":z.value&&I.value,"justify-content-end":z.value&&!I.value,"position-relative":!0})),Lo=i.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:Do}=X.getSummary(n,y,P);return()=>i.createVNode("div",{ref:l,class:T.value,style:$o.value,onWheel:Je},[d.value&&wt.value&&de(),i.createVNode("div",{ref:d,class:_.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:qo.value},[d.value&&St(f),d.value&&le(),d.value&&Ie.value&&ue(),d.value&&Tt(),d.value&&Et()]),d.value&&Do(),I.value&&i.createVNode("div",{class:Ho.value},[I.value&&i.createVNode("div",{class:Lo.value},[i.createVNode("div",null,["已选:"+$.value.length,i.createTextVNode(" 条")])])]),Be(),D.value&&At()])}});we.withInstall(Wn);function Gt(n,t){return{customClass:t.class,customStyle:t.style}}const Gn=new Map([["appearance",Gt]]);function Qn(n,t,e){return t}Ye({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"]},Gn,Qn,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const Ct=new Map([["appearance",Gt]]),_n=new Map([]),Xn="root-viewmodel";class Yn{constructor(t,e){U(this,"formSchemaUtils");U(this,"controlCreatorUtils");U(this,"designViewModelUtils");this.resolver=t,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const e=this.createComponentRefNode(t),o=this.createComponentNode(t),r=this.createViewModeNode(t),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(t){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),e}createComponentNode(t){const e=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(t);return Object.assign(e,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:o}),e}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),e.contents=[o];const{selectedFields:s}=t;s==null||s.forEach(u=>{if(u.$type===we.FormSchemaEntityField$Type.SimpleField){const l=ie.cloneDeep(u),d=this.resolveControlClassByFormColumns(t),m=this.controlCreatorUtils.setFormFieldProperty(l,"",d);m&&r.push(m)}});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(t){let e="";switch(t.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Xn,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const e=[],{selectedFields:o}=t;return o==null||o.forEach(r=>{if(r.$type===we.FormSchemaEntityField$Type.SimpleField){let s="blur";const a=r.type.name;(a===we.FormSchemaEntityFieldTypeName.Enum||a===we.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),e.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}}),e}}function Zn(n,t,e,o){var s,a,u,l,d,m;const r=e.parentComponentInstance;if(r&&o){const c=(s=r.schema)==null?void 0:s.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=e.bindingSourceContext)==null?void 0:a.entityTitle)||((l=(u=e.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((d=e.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(m=e.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Yn(n,o).createComponent(f)}else return t}function Jn(n,t,e){return t}Ye({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},Ct,Zn);const Qt={$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"]};Ye({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}},Qt,Ct,void 0),Ye({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Qt,Ct,void 0);const Kn={$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"]},eo={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};it.createPropsResolver(eo,Kn,_n,Jn);const to={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 xt(){return new DOMException("The request is not allowed","NotAllowedError")}async function no(n){if(!navigator.clipboard)throw xt();return navigator.clipboard.writeText(n)}async function oo(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const e=window.getSelection(),o=window.document.createRange();e==null||e.removeAllRanges(),o.selectNode(t),e==null||e.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(t)}if(!r)throw xt()}async function io(n){try{await no(n)}catch(t){try{await oo(n)}catch(e){throw e||t||xt()}}}function ro(){async function n(t){await io(t)}return{onCopy:n}}function so(n,t,e,o){const r=i.ref(14),s=i.ref(140),a=i.ref(""),u=i.ref(o.value.length),l=i.computed(()=>o.value),d=i.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function m(c){if(c.currentTarget){const g=c.currentTarget.value||"";u.value=g.length}}return()=>i.createVNode(i.Fragment,null,[i.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:s.value,onInput:c=>m(c)},[l.value]),i.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+s.value])])}function ao(n,t,e,o){const r=so(n,t,e,o),s=new Map([["text-area",r]]);function a(u){return s.get(u)||null}return{getEditorRender:a}}function lo(){const n=i.ref(!1),t=i.ref("复制成功");return{feedbackStyle:i.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:t,toShowFeedback:n}}function co(n,t){const e=t.getEditorRender(n.promptEditorType);return()=>e&&e()}function uo(n,t){function e(f){if(f==null)return 0;let p=0;for(let h=0;h<f.length;h++){const b=f.charCodeAt(h);b>=0&&b<=128?p++:p=p+2}return p}function o(f,p){if(f!==""&&f!==void 0&&f!==null){f=""+f;const h=f.length;let b="",w=0;for(let E=0;E<h;E++){const R=f.charAt(E);if(w++,encodeURI(R).length>4&&w++,b=b.concat(R),w>=p)return b=b.concat("..."),b}if(w<p)return f}return""}const r=i.computed(()=>!!n.value&&!!n.value.date),s=i.computed(()=>{const f=n.value&&n.value.date||"";return`${t.exception.happend} : ${f}`}),a=i.computed(()=>!!n.value&&!!n.value.detail),u=i.computed(()=>n.value?e(n.value.detail)>160:!1),l=i.ref(!1),d=i.computed(()=>l.value?t.exception.collapse:t.exception.expand),m=i.computed(()=>{const f=t.exception.detail+" : "+(n.value&&n.value.detail)||"";return l.value?f:o(f,160)}),c=i.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function g(){l.value=!l.value}return()=>i.createVNode("div",{class:"toast-msg-detail"},[r.value&&i.createVNode("div",null,[s.value]),a.value&&i.createVNode("div",{class:"exception_wrap"},[i.createVNode("div",{class:"exception_error_msg"},[i.createVNode("div",{innerHTML:m.value},null),u.value&&i.createVNode("span",{style:c.value,onClick:g},[d.value])])])])}function fo(n){return()=>i.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function po(n,t,e,o,r){const s=i.ref(n.exceptionInfo),a=i.computed(()=>{const p=t.value==="question"?"warning":t.value,h={"f-icon":!0},b=`f-icon-${p}`;return h[b]=!0,h}),u=i.computed(()=>e.value||s.value&&s.value.message),l=i.computed(()=>o.value),d=i.computed(()=>!!o.value),m=i.computed(()=>!!s.value);function c(){return m.value?uo(s,r):d.value?fo(l):()=>null}const g=c(),f=i.computed(()=>r.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"float-left modal-tips-iconwrap"},[i.createVNode("span",{class:a.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[i.createVNode("p",{class:"toast-msg-title",innerHTML:u.value,style:f.value},null),g()])])}function mo(n,t,e,o){const{onCopy:r}=t,{toShowFeedback:s}=e,a=i.ref(o.exception.copySuccess||"复制成功"),u=i.ref(o.exception.copy||"复制详细信息"),l=i.ref(n.exceptionInfo||{date:"",message:"",detail:""}),d=i.computed(()=>l.value&&l.value.detail||"");function m(c){r(d.value).catch(g=>{a.value=o.exception.copyFailed||"复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>i.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[i.createVNode("span",{onClick:m,style:"cursor: pointer;"},[u.value])])}function go(n,t,e,o,r){const s=i.ref(n.type),a=i.ref(n.buttons),u=i.ref(n.exceptionInfo),l=i.ref(r.ok||n.okButtonText),d=i.ref(r.cancel||n.cancelButtonText),m=i.ref(n.showCancelButton),c=i.ref(n.showOkButton),g=i.computed(()=>!!(a.value&&a.value.length)),f=i.computed(()=>u.value&&u.value.message&&u.value.detail),p=i.computed(()=>!(a.value&&a.value.length)&&(c.value||m.value)),h=mo(n,e,o,r);l.value==="关闭"?l.value=r.close:l.value==="知道了"&&(l.value=r.exception.roger);function b(E){s.value==="question"&&t.emit("reject"),t.emit("close")}function w(E){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>i.createVNode("div",{class:"modal-footer"},[f.value&&h(),p.value&&m.value&&i.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[d.value]),p.value&&c.value&&i.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:w},[l.value]),g.value&&a.value.length&&a.value.map(E=>i.createVNode("button",{type:"button",onClick:E.handle,class:E.class},[E.iconClass&&i.createVNode("span",{class:E.iconClass},null),E.text]))])}function ho(n){const{t,locale:e}=rt.useI18n();function o(r,s,a){return s===a?t(r):s}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:e.value}}const pt=i.defineComponent({name:"FMessageBox",props:to,emits:["accept","reject","close"],setup(n,t){const e=ho(n),o=i.ref(n.type),r=i.ref(n.title),s=i.ref(n.detail),a=i.computed(()=>{const w={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${o.value}`;return w[E]=!0,w}),u=i.computed(()=>{const w={cursor:"default"};return o.value==="prompt"?w.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(w.padding="0.5rem 1.5rem 1rem 1.5rem"),w}),l=ro(),d=ao(n,o,r,s),m=lo(),{feedbackStyle:c,feedbackMessage:g}=m;g.value=e.exception.copySuccess;function f(){return i.createVNode("div",{style:c.value},[g.value])}function p(){switch(o.value){case"prompt":return co(n,d);default:return po(n,o,r,s,e)}}const h=p(),b=go(n,t,l,m,e);return()=>i.createVNode("div",{class:"farris-messager"},[!n.exceptionInfo&&i.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),i.createVNode("section",{class:a.value,style:u.value},[h()]),b(),f()])}}),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:"关闭前回调"}},yo=new Map([["appearance",it.resolveAppearance]]);function bo(n,t,e){return t}function Co(){function n(t,e){const o={};return o.beforeClose=r=>e.call("beforeClose",[r,t]),o}return{resolve:n}}const _t={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"}},xo=it.createPropsResolver(_t,vo,yo,bo),wo=Co();class re{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const o=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new re(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new re(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let o=0;o<t.changedTouches.length;o++)if(t.changedTouches[o].target===e)return new re(t.changedTouches[o].clientX,t.changedTouches[o].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new re(0,0);if(window){const o=window.getComputedStyle(t);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);e.x=isNaN(r)?0:r,e.y=isNaN(s)?0:s}return e}return null}static copy(t){return new re(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class Oe{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new Oe(0,0);if(window){const o=window.getComputedStyle(t);return o&&(e.width=parseInt(o.getPropertyValue("width"),10),e.height=parseInt(o.getPropertyValue("height"),10)),e}return null}static copy(t){return new Oe(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function So(n,t){const e=i.ref(),o=i.ref(),r=i.ref(),s=i.ref(),a=i.ref(),u=i.ref(),l=i.ref(),d=i.ref(),m=i.ref(),c=i.ref(),g=i.ref(),f=i.ref(n.resizeable),p=i.ref(),h=i.ref(n.draggable),b=i.ref(!1);function w(){const N=o.value||document.body,B=window.getComputedStyle(N);if(!B||!e.value)return;const G=re.getTransformInfo(e.value),P={};l.value&&(P.deltaL=e.value.offsetLeft-l.value.x,P.deltaT=e.value.offsetTop-l.value.y);const K=B.getPropertyValue("position");P.width=N.clientWidth,P.height=N.clientHeight,P.pr=parseInt(B.getPropertyValue("padding-right"),10),P.pb=parseInt(B.getPropertyValue("padding-bottom"),10),P.position=B.getPropertyValue("position"),K==="static"&&(N.style.position="relative"),P.translateX=G.x,P.translateY=G.y,c.value=P}function E(N){if(e.value){s.value=Oe.getCurrent(e.value),a.value=re.getCurrent(e.value),u.value=s.value?Oe.copy(s.value):null,l.value=a.value?re.copy(a.value):null,w();const B=N.target.getAttribute("type")||"";d.value={n:!!B.match(/n/),s:!!B.match(/s/),w:!!B.match(/w/),e:!!B.match(/e/)}}}function R(){var N,B,G,P;if(e.value){const K=e.value;d.value&&((d.value.n||d.value.s)&&((N=u.value)!=null&&N.height)&&(K.style.height=u.value.height+"px"),(d.value.w||d.value.e)&&((B=u.value)!=null&&B.width)&&(K.style.width=u.value.width+"px"),l.value&&((G=l.value)!=null&&G.x&&(K.style.left=l.value.x+"px"),(P=l.value)!=null&&P.y&&(K.style.top=l.value.y+"px")))}}function j(){const N=n.minHeight?n.minHeight:1,B=n.minWidth?n.minWidth:1;u.value&&l.value&&d.value&&s.value&&(u.value.height<N&&(u.value.height=N,d.value.n&&a.value&&(l.value.y=a.value.y+(s.value.height-N))),u.value.width<B&&(u.value.width=B,d.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-B))),n.maxHeight&&u.value.height>n.maxHeight&&(u.value.height=n.maxHeight,a.value&&d.value.n&&(l.value.y=a.value.y+(s.value.height-n.maxHeight))),n.maxWidth&&u.value.width>n.maxWidth&&(u.value.width=n.maxWidth,d.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-n.maxWidth))))}function C(){if(o.value){const N=c.value;if(l.value&&u.value&&d.value&&s.value){const B=N.width-N.pr-N.deltaL-N.translateX-l.value.x,G=N.height-N.pb-N.deltaT-N.translateY-l.value.y;d.value.n&&l.value.y+N.translateY<0&&a.value&&(l.value.y=-N.translateY,u.value.height=s.value.height+a.value.y+N.translateY),d.value.w&&l.value.x+N.translateX<0&&a.value&&(l.value.x=-N.translateX,u.value.width=s.value.width+a.value.x+N.translateX),u.value.width>B&&(u.value.width=B),u.value.height>G&&(u.value.height=G)}}}function y(N){if(!r.value||!s.value||!a.value||!d.value)return;N.subtract(r.value);const B=N.x,G=N.y;d.value.n?(l.value.y=a.value.y+G,u.value.height=s.value.height-G):d.value.s&&(u.value.height=s.value.height+G),d.value.e?u.value.width=s.value.width+B:d.value.w&&(u.value.width=s.value.width-B,l.value.x=a.value.x+B),C(),j(),R()}function S(N){if(!m.value)return;const B=re.fromEvent(N);B&&y(B)}function A(){if(e.value){const{width:N,height:B,x:G,y:P}=e.value.getBoundingClientRect(),K=re.getTransformInfo(e.value);return{size:{width:N,height:B},position:{x:G-K.x,y:P-K.y}}}return null}function I(N){if(e.value){const B=A();g.value=B}r.value=void 0,s.value=null,a.value=null,u.value=null,l.value=null,d.value=null,m.value=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)}function $(){document.addEventListener("mousemove",S),document.addEventListener("mouseup",I)}function x(N){N instanceof MouseEvent&&N.button===2||h.value&&(document.body.click(),N.stopPropagation(),N.preventDefault(),r.value=re.fromEvent(N),m.value=N.target,E(N),$())}function D(N){return e.value=N,f.value&&i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:B=>x(B)},null)])}function L(N=!0){document.body.click();const B=o.value||document.body,G=Oe.getCurrent(B),P=e.value;N&&P&&(p.value=A(),p.value.transform=P.style.transform),G&&P&&(u.value=G,u.value.height-=14,u.value.width-=14,P.style.height=u.value.height+"px",P.style.width=u.value.width+"px",P.style.left="7px",P.style.top="7px",P.style.transform="",g.value={size:u.value,position:{x:0,y:0}},h.value=!1,b.value=!0)}function O(){var N,B;if(document.body.click(),p.value){const G={width:p.value.size.width||0,height:p.value.size.height||0},P={x:(window.innerWidth-G.width)/2,y:(window.innerHeight-G.height)/2};(N=u.value)==null||N.set(G),(B=l.value)==null||B.set(P);const K=e.value;K.style.height=G.height+"px",K.style.width=G.width+"px",K.style.left=`${P.x}px`,K.style.top=`${P.y}px`,K.style.transform="",g.value={size:G,position:P},h.value=n.draggable,b.value=!1}}function z(){if(e.value){const N=Oe.getCurrent(e.value);if(N){const{width:B,height:G}=N;e.value.style.left=`${(window.innerWidth-B)/2}px`,e.value.style.top=`${(window.innerHeight-G)/2}px`,e.value.style.transform=""}}}function Y(){const N=()=>{b.value?L(!1):z(),document.body.click()};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}}const se=Y();return{renderResizeBar:D,boundingElement:o,resizedEventParam:g,maximize:L,restore:O,allowDrag:h,isMaximized:b,unWindowResizeHandle:se,moveToCenter:z}}function Ao(n,t,e){const o=i.ref(),r=i.ref(n.draggable),s=i.ref(n.lockAxis),a=i.ref(),u=i.ref(),l=i.ref(!1),d=i.ref(new re(0,0)),m=i.ref(new re(0,0)),c=i.ref(new re(0,0)),g=i.ref(new re(0,0));i.watch(()=>e.value,S=>{a.value.style.cursor=S?"move":"default"});function f(S,A){if(A.tagName==="BUTTON")return!1;if(A===S)return!0;for(const I in A.children)if(Object.prototype.hasOwnProperty.call(A.children,I)&&f(S,A.children[I]))return!0;return!1}function p(){var $,x;let S=c.value.x+m.value.x,A=c.value.y+m.value.y;s.value==="x"?(S=(($=d.value)==null?void 0:$.x)||0,c.value.x=0):s.value==="y"&&(A=((x=d.value)==null?void 0:x.y)||0,c.value.y=0);const I=`translate3d(${Math.round(S)}px, ${Math.round(A)}px, 0px)`;o.value&&(o.value.style.transform=I),g.value.x=S,g.value.y=A}function h(){if(!u.value||!o.value)return null;const S=u.value.getBoundingClientRect(),A=o.value.getBoundingClientRect(),I={top:S.top<A.top,right:S.right>A.right,bottom:S.bottom>A.bottom,left:S.left<A.left};return I.top||(c.value.y-=A.top-S.top),I.bottom||(c.value.y-=A.bottom-S.bottom),I.right||(c.value.x-=A.right-S.right),I.left||(c.value.x-=A.left-S.left),p(),I}function b(S){S&&(d.value&&S.subtract(d.value),c.value.set(S),p(),h())}function w(S){l.value&&r.value&&(S.stopPropagation(),S.preventDefault(),b(re.fromEvent(S,a.value)))}function E(){var S;l.value&&(l.value=!1,m.value.add(c.value),c.value.reset(),(S=o.value)==null||S.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E))}function R(){!l.value&&a.value&&(l.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",w),document.addEventListener("mouseup",E))}function j(){if(o.value){const S=re.getTransformInfo(o.value);m.value.set(S);return}m.value.reset()}function C(S){if(!e.value||S instanceof MouseEvent&&S.button===2)return;const A=S.target||S.srcElement;a.value!==void 0&&A&&!f(A,a.value)||r.value!==!1&&(document.body.click(),S.stopPropagation(),S.preventDefault(),d.value=re.fromEvent(S,o.value),j(),R())}function y(S,A,I){if(r.value&&A){if(S)a.value=S;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)a.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const $=A.querySelector(n.dragHandle);$&&(a.value=$)}}o.value=A,u.value=I,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",C)):r.value=!1}}return{registerDraggle:y,resetTranslate:j}}function Xt(n,t){if(n){const e=o=>{o.key.toLowerCase()===n.toLowerCase()&&t({event:o,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function To(n,t){const e=i.ref(n.enableEsc);let o=null;return e.value?(o=Xt("Escape",r=>{t.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Eo(n,t){const e=i.ref(n.enableEnter);let o=null;return e.value?(o=Xt("Enter",r=>{t.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const qe=i.defineComponent({name:"FModal",props:_t,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,t){const e=i.ref(n.width||300),o=i.ref(n.height||200),r=i.ref(n.modelValue),s=i.ref(""),a=i.ref(n.class),u=i.ref(n.fitContent),l=i.ref(n.showHeader),d=i.ref(""),m=i.ref(n.showCloseButton),c=i.ref(n.showMaxButton),g=i.ref(!1),f=i.ref(n.dialogType),p=i.ref(n.src),h=i.ref(""),b=i.ref(n.showButtons),w=i.ref(n.title),E=i.ref(n.containment||null),R=i.ref(),{t:j}=rt.useI18n();w.value==="错误提示"&&(w.value=j("messageBox.errorTitle"));const C=i.ref(!1);function y(T,_){const le=_?"accept":"cancel";Promise.resolve().then(()=>{var de;return(de=n.beforeClose)==null?void 0:de.call(n,{closeType:le})}).then(de=>{de&&(r.value=!1,t.emit("update:modelValue",!1),_!=null&&t.emit(_?"accept":"cancel"),t.emit("closed",T))})}const S=[{name:"cancel",text:j("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:T=>{y(T,!1)}},{name:"accept",text:j("messageBox.ok")||"确定",class:"btn btn-primary",handle:T=>{y(T,!0)}}],A=i.ref(n.buttons&&n.buttons.length?n.buttons:S),I=i.computed(()=>!!d.value),$=i.computed(()=>!!b.value&&!!A.value),x=i.ref(),D=i.ref(),L=i.ref(!1),{renderResizeBar:O,maximize:z,restore:Y,boundingElement:se,resizedEventParam:N,allowDrag:B,unWindowResizeHandle:G,moveToCenter:P}=So(n),{registerDraggle:K}=Ao(n,t,B);function he(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ve(){const T=document.querySelectorAll(".farris-modal").length;(!T||T-1<=0)&&document.body.classList.remove("modal-open"),R.value&&R.value.classList.remove("show")}i.watch(()=>n.title,(T,_)=>{T!==_&&(w.value=T)}),i.watch(()=>n.modelValue,(T,_)=>{T!==_&&(r.value=T,r.value&&n.draggable&&i.nextTick(()=>{D.value&&!E.value&&(E.value=D.value.parentElement,se.value=E.value,K(x.value,D.value,se.value),P())}),T||(E.value&&(E.value=null),ve())),r.value?C.value=he():(L.value=!1,B.value=n.draggable)}),i.watch(()=>n.showHeader,(T,_)=>{T!==_&&(l.value=T)}),i.watch(()=>n.showButtons,(T,_)=>{T!==_&&(b.value=T)}),i.watch(()=>N.value,(T,_)=>{const le=T||{},de=_||{};JSON.stringify(le)!==JSON.stringify(de)&&t.emit("resize",{newSize:T,oldSize:_,isMaximized:L.value})});const Q=i.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),oe=i.computed(()=>{var le;const T={modal:!0,"farris-modal":!0,fade:!0};T["f-modal-fitContent"]=!!u.value,T.show=!!Q.value;const _=(le=n.maskClass)==null?void 0:le.split(" ");return _==null||_.reduce((de,Be)=>(de[Be]=!0,de),T),T}),ce=i.computed(()=>{var le;const T={"modal-dialog":!0},_=(le=a.value)==null?void 0:le.split(" ");return _==null||_.reduce((de,Be)=>(de[Be]=!0,de),T),T}),ee=i.computed(()=>{const T={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:u.value?"auto":`${o.value}px`};return n.mask||(T.pointerEvents="auto"),T}),q=()=>we.getMaxZIndex()||1040,te=i.computed(()=>{const T={display:"block",zIndex:q()};return n.mask||(T.pointerEvents="none",T.backgroundColor="transparent"),C.value&&(T.backgroundColor="transparent"),T}),$e=i.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Ne=i.computed(()=>{const T={display:l.value?"":"none"};return T["pointer-events"]=B.value?"auto":"none",T}),Te=i.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:L.value})),Ge=i.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function He(){return{height:`${n.footerHeight||60}px`}}const Qe=i.computed(()=>{const T={textAlgin:h.value},_=He();return Object.assign(T,_)});function ae(T){if(T==null||T.stopPropagation(),L.value){L.value=!1,Y();return}z(),L.value=!0}async function Je(T,_){T.handle&&await T.handle(_,T)&&t.emit("closed",_)}function ke(T){T.width&&(e.value=T.width),T.height&&(o.value=T.height),T.buttons&&(A.value=T.buttons),T.title&&(w.value=T.title)}let Ve=null,Ee=null;i.onBeforeMount(()=>{C.value=he()}),i.onMounted(()=>{D.value&&!E.value&&(E.value=D.value.parentElement,se.value=E.value,K(x.value,D.value,se.value)),Q.value&&document.body.classList.add("modal-open"),Ve=To(n,t),Ee=Eo(n,t)}),i.onUnmounted(()=>{G&&G(),Ve&&Ve.remove(),Ee&&Ee.remove()}),t.expose({modalElementRef:D,updateModalOptions:ke,close:y,maxDialog:ae,isMaximized:L});function Pe(){return i.createVNode("ul",null,[g.value&&i.createVNode("li",{class:"f-btn-icon f-bare"},[i.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&i.createVNode("li",{onClick:ae,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[i.createVNode("span",{class:Te.value},null)]),m.value&&i.createVNode("li",{class:"f-btn-icon f-bare",onClick:T=>y(T,!1),style:"pointer-events: auto;"},[i.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return i.createVNode("div",{class:"modal-footer",style:Qe.value},[A.value&&A.value.map(T=>{const _=i.ref(T.disabled);return i.createVNode("button",{name:T.name,type:"button",disabled:_.value,class:T.class+(T.iconClass?" btn-icontext":""),onClick:le=>{Je(T,le)}},[!!T.iconClass&&i.createVNode("i",{class:T.iconClass},null),T.text])})])}function Le(){return i.createVNode("div",{ref:x,class:"modal-header",style:Ne.value},[t.slots.headerTemplate?t.slots.headerTemplate():i.createVNode("div",{class:"modal-title"},[I.value&&i.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),i.createVNode("span",{class:"modal-title-label"},[w.value])]),i.createVNode("div",{class:"actions"},[Pe()])])}function Me(){return t.slots.footerTemplate?t.slots.footerTemplate():$.value&&Ke()}function Re(T){if(T.stopPropagation(),n.allowClickMaskToClose){if(T.target!==R.value)return;y(T,!1)}}function _e(){var T,_;return i.createVNode("div",{id:s.value,class:ce.value,style:ee.value,ref:D},[i.createVNode("div",{class:$e.value},[l.value&&Le(),i.createVNode("div",{class:Ge.value},[(_=(T=t.slots).default)==null?void 0:_.call(T),f.value==="iframe"&&i.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Me()]),!u.value&&D.value&&!L.value&&O(D.value)])}function Xe(T){return T||"body"}return()=>i.createVNode(i.Teleport,{to:Xe(n.host)},{default:()=>[Q.value&&i.createVNode(i.Transition,{name:"fade",appear:!0},{default:()=>[i.createVNode("div",{ref:R,class:oe.value,style:te.value,onClick:Re},[_e()])]})]})}});function Yt(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Io(n){const t=document.createElement("div");t.style.display="contents";const e=i.createApp({setup(o,r){i.onUnmounted(()=>{document.body.removeChild(t)});const s=i.ref(),a=i.ref(n.class||""),u=i.ref(!!n.showButtons),l=i.ref(!!n.showHeader),d=i.ref(n.showCloseButton==null?!0:n.showCloseButton),m=i.ref(!0),c=i.ref(n.title||""),g=n.acceptCallback||(()=>{}),f=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),h=n.resizeHandle||(R=>{}),b=n.stopMoveHandle||(R=>{}),w=Yt(n),E=R=>{m.value=!1,e.unmount(),p(R)};return i.onMounted(()=>{}),r.expose({modalRef:s}),()=>i.createVNode(qe,{ref:s,class:a.value,modelValue:m.value,"onUpdate:modelValue":R=>m.value=R,title:c.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":d.value,"show-max-button":!1,onAccept:g,onCancel:f,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:E,onResize:h,onStopMove:b},{default:()=>[w&&w(e)]})}});return document.body.appendChild(t),e.use(st.LocaleService.i18n),e.mount(t),e}class Zt{constructor(t){U(this,"appContext",null);U(this,"modalRef",i.ref());U(this,"activeModalIndex",i.ref(0));U(this,"modalRefs",{});U(this,"isUseEscCloseModal",i.ref(!1));U(this,"activeModalInstance",i.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,e){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<t&&(t=o-14),r<e&&(e=r-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return Io(e)}close(t){var e,o;t?(o=t.value)==null||o.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const o=i.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),r=i.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((C,y)=>{}),l=o.value.resizeHandle||(C=>{}),d=t.stopMoveHandle||(C=>{});let m;const c=Yt(o.value),g=C=>{var S;r.value=!1;const y=(S=C==null?void 0:C.target)==null?void 0:S.classList.contains("modal_close");u(C,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},f=C=>{g(C),m&&i.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],i.render(null,e),m=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(S=>Number(S));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=C=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(C==null?void 0:C.event))},{width:h,height:b}=o.value,w=this.adaptToWindow(h||500,b||320);Object.assign(o.value,w);const E=()=>i.createVNode(qe,i.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":C=>r.value=C},o.value,{onAccept:s,onCancel:a,onClosed:f,onResize:l,onEsc:p,onStopMove:d}),{default:()=>[c&&c(this.app)]});return m=(C=>{const y=i.h(E,C);return y.appContext=this.appContext,i.render(y,e),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:C=>{o.value={...o.value,...C},m&&i.render(i.cloneVNode(m,{...o}),e)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Fo=Symbol("FModalService");qe.install=n=>{n.component(qe.name,qe);const t=new Zt(n);n.provide(Fo,t),n.provide("FModalService",t)},qe.register=(n,t,e,o)=>{n.modal=qe,t.modal=xo,o.modal={callbackResolver:wo}};const Ae=class Ae{static show(t){const e=i.reactive({...t}),o=!1,r=e.type==="error"||e.type==="prompt",s=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",a=e.acceptCallback||(()=>{}),u=e.rejectCallback||(()=>{});let l=null,d=new Zt(Ae.app);const m=()=>{l&&(l==null||l.destroy(),d=null)};return l=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>i.createVNode(pt,i.mergeProps(e,{onAccept:a,onReject:u,onClose:m}),null)}),d==null?void 0:d.getCurrentModal()}static info(t,e){const o=i.reactive({type:"info",title:t,detail:e,okButtonText:"知道了",showCancelButton:!1});Ae.show(o)}static warning(t,e){const o=i.reactive({type:"warning",title:t,detail:e,okButtonText:"知道了",showCancelButton:!1});Ae.show(o)}static success(t,e){const o=i.reactive({type:"success",title:t,detail:e,okButtonText:"关闭",showCancelButton:!1});Ae.show(o)}static error(t,e,o){const r=i.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:t,detail:e}});Ae.show(r)}static prompt(t,e){const o=i.reactive({type:"prompt",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消"});Ae.show(o)}static question(t,e,o,r){const s=i.reactive({type:"question",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Ae.show(s)}};U(Ae,"app",null);let mt=Ae;pt.install=n=>{n.component(pt.name,pt),mt.app=n,n.provide("FMessageBoxService",mt)};class Mo extends Pn{constructor(e,o){super(e,o);U(this,"responseLayoutEditorFunction");U(this,"bindingVarible");U(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=On(this.formSchemaUtils)}getCommonPropertyConfig(e,o,r="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(e,o,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,o),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group")}getPropertyConfig(e,o){return this.getCommonPropertyConfig(e,o,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(e,o){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,o,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,o,r="Card"){const s=this;this.setDesignViewModelField(e);const{canChangeControlType:a,editorTypeList:u}=this.getAvailableEditorType(e),l={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:u,readonly:!a}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(d,m,c){if(d)switch(d&&d.propertyID){case"type":{s.changeControlType(e,d,o);break}case"label":{d.needRefreshControlTree=!0;break}case"binding":{s.changeBindingField(e,d,c);break}}}};return r.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(e,o){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==we.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var s;const o=this.checkCanChangeControlType(e,this.viewModelId);if(!o)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((s=M[e.editor.type])==null?void 0:s.name)||e.editor.type}]};let r=[];return this.designViewModelField&&this.designViewModelField.$type===we.FormSchemaEntityField$Type.SimpleField?r=ct.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(r=ct.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:o,editorTypeList:r}}changeBindingField(e,o,r){o.needRefreshEntityTree=!0}getAppearanceProperties(e,o){const r=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,r.componentId)}}},setPropertyRelates(s,a){if(s)switch(s&&s.propertyID){case"responseLayout":r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(s.propertyValue,r.componentId||e.id),r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId),r.updateElementByParentContainer(e.id,o),delete e.responseLayout;break;case"class":r.updateUnifiedLayoutAfterControlChanged(s.propertyValue,e.id,this.componentId),lt.value++;break;case"style":{lt.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,o,r){const s=o.propertyValue,a=r&&r.parent&&r.parent.schema;if(!a)return;const u=a.contents.findIndex(m=>m.id===e.id);if(u===-1)return;const l=a.contents[u];let d;if(this.designViewModelField){const g=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};g.editor||(g.editor={}),g.editor.$type=s,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,g,!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,s)}d||(d=this.controlCreatorUtils.createFormGroupWithoutField(s)),Object.assign(d,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(d,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(m=>{Object.prototype.hasOwnProperty.call(l.editor,m)&&(d.editor[m]=l.editor[m])}),r!=null&&r.updateContextSchema?r.updateContextSchema(d):(r.schema=Object.assign(l,d),Object.assign(e,d)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(m=>m.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(m=>m.classList.remove("dgComponentFocused")),lt.value++,i.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,o={},r={},s){var g;const a=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},o),u=(g=e.binding)!=null&&g.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(e,u,"readonly"),d=this.getPropertyEditorParams(e,u,"required"),m={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:d},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const f in r)m[f]=Object.assign(m[f]||{},r[f]);const c=this;return{...a,properties:{...m},setPropertyRelates(f,p){if(f){switch(f.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(e,f);break}s&&s.bind(c)(f,e,p)}}}}updateUnifiedLayoutAfterControlChanged(e,o,r){const s=e.split(" ");let a=s.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),u=s.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=s.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),d=s.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));a=a||"col-12",u=u||"col-md-"+a.replace("col-",""),l=l||"col-xl-"+u.replace("col-md-",""),d=d||"col-el-"+l.replace("col-xl-","");const m={id:o,columnInSM:parseInt(a.replace("col-",""),10),columnInMD:parseInt(u.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(r,m)}updateUnifiedLayoutAfterResponseLayoutChanged(e,o){const{formNode:r}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!r||!r.unifiedLayout)return;const s=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,s,1),o){const p=s.find(h=>h.id===o.id);Object.assign(p||{},o)}const a=s.map(p=>p.columnInSM),u=s.map(p=>p.columnInMD),l=s.map(p=>p.columnInLG),d=s.map(p=>p.columnInEL),m=this.checkIsUniqueColumn(a)?a[0]:null,c=this.checkIsUniqueColumn(u)?u[0]:null,g=this.checkIsUniqueColumn(l)?l[0]:null,f=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(r.unifiedLayout,{uniqueColClassInSM:m,uniqueColClassInMD:c,uniqueColClassInLG:g,uniqueColClassInEL:f})}checkIsUniqueColumn(e){const o=new Set(e);return Array.from(o).length===1}getItemCollectionEditor(e,o,r){return o=o||"value",r=r||"name",{editor:{columns:[{field:o,title:"值",dataType:"string"},{field:r,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:o,nameField:r,requiredFields:[o,r],uniqueFields:[o,r],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===we.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,o){e.binding&&e.binding.type===dt.Form&&e.binding.field?(o.find(a=>a.label==="fieldValueChanging")||o.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),o.find(a=>a.label==="fieldValueChanged")||o.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):o=o.filter(r=>r.label!=="fieldValueChanging"&&r.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case dt.Form:return e.binding.path||e.type;case dt.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,o="card",r,s){const a=this;let u=[];r&&(u=u.concat(r)),this.appendFieldValueChangeEvents(e,u);const l=a.eventsEditorUtils.formProperties(e,a.viewModelId,u);return{title:"事件",hideTitle:!0,properties:a.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,g){const f=c.propertyValue;delete e[a.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,f.controlInfo={type:a.getControlMethodType(e),name:e.title},a.eventsEditorUtils.saveRelatedParameters(e,a.viewModelId,f.events,f)),s&&s(c,g,f);const p=a.designViewModelUtils.getDgViewModel(a.viewModelId);p&&a.designViewModelField&&p.changeField(a.designViewModelField.id,{valueChanging:e.fieldValueChanging,valueChanged:e.fieldValueChanged})}}}getExpressionConfig(e,o,r=["compute","dependency","validate"],s){return new Wt(this.formSchemaUtils).getExpressionConfig(e,o,r,s)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,o,r){var s;e.editor[o]!==r?e.editor[o]=r:(s=this.getFormDesignerInstance())==null||s.reloadPropertyPanel()}setBooleanValue(e,o,r){let s=r;this.getBindingDataType()==="string"&&(s=(s||"").trim()||(o==="trueValue"?"true":"false"));const u=o==="trueValue"?"falseValue":"trueValue";e.editor[u]===s&&(s=s+1),this.updatePropertyValue(e,o,s)}getBooleanValueConverter(){return{convertFrom:(e,o)=>e.editor[o],convertTo:(e,o,r)=>{this.setBooleanValue(e,o,r)}}}}class Bo extends Mo{constructor(t,e){super(t,e)}getEditorProperties(t){return{description:"编辑器",title:"编辑器",type:"avatar",$converter:"/converter/property-editor.converter",parentPropertyID:"editor",properties:{readonly:{description:"",title:"只读",type:"boolean"},avatarWidth:{description:"",title:"头像宽度",type:"number"},avatarHeight:{description:"",title:"头像高度",type:"number"},cover:{description:"",title:"封面",type:"string"}}}}}function jo(n,t){const e=n.schema;function o(r,s){return new Bo(r,t).getPropertyConfig(e,s)}return{getPropsConfig:o}}const No=i.defineComponent({name:"FAvatarDesign",props:at,emits:["change","update:modelValue"],setup(n,t){const e=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),s=jo(r,o),a=vt.useDesignerComponent(e,r,s);i.onMounted(()=>{e.value.componentInstance=a}),t.expose(a.value);const u=i.computed(()=>({"f-avatar":!0,"f-avatar-readonly":n.readonly,"f-avatar-circle":n.shape==="circle","f-avatar-square":n.shape==="square"})),l=i.ref(n.modelValue),d=i.computed(()=>({width:n.avatarWidth+"px",height:n.avatarHeight+"px"})),m=!1;function c(){return""}function g(){}const f=i.ref(null),{acceptTypes:p,imageSource:h,onClickImage:b}=Ut(n,t,f,l);return()=>i.createVNode("div",{ref:e,class:u.value,style:d.value,onClick:b},[m,i.createVNode("img",{title:n.title,class:"f-avatar-image",src:h.value,onError:c},null),!n.readonly&&i.createVNode("div",{class:"f-avatar-icon"},[i.createVNode("span",{class:"f-icon f-icon-camera"},null)]),i.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:p.value,onChange:g,style:"display: none;"},null)])}});Ze.register=(n,t,e,o)=>{n.avatar=Ze,t.avatar=yt},Ze.registerDesigner=(n,t,e)=>{n.avatar=No,t.avatar=yt};const ko=we.withInstall(Ze);ne.FAvatar=Ze,ne.avatarProps=at,ne.default=ko,ne.propsResolver=yt,Object.defineProperties(ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(ne,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../dynamic-resolver/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../locale/index.umd.js"),require("@vueuse/core"),require("../data-view/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","../dynamic-resolver/index.umd.js","vue-i18n","../designer-canvas/index.umd.js","../common/index.umd.js","../locale/index.umd.js","@vueuse/core","../data-view/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"],i):(ne=typeof globalThis<"u"?globalThis:ne||self,i(ne.avatar={},ne.Vue,ne.LodashES,ne.dynamicResolver,ne.vueI18n,ne.designerCanvas,ne.common,ne.locale,ne.VueUseCore,ne.dataView))})(this,function(ne,i,ie,it,rt,vt,we,st,tn,X){"use strict";var zo=Object.defineProperty;var Uo=(ne,i,ie)=>i in ne?zo(ne,i,{enumerable:!0,configurable:!0,writable:!0,value:ie}):ne[i]=ie;var U=(ne,i,ie)=>Uo(ne,typeof i!="symbol"?i+"":i,ie);function Vt(n,t){let e;function o(c){const{properties:g,title:f,ignore:p}=c,h=p&&Array.isArray(p),b=Object.keys(g).reduce((w,E)=>((!h||!p.find(R=>R===E))&&(w[E]=g[E].type==="object"&&g[E].properties?o(g[E]):ie.cloneDeep(g[E].default)),w),{});if(f&&(!h||!p.find(w=>w==="id"))){const w=f.toLowerCase().replace(/-/g,"_");b.id=`${w}_${Math.random().toString().slice(2,6)}`}return b}function r(c){const{properties:g,title:f,required:p}=c;if(p&&Array.isArray(p)){const h=p.reduce((b,w)=>(b[w]=g[w].type==="object"&&g[w].properties?o(g[w]):ie.cloneDeep(g[w].default),b),{});if(f&&p.find(b=>b==="id")){const b=f.toLowerCase().replace(/-/g,"_");h.id=`${b}_${Math.random().toString().slice(2,6)}`}return h}return{type:f}}function s(c,g={},f){const p=n[c];if(p){let h=r(p);const b=t[c];return h=b?b({getSchemaByType:s},h,g,f):h,e!=null&&e.appendIdentifyForNewControl&&e.appendIdentifyForNewControl(h),h}return null}function a(c,g){const f=o(g);return Object.keys(f).reduce((p,h)=>(Object.prototype.hasOwnProperty.call(c,h)&&(p[h]&&ie.isPlainObject(p[h])&&ie.isPlainObject(c[h]||!c[h])?Object.assign(p[h],c[h]||{}):p[h]=c[h]),p),f),f}function u(c,g){return Object.keys(c).filter(p=>c[p]!=null).reduce((p,h)=>{if(g.has(h)){const b=g.get(h);if(typeof b=="string")p[b]=c[h];else{const w=b(h,c[h],c);Object.assign(p,w)}}else p[h]=c[h];return p},{})}function l(c,g,f=new Map){const p=a(c,g);return u(p,f)}function d(c){var f;const g=c.type;if(g){const p=n[g];if(!p)return c;const h=a(c,p),b=((f=c.editor)==null?void 0:f.type)||"";if(b){const w=n[b],E=a(c.editor,w);h.editor=E}return h}return c}function m(c){e=c}return{getSchemaByType:s,resolveSchemaWithDefaultValue:d,resolveSchemaToProps:l,mappingSchemaToProps:u,setDesignerContext:m}}const Pt={},Rt={},{getSchemaByType:Wo,resolveSchemaWithDefaultValue:nn,resolveSchemaToProps:on,mappingSchemaToProps:rn,setDesignerContext:Go}=Vt(Pt,Rt);function sn(n={}){function t(d,m,c,g){if(typeof c=="number")return g[d].length===c;if(typeof c=="object"){const f=Object.keys(c)[0],p=c[f];if(f==="not")return Number(g[d].length)!==Number(p);if(f==="moreThan")return Number(g[d].length)>=Number(p);if(f==="lessThan")return Number(g[d].length)<=Number(p)}return!1}function e(d,m,c,g){return g[d]&&g[d].propertyValue&&String(g[d].propertyValue.value)===String(c)}const o=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((d,m)=>(d.set(m,n[m]),d),o);function r(d,m){const c=d;return typeof m=="number"?[{target:c,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:c,operator:"getProperty",param:d,value:!!m}]:typeof m=="object"?Object.keys(m).map(g=>{if(g==="length")return{target:c,operator:"length",param:null,value:m[g]};const f=g,p=m[g];return{target:c,operator:"getProperty",param:f,value:p}}):[]}function s(d){return Object.keys(d).reduce((c,g)=>{const f=r(g,d[g]);return c.push(...f),c},[])}function a(d,m){if(o.has(d.operator)){const c=o.get(d.operator);return c&&c(d.target,d.param,d.value,m)||!1}return!1}function u(d,m){return s(d).reduce((f,p)=>f&&a(p,m),!0)}function l(d,m){const c=Object.keys(d),g=c.includes("allOf"),f=c.includes("anyOf"),p=g||f,w=(p?d[p?g?"allOf":"anyOf":"allOf"]:[d]).map(R=>u(R,m));return g?!w.includes(!1):w.includes(!0)}return{parseValueSchema:l}}const an={convertTo:(n,t,e,o)=>{n.appearance||(n.appearance={}),n.appearance[t]=e},convertFrom:(n,t,e)=>n.appearance?n.appearance[t]:n[t]},ln={convertFrom:(n,t,e)=>n.buttons&&n.buttons.length?`共 ${n.buttons.length} 项`:"无"},cn={convertTo:(n,t,e,o)=>{n.editor&&(n.editor[t]=e)},convertFrom:(n,t,e)=>n.editor&&Object.prototype.hasOwnProperty.call(n.editor,t)?n.editor[t]:n[t]},M={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:"多语输入框"}},dn={convertFrom:(n,t,e)=>{var r;const o=n.editor&&n.editor[t]?n.editor[t]:n[t];return((r=M[o])==null?void 0:r.name)||o}},un={convertTo:(n,t,e,o)=>{n[t]=n[t]},convertFrom:(n,t,e)=>n.editor?e.getRealEditorType(n.editor.type):""},fn={convertTo:(n,t,e,o)=>{(n.type==="data-grid-column"||n.type==="tree-grid-column")&&(n.formatter?n.formatter[t]=e:n.formatter={[t]:e})},convertFrom:(n,t,e)=>{if(n.formatter){if(t==="trueText")return n.formatter.trueText;if(t==="falseText")return n.formatter.falseText;if(t==="prefix")return n.formatter.prefix;if(t==="suffix")return n.formatter.suffix;if(t==="precision")return n.formatter.precision;if(t==="decimal")return n.formatter.decimal;if(t==="thousand")return n.formatter.thousand;if(t==="dateFormat")return n.formatter.dateFormat||"yyyy-MM-dd";if(t==="customFormat")return n.formatter.customFormat;if(t==="type")return n.formatter.type||"none"}return"none"}},pn={convertTo:(n,t,e,o)=>{n.command?n.command[t]=e:n.command={[t]:e},t==="enable"&&e&&(n.command.commands||(n.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(n,t,e)=>n.command&&t==="enable"?n.command.enable:""},mn={convertTo:(n,t,e,o)=>{n.column?n.column[t]=e:n.column={[t]:e},t==="fitColumns"&&e&&(n.column.fitMode||(n.column.fitMode="average"))},convertFrom:(n,t,e)=>{if(n.column){if(t==="fitColumns")return n.column.fitColumns;if(t==="fitMode")return n.column.fitMode}return""}},gn={convertTo:(n,t,e,o)=>{n.summary?n.summary[t]=e:n.summary={[t]:e},t==="enable"&&e&&(n.summary?n.summary.groupFields||(n.summary.groupFields=[]):n.summary={enable:e,groupFields:[]})},convertFrom:(n,t,e)=>n.summary&&t==="enable"?n.summary.enable:n.type==="data-grid-column"?n.enableSummary===void 0?!1:n.enableSummary:""},hn={convertTo:(n,t,e,o)=>{n.group?n.group[t]=e:n.group={[t]:e},t==="enable"&&e&&(n.group?n.group.groupFields||(n.group.groupFields=[]):n.group={enable:e,groupFields:[],showSummary:!1})},convertFrom:(n,t,e)=>{if(n.group){if(t==="enable")return n.group.enable;if(t==="showSummary")return n.group.showSummary}}},vn={convertFrom:(n,t)=>n.binding?n.binding.path:"",convertTo:(n,t,e)=>{if(e&&e.length>0){const o=e[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}}},yn={convertTo:(n,t,e,o)=>{n.pagination||(n.pagination={}),n.pagination[t]=e},convertFrom:(n,t,e)=>n.pagination?n.pagination[t]:n[t]},bn={convertTo:(n,t,e,o)=>{n.rowNumber||(n.rowNumber={}),n.rowNumber[t]=e},convertFrom:(n,t,e)=>n.rowNumber?n.rowNumber[t]:n[t]},Cn={convertTo:(n,t,e,o)=>{n.selection||(n.selection={}),n.selection[t]=e},convertFrom:(n,t,e)=>{var o,r;return t==="showCheckbox"?(o=n.selection)!=null&&o.multiSelect?!0:(r=n.selection)==null?void 0:r.showCheckbox:n.selection?n.selection[t]:n[t]}},xn={convertFrom:(n,t,e)=>n[t]&&n[t].length?`共 ${n[t].length} 项`:""},wn={convertFrom:(n,t)=>n[t]||"",convertTo:(n,t,e)=>{n[t]=e}},Sn={convertTo:(n,t,e,o)=>{n.size||(n.size={}),n.size[t]=e},convertFrom:(n,t,e)=>n.size?n.size[t]:n[t]},An={convertFrom:(n,t,e)=>{var o,r;return(o=n.formatter)!=null&&o.data&&t==="formatterEnumData"&&!n.formatterEnumData?(r=n.formatter)==null?void 0:r.data:n.formatterEnumData}},Tn={convertTo:(n,t,e,o)=>{n.sort||(n.sort={}),n.sort[t]=e},convertFrom:(n,t,e)=>{var o,r;if(t==="mode")return((o=n.sort)==null?void 0:o.mode)||"client";if(t==="multiSort")return!!((r=n.sort)!=null&&r.multiSort)}},En={convertTo:(n,t,e,o)=>{n.filter||(n.filter={}),n.filter[t]=e},convertFrom:(n,t,e)=>{var o;if(t==="mode")return((o=n.filter)==null?void 0:o.mode)||"client"}},In={convertTo:(n,t,e,o)=>{n.rowOption?n.rowOption[t]=e:n.rowOption={[t]:e}},convertFrom:(n,t,e)=>{if(n.rowOption){if(t==="customRowStyle")return n.rowOption.customRowStyle;if(t==="customCellStyle")return n.rowOption.customCellStyle}return""}};function Ot(n,t,e){const o=new Map([["/converter/appearance.converter",an],["/converter/buttons.converter",ln],["/converter/property-editor.converter",cn],["/converter/items-count.converter",xn],["/converter/type.converter",dn],["/converter/change-editor.converter",un],["/converter/change-formatter.converter",fn],["/converter/column-command.converter",pn],["/converter/column-option.converter",mn],["/converter/summary.converter",gn],["/converter/group.converter",hn],["/converter/form-group-label.converter",wn],["/converter/field-selector.converter",vn],["/converter/pagination.converter",yn],["/converter/row-number.converter",bn],["/converter/grid-selection.converter",Cn],["/converter/size.converter",Sn],["/converter/change-formatter-enum.converter",An],["/converter/grid-sort.converter",Tn],["/converter/grid-filter.converter",En],["/converter/row-option.converter",In]]),r=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}]]),s=sn();function a(p,h){return()=>s.parseValueSchema(p,h)}function u(p,h,b){return p.includes("visible")&&h.visible!==void 0?typeof h.visible=="boolean"?()=>!!h.visible:h.visible===void 0?!0:a(h.visible,b):()=>!0}function l(p,h,b){return p.includes("readonly")&&h.readonly!==void 0?typeof h.readonly=="boolean"?()=>!!h.readonly:a(h.readonly,b):()=>!1}function d(p,h){const b=p.$converter||h;return typeof b=="string"&&b&&o.has(b)?o.get(b)||null:b||null}function m(p,h,b,w,E,R="",j=""){return Object.keys(p).map(y=>{const S=i.ref(1),A=y,I=p[y],$=Object.keys(I),x=I.title,D=I.type,L=r.get(D)||{type:"input-group",enableClear:!1},O=I.editor?Object.assign({},L,I.editor):Object.assign({},L),z=u($,I,h),Y=l($,I,h);O.readonly=O.readonly===void 0?Y():O.readonly;const se=I.type==="cascade"?m(I.properties,h,b,w,E,R,j):[],N=!0;let B=d(I,j);const G=i.computed({get(){if(S.value){if(["class","style"].find(ce=>ce===A)&&!B&&(B=o.get("/converter/appearance.converter")||null),B&&B.convertFrom)return B.convertFrom(b,y,E,R);const oe=b[y];return Object.prototype.hasOwnProperty.call(I,"defaultValue")&&(oe===void 0||typeof oe=="string"&&oe==="")?I.type==="boolean"?I.defaultValue:I.defaultValue||"":oe}return null},set(oe){S.value+=1,B&&B.convertTo?(B.convertTo(w,y,oe,E,R),B.convertTo(b,y,oe,E,R)):(w[y]=oe,b[y]=oe)}}),{refreshPanelAfterChanged:P,description:K,isExpand:he,parentPropertyID:ve}=I,Q={propertyID:A,propertyName:x,propertyType:D,propertyValue:G,editor:O,visible:z,readonly:Y,cascadeConfig:se,hideCascadeTitle:N,refreshPanelAfterChanged:P,description:K,isExpand:he,parentPropertyID:ve};return h[A]=Q,Q})}function c(p,h,b={}){const w={},E=n[p];return E&&E.categories?Object.keys(E.categories).map(j=>{const C=E.categories[j],y=C==null?void 0:C.title,S=m(C.properties||{},w,{},b,h);return{categoryId:j,categoryName:y,properties:S}}):[]}function g(p,h,b,w,E=""){const R=h.$ref.schema,j=h.$ref.converter,C=b[R],y=C.type,S=e(C),A={},I=n[y];if(I&&I.categories){const $=I.categories[p],x=$==null?void 0:$.title;j&&Object.keys($.properties).forEach(O=>{$.properties[O].$converter=j});const D=($==null?void 0:$.properties)||{},L=m(D,A,S,C,w,E);return{categoryId:p,categoryName:x,properties:L}}return{categoryId:p,categoryName:"",properties:[]}}function f(p,h,b,w,E){const R=p.type,j=e(p),C={};let y=E||n[R];if(y&&Object.keys(y).length===0&&b&&b.getPropConfig&&(y=b.getPropConfig(w)),y&&y.categories){const S=[];return Object.keys(y.categories).map(A=>{const I=y.categories[A];if(I.$ref){S.push(g(A,I,p,h,w));return}const $=I==null?void 0:I.title,x=I==null?void 0:I.tabId,D=I==null?void 0:I.tabName,L=I==null?void 0:I.hide,O=I==null?void 0:I.hideTitle,z=m(I.properties||{},C,j,p,h,w,I.$converter),{setPropertyRelates:Y}=I,se=I==null?void 0:I.parentPropertyID;S.push({categoryId:A,categoryName:$,tabId:x,tabName:D,hide:L,properties:z,hideTitle:O,setPropertyRelates:Y,parentPropertyID:se})}),S}return[]}return{getPropertyConfigBySchema:f,getPropertyConfigByType:c,propertyConverterMap:o}}const qt={},$t={};Ot(qt,$t,nn);const Ht={},Lt={},{getSchemaByType:Qo,resolveSchemaWithDefaultValue:Fn,resolveSchemaToProps:_o,mappingSchemaToProps:Xo,setDesignerContext:Yo}=Vt(Ht,Lt),Dt={},zt={};Ot(Dt,zt,Fn);function Ye(n,t,e=new Map,o=(a,u,l,d)=>u,r={},s=a=>a){return Pt[t.title]=t,Rt[t.title]=o,qt[t.title]=r,$t[t.title]=s,Ht[t.title]=t,Lt[t.title]=o,Dt[t.title]=r,zt[t.title]=s,(a={},u=!0)=>{if(!u)return rn(a,e);const l=on(a,t,e),d=Object.keys(n).reduce((m,c)=>(m[c]=n[c].default,m),{});return Object.assign(d,l)}}function Mn(n,t,e){return t}const Bn=new Map([["appearance",it.resolveAppearance]]),jn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/avatar.schema.json",title:"avatar",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for avatar",type:"string"},type:{description:"The type string of avatar",type:"string",default:"avatar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},avatarWidth:{description:"",type:"number",default:100},avatarHeight:{description:"",type:"number",default:100},readonly:{description:"",type:"boolean",default:!1},cover:{description:"",type:"string",default:""},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding","visible"]},at={avatarWidth:{type:Number,default:100},avatarHeight:{type:Number,default:100},cover:{type:String},readonly:{type:Boolean,default:!1},shape:{type:String,default:"circle"},maxSize:{type:Number,default:1},modelValue:{type:String,default:""},title:{type:String,default:""},imageType:{type:Array,default:["jpeg"]}},yt=Ye(at,jn,Bn,Mn);function Ut(n,t,e,o){const r="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaqAljLQDOiNWJQZNJ4KffEFIRYAsFkAkFkAJFFkAkNCLIAAAC6AguhoCCl3TW2TzugIHx4S788Z6wmWN4ZY3ysoA1pu+qAgpYCAAaIoDIoCaJZvVAQ03LUBlGqWAzYmimn3vAaRYA1IkWASKKACgirIgAsgBoBdJNbZNN9t3aeIHNw2vSccbZhPxLN27dJ68/Rx222u1/LjbNn8vi/ieHPm58N03SKN5bfa58c7jOzHd78XOyXfd98bqoCaScp8jSdk+SgLjlljdccssfK12w6TlN2cmXjN1/iuAD34Z47Sa43XTjLus82nz5bjl8WNss4WPXsNtNpNLuzk3zlZ2wHUsBBF5CAFgAhouiUGRUBErSAyffFamgKqKCqkUBYcgBpADiuhoAKeYA8fStp8WX4WPCfq8b2eT1bXObPZZZ8bJrJ23lHz5rpvutu+3tvOqAAAAAAAACy3HKZY3Sy6yoA+hs85tMJlN2vGdlaeTomem0+C/9pu849SAKlARQERrkgJUWoCUVKDIqb/ugqxFBVRQFFBFABRAUAHn6bl+XDGc7bfT/ANeV26XddvJ2Yz3tcVAAAAAAAAAAFxy+HKZTjLq+l+z5j6Gzuuywt54z9jRoEQAARSoCCoCIqAIJQaCLzBZxCAKC8wIAChOIAADxdL/+i/6z6uTt0yabfXtxnta4qAAAAAAAAAAD37H/AAbP/WPBwfQ2c02WE7MYaNAIIoAhzCggHMEqaNIDNPviHoAsRqcAFSKC8iIoHNUAUAAAHl6ZPzbPLtln1ed7el467DXu2X0+68SgAAAAAAAAABpru7bo+npy7Po8HR8fi2+M46XW+Ue4ABAAAQAQUvAEvBL6BQS8U3feqpv7fcFnBUUBUUBScQFRUBQAAATKTLG43nLL6vnaWWy8ZdL5x9J4ulY/DtrZwymvrzUcgAAAAAAAANdwPT0LH9Wd8MZ+9elnY4fh7HHG8prfOtIAABQAQAKi1AE5KlBD09hPl7gKjUAVFBeYTiAqKgKAAAA5dKw+PY2ya5Y/mn19nVQfMG9th+HtbjOF3zyrCgAAAAAA6dHw+PbSWfln5r6Ob29Gw+DZS2fmy33y5T6g7cbreaAgAAAAgqAcgqfIBOapQSnr7lPS/IEaScAFVFgKIoKioCgAABgADj0nZ/HstZvyx3zxnN4+T6b52ePw7TLGcJbIoyAAAAADex2f4m1mN1+Gb75Tl9H0PbweboeOmGWXO3T0n/r0AAIAAAACKgHJFpyBEpyARFT74gKnNQVeaRQF5IoKTiigCKAAACZWY4/FlZMZxt3SAvnuna+dnlM8885wyts8nXb9I/Elw2e7G7rleN8J4ePNxUAAAAAAeroeUuFx7LrPKvQ+djlcMpljdLHs2W3x2k0/Tl2W8fLtB1C8ewQAAEUBDmt4oBeJeCAIUARFvBN3gByVAFUIChzWcAOSpGdpnjs5rnlMdeHbfKcwb58x5c+l23TZ7P1y3e0+rldvtcuO0snZjJFHvtmM1ysnjbpHHLpOyx3TK5eGM1eKyW63W3tt1UHfPpeV3YYTGduW+/JwyuWd1zyuVnDXhPKcgAAAAAAAAAAB0w2+0w3TKZTsy3+7tj0vG/rxyxvbN8eUB9DDa7PP9OeNvZrpfdu8OD5mkvGNY55Y/pzyx8ruIPePJj0nazj8OU8ZpfZ1w6Ts8rJlrhfHfPmg7FKgAF4AgVARPW/NanoAsZaBVlZUFVF4g57fbfhY7pLld0l/e+EeO23K5ZW5ZXjb97o1tcvj22WXHS/DPKMqAAAAAAAAAAAAAAAAAAAAAAOux212d0ttwvGdnjHr3ceMfPevo2XxbLTu3T0B1TmHJAZVOYF4p98xPviBFScQGlRZxBdS3TG3slvsibS/8WX+t/YHhx/TPGaqk4TyVQAAAAAAAAAAAAAAAAAAAAAAd+iX82c7ZL9/Nwdui/5b/rfoD00vARAQqAhfvcVNfL3A1WMqDSxmVQVNr/iz4/pv7LDOXLDLGcbNPDeDxTh6DtOjZaafFju816tlf+2Puo4Dv1bPvY+51bLvY+5RwHfq2Xex9zquXex9yjgO/Vcu9j7nVc+9j7lHAd+q597H3Oq597H3BwHfqufex9zqufex9yjgO/Vc+9j7nVc+9j7lHAd+q597H3Oq597H3KOA79Vz72PudVz72PuUcB36rl3sfc6rn3sfco4DvejZd7H3OrZd7H3KOA79Wy72PudWz72PuDg7dG/y3/W/Q6tl3sfdvY7K7PO25S6yzSdoOqWlEBmhaBamt+6J6AnmqaqDQy0CxYyoNCKC6m/VAGhPJdQBOSgKi6+QGu41QBRAF1LUABbUABNdAVOYUC0tE13gIWloCcTXeloFQLQTmffMtT74gixOa6gqysrzBVSVQVdWdQGpRNV1BV10SUlBYIvIF1E1Ne0F5iAKIAohaCmqWgBaapqC2ohqC6pqWoC2paa70tAqCACACa+F+RanyAWJ/a8vkAuqT6fVf7AVOz0X+AXVYh2egNSifx9T+wVWefyX+PqCyrqn807PQFEn0+p/YKH9H37gAc/kC6onL0P5BRP6OV8vqC2of2l/gAOSAuqan9J/AKmon9AUtL9PqnP1oCWl5ehfv5gh635nP1qWg//Z",s=i.ref(n.readonly);function a(f){return f.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/)!=null}function u(f){return f.indexOf("data:image/")>-1}function l(f){return f?"data:image/jpeg;base64,"+f:""}const d=i.computed(()=>{var p;if(!n.imageType||!n.imageType.length)return"";const f=(p=n.imageType)==null?void 0:p.map(h=>(h==="jpg"&&(h="jpeg"),`image/${h}`));return!f||!f.length?"image/*":f.join(",")}),m=i.computed(()=>{const f=o.value||n.cover||r;return a(f)||u(f)?f:l(f)}),c=i.computed(()=>s.value?"":n.title);function g(){s.value||e&&e.value&&e.value.click()}return{acceptTypes:d,imageSource:m,imageTitle:c,onClickImage:g}}const Ze=i.defineComponent({name:"FAvatar",props:at,emits:["change","update:modelValue"],setup(n,t){rt.useI18n();const e=i.computed(()=>({"f-avatar":!0,"f-avatar-readonly":n.readonly,"f-avatar-circle":n.shape==="circle","f-avatar-square":n.shape==="square"})),o=i.ref(n.modelValue),r=i.computed(()=>({width:n.avatarWidth+"px",height:n.avatarHeight+"px"})),s=!1;function a(){return""}function u(){}const l=i.ref(null),{acceptTypes:d,imageSource:m,onClickImage:c}=Ut(n,t,l,o);return()=>i.createVNode("div",{class:e.value,style:r.value,onClick:c},[s,i.createVNode("img",{title:n.title,class:"f-avatar-image",src:m.value,onError:a},null),!n.readonly&&i.createVNode("div",{class:"f-avatar-icon"},[i.createVNode("span",{class:"f-icon f-icon-camera"},null)]),i.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:d.value,onChange:u,style:"display: none;"},null)])}}),Nn=i.ref(0);function kn(){Nn.value++}const lt=i.ref(0);function Vn(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function o(l,d=""){return{path:d+l.code,field:l.id,fullPath:l.code}}function r(l,d=""){return t.getViewModelById(l).states.map(c=>o(c,d))}function s(l){const d=t.getRootViewModelId(),m=r(l);if(l===d)return m;const c=r(d,"root-component.");return[...m,...c]}function a(l){return l.binding&&l.binding.path||l.id||""}function u(){return e&&e.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:u}}class Wt{constructor(t){U(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'"}]);U(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});U(this,"getExpressionConverter",(t,e)=>({convertFrom:(o,r,s,a)=>{const u=s.getExpressionRuleValue(t,e||r);return u&&u.value||""},convertTo:(o,r,s,a,u)=>{var l;if(r==="dataPicking"&&(s!=null&&s.target)){const d=`${s.target}_dataPicking`;((l=s.rules)==null?void 0:l.some(c=>c.id===d&&c.value))?o.dictPickingExpressionId=d:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=t}getExpressionRule(t,e){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===t);if(!r)return"";const s=r.rules.find(a=>a.type===e);return s||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(e);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(t,e,o="label"){return{id:t.id,name:t.name,bindingPath:t[o],parents:e,type:"field"}}buildEntityFieldsTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var u;const s=this.createTreeNode(r,e);let a=[];(u=r.type)!=null&&u.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...e,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var l,d;const s=this.createTreeNode(r,e);s.type="entity";const a=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...e,r.label]),u=this.buildChildEntityTreeData((d=r.type)==null?void 0:d.entities,[...e,r.label]);u!=null&&u.length&&(a==null||a.push(...u)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const o=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),r=this.buildChildEntityTreeData(e.type.entities,[e.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,o){const r=o==="Field"?t.binding.field:t.id,s=this.getExpressionRule(r,e),a=this.getEntitiesAndVariables(),u={message:["validate","required","dataPicking"].includes(e)&&s?s.message:"",...a};return s.messageType!=null&&(u.messageType=s.messageType),u}buildRule(t,e,o,r){const{expression:s,message:a,messageType:u}=e,l={id:`${t}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=a),o==="dataPicking"&&(l.messageType=u),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,o,r){const s=e==="Field"?t.binding.field:t.id,a=this.buildRule(s,o,r,t.type==="form-group"?t.id:"");let l=this.getExpressionData().find(m=>m.targetType===e&&m.target===s);const d=m=>m.value.trim()==="";if(l){const m=l.rules.find(c=>c.id===a.id);if(m)d(a)?l.rules=l.rules.filter(c=>c.id!==a.id):(Object.assign(m,a),r==="validate"&&t.type==="form-group"&&(m.elementId=t.id));else{if(d(a))return null;l.rules=l.rules||[],l.rules.push(a)}}else{if(d(a))return null;l={target:`${s}`,rules:[a],targetType:e}}return l}getExpressionEditorOptions(t,e,o,r){return o.reduce((s,a)=>{var l,d;const u=e==="Field"?(l=t==null?void 0:t.binding)==null?void 0:l.field:t.id;return s[a]={hide:e==="Field"?!!((d=t==null?void 0:t.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(u),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,a,e),onSubmitModal:m=>{const c=this.updateExpression(t,e,m,a);if(r){const g=this.buildRule(u,m,a);r(g)}return c}}},s},{})}getExpressionInfo(t,e,o){const r=e==="Field"?t.binding.field:t.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:e,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(t,e,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!t.binding,properties:{...this.getExpressionEditorOptions(t,e,o,r)}}}getExpressionOptions(t,e,o){const r=this.getExpressionInfo(t,e,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,o,e),expressionInfo:r}}}class Pn{constructor(t,e){U(this,"componentId");U(this,"viewModelId");U(this,"eventsEditorUtils");U(this,"formSchemaUtils");U(this,"formMetadataConverter");U(this,"designViewModelUtils");U(this,"designViewModelField");U(this,"controlCreatorUtils");U(this,"designerHostService");U(this,"designerContext");U(this,"schemaService",null);U(this,"metadataService",null);U(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext}getFormDesignerInstance(){var t,e;return(e=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var o;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===e)}t.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(t){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:t.type,name:M[t.type]&&M[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},o){const r={title:"外观",description:"Appearance"},s={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 a in e)s[a]=Object.assign(s[a]||{},e[a]);return{...r,properties:{...s},setPropertyRelates(a,u){if(a){switch(a&&a.propertyID){case"class":case"style":{lt.value++;break}}o&&o(a,t,u)}}}}getPropertyEditorParams(t,e=[],o="visible",r={},s={},a=""){const{getVariables:u,getControlName:l,getStateMachines:d}=Vn(this.designerHostService),m=this.getRealTargetType(t),c=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],g={type:"property-editor",propertyTypes:c};return c.map(f=>{switch(f){case"Const":Object.assign(g,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":g.expressionConfig=this.getExpressionOptions(t,m,a||o);break;case"StateMachine":g.stateMachines=d();break;case"Variable":Object.assign(g,{controlName:l(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:u(this.viewModelId),onBeforeOpenVariables:p=>{p.value=u(this.viewModelId)}},s);break}}),g}getVisibleProperty(t,e=""){var s;let o=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?o=["Const","Expression"]:e==="form-group"&&!((s=t.binding)!=null&&s.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,o,"visible")}}}getBehaviorConfig(t,e="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(t,e);for(const l in o)a[l]=Object.assign(a[l]||{},o[l]);const u=this;return{...s,properties:{...a},setPropertyRelates(l,d){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":u.afterMutilEditorChanged(t,l);break}r&&r(l,d)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const o=e&&e.parent&&e.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===t),s=ie.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),kn()}addNewVariableToViewModel(t,e){const o=t.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(e).states.push(a)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:s,expressionInfo:a}=e,{targetId:u,targetType:l,expressionType:d,value:m,message:c}=a,g=this.formSchemaUtils.getModule();g.expressions=g.expressions||[];const{expressions:f}=g;let p=f.find(b=>b.target===u);p||(p={target:u,rules:[],targetType:l},f.push(p));const h=p.rules.find(b=>b.type===d);if(h)h.value=m,h.message=c;else{const b={id:s,type:d,value:m,message:c};p.rules.push(b)}delete e.expressionInfo}clearExpression(t,e){const o=t.propertyValue;if(o&&o.type==="Expression")return;const s=t.propertyID,a=this.formSchemaUtils.getExpressions(),u=e.binding?e.binding.field:e.id,l=a.find(d=>d.target===u);!l||!l.rules||(l.rules=l.rules.filter(d=>d.type!==s))}getExpressionOptions(t,e,o){return new Wt(this.formSchemaUtils).getExpressionOptions(t,e,o)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},e}}const We=class We{static getEditorTypesByMDataType(t,e=!1,o=""){if(e)return[{key:M["language-textbox"].type,value:M["language-textbox"].name}];let r=We.fieldControlTypeMapping[t];if(o==="data-grid-column"&&(r!=null&&r.length)){const s=[M["check-group"].type,M["radio-group"].type];r=r.filter(a=>!s.includes(a.key))}return r}static getAllInputTypes(){const t=[];for(const e in We.fieldControlTypeMapping)We.fieldControlTypeMapping[e].forEach(o=>{t.find(r=>r.key===o.key&&r.value===o.value)||t.push({key:o.key,value:o.value})});return t}static mappingDomPropAndSchemaProp(t,e){var s;const o=(s=t.editor)==null?void 0:s.type,r=[];return(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===M["input-group"].type||o===M.textarea.type||o===M["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===M["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===M["combo-list"].type||o===M["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===M["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===M["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===M.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===M["data-grid-column"].type||t.type===M["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};U(We,"fieldControlTypeMapping",{String:[{key:M["input-group"].type,value:M["input-group"].name},{key:M.lookup.type,value:M.lookup.name},{key:M["date-picker"].type,value:M["date-picker"].name},{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name},{key:M["check-group"].type,value:M["check-group"].name},{key:M["radio-group"].type,value:M["radio-group"].name},{key:M["combo-list"].type,value:M["combo-list"].name},{key:M.textarea.type,value:M.textarea.name},{key:M["time-picker"].type,value:M["time-picker"].name}],Text:[{key:M.textarea.type,value:M.textarea.name},{key:M.lookup.type,value:M.lookup.name}],Decimal:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Integer:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Number:[{key:M["number-spinner"].type,value:M["number-spinner"].name},{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name}],BigNumber:[{key:M["number-spinner"].type,value:M["number-spinner"].name}],Date:[{key:M["date-picker"].type,value:M["date-picker"].name}],DateTime:[{key:M["date-picker"].type,value:M["date-picker"].name}],Boolean:[{key:M.switch.type,value:M.switch.name},{key:M["check-box"].type,value:M["check-box"].name}],Enum:[{key:M["combo-list"].type,value:M["combo-list"].name},{key:M["radio-group"].type,value:M["radio-group"].name}],Object:[{key:M.lookup.type,value:M.lookup.name},{key:M["combo-list"].type,value:M["combo-list"].name},{key:M["radio-group"].type,value:M["radio-group"].name}]});let ct=We;var dt=(n=>(n.Form="Form",n.Variable="Variable",n))(dt||{});class Rn{constructor(){U(this,"label","");U(this,"id","");U(this,"columnInSM",12);U(this,"columnInMD",6);U(this,"columnInLG",3);U(this,"columnInEL",2);U(this,"displayWidthInSM",1);U(this,"displayWidthInMD",1);U(this,"displayWidthInLG",1);U(this,"displayWidthInEL",1);U(this,"displayColumnCountAtBreakPoint","md");U(this,"tagRow",0);U(this,"showTopBorder",0);U(this,"group",1);U(this,"isSupportedClass",!0);U(this,"fieldSetId","")}}function On(n){let t,e;const o=new Map;let r=[];function s(m,c){const f=m.split(" ").filter(E=>E.startsWith("col-"));if(f.length===0){c.isSupportedClass=!1;return}let p=f.find(E=>/^col-([1-9]|10|11|12)$/.test(E)),h=f.find(E=>/^col-md-([1-9]|10|11|12)$/.test(E)),b=f.find(E=>/^col-xl-([1-9]|10|11|12)$/.test(E)),w=f.find(E=>/^col-el-([1-9]|10|11|12)$/.test(E));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),h=h||"col-md-"+c.columnInSM,c.columnInMD=parseInt(h.replace("col-md-",""),10),c.displayWidthInMD=c.columnInMD/6,[1,2].includes(c.displayWidthInMD)||(c.isSupportedClass=!1),b=b||"col-xl-"+c.columnInMD,c.columnInLG=parseInt(b.replace("col-xl-",""),10),c.displayWidthInLG=c.columnInLG/3,[1,2,3,4].includes(c.displayWidthInLG)||(c.isSupportedClass=!1),w=w||"col-el-"+c.columnInLG,c.columnInEL=parseInt(w.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function a(m,c,g,f=!1){let p=!1;m.contents.forEach(h=>{if(h.type==="fieldset"){g+=1,a(h,c,g,!0),p=!0;return}p&&(g+=1,p=!1);const b=h.appearance&&h.appearance.class,w=new Rn;b?s(b,w):w.isSupportedClass=!1,w.label=h.label||h.id,w.id=h.id,w.group=g,f&&(w.fieldSetId=m.id),e===h.id&&(t=g),o.set(h.id,h),c.push(w)})}function u(m){const c=n.getComponentById(m);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const g=n.selectNode(c,f=>f.type===vt.DgControl["response-form"].type);return!g||!g.contents||g.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:g}}function l(m,c){c=c||m.id;const{result:g,message:f,formNode:p}=u(c);if(!g)return{result:g,message:f};e=m.id,r=[],o.clear();const h=p.contents[0].type===vt.DgControl.fieldset.type?0:1;a(p,r,h);const b=r.find(E=>!E.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:b?"customize":"standard"},importData:r}}function d(m,c){c=c;const{result:g,formNode:f}=u(c);if(!g)return"";const p=[];return m.forEach(h=>{var E;const b=o.get(h.id),w=b.appearance&&b.appearance.class;if(w){const j=w.split(" ").filter($=>!$.startsWith("col-")),C="col-"+h.columnInSM,y="col-md-"+h.columnInMD,S="col-xl-"+h.columnInLG,A="col-el-"+h.columnInEL,I=[C,y,S,A].concat(j);b.appearance.class=I.join(" ")}if(h.fieldSetId){const R=f.contents.find(C=>C.id===h.fieldSetId),j=p.find(C=>C.id===h.fieldSetId);j?(E=j.contents)==null||E.push(b):(p.push(R),R.contents=[b])}else p.push(b)}),f.contents=p,f.id}return{checkCanFindFormNode:u,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:d,getResonseFormLayoutConfig:a}}var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(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 qn={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(o,r,s){function a(d,m){if(!r[d]){if(!o[d]){var c=typeof ut=="function"&&ut;if(!m&&c)return c(d,!0);if(u)return u(d,!0);var g=new Error("Cannot find module '"+d+"'");throw g.code="MODULE_NOT_FOUND",g}var f=r[d]={exports:{}};o[d][0].call(f.exports,function(p){var h=o[d][1][p];return a(h||p)},f,f.exports,e,o,r,s)}return r[d].exports}for(var u=typeof ut=="function"&&ut,l=0;l<s.length;l++)a(s[l]);return a}return e}()({1:[function(e,o,r){var s={},a="(?:^|\\s)",u="(?:\\s|$)";function l(c){var g=s[c];return g?g.lastIndex=0:s[c]=g=new RegExp(a+c+u,"g"),g}function d(c,g){var f=c.className;f.length?l(g).test(f)||(c.className+=" "+g):c.className=g}function m(c,g){c.className=c.className.replace(l(g)," ").trim()}o.exports={add:d,rm:m}},{}],2:[function(e,o,r){(function(s){var a=e("contra/emitter"),u=e("crossvent"),l=e("./classes"),d=document,m=d.documentElement;function c(x,D){var L=arguments.length;L===1&&Array.isArray(x)===!1&&(D=x,x=[]);var O,z,Y,se,N,B,G,P,K,he=null,ve,Q,oe=!1,ce=0,ee,q=D||{};q.moves===void 0&&(q.moves=E),q.accepts===void 0&&(q.accepts=E),q.invalid===void 0&&(q.invalid=Ke),q.containers===void 0&&(q.containers=x||[]),q.isContainer===void 0&&(q.isContainer=w),q.copy===void 0&&(q.copy=!1),q.copySortSource===void 0&&(q.copySortSource=!1),q.revertOnSpill===void 0&&(q.revertOnSpill=!1),q.removeOnSpill===void 0&&(q.removeOnSpill=!1),q.direction===void 0&&(q.direction="vertical"),q.ignoreInputTextSelection===void 0&&(q.ignoreInputTextSelection=!0),q.mirrorContainer===void 0&&(q.mirrorContainer=d.body);var te=a({containers:q.containers,start:Ee,end:Le,cancel:T,remove:Xe,destroy:He,canMove:Ve,dragging:!1});return q.removeOnSpill===!0&&te.on("over",St).on("out",At),Ne(),te;function $e(v){return te.containers.indexOf(v)!==-1||q.isContainer(v)}function Ne(v){var F=v?"remove":"add";p(m,F,"mousedown",ae),p(m,F,"mouseup",Re)}function Te(v){var F=v?"remove":"add";p(m,F,"mousemove",Je)}function Ge(v){var F=v?"remove":"add";u[F](m,"selectstart",Qe),u[F](m,"click",Qe)}function He(){Ne(!0),Re({})}function Qe(v){ve&&v.preventDefault()}function ae(v){se=v.clientX,N=v.clientY;var F=h(v)!==1||v.metaKey||v.ctrlKey;if(!F){var k=v.target,H=ke(k);H&&(ve=H,Te(),v.type==="mousedown"&&(y(k)?k.focus():v.preventDefault()))}}function Je(v){if(ve){if(h(v)===0){Re({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-se)<=(q.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-N)<=(q.slideFactorY||0))){if(q.ignoreInputTextSelection){var F=$("clientX",v)||0,k=$("clientY",v)||0,H=d.elementFromPoint(F,k);if(y(H))return}var Z=ve;Te(!0),Ge(),Le(),Pe(Z),l.add(P||Y,"gu-transit"),Et(),Tt(),ce=0,Be(v)}}}function ke(v){if(!(te.dragging&&O)&&!$e(v)){for(var F=v;C(v)&&$e(C(v))===!1;)if(q.invalid(v,F)||(v=C(v),!v))return;var k=C(v);if(k&&!q.invalid(v,F)){var H=q.moves(v,k,F,A(v));if(H)return{item:v,source:k}}}}function Ve(v){return!!ke(v)}function Ee(v){var F=ke(v);F&&Pe(F)}function Pe(v){kt(v.item,v.source)&&(P=v.item.cloneNode(!0),te.emit("cloned",P,v.item,"copy")),z=v.source,Y=v.item,B=G=A(v.item),te.dragging=!0,te.emit("drag",Y,z)}function Ke(){return!1}function Le(){if(te.dragging){var v=P||Y;_e(v,C(v))}}function Me(){ve=!1,Te(!0),Ge(!0)}function Re(v){if(Me(),!!te.dragging){var F=P||Y,k=$("clientX",v)||0,H=$("clientY",v)||0,Z=b(O,k,H),J=de(Z,k,H);J&&(P&&q.copySortSource||!P||J!==z)?_e(F,J):q.removeOnSpill?Xe():T()}}function _e(v,F){var k=C(v);P&&q.copySortSource&&F===z&&k.removeChild(Y),le(F)?te.emit("cancel",v,z):te.emit("drop",v,F,z,G),_()}function Xe(){if(te.dragging){var v=P||Y,F=C(v);F&&F.removeChild(v),te.emit(P?"cancel":"remove",v,F,z),_()}}function T(v){if(te.dragging){var F=arguments.length>0?v:q.revertOnSpill,k=P||Y,H=C(k),Z=le(H);Z===!1&&F&&(P?H&&H.removeChild(P):z.insertBefore(k,B)),Z||F?te.emit("cancel",k,z,z):te.emit("drop",k,H,z,G),_()}}function _(){var v=P||Y;Me(),It(),Ft(),v&&l.rm(v,"gu-transit"),K&&clearTimeout(K),te.dragging=!1,he&&te.emit("out",v,he,z),te.emit("dragend",v,ce),z=Y=P=B=G=K=he=null}function le(v,F){var k;return F!==void 0?k=F:O?k=G:k=A(P||Y),v===z&&k===B}function de(v,F,k){for(var H=v;H&&!Z();)H=C(H);return H;function Z(){var J=$e(H);if(J===!1)return!1;var Se=gt(H,v),ye=ht(H,Se,F,k),be=le(H,ye);return be?!0:q.accepts(Y,H,z,ye)}}function Be(v){if(!O)return;v.preventDefault();var F=$("clientX",v)||0,k=$("clientY",v)||0;O.style.left=F-2+"px",O.style.top=k-2+"px";var H=P||Y,Z=b(O,F,k),J=de(Z,F,k),Se=J!==null&&J!==he;(Se||J===null)&&(Ce(),he=J,Fe()),Nt(Z,k);var ye=C(H);if(J===z&&P&&!q.copySortSource){ye&&ye.removeChild(H);return}var be,Ie=gt(J,Z);if(oe=et(Ie,J),Ie!==null)be=ht(J,Ie,F,k);else if(q.revertOnSpill===!0&&!P)be=B,J=z;else{P&&ye&&ye.removeChild(H),P&&Q&&(Q.style.display="none");return}Q.style.display="block",wt(be,H,Se),be?Bt(Ie,be):jt(J);function ue(me){te.emit(me,H,he,z)}function Fe(){Se&&ue("over")}function Ce(){he&&ue("out")}}function wt(v,F,k){(v===F||v===A(F))&&(G=A(F)),(v===null&&k||v!==F&&v!==A(F))&&(G=v)}function St(v){l.rm(v,"gu-hide")}function At(v){te.dragging&&l.add(v,"gu-hide")}function Tt(){O||(O=document.createElement("div"),O.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;",O.innerHTML=q.getMirrorText&&q.getMirrorText(Y)||"控件",l.add(O,"gu-mirror"),q.mirrorContainer.appendChild(O),p(m,"add","mousemove",Be),l.add(q.mirrorContainer,"gu-unselectable"),te.emit("cloned",O,Y,"mirror"))}function Et(){if(Q=document.createElement("div"),l.add(Q,"gu-insertion"),Y){var v=Y.getBoundingClientRect();Q.style.left=v.left+"px",Q.style.top=v.top+"px"}oe=!1,q.mirrorContainer.appendChild(Q)}function It(){O&&(l.rm(q.mirrorContainer,"gu-unselectable"),p(m,"remove","mousemove",Be),C(O).removeChild(O),O=null)}function Ft(){Q&&(C(Q).removeChild(Q),Q=null)}function gt(v,F){for(var k=F;k!==v&&C(k)!==v;)k=C(k);return k===m?null:k}function et(v,F){if(!F)return oe;var k=v||F&&F.lastElementChild;if(!k)return!0;var H=getComputedStyle(v),Z=/^inline/.test(H.getPropertyValue("display"))||/^(left|right)$/.test(H.getPropertyValue("float"));if(Z)return!0;if(F){var J=getComputedStyle(F),Se=J.getPropertyValue("display");if(/flex$/.test(Se)){var ye=J.getPropertyValue("flex-direction")||"row";if(ye==="row"||ye==="row-reverse")return!Mt(F)}return!1}return!0}function Mt(v){if(!v.children||!v.children.length)return!1;for(const F of Array.from(v.children)){const H=(F.className&&F.className.split(" ")||[]).filter(Z=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Z));if(!H.length)return!1;for(const Z of H){const J=Z.slice(Z.lastIndexOf("-")+1);if(parseInt(J,10)!==12)return!1}}return!0}function Bt(v,F){const k=F.getBoundingClientRect();if(Q.style.left=k.left+"px",Q.style.top=k.top+"px",oe){if(Q.style.height=k.height+"px",Q.style.width="4px",v){const H=v.getBoundingClientRect();H.top!==k.top&&(Q.style.left=H.right+"px",Q.style.top=H.top+"px",Q.style.height=H.height+"px")}}else if(Q.style.height="4px",Q.style.width=k.width+"px",ee){const H=ee.getBoundingClientRect();k.top<H.top&&(Q.style.display="none")}F===Y&&Y&&(Q.style.display="none")}function jt(v){G=null;var F=v.lastElementChild;if(F){var k=F.getBoundingClientRect();oe?(Q.style.left=k.right+"px",Q.style.top=k.top+"px",Q.style.height=k.height+"px",Q.style.width="4px"):(Q.style.left=k.left+"px",Q.style.top=k.bottom+"px",Q.style.height="4px",Q.style.width=k.width+"px"),F===Y&&Y&&(Q.style.display="none")}else Q.style.display="none"}function Nt(v,F){if(!q.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ee=g(v),!ee||!ee.contains(v)))return;const k=document.querySelector(".dgComponentSelected"),H=ee.getBoundingClientRect();if(F-30<H.top&&ee.scrollTop>0){let Z=ee.scrollTop<10?ee.scrollTop:10;ee.scrollBy(0,-1*Z),k&&ee.contains(k)&&(ce=ce+-1*Z)}if(F+30>H.bottom&&ee.scrollTop<ee.scrollHeight-ee.clientHeight){const Z=ee.scrollHeight-ee.clientHeight-ee.scrollTop;let J=Z<10?Z:10;ee.scrollBy(0,J),k&&ee.contains(k)&&(ce=ce+J)}}function ht(v,F,k,H){var Z=q.direction==="horizontal",J=q.direction==="mixed",Se=F!==v?be():ye();return Se;function ye(){var ue=v.children.length,Fe,Ce,me;for(Fe=0;Fe<ue;Fe++)if(Ce=v.children[Fe],me=Ce.getBoundingClientRect(),Z&&me.left+me.width/2>k||!J&&!Z&&me.top+me.height/2>H||J&&me.left+me.width>k&&me.top+me.height>H)return Ce;return null}function be(){var ue=F.getBoundingClientRect();if(J){var Fe=H-ue.top,Ce=k-ue.left,me=ue.bottom-H,tt=ue.right-k,nt=Math.min(Ce,tt,Fe,me),ot;return oe?ot=tt<Ce:ot=me===nt||tt===nt||Ce===nt,Ie(ot)}return Ie(Z?k>ue.left+R(ue)/2:H>ue.top+j(ue)/2)}function Ie(ue){return ue?A(F):F}}function kt(v,F){return typeof q.copy=="boolean"?q.copy:q.copy(v,F)}}function g(x){const D=Array.from(window.scrollContainerList);if(D.length===1){const O=Array.from(window.scrollContainerList)[0];return document.getElementById(O)}const L=f(D);for(const O of L)if(O.contains(x))return O;return null}function f(x){const D=[];return x.forEach(L=>{const O=document.getElementById(L);O&&D.push(O)}),D.sort((L,O)=>L.contains(O)?1:O.contains(L)?-1:0),D}function p(x,D,L,O){var z={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},Y={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},se={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?u[D](x,Y[L],O):s.navigator.msPointerEnabled?u[D](x,se[L],O):(u[D](x,z[L],O),u[D](x,L,O))}function h(x){if(x.touches!==void 0)return x.touches.length;if(x.which!==void 0&&x.which!==0)return x.which;if(x.buttons!==void 0)return x.buttons;var D=x.button;if(D!==void 0)return D&1?1:D&2?3:D&4?2:0}function b(x,D,L){x=x||{};var O=x.className||"",z;return x.className+=" gu-hide",z=d.elementFromPoint(D,L),x.className=O,z}function w(){return!1}function E(){return!0}function R(x){return x.width||x.right-x.left}function j(x){return x.height||x.bottom-x.top}function C(x){return x.parentNode===d?null:x.parentNode}function y(x){return x.tagName==="INPUT"||x.tagName==="TEXTAREA"||x.tagName==="SELECT"||S(x)}function S(x){return!x||x.contentEditable==="false"?!1:x.contentEditable==="true"?!0:S(C(x))}function A(x){return x.nextElementSibling||D();function D(){var L=x;do L=L.nextSibling;while(L&&L.nodeType!==1);return L}}function I(x){return x.targetTouches&&x.targetTouches.length?x.targetTouches[0]:x.changedTouches&&x.changedTouches.length?x.changedTouches[0]:x}function $(x,D){var L=I(D),O={pageX:"clientX",pageY:"clientY"};return x in O&&!(x in L)&&O[x]in L&&(x=O[x]),L[x]}o.exports=c}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,o,r){o.exports=function(a,u){return Array.prototype.slice.call(a,u)}},{}],4:[function(e,o,r){var s=e("ticky");o.exports=function(u,l,d){u&&s(function(){u.apply(d||null,l||[])})}},{ticky:10}],5:[function(e,o,r){var s=e("atoa"),a=e("./debounce");o.exports=function(l,d){var m=d||{},c={};return l===void 0&&(l={}),l.on=function(g,f){return c[g]?c[g].push(f):c[g]=[f],l},l.once=function(g,f){return f._once=!0,l.on(g,f),l},l.off=function(g,f){var p=arguments.length;if(p===1)delete c[g];else if(p===0)c={};else{var h=c[g];if(!h)return l;h.splice(h.indexOf(f),1)}return l},l.emit=function(){var g=s(arguments);return l.emitterSnapshot(g.shift()).apply(this,g)},l.emitterSnapshot=function(g){var f=(c[g]||[]).slice(0);return function(){var p=s(arguments),h=this||l;if(g==="error"&&m.throws!==!1&&!f.length)throw p.length===1?p[0]:p;return f.forEach(function(w){m.async?a(w,p,h):w.apply(h,p),w._once&&l.off(g,w)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(e,o,r){(function(s){var a=e("custom-event"),u=e("./eventmap"),l=s.document,d=g,m=p,c=[];s.addEventListener||(d=f,m=h),o.exports={add:d,remove:m,fabricate:b};function g(C,y,S,A){return C.addEventListener(y,S,A)}function f(C,y,S){return C.attachEvent("on"+y,E(C,y,S))}function p(C,y,S,A){return C.removeEventListener(y,S,A)}function h(C,y,S){var A=R(C,y,S);if(A)return C.detachEvent("on"+y,A)}function b(C,y,S){var A=u.indexOf(y)===-1?$():I();C.dispatchEvent?C.dispatchEvent(A):C.fireEvent("on"+y,A);function I(){var x;return l.createEvent?(x=l.createEvent("Event"),x.initEvent(y,!0,!0)):l.createEventObject&&(x=l.createEventObject()),x}function $(){return new a(y,{detail:S})}}function w(C,y,S){return function(I){var $=I||s.event;$.target=$.target||$.srcElement,$.preventDefault=$.preventDefault||function(){$.returnValue=!1},$.stopPropagation=$.stopPropagation||function(){$.cancelBubble=!0},$.which=$.which||$.keyCode,S.call(C,$)}}function E(C,y,S){var A=R(C,y,S)||w(C,y,S);return c.push({wrapper:A,element:C,type:y,fn:S}),A}function R(C,y,S){var A=j(C,y,S);if(A){var I=c[A].wrapper;return c.splice(A,1),I}}function j(C,y,S){var A,I;for(A=0;A<c.length;A++)if(I=c[A],I.element===C&&I.type===y&&I.fn===S)return A}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,o,r){(function(s){var a=[],u="",l=/^on/;for(u in s)l.test(u)&&a.push(u.slice(2));o.exports=a}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,o,r){(function(s){var a=s.CustomEvent;function u(){try{var l=new a("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=u()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(d,m){var c=document.createEvent("CustomEvent");return m?c.initCustomEvent(d,m.bubbles,m.cancelable,m.detail):c.initCustomEvent(d,!1,!1,void 0),c}:function(d,m){var c=document.createEventObject();return c.type=d,m?(c.bubbles=!!m.bubbles,c.cancelable=!!m.cancelable,c.detail=m.detail):(c.bubbles=!1,c.cancelable=!1,c.detail=void 0),c}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,o,r){var s=o.exports={},a,u;function l(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=l}catch{a=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=d}catch{u=d}})();function m(j){if(a===setTimeout)return setTimeout(j,0);if((a===l||!a)&&setTimeout)return a=setTimeout,setTimeout(j,0);try{return a(j,0)}catch{try{return a.call(null,j,0)}catch{return a.call(this,j,0)}}}function c(j){if(u===clearTimeout)return clearTimeout(j);if((u===d||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(j);try{return u(j)}catch{try{return u.call(null,j)}catch{return u.call(this,j)}}}var g=[],f=!1,p,h=-1;function b(){!f||!p||(f=!1,p.length?g=p.concat(g):h=-1,g.length&&w())}function w(){if(!f){var j=m(b);f=!0;for(var C=g.length;C;){for(p=g,g=[];++h<C;)p&&p[h].run();h=-1,C=g.length}p=null,f=!1,c(j)}}s.nextTick=function(j){var C=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)C[y-1]=arguments[y];g.push(new E(j,C)),g.length===1&&!f&&m(w)};function E(j,C){this.fun=j,this.array=C}E.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function R(){}s.on=R,s.addListener=R,s.once=R,s.off=R,s.removeListener=R,s.removeAllListeners=R,s.emit=R,s.prependListener=R,s.prependOnceListener=R,s.listeners=function(j){return[]},s.binding=function(j){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(j){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(e,o,r){(function(s){var a=typeof s=="function",u;a?u=function(l){s(l)}:u=function(l){setTimeout(l,0)},o.exports=u}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,o,r){(function(s,a){var u=e("process/browser.js").nextTick,l=Function.prototype.apply,d=Array.prototype.slice,m={},c=0;r.setTimeout=function(){return new g(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new g(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function g(f,p){this._id=f,this._clearFn=p}g.prototype.unref=g.prototype.ref=function(){},g.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(f,p){clearTimeout(f._idleTimeoutId),f._idleTimeout=p},r.unenroll=function(f){clearTimeout(f._idleTimeoutId),f._idleTimeout=-1},r._unrefActive=r.active=function(f){clearTimeout(f._idleTimeoutId);var p=f._idleTimeout;p>=0&&(f._idleTimeoutId=setTimeout(function(){f._onTimeout&&f._onTimeout()},p))},r.setImmediate=typeof s=="function"?s:function(f){var p=c++,h=arguments.length<2?!1:d.call(arguments,1);return m[p]=!0,u(function(){m[p]&&(h?f.apply(null,h):f.call(null),r.clearImmediate(p))}),p},r.clearImmediate=typeof a=="function"?a:function(f){delete m[f]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(qn);const $n={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}},Hn={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},bt=i.defineComponent({name:"Toast",props:Hn,emits:["close","click"],setup:(n,t)=>{const{locale:e,t:o}=rt.useI18n(),r=i.ref(n.animate),s="fadeOut",a=i.computed(()=>n.options),u=i.ref(!1),l=i.computed(()=>a.value.title&&a.value.message),d=i.computed(()=>!a.value.title&&a.value.message),m=i.computed(()=>{const j={animated:u.value,toast:!0,"toast--only-content":!l.value};return j[n.animate]=!1,j[s]=u.value,j["toasty-type-"+a.value.type]=!0,a.value.theme&&(j[a.value.theme]=!0),j}),c=i.computed(()=>{const y=`f-icon-${a.value&&a.value.type?a.value.type.replace("toasty-type-",""):"default"}`,S={"f-icon":!0};return S[y]=!0,S}),g=i.computed(()=>a.value.title||a.value.message),f=i.computed(()=>n.showCloseButton),p=i.computed(()=>!!a.value.buttons||!!t.slots.default),h=i.computed(()=>e.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b(j){j.stopPropagation(),j.preventDefault(),u.value=!1,setTimeout(()=>{t.emit("close",a.value)},200)}function w(j,C){}function E(j){return`f-preten-link ${j.customClass?j.customClass:""}`}i.watch(r,()=>{r.value});const R=()=>{var j;return i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((j=a.value.buttons)==null?void 0:j.map(C=>i.createVNode("span",{class:E(C),onClick:y=>void 0},[C.text]))),t.slots.default&&t.slots.default()])])};return()=>i.createVNode("div",{class:m.value,style:"min-height:44px"},[f.value&&i.createVNode("button",{title:o("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:b},[i.createVNode("span",{class:"f-icon modal_close"},null)]),g.value&&i.createVNode("section",{class:"modal-tips"},[!l.value&&i.createVNode("div",{class:"float-left modal-tips-iconwrap"},[i.createVNode("span",{class:c.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[l.value&&i.createVNode(i.Fragment,null,[i.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:a.value.title},null),i.createVNode("p",{class:"toast-msg",innerHTML:a.value.message,style:h.value},null),p.value&&R()]),d.value&&(a.value.buttons?i.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:a.value.message},null),i.createVNode("div",{class:"after-toast-title text-right ml-auto"},[R()])]):i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:a.value.message},null))])])])}}),ft=i.defineComponent({name:"Notify",props:$n,emits:["close","empty"],setup(n,t){const e=i.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=i.ref(),s=i.ref(n.options),a=i.ref(n.showCloseButton),u=i.computed(()=>n.position||"bottom-right"),l=i.computed(()=>n.timeout!=null?n.timeout:3e3),d=i.computed(()=>{const g=n.bottom?n.bottom:o.bottom,f=n.top?n.top:o.top,p={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?`${f}px`:"",bottom:u.value.indexOf("bottom")>-1?`${g}px`:""};return u.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",u.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function m(g){t.emit("close")}l.value&&setTimeout(()=>{m()},l.value),t.expose({closeToast:m,container:r,notifyPosition:u});function c(g,f){m()}return()=>i.createVNode("div",{class:e.value,style:d.value,ref:r},[i.createVNode(bt,{options:s.value,showCloseButton:a.value,animate:n.animate,onClose:g=>c(g,s.value)},null)])}});class Ln{constructor(){U(this,"notifyRefs",[]);U(this,"globalConfig",i.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),s=document.createElement("div");s.style.display="contents";const a=i.createApp({setup(){var d;const u=i.ref();function l(){u.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(r,u),a.unmount()},220)}if(r.position.indexOf("top")>-1){const m=e.getNotifyInstances(r.position),c=m[m.length-1];if(c){const g=c.value.container.getBoundingClientRect();r.top=g.bottom}}return r.safeHtml&&((d=r.options)!=null&&d.message)&&(r.options.message=e.escapeAllHtml(r.options.message)),i.onUnmounted(()=>{document.body.removeChild(s)}),i.onMounted(()=>{e.updateNotifyPositionForCreate(r,u)}),()=>i.createVNode(i.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[i.createVNode(ft,i.mergeProps({ref:u},r,{onClose:l}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.use(st.LocaleService.i18n),a.mount(s),a}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const o=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const r=this.getNotifyInstances(t.position),s=r.indexOf(e);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let o="",r="",s,a,u;typeof e=="string"?o=e:e&&(o=e.message||"",r=e.title||"",a=e.position||null,u=e.showCloseButton!=null?e.showCloseButton:null,s=e.timeout!=null?e.timeout:null);const d={options:{type:t,message:o,title:r}};return a!=null&&(d.position=a),u!=null&&(d.showCloseButton=u),s!=null&&(d.timeout=s),d}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Dn=Symbol("NOTIFY_SERVICE_TOKEN");ft.install=n=>{n.component(ft.name,ft),n.component(bt.name,bt);const t=new Ln;n.provide(Dn,t),n.provide("FNotifyService",t)},`${st.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const zn={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:st.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 Un(n,t,e,o,r,s,a,u,l,d,m,c,g,f,p,h,b){const{calculateCellPositionInRow:w}=s,{columnContext:E,hasLeftFixedColumn:R,hasRightFixedColumn:j}=a,{gridDataStyle:C,leftFixedGridDataStyle:y,rightFixedGridDataStyle:S}=f,{renderDataRow:A}=X.getHierarchyRow(n,t,E,b,u,l,d,m,c,g,f,p,h),I=[A];function $(z,Y){const se=w(z);return b.value.filter(N=>N.visible!==!1).map((N,B)=>I[N.type](N,se,Y,B))}function x(){return i.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:y.value},[$(E.value.leftColumns.filter(z=>z.visible),"left")])])}function D(){return i.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[i.createVNode("div",{class:"fv-grid-data",style:C.value},[$(E.value.primaryColumns.filter(z=>z.visible),"primary")])])}function L(){return i.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:S.value},[$(E.value.rightColumns.filter(z=>z.visible),"right")])])}function O(){const z=[];return R.value&&z.push(x()),z.push(D()),j.value&&z.push(L()),z}return{renderDataArea:O}}const Wn=i.defineComponent({name:"FTreeGrid",props:zn,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,t){var Jt,Kt;const o=((Jt=n.rowOption)==null?void 0:Jt.height)||28,r=i.ref(20),s=i.ref(n.columns),a=X.useIdentify(n),{idField:u}=a,l=i.ref(),d=i.ref(),m=i.ref(),c=i.ref(),g=i.ref(),f=i.ref([]),p=i.ref(!1),h=i.ref(((Kt=n.rowOption)==null?void 0:Kt.wrapContent)||!1),b=X.useGroupData(n,a),w=X.useFilter(n,t),E=X.useHierarchy(n),{collapseField:R}=E,{showLoading:j,renderLoading:C}=X.useLoading(n,l),y=X.useDataView(n,new Map,w,E,a),{dataView:S}=y,A=X.useSelection(n,y,a,f,t),{showSelection:I,selectedValues:$}=A,x=X.useSelectHierarchyItem(n,f,y,a,A,t),D=i.computed(()=>n.disabled),L=i.computed(()=>n.virtualized?Math.min(y.dataView.value.length,r.value):y.dataView.value.length),O=X.usePagination(n,y),{shouldRenderPagination:z}=O,{containerStyleObject:Y}=X.useDataViewContainerStyle(n),se=X.useCommandColumn(n),{applyCommands:N}=se;N(s);const{applyColumnSetting:B,removeColumnSetting:G}=X.useSettingColumn(n);n.showSetting&&B(s);const P=X.useColumn(n,t),K=X.useSort(n),{applyColumnSorter:he,columnContext:ve,updateColumnRenderContext:Q}=P;he(y,K);const oe=X.useGroupColumn(n,ve),ce=X.useRow(n,t,A,a),ee=X.useEdit(n,t,a,ce,f),q=X.useVisualDataBound(n),te=X.useVisualDataCell(n,ee,q),$e=X.useVisualDataRow(n,y,ee,E,a,q,te),Ne=X.useVisualData(n,s,y,L,0,$e),{getVisualData:Te}=Ne,Ge=X.useCellPosition(n,ve),He=X.useSidebar(n,A),{sidebarWidth:Qe}=He,ae=X.useVirtualScroll(n,y,f,ve,Ne,L,0,Qe),{onWheel:Je,dataGridWidth:ke,viewPortHeight:Ve,viewPortWidth:Ee,resetScroll:Pe,updateVisibleRowsOnLatestVisibleScope:Ke}=ae,Le=X.useFitColumn(n,ve,d,Ee,oe),{calculateColumnsSize:Me}=Le,Re=X.useFilterHistory(),_e=X.useColumnFilter(d,g,y,Re,ae),Xe=X.useDragColumn(n,t,P,y,oe,b,ae),T=i.computed(()=>{const V={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return we.getCustomClass(V,n.customClass)}),_=i.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":h.value})),{renderDataArea:le}=Un(n,t,m,c,g,Ge,P,y,ee,E,ce,A,x,ae,Ne,q,f),{renderGridHeader:de,renderGridColumnResizeOverlay:Be,shouldShowHeader:wt}=X.getColumnHeader(n,t,d,c,g,P,y,Xe,_e,w,Re,Le,oe,A,He,K,ae,Ee,f),{renderDataGridSidebar:St}=X.getSidebar(n,ce,A,He,ae),{renderDisableMask:At}=X.getDisableMask(),{renderHorizontalScrollbar:Tt}=X.getHorizontalScrollbar(n,d,ae),{renderVerticalScrollbar:Et}=X.getVerticalScrollbar(n,d,ae);function It(){var V,W,fe;if(d.value&&d.value.clientHeight>0&&((V=d.value)==null?void 0:V.clientWidth)>0){const ge=Math.ceil(d.value.clientHeight/o);ge>r.value&&(r.value=ge,Ke()),Ve.value=((W=m.value)==null?void 0:W.clientHeight)||0,ke.value=((fe=d.value)==null?void 0:fe.clientWidth)||0,Me()}}i.onMounted(()=>{d.value&&(r.value=Math.max(Math.ceil(d.value.clientHeight/o),r.value),f.value=Te(0,L.value+0-1),tn.useResizeObserver(d.value,It),Me(),i.nextTick(()=>{d.value&&(ke.value=d.value.clientWidth),m.value&&(Ee.value=m.value.clientWidth,Ve.value=m.value.clientHeight)})),j.value&&C()}),i.onUnmounted(()=>{}),i.watch(Ee,()=>{d.value&&Me()});function Ft(V){y.collapseTo(V),y.reOrderVisibleIndex(),Pe()}function gt(V){y.expandTo(V),y.reOrderVisibleIndex(),Pe()}function et(){const V=A.getSelectionRow();return V?V.dataIndex-1:-1}function Mt(){const V=et();y.insertNewDataItem(V),f.value=Te(0,L.value+0-1)}function Bt(){const V=et();y.insertNewChildDataItem(V),f.value=Te(0,L.value+0-1)}function jt(V,W){const fe=f.value.find(xe=>xe.raw[u.value]===W),ge=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(V,ge)}function Nt(){const V=et(),W=x.getNextSelectableHierarchyItemId(V);y.removeHierarchyDataItem(V),f.value=Te(0,L.value+0-1),W&&x.selectItemById(W)}function ht(V){ee.onEditingRow(V)}function kt(V){ee.acceptEditingRow(V)}function v(V){ee.cancelEditingRow(V)}function F(V){V&&(s.value=V,N(s),Q(s.value),he(y,K),Me())}i.watch(()=>n.columns,V=>{F(V)});function k(V,W){V&&(y.load(V),y.reOrderVisibleIndex(),W!=null&&W.keepScrollPosition?ae.scrollTo(ae.offsetY.value):Pe())}function H(V){x.selectItemById(V)}function Z(V){const W=f.value.find(fe=>fe.raw[a.idField.value]===V);W&&ce.clickRowItem(W)}function J(V){ce.activeRowById(V)}function Se(V){x.selectItemByIds(V)}function ye(){return A.getSelectedItems()}function be(){A.clearSelection()}const Ie=i.computed(()=>!f.value||!f.value.length),{renderEmpty:ue}=X.getEmpty(n,t);function Fe(){return A.getSelectionRow()}function Ce(V){x.unSelectItemByIds(V)}function me(){return A.currentSelectedDataId.value}function tt(V,W,fe){const ge=S.value.find(xe=>xe[u.value]===V);if(ge){if(Object.keys(ge).forEach(pe=>{Object.prototype.hasOwnProperty.call(W,pe)&&(ge[pe]=W[pe])}),fe){const{collapseField:pe,disabledField:De,checkedField:ze,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(ge.__fv_collapse__=W[pe]),ze&&!ie.isUndefined(W[ze])&&(ge.__fv_checked__=W[ze]),De&&!ie.isUndefined(W[De])&&(ge.__fv_disabled__=W[De]),Ue&&!ie.isUndefined(W[Ue])&&(ge.__fv_visible__=W[Ue])}const xe=f.value.find(pe=>pe.raw[u.value]===V),en=f.value.findIndex(pe=>pe.raw[u.value]===V);if(xe){if(xe.raw=ge,Object.keys(xe.data).forEach(pe=>{xe.data[pe].updateData(ge)}),fe){const{collapseField:pe,disabledField:De,checkedField:ze,visibleField:Ue}=fe;pe&&!ie.isUndefined(W[pe])&&(xe.collapse=W[pe]),ze&&!ie.isUndefined(W[ze])&&(xe.checked=W[ze]),De&&!ie.isUndefined(W[De])&&(xe.disabled=W[De]),Ue&&!ie.isUndefined(W[Ue])&&(xe.visible=W[Ue])}f.value=[...f.value.slice(0,en),xe,...f.value.slice(en+1)],y.updateSummary()}}}function nt(V){return Object.prototype.hasOwnProperty.call(V,"raw")?y.hasRealChildren(V.raw):y.hasRealChildren(V)}function ot(V){const W=y.dataView.value.find(fe=>fe[u.value]===V);return W?W[R.value]:""}function Vo(){return R.value}i.watch(()=>n.showSetting,(V,W)=>{V!==W&&(V?B(s):G(s),F(s.value))});function Po(V){return f.value.filter(W=>V.includes(W.raw[n.idField]))}function Ro(V){const W=a.idField.value,fe=f.value.find(ge=>ge.raw[W]===V);fe&&ce.changeRow(fe)}function Oo(){A.keepSelectingOnPaging.value||be(),y.updateVisibleDataSummary(f.value)}t.expose({activeRowById:J,addNewDataItem:Mt,addNewChildDataItem:Bt,addChildrenToNode:jt,collapseTo:Ft,expandTo:gt,removeDataItem:Nt,editDataItem:ht,acceptDataItem:kt,cancelDataItem:v,updateColumns:F,updateDataSource:k,selectItemById:H,selectItemByIds:Se,getSelectedItems:ye,clearSelection:be,getSelectionRow:Fe,clickRowItemById:Z,unSelectItemByIds:Ce,getCurrentRowId:me,reassignRowData:tt,hasChildren:nt,getCollapseField:Vo,getCollapseStatusById:ot,getVisibleDataByIds:Po,selectRowById:Ro,updateDerivedData:Oo});const qo=i.computed(()=>{const V={};return ae.shouldShowHorizontalScrollbar.value&&(V.paddingBottom="10px"),ae.shouldShowVirticalScrollbar.value&&(V.paddingRight="10px"),V}),$o=i.computed(()=>({...Y.value,borderRadius:"5px"}));X.getPagination(n,t,y,ae,O,A);const Ho=i.computed(()=>({"d-flex":!0,"justify-content-between":z.value&&I.value,"justify-content-end":z.value&&!I.value,"position-relative":!0})),Lo=i.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:Do}=X.getSummary(n,y,P);return()=>i.createVNode("div",{ref:l,class:T.value,style:$o.value,onWheel:Je},[d.value&&wt.value&&de(),i.createVNode("div",{ref:d,class:_.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:qo.value},[d.value&&St(f),d.value&&le(),d.value&&Ie.value&&ue(),d.value&&Tt(),d.value&&Et()]),d.value&&Do(),I.value&&i.createVNode("div",{class:Ho.value},[I.value&&i.createVNode("div",{class:Lo.value},[i.createVNode("div",null,["已选:"+$.value.length,i.createTextVNode(" 条")])])]),Be(),D.value&&At()])}});we.withInstall(Wn);function Gt(n,t){return{customClass:t.class,customStyle:t.style}}const Gn=new Map([["appearance",Gt]]);function Qn(n,t,e){return t}Ye({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"]},Gn,Qn,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const Ct=new Map([["appearance",Gt]]),_n=new Map([]),Xn="root-viewmodel";class Yn{constructor(t,e){U(this,"formSchemaUtils");U(this,"controlCreatorUtils");U(this,"designViewModelUtils");this.resolver=t,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const e=this.createComponentRefNode(t),o=this.createComponentNode(t),r=this.createViewModeNode(t),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(t){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),e}createComponentNode(t){const e=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(t);return Object.assign(e,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:o}),e}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),e.contents=[o];const{selectedFields:s}=t;s==null||s.forEach(u=>{if(u.$type===we.FormSchemaEntityField$Type.SimpleField){const l=ie.cloneDeep(u),d=this.resolveControlClassByFormColumns(t),m=this.controlCreatorUtils.setFormFieldProperty(l,"",d);m&&r.push(m)}});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(t){let e="";switch(t.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:Xn,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const e=[],{selectedFields:o}=t;return o==null||o.forEach(r=>{if(r.$type===we.FormSchemaEntityField$Type.SimpleField){let s="blur";const a=r.type.name;(a===we.FormSchemaEntityFieldTypeName.Enum||a===we.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),e.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}}),e}}function Zn(n,t,e,o){var s,a,u,l,d,m;const r=e.parentComponentInstance;if(r&&o){const c=(s=r.schema)==null?void 0:s.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=e.bindingSourceContext)==null?void 0:a.entityTitle)||((l=(u=e.bindingSourceContext)==null?void 0:u.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((d=e.bindingSourceContext)==null?void 0:d.bindTo)||"/",selectedFields:(m=e.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Yn(n,o).createComponent(f)}else return t}function Jn(n,t,e){return t}Ye({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},Ct,Zn);const Qt={$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"]};Ye({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}},Qt,Ct,void 0),Ye({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Qt,Ct,void 0);const Kn={$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"]},eo={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};it.createPropsResolver(eo,Kn,_n,Jn);const to={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 xt(){return new DOMException("The request is not allowed","NotAllowedError")}async function no(n){if(!navigator.clipboard)throw xt();return navigator.clipboard.writeText(n)}async function oo(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const e=window.getSelection(),o=window.document.createRange();e==null||e.removeAllRanges(),o.selectNode(t),e==null||e.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(t)}if(!r)throw xt()}async function io(n){try{await no(n)}catch(t){try{await oo(n)}catch(e){throw e||t||xt()}}}function ro(){async function n(t){await io(t)}return{onCopy:n}}function so(n,t,e,o){const r=i.ref(14),s=i.ref(140),a=i.ref(""),u=i.ref(o.value.length),l=i.computed(()=>o.value),d=i.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function m(c){if(c.currentTarget){const g=c.currentTarget.value||"";u.value=g.length}}return()=>i.createVNode(i.Fragment,null,[i.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:d.value,rows:"4",maxlength:s.value,onInput:c=>m(c)},[l.value]),i.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[u.value+" / "+s.value])])}function ao(n,t,e,o){const r=so(n,t,e,o),s=new Map([["text-area",r]]);function a(u){return s.get(u)||null}return{getEditorRender:a}}function lo(){const n=i.ref(!1),t=i.ref("复制成功");return{feedbackStyle:i.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:t,toShowFeedback:n}}function co(n,t){const e=t.getEditorRender(n.promptEditorType);return()=>e&&e()}function uo(n,t){function e(f){if(f==null)return 0;let p=0;for(let h=0;h<f.length;h++){const b=f.charCodeAt(h);b>=0&&b<=128?p++:p=p+2}return p}function o(f,p){if(f!==""&&f!==void 0&&f!==null){f=""+f;const h=f.length;let b="",w=0;for(let E=0;E<h;E++){const R=f.charAt(E);if(w++,encodeURI(R).length>4&&w++,b=b.concat(R),w>=p)return b=b.concat("..."),b}if(w<p)return f}return""}const r=i.computed(()=>!!n.value&&!!n.value.date),s=i.computed(()=>{const f=n.value&&n.value.date||"";return`${t.exception.happend} : ${f}`}),a=i.computed(()=>!!n.value&&!!n.value.detail),u=i.computed(()=>n.value?e(n.value.detail)>160:!1),l=i.ref(!1),d=i.computed(()=>l.value?t.exception.collapse:t.exception.expand),m=i.computed(()=>{const f=t.exception.detail+" : "+(n.value&&n.value.detail)||"";return l.value?f:o(f,160)}),c=i.computed(()=>({position:"absolute",right:0,bottom:l.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function g(){l.value=!l.value}return()=>i.createVNode("div",{class:"toast-msg-detail"},[r.value&&i.createVNode("div",null,[s.value]),a.value&&i.createVNode("div",{class:"exception_wrap"},[i.createVNode("div",{class:"exception_error_msg"},[i.createVNode("div",{innerHTML:m.value},null),u.value&&i.createVNode("span",{style:c.value,onClick:g},[d.value])])])])}function fo(n){return()=>i.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function po(n,t,e,o,r){const s=i.ref(n.exceptionInfo),a=i.computed(()=>{const p=t.value==="question"?"warning":t.value,h={"f-icon":!0},b=`f-icon-${p}`;return h[b]=!0,h}),u=i.computed(()=>e.value||s.value&&s.value.message),l=i.computed(()=>o.value),d=i.computed(()=>!!o.value),m=i.computed(()=>!!s.value);function c(){return m.value?uo(s,r):d.value?fo(l):()=>null}const g=c(),f=i.computed(()=>r.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"float-left modal-tips-iconwrap"},[i.createVNode("span",{class:a.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[i.createVNode("p",{class:"toast-msg-title",innerHTML:u.value,style:f.value},null),g()])])}function mo(n,t,e,o){const{onCopy:r}=t,{toShowFeedback:s}=e,a=i.ref(o.exception.copySuccess||"复制成功"),u=i.ref(o.exception.copy||"复制详细信息"),l=i.ref(n.exceptionInfo||{date:"",message:"",detail:""}),d=i.computed(()=>l.value&&l.value.detail||"");function m(c){r(d.value).catch(g=>{a.value=o.exception.copyFailed||"复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>i.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[i.createVNode("span",{onClick:m,style:"cursor: pointer;"},[u.value])])}function go(n,t,e,o,r){const s=i.ref(n.type),a=i.ref(n.buttons),u=i.ref(n.exceptionInfo),l=i.ref(r.ok||n.okButtonText),d=i.ref(r.cancel||n.cancelButtonText),m=i.ref(n.showCancelButton),c=i.ref(n.showOkButton),g=i.computed(()=>!!(a.value&&a.value.length)),f=i.computed(()=>!!(u.value&&u.value.detail)),p=i.computed(()=>!(a.value&&a.value.length)&&(c.value||m.value)),h=mo(n,e,o,r);l.value==="关闭"?l.value=r.close:l.value==="知道了"&&(l.value=r.exception.roger);function b(E){s.value==="question"&&t.emit("reject"),t.emit("close")}function w(E){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>i.createVNode("div",{class:"modal-footer"},[f.value&&h(),p.value&&m.value&&i.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[d.value]),p.value&&c.value&&i.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:w},[l.value]),g.value&&a.value.length&&a.value.map(E=>i.createVNode("button",{type:"button",onClick:E.handle,class:E.class},[E.iconClass&&i.createVNode("span",{class:E.iconClass},null),E.text]))])}function ho(n){const{t,locale:e}=rt.useI18n();function o(r,s,a){return s===a?t(r):s}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:e.value}}const pt=i.defineComponent({name:"FMessageBox",props:to,emits:["accept","reject","close"],setup(n,t){const e=ho(n),o=i.ref(n.type),r=i.ref(n.title),s=i.ref(n.detail),a=i.computed(()=>{const w={"modal-tips":!0,"d-flex":!0,"flex-row":!0},E=`messager-type-${o.value}`;return w[E]=!0,w}),u=i.computed(()=>{const w={cursor:"default"};return o.value==="prompt"?w.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(w.padding="0.5rem 1.5rem 1rem 1.5rem"),w}),l=ro(),d=ao(n,o,r,s),m=lo(),{feedbackStyle:c,feedbackMessage:g}=m;g.value=e.exception.copySuccess;function f(){return i.createVNode("div",{style:c.value},[g.value])}function p(){switch(o.value){case"prompt":return co(n,d);default:return po(n,o,r,s,e)}}const h=p(),b=go(n,t,l,m,e);return()=>i.createVNode("div",{class:"farris-messager"},[!n.exceptionInfo&&i.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),i.createVNode("section",{class:a.value,style:u.value},[h()]),b(),f()])}}),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:"关闭前回调"}},yo=new Map([["appearance",it.resolveAppearance]]);function bo(n,t,e){return t}function Co(){function n(t,e){const o={};return o.beforeClose=r=>e.call("beforeClose",[r,t]),o}return{resolve:n}}const _t={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"}},xo=it.createPropsResolver(_t,vo,yo,bo),wo=Co();class re{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const o=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new re(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new re(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let o=0;o<t.changedTouches.length;o++)if(t.changedTouches[o].target===e)return new re(t.changedTouches[o].clientX,t.changedTouches[o].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new re(0,0);if(window){const o=window.getComputedStyle(t);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);e.x=isNaN(r)?0:r,e.y=isNaN(s)?0:s}return e}return null}static copy(t){return new re(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class Oe{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new Oe(0,0);if(window){const o=window.getComputedStyle(t);return o&&(e.width=parseInt(o.getPropertyValue("width"),10),e.height=parseInt(o.getPropertyValue("height"),10)),e}return null}static copy(t){return new Oe(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function So(n,t){const e=i.ref(),o=i.ref(),r=i.ref(),s=i.ref(),a=i.ref(),u=i.ref(),l=i.ref(),d=i.ref(),m=i.ref(),c=i.ref(),g=i.ref(),f=i.ref(n.resizeable),p=i.ref(),h=i.ref(n.draggable),b=i.ref(!1);function w(){const N=o.value||document.body,B=window.getComputedStyle(N);if(!B||!e.value)return;const G=re.getTransformInfo(e.value),P={};l.value&&(P.deltaL=e.value.offsetLeft-l.value.x,P.deltaT=e.value.offsetTop-l.value.y);const K=B.getPropertyValue("position");P.width=N.clientWidth,P.height=N.clientHeight,P.pr=parseInt(B.getPropertyValue("padding-right"),10),P.pb=parseInt(B.getPropertyValue("padding-bottom"),10),P.position=B.getPropertyValue("position"),K==="static"&&(N.style.position="relative"),P.translateX=G.x,P.translateY=G.y,c.value=P}function E(N){if(e.value){s.value=Oe.getCurrent(e.value),a.value=re.getCurrent(e.value),u.value=s.value?Oe.copy(s.value):null,l.value=a.value?re.copy(a.value):null,w();const B=N.target.getAttribute("type")||"";d.value={n:!!B.match(/n/),s:!!B.match(/s/),w:!!B.match(/w/),e:!!B.match(/e/)}}}function R(){var N,B,G,P;if(e.value){const K=e.value;d.value&&((d.value.n||d.value.s)&&((N=u.value)!=null&&N.height)&&(K.style.height=u.value.height+"px"),(d.value.w||d.value.e)&&((B=u.value)!=null&&B.width)&&(K.style.width=u.value.width+"px"),l.value&&((G=l.value)!=null&&G.x&&(K.style.left=l.value.x+"px"),(P=l.value)!=null&&P.y&&(K.style.top=l.value.y+"px")))}}function j(){const N=n.minHeight?n.minHeight:1,B=n.minWidth?n.minWidth:1;u.value&&l.value&&d.value&&s.value&&(u.value.height<N&&(u.value.height=N,d.value.n&&a.value&&(l.value.y=a.value.y+(s.value.height-N))),u.value.width<B&&(u.value.width=B,d.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-B))),n.maxHeight&&u.value.height>n.maxHeight&&(u.value.height=n.maxHeight,a.value&&d.value.n&&(l.value.y=a.value.y+(s.value.height-n.maxHeight))),n.maxWidth&&u.value.width>n.maxWidth&&(u.value.width=n.maxWidth,d.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-n.maxWidth))))}function C(){if(o.value){const N=c.value;if(l.value&&u.value&&d.value&&s.value){const B=N.width-N.pr-N.deltaL-N.translateX-l.value.x,G=N.height-N.pb-N.deltaT-N.translateY-l.value.y;d.value.n&&l.value.y+N.translateY<0&&a.value&&(l.value.y=-N.translateY,u.value.height=s.value.height+a.value.y+N.translateY),d.value.w&&l.value.x+N.translateX<0&&a.value&&(l.value.x=-N.translateX,u.value.width=s.value.width+a.value.x+N.translateX),u.value.width>B&&(u.value.width=B),u.value.height>G&&(u.value.height=G)}}}function y(N){if(!r.value||!s.value||!a.value||!d.value)return;N.subtract(r.value);const B=N.x,G=N.y;d.value.n?(l.value.y=a.value.y+G,u.value.height=s.value.height-G):d.value.s&&(u.value.height=s.value.height+G),d.value.e?u.value.width=s.value.width+B:d.value.w&&(u.value.width=s.value.width-B,l.value.x=a.value.x+B),C(),j(),R()}function S(N){if(!m.value)return;const B=re.fromEvent(N);B&&y(B)}function A(){if(e.value){const{width:N,height:B,x:G,y:P}=e.value.getBoundingClientRect(),K=re.getTransformInfo(e.value);return{size:{width:N,height:B},position:{x:G-K.x,y:P-K.y}}}return null}function I(N){if(e.value){const B=A();g.value=B}r.value=void 0,s.value=null,a.value=null,u.value=null,l.value=null,d.value=null,m.value=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)}function $(){document.addEventListener("mousemove",S),document.addEventListener("mouseup",I)}function x(N){N instanceof MouseEvent&&N.button===2||h.value&&(document.body.click(),N.stopPropagation(),N.preventDefault(),r.value=re.fromEvent(N),m.value=N.target,E(N),$())}function D(N){return e.value=N,f.value&&i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:B=>x(B)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:B=>x(B)},null)])}function L(N=!0){document.body.click();const B=o.value||document.body,G=Oe.getCurrent(B),P=e.value;N&&P&&(p.value=A(),p.value.transform=P.style.transform),G&&P&&(u.value=G,u.value.height-=14,u.value.width-=14,P.style.height=u.value.height+"px",P.style.width=u.value.width+"px",P.style.left="7px",P.style.top="7px",P.style.transform="",g.value={size:u.value,position:{x:0,y:0}},h.value=!1,b.value=!0)}function O(){var N,B;if(document.body.click(),p.value){const G={width:p.value.size.width||0,height:p.value.size.height||0},P={x:(window.innerWidth-G.width)/2,y:(window.innerHeight-G.height)/2};(N=u.value)==null||N.set(G),(B=l.value)==null||B.set(P);const K=e.value;K.style.height=G.height+"px",K.style.width=G.width+"px",K.style.left=`${P.x}px`,K.style.top=`${P.y}px`,K.style.transform="",g.value={size:G,position:P},h.value=n.draggable,b.value=!1}}function z(){if(e.value){const N=Oe.getCurrent(e.value);if(N){const{width:B,height:G}=N;e.value.style.left=`${(window.innerWidth-B)/2}px`,e.value.style.top=`${(window.innerHeight-G)/2}px`,e.value.style.transform=""}}}function Y(){const N=()=>{b.value?L(!1):z(),document.body.click()};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}}const se=Y();return{renderResizeBar:D,boundingElement:o,resizedEventParam:g,maximize:L,restore:O,allowDrag:h,isMaximized:b,unWindowResizeHandle:se,moveToCenter:z}}function Ao(n,t,e){const o=i.ref(),r=i.ref(n.draggable),s=i.ref(n.lockAxis),a=i.ref(),u=i.ref(),l=i.ref(!1),d=i.ref(new re(0,0)),m=i.ref(new re(0,0)),c=i.ref(new re(0,0)),g=i.ref(new re(0,0));i.watch(()=>e.value,S=>{a.value.style.cursor=S?"move":"default"});function f(S,A){if(A.tagName==="BUTTON")return!1;if(A===S)return!0;for(const I in A.children)if(Object.prototype.hasOwnProperty.call(A.children,I)&&f(S,A.children[I]))return!0;return!1}function p(){var $,x;let S=c.value.x+m.value.x,A=c.value.y+m.value.y;s.value==="x"?(S=(($=d.value)==null?void 0:$.x)||0,c.value.x=0):s.value==="y"&&(A=((x=d.value)==null?void 0:x.y)||0,c.value.y=0);const I=`translate3d(${Math.round(S)}px, ${Math.round(A)}px, 0px)`;o.value&&(o.value.style.transform=I),g.value.x=S,g.value.y=A}function h(){if(!u.value||!o.value)return null;const S=u.value.getBoundingClientRect(),A=o.value.getBoundingClientRect(),I={top:S.top<A.top,right:S.right>A.right,bottom:S.bottom>A.bottom,left:S.left<A.left};return I.top||(c.value.y-=A.top-S.top),I.bottom||(c.value.y-=A.bottom-S.bottom),I.right||(c.value.x-=A.right-S.right),I.left||(c.value.x-=A.left-S.left),p(),I}function b(S){S&&(d.value&&S.subtract(d.value),c.value.set(S),p(),h())}function w(S){l.value&&r.value&&(S.stopPropagation(),S.preventDefault(),b(re.fromEvent(S,a.value)))}function E(){var S;l.value&&(l.value=!1,m.value.add(c.value),c.value.reset(),(S=o.value)==null||S.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E))}function R(){!l.value&&a.value&&(l.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",w),document.addEventListener("mouseup",E))}function j(){if(o.value){const S=re.getTransformInfo(o.value);m.value.set(S);return}m.value.reset()}function C(S){if(!e.value||S instanceof MouseEvent&&S.button===2)return;const A=S.target||S.srcElement;a.value!==void 0&&A&&!f(A,a.value)||r.value!==!1&&(document.body.click(),S.stopPropagation(),S.preventDefault(),d.value=re.fromEvent(S,o.value),j(),R())}function y(S,A,I){if(r.value&&A){if(S)a.value=S;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)a.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const $=A.querySelector(n.dragHandle);$&&(a.value=$)}}o.value=A,u.value=I,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",C)):r.value=!1}}return{registerDraggle:y,resetTranslate:j}}function Xt(n,t){if(n){const e=o=>{o.key.toLowerCase()===n.toLowerCase()&&t({event:o,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function To(n,t){const e=i.ref(n.enableEsc);let o=null;return e.value?(o=Xt("Escape",r=>{t.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Eo(n,t){const e=i.ref(n.enableEnter);let o=null;return e.value?(o=Xt("Enter",r=>{t.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const qe=i.defineComponent({name:"FModal",props:_t,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,t){const e=i.ref(n.width||300),o=i.ref(n.height||200),r=i.ref(n.modelValue),s=i.ref(""),a=i.ref(n.class),u=i.ref(n.fitContent),l=i.ref(n.showHeader),d=i.ref(""),m=i.ref(n.showCloseButton),c=i.ref(n.showMaxButton),g=i.ref(!1),f=i.ref(n.dialogType),p=i.ref(n.src),h=i.ref(""),b=i.ref(n.showButtons),w=i.ref(n.title),E=i.ref(n.containment||null),R=i.ref(),{t:j}=rt.useI18n();w.value==="错误提示"&&(w.value=j("messageBox.errorTitle"));const C=i.ref(!1);function y(T,_){const le=_?"accept":"cancel";Promise.resolve().then(()=>{var de;return(de=n.beforeClose)==null?void 0:de.call(n,{closeType:le})}).then(de=>{de&&(r.value=!1,t.emit("update:modelValue",!1),_!=null&&t.emit(_?"accept":"cancel"),t.emit("closed",T))})}const S=[{name:"cancel",text:j("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:T=>{y(T,!1)}},{name:"accept",text:j("messageBox.ok")||"确定",class:"btn btn-primary",handle:T=>{y(T,!0)}}],A=i.ref(n.buttons&&n.buttons.length?n.buttons:S),I=i.computed(()=>!!d.value),$=i.computed(()=>!!b.value&&!!A.value),x=i.ref(),D=i.ref(),L=i.ref(!1),{renderResizeBar:O,maximize:z,restore:Y,boundingElement:se,resizedEventParam:N,allowDrag:B,unWindowResizeHandle:G,moveToCenter:P}=So(n),{registerDraggle:K}=Ao(n,t,B);function he(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ve(){const T=document.querySelectorAll(".farris-modal").length;(!T||T-1<=0)&&document.body.classList.remove("modal-open"),R.value&&R.value.classList.remove("show")}i.watch(()=>n.title,(T,_)=>{T!==_&&(w.value=T)}),i.watch(()=>n.modelValue,(T,_)=>{T!==_&&(r.value=T,r.value&&n.draggable&&i.nextTick(()=>{D.value&&!E.value&&(E.value=D.value.parentElement,se.value=E.value,K(x.value,D.value,se.value),P())}),T||(E.value&&(E.value=null),ve())),r.value?C.value=he():(L.value=!1,B.value=n.draggable)}),i.watch(()=>n.showHeader,(T,_)=>{T!==_&&(l.value=T)}),i.watch(()=>n.showButtons,(T,_)=>{T!==_&&(b.value=T)}),i.watch(()=>N.value,(T,_)=>{const le=T||{},de=_||{};JSON.stringify(le)!==JSON.stringify(de)&&t.emit("resize",{newSize:T,oldSize:_,isMaximized:L.value})});const Q=i.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),oe=i.computed(()=>{var le;const T={modal:!0,"farris-modal":!0,fade:!0};T["f-modal-fitContent"]=!!u.value,T.show=!!Q.value;const _=(le=n.maskClass)==null?void 0:le.split(" ");return _==null||_.reduce((de,Be)=>(de[Be]=!0,de),T),T}),ce=i.computed(()=>{var le;const T={"modal-dialog":!0},_=(le=a.value)==null?void 0:le.split(" ");return _==null||_.reduce((de,Be)=>(de[Be]=!0,de),T),T}),ee=i.computed(()=>{const T={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:u.value?"auto":`${o.value}px`};return n.mask||(T.pointerEvents="auto"),T}),q=()=>we.getMaxZIndex()||1040,te=i.computed(()=>{const T={display:"block",zIndex:q()};return n.mask||(T.pointerEvents="none",T.backgroundColor="transparent"),C.value&&(T.backgroundColor="transparent"),T}),$e=i.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Ne=i.computed(()=>{const T={display:l.value?"":"none"};return T["pointer-events"]=B.value?"auto":"none",T}),Te=i.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:L.value})),Ge=i.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function He(){return{height:`${n.footerHeight||60}px`}}const Qe=i.computed(()=>{const T={textAlgin:h.value},_=He();return Object.assign(T,_)});function ae(T){if(T==null||T.stopPropagation(),L.value){L.value=!1,Y();return}z(),L.value=!0}async function Je(T,_){T.handle&&await T.handle(_,T)&&t.emit("closed",_)}function ke(T){T.width&&(e.value=T.width),T.height&&(o.value=T.height),T.buttons&&(A.value=T.buttons),T.title&&(w.value=T.title)}let Ve=null,Ee=null;i.onBeforeMount(()=>{C.value=he()}),i.onMounted(()=>{D.value&&!E.value&&(E.value=D.value.parentElement,se.value=E.value,K(x.value,D.value,se.value)),Q.value&&document.body.classList.add("modal-open"),Ve=To(n,t),Ee=Eo(n,t)}),i.onUnmounted(()=>{G&&G(),Ve&&Ve.remove(),Ee&&Ee.remove()}),t.expose({modalElementRef:D,updateModalOptions:ke,close:y,maxDialog:ae,isMaximized:L});function Pe(){return i.createVNode("ul",null,[g.value&&i.createVNode("li",{class:"f-btn-icon f-bare"},[i.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&i.createVNode("li",{onClick:ae,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[i.createVNode("span",{class:Te.value},null)]),m.value&&i.createVNode("li",{class:"f-btn-icon f-bare",onClick:T=>y(T,!1),style:"pointer-events: auto;"},[i.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return i.createVNode("div",{class:"modal-footer",style:Qe.value},[A.value&&A.value.map(T=>{const _=i.ref(T.disabled);return i.createVNode("button",{name:T.name,type:"button",disabled:_.value,class:T.class+(T.iconClass?" btn-icontext":""),onClick:le=>{Je(T,le)}},[!!T.iconClass&&i.createVNode("i",{class:T.iconClass},null),T.text])})])}function Le(){return i.createVNode("div",{ref:x,class:"modal-header",style:Ne.value},[t.slots.headerTemplate?t.slots.headerTemplate():i.createVNode("div",{class:"modal-title"},[I.value&&i.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),i.createVNode("span",{class:"modal-title-label"},[w.value])]),i.createVNode("div",{class:"actions"},[Pe()])])}function Me(){return t.slots.footerTemplate?t.slots.footerTemplate():$.value&&Ke()}function Re(T){if(T.stopPropagation(),n.allowClickMaskToClose){if(T.target!==R.value)return;y(T,!1)}}function _e(){var T,_;return i.createVNode("div",{id:s.value,class:ce.value,style:ee.value,ref:D},[i.createVNode("div",{class:$e.value},[l.value&&Le(),i.createVNode("div",{class:Ge.value},[(_=(T=t.slots).default)==null?void 0:_.call(T),f.value==="iframe"&&i.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Me()]),!u.value&&D.value&&!L.value&&O(D.value)])}function Xe(T){return T||"body"}return()=>i.createVNode(i.Teleport,{to:Xe(n.host)},{default:()=>[Q.value&&i.createVNode(i.Transition,{name:"fade",appear:!0},{default:()=>[i.createVNode("div",{ref:R,class:oe.value,style:te.value,onClick:Re},[_e()])]})]})}});function Yt(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Io(n){const t=document.createElement("div");t.style.display="contents";const e=i.createApp({setup(o,r){i.onUnmounted(()=>{document.body.removeChild(t)});const s=i.ref(),a=i.ref(n.class||""),u=i.ref(!!n.showButtons),l=i.ref(!!n.showHeader),d=i.ref(n.showCloseButton==null?!0:n.showCloseButton),m=i.ref(!0),c=i.ref(n.title||""),g=n.acceptCallback||(()=>{}),f=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),h=n.resizeHandle||(R=>{}),b=n.stopMoveHandle||(R=>{}),w=Yt(n),E=R=>{m.value=!1,e.unmount(),p(R)};return i.onMounted(()=>{}),r.expose({modalRef:s}),()=>i.createVNode(qe,{ref:s,class:a.value,modelValue:m.value,"onUpdate:modelValue":R=>m.value=R,title:c.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":l.value,"show-buttons":u.value,"show-close-button":d.value,"show-max-button":!1,onAccept:g,onCancel:f,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:E,onResize:h,onStopMove:b},{default:()=>[w&&w(e)]})}});return document.body.appendChild(t),e.use(st.LocaleService.i18n),e.mount(t),e}class Zt{constructor(t){U(this,"appContext",null);U(this,"modalRef",i.ref());U(this,"activeModalIndex",i.ref(0));U(this,"modalRefs",{});U(this,"isUseEscCloseModal",i.ref(!1));U(this,"activeModalInstance",i.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,e){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<t&&(t=o-14),r<e&&(e=r-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return Io(e)}close(t){var e,o;t?(o=t.value)==null||o.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const o=i.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),r=i.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),u=o.value.closedCallback||((C,y)=>{}),l=o.value.resizeHandle||(C=>{}),d=t.stopMoveHandle||(C=>{});let m;const c=Yt(o.value),g=C=>{var S;r.value=!1;const y=(S=C==null?void 0:C.target)==null?void 0:S.classList.contains("modal_close");u(C,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},f=C=>{g(C),m&&i.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],i.render(null,e),m=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(S=>Number(S));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=C=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(C==null?void 0:C.event))},{width:h,height:b}=o.value,w=this.adaptToWindow(h||500,b||320);Object.assign(o.value,w);const E=()=>i.createVNode(qe,i.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":C=>r.value=C},o.value,{onAccept:s,onCancel:a,onClosed:f,onResize:l,onEsc:p,onStopMove:d}),{default:()=>[c&&c(this.app)]});return m=(C=>{const y=i.h(E,C);return y.appContext=this.appContext,i.render(y,e),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:C=>{o.value={...o.value,...C},m&&i.render(i.cloneVNode(m,{...o}),e)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Fo=Symbol("FModalService");qe.install=n=>{n.component(qe.name,qe);const t=new Zt(n);n.provide(Fo,t),n.provide("FModalService",t)},qe.register=(n,t,e,o)=>{n.modal=qe,t.modal=xo,o.modal={callbackResolver:wo}};const Ae=class Ae{static show(t){const e=i.reactive({...t}),o=!1,r=e.type==="error"||e.type==="prompt",s=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",a=e.acceptCallback||(()=>{}),u=e.rejectCallback||(()=>{});let l=null,d=new Zt(Ae.app);const m=()=>{l&&(l==null||l.destroy(),d=null)};return l=d==null?void 0:d.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>i.createVNode(pt,i.mergeProps(e,{onAccept:a,onReject:u,onClose:m}),null)}),d==null?void 0:d.getCurrentModal()}static info(t,e){const o=i.reactive({type:"info",title:t,detail:e,okButtonText:"知道了",showCancelButton:!1});Ae.show(o)}static warning(t,e){const o=i.reactive({type:"warning",title:t,detail:e,okButtonText:"知道了",showCancelButton:!1});Ae.show(o)}static success(t,e){const o=i.reactive({type:"success",title:t,detail:e,okButtonText:"关闭",showCancelButton:!1});Ae.show(o)}static error(t,e,o){const r=i.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:t,detail:e}});Ae.show(r)}static prompt(t,e){const o=i.reactive({type:"prompt",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消"});Ae.show(o)}static question(t,e,o,r){const s=i.reactive({type:"question",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Ae.show(s)}};U(Ae,"app",null);let mt=Ae;pt.install=n=>{n.component(pt.name,pt),mt.app=n,n.provide("FMessageBoxService",mt)};class Mo extends Pn{constructor(e,o){super(e,o);U(this,"responseLayoutEditorFunction");U(this,"bindingVarible");U(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=On(this.formSchemaUtils)}getCommonPropertyConfig(e,o,r="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(e,o,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,o),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group")}getPropertyConfig(e,o){return this.getCommonPropertyConfig(e,o,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(e,o){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,o,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,o,r="Card"){const s=this;this.setDesignViewModelField(e);const{canChangeControlType:a,editorTypeList:u}=this.getAvailableEditorType(e),l={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:u,readonly:!a}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(d,m,c){if(d)switch(d&&d.propertyID){case"type":{s.changeControlType(e,d,o);break}case"label":{d.needRefreshControlTree=!0;break}case"binding":{s.changeBindingField(e,d,c);break}}}};return r.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(e,o){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==we.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var s;const o=this.checkCanChangeControlType(e,this.viewModelId);if(!o)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((s=M[e.editor.type])==null?void 0:s.name)||e.editor.type}]};let r=[];return this.designViewModelField&&this.designViewModelField.$type===we.FormSchemaEntityField$Type.SimpleField?r=ct.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(r=ct.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:o,editorTypeList:r}}changeBindingField(e,o,r){o.needRefreshEntityTree=!0}getAppearanceProperties(e,o){const r=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,r.componentId)}}},setPropertyRelates(s,a){if(s)switch(s&&s.propertyID){case"responseLayout":r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(s.propertyValue,r.componentId||e.id),r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId),r.updateElementByParentContainer(e.id,o),delete e.responseLayout;break;case"class":r.updateUnifiedLayoutAfterControlChanged(s.propertyValue,e.id,this.componentId),lt.value++;break;case"style":{lt.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,o,r){const s=o.propertyValue,a=r&&r.parent&&r.parent.schema;if(!a)return;const u=a.contents.findIndex(m=>m.id===e.id);if(u===-1)return;const l=a.contents[u];let d;if(this.designViewModelField){const g=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};g.editor||(g.editor={}),g.editor.$type=s,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,g,!1),d=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,s)}d||(d=this.controlCreatorUtils.createFormGroupWithoutField(s)),Object.assign(d,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(d,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(m=>{Object.prototype.hasOwnProperty.call(l.editor,m)&&(d.editor[m]=l.editor[m])}),r!=null&&r.updateContextSchema?r.updateContextSchema(d):(r.schema=Object.assign(l,d),Object.assign(e,d)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(m=>m.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(m=>m.classList.remove("dgComponentFocused")),lt.value++,i.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,o={},r={},s){var g;const a=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},o),u=(g=e.binding)!=null&&g.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(e,u,"readonly"),d=this.getPropertyEditorParams(e,u,"required"),m={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:d},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const f in r)m[f]=Object.assign(m[f]||{},r[f]);const c=this;return{...a,properties:{...m},setPropertyRelates(f,p){if(f){switch(f.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(e,f);break}s&&s.bind(c)(f,e,p)}}}}updateUnifiedLayoutAfterControlChanged(e,o,r){const s=e.split(" ");let a=s.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),u=s.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=s.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),d=s.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));a=a||"col-12",u=u||"col-md-"+a.replace("col-",""),l=l||"col-xl-"+u.replace("col-md-",""),d=d||"col-el-"+l.replace("col-xl-","");const m={id:o,columnInSM:parseInt(a.replace("col-",""),10),columnInMD:parseInt(u.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(d.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(r,m)}updateUnifiedLayoutAfterResponseLayoutChanged(e,o){const{formNode:r}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!r||!r.unifiedLayout)return;const s=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,s,1),o){const p=s.find(h=>h.id===o.id);Object.assign(p||{},o)}const a=s.map(p=>p.columnInSM),u=s.map(p=>p.columnInMD),l=s.map(p=>p.columnInLG),d=s.map(p=>p.columnInEL),m=this.checkIsUniqueColumn(a)?a[0]:null,c=this.checkIsUniqueColumn(u)?u[0]:null,g=this.checkIsUniqueColumn(l)?l[0]:null,f=this.checkIsUniqueColumn(d)?d[0]:null;Object.assign(r.unifiedLayout,{uniqueColClassInSM:m,uniqueColClassInMD:c,uniqueColClassInLG:g,uniqueColClassInEL:f})}checkIsUniqueColumn(e){const o=new Set(e);return Array.from(o).length===1}getItemCollectionEditor(e,o,r){return o=o||"value",r=r||"name",{editor:{columns:[{field:o,title:"值",dataType:"string"},{field:r,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:o,nameField:r,requiredFields:[o,r],uniqueFields:[o,r],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===we.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,o){e.binding&&e.binding.type===dt.Form&&e.binding.field?(o.find(a=>a.label==="fieldValueChanging")||o.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),o.find(a=>a.label==="fieldValueChanged")||o.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):o=o.filter(r=>r.label!=="fieldValueChanging"&&r.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case dt.Form:return e.binding.path||e.type;case dt.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,o="card",r,s){const a=this;let u=[];r&&(u=u.concat(r)),this.appendFieldValueChangeEvents(e,u);const l=a.eventsEditorUtils.formProperties(e,a.viewModelId,u);return{title:"事件",hideTitle:!0,properties:a.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,g){const f=c.propertyValue;delete e[a.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,f.controlInfo={type:a.getControlMethodType(e),name:e.title},a.eventsEditorUtils.saveRelatedParameters(e,a.viewModelId,f.events,f)),s&&s(c,g,f);const p=a.designViewModelUtils.getDgViewModel(a.viewModelId);p&&a.designViewModelField&&p.changeField(a.designViewModelField.id,{valueChanging:e.fieldValueChanging,valueChanged:e.fieldValueChanged})}}}getExpressionConfig(e,o,r=["compute","dependency","validate"],s){return new Wt(this.formSchemaUtils).getExpressionConfig(e,o,r,s)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,o,r){var s;e.editor[o]!==r?e.editor[o]=r:(s=this.getFormDesignerInstance())==null||s.reloadPropertyPanel()}setBooleanValue(e,o,r){let s=r;this.getBindingDataType()==="string"&&(s=(s||"").trim()||(o==="trueValue"?"true":"false"));const u=o==="trueValue"?"falseValue":"trueValue";e.editor[u]===s&&(s=s+1),this.updatePropertyValue(e,o,s)}getBooleanValueConverter(){return{convertFrom:(e,o)=>e.editor[o],convertTo:(e,o,r)=>{this.setBooleanValue(e,o,r)}}}}class Bo extends Mo{constructor(t,e){super(t,e)}getEditorProperties(t){return{description:"编辑器",title:"编辑器",type:"avatar",$converter:"/converter/property-editor.converter",parentPropertyID:"editor",properties:{readonly:{description:"",title:"只读",type:"boolean"},avatarWidth:{description:"",title:"头像宽度",type:"number"},avatarHeight:{description:"",title:"头像高度",type:"number"},cover:{description:"",title:"封面",type:"string"}}}}}function jo(n,t){const e=n.schema;function o(r,s){return new Bo(r,t).getPropertyConfig(e,s)}return{getPropsConfig:o}}const No=i.defineComponent({name:"FAvatarDesign",props:at,emits:["change","update:modelValue"],setup(n,t){const e=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),s=jo(r,o),a=vt.useDesignerComponent(e,r,s);i.onMounted(()=>{e.value.componentInstance=a}),t.expose(a.value);const u=i.computed(()=>({"f-avatar":!0,"f-avatar-readonly":n.readonly,"f-avatar-circle":n.shape==="circle","f-avatar-square":n.shape==="square"})),l=i.ref(n.modelValue),d=i.computed(()=>({width:n.avatarWidth+"px",height:n.avatarHeight+"px"})),m=!1;function c(){return""}function g(){}const f=i.ref(null),{acceptTypes:p,imageSource:h,onClickImage:b}=Ut(n,t,f,l);return()=>i.createVNode("div",{ref:e,class:u.value,style:d.value,onClick:b},[m,i.createVNode("img",{title:n.title,class:"f-avatar-image",src:h.value,onError:c},null),!n.readonly&&i.createVNode("div",{class:"f-avatar-icon"},[i.createVNode("span",{class:"f-icon f-icon-camera"},null)]),i.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:p.value,onChange:g,style:"display: none;"},null)])}});Ze.register=(n,t,e,o)=>{n.avatar=Ze,t.avatar=yt},Ze.registerDesigner=(n,t,e)=>{n.avatar=No,t.avatar=yt};const ko=we.withInstall(Ze);ne.FAvatar=Ze,ne.avatarProps=at,ne.default=ko,ne.propsResolver=yt,Object.defineProperties(ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|