@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1
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 +138 -1526
- package/components/avatar/index.umd.cjs +1 -6
- package/components/button/index.css +1 -1
- package/components/button/index.esm.js +15951 -15410
- package/components/button/index.umd.cjs +27 -27
- package/components/calendar/index.esm.js +269 -255
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +243 -229
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +32 -32
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +473 -456
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.css +1 -1
- package/components/component/index.esm.js +2503 -2239
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +1064 -954
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +1 -1
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +3894 -3058
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +91 -77
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +220 -215
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +145 -131
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +336 -329
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1611 -1536
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +219 -219
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/external-container/index.esm.js +179 -178
- package/components/external-container/index.umd.cjs +1 -1
- package/components/fieldset/index.esm.js +285 -221
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -0
- package/components/filter-bar/index.esm.js +1512 -1290
- package/components/filter-bar/index.umd.cjs +7 -7
- package/components/filter-condition-editor/index.esm.js +851 -831
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +520 -501
- package/components/flow-canvas/index.umd.cjs +8 -8
- package/components/image/index.esm.js +101 -79
- package/components/image/index.umd.cjs +3 -3
- package/components/language-textbox/index.esm.js +330 -251
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-nav/index.esm.js +399 -313
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +3 -0
- package/components/locale/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +997 -976
- package/components/lookup/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +725 -705
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +542 -522
- package/components/message-box/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +95 -308
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +115 -107
- package/components/number-range/index.umd.cjs +2 -2
- package/components/order/index.esm.js +56 -54
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +135 -123
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +266 -222
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +402 -375
- package/components/property-panel/index.umd.cjs +4 -4
- package/components/query-solution/index.esm.js +3171 -3061
- package/components/query-solution/index.umd.cjs +7 -7
- 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 +1620 -1608
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/scroll-navbar/index.esm.js +150 -136
- package/components/scroll-navbar/index.umd.cjs +2 -2
- package/components/section/index.esm.js +323 -311
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +850 -830
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/step/index.esm.js +991 -224
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +356 -334
- package/components/tabs/index.umd.cjs +1 -1
- package/components/wizard/index.esm.js +159 -162
- package/components/wizard/index.umd.cjs +1 -1
- package/designer/avatar/index.esm.js +1721 -0
- package/designer/avatar/index.umd.cjs +6 -0
- package/designer/button-edit/index.esm.js +2 -1
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +693 -659
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +90 -78
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/date-picker/index.esm.js +203 -203
- package/designer/date-picker/index.umd.cjs +1 -1
- package/designer/drawer/index.esm.js +181 -167
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +228 -206
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +10014 -9692
- package/designer/farris-designer.all.umd.cjs +18 -18
- package/designer/index.css +1 -1
- package/designer/input-group/index.esm.js +15 -15
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/nav/index.esm.js +1719 -0
- package/designer/nav/index.umd.cjs +6 -0
- package/designer/number-spinner/index.esm.js +8 -7
- package/designer/number-spinner/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +133 -125
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +864 -863
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +245 -183
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.css +1 -1
- package/designer/tabs/index.esm.js +3667 -2810
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +26 -17
- package/designer/time-picker/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +69 -37
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/designer/wizard/index.esm.js +110 -110
- package/designer/wizard/index.umd.cjs +3 -3
- package/farris.all.esm.js +39993 -39089
- package/farris.all.umd.cjs +36 -36
- package/index.css +1 -1
- package/locales/filter-bar/ui/en.json +1 -0
- package/locales/filter-bar/ui/zh-CHS.json +1 -0
- package/locales/filter-bar/ui/zh-CHT.json +1 -0
- package/locales/ui/en.json +1 -0
- package/locales/ui/zh-CHS.json +1 -0
- package/locales/ui/zh-CHT.json +1 -0
- package/package.json +1 -1
- package/types/avatar/designer.d.ts +28 -0
- package/types/avatar/index.d.ts +0 -15
- package/types/avatar/src/composition/types.d.ts +3 -0
- package/types/avatar/src/composition/use-file.d.ts +19 -0
- package/types/avatar/src/composition/use-image.d.ts +1 -1
- package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
- package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
- package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
- package/types/components.d.ts +3 -0
- package/types/condition/index.d.ts +18 -6
- package/types/condition/src/condition-fields.component.d.ts +9 -3
- package/types/condition/src/condition-fields.design.component.d.ts +9 -3
- package/types/condition/src/condition-list.component.d.ts +9 -3
- package/types/condition/src/condition.props.d.ts +11 -0
- package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
- package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
- package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
- package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
- package/types/dynamic-view/src/components/maps.d.ts +130 -4
- package/types/filter-bar/src/composition/types.d.ts +2 -0
- package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
- package/types/filter-bar/src/locale/locale.d.ts +2 -1
- package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
- package/types/language-textbox/index.d.ts +65 -2
- package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
- package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
- package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/lookup/src/composition/use-compat.d.ts +28 -0
- package/types/lookup/src/composition/use-state.d.ts +1 -0
- package/types/message-box/src/message-box.service.d.ts +2 -1
- package/types/nav/designer.d.ts +28 -0
- package/types/nav/index.d.ts +24 -20
- package/types/nav/src/designer/nav.design.props.d.ts +29 -0
- package/types/nav/src/designer/use-design-rules.d.ts +3 -0
- package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
- package/types/nav/src/schema/schema-mapper.d.ts +4 -0
- package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
- package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
- package/types/section/src/designer/section.design.props.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +39 -0
- package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
- package/types/step/src/designer/use-designer-rules.d.ts +3 -0
- package/types/step/src/designer/use-step-creator.d.ts +6 -0
- package/types/step/src/property-config/step.property-config.d.ts +15 -0
- package/types/step/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +4 -0
- package/types/tabs/src/tabs.props.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -3
- package/types/tooltip/src/tooltip.component.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../locale/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../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("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/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("../../designer/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("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js"),require("../notify/index.umd.js"),require("../button/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../locale/index.umd.js","bignumber.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/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","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/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","../../designer/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","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js","../notify/index.umd.js","../button/index.umd.js"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["designer-canvas"]={},E.Vue,E.LodashES,E.locale,E.BigNumber,E.common,E.VueUseCore,E.dataView,E.dynamicResolver,E.designerCanvas,E.FAccordion,E.FAvatar,E.FButtonEdit,E.FButtonGroup,E.FCalendar,E.FCapsule,E.FCheckbox,E.FCheckboxGroup,E.FComboList,E.FComboTree,E.FComponent,E.FColorPicker,E.FContentContainer,E.FDatePicker,E.FDataGrid,E.FDropdown,E.FDynamicForm,E.FEventsEditor,E.FFilterBar,E.FFieldSelector,E.FBindingSelector,E.FImageCropper,E.FInputGroup,E.FLayout,E.FListNav,E.FListView,E.FLookup,E.FMappingEditor,E.FNav,E.FNumberRange,E.FNumberSpinner,E.FOrder,E.FPageHeader,E.FPageFooter,E.FPagination,E.FProgress,E.FQuerySolution,E.FRadioGroup,E.FRate,E.FResponseToolbar,E.FResponseLayout,E.FResponseLayoutEditorSetting,E.FSearchBox,E.FSection,E.FSmokeDetector,E.FSplitter,E.FStep$1,E.FSwitch,E.FTabs,E.FTags,E.FText,E.FTimePicker,E.FTransfer,E.FTreeview,E.FUploader,E.FVerifyDetail,E.FVideo,E.FTextArea,E.FSchemaSelector,E.FTreeGrid$1,E.FEventParameter,E.FFilterConditionEditor,E.FFieldset,E.FSortConditionEditor,E.FMenuLookup,E.FDrawer,E.FJsonEditor,E.FPropertyEditor,E.FExpressionEditor,E.FCodeEditor,E.FHtmlTemplate,E.FCollectionPropertyEditor,E.FModal$1,E.FExternalContainer,E.FLanguageTextbox,E.FImage,E.FComment,E.FWizard,E.FTooltip,null,E.notify,E.FButton))})(this,function(E,e,pe,Le,_r,Ne,co,se,Ce,uo,At,zt,Ht,Rt,_t,$t,xt,gt,Ut,fo,Wt,Gt,Yt,Xt,Kt,Jt,Qt,mo,Zt,po,en,tn,nn,on,rn,an,ln,go,sn,cn,un,dn,fn,mn,pn,gn,vn,hn,yn,Cn,bn,wn,Sn,xn,Tn,Dn,Nn,jn,Bn,Mn,Vn,En,In,Fn,kn,On,Pn,Ln,vo,qn,ho,yo,An,Co,bo,zn,wo,So,xo,To,Hn,Do,No,Rn,_n,$n,Un,Wn,jo,$r,Bo,Mo){"use strict";var Hr=Object.defineProperty;var Rr=(E,e,pe)=>e in E?Hr(E,e,{enumerable:!0,configurable:!0,writable:!0,value:pe}):E[e]=pe;var ze=(E,e,pe)=>Rr(E,typeof e!="symbol"?e+"":e,pe);const qe=e.ref(0);function Vo(){qe.value++}function Eo(t,o){const n=o.getBoundingClientRect(),s=t.getBoundingClientRect(),l=s.top>=n.top,r=s.top<=n.bottom;return l&&r}function Tt(t){const o=t.querySelector(".component-btn-group");if(!o)return;o.style.display="";const n=o.getBoundingClientRect();if(!(n.top===0&&n.left===0)){const s=o.querySelector("div");if(s){const l=s.getBoundingClientRect();s.style.top=n.top+"px";let r=n.left-l.width;const i=document.querySelector(".editorDiv");if(i){const c=i.getBoundingClientRect();r<c.left&&({left:r}=t.getBoundingClientRect())}s.style.left=r+"px"}}}function Gn(t){var n,s,l,r,i;if(!window.scrollContainerList)return;const o=Array.from(window.scrollContainerList);if(o.length)if(o.length===1){const c=o[0],g=document.querySelector(`[id=${c}]`);if(g&&g.contains(t))return g}else{const{componentInstance:c}=t;if(((n=c==null?void 0:c.value)==null?void 0:n.scrollElementId)===((s=c==null?void 0:c.value.schema)==null?void 0:s.id))return t;if(((l=c==null?void 0:c.value)==null?void 0:l.scrollElementId)===`${(r=c==null?void 0:c.value.schema)==null?void 0:r.id}-design-item`)return t.parentElement;if((i=c.value.parent)!=null&&i.elementRef)return Gn(c.value.parent.elementRef)}}function vt(t){if(!t)return;const o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;const n=t.querySelector(".component-btn-group");if(n){let s=!0;const l=Gn(t);if(l&&(s=Eo(t,l)),!s){n.style.display="none";return}Tt(t)}}function it(t){if(!t)return;let o;t.className.includes("dgComponentSelected")?o=t:o=t.querySelector(".dgComponentSelected"),o&&vt(o)}function Io(){const t=document.querySelector(".dgComponentSelected");if(!t)return;const o=t.querySelector(".component-btn-group");o&&o.getBoundingClientRect().top!==0&&Tt(t)}const Yn={modelValue:{type:Object,default:{}},componentId:{type:String,default:""},components:{type:Array},canvasMode:{type:String,default:"PC"}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ht(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xn={exports:{}};(function(t,o){(function(n){t.exports=n()})(function(){return function(){function n(s,l,r){function i(f,h){if(!l[f]){if(!s[f]){var p=typeof ht=="function"&&ht;if(!h&&p)return p(f,!0);if(c)return c(f,!0);var O=new Error("Cannot find module '"+f+"'");throw O.code="MODULE_NOT_FOUND",O}var a=l[f]={exports:{}};s[f][0].call(a.exports,function(u){var w=s[f][1][u];return i(w||u)},a,a.exports,n,s,l,r)}return l[f].exports}for(var c=typeof ht=="function"&&ht,g=0;g<r.length;g++)i(r[g]);return i}return n}()({1:[function(n,s,l){var r={},i="(?:^|\\s)",c="(?:\\s|$)";function g(p){var O=r[p];return O?O.lastIndex=0:r[p]=O=new RegExp(i+p+c,"g"),O}function f(p,O){var a=p.className;a.length?g(O).test(a)||(p.className+=" "+O):p.className=O}function h(p,O){p.className=p.className.replace(g(O)," ").trim()}s.exports={add:f,rm:h}},{}],2:[function(n,s,l){(function(r){var i=n("contra/emitter"),c=n("crossvent"),g=n("./classes"),f=document,h=f.documentElement;function p(v,z){var k=arguments.length;k===1&&Array.isArray(v)===!1&&(z=v,v=[]);var F,A,x,W,V,L,te,C,q,ne=null,ee,Q,le=!1,ce=0,ae,X=z||{};X.moves===void 0&&(X.moves=T),X.accepts===void 0&&(X.accepts=T),X.invalid===void 0&&(X.invalid=ct),X.containers===void 0&&(X.containers=v||[]),X.isContainer===void 0&&(X.isContainer=I),X.copy===void 0&&(X.copy=!1),X.copySortSource===void 0&&(X.copySortSource=!1),X.revertOnSpill===void 0&&(X.revertOnSpill=!1),X.removeOnSpill===void 0&&(X.removeOnSpill=!1),X.direction===void 0&&(X.direction="vertical"),X.ignoreInputTextSelection===void 0&&(X.ignoreInputTextSelection=!0),X.mirrorContainer===void 0&&(X.mirrorContainer=f.body);var de=i({containers:X.containers,start:Fe,end:Ke,cancel:rt,remove:ot,destroy:Xe,canMove:$e,dragging:!1});return X.removeOnSpill===!0&&de.on("over",ut).on("out",at),Re(),de;function Ae(j){return de.containers.indexOf(j)!==-1||X.isContainer(j)}function Re(j){var $=j?"remove":"add";u(h,$,"mousedown",ye),u(h,$,"mouseup",We)}function Ie(j){var $=j?"remove":"add";u(h,$,"mousemove",st)}function et(j){var $=j?"remove":"add";c[$](h,"selectstart",tt),c[$](h,"click",tt)}function Xe(){Re(!0),We({})}function tt(j){ee&&j.preventDefault()}function ye(j){W=j.clientX,V=j.clientY;var $=w(j)!==1||j.metaKey||j.ctrlKey;if(!$){var Y=j.target,oe=_e(Y);oe&&(ee=oe,Ie(),j.type==="mousedown"&&(y(Y)?Y.focus():j.preventDefault()))}}function st(j){if(ee){if(w(j)===0){We({});return}if(!(j.clientX!==void 0&&Math.abs(j.clientX-W)<=(X.slideFactorX||0)&&j.clientY!==void 0&&Math.abs(j.clientY-V)<=(X.slideFactorY||0))){if(X.ignoreInputTextSelection){var $=B("clientX",j)||0,Y=B("clientY",j)||0,oe=f.elementFromPoint($,Y);if(y(oe))return}var ue=ee;Ie(!0),et(),Ke(),Ue(ue),g.add(C||x,"gu-transit"),Et(),Vt(),ce=0,me(j)}}}function _e(j){if(!(de.dragging&&F)&&!Ae(j)){for(var $=j;d(j)&&Ae(d(j))===!1;)if(X.invalid(j,$)||(j=d(j),!j))return;var Y=d(j);if(Y&&!X.invalid(j,$)){var oe=X.moves(j,Y,$,D(j));if(oe)return{item:j,source:Y}}}}function $e(j){return!!_e(j)}function Fe(j){var $=_e(j);$&&Ue($)}function Ue(j){qt(j.item,j.source)&&(C=j.item.cloneNode(!0),de.emit("cloned",C,j.item,"copy")),A=j.source,x=j.item,L=te=D(j.item),de.dragging=!0,de.emit("drag",x,A)}function ct(){return!1}function Ke(){if(de.dragging){var j=C||x;nt(j,d(j))}}function ke(){ee=!1,Ie(!0),et(!0)}function We(j){if(ke(),!!de.dragging){var $=C||x,Y=B("clientX",j)||0,oe=B("clientY",j)||0,ue=N(F,Y,oe),fe=ge(ue,Y,oe);fe&&(C&&X.copySortSource||!C||fe!==A)?nt($,fe):X.removeOnSpill?ot():rt()}}function nt(j,$){var Y=d(j);C&&X.copySortSource&&$===A&&Y.removeChild(x),ie($)?de.emit("cancel",j,A):de.emit("drop",j,$,A,te),P()}function ot(){if(de.dragging){var j=C||x,$=d(j);$&&$.removeChild(j),de.emit(C?"cancel":"remove",j,$,A),P()}}function rt(j){if(de.dragging){var $=arguments.length>0?j:X.revertOnSpill,Y=C||x,oe=d(Y),ue=ie(oe);ue===!1&&$&&(C?oe&&oe.removeChild(C):A.insertBefore(Y,L)),ue||$?de.emit("cancel",Y,A,A):de.emit("drop",Y,oe,A,te),P()}}function P(){var j=C||x;ke(),It(),Ft(),j&&g.rm(j,"gu-transit"),q&&clearTimeout(q),de.dragging=!1,ne&&de.emit("out",j,ne,A),de.emit("dragend",j,ce),A=x=C=L=te=q=ne=null}function ie(j,$){var Y;return $!==void 0?Y=$:F?Y=te:Y=D(C||x),j===A&&Y===L}function ge(j,$,Y){for(var oe=j;oe&&!ue();)oe=d(oe);return oe;function ue(){var fe=Ae(oe);if(fe===!1)return!1;var Ee=wt(oe,j),De=St(oe,Ee,$,Y),je=ie(oe,De);return je?!0:X.accepts(x,oe,A,De)}}function me(j){if(!F)return;j.preventDefault();var $=B("clientX",j)||0,Y=B("clientY",j)||0;F.style.left=$-2+"px",F.style.top=Y-2+"px";var oe=C||x,ue=N(F,$,Y),fe=ge(ue,$,Y),Ee=fe!==null&&fe!==ne;(Ee||fe===null)&&(Be(),ne=fe,Pe()),Lt(ue,Y);var De=d(oe);if(fe===A&&C&&!X.copySortSource){De&&De.removeChild(oe);return}var je,Oe=wt(fe,ue);if(le=dt(Oe,fe),Oe!==null)je=St(fe,Oe,$,Y);else if(X.revertOnSpill===!0&&!C)je=L,fe=A;else{C&&De&&De.removeChild(oe),C&&Q&&(Q.style.display="none");return}Q.style.display="block",Ve(je,oe,Ee),je?Ot(Oe,je):Pt(fe);function be(xe){de.emit(xe,oe,ne,A)}function Pe(){Ee&&be("over")}function Be(){ne&&be("out")}}function Ve(j,$,Y){(j===$||j===D($))&&(te=D($)),(j===null&&Y||j!==$&&j!==D($))&&(te=j)}function ut(j){g.rm(j,"gu-hide")}function at(j){de.dragging&&g.add(j,"gu-hide")}function Vt(){F||(F=document.createElement("div"),F.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;",F.innerHTML=X.getMirrorText&&X.getMirrorText(x)||"控件",g.add(F,"gu-mirror"),X.mirrorContainer.appendChild(F),u(h,"add","mousemove",me),g.add(X.mirrorContainer,"gu-unselectable"),de.emit("cloned",F,x,"mirror"))}function Et(){if(Q=document.createElement("div"),g.add(Q,"gu-insertion"),x){var j=x.getBoundingClientRect();Q.style.left=j.left+"px",Q.style.top=j.top+"px"}le=!1,X.mirrorContainer.appendChild(Q)}function It(){F&&(g.rm(X.mirrorContainer,"gu-unselectable"),u(h,"remove","mousemove",me),d(F).removeChild(F),F=null)}function Ft(){Q&&(d(Q).removeChild(Q),Q=null)}function wt(j,$){for(var Y=$;Y!==j&&d(Y)!==j;)Y=d(Y);return Y===h?null:Y}function dt(j,$){if(!$)return le;var Y=j||$&&$.lastElementChild;if(!Y)return!0;var oe=getComputedStyle(j),ue=/^inline/.test(oe.getPropertyValue("display"))||/^(left|right)$/.test(oe.getPropertyValue("float"));if(ue)return!0;if($){var fe=getComputedStyle($),Ee=fe.getPropertyValue("display");if(/flex$/.test(Ee)){var De=fe.getPropertyValue("flex-direction")||"row";if(De==="row"||De==="row-reverse")return!kt($)}return!1}return!0}function kt(j){if(!j.children||!j.children.length)return!1;for(const $ of Array.from(j.children)){const oe=($.className&&$.className.split(" ")||[]).filter(ue=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ue));if(!oe.length)return!1;for(const ue of oe){const fe=ue.slice(ue.lastIndexOf("-")+1);if(parseInt(fe,10)!==12)return!1}}return!0}function Ot(j,$){const Y=$.getBoundingClientRect();if(Q.style.left=Y.left+"px",Q.style.top=Y.top+"px",le){if(Q.style.height=Y.height+"px",Q.style.width="4px",j){const oe=j.getBoundingClientRect();oe.top!==Y.top&&(Q.style.left=oe.right+"px",Q.style.top=oe.top+"px",Q.style.height=oe.height+"px")}}else if(Q.style.height="4px",Q.style.width=Y.width+"px",ae){const oe=ae.getBoundingClientRect();Y.top<oe.top&&(Q.style.display="none")}$===x&&x&&(Q.style.display="none")}function Pt(j){te=null;var $=j.lastElementChild;if($){var Y=$.getBoundingClientRect();le?(Q.style.left=Y.right+"px",Q.style.top=Y.top+"px",Q.style.height=Y.height+"px",Q.style.width="4px"):(Q.style.left=Y.left+"px",Q.style.top=Y.bottom+"px",Q.style.height="4px",Q.style.width=Y.width+"px"),$===x&&x&&(Q.style.display="none")}else Q.style.display="none"}function Lt(j,$){if(!X.mirrorContainer.contains(j)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ae=O(j),!ae||!ae.contains(j)))return;const Y=document.querySelector(".dgComponentSelected"),oe=ae.getBoundingClientRect();if($-30<oe.top&&ae.scrollTop>0){let ue=ae.scrollTop<10?ae.scrollTop:10;ae.scrollBy(0,-1*ue),Y&&ae.contains(Y)&&(ce=ce+-1*ue)}if($+30>oe.bottom&&ae.scrollTop<ae.scrollHeight-ae.clientHeight){const ue=ae.scrollHeight-ae.clientHeight-ae.scrollTop;let fe=ue<10?ue:10;ae.scrollBy(0,fe),Y&&ae.contains(Y)&&(ce=ce+fe)}}function St(j,$,Y,oe){var ue=X.direction==="horizontal",fe=X.direction==="mixed",Ee=$!==j?je():De();return Ee;function De(){var be=j.children.length,Pe,Be,xe;for(Pe=0;Pe<be;Pe++)if(Be=j.children[Pe],xe=Be.getBoundingClientRect(),ue&&xe.left+xe.width/2>Y||!fe&&!ue&&xe.top+xe.height/2>oe||fe&&xe.left+xe.width>Y&&xe.top+xe.height>oe)return Be;return null}function je(){var be=$.getBoundingClientRect();if(fe){var Pe=oe-be.top,Be=Y-be.left,xe=be.bottom-oe,ft=be.right-Y,mt=Math.min(Be,ft,Pe,xe),pt;return le?pt=ft<Be:pt=xe===mt||ft===mt||Be===mt,Oe(pt)}return Oe(ue?Y>be.left+M(be)/2:oe>be.top+m(be)/2)}function Oe(be){return be?D($):$}}function qt(j,$){return typeof X.copy=="boolean"?X.copy:X.copy(j,$)}}function O(v){const z=Array.from(window.scrollContainerList);if(z.length===1){const F=Array.from(window.scrollContainerList)[0];return document.getElementById(F)}const k=a(z);for(const F of k)if(F.contains(v))return F;return null}function a(v){const z=[];return v.forEach(k=>{const F=document.getElementById(k);F&&z.push(F)}),z.sort((k,F)=>k.contains(F)?1:F.contains(k)?-1:0),z}function u(v,z,k,F){var A={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},x={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},W={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};r.navigator.pointerEnabled?c[z](v,x[k],F):r.navigator.msPointerEnabled?c[z](v,W[k],F):(c[z](v,A[k],F),c[z](v,k,F))}function w(v){if(v.touches!==void 0)return v.touches.length;if(v.which!==void 0&&v.which!==0)return v.which;if(v.buttons!==void 0)return v.buttons;var z=v.button;if(z!==void 0)return z&1?1:z&2?3:z&4?2:0}function N(v,z,k){v=v||{};var F=v.className||"",A;return v.className+=" gu-hide",A=f.elementFromPoint(z,k),v.className=F,A}function I(){return!1}function T(){return!0}function M(v){return v.width||v.right-v.left}function m(v){return v.height||v.bottom-v.top}function d(v){return v.parentNode===f?null:v.parentNode}function y(v){return v.tagName==="INPUT"||v.tagName==="TEXTAREA"||v.tagName==="SELECT"||b(v)}function b(v){return!v||v.contentEditable==="false"?!1:v.contentEditable==="true"?!0:b(d(v))}function D(v){return v.nextElementSibling||z();function z(){var k=v;do k=k.nextSibling;while(k&&k.nodeType!==1);return k}}function S(v){return v.targetTouches&&v.targetTouches.length?v.targetTouches[0]:v.changedTouches&&v.changedTouches.length?v.changedTouches[0]:v}function B(v,z){var k=S(z),F={pageX:"clientX",pageY:"clientY"};return v in F&&!(v in k)&&F[v]in k&&(v=F[v]),k[v]}s.exports=p}).call(this,typeof He<"u"?He:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,s,l){s.exports=function(i,c){return Array.prototype.slice.call(i,c)}},{}],4:[function(n,s,l){var r=n("ticky");s.exports=function(c,g,f){c&&r(function(){c.apply(f||null,g||[])})}},{ticky:10}],5:[function(n,s,l){var r=n("atoa"),i=n("./debounce");s.exports=function(g,f){var h=f||{},p={};return g===void 0&&(g={}),g.on=function(O,a){return p[O]?p[O].push(a):p[O]=[a],g},g.once=function(O,a){return a._once=!0,g.on(O,a),g},g.off=function(O,a){var u=arguments.length;if(u===1)delete p[O];else if(u===0)p={};else{var w=p[O];if(!w)return g;w.splice(w.indexOf(a),1)}return g},g.emit=function(){var O=r(arguments);return g.emitterSnapshot(O.shift()).apply(this,O)},g.emitterSnapshot=function(O){var a=(p[O]||[]).slice(0);return function(){var u=r(arguments),w=this||g;if(O==="error"&&h.throws!==!1&&!a.length)throw u.length===1?u[0]:u;return a.forEach(function(I){h.async?i(I,u,w):I.apply(w,u),I._once&&g.off(O,I)}),g}},g}},{"./debounce":4,atoa:3}],6:[function(n,s,l){(function(r){var i=n("custom-event"),c=n("./eventmap"),g=r.document,f=O,h=u,p=[];r.addEventListener||(f=a,h=w),s.exports={add:f,remove:h,fabricate:N};function O(d,y,b,D){return d.addEventListener(y,b,D)}function a(d,y,b){return d.attachEvent("on"+y,T(d,y,b))}function u(d,y,b,D){return d.removeEventListener(y,b,D)}function w(d,y,b){var D=M(d,y,b);if(D)return d.detachEvent("on"+y,D)}function N(d,y,b){var D=c.indexOf(y)===-1?B():S();d.dispatchEvent?d.dispatchEvent(D):d.fireEvent("on"+y,D);function S(){var v;return g.createEvent?(v=g.createEvent("Event"),v.initEvent(y,!0,!0)):g.createEventObject&&(v=g.createEventObject()),v}function B(){return new i(y,{detail:b})}}function I(d,y,b){return function(S){var B=S||r.event;B.target=B.target||B.srcElement,B.preventDefault=B.preventDefault||function(){B.returnValue=!1},B.stopPropagation=B.stopPropagation||function(){B.cancelBubble=!0},B.which=B.which||B.keyCode,b.call(d,B)}}function T(d,y,b){var D=M(d,y,b)||I(d,y,b);return p.push({wrapper:D,element:d,type:y,fn:b}),D}function M(d,y,b){var D=m(d,y,b);if(D){var S=p[D].wrapper;return p.splice(D,1),S}}function m(d,y,b){var D,S;for(D=0;D<p.length;D++)if(S=p[D],S.element===d&&S.type===y&&S.fn===b)return D}}).call(this,typeof He<"u"?He:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,s,l){(function(r){var i=[],c="",g=/^on/;for(c in r)g.test(c)&&i.push(c.slice(2));s.exports=i}).call(this,typeof He<"u"?He:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,s,l){(function(r){var i=r.CustomEvent;function c(){try{var g=new i("cat",{detail:{foo:"bar"}});return g.type==="cat"&&g.detail.foo==="bar"}catch{}return!1}s.exports=c()?i:typeof document<"u"&&typeof document.createEvent=="function"?function(f,h){var p=document.createEvent("CustomEvent");return h?p.initCustomEvent(f,h.bubbles,h.cancelable,h.detail):p.initCustomEvent(f,!1,!1,void 0),p}:function(f,h){var p=document.createEventObject();return p.type=f,h?(p.bubbles=!!h.bubbles,p.cancelable=!!h.cancelable,p.detail=h.detail):(p.bubbles=!1,p.cancelable=!1,p.detail=void 0),p}}).call(this,typeof He<"u"?He:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,s,l){var r=s.exports={},i,c;function g(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?i=setTimeout:i=g}catch{i=g}try{typeof clearTimeout=="function"?c=clearTimeout:c=f}catch{c=f}})();function h(m){if(i===setTimeout)return setTimeout(m,0);if((i===g||!i)&&setTimeout)return i=setTimeout,setTimeout(m,0);try{return i(m,0)}catch{try{return i.call(null,m,0)}catch{return i.call(this,m,0)}}}function p(m){if(c===clearTimeout)return clearTimeout(m);if((c===f||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(m);try{return c(m)}catch{try{return c.call(null,m)}catch{return c.call(this,m)}}}var O=[],a=!1,u,w=-1;function N(){!a||!u||(a=!1,u.length?O=u.concat(O):w=-1,O.length&&I())}function I(){if(!a){var m=h(N);a=!0;for(var d=O.length;d;){for(u=O,O=[];++w<d;)u&&u[w].run();w=-1,d=O.length}u=null,a=!1,p(m)}}r.nextTick=function(m){var d=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)d[y-1]=arguments[y];O.push(new T(m,d)),O.length===1&&!a&&h(I)};function T(m,d){this.fun=m,this.array=d}T.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function M(){}r.on=M,r.addListener=M,r.once=M,r.off=M,r.removeListener=M,r.removeAllListeners=M,r.emit=M,r.prependListener=M,r.prependOnceListener=M,r.listeners=function(m){return[]},r.binding=function(m){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(m){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],10:[function(n,s,l){(function(r){var i=typeof r=="function",c;i?c=function(g){r(g)}:c=function(g){setTimeout(g,0)},s.exports=c}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,s,l){(function(r,i){var c=n("process/browser.js").nextTick,g=Function.prototype.apply,f=Array.prototype.slice,h={},p=0;l.setTimeout=function(){return new O(g.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new O(g.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(a){a.close()};function O(a,u){this._id=a,this._clearFn=u}O.prototype.unref=O.prototype.ref=function(){},O.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(a,u){clearTimeout(a._idleTimeoutId),a._idleTimeout=u},l.unenroll=function(a){clearTimeout(a._idleTimeoutId),a._idleTimeout=-1},l._unrefActive=l.active=function(a){clearTimeout(a._idleTimeoutId);var u=a._idleTimeout;u>=0&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},u))},l.setImmediate=typeof r=="function"?r:function(a){var u=p++,w=arguments.length<2?!1:f.call(arguments,1);return h[u]=!0,c(function(){h[u]&&(w?a.apply(null,w):a.call(null),l.clearImmediate(u))}),u},l.clearImmediate=typeof i=="function"?i:function(a){delete h[a]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Xn);var ko=Xn.exports;const Kn=Fo(ko),Oo={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}},Po={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Dt=e.defineComponent({name:"Toast",props:Po,emits:["close","click"],setup:(t,o)=>{const n=e.ref(t.animate),s="fadeOut",l=e.computed(()=>t.options),r=e.ref(!1),i=e.computed(()=>l.value.title&&l.value.message),c=e.computed(()=>!l.value.title&&l.value.message),g=e.computed(()=>{const T={animated:r.value,toast:!0,"toast--only-content":!i.value};return T[t.animate]=!1,T[s]=r.value,T["toasty-type-"+l.value.type]=!0,l.value.theme&&(T[l.value.theme]=!0),T}),f=e.computed(()=>{const m=`f-icon-${l.value&&l.value.type?l.value.type.replace("toasty-type-",""):"default"}`,d={"f-icon":!0};return d[m]=!0,d}),h=e.computed(()=>l.value.title||l.value.message),p=e.computed(()=>t.showCloseButton),O=e.computed(()=>!!l.value.buttons||!!o.slots.default),a=e.computed(()=>Le.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function u(T){T.stopPropagation(),T.preventDefault(),r.value=!1,setTimeout(()=>{o.emit("close",l.value)},200)}function w(T,M){}function N(T){return`f-preten-link ${T.customClass?T.customClass:""}`}e.watch(n,()=>{n.value});const I=()=>{var T;return e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"after-toast-msg text-right"},[!o.slots.default&&((T=l.value.buttons)==null?void 0:T.map(M=>e.createVNode("span",{class:N(M),onClick:m=>void 0},[M.text]))),o.slots.default&&o.slots.default()])])};return()=>e.createVNode("div",{class:g.value,style:"min-height:44px"},[p.value&&e.createVNode("button",{title:Le.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:u},[e.createVNode("span",{class:"f-icon modal_close"},null)]),h.value&&e.createVNode("section",{class:"modal-tips"},[!i.value&&e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:f.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[i.value&&e.createVNode(e.Fragment,null,[e.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:l.value.title},null),e.createVNode("p",{class:"toast-msg",innerHTML:l.value.message,style:a.value},null),O.value&&I()]),c.value&&(l.value.buttons?e.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[e.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:a.value,innerHTML:l.value.message},null),e.createVNode("div",{class:"after-toast-title text-right ml-auto"},[I()])]):e.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:a.value,innerHTML:l.value.message},null))])])])}}),Lo=["moz","ms","webkit"];function qo(){let t=0;return o=>{const n=new Date().getTime(),s=Math.max(0,16-(n-t)),l=setTimeout(()=>{o(n+s)},s);return t=n+s,l}}function Ao(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=Lo.filter(o=>`${o}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:qo()}Ao();function zo(){const t=navigator.userAgent||navigator.vendor||window.opera,o=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],n=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const c of n)if(c.test(t))return!1;for(const c of o)if(c.test(t))return!0;const s="ontouchstart"in window||navigator.maxTouchPoints>0,l=screen.width,r=screen.height,i=Math.min(l,r);return!!(s&&i<=768)}const yt=e.defineComponent({name:"Notify",props:Oo,emits:["close","empty"],setup(t,o){var w;const n=zo(),l=`farris-notify-${(w=t.options)!=null&&w.type?t.options.type:"info"}}`,r=e.computed(()=>({"farris-notify":!0,[l]:n})),i={left:12,right:12,top:20,bottom:12},c=e.ref(),g=e.ref(t.options),f=e.ref(t.showCloseButton),h=e.computed(()=>t.position||"bottom-right"),p=e.computed(()=>t.timeout!=null?t.timeout:3e3),O=e.computed(()=>{const N=t.bottom?t.bottom:i.bottom,I=t.top?t.top:i.top,T={transition:"all 0.2s ease",left:h.value.indexOf("left")>-1?`${t.left?t.left:i.left}px`:"",right:h.value.indexOf("right")>-1?`${t.right?t.right:i.right}px`:"",top:h.value.indexOf("top")>-1?`${I}px`:"",bottom:h.value.indexOf("bottom")>-1?`${N}px`:""};return h.value.indexOf("center")>-1&&(T.left="50%",T.marginLeft="calc(-24rem / 2)",h.value==="center-center"&&(T.top="50%",T.transform="translate(-50%, -50%)")),T});function a(N){o.emit("close")}p.value&&setTimeout(()=>{a()},p.value),o.expose({closeToast:a,container:c,notifyPosition:h});function u(N,I){a()}return()=>{var N;return n?e.createVNode("div",{class:r.value,ref:c},[(N=t.options)==null?void 0:N.message]):e.createVNode("div",{class:r.value,style:O.value,ref:c},[e.createVNode(Dt,{options:g.value,showCloseButton:f.value,animate:t.animate,onClose:I=>u(I,g.value)},null)])}}});class Nt{constructor(){ze(this,"notifyRefs",[]);ze(this,"globalConfig",e.reactive({}))}escapeAllHtml(o){if(typeof o!="string"||!o)return"";const n=document.createElement("div");return n.textContent=o||"",n.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(o){const n=this,l=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...o}),r=document.createElement("div");r.style.display="contents";const i=e.createApp({setup(){var f;const c=e.ref();function g(){c.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(l,c),i.unmount()},220)}if(l.position.indexOf("top")>-1){const h=n.getNotifyInstances(l.position),p=h[h.length-1];if(p){const O=p.value.container.getBoundingClientRect();l.top=O.bottom}}return l.safeHtml&&((f=l.options)!=null&&f.message)&&(l.options.message=n.escapeAllHtml(l.options.message)),e.onUnmounted(()=>{document.body.removeChild(r)}),e.onMounted(()=>{n.updateNotifyPositionForCreate(l,c)}),()=>e.createVNode(e.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[e.createVNode(yt,e.mergeProps({ref:c},l,{onClose:g}),null)]})}});return i.provide("NotifyService",this),document.body.appendChild(r),i.use(Le.LocaleService.i18n),i.mount(r),i}getNotifyInstances(o){return this.notifyRefs.filter(n=>n.value.notifyPosition===o)}updateNotifyPositionForCreate(o,n){if(this.notifyRefs&&this.notifyRefs.length){const s=window.innerHeight;o.position.indexOf("bottom")>-1&&this.getNotifyInstances(o.position).forEach(l=>{const r=l.value.container.getBoundingClientRect();l.value.container.style.bottom=r.height+s-r.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(o,n){const s=this.notifyRefs.indexOf(n);if(o.position.indexOf("top")>-1){const l=this.getNotifyInstances(o.position),r=l.indexOf(n);l.slice(r+1).forEach(i=>{i.value.container.style.top=i.value.container.offsetTop-i.value.container.offsetHeight+"px"})}s>-1&&this.notifyRefs.splice(s,1)}show(o){return this.createNotifyInstance(o)}buildNotifyProps(o,n){let s="",l="",r,i,c;typeof n=="string"?s=n:n&&(s=n.message||"",l=n.title||"",i=n.position||null,c=n.showCloseButton!=null?n.showCloseButton:null,r=n.timeout!=null?n.timeout:null);const f={options:{type:o,message:s,title:l}};return i!=null&&(f.position=i),c!=null&&(f.showCloseButton=c),r!=null&&(f.timeout=r),f}info(o){const n=this.buildNotifyProps("info",o);return this.show(n)}success(o){const n=this.buildNotifyProps("success",o);return this.show(n)}warning(o){const n=this.buildNotifyProps("warning",o);return this.show(n)}error(o){const n=this.buildNotifyProps("error",o);return this.show(n)}close(o){o&&o.unmount()}closeAll(){this.notifyRefs.forEach(o=>{o==null||o.value.closeToast()}),this.notifyRefs.length=0}}const Ho=Symbol("NOTIFY_SERVICE_TOKEN");yt.install=t=>{t.component(yt.name,yt),t.component(Dt.name,Dt);const o=new Nt;t.provide(Ho,o),t.provide("FNotifyService",o)};const Ro={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}};`${Le.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const _o={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,mode:"server",size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},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"]}},autoHeight:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},checkboxPosition:{type:String,default:"after-expand"}};function $o(t,o,n,s,l,r,i,c,g,f,h,p,O,a,u,w,N){const{calculateCellPositionInRow:I}=r,{columnContext:T,hasLeftFixedColumn:M,hasRightFixedColumn:m}=i,{gridDataStyle:d,leftFixedGridDataStyle:y,rightFixedGridDataStyle:b}=a,{renderDataRow:D}=se.getHierarchyRow(t,o,T,N,c,g,f,h,p,O,a,u,w),S=[D];function B(A,x){const W=I(A);return N.value.filter(V=>V.visible!==!1).map((V,L)=>S[V.type](V,W,x,L))}function v(){return e.createVNode("div",{ref:s,class:"fv-grid-content-left-fixed"},[e.createVNode("div",{class:"fv-grid-data",style:y.value},[B(T.value.leftColumns.filter(A=>A.visible),"left")])])}function z(){return e.createVNode("div",{ref:n,class:"fv-grid-content-primary"},[e.createVNode("div",{class:"fv-grid-data",style:d.value},[B(T.value.primaryColumns.filter(A=>A.visible),"primary")])])}function k(){return e.createVNode("div",{ref:l,class:"fv-grid-content-right-fixed"},[e.createVNode("div",{class:"fv-grid-data",style:b.value},[B(T.value.rightColumns.filter(A=>A.visible),"right")])])}function F(){const A=[];return M.value&&A.push(v()),A.push(z()),m.value&&A.push(k()),A}return{renderDataArea:F}}const jt=e.defineComponent({name:"FTreeGrid",props:_o,emits:["selectionChange","clickRow","expandNode","dblclickNode","doubleClickRow","unSelectItem","selectItem","selectAll","unSelectAll","filterChanged","sortChanged","selectionUpdate"],setup(t,o){var io,lo;const s=((io=t.rowOption)==null?void 0:io.height)||28,l=e.ref(20),r=e.ref(t.columns),i=se.useIdentify(t),{idField:c}=i,g=e.ref(),f=e.ref(),h=e.ref(),p=e.ref(),O=e.ref(),a=e.ref([]),u=e.ref(!1),w=e.ref(((lo=t.rowOption)==null?void 0:lo.wrapContent)||!1),N=se.useGroupData(t,i),I=se.useFilter(t,o),T=se.useHierarchy(t),{collapseField:M}=T,{showLoading:m,renderLoading:d}=se.useLoading(t,g),y=se.useDataView(t,new Map,I,T,i),{dataView:b}=y,D=se.useSelection(t,y,i,a,o),{showSelection:S,selectedValues:B}=D,v=se.useSelectHierarchyItem(t,a,y,i,D,o),z=e.computed(()=>t.disabled),k=e.computed(()=>t.virtualized?Math.min(y.dataView.value.length,l.value):y.dataView.value.length),F=se.usePagination(t,y),{shouldRenderPagination:A}=F,{containerStyleObject:x}=se.useDataViewContainerStyle(t),W=se.useCommandColumn(t),{applyCommands:V}=W;V(r);const{applyColumnSetting:L,removeColumnSetting:te}=se.useSettingColumn(t);t.showSetting&&L(r);const C=se.useColumn(t,o),q=se.useSort(t),{applyColumnSorter:ne,columnContext:ee,updateColumnRenderContext:Q}=C;ne(y,q);const le=se.useGroupColumn(t,ee),ce=se.useRow(t,o,D,i),ae=se.useEdit(t,o,i,ce,a),X=se.useVisualDataBound(t),de=se.useVisualDataCell(t,ae,X),Ae=se.useVisualDataRow(t,y,ae,T,i,X,de),Re=se.useVisualData(t,r,y,k,0,Ae),{getVisualData:Ie}=Re,et=se.useCellPosition(t,ee),Xe=se.useSidebar(t,D),{sidebarWidth:tt}=Xe,ye=se.useVirtualScroll(t,y,a,ee,Re,k,0,tt),{onWheel:st,dataGridWidth:_e,viewPortHeight:$e,viewPortWidth:Fe,resetScroll:Ue,updateVisibleRowsOnLatestVisibleScope:ct}=ye,Ke=se.useFitColumn(t,ee,f,Fe,le),{calculateColumnsSize:ke}=Ke,We=se.useFilterHistory(),nt=se.useColumnFilter(f,O,y,We,ye),ot=se.useDragColumn(t,o,C,y,le,N,ye),rt=e.computed(()=>{const G={"fv-grid":!0,"fv-grid-bordered":t.showBorder,"fv-grid-horizontal-bordered":t.showHorizontalLines,"fv-datagrid-strip":t.showStripe};return Ne.getCustomClass(G,t.customClass)}),P=e.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":u.value,"fv-grid-wrap-content":w.value})),{renderDataArea:ie}=$o(t,o,h,p,O,et,C,y,ae,T,ce,D,v,ye,Re,X,a),{renderGridHeader:ge,renderGridColumnResizeOverlay:me,shouldShowHeader:Ve}=se.getColumnHeader(t,o,f,p,O,C,y,ot,nt,I,We,Ke,le,D,Xe,q,ye,Fe,a),{renderDataGridSidebar:ut}=se.getSidebar(t,ce,D,Xe,ye,v),{renderDisableMask:at}=se.getDisableMask(),{renderHorizontalScrollbar:Vt}=se.getHorizontalScrollbar(t,f,ye),{renderVerticalScrollbar:Et}=se.getVerticalScrollbar(t,f,ye);function It(){var G,re,we;if(f.value&&f.value.clientHeight>0&&((G=f.value)==null?void 0:G.clientWidth)>0){const Te=Math.ceil(f.value.clientHeight/s);Te>l.value&&(l.value=Te,ct()),$e.value=((re=h.value)==null?void 0:re.clientHeight)||0,_e.value=((we=f.value)==null?void 0:we.clientWidth)||0}f.value&&(f.value.clientHeight>0||f.value.clientWidth>0)&&ke()}e.onMounted(()=>{f.value&&(l.value=Math.max(Math.ceil(f.value.clientHeight/s),l.value),a.value=Ie(0,k.value+0-1),co.useResizeObserver(f.value,It),ke(),e.nextTick(()=>{f.value&&(_e.value=f.value.clientWidth),h.value&&(Fe.value=h.value.clientWidth,$e.value=h.value.clientHeight)})),m.value&&d()}),e.onUnmounted(()=>{}),e.watch(Fe,()=>{f.value&&ke()});function Ft(G){y.collapseTo(G),y.reOrderVisibleIndex(),Ue()}function wt(G){y.expandTo(G),y.reOrderVisibleIndex(),Ue()}function dt(){const G=D.getSelectionRow();return G?G.dataIndex-1:-1}function kt(){const G=dt();y.insertNewDataItem(G),a.value=Ie(0,k.value+0-1)}function Ot(){const G=dt();y.insertNewChildDataItem(G),a.value=Ie(0,k.value+0-1)}function Pt(G,re){const we=a.value.find(Me=>Me.raw[c.value]===re),Te=we?we.dataIndex-1:-1;y.insertNewChildDataItems(G,Te)}function Lt(){const G=dt(),re=v.getNextSelectableHierarchyItemId(G);y.removeHierarchyDataItem(G),a.value=Ie(0,k.value+0-1),re&&v.selectItemById(re)}function St(G){ae.onEditingRow(G)}function qt(G){ae.acceptEditingRow(G)}function j(G){ae.cancelEditingRow(G)}function $(G){G&&(r.value=G,V(r),Q(r.value),ne(y,q),ke())}e.watch(()=>t.columns,G=>{$(G)});function Y(G,re){G&&(y.load(G),y.reOrderVisibleIndex(),re!=null&&re.keepScrollPosition?ye.scrollTo(ye.offsetY.value):Ue())}function oe(G){ce.activeRowById(G)}function ue(G,re={isCurrent:!0}){re!=null&&re.isCurrent&&oe(G),v.selectItemById(G)}function fe(G){const re=a.value.find(we=>we.raw[i.idField.value]===G);re&&ce.clickRowItem(re)}function Ee(G){v.selectItemByIds(G)}function De(){return D.getSelectedItems()}function je(){D.clearSelection()}function Oe(){D.emptyCurrentRowId()}const be=e.computed(()=>!a.value||!a.value.length),{renderEmpty:Pe}=se.getEmpty(t,o);function Be(){return D.getSelectionRow()}function xe(G,re={clearCurrent:!0}){re!=null&&re.clearCurrent&&oe(""),v.unSelectItemByIds(G)}function ft(){return D.currentSelectedDataId.value}function mt(G,re,we){const Te=b.value.find(Me=>Me[c.value]===G);if(Te){if(Object.keys(Te).forEach(Se=>{Object.prototype.hasOwnProperty.call(re,Se)&&(Te[Se]=re[Se])}),we){const{collapseField:Se,disabledField:Je,checkedField:Qe,visibleField:Ze}=we;Se&&!pe.isUndefined(re[Se])&&(Te.__fv_collapse__=re[Se]),Qe&&!pe.isUndefined(re[Qe])&&(Te.__fv_checked__=re[Qe]),Je&&!pe.isUndefined(re[Je])&&(Te.__fv_disabled__=re[Je]),Ze&&!pe.isUndefined(re[Ze])&&(Te.__fv_visible__=re[Ze])}const Me=a.value.find(Se=>Se.raw[c.value]===G),so=a.value.findIndex(Se=>Se.raw[c.value]===G);if(Me){if(Me.raw=Te,Object.keys(Me.data).forEach(Se=>{Me.data[Se].updateData(Te)}),we){const{collapseField:Se,disabledField:Je,checkedField:Qe,visibleField:Ze}=we;Se&&!pe.isUndefined(re[Se])&&(Me.collapse=re[Se]),Qe&&!pe.isUndefined(re[Qe])&&(Me.checked=re[Qe]),Je&&!pe.isUndefined(re[Je])&&(Me.disabled=re[Je]),Ze&&!pe.isUndefined(re[Ze])&&(Me.visible=re[Ze])}a.value=[...a.value.slice(0,so),Me,...a.value.slice(so+1)],y.updateSummary()}}}function pt(G){return Object.prototype.hasOwnProperty.call(G,"raw")?y.hasRealChildren(G.raw):y.hasRealChildren(G)}function Br(G){const re=y.dataView.value.find(we=>we[c.value]===G);return re?re[M.value]:""}function Mr(){return M.value}e.watch(()=>t.showSetting,(G,re)=>{G!==re&&(G?L(r):te(r),$(r.value))});function Vr(G){return a.value.filter(re=>G.includes(re.raw[t.idField]))}function Er(G){const re=i.idField.value,we=a.value.find(Te=>Te.raw[re]===G);we&&ce.changeRow(we)}function Ir(){D.keepSelectingOnPaging.value||je(),y.updateVisibleDataSummary(a.value)}function Fr(G){F.updatePagination(G)}const kr=se.useAdapt(D,y,I,r,$,Y,Fr);o.expose({activeRowById:oe,addNewDataItem:kt,addNewChildDataItem:Ot,addChildrenToNode:Pt,collapseTo:Ft,expandTo:wt,removeDataItem:Lt,editDataItem:St,acceptDataItem:qt,cancelDataItem:j,updateColumns:$,updateDataSource:Y,selectItemById:ue,selectItemByIds:Ee,getSelectedItems:De,clearSelection:je,getSelectionRow:Be,clickRowItemById:fe,unSelectItemByIds:xe,getCurrentRowId:ft,reassignRowData:mt,hasChildren:pt,getCollapseField:Mr,getCollapseStatusById:Br,getVisibleDataByIds:Vr,selectRowById:Er,updateDerivedData:Ir,emptyCurrentRowId:Oe,calculateColumnsSize:ke,...kr});const Or=e.computed(()=>{const G={};return ye.shouldShowHorizontalScrollbar.value&&(G.paddingBottom="10px"),ye.shouldShowVirticalScrollbar.value&&(G.paddingRight="10px"),G}),Pr=e.computed(()=>({...x.value,borderRadius:"5px"})),{renderDataGridPagination:Lr}=se.getPagination(t,o,y,ye,F,D),qr=e.computed(()=>({"d-flex":!0,"justify-content-between":A.value&&S.value,"justify-content-end":A.value&&!S.value,"position-relative":!0})),Ar=e.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:zr}=se.getSummary(t,y,C);return()=>t.visible&&e.createVNode("div",{ref:g,class:rt.value,style:Pr.value,onWheel:st},[f.value&&Ve.value&&ge(),e.createVNode("div",{ref:f,class:P.value,onMouseover:()=>u.value=!0,onMouseleave:()=>u.value=!1,onTouchstart:G=>{G.stopPropagation(),u.value=!0,ye.onTouchstartScrollThumb(G,f)},onTouchend:G=>{u.value=!1},style:Or.value},[f.value&&ut(a),f.value&&ie(),f.value&&be.value&&Pe(),f.value&&Vt(),f.value&&Et()]),f.value&&zr(),(A.value||S.value)&&e.createVNode("div",{class:qr.value},[S.value&&e.createVNode("div",{class:Ar.value},[e.createVNode("div",null,["已选:"+B.value.length,e.createTextVNode(" 条")])]),A.value&&Lr()]),me(),z.value&&at()])}});Ne.withInstall(jt);function Jn(t){const{designerHostService:o}=t,n=new Map,s=e.ref(),l=e.ref(),r=e.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),i={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},c=e.ref(!1),g=e.ref(t.componentType);function f(N){const I=[];return N.forEach(T=>{let M=[];T.type&&T.type.fields&&T.type.fields.length>0&&(M=f(T.type.fields));const m=pe.cloneDeep(T),d=T.multiLanguage?"多语言":T.type.displayName,y=M.length?!1:!n.has(T.id);y&&(c.value=!0),I.push({data:Object.assign({displayedTypeName:d,selectable:y},m),children:M})}),I}function h(N){switch(N){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return N}}function p(N){var I,T;if(N&&(((I=N.schema)==null?void 0:I.type)===((T=ve.drawer)==null?void 0:T.type)||N.parent&&p(N.parent)))return!0}function O(N){if(n.clear(),!N)return;const I=p(t.targetComponentInstance);let T=h(g.value);["frame","table","form"].includes(T)&&(T="form");const{formSchemaUtils:M,schemaService:m}=o;M.getFormSchema().module.viewmodels.forEach(d=>{if(!d.fields||d.fields.length===0)return;const y=M.getComponentByViewModelId(d.id);let b=y.componentType;["frame","table","form"].includes(b)&&(b="form");const D=m.getTableInfoByViewModelId(d.id);if(b!==T||!D||D.id!==N.id)return;const S=M.checkComponentExistInDrawer(y.id);I&&S&&d.fields.forEach(B=>{n.set(B.id,!0)}),!I&&!S&&d.fields.forEach(B=>{n.set(B.id,!0)})})}function a(N){O(N);const{fields:I}=N.type;c.value=!1,s.value=f(I),l.value&&l.value.updateDataSource(s.value)}const u={customRowStatus:N=>(N.disabled=!N.raw.selectable,N)};function w(){return l.value.getSelectedItems().map(I=>I.data)}return{fieldTreeGridRef:l,resolveFieldDataSource:a,occupiedFieldMap:n,fieldDataSource:s,fieldTreeRowOption:u,fieldColumns:r,fieldSelectionOption:i,checkAndGetSelectedFields:w,hasSelectableField:c,currentComponentType:g}}function Uo(t){const{designerHostService:o}=t,n=new Map,s=e.ref(),l=e.ref(),r=e.ref([{field:"name",title:"实体名称"}]),i=e.ref(),c=e.ref(!1);function g(u){const w=Jn(t);return w.resolveFieldDataSource(u),w.hasSelectableField.value?(i.value=i.value||u,!0):!1}function f(u){return!(t.bindingEntityId&&t.bindingEntityId!==u.id||!g(u))}function h(u,w=""){var m;if(!u)return;const N=pe.cloneDeep(u),I=w?`${w}/${N.label}`:"/";n.set(N.label,I.replace("//","/"));const T=f(N),M={data:Object.assign({selectable:T},N),children:[]};if(N.type.entities&&N.type.entities.length){const d=N.type.entities.map(y=>h(y,I));M.children=M.children.concat(d)}return t.bindingEntityId===u.id&&(i.value=u),((m=i.value)==null?void 0:m.id)===u.id&&!w&&(c.value=!0),M}function p(){var I;const{formSchemaUtils:u}=o,w=(I=u.getFormSchema().module.entity[0])==null?void 0:I.entities[0];n.clear();const N=h(w);l.value=[N]}function O(){var w;const u=s.value.getSelectionRow();if(!u||!((w=u.raw)!=null&&w.data)){const N=new Nt;N.globalConfig={position:"top-center"},N.warning({message:"请先选择实体"});return}return u.raw.data}return{entityTreeGridRef:s,entityDataSource:l,resolveEntityDataSource:p,entityBindToMap:n,checkAndGetSelectedEntity:O,entityColumns:r,entityTreeRowOption:{customRowStatus:u=>(u.disabled=!u.raw.selectable,u)},initialSelectedEntity:i,isMainEntityInitialSelected:c}}const Wo=new Map([["appearance",Ce.resolveAppearance]]);function Go(t,o,n){return o}const Yo={$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"]},Xo={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:[]}}}}}},Bt={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},visible:{type:Boolean,default:!0},onClick:{type:Function,default:()=>{}}},Qn=Ce.createPropsResolver(Bt,Yo,Wo,Go,Xo),Ge=e.defineComponent({name:"FStep",props:Bt,emits:["click"],setup(t,o){const n=e.ref(t.direction),s=e.ref(t.fill),l=e.ref(t.height),r=e.ref(t.activeIndex),i=e.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&s.value,"f-progress-step-vertical-fill":n.value==="vertical"&&s.value})),c=e.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function g(M,m){const d={step:!0,active:m===r.value,clickable:t.clickable,current:m===r.value,finish:m<r.value};return M.status&&(d[M.status]=!0),Ne.getCustomClass(d,M.class||"")}function f(M,m){if(!t.clickable)return;const d={step:M,stepIndex:m};o.emit("click",d)}function h(M,m){const d={"f-progressstep-row":!0,"step-active":m===r.value,"step-current":m===r.value,"step-finish":m<r.value};return M.status&&(d["step-"+M.status]=!0),d}function p(M,m){const d={"step-icon":!0,"step-success":m,"f-icon":m,"f-icon-check":m};return Ne.getCustomClass(d,M.icon||"")}function O(M,m){const d=[];return M.icon?d.push(e.createVNode("span",{class:p(M,!1)},null)):m>=r.value?d.push(e.createVNode("span",{class:"step-icon"},[m+1])):d.push(e.createVNode("span",{class:p(M,!0)},null)),d}function a(M,m){return{"step-name":!0,"step-name-success":m<r.value}}function u(M,m){return e.createVNode("div",{class:"f-progress-step-title"},[e.createVNode("p",{class:a(M,m)},[M.title])])}function w(M,m){return{"f-progress-step-line":!0,"f-progress-step-line-success":m===r.value}}function N(M,m){return m!==t.steps.length-1}const I=e.computed(()=>({triangle:!0,"":n.value==="vertical"}));function T(){return t.steps.map((M,m,d)=>e.createVNode("li",{class:g(M,m),onClick:y=>f(M,m)},[o.slots.stepTemplate?o.slots.stepTemplate({step:M,index:m,length:d.length,activeIndex:r.value,direction:n.value}):e.createVNode("div",{class:h(M,m)},[e.createVNode("div",{class:"f-progress-step-content"},[O(M,m),u(M,m)]),N(M,m)&&e.createVNode("div",{class:w(M,m)},[e.createVNode("span",{class:I.value},null)])])]))}return e.watch(()=>t.activeIndex,()=>{t.activeIndex>-1&&t.activeIndex<=t.steps.length&&(r.value=t.activeIndex,T())}),()=>t.visible&&e.createVNode("div",{class:"f-progress-step"},[e.createVNode("ul",{class:i.value,style:c.value},[T()])])}}),Ko=e.defineComponent({name:"FStepDesign",props:Bt,emits:[],setup(t,o){const n=e.ref(t.direction),s=e.ref(t.fill),l=e.ref(t.height),r=e.ref(t.steps),i=e.ref(0),c=e.ref(t.clickable),g=e.ref(0),f=e.ref(),h=e.inject("design-item-context"),p=uo.useDesignerComponent(f,h);e.onMounted(()=>{f.value.componentInstance=p}),o.expose(p.value);const O=e.computed(()=>({"f-progress-step-list":n.value==="horizontal","f-progress-step-list-block":n.value==="vertical","f-progress-step-horizontal-fill":n.value==="horizontal"&&s.value,"f-progress-step-vertical-fill":n.value==="vertical"&&s.value})),a=e.computed(()=>({height:n.value==="vertical"?`${l.value}px`:""}));function u(S,B){const v={step:!0,active:B===i.value,clickable:c.value,"click-disable":S.disable,current:B===i.value};return B<i.value&&(v.finish=!0),S.status&&(v[S.status]=!0),S.hasOwnProperty("class")&&S.class.split(" ").reduce((z,k)=>(z[k]=!0,z),v),v}function w(S,B){}function N(S,B){const v={"f-progressstep-row":!0,"step-active":B===i.value,"step-current":B===i.value};return B<i.value&&(v["step-finish"]=!0),S.status&&(v["step-"+S.status]=!0),v}function I(S,B){const v={"step-icon":!0,"step-success":B,"k-icon":B,"k-i-check":B};return S.hasOwnProperty("icon")&&S.class.split(" ").reduce((z,k)=>(z[k]=!0,z),v),v}function T(S,B){const v=[];return S.icon?v.push(e.createVNode("span",{class:I(S,!1)},null)):B>=i.value||B===g.value?v.push(e.createVNode("span",{class:"step-icon"},[B+1])):v.push(e.createVNode("span",{class:I(S,!0)},null)),v}function M(S,B){return{"step-name":!0,"step-name-success":B<i.value}}function m(S,B){return e.createVNode("div",{class:"f-progress-step-title"},[e.createVNode("p",{class:M(S,B)},[S.title])])}function d(S,B){return{"f-progress-step-line":!0,"f-progress-step-line-success":B===i.value}}function y(S,B){return B!==r.value.length-1}const b=e.computed(()=>({triangle:!0,"":n.value==="vertical"}));function D(){return r.value.map((S,B)=>e.createVNode("li",{class:u(S,B),onClick:v=>void 0},[e.createVNode("div",{class:N(S,B)},[e.createVNode("div",{class:"f-progress-step-content"},[T(S,B),m(S,B)]),y(S,B)&&e.createVNode("div",{class:d(S,B)},[e.createVNode("span",{class:b.value},null)])])]))}return()=>e.createVNode("div",{ref:f,class:"f-progress-step"},[e.createVNode("ul",{class:O.value,style:a.value},[D()])])}});Ge.install=t=>{t.component(Ge.name,Ge)},Ge.register=(t,o,n,s)=>{t.step=Ge,o.step=Qn},Ge.registerDesigner=(t,o,n)=>{t.step=Ko,o.step=Qn};const Jo={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},Mt=e.defineComponent({name:"FResponseForm",props:Jo,emits:[],setup(t,o){const n=e.ref(),s=e.computed(()=>{const l=Le.LocaleService.getLocale(),r=t.customClass.split(" "),i={"drag-container":!0};return r.reduce((c,g)=>(c[g]=!0,c),i),t.adaptForLanguage&&l&&(i["farris-form-controls-inline"]=l!=="en"),i});return()=>t.visible&&e.withDirectives(e.createVNode("div",{ref:n,class:s.value,style:t.customStyle},[o.slots.default&&o.slots.default()]),[[e.resolveDirective("area-response")]])}}),Qo={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},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:Object,default:""}},Zo={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"}},er=e.defineComponent({name:"FDynamicFormLabel",props:Zo,emits:["clickLabel"],setup(t,o){e.ref(t.title||t.text);const n=e.ref(t.required),s=e.ref(t.text),l=e.ref(t.valid),r=e.ref(t.inValidTip);e.watch(()=>t.text,()=>{s.value=t.text}),e.watch(()=>t.required,(h,p)=>{h!==p&&(n.value=h)}),e.watch([()=>t.valid,()=>t.inValidTip],([h,p])=>{l.value=h,r.value=p});const i=e.computed(()=>l.value?s.value:r.value),c=e.computed(()=>l.value?"":"color:red"),g=e.computed(()=>({"col-form-label":!0,"f-width-auto":n.value&&(t.showType==="none"||!s.value)})),f=e.computed(()=>t.showType==="force-none"?!1:t.showType==="reserve-space"||n.value||!!s.value&&t.showType!=="none");return()=>f.value&&e.createVNode("label",{class:g.value,title:i.value,style:c.value,onClick:()=>o.emit("clickLabel")},[!l.value&&e.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:r.value},null),e.createVNode("span",{class:"farris-label-text"},[n.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),t.showType==="visible"&&s.value])])}}),{globalStorageKey:tr}=Ne.useThirdComponent(),H={},R={},_={},U={};async function nr(){{const t={schemaMap:Ce.schemaMap,propertyConfigSchemaMap:Ce.propertyConfigSchemaMap,propertyEffectMap:Ce.propertyEffectMap,schemaResolverMap:Ce.schemaResolverMap};zt.register(H,R,_,U),At.register(H,R,_,U),Ht.register(H,R,_,U),Rt.register(H,R,_,U),_t.register(H,R,_,U,t),$t.register(H,R,_,U),xt.register(H,R,_,U,t),gt.register(H,R,_,U,t),xt.register(H,R,_,U,t),gt.register(H,R,_,U,t),Ut.register(H,R,_,U,t),fo.register(H,R,_,U),Wt.register(H,R,_,U),Yt.register(H,R,_,U,t),Gt.register(H,R,_,U),Xt.register(H,R,_,U,t),Kt.register(H,R,_,U,t),Jt.register(H,R,_,U),Qt.register(H,R,_,U,t),mo.register(H,R,_,U),xo.register(H,R,_,U),Zt.register(H,R,_,U),po.register(H,R,_,U),yo.register(H,R,_,U),tn.register(H,R,_,U),nn.register(H,R,_,U,t),on.register(H,R,_,U,t),an.register(H,R,_,U,t),rn.register(H,R,_,U),ln.register(H,R,_,U,t),go.register(H,R,_,U),sn.register(H,R,_,U),cn.register(H,R,_,U),un.register(H,R,_,U,t),dn.register(H,R,_,U),fn.register(H,R,_,U,t),mn.register(H,R,_,U),pn.register(H,R,_,U),gn.register(H,R,_,U),vn.register(H,R,_,U,t),hn.register(H,R,_,U,t),yn.register(H,R,_,U),bn.register(H,R,_,U,t),wn.register(H,R,_,U),Cn.register(H,R,_,U),vo.register(H,R,_),Sn.register(H,R,_,U),xn.register(H,R,_,U,t),Tn.register(H,R,_,U),Dn.register(H,R,_,U),Nn.register(H,R,_,U),jn.register(H,R,_,U,t),Co.register(H,R,_,U),Bn.register(H,R,_,U,t),Mn.register(H,R,_,U),Vn.register(H,R,_,U),En.register(H,R,_,U,t),In.register(H,R,_,U),Fn.register(H,R,_,U),On.register(H,R,_,U),kn.register(H,R,_,U),Pn.register(H,R,_,U),Ln.register(H,R,_,U,t),qn.register(H,R,_,U),en.register(H,R,_,U),ho.register(H,R,_,U),An.register(H,R,_,U,t),bo.register(H,R,_,U),zn.register(H,R,_,U),wo.register(H,R,_,U),So.register(H,R,_,U),To.register(H,R,_,U),Hn.register(H,R,_,U,t),Do.register(H,R,_,U),No.register(H,R,_,U),Rn.register(H,R,_,U),_n.register(H,R,_,U,t),$n.register(H,R,_,U,t),Un.register(H,R,_,U),Wn.register(H,R,_,U);const o=window[tr];if(o)for(const n in o)o[n].createPropsResolver=Ce.createPropsResolver,o[n].register(H,R,_)}}function or(){nr();function t(i){const c=H[i];if(!c)throw new Error(`Could not find the editor of type '${i}'`);return c}function o(i,c){const g=R[i];return g?g(c):{}}function n(i){switch(i){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function s(i){switch(i){case"combo-list":case"input-group":case"textarea":return"onClear"}}function l(i){switch(i){case"input-group":case"textarea":return"onMousedownEvent"}}function r(i){switch(i){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:o,resolveEditorType:t,getChangeFunctionName:n,getClearFunctionName:s,getMousedownFunctionName:l,getMouseupFunctionName:r}}const rr={errors:{type:Object,default:null}},ar=e.defineComponent({name:"FValidationMessage",props:rr,emits:[],setup(t,o){const n=e.ref(t.errors);e.watch(()=>t.errors,r=>{n.value=r});const s=e.ref(!0),l=e.computed(()=>{if(n.value){const r=Object.keys(n.value).map(i=>{var c;return(c=n.value[i])==null?void 0:c.name});return r.length?r.join(" "):""}return""});return()=>l.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>s.value=!s.value},[!s.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),s.value&&e.createVNode("span",{class:"f-feedback-message"},[l.value])])}}),Ct=e.defineComponent({name:"FDynamicFormGroup",props:Qo,emits:["change","update:modelValue","clickLabel"],setup(t,o){var k;const n=e.ref(t.id),s=e.ref(t.customClass),l=e.ref(t.editor),r=e.ref(t.label),i=e.ref(t.modelValue),c=e.ref(t.readonly),g=e.ref(((k=t.editor)==null?void 0:k.required)||t.required),f=e.ref(t.showLabel),h=e.ref(t.visible);e.ref(t.type);const p=e.ref(),O=e.ref(t.errors),a=Ne.isMobilePhone(),u=e.ref(t.editor.type||"input-group"),w=e.computed(()=>f.value?t.showLabelType:"none"),{resolveEditorProps:N,resolveEditorType:I,getChangeFunctionName:T,getClearFunctionName:M}=or(),m=e.computed(()=>{const F={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":c.value,"align-items-start":l.value.type==="textarea"||l.value.type==="rich-text-editor","form-group--in-mobile":a};return F["form-group--has-"+u.value]=!0,F}),d=e.computed(()=>{if(t.fill)return{maxWidth:"none"}});function y(F,A,x){i.value=A!==void 0?A:F,o.emit("update:modelValue",i.value),o.emit("change",i.value,{newValue:F,newModelValue:A,parameters:x})}function b(){o.emit("update:modelValue","")}function D(F){return(...A)=>{b(),typeof F=="function"&&F(...A)}}function S(F){return(A,x,W)=>{y(A,x,W),typeof F=="function"&&F(A,x,W)}}const B=e.computed(()=>{const F=l.value.type||"input-group",A=I(F),x=N(F,l.value),W=T(F),V=M(l.value.type);return V&&(x[V]=D(x[V])),W&&(x[W]=S(x[W])),(x.id==null||x.id==="")&&(x.id=n.value),F==="number-range"&&l.value.onBeginValueChange&&typeof l.value.onBeginValueChange=="function"?(l.value.onBeginValueChange&&typeof l.value.onBeginValueChange=="function"&&(x.onBeginValueChange=l.value.onBeginValueChange),l.value.onEndValueChange&&typeof l.value.onEndValueChange=="function"&&(x.onEndValueChange=l.value.onEndValueChange)):F==="lookup"&&l.value["onUpdate:idValue"]&&typeof l.value["onUpdate:idValue"]=="function"?(x["onUpdate:idValue"]=l.value["onUpdate:idValue"],x.id=n.value):F==="collection-property-editor"&&l.value.onSelectionChange&&typeof l.value.onSelectionChange=="function"?x.onSelectionChange=l.value.onSelectionChange:F==="property-editor"&&(x.onBeforeOpenVariables=l.value.onBeforeOpenVariables),()=>e.createVNode(A,e.mergeProps({ref:p},x,{modelValue:i.value,"onUpdate:modelValue":L=>i.value=L}),o.slots)});function v(){return e.createVNode(ar,{id:`${n.value}-validation-message`,errors:O.value},null)}e.watch([()=>t.id,()=>t.customClass,()=>t.editor,()=>t.label,()=>t.modelValue,()=>t.readonly,()=>t.required,()=>t.showLabel,()=>t.visible,()=>t.errors],([F,A,x,W,V,L,te,C,q,ne])=>{var ee;n.value=F,s.value=A,l.value=x,r.value=W,i.value=V,c.value=L,g.value=((ee=l.value)==null?void 0:ee.required)||te,f.value=C,h.value=q,O.value=ne});function z(F){o.emit("clickLabel",F)}return o.expose({editorRef:p}),()=>h.value&&e.createVNode("div",{id:`${n.value}-form-group`,class:s.value,style:t.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:d.value},[e.createVNode("div",{class:m.value},[e.createVNode(er,{id:`${n.value}-lable`,showType:w.value,required:g.value,text:r.value,title:r.value,onClickLabel:z},null),e.createVNode("div",{class:"farris-input-wrap"},[B.value(),v()]),t.enableTips&&e.createVNode(jo,{content:t.tipsContent},{default:()=>[e.createVNode("span",{class:"farris-label-tips ml-1"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])]})])])])}});Mt.install=t=>{t.component(Mt.name,Mt).component(Ct.name,Ct)};const ir=e.defineComponent({name:"FEntityBindingSelector",props:Ro,emits:["submit","cancel"],setup(t,o){const n=Uo(t),{entityColumns:s,entityTreeGridRef:l,entityDataSource:r,checkAndGetSelectedEntity:i,resolveEntityDataSource:c,entityTreeRowOption:g,initialSelectedEntity:f,isMainEntityInitialSelected:h}=n,p=Jn(t),{fieldColumns:O,resolveFieldDataSource:a,fieldDataSource:u,fieldTreeGridRef:w,fieldTreeRowOption:N,fieldSelectionOption:I,checkAndGetSelectedFields:T,currentComponentType:M}=p,m=new Nt;m.globalConfig={position:"top-center"};const d=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],y=e.ref(),b=e.ref(""),D=e.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),S=e.ref(0),B=e.ref(""),v=e.computed(()=>q=>({"f-utils-fill":!0,border:q!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":D.value[S.value].id!==q}));function z(){t.bindingEntityId&&(f!=null&&f.value)&&(b.value=f.value.name),t.componentType||(y.value=h.value?"response-form":"data-grid")}function k(){const q=i();q&&(a(q),w.value.updateDataSource(u.value))}e.onBeforeMount(()=>{t.steps&&(D.value=D.value.filter(q=>t.steps.includes(q.id))),B.value=D.value[0].id,c(),z()}),e.onMounted(()=>{var q,ne;l&&((q=f.value)!=null&&q.id)&&l.value.selectRowById((ne=f.value)==null?void 0:ne.id),D.value.length===1&&D.value[0].id==="selectFields"&&k()});function F(q){var ne;(ne=w==null?void 0:w.value)!=null&&ne.emptyCurrentRowId&&w.value.emptyCurrentRowId()}function A(){return e.createVNode(jt,{key:1,ref:l,fit:!0,data:r.value,idField:"id",columns:s.value,rowNumber:{enable:!1},"row-option":g,columnOption:{fitColumns:!0}},null)}function x(){return e.createVNode(jt,{key:2,ref:w,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:u.value,idField:"id",columns:O.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":N,selection:I},null)}function W(){const q={editable:!1,type:"combo-list",data:d,idField:"value",valueField:"value",textField:"name"},ne={type:"input-group",enableClear:!1};return e.createVNode("div",null,[e.createVNode("div",{class:"f-utils-fill"},[e.createVNode("div",{class:"f-section py-0"},[e.createVNode("div",{class:"f-section-header"},[e.createVNode("div",{class:"f-title"},[e.createVNode("h4",{class:"f-title-text"},[e.createTextVNode("组件信息")])])]),e.createVNode("div",{class:"f-section-content"},[e.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[e.createVNode(Ct,{label:"组件类型",customClass:"col-12",modelValue:y.value,"onUpdate:modelValue":ee=>y.value=ee,required:"true",editor:q,onChange:F},null),e.createVNode(Ct,{label:"组件标题",customClass:"col-12",modelValue:b.value,"onUpdate:modelValue":ee=>b.value=ee,required:"true",editor:ne},null)])])])])])}function V(){S.value--,B.value=D.value[S.value].id}function L(){var q;switch(B.value){case"selectEntity":{k();break}case"selectComponentType":{if(!y.value){m.warning("请先选择组件类型");return}if(!((q=b.value)!=null&&q.trim())){m.warning("请先填写组件标题");return}M.value=y.value,a(f.value),w.value.updateDataSource(u.value);break}}S.value++,B.value=D.value[S.value].id}function te(){o.emit("cancel")}function C(){var ee;const q=i(),ne=T();if(q){const Q={bindingType:"entity"};Q.bindingEntity=q,Q.bindTo=n.entityBindToMap.get(((ee=Q.bindingEntity)==null?void 0:ee.label)||""),Q.bindingEntityFields=ne,Q.entityTitle=b.value,o.emit("submit",{bindingContext:Q,componentType:y.value})}}return()=>{var q;return e.createVNode("div",{class:"h-100 d-flex flex-column"},[((q=D.value)==null?void 0:q.length)>1?e.createVNode(Ge,{steps:D,activeIndex:S,style:"align-self:center"},null):"",e.createVNode("div",{class:v.value("selectEntity"),style:"border-radius:10px;"},[A()]),e.createVNode("div",{class:v.value("selectComponentType"),style:"border-radius:10px;"},[W()]),e.createVNode("div",{class:v.value("selectFields"),style:"border-radius:10px;"},[x()]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{class:"btn btn-secondary",onClick:te},[e.createTextVNode("取消")]),S.value!==0?e.createVNode("button",{class:"btn btn-secondary",onClick:V},[e.createTextVNode("上一步")]):"",S.value!==D.value.length-1?e.createVNode("button",{class:"btn btn-primary",onClick:L},[e.createTextVNode("下一步")]):"",S.value===D.value.length-1?e.createVNode("button",{class:"btn btn-primary",onClick:C},[e.createTextVNode("确定")]):""])])}}}),ve={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:"标签页工具栏按钮"},"drawer-toolbar-item":{type:"drawer-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:"标签页工具栏"},"drawer-toolbar":{type:"drawer-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:"多语输入框"},image:{type:"image",name:"图像"},"discussion-editor":{type:"discussion-editor",name:"评论编辑区"},"discussion-list":{type:"discussion-list",name:"评论列表"},comment:{type:"comment",name:"评论区"},"rich-text-editor":{type:"rich-text-editor",name:"富文本",icon:"rich-text-box"},calendar:{type:"calendar",name:"日历",icon:"date-picker"},wizard:{type:"wizard",name:"向导",icon:"wizard"},"wizard-page":{type:"wizard-page",name:"向导页",icon:"wizard"},"wizard-page-detail":{type:"wizard-page-detail",name:"向导详情",icon:"wizard"}};function Zn(t){let o,n;function s(m,d,y){var D;const b={componentType:m.getAttribute("data-controltype")||"",componentFeature:m.getAttribute("data-feature")||"",componentCategory:m.getAttribute("data-category")||"",label:m.getAttribute("data-controlTypeName")||"",sourceType:m.getAttribute("data-sourceType")||"move",parentComponentInstance:y.componentInstance.value,sourceElement:m,sourceContainer:d,targetContainer:y,bindingSourceContext:null,bindingTargetId:m.getAttribute("data-fieldId")||""};return m.componentInstance&&(b.componentType=(D=m.componentInstance.value.schema)==null?void 0:D.type),b}function l(m){var b,D;const{bindingContext:d,componentType:y}=m;n.bindingSourceContext=d,y&&(n.componentType=y),(b=o==null?void 0:o.modalRef)!=null&&b.value.close&&((D=o==null?void 0:o.modalRef)==null||D.value.close())}function r(){var m,d;n.bindingSourceContext=void 0,(m=o==null?void 0:o.modalRef)!=null&&m.value.close&&((d=o==null?void 0:o.modalRef)==null||d.value.close())}function i(){const{componentType:m,bindingTargetId:d,parentComponentInstance:y}=n;let b=[];return m&&(m==="list-view"||m==="calendar"?b=["selectEntity"]:b=["selectEntity","selectFields"]),d&&(b=["selectComponentType","selectFields"]),()=>e.createVNode(e.Fragment,null,[e.createVNode(ir,{componentType:m,bindingEntityId:d,steps:b,designerHostService:t,targetComponentInstance:y,onSubmit:l,onCancel:r},{default:()=>[e.createTextVNode(" ")]}),e.createTextVNode(" ")])}function c(){return new Promise((m,d)=>{const{componentType:y}=n,b=y==="list-view"||y==="calendar";o=t.modalService.open({title:"选择绑定",width:b?550:800,height:b?400:600,fitContent:!1,showButtons:!1,render:i(),enableEsc:!1,rejectCallback:()=>{n.bindingSourceContext=void 0},closedCallback:()=>{m(n)},draggable:!0})})}function g(){var m,d;n.bindingSourceContext=void 0,(m=o==null?void 0:o.modalRef)!=null&&m.value.close&&((d=o==null?void 0:o.modalRef)==null||d.value.close())}function f(m){let d="",y="";return ve["field-set"]&&m.schema.type===ve["field-set"].type&&(d=m.schema.id,y=m.schema.title),{groupId:d,groupName:y}}function h(m){var B,v;if(!m||!m.selectedData||!m.bindingType)return;const{selectedData:d,bindingType:y}=m,{groupId:b,groupName:D}=f(n.parentComponentInstance),S={bindingType:"field"};if(y==="Form"){const z=d;S.entityFieldNode=z,S.designViewModelField=pe.merge({},z,{groupId:b,groupName:D}),n.bindingSourceContext=S}else{const z=d;S.variableFieldNode=pe.merge({},z,{groupId:b,groupName:D}),n.bindingSourceContext=S}(B=o==null?void 0:o.modalRef)!=null&&B.value.close&&((v=o==null?void 0:o.modalRef)==null||v.value.close())}function p(){var m,d;n.bindingSourceContext=null,(m=o==null?void 0:o.modalRef)!=null&&m.value.close&&((d=o==null?void 0:o.modalRef)==null||d.value.close())}function O(){const{parentComponentInstance:m}=n,y={viewModelId:t.formSchemaUtils.getViewModelIdByComponentId(m==null?void 0:m.belongedComponentId),designerHostService:t,disableOccupiedFields:!0,componentSchema:{editor:{type:n.componentType}}},b={enable:!1};return()=>e.createVNode(e.Fragment,null,[e.createVNode(en.FBindingSelectorContainer,{editorParams:y,showCustomFooter:!0,bindingType:b,onSubmit:h,onCancel:g,onSkip:p},{default:()=>[e.createTextVNode(" ")]}),e.createTextVNode(" ")])}function a(){return new Promise((m,d)=>{o=t.modalService.open({title:"选择绑定",width:800,height:600,fitContent:!1,showButtons:!1,render:O(),enableEsc:!1,rejectCallback:()=>{n.bindingSourceContext=void 0},closedCallback:()=>{m(n)},draggable:!0})})}function u(){const{formSchemaUtils:m}=t,d=n.parentComponentInstance.belongedComponentId,y=new Set,b=m.getFormSchema().module,D=b.components.find(z=>z.id===d),S=m.getViewModelById(D.viewModel);let B=D.componentType;const v=m.checkComponentExistInDrawer(D.id);return(B==="frame"||B==="table")&&(B="form"),b.viewmodels.forEach(z=>{if(!z.fields||z.fields.length===0)return;const k=b.components.find(x=>x.viewModel===z.id);let{componentType:F}=k;if((F==="frame"||F==="table")&&(F="form"),F!==B||z.bindTo!==S.bindTo)return;const A=m.checkComponentExistInDrawer(k.id);v&&A&&z.fields.forEach(x=>{y.add(x.id)}),!v&&!A&&z.fields.forEach(x=>{y.add(x.id)})}),y}function w(){const{bindingTargetId:m,parentComponentInstance:d}=n;if(!m){n.bindingSourceContext=void 0;return}if(u().has(m)){const b=new Bo.FNotifyService;b.globalConfig={position:"top-center"},b.warning("表单已经包含此字段,请勿重复添加"),n.bindingSourceContext=void 0;return}else{const b={bindingType:"field"},D=t.formSchemaUtils.getComponentById(d.belongedComponentId),S=t.schemaService.getFieldByIDAndVMID(m,D.viewModel),B=pe.merge({},S.schemaField);b.entityFieldNode=B;const{groupId:v,groupName:z}=f(n.parentComponentInstance);b.designViewModelField=pe.merge({},B,{groupId:v,groupName:z}),n.bindingSourceContext=b}}function N(){return n.bindingTargetId?w():a()}function I(){const{parentComponentInstance:m}=n,d=m.addNewChildComponentSchema(n,t);n.componentSchema=d}async function T(){const{componentCategory:m}=n;switch(m){case"input":{await N();break}case"dataCollection":{await c();break}}}async function M(m,d,y){return n=s(m,d,y),await T(),n.bindingSourceContext===void 0?null:(I(),n)}return{getComponentResolveContext:s,resolveComponentCreationContextByDrop:M}}function lr(t,o){let n;function s(a,u,w){var I,T;if(a.contains(u)||u.classList.contains("no-drop"))return!1;const N=!0;if(a.componentInstance&&a.componentInstance.value.getDragScopeElement){const M=a.componentInstance.value.getDragScopeElement();if(M&&!M.contains(u))return!1}if((T=(I=u.componentInstance)==null?void 0:I.value)!=null&&T.externalContainerId)return!1;if(u.componentInstance&&u.componentInstance.value.canAccepts){const m=Zn(t).getComponentResolveContext(a,w,u);return u.componentInstance.value.canAccepts(m)}return N}function l(a,u){const w=u.getBoundingClientRect(),N=a.getBoundingClientRect(),I=N.top>=w.top,T=N.top<w.bottom;return I&&T}function r(a,u){const w=a.querySelector(".dgComponentSelected");if(!(!w||u===0)&&l(w,a)){const N=w.querySelector(".component-btn-group");if(N){const I=N.querySelector("div");if(I&&I.style.top){const T=Number.parseFloat(I.style.top);I.style.top=T-u+"px"}}}}function i(a,u,w){let N=-1;if(!u)return-1;if(a.componentInstance.value.contents)if(w&&w.componentInstance){if(w.getAttribute("data-noattach"))N=Number(w.getAttribute("data-position"));else{const I=w.componentInstance.value.schema;let T={id:I.id};I.type==="component"&&(T={component:I.id}),N=pe.findIndex(a.componentInstance.value.contents,T),N=N===-1?0:N}N!==-1&&a.componentInstance.value.contents.splice(N,0,u)}else a.componentInstance.value.contents.push(u);return N}function c(a,u,w,N){Zn(t).resolveComponentCreationContextByDrop(a,w,u).then(T=>{if(!T)return;const M=T.componentSchema;M&&(o!=null&&o.appendIdentifyForNewControl&&o.appendIdentifyForNewControl(M),i(u,M,N))}),u.contains(a)&&u.removeChild(a)}function g(a,u,w,N){let I,T=-1;if(a.componentInstance&&a.componentInstance.value.triggerBelongedComponentToMoveWhenMoved){const d=a.componentInstance.value.getBelongedComponentInstance(a.componentInstance);d&&(a=e.ref(d.elementRef).value.parentElement,w=a.parentElement)}const M=a.componentInstance&&a.componentInstance.value.schema;let m={id:M&&M.id};(M==null?void 0:M.type)==="component"&&(m={component:M&&M.id}),T=pe.findIndex(w.componentInstance.value.contents,m),T!==-1&&w.componentInstance.value.contents&&(I=w.componentInstance.value.contents.splice(T,1),I=I[0]),i(u,I,N),w.componentInstance&&w.componentInstance.value.onChildElementMovedOut&&w.componentInstance.value.onChildElementMovedOut(a),u.componentInstance&&u.componentInstance.value.onAcceptMovedChildElement&&u.componentInstance.value.onAcceptMovedChildElement(a,w)}function f(a,u,w,N){if(!u||a.contains(u))return;switch(a.getAttribute("data-sourceType")){case"control":case"field":case"entity":{c(a,u,w,N);break}default:w.componentInstance.value.contents?g(a,u,w,N):u.contains(a)&&u.removeChild(a)}qe.value++}function h(a){n&&n.destroy(),Kn&&(n=Kn([],{mirrorContainer:a,direction:"mixed",revertOnSpill:!0,moves(u,w,N){let I=!0;return u.classList.contains("no-drag")&&(I=!1),u.componentInstance&&(I=!!N.getAttribute("data-dragging-icon")),I},copy(u){return u.classList.contains("drag-copy")},getMirrorText(u){return u.componentInstance&&u.componentInstance.value.getDraggingDisplayText?u.componentInstance.value.getDraggingDisplayText():u.innerText||"控件"},accepts(u,w,N){const I=s(u,w,N),T=a.lastElementChild;return I?T.className=T.className.replace("undroppable",""):T.className.includes("undroppable")||(T.className+=" undroppable"),I}}).on("over",(u,w)=>{w.className+=" drag-over"}).on("out",(u,w)=>{w.className=w.className.replace("drag-over","").replace(" ","")}).on("drop",(u,w,N,I)=>{f(u,w,N,I)}).on("dragend",(u,w)=>{r(a,w)}))}function p(a,u){if(!a)return;if(u.noDragDrop)return a;const w=a.querySelector(`[data-dragref='${u.id}-container']`)||a;n&&w&&n.containers.push(w)}function O(){return n}return{attachComponents:p,initializeDragula:h,getDragulaInstance:O}}const sr={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1}},K={},J={},Z={},{globalStorageKey:cr}=Ne.useThirdComponent();function ur(){{const t={schemaMap:Ce.schemaMapForDesigner,propertyConfigSchemaMap:Ce.propertyConfigSchemaMapForDesigner,propertyEffectMap:Ce.propertyEffectMapForDesigner,schemaResolverMap:Ce.schemaResolverMapForDesigner};zt.registerDesigner(K,J,Z,t),At.registerDesigner(K,J,Z,t),Ht.registerDesigner(K,J,Z,t),Rt.registerDesigner(K,J,Z,t),_t.registerDesigner(K,J,Z,t),$t.registerDesigner(K,J,Z,t),xt.registerDesigner(K,J,Z,t),gt.registerDesigner(K,J,Z,t),gt.registerDesigner(K,J,Z,t),Gt.registerDesigner(K,J,Z,t),Ut.registerDesigner(K,J,Z,t),Yt.registerDesigner(K,J,Z,t),Kt.registerDesigner(K,J,Z,t),Xt.registerDesigner(K,J,Z,t),Jt.registerDesigner(K,J,Z),Qt.registerDesigner(K,J,Z,t),Rn.registerDesigner(K,J,Z),Zt.registerDesigner(K,J,Z,t),tn.registerDesigner(K,J,Z,t),nn.registerDesigner(K,J,Z,t),on.registerDesigner(K,J,Z,t),an.registerDesigner(K,J,Z,t),rn.registerDesigner(K,J,Z),sn.registerDesigner(K,J,Z),ln.registerDesigner(K,J,Z,t),_n.registerDesigner(K,J,Z,t),cn.registerDesigner(K,J,Z,t),un.registerDesigner(K,J,Z,t),dn.registerDesigner(K,J,Z),fn.registerDesigner(K,J,Z,t),mn.registerDesigner(K,J,Z),pn.registerDesigner(K,J,Z,t),gn.registerDesigner(K,J,Z,t),vn.registerDesigner(K,J,Z,t),hn.registerDesigner(K,J,Z,t),bn.registerDesigner(K,J,Z,t),wn.registerDesigner(K,J,Z,t),Cn.registerDesigner(K,J,Z,t),yn.registerDesigner(K,J,Z,t),Sn.registerDesigner(K,J,Z,t),xn.registerDesigner(K,J,Z,t),Tn.registerDesigner(K,J,Z),Dn.registerDesigner(K,J,Z,t),Nn.registerDesigner(K,J,Z,t),jn.registerDesigner(K,J,Z,t),Bn.registerDesigner(K,J,Z,t),Mn.registerDesigner(K,J,Z,t),Vn.registerDesigner(K,J,Z),En.registerDesigner(K,J,Z,t),In.registerDesigner(K,J,Z,t),Fn.registerDesigner(K,J,Z,t),kn.registerDesigner(K,J,Z,t),On.registerDesigner(K,J,Z),Wt.registerDesigner(K,J),Pn.registerDesigner(K,J,Z),Ln.registerDesigner(K,J,Z),qn.registerDesigner(K,J,Z),An.registerDesigner(K,J,Z,t),zn.registerDesigner(K,J,Z),Hn.registerDesigner(K,J,Z,t),$n.registerDesigner(K,J,Z),Un.registerDesigner(K,J,Z),Mo.registerDesigner(K,J,Z),Wn.registerDesigner(K,J,Z);const o=window[cr];if(o)for(const n in o)o[n].createPropsResolver=Ce.createPropsResolver,o[n].registerDesigner(K,J,Z)}}function dr(t){const o={schemaMap:Ce.schemaMapForDesigner,propertyConfigSchemaMap:Ce.propertyConfigSchemaMapForDesigner,propertyEffectMap:Ce.propertyEffectMapForDesigner,schemaResolverMap:Ce.schemaResolverMapForDesigner};t.forEach(n=>{n.registerDesigner&&n.registerDesigner(K,J,Z,o)})}const fr={id:{type:String}},mr=e.defineComponent({name:"FDesignerPlaceholder",props:fr,emits:[],setup(t){const o=e.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),n=e.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>e.createVNode("div",{class:o.value,style:n.value,role:"alert","data-noattach":"true","data-position":"0"},[e.createTextVNode("拖拽组件到这里")])}});function pr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const bt=e.defineComponent({name:"FDesignerItem",props:sr,emits:["selectionChange","dragEnd"],setup(t,o){const n=e.ref(`${t.modelValue.id}-component`),s=e.ref(t.canMove),l=e.ref(t.canDelete),r=e.ref(!1),i=e.ref(t.modelValue),c=e.ref(t.componentId||""),g=e.ref(""),f=e.ref(""),h=e.ref(t.customClass),p=e.ref(),O=e.inject("canvas-dragula"),a=e.ref(),u=e.inject("design-item-context");function w(C){C&&Object.assign(i.value,C)}const N={designerItemElementRef:p,componentInstance:a,schema:i.value,parent:u,setupContext:o,updateContextSchema:w};e.provide("design-item-context",N);const I=e.inject("useFormSchema"),T=e.inject("designer-host-service"),M=e.inject("external-container-id"),m=e.computed(()=>{var Q,le,ce;const C=(Q=a.value)!=null&&Q.shouldApplyClassToComponent?(le=a.value)==null?void 0:le.shouldApplyClassToComponent():!0,q=t.modelValue.appearance&&t.modelValue.appearance.class||"",ne=((ce=a.value)==null?void 0:ce.getCustomButtons)&&a.value.getCustomButtons();let ee={"farris-component":!0,"flex-fill":i.value.id==="root-component","position-relative":s.value&&l.value||(ne==null?void 0:ne.length),"farris-nested":r.value,"can-move":s.value,"d-none":p.value&&p.value.classList.contains("d-none"),dgComponentSelected:p.value&&p.value.classList.contains("dgComponentSelected"),dgComponentFocused:p.value&&p.value.classList.contains("dgComponentFocused")};return ee[`farris-component-${i.value.type}`]=!0,ee=C?Ne.getCustomClass(ee,q):ee,ee=Ne.getCustomClass(ee,f.value),ee=Ne.getCustomClass(ee,h.value),ee}),d=e.computed(()=>{var ee,Q;const C={},q=(ee=a.value)!=null&&ee.shouldApplyClassToComponent?(Q=a.value)==null?void 0:Q.shouldApplyClassToComponent():!0,ne=t.modelValue.appearance&&t.modelValue.appearance.style||"";return ne&&q&&ne.split(";").reduce((le,ce)=>{const[ae,X]=ce.split(":");return le[ae]=X,le},C),g.value&&g.value.split(";").reduce((le,ce)=>{const[ae,X]=ce.split(":");return ae&&(le[ae]=X),le},C),C});function y(C,q){var Q,le,ce;if(C&&(C.preventDefault(),C.stopPropagation()),(Q=T==null?void 0:T.designerContext)!=null&&Q.checkCanDeleteControl&&!T.designerContext.checkCanDeleteControl(q))return;if(a.value.triggerBelongedComponentToDeleteWhenDeleted){const ae=a.value.getBelongedComponentInstance(a);if(ae&&ae.parent){const X=e.ref(ae==null?void 0:ae.parent),de=X.value.contents.findIndex(Ae=>Ae.id===ae.schema.id);(ce=(le=X.value)==null?void 0:le.contents)==null||ce.splice(de,1),qe.value++}return}a.value.onRemoveComponent(T);let ne=u,ee=ae=>ae.id===q.id;if(q.type==="component"&&(ne=u==null?void 0:u.parent,ee=ae=>ae.component===q.id),ne&&ne.schema.contents){const ae=ne.schema.contents.findIndex(ee);ne.schema.contents.splice(ae,1),qe.value++,o.emit("selectionChange")}}function b(C){return l.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:q=>{y(q,C)}},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function D(){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function S(){var q;const C=((q=a.value)==null?void 0:q.getCustomButtons)&&a.value.getCustomButtons();return C&&!!C.length&&C.map(ne=>e.createVNode("div",{role:"button",class:`btn component-settings-button ${ne.class||""}`,title:ne.title,ref:ne.id,onClick:ee=>ne.onClick&&ne.onClick(ee)},[e.createVNode("i",{class:ne.icon},null)]))}function B(C){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[b(C),D(),S()])])}function v(C,q,ne,ee){o.emit("selectionChange",C,q,ne,ee)}function z(){o.emit("dragEnd")}function k(){return e.createVNode("div",{class:"no-drag w-100","data-noattach":"true","data-position":"0",style:"height: 60px; display: flex; justify-content: center; align-items: center; margin: 0px; border-radius: 3px; color: #2d2f33; background-color: #d4d6d9;"},[e.createTextVNode("未识别的组件")])}function F(C){let q;const ne=C.type,ee=K[ne],Q=J[ne],le=Q?Q(C):{};le.customClass=t.ignore?le.customClass:"",le.customStyle=t.ignore?le.customStyle:"",le.componentId=c.value,le.id=C.id;const ce=C.contents&&C.contents.length===0;return C.contents&&!!C.contents.length&&ee?e.createVNode(ee,e.mergeProps({ref:a},le),pr(q=C.contents.map(X=>e.createVNode(bt,{key:X.id,modelValue:X,"onUpdate:modelValue":de=>X=de,componentId:c.value,onSelectionChange:v,onDragEnd:z},null)))?q:{default:()=>[q]}):ee?ce?e.createVNode(ee,e.mergeProps({ref:a},le),{default:()=>[e.createVNode(mr,null,null)]}):e.createVNode(ee,e.mergeProps({ref:a},le),null):k()}function A(){const C=I.externalFormSchema.get(M);if(C!=null&&C.content)return C==null?void 0:C.content}function x(C){if(C.type==="component-ref"){const ee=(M?A():I==null?void 0:I.getFormSchema()).module.components.find(le=>le.id===C.component),Q=e.ref(ee);if(ee)return e.createVNode(bt,{key:ee.id,modelValue:Q.value,"onUpdate:modelValue":le=>Q.value=le,componentId:ee.id,onSelectionChange:v,onDragEnd:z},null)}}e.watch([()=>t.modelValue,()=>t.componentId],([C,q])=>{i.value=C,n.value=`${C.id}-component`,q&&(c.value=q),e.triggerRef(p)},{deep:!0});function W(C){window.scrollContainerList||(window.scrollContainerList=new Set);const q=C.getAttribute("id");q&&(window.scrollContainerList.add(q),C.componentInstance.value&&(C.componentInstance.value.scrollElementId=q))}function V(C){const q=C==null?void 0:C.target;W(q),it(q)}function L(){var C,q;if(p.value){(q=(C=i.value)==null?void 0:C.contents)!=null&&q.length&&p.value.addEventListener("scroll",V);const ne=p.value.querySelector(".drag-container");ne&&ne.addEventListener("scroll",V)}}e.onMounted(()=>{if(p.value&&a.value&&a.value.schema){const C=p.value.querySelector(`[data-dragref='${a.value.schema.id}-container']`);O&&C&&O.attachComponents(C,i.value),r.value=a.value.canNested!==void 0?a.value.canNested:r.value,l.value=a.value.canDelete!==void 0?a.value.canDelete:l.value,s.value=a.value.canMove!==void 0?a.value.canMove:s.value,g.value=a.value.styles||"",f.value=a.value.designerClass||"",p.value&&(p.value.componentInstance=a,p.value.designItemContext=N),a.value.belongedComponentId=c.value,a.value.setComponentBasicInfoMap(T),a.value.externalContainerId=M}L(),qe.value++}),e.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",V)});function te(C){var ee;if(C&&(C.preventDefault(),C.stopPropagation()),M){const Q=document.getElementById(`${M}-design-item`);Q&&Q.click();return}let q=N.designerItemElementRef;const ne=p.value;if(ne){const Q=document.getElementsByClassName("dgComponentFocused");Q&&Q.length===1&&Q[0]===p.value||(Array.from(Q).forEach(ce=>ce.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(ce=>ce.classList.remove("dgComponentSelected")),ne.classList.add("dgComponentFocused"),o.emit("selectionChange",i.value.type,i.value,c.value,a.value))}(ee=a.value)!=null&&ee.getDraggableDesignItemElement&&(q=a.value.getDraggableDesignItemElement(N)),q!=null&&q.value&&q.value.classList.add("dgComponentSelected"),vt(q==null?void 0:q.value)}return()=>{const C=M?`${M}-`:"";return i.value.type==="component-ref"?x(i.value):e.createVNode("div",{id:`${C}${i.value.id}-design-item`,ref:p,class:m.value,style:d.value,onClick:te},[B(i.value),F(i.value)])}}}),gr={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},showFloatingClose:{type:Boolean,default:!1},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},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}};class he{constructor(o,n){this.x=o,this.y=n}static getTransformInfo(o){const s=window.getComputedStyle(o).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(s.length>=6){const l=parseInt(s[4],10),r=parseInt(s[5],10);return{x:l,y:r}}return{x:0,y:0}}static fromEvent(o,n=null){if(this.isMouseEvent(o))return new he(o.clientX,o.clientY);if(n===null||o.changedTouches.length===1)return new he(o.changedTouches[0].clientX,o.changedTouches[0].clientY);for(let s=0;s<o.changedTouches.length;s++)if(o.changedTouches[s].target===n)return new he(o.changedTouches[s].clientX,o.changedTouches[s].clientY)}static isMouseEvent(o){return Object.prototype.toString.apply(o).indexOf("MouseEvent")===8}static isIPosition(o){return!!o&&"x"in o&&"y"in o}static getCurrent(o){const n=new he(0,0);if(window){const s=window.getComputedStyle(o);if(s){const l=parseInt(s.getPropertyValue("left"),10),r=parseInt(s.getPropertyValue("top"),10);n.x=isNaN(l)?0:l,n.y=isNaN(r)?0:r}return n}return null}static copy(o){return new he(0,0).set(o)}get value(){return{x:this.x,y:this.y}}add(o){return this.x+=o.x,this.y+=o.y,this}subtract(o){return this.x-=o.x,this.y-=o.y,this}multiply(o){this.x*=o,this.y*=o}divide(o){this.x/=o,this.y/=o}reset(){return this.x=0,this.y=0,this}set(o){return this.x=o.x,this.y=o.y,this}}class Ye{constructor(o,n){this.width=o,this.height=n}static getCurrent(o){const n=new Ye(0,0);if(window){const s=window.getComputedStyle(o);return s&&(n.width=parseInt(s.getPropertyValue("width"),10),n.height=parseInt(s.getPropertyValue("height"),10)),n}return null}static copy(o){return new Ye(0,0).set(o)}set(o){return this.width=o.width,this.height=o.height,this}}function vr(t,o){const n=e.ref(),s=e.ref(),l=e.ref(),r=e.ref(),i=e.ref(),c=e.ref(),g=e.ref(),f=e.ref(),h=e.ref(),p=e.ref(),O=e.ref(),a=e.ref(t.resizeable),u=e.ref(),w=e.ref(t.draggable),N=e.ref(!1);function I(){const V=s.value||document.body,L=window.getComputedStyle(V);if(!L||!n.value)return;const te=he.getTransformInfo(n.value),C={};g.value&&(C.deltaL=n.value.offsetLeft-g.value.x,C.deltaT=n.value.offsetTop-g.value.y);const q=L.getPropertyValue("position");C.width=V.clientWidth,C.height=V.clientHeight,C.pr=parseInt(L.getPropertyValue("padding-right"),10),C.pb=parseInt(L.getPropertyValue("padding-bottom"),10),C.position=L.getPropertyValue("position"),q==="static"&&(V.style.position="relative"),C.translateX=te.x,C.translateY=te.y,p.value=C}function T(V){if(n.value){r.value=Ye.getCurrent(n.value),i.value=he.getCurrent(n.value),c.value=r.value?Ye.copy(r.value):null,g.value=i.value?he.copy(i.value):null,I();const L=V.target.getAttribute("type")||"";f.value={n:!!L.match(/n/),s:!!L.match(/s/),w:!!L.match(/w/),e:!!L.match(/e/)}}}function M(){var V,L,te,C;if(n.value){const q=n.value;f.value&&((f.value.n||f.value.s)&&((V=c.value)!=null&&V.height)&&(q.style.height=c.value.height+"px"),(f.value.w||f.value.e)&&((L=c.value)!=null&&L.width)&&(q.style.width=c.value.width+"px"),g.value&&((te=g.value)!=null&&te.x&&(q.style.left=g.value.x+"px"),(C=g.value)!=null&&C.y&&(q.style.top=g.value.y+"px")))}}function m(){const V=t.minHeight?t.minHeight:1,L=t.minWidth?t.minWidth:1;c.value&&g.value&&f.value&&r.value&&(c.value.height<V&&(c.value.height=V,f.value.n&&i.value&&(g.value.y=i.value.y+(r.value.height-V))),c.value.width<L&&(c.value.width=L,f.value.w&&i.value&&(g.value.x=i.value.x+(r.value.width-L))),t.maxHeight&&c.value.height>t.maxHeight&&(c.value.height=t.maxHeight,i.value&&f.value.n&&(g.value.y=i.value.y+(r.value.height-t.maxHeight))),t.maxWidth&&c.value.width>t.maxWidth&&(c.value.width=t.maxWidth,f.value.w&&i.value&&(g.value.x=i.value.x+(r.value.width-t.maxWidth))))}function d(){if(s.value){const V=p.value;if(g.value&&c.value&&f.value&&r.value){const L=V.width-V.pr-V.deltaL-V.translateX-g.value.x,te=V.height-V.pb-V.deltaT-V.translateY-g.value.y;f.value.n&&g.value.y+V.translateY<0&&i.value&&(g.value.y=-V.translateY,c.value.height=r.value.height+i.value.y+V.translateY),f.value.w&&g.value.x+V.translateX<0&&i.value&&(g.value.x=-V.translateX,c.value.width=r.value.width+i.value.x+V.translateX),c.value.width>L&&(c.value.width=L),c.value.height>te&&(c.value.height=te)}}}function y(V){if(!l.value||!r.value||!i.value||!f.value)return;V.subtract(l.value);const L=V.x,te=V.y;f.value.n?(g.value.y=i.value.y+te,c.value.height=r.value.height-te):f.value.s&&(c.value.height=r.value.height+te),f.value.e?c.value.width=r.value.width+L:f.value.w&&(c.value.width=r.value.width-L,g.value.x=i.value.x+L),d(),m(),M()}function b(V){if(!h.value)return;const L=he.fromEvent(V);L&&y(L)}function D(){if(n.value){const{width:V,height:L,x:te,y:C}=n.value.getBoundingClientRect(),q=he.getTransformInfo(n.value);return{size:{width:V,height:L},position:{x:te-q.x,y:C-q.y}}}return null}function S(V){if(n.value){const L=D();O.value=L}l.value=void 0,r.value=null,i.value=null,c.value=null,g.value=null,f.value=null,h.value=null,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S)}function B(){document.addEventListener("mousemove",b),document.addEventListener("mouseup",S)}function v(V){V instanceof MouseEvent&&V.button===2||w.value&&(document.body.click(),V.stopPropagation(),V.preventDefault(),l.value=he.fromEvent(V),h.value=V.target,T(V),B())}function z(V){return n.value=V,a.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:L=>v(L)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:L=>v(L)},null)])}function k(V=!0){document.body.click();const L=s.value||document.body,te=Ye.getCurrent(L),C=n.value;V&&C&&(u.value=D(),u.value.transform=C.style.transform),te&&C&&(c.value=te,c.value.height-=14,c.value.width-=14,C.style.height=c.value.height+"px",C.style.width=c.value.width+"px",C.style.left="7px",C.style.top="7px",C.style.transform="",O.value={size:c.value,position:{x:0,y:0}},w.value=!1,N.value=!0)}function F(){var V,L;if(document.body.click(),u.value){const te={width:u.value.size.width||0,height:u.value.size.height||0},C={x:(window.innerWidth-te.width)/2,y:(window.innerHeight-te.height)/2};(V=c.value)==null||V.set(te),(L=g.value)==null||L.set(C);const q=n.value;q.style.height=te.height+"px",q.style.width=te.width+"px",q.style.left=`${C.x}px`,q.style.top=`${C.y}px`,q.style.transform="",O.value={size:te,position:C},w.value=t.draggable,N.value=!1}}function A(){if(n.value){const V=Ye.getCurrent(n.value);if(V){const{width:L,height:te}=V;n.value.style.left=`${(window.innerWidth-L)/2}px`,n.value.style.top=`${(window.innerHeight-te)/2}px`,n.value.style.transform=""}}}function x(){const V=()=>{N.value?k(!1):A(),document.body.click()};return window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}}const W=x();return{renderResizeBar:z,boundingElement:s,resizedEventParam:O,maximize:k,restore:F,allowDrag:w,isMaximized:N,unWindowResizeHandle:W,moveToCenter:A}}function hr(t,o,n){const s=e.ref(),l=e.ref(t.draggable),r=e.ref(t.lockAxis),i=e.ref(),c=e.ref(),g=e.ref(!1),f=e.ref(new he(0,0)),h=e.ref(new he(0,0)),p=e.ref(new he(0,0)),O=e.ref(new he(0,0));e.watch(()=>n.value,b=>{i.value.style.cursor=b?"move":"default"});function a(b,D){if(D.tagName==="BUTTON")return!1;if(D===b)return!0;for(const S in D.children)if(Object.prototype.hasOwnProperty.call(D.children,S)&&a(b,D.children[S]))return!0;return!1}function u(){var B,v;let b=p.value.x+h.value.x,D=p.value.y+h.value.y;r.value==="x"?(b=((B=f.value)==null?void 0:B.x)||0,p.value.x=0):r.value==="y"&&(D=((v=f.value)==null?void 0:v.y)||0,p.value.y=0);const S=`translate3d(${Math.round(b)}px, ${Math.round(D)}px, 0px)`;s.value&&(s.value.style.transform=S),O.value.x=b,O.value.y=D}function w(){if(!c.value||!s.value)return null;const b=c.value.getBoundingClientRect(),D=s.value.getBoundingClientRect(),S={top:b.top<D.top,right:b.right>D.right,bottom:b.bottom>D.bottom,left:b.left<D.left};return S.top||(p.value.y-=D.top-b.top),S.bottom||(p.value.y-=D.bottom-b.bottom),S.right||(p.value.x-=D.right-b.right),S.left||(p.value.x-=D.left-b.left),u(),S}function N(b){b&&(f.value&&b.subtract(f.value),p.value.set(b),u(),w())}function I(b){g.value&&l.value&&(b.stopPropagation(),b.preventDefault(),N(he.fromEvent(b,i.value)))}function T(){var b;g.value&&(g.value=!1,h.value.add(p.value),p.value.reset(),(b=s.value)==null||b.classList.remove("ng-dragging"),o.emit("stopMove"),document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",T))}function M(){!g.value&&i.value&&(g.value=!0,i.value.classList.add("ng-dragging"),document.addEventListener("mousemove",I),document.addEventListener("mouseup",T))}function m(){if(s.value){const b=he.getTransformInfo(s.value);h.value.set(b);return}h.value.reset()}function d(b){if(!n.value||b instanceof MouseEvent&&b.button===2)return;const D=b.target||b.srcElement;i.value!==void 0&&D&&!a(D,i.value)||l.value!==!1&&(document.body.click(),b.stopPropagation(),b.preventDefault(),f.value=he.fromEvent(b,s.value),m(),M())}function y(b,D,S){if(l.value&&D){if(b)i.value=b;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)i.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const B=D.querySelector(t.dragHandle);B&&(i.value=B)}}s.value=D,c.value=S,i.value?(i.value.classList.add("ng-draggable"),i.value.addEventListener("mousedown",d)):l.value=!1}}return{registerDraggle:y,resetTranslate:m}}function eo(t,o){if(t){const n=s=>{s.key.toLowerCase()===t.toLowerCase()&&o({event:s,key:t})};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}}function yr(t,o){const n=e.ref(t.enableEsc);let s=null;return n.value?(s=eo("Escape",l=>{o.emit("esc",{event:l.event,type:"esc"})}),{remove:s}):null}function Cr(t,o){const n=e.ref(t.enableEnter);let s=null;return n.value?(s=eo("Enter",l=>{o.emit("enter",{event:l.event,type:"enter"})}),{remove:s}):null}const lt=e.defineComponent({name:"FModal",props:gr,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(t,o){const n=e.ref(t.width||300),s=e.ref(t.height||200),l=e.ref(t.modelValue),r=e.ref(""),i=e.ref(t.class),c=e.ref(t.fitContent),g=e.ref(t.showHeader),f=e.ref(""),h=e.ref(t.showCloseButton),p=e.ref(t.showMaxButton),O=e.ref(!1),a=e.ref(t.dialogType),u=e.ref(t.src),w=e.ref(""),N=e.ref(t.showButtons),I=e.ref(t.title),T=e.ref(t.containment||null),M=e.ref();I.value==="错误提示"&&(I.value=Le.LocaleService.getLocaleValue("messageBox.errorTitle"));const m=e.ref(!1);function d(P,ie){const ge=ie?"accept":"cancel";Promise.resolve().then(()=>{var me;return(me=t.beforeClose)==null?void 0:me.call(t,{closeType:ge})}).then(me=>{me&&(l.value=!1,o.emit("update:modelValue",!1),ie!=null&&o.emit(ie?"accept":"cancel"),o.emit("closed",P))})}const y=[{name:"cancel",text:Le.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:P=>{d(P,!1)}},{name:"accept",text:Le.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:P=>{d(P,!0)}}],b=e.ref(t.buttons&&t.buttons.length?t.buttons:y),D=e.computed(()=>!!f.value),S=e.computed(()=>!!N.value&&!!b.value),B=e.ref(),v=e.ref(),z=e.ref(!1),{renderResizeBar:k,maximize:F,restore:A,boundingElement:x,resizedEventParam:W,allowDrag:V,unWindowResizeHandle:L,moveToCenter:te}=vr(t),{registerDraggle:C}=hr(t,o,V);function q(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ne(){const P=document.querySelectorAll(".farris-modal").length;(!P||P-1<=0)&&document.body.classList.remove("modal-open"),M.value&&M.value.classList.remove("show")}e.watch(()=>t.title,(P,ie)=>{P!==ie&&(I.value=P)}),e.watch(()=>t.modelValue,(P,ie)=>{P!==ie&&(l.value=P,l.value&&t.draggable&&e.nextTick(()=>{v.value&&!T.value&&(T.value=v.value.parentElement,x.value=T.value,C(B.value,v.value,x.value),te())}),P||(T.value&&(T.value=null),ne())),l.value?m.value=q():(z.value=!1,V.value=t.draggable)}),e.watch(()=>t.showHeader,(P,ie)=>{P!==ie&&(g.value=P)}),e.watch(()=>t.showButtons,(P,ie)=>{P!==ie&&(N.value=P)}),e.watch(()=>W.value,(P,ie)=>{const ge=P||{},me=ie||{};JSON.stringify(ge)!==JSON.stringify(me)&&o.emit("resize",{newSize:P,oldSize:ie,isMaximized:z.value})}),e.watch([()=>t.width,()=>t.height],(P,ie)=>{(P[0]!==ie[0]||P[1]!==ie[1])&&(n.value=P[0]||500,s.value=P[1]||600)}),e.watch(()=>t.class,(P,ie)=>{i.value=P});const ee=e.computed(()=>(l.value&&document.body.classList.add("modal-open"),l.value)),Q=e.computed(()=>{var ge;const P={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!t.showFloatingClose};P["f-modal-fitContent"]=!!c.value,P.show=!!ee.value;const ie=(ge=t.maskClass)==null?void 0:ge.split(" ");return ie==null||ie.reduce((me,Ve)=>(me[Ve]=!0,me),P),P}),le=e.computed(()=>{var ge;const P={"modal-dialog":!0},ie=(ge=i.value)==null?void 0:ge.split(" ");return ie==null||ie.reduce((me,Ve)=>(me[Ve]=!0,me),P),P}),ce=()=>Ne.isMobilePhone()&&!t.isMessager||!!t.fullscreen,ae=e.computed(()=>{const P=document.documentElement.clientWidth,ie=document.documentElement.clientHeight,ge=Math.min(n.value,P),me=t.position==="right"?"100%":c.value?"auto":`${Math.min(s.value,ie-10)}px`,Ve=`${(window.innerHeight-(me==="100%"||me==="auto"?0:parseInt(me)))/2}px`,ut=t.position==="right"?`${window.innerWidth-ge}px`:`${(window.innerWidth-ge)/2}px`,at={position:"absolute",top:Ve,left:ut,width:`${ge}px`,height:me};return t.mask||(at.pointerEvents="auto"),at}),X=e.ref(Ne.getMaxZIndex()||1050),de=e.computed(()=>{const P={display:"block",overflow:"hidden"};return t.mask||(P.pointerEvents="none",P.backgroundColor="transparent"),m.value&&(P.backgroundColor="transparent"),P.zIndex=X.value,P}),Ae=e.computed(()=>({"modal-content":!0,"modal-content-has-header":g.value,"is-mobile":ce()})),Re=e.computed(()=>{const P={display:g.value?"":"none"};return P["pointer-events"]=V.value?"auto":"none",P}),Ie=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:z.value})),et=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":a.value==="iframe","f-utils-fill":!0}));function Xe(){return{height:`${t.footerHeight||60}px`}}const tt=e.computed(()=>{const P={textAlgin:w.value},ie=Xe();return Object.assign(P,ie)});function ye(P){if(P==null||P.stopPropagation(),z.value){z.value=!1,A();return}F(),z.value=!0}async function st(P,ie){P.handle?await P.handle(ie,P)&&o.emit("closed",ie):(typeof P.onClick=="string"&&(P.onButtonClick=pe.cloneDeep(P.onClick||""),delete P.onClick),o.emit("buttonClick",{button:P,$event:ie}))}function _e(P){P.width&&(n.value=P.width),P.height&&(s.value=P.height),P.buttons&&(b.value=P.buttons),P.title&&(I.value=P.title)}let $e=null,Fe=null;e.onBeforeMount(()=>{m.value=q()}),e.onMounted(()=>{v.value&&!T.value&&(T.value=v.value.parentElement,x.value=T.value,C(B.value,v.value,x.value)),ee.value&&document.body.classList.add("modal-open"),$e=yr(t,o),Fe=Cr(t,o)}),e.onUnmounted(()=>{L&&L(),$e&&$e.remove(),Fe&&Fe.remove()}),o.expose({modalElementRef:v,updateModalOptions:_e,close:d,maxDialog:ye,isMaximized:z});function Ue(){return e.createVNode("div",{class:"action-wrapper",onClick:P=>d(P,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function ct(){return e.createVNode("ul",null,[O.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),p.value&&e.createVNode("li",{onClick:ye,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:Ie.value},null)]),h.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:P=>d(P,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return e.createVNode("div",{class:"modal-footer",style:tt.value},[b.value&&b.value.map(P=>{var me;const ie=e.ref(P.disabled),ge=P.class||((me=P.appearance)==null?void 0:me.class);return e.createVNode("button",{name:P.name,type:"button",disabled:ie.value,class:ge+(P.iconClass?" btn-icontext":"")+(P.visible===!1?"d-none":""),onClick:Ve=>{st(P,Ve)}},[!!P.iconClass&&e.createVNode("i",{class:P.iconClass},null),P.text])})])}function ke(){return e.createVNode("div",{ref:B,class:"modal-header",style:Re.value},[o.slots.headerTemplate?o.slots.headerTemplate():e.createVNode("div",{class:"modal-title"},[D.value&&e.createVNode("span",{class:f.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[I.value])]),e.createVNode("div",{class:"actions"},[ct()])])}function We(){return o.slots.footerTemplate?o.slots.footerTemplate():S.value&&Ke()}function nt(P){if(P.stopPropagation(),t.allowClickMaskToClose){if(P.target!==M.value)return;d(P,!1)}}function ot(){var P,ie;return e.createVNode("div",{id:r.value,class:le.value,style:ae.value,ref:v},[t.showFloatingClose&&Ue(),e.createVNode("div",{class:Ae.value},[g.value&&ke(),e.createVNode("div",{class:et.value},[(ie=(P=o.slots).default)==null?void 0:ie.call(P),a.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:u.value},null)]),We()]),!c.value&&v.value&&!z.value&&k(v.value)])}function rt(P){return P||"body"}return e.watchEffect(()=>{ee.value&&(X.value=Ne.getMaxZIndex()||1050)}),()=>e.createVNode(e.Teleport,{to:rt(t.host)},{default:()=>[ee.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>[e.createVNode("div",{ref:M,class:Q.value,style:de.value,onClick:nt},[ot()])]})]})}});function to(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function br(t){const o=document.createElement("div");o.style.display="contents";const n=e.createApp({setup(s,l){e.onUnmounted(()=>{document.body.removeChild(o)});const r=e.ref(),i=e.ref(t.class||""),c=e.ref(!!t.showButtons),g=e.ref(!!t.showHeader),f=e.ref(t.showCloseButton==null?!0:t.showCloseButton),h=e.ref(!!t.showFloatingClose),p=e.ref(!0),O=e.ref(t.title||""),a=t.acceptCallback||(()=>{}),u=t.rejectCallback||(()=>{}),w=t.closedCallback||(m=>{}),N=t.resizeHandle||(m=>{}),I=t.stopMoveHandle||(m=>{}),T=to(t),M=m=>{p.value=!1,n.unmount(),w(m)};return e.onMounted(()=>{}),l.expose({modalRef:r}),()=>e.createVNode(lt,{ref:r,class:i.value,modelValue:p.value,"onUpdate:modelValue":m=>p.value=m,title:O.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":g.value,"show-buttons":c.value,"show-close-button":f.value,"show-max-button":!1,showFloatingClose:h.value,onAccept:a,onCancel:u,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:M,onResize:N,onStopMove:I},{default:()=>[T&&T(n)]})}});return document.body.appendChild(o),n.use(Le.LocaleService.i18n),n.mount(o),n}class wr{constructor(o){ze(this,"appContext",null);ze(this,"modalRef",e.ref());ze(this,"activeModalIndex",e.ref(0));ze(this,"modalRefs",{});ze(this,"isUseEscCloseModal",e.ref(!1));ze(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=o,this.appContext=o?o._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(o,n){const{width:s,height:l}={width:window.innerWidth,height:window.innerHeight};return s<o&&(o=s-14),l<n&&(n=l-14),{width:o,height:n}}static show(o){const n=Object.assign({title:"",showButtons:!0,showHeader:!0},o);return br(n)}close(o){var n,s;o?(s=o.value)==null||s.close():(n=this.getCurrentModal())==null||n.close()}open(o){const n=document.createDocumentFragment();o.showMaxButton&&o.fitContent&&(o.showMaxButton=!1);const s=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},o)),l=e.ref(!0),r=s.value.acceptCallback||(()=>{}),i=s.value.rejectCallback||(()=>{}),c=s.value.closedCallback||((d,y)=>{}),g=s.value.resizeHandle||(d=>{}),f=o.stopMoveHandle||(d=>{});let h;const p=to(s.value),O=d=>{var b;l.value=!1;const y=(b=d==null?void 0:d.target)==null?void 0:b.classList.contains("modal_close");c(d,this.isUseEscCloseModal.value?"esc":y?"icon":"button")},a=d=>{O(d),h&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,n),h=null,this.modalRef.value=null,this.modalRefs){const y=Object.keys(this.modalRefs).map(b=>Number(b));y.length>0?this.activeModalIndex.value=Math.max(...y):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},u=d=>{var y;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((y=this.activeModalInstance.value)==null||y.close(d==null?void 0:d.event))},{width:w,height:N}=s.value,I=this.adaptToWindow(w||500,N||320);Object.assign(s.value,I);const T=()=>e.createVNode(lt,e.mergeProps({ref:this.modalRef,modelValue:l.value,"onUpdate:modelValue":d=>l.value=d},s.value,{isMessager:s.value.class&&s.value.class.indexOf("modal-message")>-1,onAccept:r,onCancel:i,onClosed:a,onResize:g,onEsc:u,onStopMove:f}),{default:()=>[p&&p(this.app)]});return h=(d=>{const y=e.h(T,d);return y.appContext=this.appContext,e.render(y,n),y})({...s.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:d=>{s.value={...s.value,...d},h&&e.render(e.cloneVNode(h,{...s}),n)},destroy:a,modalRef:this.activeModalInstance,close:()=>this.close()}}}const no=Symbol("FModalService");lt.install=t=>{t.component(lt.name,lt);const o=new wr(t);t.provide(no,o),t.provide("FModalService",o)};const oo=e.ref(0);function ro(){oo.value++}const Sr=e.defineComponent({name:"FDesignerCanvas",props:Yn,emits:["init","selectionChange","canvasChanged","dragEnd"],setup(t,o){const n=e.ref(),s=e.ref(),l=e.ref(),r=e.ref(),i=e.ref(),c=e.ref(),g=e.ref(t.componentId),f=e.ref(t.canvasMode);let h,p;const O=e.inject("designerContext"),a={eventsEditorUtils:e.inject("eventsEditorUtils"),formSchemaUtils:e.inject("useFormSchema"),formMetadataConverter:e.inject("formMetadataConverter"),designViewModelUtils:e.inject("designViewModelUtils"),controlCreatorUtils:e.inject("controlCreatorUtils"),metadataService:e.inject("Meatdata_Http_Service_Token"),schemaService:e.inject("schemaService"),useFormCommand:e.inject("useFormCommand"),modalService:e.inject(no),formStateMachineUtils:e.inject("useFormStateMachine"),messagerService:e.inject("FMessageBoxService"),designerContext:O};e.provide("designer-host-service",a);const u=lr(a,O);t.components&&dr(t.components),ur(),e.provide("canvas-dragula",u),e.provide("design-item-context",{designerItemElementRef:i,componentInstance:c,schema:s.value,parent:void 0});const w=e.computed(()=>({"d-flex":!0,"flex-fill":!0,"flex-column":!0})),N=e.computed(()=>({editorPanel:!0,"d-flex":!0,"flex-fill":!0,"flex-column":!0,[f.value]:!0}));e.watch([()=>t.modelValue,()=>t.componentId,()=>t.canvasMode],([d,y,b])=>{n.value=d,g.value=y,f.value=b}),e.watch(qe,()=>{it(l.value),o.emit("canvasChanged")},{flush:"post"});function I(){h=new ResizeObserver(()=>{p&&clearTimeout(p),p=setTimeout(()=>{it(r.value)})}),h.observe(r.value)}function T(d,y,b,D){o.emit("selectionChange",d,y,b,D)}function M(){o.emit("dragEnd")}function m(){r.value.addEventListener("scroll",d=>{it(r.value)})}return e.onMounted(()=>{l.value&&u.initializeDragula(l.value),n.value=t.modelValue,o.emit("init",u),I(),m()}),e.onUnmounted(()=>{h&&(h.unobserve(l.value),h.disconnect(),h=null)}),o.expose({refreshCanvas:ro,changeCanvas:Vo,designerCanvasElementRef:l,designerCanvasContainerElementRef:r,designerHostService:a}),()=>e.createVNode("div",{class:"editorDiv flex-fill h-100",ref:r},[e.createVNode("div",{class:N.value},[e.createVNode("div",{ref:l,class:w.value},[n.value&&e.createVNode(bt,{key:oo.value,modelValue:n.value,"onUpdate:modelValue":d=>n.value=d,onSelectionChange:T,componentId:g.value,onDragEnd:M},null)])])])}}),xr={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function ao(t,o,n){var D;const s=n&&n.getStyles&&n.getStyles()||"",l=e.ref();let r;function i(){return n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function c(){return!1}function g(){return n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function f(){return n&&n.checkCanAddComponent?n.checkCanAddComponent():!0}function h(S){if(!S||!S.value)return null;const B=e.ref(S==null?void 0:S.value.parent),v=h(B);return v||null}function p(S=o){var k;const{componentInstance:B,designerItemElementRef:v}=S;if(!B||!B.value)return null;const{getCustomButtons:z}=B.value;return B.value.canMove||B.value.canAdd||B.value.canDelete||z&&((k=z())!=null&&k.length)?v:p(S.parent)}function O(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function a(S){return!!n&&n.canAccepts(S)}function u(){return(o==null?void 0:o.schema.label)||(o==null?void 0:o.schema.title)||(o==null?void 0:o.schema.name)}function w(){}function N(S,B){!S||!B||n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(S,B)}function I(S){const{componentType:B}=S,v=e.inject("designer-host-service");let z=Ce.getSchemaByTypeForDesigner(B,S,v);n&&n.onResolveNewComponentSchema&&(z=n.onResolveNewComponentSchema(S,z));const k=B.toLowerCase().replace(/-/g,"_");return z&&!z.id&&z.type===B&&(z.id=`${k}_${Math.random().toString().slice(2,6)}`),z}function T(S){}function M(...S){return n&&n.getPropsConfig?n.getPropsConfig(...S):[]}function m(){}function d(S){var v;if(!(o!=null&&o.schema))return;if(n!=null&&n.setComponentBasicInfoMap){n.setComponentBasicInfoMap();return}let B="";if(n!=null&&n.getComponentTitle)B=n.getComponentTitle();else{const{text:z,title:k,label:F,mainTitle:A,name:x,type:W}=o.schema;B=z||k||F||A||x||((v=ve[W])==null?void 0:v.name)}B&&(!r&&S&&(r=S.formSchemaUtils),r.getControlBasicInfoMap().set(o.schema.id,{componentTitle:B,parentPathName:B}))}function y(S){var k;const{changeObject:B}=S,{propertyID:v,propertyValue:z}=B;["text","title","label","name","mainTitle"].includes((k=S==null?void 0:S.changeObject)==null?void 0:k.propertyID)&&v&&z&&d()}function b(S){if(y(S),n&&n.onPropertyChanged)return n.onPropertyChanged(S)}return l.value={canMove:i(),canSelectParent:c(),canAdd:f(),canDelete:g(),canNested:!1,contents:[],elementRef:t,parent:(D=o.parent)==null?void 0:D.componentInstance,schema:o.schema,styles:s,canAccepts:a,getBelongedComponentInstance:h,getDraggableDesignItemElement:p,getDraggingDisplayText:u,getPropConfig:M,getDragScopeElement:w,onAcceptMovedChildElement:N,onChildElementMovedOut:T,addNewChildComponentSchema:I,onRemoveComponent:m,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1),onPropertyChanged:b,getCustomButtons:O,setComponentBasicInfoMap:d},l}const Tr=e.defineComponent({name:"FDesignerInnerItem",props:xr,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,o){const n=e.ref(t.canMove),s=e.ref(t.canAdd),l=e.ref(t.canDelete),r=e.ref(!1),i=e.ref(t.contentKey),c=e.ref(t.childType),g=e.ref(t.childLabel),f=e.ref(t.modelValue),h=e.ref(""),p=e.ref(),O=e.inject("canvas-dragula"),a=e.ref(),u=e.inject("design-item-context"),w={designerItemElementRef:p,componentInstance:a,schema:f.value,parent:u,setupContext:o};e.provide("design-item-context",w);const N=e.inject("designer-host-service"),I=e.inject("external-container-id"),T=e.computed(()=>{var V;const x=((V=a.value)==null?void 0:V.getCustomButtons)&&a.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||l.value||(x==null?void 0:x.length),"farris-nested":r.value,"can-move":n.value,"d-none":p.value&&p.value.classList.contains("d-none")}}),M=e.computed(()=>{const x={};return h.value&&h.value.split(";").reduce((W,V)=>{const[L,te]=V.split(":");return L&&(W[L]=te),W},x),x});function m(x,W){if(u&&u.schema[i.value]){const V=u.schema[i.value].findIndex(L=>L.id===W.id);if(V>-1){const L=u.schema[i.value].length,te=u.schema[i.value][V%L];u.designerItemElementRef.value.querySelector(`#${te.id}-design-item`),u.schema[i.value].splice(V,1),qe.value++,o.emit("removeComponent"),o.emit("selectionChange")}}}function d(x){if(a.value.addNewChildComponentSchema){const W={componentType:c.value,label:g.value,parentComponentInstance:a.value,targetPosition:-1},V=a.value.addNewChildComponentSchema(W);f.value[i.value].push(V),o.emit("addComponent")}}function y(){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:x=>{d()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function b(x){return l.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(W=>m(W,x),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function D(){return n.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function S(){var W;const x=((W=a.value)==null?void 0:W.getCustomButtons)&&a.value.getCustomButtons();return x&&!!x.length&&x.map(V=>e.createVNode("div",{role:"button",class:`btn component-settings-button ${V.class||""} ${V.text?"settings-button-extend":""}`,title:V.title,ref:V.id,onClick:L=>V.onClick&&V.onClick(L)},[e.createVNode("i",{class:"f-icon "+V.icon},null),V.text&&e.createVNode("span",{class:"icon-text"},[V.text])]))}function B(x){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[y(),D(),b(x),S()])])}e.watch(()=>t.modelValue,x=>{f.value=x,w.schema=x});function v(x){window.scrollContainerList||(window.scrollContainerList=new Set);const W=x.getAttribute("id");W&&window.scrollContainerList.add(W)}function z(x){const W=x.target;v(W),it(W)}function k(){var x,W;(W=(x=f.value)==null?void 0:x.contents)!=null&&W.length&&p.value&&p.value.addEventListener("scroll",z)}function F(){const x=p.value,W=e.ref(x.children[1]);return ao(W,w).value}e.onMounted(()=>{if(p.value){const x=p.value.querySelector(`[data-dragref='${f.value.id}-container']`);a.value=x&&x.componentInstance?x.componentInstance.value:F(),O&&x&&O.attachComponents(x,f.value),r.value=a.value.canNested!==void 0?a.value.canNested:r.value,s.value=a.value.canAdd!==void 0?a.value.canAdd:s.value,l.value=a.value.canDelete!==void 0?a.value.canDelete:l.value,n.value=a.value.canMove!==void 0?a.value.canMove:n.value,h.value=a.value.styles||"",p.value&&(p.value.componentInstance=a,p.value.designItemContext=w),a.value.setComponentBasicInfoMap(N)}k(),qe.value++}),e.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",z)});function A(x){if(x&&(x.preventDefault(),x.stopPropagation()),I){const L=document.getElementById(`${I}-design-item`);L&&L.click();return}let W=w.designerItemElementRef;const V=p.value;if(V){const L=document.getElementsByClassName("dgComponentFocused");L&&L.length===1&&L[0]===p.value&&p.value.classList.contains("dgComponentSelected")||(Array.from(L).forEach(C=>C.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(C=>C.classList.remove("dgComponentSelected")),V.classList.add("dgComponentFocused"),o.emit("selectionChange",f.value.type,f.value,t.componentId,a.value),a.value.getDraggableDesignItemElement&&(W=a.value.getDraggableDesignItemElement(w),W&&W.value&&W.value.classList.add("dgComponentSelected")))}vt(W==null?void 0:W.value)}return()=>e.createVNode("div",{id:`${t.id}-design-item`,ref:p,class:T.value,style:M.value,onClick:A},[B(f.value),o.slots.default&&o.slots.default()])}});function Dr(t,o,n){var z;const s=n&&n.getStyles&&n.getStyles()||"",l=n&&n.getDesignerClass&&n.getDesignerClass()||"",r=e.ref();let i;function c(){return(o==null?void 0:o.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function g(){return!1}function f(){return(o==null?void 0:o.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function h(){return(o==null?void 0:o.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function p(k){if(!k||!k.value)return null;if(k.value.schema&&k.value.schema.type==="component")return k.value;const F=e.ref(k==null?void 0:k.value.parent),A=p(F);return A||null}function O(k=o){var W;if(n!=null&&n.getDraggableDesignItemElement)return n.getDraggableDesignItemElement(k);const{componentInstance:F,designerItemElementRef:A}=k;if(!F||!F.value)return null;const{getCustomButtons:x}=F.value;return F.value.canMove||x&&((W=x())!=null&&W.length)?A:O(k.parent)}function a(k){return!!n&&n.canAccepts(k)}function u(){return(o==null?void 0:o.schema.label)||(o==null?void 0:o.schema.title)||(o==null?void 0:o.schema.name)}function w(){}function N(k,F){var A;!k||!F||(n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(k,F),(A=o==null?void 0:o.setupContext)==null||A.emit("dragEnd"))}function I(k,F){const{componentType:A}=k;let x=Ce.getSchemaByTypeForDesigner(A,k,F);n&&n.onResolveNewComponentSchema&&(x=n.onResolveNewComponentSchema(k,x));const W=A.toLowerCase().replace(/-/g,"_");return x&&!x.id&&x.type===A&&(x.id=`${W}_${Math.random().toString().slice(2,6)}`),x}function T(k){k&&n!=null&&n.onChildElementMovedOut&&n.onChildElementMovedOut(k)}function M(...k){if(n&&n.getPropsConfig)return n.getPropsConfig(...k)}function m(k){if(!k)return;const F=o==null?void 0:o.schema,{formSchemaUtils:A}=k;if(F&&A.getExpressions().length){const x=A.getExpressions().findIndex(W=>W.target===F.id);x>-1&&A.getExpressions().splice(x,1)}}function d(k){if(!k||!(o!=null&&o.schema))return;const F=o.schema,{formSchemaUtils:A}=k;A.removeCommunicationInComponent(F)}function y(k){n&&n.onRemoveComponent&&n.onRemoveComponent(),m(k),d(k),o!=null&&o.schema.contents&&o.schema.contents.map(F=>{let A=F.id;F.type==="component-ref"&&(A=F.component);const x=t.value.querySelectorAll(`#${A}-design-item`);x!=null&&x.length&&Array.from(x).map(W=>{var V;(V=W==null?void 0:W.componentInstance)!=null&&V.value.onRemoveComponent&&W.componentInstance.value.onRemoveComponent(k)})})}function b(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function D(k){var A,x;if(!((A=o==null?void 0:o.schema)!=null&&A.id))return;if(!i&&k&&(i=k.formSchemaUtils),n!=null&&n.setComponentBasicInfoMap){n.setComponentBasicInfoMap();return}let F="";if(n!=null&&n.getComponentTitle)F=n.getComponentTitle();else{const{text:W,title:V,label:L,mainTitle:te,name:C,type:q}=o.schema;F=W||V||L||te||C||((x=ve[q])==null?void 0:x.name)}F&&i.getControlBasicInfoMap().set(o.schema.id,{componentTitle:F,parentPathName:F})}function S(k){var W;const{changeObject:F}=k,{propertyID:A,propertyValue:x}=F;if(["text","title","label","name","mainTitle"].includes((W=k==null?void 0:k.changeObject)==null?void 0:W.propertyID)&&A&&x&&(D(),i)){const V=i.getControlBasicInfoMap(),L=V.keys().toArray().filter(te=>{var C,q;return((C=V.get(te))==null?void 0:C.reliedComponentId)===((q=o==null?void 0:o.schema)==null?void 0:q.id)});L!=null&&L.length&&L.forEach(te=>{const C=V.get(te).parentPathName.split(" > ");C[0]=x,V.get(te).parentPathName=C.join(" > ")})}}function B(k){if(S(k),n&&n.onPropertyChanged)return n.onPropertyChanged(k)}function v(){return n!=null&&n.shouldApplyClassToComponent?n.shouldApplyClassToComponent():!0}return r.value={canMove:c(),canSelectParent:g(),canDelete:f(),canNested:!h(),contents:o==null?void 0:o.schema.contents,elementRef:t,parent:(z=o==null?void 0:o.parent)==null?void 0:z.componentInstance,schema:o==null?void 0:o.schema,styles:s,designerClass:l,canAccepts:a,getBelongedComponentInstance:p,getDraggableDesignItemElement:O,getDraggingDisplayText:u,getPropConfig:M,getDragScopeElement:w,onAcceptMovedChildElement:N,onChildElementMovedOut:T,addNewChildComponentSchema:I,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1),onRemoveComponent:y,getCustomButtons:b,onPropertyChanged:B,setComponentBasicInfoMap:D,updateContextSchema:o==null?void 0:o.updateContextSchema,shouldApplyClassToComponent:v},r}class Nr{getTemplateRule(o,n){const s=n==null?void 0:n.formSchemaUtils,l=s==null?void 0:s.getFormTemplateRule(),r={canAccept:!0,canDelete:!0,canMove:!0};if(!l)return r;const i=this.getComponentContext(o),{componentClassList:c}=i;return c.forEach(g=>{if(!g||!l[g])return;const{canMove:f,canDelete:h,canAccept:p}=l[g];r.canMove=r.canMove&&this.resolveRuleValue(f,i),r.canDelete=r.canDelete&&this.resolveRuleValue(h,i),r.canAccept=r.canAccept&&this.resolveRuleValue(p,i)}),r}resolveRuleValue(o,n){return typeof o=="boolean"?o:this.parseRuleValueSchema(o,n)}parseRuleValueSchema(o,n){const s=o.invalidContext||[];let l=!0;for(const r of s){const{firstLevelChild:i,secondLevelChild:c,parent:g,...f}=r;if(f&&n.component){let h=!0;for(const p of Object.keys(f))if(f[p]!==n.component[p]){h=!1;break}if(!h){l=!1;continue}}if(r.firstLevelChild){if(r.firstLevelChild.class){const{firstLevelChildClassList:h}=n;if(h&&!h.includes(r.firstLevelChild.class)){l=!1;continue}}if(r.firstLevelChild.type){const{firstLevelChildSchema:h}=n;if(!h||h.type!==r.firstLevelChild.type){l=!1;continue}}}if(r.secondLevelChild){if(r.secondLevelChild.class){const{secondLevelChildClassList:h}=n;if(h&&!h.includes(r.secondLevelChild.class)){l=!1;continue}}if(r.secondLevelChild.type){const{secondLevelChildSchema:h}=n;if(!h||h.type!==r.secondLevelChild.type){l=!1;continue}}}if(r.parent){if(r.parent.class){const{parentClassList:h}=n;if(h&&!h.includes(r.parent.class)){l=!1;continue}}if(r.parent.type){const{parentSchema:h}=n;if(h&&h.type!==r.parent.type){l=!1;continue}}}l=!0;break}return!l}getComponentContext(o){var w,N,I,T;const n=o.schema,s=n.appearance&&n.appearance.class||"",l=s.split(" ")||[],r=n.contents||[],i=r.length?r[0]:null,c=i&&i.appearance?i.appearance.class:"",g=c?c.split(" "):[],f=(w=i==null?void 0:i.contents)!=null&&w.length?i==null?void 0:i.contents[0]:null,h=f&&f.appearance?f.appearance.class:"",p=h?h.split(" "):[],O=n.type==="component"?(I=(N=o.parent)==null?void 0:N.parent)==null?void 0:I.schema:(T=o.parent)==null?void 0:T.schema,a=O&&O.appearance&&O.appearance.class||"",u=a?a.split(" "):[];return{componentClass:s,componentClassList:l,childContents:r,firstLevelChildSchema:i,firstLevelChildClass:c,firstLevelChildClassList:g,secondLevelChildSchema:f,secondLevelChildClass:h,secondLevelChildClassList:p,parentSchema:O,parentClass:a,parentClassList:u,component:n}}}function jr(){function t(o,n){var i;if(!o)return!1;const s=((i=o.targetContainer)==null?void 0:i.componentInstance)&&o.targetContainer.componentInstance.value;if(!s)return!1;const l=s.schema.type,r=n==null?void 0:n.formSchemaUtils.getComponentById(s.belongedComponentId);return!((o.componentCategory==="input"||o.componentType==="form-group")&&![ve["response-layout-item"].type,ve["response-form"].type,ve.fieldset.type].includes(l)||(o.componentType===ve.tabs.type||o.componentType===ve.section.type)&&((r==null?void 0:r.componentType)!=="frame"||![ve["content-container"].type,ve["splitter-pane"].type,ve["response-layout-item"].type,ve.drawer.type].includes(l))||[ve["query-solution"].type,ve["filter-bar"].type,ve.drawer.type].includes(o.componentType)||o.componentType===ve.fieldset.type&&l!==ve["response-form"].type||o.componentCategory==="dataCollection"&&(r==null?void 0:r.componentType)!=="frame")}return{basalDragulaRuleForContainer:t}}E.DgControl=ve,E.FDesignerCanvas=Sr,E.FDesignerInnerItem=Tr,E.FDesignerItem=bt,E.UseTemplateDragAndDropRules=Nr,E.canvasChanged=qe,E.componentMap=K,E.componentPropsConverter=J,E.designerCanvasProps=Yn,E.refreshCanvas=ro,E.setPositionForSelectedElement=Tt,E.setPositionOfButtonGroup=vt,E.setPositionOfSelectedComponentBtnGroup=Io,E.useDesignerComponent=Dr,E.useDesignerInnerComponent=ao,E.useDragulaCommonRule=jr,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(j,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../locale/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../button/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/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("../../designer/nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/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("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../locale/index.umd.js","bignumber.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../button/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/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","../../designer/nav/index.umd.js","../number-range/index.umd.js","../../designer/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","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js","../notify/index.umd.js"],e):(j=typeof globalThis<"u"?globalThis:j||self,e(j["designer-canvas"]={},j.Vue,j.LodashES,j.locale,j.BigNumber,j.common,j.VueUseCore,j.dataView,j.dynamicResolver,j.designerCanvas,j.FAccordion,j.FAvatar,j.FButtonEdit,j.FButtonGroup,j.FButton,j.FCalendar,j.FCapsule,j.FCheckbox,j.FCheckboxGroup,j.FComboList,j.FComboTree,j.FComponent,j.FColorPicker,j.FContentContainer,j.FDatePicker,j.FDataGrid,j.FDropdown,j.FDynamicForm,j.FEventsEditor,j.FFilterBar,j.FFieldSelector,j.FBindingSelector,j.FImageCropper,j.FInputGroup,j.FLayout,j.FListNav,j.FListView,j.FLookup,j.FMappingEditor,j.FNav,j.FNumberRange,j.FNumberSpinner,j.FOrder,j.FPageHeader,j.FPageFooter,j.FPagination,j.FProgress,j.FQuerySolution,j.FRadioGroup,j.FRate,j.FResponseToolbar,j.FResponseLayout,j.FResponseLayoutEditorSetting,j.FSearchBox,j.FSection,j.FSmokeDetector,j.FSplitter,j.FStep$1,j.FSwitch,j.FTabs,j.FTags,j.FText,j.FTimePicker,j.FTransfer,j.FTreeview,j.FUploader,j.FVerifyDetail,j.FVideo,j.FTextArea,j.FSchemaSelector,j.FTreeGrid$1,j.FEventParameter,j.FFilterConditionEditor,j.FFieldset,j.FSortConditionEditor,j.FMenuLookup,j.FDrawer,j.FJsonEditor,j.FPropertyEditor,j.FExpressionEditor,j.FCodeEditor,j.FHtmlTemplate,j.FCollectionPropertyEditor,j.FModal$1,j.FExternalContainer,j.FLanguageTextbox,j.FImage,j.FComment,j.FWizard,j.FTooltip,null,j.notify))})(this,function(j,e,ge,qe,Ki,Me,po,le,be,at,zt,Rt,Ut,Ht,_t,$t,Wt,Tt,ht,Gt,go,Yt,Xt,Kt,Jt,Qt,Zt,en,ho,tn,vo,nn,on,rn,an,sn,ln,cn,yo,un,dn,fn,mn,pn,gn,hn,vn,yn,Cn,bn,wn,xn,Sn,Tn,Nn,En,Mn,Vn,In,jn,Dn,Bn,Fn,kn,Pn,On,Ln,qn,An,Co,zn,bo,wo,Rn,xo,So,Un,To,No,Eo,Mo,Hn,Vo,Io,_n,$n,Wn,Gn,Yn,jo,Ji,Do){"use strict";var Yi=Object.defineProperty;var Xi=(j,e,ge)=>e in j?Yi(j,e,{enumerable:!0,configurable:!0,writable:!0,value:ge}):j[e]=ge;var pe=(j,e,ge)=>Xi(j,typeof e!="symbol"?e+"":e,ge);const Ae=e.ref(0);function Bo(){Ae.value++}function Fo(o,n){const t=n.getBoundingClientRect(),i=o.getBoundingClientRect(),r=i.top>=t.top,s=i.top<=t.bottom;return r&&s}function Nt(o){const n=o.querySelector(".component-btn-group");if(!n)return;n.style.display="";const t=n.getBoundingClientRect();if(!(t.top===0&&t.left===0)){const i=n.querySelector("div");if(i){const r=i.getBoundingClientRect();i.style.top=t.top+"px";let s=t.left-r.width;const a=document.querySelector(".editorDiv");if(a){const l=a.getBoundingClientRect();s<l.left&&({left:s}=o.getBoundingClientRect())}i.style.left=s+"px"}}}function Xn(o){var t,i,r,s,a;if(!window.scrollContainerList)return;const n=Array.from(window.scrollContainerList);if(n.length)if(n.length===1){const l=n[0],u=document.querySelector(`[id=${l}]`);if(u&&u.contains(o))return u}else{const{componentInstance:l}=o;if(((t=l==null?void 0:l.value)==null?void 0:t.scrollElementId)===((i=l==null?void 0:l.value.schema)==null?void 0:i.id))return o;if(((r=l==null?void 0:l.value)==null?void 0:r.scrollElementId)===`${(s=l==null?void 0:l.value.schema)==null?void 0:s.id}-design-item`)return o.parentElement;if((a=l.value.parent)!=null&&a.elementRef)return Xn(l.value.parent.elementRef)}}function vt(o){if(!o)return;const n=o.getBoundingClientRect();if(n.width===0&&n.height===0)return;const t=o.querySelector(".component-btn-group");if(t){let i=!0;const r=Xn(o);if(r&&(i=Fo(o,r)),!i){t.style.display="none";return}Nt(o)}}function st(o){if(!o)return;let n;o.className.includes("dgComponentSelected")?n=o:n=o.querySelector(".dgComponentSelected"),n&&vt(n)}function ko(){const o=document.querySelector(".dgComponentSelected");if(!o)return;const n=o.querySelector(".component-btn-group");n&&n.getBoundingClientRect().top!==0&&Nt(o)}const Kn={modelValue:{type:Object,default:{}},componentId:{type:String,default:""},components:{type:Array},canvasMode:{type:String,default:"PC"}};var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function yt(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jn={exports:{}};(function(o,n){(function(t){o.exports=t()})(function(){return function(){function t(i,r,s){function a(d,p){if(!r[d]){if(!i[d]){var m=typeof yt=="function"&&yt;if(!p&&m)return m(d,!0);if(l)return l(d,!0);var E=new Error("Cannot find module '"+d+"'");throw E.code="MODULE_NOT_FOUND",E}var c=r[d]={exports:{}};i[d][0].call(c.exports,function(f){var x=i[d][1][f];return a(x||f)},c,c.exports,t,i,r,s)}return r[d].exports}for(var l=typeof yt=="function"&&yt,u=0;u<s.length;u++)a(s[u]);return a}return t}()({1:[function(t,i,r){var s={},a="(?:^|\\s)",l="(?:\\s|$)";function u(m){var E=s[m];return E?E.lastIndex=0:s[m]=E=new RegExp(a+m+l,"g"),E}function d(m,E){var c=m.className;c.length?u(E).test(c)||(m.className+=" "+E):m.className=E}function p(m,E){m.className=m.className.replace(u(E)," ").trim()}i.exports={add:d,rm:p}},{}],2:[function(t,i,r){(function(s){var a=t("contra/emitter"),l=t("crossvent"),u=t("./classes"),d=document,p=d.documentElement;function m(N,z){var F=arguments.length;F===1&&Array.isArray(N)===!1&&(z=N,N=[]);var D,q,M,W,I,O,te,T,L,ne=null,ee,Q,se=!1,ce=0,re,X=z||{};X.moves===void 0&&(X.moves=C),X.accepts===void 0&&(X.accepts=C),X.invalid===void 0&&(X.invalid=ut),X.containers===void 0&&(X.containers=N||[]),X.isContainer===void 0&&(X.isContainer=b),X.copy===void 0&&(X.copy=!1),X.copySortSource===void 0&&(X.copySortSource=!1),X.revertOnSpill===void 0&&(X.revertOnSpill=!1),X.removeOnSpill===void 0&&(X.removeOnSpill=!1),X.direction===void 0&&(X.direction="vertical"),X.ignoreInputTextSelection===void 0&&(X.ignoreInputTextSelection=!0),X.mirrorContainer===void 0&&(X.mirrorContainer=d.body);var de=a({containers:X.containers,start:ke,end:Ke,cancel:it,remove:ot,destroy:Xe,canMove:_e,dragging:!1});return X.removeOnSpill===!0&&de.on("over",dt).on("out",rt),Ue(),de;function ze(V){return de.containers.indexOf(V)!==-1||X.isContainer(V)}function Ue(V){var _=V?"remove":"add";f(p,_,"mousedown",Ce),f(p,_,"mouseup",We)}function Fe(V){var _=V?"remove":"add";f(p,_,"mousemove",ct)}function et(V){var _=V?"remove":"add";l[_](p,"selectstart",tt),l[_](p,"click",tt)}function Xe(){Ue(!0),We({})}function tt(V){ee&&V.preventDefault()}function Ce(V){W=V.clientX,I=V.clientY;var _=x(V)!==1||V.metaKey||V.ctrlKey;if(!_){var Y=V.target,oe=He(Y);oe&&(ee=oe,Fe(),V.type==="mousedown"&&(h(Y)?Y.focus():V.preventDefault()))}}function ct(V){if(ee){if(x(V)===0){We({});return}if(!(V.clientX!==void 0&&Math.abs(V.clientX-W)<=(X.slideFactorX||0)&&V.clientY!==void 0&&Math.abs(V.clientY-I)<=(X.slideFactorY||0))){if(X.ignoreInputTextSelection){var _=A("clientX",V)||0,Y=A("clientY",V)||0,oe=d.elementFromPoint(_,Y);if(h(oe))return}var ue=ee;Fe(!0),et(),Ke(),$e(ue),u.add(T||M,"gu-transit"),Bt(),Dt(),ce=0,me(V)}}}function He(V){if(!(de.dragging&&D)&&!ze(V)){for(var _=V;g(V)&&ze(g(V))===!1;)if(X.invalid(V,_)||(V=g(V),!V))return;var Y=g(V);if(Y&&!X.invalid(V,_)){var oe=X.moves(V,Y,_,S(V));if(oe)return{item:V,source:Y}}}}function _e(V){return!!He(V)}function ke(V){var _=He(V);_&&$e(_)}function $e(V){At(V.item,V.source)&&(T=V.item.cloneNode(!0),de.emit("cloned",T,V.item,"copy")),q=V.source,M=V.item,O=te=S(V.item),de.dragging=!0,de.emit("drag",M,q)}function ut(){return!1}function Ke(){if(de.dragging){var V=T||M;nt(V,g(V))}}function Pe(){ee=!1,Fe(!0),et(!0)}function We(V){if(Pe(),!!de.dragging){var _=T||M,Y=A("clientX",V)||0,oe=A("clientY",V)||0,ue=y(D,Y,oe),fe=ve(ue,Y,oe);fe&&(T&&X.copySortSource||!T||fe!==q)?nt(_,fe):X.removeOnSpill?ot():it()}}function nt(V,_){var Y=g(V);T&&X.copySortSource&&_===q&&Y.removeChild(M),ae(_)?de.emit("cancel",V,q):de.emit("drop",V,_,q,te),k()}function ot(){if(de.dragging){var V=T||M,_=g(V);_&&_.removeChild(V),de.emit(T?"cancel":"remove",V,_,q),k()}}function it(V){if(de.dragging){var _=arguments.length>0?V:X.revertOnSpill,Y=T||M,oe=g(Y),ue=ae(oe);ue===!1&&_&&(T?oe&&oe.removeChild(T):q.insertBefore(Y,O)),ue||_?de.emit("cancel",Y,q,q):de.emit("drop",Y,oe,q,te),k()}}function k(){var V=T||M;Pe(),Ft(),kt(),V&&u.rm(V,"gu-transit"),L&&clearTimeout(L),de.dragging=!1,ne&&de.emit("out",V,ne,q),de.emit("dragend",V,ce),q=M=T=O=te=L=ne=null}function ae(V,_){var Y;return _!==void 0?Y=_:D?Y=te:Y=S(T||M),V===q&&Y===O}function ve(V,_,Y){for(var oe=V;oe&&!ue();)oe=g(oe);return oe;function ue(){var fe=ze(oe);if(fe===!1)return!1;var Be=xt(oe,V),Ee=St(oe,Be,_,Y),Ve=ae(oe,Ee);return Ve?!0:X.accepts(M,oe,q,Ee)}}function me(V){if(!D)return;V.preventDefault();var _=A("clientX",V)||0,Y=A("clientY",V)||0;D.style.left=_-2+"px",D.style.top=Y-2+"px";var oe=T||M,ue=y(D,_,Y),fe=ve(ue,_,Y),Be=fe!==null&&fe!==ne;(Be||fe===null)&&(Ie(),ne=fe,Le()),qt(ue,Y);var Ee=g(oe);if(fe===q&&T&&!X.copySortSource){Ee&&Ee.removeChild(oe);return}var Ve,Oe=xt(fe,ue);if(se=ft(Oe,fe),Oe!==null)Ve=St(fe,Oe,_,Y);else if(X.revertOnSpill===!0&&!T)Ve=O,fe=q;else{T&&Ee&&Ee.removeChild(oe),T&&Q&&(Q.style.display="none");return}Q.style.display="block",De(Ve,oe,Be),Ve?Ot(Oe,Ve):Lt(fe);function we(Te){de.emit(Te,oe,ne,q)}function Le(){Be&&we("over")}function Ie(){ne&&we("out")}}function De(V,_,Y){(V===_||V===S(_))&&(te=S(_)),(V===null&&Y||V!==_&&V!==S(_))&&(te=V)}function dt(V){u.rm(V,"gu-hide")}function rt(V){de.dragging&&u.add(V,"gu-hide")}function Dt(){D||(D=document.createElement("div"),D.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;",D.innerHTML=X.getMirrorText&&X.getMirrorText(M)||"控件",u.add(D,"gu-mirror"),X.mirrorContainer.appendChild(D),f(p,"add","mousemove",me),u.add(X.mirrorContainer,"gu-unselectable"),de.emit("cloned",D,M,"mirror"))}function Bt(){if(Q=document.createElement("div"),u.add(Q,"gu-insertion"),M){var V=M.getBoundingClientRect();Q.style.left=V.left+"px",Q.style.top=V.top+"px"}se=!1,X.mirrorContainer.appendChild(Q)}function Ft(){D&&(u.rm(X.mirrorContainer,"gu-unselectable"),f(p,"remove","mousemove",me),g(D).removeChild(D),D=null)}function kt(){Q&&(g(Q).removeChild(Q),Q=null)}function xt(V,_){for(var Y=_;Y!==V&&g(Y)!==V;)Y=g(Y);return Y===p?null:Y}function ft(V,_){if(!_)return se;var Y=V||_&&_.lastElementChild;if(!Y)return!0;var oe=getComputedStyle(V),ue=/^inline/.test(oe.getPropertyValue("display"))||/^(left|right)$/.test(oe.getPropertyValue("float"));if(ue)return!0;if(_){var fe=getComputedStyle(_),Be=fe.getPropertyValue("display");if(/flex$/.test(Be)){var Ee=fe.getPropertyValue("flex-direction")||"row";if(Ee==="row"||Ee==="row-reverse")return!Pt(_)}return!1}return!0}function Pt(V){if(!V.children||!V.children.length)return!1;for(const _ of Array.from(V.children)){const oe=(_.className&&_.className.split(" ")||[]).filter(ue=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ue));if(!oe.length)return!1;for(const ue of oe){const fe=ue.slice(ue.lastIndexOf("-")+1);if(parseInt(fe,10)!==12)return!1}}return!0}function Ot(V,_){const Y=_.getBoundingClientRect();if(Q.style.left=Y.left+"px",Q.style.top=Y.top+"px",se){if(Q.style.height=Y.height+"px",Q.style.width="4px",V){const oe=V.getBoundingClientRect();oe.top!==Y.top&&(Q.style.left=oe.right+"px",Q.style.top=oe.top+"px",Q.style.height=oe.height+"px")}}else if(Q.style.height="4px",Q.style.width=Y.width+"px",re){const oe=re.getBoundingClientRect();Y.top<oe.top&&(Q.style.display="none")}_===M&&M&&(Q.style.display="none")}function Lt(V){te=null;var _=V.lastElementChild;if(_){var Y=_.getBoundingClientRect();se?(Q.style.left=Y.right+"px",Q.style.top=Y.top+"px",Q.style.height=Y.height+"px",Q.style.width="4px"):(Q.style.left=Y.left+"px",Q.style.top=Y.bottom+"px",Q.style.height="4px",Q.style.width=Y.width+"px"),_===M&&M&&(Q.style.display="none")}else Q.style.display="none"}function qt(V,_){if(!X.mirrorContainer.contains(V)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(re=E(V),!re||!re.contains(V)))return;const Y=document.querySelector(".dgComponentSelected"),oe=re.getBoundingClientRect();if(_-30<oe.top&&re.scrollTop>0){let ue=re.scrollTop<10?re.scrollTop:10;re.scrollBy(0,-1*ue),Y&&re.contains(Y)&&(ce=ce+-1*ue)}if(_+30>oe.bottom&&re.scrollTop<re.scrollHeight-re.clientHeight){const ue=re.scrollHeight-re.clientHeight-re.scrollTop;let fe=ue<10?ue:10;re.scrollBy(0,fe),Y&&re.contains(Y)&&(ce=ce+fe)}}function St(V,_,Y,oe){var ue=X.direction==="horizontal",fe=X.direction==="mixed",Be=_!==V?Ve():Ee();return Be;function Ee(){var we=V.children.length,Le,Ie,Te;for(Le=0;Le<we;Le++)if(Ie=V.children[Le],Te=Ie.getBoundingClientRect(),ue&&Te.left+Te.width/2>Y||!fe&&!ue&&Te.top+Te.height/2>oe||fe&&Te.left+Te.width>Y&&Te.top+Te.height>oe)return Ie;return null}function Ve(){var we=_.getBoundingClientRect();if(fe){var Le=oe-we.top,Ie=Y-we.left,Te=we.bottom-oe,mt=we.right-Y,pt=Math.min(Ie,mt,Le,Te),gt;return se?gt=mt<Ie:gt=Te===pt||mt===pt||Ie===pt,Oe(gt)}return Oe(ue?Y>we.left+B(we)/2:oe>we.top+w(we)/2)}function Oe(we){return we?S(_):_}}function At(V,_){return typeof X.copy=="boolean"?X.copy:X.copy(V,_)}}function E(N){const z=Array.from(window.scrollContainerList);if(z.length===1){const D=Array.from(window.scrollContainerList)[0];return document.getElementById(D)}const F=c(z);for(const D of F)if(D.contains(N))return D;return null}function c(N){const z=[];return N.forEach(F=>{const D=document.getElementById(F);D&&z.push(D)}),z.sort((F,D)=>F.contains(D)?1:D.contains(F)?-1:0),z}function f(N,z,F,D){var q={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},M={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},W={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?l[z](N,M[F],D):s.navigator.msPointerEnabled?l[z](N,W[F],D):(l[z](N,q[F],D),l[z](N,F,D))}function x(N){if(N.touches!==void 0)return N.touches.length;if(N.which!==void 0&&N.which!==0)return N.which;if(N.buttons!==void 0)return N.buttons;var z=N.button;if(z!==void 0)return z&1?1:z&2?3:z&4?2:0}function y(N,z,F){N=N||{};var D=N.className||"",q;return N.className+=" gu-hide",q=d.elementFromPoint(z,F),N.className=D,q}function b(){return!1}function C(){return!0}function B(N){return N.width||N.right-N.left}function w(N){return N.height||N.bottom-N.top}function g(N){return N.parentNode===d?null:N.parentNode}function h(N){return N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N.tagName==="SELECT"||v(N)}function v(N){return!N||N.contentEditable==="false"?!1:N.contentEditable==="true"?!0:v(g(N))}function S(N){return N.nextElementSibling||z();function z(){var F=N;do F=F.nextSibling;while(F&&F.nodeType!==1);return F}}function P(N){return N.targetTouches&&N.targetTouches.length?N.targetTouches[0]:N.changedTouches&&N.changedTouches.length?N.changedTouches[0]:N}function A(N,z){var F=P(z),D={pageX:"clientX",pageY:"clientY"};return N in D&&!(N in F)&&D[N]in F&&(N=D[N]),F[N]}i.exports=m}).call(this,typeof Re<"u"?Re:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,i,r){i.exports=function(a,l){return Array.prototype.slice.call(a,l)}},{}],4:[function(t,i,r){var s=t("ticky");i.exports=function(l,u,d){l&&s(function(){l.apply(d||null,u||[])})}},{ticky:10}],5:[function(t,i,r){var s=t("atoa"),a=t("./debounce");i.exports=function(u,d){var p=d||{},m={};return u===void 0&&(u={}),u.on=function(E,c){return m[E]?m[E].push(c):m[E]=[c],u},u.once=function(E,c){return c._once=!0,u.on(E,c),u},u.off=function(E,c){var f=arguments.length;if(f===1)delete m[E];else if(f===0)m={};else{var x=m[E];if(!x)return u;x.splice(x.indexOf(c),1)}return u},u.emit=function(){var E=s(arguments);return u.emitterSnapshot(E.shift()).apply(this,E)},u.emitterSnapshot=function(E){var c=(m[E]||[]).slice(0);return function(){var f=s(arguments),x=this||u;if(E==="error"&&p.throws!==!1&&!c.length)throw f.length===1?f[0]:f;return c.forEach(function(b){p.async?a(b,f,x):b.apply(x,f),b._once&&u.off(E,b)}),u}},u}},{"./debounce":4,atoa:3}],6:[function(t,i,r){(function(s){var a=t("custom-event"),l=t("./eventmap"),u=s.document,d=E,p=f,m=[];s.addEventListener||(d=c,p=x),i.exports={add:d,remove:p,fabricate:y};function E(g,h,v,S){return g.addEventListener(h,v,S)}function c(g,h,v){return g.attachEvent("on"+h,C(g,h,v))}function f(g,h,v,S){return g.removeEventListener(h,v,S)}function x(g,h,v){var S=B(g,h,v);if(S)return g.detachEvent("on"+h,S)}function y(g,h,v){var S=l.indexOf(h)===-1?A():P();g.dispatchEvent?g.dispatchEvent(S):g.fireEvent("on"+h,S);function P(){var N;return u.createEvent?(N=u.createEvent("Event"),N.initEvent(h,!0,!0)):u.createEventObject&&(N=u.createEventObject()),N}function A(){return new a(h,{detail:v})}}function b(g,h,v){return function(P){var A=P||s.event;A.target=A.target||A.srcElement,A.preventDefault=A.preventDefault||function(){A.returnValue=!1},A.stopPropagation=A.stopPropagation||function(){A.cancelBubble=!0},A.which=A.which||A.keyCode,v.call(g,A)}}function C(g,h,v){var S=B(g,h,v)||b(g,h,v);return m.push({wrapper:S,element:g,type:h,fn:v}),S}function B(g,h,v){var S=w(g,h,v);if(S){var P=m[S].wrapper;return m.splice(S,1),P}}function w(g,h,v){var S,P;for(S=0;S<m.length;S++)if(P=m[S],P.element===g&&P.type===h&&P.fn===v)return S}}).call(this,typeof Re<"u"?Re:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,i,r){(function(s){var a=[],l="",u=/^on/;for(l in s)u.test(l)&&a.push(l.slice(2));i.exports=a}).call(this,typeof Re<"u"?Re:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,i,r){(function(s){var a=s.CustomEvent;function l(){try{var u=new a("cat",{detail:{foo:"bar"}});return u.type==="cat"&&u.detail.foo==="bar"}catch{}return!1}i.exports=l()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(d,p){var m=document.createEvent("CustomEvent");return p?m.initCustomEvent(d,p.bubbles,p.cancelable,p.detail):m.initCustomEvent(d,!1,!1,void 0),m}:function(d,p){var m=document.createEventObject();return m.type=d,p?(m.bubbles=!!p.bubbles,m.cancelable=!!p.cancelable,m.detail=p.detail):(m.bubbles=!1,m.cancelable=!1,m.detail=void 0),m}}).call(this,typeof Re<"u"?Re:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,i,r){var s=i.exports={},a,l;function u(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=u}catch{a=u}try{typeof clearTimeout=="function"?l=clearTimeout:l=d}catch{l=d}})();function p(w){if(a===setTimeout)return setTimeout(w,0);if((a===u||!a)&&setTimeout)return a=setTimeout,setTimeout(w,0);try{return a(w,0)}catch{try{return a.call(null,w,0)}catch{return a.call(this,w,0)}}}function m(w){if(l===clearTimeout)return clearTimeout(w);if((l===d||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(w);try{return l(w)}catch{try{return l.call(null,w)}catch{return l.call(this,w)}}}var E=[],c=!1,f,x=-1;function y(){!c||!f||(c=!1,f.length?E=f.concat(E):x=-1,E.length&&b())}function b(){if(!c){var w=p(y);c=!0;for(var g=E.length;g;){for(f=E,E=[];++x<g;)f&&f[x].run();x=-1,g=E.length}f=null,c=!1,m(w)}}s.nextTick=function(w){var g=new Array(arguments.length-1);if(arguments.length>1)for(var h=1;h<arguments.length;h++)g[h-1]=arguments[h];E.push(new C(w,g)),E.length===1&&!c&&p(b)};function C(w,g){this.fun=w,this.array=g}C.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function B(){}s.on=B,s.addListener=B,s.once=B,s.off=B,s.removeListener=B,s.removeAllListeners=B,s.emit=B,s.prependListener=B,s.prependOnceListener=B,s.listeners=function(w){return[]},s.binding=function(w){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(w){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(t,i,r){(function(s){var a=typeof s=="function",l;a?l=function(u){s(u)}:l=function(u){setTimeout(u,0)},i.exports=l}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,i,r){(function(s,a){var l=t("process/browser.js").nextTick,u=Function.prototype.apply,d=Array.prototype.slice,p={},m=0;r.setTimeout=function(){return new E(u.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new E(u.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(c){c.close()};function E(c,f){this._id=c,this._clearFn=f}E.prototype.unref=E.prototype.ref=function(){},E.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(c,f){clearTimeout(c._idleTimeoutId),c._idleTimeout=f},r.unenroll=function(c){clearTimeout(c._idleTimeoutId),c._idleTimeout=-1},r._unrefActive=r.active=function(c){clearTimeout(c._idleTimeoutId);var f=c._idleTimeout;f>=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},f))},r.setImmediate=typeof s=="function"?s:function(c){var f=m++,x=arguments.length<2?!1:d.call(arguments,1);return p[f]=!0,l(function(){p[f]&&(x?c.apply(null,x):c.call(null),r.clearImmediate(f))}),f},r.clearImmediate=typeof a=="function"?a:function(c){delete p[c]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Jn);var Oo=Jn.exports;const Qn=Po(Oo),Lo={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}},qo={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Et=e.defineComponent({name:"Toast",props:qo,emits:["close","click"],setup:(o,n)=>{const t=e.ref(o.animate),i="fadeOut",r=e.computed(()=>o.options),s=e.ref(!1),a=e.computed(()=>r.value.title&&r.value.message),l=e.computed(()=>!r.value.title&&r.value.message),u=e.computed(()=>{const C={animated:s.value,toast:!0,"toast--only-content":!a.value};return C[o.animate]=!1,C[i]=s.value,C["toasty-type-"+r.value.type]=!0,r.value.theme&&(C[r.value.theme]=!0),C}),d=e.computed(()=>{const w=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,g={"f-icon":!0};return g[w]=!0,g}),p=e.computed(()=>r.value.title||r.value.message),m=e.computed(()=>o.showCloseButton),E=e.computed(()=>!!r.value.buttons||!!n.slots.default),c=e.computed(()=>qe.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function f(C){C.stopPropagation(),C.preventDefault(),s.value=!1,setTimeout(()=>{n.emit("close",r.value)},200)}function x(C,B){}function y(C){return`f-preten-link ${C.customClass?C.customClass:""}`}e.watch(t,()=>{t.value});const b=()=>{var C;return e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"after-toast-msg text-right"},[!n.slots.default&&((C=r.value.buttons)==null?void 0:C.map(B=>e.createVNode("span",{class:y(B),onClick:w=>void 0},[B.text]))),n.slots.default&&n.slots.default()])])};return()=>e.createVNode("div",{class:u.value,style:"min-height:44px"},[m.value&&e.createVNode("button",{title:qe.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:f},[e.createVNode("span",{class:"f-icon modal_close"},null)]),p.value&&e.createVNode("section",{class:"modal-tips"},[!a.value&&e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:d.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[a.value&&e.createVNode(e.Fragment,null,[e.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),e.createVNode("p",{class:"toast-msg",innerHTML:r.value.message,style:c.value},null),E.value&&b()]),l.value&&(r.value.buttons?e.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[e.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:r.value.message},null),e.createVNode("div",{class:"after-toast-title text-right ml-auto"},[b()])]):e.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:c.value,innerHTML:r.value.message},null))])])])}}),Ao=["moz","ms","webkit"];function zo(){let o=0;return n=>{const t=new Date().getTime(),i=Math.max(0,16-(t-o)),r=setTimeout(()=>{n(t+i)},i);return o=t+i,r}}function Ro(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const o=Ao.filter(n=>`${n}RequestAnimationFrame`in window)[0];return o?window[`${o}RequestAnimationFrame`]:zo()}Ro();function Uo(){const o=navigator.userAgent||navigator.vendor||window.opera,n=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],t=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const l of t)if(l.test(o))return!1;for(const l of n)if(l.test(o))return!0;const i="ontouchstart"in window||navigator.maxTouchPoints>0,r=screen.width,s=screen.height,a=Math.min(r,s);return!!(i&&a<=768)}const Ct=e.defineComponent({name:"Notify",props:Lo,emits:["close","empty"],setup(o,n){var x;const t=Uo(),r=`farris-notify-${(x=o.options)!=null&&x.type?o.options.type:"info"}}`,s=e.computed(()=>({"farris-notify":!0,[r]:t})),a={left:12,right:12,top:20,bottom:12},l=e.ref(),u=e.ref(o.options),d=e.ref(o.showCloseButton),p=e.computed(()=>o.position||"bottom-right"),m=e.computed(()=>o.timeout!=null?o.timeout:3e3),E=e.computed(()=>{const y=o.bottom?o.bottom:a.bottom,b=o.top?o.top:a.top,C={transition:"all 0.2s ease",left:p.value.indexOf("left")>-1?`${o.left?o.left:a.left}px`:"",right:p.value.indexOf("right")>-1?`${o.right?o.right:a.right}px`:"",top:p.value.indexOf("top")>-1?`${b}px`:"",bottom:p.value.indexOf("bottom")>-1?`${y}px`:""};return p.value.indexOf("center")>-1&&(C.left="50%",C.marginLeft="calc(-24rem / 2)",p.value==="center-center"&&(C.top="50%",C.transform="translate(-50%, -50%)")),C});function c(y){n.emit("close")}m.value&&setTimeout(()=>{c()},m.value),n.expose({closeToast:c,container:l,notifyPosition:p});function f(y,b){c()}return()=>{var y;return t?e.createVNode("div",{class:s.value,ref:l},[(y=o.options)==null?void 0:y.message]):e.createVNode("div",{class:s.value,style:E.value,ref:l},[e.createVNode(Et,{options:u.value,showCloseButton:d.value,animate:o.animate,onClose:b=>f(b,u.value)},null)])}}});class Mt{constructor(){pe(this,"notifyRefs",[]);pe(this,"globalConfig",e.reactive({}))}escapeAllHtml(n){if(typeof n!="string"||!n)return"";const t=document.createElement("div");return t.textContent=n||"",t.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(n){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...n}),s=document.createElement("div");s.style.display="contents";const a=e.createApp({setup(){var d;const l=e.ref();function u(){l.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,l),a.unmount()},220)}if(r.position.indexOf("top")>-1){const p=t.getNotifyInstances(r.position),m=p[p.length-1];if(m){const E=m.value.container.getBoundingClientRect();r.top=E.bottom}}return r.safeHtml&&((d=r.options)!=null&&d.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),e.onUnmounted(()=>{document.body.removeChild(s)}),e.onMounted(()=>{t.updateNotifyPositionForCreate(r,l)}),()=>e.createVNode(e.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[e.createVNode(Ct,e.mergeProps({ref:l},r,{onClose:u}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.use(qe.LocaleService.i18n),a.mount(s),a}getNotifyInstances(n){return this.notifyRefs.filter(t=>t.value.notifyPosition===n)}updateNotifyPositionForCreate(n,t){if(this.notifyRefs&&this.notifyRefs.length){const i=window.innerHeight;n.position.indexOf("bottom")>-1&&this.getNotifyInstances(n.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+i-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(n,t){const i=this.notifyRefs.indexOf(t);if(n.position.indexOf("top")>-1){const r=this.getNotifyInstances(n.position),s=r.indexOf(t);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}i>-1&&this.notifyRefs.splice(i,1)}show(n){return this.createNotifyInstance(n)}buildNotifyProps(n,t){let i="",r="",s,a,l;typeof t=="string"?i=t:t&&(i=t.message||"",r=t.title||"",a=t.position||null,l=t.showCloseButton!=null?t.showCloseButton:null,s=t.timeout!=null?t.timeout:null);const d={options:{type:n,message:i,title:r}};return a!=null&&(d.position=a),l!=null&&(d.showCloseButton=l),s!=null&&(d.timeout=s),d}info(n){const t=this.buildNotifyProps("info",n);return this.show(t)}success(n){const t=this.buildNotifyProps("success",n);return this.show(t)}warning(n){const t=this.buildNotifyProps("warning",n);return this.show(t)}error(n){const t=this.buildNotifyProps("error",n);return this.show(t)}close(n){n&&n.unmount()}closeAll(){this.notifyRefs.forEach(n=>{n==null||n.value.closeToast()}),this.notifyRefs.length=0}}const Ho=Symbol("NOTIFY_SERVICE_TOKEN");Ct.install=o=>{o.component(Ct.name,Ct),o.component(Et.name,Et);const n=new Mt;o.provide(Ho,n),o.provide("FNotifyService",n)};const _o={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]},targetComponentInstance:{type:Object,default:{}}};`${qe.LocaleService.getLocaleValue("datagrid.loadingMessage")}`;const $o={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,mode:"server",size:-1}},rowNumber:{type:Object,default:{enable:!0,width:36,heading:"序号"}},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"]}},autoHeight:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},checkboxPosition:{type:String,default:"after-expand"}};function Wo(o,n,t,i,r,s,a,l,u,d,p,m,E,c,f,x,y){const{calculateCellPositionInRow:b}=s,{columnContext:C,hasLeftFixedColumn:B,hasRightFixedColumn:w}=a,{gridDataStyle:g,leftFixedGridDataStyle:h,rightFixedGridDataStyle:v}=c,{renderDataRow:S}=le.getHierarchyRow(o,n,C,y,l,u,d,p,m,E,c,f,x),P=[S];function A(q,M){const W=b(q);return y.value.filter(I=>I.visible!==!1).map((I,O)=>P[I.type](I,W,M,O))}function N(){return e.createVNode("div",{ref:i,class:"fv-grid-content-left-fixed"},[e.createVNode("div",{class:"fv-grid-data",style:h.value},[A(C.value.leftColumns.filter(q=>q.visible),"left")])])}function z(){return e.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[e.createVNode("div",{class:"fv-grid-data",style:g.value},[A(C.value.primaryColumns.filter(q=>q.visible),"primary")])])}function F(){return e.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[e.createVNode("div",{class:"fv-grid-data",style:v.value},[A(C.value.rightColumns.filter(q=>q.visible),"right")])])}function D(){const q=[];return B.value&&q.push(N()),q.push(z()),w.value&&q.push(F()),q}return{renderDataArea:D}}const Vt=e.defineComponent({name:"FTreeGrid",props:$o,emits:["selectionChange","clickRow","expandNode","dblclickNode","doubleClickRow","unSelectItem","selectItem","selectAll","unSelectAll","filterChanged","sortChanged","selectionUpdate"],setup(o,n){var uo,fo;const i=((uo=o.rowOption)==null?void 0:uo.height)||28,r=e.ref(20),s=e.ref(o.columns),a=le.useIdentify(o),{idField:l}=a,u=e.ref(),d=e.ref(),p=e.ref(),m=e.ref(),E=e.ref(),c=e.ref([]),f=e.ref(!1),x=e.ref(((fo=o.rowOption)==null?void 0:fo.wrapContent)||!1),y=le.useGroupData(o,a),b=le.useFilter(o,n),C=le.useHierarchy(o),{collapseField:B}=C,{showLoading:w,renderLoading:g}=le.useLoading(o,u),h=le.useDataView(o,new Map,b,C,a),{dataView:v}=h,S=le.useSelection(o,h,a,c,n),{showSelection:P,selectedValues:A}=S,N=le.useSelectHierarchyItem(o,c,h,a,S,n),z=e.computed(()=>o.disabled),F=e.computed(()=>o.virtualized?Math.min(h.dataView.value.length,r.value):h.dataView.value.length),D=le.usePagination(o,h),{shouldRenderPagination:q}=D,{containerStyleObject:M}=le.useDataViewContainerStyle(o),W=le.useCommandColumn(o),{applyCommands:I}=W;I(s);const{applyColumnSetting:O,removeColumnSetting:te}=le.useSettingColumn(o);o.showSetting&&O(s);const T=le.useColumn(o,n),L=le.useSort(o),{applyColumnSorter:ne,columnContext:ee,updateColumnRenderContext:Q}=T;ne(h,L);const se=le.useGroupColumn(o,ee),ce=le.useRow(o,n,S,a),re=le.useEdit(o,n,a,ce,c),X=le.useVisualDataBound(o),de=le.useVisualDataCell(o,re,X),ze=le.useVisualDataRow(o,h,re,C,a,X,de),Ue=le.useVisualData(o,s,h,F,0,ze),{getVisualData:Fe}=Ue,et=le.useCellPosition(o,ee),Xe=le.useSidebar(o,S),{sidebarWidth:tt}=Xe,Ce=le.useVirtualScroll(o,h,c,ee,Ue,F,0,tt),{onWheel:ct,dataGridWidth:He,viewPortHeight:_e,viewPortWidth:ke,resetScroll:$e,updateVisibleRowsOnLatestVisibleScope:ut}=Ce,Ke=le.useFitColumn(o,ee,d,ke,se),{calculateColumnsSize:Pe}=Ke,We=le.useFilterHistory(),nt=le.useColumnFilter(d,E,h,We,Ce),ot=le.useDragColumn(o,n,T,h,se,y,Ce),it=e.computed(()=>{const G={"fv-grid":!0,"fv-grid-bordered":o.showBorder,"fv-grid-horizontal-bordered":o.showHorizontalLines,"fv-datagrid-strip":o.showStripe};return Me.getCustomClass(G,o.customClass)}),k=e.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":f.value,"fv-grid-wrap-content":x.value})),{renderDataArea:ae}=Wo(o,n,p,m,E,et,T,h,re,C,ce,S,N,Ce,Ue,X,c),{renderGridHeader:ve,renderGridColumnResizeOverlay:me,shouldShowHeader:De}=le.getColumnHeader(o,n,d,m,E,T,h,ot,nt,b,We,Ke,se,S,Xe,L,Ce,ke,c),{renderDataGridSidebar:dt}=le.getSidebar(o,ce,S,Xe,Ce,N),{renderDisableMask:rt}=le.getDisableMask(),{renderHorizontalScrollbar:Dt}=le.getHorizontalScrollbar(o,d,Ce),{renderVerticalScrollbar:Bt}=le.getVerticalScrollbar(o,d,Ce);function Ft(){var G,ie,xe;if(d.value&&d.value.clientHeight>0&&((G=d.value)==null?void 0:G.clientWidth)>0){const Ne=Math.ceil(d.value.clientHeight/i);Ne>r.value&&(r.value=Ne,ut()),_e.value=((ie=p.value)==null?void 0:ie.clientHeight)||0,He.value=((xe=d.value)==null?void 0:xe.clientWidth)||0}d.value&&(d.value.clientHeight>0||d.value.clientWidth>0)&&Pe()}e.onMounted(()=>{d.value&&(r.value=Math.max(Math.ceil(d.value.clientHeight/i),r.value),c.value=Fe(0,F.value+0-1),po.useResizeObserver(d.value,Ft),Pe(),e.nextTick(()=>{d.value&&(He.value=d.value.clientWidth),p.value&&(ke.value=p.value.clientWidth,_e.value=p.value.clientHeight)})),w.value&&g()}),e.onUnmounted(()=>{}),e.watch(ke,()=>{d.value&&Pe()});function kt(G){h.collapseTo(G),h.reOrderVisibleIndex(),$e()}function xt(G){h.expandTo(G),h.reOrderVisibleIndex(),$e()}function ft(){const G=S.getSelectionRow();return G?G.dataIndex-1:-1}function Pt(){const G=ft();h.insertNewDataItem(G),c.value=Fe(0,F.value+0-1)}function Ot(){const G=ft();h.insertNewChildDataItem(G),c.value=Fe(0,F.value+0-1)}function Lt(G,ie){const xe=c.value.find(je=>je.raw[l.value]===ie),Ne=xe?xe.dataIndex-1:-1;h.insertNewChildDataItems(G,Ne)}function qt(){const G=ft(),ie=N.getNextSelectableHierarchyItemId(G);h.removeHierarchyDataItem(G),c.value=Fe(0,F.value+0-1),ie&&N.selectItemById(ie)}function St(G){re.onEditingRow(G)}function At(G){re.acceptEditingRow(G)}function V(G){re.cancelEditingRow(G)}function _(G){G&&(s.value=G,I(s),Q(s.value),ne(h,L),Pe())}e.watch(()=>o.columns,G=>{_(G)});function Y(G,ie){G&&(h.load(G),h.reOrderVisibleIndex(),ie!=null&&ie.keepScrollPosition?Ce.scrollTo(Ce.offsetY.value):$e())}function oe(G){ce.activeRowById(G)}function ue(G,ie={isCurrent:!0}){ie!=null&&ie.isCurrent&&oe(G),N.selectItemById(G)}function fe(G){const ie=c.value.find(xe=>xe.raw[a.idField.value]===G);ie&&ce.clickRowItem(ie)}function Be(G){N.selectItemByIds(G)}function Ee(){return S.getSelectedItems()}function Ve(){S.clearSelection()}function Oe(){S.emptyCurrentRowId()}const we=e.computed(()=>!c.value||!c.value.length),{renderEmpty:Le}=le.getEmpty(o,n);function Ie(){return S.getSelectionRow()}function Te(G,ie={clearCurrent:!0}){ie!=null&&ie.clearCurrent&&oe(""),N.unSelectItemByIds(G)}function mt(){return S.currentSelectedDataId.value}function pt(G,ie,xe){const Ne=v.value.find(je=>je[l.value]===G);if(Ne){if(Object.keys(Ne).forEach(Se=>{Object.prototype.hasOwnProperty.call(ie,Se)&&(Ne[Se]=ie[Se])}),xe){const{collapseField:Se,disabledField:Je,checkedField:Qe,visibleField:Ze}=xe;Se&&!ge.isUndefined(ie[Se])&&(Ne.__fv_collapse__=ie[Se]),Qe&&!ge.isUndefined(ie[Qe])&&(Ne.__fv_checked__=ie[Qe]),Je&&!ge.isUndefined(ie[Je])&&(Ne.__fv_disabled__=ie[Je]),Ze&&!ge.isUndefined(ie[Ze])&&(Ne.__fv_visible__=ie[Ze])}const je=c.value.find(Se=>Se.raw[l.value]===G),mo=c.value.findIndex(Se=>Se.raw[l.value]===G);if(je){if(je.raw=Ne,Object.keys(je.data).forEach(Se=>{je.data[Se].updateData(Ne)}),xe){const{collapseField:Se,disabledField:Je,checkedField:Qe,visibleField:Ze}=xe;Se&&!ge.isUndefined(ie[Se])&&(je.collapse=ie[Se]),Qe&&!ge.isUndefined(ie[Qe])&&(je.checked=ie[Qe]),Je&&!ge.isUndefined(ie[Je])&&(je.disabled=ie[Je]),Ze&&!ge.isUndefined(ie[Ze])&&(je.visible=ie[Ze])}c.value=[...c.value.slice(0,mo),je,...c.value.slice(mo+1)],h.updateSummary()}}}function gt(G){return Object.prototype.hasOwnProperty.call(G,"raw")?h.hasRealChildren(G.raw):h.hasRealChildren(G)}function Pi(G){const ie=h.dataView.value.find(xe=>xe[l.value]===G);return ie?ie[B.value]:""}function Oi(){return B.value}e.watch(()=>o.showSetting,(G,ie)=>{G!==ie&&(G?O(s):te(s),_(s.value))});function Li(G){return c.value.filter(ie=>G.includes(ie.raw[o.idField]))}function qi(G){const ie=a.idField.value,xe=c.value.find(Ne=>Ne.raw[ie]===G);xe&&ce.changeRow(xe)}function Ai(){S.keepSelectingOnPaging.value||Ve(),h.updateVisibleDataSummary(c.value)}function zi(G){D.updatePagination(G)}const Ri=le.useAdapt(S,h,b,s,_,Y,zi);n.expose({activeRowById:oe,addNewDataItem:Pt,addNewChildDataItem:Ot,addChildrenToNode:Lt,collapseTo:kt,expandTo:xt,removeDataItem:qt,editDataItem:St,acceptDataItem:At,cancelDataItem:V,updateColumns:_,updateDataSource:Y,selectItemById:ue,selectItemByIds:Be,getSelectedItems:Ee,clearSelection:Ve,getSelectionRow:Ie,clickRowItemById:fe,unSelectItemByIds:Te,getCurrentRowId:mt,reassignRowData:pt,hasChildren:gt,getCollapseField:Oi,getCollapseStatusById:Pi,getVisibleDataByIds:Li,selectRowById:qi,updateDerivedData:Ai,emptyCurrentRowId:Oe,calculateColumnsSize:Pe,...Ri});const Ui=e.computed(()=>{const G={};return Ce.shouldShowHorizontalScrollbar.value&&(G.paddingBottom="10px"),Ce.shouldShowVirticalScrollbar.value&&(G.paddingRight="10px"),G}),Hi=e.computed(()=>({...M.value,borderRadius:"5px"})),{renderDataGridPagination:_i}=le.getPagination(o,n,h,Ce,D,S),$i=e.computed(()=>({"d-flex":!0,"justify-content-between":q.value&&P.value,"justify-content-end":q.value&&!P.value,"position-relative":!0})),Wi=e.computed(()=>({"d-flex":!0,"align-items-center":!0})),{renderDataGridSummary:Gi}=le.getSummary(o,h,T);return()=>o.visible&&e.createVNode("div",{ref:u,class:it.value,style:Hi.value,onWheel:ct},[d.value&&De.value&&ve(),e.createVNode("div",{ref:d,class:k.value,onMouseover:()=>f.value=!0,onMouseleave:()=>f.value=!1,onTouchstart:G=>{G.stopPropagation(),f.value=!0,Ce.onTouchstartScrollThumb(G,d)},onTouchend:G=>{f.value=!1},style:Ui.value},[d.value&&dt(c),d.value&&ae(),d.value&&we.value&&Le(),d.value&&Dt(),d.value&&Bt()]),d.value&&Gi(),(q.value||P.value)&&e.createVNode("div",{class:$i.value},[P.value&&e.createVNode("div",{class:Wi.value},[e.createVNode("div",null,["已选:"+A.value.length,e.createTextVNode(" 条")])]),q.value&&_i()]),me(),z.value&&rt()])}});Me.withInstall(Vt);function Zn(o){const{designerHostService:n}=o,t=new Map,i=e.ref(),r=e.ref(),s=e.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),a={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},l=e.ref(!1),u=e.ref(o.componentType);function d(y){const b=[];return y.forEach(C=>{let B=[];C.type&&C.type.fields&&C.type.fields.length>0&&(B=d(C.type.fields));const w=ge.cloneDeep(C),g=C.multiLanguage?"多语言":C.type.displayName,h=B.length?!1:!t.has(C.id);h&&(l.value=!0),b.push({data:Object.assign({displayedTypeName:g,selectable:h},w),children:B})}),b}function p(y){switch(y){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return y}}function m(y){var b,C;if(y&&(((b=y.schema)==null?void 0:b.type)===((C=he.drawer)==null?void 0:C.type)||y.parent&&m(y.parent)))return!0}function E(y){if(t.clear(),!y)return;const b=m(o.targetComponentInstance);let C=p(u.value);["frame","table","form"].includes(C)&&(C="form");const{formSchemaUtils:B,schemaService:w}=n;B.getFormSchema().module.viewmodels.forEach(g=>{if(!g.fields||g.fields.length===0)return;const h=B.getComponentByViewModelId(g.id);let v=h.componentType;["frame","table","form"].includes(v)&&(v="form");const S=w.getTableInfoByViewModelId(g.id);if(v!==C||!S||S.id!==y.id)return;const P=B.checkComponentExistInDrawer(h.id);b&&P&&g.fields.forEach(A=>{t.set(A.id,!0)}),!b&&!P&&g.fields.forEach(A=>{t.set(A.id,!0)})})}function c(y){E(y);const{fields:b}=y.type;l.value=!1,i.value=d(b),r.value&&r.value.updateDataSource(i.value)}const f={customRowStatus:y=>(y.disabled=!y.raw.selectable,y)};function x(){return r.value.getSelectedItems().map(b=>b.data)}return{fieldTreeGridRef:r,resolveFieldDataSource:c,occupiedFieldMap:t,fieldDataSource:i,fieldTreeRowOption:f,fieldColumns:s,fieldSelectionOption:a,checkAndGetSelectedFields:x,hasSelectableField:l,currentComponentType:u}}function Go(o){const{designerHostService:n}=o,t=new Map,i=e.ref(),r=e.ref(),s=e.ref([{field:"name",title:"实体名称"}]),a=e.ref(),l=e.ref(!1);function u(f){const x=Zn(o);return x.resolveFieldDataSource(f),x.hasSelectableField.value?(a.value=a.value||f,!0):!1}function d(f){return!(o.bindingEntityId&&o.bindingEntityId!==f.id||!u(f))}function p(f,x=""){var w;if(!f)return;const y=ge.cloneDeep(f),b=x?`${x}/${y.label}`:"/";t.set(y.label,b.replace("//","/"));const C=d(y),B={data:Object.assign({selectable:C},y),children:[]};if(y.type.entities&&y.type.entities.length){const g=y.type.entities.map(h=>p(h,b));B.children=B.children.concat(g)}return o.bindingEntityId===f.id&&(a.value=f),((w=a.value)==null?void 0:w.id)===f.id&&!x&&(l.value=!0),B}function m(){var b;const{formSchemaUtils:f}=n,x=(b=f.getFormSchema().module.entity[0])==null?void 0:b.entities[0];t.clear();const y=p(x);r.value=[y]}function E(){var x;const f=i.value.getSelectionRow();if(!f||!((x=f.raw)!=null&&x.data)){const y=new Mt;y.globalConfig={position:"top-center"},y.warning({message:"请先选择实体"});return}return f.raw.data}return{entityTreeGridRef:i,entityDataSource:r,resolveEntityDataSource:m,entityBindToMap:t,checkAndGetSelectedEntity:E,entityColumns:s,entityTreeRowOption:{customRowStatus:f=>(f.disabled=!f.raw.selectable,f)},initialSelectedEntity:a,isMainEntityInitialSelected:l}}const Yo=new Map([["appearance",be.resolveAppearance]]);function Xo(o,n){const{formSchemaUtils:t,designViewModelUtils:i}=n;function r(l,u){var d,p,m,E;return(p=(d=u==null?void 0:u.parentComponentInstance)==null?void 0:d.schema)==null||p.type,(E=(m=t.getFormSchema())==null?void 0:m.module)==null||E.templateId,l}function s(l){const u=o.getSchemaByType("component");return Object.assign(u,{id:`${l.componentId}-component`,contents:[],type:"wizard",appearance:{class:"h-100"},steps:[],clickable:!0,fill:!1,direction:"vertical",activeIndex:0}),u}function a(l){const u=s(l);return r(u,l)}return{createComponent:a}}function Ko(o,n,t,i){var s,a,l,u,d,p;const r=t.parentComponentInstance;if(r&&i){const m=Math.random().toString(36).slice(2,6),E={componentId:`step-${m}`,componentName:((s=t.bindingSourceContext)==null?void 0:s.entityTitle)||((l=(a=t.bindingSourceContext)==null?void 0:a.bindingEntity)==null?void 0:l.name)||`列表-${m}`,componentType:"step",parentContainerId:r.schema.id,parentComponentInstance:r,bindTo:((u=t.bindingSourceContext)==null?void 0:u.bindTo)||"",dataSource:(p=(d=t.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:p.label},{createComponent:c}=Xo(o,i);return c(E)}else return n}const Jo={$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},visible:{description:"",type:"boolean",default:!0},direction:{description:"排列方式",type:"enum",default:"horizontal"},steps:{description:"步骤条",type:"array"},activeIndex:{description:"当前索引",type:"number",default:-1},clickable:{description:"是否允许点击",type:"boolean",default:!0},fill:{description:"是否填充",type:"boolean",default:!0}},required:["id","type"]},It={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},visible:{type:Boolean,default:!0},onClick:{type:Function,default:()=>{}}},eo=be.createPropsResolver(It,Jo,Yo,Ko),Ge=e.defineComponent({name:"FStep",props:It,emits:["click"],setup(o,n){const t=e.ref(o.activeIndex),i=e.computed(()=>({"f-progress-step-list":o.direction==="horizontal","f-progress-step-list-block":o.direction==="vertical","f-progress-step-horizontal-fill":o.direction==="horizontal"&&o.fill,"f-progress-step-vertical-fill":o.direction==="vertical"&&o.fill})),r=e.computed(()=>({overflow:"auto"}));function s(y,b){const C={step:!0,active:b===t.value,clickable:o.clickable,current:b===t.value,finish:b<t.value};return y.status&&(C[y.status]=!0),Me.getCustomClass(C,y.class||"")}function a(y,b){if(!o.clickable)return;t.value=b;const C={step:y,stepIndex:b};n.emit("click",C)}function l(y,b){const C={"f-progressstep-row":!0,"step-active":b===t.value,"step-current":b===t.value,"step-finish":b<t.value};return y.status&&(C["step-"+y.status]=!0),C}function u(y,b){const C={"step-icon":!0,"step-success":b,"f-icon":b,"f-icon-check":b};return Me.getCustomClass(C,y.icon||"")}function d(y,b){const C=[];return y.icon?C.push(e.createVNode("span",{class:u(y,!1)},null)):b>=t.value?C.push(e.createVNode("span",{class:"step-icon"},[b+1])):C.push(e.createVNode("span",{class:u(y,!0)},null)),C}function p(y,b){return{"step-name":!0,"step-name-success":b<t.value}}function m(y,b){return e.createVNode("div",{class:"f-progress-step-title"},[e.createVNode("p",{class:p(y,b)},[y.title])])}function E(y,b){return{"f-progress-step-line":!0,"f-progress-step-line-success":b===t.value}}function c(y,b){return b!==o.steps.length-1}const f=e.computed(()=>({triangle:!0}));function x(){return o.steps.map((y,b,C)=>e.createVNode("li",{class:s(y,b),onClick:B=>a(y,b)},[n.slots.stepTemplate?n.slots.stepTemplate({step:y,index:b,length:C.length,activeIndex:t.value,direction:o.direction}):e.createVNode("div",{class:l(y,b)},[e.createVNode("div",{class:"f-progress-step-content"},[d(y,b),m(y,b)]),c(y,b)&&e.createVNode("div",{class:E(y,b)},[e.createVNode("span",{class:f.value},null)])])]))}return e.watch(()=>o.activeIndex,()=>{o.activeIndex>-1&&o.activeIndex<=o.steps.length&&(t.value=o.activeIndex)}),()=>o.visible&&e.createVNode("div",{class:"f-progress-step"},[e.createVNode("ul",{class:i.value,style:r.value},[x()])])}}),he={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:"标签页工具栏按钮"},"drawer-toolbar-item":{type:"drawer-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:"标签页工具栏"},"drawer-toolbar":{type:"drawer-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:"列表导航"},nav:{type:"nav",name:"标签类导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"},image:{type:"image",name:"图像"},avatar:{type:"avatar",name:"头像"},"discussion-editor":{type:"discussion-editor",name:"评论编辑区"},"discussion-list":{type:"discussion-list",name:"评论列表"},comment:{type:"comment",name:"评论区"},"rich-text-editor":{type:"rich-text-editor",name:"富文本",icon:"rich-text-box"},calendar:{type:"calendar",name:"日历",icon:"date-picker"},wizard:{type:"wizard",name:"向导",icon:"wizard"},"wizard-page":{type:"wizard-page",name:"向导页",icon:"wizard"},"wizard-page-detail":{type:"wizard-page-detail",name:"向导详情",icon:"wizard"},step:{type:"step",name:"步骤条",icon:"step"}};function Qo(o){const{formSchemaUtils:n,formStateMachineUtils:t}=o;function i(u,d=""){return{path:d+u.code,field:u.id,fullPath:u.code}}function r(u,d=""){const p=n.getViewModelById(u);return p?p.states.map(m=>i(m,d)):[]}function s(u){const d=n.getRootViewModelId(),p=r(u);if(u===d)return p;const m=r(d,"root-component.");return[...p,...m]}function a(u){return u.binding&&u.binding.path||u.id||""}function l(){return t&&t.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:l}}class Zo{constructor(n){pe(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'"}]);pe(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});pe(this,"getExpressionConverter",(n,t)=>({convertFrom:(i,r,s,a)=>{const l=s.getExpressionRuleValue(n,t||r);return l&&l.value||""},convertTo:(i,r,s,a,l)=>{var u;if(r==="dataPicking"&&(s!=null&&s.target)){const d=`${s.target}_dataPicking`;((u=s.rules)==null?void 0:u.some(m=>m.id===d&&m.value))?i.dictPickingExpressionId=d:delete i.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=n}getExpressionRule(n,t){const i=this.formSchemaService.getExpressions();if(!i)return"";const r=i.find(a=>a.target===n);if(!r)return"";const s=r.rules.find(a=>a.type===t);return s||""}getContextFormVariables(){const{module:n}=this.formSchemaService.getFormSchema();if(!n.viewmodels||n.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),i=this.formSchemaService.getViewModelById(t);if(!i||!i.states||i.states.length===0)return[];const r=[];return i.states.filter(s=>s.category==="remote").forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(n,t,i="label"){return{id:n.id,name:n.name,bindingPath:n[i],parents:t,type:"field"}}buildEntityFieldsTreeData(n=null,t){const i=[];return n==null||n.forEach(r=>{var l;const s=this.createTreeNode(r,t);let a=[];(l=r.type)!=null&&l.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),i.push({data:s,children:a,expanded:!0})}),i}buildChildEntityTreeData(n=null,t){const i=[];return n==null||n.forEach(r=>{var u,d;const s=this.createTreeNode(r,t);s.type="entity";const a=this.buildEntityFieldsTreeData((u=r.type)==null?void 0:u.fields,[...t,r.label]),l=this.buildChildEntityTreeData((d=r.type)==null?void 0:d.entities,[...t,r.label]);l!=null&&l.length&&(a==null||a.push(...l)),i.push({data:s,children:a||[],expanded:!0})}),i}getEntitiesTreeData(){const n=this.formSchemaService.getSchemaEntities();if(!(n!=null&&n.length))return[];const t=n[0];if(!(t!=null&&t.type))return[];const i=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(i==null||i.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:i||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(n,t,i){const r=i==="Field"?n.binding.field:n.id,s=this.getExpressionRule(r,t),a=this.getEntitiesAndVariables(),l={message:["validate","required","dataPicking"].includes(t)&&s?s.message:"",...a};return s.messageType!=null&&(l.messageType=s.messageType),l}buildRule(n,t,i,r){const{expression:s,message:a,messageType:l}=t,u={id:`${n}_${i}`,type:i,value:s};return(i==="validate"||i==="dataPicking"||i==="required")&&(u.message=a),i==="dataPicking"&&(u.messageType=l),i==="validate"&&r&&(u.elementId=r),u}getExpressionData(){const{expressions:n}=this.formSchemaService.getFormSchema().module;return n||[]}updateExpression(n,t,i,r){const s=t==="Field"?n.binding.field:n.id,a=this.buildRule(s,i,r,n.type==="form-group"?n.id:"");let u=this.getExpressionData().find(p=>p.targetType===t&&p.target===s);const d=p=>p.value.trim()==="";if(u){const p=u.rules.find(m=>m.id===a.id);if(p)d(a)?u.rules=u.rules.filter(m=>m.id!==a.id):(Object.assign(p,a),r==="validate"&&n.type==="form-group"&&(p.elementId=n.id));else{if(d(a))return null;u.rules=u.rules||[],u.rules.push(a)}}else{if(d(a))return null;u={target:`${s}`,rules:[a],targetType:t}}return u}getExpressionEditorOptions(n,t,i,r){return i.reduce((s,a)=>{var u,d;const l=t==="Field"?(u=n==null?void 0:n.binding)==null?void 0:u.field:n.id;return s[a]={hide:t==="Field"?!!((d=n==null?void 0:n.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(l),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(n,a,t),onSubmitModal:p=>{const m=this.updateExpression(n,t,p,a);if(r){const E=this.buildRule(l,p,a);r(E)}return m}}},s},{})}getExpressionInfo(n,t,i){const r=t==="Field"?n.binding.field:n.id,s=this.getExpressionRule(r,i),a={value:s&&s.value,targetId:r,targetType:t,expressionType:i};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(n,t,i=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!n.binding,properties:{...this.getExpressionEditorOptions(n,t,i,r)}}}getExpressionOptions(n,t,i){const r=this.getExpressionInfo(n,t,i);return{dialogTitle:`${this.expressionNames[i]}编辑器`,singleExpand:!1,showMessage:i==="required",beforeOpen:()=>this.onBeforeOpenExpression(n,i,t),expressionInfo:r}}}class ei{constructor(n,t){pe(this,"componentId");pe(this,"viewModelId");pe(this,"eventsEditorUtils");pe(this,"formSchemaUtils");pe(this,"formMetadataConverter");pe(this,"designViewModelUtils");pe(this,"designViewModelField");pe(this,"controlCreatorUtils");pe(this,"designerHostService");pe(this,"designerContext");pe(this,"schemaService",null);pe(this,"metadataService",null);pe(this,"propertyConfig",{type:"object",categories:{}});var i;this.componentId=n,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((i=this.formSchemaUtils)==null?void 0:i.getViewModelIdByComponentId(n))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService,this.designerContext=t.designerContext}getFormDesignerInstance(){var n,t;return(t=(n=this.designerContext)==null?void 0:n.instances)==null?void 0:t.formDesigner.value}getTableInfo(){var n;return(n=this.schemaService)==null?void 0:n.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(n){var i;const t=n.binding&&n.binding.type==="Form"&&n.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===t)}n.updateOn=(i=this.designViewModelField)==null?void 0:i.updateOn}}getBasicPropConfig(n){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:n.type,name:at.DgControl[n.type]&&at.DgControl[n.type].name}]}}}}}getAppearanceConfig(n=null,t={},i){const r={title:"外观",description:"Appearance"},s={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const a in t)s[a]=Object.assign(s[a]||{},t[a]);return{...r,properties:{...s},setPropertyRelates(a,l){if(a){switch(a&&a.propertyID){case"class":case"style":{at.canvasChanged.value++;break}}i&&i(a,n,l)}}}}getPropertyEditorParams(n,t=[],i="visible",r={},s={},a=""){const{getVariables:l,getControlName:u,getStateMachines:d}=Qo(this.designerHostService),p=this.getRealTargetType(n),m=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],E={type:"property-editor",propertyTypes:m};return m.map(c=>{switch(c){case"Const":Object.assign(E,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":E.expressionConfig=this.getExpressionOptions(n,p,a||i);break;case"StateMachine":E.stateMachines=d();break;case"Variable":Object.assign(E,{controlName:u(n),newVariablePrefix:"is",newVariableType:"Boolean",variables:l(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:f=>{f.value=l(this.viewModelId)}},s),this.designerContext.designerMode==="PC_RTC"&&(E.newVariablePrefix="ext_"+E.newVariablePrefix);break}}),E}getVisibleProperty(n,t=""){var s;let i=["Const","Variable","StateMachine","Expression"];return t==="gridFieldEditor"?i=["Const","Expression"]:t==="form-group"&&!((s=n.binding)!=null&&s.field)?i=["Const","Variable","StateMachine"]:(t==="dataGrid"||t==="treeGrid"||t==="wizard")&&(i=["Const","Variable","Expression"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(n,i,"visible")}}}getBehaviorConfig(n,t="",i={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(n,t);for(const u in i)a[u]=Object.assign(a[u]||{},i[u]);const l=this;return{...s,properties:{...a},setPropertyRelates(u,d){if(u){switch(u.propertyID){case"disabled":case"readonly":case"visible":l.afterMutilEditorChanged(n,u);break}r&&r(u,d)}}}}afterMutilEditorChanged(n,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,n)}updateElementByParentContainer(n,t){const i=t&&t.parent&&t.parent.schema;if(!i)return;const r=i.contents.findIndex(a=>a.id===n),s=ge.cloneDeep(i.contents[r]);i.contents.splice(r,1),i.contents.splice(r,0,s),at.refreshCanvas()}addNewVariableToViewModel(n,t){const i=n.propertyValue;if(!(i&&typeof i=="object")||!(i.type==="Variable"&&i.isNewVariable))return;const a={id:i.field,category:"locale",code:i.fullPath,name:i.fullPath,type:i.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete i.newVariableType,delete i.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(a)}updateExpressionValue(n){const t=n.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:s,expressionInfo:a}=t,{targetId:l,targetType:u,expressionType:d,value:p,message:m}=a,E=this.formSchemaUtils.getModule();E.expressions=E.expressions||[];const{expressions:c}=E;let f=c.find(y=>y.target===l);f||(f={target:l,rules:[],targetType:u},c.push(f));const x=f.rules.find(y=>y.type===d);if(x)x.value=p,x.message=m;else{const y={id:s,type:d,value:p,message:m};f.rules.push(y)}delete t.expressionInfo}clearExpression(n,t){const i=n.propertyValue;if(i&&i.type==="Expression")return;const s=n.propertyID,a=this.formSchemaUtils.getExpressions(),l=t.binding?t.binding.field:t.id,u=a.find(d=>d.target===l);!u||!u.rules||(u.rules=u.rules.filter(d=>d.type!==s))}getExpressionOptions(n,t,i){return new Zo(this.formSchemaUtils).getExpressionOptions(n,t,i)}getRealTargetType(n){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(n.type)>-1?"Button":n.binding&&n.binding.field?"Field":"Container"}createBaseEventProperty(n){const t={};return t[this.viewModelId]={type:"events-editor",editor:{initialData:n,viewSourceHandle:i=>{var r;((r=i.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(i)}}},t}}class ti extends ei{constructor(n,t){super(n,t)}getPropertyConfig(n){return this.getBasicPropConfig(n),this.getAppearanceProperties(),this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"step",{clickable:{description:"是否支持点击",title:"是否支持点击",type:"boolean"},steps:{title:"步骤条",type:"array",description:"是否填充",editor:{columns:[{field:"id",title:"值",dataType:"string"},{field:"title",title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:"id",nameField:"title",requiredFields:["id","title"],uniqueFields:["id","title"]},refreshPanelAfterChanged:!0}}),this.getEventPropConfig(n),this.propertyConfig}getBasicPropConfig(n){const t=super.getBasicPropConfig(n);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...t.properties}}}assembleSchemaEntityToTree(n,t,i,r="",s=[]){const a=r?`${r}/${n.label}`:"/";return s.push({id:n.id,name:n.name,label:n.label,layer:t,parent:i&&i.id,bindTo:a.replace("//","/")}),n.type.entities&&n.type.entities.length&&n.type.entities.map(l=>this.assembleSchemaEntityToTree(l,t+1,n,a,s)),s}getAppearanceProperties(){this.propertyConfig.categories.appearance={title:"外观",properties:{fill:{title:"是否填充",type:"boolean",description:"是否填充"},direction:{title:"排列方式",type:"enum",description:"排列方式",editor:{data:[{id:"vertical",name:"垂直"},{id:"horizontal",name:"水平"}]}}}}}getEventPropConfig(n){var a;const t=[{label:"onClick",name:"点击事件"}];(a=n.pagination)==null||a.enable;const i=this,r=i.eventsEditorUtils.formProperties(n,i.viewModelId,t),s=i.createBaseEventProperty(r);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,u){const d=l.propertyValue;delete n[i.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,i.eventsEditorUtils.saveRelatedParameters(n,i.viewModelId,d.events,d))}}}}function ni(o,n){const t=o.schema;function i(){return""}function r(p){return!1}function s(){return!0}function a(){return!0}function l(){return!0}function u(p){return new ti(p,n).getPropertyConfig(t)}function d(){var p,m,E,c;if(o&&n){const f=(p=o==null?void 0:o.componentInstance)==null?void 0:p.value.belongedComponentId;let x="",y="";const{formSchemaUtils:b}=n;if(f){const B=b.getRootViewModelId(),w=b.getComponentByViewModelId(B),g=b.selectNode(w,h=>h.contents&&h.contents.find(v=>v.component===f));(g==null?void 0:g.type)===((m=he["tab-page"])==null?void 0:m.type)&&((E=g==null?void 0:g.contents)!=null&&E.length)&&(x=g.title||""),(g==null?void 0:g.type)===((c=he.section)==null?void 0:c.type)&&(g==null?void 0:g.showHeader)!==!1&&(x=g.mainTitle||""),x=x?`${x} > `:"",y=x?g.id:""}const C=he["list-view"].name;n==null||n.formSchemaUtils.getControlBasicInfoMap().set(o.schema.id,{componentTitle:C,parentPathName:`${x}${C}`,reliedComponentId:y})}}return{canAccepts:r,checkCanDeleteComponent:s,checkCanMoveComponent:a,hideNestedPaddingInDesginerView:l,getPropsConfig:u,setComponentBasicInfoMap:d,getDesignerClass:i}}const oi=e.defineComponent({name:"FStepDesign",props:It,emits:[],setup(o,n){const t=e.ref(0),i=e.ref(0),r=e.ref(),s=e.inject("designer-host-service"),a=e.inject("design-item-context"),l=ni(a,s),u=at.useDesignerComponent(r,a,l);e.onMounted(()=>{r.value.componentInstance=u}),n.expose(u.value);const d=e.computed(()=>({"f-progress-step-list":o.direction==="horizontal","f-progress-step-list-block":o.direction==="vertical","f-progress-step-horizontal-fill":o.direction==="horizontal"&&o.fill,"f-progress-step-vertical-fill":o.direction==="vertical"&&o.fill})),p=e.computed(()=>({overflow:"auto"}));function m(h,v){const S={step:!0,active:v===t.value,clickable:o.clickable,"click-disable":h.disable,current:v===t.value};return v<t.value&&(S.finish=!0),h.status&&(S[h.status]=!0),h.hasOwnProperty("class")&&h.class.split(" ").reduce((P,A)=>(P[A]=!0,P),S),S}function E(h,v){}function c(h,v){const S={"f-progressstep-row":!0,"step-active":v===t.value,"step-current":v===t.value};return v<t.value&&(S["step-finish"]=!0),h.status&&(S["step-"+h.status]=!0),S}function f(h,v){const S={"step-icon":!0,"step-success":v,"k-icon":v,"k-i-check":v};return h.hasOwnProperty("icon")&&h.class.split(" ").reduce((P,A)=>(P[A]=!0,P),S),S}function x(h,v){const S=[];return h.icon?S.push(e.createVNode("span",{class:f(h,!1)},null)):v>=t.value||v===i.value?S.push(e.createVNode("span",{class:"step-icon"},[v+1])):S.push(e.createVNode("span",{class:f(h,!0)},null)),S}function y(h,v){return{"step-name":!0,"step-name-success":v<t.value}}function b(h,v){return e.createVNode("div",{class:"f-progress-step-title"},[e.createVNode("p",{class:y(h,v)},[h.title])])}function C(h,v){return{"f-progress-step-line":!0,"f-progress-step-line-success":v===t.value}}function B(h,v){return v!==o.steps.length-1}const w=e.computed(()=>({triangle:!0}));function g(){return o.steps.map((h,v)=>e.createVNode("li",{class:m(h,v),onClick:S=>void 0},[e.createVNode("div",{class:c(h,v)},[e.createVNode("div",{class:"f-progress-step-content"},[x(h,v),b(h,v)]),B(h,v)&&e.createVNode("div",{class:C(h,v)},[e.createVNode("span",{class:w.value},null)])])]))}return()=>e.createVNode("div",{ref:r,class:"f-progress-step"},[e.createVNode("ul",{class:d.value,style:p.value},[g()])])}});Ge.install=o=>{o.component(Ge.name,Ge)},Ge.register=(o,n,t,i)=>{o.step=Ge,n.step=eo},Ge.registerDesigner=(o,n,t)=>{o.step=oi,n.step=eo};const ii={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},jt=e.defineComponent({name:"FResponseForm",props:ii,emits:[],setup(o,n){const t=e.ref(),i=e.computed(()=>{const r=qe.LocaleService.getLocale(),s=o.customClass.split(" "),a={"drag-container":!0};return s.reduce((l,u)=>(l[u]=!0,l),a),o.adaptForLanguage&&r&&(a["farris-form-controls-inline"]=r!=="en"),a});return()=>o.visible&&e.withDirectives(e.createVNode("div",{ref:t,class:i.value,style:o.customStyle},[n.slots.default&&n.slots.default()]),[[e.resolveDirective("area-response")]])}}),ri={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},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:Object,default:""},linkLabel:{type:String,default:!1}},ai={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"},isLink:{type:Boolean,default:!1}},si=e.defineComponent({name:"FDynamicFormLabel",props:ai,emits:["clickLabel"],setup(o,n){e.ref(o.title||o.text);const t=e.ref(o.required),i=e.ref(o.text),r=e.ref(o.valid),s=e.ref(o.inValidTip);e.watch(()=>o.text,()=>{i.value=o.text}),e.watch(()=>o.required,(p,m)=>{p!==m&&(t.value=p)}),e.watch([()=>o.valid,()=>o.inValidTip],([p,m])=>{r.value=p,s.value=m});const a=e.computed(()=>r.value?i.value:s.value),l=e.computed(()=>r.value?"":"color:red"),u=e.computed(()=>({"col-form-label":!0,"f-width-auto":t.value&&(o.showType==="none"||!i.value),"f-pretend-link":o.isLink})),d=e.computed(()=>o.showType==="force-none"?!1:o.showType==="reserve-space"||t.value||!!i.value&&o.showType!=="none");return()=>d.value&&e.createVNode("label",{class:u.value,title:a.value,style:l.value,onClick:()=>n.emit("clickLabel")},[!r.value&&e.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:s.value},null),e.createVNode("span",{class:"farris-label-text"},[t.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),o.showType==="visible"&&i.value])])}}),{globalStorageKey:li}=Me.useThirdComponent(),R={},U={},H={},$={};async function ci(){{const o={schemaMap:be.schemaMap,propertyConfigSchemaMap:be.propertyConfigSchemaMap,propertyEffectMap:be.propertyEffectMap,schemaResolverMap:be.schemaResolverMap};Rt.register(R,U,H,$),zt.register(R,U,H,$),Ut.register(R,U,H,$),Ht.register(R,U,H,$),_t.register(R,U,H,$),$t.register(R,U,H,$,o),Wt.register(R,U,H,$),Tt.register(R,U,H,$,o),ht.register(R,U,H,$,o),Tt.register(R,U,H,$,o),ht.register(R,U,H,$,o),Gt.register(R,U,H,$,o),go.register(R,U,H,$),Yt.register(R,U,H,$),Kt.register(R,U,H,$,o),Xt.register(R,U,H,$),Jt.register(R,U,H,$,o),Qt.register(R,U,H,$,o),Zt.register(R,U,H,$),en.register(R,U,H,$,o),ho.register(R,U,H,$),Eo.register(R,U,H,$),tn.register(R,U,H,$),vo.register(R,U,H,$),wo.register(R,U,H,$),on.register(R,U,H,$),rn.register(R,U,H,$,o),an.register(R,U,H,$,o),ln.register(R,U,H,$,o),sn.register(R,U,H,$),cn.register(R,U,H,$,o),yo.register(R,U,H,$),un.register(R,U,H,$),dn.register(R,U,H,$),fn.register(R,U,H,$,o),mn.register(R,U,H,$),pn.register(R,U,H,$,o),gn.register(R,U,H,$),hn.register(R,U,H,$),vn.register(R,U,H,$),yn.register(R,U,H,$,o),Cn.register(R,U,H,$,o),bn.register(R,U,H,$),xn.register(R,U,H,$,o),Sn.register(R,U,H,$),wn.register(R,U,H,$),Co.register(R,U,H),Tn.register(R,U,H,$),Nn.register(R,U,H,$,o),En.register(R,U,H,$),Mn.register(R,U,H,$),Vn.register(R,U,H,$),In.register(R,U,H,$,o),xo.register(R,U,H,$),jn.register(R,U,H,$,o),Dn.register(R,U,H,$),Bn.register(R,U,H,$),Fn.register(R,U,H,$,o),kn.register(R,U,H,$),Pn.register(R,U,H,$),Ln.register(R,U,H,$),On.register(R,U,H,$),qn.register(R,U,H,$),An.register(R,U,H,$,o),zn.register(R,U,H,$),nn.register(R,U,H,$),bo.register(R,U,H,$),Rn.register(R,U,H,$,o),So.register(R,U,H,$),Un.register(R,U,H,$),To.register(R,U,H,$),No.register(R,U,H,$),Mo.register(R,U,H,$),Hn.register(R,U,H,$,o),Vo.register(R,U,H,$),Io.register(R,U,H,$),_n.register(R,U,H,$),$n.register(R,U,H,$,o),Wn.register(R,U,H,$,o),Gn.register(R,U,H,$),Yn.register(R,U,H,$);const n=window[li];if(n)for(const t in n)n[t].createPropsResolver=be.createPropsResolver,n[t].register(R,U,H)}}function to(){ci();function o(a){const l=R[a];if(!l)throw new Error(`Could not find the editor of type '${a}'`);return l}function n(a,l){const u=U[a];return u?u(l):{}}function t(a){switch(a){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function i(a){switch(a){case"combo-list":case"input-group":case"textarea":return"onClear"}}function r(a){switch(a){case"input-group":case"textarea":return"onMousedownEvent"}}function s(a){switch(a){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:n,resolveEditorType:o,getChangeFunctionName:t,getClearFunctionName:i,getMousedownFunctionName:r,getMouseupFunctionName:s}}const ui={errors:{type:Object,default:null}},di=e.defineComponent({name:"FValidationMessage",props:ui,emits:[],setup(o,n){const t=e.ref(o.errors);e.watch(()=>o.errors,s=>{t.value=s});const i=e.ref(!0),r=e.computed(()=>{if(t.value){const s=Object.keys(t.value).map(a=>{var l;return(l=t.value[a])==null?void 0:l.name});return s.length?s.join(" "):""}return""});return()=>r.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>i.value=!i.value},[!i.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),i.value&&e.createVNode("span",{class:"f-feedback-message"},[r.value])])}}),bt=e.defineComponent({name:"FDynamicFormGroup",props:ri,emits:["change","update:modelValue","clickLabel"],setup(o,n){var F;const t=e.ref(o.id),i=e.ref(o.customClass),r=e.ref(o.editor),s=e.ref(o.label),a=e.ref(o.modelValue),l=e.ref(o.readonly),u=e.ref(((F=o.editor)==null?void 0:F.required)||o.required),d=e.ref(o.showLabel),p=e.ref(o.visible);e.ref(o.type);const m=e.ref(),E=e.ref(o.errors),c=Me.isMobilePhone(),f=e.ref(o.editor.type||"input-group"),x=e.computed(()=>d.value?o.showLabelType:"none"),{resolveEditorProps:y,resolveEditorType:b,getChangeFunctionName:C,getClearFunctionName:B}=to(),w=e.computed(()=>{const D={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":l.value,"align-items-start":r.value.type==="textarea"||r.value.type==="rich-text-editor","form-group--in-mobile":c};return D["form-group--has-"+f.value]=!0,D}),g=e.computed(()=>{if(o.fill)return{maxWidth:"none"}});function h(D,q,M){a.value=q!==void 0?q:D,n.emit("update:modelValue",a.value),n.emit("change",a.value,{newValue:D,newModelValue:q,parameters:M})}function v(){n.emit("update:modelValue","")}function S(D){return(...q)=>{v(),typeof D=="function"&&D(...q)}}function P(D){return(q,M,W)=>{h(q,M,W),typeof D=="function"&&D(q,M,W)}}const A=e.computed(()=>{const D=r.value.type||"input-group",q=b(D),M=y(D,r.value),W=C(D),I=B(r.value.type);return I&&(M[I]=S(M[I])),W&&(M[W]=P(M[W])),(M.id==null||M.id==="")&&(M.id=t.value),D==="number-range"&&r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"?(r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"&&(M.onBeginValueChange=r.value.onBeginValueChange),r.value.onEndValueChange&&typeof r.value.onEndValueChange=="function"&&(M.onEndValueChange=r.value.onEndValueChange)):D==="lookup"&&r.value["onUpdate:idValue"]&&typeof r.value["onUpdate:idValue"]=="function"?(M["onUpdate:idValue"]=r.value["onUpdate:idValue"],M.id=t.value):D==="collection-property-editor"&&r.value.onSelectionChange&&typeof r.value.onSelectionChange=="function"?M.onSelectionChange=r.value.onSelectionChange:D==="property-editor"&&(M.onBeforeOpenVariables=r.value.onBeforeOpenVariables),()=>e.createVNode(q,e.mergeProps({ref:m},M,{modelValue:a.value,"onUpdate:modelValue":O=>a.value=O}),n.slots)});function N(){return e.createVNode(di,{id:`${t.value}-validation-message`,errors:E.value},null)}e.watch([()=>o.id,()=>o.customClass,()=>o.editor,()=>o.label,()=>o.modelValue,()=>o.readonly,()=>o.required,()=>o.showLabel,()=>o.visible,()=>o.errors],([D,q,M,W,I,O,te,T,L,ne])=>{var ee;t.value=D,i.value=q,r.value=M,s.value=W,a.value=I,l.value=O,u.value=((ee=r.value)==null?void 0:ee.required)||te,d.value=T,p.value=L,E.value=ne});function z(D){n.emit("clickLabel",D)}return n.expose({editorRef:m}),()=>p.value&&e.createVNode("div",{id:`${t.value}-form-group`,class:i.value,style:o.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:g.value},[e.createVNode("div",{class:w.value},[e.createVNode(si,{id:`${t.value}-lable`,showType:x.value,required:u.value,text:s.value,title:s.value,isLink:!!o.linkLabel,onClickLabel:z},null),e.createVNode("div",{class:"farris-input-wrap"},[A.value(),N()]),o.enableTips&&e.createVNode(jo,{content:o.tipsContent},{default:()=>[e.createVNode("span",{class:"farris-label-tips ml-1"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])]})])])])}}),fi={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},no=e.defineComponent({name:"FDynamicFormInput",props:fi,emits:["change","update:modelValue","mousedown","mouseup"],setup(o,n){const t=e.ref(o.id),i=e.ref(o.editor),r=e.ref(o.modelValue),{resolveEditorProps:s,resolveEditorType:a,getChangeFunctionName:l,getMousedownFunctionName:u,getMouseupFunctionName:d,getClearFunctionName:p}=to();function m(C,B,w){r.value=B!==void 0?B:C,n.emit("update:modelValue",r.value),n.emit("change",r.value,{newValue:C,newModelValue:B,parameters:w})}function E(C){n.emit("mousedown",C)}function c(C){n.emit("mouseup",C)}function f(){n.emit("update:modelValue","")}function x(C){return(...B)=>{f(),typeof C=="function"&&C(...B)}}function y(C){return(B,w,g)=>{m(B,w,g),typeof C=="function"&&C(B,w,g)}}const b=e.computed(()=>{const C=a(i.value.type),B=s(i.value.type,i.value);B.focusOnCreated=o.focusOnCreated,B.selectOnCreated=o.selectOnCreated;const w=l(i.value.type),g=p(i.value.type);g&&(B[g]=x(B[g])),w&&(B[w]=y(B[w]));const h=u(i.value.type);B[h]=E;const v=d(i.value.type);return B[v]=c,B.id=t.value,()=>e.createVNode(C,e.mergeProps(B,{modelValue:r.value,"onUpdate:modelValue":S=>r.value=S}),null)});return e.watch([()=>o.id,()=>o.editor,()=>o.modelValue],([C,B,w])=>{t.value=C,i.value=B,r.value=w}),()=>b.value()}});jt.install=o=>{o.component(jt.name,jt).component(no.name,no).component(bt.name,bt)};const mi=e.defineComponent({name:"FEntityBindingSelector",props:_o,emits:["submit","cancel"],setup(o,n){const t=Go(o),{entityColumns:i,entityTreeGridRef:r,entityDataSource:s,checkAndGetSelectedEntity:a,resolveEntityDataSource:l,entityTreeRowOption:u,initialSelectedEntity:d,isMainEntityInitialSelected:p}=t,m=Zn(o),{fieldColumns:E,resolveFieldDataSource:c,fieldDataSource:f,fieldTreeGridRef:x,fieldTreeRowOption:y,fieldSelectionOption:b,checkAndGetSelectedFields:C,currentComponentType:B}=m,w=new Mt;w.globalConfig={position:"top-center"};const g=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],h=e.ref(),v=e.ref(""),S=e.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),P=e.ref(0),A=e.ref(""),N=e.computed(()=>L=>({"f-utils-fill":!0,border:L!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":S.value[P.value].id!==L}));function z(){o.bindingEntityId&&(d!=null&&d.value)&&(v.value=d.value.name),o.componentType||(h.value=p.value?"response-form":"data-grid")}function F(){const L=a();L&&(c(L),x.value.updateDataSource(f.value))}e.onBeforeMount(()=>{o.steps&&(S.value=S.value.filter(L=>o.steps.includes(L.id))),A.value=S.value[0].id,l(),z()}),e.onMounted(()=>{var L,ne;r&&((L=d.value)!=null&&L.id)&&r.value.selectRowById((ne=d.value)==null?void 0:ne.id),S.value.length===1&&S.value[0].id==="selectFields"&&F()});function D(L){var ne;(ne=x==null?void 0:x.value)!=null&&ne.emptyCurrentRowId&&x.value.emptyCurrentRowId()}function q(){return e.createVNode(Vt,{key:1,ref:r,fit:!0,data:s.value,idField:"id",columns:i.value,rowNumber:{enable:!1},"row-option":u,columnOption:{fitColumns:!0}},null)}function M(){return e.createVNode(Vt,{key:2,ref:x,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:f.value,idField:"id",columns:E.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":y,selection:b},null)}function W(){const L={editable:!1,type:"combo-list",data:g,idField:"value",valueField:"value",textField:"name"},ne={type:"input-group",enableClear:!1};return e.createVNode("div",null,[e.createVNode("div",{class:"f-utils-fill"},[e.createVNode("div",{class:"f-section py-0"},[e.createVNode("div",{class:"f-section-header"},[e.createVNode("div",{class:"f-title"},[e.createVNode("h4",{class:"f-title-text"},[e.createTextVNode("组件信息")])])]),e.createVNode("div",{class:"f-section-content"},[e.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[e.createVNode(bt,{label:"组件类型",customClass:"col-12",modelValue:h.value,"onUpdate:modelValue":ee=>h.value=ee,required:"true",editor:L,onChange:D},null),e.createVNode(bt,{label:"组件标题",customClass:"col-12",modelValue:v.value,"onUpdate:modelValue":ee=>v.value=ee,required:"true",editor:ne},null)])])])])])}function I(){P.value--,A.value=S.value[P.value].id}function O(){var L;switch(A.value){case"selectEntity":{F();break}case"selectComponentType":{if(!h.value){w.warning("请先选择组件类型");return}if(!((L=v.value)!=null&&L.trim())){w.warning("请先填写组件标题");return}B.value=h.value,c(d.value),x.value.updateDataSource(f.value);break}}P.value++,A.value=S.value[P.value].id}function te(){n.emit("cancel")}function T(){var ee;const L=a(),ne=C();if(L){const Q={bindingType:"entity"};Q.bindingEntity=L,Q.bindTo=t.entityBindToMap.get(((ee=Q.bindingEntity)==null?void 0:ee.label)||""),Q.bindingEntityFields=ne,Q.entityTitle=v.value,n.emit("submit",{bindingContext:Q,componentType:h.value})}}return()=>{var L;return e.createVNode("div",{class:"h-100 d-flex flex-column"},[((L=S.value)==null?void 0:L.length)>1?e.createVNode(Ge,{steps:S,activeIndex:P,style:"align-self:center"},null):"",e.createVNode("div",{class:N.value("selectEntity"),style:"border-radius:10px;"},[q()]),e.createVNode("div",{class:N.value("selectComponentType"),style:"border-radius:10px;"},[W()]),e.createVNode("div",{class:N.value("selectFields"),style:"border-radius:10px;"},[M()]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{class:"btn btn-secondary",onClick:te},[e.createTextVNode("取消")]),P.value!==0?e.createVNode("button",{class:"btn btn-secondary",onClick:I},[e.createTextVNode("上一步")]):"",P.value!==S.value.length-1?e.createVNode("button",{class:"btn btn-primary",onClick:O},[e.createTextVNode("下一步")]):"",P.value===S.value.length-1?e.createVNode("button",{class:"btn btn-primary",onClick:T},[e.createTextVNode("确定")]):""])])}}});function oo(o){let n,t;function i(w,g,h){var S;const v={componentType:w.getAttribute("data-controltype")||"",componentFeature:w.getAttribute("data-feature")||"",componentCategory:w.getAttribute("data-category")||"",label:w.getAttribute("data-controlTypeName")||"",sourceType:w.getAttribute("data-sourceType")||"move",parentComponentInstance:h.componentInstance.value,sourceElement:w,sourceContainer:g,targetContainer:h,bindingSourceContext:null,bindingTargetId:w.getAttribute("data-fieldId")||""};return w.componentInstance&&(v.componentType=(S=w.componentInstance.value.schema)==null?void 0:S.type),v}function r(w){var v,S;const{bindingContext:g,componentType:h}=w;t.bindingSourceContext=g,h&&(t.componentType=h),(v=n==null?void 0:n.modalRef)!=null&&v.value.close&&((S=n==null?void 0:n.modalRef)==null||S.value.close())}function s(){var w,g;t.bindingSourceContext=void 0,(w=n==null?void 0:n.modalRef)!=null&&w.value.close&&((g=n==null?void 0:n.modalRef)==null||g.value.close())}function a(){const{componentType:w,bindingTargetId:g,parentComponentInstance:h}=t;let v=[];return w&&(w==="list-view"||w==="calendar"?v=["selectEntity"]:v=["selectEntity","selectFields"]),g&&(v=["selectComponentType","selectFields"]),()=>e.createVNode(e.Fragment,null,[e.createVNode(mi,{componentType:w,bindingEntityId:g,steps:v,designerHostService:o,targetComponentInstance:h,onSubmit:r,onCancel:s},{default:()=>[e.createTextVNode(" ")]}),e.createTextVNode(" ")])}function l(){return new Promise((w,g)=>{const{componentType:h}=t,v=h==="list-view"||h==="calendar";n=o.modalService.open({title:"选择绑定",width:v?550:800,height:v?400:600,fitContent:!1,showButtons:!1,render:a(),enableEsc:!1,rejectCallback:()=>{t.bindingSourceContext=void 0},closedCallback:()=>{w(t)},draggable:!0})})}function u(){var w,g;t.bindingSourceContext=void 0,(w=n==null?void 0:n.modalRef)!=null&&w.value.close&&((g=n==null?void 0:n.modalRef)==null||g.value.close())}function d(w){let g="",h="";return he["field-set"]&&w.schema.type===he["field-set"].type&&(g=w.schema.id,h=w.schema.title),{groupId:g,groupName:h}}function p(w){var A,N;if(!w||!w.selectedData||!w.bindingType)return;const{selectedData:g,bindingType:h}=w,{groupId:v,groupName:S}=d(t.parentComponentInstance),P={bindingType:"field"};if(h==="Form"){const z=g;P.entityFieldNode=z,P.designViewModelField=ge.merge({},z,{groupId:v,groupName:S}),t.bindingSourceContext=P}else{const z=g;P.variableFieldNode=ge.merge({},z,{groupId:v,groupName:S}),t.bindingSourceContext=P}(A=n==null?void 0:n.modalRef)!=null&&A.value.close&&((N=n==null?void 0:n.modalRef)==null||N.value.close())}function m(){var w,g;t.bindingSourceContext=null,(w=n==null?void 0:n.modalRef)!=null&&w.value.close&&((g=n==null?void 0:n.modalRef)==null||g.value.close())}function E(){const{parentComponentInstance:w}=t,h={viewModelId:o.formSchemaUtils.getViewModelIdByComponentId(w==null?void 0:w.belongedComponentId),designerHostService:o,disableOccupiedFields:!0,componentSchema:{editor:{type:t.componentType}}},v={enable:!1};return()=>e.createVNode(e.Fragment,null,[e.createVNode(nn.FBindingSelectorContainer,{editorParams:h,showCustomFooter:!0,bindingType:v,onSubmit:p,onCancel:u,onSkip:m},{default:()=>[e.createTextVNode(" ")]}),e.createTextVNode(" ")])}function c(){return new Promise((w,g)=>{n=o.modalService.open({title:"选择绑定",width:800,height:600,fitContent:!1,showButtons:!1,render:E(),enableEsc:!1,rejectCallback:()=>{t.bindingSourceContext=void 0},closedCallback:()=>{w(t)},draggable:!0})})}function f(){const{formSchemaUtils:w}=o,g=t.parentComponentInstance.belongedComponentId,h=new Set,v=w.getFormSchema().module,S=v.components.find(z=>z.id===g),P=w.getViewModelById(S.viewModel);let A=S.componentType;const N=w.checkComponentExistInDrawer(S.id);return(A==="frame"||A==="table")&&(A="form"),v.viewmodels.forEach(z=>{if(!z.fields||z.fields.length===0)return;const F=v.components.find(M=>M.viewModel===z.id);let{componentType:D}=F;if((D==="frame"||D==="table")&&(D="form"),D!==A||z.bindTo!==P.bindTo)return;const q=w.checkComponentExistInDrawer(F.id);N&&q&&z.fields.forEach(M=>{h.add(M.id)}),!N&&!q&&z.fields.forEach(M=>{h.add(M.id)})}),h}function x(){const{bindingTargetId:w,parentComponentInstance:g}=t;if(!w){t.bindingSourceContext=void 0;return}if(f().has(w)){const v=new Do.FNotifyService;v.globalConfig={position:"top-center"},v.warning("表单已经包含此字段,请勿重复添加"),t.bindingSourceContext=void 0;return}else{const v={bindingType:"field"},S=o.formSchemaUtils.getComponentById(g.belongedComponentId),P=o.schemaService.getFieldByIDAndVMID(w,S.viewModel),A=ge.merge({},P.schemaField);v.entityFieldNode=A;const{groupId:N,groupName:z}=d(t.parentComponentInstance);v.designViewModelField=ge.merge({},A,{groupId:N,groupName:z}),t.bindingSourceContext=v}}function y(){return t.bindingTargetId?x():c()}function b(){const{parentComponentInstance:w}=t,g=w.addNewChildComponentSchema(t,o);t.componentSchema=g}async function C(){const{componentCategory:w}=t;switch(w){case"input":{await y();break}case"dataCollection":{await l();break}}}async function B(w,g,h){return t=i(w,g,h),await C(),t.bindingSourceContext===void 0?null:(b(),t)}return{getComponentResolveContext:i,resolveComponentCreationContextByDrop:B}}function pi(o,n){let t;function i(c,f,x){var b,C;if(c.contains(f)||f.classList.contains("no-drop"))return!1;const y=!0;if(c.componentInstance&&c.componentInstance.value.getDragScopeElement){const B=c.componentInstance.value.getDragScopeElement();if(B&&!B.contains(f))return!1}if((C=(b=f.componentInstance)==null?void 0:b.value)!=null&&C.externalContainerId)return!1;if(f.componentInstance&&f.componentInstance.value.canAccepts){const w=oo(o).getComponentResolveContext(c,x,f);return f.componentInstance.value.canAccepts(w)}return y}function r(c,f){const x=f.getBoundingClientRect(),y=c.getBoundingClientRect(),b=y.top>=x.top,C=y.top<x.bottom;return b&&C}function s(c,f){const x=c.querySelector(".dgComponentSelected");if(!(!x||f===0)&&r(x,c)){const y=x.querySelector(".component-btn-group");if(y){const b=y.querySelector("div");if(b&&b.style.top){const C=Number.parseFloat(b.style.top);b.style.top=C-f+"px"}}}}function a(c,f,x){let y=-1;if(!f)return-1;if(c.componentInstance.value.contents)if(x&&x.componentInstance){if(x.getAttribute("data-noattach"))y=Number(x.getAttribute("data-position"));else{const b=x.componentInstance.value.schema;let C={id:b.id};b.type==="component"&&(C={component:b.id}),y=ge.findIndex(c.componentInstance.value.contents,C),y=y===-1?0:y}y!==-1&&c.componentInstance.value.contents.splice(y,0,f)}else c.componentInstance.value.contents.push(f);return y}function l(c,f,x,y){oo(o).resolveComponentCreationContextByDrop(c,x,f).then(C=>{if(!C)return;const B=C.componentSchema;B&&(n!=null&&n.appendIdentifyForNewControl&&n.appendIdentifyForNewControl(B),a(f,B,y))}),f.contains(c)&&f.removeChild(c)}function u(c,f,x,y){let b,C=-1;if(c.componentInstance&&c.componentInstance.value.triggerBelongedComponentToMoveWhenMoved){const g=c.componentInstance.value.getBelongedComponentInstance(c.componentInstance);g&&(c=e.ref(g.elementRef).value.parentElement,x=c.parentElement)}const B=c.componentInstance&&c.componentInstance.value.schema;let w={id:B&&B.id};(B==null?void 0:B.type)==="component"&&(w={component:B&&B.id}),C=ge.findIndex(x.componentInstance.value.contents,w),C!==-1&&x.componentInstance.value.contents&&(b=x.componentInstance.value.contents.splice(C,1),b=b[0]),a(f,b,y),x.componentInstance&&x.componentInstance.value.onChildElementMovedOut&&x.componentInstance.value.onChildElementMovedOut(c),f.componentInstance&&f.componentInstance.value.onAcceptMovedChildElement&&f.componentInstance.value.onAcceptMovedChildElement(c,x)}function d(c,f,x,y){if(!f||c.contains(f))return;switch(c.getAttribute("data-sourceType")){case"control":case"field":case"entity":{l(c,f,x,y);break}default:x.componentInstance.value.contents?u(c,f,x,y):f.contains(c)&&f.removeChild(c)}Ae.value++}function p(c){t&&t.destroy(),Qn&&(t=Qn([],{mirrorContainer:c,direction:"mixed",revertOnSpill:!0,moves(f,x,y){let b=!0;return f.classList.contains("no-drag")&&(b=!1),f.componentInstance&&(b=!!y.getAttribute("data-dragging-icon")),b},copy(f){return f.classList.contains("drag-copy")},getMirrorText(f){return f.componentInstance&&f.componentInstance.value.getDraggingDisplayText?f.componentInstance.value.getDraggingDisplayText():f.innerText||"控件"},accepts(f,x,y){const b=i(f,x,y),C=c.lastElementChild;return b?C.className=C.className.replace("undroppable",""):C.className.includes("undroppable")||(C.className+=" undroppable"),b}}).on("over",(f,x)=>{x.className+=" drag-over"}).on("out",(f,x)=>{x.className=x.className.replace("drag-over","").replace(" ","")}).on("drop",(f,x,y,b)=>{d(f,x,y,b)}).on("dragend",(f,x)=>{s(c,x)}))}function m(c,f){if(!c)return;if(f.noDragDrop)return c;const x=c.querySelector(`[data-dragref='${f.id}-container']`)||c;t&&x&&t.containers.push(x)}function E(){return t}return{attachComponents:m,initializeDragula:p,getDragulaInstance:E}}const gi={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1}},K={},J={},Z={},{globalStorageKey:hi}=Me.useThirdComponent();function vi(){{const o={schemaMap:be.schemaMapForDesigner,propertyConfigSchemaMap:be.propertyConfigSchemaMapForDesigner,propertyEffectMap:be.propertyEffectMapForDesigner,schemaResolverMap:be.schemaResolverMapForDesigner};Rt.registerDesigner(K,J,Z,o),zt.registerDesigner(K,J,Z,o),Ut.registerDesigner(K,J,Z,o),Ht.registerDesigner(K,J,Z,o),$t.registerDesigner(K,J,Z,o),Wt.registerDesigner(K,J,Z,o),Tt.registerDesigner(K,J,Z,o),ht.registerDesigner(K,J,Z,o),ht.registerDesigner(K,J,Z,o),Xt.registerDesigner(K,J,Z,o),Gt.registerDesigner(K,J,Z,o),Kt.registerDesigner(K,J,Z,o),Qt.registerDesigner(K,J,Z,o),Jt.registerDesigner(K,J,Z,o),Zt.registerDesigner(K,J,Z),en.registerDesigner(K,J,Z,o),_n.registerDesigner(K,J,Z),tn.registerDesigner(K,J,Z,o),on.registerDesigner(K,J,Z,o),rn.registerDesigner(K,J,Z,o),an.registerDesigner(K,J,Z,o),ln.registerDesigner(K,J,Z,o),sn.registerDesigner(K,J,Z),un.registerDesigner(K,J,Z),cn.registerDesigner(K,J,Z,o),$n.registerDesigner(K,J,Z,o),dn.registerDesigner(K,J,Z,o),fn.registerDesigner(K,J,Z,o),mn.registerDesigner(K,J,Z),pn.registerDesigner(K,J,Z,o),gn.registerDesigner(K,J,Z),hn.registerDesigner(K,J,Z,o),vn.registerDesigner(K,J,Z,o),yn.registerDesigner(K,J,Z,o),Cn.registerDesigner(K,J,Z,o),xn.registerDesigner(K,J,Z,o),Sn.registerDesigner(K,J,Z,o),wn.registerDesigner(K,J,Z,o),bn.registerDesigner(K,J,Z,o),Tn.registerDesigner(K,J,Z,o),Nn.registerDesigner(K,J,Z,o),En.registerDesigner(K,J,Z),Mn.registerDesigner(K,J,Z,o),Vn.registerDesigner(K,J,Z,o),In.registerDesigner(K,J,Z,o),jn.registerDesigner(K,J,Z,o),Dn.registerDesigner(K,J,Z,o),Bn.registerDesigner(K,J,Z),Fn.registerDesigner(K,J,Z,o),kn.registerDesigner(K,J,Z,o),Pn.registerDesigner(K,J,Z,o),On.registerDesigner(K,J,Z,o),Ln.registerDesigner(K,J,Z),Yt.registerDesigner(K,J),qn.registerDesigner(K,J,Z),An.registerDesigner(K,J,Z),zn.registerDesigner(K,J,Z),Rn.registerDesigner(K,J,Z,o),Un.registerDesigner(K,J,Z),Hn.registerDesigner(K,J,Z,o),Wn.registerDesigner(K,J,Z),Gn.registerDesigner(K,J,Z),_t.registerDesigner(K,J,Z),Yn.registerDesigner(K,J,Z);const n=window[hi];if(n)for(const t in n)n[t].createPropsResolver=be.createPropsResolver,n[t].registerDesigner(K,J,Z)}}function yi(o){const n={schemaMap:be.schemaMapForDesigner,propertyConfigSchemaMap:be.propertyConfigSchemaMapForDesigner,propertyEffectMap:be.propertyEffectMapForDesigner,schemaResolverMap:be.schemaResolverMapForDesigner};o.forEach(t=>{t.registerDesigner&&t.registerDesigner(K,J,Z,n)})}const Ci={id:{type:String}},bi=e.defineComponent({name:"FDesignerPlaceholder",props:Ci,emits:[],setup(o){const n=e.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),t=e.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>e.createVNode("div",{class:n.value,style:t.value,role:"alert","data-noattach":"true","data-position":"0"},[e.createTextVNode("拖拽组件到这里")])}});function wi(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const wt=e.defineComponent({name:"FDesignerItem",props:gi,emits:["selectionChange","dragEnd"],setup(o,n){const t=e.ref(`${o.modelValue.id}-component`),i=e.ref(o.canMove),r=e.ref(o.canDelete),s=e.ref(!1),a=e.ref(o.modelValue),l=e.ref(o.componentId||""),u=e.ref(""),d=e.ref(""),p=e.ref(o.customClass),m=e.ref(),E=e.inject("canvas-dragula"),c=e.ref(),f=e.inject("design-item-context");function x(T){T&&Object.assign(a.value,T)}const y={designerItemElementRef:m,componentInstance:c,schema:a.value,parent:f,setupContext:n,updateContextSchema:x};e.provide("design-item-context",y);const b=e.inject("useFormSchema"),C=e.inject("designer-host-service"),B=e.inject("external-container-id"),w=e.computed(()=>{var Q,se,ce;const T=(Q=c.value)!=null&&Q.shouldApplyClassToComponent?(se=c.value)==null?void 0:se.shouldApplyClassToComponent():!0,L=o.modelValue.appearance&&o.modelValue.appearance.class||"",ne=((ce=c.value)==null?void 0:ce.getCustomButtons)&&c.value.getCustomButtons();let ee={"farris-component":!0,"flex-fill":a.value.id==="root-component","position-relative":i.value&&r.value||(ne==null?void 0:ne.length),"farris-nested":s.value,"can-move":i.value,"d-none":m.value&&m.value.classList.contains("d-none"),dgComponentSelected:m.value&&m.value.classList.contains("dgComponentSelected"),dgComponentFocused:m.value&&m.value.classList.contains("dgComponentFocused")};return ee[`farris-component-${a.value.type}`]=!0,ee=T?Me.getCustomClass(ee,L):ee,ee=Me.getCustomClass(ee,d.value),ee=Me.getCustomClass(ee,p.value),ee}),g=e.computed(()=>{var ee,Q;const T={},L=(ee=c.value)!=null&&ee.shouldApplyClassToComponent?(Q=c.value)==null?void 0:Q.shouldApplyClassToComponent():!0,ne=o.modelValue.appearance&&o.modelValue.appearance.style||"";return ne&&L&&ne.split(";").reduce((se,ce)=>{const[re,X]=ce.split(":");return se[re]=X,se},T),u.value&&u.value.split(";").reduce((se,ce)=>{const[re,X]=ce.split(":");return re&&(se[re]=X),se},T),T});function h(T,L){var Q,se,ce;if(T&&(T.preventDefault(),T.stopPropagation()),(Q=C==null?void 0:C.designerContext)!=null&&Q.checkCanDeleteControl&&!C.designerContext.checkCanDeleteControl(L))return;if(c.value.triggerBelongedComponentToDeleteWhenDeleted){const re=c.value.getBelongedComponentInstance(c);if(re&&re.parent){const X=e.ref(re==null?void 0:re.parent),de=X.value.contents.findIndex(ze=>ze.id===re.schema.id);(ce=(se=X.value)==null?void 0:se.contents)==null||ce.splice(de,1),Ae.value++}return}c.value.onRemoveComponent(C);let ne=f,ee=re=>re.id===L.id;if(L.type==="component"&&(ne=f==null?void 0:f.parent,ee=re=>re.component===L.id),ne&&ne.schema.contents){const re=ne.schema.contents.findIndex(ee);ne.schema.contents.splice(re,1),Ae.value++,n.emit("selectionChange")}}function v(T){return r.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:L=>{h(L,T)}},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function S(){return i.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function P(){var L;const T=((L=c.value)==null?void 0:L.getCustomButtons)&&c.value.getCustomButtons();return T&&!!T.length&&T.map(ne=>e.createVNode("div",{role:"button",class:`btn component-settings-button ${ne.class||""}`,title:ne.title,ref:ne.id,onClick:ee=>ne.onClick&&ne.onClick(ee)},[e.createVNode("i",{class:ne.icon},null)]))}function A(T){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[v(T),S(),P()])])}function N(T,L,ne,ee){n.emit("selectionChange",T,L,ne,ee)}function z(){n.emit("dragEnd")}function F(){return e.createVNode("div",{class:"no-drag w-100","data-noattach":"true","data-position":"0",style:"height: 60px; display: flex; justify-content: center; align-items: center; margin: 0px; border-radius: 3px; color: #2d2f33; background-color: #d4d6d9;"},[e.createTextVNode("未识别的组件")])}function D(T){let L;const ne=T.type,ee=K[ne],Q=J[ne],se=Q?Q(T):{};se.customClass=o.ignore?se.customClass:"",se.customStyle=o.ignore?se.customStyle:"",se.componentId=l.value,se.id=T.id;const ce=T.contents&&T.contents.length===0;return T.contents&&!!T.contents.length&&ee?e.createVNode(ee,e.mergeProps({ref:c},se),wi(L=T.contents.map(X=>e.createVNode(wt,{key:X.id,modelValue:X,"onUpdate:modelValue":de=>X=de,componentId:l.value,onSelectionChange:N,onDragEnd:z},null)))?L:{default:()=>[L]}):ee?ce?e.createVNode(ee,e.mergeProps({ref:c},se),{default:()=>[e.createVNode(bi,null,null)]}):e.createVNode(ee,e.mergeProps({ref:c},se),null):F()}function q(){const T=b.externalFormSchema.get(B);if(T!=null&&T.content)return T==null?void 0:T.content}function M(T){if(T.type==="component-ref"){const ee=(B?q():b==null?void 0:b.getFormSchema()).module.components.find(se=>se.id===T.component),Q=e.ref(ee);if(ee)return e.createVNode(wt,{key:ee.id,modelValue:Q.value,"onUpdate:modelValue":se=>Q.value=se,componentId:ee.id,onSelectionChange:N,onDragEnd:z},null)}}e.watch([()=>o.modelValue,()=>o.componentId],([T,L])=>{a.value=T,t.value=`${T.id}-component`,L&&(l.value=L),e.triggerRef(m)},{deep:!0});function W(T){window.scrollContainerList||(window.scrollContainerList=new Set);const L=T.getAttribute("id");L&&(window.scrollContainerList.add(L),T.componentInstance.value&&(T.componentInstance.value.scrollElementId=L))}function I(T){const L=T==null?void 0:T.target;W(L),st(L)}function O(){var T,L;if(m.value){(L=(T=a.value)==null?void 0:T.contents)!=null&&L.length&&m.value.addEventListener("scroll",I);const ne=m.value.querySelector(".drag-container");ne&&ne.addEventListener("scroll",I)}}e.onMounted(()=>{if(m.value&&c.value&&c.value.schema){const T=m.value.querySelector(`[data-dragref='${c.value.schema.id}-container']`);E&&T&&E.attachComponents(T,a.value),s.value=c.value.canNested!==void 0?c.value.canNested:s.value,r.value=c.value.canDelete!==void 0?c.value.canDelete:r.value,i.value=c.value.canMove!==void 0?c.value.canMove:i.value,u.value=c.value.styles||"",d.value=c.value.designerClass||"",m.value&&(m.value.componentInstance=c,m.value.designItemContext=y),c.value.belongedComponentId=l.value,c.value.setComponentBasicInfoMap(C),c.value.externalContainerId=B}O(),Ae.value++}),e.onBeforeUnmount(()=>{m.value&&m.value.removeEventListener("scroll",I)});function te(T){var ee;if(T&&(T.preventDefault(),T.stopPropagation()),B){const Q=document.getElementById(`${B}-design-item`);Q&&Q.click();return}let L=y.designerItemElementRef;const ne=m.value;if(ne){const Q=document.getElementsByClassName("dgComponentFocused");Q&&Q.length===1&&Q[0]===m.value||(Array.from(Q).forEach(ce=>ce.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(ce=>ce.classList.remove("dgComponentSelected")),ne.classList.add("dgComponentFocused"),n.emit("selectionChange",a.value.type,a.value,l.value,c.value))}(ee=c.value)!=null&&ee.getDraggableDesignItemElement&&(L=c.value.getDraggableDesignItemElement(y)),L!=null&&L.value&&L.value.classList.add("dgComponentSelected"),vt(L==null?void 0:L.value)}return()=>{const T=B?`${B}-`:"";return a.value.type==="component-ref"?M(a.value):e.createVNode("div",{id:`${T}${a.value.id}-design-item`,ref:m,class:w.value,style:g.value,onClick:te},[A(a.value),D(a.value)])}}}),xi={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},showFloatingClose:{type:Boolean,default:!1},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},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}};class ye{constructor(n,t){this.x=n,this.y=t}static getTransformInfo(n){const i=window.getComputedStyle(n).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(i.length>=6){const r=parseInt(i[4],10),s=parseInt(i[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(n,t=null){if(this.isMouseEvent(n))return new ye(n.clientX,n.clientY);if(t===null||n.changedTouches.length===1)return new ye(n.changedTouches[0].clientX,n.changedTouches[0].clientY);for(let i=0;i<n.changedTouches.length;i++)if(n.changedTouches[i].target===t)return new ye(n.changedTouches[i].clientX,n.changedTouches[i].clientY)}static isMouseEvent(n){return Object.prototype.toString.apply(n).indexOf("MouseEvent")===8}static isIPosition(n){return!!n&&"x"in n&&"y"in n}static getCurrent(n){const t=new ye(0,0);if(window){const i=window.getComputedStyle(n);if(i){const r=parseInt(i.getPropertyValue("left"),10),s=parseInt(i.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(s)?0:s}return t}return null}static copy(n){return new ye(0,0).set(n)}get value(){return{x:this.x,y:this.y}}add(n){return this.x+=n.x,this.y+=n.y,this}subtract(n){return this.x-=n.x,this.y-=n.y,this}multiply(n){this.x*=n,this.y*=n}divide(n){this.x/=n,this.y/=n}reset(){return this.x=0,this.y=0,this}set(n){return this.x=n.x,this.y=n.y,this}}class Ye{constructor(n,t){this.width=n,this.height=t}static getCurrent(n){const t=new Ye(0,0);if(window){const i=window.getComputedStyle(n);return i&&(t.width=parseInt(i.getPropertyValue("width"),10),t.height=parseInt(i.getPropertyValue("height"),10)),t}return null}static copy(n){return new Ye(0,0).set(n)}set(n){return this.width=n.width,this.height=n.height,this}}function Si(o,n){const t=e.ref(),i=e.ref(),r=e.ref(),s=e.ref(),a=e.ref(),l=e.ref(),u=e.ref(),d=e.ref(),p=e.ref(),m=e.ref(),E=e.ref(),c=e.ref(o.resizeable),f=e.ref(),x=e.ref(o.draggable),y=e.ref(!1);function b(){const I=i.value||document.body,O=window.getComputedStyle(I);if(!O||!t.value)return;const te=ye.getTransformInfo(t.value),T={};u.value&&(T.deltaL=t.value.offsetLeft-u.value.x,T.deltaT=t.value.offsetTop-u.value.y);const L=O.getPropertyValue("position");T.width=I.clientWidth,T.height=I.clientHeight,T.pr=parseInt(O.getPropertyValue("padding-right"),10),T.pb=parseInt(O.getPropertyValue("padding-bottom"),10),T.position=O.getPropertyValue("position"),L==="static"&&(I.style.position="relative"),T.translateX=te.x,T.translateY=te.y,m.value=T}function C(I){if(t.value){s.value=Ye.getCurrent(t.value),a.value=ye.getCurrent(t.value),l.value=s.value?Ye.copy(s.value):null,u.value=a.value?ye.copy(a.value):null,b();const O=I.target.getAttribute("type")||"";d.value={n:!!O.match(/n/),s:!!O.match(/s/),w:!!O.match(/w/),e:!!O.match(/e/)}}}function B(){var I,O,te,T;if(t.value){const L=t.value;d.value&&((d.value.n||d.value.s)&&((I=l.value)!=null&&I.height)&&(L.style.height=l.value.height+"px"),(d.value.w||d.value.e)&&((O=l.value)!=null&&O.width)&&(L.style.width=l.value.width+"px"),u.value&&((te=u.value)!=null&&te.x&&(L.style.left=u.value.x+"px"),(T=u.value)!=null&&T.y&&(L.style.top=u.value.y+"px")))}}function w(){const I=o.minHeight?o.minHeight:1,O=o.minWidth?o.minWidth:1;l.value&&u.value&&d.value&&s.value&&(l.value.height<I&&(l.value.height=I,d.value.n&&a.value&&(u.value.y=a.value.y+(s.value.height-I))),l.value.width<O&&(l.value.width=O,d.value.w&&a.value&&(u.value.x=a.value.x+(s.value.width-O))),o.maxHeight&&l.value.height>o.maxHeight&&(l.value.height=o.maxHeight,a.value&&d.value.n&&(u.value.y=a.value.y+(s.value.height-o.maxHeight))),o.maxWidth&&l.value.width>o.maxWidth&&(l.value.width=o.maxWidth,d.value.w&&a.value&&(u.value.x=a.value.x+(s.value.width-o.maxWidth))))}function g(){if(i.value){const I=m.value;if(u.value&&l.value&&d.value&&s.value){const O=I.width-I.pr-I.deltaL-I.translateX-u.value.x,te=I.height-I.pb-I.deltaT-I.translateY-u.value.y;d.value.n&&u.value.y+I.translateY<0&&a.value&&(u.value.y=-I.translateY,l.value.height=s.value.height+a.value.y+I.translateY),d.value.w&&u.value.x+I.translateX<0&&a.value&&(u.value.x=-I.translateX,l.value.width=s.value.width+a.value.x+I.translateX),l.value.width>O&&(l.value.width=O),l.value.height>te&&(l.value.height=te)}}}function h(I){if(!r.value||!s.value||!a.value||!d.value)return;I.subtract(r.value);const O=I.x,te=I.y;d.value.n?(u.value.y=a.value.y+te,l.value.height=s.value.height-te):d.value.s&&(l.value.height=s.value.height+te),d.value.e?l.value.width=s.value.width+O:d.value.w&&(l.value.width=s.value.width-O,u.value.x=a.value.x+O),g(),w(),B()}function v(I){if(!p.value)return;const O=ye.fromEvent(I);O&&h(O)}function S(){if(t.value){const{width:I,height:O,x:te,y:T}=t.value.getBoundingClientRect(),L=ye.getTransformInfo(t.value);return{size:{width:I,height:O},position:{x:te-L.x,y:T-L.y}}}return null}function P(I){if(t.value){const O=S();E.value=O}r.value=void 0,s.value=null,a.value=null,l.value=null,u.value=null,d.value=null,p.value=null,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",P)}function A(){document.addEventListener("mousemove",v),document.addEventListener("mouseup",P)}function N(I){I instanceof MouseEvent&&I.button===2||x.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),r.value=ye.fromEvent(I),p.value=I.target,C(I),A())}function z(I){return t.value=I,c.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:O=>N(O)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:O=>N(O)},null)])}function F(I=!0){document.body.click();const O=i.value||document.body,te=Ye.getCurrent(O),T=t.value;I&&T&&(f.value=S(),f.value.transform=T.style.transform),te&&T&&(l.value=te,l.value.height-=14,l.value.width-=14,T.style.height=l.value.height+"px",T.style.width=l.value.width+"px",T.style.left="7px",T.style.top="7px",T.style.transform="",E.value={size:l.value,position:{x:0,y:0}},x.value=!1,y.value=!0)}function D(){var I,O;if(document.body.click(),f.value){const te={width:f.value.size.width||0,height:f.value.size.height||0},T={x:(window.innerWidth-te.width)/2,y:(window.innerHeight-te.height)/2};(I=l.value)==null||I.set(te),(O=u.value)==null||O.set(T);const L=t.value;L.style.height=te.height+"px",L.style.width=te.width+"px",L.style.left=`${T.x}px`,L.style.top=`${T.y}px`,L.style.transform="",E.value={size:te,position:T},x.value=o.draggable,y.value=!1}}function q(){if(t.value){const I=Ye.getCurrent(t.value);if(I){const{width:O,height:te}=I;t.value.style.left=`${(window.innerWidth-O)/2}px`,t.value.style.top=`${(window.innerHeight-te)/2}px`,t.value.style.transform=""}}}function M(){const I=()=>{y.value?F(!1):q(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const W=M();return{renderResizeBar:z,boundingElement:i,resizedEventParam:E,maximize:F,restore:D,allowDrag:x,isMaximized:y,unWindowResizeHandle:W,moveToCenter:q}}function Ti(o,n,t){const i=e.ref(),r=e.ref(o.draggable),s=e.ref(o.lockAxis),a=e.ref(),l=e.ref(),u=e.ref(!1),d=e.ref(new ye(0,0)),p=e.ref(new ye(0,0)),m=e.ref(new ye(0,0)),E=e.ref(new ye(0,0));e.watch(()=>t.value,v=>{a.value.style.cursor=v?"move":"default"});function c(v,S){if(S.tagName==="BUTTON")return!1;if(S===v)return!0;for(const P in S.children)if(Object.prototype.hasOwnProperty.call(S.children,P)&&c(v,S.children[P]))return!0;return!1}function f(){var A,N;let v=m.value.x+p.value.x,S=m.value.y+p.value.y;s.value==="x"?(v=((A=d.value)==null?void 0:A.x)||0,m.value.x=0):s.value==="y"&&(S=((N=d.value)==null?void 0:N.y)||0,m.value.y=0);const P=`translate3d(${Math.round(v)}px, ${Math.round(S)}px, 0px)`;i.value&&(i.value.style.transform=P),E.value.x=v,E.value.y=S}function x(){if(!l.value||!i.value)return null;const v=l.value.getBoundingClientRect(),S=i.value.getBoundingClientRect(),P={top:v.top<S.top,right:v.right>S.right,bottom:v.bottom>S.bottom,left:v.left<S.left};return P.top||(m.value.y-=S.top-v.top),P.bottom||(m.value.y-=S.bottom-v.bottom),P.right||(m.value.x-=S.right-v.right),P.left||(m.value.x-=S.left-v.left),f(),P}function y(v){v&&(d.value&&v.subtract(d.value),m.value.set(v),f(),x())}function b(v){u.value&&r.value&&(v.stopPropagation(),v.preventDefault(),y(ye.fromEvent(v,a.value)))}function C(){var v;u.value&&(u.value=!1,p.value.add(m.value),m.value.reset(),(v=i.value)==null||v.classList.remove("ng-dragging"),n.emit("stopMove"),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C))}function B(){!u.value&&a.value&&(u.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",b),document.addEventListener("mouseup",C))}function w(){if(i.value){const v=ye.getTransformInfo(i.value);p.value.set(v);return}p.value.reset()}function g(v){if(!t.value||v instanceof MouseEvent&&v.button===2)return;const S=v.target||v.srcElement;a.value!==void 0&&S&&!c(S,a.value)||r.value!==!1&&(document.body.click(),v.stopPropagation(),v.preventDefault(),d.value=ye.fromEvent(v,i.value),w(),B())}function h(v,S,P){if(r.value&&S){if(v)a.value=v;else if(o.dragHandle){if(o.dragHandle instanceof HTMLElement)a.value=o.dragHandle;else if(typeof o.dragHandle=="string"){const A=S.querySelector(o.dragHandle);A&&(a.value=A)}}i.value=S,l.value=P,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",g)):r.value=!1}}return{registerDraggle:h,resetTranslate:w}}function io(o,n){if(o){const t=i=>{i.key.toLowerCase()===o.toLowerCase()&&n({event:i,key:o})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Ni(o,n){const t=e.ref(o.enableEsc);let i=null;return t.value?(i=io("Escape",r=>{n.emit("esc",{event:r.event,type:"esc"})}),{remove:i}):null}function Ei(o,n){const t=e.ref(o.enableEnter);let i=null;return t.value?(i=io("Enter",r=>{n.emit("enter",{event:r.event,type:"enter"})}),{remove:i}):null}const lt=e.defineComponent({name:"FModal",props:xi,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(o,n){const t=e.ref(o.width||300),i=e.ref(o.height||200),r=e.ref(o.modelValue),s=e.ref(""),a=e.ref(o.class),l=e.ref(o.fitContent),u=e.ref(o.showHeader),d=e.ref(""),p=e.ref(o.showCloseButton),m=e.ref(o.showMaxButton),E=e.ref(!1),c=e.ref(o.dialogType),f=e.ref(o.src),x=e.ref(""),y=e.ref(o.showButtons),b=e.ref(o.title),C=e.ref(o.containment||null),B=e.ref();b.value==="错误提示"&&(b.value=qe.LocaleService.getLocaleValue("messageBox.errorTitle"));const w=e.ref(!1);function g(k,ae){const ve=ae?"accept":"cancel";Promise.resolve().then(()=>{var me;return(me=o.beforeClose)==null?void 0:me.call(o,{closeType:ve})}).then(me=>{me&&(r.value=!1,n.emit("update:modelValue",!1),ae!=null&&n.emit(ae?"accept":"cancel"),n.emit("closed",k))})}const h=[{name:"cancel",text:qe.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:k=>{g(k,!1)}},{name:"accept",text:qe.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:k=>{g(k,!0)}}],v=e.ref(o.buttons&&o.buttons.length?o.buttons:h),S=e.computed(()=>!!d.value),P=e.computed(()=>!!y.value&&!!v.value),A=e.ref(),N=e.ref(),z=e.ref(!1),{renderResizeBar:F,maximize:D,restore:q,boundingElement:M,resizedEventParam:W,allowDrag:I,unWindowResizeHandle:O,moveToCenter:te}=Si(o),{registerDraggle:T}=Ti(o,n,I);function L(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function ne(){const k=document.querySelectorAll(".farris-modal").length;(!k||k-1<=0)&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}e.watch(()=>o.title,(k,ae)=>{k!==ae&&(b.value=k)}),e.watch(()=>o.modelValue,(k,ae)=>{k!==ae&&(r.value=k,r.value&&o.draggable&&e.nextTick(()=>{N.value&&!C.value&&(C.value=N.value.parentElement,M.value=C.value,T(A.value,N.value,M.value),te())}),k||(C.value&&(C.value=null),ne())),r.value?w.value=L():(z.value=!1,I.value=o.draggable)}),e.watch(()=>o.showHeader,(k,ae)=>{k!==ae&&(u.value=k)}),e.watch(()=>o.showButtons,(k,ae)=>{k!==ae&&(y.value=k)}),e.watch(()=>W.value,(k,ae)=>{const ve=k||{},me=ae||{};JSON.stringify(ve)!==JSON.stringify(me)&&n.emit("resize",{newSize:k,oldSize:ae,isMaximized:z.value})}),e.watch([()=>o.width,()=>o.height],(k,ae)=>{(k[0]!==ae[0]||k[1]!==ae[1])&&(t.value=k[0]||500,i.value=k[1]||600)}),e.watch(()=>o.class,(k,ae)=>{a.value=k});const ee=e.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),Q=e.computed(()=>{var ve;const k={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!o.showFloatingClose};k["f-modal-fitContent"]=!!l.value,k.show=!!ee.value;const ae=(ve=o.maskClass)==null?void 0:ve.split(" ");return ae==null||ae.reduce((me,De)=>(me[De]=!0,me),k),k}),se=e.computed(()=>{var ve;const k={"modal-dialog":!0},ae=(ve=a.value)==null?void 0:ve.split(" ");return ae==null||ae.reduce((me,De)=>(me[De]=!0,me),k),k}),ce=()=>Me.isMobilePhone()&&!o.isMessager||!!o.fullscreen,re=e.computed(()=>{const k=document.documentElement.clientWidth,ae=document.documentElement.clientHeight,ve=Math.min(t.value,k),me=o.position==="right"?"100%":l.value?"auto":`${Math.min(i.value,ae-10)}px`,De=`${(window.innerHeight-(me==="100%"||me==="auto"?0:parseInt(me)))/2}px`,dt=o.position==="right"?`${window.innerWidth-ve}px`:`${(window.innerWidth-ve)/2}px`,rt={position:"absolute",top:De,left:dt,width:`${ve}px`,height:me};return o.mask||(rt.pointerEvents="auto"),rt}),X=e.ref(Me.getMaxZIndex()||1050),de=e.computed(()=>{const k={display:"block",overflow:"hidden"};return o.mask||(k.pointerEvents="none",k.backgroundColor="transparent"),w.value&&(k.backgroundColor="transparent"),k.zIndex=X.value,k}),ze=e.computed(()=>({"modal-content":!0,"modal-content-has-header":u.value,"is-mobile":ce()})),Ue=e.computed(()=>{const k={display:u.value?"":"none"};return k["pointer-events"]=I.value?"auto":"none",k}),Fe=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:z.value})),et=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":c.value==="iframe","f-utils-fill":!0}));function Xe(){return{height:`${o.footerHeight||60}px`}}const tt=e.computed(()=>{const k={textAlgin:x.value},ae=Xe();return Object.assign(k,ae)});function Ce(k){if(k==null||k.stopPropagation(),z.value){z.value=!1,q();return}D(),z.value=!0}async function ct(k,ae){k.handle?await k.handle(ae,k)&&n.emit("closed",ae):(typeof k.onClick=="string"&&(k.onButtonClick=ge.cloneDeep(k.onClick||""),delete k.onClick),n.emit("buttonClick",{button:k,$event:ae}))}function He(k){k.width&&(t.value=k.width),k.height&&(i.value=k.height),k.buttons&&(v.value=k.buttons),k.title&&(b.value=k.title)}let _e=null,ke=null;e.onBeforeMount(()=>{w.value=L()}),e.onMounted(()=>{N.value&&!C.value&&(C.value=N.value.parentElement,M.value=C.value,T(A.value,N.value,M.value)),ee.value&&document.body.classList.add("modal-open"),_e=Ni(o,n),ke=Ei(o,n)}),e.onUnmounted(()=>{O&&O(),_e&&_e.remove(),ke&&ke.remove()}),n.expose({modalElementRef:N,updateModalOptions:He,close:g,maxDialog:Ce,isMaximized:z});function $e(){return e.createVNode("div",{class:"action-wrapper",onClick:k=>g(k,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function ut(){return e.createVNode("ul",null,[E.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),m.value&&e.createVNode("li",{onClick:Ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:Fe.value},null)]),p.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:k=>g(k,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ke(){return e.createVNode("div",{class:"modal-footer",style:tt.value},[v.value&&v.value.map(k=>{var me;const ae=e.ref(k.disabled),ve=k.class||((me=k.appearance)==null?void 0:me.class);return e.createVNode("button",{name:k.name,type:"button",disabled:ae.value,class:ve+(k.iconClass?" btn-icontext":"")+(k.visible===!1?"d-none":""),onClick:De=>{ct(k,De)}},[!!k.iconClass&&e.createVNode("i",{class:k.iconClass},null),k.text])})])}function Pe(){return e.createVNode("div",{ref:A,class:"modal-header",style:Ue.value},[n.slots.headerTemplate?n.slots.headerTemplate():e.createVNode("div",{class:"modal-title"},[S.value&&e.createVNode("span",{class:d.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[b.value])]),e.createVNode("div",{class:"actions"},[ut()])])}function We(){return n.slots.footerTemplate?n.slots.footerTemplate():P.value&&Ke()}function nt(k){if(k.stopPropagation(),o.allowClickMaskToClose){if(k.target!==B.value)return;g(k,!1)}}function ot(){var k,ae;return e.createVNode("div",{id:s.value,class:se.value,style:re.value,ref:N},[o.showFloatingClose&&$e(),e.createVNode("div",{class:ze.value},[u.value&&Pe(),e.createVNode("div",{class:et.value},[(ae=(k=n.slots).default)==null?void 0:ae.call(k),c.value==="iframe"&&e.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:f.value},null)]),We()]),!l.value&&N.value&&!z.value&&F(N.value)])}function it(k){return k||"body"}return e.watchEffect(()=>{ee.value&&(X.value=Me.getMaxZIndex()||1050)}),()=>e.createVNode(e.Teleport,{to:it(o.host)},{default:()=>[ee.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>[e.createVNode("div",{ref:B,class:Q.value,style:de.value,onClick:nt},[ot()])]})]})}});function ro(o){if(o.content&&o.content.render)return o.content.render;if(o.render&&typeof o.render=="function")return o.render}function Mi(o){const n=document.createElement("div");n.style.display="contents";const t=e.createApp({setup(i,r){e.onUnmounted(()=>{document.body.removeChild(n)});const s=e.ref(),a=e.ref(o.class||""),l=e.ref(!!o.showButtons),u=e.ref(!!o.showHeader),d=e.ref(o.showCloseButton==null?!0:o.showCloseButton),p=e.ref(!!o.showFloatingClose),m=e.ref(!0),E=e.ref(o.title||""),c=o.acceptCallback||(()=>{}),f=o.rejectCallback||(()=>{}),x=o.closedCallback||(w=>{}),y=o.resizeHandle||(w=>{}),b=o.stopMoveHandle||(w=>{}),C=ro(o),B=w=>{m.value=!1,t.unmount(),x(w)};return e.onMounted(()=>{}),r.expose({modalRef:s}),()=>e.createVNode(lt,{ref:s,class:a.value,modelValue:m.value,"onUpdate:modelValue":w=>m.value=w,title:E.value,width:o.width,height:o.height,buttons:o.buttons,"show-header":u.value,"show-buttons":l.value,"show-close-button":d.value,"show-max-button":!1,showFloatingClose:p.value,onAccept:c,onCancel:f,fitContent:o.fitContent==null?!0:o.fitContent,onClosed:B,onResize:y,onStopMove:b},{default:()=>[C&&C(t)]})}});return document.body.appendChild(n),t.use(qe.LocaleService.i18n),t.mount(n),t}class Vi{constructor(n){pe(this,"appContext",null);pe(this,"modalRef",e.ref());pe(this,"activeModalIndex",e.ref(0));pe(this,"modalRefs",{});pe(this,"isUseEscCloseModal",e.ref(!1));pe(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=n,this.appContext=n?n._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(n,t){const{width:i,height:r}={width:window.innerWidth,height:window.innerHeight};return i<n&&(n=i-14),r<t&&(t=r-14),{width:n,height:t}}static show(n){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return Mi(t)}close(n){var t,i;n?(i=n.value)==null||i.close():(t=this.getCurrentModal())==null||t.close()}open(n){const t=document.createDocumentFragment();n.showMaxButton&&n.fitContent&&(n.showMaxButton=!1);const i=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},n)),r=e.ref(!0),s=i.value.acceptCallback||(()=>{}),a=i.value.rejectCallback||(()=>{}),l=i.value.closedCallback||((g,h)=>{}),u=i.value.resizeHandle||(g=>{}),d=n.stopMoveHandle||(g=>{});let p;const m=ro(i.value),E=g=>{var v;r.value=!1;const h=(v=g==null?void 0:g.target)==null?void 0:v.classList.contains("modal_close");l(g,this.isUseEscCloseModal.value?"esc":h?"icon":"button")},c=g=>{E(g),p&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,t),p=null,this.modalRef.value=null,this.modalRefs){const h=Object.keys(this.modalRefs).map(v=>Number(v));h.length>0?this.activeModalIndex.value=Math.max(...h):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},f=g=>{var h;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((h=this.activeModalInstance.value)==null||h.close(g==null?void 0:g.event))},{width:x,height:y}=i.value,b=this.adaptToWindow(x||500,y||320);Object.assign(i.value,b);const C=()=>e.createVNode(lt,e.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":g=>r.value=g},i.value,{isMessager:i.value.class&&i.value.class.indexOf("modal-message")>-1,onAccept:s,onCancel:a,onClosed:c,onResize:u,onEsc:f,onStopMove:d}),{default:()=>[m&&m(this.app)]});return p=(g=>{const h=e.h(C,g);return h.appContext=this.appContext,e.render(h,t),h})({...i.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:g=>{i.value={...i.value,...g},p&&e.render(e.cloneVNode(p,{...i}),t)},destroy:c,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ao=Symbol("FModalService");lt.install=o=>{o.component(lt.name,lt);const n=new Vi(o);o.provide(ao,n),o.provide("FModalService",n)};const so=e.ref(0);function lo(){so.value++}const Ii=e.defineComponent({name:"FDesignerCanvas",props:Kn,emits:["init","selectionChange","canvasChanged","dragEnd"],setup(o,n){const t=e.ref(),i=e.ref(),r=e.ref(),s=e.ref(),a=e.ref(),l=e.ref(),u=e.ref(o.componentId),d=e.ref(o.canvasMode);let p,m;const E=e.inject("designerContext"),c={eventsEditorUtils:e.inject("eventsEditorUtils"),formSchemaUtils:e.inject("useFormSchema"),formMetadataConverter:e.inject("formMetadataConverter"),designViewModelUtils:e.inject("designViewModelUtils"),controlCreatorUtils:e.inject("controlCreatorUtils"),metadataService:e.inject("Meatdata_Http_Service_Token"),schemaService:e.inject("schemaService"),useFormCommand:e.inject("useFormCommand"),modalService:e.inject(ao),formStateMachineUtils:e.inject("useFormStateMachine"),messagerService:e.inject("FMessageBoxService"),designerContext:E};e.provide("designer-host-service",c);const f=pi(c,E);o.components&&yi(o.components),vi(),e.provide("canvas-dragula",f),e.provide("design-item-context",{designerItemElementRef:a,componentInstance:l,schema:i.value,parent:void 0});const x=e.computed(()=>({"d-flex":!0,"flex-fill":!0,"flex-column":!0})),y=e.computed(()=>({editorPanel:!0,"d-flex":!0,"flex-fill":!0,"flex-column":!0,[d.value]:!0}));e.watch([()=>o.modelValue,()=>o.componentId,()=>o.canvasMode],([g,h,v])=>{t.value=g,u.value=h,d.value=v}),e.watch(Ae,()=>{st(r.value),n.emit("canvasChanged")},{flush:"post"});function b(){p=new ResizeObserver(()=>{m&&clearTimeout(m),m=setTimeout(()=>{st(s.value)})}),p.observe(s.value)}function C(g,h,v,S){n.emit("selectionChange",g,h,v,S)}function B(){n.emit("dragEnd")}function w(){s.value.addEventListener("scroll",g=>{st(s.value)})}return e.onMounted(()=>{r.value&&f.initializeDragula(r.value),t.value=o.modelValue,n.emit("init",f),b(),w()}),e.onUnmounted(()=>{p&&(p.unobserve(r.value),p.disconnect(),p=null)}),n.expose({refreshCanvas:lo,changeCanvas:Bo,designerCanvasElementRef:r,designerCanvasContainerElementRef:s,designerHostService:c}),()=>e.createVNode("div",{class:"editorDiv flex-fill h-100",ref:s},[e.createVNode("div",{class:y.value},[e.createVNode("div",{ref:r,class:x.value},[t.value&&e.createVNode(wt,{key:so.value,modelValue:t.value,"onUpdate:modelValue":g=>t.value=g,onSelectionChange:C,componentId:u.value,onDragEnd:B},null)])])])}}),ji={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function co(o,n,t){var S;const i=t&&t.getStyles&&t.getStyles()||"",r=e.ref();let s;function a(){return t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function l(){return!1}function u(){return t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function d(){return t&&t.checkCanAddComponent?t.checkCanAddComponent():!0}function p(P){if(!P||!P.value)return null;const A=e.ref(P==null?void 0:P.value.parent),N=p(A);return N||null}function m(P=n){var F;const{componentInstance:A,designerItemElementRef:N}=P;if(!A||!A.value)return null;const{getCustomButtons:z}=A.value;return A.value.canMove||A.value.canAdd||A.value.canDelete||z&&((F=z())!=null&&F.length)?N:m(P.parent)}function E(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function c(P){return!!t&&t.canAccepts(P)}function f(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function x(){}function y(P,A){!P||!A||t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(P,A)}function b(P){const{componentType:A}=P,N=e.inject("designer-host-service");let z=be.getSchemaByTypeForDesigner(A,P,N);t&&t.onResolveNewComponentSchema&&(z=t.onResolveNewComponentSchema(P,z));const F=A.toLowerCase().replace(/-/g,"_");return z&&!z.id&&z.type===A&&(z.id=`${F}_${Math.random().toString().slice(2,6)}`),z}function C(P){}function B(...P){return t&&t.getPropsConfig?t.getPropsConfig(...P):[]}function w(){}function g(P){var N;if(!(n!=null&&n.schema))return;if(t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let A="";if(t!=null&&t.getComponentTitle)A=t.getComponentTitle();else{const{text:z,title:F,label:D,mainTitle:q,name:M,type:W}=n.schema;A=z||F||D||q||M||((N=he[W])==null?void 0:N.name)}A&&(!s&&P&&(s=P.formSchemaUtils),s.getControlBasicInfoMap().set(n.schema.id,{componentTitle:A,parentPathName:A}))}function h(P){var F;const{changeObject:A}=P,{propertyID:N,propertyValue:z}=A;["text","title","label","name","mainTitle"].includes((F=P==null?void 0:P.changeObject)==null?void 0:F.propertyID)&&N&&z&&g()}function v(P){if(h(P),t&&t.onPropertyChanged)return t.onPropertyChanged(P)}return r.value={canMove:a(),canSelectParent:l(),canAdd:d(),canDelete:u(),canNested:!1,contents:[],elementRef:o,parent:(S=n.parent)==null?void 0:S.componentInstance,schema:n.schema,styles:i,canAccepts:c,getBelongedComponentInstance:p,getDraggableDesignItemElement:m,getDraggingDisplayText:f,getPropConfig:B,getDragScopeElement:x,onAcceptMovedChildElement:y,onChildElementMovedOut:C,addNewChildComponentSchema:b,onRemoveComponent:w,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1),onPropertyChanged:v,getCustomButtons:E,setComponentBasicInfoMap:g},r}const Di=e.defineComponent({name:"FDesignerInnerItem",props:ji,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(o,n){const t=e.ref(o.canMove),i=e.ref(o.canAdd),r=e.ref(o.canDelete),s=e.ref(!1),a=e.ref(o.contentKey),l=e.ref(o.childType),u=e.ref(o.childLabel),d=e.ref(o.modelValue),p=e.ref(""),m=e.ref(),E=e.inject("canvas-dragula"),c=e.ref(),f=e.inject("design-item-context"),x={designerItemElementRef:m,componentInstance:c,schema:d.value,parent:f,setupContext:n};e.provide("design-item-context",x);const y=e.inject("designer-host-service"),b=e.inject("external-container-id"),C=e.computed(()=>{var I;const M=((I=c.value)==null?void 0:I.getCustomButtons)&&c.value.getCustomButtons();return{"farris-component":!0,"flex-fill":o.id==="root-component","position-relative":t.value||r.value||(M==null?void 0:M.length),"farris-nested":s.value,"can-move":t.value,"d-none":m.value&&m.value.classList.contains("d-none")}}),B=e.computed(()=>{const M={};return p.value&&p.value.split(";").reduce((W,I)=>{const[O,te]=I.split(":");return O&&(W[O]=te),W},M),M});function w(M,W){if(f&&f.schema[a.value]){const I=f.schema[a.value].findIndex(O=>O.id===W.id);if(I>-1){const O=f.schema[a.value].length,te=f.schema[a.value][I%O];f.designerItemElementRef.value.querySelector(`#${te.id}-design-item`),f.schema[a.value].splice(I,1),Ae.value++,n.emit("removeComponent"),n.emit("selectionChange")}}}function g(M){if(c.value.addNewChildComponentSchema){const W={componentType:l.value,label:u.value,parentComponentInstance:c.value,targetPosition:-1},I=c.value.addNewChildComponentSchema(W);d.value[a.value].push(I),n.emit("addComponent")}}function h(){return i.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:M=>{g()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function v(M){return r.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(W=>w(W,M),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function S(){return t.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function P(){var W;const M=((W=c.value)==null?void 0:W.getCustomButtons)&&c.value.getCustomButtons();return M&&!!M.length&&M.map(I=>e.createVNode("div",{role:"button",class:`btn component-settings-button ${I.class||""} ${I.text?"settings-button-extend":""}`,title:I.title,ref:I.id,onClick:O=>I.onClick&&I.onClick(O)},[e.createVNode("i",{class:"f-icon "+I.icon},null),I.text&&e.createVNode("span",{class:"icon-text"},[I.text])]))}function A(M){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[h(),S(),v(M),P()])])}e.watch(()=>o.modelValue,M=>{d.value=M,x.schema=M});function N(M){window.scrollContainerList||(window.scrollContainerList=new Set);const W=M.getAttribute("id");W&&window.scrollContainerList.add(W)}function z(M){const W=M.target;N(W),st(W)}function F(){var M,W;(W=(M=d.value)==null?void 0:M.contents)!=null&&W.length&&m.value&&m.value.addEventListener("scroll",z)}function D(){const M=m.value,W=e.ref(M.children[1]);return co(W,x).value}e.onMounted(()=>{if(m.value){const M=m.value.querySelector(`[data-dragref='${d.value.id}-container']`);c.value=M&&M.componentInstance?M.componentInstance.value:D(),E&&M&&E.attachComponents(M,d.value),s.value=c.value.canNested!==void 0?c.value.canNested:s.value,i.value=c.value.canAdd!==void 0?c.value.canAdd:i.value,r.value=c.value.canDelete!==void 0?c.value.canDelete:r.value,t.value=c.value.canMove!==void 0?c.value.canMove:t.value,p.value=c.value.styles||"",m.value&&(m.value.componentInstance=c,m.value.designItemContext=x),c.value.setComponentBasicInfoMap(y)}F(),Ae.value++}),e.onBeforeUnmount(()=>{m.value&&m.value.removeEventListener("scroll",z)});function q(M){if(M&&(M.preventDefault(),M.stopPropagation()),b){const O=document.getElementById(`${b}-design-item`);O&&O.click();return}let W=x.designerItemElementRef;const I=m.value;if(I){const O=document.getElementsByClassName("dgComponentFocused");O&&O.length===1&&O[0]===m.value&&m.value.classList.contains("dgComponentSelected")||(Array.from(O).forEach(T=>T.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(T=>T.classList.remove("dgComponentSelected")),I.classList.add("dgComponentFocused"),n.emit("selectionChange",d.value.type,d.value,o.componentId,c.value),c.value.getDraggableDesignItemElement&&(W=c.value.getDraggableDesignItemElement(x),W&&W.value&&W.value.classList.add("dgComponentSelected")))}vt(W==null?void 0:W.value)}return()=>e.createVNode("div",{id:`${o.id}-design-item`,ref:m,class:C.value,style:B.value,onClick:q},[A(d.value),n.slots.default&&n.slots.default()])}});function Bi(o,n,t){var z;const i=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=e.ref();let a;function l(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function u(){return!1}function d(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function p(){return(n==null?void 0:n.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function m(F){if(!F||!F.value)return null;if(F.value.schema&&F.value.schema.type==="component")return F.value;const D=e.ref(F==null?void 0:F.value.parent),q=m(D);return q||null}function E(F=n){var W;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(F);const{componentInstance:D,designerItemElementRef:q}=F;if(!D||!D.value)return null;const{getCustomButtons:M}=D.value;return D.value.canMove||M&&((W=M())!=null&&W.length)?q:E(F.parent)}function c(F){return!!t&&t.canAccepts(F)}function f(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function x(){}function y(F,D){var q;!F||!D||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(F,D),(q=n==null?void 0:n.setupContext)==null||q.emit("dragEnd"))}function b(F,D){const{componentType:q}=F;let M=be.getSchemaByTypeForDesigner(q,F,D);t&&t.onResolveNewComponentSchema&&(M=t.onResolveNewComponentSchema(F,M));const W=q.toLowerCase().replace(/-/g,"_");return M&&!M.id&&M.type===q&&(M.id=`${W}_${Math.random().toString().slice(2,6)}`),M}function C(F){F&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(F)}function B(...F){if(t&&t.getPropsConfig)return t.getPropsConfig(...F)}function w(F){if(!F)return;const D=n==null?void 0:n.schema,{formSchemaUtils:q}=F;if(D&&q.getExpressions().length){const M=q.getExpressions().findIndex(W=>W.target===D.id);M>-1&&q.getExpressions().splice(M,1)}}function g(F){if(!F||!(n!=null&&n.schema))return;const D=n.schema,{formSchemaUtils:q}=F;q.removeCommunicationInComponent(D)}function h(F){t&&t.onRemoveComponent&&t.onRemoveComponent(),w(F),g(F),n!=null&&n.schema.contents&&n.schema.contents.map(D=>{let q=D.id;D.type==="component-ref"&&(q=D.component);const M=o.value.querySelectorAll(`#${q}-design-item`);M!=null&&M.length&&Array.from(M).map(W=>{var I;(I=W==null?void 0:W.componentInstance)!=null&&I.value.onRemoveComponent&&W.componentInstance.value.onRemoveComponent(F)})})}function v(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function S(F){var q,M;if(!((q=n==null?void 0:n.schema)!=null&&q.id))return;if(!a&&F&&(a=F.formSchemaUtils),t!=null&&t.setComponentBasicInfoMap){t.setComponentBasicInfoMap();return}let D="";if(t!=null&&t.getComponentTitle)D=t.getComponentTitle();else{const{text:W,title:I,label:O,mainTitle:te,name:T,type:L}=n.schema;D=W||I||O||te||T||((M=he[L])==null?void 0:M.name)}D&&a.getControlBasicInfoMap().set(n.schema.id,{componentTitle:D,parentPathName:D})}function P(F){var W;const{changeObject:D}=F,{propertyID:q,propertyValue:M}=D;if(["text","title","label","name","mainTitle"].includes((W=F==null?void 0:F.changeObject)==null?void 0:W.propertyID)&&q&&M&&(S(),a)){const I=a.getControlBasicInfoMap(),O=I.keys().toArray().filter(te=>{var T,L;return((T=I.get(te))==null?void 0:T.reliedComponentId)===((L=n==null?void 0:n.schema)==null?void 0:L.id)});O!=null&&O.length&&O.forEach(te=>{const T=I.get(te).parentPathName.split(" > ");T[0]=M,I.get(te).parentPathName=T.join(" > ")})}}function A(F){if(P(F),t&&t.onPropertyChanged)return t.onPropertyChanged(F)}function N(){return t!=null&&t.shouldApplyClassToComponent?t.shouldApplyClassToComponent():!0}return s.value={canMove:l(),canSelectParent:u(),canDelete:d(),canNested:!p(),contents:n==null?void 0:n.schema.contents,elementRef:o,parent:(z=n==null?void 0:n.parent)==null?void 0:z.componentInstance,schema:n==null?void 0:n.schema,styles:i,designerClass:r,canAccepts:c,getBelongedComponentInstance:m,getDraggableDesignItemElement:E,getDraggingDisplayText:f,getPropConfig:B,getDragScopeElement:x,onAcceptMovedChildElement:y,onChildElementMovedOut:C,addNewChildComponentSchema:b,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1),onRemoveComponent:h,getCustomButtons:v,onPropertyChanged:A,setComponentBasicInfoMap:S,updateContextSchema:n==null?void 0:n.updateContextSchema,shouldApplyClassToComponent:N},s}class Fi{getTemplateRule(n,t){const i=t==null?void 0:t.formSchemaUtils,r=i==null?void 0:i.getFormTemplateRule(),s={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return s;const a=this.getComponentContext(n),{componentClassList:l}=a;return l.forEach(u=>{if(!u||!r[u])return;const{canMove:d,canDelete:p,canAccept:m}=r[u];s.canMove=s.canMove&&this.resolveRuleValue(d,a),s.canDelete=s.canDelete&&this.resolveRuleValue(p,a),s.canAccept=s.canAccept&&this.resolveRuleValue(m,a)}),s}resolveRuleValue(n,t){return typeof n=="boolean"?n:this.parseRuleValueSchema(n,t)}parseRuleValueSchema(n,t){const i=n.invalidContext||[];let r=!0;for(const s of i){const{firstLevelChild:a,secondLevelChild:l,parent:u,...d}=s;if(d&&t.component){let p=!0;for(const m of Object.keys(d))if(d[m]!==t.component[m]){p=!1;break}if(!p){r=!1;continue}}if(s.firstLevelChild){if(s.firstLevelChild.class){const{firstLevelChildClassList:p}=t;if(p&&!p.includes(s.firstLevelChild.class)){r=!1;continue}}if(s.firstLevelChild.type){const{firstLevelChildSchema:p}=t;if(!p||p.type!==s.firstLevelChild.type){r=!1;continue}}}if(s.secondLevelChild){if(s.secondLevelChild.class){const{secondLevelChildClassList:p}=t;if(p&&!p.includes(s.secondLevelChild.class)){r=!1;continue}}if(s.secondLevelChild.type){const{secondLevelChildSchema:p}=t;if(!p||p.type!==s.secondLevelChild.type){r=!1;continue}}}if(s.parent){if(s.parent.class){const{parentClassList:p}=t;if(p&&!p.includes(s.parent.class)){r=!1;continue}}if(s.parent.type){const{parentSchema:p}=t;if(p&&p.type!==s.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(n){var x,y,b,C;const t=n.schema,i=t.appearance&&t.appearance.class||"",r=i.split(" ")||[],s=t.contents||[],a=s.length?s[0]:null,l=a&&a.appearance?a.appearance.class:"",u=l?l.split(" "):[],d=(x=a==null?void 0:a.contents)!=null&&x.length?a==null?void 0:a.contents[0]:null,p=d&&d.appearance?d.appearance.class:"",m=p?p.split(" "):[],E=t.type==="component"?(b=(y=n.parent)==null?void 0:y.parent)==null?void 0:b.schema:(C=n.parent)==null?void 0:C.schema,c=E&&E.appearance&&E.appearance.class||"",f=c?c.split(" "):[];return{componentClass:i,componentClassList:r,childContents:s,firstLevelChildSchema:a,firstLevelChildClass:l,firstLevelChildClassList:u,secondLevelChildSchema:d,secondLevelChildClass:p,secondLevelChildClassList:m,parentSchema:E,parentClass:c,parentClassList:f,component:t}}}function ki(){function o(n,t){var a;if(!n)return!1;const i=((a=n.targetContainer)==null?void 0:a.componentInstance)&&n.targetContainer.componentInstance.value;if(!i)return!1;const r=i.schema.type,s=t==null?void 0:t.formSchemaUtils.getComponentById(i.belongedComponentId);return!((n.componentCategory==="input"||n.componentType==="form-group")&&![he["response-layout-item"].type,he["response-form"].type,he.fieldset.type].includes(r)||(n.componentType===he.tabs.type||n.componentType===he.section.type)&&((s==null?void 0:s.componentType)!=="frame"||![he["content-container"].type,he["splitter-pane"].type,he["response-layout-item"].type,he.drawer.type].includes(r))||[he["query-solution"].type,he["filter-bar"].type,he.drawer.type].includes(n.componentType)||n.componentType===he.fieldset.type&&r!==he["response-form"].type||n.componentCategory==="dataCollection"&&(s==null?void 0:s.componentType)!=="frame")}return{basalDragulaRuleForContainer:o}}j.DgControl=he,j.FDesignerCanvas=Ii,j.FDesignerInnerItem=Di,j.FDesignerItem=wt,j.UseTemplateDragAndDropRules=Fi,j.canvasChanged=Ae,j.componentMap=K,j.componentPropsConverter=J,j.designerCanvasProps=Kn,j.refreshCanvas=lo,j.setPositionForSelectedElement=Nt,j.setPositionOfButtonGroup=vt,j.setPositionOfSelectedComponentBtnGroup=ko,j.useDesignerComponent=Bi,j.useDesignerInnerComponent=co,j.useDragulaCommonRule=ki,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|