@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,2 +1,2 @@
|
|
|
1
1
|
(function(oe,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("vue-i18n"),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","../common/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","vue-i18n","../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):(oe=typeof globalThis<"u"?globalThis:oe||self,i(oe.textarea={},oe.Vue,oe.LodashES,oe.common,oe.dynamicResolver,oe.designerCanvas,oe.vueI18n,oe.locale,oe.VueUseCore,oe.dataView))})(this,function(oe,i,re,ve,it,Pt,gt,rt,tn,J){"use strict";var Uo=Object.defineProperty;var _o=(oe,i,re)=>i in oe?Uo(oe,i,{enumerable:!0,configurable:!0,writable:!0,value:re}):oe[i]=re;var W=(oe,i,re)=>_o(oe,typeof i!="symbol"?i+"":i,re);function Ot(n,e){let t;function o(c){const{properties:h,title:f,ignore:p}=c,g=p&&Array.isArray(p),b=Object.keys(h).reduce((S,F)=>((!g||!p.find(R=>R===F))&&(S[F]=h[F].type==="object"&&h[F].properties?o(h[F]):re.cloneDeep(h[F].default)),S),{});if(f&&(!g||!p.find(S=>S==="id"))){const S=f.toLowerCase().replace(/-/g,"_");b.id=`${S}_${Math.random().toString().slice(2,6)}`}return b}function r(c){const{properties:h,title:f,required:p}=c;if(p&&Array.isArray(p)){const g=p.reduce((b,S)=>(b[S]=h[S].type==="object"&&h[S].properties?o(h[S]):re.cloneDeep(h[S].default),b),{});if(f&&p.find(b=>b==="id")){const b=f.toLowerCase().replace(/-/g,"_");g.id=`${b}_${Math.random().toString().slice(2,6)}`}return g}return{type:f}}function a(c,h={},f){const p=n[c];if(p){let g=r(p);const b=e[c];return g=b?b({getSchemaByType:a},g,h,f):g,t!=null&&t.appendIdentifyForNewControl&&t.appendIdentifyForNewControl(g),g}return null}function s(c,h){const f=o(h);return Object.keys(f).reduce((p,g)=>(Object.prototype.hasOwnProperty.call(c,g)&&(p[g]&&re.isPlainObject(p[g])&&re.isPlainObject(c[g]||!c[g])?Object.assign(p[g],c[g]||{}):p[g]=c[g]),p),f),f}function d(c,h){return Object.keys(c).filter(p=>c[p]!=null).reduce((p,g)=>{if(h.has(g)){const b=h.get(g);if(typeof b=="string")p[b]=c[g];else{const S=b(g,c[g],c);Object.assign(p,S)}}else p[g]=c[g];return p},{})}function l(c,h,f=new Map){const p=s(c,h);return d(p,f)}function u(c){var f;const h=c.type;if(h){const p=n[h];if(!p)return c;const g=s(c,p),b=((f=c.editor)==null?void 0:f.type)||"";if(b){const S=n[b],F=s(c.editor,S);g.editor=F}return g}return c}function m(c){t=c}return{getSchemaByType:a,resolveSchemaWithDefaultValue:u,resolveSchemaToProps:l,mappingSchemaToProps:d,setDesignerContext:m}}const $t={},qt={},{getSchemaByType:Wo,resolveSchemaWithDefaultValue:nn,resolveSchemaToProps:on,mappingSchemaToProps:rn,setDesignerContext:Go}=Ot($t,qt);function an(n={}){function e(u,m,c,h){if(typeof c=="number")return h[u].length===c;if(typeof c=="object"){const f=Object.keys(c)[0],p=c[f];if(f==="not")return Number(h[u].length)!==Number(p);if(f==="moreThan")return Number(h[u].length)>=Number(p);if(f==="lessThan")return Number(h[u].length)<=Number(p)}return!1}function t(u,m,c,h){return h[u]&&h[u].propertyValue&&String(h[u].propertyValue.value)===String(c)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((u,m)=>(u.set(m,n[m]),u),o);function r(u,m){const c=u;return typeof m=="number"?[{target:c,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:c,operator:"getProperty",param:u,value:!!m}]:typeof m=="object"?Object.keys(m).map(h=>{if(h==="length")return{target:c,operator:"length",param:null,value:m[h]};const f=h,p=m[h];return{target:c,operator:"getProperty",param:f,value:p}}):[]}function a(u){return Object.keys(u).reduce((c,h)=>{const f=r(h,u[h]);return c.push(...f),c},[])}function s(u,m){if(o.has(u.operator)){const c=o.get(u.operator);return c&&c(u.target,u.param,u.value,m)||!1}return!1}function d(u,m){return a(u).reduce((f,p)=>f&&s(p,m),!0)}function l(u,m){const c=Object.keys(u),h=c.includes("allOf"),f=c.includes("anyOf"),p=h||f,S=(p?u[p?h?"allOf":"anyOf":"allOf"]:[u]).map(R=>d(R,m));return h?!S.includes(!1):S.includes(!0)}return{parseValueSchema:l}}const sn={convertTo:(n,e,t,o)=>{n.appearance||(n.appearance={}),n.appearance[e]=t},convertFrom:(n,e,t)=>n.appearance?n.appearance[e]:n[e]},ln={convertFrom:(n,e,t)=>n.buttons&&n.buttons.length?`共 ${n.buttons.length} 项`:"无"},cn={convertTo:(n,e,t,o)=>{n.editor&&(n.editor[e]=t)},convertFrom:(n,e,t)=>n.editor&&Object.prototype.hasOwnProperty.call(n.editor,e)?n.editor[e]:n[e]},P={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:"多语输入框"}},un={convertFrom:(n,e,t)=>{var r;const o=n.editor&&n.editor[e]?n.editor[e]:n[e];return((r=P[o])==null?void 0:r.name)||o}},dn={convertTo:(n,e,t,o)=>{n[e]=n[e]},convertFrom:(n,e,t)=>n.editor?t.getRealEditorType(n.editor.type):""},fn={convertTo:(n,e,t,o)=>{(n.type==="data-grid-column"||n.type==="tree-grid-column")&&(n.formatter?n.formatter[e]=t:n.formatter={[e]:t})},convertFrom:(n,e,t)=>{if(n.formatter){if(e==="trueText")return n.formatter.trueText;if(e==="falseText")return n.formatter.falseText;if(e==="prefix")return n.formatter.prefix;if(e==="suffix")return n.formatter.suffix;if(e==="precision")return n.formatter.precision;if(e==="decimal")return n.formatter.decimal;if(e==="thousand")return n.formatter.thousand;if(e==="dateFormat")return n.formatter.dateFormat||"yyyy-MM-dd";if(e==="customFormat")return n.formatter.customFormat;if(e==="type")return n.formatter.type||"none"}return"none"}},pn={convertTo:(n,e,t,o)=>{n.command?n.command[e]=t:n.command={[e]:t},e==="enable"&&t&&(n.command.commands||(n.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(n,e,t)=>n.command&&e==="enable"?n.command.enable:""},mn={convertTo:(n,e,t,o)=>{n.column?n.column[e]=t:n.column={[e]:t},e==="fitColumns"&&t&&(n.column.fitMode||(n.column.fitMode="average"))},convertFrom:(n,e,t)=>{if(n.column){if(e==="fitColumns")return n.column.fitColumns;if(e==="fitMode")return n.column.fitMode}return""}},hn={convertTo:(n,e,t,o)=>{n.summary?n.summary[e]=t:n.summary={[e]:t},e==="enable"&&t&&(n.summary?n.summary.groupFields||(n.summary.groupFields=[]):n.summary={enable:t,groupFields:[]})},convertFrom:(n,e,t)=>n.summary&&e==="enable"?n.summary.enable:n.type==="data-grid-column"?n.enableSummary===void 0?!1:n.enableSummary:""},gn={convertTo:(n,e,t,o)=>{n.group?n.group[e]=t:n.group={[e]:t},e==="enable"&&t&&(n.group?n.group.groupFields||(n.group.groupFields=[]):n.group={enable:t,groupFields:[],showSummary:!1})},convertFrom:(n,e,t)=>{if(n.group){if(e==="enable")return n.group.enable;if(e==="showSummary")return n.group.showSummary}}},vn={convertFrom:(n,e)=>n.binding?n.binding.path:"",convertTo:(n,e,t)=>{if(t&&t.length>0){const o=t[0];n.binding||(n.binding={}),n.binding.type="Form",n.binding.path=o.bindingField,n.binding.field=o.id,n.binding.fullPath=o.path,n.path=o.bindingPath}}},yn={convertTo:(n,e,t,o)=>{n.pagination||(n.pagination={}),n.pagination[e]=t},convertFrom:(n,e,t)=>n.pagination?n.pagination[e]:n[e]},bn={convertTo:(n,e,t,o)=>{n.rowNumber||(n.rowNumber={}),n.rowNumber[e]=t},convertFrom:(n,e,t)=>n.rowNumber?n.rowNumber[e]:n[e]},Cn={convertTo:(n,e,t,o)=>{n.selection||(n.selection={}),n.selection[e]=t},convertFrom:(n,e,t)=>{var o,r;return e==="showCheckbox"?(o=n.selection)!=null&&o.multiSelect?!0:(r=n.selection)==null?void 0:r.showCheckbox:n.selection?n.selection[e]:n[e]}},wn={convertFrom:(n,e,t)=>n[e]&&n[e].length?`共 ${n[e].length} 项`:""},xn={convertFrom:(n,e)=>n[e]||"",convertTo:(n,e,t)=>{n[e]=t}},Sn={convertTo:(n,e,t,o)=>{n.size||(n.size={}),n.size[e]=t},convertFrom:(n,e,t)=>n.size?n.size[e]:n[e]},Tn={convertFrom:(n,e,t)=>{var o,r;return(o=n.formatter)!=null&&o.data&&e==="formatterEnumData"&&!n.formatterEnumData?(r=n.formatter)==null?void 0:r.data:n.formatterEnumData}},Mn={convertTo:(n,e,t,o)=>{n.sort||(n.sort={}),n.sort[e]=t},convertFrom:(n,e,t)=>{var o,r;if(e==="mode")return((o=n.sort)==null?void 0:o.mode)||"client";if(e==="multiSort")return!!((r=n.sort)!=null&&r.multiSort)}},En={convertTo:(n,e,t,o)=>{n.filter||(n.filter={}),n.filter[e]=t},convertFrom:(n,e,t)=>{var o;if(e==="mode")return((o=n.filter)==null?void 0:o.mode)||"client"}},Fn={convertTo:(n,e,t,o)=>{n.rowOption?n.rowOption[e]=t:n.rowOption={[e]:t}},convertFrom:(n,e,t)=>{if(n.rowOption){if(e==="customRowStyle")return n.rowOption.customRowStyle;if(e==="customCellStyle")return n.rowOption.customCellStyle}return""}};function Dt(n,e,t){const o=new Map([["/converter/appearance.converter",sn],["/converter/buttons.converter",ln],["/converter/property-editor.converter",cn],["/converter/items-count.converter",wn],["/converter/type.converter",un],["/converter/change-editor.converter",dn],["/converter/change-formatter.converter",fn],["/converter/column-command.converter",pn],["/converter/column-option.converter",mn],["/converter/summary.converter",hn],["/converter/group.converter",gn],["/converter/form-group-label.converter",xn],["/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",Tn],["/converter/grid-sort.converter",Mn],["/converter/grid-filter.converter",En],["/converter/row-option.converter",Fn]]),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}]]),a=an();function s(p,g){return()=>a.parseValueSchema(p,g)}function d(p,g,b){return p.includes("visible")&&g.visible!==void 0?typeof g.visible=="boolean"?()=>!!g.visible:g.visible===void 0?!0:s(g.visible,b):()=>!0}function l(p,g,b){return p.includes("readonly")&&g.readonly!==void 0?typeof g.readonly=="boolean"?()=>!!g.readonly:s(g.readonly,b):()=>!1}function u(p,g){const b=p.$converter||g;return typeof b=="string"&&b&&o.has(b)?o.get(b)||null:b||null}function m(p,g,b,S,F,R="",$=""){return Object.keys(p).map(y=>{const E=i.ref(1),T=y,j=p[y],H=Object.keys(j),C=j.title,M=j.type,V=r.get(M)||{type:"input-group",enableClear:!1},N=j.editor?Object.assign({},V,j.editor):Object.assign({},V),x=d(H,j,g),A=l(H,j,g);N.readonly=N.readonly===void 0?A():N.readonly;const Q=j.type==="cascade"?m(j.properties,g,b,S,F,R,$):[],I=!0;let k=u(j,$);const _=i.computed({get(){if(E.value){if(["class","style"].find(ce=>ce===T)&&!k&&(k=o.get("/converter/appearance.converter")||null),k&&k.convertFrom)return k.convertFrom(b,y,F,R);const ie=b[y];return Object.prototype.hasOwnProperty.call(j,"defaultValue")&&(ie===void 0||typeof ie=="string"&&ie==="")?j.type==="boolean"?j.defaultValue:j.defaultValue||"":ie}return null},set(ie){E.value+=1,k&&k.convertTo?(k.convertTo(S,y,ie,F,R),k.convertTo(b,y,ie,F,R)):(S[y]=ie,b[y]=ie)}}),{refreshPanelAfterChanged:D,description:ee,isExpand:ge,parentPropertyID:ye}=j,X={propertyID:T,propertyName:C,propertyType:M,propertyValue:_,editor:N,visible:x,readonly:A,cascadeConfig:Q,hideCascadeTitle:I,refreshPanelAfterChanged:D,description:ee,isExpand:ge,parentPropertyID:ye};return g[T]=X,X})}function c(p,g,b={}){const S={},F=n[p];return F&&F.categories?Object.keys(F.categories).map($=>{const w=F.categories[$],y=w==null?void 0:w.title,E=m(w.properties||{},S,{},b,g);return{categoryId:$,categoryName:y,properties:E}}):[]}function h(p,g,b,S,F=""){const R=g.$ref.schema,$=g.$ref.converter,w=b[R],y=w.type,E=t(w),T={},j=n[y];if(j&&j.categories){const H=j.categories[p],C=H==null?void 0:H.title;$&&Object.keys(H.properties).forEach(N=>{H.properties[N].$converter=$});const M=(H==null?void 0:H.properties)||{},V=m(M,T,E,w,S,F);return{categoryId:p,categoryName:C,properties:V}}return{categoryId:p,categoryName:"",properties:[]}}function f(p,g,b,S,F){const R=p.type,$=t(p),w={};let y=F||n[R];if(y&&Object.keys(y).length===0&&b&&b.getPropConfig&&(y=b.getPropConfig(S)),y&&y.categories){const E=[];return Object.keys(y.categories).map(T=>{const j=y.categories[T];if(j.$ref){E.push(h(T,j,p,g,S));return}const H=j==null?void 0:j.title,C=j==null?void 0:j.tabId,M=j==null?void 0:j.tabName,V=j==null?void 0:j.hide,N=j==null?void 0:j.hideTitle,x=m(j.properties||{},w,$,p,g,S,j.$converter),{setPropertyRelates:A}=j,Q=j==null?void 0:j.parentPropertyID;E.push({categoryId:T,categoryName:H,tabId:C,tabName:M,hide:V,properties:x,hideTitle:N,setPropertyRelates:A,parentPropertyID:Q})}),E}return[]}return{getPropertyConfigBySchema:f,getPropertyConfigByType:c,propertyConverterMap:o}}const Lt={},Rt={};Dt(Lt,Rt,nn);const At={},Ht={},{getSchemaByType:Xo,resolveSchemaWithDefaultValue:Bn,resolveSchemaToProps:Yo,mappingSchemaToProps:Jo,setDesignerContext:Qo}=Ot(At,Ht),zt={},Ut={};Dt(zt,Ut,Bn);function Je(n,e,t=new Map,o=(s,d,l,u)=>d,r={},a=s=>s){return $t[e.title]=e,qt[e.title]=o,Lt[e.title]=r,Rt[e.title]=a,At[e.title]=e,Ht[e.title]=o,zt[e.title]=r,Ut[e.title]=a,(s={},d=!0)=>{if(!d)return rn(s,t);const l=on(s,e,t),u=Object.keys(n).reduce((m,c)=>(m[c]=n[c].default,m),{});return Object.assign(u,l)}}function vt(n,e){return{customClass:e.class,customStyle:e.style}}const kn=new Map([["appearance",vt]]),jn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/switch.schema.json",title:"textarea",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a textarea",type:"string"},type:{description:"The type string of textarea component",type:"string",default:"textarea"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},rows:{description:"",type:"number"},showCount:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:0},updateOn:{description:"",type:"string",default:"blur"},allowUnlimtedWhenEmpty:{description:"",type:"boolean",default:!0},autoHeight:{description:"",type:"boolean",default:!1},resizable:{description:"",type:"boolean",default:!1},lineBreak:{description:"",type:"boolean",default:"enter"}},required:["type"],ignore:["id","appearance","binding","visible"]};function Nn(n,e,t){return e}const at={autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},autocomplete:{type:Boolean,default:!1},allowUnlimtedWhenEmpty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!1},id:{type:String,default:""},minLength:{type:Number,default:0},maxLength:{type:Number},modelValue:{type:String,default:""},placeholder:{type:String,default:""},readonly:{type:Boolean,default:!1},rows:{type:Number},resizable:{type:Boolean,default:!1},showCount:{type:Boolean,default:!1},showBorder:{Type:Boolean,default:!0},tabIndex:{type:Number,default:-1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"},lineBreak:{type:Boolean,default:"enter"}},_t=Object.assign({},at,{readonly:{}}),yt=Je(at,jn,kn,Nn),Qe=i.defineComponent({name:"FTextarea",props:at,emits:["update:modelValue","valueChange","change","mousedownEvent","mouseupEvent"],setup(n,e){var N;const{isUndefined:t}=ve.useCommonUtils(),o=i.ref(),r=i.ref(null),a=i.computed(()=>n.modelValue),s=i.computed(()=>{if(!(n.allowUnlimtedWhenEmpty&&n.maxLength===0||t(n.maxLength)))return typeof n.maxLength=="number"&&!isNaN(n.maxLength)?n.maxLength:n.modelValue?n.modelValue.length:0}),d=i.ref(((N=n.modelValue)==null?void 0:N.slice(0,s.value))||""),l=ve.useTextBox(n,e,d,a,o),{inputGroupClass:u,onBlur:m,onFocus:c,onMousedown:h,onMouseup:f,onTextBoxValueChange:p,hasFocused:g}=l,b=ve.useClear(n,e,l),{onMouseEnter:S,onMouseLeave:F,clearButtonClass:R,shouldShowClearButton:$,clearButtonStyle:w}=b,y=x=>{var A,Q,I;x.stopPropagation(),e.emit("update:modelValue",(A=x.target)==null?void 0:A.value),e.emit("valueChange",(Q=x.target)==null?void 0:Q.value),e.emit("change",(I=x.target)==null?void 0:I.value)},E=x=>{x.stopPropagation(),r.value.value="",e.emit("update:modelValue",""),e.emit("valueChange",""),e.emit("change","")},T=x=>{if(n.readonly||!g)return;const{altKey:A,key:Q}=x;if(Q==="Enter"&&!A&&n.lineBreak==="alt enter"){x.preventDefault();return}if(A&&Q==="Enter"&&n.lineBreak==="alt enter"){x.stopPropagation(),x.preventDefault();const{selectionStart:I,selectionEnd:k}=r.value;d.value=d.value.slice(0,I)+`
|
|
2
|
-
`+d.value.slice(k),i.nextTick(()=>{var _;r.value.selectionStart=I+1,r.value.selectionEnd=I+1,(_=r.value)==null||_.focus()}),e.emit("update:modelValue",d.value),e.emit("valueChange",d.value),e.emit("change",d.value);return}},j=i.computed(()=>({"form-control":!0,"h-100":n.autoHeight})),H=i.computed(()=>{const x={};return n.resizable||(x.resize="none"),n.rows>2?{height:"auto",...x}:x}),C=i.computed(()=>n.disabled||n.readonly?"":n.placeholder);i.watch(()=>n.modelValue,(x,A)=>{x!==A&&(d.value=x)});const M=()=>r.value;e.expose({elementRef:r,getTextareaElement:M});function V(){var x,A;n.selectOnCreated&&((x=r.value)==null||x.select()),n.focusOnCreated&&((A=r.value)==null||A.focus({preventScroll:!0}))}return i.onMounted(()=>{V()}),()=>i.createVNode("div",{ref:o,class:u.value,onMouseenter:S,onMouseleave:F,style:"position:relative"},[i.withDirectives(i.createVNode("textarea",{ref:r,class:j.value,id:n.id,"onUpdate:modelValue":x=>d.value=x,minlength:n.minLength,maxlength:s.value,tabindex:n.tabIndex,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,placeholder:C.value,autofocus:n.autofocus,rows:n.rows,onInput:y,onFocus:c,onChange:p,onKeydown:T,onBlur:m,onMousedown:h,onMouseup:f,style:H.value},null),[[i.vModelText,d.value]]),$.value&&i.createVNode("span",{id:"clearIcon",class:R.value,style:w.value,onClick:x=>E(x)},[i.createVNode("i",{class:"f-icon modal_close"},null)])])}});function In(n,e,t){var C;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=i.ref();let s;function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function l(){return!1}function u(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function c(M){if(!M||!M.value)return null;if(M.value.schema&&M.value.schema.type==="component")return M.value;const V=i.ref(M==null?void 0:M.value.parent),N=c(V);return N||null}function h(M=e){var A;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(M);const{componentInstance:V,designerItemElementRef:N}=M;if(!V||!V.value)return null;const{getCustomButtons:x}=V.value;return V.value.canMove||x&&((A=x())!=null&&A.length)?N:h(M.parent)}function f(M){return!!t&&t.canAccepts(M)}function p(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function g(){}function b(M,V){var N;!M||!V||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(M,V),(N=e==null?void 0:e.setupContext)==null||N.emit("dragEnd"))}function S(M,V){const{componentType:N}=M;let x=it.getSchemaByTypeForDesigner(N,M,V);t&&t.onResolveNewComponentSchema&&(x=t.onResolveNewComponentSchema(M,x));const A=N.toLowerCase().replace(/-/g,"_");return x&&!x.id&&x.type===N&&(x.id=`${A}_${Math.random().toString().slice(2,6)}`),x}function F(M){M&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(M)}function R(...M){if(t&&t.getPropsConfig)return t.getPropsConfig(...M)}function $(M){if(!M)return;const V=e==null?void 0:e.schema,{formSchemaUtils:N}=M;if(V&&N.getExpressions().length){const x=N.getExpressions().findIndex(A=>A.target===V.id);x>-1&&N.getExpressions().splice(x,1)}}function w(M){if(!M||!(e!=null&&e.schema))return;const V=e.schema,{formSchemaUtils:N}=M;N.removeCommunicationInComponent(V)}function y(M){t&&t.onRemoveComponent&&t.onRemoveComponent(),$(M),w(M),e!=null&&e.schema.contents&&e.schema.contents.map(V=>{let N=V.id;V.type==="component-ref"&&(N=V.component);const x=n.value.querySelectorAll(`#${N}-design-item`);x!=null&&x.length&&Array.from(x).map(A=>{var Q;(Q=A==null?void 0:A.componentInstance)!=null&&Q.value.onRemoveComponent&&A.componentInstance.value.onRemoveComponent(M)})})}function E(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function T(M){var N,x;if(!((N=e==null?void 0:e.schema)!=null&&N.id))return;if(!s&&M&&(s=M.formSchemaUtils),t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let V="";if(t!=null&&t.getComponentTitle)V=t.getComponentTitle();else{const{text:A,title:Q,label:I,mainTitle:k,name:_,type:D}=e.schema;V=A||Q||I||k||_||((x=P[D])==null?void 0:x.name)}V&&s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:V,parentPathName:V})}function j(M){var A;const{changeObject:V}=M,{propertyID:N,propertyValue:x}=V;if(["text","title","label","name","mainTitle"].includes((A=M==null?void 0:M.changeObject)==null?void 0:A.propertyID)&&N&&x&&(T(),s)){const Q=s.getControlBasicInfoMap(),I=Q.keys().toArray().filter(k=>{var _,D;return((_=Q.get(k))==null?void 0:_.reliedComponentId)===((D=e==null?void 0:e.schema)==null?void 0:D.id)});I!=null&&I.length&&I.forEach(k=>{const _=Q.get(k).parentPathName.split(" > ");_[0]=x,Q.get(k).parentPathName=_.join(" > ")})}}function H(M){if(j(M),t&&t.onPropertyChanged)return t.onPropertyChanged(M)}return a.value={canMove:d(),canSelectParent:l(),canDelete:u(),canNested:!m(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:f,getBelongedComponentInstance:c,getDraggableDesignItemElement:h,getDraggingDisplayText:p,getPropConfig:R,getDragScopeElement:g,onAcceptMovedChildElement:b,onChildElementMovedOut:F,addNewChildComponentSchema:S,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||i.ref(!1),onRemoveComponent:y,getCustomButtons:E,onPropertyChanged:H,setComponentBasicInfoMap:T,updateContextSchema:e==null?void 0:e.updateContextSchema},a}const Vn=i.ref(0);function Pn(){Vn.value++}const st=i.ref(0);function On(n){const{formSchemaUtils:e,formStateMachineUtils:t}=n;function o(l,u=""){return{path:u+l.code,field:l.id,fullPath:l.code}}function r(l,u=""){return e.getViewModelById(l).states.map(c=>o(c,u))}function a(l){const u=e.getRootViewModelId(),m=r(l);if(l===u)return m;const c=r(u,"root-component.");return[...m,...c]}function s(l){return l.binding&&l.binding.path||l.id||""}function d(){return t&&t.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:d}}class Wt{constructor(e){W(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'"}]);W(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});W(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,a,s)=>{const d=a.getExpressionRuleValue(e,t||r);return d&&d.value||""},convertTo:(o,r,a,s,d)=>{var l;if(r==="dataPicking"&&(a!=null&&a.target)){const u=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(c=>c.id===u&&c.value))?o.dictPickingExpressionId=u:delete o.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(s=>s.target===e);if(!r)return"";const a=r.rules.find(s=>s.type===t);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(a=>{r.push({key:a.code,name:a.name,description:a.name,category:a.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t,type:"field"}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var d;const a=this.createTreeNode(r,t);let s=[];(d=r.type)!=null&&d.fields&&(s=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:a,children:s,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var l,u;const a=this.createTreeNode(r,t);a.type="entity";const s=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...t,r.label]),d=this.buildChildEntityTreeData((u=r.type)==null?void 0:u.entities,[...t,r.label]);d!=null&&d.length&&(s==null||s.push(...d)),o.push({data:a,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,a=this.getExpressionRule(r,t),s=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(t)&&a?a.message:"",...s};return a.messageType!=null&&(d.messageType=a.messageType),d}buildRule(e,t,o,r){const{expression:a,message:s,messageType:d}=t,l={id:`${e}_${o}`,type:o,value:a};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=s),o==="dataPicking"&&(l.messageType=d),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,o,r,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(m=>m.targetType===t&&m.target===a);const u=m=>m.value.trim()==="";if(l){const m=l.rules.find(c=>c.id===s.id);if(m)u(s)?l.rules=l.rules.filter(c=>c.id!==s.id):(Object.assign(m,s),r==="validate"&&e.type==="form-group"&&(m.elementId=e.id));else{if(u(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(u(s))return null;l={target:`${a}`,rules:[s],targetType:t}}return l}getExpressionEditorOptions(e,t,o,r){return o.reduce((a,s)=>{var l,u;const d=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return a[s]={hide:t==="Field"?!!((u=e==null?void 0:e.binding)!=null&&u.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(d),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:m=>{const c=this.updateExpression(e,t,m,s);if(r){const h=this.buildRule(d,m,s);r(h)}return c}}},a},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(r,o),s={value:a&&a.value,targetId:r,targetType:t,expressionType:o};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class $n{constructor(e,t){W(this,"componentId");W(this,"viewModelId");W(this,"eventsEditorUtils");W(this,"formSchemaUtils");W(this,"formMetadataConverter");W(this,"designViewModelUtils");W(this,"designViewModelField");W(this,"controlCreatorUtils");W(this,"designerHostService");W(this,"designerContext");W(this,"schemaService",null);W(this,"metadataService",null);W(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService,this.designerContext=t.designerContext}getFormDesignerInstance(){var e,t;return(t=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:t.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(a=>a.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:P[e.type]&&P[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in t)a[s]=Object.assign(a[s]||{},t[s]);return{...r,properties:{...a},setPropertyRelates(s,d){if(s){switch(s&&s.propertyID){case"class":case"style":{st.value++;break}}o&&o(s,e,d)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},a={},s=""){const{getVariables:d,getControlName:l,getStateMachines:u}=On(this.designerHostService),m=this.getRealTargetType(e),c=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:c};return c.map(f=>{switch(f){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":h.expressionConfig=this.getExpressionOptions(e,m,s||o);break;case"StateMachine":h.stateMachines=u();break;case"Variable":Object.assign(h,{controlName:l(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:d(this.viewModelId),onBeforeOpenVariables:p=>{p.value=d(this.viewModelId)}},a);break}}),h}getVisibleProperty(e,t=""){var a;let o=["Const","Variable","StateMachine","Expression"];return t==="gridFieldEditor"?o=["Const","Expression"]:t==="form-group"&&!((a=e.binding)!=null&&a.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,t="",o={},r){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in o)s[l]=Object.assign(s[l]||{},o[l]);const d=this;return{...a,properties:{...s},setPropertyRelates(l,u){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(e,l);break}r&&r(l,u)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(s=>s.id===e),a=re.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,a),Pn()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(t).states.push(s)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:a,expressionInfo:s}=t,{targetId:d,targetType:l,expressionType:u,value:m,message:c}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:f}=h;let p=f.find(b=>b.target===d);p||(p={target:d,rules:[],targetType:l},f.push(p));const g=p.rules.find(b=>b.type===u);if(g)g.value=m,g.message=c;else{const b={id:a,type:u,value:m,message:c};p.rules.push(b)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const a=e.propertyID,s=this.formSchemaUtils.getExpressions(),d=t.binding?t.binding.field:t.id,l=s.find(u=>u.target===d);!l||!l.rules||(l.rules=l.rules.filter(u=>u.type!==a))}getExpressionOptions(e,t,o){return new Wt(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const t={};return t[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},t}}const _e=class _e{static getEditorTypesByMDataType(e,t=!1,o=""){if(t)return[{key:P["language-textbox"].type,value:P["language-textbox"].name}];let r=_e.fieldControlTypeMapping[e];if(o==="data-grid-column"&&(r!=null&&r.length)){const a=[P["check-group"].type,P["radio-group"].type];r=r.filter(s=>!a.includes(s.key))}return r}static getAllInputTypes(){const e=[];for(const t in _e.fieldControlTypeMapping)_e.fieldControlTypeMapping[t].forEach(o=>{e.find(r=>r.key===o.key&&r.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var a;const o=(a=e.editor)==null?void 0:a.type,r=[];return(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&t&&t.categoryId&&t.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===P["input-group"].type||o===P.textarea.type||o===P["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===P["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===P["combo-list"].type||o===P["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===P["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===P["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===P.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"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};W(_e,"fieldControlTypeMapping",{String:[{key:P["input-group"].type,value:P["input-group"].name},{key:P.lookup.type,value:P.lookup.name},{key:P["date-picker"].type,value:P["date-picker"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name},{key:P["check-group"].type,value:P["check-group"].name},{key:P["radio-group"].type,value:P["radio-group"].name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P.textarea.type,value:P.textarea.name},{key:P["time-picker"].type,value:P["time-picker"].name}],Text:[{key:P.textarea.type,value:P.textarea.name},{key:P.lookup.type,value:P.lookup.name}],Decimal:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Integer:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Number:[{key:P["number-spinner"].type,value:P["number-spinner"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],BigNumber:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Date:[{key:P["date-picker"].type,value:P["date-picker"].name}],DateTime:[{key:P["date-picker"].type,value:P["date-picker"].name}],Boolean:[{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],Enum:[{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}],Object:[{key:P.lookup.type,value:P.lookup.name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}]});let lt=_e;var ct=(n=>(n.Form="Form",n.Variable="Variable",n))(ct||{});class qn{constructor(){W(this,"label","");W(this,"id","");W(this,"columnInSM",12);W(this,"columnInMD",6);W(this,"columnInLG",3);W(this,"columnInEL",2);W(this,"displayWidthInSM",1);W(this,"displayWidthInMD",1);W(this,"displayWidthInLG",1);W(this,"displayWidthInEL",1);W(this,"displayColumnCountAtBreakPoint","md");W(this,"tagRow",0);W(this,"showTopBorder",0);W(this,"group",1);W(this,"isSupportedClass",!0);W(this,"fieldSetId","")}}function Dn(n){let e,t;const o=new Map;let r=[];function a(m,c){const f=m.split(" ").filter(F=>F.startsWith("col-"));if(f.length===0){c.isSupportedClass=!1;return}let p=f.find(F=>/^col-([1-9]|10|11|12)$/.test(F)),g=f.find(F=>/^col-md-([1-9]|10|11|12)$/.test(F)),b=f.find(F=>/^col-xl-([1-9]|10|11|12)$/.test(F)),S=f.find(F=>/^col-el-([1-9]|10|11|12)$/.test(F));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),g=g||"col-md-"+c.columnInSM,c.columnInMD=parseInt(g.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),S=S||"col-el-"+c.columnInLG,c.columnInEL=parseInt(S.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function s(m,c,h,f=!1){let p=!1;m.contents.forEach(g=>{if(g.type==="fieldset"){h+=1,s(g,c,h,!0),p=!0;return}p&&(h+=1,p=!1);const b=g.appearance&&g.appearance.class,S=new qn;b?a(b,S):S.isSupportedClass=!1,S.label=g.label||g.id,S.id=g.id,S.group=h,f&&(S.fieldSetId=m.id),t===g.id&&(e=h),o.set(g.id,g),c.push(S)})}function d(m){const c=n.getComponentById(m);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const h=n.selectNode(c,f=>f.type===Pt.DgControl["response-form"].type);return!h||!h.contents||h.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:h}}function l(m,c){c=c||m.id;const{result:h,message:f,formNode:p}=d(c);if(!h)return{result:h,message:f};t=m.id,r=[],o.clear();const g=p.contents[0].type===Pt.DgControl.fieldset.type?0:1;s(p,r,g);const b=r.find(F=>!F.isSupportedClass);return{defaultState:{defaultGroupNumber:e||1,model:b?"customize":"standard"},importData:r}}function u(m,c){c=c;const{result:h,formNode:f}=d(c);if(!h)return"";const p=[];return m.forEach(g=>{var F;const b=o.get(g.id),S=b.appearance&&b.appearance.class;if(S){const $=S.split(" ").filter(H=>!H.startsWith("col-")),w="col-"+g.columnInSM,y="col-md-"+g.columnInMD,E="col-xl-"+g.columnInLG,T="col-el-"+g.columnInEL,j=[w,y,E,T].concat($);b.appearance.class=j.join(" ")}if(g.fieldSetId){const R=f.contents.find(w=>w.id===g.fieldSetId),$=p.find(w=>w.id===g.fieldSetId);$?(F=$.contents)==null||F.push(b):(p.push(R),R.contents=[b])}else p.push(b)}),f.contents=p,f.id}return{checkCanFindFormNode:d,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:u,getResonseFormLayoutConfig:s}}var Ne=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 Ln={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(o,r,a){function s(u,m){if(!r[u]){if(!o[u]){var c=typeof ut=="function"&&ut;if(!m&&c)return c(u,!0);if(d)return d(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var f=r[u]={exports:{}};o[u][0].call(f.exports,function(p){var g=o[u][1][p];return s(g||p)},f,f.exports,t,o,r,a)}return r[u].exports}for(var d=typeof ut=="function"&&ut,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,o,r){var a={},s="(?:^|\\s)",d="(?:\\s|$)";function l(c){var h=a[c];return h?h.lastIndex=0:a[c]=h=new RegExp(s+c+d,"g"),h}function u(c,h){var f=c.className;f.length?l(h).test(f)||(c.className+=" "+h):c.className=h}function m(c,h){c.className=c.className.replace(l(h)," ").trim()}o.exports={add:u,rm:m}},{}],2:[function(t,o,r){(function(a){var s=t("contra/emitter"),d=t("crossvent"),l=t("./classes"),u=document,m=u.documentElement;function c(C,M){var V=arguments.length;V===1&&Array.isArray(C)===!1&&(M=C,C=[]);var N,x,A,Q,I,k,_,D,ee,ge=null,ye,X,ie=!1,ce=0,te,z=M||{};z.moves===void 0&&(z.moves=F),z.accepts===void 0&&(z.accepts=F),z.invalid===void 0&&(z.invalid=Ke),z.containers===void 0&&(z.containers=C||[]),z.isContainer===void 0&&(z.isContainer=S),z.copy===void 0&&(z.copy=!1),z.copySortSource===void 0&&(z.copySortSource=!1),z.revertOnSpill===void 0&&(z.revertOnSpill=!1),z.removeOnSpill===void 0&&(z.removeOnSpill=!1),z.direction===void 0&&(z.direction="vertical"),z.ignoreInputTextSelection===void 0&&(z.ignoreInputTextSelection=!0),z.mirrorContainer===void 0&&(z.mirrorContainer=u.body);var ne=s({containers:z.containers,start:Ee,end:Ae,cancel:B,remove:Ye,destroy:Re,canMove:Pe,dragging:!1});return z.removeOnSpill===!0&&ne.on("over",St).on("out",Tt),Ie(),ne;function Le(v){return ne.containers.indexOf(v)!==-1||z.isContainer(v)}function Ie(v){var O=v?"remove":"add";p(m,O,"mousedown",se),p(m,O,"mouseup",$e)}function Me(v){var O=v?"remove":"add";p(m,O,"mousemove",Ze)}function We(v){var O=v?"remove":"add";d[O](m,"selectstart",Ge),d[O](m,"click",Ge)}function Re(){Ie(!0),$e({})}function Ge(v){ye&&v.preventDefault()}function se(v){Q=v.clientX,I=v.clientY;var O=g(v)!==1||v.metaKey||v.ctrlKey;if(!O){var q=v.target,U=Ve(q);U&&(ye=U,Me(),v.type==="mousedown"&&(y(q)?q.focus():v.preventDefault()))}}function Ze(v){if(ye){if(g(v)===0){$e({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-Q)<=(z.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-I)<=(z.slideFactorY||0))){if(z.ignoreInputTextSelection){var O=H("clientX",v)||0,q=H("clientY",v)||0,U=u.elementFromPoint(O,q);if(y(U))return}var Z=ye;Me(!0),We(),Ae(),Oe(Z),l.add(D||A,"gu-transit"),Et(),Mt(),ce=0,je(v)}}}function Ve(v){if(!(ne.dragging&&N)&&!Le(v)){for(var O=v;w(v)&&Le(w(v))===!1;)if(z.invalid(v,O)||(v=w(v),!v))return;var q=w(v);if(q&&!z.invalid(v,O)){var U=z.moves(v,q,O,T(v));if(U)return{item:v,source:q}}}}function Pe(v){return!!Ve(v)}function Ee(v){var O=Ve(v);O&&Oe(O)}function Oe(v){Vt(v.item,v.source)&&(D=v.item.cloneNode(!0),ne.emit("cloned",D,v.item,"copy")),x=v.source,A=v.item,k=_=T(v.item),ne.dragging=!0,ne.emit("drag",A,x)}function Ke(){return!1}function Ae(){if(ne.dragging){var v=D||A;Xe(v,w(v))}}function ke(){ye=!1,Me(!0),We(!0)}function $e(v){if(ke(),!!ne.dragging){var O=D||A,q=H("clientX",v)||0,U=H("clientY",v)||0,Z=b(N,q,U),K=ue(Z,q,U);K&&(D&&z.copySortSource||!D||K!==x)?Xe(O,K):z.removeOnSpill?Ye():B()}}function Xe(v,O){var q=w(v);D&&z.copySortSource&&O===x&&q.removeChild(A),le(O)?ne.emit("cancel",v,x):ne.emit("drop",v,O,x,_),Y()}function Ye(){if(ne.dragging){var v=D||A,O=w(v);O&&O.removeChild(v),ne.emit(D?"cancel":"remove",v,O,x),Y()}}function B(v){if(ne.dragging){var O=arguments.length>0?v:z.revertOnSpill,q=D||A,U=w(q),Z=le(U);Z===!1&&O&&(D?U&&U.removeChild(D):x.insertBefore(q,k)),Z||O?ne.emit("cancel",q,x,x):ne.emit("drop",q,U,x,_),Y()}}function Y(){var v=D||A;ke(),Ft(),Bt(),v&&l.rm(v,"gu-transit"),ee&&clearTimeout(ee),ne.dragging=!1,ge&&ne.emit("out",v,ge,x),ne.emit("dragend",v,ce),x=A=D=k=_=ee=ge=null}function le(v,O){var q;return O!==void 0?q=O:N?q=_:q=T(D||A),v===x&&q===k}function ue(v,O,q){for(var U=v;U&&!Z();)U=w(U);return U;function Z(){var K=Le(U);if(K===!1)return!1;var Se=mt(U,v),be=ht(U,Se,O,q),Ce=le(U,be);return Ce?!0:z.accepts(A,U,x,be)}}function je(v){if(!N)return;v.preventDefault();var O=H("clientX",v)||0,q=H("clientY",v)||0;N.style.left=O-2+"px",N.style.top=q-2+"px";var U=D||A,Z=b(N,O,q),K=ue(Z,O,q),Se=K!==null&&K!==ge;(Se||K===null)&&(we(),ge=K,Be()),It(Z,q);var be=w(U);if(K===x&&D&&!z.copySortSource){be&&be.removeChild(U);return}var Ce,Fe=mt(K,Z);if(ie=et(Fe,K),Fe!==null)Ce=ht(K,Fe,O,q);else if(z.revertOnSpill===!0&&!D)Ce=k,K=x;else{D&&be&&be.removeChild(U),D&&X&&(X.style.display="none");return}X.style.display="block",xt(Ce,U,Se),Ce?jt(Fe,Ce):Nt(K);function de(me){ne.emit(me,U,ge,x)}function Be(){Se&&de("over")}function we(){ge&&de("out")}}function xt(v,O,q){(v===O||v===T(O))&&(_=T(O)),(v===null&&q||v!==O&&v!==T(O))&&(_=v)}function St(v){l.rm(v,"gu-hide")}function Tt(v){ne.dragging&&l.add(v,"gu-hide")}function Mt(){N||(N=document.createElement("div"),N.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",N.innerHTML=z.getMirrorText&&z.getMirrorText(A)||"控件",l.add(N,"gu-mirror"),z.mirrorContainer.appendChild(N),p(m,"add","mousemove",je),l.add(z.mirrorContainer,"gu-unselectable"),ne.emit("cloned",N,A,"mirror"))}function Et(){if(X=document.createElement("div"),l.add(X,"gu-insertion"),A){var v=A.getBoundingClientRect();X.style.left=v.left+"px",X.style.top=v.top+"px"}ie=!1,z.mirrorContainer.appendChild(X)}function Ft(){N&&(l.rm(z.mirrorContainer,"gu-unselectable"),p(m,"remove","mousemove",je),w(N).removeChild(N),N=null)}function Bt(){X&&(w(X).removeChild(X),X=null)}function mt(v,O){for(var q=O;q!==v&&w(q)!==v;)q=w(q);return q===m?null:q}function et(v,O){if(!O)return ie;var q=v||O&&O.lastElementChild;if(!q)return!0;var U=getComputedStyle(v),Z=/^inline/.test(U.getPropertyValue("display"))||/^(left|right)$/.test(U.getPropertyValue("float"));if(Z)return!0;if(O){var K=getComputedStyle(O),Se=K.getPropertyValue("display");if(/flex$/.test(Se)){var be=K.getPropertyValue("flex-direction")||"row";if(be==="row"||be==="row-reverse")return!kt(O)}return!1}return!0}function kt(v){if(!v.children||!v.children.length)return!1;for(const O of Array.from(v.children)){const U=(O.className&&O.className.split(" ")||[]).filter(Z=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Z));if(!U.length)return!1;for(const Z of U){const K=Z.slice(Z.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function jt(v,O){const q=O.getBoundingClientRect();if(X.style.left=q.left+"px",X.style.top=q.top+"px",ie){if(X.style.height=q.height+"px",X.style.width="4px",v){const U=v.getBoundingClientRect();U.top!==q.top&&(X.style.left=U.right+"px",X.style.top=U.top+"px",X.style.height=U.height+"px")}}else if(X.style.height="4px",X.style.width=q.width+"px",te){const U=te.getBoundingClientRect();q.top<U.top&&(X.style.display="none")}O===A&&A&&(X.style.display="none")}function Nt(v){_=null;var O=v.lastElementChild;if(O){var q=O.getBoundingClientRect();ie?(X.style.left=q.right+"px",X.style.top=q.top+"px",X.style.height=q.height+"px",X.style.width="4px"):(X.style.left=q.left+"px",X.style.top=q.bottom+"px",X.style.height="4px",X.style.width=q.width+"px"),O===A&&A&&(X.style.display="none")}else X.style.display="none"}function It(v,O){if(!z.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(te=h(v),!te||!te.contains(v)))return;const q=document.querySelector(".dgComponentSelected"),U=te.getBoundingClientRect();if(O-30<U.top&&te.scrollTop>0){let Z=te.scrollTop<10?te.scrollTop:10;te.scrollBy(0,-1*Z),q&&te.contains(q)&&(ce=ce+-1*Z)}if(O+30>U.bottom&&te.scrollTop<te.scrollHeight-te.clientHeight){const Z=te.scrollHeight-te.clientHeight-te.scrollTop;let K=Z<10?Z:10;te.scrollBy(0,K),q&&te.contains(q)&&(ce=ce+K)}}function ht(v,O,q,U){var Z=z.direction==="horizontal",K=z.direction==="mixed",Se=O!==v?Ce():be();return Se;function be(){var de=v.children.length,Be,we,me;for(Be=0;Be<de;Be++)if(we=v.children[Be],me=we.getBoundingClientRect(),Z&&me.left+me.width/2>q||!K&&!Z&&me.top+me.height/2>U||K&&me.left+me.width>q&&me.top+me.height>U)return we;return null}function Ce(){var de=O.getBoundingClientRect();if(K){var Be=U-de.top,we=q-de.left,me=de.bottom-U,tt=de.right-q,nt=Math.min(we,tt,Be,me),ot;return ie?ot=tt<we:ot=me===nt||tt===nt||we===nt,Fe(ot)}return Fe(Z?q>de.left+R(de)/2:U>de.top+$(de)/2)}function Fe(de){return de?T(O):O}}function Vt(v,O){return typeof z.copy=="boolean"?z.copy:z.copy(v,O)}}function h(C){const M=Array.from(window.scrollContainerList);if(M.length===1){const N=Array.from(window.scrollContainerList)[0];return document.getElementById(N)}const V=f(M);for(const N of V)if(N.contains(C))return N;return null}function f(C){const M=[];return C.forEach(V=>{const N=document.getElementById(V);N&&M.push(N)}),M.sort((V,N)=>V.contains(N)?1:N.contains(V)?-1:0),M}function p(C,M,V,N){var x={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},A={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},Q={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?d[M](C,A[V],N):a.navigator.msPointerEnabled?d[M](C,Q[V],N):(d[M](C,x[V],N),d[M](C,V,N))}function g(C){if(C.touches!==void 0)return C.touches.length;if(C.which!==void 0&&C.which!==0)return C.which;if(C.buttons!==void 0)return C.buttons;var M=C.button;if(M!==void 0)return M&1?1:M&2?3:M&4?2:0}function b(C,M,V){C=C||{};var N=C.className||"",x;return C.className+=" gu-hide",x=u.elementFromPoint(M,V),C.className=N,x}function S(){return!1}function F(){return!0}function R(C){return C.width||C.right-C.left}function $(C){return C.height||C.bottom-C.top}function w(C){return C.parentNode===u?null:C.parentNode}function y(C){return C.tagName==="INPUT"||C.tagName==="TEXTAREA"||C.tagName==="SELECT"||E(C)}function E(C){return!C||C.contentEditable==="false"?!1:C.contentEditable==="true"?!0:E(w(C))}function T(C){return C.nextElementSibling||M();function M(){var V=C;do V=V.nextSibling;while(V&&V.nodeType!==1);return V}}function j(C){return C.targetTouches&&C.targetTouches.length?C.targetTouches[0]:C.changedTouches&&C.changedTouches.length?C.changedTouches[0]:C}function H(C,M){var V=j(M),N={pageX:"clientX",pageY:"clientY"};return C in N&&!(C in V)&&N[C]in V&&(C=N[C]),V[C]}o.exports=c}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(s,d){return Array.prototype.slice.call(s,d)}},{}],4:[function(t,o,r){var a=t("ticky");o.exports=function(d,l,u){d&&a(function(){d.apply(u||null,l||[])})}},{ticky:10}],5:[function(t,o,r){var a=t("atoa"),s=t("./debounce");o.exports=function(l,u){var m=u||{},c={};return l===void 0&&(l={}),l.on=function(h,f){return c[h]?c[h].push(f):c[h]=[f],l},l.once=function(h,f){return f._once=!0,l.on(h,f),l},l.off=function(h,f){var p=arguments.length;if(p===1)delete c[h];else if(p===0)c={};else{var g=c[h];if(!g)return l;g.splice(g.indexOf(f),1)}return l},l.emit=function(){var h=a(arguments);return l.emitterSnapshot(h.shift()).apply(this,h)},l.emitterSnapshot=function(h){var f=(c[h]||[]).slice(0);return function(){var p=a(arguments),g=this||l;if(h==="error"&&m.throws!==!1&&!f.length)throw p.length===1?p[0]:p;return f.forEach(function(S){m.async?s(S,p,g):S.apply(g,p),S._once&&l.off(h,S)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(a){var s=t("custom-event"),d=t("./eventmap"),l=a.document,u=h,m=p,c=[];a.addEventListener||(u=f,m=g),o.exports={add:u,remove:m,fabricate:b};function h(w,y,E,T){return w.addEventListener(y,E,T)}function f(w,y,E){return w.attachEvent("on"+y,F(w,y,E))}function p(w,y,E,T){return w.removeEventListener(y,E,T)}function g(w,y,E){var T=R(w,y,E);if(T)return w.detachEvent("on"+y,T)}function b(w,y,E){var T=d.indexOf(y)===-1?H():j();w.dispatchEvent?w.dispatchEvent(T):w.fireEvent("on"+y,T);function j(){var C;return l.createEvent?(C=l.createEvent("Event"),C.initEvent(y,!0,!0)):l.createEventObject&&(C=l.createEventObject()),C}function H(){return new s(y,{detail:E})}}function S(w,y,E){return function(j){var H=j||a.event;H.target=H.target||H.srcElement,H.preventDefault=H.preventDefault||function(){H.returnValue=!1},H.stopPropagation=H.stopPropagation||function(){H.cancelBubble=!0},H.which=H.which||H.keyCode,E.call(w,H)}}function F(w,y,E){var T=R(w,y,E)||S(w,y,E);return c.push({wrapper:T,element:w,type:y,fn:E}),T}function R(w,y,E){var T=$(w,y,E);if(T){var j=c[T].wrapper;return c.splice(T,1),j}}function $(w,y,E){var T,j;for(T=0;T<c.length;T++)if(j=c[T],j.element===w&&j.type===y&&j.fn===E)return T}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(a){var s=[],d="",l=/^on/;for(d in a)l.test(d)&&s.push(d.slice(2));o.exports=s}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(a){var s=a.CustomEvent;function d(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=d()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(u,m){var c=document.createEvent("CustomEvent");return m?c.initCustomEvent(u,m.bubbles,m.cancelable,m.detail):c.initCustomEvent(u,!1,!1,void 0),c}:function(u,m){var c=document.createEventObject();return c.type=u,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 Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var a=o.exports={},s,d;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?d=clearTimeout:d=u}catch{d=u}})();function m($){if(s===setTimeout)return setTimeout($,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout($,0);try{return s($,0)}catch{try{return s.call(null,$,0)}catch{return s.call(this,$,0)}}}function c($){if(d===clearTimeout)return clearTimeout($);if((d===u||!d)&&clearTimeout)return d=clearTimeout,clearTimeout($);try{return d($)}catch{try{return d.call(null,$)}catch{return d.call(this,$)}}}var h=[],f=!1,p,g=-1;function b(){!f||!p||(f=!1,p.length?h=p.concat(h):g=-1,h.length&&S())}function S(){if(!f){var $=m(b);f=!0;for(var w=h.length;w;){for(p=h,h=[];++g<w;)p&&p[g].run();g=-1,w=h.length}p=null,f=!1,c($)}}a.nextTick=function($){var w=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)w[y-1]=arguments[y];h.push(new F($,w)),h.length===1&&!f&&m(S)};function F($,w){this.fun=$,this.array=w}F.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function R(){}a.on=R,a.addListener=R,a.once=R,a.off=R,a.removeListener=R,a.removeAllListeners=R,a.emit=R,a.prependListener=R,a.prependOnceListener=R,a.listeners=function($){return[]},a.binding=function($){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function($){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,o,r){(function(a){var s=typeof a=="function",d;s?d=function(l){a(l)}:d=function(l){setTimeout(l,0)},o.exports=d}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(a,s){var d=t("process/browser.js").nextTick,l=Function.prototype.apply,u=Array.prototype.slice,m={},c=0;r.setTimeout=function(){return new h(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new h(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function h(f,p){this._id=f,this._clearFn=p}h.prototype.unref=h.prototype.ref=function(){},h.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 a=="function"?a:function(f){var p=c++,g=arguments.length<2?!1:u.call(arguments,1);return m[p]=!0,d(function(){m[p]&&(g?f.apply(null,g):f.call(null),r.clearImmediate(p))}),p},r.clearImmediate=typeof s=="function"?s:function(f){delete m[f]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ln);const Rn={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}},An={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},bt=i.defineComponent({name:"Toast",props:An,emits:["close","click"],setup:(n,e)=>{const{locale:t,t:o}=gt.useI18n(),r=i.ref(n.animate),a="fadeOut",s=i.computed(()=>n.options),d=i.ref(!1),l=i.computed(()=>s.value.title&&s.value.message),u=i.computed(()=>!s.value.title&&s.value.message),m=i.computed(()=>{const $={animated:d.value,toast:!0,"toast--only-content":!l.value};return $[n.animate]=!1,$[a]=d.value,$["toasty-type-"+s.value.type]=!0,s.value.theme&&($[s.value.theme]=!0),$}),c=i.computed(()=>{const y=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,E={"f-icon":!0};return E[y]=!0,E}),h=i.computed(()=>s.value.title||s.value.message),f=i.computed(()=>n.showCloseButton),p=i.computed(()=>!!s.value.buttons||!!e.slots.default),g=i.computed(()=>t.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b($){$.stopPropagation(),$.preventDefault(),d.value=!1,setTimeout(()=>{e.emit("close",s.value)},200)}function S($,w){}function F($){return`f-preten-link ${$.customClass?$.customClass:""}`}i.watch(r,()=>{r.value});const R=()=>{var $;return i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&(($=s.value.buttons)==null?void 0:$.map(w=>i.createVNode("span",{class:F(w),onClick:y=>void 0},[w.text]))),e.slots.default&&e.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)]),h.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:s.value.title},null),i.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:g.value},null),p.value&&R()]),u.value&&(s.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:g.value,innerHTML:s.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:g.value,innerHTML:s.value.message},null))])])])}}),dt=i.defineComponent({name:"Notify",props:Rn,emits:["close","empty"],setup(n,e){const t=i.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=i.ref(),a=i.ref(n.options),s=i.ref(n.showCloseButton),d=i.computed(()=>n.position||"bottom-right"),l=i.computed(()=>n.timeout!=null?n.timeout:3e3),u=i.computed(()=>{const h=n.bottom?n.bottom:o.bottom,f=n.top?n.top:o.top,p={transition:"all 0.2s ease",left:d.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:d.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:d.value.indexOf("top")>-1?`${f}px`:"",bottom:d.value.indexOf("bottom")>-1?`${h}px`:""};return d.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",d.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function m(h){e.emit("close")}l.value&&setTimeout(()=>{m()},l.value),e.expose({closeToast:m,container:r,notifyPosition:d});function c(h,f){m()}return()=>i.createVNode("div",{class:t.value,style:u.value,ref:r},[i.createVNode(bt,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>c(h,a.value)},null)])}});class Hn{constructor(){W(this,"notifyRefs",[]);W(this,"globalConfig",i.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const s=i.createApp({setup(){var u;const d=i.ref();function l(){d.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,d),s.unmount()},220)}if(r.position.indexOf("top")>-1){const m=t.getNotifyInstances(r.position),c=m[m.length-1];if(c){const h=c.value.container.getBoundingClientRect();r.top=h.bottom}}return r.safeHtml&&((u=r.options)!=null&&u.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),i.onUnmounted(()=>{document.body.removeChild(a)}),i.onMounted(()=>{t.updateNotifyPositionForCreate(r,d)}),()=>i.createVNode(i.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[i.createVNode(dt,i.mergeProps({ref:d},r,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(rt.LocaleService.i18n),s.mount(a),s}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const a=r.value.container.getBoundingClientRect();r.value.container.style.bottom=a.height+o-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),a=r.indexOf(t);r.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",a,s,d;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",s=t.position||null,d=t.showCloseButton!=null?t.showCloseButton:null,a=t.timeout!=null?t.timeout:null);const u={options:{type:e,message:o,title:r}};return s!=null&&(u.position=s),d!=null&&(u.showCloseButton=d),a!=null&&(u.timeout=a),u}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const zn=Symbol("NOTIFY_SERVICE_TOKEN");dt.install=n=>{n.component(dt.name,dt),n.component(bt.name,bt);const e=new Hn;n.provide(zn,e),n.provide("FNotifyService",e)},`${rt.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const Un={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:rt.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 _n(n,e,t,o,r,a,s,d,l,u,m,c,h,f,p,g,b){const{calculateCellPositionInRow:S}=a,{columnContext:F,hasLeftFixedColumn:R,hasRightFixedColumn:$}=s,{gridDataStyle:w,leftFixedGridDataStyle:y,rightFixedGridDataStyle:E}=f,{renderDataRow:T}=J.getHierarchyRow(n,e,F,b,d,l,u,m,c,h,f,p,g),j=[T];function H(x,A){const Q=S(x);return b.value.filter(I=>I.visible!==!1).map((I,k)=>j[I.type](I,Q,A,k))}function C(){return i.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:y.value},[H(F.value.leftColumns.filter(x=>x.visible),"left")])])}function M(){return i.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[i.createVNode("div",{class:"fv-grid-data",style:w.value},[H(F.value.primaryColumns.filter(x=>x.visible),"primary")])])}function V(){return i.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:E.value},[H(F.value.rightColumns.filter(x=>x.visible),"right")])])}function N(){const x=[];return R.value&&x.push(C()),x.push(M()),$.value&&x.push(V()),x}return{renderDataArea:N}}const Wn=i.defineComponent({name:"FTreeGrid",props:Un,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,e){var Zt,Kt;const o=((Zt=n.rowOption)==null?void 0:Zt.height)||28,r=i.ref(20),a=i.ref(n.columns),s=J.useIdentify(n),{idField:d}=s,l=i.ref(),u=i.ref(),m=i.ref(),c=i.ref(),h=i.ref(),f=i.ref([]),p=i.ref(!1),g=i.ref(((Kt=n.rowOption)==null?void 0:Kt.wrapContent)||!1),b=J.useGroupData(n,s),S=J.useFilter(n,e),F=J.useHierarchy(n),{collapseField:R}=F,{showLoading:$,renderLoading:w}=J.useLoading(n,l),y=J.useDataView(n,new Map,S,F,s),{dataView:E}=y,T=J.useSelection(n,y,s,f,e),{showSelection:j,selectedValues:H}=T,C=J.useSelectHierarchyItem(n,f,y,s,T,e),M=i.computed(()=>n.disabled),V=i.computed(()=>n.virtualized?Math.min(y.dataView.value.length,r.value):y.dataView.value.length),N=J.usePagination(n,y),{shouldRenderPagination:x}=N,{containerStyleObject:A}=J.useDataViewContainerStyle(n),Q=J.useCommandColumn(n),{applyCommands:I}=Q;I(a);const{applyColumnSetting:k,removeColumnSetting:_}=J.useSettingColumn(n);n.showSetting&&k(a);const D=J.useColumn(n,e),ee=J.useSort(n),{applyColumnSorter:ge,columnContext:ye,updateColumnRenderContext:X}=D;ge(y,ee);const ie=J.useGroupColumn(n,ye),ce=J.useRow(n,e,T,s),te=J.useEdit(n,e,s,ce,f),z=J.useVisualDataBound(n),ne=J.useVisualDataCell(n,te,z),Le=J.useVisualDataRow(n,y,te,F,s,z,ne),Ie=J.useVisualData(n,a,y,V,0,Le),{getVisualData:Me}=Ie,We=J.useCellPosition(n,ye),Re=J.useSidebar(n,T),{sidebarWidth:Ge}=Re,se=J.useVirtualScroll(n,y,f,ye,Ie,V,0,Ge),{onWheel:Ze,dataGridWidth:Ve,viewPortHeight:Pe,viewPortWidth:Ee,resetScroll:Oe,updateVisibleRowsOnLatestVisibleScope:Ke}=se,Ae=J.useFitColumn(n,ye,u,Ee,ie),{calculateColumnsSize:ke}=Ae,$e=J.useFilterHistory(),Xe=J.useColumnFilter(u,h,y,$e,se),Ye=J.useDragColumn(n,e,D,y,ie,b,se),B=i.computed(()=>{const L={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return ve.getCustomClass(L,n.customClass)}),Y=i.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":g.value})),{renderDataArea:le}=_n(n,e,m,c,h,We,D,y,te,F,ce,T,C,se,Ie,z,f),{renderGridHeader:ue,renderGridColumnResizeOverlay:je,shouldShowHeader:xt}=J.getColumnHeader(n,e,u,c,h,D,y,Ye,Xe,S,$e,Ae,ie,T,Re,ee,se,Ee,f),{renderDataGridSidebar:St}=J.getSidebar(n,ce,T,Re,se),{renderDisableMask:Tt}=J.getDisableMask(),{renderHorizontalScrollbar:Mt}=J.getHorizontalScrollbar(n,u,se),{renderVerticalScrollbar:Et}=J.getVerticalScrollbar(n,u,se);function Ft(){var L,G,fe;if(u.value&&u.value.clientHeight>0&&((L=u.value)==null?void 0:L.clientWidth)>0){const he=Math.ceil(u.value.clientHeight/o);he>r.value&&(r.value=he,Ke()),Pe.value=((G=m.value)==null?void 0:G.clientHeight)||0,Ve.value=((fe=u.value)==null?void 0:fe.clientWidth)||0,ke()}}i.onMounted(()=>{u.value&&(r.value=Math.max(Math.ceil(u.value.clientHeight/o),r.value),f.value=Me(0,V.value+0-1),tn.useResizeObserver(u.value,Ft),ke(),i.nextTick(()=>{u.value&&(Ve.value=u.value.clientWidth),m.value&&(Ee.value=m.value.clientWidth,Pe.value=m.value.clientHeight)})),$.value&&w()}),i.onUnmounted(()=>{}),i.watch(Ee,()=>{u.value&&ke()});function Bt(L){y.collapseTo(L),y.reOrderVisibleIndex(),Oe()}function mt(L){y.expandTo(L),y.reOrderVisibleIndex(),Oe()}function et(){const L=T.getSelectionRow();return L?L.dataIndex-1:-1}function kt(){const L=et();y.insertNewDataItem(L),f.value=Me(0,V.value+0-1)}function jt(){const L=et();y.insertNewChildDataItem(L),f.value=Me(0,V.value+0-1)}function Nt(L,G){const fe=f.value.find(xe=>xe.raw[d.value]===G),he=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(L,he)}function It(){const L=et(),G=C.getNextSelectableHierarchyItemId(L);y.removeHierarchyDataItem(L),f.value=Me(0,V.value+0-1),G&&C.selectItemById(G)}function ht(L){te.onEditingRow(L)}function Vt(L){te.acceptEditingRow(L)}function v(L){te.cancelEditingRow(L)}function O(L){L&&(a.value=L,I(a),X(a.value),ge(y,ee),ke())}i.watch(()=>n.columns,L=>{O(L)});function q(L,G){L&&(y.load(L),y.reOrderVisibleIndex(),G!=null&&G.keepScrollPosition?se.scrollTo(se.offsetY.value):Oe())}function U(L){C.selectItemById(L)}function Z(L){const G=f.value.find(fe=>fe.raw[s.idField.value]===L);G&&ce.clickRowItem(G)}function K(L){ce.activeRowById(L)}function Se(L){C.selectItemByIds(L)}function be(){return T.getSelectedItems()}function Ce(){T.clearSelection()}const Fe=i.computed(()=>!f.value||!f.value.length),{renderEmpty:de}=J.getEmpty(n,e);function Be(){return T.getSelectionRow()}function we(L){C.unSelectItemByIds(L)}function me(){return T.currentSelectedDataId.value}function tt(L,G,fe){const he=E.value.find(xe=>xe[d.value]===L);if(he){if(Object.keys(he).forEach(pe=>{Object.prototype.hasOwnProperty.call(G,pe)&&(he[pe]=G[pe])}),fe){const{collapseField:pe,disabledField:He,checkedField:ze,visibleField:Ue}=fe;pe&&!re.isUndefined(G[pe])&&(he.__fv_collapse__=G[pe]),ze&&!re.isUndefined(G[ze])&&(he.__fv_checked__=G[ze]),He&&!re.isUndefined(G[He])&&(he.__fv_disabled__=G[He]),Ue&&!re.isUndefined(G[Ue])&&(he.__fv_visible__=G[Ue])}const xe=f.value.find(pe=>pe.raw[d.value]===L),en=f.value.findIndex(pe=>pe.raw[d.value]===L);if(xe){if(xe.raw=he,Object.keys(xe.data).forEach(pe=>{xe.data[pe].updateData(he)}),fe){const{collapseField:pe,disabledField:He,checkedField:ze,visibleField:Ue}=fe;pe&&!re.isUndefined(G[pe])&&(xe.collapse=G[pe]),ze&&!re.isUndefined(G[ze])&&(xe.checked=G[ze]),He&&!re.isUndefined(G[He])&&(xe.disabled=G[He]),Ue&&!re.isUndefined(G[Ue])&&(xe.visible=G[Ue])}f.value=[...f.value.slice(0,en),xe,...f.value.slice(en+1)],y.updateSummary()}}}function nt(L){return Object.prototype.hasOwnProperty.call(L,"raw")?y.hasRealChildren(L.raw):y.hasRealChildren(L)}function ot(L){const G=y.dataView.value.find(fe=>fe[d.value]===L);return G?G[R.value]:""}function Oo(){return R.value}i.watch(()=>n.showSetting,(L,G)=>{L!==G&&(L?k(a):_(a),O(a.value))});function $o(L){return f.value.filter(G=>L.includes(G.raw[n.idField]))}function qo(L){const G=s.idField.value,fe=f.value.find(he=>he.raw[G]===L);fe&&ce.changeRow(fe)}function Do(){T.keepSelectingOnPaging.value||Ce(),y.updateVisibleDataSummary(f.value)}e.expose({activeRowById:K,addNewDataItem:kt,addNewChildDataItem:jt,addChildrenToNode:Nt,collapseTo:Bt,expandTo:mt,removeDataItem:It,editDataItem:ht,acceptDataItem:Vt,cancelDataItem:v,updateColumns:O,updateDataSource:q,selectItemById:U,selectItemByIds:Se,getSelectedItems:be,clearSelection:Ce,getSelectionRow:Be,clickRowItemById:Z,unSelectItemByIds:we,getCurrentRowId:me,reassignRowData:tt,hasChildren:nt,getCollapseField:Oo,getCollapseStatusById:ot,getVisibleDataByIds:$o,selectRowById:qo,updateDerivedData:Do});const Lo=i.computed(()=>{const L={};return se.shouldShowHorizontalScrollbar.value&&(L.paddingBottom="10px"),se.shouldShowVirticalScrollbar.value&&(L.paddingRight="10px"),L}),Ro=i.computed(()=>({...A.value,borderRadius:"5px"}));J.getPagination(n,e,y,se,N,T);const Ao=i.computed(()=>({"d-flex":!0,"justify-content-between":x.value&&j.value,"justify-content-end":x.value&&!j.value,"position-relative":!0})),Ho=i.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:zo}=J.getSummary(n,y,D);return()=>i.createVNode("div",{ref:l,class:B.value,style:Ro.value,onWheel:Ze},[u.value&&xt.value&&ue(),i.createVNode("div",{ref:u,class:Y.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:Lo.value},[u.value&&St(f),u.value&&le(),u.value&&Fe.value&&de(),u.value&&Mt(),u.value&&Et()]),u.value&&zo(),j.value&&i.createVNode("div",{class:Ao.value},[j.value&&i.createVNode("div",{class:Ho.value},[i.createVNode("div",null,["已选:"+H.value.length,i.createTextVNode(" 条")])])]),je(),M.value&&Tt()])}});ve.withInstall(Wn);const Gn=new Map([["appearance",vt]]);function Xn(n,e,t){return e}Je({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,Xn,{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",vt]]),Yn=new Map([]),Jn="root-viewmodel";class Qn{constructor(e,t){W(this,"formSchemaUtils");W(this,"controlCreatorUtils");W(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(r),a.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:a}=e;a==null||a.forEach(d=>{if(d.$type===ve.FormSchemaEntityField$Type.SimpleField){const l=re.cloneDeep(d),u=this.resolveControlClassByFormColumns(e),m=this.controlCreatorUtils.setFormFieldProperty(l,"",u);m&&r.push(m)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:Jn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{if(r.$type===ve.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=r.type.name;(s===ve.FormSchemaEntityFieldTypeName.Enum||s===ve.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),t}}function Zn(n,e,t,o){var a,s,d,l,u,m;const r=t.parentComponentInstance;if(r&&o){const c=(a=r.schema)==null?void 0:a.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=t.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(d=t.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((u=t.bindingSourceContext)==null?void 0:u.bindTo)||"/",selectedFields:(m=t.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Qn(n,o).createComponent(f)}else return e}function Kn(n,e,t){return e}Je({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 Gt={$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"]};Je({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}},Gt,Ct,void 0),Je({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Gt,Ct,void 0);const eo={$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"]},to={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};it.createPropsResolver(to,eo,Yn,Kn);const no={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 wt(){return new DOMException("The request is not allowed","NotAllowedError")}async function oo(n){if(!navigator.clipboard)throw wt();return navigator.clipboard.writeText(n)}async function io(n){const e=document.createElement("span");e.textContent=n,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw wt()}async function ro(n){try{await oo(n)}catch(e){try{await io(n)}catch(t){throw t||e||wt()}}}function ao(){async function n(e){await ro(e)}return{onCopy:n}}function so(n,e,t,o){const r=i.ref(14),a=i.ref(140),s=i.ref(""),d=i.ref(o.value.length),l=i.computed(()=>o.value),u=i.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function m(c){if(c.currentTarget){const h=c.currentTarget.value||"";d.value=h.length}}return()=>i.createVNode(i.Fragment,null,[i.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:u.value,rows:"4",maxlength:a.value,onInput:c=>m(c)},[l.value]),i.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[d.value+" / "+a.value])])}function lo(n,e,t,o){const r=so(n,e,t,o),a=new Map([["text-area",r]]);function s(d){return a.get(d)||null}return{getEditorRender:s}}function co(){const n=i.ref(!1),e=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:e,toShowFeedback:n}}function uo(n,e){const t=e.getEditorRender(n.promptEditorType);return()=>t&&t()}function fo(n,e){function t(f){if(f==null)return 0;let p=0;for(let g=0;g<f.length;g++){const b=f.charCodeAt(g);b>=0&&b<=128?p++:p=p+2}return p}function o(f,p){if(f!==""&&f!==void 0&&f!==null){f=""+f;const g=f.length;let b="",S=0;for(let F=0;F<g;F++){const R=f.charAt(F);if(S++,encodeURI(R).length>4&&S++,b=b.concat(R),S>=p)return b=b.concat("..."),b}if(S<p)return f}return""}const r=i.computed(()=>!!n.value&&!!n.value.date),a=i.computed(()=>{const f=n.value&&n.value.date||"";return`${e.exception.happend} : ${f}`}),s=i.computed(()=>!!n.value&&!!n.value.detail),d=i.computed(()=>n.value?t(n.value.detail)>160:!1),l=i.ref(!1),u=i.computed(()=>l.value?e.exception.collapse:e.exception.expand),m=i.computed(()=>{const f=e.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 h(){l.value=!l.value}return()=>i.createVNode("div",{class:"toast-msg-detail"},[r.value&&i.createVNode("div",null,[a.value]),s.value&&i.createVNode("div",{class:"exception_wrap"},[i.createVNode("div",{class:"exception_error_msg"},[i.createVNode("div",{innerHTML:m.value},null),d.value&&i.createVNode("span",{style:c.value,onClick:h},[u.value])])])])}function po(n){return()=>i.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function mo(n,e,t,o,r){const a=i.ref(n.exceptionInfo),s=i.computed(()=>{const p=e.value==="question"?"warning":e.value,g={"f-icon":!0},b=`f-icon-${p}`;return g[b]=!0,g}),d=i.computed(()=>t.value||a.value&&a.value.message),l=i.computed(()=>o.value),u=i.computed(()=>!!o.value),m=i.computed(()=>!!a.value);function c(){return m.value?fo(a,r):u.value?po(l):()=>null}const h=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:s.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[i.createVNode("p",{class:"toast-msg-title",innerHTML:d.value,style:f.value},null),h()])])}function ho(n,e,t,o){const{onCopy:r}=e,{toShowFeedback:a}=t,s=i.ref(o.exception.copySuccess||"复制成功"),d=i.ref(o.exception.copy||"复制详细信息"),l=i.ref(n.exceptionInfo||{date:"",message:"",detail:""}),u=i.computed(()=>l.value&&l.value.detail||"");function m(c){r(u.value).catch(h=>{s.value=o.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>i.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[i.createVNode("span",{onClick:m,style:"cursor: pointer;"},[d.value])])}function go(n,e,t,o,r){const a=i.ref(n.type),s=i.ref(n.buttons),d=i.ref(n.exceptionInfo),l=i.ref(r.ok||n.okButtonText),u=i.ref(r.cancel||n.cancelButtonText),m=i.ref(n.showCancelButton),c=i.ref(n.showOkButton),h=i.computed(()=>!!(s.value&&s.value.length)),f=i.computed(()=>d.value&&d.value.message&&d.value.detail),p=i.computed(()=>!(s.value&&s.value.length)&&(c.value||m.value)),g=ho(n,t,o,r);l.value==="关闭"?l.value=r.close:l.value==="知道了"&&(l.value=r.exception.roger);function b(F){a.value==="question"&&e.emit("reject"),e.emit("close")}function S(F){a.value==="question"&&e.emit("accept"),e.emit("close")}return()=>i.createVNode("div",{class:"modal-footer"},[f.value&&g(),p.value&&m.value&&i.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[u.value]),p.value&&c.value&&i.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:S},[l.value]),h.value&&s.value.length&&s.value.map(F=>i.createVNode("button",{type:"button",onClick:F.handle,class:F.class},[F.iconClass&&i.createVNode("span",{class:F.iconClass},null),F.text]))])}function vo(n){const{t:e,locale:t}=gt.useI18n();function o(r,a,s){return a===s?e(r):a}return{yes:o("messageBox.yes")||"是",no:o("messageBox.no")||"否",close:o("messageBox.close")||"关闭",ok:o("messageBox.ok",n.okButtonText,"确定")||"确定",cancel:o("messageBox.cancel",n.cancelButtonText,"取消")||"取消",title:o("messageBox.title")||"系统提示",errorTitle:o("messageBox.errorTitle")||"错误提示",exception:{expand:o("messageBox.exception.expand")||"展开",collapse:o("messageBox.exception.collapse")||"收起",happend:o("messageBox.exception.happend")||"发生时间",detail:o("messageBox.exception.detail")||"详细信息",copy:o("messageBox.exception.copy")||"复制详细信息",copySuccess:o("messageBox.exception.copySuccess")||"复制成功",copyFailed:o("messageBox.exception.copyFailed")||"复制失败",roger:o("messageBox.exception.roger")||"知道了"},locale:t.value}}const ft=i.defineComponent({name:"FMessageBox",props:no,emits:["accept","reject","close"],setup(n,e){const t=vo(n),o=i.ref(n.type),r=i.ref(n.title),a=i.ref(n.detail),s=i.computed(()=>{const S={"modal-tips":!0,"d-flex":!0,"flex-row":!0},F=`messager-type-${o.value}`;return S[F]=!0,S}),d=i.computed(()=>{const S={cursor:"default"};return o.value==="prompt"?S.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(S.padding="0.5rem 1.5rem 1rem 1.5rem"),S}),l=ao(),u=lo(n,o,r,a),m=co(),{feedbackStyle:c,feedbackMessage:h}=m;h.value=t.exception.copySuccess;function f(){return i.createVNode("div",{style:c.value},[h.value])}function p(){switch(o.value){case"prompt":return uo(n,u);default:return mo(n,o,r,a,t)}}const g=p(),b=go(n,e,l,m,t);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:s.value,style:d.value},[g()]),b(),f()])}}),yo={$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:"关闭前回调"}},bo=new Map([["appearance",it.resolveAppearance]]);function Co(n,e,t){return e}function wo(){function n(e,t){const o={};return o.beforeClose=r=>t.call("beforeClose",[r,e]),o}return{resolve:n}}const Xt={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(Xt,yo,bo,Co),So=wo();class ae{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),a=parseInt(o[5],10);return{x:r,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ae(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ae(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ae(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ae(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),a=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new ae(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class qe{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new qe(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new qe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function To(n,e){const t=i.ref(),o=i.ref(),r=i.ref(),a=i.ref(),s=i.ref(),d=i.ref(),l=i.ref(),u=i.ref(),m=i.ref(),c=i.ref(),h=i.ref(),f=i.ref(n.resizeable),p=i.ref(),g=i.ref(n.draggable),b=i.ref(!1);function S(){const I=o.value||document.body,k=window.getComputedStyle(I);if(!k||!t.value)return;const _=ae.getTransformInfo(t.value),D={};l.value&&(D.deltaL=t.value.offsetLeft-l.value.x,D.deltaT=t.value.offsetTop-l.value.y);const ee=k.getPropertyValue("position");D.width=I.clientWidth,D.height=I.clientHeight,D.pr=parseInt(k.getPropertyValue("padding-right"),10),D.pb=parseInt(k.getPropertyValue("padding-bottom"),10),D.position=k.getPropertyValue("position"),ee==="static"&&(I.style.position="relative"),D.translateX=_.x,D.translateY=_.y,c.value=D}function F(I){if(t.value){a.value=qe.getCurrent(t.value),s.value=ae.getCurrent(t.value),d.value=a.value?qe.copy(a.value):null,l.value=s.value?ae.copy(s.value):null,S();const k=I.target.getAttribute("type")||"";u.value={n:!!k.match(/n/),s:!!k.match(/s/),w:!!k.match(/w/),e:!!k.match(/e/)}}}function R(){var I,k,_,D;if(t.value){const ee=t.value;u.value&&((u.value.n||u.value.s)&&((I=d.value)!=null&&I.height)&&(ee.style.height=d.value.height+"px"),(u.value.w||u.value.e)&&((k=d.value)!=null&&k.width)&&(ee.style.width=d.value.width+"px"),l.value&&((_=l.value)!=null&&_.x&&(ee.style.left=l.value.x+"px"),(D=l.value)!=null&&D.y&&(ee.style.top=l.value.y+"px")))}}function $(){const I=n.minHeight?n.minHeight:1,k=n.minWidth?n.minWidth:1;d.value&&l.value&&u.value&&a.value&&(d.value.height<I&&(d.value.height=I,u.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-I))),d.value.width<k&&(d.value.width=k,u.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-k))),n.maxHeight&&d.value.height>n.maxHeight&&(d.value.height=n.maxHeight,s.value&&u.value.n&&(l.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&d.value.width>n.maxWidth&&(d.value.width=n.maxWidth,u.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-n.maxWidth))))}function w(){if(o.value){const I=c.value;if(l.value&&d.value&&u.value&&a.value){const k=I.width-I.pr-I.deltaL-I.translateX-l.value.x,_=I.height-I.pb-I.deltaT-I.translateY-l.value.y;u.value.n&&l.value.y+I.translateY<0&&s.value&&(l.value.y=-I.translateY,d.value.height=a.value.height+s.value.y+I.translateY),u.value.w&&l.value.x+I.translateX<0&&s.value&&(l.value.x=-I.translateX,d.value.width=a.value.width+s.value.x+I.translateX),d.value.width>k&&(d.value.width=k),d.value.height>_&&(d.value.height=_)}}}function y(I){if(!r.value||!a.value||!s.value||!u.value)return;I.subtract(r.value);const k=I.x,_=I.y;u.value.n?(l.value.y=s.value.y+_,d.value.height=a.value.height-_):u.value.s&&(d.value.height=a.value.height+_),u.value.e?d.value.width=a.value.width+k:u.value.w&&(d.value.width=a.value.width-k,l.value.x=s.value.x+k),w(),$(),R()}function E(I){if(!m.value)return;const k=ae.fromEvent(I);k&&y(k)}function T(){if(t.value){const{width:I,height:k,x:_,y:D}=t.value.getBoundingClientRect(),ee=ae.getTransformInfo(t.value);return{size:{width:I,height:k},position:{x:_-ee.x,y:D-ee.y}}}return null}function j(I){if(t.value){const k=T();h.value=k}r.value=void 0,a.value=null,s.value=null,d.value=null,l.value=null,u.value=null,m.value=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",j)}function H(){document.addEventListener("mousemove",E),document.addEventListener("mouseup",j)}function C(I){I instanceof MouseEvent&&I.button===2||g.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),r.value=ae.fromEvent(I),m.value=I.target,F(I),H())}function M(I){return t.value=I,f.value&&i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:k=>C(k)},null)])}function V(I=!0){document.body.click();const k=o.value||document.body,_=qe.getCurrent(k),D=t.value;I&&D&&(p.value=T(),p.value.transform=D.style.transform),_&&D&&(d.value=_,d.value.height-=14,d.value.width-=14,D.style.height=d.value.height+"px",D.style.width=d.value.width+"px",D.style.left="7px",D.style.top="7px",D.style.transform="",h.value={size:d.value,position:{x:0,y:0}},g.value=!1,b.value=!0)}function N(){var I,k;if(document.body.click(),p.value){const _={width:p.value.size.width||0,height:p.value.size.height||0},D={x:(window.innerWidth-_.width)/2,y:(window.innerHeight-_.height)/2};(I=d.value)==null||I.set(_),(k=l.value)==null||k.set(D);const ee=t.value;ee.style.height=_.height+"px",ee.style.width=_.width+"px",ee.style.left=`${D.x}px`,ee.style.top=`${D.y}px`,ee.style.transform="",h.value={size:_,position:D},g.value=n.draggable,b.value=!1}}function x(){if(t.value){const I=qe.getCurrent(t.value);if(I){const{width:k,height:_}=I;t.value.style.left=`${(window.innerWidth-k)/2}px`,t.value.style.top=`${(window.innerHeight-_)/2}px`,t.value.style.transform=""}}}function A(){const I=()=>{b.value?V(!1):x(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const Q=A();return{renderResizeBar:M,boundingElement:o,resizedEventParam:h,maximize:V,restore:N,allowDrag:g,isMaximized:b,unWindowResizeHandle:Q,moveToCenter:x}}function Mo(n,e,t){const o=i.ref(),r=i.ref(n.draggable),a=i.ref(n.lockAxis),s=i.ref(),d=i.ref(),l=i.ref(!1),u=i.ref(new ae(0,0)),m=i.ref(new ae(0,0)),c=i.ref(new ae(0,0)),h=i.ref(new ae(0,0));i.watch(()=>t.value,E=>{s.value.style.cursor=E?"move":"default"});function f(E,T){if(T.tagName==="BUTTON")return!1;if(T===E)return!0;for(const j in T.children)if(Object.prototype.hasOwnProperty.call(T.children,j)&&f(E,T.children[j]))return!0;return!1}function p(){var H,C;let E=c.value.x+m.value.x,T=c.value.y+m.value.y;a.value==="x"?(E=((H=u.value)==null?void 0:H.x)||0,c.value.x=0):a.value==="y"&&(T=((C=u.value)==null?void 0:C.y)||0,c.value.y=0);const j=`translate3d(${Math.round(E)}px, ${Math.round(T)}px, 0px)`;o.value&&(o.value.style.transform=j),h.value.x=E,h.value.y=T}function g(){if(!d.value||!o.value)return null;const E=d.value.getBoundingClientRect(),T=o.value.getBoundingClientRect(),j={top:E.top<T.top,right:E.right>T.right,bottom:E.bottom>T.bottom,left:E.left<T.left};return j.top||(c.value.y-=T.top-E.top),j.bottom||(c.value.y-=T.bottom-E.bottom),j.right||(c.value.x-=T.right-E.right),j.left||(c.value.x-=T.left-E.left),p(),j}function b(E){E&&(u.value&&E.subtract(u.value),c.value.set(E),p(),g())}function S(E){l.value&&r.value&&(E.stopPropagation(),E.preventDefault(),b(ae.fromEvent(E,s.value)))}function F(){var E;l.value&&(l.value=!1,m.value.add(c.value),c.value.reset(),(E=o.value)==null||E.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",F))}function R(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",S),document.addEventListener("mouseup",F))}function $(){if(o.value){const E=ae.getTransformInfo(o.value);m.value.set(E);return}m.value.reset()}function w(E){if(!t.value||E instanceof MouseEvent&&E.button===2)return;const T=E.target||E.srcElement;s.value!==void 0&&T&&!f(T,s.value)||r.value!==!1&&(document.body.click(),E.stopPropagation(),E.preventDefault(),u.value=ae.fromEvent(E,o.value),$(),R())}function y(E,T,j){if(r.value&&T){if(E)s.value=E;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const H=T.querySelector(n.dragHandle);H&&(s.value=H)}}o.value=T,d.value=j,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",w)):r.value=!1}}return{registerDraggle:y,resetTranslate:$}}function Yt(n,e){if(n){const t=o=>{o.key.toLowerCase()===n.toLowerCase()&&e({event:o,key:n})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Eo(n,e){const t=i.ref(n.enableEsc);let o=null;return t.value?(o=Yt("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Fo(n,e){const t=i.ref(n.enableEnter);let o=null;return t.value?(o=Yt("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const De=i.defineComponent({name:"FModal",props:Xt,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,e){const t=i.ref(n.width||300),o=i.ref(n.height||200),r=i.ref(n.modelValue),a=i.ref(""),s=i.ref(n.class),d=i.ref(n.fitContent),l=i.ref(n.showHeader),u=i.ref(""),m=i.ref(n.showCloseButton),c=i.ref(n.showMaxButton),h=i.ref(!1),f=i.ref(n.dialogType),p=i.ref(n.src),g=i.ref(""),b=i.ref(n.showButtons),S=i.ref(n.title),F=i.ref(n.containment||null),R=i.ref(),{t:$}=gt.useI18n();S.value==="错误提示"&&(S.value=$("messageBox.errorTitle"));const w=i.ref(!1);function y(B,Y){const le=Y?"accept":"cancel";Promise.resolve().then(()=>{var ue;return(ue=n.beforeClose)==null?void 0:ue.call(n,{closeType:le})}).then(ue=>{ue&&(r.value=!1,e.emit("update:modelValue",!1),Y!=null&&e.emit(Y?"accept":"cancel"),e.emit("closed",B))})}const E=[{name:"cancel",text:$("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:B=>{y(B,!1)}},{name:"accept",text:$("messageBox.ok")||"确定",class:"btn btn-primary",handle:B=>{y(B,!0)}}],T=i.ref(n.buttons&&n.buttons.length?n.buttons:E),j=i.computed(()=>!!u.value),H=i.computed(()=>!!b.value&&!!T.value),C=i.ref(),M=i.ref(),V=i.ref(!1),{renderResizeBar:N,maximize:x,restore:A,boundingElement:Q,resizedEventParam:I,allowDrag:k,unWindowResizeHandle:_,moveToCenter:D}=To(n),{registerDraggle:ee}=Mo(n,e,k);function ge(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ye(){const B=document.querySelectorAll(".farris-modal").length;(!B||B-1<=0)&&document.body.classList.remove("modal-open"),R.value&&R.value.classList.remove("show")}i.watch(()=>n.title,(B,Y)=>{B!==Y&&(S.value=B)}),i.watch(()=>n.modelValue,(B,Y)=>{B!==Y&&(r.value=B,r.value&&n.draggable&&i.nextTick(()=>{M.value&&!F.value&&(F.value=M.value.parentElement,Q.value=F.value,ee(C.value,M.value,Q.value),D())}),B||(F.value&&(F.value=null),ye())),r.value?w.value=ge():(V.value=!1,k.value=n.draggable)}),i.watch(()=>n.showHeader,(B,Y)=>{B!==Y&&(l.value=B)}),i.watch(()=>n.showButtons,(B,Y)=>{B!==Y&&(b.value=B)}),i.watch(()=>I.value,(B,Y)=>{const le=B||{},ue=Y||{};JSON.stringify(le)!==JSON.stringify(ue)&&e.emit("resize",{newSize:B,oldSize:Y,isMaximized:V.value})});const X=i.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ie=i.computed(()=>{var le;const B={modal:!0,"farris-modal":!0,fade:!0};B["f-modal-fitContent"]=!!d.value,B.show=!!X.value;const Y=(le=n.maskClass)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,je)=>(ue[je]=!0,ue),B),B}),ce=i.computed(()=>{var le;const B={"modal-dialog":!0},Y=(le=s.value)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,je)=>(ue[je]=!0,ue),B),B}),te=i.computed(()=>{const B={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:d.value?"auto":`${o.value}px`};return n.mask||(B.pointerEvents="auto"),B}),z=()=>ve.getMaxZIndex()||1040,ne=i.computed(()=>{const B={display:"block",zIndex:z()};return n.mask||(B.pointerEvents="none",B.backgroundColor="transparent"),w.value&&(B.backgroundColor="transparent"),B}),Le=i.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Ie=i.computed(()=>{const B={display:l.value?"":"none"};return B["pointer-events"]=k.value?"auto":"none",B}),Me=i.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:V.value})),We=i.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function Re(){return{height:`${n.footerHeight||60}px`}}const Ge=i.computed(()=>{const B={textAlgin:g.value},Y=Re();return Object.assign(B,Y)});function se(B){if(B==null||B.stopPropagation(),V.value){V.value=!1,A();return}x(),V.value=!0}async function Ze(B,Y){B.handle&&await B.handle(Y,B)&&e.emit("closed",Y)}function Ve(B){B.width&&(t.value=B.width),B.height&&(o.value=B.height),B.buttons&&(T.value=B.buttons),B.title&&(S.value=B.title)}let Pe=null,Ee=null;i.onBeforeMount(()=>{w.value=ge()}),i.onMounted(()=>{M.value&&!F.value&&(F.value=M.value.parentElement,Q.value=F.value,ee(C.value,M.value,Q.value)),X.value&&document.body.classList.add("modal-open"),Pe=Eo(n,e),Ee=Fo(n,e)}),i.onUnmounted(()=>{_&&_(),Pe&&Pe.remove(),Ee&&Ee.remove()}),e.expose({modalElementRef:M,updateModalOptions:Ve,close:y,maxDialog:se,isMaximized:V});function Oe(){return i.createVNode("ul",null,[h.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:se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[i.createVNode("span",{class:Me.value},null)]),m.value&&i.createVNode("li",{class:"f-btn-icon f-bare",onClick:B=>y(B,!1),style:"pointer-events: auto;"},[i.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return i.createVNode("div",{class:"modal-footer",style:Ge.value},[T.value&&T.value.map(B=>{const Y=i.ref(B.disabled);return i.createVNode("button",{name:B.name,type:"button",disabled:Y.value,class:B.class+(B.iconClass?" btn-icontext":""),onClick:le=>{Ze(B,le)}},[!!B.iconClass&&i.createVNode("i",{class:B.iconClass},null),B.text])})])}function Ae(){return i.createVNode("div",{ref:C,class:"modal-header",style:Ie.value},[e.slots.headerTemplate?e.slots.headerTemplate():i.createVNode("div",{class:"modal-title"},[j.value&&i.createVNode("span",{class:u.value,style:"margin-right: 8px"},null),i.createVNode("span",{class:"modal-title-label"},[S.value])]),i.createVNode("div",{class:"actions"},[Oe()])])}function ke(){return e.slots.footerTemplate?e.slots.footerTemplate():H.value&&Ke()}function $e(B){if(B.stopPropagation(),n.allowClickMaskToClose){if(B.target!==R.value)return;y(B,!1)}}function Xe(){var B,Y;return i.createVNode("div",{id:a.value,class:ce.value,style:te.value,ref:M},[i.createVNode("div",{class:Le.value},[l.value&&Ae(),i.createVNode("div",{class:We.value},[(Y=(B=e.slots).default)==null?void 0:Y.call(B),f.value==="iframe"&&i.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),ke()]),!d.value&&M.value&&!V.value&&N(M.value)])}function Ye(B){return B||"body"}return()=>i.createVNode(i.Teleport,{to:Ye(n.host)},{default:()=>[X.value&&i.createVNode(i.Transition,{name:"fade",appear:!0},{default:()=>[i.createVNode("div",{ref:R,class:ie.value,style:ne.value,onClick:$e},[Xe()])]})]})}});function Jt(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Bo(n){const e=document.createElement("div");e.style.display="contents";const t=i.createApp({setup(o,r){i.onUnmounted(()=>{document.body.removeChild(e)});const a=i.ref(),s=i.ref(n.class||""),d=i.ref(!!n.showButtons),l=i.ref(!!n.showHeader),u=i.ref(n.showCloseButton==null?!0:n.showCloseButton),m=i.ref(!0),c=i.ref(n.title||""),h=n.acceptCallback||(()=>{}),f=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),g=n.resizeHandle||(R=>{}),b=n.stopMoveHandle||(R=>{}),S=Jt(n),F=R=>{m.value=!1,t.unmount(),p(R)};return i.onMounted(()=>{}),r.expose({modalRef:a}),()=>i.createVNode(De,{ref:a,class:s.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":d.value,"show-close-button":u.value,"show-max-button":!1,onAccept:h,onCancel:f,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:F,onResize:g,onStopMove:b},{default:()=>[S&&S(t)]})}});return document.body.appendChild(e),t.use(rt.LocaleService.i18n),t.mount(e),t}class Qt{constructor(e){W(this,"appContext",null);W(this,"modalRef",i.ref());W(this,"activeModalIndex",i.ref(0));W(this,"modalRefs",{});W(this,"isUseEscCloseModal",i.ref(!1));W(this,"activeModalInstance",i.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Bo(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=i.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=i.ref(!0),a=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),d=o.value.closedCallback||((w,y)=>{}),l=o.value.resizeHandle||(w=>{}),u=e.stopMoveHandle||(w=>{});let m;const c=Jt(o.value),h=w=>{var E;r.value=!1;const y=(E=w==null?void 0:w.target)==null?void 0:E.classList.contains("modal_close");d(w,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},f=w=>{h(w),m&&i.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],i.render(null,t),m=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(E=>Number(E));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=w=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(w==null?void 0:w.event))},{width:g,height:b}=o.value,S=this.adaptToWindow(g||500,b||320);Object.assign(o.value,S);const F=()=>i.createVNode(De,i.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":w=>r.value=w},o.value,{onAccept:a,onCancel:s,onClosed:f,onResize:l,onEsc:p,onStopMove:u}),{default:()=>[c&&c(this.app)]});return m=(w=>{const y=i.h(F,w);return y.appContext=this.appContext,i.render(y,t),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{o.value={...o.value,...w},m&&i.render(i.cloneVNode(m,{...o}),t)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ko=Symbol("FModalService");De.install=n=>{n.component(De.name,De);const e=new Qt(n);n.provide(ko,e),n.provide("FModalService",e)},De.register=(n,e,t,o)=>{n.modal=De,e.modal=xo,o.modal={callbackResolver:So}};const Te=class Te{static show(e){const t=i.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",a=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",s=t.acceptCallback||(()=>{}),d=t.rejectCallback||(()=>{});let l=null,u=new Qt(Te.app);const m=()=>{l&&(l==null||l.destroy(),u=null)};return l=u==null?void 0:u.open({class:"modal-message modal-message-type-info",title:a,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>i.createVNode(ft,i.mergeProps(t,{onAccept:s,onReject:d,onClose:m}),null)}),u==null?void 0:u.getCurrentModal()}static info(e,t){const o=i.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Te.show(o)}static warning(e,t){const o=i.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Te.show(o)}static success(e,t){const o=i.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",showCancelButton:!1});Te.show(o)}static error(e,t,o){const r=i.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:e,detail:t}});Te.show(r)}static prompt(e,t){const o=i.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Te.show(o)}static question(e,t,o,r){const a=i.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Te.show(a)}};W(Te,"app",null);let pt=Te;ft.install=n=>{n.component(ft.name,ft),pt.app=n,n.provide("FMessageBoxService",pt)};class jo extends $n{constructor(t,o){super(t,o);W(this,"responseLayoutEditorFunction");W(this,"bindingVarible");W(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=Dn(this.formSchemaUtils)}getCommonPropertyConfig(t,o,r="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(t,o,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(t,o),this.propertyConfig.categories.behavior=this.getBehaviorConfig(t,"form-group")}getPropertyConfig(t,o){return this.getCommonPropertyConfig(t,o,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(t),this.propertyConfig.categories.expressions=this.getExpressionConfig(t,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(t,o){return this.propertyConfig.categories={},this.getCommonPropertyConfig(t,o,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(t):this.propertyConfig.categories.editor=this.getEditorProperties(t),this.propertyConfig.categories.expressons=this.getExpressionConfig(t,"Field"),this.propertyConfig.categories}getBasicProperties(t,o,r="Card"){const a=this;this.setDesignViewModelField(t);const{canChangeControlType:s,editorTypeList:d}=this.getAvailableEditorType(t),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:d,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:t,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!t.isRtcControl}},setPropertyRelates(u,m,c){if(u)switch(u&&u.propertyID){case"type":{a.changeControlType(t,u,o);break}case"label":{u.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(t,u,c);break}}}};return r.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(t,o){if(!t.binding)return!1;if(t.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(t.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==ve.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(t){var a;const o=this.checkCanChangeControlType(t,this.viewModelId);if(!o)return{canChangeControlType:!1,editorTypeList:[{key:t.editor.type,value:((a=P[t.editor.type])==null?void 0:a.name)||t.editor.type}]};let r=[];return this.designViewModelField&&this.designViewModelField.$type===ve.FormSchemaEntityField$Type.SimpleField?r=lt.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(r=lt.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:o,editorTypeList:r}}changeBindingField(t,o,r){o.needRefreshEntityTree=!0}getAppearanceProperties(t,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(t,r.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,r.componentId||t.id),r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId),r.updateElementByParentContainer(t.id,o),delete t.responseLayout;break;case"class":r.updateUnifiedLayoutAfterControlChanged(a.propertyValue,t.id,this.componentId),st.value++;break;case"style":{st.value++;break}}}}}getEditorProperties(t){return this.getComponentConfig(t)}changeControlType(t,o,r){const a=o.propertyValue,s=r&&r.parent&&r.parent.schema;if(!s)return;const d=s.contents.findIndex(m=>m.id===t.id);if(d===-1)return;const l=s.contents[d];let u;if(this.designViewModelField){const h=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};h.editor||(h.editor={}),h.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,h,!1),u=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}u||(u=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(u,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(u,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(m=>{Object.prototype.hasOwnProperty.call(l.editor,m)&&(u.editor[m]=l.editor[m])}),r!=null&&r.updateContextSchema?r.updateContextSchema(u):(r.schema=Object.assign(l,u),Object.assign(t,u)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(m=>m.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(m=>m.classList.remove("dgComponentFocused")),st.value++,i.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(t,o={},r={},a){var h;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},o),d=(h=t.binding)!=null&&h.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(t,d,"readonly"),u=this.getPropertyEditorParams(t,d,"required"),m={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:u},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const f in r)m[f]=Object.assign(m[f]||{},r[f]);const c=this;return{...s,properties:{...m},setPropertyRelates(f,p){if(f){switch(f.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(t,f);break}a&&a.bind(c)(f,t,p)}}}}updateUnifiedLayoutAfterControlChanged(t,o,r){const a=t.split(" ");let s=a.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),d=a.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=a.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),u=a.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));s=s||"col-12",d=d||"col-md-"+s.replace("col-",""),l=l||"col-xl-"+d.replace("col-md-",""),u=u||"col-el-"+l.replace("col-xl-","");const m={id:o,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(d.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(u.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(r,m)}updateUnifiedLayoutAfterResponseLayoutChanged(t,o){const{formNode:r}=this.responseLayoutEditorFunction.checkCanFindFormNode(t);if(!r||!r.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,a,1),o){const p=a.find(g=>g.id===o.id);Object.assign(p||{},o)}const s=a.map(p=>p.columnInSM),d=a.map(p=>p.columnInMD),l=a.map(p=>p.columnInLG),u=a.map(p=>p.columnInEL),m=this.checkIsUniqueColumn(s)?s[0]:null,c=this.checkIsUniqueColumn(d)?d[0]:null,h=this.checkIsUniqueColumn(l)?l[0]:null,f=this.checkIsUniqueColumn(u)?u[0]:null;Object.assign(r.unifiedLayout,{uniqueColClassInSM:m,uniqueColClassInMD:c,uniqueColClassInLG:h,uniqueColClassInEL:f})}checkIsUniqueColumn(t){const o=new Set(t);return Array.from(o).length===1}getItemCollectionEditor(t,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(t)}}}checkEnumDataReadonly(t){return!t.binding||t.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===ve.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(t,o){t.binding&&t.binding.type===ct.Form&&t.binding.field?(o.find(s=>s.label==="fieldValueChanging")||o.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),o.find(s=>s.label==="fieldValueChanged")||o.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(t.fieldValueChanging=this.designViewModelField.valueChanging,t.fieldValueChanged=this.designViewModelField.valueChanged)):o=o.filter(r=>r.label!=="fieldValueChanging"&&r.label!=="fieldValueChanged")}getControlMethodType(t){if(!t.binding)return t.type;switch(t.binding.type){case ct.Form:return t.binding.path||t.type;case ct.Variable:return t.binding.fullPath||t.type}return t.type}getEventPropertyConfig(t,o="card",r,a){const s=this;let d=[];r&&(d=d.concat(r)),this.appendFieldValueChangeEvents(t,d);const l=s.eventsEditorUtils.formProperties(t,s.viewModelId,d);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,h){const f=c.propertyValue;delete t[s.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,f.controlInfo={type:s.getControlMethodType(t),name:t.title},s.eventsEditorUtils.saveRelatedParameters(t,s.viewModelId,f.events,f)),a&&a(c,h,f);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:t.fieldValueChanging,valueChanged:t.fieldValueChanged})}}}getExpressionConfig(t,o,r=["compute","dependency","validate"],a){return new Wt(this.formSchemaUtils).getExpressionConfig(t,o,r,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(t,o,r){var a;t.editor[o]!==r?t.editor[o]=r:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(t,o,r){let a=r;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(o==="trueValue"?"true":"false"));const d=o==="trueValue"?"falseValue":"trueValue";t.editor[d]===a&&(a=a+1),this.updatePropertyValue(t,o,a)}getBooleanValueConverter(){return{convertFrom:(t,o)=>t.editor[o],convertTo:(t,o,r)=>{this.setBooleanValue(t,o,r)}}}}class No extends jo{constructor(e,t){super(e,t)}getEditorProperties(e){return this.getComponentConfig(e,{type:"textarea"},{resizable:{description:"",title:"拖拽调整大小",type:"boolean"},autoHeight:{description:"",title:"自动高度",visible:!1,type:"boolean"}})}getGridFieldEdtiorProperties(e){return this.getComponentConfig(e,{type:"textarea"},{autoHeight:{description:"",title:"自动高度",visible:!1,type:"boolean"}})}}function Io(n,e){const t=n.schema;function o(r,a){return new No(r,e).getPropertyConfig(t,a)}return{getPropsConfig:o}}const Vo=i.defineComponent({name:"FTextareaDesign",props:_t,emits:[""],setup(n,e){const t=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),a=Io(r,o),s=In(t,r,a),d=i.computed(()=>n.maxLength?n.maxLength:n.modelValue.length),l=i.computed(()=>({position:"relative"})),u=i.computed(()=>({"box-shadow":"0 0 0 1px #dcdfe6 inset",border:"none",padding:"5px 10px",width:"100%"})),m={position:"absolute",bottom:"5px",right:"10px"};return i.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>i.createVNode("div",{style:l.value,ref:t},[i.createVNode("textarea",{id:n.id,tabindex:n.tabIndex,disabled:!1,readonly:!0,style:u.value,placeholder:n.placeholder,rows:n.rows},null),n.showCount&&i.createVNode("span",{style:m},[`${n.modelValue.length}/${d.value}`])])}});Qe.register=(n,e,t,o)=>{n.textarea=Qe,e.textarea=yt},Qe.registerDesigner=(n,e,t)=>{n.textarea=Vo,e.textarea=yt};const Po=ve.withInstall(Qe);oe.FTextarea=Qe,oe.default=Po,oe.propsResolver=yt,oe.textAreaDesignProps=_t,oe.textAreaProps=at,Object.defineProperties(oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
|
+
`+d.value.slice(k),i.nextTick(()=>{var _;r.value.selectionStart=I+1,r.value.selectionEnd=I+1,(_=r.value)==null||_.focus()}),e.emit("update:modelValue",d.value),e.emit("valueChange",d.value),e.emit("change",d.value);return}},j=i.computed(()=>({"form-control":!0,"h-100":n.autoHeight})),H=i.computed(()=>{const x={};return n.resizable||(x.resize="none"),n.rows>2?{height:"auto",...x}:x}),C=i.computed(()=>n.disabled||n.readonly?"":n.placeholder);i.watch(()=>n.modelValue,(x,A)=>{x!==A&&(d.value=x)});const M=()=>r.value;e.expose({elementRef:r,getTextareaElement:M});function V(){var x,A;n.selectOnCreated&&((x=r.value)==null||x.select()),n.focusOnCreated&&((A=r.value)==null||A.focus({preventScroll:!0}))}return i.onMounted(()=>{V()}),()=>i.createVNode("div",{ref:o,class:u.value,onMouseenter:S,onMouseleave:F,style:"position:relative"},[i.withDirectives(i.createVNode("textarea",{ref:r,class:j.value,id:n.id,"onUpdate:modelValue":x=>d.value=x,minlength:n.minLength,maxlength:s.value,tabindex:n.tabIndex,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,placeholder:C.value,autofocus:n.autofocus,rows:n.rows,onInput:y,onFocus:c,onChange:p,onKeydown:T,onBlur:m,onMousedown:h,onMouseup:f,style:H.value},null),[[i.vModelText,d.value]]),$.value&&i.createVNode("span",{id:"clearIcon",class:R.value,style:w.value,onClick:x=>E(x)},[i.createVNode("i",{class:"f-icon modal_close"},null)])])}});function In(n,e,t){var C;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=i.ref();let s;function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function l(){return!1}function u(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function c(M){if(!M||!M.value)return null;if(M.value.schema&&M.value.schema.type==="component")return M.value;const V=i.ref(M==null?void 0:M.value.parent),N=c(V);return N||null}function h(M=e){var A;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(M);const{componentInstance:V,designerItemElementRef:N}=M;if(!V||!V.value)return null;const{getCustomButtons:x}=V.value;return V.value.canMove||x&&((A=x())!=null&&A.length)?N:h(M.parent)}function f(M){return!!t&&t.canAccepts(M)}function p(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function g(){}function b(M,V){var N;!M||!V||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(M,V),(N=e==null?void 0:e.setupContext)==null||N.emit("dragEnd"))}function S(M,V){const{componentType:N}=M;let x=it.getSchemaByTypeForDesigner(N,M,V);t&&t.onResolveNewComponentSchema&&(x=t.onResolveNewComponentSchema(M,x));const A=N.toLowerCase().replace(/-/g,"_");return x&&!x.id&&x.type===N&&(x.id=`${A}_${Math.random().toString().slice(2,6)}`),x}function F(M){M&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(M)}function R(...M){if(t&&t.getPropsConfig)return t.getPropsConfig(...M)}function $(M){if(!M)return;const V=e==null?void 0:e.schema,{formSchemaUtils:N}=M;if(V&&N.getExpressions().length){const x=N.getExpressions().findIndex(A=>A.target===V.id);x>-1&&N.getExpressions().splice(x,1)}}function w(M){if(!M||!(e!=null&&e.schema))return;const V=e.schema,{formSchemaUtils:N}=M;N.removeCommunicationInComponent(V)}function y(M){t&&t.onRemoveComponent&&t.onRemoveComponent(),$(M),w(M),e!=null&&e.schema.contents&&e.schema.contents.map(V=>{let N=V.id;V.type==="component-ref"&&(N=V.component);const x=n.value.querySelectorAll(`#${N}-design-item`);x!=null&&x.length&&Array.from(x).map(A=>{var Q;(Q=A==null?void 0:A.componentInstance)!=null&&Q.value.onRemoveComponent&&A.componentInstance.value.onRemoveComponent(M)})})}function E(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function T(M){var N,x;if(!((N=e==null?void 0:e.schema)!=null&&N.id))return;if(!s&&M&&(s=M.formSchemaUtils),t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let V="";if(t!=null&&t.getComponentTitle)V=t.getComponentTitle();else{const{text:A,title:Q,label:I,mainTitle:k,name:_,type:D}=e.schema;V=A||Q||I||k||_||((x=P[D])==null?void 0:x.name)}V&&s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:V,parentPathName:V})}function j(M){var A;const{changeObject:V}=M,{propertyID:N,propertyValue:x}=V;if(["text","title","label","name","mainTitle"].includes((A=M==null?void 0:M.changeObject)==null?void 0:A.propertyID)&&N&&x&&(T(),s)){const Q=s.getControlBasicInfoMap(),I=Q.keys().toArray().filter(k=>{var _,D;return((_=Q.get(k))==null?void 0:_.reliedComponentId)===((D=e==null?void 0:e.schema)==null?void 0:D.id)});I!=null&&I.length&&I.forEach(k=>{const _=Q.get(k).parentPathName.split(" > ");_[0]=x,Q.get(k).parentPathName=_.join(" > ")})}}function H(M){if(j(M),t&&t.onPropertyChanged)return t.onPropertyChanged(M)}return a.value={canMove:d(),canSelectParent:l(),canDelete:u(),canNested:!m(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:f,getBelongedComponentInstance:c,getDraggableDesignItemElement:h,getDraggingDisplayText:p,getPropConfig:R,getDragScopeElement:g,onAcceptMovedChildElement:b,onChildElementMovedOut:F,addNewChildComponentSchema:S,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||i.ref(!1),onRemoveComponent:y,getCustomButtons:E,onPropertyChanged:H,setComponentBasicInfoMap:T,updateContextSchema:e==null?void 0:e.updateContextSchema},a}const Vn=i.ref(0);function Pn(){Vn.value++}const st=i.ref(0);function On(n){const{formSchemaUtils:e,formStateMachineUtils:t}=n;function o(l,u=""){return{path:u+l.code,field:l.id,fullPath:l.code}}function r(l,u=""){return e.getViewModelById(l).states.map(c=>o(c,u))}function a(l){const u=e.getRootViewModelId(),m=r(l);if(l===u)return m;const c=r(u,"root-component.");return[...m,...c]}function s(l){return l.binding&&l.binding.path||l.id||""}function d(){return t&&t.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:d}}class Wt{constructor(e){W(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'"}]);W(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});W(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,a,s)=>{const d=a.getExpressionRuleValue(e,t||r);return d&&d.value||""},convertTo:(o,r,a,s,d)=>{var l;if(r==="dataPicking"&&(a!=null&&a.target)){const u=`${a.target}_dataPicking`;((l=a.rules)==null?void 0:l.some(c=>c.id===u&&c.value))?o.dictPickingExpressionId=u:delete o.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(s=>s.target===e);if(!r)return"";const a=r.rules.find(s=>s.type===t);return a||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(a=>{r.push({key:a.code,name:a.name,description:a.name,category:a.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t,type:"field"}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var d;const a=this.createTreeNode(r,t);let s=[];(d=r.type)!=null&&d.fields&&(s=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:a,children:s,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var l,u;const a=this.createTreeNode(r,t);a.type="entity";const s=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...t,r.label]),d=this.buildChildEntityTreeData((u=r.type)==null?void 0:u.entities,[...t,r.label]);d!=null&&d.length&&(s==null||s.push(...d)),o.push({data:a,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,a=this.getExpressionRule(r,t),s=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(t)&&a?a.message:"",...s};return a.messageType!=null&&(d.messageType=a.messageType),d}buildRule(e,t,o,r){const{expression:a,message:s,messageType:d}=t,l={id:`${e}_${o}`,type:o,value:a};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=s),o==="dataPicking"&&(l.messageType=d),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const a=t==="Field"?e.binding.field:e.id,s=this.buildRule(a,o,r,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(m=>m.targetType===t&&m.target===a);const u=m=>m.value.trim()==="";if(l){const m=l.rules.find(c=>c.id===s.id);if(m)u(s)?l.rules=l.rules.filter(c=>c.id!==s.id):(Object.assign(m,s),r==="validate"&&e.type==="form-group"&&(m.elementId=e.id));else{if(u(s))return null;l.rules=l.rules||[],l.rules.push(s)}}else{if(u(s))return null;l={target:`${a}`,rules:[s],targetType:t}}return l}getExpressionEditorOptions(e,t,o,r){return o.reduce((a,s)=>{var l,u;const d=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return a[s]={hide:t==="Field"?!!((u=e==null?void 0:e.binding)!=null&&u.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(d),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,s,t),onSubmitModal:m=>{const c=this.updateExpression(e,t,m,s);if(r){const h=this.buildRule(d,m,s);r(h)}return c}}},a},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,a=this.getExpressionRule(r,o),s={value:a&&a.value,targetId:r,targetType:t,expressionType:o};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class $n{constructor(e,t){W(this,"componentId");W(this,"viewModelId");W(this,"eventsEditorUtils");W(this,"formSchemaUtils");W(this,"formMetadataConverter");W(this,"designViewModelUtils");W(this,"designViewModelField");W(this,"controlCreatorUtils");W(this,"designerHostService");W(this,"designerContext");W(this,"schemaService",null);W(this,"metadataService",null);W(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService,this.designerContext=t.designerContext}getFormDesignerInstance(){var e,t;return(t=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:t.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(a=>a.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:P[e.type]&&P[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in t)a[s]=Object.assign(a[s]||{},t[s]);return{...r,properties:{...a},setPropertyRelates(s,d){if(s){switch(s&&s.propertyID){case"class":case"style":{st.value++;break}}o&&o(s,e,d)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},a={},s=""){const{getVariables:d,getControlName:l,getStateMachines:u}=On(this.designerHostService),m=this.getRealTargetType(e),c=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:c};return c.map(f=>{switch(f){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":h.expressionConfig=this.getExpressionOptions(e,m,s||o);break;case"StateMachine":h.stateMachines=u();break;case"Variable":Object.assign(h,{controlName:l(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:d(this.viewModelId),onBeforeOpenVariables:p=>{p.value=d(this.viewModelId)}},a);break}}),h}getVisibleProperty(e,t=""){var a;let o=["Const","Variable","StateMachine","Expression"];return t==="gridFieldEditor"?o=["Const","Expression"]:t==="form-group"&&!((a=e.binding)!=null&&a.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,t="",o={},r){const a={title:"行为",description:""},s=this.getVisibleProperty(e,t);for(const l in o)s[l]=Object.assign(s[l]||{},o[l]);const d=this;return{...a,properties:{...s},setPropertyRelates(l,u){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(e,l);break}r&&r(l,u)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(s=>s.id===e),a=re.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,a),Pn()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(t).states.push(s)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:a,expressionInfo:s}=t,{targetId:d,targetType:l,expressionType:u,value:m,message:c}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:f}=h;let p=f.find(b=>b.target===d);p||(p={target:d,rules:[],targetType:l},f.push(p));const g=p.rules.find(b=>b.type===u);if(g)g.value=m,g.message=c;else{const b={id:a,type:u,value:m,message:c};p.rules.push(b)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const a=e.propertyID,s=this.formSchemaUtils.getExpressions(),d=t.binding?t.binding.field:t.id,l=s.find(u=>u.target===d);!l||!l.rules||(l.rules=l.rules.filter(u=>u.type!==a))}getExpressionOptions(e,t,o){return new Wt(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const t={};return t[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},t}}const _e=class _e{static getEditorTypesByMDataType(e,t=!1,o=""){if(t)return[{key:P["language-textbox"].type,value:P["language-textbox"].name}];let r=_e.fieldControlTypeMapping[e];if(o==="data-grid-column"&&(r!=null&&r.length)){const a=[P["check-group"].type,P["radio-group"].type];r=r.filter(s=>!a.includes(s.key))}return r}static getAllInputTypes(){const e=[];for(const t in _e.fieldControlTypeMapping)_e.fieldControlTypeMapping[t].forEach(o=>{e.find(r=>r.key===o.key&&r.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var a;const o=(a=e.editor)==null?void 0:a.type,r=[];return(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&t&&t.categoryId&&t.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===P["input-group"].type||o===P.textarea.type||o===P["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===P["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===P["combo-list"].type||o===P["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===P["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===P["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===P.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"}),(e.type===P["data-grid-column"].type||e.type===P["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};W(_e,"fieldControlTypeMapping",{String:[{key:P["input-group"].type,value:P["input-group"].name},{key:P.lookup.type,value:P.lookup.name},{key:P["date-picker"].type,value:P["date-picker"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name},{key:P["check-group"].type,value:P["check-group"].name},{key:P["radio-group"].type,value:P["radio-group"].name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P.textarea.type,value:P.textarea.name},{key:P["time-picker"].type,value:P["time-picker"].name}],Text:[{key:P.textarea.type,value:P.textarea.name},{key:P.lookup.type,value:P.lookup.name}],Decimal:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Integer:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Number:[{key:P["number-spinner"].type,value:P["number-spinner"].name},{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],BigNumber:[{key:P["number-spinner"].type,value:P["number-spinner"].name}],Date:[{key:P["date-picker"].type,value:P["date-picker"].name}],DateTime:[{key:P["date-picker"].type,value:P["date-picker"].name}],Boolean:[{key:P.switch.type,value:P.switch.name},{key:P["check-box"].type,value:P["check-box"].name}],Enum:[{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}],Object:[{key:P.lookup.type,value:P.lookup.name},{key:P["combo-list"].type,value:P["combo-list"].name},{key:P["radio-group"].type,value:P["radio-group"].name}]});let lt=_e;var ct=(n=>(n.Form="Form",n.Variable="Variable",n))(ct||{});class qn{constructor(){W(this,"label","");W(this,"id","");W(this,"columnInSM",12);W(this,"columnInMD",6);W(this,"columnInLG",3);W(this,"columnInEL",2);W(this,"displayWidthInSM",1);W(this,"displayWidthInMD",1);W(this,"displayWidthInLG",1);W(this,"displayWidthInEL",1);W(this,"displayColumnCountAtBreakPoint","md");W(this,"tagRow",0);W(this,"showTopBorder",0);W(this,"group",1);W(this,"isSupportedClass",!0);W(this,"fieldSetId","")}}function Dn(n){let e,t;const o=new Map;let r=[];function a(m,c){const f=m.split(" ").filter(F=>F.startsWith("col-"));if(f.length===0){c.isSupportedClass=!1;return}let p=f.find(F=>/^col-([1-9]|10|11|12)$/.test(F)),g=f.find(F=>/^col-md-([1-9]|10|11|12)$/.test(F)),b=f.find(F=>/^col-xl-([1-9]|10|11|12)$/.test(F)),S=f.find(F=>/^col-el-([1-9]|10|11|12)$/.test(F));p=p||"col-12",c.columnInSM=parseInt(p.replace("col-",""),10),c.displayWidthInSM=c.columnInSM/12,c.displayWidthInSM!==1&&(c.isSupportedClass=!1),g=g||"col-md-"+c.columnInSM,c.columnInMD=parseInt(g.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),S=S||"col-el-"+c.columnInLG,c.columnInEL=parseInt(S.replace("col-el-",""),10),c.displayWidthInEL=c.columnInEL/2,[1,2,3,4,5,6].includes(c.displayWidthInEL)||(c.isSupportedClass=!1)}function s(m,c,h,f=!1){let p=!1;m.contents.forEach(g=>{if(g.type==="fieldset"){h+=1,s(g,c,h,!0),p=!0;return}p&&(h+=1,p=!1);const b=g.appearance&&g.appearance.class,S=new qn;b?a(b,S):S.isSupportedClass=!1,S.label=g.label||g.id,S.id=g.id,S.group=h,f&&(S.fieldSetId=m.id),t===g.id&&(e=h),o.set(g.id,g),c.push(S)})}function d(m){const c=n.getComponentById(m);if(!c||!c.componentType||!c.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const h=n.selectNode(c,f=>f.type===Pt.DgControl["response-form"].type);return!h||!h.contents||h.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:h}}function l(m,c){c=c||m.id;const{result:h,message:f,formNode:p}=d(c);if(!h)return{result:h,message:f};t=m.id,r=[],o.clear();const g=p.contents[0].type===Pt.DgControl.fieldset.type?0:1;s(p,r,g);const b=r.find(F=>!F.isSupportedClass);return{defaultState:{defaultGroupNumber:e||1,model:b?"customize":"standard"},importData:r}}function u(m,c){c=c;const{result:h,formNode:f}=d(c);if(!h)return"";const p=[];return m.forEach(g=>{var F;const b=o.get(g.id),S=b.appearance&&b.appearance.class;if(S){const $=S.split(" ").filter(H=>!H.startsWith("col-")),w="col-"+g.columnInSM,y="col-md-"+g.columnInMD,E="col-xl-"+g.columnInLG,T="col-el-"+g.columnInEL,j=[w,y,E,T].concat($);b.appearance.class=j.join(" ")}if(g.fieldSetId){const R=f.contents.find(w=>w.id===g.fieldSetId),$=p.find(w=>w.id===g.fieldSetId);$?(F=$.contents)==null||F.push(b):(p.push(R),R.contents=[b])}else p.push(b)}),f.contents=p,f.id}return{checkCanFindFormNode:d,checkCanOpenLayoutEditor:l,changeFormControlsByResponseLayoutConfig:u,getResonseFormLayoutConfig:s}}var Ne=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 Ln={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){return function(){function t(o,r,a){function s(u,m){if(!r[u]){if(!o[u]){var c=typeof ut=="function"&&ut;if(!m&&c)return c(u,!0);if(d)return d(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var f=r[u]={exports:{}};o[u][0].call(f.exports,function(p){var g=o[u][1][p];return s(g||p)},f,f.exports,t,o,r,a)}return r[u].exports}for(var d=typeof ut=="function"&&ut,l=0;l<a.length;l++)s(a[l]);return s}return t}()({1:[function(t,o,r){var a={},s="(?:^|\\s)",d="(?:\\s|$)";function l(c){var h=a[c];return h?h.lastIndex=0:a[c]=h=new RegExp(s+c+d,"g"),h}function u(c,h){var f=c.className;f.length?l(h).test(f)||(c.className+=" "+h):c.className=h}function m(c,h){c.className=c.className.replace(l(h)," ").trim()}o.exports={add:u,rm:m}},{}],2:[function(t,o,r){(function(a){var s=t("contra/emitter"),d=t("crossvent"),l=t("./classes"),u=document,m=u.documentElement;function c(C,M){var V=arguments.length;V===1&&Array.isArray(C)===!1&&(M=C,C=[]);var N,x,A,Q,I,k,_,D,ee,ge=null,ye,X,ie=!1,ce=0,te,z=M||{};z.moves===void 0&&(z.moves=F),z.accepts===void 0&&(z.accepts=F),z.invalid===void 0&&(z.invalid=Ke),z.containers===void 0&&(z.containers=C||[]),z.isContainer===void 0&&(z.isContainer=S),z.copy===void 0&&(z.copy=!1),z.copySortSource===void 0&&(z.copySortSource=!1),z.revertOnSpill===void 0&&(z.revertOnSpill=!1),z.removeOnSpill===void 0&&(z.removeOnSpill=!1),z.direction===void 0&&(z.direction="vertical"),z.ignoreInputTextSelection===void 0&&(z.ignoreInputTextSelection=!0),z.mirrorContainer===void 0&&(z.mirrorContainer=u.body);var ne=s({containers:z.containers,start:Ee,end:Ae,cancel:B,remove:Ye,destroy:Re,canMove:Pe,dragging:!1});return z.removeOnSpill===!0&&ne.on("over",St).on("out",Tt),Ie(),ne;function Le(v){return ne.containers.indexOf(v)!==-1||z.isContainer(v)}function Ie(v){var O=v?"remove":"add";p(m,O,"mousedown",se),p(m,O,"mouseup",$e)}function Me(v){var O=v?"remove":"add";p(m,O,"mousemove",Ze)}function We(v){var O=v?"remove":"add";d[O](m,"selectstart",Ge),d[O](m,"click",Ge)}function Re(){Ie(!0),$e({})}function Ge(v){ye&&v.preventDefault()}function se(v){Q=v.clientX,I=v.clientY;var O=g(v)!==1||v.metaKey||v.ctrlKey;if(!O){var q=v.target,U=Ve(q);U&&(ye=U,Me(),v.type==="mousedown"&&(y(q)?q.focus():v.preventDefault()))}}function Ze(v){if(ye){if(g(v)===0){$e({});return}if(!(v.clientX!==void 0&&Math.abs(v.clientX-Q)<=(z.slideFactorX||0)&&v.clientY!==void 0&&Math.abs(v.clientY-I)<=(z.slideFactorY||0))){if(z.ignoreInputTextSelection){var O=H("clientX",v)||0,q=H("clientY",v)||0,U=u.elementFromPoint(O,q);if(y(U))return}var Z=ye;Me(!0),We(),Ae(),Oe(Z),l.add(D||A,"gu-transit"),Et(),Mt(),ce=0,je(v)}}}function Ve(v){if(!(ne.dragging&&N)&&!Le(v)){for(var O=v;w(v)&&Le(w(v))===!1;)if(z.invalid(v,O)||(v=w(v),!v))return;var q=w(v);if(q&&!z.invalid(v,O)){var U=z.moves(v,q,O,T(v));if(U)return{item:v,source:q}}}}function Pe(v){return!!Ve(v)}function Ee(v){var O=Ve(v);O&&Oe(O)}function Oe(v){Vt(v.item,v.source)&&(D=v.item.cloneNode(!0),ne.emit("cloned",D,v.item,"copy")),x=v.source,A=v.item,k=_=T(v.item),ne.dragging=!0,ne.emit("drag",A,x)}function Ke(){return!1}function Ae(){if(ne.dragging){var v=D||A;Xe(v,w(v))}}function ke(){ye=!1,Me(!0),We(!0)}function $e(v){if(ke(),!!ne.dragging){var O=D||A,q=H("clientX",v)||0,U=H("clientY",v)||0,Z=b(N,q,U),K=ue(Z,q,U);K&&(D&&z.copySortSource||!D||K!==x)?Xe(O,K):z.removeOnSpill?Ye():B()}}function Xe(v,O){var q=w(v);D&&z.copySortSource&&O===x&&q.removeChild(A),le(O)?ne.emit("cancel",v,x):ne.emit("drop",v,O,x,_),Y()}function Ye(){if(ne.dragging){var v=D||A,O=w(v);O&&O.removeChild(v),ne.emit(D?"cancel":"remove",v,O,x),Y()}}function B(v){if(ne.dragging){var O=arguments.length>0?v:z.revertOnSpill,q=D||A,U=w(q),Z=le(U);Z===!1&&O&&(D?U&&U.removeChild(D):x.insertBefore(q,k)),Z||O?ne.emit("cancel",q,x,x):ne.emit("drop",q,U,x,_),Y()}}function Y(){var v=D||A;ke(),Ft(),Bt(),v&&l.rm(v,"gu-transit"),ee&&clearTimeout(ee),ne.dragging=!1,ge&&ne.emit("out",v,ge,x),ne.emit("dragend",v,ce),x=A=D=k=_=ee=ge=null}function le(v,O){var q;return O!==void 0?q=O:N?q=_:q=T(D||A),v===x&&q===k}function ue(v,O,q){for(var U=v;U&&!Z();)U=w(U);return U;function Z(){var K=Le(U);if(K===!1)return!1;var Se=mt(U,v),be=ht(U,Se,O,q),Ce=le(U,be);return Ce?!0:z.accepts(A,U,x,be)}}function je(v){if(!N)return;v.preventDefault();var O=H("clientX",v)||0,q=H("clientY",v)||0;N.style.left=O-2+"px",N.style.top=q-2+"px";var U=D||A,Z=b(N,O,q),K=ue(Z,O,q),Se=K!==null&&K!==ge;(Se||K===null)&&(we(),ge=K,Be()),It(Z,q);var be=w(U);if(K===x&&D&&!z.copySortSource){be&&be.removeChild(U);return}var Ce,Fe=mt(K,Z);if(ie=et(Fe,K),Fe!==null)Ce=ht(K,Fe,O,q);else if(z.revertOnSpill===!0&&!D)Ce=k,K=x;else{D&&be&&be.removeChild(U),D&&X&&(X.style.display="none");return}X.style.display="block",xt(Ce,U,Se),Ce?jt(Fe,Ce):Nt(K);function de(me){ne.emit(me,U,ge,x)}function Be(){Se&&de("over")}function we(){ge&&de("out")}}function xt(v,O,q){(v===O||v===T(O))&&(_=T(O)),(v===null&&q||v!==O&&v!==T(O))&&(_=v)}function St(v){l.rm(v,"gu-hide")}function Tt(v){ne.dragging&&l.add(v,"gu-hide")}function Mt(){N||(N=document.createElement("div"),N.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",N.innerHTML=z.getMirrorText&&z.getMirrorText(A)||"控件",l.add(N,"gu-mirror"),z.mirrorContainer.appendChild(N),p(m,"add","mousemove",je),l.add(z.mirrorContainer,"gu-unselectable"),ne.emit("cloned",N,A,"mirror"))}function Et(){if(X=document.createElement("div"),l.add(X,"gu-insertion"),A){var v=A.getBoundingClientRect();X.style.left=v.left+"px",X.style.top=v.top+"px"}ie=!1,z.mirrorContainer.appendChild(X)}function Ft(){N&&(l.rm(z.mirrorContainer,"gu-unselectable"),p(m,"remove","mousemove",je),w(N).removeChild(N),N=null)}function Bt(){X&&(w(X).removeChild(X),X=null)}function mt(v,O){for(var q=O;q!==v&&w(q)!==v;)q=w(q);return q===m?null:q}function et(v,O){if(!O)return ie;var q=v||O&&O.lastElementChild;if(!q)return!0;var U=getComputedStyle(v),Z=/^inline/.test(U.getPropertyValue("display"))||/^(left|right)$/.test(U.getPropertyValue("float"));if(Z)return!0;if(O){var K=getComputedStyle(O),Se=K.getPropertyValue("display");if(/flex$/.test(Se)){var be=K.getPropertyValue("flex-direction")||"row";if(be==="row"||be==="row-reverse")return!kt(O)}return!1}return!0}function kt(v){if(!v.children||!v.children.length)return!1;for(const O of Array.from(v.children)){const U=(O.className&&O.className.split(" ")||[]).filter(Z=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Z));if(!U.length)return!1;for(const Z of U){const K=Z.slice(Z.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function jt(v,O){const q=O.getBoundingClientRect();if(X.style.left=q.left+"px",X.style.top=q.top+"px",ie){if(X.style.height=q.height+"px",X.style.width="4px",v){const U=v.getBoundingClientRect();U.top!==q.top&&(X.style.left=U.right+"px",X.style.top=U.top+"px",X.style.height=U.height+"px")}}else if(X.style.height="4px",X.style.width=q.width+"px",te){const U=te.getBoundingClientRect();q.top<U.top&&(X.style.display="none")}O===A&&A&&(X.style.display="none")}function Nt(v){_=null;var O=v.lastElementChild;if(O){var q=O.getBoundingClientRect();ie?(X.style.left=q.right+"px",X.style.top=q.top+"px",X.style.height=q.height+"px",X.style.width="4px"):(X.style.left=q.left+"px",X.style.top=q.bottom+"px",X.style.height="4px",X.style.width=q.width+"px"),O===A&&A&&(X.style.display="none")}else X.style.display="none"}function It(v,O){if(!z.mirrorContainer.contains(v)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(te=h(v),!te||!te.contains(v)))return;const q=document.querySelector(".dgComponentSelected"),U=te.getBoundingClientRect();if(O-30<U.top&&te.scrollTop>0){let Z=te.scrollTop<10?te.scrollTop:10;te.scrollBy(0,-1*Z),q&&te.contains(q)&&(ce=ce+-1*Z)}if(O+30>U.bottom&&te.scrollTop<te.scrollHeight-te.clientHeight){const Z=te.scrollHeight-te.clientHeight-te.scrollTop;let K=Z<10?Z:10;te.scrollBy(0,K),q&&te.contains(q)&&(ce=ce+K)}}function ht(v,O,q,U){var Z=z.direction==="horizontal",K=z.direction==="mixed",Se=O!==v?Ce():be();return Se;function be(){var de=v.children.length,Be,we,me;for(Be=0;Be<de;Be++)if(we=v.children[Be],me=we.getBoundingClientRect(),Z&&me.left+me.width/2>q||!K&&!Z&&me.top+me.height/2>U||K&&me.left+me.width>q&&me.top+me.height>U)return we;return null}function Ce(){var de=O.getBoundingClientRect();if(K){var Be=U-de.top,we=q-de.left,me=de.bottom-U,tt=de.right-q,nt=Math.min(we,tt,Be,me),ot;return ie?ot=tt<we:ot=me===nt||tt===nt||we===nt,Fe(ot)}return Fe(Z?q>de.left+R(de)/2:U>de.top+$(de)/2)}function Fe(de){return de?T(O):O}}function Vt(v,O){return typeof z.copy=="boolean"?z.copy:z.copy(v,O)}}function h(C){const M=Array.from(window.scrollContainerList);if(M.length===1){const N=Array.from(window.scrollContainerList)[0];return document.getElementById(N)}const V=f(M);for(const N of V)if(N.contains(C))return N;return null}function f(C){const M=[];return C.forEach(V=>{const N=document.getElementById(V);N&&M.push(N)}),M.sort((V,N)=>V.contains(N)?1:N.contains(V)?-1:0),M}function p(C,M,V,N){var x={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},A={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},Q={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?d[M](C,A[V],N):a.navigator.msPointerEnabled?d[M](C,Q[V],N):(d[M](C,x[V],N),d[M](C,V,N))}function g(C){if(C.touches!==void 0)return C.touches.length;if(C.which!==void 0&&C.which!==0)return C.which;if(C.buttons!==void 0)return C.buttons;var M=C.button;if(M!==void 0)return M&1?1:M&2?3:M&4?2:0}function b(C,M,V){C=C||{};var N=C.className||"",x;return C.className+=" gu-hide",x=u.elementFromPoint(M,V),C.className=N,x}function S(){return!1}function F(){return!0}function R(C){return C.width||C.right-C.left}function $(C){return C.height||C.bottom-C.top}function w(C){return C.parentNode===u?null:C.parentNode}function y(C){return C.tagName==="INPUT"||C.tagName==="TEXTAREA"||C.tagName==="SELECT"||E(C)}function E(C){return!C||C.contentEditable==="false"?!1:C.contentEditable==="true"?!0:E(w(C))}function T(C){return C.nextElementSibling||M();function M(){var V=C;do V=V.nextSibling;while(V&&V.nodeType!==1);return V}}function j(C){return C.targetTouches&&C.targetTouches.length?C.targetTouches[0]:C.changedTouches&&C.changedTouches.length?C.changedTouches[0]:C}function H(C,M){var V=j(M),N={pageX:"clientX",pageY:"clientY"};return C in N&&!(C in V)&&N[C]in V&&(C=N[C]),V[C]}o.exports=c}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(s,d){return Array.prototype.slice.call(s,d)}},{}],4:[function(t,o,r){var a=t("ticky");o.exports=function(d,l,u){d&&a(function(){d.apply(u||null,l||[])})}},{ticky:10}],5:[function(t,o,r){var a=t("atoa"),s=t("./debounce");o.exports=function(l,u){var m=u||{},c={};return l===void 0&&(l={}),l.on=function(h,f){return c[h]?c[h].push(f):c[h]=[f],l},l.once=function(h,f){return f._once=!0,l.on(h,f),l},l.off=function(h,f){var p=arguments.length;if(p===1)delete c[h];else if(p===0)c={};else{var g=c[h];if(!g)return l;g.splice(g.indexOf(f),1)}return l},l.emit=function(){var h=a(arguments);return l.emitterSnapshot(h.shift()).apply(this,h)},l.emitterSnapshot=function(h){var f=(c[h]||[]).slice(0);return function(){var p=a(arguments),g=this||l;if(h==="error"&&m.throws!==!1&&!f.length)throw p.length===1?p[0]:p;return f.forEach(function(S){m.async?s(S,p,g):S.apply(g,p),S._once&&l.off(h,S)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(a){var s=t("custom-event"),d=t("./eventmap"),l=a.document,u=h,m=p,c=[];a.addEventListener||(u=f,m=g),o.exports={add:u,remove:m,fabricate:b};function h(w,y,E,T){return w.addEventListener(y,E,T)}function f(w,y,E){return w.attachEvent("on"+y,F(w,y,E))}function p(w,y,E,T){return w.removeEventListener(y,E,T)}function g(w,y,E){var T=R(w,y,E);if(T)return w.detachEvent("on"+y,T)}function b(w,y,E){var T=d.indexOf(y)===-1?H():j();w.dispatchEvent?w.dispatchEvent(T):w.fireEvent("on"+y,T);function j(){var C;return l.createEvent?(C=l.createEvent("Event"),C.initEvent(y,!0,!0)):l.createEventObject&&(C=l.createEventObject()),C}function H(){return new s(y,{detail:E})}}function S(w,y,E){return function(j){var H=j||a.event;H.target=H.target||H.srcElement,H.preventDefault=H.preventDefault||function(){H.returnValue=!1},H.stopPropagation=H.stopPropagation||function(){H.cancelBubble=!0},H.which=H.which||H.keyCode,E.call(w,H)}}function F(w,y,E){var T=R(w,y,E)||S(w,y,E);return c.push({wrapper:T,element:w,type:y,fn:E}),T}function R(w,y,E){var T=$(w,y,E);if(T){var j=c[T].wrapper;return c.splice(T,1),j}}function $(w,y,E){var T,j;for(T=0;T<c.length;T++)if(j=c[T],j.element===w&&j.type===y&&j.fn===E)return T}}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(a){var s=[],d="",l=/^on/;for(d in a)l.test(d)&&s.push(d.slice(2));o.exports=s}).call(this,typeof Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(a){var s=a.CustomEvent;function d(){try{var l=new s("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=d()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(u,m){var c=document.createEvent("CustomEvent");return m?c.initCustomEvent(u,m.bubbles,m.cancelable,m.detail):c.initCustomEvent(u,!1,!1,void 0),c}:function(u,m){var c=document.createEventObject();return c.type=u,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 Ne<"u"?Ne:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var a=o.exports={},s,d;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?d=clearTimeout:d=u}catch{d=u}})();function m($){if(s===setTimeout)return setTimeout($,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout($,0);try{return s($,0)}catch{try{return s.call(null,$,0)}catch{return s.call(this,$,0)}}}function c($){if(d===clearTimeout)return clearTimeout($);if((d===u||!d)&&clearTimeout)return d=clearTimeout,clearTimeout($);try{return d($)}catch{try{return d.call(null,$)}catch{return d.call(this,$)}}}var h=[],f=!1,p,g=-1;function b(){!f||!p||(f=!1,p.length?h=p.concat(h):g=-1,h.length&&S())}function S(){if(!f){var $=m(b);f=!0;for(var w=h.length;w;){for(p=h,h=[];++g<w;)p&&p[g].run();g=-1,w=h.length}p=null,f=!1,c($)}}a.nextTick=function($){var w=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)w[y-1]=arguments[y];h.push(new F($,w)),h.length===1&&!f&&m(S)};function F($,w){this.fun=$,this.array=w}F.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function R(){}a.on=R,a.addListener=R,a.once=R,a.off=R,a.removeListener=R,a.removeAllListeners=R,a.emit=R,a.prependListener=R,a.prependOnceListener=R,a.listeners=function($){return[]},a.binding=function($){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function($){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],10:[function(t,o,r){(function(a){var s=typeof a=="function",d;s?d=function(l){a(l)}:d=function(l){setTimeout(l,0)},o.exports=d}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(a,s){var d=t("process/browser.js").nextTick,l=Function.prototype.apply,u=Array.prototype.slice,m={},c=0;r.setTimeout=function(){return new h(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new h(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(f){f.close()};function h(f,p){this._id=f,this._clearFn=p}h.prototype.unref=h.prototype.ref=function(){},h.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 a=="function"?a:function(f){var p=c++,g=arguments.length<2?!1:u.call(arguments,1);return m[p]=!0,d(function(){m[p]&&(g?f.apply(null,g):f.call(null),r.clearImmediate(p))}),p},r.clearImmediate=typeof s=="function"?s:function(f){delete m[f]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ln);const Rn={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}},An={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},bt=i.defineComponent({name:"Toast",props:An,emits:["close","click"],setup:(n,e)=>{const{locale:t,t:o}=gt.useI18n(),r=i.ref(n.animate),a="fadeOut",s=i.computed(()=>n.options),d=i.ref(!1),l=i.computed(()=>s.value.title&&s.value.message),u=i.computed(()=>!s.value.title&&s.value.message),m=i.computed(()=>{const $={animated:d.value,toast:!0,"toast--only-content":!l.value};return $[n.animate]=!1,$[a]=d.value,$["toasty-type-"+s.value.type]=!0,s.value.theme&&($[s.value.theme]=!0),$}),c=i.computed(()=>{const y=`f-icon-${s.value&&s.value.type?s.value.type.replace("toasty-type-",""):"default"}`,E={"f-icon":!0};return E[y]=!0,E}),h=i.computed(()=>s.value.title||s.value.message),f=i.computed(()=>n.showCloseButton),p=i.computed(()=>!!s.value.buttons||!!e.slots.default),g=i.computed(()=>t.value==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function b($){$.stopPropagation(),$.preventDefault(),d.value=!1,setTimeout(()=>{e.emit("close",s.value)},200)}function S($,w){}function F($){return`f-preten-link ${$.customClass?$.customClass:""}`}i.watch(r,()=>{r.value});const R=()=>{var $;return i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&(($=s.value.buttons)==null?void 0:$.map(w=>i.createVNode("span",{class:F(w),onClick:y=>void 0},[w.text]))),e.slots.default&&e.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)]),h.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:s.value.title},null),i.createVNode("p",{class:"toast-msg",innerHTML:s.value.message,style:g.value},null),p.value&&R()]),u.value&&(s.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:g.value,innerHTML:s.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:g.value,innerHTML:s.value.message},null))])])])}}),dt=i.defineComponent({name:"Notify",props:Rn,emits:["close","empty"],setup(n,e){const t=i.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=i.ref(),a=i.ref(n.options),s=i.ref(n.showCloseButton),d=i.computed(()=>n.position||"bottom-right"),l=i.computed(()=>n.timeout!=null?n.timeout:3e3),u=i.computed(()=>{const h=n.bottom?n.bottom:o.bottom,f=n.top?n.top:o.top,p={transition:"all 0.2s ease",left:d.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:d.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:d.value.indexOf("top")>-1?`${f}px`:"",bottom:d.value.indexOf("bottom")>-1?`${h}px`:""};return d.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",d.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function m(h){e.emit("close")}l.value&&setTimeout(()=>{m()},l.value),e.expose({closeToast:m,container:r,notifyPosition:d});function c(h,f){m()}return()=>i.createVNode("div",{class:t.value,style:u.value,ref:r},[i.createVNode(bt,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>c(h,a.value)},null)])}});class Hn{constructor(){W(this,"notifyRefs",[]);W(this,"globalConfig",i.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),a=document.createElement("div");a.style.display="contents";const s=i.createApp({setup(){var u;const d=i.ref();function l(){d.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,d),s.unmount()},220)}if(r.position.indexOf("top")>-1){const m=t.getNotifyInstances(r.position),c=m[m.length-1];if(c){const h=c.value.container.getBoundingClientRect();r.top=h.bottom}}return r.safeHtml&&((u=r.options)!=null&&u.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),i.onUnmounted(()=>{document.body.removeChild(a)}),i.onMounted(()=>{t.updateNotifyPositionForCreate(r,d)}),()=>i.createVNode(i.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[i.createVNode(dt,i.mergeProps({ref:d},r,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(rt.LocaleService.i18n),s.mount(a),s}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const a=r.value.container.getBoundingClientRect();r.value.container.style.bottom=a.height+o-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),a=r.indexOf(t);r.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",a,s,d;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",s=t.position||null,d=t.showCloseButton!=null?t.showCloseButton:null,a=t.timeout!=null?t.timeout:null);const u={options:{type:e,message:o,title:r}};return s!=null&&(u.position=s),d!=null&&(u.showCloseButton=d),a!=null&&(u.timeout=a),u}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const zn=Symbol("NOTIFY_SERVICE_TOKEN");dt.install=n=>{n.component(dt.name,dt),n.component(bt.name,bt);const e=new Hn;n.provide(zn,e),n.provide("FNotifyService",e)},`${rt.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const Un={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:rt.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 _n(n,e,t,o,r,a,s,d,l,u,m,c,h,f,p,g,b){const{calculateCellPositionInRow:S}=a,{columnContext:F,hasLeftFixedColumn:R,hasRightFixedColumn:$}=s,{gridDataStyle:w,leftFixedGridDataStyle:y,rightFixedGridDataStyle:E}=f,{renderDataRow:T}=J.getHierarchyRow(n,e,F,b,d,l,u,m,c,h,f,p,g),j=[T];function H(x,A){const Q=S(x);return b.value.filter(I=>I.visible!==!1).map((I,k)=>j[I.type](I,Q,A,k))}function C(){return i.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:y.value},[H(F.value.leftColumns.filter(x=>x.visible),"left")])])}function M(){return i.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[i.createVNode("div",{class:"fv-grid-data",style:w.value},[H(F.value.primaryColumns.filter(x=>x.visible),"primary")])])}function V(){return i.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[i.createVNode("div",{class:"fv-grid-data",style:E.value},[H(F.value.rightColumns.filter(x=>x.visible),"right")])])}function N(){const x=[];return R.value&&x.push(C()),x.push(M()),$.value&&x.push(V()),x}return{renderDataArea:N}}const Wn=i.defineComponent({name:"FTreeGrid",props:Un,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode","doubleClickRow","unSelectItem","selectItem","filterChanged","sortChanged","selectionUpdate"],setup(n,e){var Zt,Kt;const o=((Zt=n.rowOption)==null?void 0:Zt.height)||28,r=i.ref(20),a=i.ref(n.columns),s=J.useIdentify(n),{idField:d}=s,l=i.ref(),u=i.ref(),m=i.ref(),c=i.ref(),h=i.ref(),f=i.ref([]),p=i.ref(!1),g=i.ref(((Kt=n.rowOption)==null?void 0:Kt.wrapContent)||!1),b=J.useGroupData(n,s),S=J.useFilter(n,e),F=J.useHierarchy(n),{collapseField:R}=F,{showLoading:$,renderLoading:w}=J.useLoading(n,l),y=J.useDataView(n,new Map,S,F,s),{dataView:E}=y,T=J.useSelection(n,y,s,f,e),{showSelection:j,selectedValues:H}=T,C=J.useSelectHierarchyItem(n,f,y,s,T,e),M=i.computed(()=>n.disabled),V=i.computed(()=>n.virtualized?Math.min(y.dataView.value.length,r.value):y.dataView.value.length),N=J.usePagination(n,y),{shouldRenderPagination:x}=N,{containerStyleObject:A}=J.useDataViewContainerStyle(n),Q=J.useCommandColumn(n),{applyCommands:I}=Q;I(a);const{applyColumnSetting:k,removeColumnSetting:_}=J.useSettingColumn(n);n.showSetting&&k(a);const D=J.useColumn(n,e),ee=J.useSort(n),{applyColumnSorter:ge,columnContext:ye,updateColumnRenderContext:X}=D;ge(y,ee);const ie=J.useGroupColumn(n,ye),ce=J.useRow(n,e,T,s),te=J.useEdit(n,e,s,ce,f),z=J.useVisualDataBound(n),ne=J.useVisualDataCell(n,te,z),Le=J.useVisualDataRow(n,y,te,F,s,z,ne),Ie=J.useVisualData(n,a,y,V,0,Le),{getVisualData:Me}=Ie,We=J.useCellPosition(n,ye),Re=J.useSidebar(n,T),{sidebarWidth:Ge}=Re,se=J.useVirtualScroll(n,y,f,ye,Ie,V,0,Ge),{onWheel:Ze,dataGridWidth:Ve,viewPortHeight:Pe,viewPortWidth:Ee,resetScroll:Oe,updateVisibleRowsOnLatestVisibleScope:Ke}=se,Ae=J.useFitColumn(n,ye,u,Ee,ie),{calculateColumnsSize:ke}=Ae,$e=J.useFilterHistory(),Xe=J.useColumnFilter(u,h,y,$e,se),Ye=J.useDragColumn(n,e,D,y,ie,b,se),B=i.computed(()=>{const L={"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe};return ve.getCustomClass(L,n.customClass)}),Y=i.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":p.value,"fv-grid-wrap-content":g.value})),{renderDataArea:le}=_n(n,e,m,c,h,We,D,y,te,F,ce,T,C,se,Ie,z,f),{renderGridHeader:ue,renderGridColumnResizeOverlay:je,shouldShowHeader:xt}=J.getColumnHeader(n,e,u,c,h,D,y,Ye,Xe,S,$e,Ae,ie,T,Re,ee,se,Ee,f),{renderDataGridSidebar:St}=J.getSidebar(n,ce,T,Re,se),{renderDisableMask:Tt}=J.getDisableMask(),{renderHorizontalScrollbar:Mt}=J.getHorizontalScrollbar(n,u,se),{renderVerticalScrollbar:Et}=J.getVerticalScrollbar(n,u,se);function Ft(){var L,G,fe;if(u.value&&u.value.clientHeight>0&&((L=u.value)==null?void 0:L.clientWidth)>0){const he=Math.ceil(u.value.clientHeight/o);he>r.value&&(r.value=he,Ke()),Pe.value=((G=m.value)==null?void 0:G.clientHeight)||0,Ve.value=((fe=u.value)==null?void 0:fe.clientWidth)||0,ke()}}i.onMounted(()=>{u.value&&(r.value=Math.max(Math.ceil(u.value.clientHeight/o),r.value),f.value=Me(0,V.value+0-1),tn.useResizeObserver(u.value,Ft),ke(),i.nextTick(()=>{u.value&&(Ve.value=u.value.clientWidth),m.value&&(Ee.value=m.value.clientWidth,Pe.value=m.value.clientHeight)})),$.value&&w()}),i.onUnmounted(()=>{}),i.watch(Ee,()=>{u.value&&ke()});function Bt(L){y.collapseTo(L),y.reOrderVisibleIndex(),Oe()}function mt(L){y.expandTo(L),y.reOrderVisibleIndex(),Oe()}function et(){const L=T.getSelectionRow();return L?L.dataIndex-1:-1}function kt(){const L=et();y.insertNewDataItem(L),f.value=Me(0,V.value+0-1)}function jt(){const L=et();y.insertNewChildDataItem(L),f.value=Me(0,V.value+0-1)}function Nt(L,G){const fe=f.value.find(xe=>xe.raw[d.value]===G),he=fe?fe.dataIndex-1:-1;y.insertNewChildDataItems(L,he)}function It(){const L=et(),G=C.getNextSelectableHierarchyItemId(L);y.removeHierarchyDataItem(L),f.value=Me(0,V.value+0-1),G&&C.selectItemById(G)}function ht(L){te.onEditingRow(L)}function Vt(L){te.acceptEditingRow(L)}function v(L){te.cancelEditingRow(L)}function O(L){L&&(a.value=L,I(a),X(a.value),ge(y,ee),ke())}i.watch(()=>n.columns,L=>{O(L)});function q(L,G){L&&(y.load(L),y.reOrderVisibleIndex(),G!=null&&G.keepScrollPosition?se.scrollTo(se.offsetY.value):Oe())}function U(L){C.selectItemById(L)}function Z(L){const G=f.value.find(fe=>fe.raw[s.idField.value]===L);G&&ce.clickRowItem(G)}function K(L){ce.activeRowById(L)}function Se(L){C.selectItemByIds(L)}function be(){return T.getSelectedItems()}function Ce(){T.clearSelection()}const Fe=i.computed(()=>!f.value||!f.value.length),{renderEmpty:de}=J.getEmpty(n,e);function Be(){return T.getSelectionRow()}function we(L){C.unSelectItemByIds(L)}function me(){return T.currentSelectedDataId.value}function tt(L,G,fe){const he=E.value.find(xe=>xe[d.value]===L);if(he){if(Object.keys(he).forEach(pe=>{Object.prototype.hasOwnProperty.call(G,pe)&&(he[pe]=G[pe])}),fe){const{collapseField:pe,disabledField:He,checkedField:ze,visibleField:Ue}=fe;pe&&!re.isUndefined(G[pe])&&(he.__fv_collapse__=G[pe]),ze&&!re.isUndefined(G[ze])&&(he.__fv_checked__=G[ze]),He&&!re.isUndefined(G[He])&&(he.__fv_disabled__=G[He]),Ue&&!re.isUndefined(G[Ue])&&(he.__fv_visible__=G[Ue])}const xe=f.value.find(pe=>pe.raw[d.value]===L),en=f.value.findIndex(pe=>pe.raw[d.value]===L);if(xe){if(xe.raw=he,Object.keys(xe.data).forEach(pe=>{xe.data[pe].updateData(he)}),fe){const{collapseField:pe,disabledField:He,checkedField:ze,visibleField:Ue}=fe;pe&&!re.isUndefined(G[pe])&&(xe.collapse=G[pe]),ze&&!re.isUndefined(G[ze])&&(xe.checked=G[ze]),He&&!re.isUndefined(G[He])&&(xe.disabled=G[He]),Ue&&!re.isUndefined(G[Ue])&&(xe.visible=G[Ue])}f.value=[...f.value.slice(0,en),xe,...f.value.slice(en+1)],y.updateSummary()}}}function nt(L){return Object.prototype.hasOwnProperty.call(L,"raw")?y.hasRealChildren(L.raw):y.hasRealChildren(L)}function ot(L){const G=y.dataView.value.find(fe=>fe[d.value]===L);return G?G[R.value]:""}function Oo(){return R.value}i.watch(()=>n.showSetting,(L,G)=>{L!==G&&(L?k(a):_(a),O(a.value))});function $o(L){return f.value.filter(G=>L.includes(G.raw[n.idField]))}function qo(L){const G=s.idField.value,fe=f.value.find(he=>he.raw[G]===L);fe&&ce.changeRow(fe)}function Do(){T.keepSelectingOnPaging.value||Ce(),y.updateVisibleDataSummary(f.value)}e.expose({activeRowById:K,addNewDataItem:kt,addNewChildDataItem:jt,addChildrenToNode:Nt,collapseTo:Bt,expandTo:mt,removeDataItem:It,editDataItem:ht,acceptDataItem:Vt,cancelDataItem:v,updateColumns:O,updateDataSource:q,selectItemById:U,selectItemByIds:Se,getSelectedItems:be,clearSelection:Ce,getSelectionRow:Be,clickRowItemById:Z,unSelectItemByIds:we,getCurrentRowId:me,reassignRowData:tt,hasChildren:nt,getCollapseField:Oo,getCollapseStatusById:ot,getVisibleDataByIds:$o,selectRowById:qo,updateDerivedData:Do});const Lo=i.computed(()=>{const L={};return se.shouldShowHorizontalScrollbar.value&&(L.paddingBottom="10px"),se.shouldShowVirticalScrollbar.value&&(L.paddingRight="10px"),L}),Ro=i.computed(()=>({...A.value,borderRadius:"5px"}));J.getPagination(n,e,y,se,N,T);const Ao=i.computed(()=>({"d-flex":!0,"justify-content-between":x.value&&j.value,"justify-content-end":x.value&&!j.value,"position-relative":!0})),Ho=i.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:zo}=J.getSummary(n,y,D);return()=>i.createVNode("div",{ref:l,class:B.value,style:Ro.value,onWheel:Ze},[u.value&&xt.value&&ue(),i.createVNode("div",{ref:u,class:Y.value,onMouseover:()=>p.value=!0,onMouseleave:()=>p.value=!1,style:Lo.value},[u.value&&St(f),u.value&&le(),u.value&&Fe.value&&de(),u.value&&Mt(),u.value&&Et()]),u.value&&zo(),j.value&&i.createVNode("div",{class:Ao.value},[j.value&&i.createVNode("div",{class:Ho.value},[i.createVNode("div",null,["已选:"+H.value.length,i.createTextVNode(" 条")])])]),je(),M.value&&Tt()])}});ve.withInstall(Wn);const Gn=new Map([["appearance",vt]]);function Xn(n,e,t){return e}Je({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,Xn,{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",vt]]),Yn=new Map([]),Jn="root-viewmodel";class Qn{constructor(e,t){W(this,"formSchemaUtils");W(this,"controlCreatorUtils");W(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),a=this.formSchemaUtils.getFormSchema();return a.module.viewmodels.push(r),a.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:a}=e;a==null||a.forEach(d=>{if(d.$type===ve.FormSchemaEntityField$Type.SimpleField){const l=re.cloneDeep(d),u=this.resolveControlClassByFormColumns(e),m=this.controlCreatorUtils.setFormFieldProperty(l,"",u);m&&r.push(m)}});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:Jn,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{if(r.$type===ve.FormSchemaEntityField$Type.SimpleField){let a="blur";const s=r.type.name;(s===ve.FormSchemaEntityFieldTypeName.Enum||s===ve.FormSchemaEntityFieldTypeName.Boolean)&&(a="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:a,fieldSchema:{}})}}),t}}function Zn(n,e,t,o){var a,s,d,l,u,m;const r=t.parentComponentInstance;if(r&&o){const c=(a=r.schema)==null?void 0:a.type,f={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=t.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(d=t.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:c==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((u=t.bindingSourceContext)==null?void 0:u.bindTo)||"/",selectedFields:(m=t.bindingSourceContext)==null?void 0:m.bindingEntityFields};return new Qn(n,o).createComponent(f)}else return e}function Kn(n,e,t){return e}Je({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 Gt={$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"]};Je({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}},Gt,Ct,void 0),Je({id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Gt,Ct,void 0);const eo={$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"]},to={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};it.createPropsResolver(to,eo,Yn,Kn);const no={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 wt(){return new DOMException("The request is not allowed","NotAllowedError")}async function oo(n){if(!navigator.clipboard)throw wt();return navigator.clipboard.writeText(n)}async function io(n){const e=document.createElement("span");e.textContent=n,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw wt()}async function ro(n){try{await oo(n)}catch(e){try{await io(n)}catch(t){throw t||e||wt()}}}function ao(){async function n(e){await ro(e)}return{onCopy:n}}function so(n,e,t,o){const r=i.ref(14),a=i.ref(140),s=i.ref(""),d=i.ref(o.value.length),l=i.computed(()=>o.value),u=i.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function m(c){if(c.currentTarget){const h=c.currentTarget.value||"";d.value=h.length}}return()=>i.createVNode(i.Fragment,null,[i.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:u.value,rows:"4",maxlength:a.value,onInput:c=>m(c)},[l.value]),i.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[d.value+" / "+a.value])])}function lo(n,e,t,o){const r=so(n,e,t,o),a=new Map([["text-area",r]]);function s(d){return a.get(d)||null}return{getEditorRender:s}}function co(){const n=i.ref(!1),e=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:e,toShowFeedback:n}}function uo(n,e){const t=e.getEditorRender(n.promptEditorType);return()=>t&&t()}function fo(n,e){function t(f){if(f==null)return 0;let p=0;for(let g=0;g<f.length;g++){const b=f.charCodeAt(g);b>=0&&b<=128?p++:p=p+2}return p}function o(f,p){if(f!==""&&f!==void 0&&f!==null){f=""+f;const g=f.length;let b="",S=0;for(let F=0;F<g;F++){const R=f.charAt(F);if(S++,encodeURI(R).length>4&&S++,b=b.concat(R),S>=p)return b=b.concat("..."),b}if(S<p)return f}return""}const r=i.computed(()=>!!n.value&&!!n.value.date),a=i.computed(()=>{const f=n.value&&n.value.date||"";return`${e.exception.happend} : ${f}`}),s=i.computed(()=>!!n.value&&!!n.value.detail),d=i.computed(()=>n.value?t(n.value.detail)>160:!1),l=i.ref(!1),u=i.computed(()=>l.value?e.exception.collapse:e.exception.expand),m=i.computed(()=>{const f=e.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 h(){l.value=!l.value}return()=>i.createVNode("div",{class:"toast-msg-detail"},[r.value&&i.createVNode("div",null,[a.value]),s.value&&i.createVNode("div",{class:"exception_wrap"},[i.createVNode("div",{class:"exception_error_msg"},[i.createVNode("div",{innerHTML:m.value},null),d.value&&i.createVNode("span",{style:c.value,onClick:h},[u.value])])])])}function po(n){return()=>i.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function mo(n,e,t,o,r){const a=i.ref(n.exceptionInfo),s=i.computed(()=>{const p=e.value==="question"?"warning":e.value,g={"f-icon":!0},b=`f-icon-${p}`;return g[b]=!0,g}),d=i.computed(()=>t.value||a.value&&a.value.message),l=i.computed(()=>o.value),u=i.computed(()=>!!o.value),m=i.computed(()=>!!a.value);function c(){return m.value?fo(a,r):u.value?po(l):()=>null}const h=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:s.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[i.createVNode("p",{class:"toast-msg-title",innerHTML:d.value,style:f.value},null),h()])])}function ho(n,e,t,o){const{onCopy:r}=e,{toShowFeedback:a}=t,s=i.ref(o.exception.copySuccess||"复制成功"),d=i.ref(o.exception.copy||"复制详细信息"),l=i.ref(n.exceptionInfo||{date:"",message:"",detail:""}),u=i.computed(()=>l.value&&l.value.detail||"");function m(c){r(u.value).catch(h=>{s.value=o.exception.copyFailed||"复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>i.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[i.createVNode("span",{onClick:m,style:"cursor: pointer;"},[d.value])])}function go(n,e,t,o,r){const a=i.ref(n.type),s=i.ref(n.buttons),d=i.ref(n.exceptionInfo),l=i.ref(r.ok||n.okButtonText),u=i.ref(r.cancel||n.cancelButtonText),m=i.ref(n.showCancelButton),c=i.ref(n.showOkButton),h=i.computed(()=>!!(s.value&&s.value.length)),f=i.computed(()=>!!(d.value&&d.value.detail)),p=i.computed(()=>!(s.value&&s.value.length)&&(c.value||m.value)),g=ho(n,t,o,r);l.value==="关闭"?l.value=r.close:l.value==="知道了"&&(l.value=r.exception.roger);function b(F){a.value==="question"&&e.emit("reject"),e.emit("close")}function S(F){a.value==="question"&&e.emit("accept"),e.emit("close")}return()=>i.createVNode("div",{class:"modal-footer"},[f.value&&g(),p.value&&m.value&&i.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[u.value]),p.value&&c.value&&i.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:S},[l.value]),h.value&&s.value.length&&s.value.map(F=>i.createVNode("button",{type:"button",onClick:F.handle,class:F.class},[F.iconClass&&i.createVNode("span",{class:F.iconClass},null),F.text]))])}function vo(n){const{t:e,locale:t}=gt.useI18n();function o(r,a,s){return a===s?e(r):a}return{yes:o("messageBox.yes")||"是",no:o("messageBox.no")||"否",close:o("messageBox.close")||"关闭",ok:o("messageBox.ok",n.okButtonText,"确定")||"确定",cancel:o("messageBox.cancel",n.cancelButtonText,"取消")||"取消",title:o("messageBox.title")||"系统提示",errorTitle:o("messageBox.errorTitle")||"错误提示",exception:{expand:o("messageBox.exception.expand")||"展开",collapse:o("messageBox.exception.collapse")||"收起",happend:o("messageBox.exception.happend")||"发生时间",detail:o("messageBox.exception.detail")||"详细信息",copy:o("messageBox.exception.copy")||"复制详细信息",copySuccess:o("messageBox.exception.copySuccess")||"复制成功",copyFailed:o("messageBox.exception.copyFailed")||"复制失败",roger:o("messageBox.exception.roger")||"知道了"},locale:t.value}}const ft=i.defineComponent({name:"FMessageBox",props:no,emits:["accept","reject","close"],setup(n,e){const t=vo(n),o=i.ref(n.type),r=i.ref(n.title),a=i.ref(n.detail),s=i.computed(()=>{const S={"modal-tips":!0,"d-flex":!0,"flex-row":!0},F=`messager-type-${o.value}`;return S[F]=!0,S}),d=i.computed(()=>{const S={cursor:"default"};return o.value==="prompt"?S.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(S.padding="0.5rem 1.5rem 1rem 1.5rem"),S}),l=ao(),u=lo(n,o,r,a),m=co(),{feedbackStyle:c,feedbackMessage:h}=m;h.value=t.exception.copySuccess;function f(){return i.createVNode("div",{style:c.value},[h.value])}function p(){switch(o.value){case"prompt":return uo(n,u);default:return mo(n,o,r,a,t)}}const g=p(),b=go(n,e,l,m,t);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:s.value,style:d.value},[g()]),b(),f()])}}),yo={$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:"关闭前回调"}},bo=new Map([["appearance",it.resolveAppearance]]);function Co(n,e,t){return e}function wo(){function n(e,t){const o={};return o.beforeClose=r=>t.call("beforeClose",[r,e]),o}return{resolve:n}}const Xt={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(Xt,yo,bo,Co),So=wo();class ae{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),a=parseInt(o[5],10);return{x:r,y:a}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ae(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ae(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ae(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ae(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),a=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(a)?0:a}return t}return null}static copy(e){return new ae(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class qe{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new qe(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new qe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function To(n,e){const t=i.ref(),o=i.ref(),r=i.ref(),a=i.ref(),s=i.ref(),d=i.ref(),l=i.ref(),u=i.ref(),m=i.ref(),c=i.ref(),h=i.ref(),f=i.ref(n.resizeable),p=i.ref(),g=i.ref(n.draggable),b=i.ref(!1);function S(){const I=o.value||document.body,k=window.getComputedStyle(I);if(!k||!t.value)return;const _=ae.getTransformInfo(t.value),D={};l.value&&(D.deltaL=t.value.offsetLeft-l.value.x,D.deltaT=t.value.offsetTop-l.value.y);const ee=k.getPropertyValue("position");D.width=I.clientWidth,D.height=I.clientHeight,D.pr=parseInt(k.getPropertyValue("padding-right"),10),D.pb=parseInt(k.getPropertyValue("padding-bottom"),10),D.position=k.getPropertyValue("position"),ee==="static"&&(I.style.position="relative"),D.translateX=_.x,D.translateY=_.y,c.value=D}function F(I){if(t.value){a.value=qe.getCurrent(t.value),s.value=ae.getCurrent(t.value),d.value=a.value?qe.copy(a.value):null,l.value=s.value?ae.copy(s.value):null,S();const k=I.target.getAttribute("type")||"";u.value={n:!!k.match(/n/),s:!!k.match(/s/),w:!!k.match(/w/),e:!!k.match(/e/)}}}function R(){var I,k,_,D;if(t.value){const ee=t.value;u.value&&((u.value.n||u.value.s)&&((I=d.value)!=null&&I.height)&&(ee.style.height=d.value.height+"px"),(u.value.w||u.value.e)&&((k=d.value)!=null&&k.width)&&(ee.style.width=d.value.width+"px"),l.value&&((_=l.value)!=null&&_.x&&(ee.style.left=l.value.x+"px"),(D=l.value)!=null&&D.y&&(ee.style.top=l.value.y+"px")))}}function $(){const I=n.minHeight?n.minHeight:1,k=n.minWidth?n.minWidth:1;d.value&&l.value&&u.value&&a.value&&(d.value.height<I&&(d.value.height=I,u.value.n&&s.value&&(l.value.y=s.value.y+(a.value.height-I))),d.value.width<k&&(d.value.width=k,u.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-k))),n.maxHeight&&d.value.height>n.maxHeight&&(d.value.height=n.maxHeight,s.value&&u.value.n&&(l.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&d.value.width>n.maxWidth&&(d.value.width=n.maxWidth,u.value.w&&s.value&&(l.value.x=s.value.x+(a.value.width-n.maxWidth))))}function w(){if(o.value){const I=c.value;if(l.value&&d.value&&u.value&&a.value){const k=I.width-I.pr-I.deltaL-I.translateX-l.value.x,_=I.height-I.pb-I.deltaT-I.translateY-l.value.y;u.value.n&&l.value.y+I.translateY<0&&s.value&&(l.value.y=-I.translateY,d.value.height=a.value.height+s.value.y+I.translateY),u.value.w&&l.value.x+I.translateX<0&&s.value&&(l.value.x=-I.translateX,d.value.width=a.value.width+s.value.x+I.translateX),d.value.width>k&&(d.value.width=k),d.value.height>_&&(d.value.height=_)}}}function y(I){if(!r.value||!a.value||!s.value||!u.value)return;I.subtract(r.value);const k=I.x,_=I.y;u.value.n?(l.value.y=s.value.y+_,d.value.height=a.value.height-_):u.value.s&&(d.value.height=a.value.height+_),u.value.e?d.value.width=a.value.width+k:u.value.w&&(d.value.width=a.value.width-k,l.value.x=s.value.x+k),w(),$(),R()}function E(I){if(!m.value)return;const k=ae.fromEvent(I);k&&y(k)}function T(){if(t.value){const{width:I,height:k,x:_,y:D}=t.value.getBoundingClientRect(),ee=ae.getTransformInfo(t.value);return{size:{width:I,height:k},position:{x:_-ee.x,y:D-ee.y}}}return null}function j(I){if(t.value){const k=T();h.value=k}r.value=void 0,a.value=null,s.value=null,d.value=null,l.value=null,u.value=null,m.value=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",j)}function H(){document.addEventListener("mousemove",E),document.addEventListener("mouseup",j)}function C(I){I instanceof MouseEvent&&I.button===2||g.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),r.value=ae.fromEvent(I),m.value=I.target,F(I),H())}function M(I){return t.value=I,f.value&&i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:k=>C(k)},null),i.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:k=>C(k)},null)])}function V(I=!0){document.body.click();const k=o.value||document.body,_=qe.getCurrent(k),D=t.value;I&&D&&(p.value=T(),p.value.transform=D.style.transform),_&&D&&(d.value=_,d.value.height-=14,d.value.width-=14,D.style.height=d.value.height+"px",D.style.width=d.value.width+"px",D.style.left="7px",D.style.top="7px",D.style.transform="",h.value={size:d.value,position:{x:0,y:0}},g.value=!1,b.value=!0)}function N(){var I,k;if(document.body.click(),p.value){const _={width:p.value.size.width||0,height:p.value.size.height||0},D={x:(window.innerWidth-_.width)/2,y:(window.innerHeight-_.height)/2};(I=d.value)==null||I.set(_),(k=l.value)==null||k.set(D);const ee=t.value;ee.style.height=_.height+"px",ee.style.width=_.width+"px",ee.style.left=`${D.x}px`,ee.style.top=`${D.y}px`,ee.style.transform="",h.value={size:_,position:D},g.value=n.draggable,b.value=!1}}function x(){if(t.value){const I=qe.getCurrent(t.value);if(I){const{width:k,height:_}=I;t.value.style.left=`${(window.innerWidth-k)/2}px`,t.value.style.top=`${(window.innerHeight-_)/2}px`,t.value.style.transform=""}}}function A(){const I=()=>{b.value?V(!1):x(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const Q=A();return{renderResizeBar:M,boundingElement:o,resizedEventParam:h,maximize:V,restore:N,allowDrag:g,isMaximized:b,unWindowResizeHandle:Q,moveToCenter:x}}function Mo(n,e,t){const o=i.ref(),r=i.ref(n.draggable),a=i.ref(n.lockAxis),s=i.ref(),d=i.ref(),l=i.ref(!1),u=i.ref(new ae(0,0)),m=i.ref(new ae(0,0)),c=i.ref(new ae(0,0)),h=i.ref(new ae(0,0));i.watch(()=>t.value,E=>{s.value.style.cursor=E?"move":"default"});function f(E,T){if(T.tagName==="BUTTON")return!1;if(T===E)return!0;for(const j in T.children)if(Object.prototype.hasOwnProperty.call(T.children,j)&&f(E,T.children[j]))return!0;return!1}function p(){var H,C;let E=c.value.x+m.value.x,T=c.value.y+m.value.y;a.value==="x"?(E=((H=u.value)==null?void 0:H.x)||0,c.value.x=0):a.value==="y"&&(T=((C=u.value)==null?void 0:C.y)||0,c.value.y=0);const j=`translate3d(${Math.round(E)}px, ${Math.round(T)}px, 0px)`;o.value&&(o.value.style.transform=j),h.value.x=E,h.value.y=T}function g(){if(!d.value||!o.value)return null;const E=d.value.getBoundingClientRect(),T=o.value.getBoundingClientRect(),j={top:E.top<T.top,right:E.right>T.right,bottom:E.bottom>T.bottom,left:E.left<T.left};return j.top||(c.value.y-=T.top-E.top),j.bottom||(c.value.y-=T.bottom-E.bottom),j.right||(c.value.x-=T.right-E.right),j.left||(c.value.x-=T.left-E.left),p(),j}function b(E){E&&(u.value&&E.subtract(u.value),c.value.set(E),p(),g())}function S(E){l.value&&r.value&&(E.stopPropagation(),E.preventDefault(),b(ae.fromEvent(E,s.value)))}function F(){var E;l.value&&(l.value=!1,m.value.add(c.value),c.value.reset(),(E=o.value)==null||E.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",F))}function R(){!l.value&&s.value&&(l.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",S),document.addEventListener("mouseup",F))}function $(){if(o.value){const E=ae.getTransformInfo(o.value);m.value.set(E);return}m.value.reset()}function w(E){if(!t.value||E instanceof MouseEvent&&E.button===2)return;const T=E.target||E.srcElement;s.value!==void 0&&T&&!f(T,s.value)||r.value!==!1&&(document.body.click(),E.stopPropagation(),E.preventDefault(),u.value=ae.fromEvent(E,o.value),$(),R())}function y(E,T,j){if(r.value&&T){if(E)s.value=E;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const H=T.querySelector(n.dragHandle);H&&(s.value=H)}}o.value=T,d.value=j,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",w)):r.value=!1}}return{registerDraggle:y,resetTranslate:$}}function Yt(n,e){if(n){const t=o=>{o.key.toLowerCase()===n.toLowerCase()&&e({event:o,key:n})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Eo(n,e){const t=i.ref(n.enableEsc);let o=null;return t.value?(o=Yt("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Fo(n,e){const t=i.ref(n.enableEnter);let o=null;return t.value?(o=Yt("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const De=i.defineComponent({name:"FModal",props:Xt,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,e){const t=i.ref(n.width||300),o=i.ref(n.height||200),r=i.ref(n.modelValue),a=i.ref(""),s=i.ref(n.class),d=i.ref(n.fitContent),l=i.ref(n.showHeader),u=i.ref(""),m=i.ref(n.showCloseButton),c=i.ref(n.showMaxButton),h=i.ref(!1),f=i.ref(n.dialogType),p=i.ref(n.src),g=i.ref(""),b=i.ref(n.showButtons),S=i.ref(n.title),F=i.ref(n.containment||null),R=i.ref(),{t:$}=gt.useI18n();S.value==="错误提示"&&(S.value=$("messageBox.errorTitle"));const w=i.ref(!1);function y(B,Y){const le=Y?"accept":"cancel";Promise.resolve().then(()=>{var ue;return(ue=n.beforeClose)==null?void 0:ue.call(n,{closeType:le})}).then(ue=>{ue&&(r.value=!1,e.emit("update:modelValue",!1),Y!=null&&e.emit(Y?"accept":"cancel"),e.emit("closed",B))})}const E=[{name:"cancel",text:$("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:B=>{y(B,!1)}},{name:"accept",text:$("messageBox.ok")||"确定",class:"btn btn-primary",handle:B=>{y(B,!0)}}],T=i.ref(n.buttons&&n.buttons.length?n.buttons:E),j=i.computed(()=>!!u.value),H=i.computed(()=>!!b.value&&!!T.value),C=i.ref(),M=i.ref(),V=i.ref(!1),{renderResizeBar:N,maximize:x,restore:A,boundingElement:Q,resizedEventParam:I,allowDrag:k,unWindowResizeHandle:_,moveToCenter:D}=To(n),{registerDraggle:ee}=Mo(n,e,k);function ge(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ye(){const B=document.querySelectorAll(".farris-modal").length;(!B||B-1<=0)&&document.body.classList.remove("modal-open"),R.value&&R.value.classList.remove("show")}i.watch(()=>n.title,(B,Y)=>{B!==Y&&(S.value=B)}),i.watch(()=>n.modelValue,(B,Y)=>{B!==Y&&(r.value=B,r.value&&n.draggable&&i.nextTick(()=>{M.value&&!F.value&&(F.value=M.value.parentElement,Q.value=F.value,ee(C.value,M.value,Q.value),D())}),B||(F.value&&(F.value=null),ye())),r.value?w.value=ge():(V.value=!1,k.value=n.draggable)}),i.watch(()=>n.showHeader,(B,Y)=>{B!==Y&&(l.value=B)}),i.watch(()=>n.showButtons,(B,Y)=>{B!==Y&&(b.value=B)}),i.watch(()=>I.value,(B,Y)=>{const le=B||{},ue=Y||{};JSON.stringify(le)!==JSON.stringify(ue)&&e.emit("resize",{newSize:B,oldSize:Y,isMaximized:V.value})});const X=i.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ie=i.computed(()=>{var le;const B={modal:!0,"farris-modal":!0,fade:!0};B["f-modal-fitContent"]=!!d.value,B.show=!!X.value;const Y=(le=n.maskClass)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,je)=>(ue[je]=!0,ue),B),B}),ce=i.computed(()=>{var le;const B={"modal-dialog":!0},Y=(le=s.value)==null?void 0:le.split(" ");return Y==null||Y.reduce((ue,je)=>(ue[je]=!0,ue),B),B}),te=i.computed(()=>{const B={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:d.value?"auto":`${o.value}px`};return n.mask||(B.pointerEvents="auto"),B}),z=()=>ve.getMaxZIndex()||1040,ne=i.computed(()=>{const B={display:"block",zIndex:z()};return n.mask||(B.pointerEvents="none",B.backgroundColor="transparent"),w.value&&(B.backgroundColor="transparent"),B}),Le=i.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),Ie=i.computed(()=>{const B={display:l.value?"":"none"};return B["pointer-events"]=k.value?"auto":"none",B}),Me=i.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:V.value})),We=i.computed(()=>({"modal-body":!0,"f-utils-flex-column":f.value==="iframe","f-utils-fill":!0}));function Re(){return{height:`${n.footerHeight||60}px`}}const Ge=i.computed(()=>{const B={textAlgin:g.value},Y=Re();return Object.assign(B,Y)});function se(B){if(B==null||B.stopPropagation(),V.value){V.value=!1,A();return}x(),V.value=!0}async function Ze(B,Y){B.handle&&await B.handle(Y,B)&&e.emit("closed",Y)}function Ve(B){B.width&&(t.value=B.width),B.height&&(o.value=B.height),B.buttons&&(T.value=B.buttons),B.title&&(S.value=B.title)}let Pe=null,Ee=null;i.onBeforeMount(()=>{w.value=ge()}),i.onMounted(()=>{M.value&&!F.value&&(F.value=M.value.parentElement,Q.value=F.value,ee(C.value,M.value,Q.value)),X.value&&document.body.classList.add("modal-open"),Pe=Eo(n,e),Ee=Fo(n,e)}),i.onUnmounted(()=>{_&&_(),Pe&&Pe.remove(),Ee&&Ee.remove()}),e.expose({modalElementRef:M,updateModalOptions:Ve,close:y,maxDialog:se,isMaximized:V});function Oe(){return i.createVNode("ul",null,[h.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:se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[i.createVNode("span",{class:Me.value},null)]),m.value&&i.createVNode("li",{class:"f-btn-icon f-bare",onClick:B=>y(B,!1),style:"pointer-events: auto;"},[i.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return i.createVNode("div",{class:"modal-footer",style:Ge.value},[T.value&&T.value.map(B=>{const Y=i.ref(B.disabled);return i.createVNode("button",{name:B.name,type:"button",disabled:Y.value,class:B.class+(B.iconClass?" btn-icontext":""),onClick:le=>{Ze(B,le)}},[!!B.iconClass&&i.createVNode("i",{class:B.iconClass},null),B.text])})])}function Ae(){return i.createVNode("div",{ref:C,class:"modal-header",style:Ie.value},[e.slots.headerTemplate?e.slots.headerTemplate():i.createVNode("div",{class:"modal-title"},[j.value&&i.createVNode("span",{class:u.value,style:"margin-right: 8px"},null),i.createVNode("span",{class:"modal-title-label"},[S.value])]),i.createVNode("div",{class:"actions"},[Oe()])])}function ke(){return e.slots.footerTemplate?e.slots.footerTemplate():H.value&&Ke()}function $e(B){if(B.stopPropagation(),n.allowClickMaskToClose){if(B.target!==R.value)return;y(B,!1)}}function Xe(){var B,Y;return i.createVNode("div",{id:a.value,class:ce.value,style:te.value,ref:M},[i.createVNode("div",{class:Le.value},[l.value&&Ae(),i.createVNode("div",{class:We.value},[(Y=(B=e.slots).default)==null?void 0:Y.call(B),f.value==="iframe"&&i.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),ke()]),!d.value&&M.value&&!V.value&&N(M.value)])}function Ye(B){return B||"body"}return()=>i.createVNode(i.Teleport,{to:Ye(n.host)},{default:()=>[X.value&&i.createVNode(i.Transition,{name:"fade",appear:!0},{default:()=>[i.createVNode("div",{ref:R,class:ie.value,style:ne.value,onClick:$e},[Xe()])]})]})}});function Jt(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Bo(n){const e=document.createElement("div");e.style.display="contents";const t=i.createApp({setup(o,r){i.onUnmounted(()=>{document.body.removeChild(e)});const a=i.ref(),s=i.ref(n.class||""),d=i.ref(!!n.showButtons),l=i.ref(!!n.showHeader),u=i.ref(n.showCloseButton==null?!0:n.showCloseButton),m=i.ref(!0),c=i.ref(n.title||""),h=n.acceptCallback||(()=>{}),f=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),g=n.resizeHandle||(R=>{}),b=n.stopMoveHandle||(R=>{}),S=Jt(n),F=R=>{m.value=!1,t.unmount(),p(R)};return i.onMounted(()=>{}),r.expose({modalRef:a}),()=>i.createVNode(De,{ref:a,class:s.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":d.value,"show-close-button":u.value,"show-max-button":!1,onAccept:h,onCancel:f,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:F,onResize:g,onStopMove:b},{default:()=>[S&&S(t)]})}});return document.body.appendChild(e),t.use(rt.LocaleService.i18n),t.mount(e),t}class Qt{constructor(e){W(this,"appContext",null);W(this,"modalRef",i.ref());W(this,"activeModalIndex",i.ref(0));W(this,"modalRefs",{});W(this,"isUseEscCloseModal",i.ref(!1));W(this,"activeModalInstance",i.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Bo(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=i.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=i.ref(!0),a=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),d=o.value.closedCallback||((w,y)=>{}),l=o.value.resizeHandle||(w=>{}),u=e.stopMoveHandle||(w=>{});let m;const c=Jt(o.value),h=w=>{var E;r.value=!1;const y=(E=w==null?void 0:w.target)==null?void 0:E.classList.contains("modal_close");d(w,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},f=w=>{h(w),m&&i.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],i.render(null,t),m=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(E=>Number(E));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=w=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(w==null?void 0:w.event))},{width:g,height:b}=o.value,S=this.adaptToWindow(g||500,b||320);Object.assign(o.value,S);const F=()=>i.createVNode(De,i.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":w=>r.value=w},o.value,{onAccept:a,onCancel:s,onClosed:f,onResize:l,onEsc:p,onStopMove:u}),{default:()=>[c&&c(this.app)]});return m=(w=>{const y=i.h(F,w);return y.appContext=this.appContext,i.render(y,t),y})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:w=>{o.value={...o.value,...w},m&&i.render(i.cloneVNode(m,{...o}),t)},destroy:f,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ko=Symbol("FModalService");De.install=n=>{n.component(De.name,De);const e=new Qt(n);n.provide(ko,e),n.provide("FModalService",e)},De.register=(n,e,t,o)=>{n.modal=De,e.modal=xo,o.modal={callbackResolver:So}};const Te=class Te{static show(e){const t=i.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",a=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",s=t.acceptCallback||(()=>{}),d=t.rejectCallback||(()=>{});let l=null,u=new Qt(Te.app);const m=()=>{l&&(l==null||l.destroy(),u=null)};return l=u==null?void 0:u.open({class:"modal-message modal-message-type-info",title:a,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>i.createVNode(ft,i.mergeProps(t,{onAccept:s,onReject:d,onClose:m}),null)}),u==null?void 0:u.getCurrentModal()}static info(e,t){const o=i.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Te.show(o)}static warning(e,t){const o=i.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",showCancelButton:!1});Te.show(o)}static success(e,t){const o=i.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",showCancelButton:!1});Te.show(o)}static error(e,t,o){const r=i.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:o,message:e,detail:t}});Te.show(r)}static prompt(e,t){const o=i.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Te.show(o)}static question(e,t,o,r){const a=i.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Te.show(a)}};W(Te,"app",null);let pt=Te;ft.install=n=>{n.component(ft.name,ft),pt.app=n,n.provide("FMessageBoxService",pt)};class jo extends $n{constructor(t,o){super(t,o);W(this,"responseLayoutEditorFunction");W(this,"bindingVarible");W(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=Dn(this.formSchemaUtils)}getCommonPropertyConfig(t,o,r="Card"){this.propertyConfig.categories.basic=this.getBasicProperties(t,o,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(t,o),this.propertyConfig.categories.behavior=this.getBehaviorConfig(t,"form-group")}getPropertyConfig(t,o){return this.getCommonPropertyConfig(t,o,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(t),this.propertyConfig.categories.expressions=this.getExpressionConfig(t,"Field"),this.propertyConfig}getGridFieldEdtiorPropConfig(t,o){return this.propertyConfig.categories={},this.getCommonPropertyConfig(t,o,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(t):this.propertyConfig.categories.editor=this.getEditorProperties(t),this.propertyConfig.categories.expressons=this.getExpressionConfig(t,"Field"),this.propertyConfig.categories}getBasicProperties(t,o,r="Card"){const a=this;this.setDesignViewModelField(t);const{canChangeControlType:s,editorTypeList:d}=this.getAvailableEditorType(t),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:d,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]}},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:t,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!t.isRtcControl}},setPropertyRelates(u,m,c){if(u)switch(u&&u.propertyID){case"type":{a.changeControlType(t,u,o);break}case"label":{u.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(t,u,c);break}}}};return r.toLocaleLowerCase()!=="card"&&delete l.properties.showLabelType,l}checkCanChangeControlType(t,o){if(!t.binding)return!1;if(t.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(t.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==ve.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(t){var a;const o=this.checkCanChangeControlType(t,this.viewModelId);if(!o)return{canChangeControlType:!1,editorTypeList:[{key:t.editor.type,value:((a=P[t.editor.type])==null?void 0:a.name)||t.editor.type}]};let r=[];return this.designViewModelField&&this.designViewModelField.$type===ve.FormSchemaEntityField$Type.SimpleField?r=lt.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(r=lt.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.multiLanguage)),{canChangeControlType:o,editorTypeList:r}}changeBindingField(t,o,r){o.needRefreshEntityTree=!0}getAppearanceProperties(t,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(t,r.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,r.componentId||t.id),r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId),r.updateElementByParentContainer(t.id,o),delete t.responseLayout;break;case"class":r.updateUnifiedLayoutAfterControlChanged(a.propertyValue,t.id,this.componentId),st.value++;break;case"style":{st.value++;break}}}}}getEditorProperties(t){return this.getComponentConfig(t)}changeControlType(t,o,r){const a=o.propertyValue,s=r&&r.parent&&r.parent.schema;if(!s)return;const d=s.contents.findIndex(m=>m.id===t.id);if(d===-1)return;const l=s.contents[d];let u;if(this.designViewModelField){const h=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};h.editor||(h.editor={}),h.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,h,!1),u=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}u||(u=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(u,{id:l.id,appearance:l.appearance,size:l.size,label:l.label,binding:l.binding}),Object.prototype.hasOwnProperty.call(l,"visible")&&Object.assign(u,{visible:l.visible}),l.editor&&["readonly","required","placeholder"].map(m=>{Object.prototype.hasOwnProperty.call(l.editor,m)&&(u.editor[m]=l.editor[m])}),r!=null&&r.updateContextSchema?r.updateContextSchema(u):(r.schema=Object.assign(l,u),Object.assign(t,u)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(m=>m.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(m=>m.classList.remove("dgComponentFocused")),st.value++,i.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(t,o={},r={},a){var h;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},o),d=(h=t.binding)!=null&&h.field?[]:["Const","Variable","StateMachine"],l=this.getPropertyEditorParams(t,d,"readonly"),u=this.getPropertyEditorParams(t,d,"required"),m={readonly:{description:"",title:"只读",editor:l},required:{description:"",title:"必填",type:"boolean",editor:u},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const f in r)m[f]=Object.assign(m[f]||{},r[f]);const c=this;return{...s,properties:{...m},setPropertyRelates(f,p){if(f){switch(f.propertyID){case"readonly":case"required":c.afterMutilEditorChanged(t,f);break}a&&a.bind(c)(f,t,p)}}}}updateUnifiedLayoutAfterControlChanged(t,o,r){const a=t.split(" ");let s=a.find(c=>/^col-([1-9]|10|11|12)$/.test(c)),d=a.find(c=>/^col-md-([1-9]|10|11|12)$/.test(c)),l=a.find(c=>/^col-xl-([1-9]|10|11|12)$/.test(c)),u=a.find(c=>/^col-el-([1-9]|10|11|12)$/.test(c));s=s||"col-12",d=d||"col-md-"+s.replace("col-",""),l=l||"col-xl-"+d.replace("col-md-",""),u=u||"col-el-"+l.replace("col-xl-","");const m={id:o,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(d.replace("col-md-",""),10),columnInLG:parseInt(l.replace("col-xl-",""),10),columnInEL:parseInt(u.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(r,m)}updateUnifiedLayoutAfterResponseLayoutChanged(t,o){const{formNode:r}=this.responseLayoutEditorFunction.checkCanFindFormNode(t);if(!r||!r.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,a,1),o){const p=a.find(g=>g.id===o.id);Object.assign(p||{},o)}const s=a.map(p=>p.columnInSM),d=a.map(p=>p.columnInMD),l=a.map(p=>p.columnInLG),u=a.map(p=>p.columnInEL),m=this.checkIsUniqueColumn(s)?s[0]:null,c=this.checkIsUniqueColumn(d)?d[0]:null,h=this.checkIsUniqueColumn(l)?l[0]:null,f=this.checkIsUniqueColumn(u)?u[0]:null;Object.assign(r.unifiedLayout,{uniqueColClassInSM:m,uniqueColClassInMD:c,uniqueColClassInLG:h,uniqueColClassInEL:f})}checkIsUniqueColumn(t){const o=new Set(t);return Array.from(o).length===1}getItemCollectionEditor(t,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(t)}}}checkEnumDataReadonly(t){return!t.binding||t.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===ve.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(t,o){t.binding&&t.binding.type===ct.Form&&t.binding.field?(o.find(s=>s.label==="fieldValueChanging")||o.push({label:"fieldValueChanging",name:"绑定字段值变化前事件"}),o.find(s=>s.label==="fieldValueChanged")||o.push({label:"fieldValueChanged",name:"绑定字段值变化后事件"}),this.designViewModelField&&(t.fieldValueChanging=this.designViewModelField.valueChanging,t.fieldValueChanged=this.designViewModelField.valueChanged)):o=o.filter(r=>r.label!=="fieldValueChanging"&&r.label!=="fieldValueChanged")}getControlMethodType(t){if(!t.binding)return t.type;switch(t.binding.type){case ct.Form:return t.binding.path||t.type;case ct.Variable:return t.binding.fullPath||t.type}return t.type}getEventPropertyConfig(t,o="card",r,a){const s=this;let d=[];r&&(d=d.concat(r)),this.appendFieldValueChangeEvents(t,d);const l=s.eventsEditorUtils.formProperties(t,s.viewModelId,d);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(l),tabId:"commands",tabName:"交互",setPropertyRelates(c,h){const f=c.propertyValue;delete t[s.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,f.controlInfo={type:s.getControlMethodType(t),name:t.title},s.eventsEditorUtils.saveRelatedParameters(t,s.viewModelId,f.events,f)),a&&a(c,h,f);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:t.fieldValueChanging,valueChanged:t.fieldValueChanged})}}}getExpressionConfig(t,o,r=["compute","dependency","validate"],a){return new Wt(this.formSchemaUtils).getExpressionConfig(t,o,r,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="number"?this.numberEditorOptions:{}}updatePropertyValue(t,o,r){var a;t.editor[o]!==r?t.editor[o]=r:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(t,o,r){let a=r;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(o==="trueValue"?"true":"false"));const d=o==="trueValue"?"falseValue":"trueValue";t.editor[d]===a&&(a=a+1),this.updatePropertyValue(t,o,a)}getBooleanValueConverter(){return{convertFrom:(t,o)=>t.editor[o],convertTo:(t,o,r)=>{this.setBooleanValue(t,o,r)}}}}class No extends jo{constructor(e,t){super(e,t)}getEditorProperties(e){return this.getComponentConfig(e,{type:"textarea"},{resizable:{description:"",title:"拖拽调整大小",type:"boolean"},autoHeight:{description:"",title:"自动高度",visible:!1,type:"boolean"}})}getGridFieldEdtiorProperties(e){return this.getComponentConfig(e,{type:"textarea"},{autoHeight:{description:"",title:"自动高度",visible:!1,type:"boolean"}})}}function Io(n,e){const t=n.schema;function o(r,a){return new No(r,e).getPropertyConfig(t,a)}return{getPropsConfig:o}}const Vo=i.defineComponent({name:"FTextareaDesign",props:_t,emits:[""],setup(n,e){const t=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),a=Io(r,o),s=In(t,r,a),d=i.computed(()=>n.maxLength?n.maxLength:n.modelValue.length),l=i.computed(()=>({position:"relative"})),u=i.computed(()=>({"box-shadow":"0 0 0 1px #dcdfe6 inset",border:"none",padding:"5px 10px",width:"100%"})),m={position:"absolute",bottom:"5px",right:"10px"};return i.onMounted(()=>{t.value.componentInstance=s}),e.expose(s.value),()=>i.createVNode("div",{style:l.value,ref:t},[i.createVNode("textarea",{id:n.id,tabindex:n.tabIndex,disabled:!1,readonly:!0,style:u.value,placeholder:n.placeholder,rows:n.rows},null),n.showCount&&i.createVNode("span",{style:m},[`${n.modelValue.length}/${d.value}`])])}});Qe.register=(n,e,t,o)=>{n.textarea=Qe,e.textarea=yt},Qe.registerDesigner=(n,e,t)=>{n.textarea=Vo,e.textarea=yt};const Po=ve.withInstall(Qe);oe.FTextarea=Qe,oe.default=Po,oe.propsResolver=yt,oe.textAreaDesignProps=_t,oe.textAreaProps=at,Object.defineProperties(oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|