@farris/ui-vue 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/components/avatar/index.esm.js +1 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/component/index.esm.js +1 -1
  4. package/components/component/index.umd.cjs +1 -1
  5. package/components/condition/index.esm.js +1 -1
  6. package/components/condition/index.umd.cjs +1 -1
  7. package/components/content-container/index.esm.js +1 -1
  8. package/components/content-container/index.umd.cjs +1 -1
  9. package/components/designer-canvas/index.esm.js +904 -893
  10. package/components/designer-canvas/index.umd.cjs +1 -1
  11. package/components/dynamic-form/index.esm.js +1 -1
  12. package/components/dynamic-form/index.umd.cjs +1 -1
  13. package/components/dynamic-view/index.esm.js +1 -1
  14. package/components/dynamic-view/index.umd.cjs +1 -1
  15. package/components/events-editor/index.esm.js +1 -1
  16. package/components/events-editor/index.umd.cjs +1 -1
  17. package/components/filter-bar/index.esm.js +1 -1
  18. package/components/filter-bar/index.umd.cjs +1 -1
  19. package/components/flow-canvas/index.esm.js +1 -1
  20. package/components/flow-canvas/index.umd.cjs +1 -1
  21. package/components/number-range/index.esm.js +1 -1
  22. package/components/number-range/index.umd.cjs +1 -1
  23. package/components/number-spinner/index.esm.js +1 -1
  24. package/components/number-spinner/index.umd.cjs +1 -1
  25. package/components/page-header/index.esm.js +795 -2822
  26. package/components/page-header/index.umd.cjs +1 -1
  27. package/components/property-panel/index.esm.js +1 -1
  28. package/components/property-panel/index.umd.cjs +1 -1
  29. package/components/query-solution/index.esm.js +1 -1
  30. package/components/query-solution/index.umd.cjs +1 -1
  31. package/components/response-layout/index.esm.js +1 -1
  32. package/components/response-layout/index.umd.cjs +1 -1
  33. package/components/section/index.esm.js +119 -7475
  34. package/components/section/index.umd.cjs +1 -1
  35. package/components/time-picker/index.esm.js +1 -1
  36. package/components/time-picker/index.umd.cjs +1 -1
  37. package/components/video/index.esm.js +1 -1
  38. package/components/video/index.umd.cjs +1 -1
  39. package/designer/data-grid/index.esm.js +1 -1
  40. package/designer/data-grid/index.umd.cjs +1 -1
  41. package/designer/farris-designer.all.esm.js +946 -934
  42. package/designer/farris-designer.all.umd.cjs +4 -4
  43. package/designer/radio-group/index.esm.js +1 -1
  44. package/designer/radio-group/index.umd.cjs +1 -1
  45. package/designer/section/index.esm.js +744 -0
  46. package/designer/section/index.umd.cjs +1 -0
  47. package/farris.all.esm.js +10489 -10488
  48. package/farris.all.umd.cjs +16 -16
  49. package/package.json +1 -1
  50. package/types/designer-canvas/index.d.ts +2 -2
  51. package/types/section/designer.d.ts +26 -0
  52. package/types/section/index.d.ts +1 -0
  53. package/types/section/src/designer/section-header.design.component.d.ts +2 -2
  54. package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
  55. package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
  56. package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
  57. package/types/section/src/designer/section.design.props.d.ts +11 -0
  58. package/types/section/src/designer/use-designer-rules.d.ts +1 -2
  59. package/types/section/src/property-config/section.property-config.d.ts +1 -1
  60. package/types/section/src/schema/schema-resolver.d.ts +1 -1
  61. package/types/section/src/section.props.d.ts +0 -10
  62. package/components/section/index.css +0 -1
@@ -1 +1 @@
1
- (function(I,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("@vueuse/core"),require("../dynamic-resolver/index.umd.js"),require("../data-view/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../tree-grid/index.umd.js"),require("../notify/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","@vueuse/core","../dynamic-resolver/index.umd.js","../data-view/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../../designer/tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../tree-grid/index.umd.js","../notify/index.umd.js","bignumber.js"],n):(I=typeof globalThis<"u"?globalThis:I||self,n(I.video={},I.Vue,I.LodashES,I.common,I.VueUseCore,I.dynamicResolver,I.dataView,I.designerCanvas,I.propertyPanel,I.FAccordion,I.FAvatar,I.FButtonEdit,I.FButtonGroup,I.FCalendar,I.FCapsule,I.FCheckbox,I.FCheckboxGroup,I.FComboList,I.FComboTree,I.FComponent,I.FColorPicker,I.FContentContainer,I.FDatePicker,I.FDataGrid,I.FDropdown,I.FDynamicForm,I.FEventsEditor,I.FFilterBar,I.FFieldSelector,I.FBindingSelector,I.FImageCropper,I.FInputGroup,I.FLayout,I.FListNav,I.FListView,I.FLookup,I.FMappingEditor,I.FNav,I.FNumberRange,I.FNumberSpinner,I.FOrder,I.FPageHeader,I.FPageFooter,I.FPagination,I.FProgress,I.FQuerySolution,I.FRadioGroup,I.FRate,I.FResponseToolbar,I.FResponseLayout,I.FResponseLayoutEditorSetting,I.FSearchBox,I.FSection,I.FSmokeDetector,I.FSplitter,I.FStep,I.FSwitch,I.FTabs,I.FTags,I.FText,I.FTimePicker,I.FTransfer,I.FTreeview,I.FUploader,I.FVerifyDetail,I.FVideo$1,I.FTextArea,I.FSchemaSelector,I.FTreeGrid$1,I.FEventParameter,I.FFilterConditionEditor,I.FFieldset,I.FSortConditionEditor,I.FMenuLookup,I.FDrawer,I.FJsonEditor,I.FPropertyEditor,I.FExpressionEditor,I.FCodeEditor,I.FHtmlTemplate,null,I.FTreeGrid$2,I.notify))})(this,function(I,n,le,Qe,rn,Ne,ne,Ge,an,sn,ln,cn,dn,un,pn,Rt,$t,fn,mn,hn,yn,gn,vn,bn,Cn,wn,xn,Sn,Tn,Fn,Vn,Nn,Mn,En,In,kn,Bn,jn,On,Pn,Dn,Rn,$n,qn,Ln,An,Un,zn,Gn,Hn,_n,Wn,Yn,Xn,Jn,Qn,Zn,Kn,eo,to,no,oo,io,ro,ao,so,lo,co,uo,po,fo,mo,ho,yo,go,vo,bo,Co,wo,xo,tr,So,To){"use strict";var Ki=Object.defineProperty;var er=(I,n,le)=>n in I?Ki(I,n,{enumerable:!0,configurable:!0,writable:!0,value:le}):I[n]=le;var oe=(I,n,le)=>er(I,typeof n!="symbol"?n+"":n,le);const ht={},qt={};function yt(i){const{properties:e,title:t,ignore:o}=i,r=o&&Array.isArray(o),s=Object.keys(e).reduce((a,d)=>((!r||!o.find(l=>l===d))&&(a[d]=e[d].type==="object"&&e[d].properties?yt(e[d]):le.cloneDeep(e[d].default)),a),{});if(t&&(!r||!o.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");s.id=`${a}_${Math.random().toString().slice(2,6)}`}return s}function Fo(i){const{properties:e,title:t,required:o}=i;if(o&&Array.isArray(o)){const r=o.reduce((s,a)=>(s[a]=e[a].type==="object"&&e[a].properties?yt(e[a]):le.cloneDeep(e[a].default),s),{});if(t&&o.find(s=>s==="id")){const s=t.toLowerCase().replace(/-/g,"_");r.id=`${s}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function Ze(i,e={},t){const o=ht[i];if(o){let r=Fo(o);const s=qt[i];return r=s?s({getSchemaByType:Ze},r,e,t):r,r}return null}function Vo(i,e){const t=yt(e);return Object.keys(t).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(i,r)&&(o[r]&&le.isPlainObject(o[r])&&le.isPlainObject(i[r]||!i[r])?Object.assign(o[r],i[r]||{}):o[r]=i[r]),o),t),t}function Lt(i,e){return Object.keys(i).filter(o=>i[o]!=null).reduce((o,r)=>{if(e.has(r)){const s=e.get(r);if(typeof s=="string")o[s]=i[r];else{const a=s(r,i[r],i);Object.assign(o,a)}}else o[r]=i[r];return o},{})}function No(i,e,t=new Map){const o=Vo(i,e);return Lt(o,t)}function Mo(i={}){function e(c,u,f,m){if(typeof f=="number")return m[c].length===f;if(typeof f=="object"){const g=Object.keys(f)[0],y=f[g];if(g==="not")return Number(m[c].length)!==Number(y);if(g==="moreThan")return Number(m[c].length)>=Number(y);if(g==="lessThan")return Number(m[c].length)<=Number(y)}return!1}function t(c,u,f,m){return m[c]&&m[c].propertyValue&&String(m[c].propertyValue.value)===String(f)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(i).reduce((c,u)=>(c.set(u,i[u]),c),o);function r(c,u){const f=c;return typeof u=="number"?[{target:f,operator:"length",param:null,value:Number(u)}]:typeof u=="boolean"?[{target:f,operator:"getProperty",param:c,value:!!u}]:typeof u=="object"?Object.keys(u).map(m=>{if(m==="length")return{target:f,operator:"length",param:null,value:u[m]};const g=m,y=u[m];return{target:f,operator:"getProperty",param:g,value:y}}):[]}function s(c){return Object.keys(c).reduce((f,m)=>{const g=r(m,c[m]);return f.push(...g),f},[])}function a(c,u){if(o.has(c.operator)){const f=o.get(c.operator);return f&&f(c.target,c.param,c.value,u)||!1}return!1}function d(c,u){return s(c).reduce((g,y)=>g&&a(y,u),!0)}function l(c,u){const f=Object.keys(c),m=f.includes("allOf"),g=f.includes("anyOf"),y=m||g,C=(y?c[y?m?"allOf":"anyOf":"allOf"]:[c]).map(B=>d(B,u));return m?!C.includes(!1):C.includes(!0)}return{parseValueSchema:l}}const U={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},Eo={},Io={};Mo();function gt(i,e,t=new Map,o=(a,d,l,c)=>d,r={},s=a=>a){return ht[e.title]=e,qt[e.title]=o,Eo[e.title]=r,Io[e.title]=s,(a={},d=!0)=>{if(!d)return Lt(a,t);const l=No(a,e,t),c=Object.keys(i).reduce((u,f)=>(u[f]=i[f].default,u),{});return Object.assign(c,l)}}function vt(i,e){return{customClass:e.class,customStyle:e.style}}const ko={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/video.schema.json",title:"video",description:"A Farris Video Component",type:"object",properties:{id:{description:"The unique identifier for a Video",type:"string"},type:{description:"The type string of Video component",type:"string",default:"video"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Bo=new Map([["appearance",vt]]);function jo(i,e,t){return e}const Oo={title:"verify-detail",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:[]}}}}}},rt={src:{type:String,required:!0,default:""},autoplay:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},preload:{type:String,default:"none"},poster:{type:String},width:{type:[String,Number],default:300},height:{type:[String,Number],default:168}},bt=gt(rt,ko,Bo,jo,Oo);function Po(i,e){function t(v){v.stopPropagation(),e.emit("abort")}function o(v){v.stopPropagation(),e.emit("play")}function r(v){v.stopPropagation(),e.emit("pause")}function s(v){v.stopPropagation(),e.emit("ended")}function a(v){v.stopPropagation(),e.emit("durationchange")}function d(v){v.stopPropagation(),e.emit("error")}function l(v){v.stopPropagation(),e.emit("loadeddata")}function c(v){v.stopPropagation(),e.emit("loadedmetadata")}function u(v){v.stopPropagation(),e.emit("loadstart")}function f(v){v.stopPropagation(),e.emit("playing")}function m(v){v.stopPropagation(),e.emit("progress")}function g(v){v.stopPropagation(),e.emit("timeupdate")}function y(v){v.stopPropagation(),e.emit("volumechange")}function S(v){v.stopPropagation(),e.emit("canplay")}return{onAbort:t,onPlay:o,onPause:r,onEnded:s,onDurationchange:a,onError:d,onLoadeddata:l,onLoadedmetadata:c,onLoadstart:u,onPlaying:f,onProgress:m,onTimeupdate:g,onVolumechange:y,onCanplay:S}}const at=n.defineComponent({name:"FVideo",props:rt,emits:["abort","play","pause","ended","durationchange","canplay","error","loadeddata","loadedmetadata","loadstart","playing","progress","timeupdate","volumechange"],setup(i,e){const t=n.ref(),{onAbort:o,onPlay:r,onPause:s,onEnded:a,onDurationchange:d,onError:l,onLoadeddata:c,onLoadedmetadata:u,onLoadstart:f,onPlaying:m,onProgress:g,onTimeupdate:y,onVolumechange:S,onCanplay:v}=Po(i,e);return n.onUnmounted(()=>{}),()=>n.createVNode("video",{ref:t,src:i.src,autoplay:i.autoplay,controls:i.controls,loop:i.loop,muted:i.muted,width:i.width,height:i.height,poster:i.poster,onAbort:C=>o(C),onPlay:C=>r(C),onPause:C=>s(C),onEnded:C=>a(C),onDurationchange:C=>d(C),onError:C=>l(C),onLoadeddata:C=>c(C),onLoadedmetadata:C=>u(C),onLoadstart:C=>f(C),onPlaying:C=>m(C),onProgress:C=>g(C),onTimeupdate:C=>y(C),onVolumechange:C=>S(C),onCanplay:C=>v(C)},[n.createTextVNode("Your browser does not support the video tag.")])}});function Do(i,e,t){var F;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=n.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function d(){return!1}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function u(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const w=n.ref(p==null?void 0:p.value.parent),V=u(w);return V||null}function f(p=e){var M;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(p);const{componentInstance:w,designerItemElementRef:V}=p;if(!w||!w.value)return null;const{getCustomButtons:h}=w.value;return w.value.canMove||h&&((M=h())!=null&&M.length)?V:f(p.parent)}function m(p){return!!t&&t.canAccepts(p)}function g(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function y(){}function S(p,w){var V;!p||!w||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(p,w),(V=e==null?void 0:e.setupContext)==null||V.emit("dragEnd"))}function v(p,w){const{componentType:V}=p;let h=Ze(V,p,w);t&&t.onResolveNewComponentSchema&&(h=t.onResolveNewComponentSchema(p,h));const M=V.toLowerCase().replace(/-/g,"_");return h&&!h.id&&h.type===V&&(h.id=`${M}_${Math.random().toString().slice(2,6)}`),h}function C(p){p&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(p)}function j(...p){if(t&&t.getPropsConfig)return t.getPropsConfig(...p)}function B(p){if(!p)return;const w=e==null?void 0:e.schema,{formSchemaUtils:V}=p;if(w&&V.getExpressions().length){const h=V.getExpressions().findIndex(M=>M.target===w.id);h>-1&&V.getExpressions().splice(h,1)}}function N(p){t&&t.onRemoveComponent&&t.onRemoveComponent(),B(p),e!=null&&e.schema.contents&&e.schema.contents.map(w=>{let V=w.id;w.type==="component-ref"&&(V=w.component);const h=i.value.querySelectorAll(`#${V}-design-item`);h!=null&&h.length&&Array.from(h).map(M=>{var H;(H=M==null?void 0:M.componentInstance)!=null&&H.value.onRemoveComponent&&M.componentInstance.value.onRemoveComponent(p)})})}function b(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function T(p){if(t&&t.onPropertyChanged)return t.onPropertyChanged(p)}return s.value={canMove:a(),canSelectParent:d(),canDelete:l(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:i,parent:(F=e==null?void 0:e.parent)==null?void 0:F.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:m,getBelongedComponentInstance:u,getDraggableDesignItemElement:f,getDraggingDisplayText:g,getPropConfig:j,getDragScopeElement:y,onAcceptMovedChildElement:S,onChildElementMovedOut:C,addNewChildComponentSchema:v,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:N,getCustomButtons:b,onPropertyChanged:T},s}class Ro{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),s={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return s;const a=this.getComponentContext(e),{componentClassList:d}=a;return d.forEach(l=>{if(!l||!r[l])return;const{canMove:c,canDelete:u,canAccept:f}=r[l];s.canMove=s.canMove&&this.resolveRuleValue(c,a),s.canDelete=s.canDelete&&this.resolveRuleValue(u,a),s.canAccept=s.canAccept&&this.resolveRuleValue(f,a)}),s}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let r=!0;for(const s of o){if(s.firstLevelChild){if(s.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(s.firstLevelChild.class)){r=!1;continue}}if(s.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==s.firstLevelChild.type){r=!1;continue}}}if(s.secondLevelChild){if(s.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(s.secondLevelChild.class)){r=!1;continue}}if(s.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==s.secondLevelChild.type){r=!1;continue}}}if(s.parent){if(s.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(s.parent.class)){r=!1;continue}}if(s.parent.type){const{parentSchema:a}=t;if(a&&a.type!==s.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var S,v,C,j;const t=e.schema,o=t.appearance&&t.appearance.class||"",r=o.split(" ")||[],s=t.contents||[],a=s.length?s[0]:null,d=a&&a.appearance?a.appearance.class:"",l=d?d.split(" "):[],c=(S=a==null?void 0:a.contents)!=null&&S.length?a==null?void 0:a.contents[0]:null,u=c&&c.appearance?c.appearance.class:"",f=u?u.split(" "):[],m=t.type==="component"?(C=(v=e.parent)==null?void 0:v.parent)==null?void 0:C.schema:(j=e.parent)==null?void 0:j.schema,g=m&&m.appearance&&m.appearance.class||"",y=g?g.split(" "):[];return{componentClass:o,componentClassList:r,childContents:s,firstLevelChildSchema:a,firstLevelChildClass:d,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:u,secondLevelChildClassList:f,parentSchema:m,parentClass:g,parentClassList:y}}}const $o=n.ref(0);function At(){$o.value++}const Ut=n.ref(0);function qo(i){const{formSchemaUtils:e,formStateMachineUtils:t}=i;function o(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function r(l,c=""){return e.getViewModelById(l).states.map(f=>o(f,c))}function s(l){const c=e.getRootViewModelId(),u=r(l);if(l===c)return u;const f=r(c,"root-component.");return[...u,...f]}function a(l){return l.binding&&l.binding.path||l.id||""}function d(){return t&&t.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:d}}class Lo{constructor(e){oe(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'"}]);oe(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});oe(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,s,a)=>{const d=s.getExpressionRuleValue(e,t||r);return d&&d.value||""},convertTo:(o,r,s,a,d)=>{var l;if(r==="dataPicking"&&(s!=null&&s.target)){const c=`${s.target}_dataPicking`;((l=s.rules)==null?void 0:l.some(f=>f.id===c&&f.value))?o.dictPickingExpressionId=c:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===e);if(!r)return"";const s=r.rules.find(a=>a.type===t);return s||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var d;const s=this.createTreeNode(r,t);let a=[];(d=r.type)!=null&&d.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var l,c;const s=this.createTreeNode(r,t),a=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...t,r.label]),d=this.buildChildEntityTreeData((c=r.type)==null?void 0:c.entities,[...t,r.label]);d!=null&&d.length&&(a==null||a.push(...d)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,t),a=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(t)&&s?s.message:"",...a};return s.messageType!=null&&(d.messageType=s.messageType),d}buildRule(e,t,o,r){const{expression:s,message:a,messageType:d}=t,l={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=a),o==="dataPicking"&&(l.messageType=d),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const s=t==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(u=>u.targetType===t&&u.target===s);const c=u=>u.value.trim()==="";if(l){const u=l.rules.find(f=>f.id===a.id);if(u)c(a)?l.rules=l.rules.filter(f=>f.id!==a.id):(Object.assign(u,a),r==="validate"&&e.type==="form-group"&&(u.elementId=e.id));else{if(c(a))return null;l.rules=l.rules||[],l.rules.push(a)}}else{if(c(a))return null;l={target:`${s}`,rules:[a],targetType:t}}return l}getExpressionEditorOptions(e,t,o,r){return o.reduce((s,a)=>{var l,c;const d=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return s[a]={hide:t==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(d),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,a,t),onSubmitModal:u=>{const f=this.updateExpression(e,t,u,a);if(r){const m=this.buildRule(d,u,a);r(m)}return f}}},s},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:t,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class Ao{constructor(e,t){oe(this,"componentId");oe(this,"viewModelId");oe(this,"eventsEditorUtils");oe(this,"formSchemaUtils");oe(this,"formMetadataConverter");oe(this,"designViewModelUtils");oe(this,"designViewModelField");oe(this,"controlCreatorUtils");oe(this,"designerHostService");oe(this,"schemaService",null);oe(this,"metadataService",null);oe(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:U[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},s={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const a in t)s[a]=Object.assign(s[a]||{},t[a]);return{...r,properties:{...s},setPropertyRelates(a,d){if(a){switch(a&&a.propertyID){case"class":case"style":{Ut.value++;break}}o&&o(a,e,d)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},s={}){const{getVariables:a,getControlName:d,getStateMachines:l}=qo(this.designerHostService),c=this.getRealTargetType(e),u=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,c,o);break;case"StateMachine":f.stateMachines=l();break;case"Variable":Object.assign(f,{controlName:d(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:a(this.viewModelId),onBeforeOpenVariables:g=>{g.value=a(this.viewModelId)}},s);break}}),f}getVisibleProperty(e,t=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,t==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(e,t="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,t);for(const l in o)a[l]=Object.assign(a[l]||{},o[l]);const d=this;return{...s,properties:{...a},setPropertyRelates(l,c){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(e,l);break}r&&r(l,c)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===e),s=le.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),At()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(t).states.push(a)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:s,expressionInfo:a}=t,{targetId:d,targetType:l,expressionType:c,value:u,message:f}=a,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:g}=m;let y=g.find(v=>v.target===d);y||(y={target:d,rules:[],targetType:l},g.push(y));const S=y.rules.find(v=>v.type===c);if(S)S.value=u,S.message=f;else{const v={id:s,type:c,value:u,message:f};y.rules.push(v)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),d=t.binding?t.binding.field:t.id,l=a.find(c=>c.target===d);!l||!l.rules||(l.rules=l.rules.filter(c=>c.type!==s))}getExpressionOptions(e,t,o){return new Lo(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}class Uo extends Ao{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearancePropConfig(e),this.getBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearancePropConfig(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId);e.name=t?t.name:null;const o=this;return this.getAppearanceConfig(e,{name:{title:"组件名称",type:"string",description:"组件名称",defaultValue:e.name}},(s,a,d)=>{switch(s.propertyID){case"name":o.syncChangesToViewModel({name:s.propertyValue}),delete a.name;break}})}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],o=this,r=o.eventsEditorUtils.formProperties(e,o.viewModelId,t),s={};s[o.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,d){const l=a.propertyValue;delete e[o.viewModelId],l&&(l.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,l.events,l))}}}getBehaviorConfig(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId),o=t?t.enableValidation:null,r=this;this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{enableValidation:{title:"启用校验",type:"boolean",description:"运行时组件是否启用校验",defaultValue:o}},setPropertyRelates:s=>{if(s)switch(s.propertyID){case"enableValidation":{r.syncChangesToViewModel({enableValidation:s.propertyValue}),delete e.enableValidation;break}}}}}syncChangesToViewModel(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId);t&&Object.assign(t,e)}}const zo={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}},Go={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Ct=n.defineComponent({name:"Toast",props:Go,emits:["close","click"],setup:(i,e)=>{const t=n.ref(i.animate),o="fadeOut",r=n.computed(()=>i.options),s=n.ref(!1),a=n.computed(()=>{const C={animated:s.value,toast:!0};return C[i.animate]=!1,C[o]=s.value,C[r.value.type]=!0,r.value.theme&&(C[r.value.theme]=!0),C}),d=n.computed(()=>{const B=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,N={"f-icon":!0};return N[B]=!0,N}),l=n.computed(()=>r.value.title||r.value.message),c=n.computed(()=>r.value.title&&r.value.message),u=n.computed(()=>!r.value.title&&r.value.message),f=n.computed(()=>i.showCloseButton),m=n.computed(()=>!!r.value.buttons||!!e.slots.default);function g(C){C.stopPropagation(),C.preventDefault(),s.value=!1,setTimeout(()=>{e.emit("close",r.value)},200)}function y(C,j){}function S(C){return`f-preten-link ${C.customClass?C.customClass:""}`}n.watch(t,()=>{t.value});const v=()=>{var C;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((C=r.value.buttons)==null?void 0:C.map(j=>n.createVNode("span",{class:S(j),onClick:B=>void 0},[j.text]))),e.slots.default&&e.slots.default()])])};return()=>n.createVNode("div",{class:a.value,style:"min-height:44px"},[f.value&&n.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:g},[n.createVNode("span",{class:"f-icon modal_close"},null)]),l.value&&n.createVNode("section",{class:"modal-tips"},[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:d.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[c.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),m.value&&v()]),u.value&&(r.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[v()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),st=n.defineComponent({name:"Notify",props:zo,emits:["close","empty"],setup(i,e){const t=n.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=n.ref(),s=n.ref(i.options),a=n.ref(i.showCloseButton),d=n.computed(()=>i.position||"bottom-right"),l=n.computed(()=>i.timeout!=null?i.timeout:3e3),c=n.computed(()=>{const m=i.bottom?i.bottom:o.bottom,g=i.top?i.top:o.top,y={transition:"all 0.2s ease",left:d.value.indexOf("left")>-1?`${i.left?i.left:o.left}px`:"",right:d.value.indexOf("right")>-1?`${i.right?i.right:o.right}px`:"",top:d.value.indexOf("top")>-1?`${g}px`:"",bottom:d.value.indexOf("bottom")>-1?`${m}px`:""};return d.value.indexOf("center")>-1&&(y.left="50%",y.marginLeft="calc(-24rem / 2)",d.value==="center-center"&&(y.top="50%",y.transform="translate(-50%, -50%)")),y});function u(m){e.emit("close")}l.value&&setTimeout(()=>{u()},l.value),e.expose({closeToast:u,container:r,notifyPosition:d});function f(m,g){u()}return()=>n.createVNode("div",{class:t.value,style:c.value,ref:r},[n.createVNode(Ct,{options:s.value,showCloseButton:a.value,animate:i.animate,onClose:m=>f(m,s.value)},null)])}});class lt{constructor(){oe(this,"notifyRefs",[]);oe(this,"globalConfig",n.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),s=document.createElement("div");s.style.display="contents";const a=n.createApp({setup(){var c;const d=n.ref();function l(){d.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,d),a.unmount()},220)}if(r.position.indexOf("top")>-1){const u=t.getNotifyInstances(r.position),f=u[u.length-1];if(f){const m=f.value.container.getBoundingClientRect();r.top=m.bottom}}return r.safeHtml&&((c=r.options)!=null&&c.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),n.onUnmounted(()=>{document.body.removeChild(s)}),n.onMounted(()=>{t.updateNotifyPositionForCreate(r,d)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(st,n.mergeProps({ref:d},r,{onClose:l}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.mount(s),a}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),s=r.indexOf(t);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",s,a,d;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",a=t.position||null,d=t.showCloseButton!=null?t.showCloseButton:null,s=t.timeout!=null?t.timeout:null);const c={options:{type:e,message:o,title:r}};return a!=null&&(c.position=a),d!=null&&(c.showCloseButton=d),s!=null&&(c.timeout=s),c}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const Ho=Symbol("NOTIFY_SERVICE_TOKEN");st.install=i=>{i.component(st.name,st),i.component(Ct.name,Ct);const e=new lt;i.provide(Ho,e),i.provide("FNotifyService",e)};const _o={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]}},zt=new Map([["appearance",Ne.resolveAppearance],["column","columnOption"]]);function Wo(i,e,t){var f;const o=t.parentComponentInstance,r=o.schema.type,s=String(((f=o.schema.appearance)==null?void 0:f.class)||"").split(" "),a=r==="section"||r==="tab-page",d=s.includes("f-page-content-nav"),l=s.includes("f-page-main"),c=i.getSchemaByType("component");c.id=`${e.id}-component`,c.componentType="data-grid";let u="";return u+=a?"f-struct-data-grid-in-card f-struct-is-subgrid":"",u+=d?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",u+=l?"f-struct-data-grid f-struct-wrapper":"",c.appearance={class:u},c.contents=[e],c}function Yo(i,e,t){const o=t.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),s=r.includes("f-page-content-nav"),a=r.includes("f-page-main"),d=i.getSchemaByType("section");d.id=`${e.id}-section`;let l="";return l+=s?"f-section-in-nav ":"",l+=a?"f-section-in-managelist ":"",l+="f-section-grid",d.appearance={class:l},d.contents=[e],d}function Xo(i,e,t){const o=i.getSchemaByType("content-container");return o.id=`${e.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[e],o}function Gt(i,e,t){const r=t.parentComponentInstance.schema.type,s=r==="section"||r==="tab-page";e.appearance={class:"f-component-grid"};const d=(s?Xo:Yo)(i,e,t);return Wo(i,d,t)}const Ht={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},wt={autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1}};Ne.createPropsResolver(wt,Ht,zt,Gt),Ne.createTreeGridSelectionItemResolver(),Ne.createTreeGridBindingResolver();const Jo=Object.assign({},wt,{componentId:{type:String,default:""}});Ne.createPropsResolver(Jo,Ht,zt,Gt),Ne.createDataViewUpdateColumnsResolver();function Qo(i,e,t,o,r,s,a,d,l,c,u,f,m,g,y,S,v){const{calculateCellPositionInRow:C}=s,{columnContext:j,hasLeftFixedColumn:B,hasRightFixedColumn:N}=a,{gridDataStyle:b,leftFixedGridDataStyle:T,rightFixedGridDataStyle:F}=g,{renderDataRow:p}=ne.getHierarchyRow(i,e,j,v,d,l,c,u,f,m,g,y,S),w=[p];function V(P,W){const K=C(P);return v.value.filter(O=>O.visible!==!1).map((O,q)=>w[O.type](O,K,W,q))}function h(){return n.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:T.value},[V(j.value.leftColumns.filter(P=>P.visible),"left")])])}function M(){return n.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:b.value},[V(j.value.primaryColumns.filter(P=>P.visible),"primary")])])}function H(){return n.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:F.value},[V(j.value.rightColumns.filter(P=>P.visible),"right")])])}function E(){const P=[];return B.value&&P.push(h()),P.push(M()),N.value&&P.push(H()),P}return{renderDataArea:E}}const xt=n.defineComponent({name:"FTreeGrid",props:wt,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(i,e){var be,me;const o=((be=i.rowOption)==null?void 0:be.height)||28,r=n.ref(20),s=n.ref(i.columns),a=ne.useIdentify(i),{idField:d}=a,l=n.ref(),c=n.ref(),u=n.ref(),f=n.ref(),m=n.ref(),g=n.ref([]),y=n.ref(!1),S=n.ref(((me=i.rowOption)==null?void 0:me.wrapContent)||!1),v=ne.useGroupData(i,a),C=ne.useFilter(),j=ne.useHierarchy(i),{collapseField:B}=j,{showLoading:N,renderLoading:b}=ne.useLoading(i,l),T=ne.useDataView(i,new Map,C,j,a),{dataView:F}=T,p=ne.useSelection(i,T,a,g,e),w=ne.useSelectHierarchyItem(i,g,T,a,p,e),V=n.computed(()=>i.disabled),h=n.computed(()=>i.virtualized?Math.min(T.dataView.value.length,r.value):T.dataView.value.length),{containerStyleObject:M}=ne.useDataViewContainerStyle(i),H=ne.useCommandColumn(i),{applyCommands:E}=H;E(s);const P=ne.useColumn(i),W=ne.useSort(i),{applyColumnSorter:K,columnContext:O,updateColumnRenderContext:q}=P;K(T,W);const J=ne.useGroupColumn(i,O),G=ne.useRow(i,e,p,a),Q=ne.useEdit(i,e,a,G,g),ae=ne.useVisualDataBound(i),ye=ne.useVisualDataCell(i,Q,ae),Z=ne.useVisualDataRow(i,T,Q,j,a,ae,ye),we=ne.useVisualData(i,s,T,h,0,Z),{getVisualData:Ce}=we,ce=ne.useCellPosition(i,O),_=ne.useSidebar(i,p),{sidebarWidth:se}=_,pe=ne.useVirtualScroll(i,T,g,O,we,h,0,se),{onWheel:_e,dataGridWidth:Oe,viewPortHeight:Pe,viewPortWidth:De,resetScroll:Re,updateVisibleRowsOnLatestVisibleScope:Le}=pe,$e=ne.useFitColumn(i,O,c,De,J),{calculateColumnsSize:Me}=$e,We=ne.useFilterHistory(),et=ne.useColumnFilter(c,m,T,We,pe),Ye=ne.useDragColumn(i,e,P,T,J,v,pe),tt=n.computed(()=>({"fv-grid":!0,"fv-grid-bordered":i.showBorder,"fv-grid-horizontal-bordered":i.showHorizontalLines,"fv-datagrid-strip":i.showStripe})),Xe=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":y.value,"fv-grid-wrap-content":S.value})),{renderDataArea:Je}=Qo(i,e,u,f,m,ce,P,T,Q,j,G,p,w,pe,we,ae,g),{renderGridHeader:k,renderGridColumnResizeOverlay:te,shouldShowHeader:de}=ne.getColumnHeader(i,e,c,f,m,P,T,Ye,et,C,We,$e,J,p,_,W,pe,De,g),{renderDataGridSidebar:xe}=ne.getSidebar(i,G,p,_,pe),{renderDisableMask:ke}=ne.getDisableMask(),{renderHorizontalScrollbar:nt}=ne.getHorizontalScrollbar(i,c,pe),{renderVerticalScrollbar:ut}=ne.getVerticalScrollbar(i,c,pe);function ot(){var Y,ee,ge;if(c.value&&c.value.clientHeight>0&&((Y=c.value)==null?void 0:Y.clientWidth)>0){const Te=Math.ceil(c.value.clientHeight/o);Te>r.value&&(r.value=Te,Le()),Pe.value=((ee=u.value)==null?void 0:ee.clientHeight)||0,Oe.value=((ge=c.value)==null?void 0:ge.clientWidth)||0,Me()}}n.onMounted(()=>{c.value&&(r.value=Math.max(Math.ceil(c.value.clientHeight/o),r.value),g.value=Ce(0,h.value+0-1),rn.useResizeObserver(c.value,ot),Me(),n.nextTick(()=>{c.value&&(Oe.value=c.value.clientWidth),u.value&&(De.value=u.value.clientWidth,Pe.value=u.value.clientHeight)})),N.value&&b()}),n.onUnmounted(()=>{}),n.watch(De,()=>{c.value&&Me()});function Vt(Y){T.collapseTo(Y),T.reOrderVisibleIndex(),Re()}function Nt(Y){T.expandTo(Y),T.reOrderVisibleIndex(),Re()}function it(){const Y=p.getSelectionRow();return Y?Y.dataIndex-1:-1}function Mt(){const Y=it();T.insertNewDataItem(Y),g.value=Ce(0,h.value+0-1)}function Et(){const Y=it();T.insertNewChildDataItem(Y),g.value=Ce(0,h.value+0-1)}function It(){const Y=it(),ee=w.getNextSelectableHierarchyItemId(Y);T.removeHierarchyDataItem(Y),g.value=Ce(0,h.value+0-1),ee&&p.selectItemById(ee)}function kt(Y){Q.onEditingRow(Y)}function pt(Y){Q.acceptEditingRow(Y)}function Bt(Y){Q.cancelEditingRow(Y)}function ft(Y){Y&&(s.value=Y,E(s),q(s.value),K(T,W),Me())}n.watch(()=>i.columns,Y=>{ft(Y)});function jt(Y,ee){Y&&(T.load(Y),T.reOrderVisibleIndex(),ee!=null&&ee.keepScrollPosition?pe.scrollTo(pe.offsetY.value):Re())}function Ot(Y){p.selectItemById(Y)}function Pt(Y){const ee=g.value.find(ge=>ge.raw[a.idField.value]===Y);ee&&G.clickRowItem(ee)}function mt(Y){G.activeRowById(Y)}function Dt(Y){p.selectItemByIds(Y)}function x(){return p.getSelectedItems()}function D(){p.clearSelection()}const z=n.computed(()=>!g.value||!g.value.length),{renderEmpty:X}=ne.getEmpty(e);function ie(){return p.getSelectionRow()}function re(Y){p.unSelectItemByIds(Y)}function Fe(){return p.currentSelectedDataId.value}function ve(Y,ee,ge){const Te=F.value.find(Ve=>Ve[d.value]===Y);if(Te){if(Object.keys(Te).forEach(he=>{Object.prototype.hasOwnProperty.call(ee,he)&&(Te[he]=ee[he])}),ge){const{collapseField:he,disabledField:Ae,checkedField:Ue,visibleField:ze}=ge;he&&!le.isUndefined(ee[he])&&(Te.__fv_collapse__=ee[he]),Ue&&!le.isUndefined(ee[Ue])&&(Te.__fv_checked__=ee[Ue]),Ae&&!le.isUndefined(ee[Ae])&&(Te.__fv_disabled__=ee[Ae]),ze&&!le.isUndefined(ee[ze])&&(Te.__fv_visible__=ee[ze])}const Ve=g.value.find(he=>he.raw[d.value]===Y),on=g.value.findIndex(he=>he.raw[d.value]===Y);if(Ve){if(Ve.raw=Te,Object.keys(Ve.data).forEach(he=>{Ve.data[he].updateData(Te)}),ge){const{collapseField:he,disabledField:Ae,checkedField:Ue,visibleField:ze}=ge;he&&!le.isUndefined(ee[he])&&(Ve.collapse=ee[he]),Ue&&!le.isUndefined(ee[Ue])&&(Ve.checked=ee[Ue]),Ae&&!le.isUndefined(ee[Ae])&&(Ve.disabled=ee[Ae]),ze&&!le.isUndefined(ee[ze])&&(Ve.visible=ee[ze])}g.value=[...g.value.slice(0,on),Ve,...g.value.slice(on+1)]}}}function Se(Y){const ee=T.dataView.value.find(ge=>ge[d.value]===Y);return ee?ee[B.value]:""}function Ee(){return B.value}e.expose({activeRowById:mt,addNewDataItem:Mt,addNewChildDataItem:Et,collapseTo:Vt,expandTo:Nt,removeDataItem:It,editDataItem:kt,acceptDataItem:pt,cancelDataItem:Bt,updateColumns:ft,updateDataSource:jt,selectItemById:Ot,selectItemByIds:Dt,getSelectedItems:x,clearSelection:D,getSelectionRow:ie,clickRowItemById:Pt,unSelectItemByIds:re,getCurrentRowId:Fe,reassignRowData:ve,getCollapseField:Ee,getCollapseStatusById:Se});const fe=n.computed(()=>{const Y={};return pe.shouldShowHorizontalScrollbar.value&&(Y.paddingBottom="10px"),pe.shouldShowVirticalScrollbar.value&&(Y.paddingRight="10px"),Y}),Ie=n.computed(()=>({...M.value,borderRadius:"5px"}));return()=>n.createVNode("div",{ref:l,class:tt.value,style:Ie.value,onWheel:_e},[c.value&&de.value&&k(),n.createVNode("div",{ref:c,class:Xe.value,onMouseover:()=>y.value=!0,onMouseleave:()=>y.value=!1,style:fe.value},[c.value&&xe(g),c.value&&Je(),c.value&&z.value&&X(),c.value&&nt(),c.value&&ut()]),te(),V.value&&ke()])}});Qe.withInstall(xt);function _t(i){const{designerHostService:e}=i,t=new Map,o=n.ref(),r=n.ref(),s=n.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),a={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},d=n.ref(!1),l=n.ref(i.componentType);function c(S){const v=[];return S.forEach(C=>{let j=[];C.type&&C.type.fields&&C.type.fields.length>0&&(j=c(C.type.fields));const B=le.cloneDeep(C),N=C.multiLanguage?"多语言":C.type.displayName,b=j.length?!1:!t.has(C.id);b&&(d.value=!0),v.push({data:Object.assign({displayedTypeName:N,selectable:b},B),children:j})}),v}function u(S){switch(S){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return S}}function f(S){if(t.clear(),!S)return;let v=u(l.value);["frame","table","form"].includes(v)&&(v="form");const{formSchemaUtils:C,schemaService:j}=e;C.getFormSchema().module.viewmodels.forEach(B=>{if(!B.fields||B.fields.length===0)return;let b=C.getComponentByViewModelId(B.id).componentType;["frame","table","form"].includes(b)&&(b="form");const T=j.getTableInfoByViewModelId(B.id);b!==v||!T||T.id!==S.id||B.fields.forEach(F=>{t.set(F.id,!0)})})}function m(S){f(S);const{fields:v}=S.type;d.value=!1,o.value=c(v),r.value&&r.value.updateDataSource(o.value)}const g={customRowStatus:S=>(S.disabled=!S.raw.selectable,S)};function y(){const S=r.value.getSelectedItems();if(!S.length){const v=new lt;v.globalConfig={position:"top-center"},v.warning({message:"请先选择显示字段"});return}return S.map(v=>v.data)}return{fieldTreeGridRef:r,resolveFieldDataSource:m,occupiedFieldMap:t,fieldDataSource:o,fieldTreeRowOption:g,fieldColumns:s,fieldSelectionOption:a,checkAndGetSelectedFields:y,hasSelectableField:d,currentComponentType:l}}function Zo(i){const{designerHostService:e}=i,t=new Map,o=n.ref(),r=n.ref(),s=n.ref([{field:"name",title:"实体名称"}]),a=n.ref(),d=n.ref(!1);function l(y){const S=_t(i);return S.resolveFieldDataSource(y),S.hasSelectableField.value?(a.value=a.value||y,!0):!1}function c(y){return!(i.bindingEntityId&&i.bindingEntityId!==y.id||!l(y))}function u(y,S=""){var N;if(!y)return;const v=le.cloneDeep(y),C=S?`${S}/${v.label}`:"/";t.set(v.label,C.replace("//","/"));const j=c(v),B={data:Object.assign({selectable:j},v),children:[]};if(v.type.entities&&v.type.entities.length){const b=v.type.entities.map(T=>u(T,C));B.children=B.children.concat(b)}return i.bindingEntityId===y.id&&(a.value=y),((N=a.value)==null?void 0:N.id)===y.id&&!S&&(d.value=!0),B}function f(){var C;const{formSchemaUtils:y}=e,S=(C=y.getFormSchema().module.entity[0])==null?void 0:C.entities[0];t.clear();const v=u(S);r.value=[v]}function m(){const y=o.value.getSelectedItems();if(!y.length){const S=new lt;S.globalConfig={position:"top-center"},S.warning({message:"请先选择实体"});return}return y[0].data}return{entityTreeGridRef:o,entityDataSource:r,resolveEntityDataSource:f,entityBindToMap:t,checkAndGetSelectedEntity:m,entityColumns:s,entityTreeRowOption:{customRowStatus:y=>(y.disabled=!y.raw.selectable,y)},initialSelectedEntity:a,isMainEntityInitialSelected:d}}const Ko=new Map([["appearance",vt]]);function ei(i,e,t){return e}const ti={$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"]},ni={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:[]}}}}}},Wt={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}};gt(Wt,ti,Ko,ei,ni);const oi=n.defineComponent({name:"FStep",props:Wt,emits:["click"],setup(i,e){const t=n.ref(i.direction),o=n.ref(i.fill),r=n.ref(i.height),s=n.ref(i.steps),a=n.ref(i.activeIndex),d=n.computed(()=>({"f-progress-step-list":t.value==="horizontal","f-progress-step-list-block":t.value==="vertical","f-progress-step-horizontal-fill":t.value==="horizontal"&&o.value,"f-progress-step-vertical-fill":t.value==="vertical"&&o.value})),l=n.computed(()=>({height:t.value==="vertical"?`${r.value}px`:""}));function c(N,b){const T={step:!0,active:b===a.value,clickable:i.clickable,current:b===a.value,finish:b<a.value};return N.status&&(T[N.status]=!0),Qe.getCustomClass(T,N.class||"")}function u(N,b){if(!i.clickable)return;const T={step:N,stepIndex:b};e.emit("click",T)}function f(N,b){const T={"f-progressstep-row":!0,"step-active":b===a.value,"step-current":b===a.value,"step-finish":b<a.value};return N.status&&(T["step-"+N.status]=!0),T}function m(N,b){const T={"step-icon":!0,"step-success":b,"f-icon":b,"f-icon-check":b};return Qe.getCustomClass(T,N.icon||"")}function g(N,b){const T=[];return N.icon?T.push(n.createVNode("span",{class:m(N,!1)},null)):b>=a.value?T.push(n.createVNode("span",{class:"step-icon"},[b+1])):T.push(n.createVNode("span",{class:m(N,!0)},null)),T}function y(N,b){return{"step-name":!0,"step-name-success":b<a.value}}function S(N,b){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:y(N,b)},[N.title])])}function v(N,b){return{"f-progress-step-line":!0,"f-progress-step-line-success":b===a.value}}function C(N,b){return b!==s.value.length-1}const j=n.computed(()=>({triangle:!0,"":t.value==="vertical"}));function B(){return s.value.map((N,b)=>n.createVNode("li",{class:c(N,b),onClick:T=>u(N,b)},[n.createVNode("div",{class:f(N,b)},[n.createVNode("div",{class:"f-progress-step-content"},[g(N,b),S(N,b)]),C(N,b)&&n.createVNode("div",{class:v(N,b)},[n.createVNode("span",{class:j.value},null)])])]))}return n.watch(()=>i.activeIndex,()=>{i.activeIndex>-1&&i.activeIndex<=s.value.length&&(a.value=i.activeIndex,B())}),()=>n.createVNode("div",{class:"f-progress-step"},[n.createVNode("ul",{class:d.value,style:l.value},[B()])])}}),St=new Map([["appearance",vt]]),ii=new Map([]),ri="root-viewmodel";class ai{constructor(e,t){oe(this,"formSchemaUtils");oe(this,"controlCreatorUtils");oe(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:s}=e;s==null||s.forEach(d=>{const l=le.cloneDeep(d),c=this.resolveControlClassByFormColumns(e),u=this.controlCreatorUtils.setFormFieldProperty(l,"",c);u&&r.push(u)});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:ri,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{let s="blur";const a=r.type.name;(a===Qe.FormSchemaEntityFieldTypeName.Enum||a===Qe.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}),t}}function si(i,e,t,o){var s,a,d,l,c,u;const r=t.parentComponentInstance;if(r&&o){const f=(s=r.schema)==null?void 0:s.type,g={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=t.bindingSourceContext)==null?void 0:a.entityTitle)||((l=(d=t.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:f==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(u=t.bindingSourceContext)==null?void 0:u.bindingEntityFields};return new ai(i,o).createComponent(g)}else return e}function li(i,e,t){return e}gt({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},St,si);const Yt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Xt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}};Ne.createPropsResolver(Xt,Yt,St,void 0),Ne.createFormGroupEditorResolver();const ci={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""}},di=n.defineComponent({name:"FDynamicFormLabel",props:ci,emits:[],setup(i,e){n.ref(i.title||i.text);const t=n.ref(i.required),o=n.ref(i.text),r=n.ref(i.valid),s=n.ref(i.inValidTip);n.watch(()=>i.text,()=>{o.value=i.text}),n.watch(()=>i.required,(l,c)=>{l!==c&&(t.value=l)}),n.watch([()=>i.valid,()=>i.inValidTip],([l,c])=>{r.value=l,s.value=c});const a=n.computed(()=>r.value?o.value:s.value),d=n.computed(()=>r.value?"":"color:red");return()=>o.value&&n.createVNode("label",{class:"col-form-label",title:a.value,style:d.value},[!r.value&&n.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:s.value},null),n.createVNode("span",{class:"farris-label-text"},[t.value&&n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),o.value])])}}),R={},$={},L={},A={};let Jt=!1;function ui(){Jt||(Jt=!0,ln.register(R,$,L,A),sn.register(R,$,L,A),cn.register(R,$,L,A),dn.register(R,$,L,A),un.register(R,$,L,A),pn.register(R,$,L,A),Rt.register(R,$,L,A),$t.register(R,$,L,A),Rt.register(R,$,L,A),$t.register(R,$,L,A),fn.register(R,$,L,A),mn.register(R,$,L,A),hn.register(R,$,L,A),gn.register(R,$,L,A),yn.register(R,$,L,A),vn.register(R,$,L,A),bn.register(R,$,L,A),Cn.register(R,$,L,A),wn.register(R,$,L,A),xn.register(R,$,L,A),Co.register(R,$,L,A),Sn.register(R,$,L,A),Tn.register(R,$,L,A),fo.register(R,$,L,A),Vn.register(R,$,L,A),Nn.register(R,$,L,A),Mn.register(R,$,L,A),In.register(R,$,L,A),En.register(R,$,L,A),kn.register(R,$,L,A),Bn.register(R,$,L,A),jn.register(R,$,L,A),On.register(R,$,L,A),Pn.register(R,$,L,A),Dn.register(R,$,L,A),Rn.register(R,$,L,A),$n.register(R,$,L,A),qn.register(R,$,L,A),Ln.register(R,$,L,A),An.register(R,$,L,A),Un.register(R,$,L,A),zn.register(R,$,L,A),Hn.register(R,$,L,A),_n.register(R,$,L,A),Gn.register(R,$,L,A),co.register(R,$,L),Wn.register(R,$,L,A),Yn.register(R,$,L,A),Xn.register(R,$,L,A),Jn.register(R,$,L,A),Qn.register(R,$,L,A),Zn.register(R,$,L,A),ho.register(R,$,L,A),Kn.register(R,$,L,A),eo.register(R,$,L,A),to.register(R,$,L,A),no.register(R,$,L,A),oo.register(R,$,L,A),io.register(R,$,L,A),ao.register(R,$,L,A),ro.register(R,$,L,A),so.register(R,$,L,A),lo.register(R,$,L,A),uo.register(R,$,L,A),Fn.register(R,$,L,A),po.register(R,$,L,A),mo.register(R,$,L,A),yo.register(R,$,L,A),go.register(R,$,L,A),vo.register(R,$,L,A),bo.register(R,$,L,A),wo.register(R,$,L,A),xo.register(R,$,L,A))}function pi(){ui();function i(a){const d=R[a];if(!d)throw new Error(`Could not find the editor of type '${a}'`);return d}function e(a,d){const l=$[a];return l?l(d):{}}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"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"time-picker":return"onValueChange";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-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":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged"}}function o(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:e,resolveEditorType:i,getChangeFunctionName:t,getClearFunctionName:o,getMousedownFunctionName:r,getMouseupFunctionName:s}}const fi={errors:{type:Object,default:null}},mi=n.defineComponent({name:"FValidationMessage",props:fi,emits:[],setup(i,e){const t=n.ref(i.errors);n.watch(()=>i.errors,s=>{t.value=s});const o=n.ref(!0),r=n.computed(()=>{if(t.value){const s=Object.keys(t.value).map(a=>{var d;return(d=t.value[a])==null?void 0:d.name});return s.length?s.join(" "):""}return""});return()=>r.value&&n.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>o.value=!o.value},[!o.value&&n.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),o.value&&n.createVNode("span",{class:"f-feedback-message"},[r.value])])}}),Qt=n.defineComponent({name:"FDynamicFormGroup",props:Xt,emits:["change","update:modelValue"],setup(i,e){var T;const t=n.ref(i.id),o=n.ref(i.customClass),r=n.ref(i.editor),s=n.ref(i.label),a=n.ref(i.modelValue),d=n.ref(i.readonly),l=n.ref(((T=i.editor)==null?void 0:T.required)||i.required),c=n.ref(i.showLabel),u=n.ref(i.visible);n.ref(i.type);const f=n.ref(),m=n.ref(i.errors),{resolveEditorProps:g,resolveEditorType:y,getChangeFunctionName:S,getClearFunctionName:v}=pi(),C=n.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":d.value}));function j(F,p,w){a.value=p!==void 0?p:F,e.emit("update:modelValue",a.value),e.emit("change",a.value,{newValue:F,newModelValue:p,parameters:w})}function B(){e.emit("update:modelValue","")}const N=n.computed(()=>{const F=r.value.type||"input-group",p=y(F),w=g(F,r.value),V=S(F),h=v(r.value.type);return h&&(w[h]=B),w[V]=j,(w.id==null||w.id==="")&&(w.id=t.value),F==="number-range"&&r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"?(r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"&&(w.onBeginValueChange=r.value.onBeginValueChange),r.value.onEndValueChange&&typeof r.value.onEndValueChange=="function"&&(w.onEndValueChange=r.value.onEndValueChange)):F==="lookup"&&r.value["onUpdate:idValue"]&&typeof r.value["onUpdate:idValue"]=="function"?w["onUpdate:idValue"]=r.value["onUpdate:idValue"]:F==="property-editor"&&(w.onBeforeOpenVariables=r.value.onBeforeOpenVariables),()=>n.createVNode(p,n.mergeProps({ref:f},w,{modelValue:a.value,"onUpdate:modelValue":M=>a.value=M}),e.slots)});function b(){return n.createVNode(mi,{id:`${t.value}-validation-message`,errors:m.value},null)}return n.watch([()=>i.id,()=>i.customClass,()=>i.editor,()=>i.label,()=>i.modelValue,()=>i.readonly,()=>i.required,()=>i.showLabel,()=>i.visible,()=>i.errors],([F,p,w,V,h,M,H,E,P,W])=>{var K;t.value=F,o.value=p,r.value=w,s.value=V,a.value=h,d.value=M,l.value=((K=r.value)==null?void 0:K.required)||H,c.value=E,u.value=P,m.value=W}),e.expose({editorRef:f}),()=>u.value&&n.createVNode("div",{id:`${t.value}-input-group`,class:o.value,style:i.customStyle},[n.createVNode("div",{class:"farris-group-wrap"},[n.createVNode("div",{class:C.value},[c.value&&n.createVNode(di,{id:`${t.value}-lable`,required:l.value,text:s.value,title:s.value},null),n.createVNode("div",{class:"farris-input-wrap"},[N.value(),b()])])])])}}),hi={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};Ne.createPropsResolver(hi,Yt,St,void 0);const yi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},gi={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};Ne.createPropsResolver(gi,yi,ii,li);const vi={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Tt(){return new DOMException("The request is not allowed","NotAllowedError")}async function bi(i){if(!navigator.clipboard)throw Tt();return navigator.clipboard.writeText(i)}async function Ci(i){const e=document.createElement("span");e.textContent=i,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw Tt()}async function wi(i){try{await bi(i)}catch(e){try{await Ci(i)}catch(t){throw t||e||Tt()}}}function xi(){async function i(e){await wi(e)}return{onCopy:i}}function Si(i,e,t,o){const r=n.ref(14),s=n.ref(140),a=n.ref(""),d=n.ref(o.value.length),l=n.computed(()=>o.value),c=n.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function u(f){if(f.currentTarget){const m=f.currentTarget.value||"";d.value=m.length}}return()=>n.createVNode(n.Fragment,null,[n.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:s.value,onInput:f=>u(f)},[l.value]),n.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[d.value+" / "+s.value])])}function Ti(i,e,t,o){const r=Si(i,e,t,o),s=new Map([["text-area",r]]);function a(d){return s.get(d)||null}return{getEditorRender:a}}function Fi(){const i=n.ref(!1),e=n.ref("复制成功");return{feedbackStyle:n.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return o.opacity=i.value?"0.8":"0",o.display=i.value?"":"none",o}),feedbackMessage:e,toShowFeedback:i}}function Vi(i,e){const t=e.getEditorRender(i.promptEditorType);return()=>t&&t()}function Ni(i){function e(m){if(m==null)return 0;let g=0;for(let y=0;y<m.length;y++){const S=m.charCodeAt(y);S>=0&&S<=128?g++:g=g+2}return g}function t(m,g){if(m!==""&&m!==void 0&&m!==null){m=""+m;const y=m.length;let S="",v=0;for(let C=0;C<y;C++){const j=m.charAt(C);if(v++,encodeURI(j).length>4&&v++,S=S.concat(j),v>=g)return S=S.concat("..."),S}if(v<g)return m}return""}const o=n.computed(()=>!!i.value&&!!i.value.date),r=n.computed(()=>`发生时间 : ${i.value&&i.value.date||""}`),s=n.computed(()=>!!i.value&&!!i.value.detail),a=n.computed(()=>i.value?e(i.value.detail)>160:!1),d=n.ref(!1),l=n.computed(()=>d.value?"收起":"展开"),c=n.computed(()=>{const m="详细信息 : "+(i.value&&i.value.detail)||"";return d.value?m:t(m,160)}),u=n.computed(()=>({position:"absolute",right:0,bottom:d.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function f(){d.value=!d.value}return()=>n.createVNode("div",{class:"toast-msg-detail"},[o.value&&n.createVNode("div",null,[r.value]),s.value&&n.createVNode("div",{class:"exception_wrap"},[n.createVNode("div",{class:"exception_error_msg"},[n.createVNode("div",{innerHTML:c.value},null),a.value&&n.createVNode("span",{style:u.value,onClick:f},[l.value])])])])}function Mi(i){return()=>n.createVNode("p",{class:"toast-msg-detail",innerHTML:i.value},null)}function Ei(i,e,t,o){const r=n.ref(i.exceptionInfo),s=n.computed(()=>{const m={"f-icon":!0},g=`f-icon-${e.value}`;return m[g]=!0,m}),a=n.computed(()=>t.value||r.value&&r.value.message),d=n.computed(()=>o.value),l=n.computed(()=>!!o.value),c=n.computed(()=>!!r.value);function u(){return c.value?Ni(r):l.value?Mi(d):()=>null}const f=u();return()=>n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:s.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[n.createVNode("p",{class:"toast-msg-title",innerHTML:a.value},null),f()])])}function Ii(i,e,t){const{onCopy:o}=e,{toShowFeedback:r}=t,s=n.ref("复制成功"),a=n.ref("复制详细信息"),d=n.ref(i.exceptionInfo||{date:"",message:"",detail:""}),l=n.computed(()=>d.value&&d.value.detail||"");function c(u){o(l.value).catch(f=>{s.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>n.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[n.createVNode("span",{onClick:c,style:"cursor: pointer;"},[a.value])])}function ki(i,e,t,o){const r=n.ref(i.type),s=n.ref(i.buttons),a=n.ref(i.exceptionInfo),d=n.ref(i.okButtonText),l=n.ref(i.cancelButtonText),c=n.ref(!0),u=n.ref(!0),f=n.computed(()=>!!(s.value&&s.value.length)),m=n.computed(()=>a.value&&a.value.date&&a.value.message&&a.value.detail),g=n.computed(()=>!(s.value&&s.value.length)&&(d.value||l.value)),y=n.computed(()=>u.value&&d.value),S=n.computed(()=>c.value&&l.value),v=Ii(i,t,o);function C(B){r.value==="question"&&e.emit("reject"),e.emit("close")}function j(B){r.value==="question"&&e.emit("accept"),e.emit("close")}return()=>n.createVNode("div",{class:"modal-footer"},[m.value&&v(),g.value&&S.value&&n.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:C},[l.value]),g.value&&y.value&&n.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:j},[d.value]),f.value&&s.value.length&&s.value.map(B=>n.createVNode("button",{type:"button",onClick:B.handle,class:B.class},[B.iconClass&&n.createVNode("span",{class:B.iconClass},null),B.text]))])}const ct=n.defineComponent({name:"FMessageBox",props:vi,emits:["accept","reject","close"],setup(i,e){const t=n.ref(i.type),o=n.ref(i.title),r=n.ref(i.detail),s=n.computed(()=>{const v={"modal-tips":!0,"d-flex":!0,"flex-row":!0},C=`messager-type-${t.value}`;return v[C]=!0,v}),a=n.computed(()=>{const v={};return t.value==="prompt"?v.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(v.padding="0.5rem 1.5rem 1rem 1.5rem"),v}),d=xi(),l=Ti(i,t,o,r),c=Fi(),{feedbackStyle:u,feedbackMessage:f}=c;function m(){return n.createVNode("div",{style:u.value},[f.value])}function g(){switch(t.value){case"prompt":return Vi(i,l);default:return Ei(i,t,o,r)}}const y=g(),S=ki(i,e,d,c);return()=>n.createVNode("div",{class:"farris-messager"},[n.createVNode("section",{class:s.value,style:a.value},[y()]),S(),m()])}}),Bi={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},host:{type:Object,default:"body"}};class ue{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ue(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ue(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ue(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ue(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(s)?0:s}return t}return null}static copy(e){return new ue(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class qe{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new qe(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new qe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function ji(i,e){const t=n.ref(),o=n.ref(),r=n.ref(),s=n.ref(),a=n.ref(),d=n.ref(),l=n.ref(),c=n.ref(),u=n.ref(),f=n.ref(),m=n.ref(),g=n.ref(i.resizeable),y=n.ref(),S=n.ref(i.draggable),v=n.ref(!1);function C(){const O=o.value||document.body,q=window.getComputedStyle(O);if(!q||!t.value)return;const J=ue.getTransformInfo(t.value),G={};l.value&&(G.deltaL=t.value.offsetLeft-l.value.x,G.deltaT=t.value.offsetTop-l.value.y);const Q=q.getPropertyValue("position");G.width=O.clientWidth,G.height=O.clientHeight,G.pr=parseInt(q.getPropertyValue("padding-right"),10),G.pb=parseInt(q.getPropertyValue("padding-bottom"),10),G.position=q.getPropertyValue("position"),Q==="static"&&(O.style.position="relative"),G.translateX=J.x,G.translateY=J.y,f.value=G}function j(O){if(t.value){s.value=qe.getCurrent(t.value),a.value=ue.getCurrent(t.value),d.value=s.value?qe.copy(s.value):null,l.value=a.value?ue.copy(a.value):null,C();const q=O.target.getAttribute("type")||"";c.value={n:!!q.match(/n/),s:!!q.match(/s/),w:!!q.match(/w/),e:!!q.match(/e/)}}}function B(){var O,q,J,G;if(t.value){const Q=t.value;c.value&&((c.value.n||c.value.s)&&((O=d.value)!=null&&O.height)&&(Q.style.height=d.value.height+"px"),(c.value.w||c.value.e)&&((q=d.value)!=null&&q.width)&&(Q.style.width=d.value.width+"px"),l.value&&((J=l.value)!=null&&J.x&&(Q.style.left=l.value.x+"px"),(G=l.value)!=null&&G.y&&(Q.style.top=l.value.y+"px")))}}function N(){const O=i.minHeight?i.minHeight:1,q=i.minWidth?i.minWidth:1;d.value&&l.value&&c.value&&s.value&&(d.value.height<O&&(d.value.height=O,c.value.n&&a.value&&(l.value.y=a.value.y+(s.value.height-O))),d.value.width<q&&(d.value.width=q,c.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-q))),i.maxHeight&&d.value.height>i.maxHeight&&(d.value.height=i.maxHeight,a.value&&c.value.n&&(l.value.y=a.value.y+(s.value.height-i.maxHeight))),i.maxWidth&&d.value.width>i.maxWidth&&(d.value.width=i.maxWidth,c.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-i.maxWidth))))}function b(){if(o.value){const O=f.value;if(l.value&&d.value&&c.value&&s.value){const q=O.width-O.pr-O.deltaL-O.translateX-l.value.x,J=O.height-O.pb-O.deltaT-O.translateY-l.value.y;c.value.n&&l.value.y+O.translateY<0&&a.value&&(l.value.y=-O.translateY,d.value.height=s.value.height+a.value.y+O.translateY),c.value.w&&l.value.x+O.translateX<0&&a.value&&(l.value.x=-O.translateX,d.value.width=s.value.width+a.value.x+O.translateX),d.value.width>q&&(d.value.width=q),d.value.height>J&&(d.value.height=J)}}}function T(O){if(!r.value||!s.value||!a.value||!c.value)return;O.subtract(r.value);const q=O.x,J=O.y;c.value.n?(l.value.y=a.value.y+J,d.value.height=s.value.height-J):c.value.s&&(d.value.height=s.value.height+J),c.value.e?d.value.width=s.value.width+q:c.value.w&&(d.value.width=s.value.width-q,l.value.x=a.value.x+q),b(),N(),B()}function F(O){if(!u.value)return;const q=ue.fromEvent(O);q&&T(q)}function p(){if(t.value){const{width:O,height:q,x:J,y:G}=t.value.getBoundingClientRect(),Q=ue.getTransformInfo(t.value);return{size:{width:O,height:q},position:{x:J-Q.x,y:G-Q.y}}}return null}function w(O){if(t.value){const q=p();m.value=q}r.value=void 0,s.value=null,a.value=null,d.value=null,l.value=null,c.value=null,u.value=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",w)}function V(){document.addEventListener("mousemove",F),document.addEventListener("mouseup",w)}function h(O){O instanceof MouseEvent&&O.button===2||S.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),r.value=ue.fromEvent(O),u.value=O.target,j(O),V())}function M(O){return t.value=O,g.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:q=>h(q)},null)])}function H(O=!0){document.body.click();const q=o.value||document.body,J=qe.getCurrent(q),G=t.value;O&&G&&(y.value=p(),y.value.transform=G.style.transform),J&&G&&(d.value=J,d.value.height-=14,d.value.width-=14,G.style.height=d.value.height+"px",G.style.width=d.value.width+"px",G.style.left="7px",G.style.top="7px",G.style.transform="",m.value={size:d.value,position:{x:0,y:0}},S.value=!1,v.value=!0)}function E(){var O,q;if(document.body.click(),y.value){const J={width:y.value.size.width||0,height:y.value.size.height||0},G={x:(window.innerWidth-J.width)/2,y:(window.innerHeight-J.height)/2};(O=d.value)==null||O.set(J),(q=l.value)==null||q.set(G);const Q=t.value;Q.style.height=J.height+"px",Q.style.width=J.width+"px",Q.style.left=`${G.x}px`,Q.style.top=`${G.y}px`,Q.style.transform="",m.value={size:J,position:G},S.value=i.draggable,v.value=!1}}function P(){if(t.value){const O=qe.getCurrent(t.value);if(O){const{width:q,height:J}=O;t.value.style.left=`${(window.innerWidth-q)/2}px`,t.value.style.top=`${(window.innerHeight-J)/2}px`,t.value.style.transform=""}}}function W(){const O=()=>{v.value?H(!1):P(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const K=W();return{renderResizeBar:M,boundingElement:o,resizedEventParam:m,maximize:H,restore:E,allowDrag:S,isMaximized:v,unWindowResizeHandle:K}}function Oi(i,e,t){const o=n.ref(),r=n.ref(i.draggable),s=n.ref(i.lockAxis),a=n.ref(),d=n.ref(),l=n.ref(!1),c=n.ref(new ue(0,0)),u=n.ref(new ue(0,0)),f=n.ref(new ue(0,0)),m=n.ref(new ue(0,0));n.watch(()=>t.value,F=>{a.value.style.cursor=F?"move":"default"});function g(F,p){if(p.tagName==="BUTTON")return!1;if(p===F)return!0;for(const w in p.children)if(Object.prototype.hasOwnProperty.call(p.children,w)&&g(F,p.children[w]))return!0;return!1}function y(){var V,h;let F=f.value.x+u.value.x,p=f.value.y+u.value.y;s.value==="x"?(F=((V=c.value)==null?void 0:V.x)||0,f.value.x=0):s.value==="y"&&(p=((h=c.value)==null?void 0:h.y)||0,f.value.y=0);const w=`translate3d(${Math.round(F)}px, ${Math.round(p)}px, 0px)`;o.value&&(o.value.style.transform=w),m.value.x=F,m.value.y=p}function S(){if(!d.value||!o.value)return null;const F=d.value.getBoundingClientRect(),p=o.value.getBoundingClientRect(),w={top:F.top<p.top,right:F.right>p.right,bottom:F.bottom>p.bottom,left:F.left<p.left};return w.top||(f.value.y-=p.top-F.top),w.bottom||(f.value.y-=p.bottom-F.bottom),w.right||(f.value.x-=p.right-F.right),w.left||(f.value.x-=p.left-F.left),y(),w}function v(F){F&&(c.value&&F.subtract(c.value),f.value.set(F),y(),S())}function C(F){l.value&&r.value&&(F.stopPropagation(),F.preventDefault(),v(ue.fromEvent(F,a.value)))}function j(){var F;l.value&&(l.value=!1,u.value.add(f.value),f.value.reset(),(F=o.value)==null||F.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",j))}function B(){!l.value&&a.value&&(l.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",C),document.addEventListener("mouseup",j))}function N(){if(o.value){const F=ue.getTransformInfo(o.value);u.value.set(F);return}u.value.reset()}function b(F){if(!t.value||F instanceof MouseEvent&&F.button===2)return;const p=F.target||F.srcElement;a.value!==void 0&&p&&!g(p,a.value)||r.value!==!1&&(document.body.click(),F.stopPropagation(),F.preventDefault(),c.value=ue.fromEvent(F,o.value),N(),B())}function T(F,p,w){if(r.value&&p){if(F)a.value=F;else if(i.dragHandle){if(i.dragHandle instanceof HTMLElement)a.value=i.dragHandle;else if(typeof i.dragHandle=="string"){const V=p.querySelector(i.dragHandle);V&&(a.value=V)}}o.value=p,d.value=w,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",b)):r.value=!1}}return{registerDraggle:T,resetTranslate:N}}function Zt(i,e){if(i){const t=o=>{o.key.toLowerCase()===i.toLowerCase()&&e({event:o,key:i})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Pi(i,e){const t=n.ref(i.enableEsc);let o=null;return t.value?(o=Zt("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Di(i,e){const t=n.ref(i.enableEnter);let o=null;return t.value?(o=Zt("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ke=n.defineComponent({name:"FModal",props:Bi,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(i,e){const t=n.ref(i.width||300),o=n.ref(i.height||200),r=n.ref(i.modelValue),s=n.ref(""),a=n.ref(i.class),d=n.ref(i.fitContent),l=n.ref(i.showHeader),c=n.ref(""),u=n.ref(i.showCloseButton),f=n.ref(i.showMaxButton),m=n.ref(!1),g=n.ref(i.dialogType),y=n.ref(i.src),S=n.ref(""),v=n.ref(i.showButtons),C=n.ref(i.title),j=n.ref(i.containment||null),B=n.ref(),N=n.ref(!1);function b(k,te){Promise.resolve().then(()=>{var de;return(de=i.beforeClose)==null?void 0:de.call(i)}).then(de=>{de&&(r.value=!1,e.emit("update:modelValue",!1),te!=null&&e.emit(te?"accept":"cancel"),e.emit("closed",k))})}const T=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:k=>{b(k,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:k=>{b(k,!0)}}],F=n.ref(i.buttons&&i.buttons.length?i.buttons:T),p=n.computed(()=>!!c.value),w=n.computed(()=>!!v.value&&!!F.value),V=n.ref(),h=n.ref(),M=n.ref(!1),{renderResizeBar:H,maximize:E,restore:P,boundingElement:W,resizedEventParam:K,allowDrag:O,unWindowResizeHandle:q}=ji(i),{registerDraggle:J}=Oi(i,e,O);function G(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function Q(){const k=document.querySelectorAll(".farris-modal").length;(!k||k-1<=0)&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}n.watch(()=>i.title,(k,te)=>{k!==te&&(C.value=k)}),n.watch(()=>i.modelValue,(k,te)=>{k!==te&&(r.value=k,r.value&&i.draggable&&n.nextTick(()=>{h.value&&!j.value&&(j.value=h.value.parentElement,W.value=j.value,J(V.value,h.value,W.value))}),k||(j.value&&(j.value=null),Q())),r.value&&(N.value=G())}),n.watch(()=>i.showHeader,(k,te)=>{k!==te&&(l.value=k)}),n.watch(()=>i.showButtons,(k,te)=>{k!==te&&(v.value=k)}),n.watch(()=>K.value,(k,te)=>{const de=k||{},xe=te||{};JSON.stringify(de)!==JSON.stringify(xe)&&e.emit("resize",{newSize:k,oldSize:te,isMaximized:M.value})});const ae=n.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ye=n.computed(()=>{var de;const k={modal:!0,"farris-modal":!0,fade:!0};k["f-modal-fitContent"]=!!d.value,k.show=!!ae.value;const te=(de=i.maskClass)==null?void 0:de.split(" ");return te==null||te.reduce((xe,ke)=>(xe[ke]=!0,xe),k),k}),Z=n.computed(()=>{var de;const k={"modal-dialog":!0},te=(de=a.value)==null?void 0:de.split(" ");return te==null||te.reduce((xe,ke)=>(xe[ke]=!0,xe),k),k}),we=n.computed(()=>{const k={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:d.value?"auto":`${o.value}px`};return i.mask||(k.pointerEvents="auto"),k}),Ce=n.computed(()=>{const k={display:"block"};return i.mask||(k.pointerEvents="none",k.backgroundColor="transparent"),N.value&&(k.backgroundColor="transparent"),k}),ce=n.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),_=n.computed(()=>{const k={display:l.value?"":"none"};return k["pointer-events"]=O.value?"auto":"none",k}),se=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:M.value})),pe=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":g.value==="iframe","f-utils-fill":!0}));function _e(){return{height:`${i.footerHeight||60}px`}}const Oe=n.computed(()=>{const k={textAlgin:S.value},te=_e();return Object.assign(k,te)});function Pe(k){if(k.stopPropagation(),M.value){M.value=!1,P();return}E(),M.value=!0}async function De(k,te){k.handle&&await k.handle(te,k)&&e.emit("closed",te)}function Re(k){k.width&&(t.value=k.width),k.height&&(o.value=k.height),k.buttons&&(F.value=k.buttons),k.title&&(C.value=k.title)}let Le=null,$e=null;n.onBeforeMount(()=>{N.value=G()}),n.onMounted(()=>{h.value&&!j.value&&(j.value=h.value.parentElement,W.value=j.value,J(V.value,h.value,W.value)),ae.value&&document.body.classList.add("modal-open"),Le=Pi(i,e),$e=Di(i,e)}),n.onUnmounted(()=>{q&&q(),Le&&Le.remove(),$e&&$e.remove()}),e.expose({modalElementRef:h,updateModalOptions:Re,close:b,maxDialog:Pe,isMaximized:M});function Me(){return n.createVNode("ul",null,[m.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&n.createVNode("li",{onClick:Pe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:se.value},null)]),u.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:k=>b(k,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}function We(){return n.createVNode("div",{class:"modal-footer",style:Oe.value},[F.value&&F.value.map(k=>{const te=n.ref(k.disabled);return n.createVNode("button",{name:k.name,type:"button",disabled:te.value,class:k.class+(k.iconClass?" btn-icontext":""),onClick:de=>{De(k,de)}},[!!k.iconClass&&n.createVNode("i",{class:k.iconClass},null),k.text])})])}function et(){return n.createVNode("div",{ref:V,class:"modal-header",style:_.value},[e.slots.headerTemplate?e.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[p.value&&n.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[C.value])]),n.createVNode("div",{class:"actions"},[Me()])])}function Ye(){return e.slots.footerTemplate?e.slots.footerTemplate():w.value&&We()}function tt(k){if(k.stopPropagation(),i.allowClickMaskToClose){if(k.target!==B.value)return;b(k,!1)}}function Xe(){var k,te;return n.createVNode("div",{id:s.value,class:Z.value,style:we.value,ref:h},[n.createVNode("div",{class:ce.value},[l.value&&et(),n.createVNode("div",{class:pe.value},[(te=(k=e.slots).default)==null?void 0:te.call(k),g.value==="iframe"&&n.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:y.value},null)]),Ye()]),!d.value&&h.value&&!M.value&&H(h.value)])}function Je(k){return k||"body"}return()=>n.createVNode(n.Teleport,{to:Je(i.host)},{default:()=>[ae.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:B,class:ye.value,style:Ce.value,onClick:tt},[Xe()])]})]})}});function Kt(i){if(i.content&&i.content.render)return i.content.render;if(i.render&&typeof i.render=="function")return i.render}function Ri(i){const e=document.createElement("div");e.style.display="contents";const t=n.createApp({setup(o,r){n.onUnmounted(()=>{document.body.removeChild(e)});const s=n.ref(),a=n.ref(i.class||""),d=n.ref(!!i.showButtons),l=n.ref(!!i.showHeader),c=n.ref(i.showCloseButton==null?!0:i.showCloseButton),u=n.ref(!0),f=n.ref(i.title||""),m=i.acceptCallback||(()=>{}),g=i.rejectCallback||(()=>{}),y=i.closedCallback||(B=>{}),S=i.resizeHandle||(B=>{}),v=i.stopMoveHandle||(B=>{}),C=Kt(i),j=B=>{u.value=!1,t.unmount(),y(B)};return n.onMounted(()=>{}),r.expose({modalRef:s}),()=>n.createVNode(Ke,{ref:s,class:a.value,modelValue:u.value,"onUpdate:modelValue":B=>u.value=B,title:f.value,width:i.width,height:i.height,buttons:i.buttons,"show-header":l.value,"show-buttons":d.value,"show-close-button":c.value,"show-max-button":!1,onAccept:m,onCancel:g,fitContent:i.fitContent==null?!0:i.fitContent,onClosed:j,onResize:S,onStopMove:v},{default:()=>[C&&C(t)]})}});return document.body.appendChild(e),t.mount(e),t}class en{constructor(e){oe(this,"appContext",null);oe(this,"modalRef",n.ref());oe(this,"activeModalIndex",n.ref(0));oe(this,"modalRefs",{});oe(this,"isUseEscCloseModal",n.ref(!1));oe(this,"activeModalInstance",n.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Ri(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=n.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),d=o.value.closedCallback||((b,T)=>{}),l=o.value.resizeHandle||(b=>{}),c=e.stopMoveHandle||(b=>{});let u;const f=Kt(o.value),m=b=>{var F;r.value=!1;const T=(F=b==null?void 0:b.target)==null?void 0:F.classList.contains("modal_close");d(b,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},g=b=>{m(b),u&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,t),u=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs).map(F=>Number(F));T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},y=b=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(b==null?void 0:b.event))},{width:S,height:v}=o.value,C=this.adaptToWindow(S||500,v||320);Object.assign(o.value,C);const j=()=>n.createVNode(Ke,n.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b},o.value,{onAccept:s,onCancel:a,onClosed:g,onResize:l,onEsc:y,onStopMove:c}),{default:()=>[f&&f(this.app)]});return u=(b=>{const T=n.h(j,b);return T.appContext=this.appContext,n.render(T,t),T})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:b=>{o.value={...o.value,...b},u&&n.render(n.cloneVNode(u,{...o}),t)},destroy:g,modalRef:this.activeModalInstance,close:()=>this.close()}}}const $i=Symbol("FModalService");Ke.install=i=>{i.component(Ke.name,Ke);const e=new en(i);i.provide($i,e),i.provide("FModalService",e)};class Be{static show(e){const t=n.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",s=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",a=t.acceptCallback||(()=>{}),d=t.rejectCallback||(()=>{});let l=null,c=new en(l);const u=()=>{l&&(l==null||l.destroy(),c=null)};return l=c==null?void 0:c.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>n.createVNode(ct,n.mergeProps(t,{onAccept:a,onReject:d,onClose:u}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const o=n.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(o)}static warning(e,t){const o=n.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(o)}static success(e,t){const o=n.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Be.show(o)}static error(e,t,o){const r=n.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:e,detail:t}});Be.show(r)}static prompt(e,t){const o=n.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Be.show(o)}static question(e,t,o,r){const s=n.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Be.show(s)}}ct.install=i=>{i.component(ct.name,ct),i.provide("FMessageBoxService",Be)};const qi=n.defineComponent({name:"FEntityBindingSelector",props:_o,emits:["submit","cancel"],setup(i,e){const t=Zo(i),{entityColumns:o,entityTreeGridRef:r,entityDataSource:s,checkAndGetSelectedEntity:a,resolveEntityDataSource:d,entityTreeRowOption:l,initialSelectedEntity:c,isMainEntityInitialSelected:u}=t,f=_t(i),{fieldColumns:m,resolveFieldDataSource:g,fieldDataSource:y,fieldTreeGridRef:S,fieldTreeRowOption:v,fieldSelectionOption:C,checkAndGetSelectedFields:j,currentComponentType:B}=f,N=new lt;N.globalConfig={position:"top-center"};const b=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],T=n.ref(),F=n.ref(""),p=n.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),w=n.ref(0),V=n.ref(""),h=n.computed(()=>Q=>({"f-utils-fill":!0,border:Q!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":p.value[w.value].id!==Q}));function M(){i.bindingEntityId&&(c!=null&&c.value)&&(F.value=c.value.name),i.componentType||(T.value=u.value?"response-form":"data-grid")}function H(){const Q=a();Q&&(g(Q),S.value.updateDataSource(y.value))}n.onBeforeMount(()=>{i.steps&&(p.value=p.value.filter(Q=>i.steps.includes(Q.id))),V.value=p.value[0].id,d(),M()}),n.onMounted(()=>{var Q,ae;r&&((Q=c.value)!=null&&Q.id)&&r.value.selectItemById((ae=c.value)==null?void 0:ae.id),p.value.length===1&&p.value[0].id==="selectFields"&&H()});function E(Q){var ae;(ae=S==null?void 0:S.value)!=null&&ae.clearSelection&&S.value.clearSelection()}function P(){return n.createVNode(xt,{key:1,ref:r,fit:!0,data:s.value,idField:"id",columns:o.value,rowNumber:{enable:!1},"row-option":l,columnOption:{fitColumns:!0}},null)}function W(){return n.createVNode(xt,{key:2,ref:S,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:y.value,idField:"id",columns:m.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":v,selection:C},null)}function K(){const Q={editable:!1,type:"combo-list",data:b,idField:"value",valueField:"value",textField:"name"},ae={type:"input-group",enableClear:!1};return n.createVNode("div",null,[n.createVNode("div",{class:"f-utils-fill"},[n.createVNode("div",{class:"f-section py-0"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode("组件信息")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode(Qt,{label:"组件类型",customClass:"col-12",modelValue:T.value,"onUpdate:modelValue":ye=>T.value=ye,required:"true",editor:Q,onChange:E},null),n.createVNode(Qt,{label:"组件标题",customClass:"col-12",modelValue:F.value,"onUpdate:modelValue":ye=>F.value=ye,required:"true",editor:ae},null)])])])])])}function O(){w.value--,V.value=p.value[w.value].id}function q(){var Q;switch(V.value){case"selectEntity":{H();break}case"selectComponentType":{if(!T.value){N.warning("请先选择组件类型");return}if(!((Q=F.value)!=null&&Q.trim())){N.warning("请先填写组件标题");return}B.value=T.value,g(c.value),S.value.updateDataSource(y.value);break}}w.value++,V.value=p.value[w.value].id}function J(){e.emit("cancel")}function G(){var ye;const Q=a(),ae=j();if(Q&&ae){const Z={bindingType:"entity"};Z.bindingEntity=Q,Z.bindTo=t.entityBindToMap.get(((ye=Z.bindingEntity)==null?void 0:ye.label)||""),Z.bindingEntityFields=ae,Z.entityTitle=F.value,e.emit("submit",{bindingContext:Z,componentType:T.value})}}return()=>{var Q;return n.createVNode("div",{class:"h-100 d-flex flex-column"},[((Q=p.value)==null?void 0:Q.length)>1?n.createVNode(oi,{steps:p,activeIndex:w,style:"align-self:center"},null):"",n.createVNode("div",{class:h.value("selectEntity"),style:"border-radius:10px;"},[P()]),n.createVNode("div",{class:h.value("selectComponentType"),style:"border-radius:10px;"},[K()]),n.createVNode("div",{class:h.value("selectFields"),style:"border-radius:10px;"},[W()]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{class:"btn btn-secondary",onClick:J},[n.createTextVNode("取消")]),w.value!==0?n.createVNode("button",{class:"btn btn-secondary",onClick:O},[n.createTextVNode("上一步")]):"",w.value!==p.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:q},[n.createTextVNode("下一步")]):"",w.value===p.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:G},[n.createTextVNode("确定")]):""])])}}});function Li(i,e){let t;function o(l){var y,S,v,C,j,B;const c=(S=(y=i.parent)==null?void 0:y.parent)==null?void 0:S.componentInstance;if(!((j=(C=(v=c==null?void 0:c.value)==null?void 0:v.schema)==null?void 0:C.contents)!=null&&j.length))return;const u={componentType:"response-form",bindingSourceContext:l,parentComponentInstance:c.value},f=c.value.addNewChildComponentSchema(u,e),m=(B=i.parent)==null?void 0:B.schema,g=c.value.schema.contents.findIndex(N=>N.id===(m==null?void 0:m.id));g>-1&&c.value.schema.contents.splice(g+1,0,f)}function r(l){var c,u;o(l.bindingContext),(c=t==null?void 0:t.modalRef)!=null&&c.value.close&&((u=t==null?void 0:t.modalRef)==null||u.value.close())}function s(){var l,c;(l=t==null?void 0:t.modalRef)!=null&&l.value.close&&((c=t==null?void 0:t.modalRef)==null||c.value.close())}function a(){if(!e)return;const{schemaService:l,formSchemaUtils:c}=e,{componentType:u}=i.schema,f=c.getViewModelIdByComponentId(i.componentInstance.value.belongedComponentId),m=l.getTableInfoByViewModelId(f),g=m==null?void 0:m.id,y=["selectFields"];return()=>n.createVNode(n.Fragment,null,[n.createVNode(qi,{componentType:u,bindingEntityId:g,steps:y,designerHostService:e,onSubmit:r,onCancel:s},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function d(l){l.stopPropagation(),l.preventDefault(),e&&(t=e.modalService.open({title:"添加卡片",width:800,height:600,fitContent:!1,showButtons:!1,render:a(),enableEsc:!1,draggable:!0}))}return{addSiblingComponent:d}}const Ai={componentId:{type:String,default:""},designerHostService:{type:Object,default:{}}};var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ui={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(){return function(){function t(o,r,s){function a(c,u){if(!r[c]){if(!o[c]){var f=typeof dt=="function"&&dt;if(!u&&f)return f(c,!0);if(d)return d(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var g=r[c]={exports:{}};o[c][0].call(g.exports,function(y){var S=o[c][1][y];return a(S||y)},g,g.exports,t,o,r,s)}return r[c].exports}for(var d=typeof dt=="function"&&dt,l=0;l<s.length;l++)a(s[l]);return a}return t}()({1:[function(t,o,r){var s={},a="(?:^|\\s)",d="(?:\\s|$)";function l(f){var m=s[f];return m?m.lastIndex=0:s[f]=m=new RegExp(a+f+d,"g"),m}function c(f,m){var g=f.className;g.length?l(m).test(g)||(f.className+=" "+m):f.className=m}function u(f,m){f.className=f.className.replace(l(m)," ").trim()}o.exports={add:c,rm:u}},{}],2:[function(t,o,r){(function(s){var a=t("contra/emitter"),d=t("crossvent"),l=t("./classes"),c=document,u=c.documentElement;function f(h,M){var H=arguments.length;H===1&&Array.isArray(h)===!1&&(M=h,h=[]);var E,P,W,K,O,q,J,G,Q,ae=null,ye,Z,we=!1,Ce=0,ce,_=M||{};_.moves===void 0&&(_.moves=j),_.accepts===void 0&&(_.accepts=j),_.invalid===void 0&&(_.invalid=tt),_.containers===void 0&&(_.containers=h||[]),_.isContainer===void 0&&(_.isContainer=C),_.copy===void 0&&(_.copy=!1),_.copySortSource===void 0&&(_.copySortSource=!1),_.revertOnSpill===void 0&&(_.revertOnSpill=!1),_.removeOnSpill===void 0&&(_.removeOnSpill=!1),_.direction===void 0&&(_.direction="vertical"),_.ignoreInputTextSelection===void 0&&(_.ignoreInputTextSelection=!0),_.mirrorContainer===void 0&&(_.mirrorContainer=c.body);var se=a({containers:_.containers,start:et,end:Xe,cancel:xe,remove:de,destroy:De,canMove:We,dragging:!1});return _.removeOnSpill===!0&&se.on("over",Nt).on("out",it),_e(),se;function pe(x){return se.containers.indexOf(x)!==-1||_.isContainer(x)}function _e(x){var D=x?"remove":"add";y(u,D,"mousedown",Le),y(u,D,"mouseup",k)}function Oe(x){var D=x?"remove":"add";y(u,D,"mousemove",$e)}function Pe(x){var D=x?"remove":"add";d[D](u,"selectstart",Re),d[D](u,"click",Re)}function De(){_e(!0),k({})}function Re(x){ye&&x.preventDefault()}function Le(x){K=x.clientX,O=x.clientY;var D=S(x)!==1||x.metaKey||x.ctrlKey;if(!D){var z=x.target,X=Me(z);X&&(ye=X,Oe(),x.type==="mousedown"&&(T(z)?z.focus():x.preventDefault()))}}function $e(x){if(ye){if(S(x)===0){k({});return}if(!(x.clientX!==void 0&&Math.abs(x.clientX-K)<=(_.slideFactorX||0)&&x.clientY!==void 0&&Math.abs(x.clientY-O)<=(_.slideFactorY||0))){if(_.ignoreInputTextSelection){var D=V("clientX",x)||0,z=V("clientY",x)||0,X=c.elementFromPoint(D,z);if(T(X))return}var ie=ye;Oe(!0),Pe(),Xe(),Ye(ie),l.add(G||W,"gu-transit"),Et(),Mt(),Ce=0,ot(x)}}}function Me(x){if(!(se.dragging&&E)&&!pe(x)){for(var D=x;b(x)&&pe(b(x))===!1;)if(_.invalid(x,D)||(x=b(x),!x))return;var z=b(x);if(z&&!_.invalid(x,D)){var X=_.moves(x,z,D,p(x));if(X)return{item:x,source:z}}}}function We(x){return!!Me(x)}function et(x){var D=Me(x);D&&Ye(D)}function Ye(x){Dt(x.item,x.source)&&(G=x.item.cloneNode(!0),se.emit("cloned",G,x.item,"copy")),P=x.source,W=x.item,q=J=p(x.item),se.dragging=!0,se.emit("drag",W,P)}function tt(){return!1}function Xe(){if(se.dragging){var x=G||W;te(x,b(x))}}function Je(){ye=!1,Oe(!0),Pe(!0)}function k(x){if(Je(),!!se.dragging){var D=G||W,z=V("clientX",x)||0,X=V("clientY",x)||0,ie=v(E,z,X),re=ut(ie,z,X);re&&(G&&_.copySortSource||!G||re!==P)?te(D,re):_.removeOnSpill?de():xe()}}function te(x,D){var z=b(x);G&&_.copySortSource&&D===P&&z.removeChild(W),nt(D)?se.emit("cancel",x,P):se.emit("drop",x,D,P,J),ke()}function de(){if(se.dragging){var x=G||W,D=b(x);D&&D.removeChild(x),se.emit(G?"cancel":"remove",x,D,P),ke()}}function xe(x){if(se.dragging){var D=arguments.length>0?x:_.revertOnSpill,z=G||W,X=b(z),ie=nt(X);ie===!1&&D&&(G?X&&X.removeChild(G):P.insertBefore(z,q)),ie||D?se.emit("cancel",z,P,P):se.emit("drop",z,X,P,J),ke()}}function ke(){var x=G||W;Je(),It(),kt(),x&&l.rm(x,"gu-transit"),Q&&clearTimeout(Q),se.dragging=!1,ae&&se.emit("out",x,ae,P),se.emit("dragend",x,Ce),P=W=G=q=J=Q=ae=null}function nt(x,D){var z;return D!==void 0?z=D:E?z=J:z=p(G||W),x===P&&z===q}function ut(x,D,z){for(var X=x;X&&!ie();)X=b(X);return X;function ie(){var re=pe(X);if(re===!1)return!1;var Fe=pt(X,x),ve=mt(X,Fe,D,z),Se=nt(X,ve);return Se?!0:_.accepts(W,X,P,ve)}}function ot(x){if(!E)return;x.preventDefault();var D=V("clientX",x)||0,z=V("clientY",x)||0;E.style.left=D-2+"px",E.style.top=z-2+"px";var X=G||W,ie=v(E,D,z),re=ut(ie,D,z),Fe=re!==null&&re!==ae;(Fe||re===null)&&(be(),ae=re,Ie()),Pt(ie,z);var ve=b(X);if(re===P&&G&&!_.copySortSource){ve&&ve.removeChild(X);return}var Se,Ee=pt(re,ie);if(we=Bt(Ee,re),Ee!==null)Se=mt(re,Ee,D,z);else if(_.revertOnSpill===!0&&!G)Se=q,re=P;else{G&&ve&&ve.removeChild(X),G&&Z&&(Z.style.display="none");return}Z.style.display="block",Vt(Se,X,Fe),Se?jt(Ee,Se):Ot(re);function fe(me){se.emit(me,X,ae,P)}function Ie(){Fe&&fe("over")}function be(){ae&&fe("out")}}function Vt(x,D,z){(x===D||x===p(D))&&(J=p(D)),(x===null&&z||x!==D&&x!==p(D))&&(J=x)}function Nt(x){l.rm(x,"gu-hide")}function it(x){se.dragging&&l.add(x,"gu-hide")}function Mt(){E||(E=document.createElement("div"),E.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;",E.innerHTML=_.getMirrorText&&_.getMirrorText(W)||"控件",l.add(E,"gu-mirror"),_.mirrorContainer.appendChild(E),y(u,"add","mousemove",ot),l.add(_.mirrorContainer,"gu-unselectable"),se.emit("cloned",E,W,"mirror"))}function Et(){if(Z=document.createElement("div"),l.add(Z,"gu-insertion"),W){var x=W.getBoundingClientRect();Z.style.left=x.left+"px",Z.style.top=x.top+"px"}we=!1,_.mirrorContainer.appendChild(Z)}function It(){E&&(l.rm(_.mirrorContainer,"gu-unselectable"),y(u,"remove","mousemove",ot),b(E).removeChild(E),E=null)}function kt(){Z&&(b(Z).removeChild(Z),Z=null)}function pt(x,D){for(var z=D;z!==x&&b(z)!==x;)z=b(z);return z===u?null:z}function Bt(x,D){if(!D)return we;var z=x||D&&D.lastElementChild;if(!z)return!0;var X=getComputedStyle(x),ie=/^inline/.test(X.getPropertyValue("display"))||/^(left|right)$/.test(X.getPropertyValue("float"));if(ie)return!0;if(D){var re=getComputedStyle(D),Fe=re.getPropertyValue("display");if(/flex$/.test(Fe)){var ve=re.getPropertyValue("flex-direction")||"row";if(ve==="row"||ve==="row-reverse")return!ft(D)}return!1}return!0}function ft(x){if(!x.children||!x.children.length)return!1;for(const D of Array.from(x.children)){const X=(D.className&&D.className.split(" ")||[]).filter(ie=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ie));if(!X.length)return!1;for(const ie of X){const re=ie.slice(ie.lastIndexOf("-")+1);if(parseInt(re,10)!==12)return!1}}return!0}function jt(x,D){const z=D.getBoundingClientRect();if(Z.style.left=z.left+"px",Z.style.top=z.top+"px",we){if(Z.style.height=z.height+"px",Z.style.width="4px",x){const X=x.getBoundingClientRect();X.top!==z.top&&(Z.style.left=X.right+"px",Z.style.top=X.top+"px",Z.style.height=X.height+"px")}}else if(Z.style.height="4px",Z.style.width=z.width+"px",ce){const X=ce.getBoundingClientRect();z.top<X.top&&(Z.style.display="none")}D===W&&W&&(Z.style.display="none")}function Ot(x){J=null;var D=x.lastElementChild;if(D){var z=D.getBoundingClientRect();we?(Z.style.left=z.right+"px",Z.style.top=z.top+"px",Z.style.height=z.height+"px",Z.style.width="4px"):(Z.style.left=z.left+"px",Z.style.top=z.bottom+"px",Z.style.height="4px",Z.style.width=z.width+"px"),D===W&&W&&(Z.style.display="none")}else Z.style.display="none"}function Pt(x,D){if(!_.mirrorContainer.contains(x)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ce=m(x),!ce||!ce.contains(x)))return;const z=document.querySelector(".dgComponentSelected"),X=ce.getBoundingClientRect();if(D-30<X.top&&ce.scrollTop>0){let ie=ce.scrollTop<10?ce.scrollTop:10;ce.scrollBy(0,-1*ie),z&&ce.contains(z)&&(Ce=Ce+-1*ie)}if(D+30>X.bottom&&ce.scrollTop<ce.scrollHeight-ce.clientHeight){const ie=ce.scrollHeight-ce.clientHeight-ce.scrollTop;let re=ie<10?ie:10;ce.scrollBy(0,re),z&&ce.contains(z)&&(Ce=Ce+re)}}function mt(x,D,z,X){var ie=_.direction==="horizontal",re=_.direction==="mixed",Fe=D!==x?Se():ve();return Fe;function ve(){var fe=x.children.length,Ie,be,me;for(Ie=0;Ie<fe;Ie++)if(be=x.children[Ie],me=be.getBoundingClientRect(),ie&&me.left+me.width/2>z||!re&&!ie&&me.top+me.height/2>X||re&&me.left+me.width>z&&me.top+me.height>X)return be;return null}function Se(){var fe=D.getBoundingClientRect();if(re){var Ie=X-fe.top,be=z-fe.left,me=fe.bottom-X,Y=fe.right-z,ee=Math.min(be,Y,Ie,me),ge;return we?ge=Y<be:ge=me===ee||Y===ee||be===ee,Ee(ge)}return Ee(ie?z>fe.left+B(fe)/2:X>fe.top+N(fe)/2)}function Ee(fe){return fe?p(D):D}}function Dt(x,D){return typeof _.copy=="boolean"?_.copy:_.copy(x,D)}}function m(h){const M=Array.from(window.scrollContainerList);if(M.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const H=g(M);for(const E of H)if(E.contains(h))return E;return null}function g(h){const M=[];return h.forEach(H=>{const E=document.getElementById(H);E&&M.push(E)}),M.sort((H,E)=>H.contains(E)?1:E.contains(H)?-1:0),M}function y(h,M,H,E){var P={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},W={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?d[M](h,W[H],E):s.navigator.msPointerEnabled?d[M](h,K[H],E):(d[M](h,P[H],E),d[M](h,H,E))}function S(h){if(h.touches!==void 0)return h.touches.length;if(h.which!==void 0&&h.which!==0)return h.which;if(h.buttons!==void 0)return h.buttons;var M=h.button;if(M!==void 0)return M&1?1:M&2?3:M&4?2:0}function v(h,M,H){h=h||{};var E=h.className||"",P;return h.className+=" gu-hide",P=c.elementFromPoint(M,H),h.className=E,P}function C(){return!1}function j(){return!0}function B(h){return h.width||h.right-h.left}function N(h){return h.height||h.bottom-h.top}function b(h){return h.parentNode===c?null:h.parentNode}function T(h){return h.tagName==="INPUT"||h.tagName==="TEXTAREA"||h.tagName==="SELECT"||F(h)}function F(h){return!h||h.contentEditable==="false"?!1:h.contentEditable==="true"?!0:F(b(h))}function p(h){return h.nextElementSibling||M();function M(){var H=h;do H=H.nextSibling;while(H&&H.nodeType!==1);return H}}function w(h){return h.targetTouches&&h.targetTouches.length?h.targetTouches[0]:h.changedTouches&&h.changedTouches.length?h.changedTouches[0]:h}function V(h,M){var H=w(M),E={pageX:"clientX",pageY:"clientY"};return h in E&&!(h in H)&&E[h]in H&&(h=E[h]),H[h]}o.exports=f}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(a,d){return Array.prototype.slice.call(a,d)}},{}],4:[function(t,o,r){var s=t("ticky");o.exports=function(d,l,c){d&&s(function(){d.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,o,r){var s=t("atoa"),a=t("./debounce");o.exports=function(l,c){var u=c||{},f={};return l===void 0&&(l={}),l.on=function(m,g){return f[m]?f[m].push(g):f[m]=[g],l},l.once=function(m,g){return g._once=!0,l.on(m,g),l},l.off=function(m,g){var y=arguments.length;if(y===1)delete f[m];else if(y===0)f={};else{var S=f[m];if(!S)return l;S.splice(S.indexOf(g),1)}return l},l.emit=function(){var m=s(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var g=(f[m]||[]).slice(0);return function(){var y=s(arguments),S=this||l;if(m==="error"&&u.throws!==!1&&!g.length)throw y.length===1?y[0]:y;return g.forEach(function(C){u.async?a(C,y,S):C.apply(S,y),C._once&&l.off(m,C)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(s){var a=t("custom-event"),d=t("./eventmap"),l=s.document,c=m,u=y,f=[];s.addEventListener||(c=g,u=S),o.exports={add:c,remove:u,fabricate:v};function m(b,T,F,p){return b.addEventListener(T,F,p)}function g(b,T,F){return b.attachEvent("on"+T,j(b,T,F))}function y(b,T,F,p){return b.removeEventListener(T,F,p)}function S(b,T,F){var p=B(b,T,F);if(p)return b.detachEvent("on"+T,p)}function v(b,T,F){var p=d.indexOf(T)===-1?V():w();b.dispatchEvent?b.dispatchEvent(p):b.fireEvent("on"+T,p);function w(){var h;return l.createEvent?(h=l.createEvent("Event"),h.initEvent(T,!0,!0)):l.createEventObject&&(h=l.createEventObject()),h}function V(){return new a(T,{detail:F})}}function C(b,T,F){return function(w){var V=w||s.event;V.target=V.target||V.srcElement,V.preventDefault=V.preventDefault||function(){V.returnValue=!1},V.stopPropagation=V.stopPropagation||function(){V.cancelBubble=!0},V.which=V.which||V.keyCode,F.call(b,V)}}function j(b,T,F){var p=B(b,T,F)||C(b,T,F);return f.push({wrapper:p,element:b,type:T,fn:F}),p}function B(b,T,F){var p=N(b,T,F);if(p){var w=f[p].wrapper;return f.splice(p,1),w}}function N(b,T,F){var p,w;for(p=0;p<f.length;p++)if(w=f[p],w.element===b&&w.type===T&&w.fn===F)return p}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(s){var a=[],d="",l=/^on/;for(d in s)l.test(d)&&a.push(d.slice(2));o.exports=a}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(s){var a=s.CustomEvent;function d(){try{var l=new a("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=d()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(c,u){var f=document.createEvent("CustomEvent");return u?f.initCustomEvent(c,u.bubbles,u.cancelable,u.detail):f.initCustomEvent(c,!1,!1,void 0),f}:function(c,u){var f=document.createEventObject();return f.type=c,u?(f.bubbles=!!u.bubbles,f.cancelable=!!u.cancelable,f.detail=u.detail):(f.bubbles=!1,f.cancelable=!1,f.detail=void 0),f}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var s=o.exports={},a,d;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=l}catch{a=l}try{typeof clearTimeout=="function"?d=clearTimeout:d=c}catch{d=c}})();function u(N){if(a===setTimeout)return setTimeout(N,0);if((a===l||!a)&&setTimeout)return a=setTimeout,setTimeout(N,0);try{return a(N,0)}catch{try{return a.call(null,N,0)}catch{return a.call(this,N,0)}}}function f(N){if(d===clearTimeout)return clearTimeout(N);if((d===c||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(N);try{return d(N)}catch{try{return d.call(null,N)}catch{return d.call(this,N)}}}var m=[],g=!1,y,S=-1;function v(){!g||!y||(g=!1,y.length?m=y.concat(m):S=-1,m.length&&C())}function C(){if(!g){var N=u(v);g=!0;for(var b=m.length;b;){for(y=m,m=[];++S<b;)y&&y[S].run();S=-1,b=m.length}y=null,g=!1,f(N)}}s.nextTick=function(N){var b=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)b[T-1]=arguments[T];m.push(new j(N,b)),m.length===1&&!g&&u(C)};function j(N,b){this.fun=N,this.array=b}j.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(N){return[]},s.binding=function(N){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(N){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(t,o,r){(function(s){var a=typeof s=="function",d;a?d=function(l){s(l)}:d=function(l){setTimeout(l,0)},o.exports=d}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(s,a){var d=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,u={},f=0;r.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(g){g.close()};function m(g,y){this._id=g,this._clearFn=y}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(g,y){clearTimeout(g._idleTimeoutId),g._idleTimeout=y},r.unenroll=function(g){clearTimeout(g._idleTimeoutId),g._idleTimeout=-1},r._unrefActive=r.active=function(g){clearTimeout(g._idleTimeoutId);var y=g._idleTimeout;y>=0&&(g._idleTimeoutId=setTimeout(function(){g._onTimeout&&g._onTimeout()},y))},r.setImmediate=typeof s=="function"?s:function(g){var y=f++,S=arguments.length<2?!1:c.call(arguments,1);return u[y]=!0,d(function(){u[y]&&(S?g.apply(null,S):g.call(null),r.clearImmediate(y))}),y},r.clearImmediate=typeof a=="function"?a:function(g){delete u[g]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ui);const He=class He{static getEditorTypesByMDataType(e,t=""){let o=He.fieldControlTypeMapping[e];if(t==="data-grid-column"&&(o!=null&&o.length)){const r=[U["check-group"].type,U["radio-group"].type];o=o.filter(s=>!r.includes(s.key))}return o}static getAllInputTypes(){const e=[];for(const t in He.fieldControlTypeMapping)He.fieldControlTypeMapping[t].forEach(o=>{e.find(r=>r.key===o.key&&r.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var s;const o=(s=e.editor)==null?void 0:s.type,r=[];return(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&t&&t.categoryId&&t.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===U["input-group"].type||o===U.textarea.type||o===U["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===U["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===U["combo-list"].type||o===U["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===U["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===U["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===U.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};oe(He,"fieldControlTypeMapping",{String:[{key:U["input-group"].type,value:U["input-group"].name},{key:U.lookup.type,value:U.lookup.name},{key:U["date-picker"].type,value:U["date-picker"].name},{key:U["check-group"].type,value:U["check-group"].name},{key:U["radio-group"].type,value:U["radio-group"].name},{key:U["combo-list"].type,value:U["combo-list"].name},{key:U.textarea.type,value:U.textarea.name},{key:U["time-picker"].type,value:U["time-picker"].name}],Text:[{key:U.textarea.type,value:U.textarea.name},{key:U.lookup.type,value:U.lookup.name}],Decimal:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Integer:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Number:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],BigNumber:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Date:[{key:U["date-picker"].type,value:U["date-picker"].name}],DateTime:[{key:U["date-picker"].type,value:U["date-picker"].name}],Boolean:[{key:U.switch.type,value:U.switch.name},{key:U["check-box"].type,value:U["check-box"].name}],Enum:[{key:U["combo-list"].type,value:U["combo-list"].name},{key:U["radio-group"].type,value:U["radio-group"].name}],Object:[{key:U.lookup.type,value:U.lookup.name},{key:U["combo-list"].type,value:U["combo-list"].name},{key:U["radio-group"].type,value:U["radio-group"].name}]});let tn=He;var Ft=(i=>(i.Form="Form",i.Variable="Variable",i))(Ft||{});class zi{constructor(e,t){oe(this,"controlsInfo",{});oe(this,"formSchemaUtils");oe(this,"designViewModelUtils");oe(this,"viewModelId","");this.designerHostService=e,this.componentId=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils,this.viewModelId=this.formSchemaUtils.getViewModelIdByComponentId(this.componentId)}buildFieldTreeData(){const e=this.designViewModelUtils.getDgViewModel(this.viewModelId);if(!e)return[];const t=this.formSchemaUtils.getComponentById(this.componentId);if(!t)return[];const{componentType:o}=t,r=e.fields;if(o==="data-grid"||o==="form"){const s=this.getAllControlsInComponents(t);return this.controlsInfo.controls=s,this.buildFieldTreeDataByControls(r,s,o)}return[]}getAllControlsInComponents(e){const t=[],o=this.getFormLayoutInCmp(e.contents);if(this.controlsInfo.formLayout=o,o){const r=o.columns||o.contents;this.getAllControlsInLayout(r,t)}return t}buildFieldTreeDataByControls(e,t,o){const r=[],s=new Map,a=[];return t.forEach(d=>{if(d.type===U.fieldset.type){a.push(d);return}const l=this.buildFieldTreeNodeFromControl(d,e,this.componentId,o);if(l)if(l.isInGroupNode){if(!s.has(l.groupId)){const u=this.buildFieldTreeGroupNodeWithBindingEntityField(d,e,a);u&&(s.set(l.groupId,u),r.push(u))}const c=s.get(l.groupId);c!=null&&c.children&&c.children.push(l)}else r.push(l)}),r}buildFieldTreeNodeFromControl(e,t,o,r){let s;return e.binding?e.binding.type===Ft.Variable?s=this.buildFieldTreeNodeWithBindingVariable(e):s=this.buildFieldTreeNodeWithBindingEntityField(e,t,o,r):s=this.buildFieldTreeNodeWithoutControlBinding(e),s}buildFieldTreeNodeWithoutControlBinding(e){return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:e.id,name:e.title||e.text||e.label},groupId:"",expanded:!1,isBindVariable:!1,isComplexField:!1,isGroupNode:!1,isInGroupNode:!1,isNoBinding:!0,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingVariable(e){const t=e.binding.field,o=this.formSchemaUtils.getVariableById(t),r=this.formSchemaUtils.getViewModelById(this.viewModelId),s=r==null?void 0:r.fields.find(d=>d.id===t),a=s&&s.groupId;return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:t,name:e.title||e.text||e.label,code:e.binding.fullPath||e.binding.path,controlType:e.type,type:o&&o.type,category:o&&o.category},groupId:a,expanded:!1,isBindVariable:!0,isComplexField:!1,isInGroupNode:!!a,isGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingEntityField(e,t,o,r){const s=e.binding.field,a=t.find(m=>m.id===s);if(!a)return;const{groupId:d}=a,l=a.isSchemaRemoved?{id:s,name:e.title||e.text||e.label}:a,c=a.isSchemaRemoved,u=!a.isSchemaRemoved,f=a.$type==="ComplexField";return{canChangeControlType:u,children:[],componentId:o,componentType:r,control:e,data:l,expanded:!1,groupId:d,isBindVariable:!1,isComplexField:f,isGroupNode:!1,isInGroupNode:!!d,isNoBinding:!1,isRemoved:!!c,nodeType:"field"}}buildFieldTreeGroupNodeWithBindingEntityField(e,t,o){const r=e.binding.field;if(e.binding.type===Ft.Form){const s=t.find(c=>c.id===r);if(!s)return;const{groupId:a,groupName:d}=s,l=o.find(c=>c.id===a);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:l,data:{id:a,name:d},groupId:a,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}else{const s=this.formSchemaUtils.getViewModelById(this.viewModelId),a=s==null?void 0:s.fields.find(u=>u.id===r);if(!a)return;const{groupId:d,groupName:l}=a,c=o.find(u=>u.id===d);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:c,data:{id:d,name:l},groupId:d,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}}getFormLayoutInCmp(e){if(!e)return{};for(const t of e){if([U["data-grid"].type,U["tree-grid"].type,U["response-form"].type].includes(t.type))return t;if(t.contents){const r=this.getFormLayoutInCmp(t.contents);if(r)return r}}return null}getAllControlsInLayout(e,t){if(e)for(const o of e)o.type===U.fieldset.type&&t.push(o),o.contents?this.getAllControlsInLayout(o.contents,t):t.push(o)}}const Gi=n.defineComponent({name:"FSplitterFormComponent",props:Ai,emits:["cancel","submit"],setup(i,e){const t=n.ref(""),o=n.ref(),r=n.ref(i.data),s=n.ref([{field:"name",title:"名称"},{field:"bindingPath",title:"绑定字段"}]),{schemaService:a,formSchemaUtils:d}=i.designerHostService,l=new To.FNotifyService;l.globalConfig={position:"top-center"};const c={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u={cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}};n.onBeforeMount(()=>{const y=d.getViewModelIdByComponentId(i.componentId),{name:S}=a.getTableInfoByViewModelId(y);t.value=S;const v=new zi(i.designerHostService,i.componentId);r.value=v.buildFieldTreeData()});function f(){e.emit("cancel")}function m(){if(!t.value){l.warning({message:"请填写组件标题"});return}const y=o.value.getSelectedItems();if(!y.length){l.warning("请选择字段");return}e.emit("submit",{selections:y,componentTitle:t.value})}function g(y,S){const v=S.raw;return n.createVNode(n.Fragment,null,[v.isRemoved?n.createVNode("span",{title:"绑定字段不存在,请在视图模型中手动移除。"},[n.createTextVNode("绑定字段不存在。 ")]):"",v.isBindVariable?n.createVNode("span",null,[n.createTextVNode("变量:"),v.code,n.createTextVNode(" ")]):"",v.isNoBinding?n.createVNode("span",null,[n.createTextVNode("控件没有绑定信息 ")]):"",!v.isRemoved&&!v.isBindVariable&&!v.isComplexField?n.createVNode("span",null,[v.bindingField,n.createTextVNode(" ")]):""])}return()=>n.createVNode("div",{class:"h-100 d-flex flex-column flex-fill"},[n.createVNode("div",{class:"f-section pt-3 pl-4"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode(" 组件信息 ")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode("div",{class:"col-12 farris-group-wrap"},[n.createVNode("div",{class:"form-group farris-form-group"},[n.createVNode("label",{class:"col-form-label",style:"justify-content: start !important; width: 80px !important;"},[n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),n.createVNode("span",{class:"farris-label-text"},[n.createTextVNode(" 组件标题")])]),n.createVNode("div",{class:"farris-input-wrap"},[n.withDirectives(n.createVNode("input",{class:"form-control",type:"input","onUpdate:modelValue":y=>t.value=y},null),[[n.vModelText,t.value]])])])])])])]),n.createVNode("div",{class:"f-section pl-4 f-utils-fill"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode(" 组件字段 ")])])]),n.createVNode("div",{class:"f-section-content border f-utils-fill"},[n.createVNode(So,{key:1,ref:o,fit:!0,data:r.value,idField:"id",columns:s.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},selection:c,hierarchy:u},{cellTemplate:({cell:y,row:S})=>y.field==="bindingPath"?g(y,S):y.data!=null?y.data.toString():y.data})])]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:f},[n.createTextVNode("取消")]),n.createVNode("button",{type:"button",class:"btn btn-primary",onClick:m},[n.createTextVNode("确定")])])])}});function nn(){function i(){const t=o=>{const r=Math.random()*16|0;return(o==="x"?r:r&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t)}function e(t,o){const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];let a;if(o=o||r.length,t)for(a=0;a<t;a++)s[a]=r[0|Math.random()*o];else{let d;for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",a=0;a<36;a++)s[a]||(d=0|Math.random()*16,s[a]=r[a===19?d&3|8:d])}return s.join("")}return{guid:i,uuid:e}}const Hi=["moz","ms","webkit"];function _i(){let i=0;return e=>{const t=new Date().getTime(),o=Math.max(0,16-(t-i)),r=setTimeout(()=>{e(t+o)},o);return i=t+o,r}}function Wi(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const i=Hi.filter(e=>`${e}RequestAnimationFrame`in window)[0];return i?window[`${i}RequestAnimationFrame`]:_i()}Wi();function Yi(i,e){let t;const o=n.ref(""),r=n.ref([]),s=n.ref([]),a=n.ref([]),d=i.componentInstance.value.belongedComponentId;function l(p){p.forEach(w=>{w.isGroupNode||(w.isNoBinding||s.value.push(w.data.id),r.value.push(w.control))})}function c(p){var E;const w=i.componentInstance.value.schema;let V={};w.contents&&w.contents.length>0&&(V=w.contents.find(P=>P.type===Ge.DgControl.section.type)||{});const h=Object.assign({},V,{id:p+"-section",mainTitle:o.value,appearance:V.appearance?le.cloneDeep(V.appearance):{class:"f-section-form f-section-in-mainsubcard"},contents:[]}),M=((E=V.contents)==null?void 0:E.find(P=>P.type===Ge.DgControl["response-form"].type))||{},H=Ze(Ge.DgControl["response-form"].type);return Object.assign(H,M,{id:p+"-form",appearance:M.appearance?le.cloneDeep(M.appearance):{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r.value}),h.contents=[H],[h]}function u(p){var V;if(!((V=p.states)!=null&&V.length))return[];const w=[];return p.states.forEach(h=>{r.value.forEach(M=>{function H(E){Object.keys(E).forEach(P=>{const W=E[P];if(W&&W.type==="Variable"&&W.field===h.id){let K=w.find(O=>O.id===h.id);K||(K=Object.assign({},h,{newId:nn().guid()}),w.push(K),a.value.push(h.id)),E[P].field=K.newId}})}H(M),M.editor&&H(M.editor)})}),w.map(h=>{h.id=h.newId,delete h.newId}),w}function f(p,w){const V=[];s.value.forEach(M=>{const H=w.fields.find(E=>E.id===M);V.push(Object.assign({},H,{groupId:null,groupName:null}))});const h=u(w);return{id:p+"-viewmodel",code:p+"-viewmodel",name:o.value,bindTo:w.bindTo,parent:w.parent,fields:V,commands:[],states:h,enableValidation:w.enableValidation}}function m(p,w,V){var E;if(!((E=i==null?void 0:i.parent)!=null&&E.parent)||!e)return;const M=i.parent.parent.componentInstance.value.schema;if(!(M!=null&&M.contents))return;const H=M.contents.findIndex(P=>P.component===d);if(H>-1){const{formSchemaUtils:P}=e;P.getComponents().push(p),P.getViewModels().push(V),M.contents.splice(H+1,0,w)}}function g(){if(!e)return;const p=i.componentInstance.value.schema,{schemaService:w,formSchemaUtils:V}=e,h=V.getViewModelIdByComponentId(d),M=V.getViewModelById(h),{code:H}=w.getTableInfoByViewModelId(h),E=H+"-"+Math.random().toString(36).slice(2,6),P=Ze("component-ref");Object.assign(P,{id:E+"-component-ref",component:E+"-component"});const W=f(E,M),K=Ze("component"),O=c(E);return Object.assign(K,{id:E+"-component",viewModel:E+"-viewmodel",componentType:p.componentType,appearance:p.appearance?le.cloneDeep(p.appearance):null,formColumns:p.formColumns,contents:O}),m(K,P,W),W}function y(){if(!e)return;const{formSchemaUtils:p}=e,w=i.componentInstance.value.schema,V=r.value.map(M=>M.id),h=p.selectNode(w,M=>M.type===Ge.DgControl["response-form"].type);h.contents.forEach(M=>{M.type===Ge.DgControl.fieldset.type&&(M.contents=M.contents.filter(H=>!V.includes(H.id)))}),h.contents=h.contents.filter(M=>!(V.includes(M.id)||M.type===Ge.DgControl.fieldset.type&&M.contents&&M.contents.length===0))}function S(){if(!e)return;const{formSchemaUtils:p}=e,w=p.getViewModelIdByComponentId(d),V=p.getViewModelById(w);V&&V.fields&&(V.fields=V.fields.filter(h=>!s.value.includes(h.id)))}function v(p){if(!e)return;const{formSchemaUtils:w}=e,V=nn().guid(),h=Object.assign({},p,{id:V,code:p.code+V.slice(0,4),name:p.name+V.slice(0,4)}),H=w.getCommands().find(E=>E.id===p.cmpId);return H&&H.refedHandlers.push({host:V,handler:p.handlerName}),h}function C(p){if(!e)return;const{formSchemaUtils:w}=e,V=w.getViewModelIdByComponentId(d),h=w.getViewModelById(V),M={};r.value.forEach(E=>{var K;const P=E.type==="form-group"&&E.editor?E.editor.type:E.type,W=(K=ht[P])==null?void 0:K.events;W&&Object.keys(E).forEach(O=>{const q=Object.keys(W).find(J=>J===O);if(q&&E[q]){const J=h.commands.find(G=>G.code===E[q]);if(J){let G=M[J.code];G||(G=v(J),M[J.code]=G,p.commands.push(G)),E[q]=G.code}}})});const H=["valueChanging","valueChanged"];p.fields.forEach(E=>{H.forEach(P=>{if(E[P]){const W=h.commands.find(K=>K.code===E[P]);if(M[W.code])E[P]=M[W.code].code;else{const K=v(W);M[W.code]=K,p.commands.push(K),E[P]=K.code}}})})}function j(p,w,V){if(p&&(w(p,V),p.contents))for(const h of p.contents)j(h,w,V)}function B(){if(!a.value.length)return;const p=e==null?void 0:e.formSchemaUtils,w=p.getComponentById(d),V=[],h=(E,P)=>{E&&(Object.keys(E).forEach(W=>{const K=E[W];K&&typeof K=="object"&&K.type===an.FormBindingType.Variable&&a.value.includes(K.field)&&!P.includes(K.field)&&P.push(K.field)}),E.editor&&h(E.editor,P))};j(w,h,V);const M=p.getViewModelIdByComponentId(d),H=p.getViewModelById(M);a.value.forEach(E=>{V.includes(E)||(H.states=H.states.filter(P=>P.id!==E))})}function N(p){var h,M;const{selections:w}=p;o.value=p.componentTitle,l(w);const V=g();y(),S(),C(V),B(),(h=t==null?void 0:t.modalRef)!=null&&h.value.close&&((M=t==null?void 0:t.modalRef)==null||M.value.close()),Ut.value++,n.nextTick(()=>{At()})}function b(){var p,w;(p=t==null?void 0:t.modalRef)!=null&&p.value.close&&((w=t==null?void 0:t.modalRef)==null||w.value.close())}function T(){if(e)return()=>n.createVNode(n.Fragment,null,[n.createVNode(Gi,{componentId:i.componentInstance.value.belongedComponentId,designerHostService:e,onSubmit:N,onCancel:b},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function F(p){p.stopPropagation(),p.preventDefault(),e&&(t=e.modalService.open({title:"拆分卡片",width:900,height:600,fitContent:!1,showButtons:!1,render:T(),enableEsc:!1,draggable:!0}))}return{openSplitComponentModal:F}}function Xi(i,e){const t=new Ro,{canMove:o,canDelete:r}=t.getTemplateRule(i,e);function s(){return!1}function a(){return r}function d(){return o}function l(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function u(v){const C=new Uo(v,e),{schema:j}=i;return C.getPropertyConfig(j)}function f(){var N,b,T,F;const v=i==null?void 0:i.schema,j=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(v.id);if(v.componentType!=="data-grid"&&v.componentType!=="form"||!((N=i.componentInstance)!=null&&N.value.parent))return;const B=(b=i.componentInstance)==null?void 0:b.value.parent.schema;if((T=B==null?void 0:B.toolbar)!=null&&T.buttons&&B.toolbar.buttons.length){B.toolbar.buttons.forEach(w=>{const V=w.onClick,h=V&&V.split(".");if(!h||h.length<3)return;h[h.length-2]===j&&(w.needRemove=!0)}),B.toolbar.buttons=B.toolbar.buttons.filter(w=>!w.needRemove);const p=(F=i.componentInstance)==null?void 0:F.value.parent;p.parent&&p.parent.updateToolbarItems&&p.parent.updateToolbarItems()}}function m(){const v=e==null?void 0:e.designViewModelUtils,C=e==null?void 0:e.formSchemaUtils,j=i==null?void 0:i.schema;if(v&&C){const B=C.getViewModelIdByComponentId(j.id);v.deleteViewModelById(B),C.deleteComponent(j.id)}}function g(){const v=e==null?void 0:e.designViewModelUtils,C=e==null?void 0:e.formSchemaUtils,j=i==null?void 0:i.schema,B=C.getViewModelIdByComponentId(j.id),N=v.getDgViewModel(B);N!=null&&N.fields&&N.fields.forEach(b=>{const T=C.getExpressions();if(T!=null&&T.length){const F=T.findIndex(p=>p.target===b.id);F>-1&&C.getExpressions().splice(F,1)}})}function y(){f(),g(),m()}function S(){const{schema:v}=i,C=[];return v.componentType==="form"&&C.push({id:"splitFormComponent",title:"拆分卡片",icon:"f-icon fd-i-Family fd_pc-split-card",onClick:j=>{Yi(i,e).openSplitComponentModal(j)}},{id:"addSiblingComponent",title:"添加同级卡片",icon:"f-icon f-icon-plus",onClick:j=>{Li(i,e).addSiblingComponent(j)}}),C}return{canAccepts:s,checkCanDeleteComponent:a,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:l,getStyles:c,getPropsConfig:u,onRemoveComponent:y,getCustomButtons:S}}function Ji(i,e){const t=n.ref(i.width),o=n.ref(i.height);let r;n.watch(e,a=>{a&&(t.value=a.clientWidth,r=new ResizeObserver(d=>{if(!d||d.length<1)return;const c=d[0].contentRect;c&&(t.value=c.width)}),r.observe(a))});function s(){r&&r.disconnect()}return{destory:s,width:t,height:o}}const Qi=n.defineComponent({name:"FVideoDesign",props:rt,setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=Xi(o,r),a=Do(t,o,s),{width:d,height:l,destory:c}=Ji(i,t);return n.onMounted(()=>{t.value.componentInstance=a}),n.onUnmounted(()=>{c()}),e.expose(a.value),()=>n.createVNode("div",{ref:t,class:"drag-container","data-dragref":`${o.schema.id}-container`},[n.createVNode("video",{src:i.src,autoplay:i.autoplay,controls:i.controls,loop:i.loop,muted:i.muted,width:d.value,height:l.value},[n.createTextVNode("Your browser does not support the video tag.")])])}}),Zi={install(i){i.component(at.name,at)},register(i,e,t,o){i.video=at,e.video=bt},registerDesigner(i,e,t){i.video=Qi,e.video=bt}};I.FVideo=at,I.default=Zi,I.propsResolver=bt,I.videoProps=rt,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(I,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("@vueuse/core"),require("../dynamic-resolver/index.umd.js"),require("../data-view/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../tree-grid/index.umd.js"),require("../notify/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","@vueuse/core","../dynamic-resolver/index.umd.js","../data-view/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../../designer/tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../schema-selector/index.umd.js","../../designer/tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../tree-grid/index.umd.js","../notify/index.umd.js","bignumber.js"],n):(I=typeof globalThis<"u"?globalThis:I||self,n(I.video={},I.Vue,I.LodashES,I.common,I.VueUseCore,I.dynamicResolver,I.dataView,I.designerCanvas,I.propertyPanel,I.FAccordion,I.FAvatar,I.FButtonEdit,I.FButtonGroup,I.FCalendar,I.FCapsule,I.FCheckbox,I.FCheckboxGroup,I.FComboList,I.FComboTree,I.FComponent,I.FColorPicker,I.FContentContainer,I.FDatePicker,I.FDataGrid,I.FDropdown,I.FDynamicForm,I.FEventsEditor,I.FFilterBar,I.FFieldSelector,I.FBindingSelector,I.FImageCropper,I.FInputGroup,I.FLayout,I.FListNav,I.FListView,I.FLookup,I.FMappingEditor,I.FNav,I.FNumberRange,I.FNumberSpinner,I.FOrder,I.FPageHeader,I.FPageFooter,I.FPagination,I.FProgress,I.FQuerySolution,I.FRadioGroup,I.FRate,I.FResponseToolbar,I.FResponseLayout,I.FResponseLayoutEditorSetting,I.FSearchBox,I.FSection,I.FSmokeDetector,I.FSplitter,I.FStep,I.FSwitch,I.FTabs,I.FTags,I.FText,I.FTimePicker,I.FTransfer,I.FTreeview,I.FUploader,I.FVerifyDetail,I.FVideo$1,I.FTextArea,I.FSchemaSelector,I.FTreeGrid$1,I.FEventParameter,I.FFilterConditionEditor,I.FFieldset,I.FSortConditionEditor,I.FMenuLookup,I.FDrawer,I.FJsonEditor,I.FPropertyEditor,I.FExpressionEditor,I.FCodeEditor,I.FHtmlTemplate,null,I.FTreeGrid$2,I.notify))})(this,function(I,n,le,Qe,rn,Ne,ne,Ge,an,sn,ln,cn,dn,un,pn,Rt,$t,fn,mn,hn,yn,gn,vn,bn,Cn,wn,xn,Sn,Tn,Fn,Vn,Nn,Mn,En,In,kn,Bn,jn,On,Pn,Dn,Rn,$n,qn,Ln,An,Un,zn,Gn,Hn,_n,Wn,Yn,Xn,Jn,Qn,Zn,Kn,eo,to,no,oo,io,ro,ao,so,lo,co,uo,po,fo,mo,ho,yo,go,vo,bo,Co,wo,xo,tr,So,To){"use strict";var Ki=Object.defineProperty;var er=(I,n,le)=>n in I?Ki(I,n,{enumerable:!0,configurable:!0,writable:!0,value:le}):I[n]=le;var oe=(I,n,le)=>er(I,typeof n!="symbol"?n+"":n,le);const ht={},qt={};function yt(i){const{properties:e,title:t,ignore:o}=i,r=o&&Array.isArray(o),s=Object.keys(e).reduce((a,d)=>((!r||!o.find(l=>l===d))&&(a[d]=e[d].type==="object"&&e[d].properties?yt(e[d]):le.cloneDeep(e[d].default)),a),{});if(t&&(!r||!o.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");s.id=`${a}_${Math.random().toString().slice(2,6)}`}return s}function Fo(i){const{properties:e,title:t,required:o}=i;if(o&&Array.isArray(o)){const r=o.reduce((s,a)=>(s[a]=e[a].type==="object"&&e[a].properties?yt(e[a]):le.cloneDeep(e[a].default),s),{});if(t&&o.find(s=>s==="id")){const s=t.toLowerCase().replace(/-/g,"_");r.id=`${s}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function Ze(i,e={},t){const o=ht[i];if(o){let r=Fo(o);const s=qt[i];return r=s?s({getSchemaByType:Ze},r,e,t):r,r}return null}function Vo(i,e){const t=yt(e);return Object.keys(t).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(i,r)&&(o[r]&&le.isPlainObject(o[r])&&le.isPlainObject(i[r]||!i[r])?Object.assign(o[r],i[r]||{}):o[r]=i[r]),o),t),t}function Lt(i,e){return Object.keys(i).filter(o=>i[o]!=null).reduce((o,r)=>{if(e.has(r)){const s=e.get(r);if(typeof s=="string")o[s]=i[r];else{const a=s(r,i[r],i);Object.assign(o,a)}}else o[r]=i[r];return o},{})}function No(i,e,t=new Map){const o=Vo(i,e);return Lt(o,t)}function Mo(i={}){function e(c,u,f,m){if(typeof f=="number")return m[c].length===f;if(typeof f=="object"){const g=Object.keys(f)[0],y=f[g];if(g==="not")return Number(m[c].length)!==Number(y);if(g==="moreThan")return Number(m[c].length)>=Number(y);if(g==="lessThan")return Number(m[c].length)<=Number(y)}return!1}function t(c,u,f,m){return m[c]&&m[c].propertyValue&&String(m[c].propertyValue.value)===String(f)}const o=new Map([["length",e],["getProperty",t]]);Object.keys(i).reduce((c,u)=>(c.set(u,i[u]),c),o);function r(c,u){const f=c;return typeof u=="number"?[{target:f,operator:"length",param:null,value:Number(u)}]:typeof u=="boolean"?[{target:f,operator:"getProperty",param:c,value:!!u}]:typeof u=="object"?Object.keys(u).map(m=>{if(m==="length")return{target:f,operator:"length",param:null,value:u[m]};const g=m,y=u[m];return{target:f,operator:"getProperty",param:g,value:y}}):[]}function s(c){return Object.keys(c).reduce((f,m)=>{const g=r(m,c[m]);return f.push(...g),f},[])}function a(c,u){if(o.has(c.operator)){const f=o.get(c.operator);return f&&f(c.target,c.param,c.value,u)||!1}return!1}function d(c,u){return s(c).reduce((g,y)=>g&&a(y,u),!0)}function l(c,u){const f=Object.keys(c),m=f.includes("allOf"),g=f.includes("anyOf"),y=m||g,C=(y?c[y?m?"allOf":"anyOf":"allOf"]:[c]).map(B=>d(B,u));return m?!C.includes(!1):C.includes(!0)}return{parseValueSchema:l}}const U={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},Eo={},Io={};Mo();function gt(i,e,t=new Map,o=(a,d,l,c)=>d,r={},s=a=>a){return ht[e.title]=e,qt[e.title]=o,Eo[e.title]=r,Io[e.title]=s,(a={},d=!0)=>{if(!d)return Lt(a,t);const l=No(a,e,t),c=Object.keys(i).reduce((u,f)=>(u[f]=i[f].default,u),{});return Object.assign(c,l)}}function vt(i,e){return{customClass:e.class,customStyle:e.style}}const ko={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/video.schema.json",title:"video",description:"A Farris Video Component",type:"object",properties:{id:{description:"The unique identifier for a Video",type:"string"},type:{description:"The type string of Video component",type:"string",default:"video"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Bo=new Map([["appearance",vt]]);function jo(i,e,t){return e}const Oo={title:"verify-detail",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:[]}}}}}},rt={src:{type:String,required:!0,default:""},autoplay:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},preload:{type:String,default:"none"},poster:{type:String},width:{type:[String,Number],default:300},height:{type:[String,Number],default:168}},bt=gt(rt,ko,Bo,jo,Oo);function Po(i,e){function t(v){v.stopPropagation(),e.emit("abort")}function o(v){v.stopPropagation(),e.emit("play")}function r(v){v.stopPropagation(),e.emit("pause")}function s(v){v.stopPropagation(),e.emit("ended")}function a(v){v.stopPropagation(),e.emit("durationchange")}function d(v){v.stopPropagation(),e.emit("error")}function l(v){v.stopPropagation(),e.emit("loadeddata")}function c(v){v.stopPropagation(),e.emit("loadedmetadata")}function u(v){v.stopPropagation(),e.emit("loadstart")}function f(v){v.stopPropagation(),e.emit("playing")}function m(v){v.stopPropagation(),e.emit("progress")}function g(v){v.stopPropagation(),e.emit("timeupdate")}function y(v){v.stopPropagation(),e.emit("volumechange")}function S(v){v.stopPropagation(),e.emit("canplay")}return{onAbort:t,onPlay:o,onPause:r,onEnded:s,onDurationchange:a,onError:d,onLoadeddata:l,onLoadedmetadata:c,onLoadstart:u,onPlaying:f,onProgress:m,onTimeupdate:g,onVolumechange:y,onCanplay:S}}const at=n.defineComponent({name:"FVideo",props:rt,emits:["abort","play","pause","ended","durationchange","canplay","error","loadeddata","loadedmetadata","loadstart","playing","progress","timeupdate","volumechange"],setup(i,e){const t=n.ref(),{onAbort:o,onPlay:r,onPause:s,onEnded:a,onDurationchange:d,onError:l,onLoadeddata:c,onLoadedmetadata:u,onLoadstart:f,onPlaying:m,onProgress:g,onTimeupdate:y,onVolumechange:S,onCanplay:v}=Po(i,e);return n.onUnmounted(()=>{}),()=>n.createVNode("video",{ref:t,src:i.src,autoplay:i.autoplay,controls:i.controls,loop:i.loop,muted:i.muted,width:i.width,height:i.height,poster:i.poster,onAbort:C=>o(C),onPlay:C=>r(C),onPause:C=>s(C),onEnded:C=>a(C),onDurationchange:C=>d(C),onError:C=>l(C),onLoadeddata:C=>c(C),onLoadedmetadata:C=>u(C),onLoadstart:C=>f(C),onPlaying:C=>m(C),onProgress:C=>g(C),onTimeupdate:C=>y(C),onVolumechange:C=>S(C),onCanplay:C=>v(C)},[n.createTextVNode("Your browser does not support the video tag.")])}});function Do(i,e,t){var F;const o=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=n.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function d(){return!1}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function u(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const w=n.ref(p==null?void 0:p.value.parent),V=u(w);return V||null}function f(p=e){var M;if(t!=null&&t.getDraggableDesignItemElement)return t.getDraggableDesignItemElement(p);const{componentInstance:w,designerItemElementRef:V}=p;if(!w||!w.value)return null;const{getCustomButtons:h}=w.value;return w.value.canMove||h&&((M=h())!=null&&M.length)?V:f(p.parent)}function m(p){return!!t&&t.canAccepts(p)}function g(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function y(){}function S(p,w){var V;!p||!w||(t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(p,w),(V=e==null?void 0:e.setupContext)==null||V.emit("dragEnd"))}function v(p,w){const{componentType:V}=p;let h=Ze(V,p,w);t&&t.onResolveNewComponentSchema&&(h=t.onResolveNewComponentSchema(p,h));const M=V.toLowerCase().replace(/-/g,"_");return h&&!h.id&&h.type===V&&(h.id=`${M}_${Math.random().toString().slice(2,6)}`),h}function C(p){p&&t!=null&&t.onChildElementMovedOut&&t.onChildElementMovedOut(p)}function j(...p){if(t&&t.getPropsConfig)return t.getPropsConfig(...p)}function B(p){if(!p)return;const w=e==null?void 0:e.schema,{formSchemaUtils:V}=p;if(w&&V.getExpressions().length){const h=V.getExpressions().findIndex(M=>M.target===w.id);h>-1&&V.getExpressions().splice(h,1)}}function N(p){t&&t.onRemoveComponent&&t.onRemoveComponent(),B(p),e!=null&&e.schema.contents&&e.schema.contents.map(w=>{let V=w.id;w.type==="component-ref"&&(V=w.component);const h=i.value.querySelectorAll(`#${V}-design-item`);h!=null&&h.length&&Array.from(h).map(M=>{var H;(H=M==null?void 0:M.componentInstance)!=null&&H.value.onRemoveComponent&&M.componentInstance.value.onRemoveComponent(p)})})}function b(){if(t&&t.getCustomButtons)return t.getCustomButtons()}function T(p){if(t&&t.onPropertyChanged)return t.onPropertyChanged(p)}return s.value={canMove:a(),canSelectParent:d(),canDelete:l(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:i,parent:(F=e==null?void 0:e.parent)==null?void 0:F.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:m,getBelongedComponentInstance:u,getDraggableDesignItemElement:f,getDraggingDisplayText:g,getPropConfig:j,getDragScopeElement:y,onAcceptMovedChildElement:S,onChildElementMovedOut:C,addNewChildComponentSchema:v,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||n.ref(!1),onRemoveComponent:N,getCustomButtons:b,onPropertyChanged:T},s}class Ro{getTemplateRule(e,t){const o=t==null?void 0:t.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),s={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return s;const a=this.getComponentContext(e),{componentClassList:d}=a;return d.forEach(l=>{if(!l||!r[l])return;const{canMove:c,canDelete:u,canAccept:f}=r[l];s.canMove=s.canMove&&this.resolveRuleValue(c,a),s.canDelete=s.canDelete&&this.resolveRuleValue(u,a),s.canAccept=s.canAccept&&this.resolveRuleValue(f,a)}),s}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const o=e.invalidContext||[];let r=!0;for(const s of o){if(s.firstLevelChild){if(s.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(s.firstLevelChild.class)){r=!1;continue}}if(s.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==s.firstLevelChild.type){r=!1;continue}}}if(s.secondLevelChild){if(s.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(s.secondLevelChild.class)){r=!1;continue}}if(s.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==s.secondLevelChild.type){r=!1;continue}}}if(s.parent){if(s.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(s.parent.class)){r=!1;continue}}if(s.parent.type){const{parentSchema:a}=t;if(a&&a.type!==s.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var S,v,C,j;const t=e.schema,o=t.appearance&&t.appearance.class||"",r=o.split(" ")||[],s=t.contents||[],a=s.length?s[0]:null,d=a&&a.appearance?a.appearance.class:"",l=d?d.split(" "):[],c=(S=a==null?void 0:a.contents)!=null&&S.length?a==null?void 0:a.contents[0]:null,u=c&&c.appearance?c.appearance.class:"",f=u?u.split(" "):[],m=t.type==="component"?(C=(v=e.parent)==null?void 0:v.parent)==null?void 0:C.schema:(j=e.parent)==null?void 0:j.schema,g=m&&m.appearance&&m.appearance.class||"",y=g?g.split(" "):[];return{componentClass:o,componentClassList:r,childContents:s,firstLevelChildSchema:a,firstLevelChildClass:d,firstLevelChildClassList:l,secondLevelChildSchema:c,secondLevelChildClass:u,secondLevelChildClassList:f,parentSchema:m,parentClass:g,parentClassList:y}}}const $o=n.ref(0);function At(){$o.value++}const Ut=n.ref(0);function qo(i){const{formSchemaUtils:e,formStateMachineUtils:t}=i;function o(l,c=""){return{path:c+l.code,field:l.id,fullPath:l.code}}function r(l,c=""){return e.getViewModelById(l).states.map(f=>o(f,c))}function s(l){const c=e.getRootViewModelId(),u=r(l);if(l===c)return u;const f=r(c,"root-component.");return[...u,...f]}function a(l){return l.binding&&l.binding.path||l.id||""}function d(){return t&&t.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:d}}class Lo{constructor(e){oe(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'"}]);oe(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});oe(this,"getExpressionConverter",(e,t)=>({convertFrom:(o,r,s,a)=>{const d=s.getExpressionRuleValue(e,t||r);return d&&d.value||""},convertTo:(o,r,s,a,d)=>{var l;if(r==="dataPicking"&&(s!=null&&s.target)){const c=`${s.target}_dataPicking`;((l=s.rules)==null?void 0:l.some(f=>f.id===c&&f.value))?o.dictPickingExpressionId=c:delete o.dictPickingExpressionId}a.updateExpression(s)}}));this.formSchemaService=e}getExpressionRule(e,t){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===e);if(!r)return"";const s=r.rules.find(a=>a.type===t);return s||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const t=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(t);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.category})}),r}createTreeNode(e,t,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:t}}buildEntityFieldsTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var d;const s=this.createTreeNode(r,t);let a=[];(d=r.type)!=null&&d.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...t,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,t){const o=[];return e==null||e.forEach(r=>{var l,c;const s=this.createTreeNode(r,t),a=this.buildEntityFieldsTreeData((l=r.type)==null?void 0:l.fields,[...t,r.label]),d=this.buildChildEntityTreeData((c=r.type)==null?void 0:c.entities,[...t,r.label]);d!=null&&d.length&&(a==null||a.push(...d)),o.push({data:s,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const t=e[0];if(!(t!=null&&t.type))return[];const o=this.buildEntityFieldsTreeData(t.type.fields,[t.code]),r=this.buildChildEntityTreeData(t.type.entities,[t.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:t.code,fields:[{data:this.createTreeNode(t,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,t,o){const r=o==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,t),a=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(t)&&s?s.message:"",...a};return s.messageType!=null&&(d.messageType=s.messageType),d}buildRule(e,t,o,r){const{expression:s,message:a,messageType:d}=t,l={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(l.message=a),o==="dataPicking"&&(l.messageType=d),o==="validate"&&r&&(l.elementId=r),l}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,t,o,r){const s=t==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let l=this.getExpressionData().find(u=>u.targetType===t&&u.target===s);const c=u=>u.value.trim()==="";if(l){const u=l.rules.find(f=>f.id===a.id);if(u)c(a)?l.rules=l.rules.filter(f=>f.id!==a.id):(Object.assign(u,a),r==="validate"&&e.type==="form-group"&&(u.elementId=e.id));else{if(c(a))return null;l.rules=l.rules||[],l.rules.push(a)}}else{if(c(a))return null;l={target:`${s}`,rules:[a],targetType:t}}return l}getExpressionEditorOptions(e,t,o,r){return o.reduce((s,a)=>{var l,c;const d=t==="Field"?(l=e==null?void 0:e.binding)==null?void 0:l.field:e.id;return s[a]={hide:t==="Field"?!!((c=e==null?void 0:e.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(d),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,a,t),onSubmitModal:u=>{const f=this.updateExpression(e,t,u,a);if(r){const m=this.buildRule(d,u,a);r(m)}return f}}},s},{})}getExpressionInfo(e,t,o){const r=t==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:t,expressionType:o};return s&&s.message&&(a.message=s.message),a}getExpressionConfig(e,t,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(e,t,o,r)}}}getExpressionOptions(e,t,o){const r=this.getExpressionInfo(e,t,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,t),expressionInfo:r}}}class Ao{constructor(e,t){oe(this,"componentId");oe(this,"viewModelId");oe(this,"eventsEditorUtils");oe(this,"formSchemaUtils");oe(this,"formMetadataConverter");oe(this,"designViewModelUtils");oe(this,"designViewModelField");oe(this,"controlCreatorUtils");oe(this,"designerHostService");oe(this,"schemaService",null);oe(this,"metadataService",null);oe(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===t)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:U[e.type].name}]}}}}}getAppearanceConfig(e=null,t={},o){const r={title:"外观",description:"Appearance"},s={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const a in t)s[a]=Object.assign(s[a]||{},t[a]);return{...r,properties:{...s},setPropertyRelates(a,d){if(a){switch(a&&a.propertyID){case"class":case"style":{Ut.value++;break}}o&&o(a,e,d)}}}}getPropertyEditorParams(e,t=[],o="visible",r={},s={}){const{getVariables:a,getControlName:d,getStateMachines:l}=qo(this.designerHostService),c=this.getRealTargetType(e),u=t&&t.length>0?t:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,c,o);break;case"StateMachine":f.stateMachines=l();break;case"Variable":Object.assign(f,{controlName:d(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:a(this.viewModelId),onBeforeOpenVariables:g=>{g.value=a(this.viewModelId)}},s);break}}),f}getVisibleProperty(e,t=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,t==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(e,t="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,t);for(const l in o)a[l]=Object.assign(a[l]||{},o[l]);const d=this;return{...s,properties:{...a},setPropertyRelates(l,c){if(l){switch(l.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(e,l);break}r&&r(l,c)}}}}afterMutilEditorChanged(e,t){this.addNewVariableToViewModel(t,this.viewModelId),this.updateExpressionValue(t),this.clearExpression(t,e)}updateElementByParentContainer(e,t){const o=t&&t.parent&&t.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===e),s=le.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),At()}addNewVariableToViewModel(e,t){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(t).states.push(a)}updateExpressionValue(e){const t=e.propertyValue;if(!((t&&t.type)==="Expression"&&t.expressionInfo))return;const{expressionId:s,expressionInfo:a}=t,{targetId:d,targetType:l,expressionType:c,value:u,message:f}=a,m=this.formSchemaUtils.getModule();m.expressions??(m.expressions=[]);const{expressions:g}=m;let y=g.find(v=>v.target===d);y||(y={target:d,rules:[],targetType:l},g.push(y));const S=y.rules.find(v=>v.type===c);if(S)S.value=u,S.message=f;else{const v={id:s,type:c,value:u,message:f};y.rules.push(v)}delete t.expressionInfo}clearExpression(e,t){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),d=t.binding?t.binding.field:t.id,l=a.find(c=>c.target===d);!l||!l.rules||(l.rules=l.rules.filter(c=>c.type!==s))}getExpressionOptions(e,t,o){return new Lo(this.formSchemaUtils).getExpressionOptions(e,t,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}}class Uo extends Ao{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearancePropConfig(e),this.getBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearancePropConfig(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId);e.name=t?t.name:null;const o=this;return this.getAppearanceConfig(e,{name:{title:"组件名称",type:"string",description:"组件名称",defaultValue:e.name}},(s,a,d)=>{switch(s.propertyID){case"name":o.syncChangesToViewModel({name:s.propertyValue}),delete a.name;break}})}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],o=this,r=o.eventsEditorUtils.formProperties(e,o.viewModelId,t),s={};s[o.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,d){const l=a.propertyValue;delete e[o.viewModelId],l&&(l.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,l.events,l))}}}getBehaviorConfig(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId),o=t?t.enableValidation:null,r=this;this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{enableValidation:{title:"启用校验",type:"boolean",description:"运行时组件是否启用校验",defaultValue:o}},setPropertyRelates:s=>{if(s)switch(s.propertyID){case"enableValidation":{r.syncChangesToViewModel({enableValidation:s.propertyValue}),delete e.enableValidation;break}}}}}syncChangesToViewModel(e){const t=this.formSchemaUtils.getViewModelById(this.viewModelId);t&&Object.assign(t,e)}}const zo={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}},Go={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},Ct=n.defineComponent({name:"Toast",props:Go,emits:["close","click"],setup:(i,e)=>{const t=n.ref(i.animate),o="fadeOut",r=n.computed(()=>i.options),s=n.ref(!1),a=n.computed(()=>{const C={animated:s.value,toast:!0};return C[i.animate]=!1,C[o]=s.value,C[r.value.type]=!0,r.value.theme&&(C[r.value.theme]=!0),C}),d=n.computed(()=>{const B=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,N={"f-icon":!0};return N[B]=!0,N}),l=n.computed(()=>r.value.title||r.value.message),c=n.computed(()=>r.value.title&&r.value.message),u=n.computed(()=>!r.value.title&&r.value.message),f=n.computed(()=>i.showCloseButton),m=n.computed(()=>!!r.value.buttons||!!e.slots.default);function g(C){C.stopPropagation(),C.preventDefault(),s.value=!1,setTimeout(()=>{e.emit("close",r.value)},200)}function y(C,j){}function S(C){return`f-preten-link ${C.customClass?C.customClass:""}`}n.watch(t,()=>{t.value});const v=()=>{var C;return n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((C=r.value.buttons)==null?void 0:C.map(j=>n.createVNode("span",{class:S(j),onClick:B=>void 0},[j.text]))),e.slots.default&&e.slots.default()])])};return()=>n.createVNode("div",{class:a.value,style:"min-height:44px"},[f.value&&n.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:g},[n.createVNode("span",{class:"f-icon modal_close"},null)]),l.value&&n.createVNode("section",{class:"modal-tips"},[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:d.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[c.value&&n.createVNode(n.Fragment,null,[n.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),n.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),m.value&&v()]),u.value&&(r.value.buttons?n.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),n.createVNode("div",{class:"after-toast-title text-right ml-auto"},[v()])]):n.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),st=n.defineComponent({name:"Notify",props:zo,emits:["close","empty"],setup(i,e){const t=n.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=n.ref(),s=n.ref(i.options),a=n.ref(i.showCloseButton),d=n.computed(()=>i.position||"bottom-right"),l=n.computed(()=>i.timeout!=null?i.timeout:3e3),c=n.computed(()=>{const m=i.bottom?i.bottom:o.bottom,g=i.top?i.top:o.top,y={transition:"all 0.2s ease",left:d.value.indexOf("left")>-1?`${i.left?i.left:o.left}px`:"",right:d.value.indexOf("right")>-1?`${i.right?i.right:o.right}px`:"",top:d.value.indexOf("top")>-1?`${g}px`:"",bottom:d.value.indexOf("bottom")>-1?`${m}px`:""};return d.value.indexOf("center")>-1&&(y.left="50%",y.marginLeft="calc(-24rem / 2)",d.value==="center-center"&&(y.top="50%",y.transform="translate(-50%, -50%)")),y});function u(m){e.emit("close")}l.value&&setTimeout(()=>{u()},l.value),e.expose({closeToast:u,container:r,notifyPosition:d});function f(m,g){u()}return()=>n.createVNode("div",{class:t.value,style:c.value,ref:r},[n.createVNode(Ct,{options:s.value,showCloseButton:a.value,animate:i.animate,onClose:m=>f(m,s.value)},null)])}});class lt{constructor(){oe(this,"notifyRefs",[]);oe(this,"globalConfig",n.reactive({}))}escapeAllHtml(e){if(typeof e!="string"||!e)return"";const t=document.createElement("div");return t.textContent=e||"",t.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(e){const t=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...e}),s=document.createElement("div");s.style.display="contents";const a=n.createApp({setup(){var c;const d=n.ref();function l(){d.value.container.style.transform="scale(0)",setTimeout(()=>{t.updateNotifyPositionForClose(r,d),a.unmount()},220)}if(r.position.indexOf("top")>-1){const u=t.getNotifyInstances(r.position),f=u[u.length-1];if(f){const m=f.value.container.getBoundingClientRect();r.top=m.bottom}}return r.safeHtml&&((c=r.options)!=null&&c.message)&&(r.options.message=t.escapeAllHtml(r.options.message)),n.onUnmounted(()=>{document.body.removeChild(s)}),n.onMounted(()=>{t.updateNotifyPositionForCreate(r,d)}),()=>n.createVNode(n.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[n.createVNode(st,n.mergeProps({ref:d},r,{onClose:l}),null)]})}});return a.provide("NotifyService",this),document.body.appendChild(s),a.mount(s),a}getNotifyInstances(e){return this.notifyRefs.filter(t=>t.value.notifyPosition===e)}updateNotifyPositionForCreate(e,t){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(r=>{const s=r.value.container.getBoundingClientRect();r.value.container.style.bottom=s.height+o-s.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,t]}updateNotifyPositionForClose(e,t){const o=this.notifyRefs.indexOf(t);if(e.position.indexOf("top")>-1){const r=this.getNotifyInstances(e.position),s=r.indexOf(t);r.slice(s+1).forEach(a=>{a.value.container.style.top=a.value.container.offsetTop-a.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,t){let o="",r="",s,a,d;typeof t=="string"?o=t:t&&(o=t.message||"",r=t.title||"",a=t.position||null,d=t.showCloseButton!=null?t.showCloseButton:null,s=t.timeout!=null?t.timeout:null);const c={options:{type:e,message:o,title:r}};return a!=null&&(c.position=a),d!=null&&(c.showCloseButton=d),s!=null&&(c.timeout=s),c}info(e){const t=this.buildNotifyProps("info",e);return this.show(t)}success(e){const t=this.buildNotifyProps("success",e);return this.show(t)}warning(e){const t=this.buildNotifyProps("warning",e);return this.show(t)}error(e){const t=this.buildNotifyProps("error",e);return this.show(t)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const Ho=Symbol("NOTIFY_SERVICE_TOKEN");st.install=i=>{i.component(st.name,st),i.component(Ct.name,Ct);const e=new lt;i.provide(Ho,e),i.provide("FNotifyService",e)};const _o={designerHostService:{type:Object,default:{}},componentType:{type:String,default:""},bindingEntityId:{type:String,default:""},steps:{type:Array,default:["selectEntity","selectFields"]}},zt=new Map([["appearance",Ne.resolveAppearance],["column","columnOption"]]);function Wo(i,e,t){var f;const o=t.parentComponentInstance,r=o.schema.type,s=String(((f=o.schema.appearance)==null?void 0:f.class)||"").split(" "),a=r==="section"||r==="tab-page",d=s.includes("f-page-content-nav"),l=s.includes("f-page-main"),c=i.getSchemaByType("component");c.id=`${e.id}-component`,c.componentType="data-grid";let u="";return u+=a?"f-struct-data-grid-in-card f-struct-is-subgrid":"",u+=d?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",u+=l?"f-struct-data-grid f-struct-wrapper":"",c.appearance={class:u},c.contents=[e],c}function Yo(i,e,t){const o=t.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),s=r.includes("f-page-content-nav"),a=r.includes("f-page-main"),d=i.getSchemaByType("section");d.id=`${e.id}-section`;let l="";return l+=s?"f-section-in-nav ":"",l+=a?"f-section-in-managelist ":"",l+="f-section-grid",d.appearance={class:l},d.contents=[e],d}function Xo(i,e,t){const o=i.getSchemaByType("content-container");return o.id=`${e.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[e],o}function Gt(i,e,t){const r=t.parentComponentInstance.schema.type,s=r==="section"||r==="tab-page";e.appearance={class:"f-component-grid"};const d=(s?Xo:Yo)(i,e,t);return Wo(i,d,t)}const Ht={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},wt={autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1}};Ne.createPropsResolver(wt,Ht,zt,Gt),Ne.createTreeGridSelectionItemResolver(),Ne.createTreeGridBindingResolver();const Jo=Object.assign({},wt,{componentId:{type:String,default:""}});Ne.createPropsResolver(Jo,Ht,zt,Gt),Ne.createDataViewUpdateColumnsResolver();function Qo(i,e,t,o,r,s,a,d,l,c,u,f,m,g,y,S,v){const{calculateCellPositionInRow:C}=s,{columnContext:j,hasLeftFixedColumn:B,hasRightFixedColumn:N}=a,{gridDataStyle:b,leftFixedGridDataStyle:T,rightFixedGridDataStyle:F}=g,{renderDataRow:p}=ne.getHierarchyRow(i,e,j,v,d,l,c,u,f,m,g,y,S),w=[p];function V(P,W){const K=C(P);return v.value.filter(O=>O.visible!==!1).map((O,q)=>w[O.type](O,K,W,q))}function h(){return n.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:T.value},[V(j.value.leftColumns.filter(P=>P.visible),"left")])])}function M(){return n.createVNode("div",{ref:t,class:"fv-grid-content-primary"},[n.createVNode("div",{class:"fv-grid-data",style:b.value},[V(j.value.primaryColumns.filter(P=>P.visible),"primary")])])}function H(){return n.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[n.createVNode("div",{class:"fv-grid-data",style:F.value},[V(j.value.rightColumns.filter(P=>P.visible),"right")])])}function E(){const P=[];return B.value&&P.push(h()),P.push(M()),N.value&&P.push(H()),P}return{renderDataArea:E}}const xt=n.defineComponent({name:"FTreeGrid",props:wt,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(i,e){var be,me;const o=((be=i.rowOption)==null?void 0:be.height)||28,r=n.ref(20),s=n.ref(i.columns),a=ne.useIdentify(i),{idField:d}=a,l=n.ref(),c=n.ref(),u=n.ref(),f=n.ref(),m=n.ref(),g=n.ref([]),y=n.ref(!1),S=n.ref(((me=i.rowOption)==null?void 0:me.wrapContent)||!1),v=ne.useGroupData(i,a),C=ne.useFilter(),j=ne.useHierarchy(i),{collapseField:B}=j,{showLoading:N,renderLoading:b}=ne.useLoading(i,l),T=ne.useDataView(i,new Map,C,j,a),{dataView:F}=T,p=ne.useSelection(i,T,a,g,e),w=ne.useSelectHierarchyItem(i,g,T,a,p,e),V=n.computed(()=>i.disabled),h=n.computed(()=>i.virtualized?Math.min(T.dataView.value.length,r.value):T.dataView.value.length),{containerStyleObject:M}=ne.useDataViewContainerStyle(i),H=ne.useCommandColumn(i),{applyCommands:E}=H;E(s);const P=ne.useColumn(i),W=ne.useSort(i),{applyColumnSorter:K,columnContext:O,updateColumnRenderContext:q}=P;K(T,W);const J=ne.useGroupColumn(i,O),G=ne.useRow(i,e,p,a),Q=ne.useEdit(i,e,a,G,g),ae=ne.useVisualDataBound(i),ye=ne.useVisualDataCell(i,Q,ae),Z=ne.useVisualDataRow(i,T,Q,j,a,ae,ye),we=ne.useVisualData(i,s,T,h,0,Z),{getVisualData:Ce}=we,ce=ne.useCellPosition(i,O),_=ne.useSidebar(i,p),{sidebarWidth:se}=_,pe=ne.useVirtualScroll(i,T,g,O,we,h,0,se),{onWheel:_e,dataGridWidth:Oe,viewPortHeight:Pe,viewPortWidth:De,resetScroll:Re,updateVisibleRowsOnLatestVisibleScope:Le}=pe,$e=ne.useFitColumn(i,O,c,De,J),{calculateColumnsSize:Me}=$e,We=ne.useFilterHistory(),et=ne.useColumnFilter(c,m,T,We,pe),Ye=ne.useDragColumn(i,e,P,T,J,v,pe),tt=n.computed(()=>({"fv-grid":!0,"fv-grid-bordered":i.showBorder,"fv-grid-horizontal-bordered":i.showHorizontalLines,"fv-datagrid-strip":i.showStripe})),Xe=n.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":y.value,"fv-grid-wrap-content":S.value})),{renderDataArea:Je}=Qo(i,e,u,f,m,ce,P,T,Q,j,G,p,w,pe,we,ae,g),{renderGridHeader:k,renderGridColumnResizeOverlay:te,shouldShowHeader:de}=ne.getColumnHeader(i,e,c,f,m,P,T,Ye,et,C,We,$e,J,p,_,W,pe,De,g),{renderDataGridSidebar:xe}=ne.getSidebar(i,G,p,_,pe),{renderDisableMask:ke}=ne.getDisableMask(),{renderHorizontalScrollbar:nt}=ne.getHorizontalScrollbar(i,c,pe),{renderVerticalScrollbar:ut}=ne.getVerticalScrollbar(i,c,pe);function ot(){var Y,ee,ge;if(c.value&&c.value.clientHeight>0&&((Y=c.value)==null?void 0:Y.clientWidth)>0){const Te=Math.ceil(c.value.clientHeight/o);Te>r.value&&(r.value=Te,Le()),Pe.value=((ee=u.value)==null?void 0:ee.clientHeight)||0,Oe.value=((ge=c.value)==null?void 0:ge.clientWidth)||0,Me()}}n.onMounted(()=>{c.value&&(r.value=Math.max(Math.ceil(c.value.clientHeight/o),r.value),g.value=Ce(0,h.value+0-1),rn.useResizeObserver(c.value,ot),Me(),n.nextTick(()=>{c.value&&(Oe.value=c.value.clientWidth),u.value&&(De.value=u.value.clientWidth,Pe.value=u.value.clientHeight)})),N.value&&b()}),n.onUnmounted(()=>{}),n.watch(De,()=>{c.value&&Me()});function Vt(Y){T.collapseTo(Y),T.reOrderVisibleIndex(),Re()}function Nt(Y){T.expandTo(Y),T.reOrderVisibleIndex(),Re()}function it(){const Y=p.getSelectionRow();return Y?Y.dataIndex-1:-1}function Mt(){const Y=it();T.insertNewDataItem(Y),g.value=Ce(0,h.value+0-1)}function Et(){const Y=it();T.insertNewChildDataItem(Y),g.value=Ce(0,h.value+0-1)}function It(){const Y=it(),ee=w.getNextSelectableHierarchyItemId(Y);T.removeHierarchyDataItem(Y),g.value=Ce(0,h.value+0-1),ee&&p.selectItemById(ee)}function kt(Y){Q.onEditingRow(Y)}function pt(Y){Q.acceptEditingRow(Y)}function Bt(Y){Q.cancelEditingRow(Y)}function ft(Y){Y&&(s.value=Y,E(s),q(s.value),K(T,W),Me())}n.watch(()=>i.columns,Y=>{ft(Y)});function jt(Y,ee){Y&&(T.load(Y),T.reOrderVisibleIndex(),ee!=null&&ee.keepScrollPosition?pe.scrollTo(pe.offsetY.value):Re())}function Ot(Y){p.selectItemById(Y)}function Pt(Y){const ee=g.value.find(ge=>ge.raw[a.idField.value]===Y);ee&&G.clickRowItem(ee)}function mt(Y){G.activeRowById(Y)}function Dt(Y){p.selectItemByIds(Y)}function x(){return p.getSelectedItems()}function D(){p.clearSelection()}const z=n.computed(()=>!g.value||!g.value.length),{renderEmpty:X}=ne.getEmpty(e);function ie(){return p.getSelectionRow()}function re(Y){p.unSelectItemByIds(Y)}function Fe(){return p.currentSelectedDataId.value}function ve(Y,ee,ge){const Te=F.value.find(Ve=>Ve[d.value]===Y);if(Te){if(Object.keys(Te).forEach(he=>{Object.prototype.hasOwnProperty.call(ee,he)&&(Te[he]=ee[he])}),ge){const{collapseField:he,disabledField:Ae,checkedField:Ue,visibleField:ze}=ge;he&&!le.isUndefined(ee[he])&&(Te.__fv_collapse__=ee[he]),Ue&&!le.isUndefined(ee[Ue])&&(Te.__fv_checked__=ee[Ue]),Ae&&!le.isUndefined(ee[Ae])&&(Te.__fv_disabled__=ee[Ae]),ze&&!le.isUndefined(ee[ze])&&(Te.__fv_visible__=ee[ze])}const Ve=g.value.find(he=>he.raw[d.value]===Y),on=g.value.findIndex(he=>he.raw[d.value]===Y);if(Ve){if(Ve.raw=Te,Object.keys(Ve.data).forEach(he=>{Ve.data[he].updateData(Te)}),ge){const{collapseField:he,disabledField:Ae,checkedField:Ue,visibleField:ze}=ge;he&&!le.isUndefined(ee[he])&&(Ve.collapse=ee[he]),Ue&&!le.isUndefined(ee[Ue])&&(Ve.checked=ee[Ue]),Ae&&!le.isUndefined(ee[Ae])&&(Ve.disabled=ee[Ae]),ze&&!le.isUndefined(ee[ze])&&(Ve.visible=ee[ze])}g.value=[...g.value.slice(0,on),Ve,...g.value.slice(on+1)]}}}function Se(Y){const ee=T.dataView.value.find(ge=>ge[d.value]===Y);return ee?ee[B.value]:""}function Ee(){return B.value}e.expose({activeRowById:mt,addNewDataItem:Mt,addNewChildDataItem:Et,collapseTo:Vt,expandTo:Nt,removeDataItem:It,editDataItem:kt,acceptDataItem:pt,cancelDataItem:Bt,updateColumns:ft,updateDataSource:jt,selectItemById:Ot,selectItemByIds:Dt,getSelectedItems:x,clearSelection:D,getSelectionRow:ie,clickRowItemById:Pt,unSelectItemByIds:re,getCurrentRowId:Fe,reassignRowData:ve,getCollapseField:Ee,getCollapseStatusById:Se});const fe=n.computed(()=>{const Y={};return pe.shouldShowHorizontalScrollbar.value&&(Y.paddingBottom="10px"),pe.shouldShowVirticalScrollbar.value&&(Y.paddingRight="10px"),Y}),Ie=n.computed(()=>({...M.value,borderRadius:"5px"}));return()=>n.createVNode("div",{ref:l,class:tt.value,style:Ie.value,onWheel:_e},[c.value&&de.value&&k(),n.createVNode("div",{ref:c,class:Xe.value,onMouseover:()=>y.value=!0,onMouseleave:()=>y.value=!1,style:fe.value},[c.value&&xe(g),c.value&&Je(),c.value&&z.value&&X(),c.value&&nt(),c.value&&ut()]),te(),V.value&&ke()])}});Qe.withInstall(xt);function _t(i){const{designerHostService:e}=i,t=new Map,o=n.ref(),r=n.ref(),s=n.ref([{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"displayedTypeName",title:"字段类型"}]),a={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},d=n.ref(!1),l=n.ref(i.componentType);function c(S){const v=[];return S.forEach(C=>{let j=[];C.type&&C.type.fields&&C.type.fields.length>0&&(j=c(C.type.fields));const B=le.cloneDeep(C),N=C.multiLanguage?"多语言":C.type.displayName,b=j.length?!1:!t.has(C.id);b&&(d.value=!0),v.push({data:Object.assign({displayedTypeName:N,selectable:b},B),children:j})}),v}function u(S){switch(S){case"data-grid":case"tree-grid":return"data-grid";case"response-form":return"form";default:return S}}function f(S){if(t.clear(),!S)return;let v=u(l.value);["frame","table","form"].includes(v)&&(v="form");const{formSchemaUtils:C,schemaService:j}=e;C.getFormSchema().module.viewmodels.forEach(B=>{if(!B.fields||B.fields.length===0)return;let b=C.getComponentByViewModelId(B.id).componentType;["frame","table","form"].includes(b)&&(b="form");const T=j.getTableInfoByViewModelId(B.id);b!==v||!T||T.id!==S.id||B.fields.forEach(F=>{t.set(F.id,!0)})})}function m(S){f(S);const{fields:v}=S.type;d.value=!1,o.value=c(v),r.value&&r.value.updateDataSource(o.value)}const g={customRowStatus:S=>(S.disabled=!S.raw.selectable,S)};function y(){const S=r.value.getSelectedItems();if(!S.length){const v=new lt;v.globalConfig={position:"top-center"},v.warning({message:"请先选择显示字段"});return}return S.map(v=>v.data)}return{fieldTreeGridRef:r,resolveFieldDataSource:m,occupiedFieldMap:t,fieldDataSource:o,fieldTreeRowOption:g,fieldColumns:s,fieldSelectionOption:a,checkAndGetSelectedFields:y,hasSelectableField:d,currentComponentType:l}}function Zo(i){const{designerHostService:e}=i,t=new Map,o=n.ref(),r=n.ref(),s=n.ref([{field:"name",title:"实体名称"}]),a=n.ref(),d=n.ref(!1);function l(y){const S=_t(i);return S.resolveFieldDataSource(y),S.hasSelectableField.value?(a.value=a.value||y,!0):!1}function c(y){return!(i.bindingEntityId&&i.bindingEntityId!==y.id||!l(y))}function u(y,S=""){var N;if(!y)return;const v=le.cloneDeep(y),C=S?`${S}/${v.label}`:"/";t.set(v.label,C.replace("//","/"));const j=c(v),B={data:Object.assign({selectable:j},v),children:[]};if(v.type.entities&&v.type.entities.length){const b=v.type.entities.map(T=>u(T,C));B.children=B.children.concat(b)}return i.bindingEntityId===y.id&&(a.value=y),((N=a.value)==null?void 0:N.id)===y.id&&!S&&(d.value=!0),B}function f(){var C;const{formSchemaUtils:y}=e,S=(C=y.getFormSchema().module.entity[0])==null?void 0:C.entities[0];t.clear();const v=u(S);r.value=[v]}function m(){const y=o.value.getSelectedItems();if(!y.length){const S=new lt;S.globalConfig={position:"top-center"},S.warning({message:"请先选择实体"});return}return y[0].data}return{entityTreeGridRef:o,entityDataSource:r,resolveEntityDataSource:f,entityBindToMap:t,checkAndGetSelectedEntity:m,entityColumns:s,entityTreeRowOption:{customRowStatus:y=>(y.disabled=!y.raw.selectable,y)},initialSelectedEntity:a,isMainEntityInitialSelected:d}}const Ko=new Map([["appearance",vt]]);function ei(i,e,t){return e}const ti={$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"]},ni={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:[]}}}}}},Wt={direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}};gt(Wt,ti,Ko,ei,ni);const oi=n.defineComponent({name:"FStep",props:Wt,emits:["click"],setup(i,e){const t=n.ref(i.direction),o=n.ref(i.fill),r=n.ref(i.height),s=n.ref(i.steps),a=n.ref(i.activeIndex),d=n.computed(()=>({"f-progress-step-list":t.value==="horizontal","f-progress-step-list-block":t.value==="vertical","f-progress-step-horizontal-fill":t.value==="horizontal"&&o.value,"f-progress-step-vertical-fill":t.value==="vertical"&&o.value})),l=n.computed(()=>({height:t.value==="vertical"?`${r.value}px`:""}));function c(N,b){const T={step:!0,active:b===a.value,clickable:i.clickable,current:b===a.value,finish:b<a.value};return N.status&&(T[N.status]=!0),Qe.getCustomClass(T,N.class||"")}function u(N,b){if(!i.clickable)return;const T={step:N,stepIndex:b};e.emit("click",T)}function f(N,b){const T={"f-progressstep-row":!0,"step-active":b===a.value,"step-current":b===a.value,"step-finish":b<a.value};return N.status&&(T["step-"+N.status]=!0),T}function m(N,b){const T={"step-icon":!0,"step-success":b,"f-icon":b,"f-icon-check":b};return Qe.getCustomClass(T,N.icon||"")}function g(N,b){const T=[];return N.icon?T.push(n.createVNode("span",{class:m(N,!1)},null)):b>=a.value?T.push(n.createVNode("span",{class:"step-icon"},[b+1])):T.push(n.createVNode("span",{class:m(N,!0)},null)),T}function y(N,b){return{"step-name":!0,"step-name-success":b<a.value}}function S(N,b){return n.createVNode("div",{class:"f-progress-step-title"},[n.createVNode("p",{class:y(N,b)},[N.title])])}function v(N,b){return{"f-progress-step-line":!0,"f-progress-step-line-success":b===a.value}}function C(N,b){return b!==s.value.length-1}const j=n.computed(()=>({triangle:!0,"":t.value==="vertical"}));function B(){return s.value.map((N,b)=>n.createVNode("li",{class:c(N,b),onClick:T=>u(N,b)},[n.createVNode("div",{class:f(N,b)},[n.createVNode("div",{class:"f-progress-step-content"},[g(N,b),S(N,b)]),C(N,b)&&n.createVNode("div",{class:v(N,b)},[n.createVNode("span",{class:j.value},null)])])]))}return n.watch(()=>i.activeIndex,()=>{i.activeIndex>-1&&i.activeIndex<=s.value.length&&(a.value=i.activeIndex,B())}),()=>n.createVNode("div",{class:"f-progress-step"},[n.createVNode("ul",{class:d.value,style:l.value},[B()])])}}),St=new Map([["appearance",vt]]),ii=new Map([]),ri="root-viewmodel";class ai{constructor(e,t){oe(this,"formSchemaUtils");oe(this,"controlCreatorUtils");oe(this,"designViewModelUtils");this.resolver=e,this.designerHostService=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(e){const t=this.createComponentRefNode(e),o=this.createComponentNode(e),r=this.createViewModeNode(e),s=this.formSchemaUtils.getFormSchema();return s.module.viewmodels.push(r),s.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),t}createComponentRefNode(e){const t=this.resolver.getSchemaByType("component-ref");return Object.assign(t,{id:`${e.componentId}-component-ref`,component:`${e.componentId}-component`}),t}createComponentNode(e){const t=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(e);return Object.assign(t,{id:`${e.componentId}-component`,viewModel:`${e.componentId}-component-viewmodel`,componentType:e.componentType,appearance:{class:this.getFormComponentClass()},formColumns:e.formColumns,contents:o}),t}getFormComponentClass(){const{templateId:e}=this.formSchemaUtils.getFormSchema().module;return e==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(e){const t=this.resolver.getSchemaByType("section");Object.assign(t,{id:e.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:e.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:e.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),t.contents=[o];const{selectedFields:s}=e;s==null||s.forEach(d=>{const l=le.cloneDeep(d),c=this.resolveControlClassByFormColumns(e),u=this.controlCreatorUtils.setFormFieldProperty(l,"",c);u&&r.push(u)});const{templateId:a}=this.formSchemaUtils.getFormSchema().module;return a==="double-list-in-tab-template"&&(t.appearance.class="f-section-grid f-section-in-main px-0 pt-0",t.fill=!0),[t]}resolveControlClassByFormColumns(e){let t="";switch(e.formColumns){case 1:{t="col-12";break}case 2:{t="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{t="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{t="col-12 col-md-6 col-xl-3 col-el-2";break}}return t}createViewModeNode(e){return{id:`${e.componentId}-component-viewmodel`,code:`${e.componentId}-component-viewmodel`,name:e.componentName,bindTo:e.bindTo,parent:ri,fields:this.assembleViewModelFields(e),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(e){const t=[],{selectedFields:o}=e;return o==null||o.forEach(r=>{let s="blur";const a=r.type.name;(a===Qe.FormSchemaEntityFieldTypeName.Enum||a===Qe.FormSchemaEntityFieldTypeName.Boolean)&&(s="change"),t.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:s,fieldSchema:{}})}),t}}function si(i,e,t,o){var s,a,d,l,c,u;const r=t.parentComponentInstance;if(r&&o){const f=(s=r.schema)==null?void 0:s.type,g={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((a=t.bindingSourceContext)==null?void 0:a.entityTitle)||((l=(d=t.bindingSourceContext)==null?void 0:d.bindingEntity)==null?void 0:l.name)||"标题",componentType:"form",formColumns:f==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((c=t.bindingSourceContext)==null?void 0:c.bindTo)||"/",selectedFields:(u=t.bindingSourceContext)==null?void 0:u.bindingEntityFields};return new ai(i,o).createComponent(g)}else return e}function li(i,e,t){return e}gt({customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},St,si);const Yt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Xt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}};Ne.createPropsResolver(Xt,Yt,St,void 0),Ne.createFormGroupEditorResolver();const ci={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""}},di=n.defineComponent({name:"FDynamicFormLabel",props:ci,emits:[],setup(i,e){n.ref(i.title||i.text);const t=n.ref(i.required),o=n.ref(i.text),r=n.ref(i.valid),s=n.ref(i.inValidTip);n.watch(()=>i.text,()=>{o.value=i.text}),n.watch(()=>i.required,(l,c)=>{l!==c&&(t.value=l)}),n.watch([()=>i.valid,()=>i.inValidTip],([l,c])=>{r.value=l,s.value=c});const a=n.computed(()=>r.value?o.value:s.value),d=n.computed(()=>r.value?"":"color:red");return()=>o.value&&n.createVNode("label",{class:"col-form-label",title:a.value,style:d.value},[!r.value&&n.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:s.value},null),n.createVNode("span",{class:"farris-label-text"},[t.value&&n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),o.value])])}}),R={},$={},L={},A={};let Jt=!1;function ui(){Jt||(Jt=!0,ln.register(R,$,L,A),sn.register(R,$,L,A),cn.register(R,$,L,A),dn.register(R,$,L,A),un.register(R,$,L,A),pn.register(R,$,L,A),Rt.register(R,$,L,A),$t.register(R,$,L,A),Rt.register(R,$,L,A),$t.register(R,$,L,A),fn.register(R,$,L,A),mn.register(R,$,L,A),hn.register(R,$,L,A),gn.register(R,$,L,A),yn.register(R,$,L,A),vn.register(R,$,L,A),bn.register(R,$,L,A),Cn.register(R,$,L,A),wn.register(R,$,L,A),xn.register(R,$,L,A),Co.register(R,$,L,A),Sn.register(R,$,L,A),Tn.register(R,$,L,A),fo.register(R,$,L,A),Vn.register(R,$,L,A),Nn.register(R,$,L,A),Mn.register(R,$,L,A),In.register(R,$,L,A),En.register(R,$,L,A),kn.register(R,$,L,A),Bn.register(R,$,L,A),jn.register(R,$,L,A),On.register(R,$,L,A),Pn.register(R,$,L,A),Dn.register(R,$,L,A),Rn.register(R,$,L,A),$n.register(R,$,L,A),qn.register(R,$,L,A),Ln.register(R,$,L,A),An.register(R,$,L,A),Un.register(R,$,L,A),zn.register(R,$,L,A),Hn.register(R,$,L,A),_n.register(R,$,L,A),Gn.register(R,$,L,A),co.register(R,$,L),Wn.register(R,$,L,A),Yn.register(R,$,L,A),Xn.register(R,$,L,A),Jn.register(R,$,L,A),Qn.register(R,$,L,A),Zn.register(R,$,L,A),ho.register(R,$,L,A),Kn.register(R,$,L,A),eo.register(R,$,L,A),to.register(R,$,L,A),no.register(R,$,L,A),oo.register(R,$,L,A),io.register(R,$,L,A),ao.register(R,$,L,A),ro.register(R,$,L,A),so.register(R,$,L,A),lo.register(R,$,L,A),uo.register(R,$,L,A),Fn.register(R,$,L,A),po.register(R,$,L,A),mo.register(R,$,L,A),yo.register(R,$,L,A),go.register(R,$,L,A),vo.register(R,$,L,A),bo.register(R,$,L,A),wo.register(R,$,L,A),xo.register(R,$,L,A))}function pi(){ui();function i(a){const d=R[a];if(!d)throw new Error(`Could not find the editor of type '${a}'`);return d}function e(a,d){const l=$[a];return l?l(d):{}}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"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"time-picker":return"onValueChange";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-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":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged"}}function o(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:e,resolveEditorType:i,getChangeFunctionName:t,getClearFunctionName:o,getMousedownFunctionName:r,getMouseupFunctionName:s}}const fi={errors:{type:Object,default:null}},mi=n.defineComponent({name:"FValidationMessage",props:fi,emits:[],setup(i,e){const t=n.ref(i.errors);n.watch(()=>i.errors,s=>{t.value=s});const o=n.ref(!0),r=n.computed(()=>{if(t.value){const s=Object.keys(t.value).map(a=>{var d;return(d=t.value[a])==null?void 0:d.name});return s.length?s.join(" "):""}return""});return()=>r.value&&n.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>o.value=!o.value},[!o.value&&n.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),o.value&&n.createVNode("span",{class:"f-feedback-message"},[r.value])])}}),Qt=n.defineComponent({name:"FDynamicFormGroup",props:Xt,emits:["change","update:modelValue"],setup(i,e){var T;const t=n.ref(i.id),o=n.ref(i.customClass),r=n.ref(i.editor),s=n.ref(i.label),a=n.ref(i.modelValue),d=n.ref(i.readonly),l=n.ref(((T=i.editor)==null?void 0:T.required)||i.required),c=n.ref(i.showLabel),u=n.ref(i.visible);n.ref(i.type);const f=n.ref(),m=n.ref(i.errors),{resolveEditorProps:g,resolveEditorType:y,getChangeFunctionName:S,getClearFunctionName:v}=pi(),C=n.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":d.value}));function j(F,p,w){a.value=p!==void 0?p:F,e.emit("update:modelValue",a.value),e.emit("change",a.value,{newValue:F,newModelValue:p,parameters:w})}function B(){e.emit("update:modelValue","")}const N=n.computed(()=>{const F=r.value.type||"input-group",p=y(F),w=g(F,r.value),V=S(F),h=v(r.value.type);return h&&(w[h]=B),w[V]=j,(w.id==null||w.id==="")&&(w.id=t.value),F==="number-range"&&r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"?(r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"&&(w.onBeginValueChange=r.value.onBeginValueChange),r.value.onEndValueChange&&typeof r.value.onEndValueChange=="function"&&(w.onEndValueChange=r.value.onEndValueChange)):F==="lookup"&&r.value["onUpdate:idValue"]&&typeof r.value["onUpdate:idValue"]=="function"?w["onUpdate:idValue"]=r.value["onUpdate:idValue"]:F==="property-editor"&&(w.onBeforeOpenVariables=r.value.onBeforeOpenVariables),()=>n.createVNode(p,n.mergeProps({ref:f},w,{modelValue:a.value,"onUpdate:modelValue":M=>a.value=M}),e.slots)});function b(){return n.createVNode(mi,{id:`${t.value}-validation-message`,errors:m.value},null)}return n.watch([()=>i.id,()=>i.customClass,()=>i.editor,()=>i.label,()=>i.modelValue,()=>i.readonly,()=>i.required,()=>i.showLabel,()=>i.visible,()=>i.errors],([F,p,w,V,h,M,H,E,P,W])=>{var K;t.value=F,o.value=p,r.value=w,s.value=V,a.value=h,d.value=M,l.value=((K=r.value)==null?void 0:K.required)||H,c.value=E,u.value=P,m.value=W}),e.expose({editorRef:f}),()=>u.value&&n.createVNode("div",{id:`${t.value}-input-group`,class:o.value,style:i.customStyle},[n.createVNode("div",{class:"farris-group-wrap"},[n.createVNode("div",{class:C.value},[c.value&&n.createVNode(di,{id:`${t.value}-lable`,required:l.value,text:s.value,title:s.value},null),n.createVNode("div",{class:"farris-input-wrap"},[N.value(),b()])])])])}}),hi={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}};Ne.createPropsResolver(hi,Yt,St,void 0);const yi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},gi={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}};Ne.createPropsResolver(gi,yi,ii,li);const vi={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function Tt(){return new DOMException("The request is not allowed","NotAllowedError")}async function bi(i){if(!navigator.clipboard)throw Tt();return navigator.clipboard.writeText(i)}async function Ci(i){const e=document.createElement("span");e.textContent=i,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);const t=window.getSelection(),o=window.document.createRange();t==null||t.removeAllRanges(),o.selectNode(e),t==null||t.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{t==null||t.removeAllRanges(),window.document.body.removeChild(e)}if(!r)throw Tt()}async function wi(i){try{await bi(i)}catch(e){try{await Ci(i)}catch(t){throw t||e||Tt()}}}function xi(){async function i(e){await wi(e)}return{onCopy:i}}function Si(i,e,t,o){const r=n.ref(14),s=n.ref(140),a=n.ref(""),d=n.ref(o.value.length),l=n.computed(()=>o.value),c=n.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function u(f){if(f.currentTarget){const m=f.currentTarget.value||"";d.value=m.length}}return()=>n.createVNode(n.Fragment,null,[n.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:s.value,onInput:f=>u(f)},[l.value]),n.createVNode("span",{class:"textarea-wordcount",title:a.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[d.value+" / "+s.value])])}function Ti(i,e,t,o){const r=Si(i,e,t,o),s=new Map([["text-area",r]]);function a(d){return s.get(d)||null}return{getEditorRender:a}}function Fi(){const i=n.ref(!1),e=n.ref("复制成功");return{feedbackStyle:n.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return o.opacity=i.value?"0.8":"0",o.display=i.value?"":"none",o}),feedbackMessage:e,toShowFeedback:i}}function Vi(i,e){const t=e.getEditorRender(i.promptEditorType);return()=>t&&t()}function Ni(i){function e(m){if(m==null)return 0;let g=0;for(let y=0;y<m.length;y++){const S=m.charCodeAt(y);S>=0&&S<=128?g++:g=g+2}return g}function t(m,g){if(m!==""&&m!==void 0&&m!==null){m=""+m;const y=m.length;let S="",v=0;for(let C=0;C<y;C++){const j=m.charAt(C);if(v++,encodeURI(j).length>4&&v++,S=S.concat(j),v>=g)return S=S.concat("..."),S}if(v<g)return m}return""}const o=n.computed(()=>!!i.value&&!!i.value.date),r=n.computed(()=>`发生时间 : ${i.value&&i.value.date||""}`),s=n.computed(()=>!!i.value&&!!i.value.detail),a=n.computed(()=>i.value?e(i.value.detail)>160:!1),d=n.ref(!1),l=n.computed(()=>d.value?"收起":"展开"),c=n.computed(()=>{const m="详细信息 : "+(i.value&&i.value.detail)||"";return d.value?m:t(m,160)}),u=n.computed(()=>({position:"absolute",right:0,bottom:d.value?0:"2px",color:"#2A87FF",cursor:"pointer"}));function f(){d.value=!d.value}return()=>n.createVNode("div",{class:"toast-msg-detail"},[o.value&&n.createVNode("div",null,[r.value]),s.value&&n.createVNode("div",{class:"exception_wrap"},[n.createVNode("div",{class:"exception_error_msg"},[n.createVNode("div",{innerHTML:c.value},null),a.value&&n.createVNode("span",{style:u.value,onClick:f},[l.value])])])])}function Mi(i){return()=>n.createVNode("p",{class:"toast-msg-detail",innerHTML:i.value},null)}function Ei(i,e,t,o){const r=n.ref(i.exceptionInfo),s=n.computed(()=>{const m={"f-icon":!0},g=`f-icon-${e.value}`;return m[g]=!0,m}),a=n.computed(()=>t.value||r.value&&r.value.message),d=n.computed(()=>o.value),l=n.computed(()=>!!o.value),c=n.computed(()=>!!r.value);function u(){return c.value?Ni(r):l.value?Mi(d):()=>null}const f=u();return()=>n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"float-left modal-tips-iconwrap"},[n.createVNode("span",{class:s.value},null)]),n.createVNode("div",{class:"modal-tips-content"},[n.createVNode("p",{class:"toast-msg-title",innerHTML:a.value},null),f()])])}function Ii(i,e,t){const{onCopy:o}=e,{toShowFeedback:r}=t,s=n.ref("复制成功"),a=n.ref("复制详细信息"),d=n.ref(i.exceptionInfo||{date:"",message:"",detail:""}),l=n.computed(()=>d.value&&d.value.detail||"");function c(u){o(l.value).catch(f=>{s.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>n.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[n.createVNode("span",{onClick:c,style:"cursor: pointer;"},[a.value])])}function ki(i,e,t,o){const r=n.ref(i.type),s=n.ref(i.buttons),a=n.ref(i.exceptionInfo),d=n.ref(i.okButtonText),l=n.ref(i.cancelButtonText),c=n.ref(!0),u=n.ref(!0),f=n.computed(()=>!!(s.value&&s.value.length)),m=n.computed(()=>a.value&&a.value.date&&a.value.message&&a.value.detail),g=n.computed(()=>!(s.value&&s.value.length)&&(d.value||l.value)),y=n.computed(()=>u.value&&d.value),S=n.computed(()=>c.value&&l.value),v=Ii(i,t,o);function C(B){r.value==="question"&&e.emit("reject"),e.emit("close")}function j(B){r.value==="question"&&e.emit("accept"),e.emit("close")}return()=>n.createVNode("div",{class:"modal-footer"},[m.value&&v(),g.value&&S.value&&n.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:C},[l.value]),g.value&&y.value&&n.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:j},[d.value]),f.value&&s.value.length&&s.value.map(B=>n.createVNode("button",{type:"button",onClick:B.handle,class:B.class},[B.iconClass&&n.createVNode("span",{class:B.iconClass},null),B.text]))])}const ct=n.defineComponent({name:"FMessageBox",props:vi,emits:["accept","reject","close"],setup(i,e){const t=n.ref(i.type),o=n.ref(i.title),r=n.ref(i.detail),s=n.computed(()=>{const v={"modal-tips":!0,"d-flex":!0,"flex-row":!0},C=`messager-type-${t.value}`;return v[C]=!0,v}),a=n.computed(()=>{const v={};return t.value==="prompt"?v.padding="0.5rem 0.5rem 1rem 1.5rem":t.value==="error"&&(v.padding="0.5rem 1.5rem 1rem 1.5rem"),v}),d=xi(),l=Ti(i,t,o,r),c=Fi(),{feedbackStyle:u,feedbackMessage:f}=c;function m(){return n.createVNode("div",{style:u.value},[f.value])}function g(){switch(t.value){case"prompt":return Vi(i,l);default:return Ei(i,t,o,r)}}const y=g(),S=ki(i,e,d,c);return()=>n.createVNode("div",{class:"farris-messager"},[n.createVNode("section",{class:s.value,style:a.value},[y()]),S(),m()])}}),Bi={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},host:{type:Object,default:"body"}};class ue{constructor(e,t){this.x=e,this.y=t}static getTransformInfo(e){const o=window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),s=parseInt(o[5],10);return{x:r,y:s}}return{x:0,y:0}}static fromEvent(e,t=null){if(this.isMouseEvent(e))return new ue(e.clientX,e.clientY);if(t===null||e.changedTouches.length===1)return new ue(e.changedTouches[0].clientX,e.changedTouches[0].clientY);for(let o=0;o<e.changedTouches.length;o++)if(e.changedTouches[o].target===t)return new ue(e.changedTouches[o].clientX,e.changedTouches[o].clientY)}static isMouseEvent(e){return Object.prototype.toString.apply(e).indexOf("MouseEvent")===8}static isIPosition(e){return!!e&&"x"in e&&"y"in e}static getCurrent(e){const t=new ue(0,0);if(window){const o=window.getComputedStyle(e);if(o){const r=parseInt(o.getPropertyValue("left"),10),s=parseInt(o.getPropertyValue("top"),10);t.x=isNaN(r)?0:r,t.y=isNaN(s)?0:s}return t}return null}static copy(e){return new ue(0,0).set(e)}get value(){return{x:this.x,y:this.y}}add(e){return this.x+=e.x,this.y+=e.y,this}subtract(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){this.x*=e,this.y*=e}divide(e){this.x/=e,this.y/=e}reset(){return this.x=0,this.y=0,this}set(e){return this.x=e.x,this.y=e.y,this}}class qe{constructor(e,t){this.width=e,this.height=t}static getCurrent(e){const t=new qe(0,0);if(window){const o=window.getComputedStyle(e);return o&&(t.width=parseInt(o.getPropertyValue("width"),10),t.height=parseInt(o.getPropertyValue("height"),10)),t}return null}static copy(e){return new qe(0,0).set(e)}set(e){return this.width=e.width,this.height=e.height,this}}function ji(i,e){const t=n.ref(),o=n.ref(),r=n.ref(),s=n.ref(),a=n.ref(),d=n.ref(),l=n.ref(),c=n.ref(),u=n.ref(),f=n.ref(),m=n.ref(),g=n.ref(i.resizeable),y=n.ref(),S=n.ref(i.draggable),v=n.ref(!1);function C(){const O=o.value||document.body,q=window.getComputedStyle(O);if(!q||!t.value)return;const J=ue.getTransformInfo(t.value),G={};l.value&&(G.deltaL=t.value.offsetLeft-l.value.x,G.deltaT=t.value.offsetTop-l.value.y);const Q=q.getPropertyValue("position");G.width=O.clientWidth,G.height=O.clientHeight,G.pr=parseInt(q.getPropertyValue("padding-right"),10),G.pb=parseInt(q.getPropertyValue("padding-bottom"),10),G.position=q.getPropertyValue("position"),Q==="static"&&(O.style.position="relative"),G.translateX=J.x,G.translateY=J.y,f.value=G}function j(O){if(t.value){s.value=qe.getCurrent(t.value),a.value=ue.getCurrent(t.value),d.value=s.value?qe.copy(s.value):null,l.value=a.value?ue.copy(a.value):null,C();const q=O.target.getAttribute("type")||"";c.value={n:!!q.match(/n/),s:!!q.match(/s/),w:!!q.match(/w/),e:!!q.match(/e/)}}}function B(){var O,q,J,G;if(t.value){const Q=t.value;c.value&&((c.value.n||c.value.s)&&((O=d.value)!=null&&O.height)&&(Q.style.height=d.value.height+"px"),(c.value.w||c.value.e)&&((q=d.value)!=null&&q.width)&&(Q.style.width=d.value.width+"px"),l.value&&((J=l.value)!=null&&J.x&&(Q.style.left=l.value.x+"px"),(G=l.value)!=null&&G.y&&(Q.style.top=l.value.y+"px")))}}function N(){const O=i.minHeight?i.minHeight:1,q=i.minWidth?i.minWidth:1;d.value&&l.value&&c.value&&s.value&&(d.value.height<O&&(d.value.height=O,c.value.n&&a.value&&(l.value.y=a.value.y+(s.value.height-O))),d.value.width<q&&(d.value.width=q,c.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-q))),i.maxHeight&&d.value.height>i.maxHeight&&(d.value.height=i.maxHeight,a.value&&c.value.n&&(l.value.y=a.value.y+(s.value.height-i.maxHeight))),i.maxWidth&&d.value.width>i.maxWidth&&(d.value.width=i.maxWidth,c.value.w&&a.value&&(l.value.x=a.value.x+(s.value.width-i.maxWidth))))}function b(){if(o.value){const O=f.value;if(l.value&&d.value&&c.value&&s.value){const q=O.width-O.pr-O.deltaL-O.translateX-l.value.x,J=O.height-O.pb-O.deltaT-O.translateY-l.value.y;c.value.n&&l.value.y+O.translateY<0&&a.value&&(l.value.y=-O.translateY,d.value.height=s.value.height+a.value.y+O.translateY),c.value.w&&l.value.x+O.translateX<0&&a.value&&(l.value.x=-O.translateX,d.value.width=s.value.width+a.value.x+O.translateX),d.value.width>q&&(d.value.width=q),d.value.height>J&&(d.value.height=J)}}}function T(O){if(!r.value||!s.value||!a.value||!c.value)return;O.subtract(r.value);const q=O.x,J=O.y;c.value.n?(l.value.y=a.value.y+J,d.value.height=s.value.height-J):c.value.s&&(d.value.height=s.value.height+J),c.value.e?d.value.width=s.value.width+q:c.value.w&&(d.value.width=s.value.width-q,l.value.x=a.value.x+q),b(),N(),B()}function F(O){if(!u.value)return;const q=ue.fromEvent(O);q&&T(q)}function p(){if(t.value){const{width:O,height:q,x:J,y:G}=t.value.getBoundingClientRect(),Q=ue.getTransformInfo(t.value);return{size:{width:O,height:q},position:{x:J-Q.x,y:G-Q.y}}}return null}function w(O){if(t.value){const q=p();m.value=q}r.value=void 0,s.value=null,a.value=null,d.value=null,l.value=null,c.value=null,u.value=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",w)}function V(){document.addEventListener("mousemove",F),document.addEventListener("mouseup",w)}function h(O){O instanceof MouseEvent&&O.button===2||S.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),r.value=ue.fromEvent(O),u.value=O.target,j(O),V())}function M(O){return t.value=O,g.value&&n.createVNode(n.Fragment,null,[n.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:q=>h(q)},null),n.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:q=>h(q)},null)])}function H(O=!0){document.body.click();const q=o.value||document.body,J=qe.getCurrent(q),G=t.value;O&&G&&(y.value=p(),y.value.transform=G.style.transform),J&&G&&(d.value=J,d.value.height-=14,d.value.width-=14,G.style.height=d.value.height+"px",G.style.width=d.value.width+"px",G.style.left="7px",G.style.top="7px",G.style.transform="",m.value={size:d.value,position:{x:0,y:0}},S.value=!1,v.value=!0)}function E(){var O,q;if(document.body.click(),y.value){const J={width:y.value.size.width||0,height:y.value.size.height||0},G={x:(window.innerWidth-J.width)/2,y:(window.innerHeight-J.height)/2};(O=d.value)==null||O.set(J),(q=l.value)==null||q.set(G);const Q=t.value;Q.style.height=J.height+"px",Q.style.width=J.width+"px",Q.style.left=`${G.x}px`,Q.style.top=`${G.y}px`,Q.style.transform="",m.value={size:J,position:G},S.value=i.draggable,v.value=!1}}function P(){if(t.value){const O=qe.getCurrent(t.value);if(O){const{width:q,height:J}=O;t.value.style.left=`${(window.innerWidth-q)/2}px`,t.value.style.top=`${(window.innerHeight-J)/2}px`,t.value.style.transform=""}}}function W(){const O=()=>{v.value?H(!1):P(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const K=W();return{renderResizeBar:M,boundingElement:o,resizedEventParam:m,maximize:H,restore:E,allowDrag:S,isMaximized:v,unWindowResizeHandle:K}}function Oi(i,e,t){const o=n.ref(),r=n.ref(i.draggable),s=n.ref(i.lockAxis),a=n.ref(),d=n.ref(),l=n.ref(!1),c=n.ref(new ue(0,0)),u=n.ref(new ue(0,0)),f=n.ref(new ue(0,0)),m=n.ref(new ue(0,0));n.watch(()=>t.value,F=>{a.value.style.cursor=F?"move":"default"});function g(F,p){if(p.tagName==="BUTTON")return!1;if(p===F)return!0;for(const w in p.children)if(Object.prototype.hasOwnProperty.call(p.children,w)&&g(F,p.children[w]))return!0;return!1}function y(){var V,h;let F=f.value.x+u.value.x,p=f.value.y+u.value.y;s.value==="x"?(F=((V=c.value)==null?void 0:V.x)||0,f.value.x=0):s.value==="y"&&(p=((h=c.value)==null?void 0:h.y)||0,f.value.y=0);const w=`translate3d(${Math.round(F)}px, ${Math.round(p)}px, 0px)`;o.value&&(o.value.style.transform=w),m.value.x=F,m.value.y=p}function S(){if(!d.value||!o.value)return null;const F=d.value.getBoundingClientRect(),p=o.value.getBoundingClientRect(),w={top:F.top<p.top,right:F.right>p.right,bottom:F.bottom>p.bottom,left:F.left<p.left};return w.top||(f.value.y-=p.top-F.top),w.bottom||(f.value.y-=p.bottom-F.bottom),w.right||(f.value.x-=p.right-F.right),w.left||(f.value.x-=p.left-F.left),y(),w}function v(F){F&&(c.value&&F.subtract(c.value),f.value.set(F),y(),S())}function C(F){l.value&&r.value&&(F.stopPropagation(),F.preventDefault(),v(ue.fromEvent(F,a.value)))}function j(){var F;l.value&&(l.value=!1,u.value.add(f.value),f.value.reset(),(F=o.value)==null||F.classList.remove("ng-dragging"),e.emit("stopMove"),document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",j))}function B(){!l.value&&a.value&&(l.value=!0,a.value.classList.add("ng-dragging"),document.addEventListener("mousemove",C),document.addEventListener("mouseup",j))}function N(){if(o.value){const F=ue.getTransformInfo(o.value);u.value.set(F);return}u.value.reset()}function b(F){if(!t.value||F instanceof MouseEvent&&F.button===2)return;const p=F.target||F.srcElement;a.value!==void 0&&p&&!g(p,a.value)||r.value!==!1&&(document.body.click(),F.stopPropagation(),F.preventDefault(),c.value=ue.fromEvent(F,o.value),N(),B())}function T(F,p,w){if(r.value&&p){if(F)a.value=F;else if(i.dragHandle){if(i.dragHandle instanceof HTMLElement)a.value=i.dragHandle;else if(typeof i.dragHandle=="string"){const V=p.querySelector(i.dragHandle);V&&(a.value=V)}}o.value=p,d.value=w,a.value?(a.value.classList.add("ng-draggable"),a.value.addEventListener("mousedown",b)):r.value=!1}}return{registerDraggle:T,resetTranslate:N}}function Zt(i,e){if(i){const t=o=>{o.key.toLowerCase()===i.toLowerCase()&&e({event:o,key:i})};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}}function Pi(i,e){const t=n.ref(i.enableEsc);let o=null;return t.value?(o=Zt("Escape",r=>{e.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function Di(i,e){const t=n.ref(i.enableEnter);let o=null;return t.value?(o=Zt("Enter",r=>{e.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ke=n.defineComponent({name:"FModal",props:Bi,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(i,e){const t=n.ref(i.width||300),o=n.ref(i.height||200),r=n.ref(i.modelValue),s=n.ref(""),a=n.ref(i.class),d=n.ref(i.fitContent),l=n.ref(i.showHeader),c=n.ref(""),u=n.ref(i.showCloseButton),f=n.ref(i.showMaxButton),m=n.ref(!1),g=n.ref(i.dialogType),y=n.ref(i.src),S=n.ref(""),v=n.ref(i.showButtons),C=n.ref(i.title),j=n.ref(i.containment||null),B=n.ref(),N=n.ref(!1);function b(k,te){Promise.resolve().then(()=>{var de;return(de=i.beforeClose)==null?void 0:de.call(i)}).then(de=>{de&&(r.value=!1,e.emit("update:modelValue",!1),te!=null&&e.emit(te?"accept":"cancel"),e.emit("closed",k))})}const T=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:k=>{b(k,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:k=>{b(k,!0)}}],F=n.ref(i.buttons&&i.buttons.length?i.buttons:T),p=n.computed(()=>!!c.value),w=n.computed(()=>!!v.value&&!!F.value),V=n.ref(),h=n.ref(),M=n.ref(!1),{renderResizeBar:H,maximize:E,restore:P,boundingElement:W,resizedEventParam:K,allowDrag:O,unWindowResizeHandle:q}=ji(i),{registerDraggle:J}=Oi(i,e,O);function G(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function Q(){const k=document.querySelectorAll(".farris-modal").length;(!k||k-1<=0)&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}n.watch(()=>i.title,(k,te)=>{k!==te&&(C.value=k)}),n.watch(()=>i.modelValue,(k,te)=>{k!==te&&(r.value=k,r.value&&i.draggable&&n.nextTick(()=>{h.value&&!j.value&&(j.value=h.value.parentElement,W.value=j.value,J(V.value,h.value,W.value))}),k||(j.value&&(j.value=null),Q())),r.value&&(N.value=G())}),n.watch(()=>i.showHeader,(k,te)=>{k!==te&&(l.value=k)}),n.watch(()=>i.showButtons,(k,te)=>{k!==te&&(v.value=k)}),n.watch(()=>K.value,(k,te)=>{const de=k||{},xe=te||{};JSON.stringify(de)!==JSON.stringify(xe)&&e.emit("resize",{newSize:k,oldSize:te,isMaximized:M.value})});const ae=n.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),ye=n.computed(()=>{var de;const k={modal:!0,"farris-modal":!0,fade:!0};k["f-modal-fitContent"]=!!d.value,k.show=!!ae.value;const te=(de=i.maskClass)==null?void 0:de.split(" ");return te==null||te.reduce((xe,ke)=>(xe[ke]=!0,xe),k),k}),Z=n.computed(()=>{var de;const k={"modal-dialog":!0},te=(de=a.value)==null?void 0:de.split(" ");return te==null||te.reduce((xe,ke)=>(xe[ke]=!0,xe),k),k}),we=n.computed(()=>{const k={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-t.value)/2}px`,width:`${t.value}px`,height:d.value?"auto":`${o.value}px`};return i.mask||(k.pointerEvents="auto"),k}),Ce=n.computed(()=>{const k={display:"block"};return i.mask||(k.pointerEvents="none",k.backgroundColor="transparent"),N.value&&(k.backgroundColor="transparent"),k}),ce=n.computed(()=>({"modal-content":!0,"modal-content-has-header":l.value})),_=n.computed(()=>{const k={display:l.value?"":"none"};return k["pointer-events"]=O.value?"auto":"none",k}),se=n.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:M.value})),pe=n.computed(()=>({"modal-body":!0,"f-utils-flex-column":g.value==="iframe","f-utils-fill":!0}));function _e(){return{height:`${i.footerHeight||60}px`}}const Oe=n.computed(()=>{const k={textAlgin:S.value},te=_e();return Object.assign(k,te)});function Pe(k){if(k.stopPropagation(),M.value){M.value=!1,P();return}E(),M.value=!0}async function De(k,te){k.handle&&await k.handle(te,k)&&e.emit("closed",te)}function Re(k){k.width&&(t.value=k.width),k.height&&(o.value=k.height),k.buttons&&(F.value=k.buttons),k.title&&(C.value=k.title)}let Le=null,$e=null;n.onBeforeMount(()=>{N.value=G()}),n.onMounted(()=>{h.value&&!j.value&&(j.value=h.value.parentElement,W.value=j.value,J(V.value,h.value,W.value)),ae.value&&document.body.classList.add("modal-open"),Le=Pi(i,e),$e=Di(i,e)}),n.onUnmounted(()=>{q&&q(),Le&&Le.remove(),$e&&$e.remove()}),e.expose({modalElementRef:h,updateModalOptions:Re,close:b,maxDialog:Pe,isMaximized:M});function Me(){return n.createVNode("ul",null,[m.value&&n.createVNode("li",{class:"f-btn-icon f-bare"},[n.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&n.createVNode("li",{onClick:Pe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[n.createVNode("span",{class:se.value},null)]),u.value&&n.createVNode("li",{class:"f-btn-icon f-bare",onClick:k=>b(k,!1),style:"pointer-events: auto;"},[n.createVNode("span",{class:"f-icon modal_close"},null)])])}function We(){return n.createVNode("div",{class:"modal-footer",style:Oe.value},[F.value&&F.value.map(k=>{const te=n.ref(k.disabled);return n.createVNode("button",{name:k.name,type:"button",disabled:te.value,class:k.class+(k.iconClass?" btn-icontext":""),onClick:de=>{De(k,de)}},[!!k.iconClass&&n.createVNode("i",{class:k.iconClass},null),k.text])})])}function et(){return n.createVNode("div",{ref:V,class:"modal-header",style:_.value},[e.slots.headerTemplate?e.slots.headerTemplate():n.createVNode("div",{class:"modal-title"},[p.value&&n.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),n.createVNode("span",{class:"modal-title-label"},[C.value])]),n.createVNode("div",{class:"actions"},[Me()])])}function Ye(){return e.slots.footerTemplate?e.slots.footerTemplate():w.value&&We()}function tt(k){if(k.stopPropagation(),i.allowClickMaskToClose){if(k.target!==B.value)return;b(k,!1)}}function Xe(){var k,te;return n.createVNode("div",{id:s.value,class:Z.value,style:we.value,ref:h},[n.createVNode("div",{class:ce.value},[l.value&&et(),n.createVNode("div",{class:pe.value},[(te=(k=e.slots).default)==null?void 0:te.call(k),g.value==="iframe"&&n.createVNode("iframe",{title:s.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:y.value},null)]),Ye()]),!d.value&&h.value&&!M.value&&H(h.value)])}function Je(k){return k||"body"}return()=>n.createVNode(n.Teleport,{to:Je(i.host)},{default:()=>[ae.value&&n.createVNode(n.Transition,{name:"fade",appear:!0},{default:()=>[n.createVNode("div",{ref:B,class:ye.value,style:Ce.value,onClick:tt},[Xe()])]})]})}});function Kt(i){if(i.content&&i.content.render)return i.content.render;if(i.render&&typeof i.render=="function")return i.render}function Ri(i){const e=document.createElement("div");e.style.display="contents";const t=n.createApp({setup(o,r){n.onUnmounted(()=>{document.body.removeChild(e)});const s=n.ref(),a=n.ref(i.class||""),d=n.ref(!!i.showButtons),l=n.ref(!!i.showHeader),c=n.ref(i.showCloseButton==null?!0:i.showCloseButton),u=n.ref(!0),f=n.ref(i.title||""),m=i.acceptCallback||(()=>{}),g=i.rejectCallback||(()=>{}),y=i.closedCallback||(B=>{}),S=i.resizeHandle||(B=>{}),v=i.stopMoveHandle||(B=>{}),C=Kt(i),j=B=>{u.value=!1,t.unmount(),y(B)};return n.onMounted(()=>{}),r.expose({modalRef:s}),()=>n.createVNode(Ke,{ref:s,class:a.value,modelValue:u.value,"onUpdate:modelValue":B=>u.value=B,title:f.value,width:i.width,height:i.height,buttons:i.buttons,"show-header":l.value,"show-buttons":d.value,"show-close-button":c.value,"show-max-button":!1,onAccept:m,onCancel:g,fitContent:i.fitContent==null?!0:i.fitContent,onClosed:j,onResize:S,onStopMove:v},{default:()=>[C&&C(t)]})}});return document.body.appendChild(e),t.mount(e),t}class en{constructor(e){oe(this,"appContext",null);oe(this,"modalRef",n.ref());oe(this,"activeModalIndex",n.ref(0));oe(this,"modalRefs",{});oe(this,"isUseEscCloseModal",n.ref(!1));oe(this,"activeModalInstance",n.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=e,this.appContext=e?e._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(e,t){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<e&&(e=o-14),r<t&&(t=r-14),{width:e,height:t}}static show(e){const t=Object.assign({title:"",showButtons:!0,showHeader:!0},e);return Ri(t)}close(e){var t,o;e?(o=e.value)==null||o.close():(t=this.getCurrentModal())==null||t.close()}open(e){const t=document.createDocumentFragment();e.showMaxButton&&e.fitContent&&(e.showMaxButton=!1);const o=n.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},e)),r=n.ref(!0),s=o.value.acceptCallback||(()=>{}),a=o.value.rejectCallback||(()=>{}),d=o.value.closedCallback||((b,T)=>{}),l=o.value.resizeHandle||(b=>{}),c=e.stopMoveHandle||(b=>{});let u;const f=Kt(o.value),m=b=>{var F;r.value=!1;const T=(F=b==null?void 0:b.target)==null?void 0:F.classList.contains("modal_close");d(b,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},g=b=>{m(b),u&&n.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],n.render(null,t),u=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs).map(F=>Number(F));T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},y=b=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(b==null?void 0:b.event))},{width:S,height:v}=o.value,C=this.adaptToWindow(S||500,v||320);Object.assign(o.value,C);const j=()=>n.createVNode(Ke,n.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b},o.value,{onAccept:s,onCancel:a,onClosed:g,onResize:l,onEsc:y,onStopMove:c}),{default:()=>[f&&f(this.app)]});return u=(b=>{const T=n.h(j,b);return T.appContext=this.appContext,n.render(T,t),T})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:b=>{o.value={...o.value,...b},u&&n.render(n.cloneVNode(u,{...o}),t)},destroy:g,modalRef:this.activeModalInstance,close:()=>this.close()}}}const $i=Symbol("FModalService");Ke.install=i=>{i.component(Ke.name,Ke);const e=new en(i);i.provide($i,e),i.provide("FModalService",e)};class Be{static show(e){const t=n.reactive({...e}),o=!1,r=t.type==="error"||t.type==="prompt",s=t.type==="error"?"错误提示":t.type==="prompt"&&t.title||"",a=t.acceptCallback||(()=>{}),d=t.rejectCallback||(()=>{});let l=null,c=new en(l);const u=()=>{l&&(l==null||l.destroy(),c=null)};return l=c==null?void 0:c.open({class:"modal-message modal-message-type-info",title:s,showButtons:o,showHeader:r,width:t.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>n.createVNode(ct,n.mergeProps(t,{onAccept:a,onReject:d,onClose:u}),null)}),c==null?void 0:c.getCurrentModal()}static info(e,t){const o=n.reactive({type:"info",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(o)}static warning(e,t){const o=n.reactive({type:"warning",title:e,detail:t,okButtonText:"知道了",cancelButtonText:""});Be.show(o)}static success(e,t){const o=n.reactive({type:"success",title:e,detail:t,okButtonText:"关闭",cancelButtonText:""});Be.show(o)}static error(e,t,o){const r=n.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:e,detail:t}});Be.show(r)}static prompt(e,t){const o=n.reactive({type:"prompt",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消"});Be.show(o)}static question(e,t,o,r){const s=n.reactive({type:"question",title:e,detail:t,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});Be.show(s)}}ct.install=i=>{i.component(ct.name,ct),i.provide("FMessageBoxService",Be)};const qi=n.defineComponent({name:"FEntityBindingSelector",props:_o,emits:["submit","cancel"],setup(i,e){const t=Zo(i),{entityColumns:o,entityTreeGridRef:r,entityDataSource:s,checkAndGetSelectedEntity:a,resolveEntityDataSource:d,entityTreeRowOption:l,initialSelectedEntity:c,isMainEntityInitialSelected:u}=t,f=_t(i),{fieldColumns:m,resolveFieldDataSource:g,fieldDataSource:y,fieldTreeGridRef:S,fieldTreeRowOption:v,fieldSelectionOption:C,checkAndGetSelectedFields:j,currentComponentType:B}=f,N=new lt;N.globalConfig={position:"top-center"};const b=[{name:"卡片面板",value:"response-form"},{name:"表格",value:"data-grid"}],T=n.ref(),F=n.ref(""),p=n.ref([{id:"selectComponentType",title:"选择组件类型"},{id:"selectEntity",title:"选择实体"},{id:"selectFields",title:"选择显示字段"}]),w=n.ref(0),V=n.ref(""),h=n.computed(()=>Q=>({"f-utils-fill":!0,border:Q!=="selectComponentType","mx-3":!0,"my-2":!0,"position-relative":!0,"d-none":p.value[w.value].id!==Q}));function M(){i.bindingEntityId&&(c!=null&&c.value)&&(F.value=c.value.name),i.componentType||(T.value=u.value?"response-form":"data-grid")}function H(){const Q=a();Q&&(g(Q),S.value.updateDataSource(y.value))}n.onBeforeMount(()=>{i.steps&&(p.value=p.value.filter(Q=>i.steps.includes(Q.id))),V.value=p.value[0].id,d(),M()}),n.onMounted(()=>{var Q,ae;r&&((Q=c.value)!=null&&Q.id)&&r.value.selectItemById((ae=c.value)==null?void 0:ae.id),p.value.length===1&&p.value[0].id==="selectFields"&&H()});function E(Q){var ae;(ae=S==null?void 0:S.value)!=null&&ae.clearSelection&&S.value.clearSelection()}function P(){return n.createVNode(xt,{key:1,ref:r,fit:!0,data:s.value,idField:"id",columns:o.value,rowNumber:{enable:!1},"row-option":l,columnOption:{fitColumns:!0}},null)}function W(){return n.createVNode(xt,{key:2,ref:S,hierarchy:{cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}},fit:!0,data:y.value,idField:"id",columns:m.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},"row-option":v,selection:C},null)}function K(){const Q={editable:!1,type:"combo-list",data:b,idField:"value",valueField:"value",textField:"name"},ae={type:"input-group",enableClear:!1};return n.createVNode("div",null,[n.createVNode("div",{class:"f-utils-fill"},[n.createVNode("div",{class:"f-section py-0"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode("组件信息")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode(Qt,{label:"组件类型",customClass:"col-12",modelValue:T.value,"onUpdate:modelValue":ye=>T.value=ye,required:"true",editor:Q,onChange:E},null),n.createVNode(Qt,{label:"组件标题",customClass:"col-12",modelValue:F.value,"onUpdate:modelValue":ye=>F.value=ye,required:"true",editor:ae},null)])])])])])}function O(){w.value--,V.value=p.value[w.value].id}function q(){var Q;switch(V.value){case"selectEntity":{H();break}case"selectComponentType":{if(!T.value){N.warning("请先选择组件类型");return}if(!((Q=F.value)!=null&&Q.trim())){N.warning("请先填写组件标题");return}B.value=T.value,g(c.value),S.value.updateDataSource(y.value);break}}w.value++,V.value=p.value[w.value].id}function J(){e.emit("cancel")}function G(){var ye;const Q=a(),ae=j();if(Q&&ae){const Z={bindingType:"entity"};Z.bindingEntity=Q,Z.bindTo=t.entityBindToMap.get(((ye=Z.bindingEntity)==null?void 0:ye.label)||""),Z.bindingEntityFields=ae,Z.entityTitle=F.value,e.emit("submit",{bindingContext:Z,componentType:T.value})}}return()=>{var Q;return n.createVNode("div",{class:"h-100 d-flex flex-column"},[((Q=p.value)==null?void 0:Q.length)>1?n.createVNode(oi,{steps:p,activeIndex:w,style:"align-self:center"},null):"",n.createVNode("div",{class:h.value("selectEntity"),style:"border-radius:10px;"},[P()]),n.createVNode("div",{class:h.value("selectComponentType"),style:"border-radius:10px;"},[K()]),n.createVNode("div",{class:h.value("selectFields"),style:"border-radius:10px;"},[W()]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{class:"btn btn-secondary",onClick:J},[n.createTextVNode("取消")]),w.value!==0?n.createVNode("button",{class:"btn btn-secondary",onClick:O},[n.createTextVNode("上一步")]):"",w.value!==p.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:q},[n.createTextVNode("下一步")]):"",w.value===p.value.length-1?n.createVNode("button",{class:"btn btn-primary",onClick:G},[n.createTextVNode("确定")]):""])])}}});function Li(i,e){let t;function o(l){var y,S,v,C,j,B;const c=(S=(y=i.parent)==null?void 0:y.parent)==null?void 0:S.componentInstance;if(!((j=(C=(v=c==null?void 0:c.value)==null?void 0:v.schema)==null?void 0:C.contents)!=null&&j.length))return;const u={componentType:"response-form",bindingSourceContext:l,parentComponentInstance:c.value},f=c.value.addNewChildComponentSchema(u,e),m=(B=i.parent)==null?void 0:B.schema,g=c.value.schema.contents.findIndex(N=>N.id===(m==null?void 0:m.id));g>-1&&c.value.schema.contents.splice(g+1,0,f)}function r(l){var c,u;o(l.bindingContext),(c=t==null?void 0:t.modalRef)!=null&&c.value.close&&((u=t==null?void 0:t.modalRef)==null||u.value.close())}function s(){var l,c;(l=t==null?void 0:t.modalRef)!=null&&l.value.close&&((c=t==null?void 0:t.modalRef)==null||c.value.close())}function a(){if(!e)return;const{schemaService:l,formSchemaUtils:c}=e,{componentType:u}=i.schema,f=c.getViewModelIdByComponentId(i.componentInstance.value.belongedComponentId),m=l.getTableInfoByViewModelId(f),g=m==null?void 0:m.id,y=["selectFields"];return()=>n.createVNode(n.Fragment,null,[n.createVNode(qi,{componentType:u,bindingEntityId:g,steps:y,designerHostService:e,onSubmit:r,onCancel:s},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function d(l){l.stopPropagation(),l.preventDefault(),e&&(t=e.modalService.open({title:"添加卡片",width:800,height:600,fitContent:!1,showButtons:!1,render:a(),enableEsc:!1,draggable:!0}))}return{addSiblingComponent:d}}const Ai={componentId:{type:String,default:""},designerHostService:{type:Object,default:{}}};var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ui={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(){return function(){function t(o,r,s){function a(c,u){if(!r[c]){if(!o[c]){var f=typeof dt=="function"&&dt;if(!u&&f)return f(c,!0);if(d)return d(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var g=r[c]={exports:{}};o[c][0].call(g.exports,function(y){var S=o[c][1][y];return a(S||y)},g,g.exports,t,o,r,s)}return r[c].exports}for(var d=typeof dt=="function"&&dt,l=0;l<s.length;l++)a(s[l]);return a}return t}()({1:[function(t,o,r){var s={},a="(?:^|\\s)",d="(?:\\s|$)";function l(f){var m=s[f];return m?m.lastIndex=0:s[f]=m=new RegExp(a+f+d,"g"),m}function c(f,m){var g=f.className;g.length?l(m).test(g)||(f.className+=" "+m):f.className=m}function u(f,m){f.className=f.className.replace(l(m)," ").trim()}o.exports={add:c,rm:u}},{}],2:[function(t,o,r){(function(s){var a=t("contra/emitter"),d=t("crossvent"),l=t("./classes"),c=document,u=c.documentElement;function f(h,M){var H=arguments.length;H===1&&Array.isArray(h)===!1&&(M=h,h=[]);var E,P,W,K,O,q,J,G,Q,ae=null,ye,Z,we=!1,Ce=0,ce,_=M||{};_.moves===void 0&&(_.moves=j),_.accepts===void 0&&(_.accepts=j),_.invalid===void 0&&(_.invalid=tt),_.containers===void 0&&(_.containers=h||[]),_.isContainer===void 0&&(_.isContainer=C),_.copy===void 0&&(_.copy=!1),_.copySortSource===void 0&&(_.copySortSource=!1),_.revertOnSpill===void 0&&(_.revertOnSpill=!1),_.removeOnSpill===void 0&&(_.removeOnSpill=!1),_.direction===void 0&&(_.direction="vertical"),_.ignoreInputTextSelection===void 0&&(_.ignoreInputTextSelection=!0),_.mirrorContainer===void 0&&(_.mirrorContainer=c.body);var se=a({containers:_.containers,start:et,end:Xe,cancel:xe,remove:de,destroy:De,canMove:We,dragging:!1});return _.removeOnSpill===!0&&se.on("over",Nt).on("out",it),_e(),se;function pe(x){return se.containers.indexOf(x)!==-1||_.isContainer(x)}function _e(x){var D=x?"remove":"add";y(u,D,"mousedown",Le),y(u,D,"mouseup",k)}function Oe(x){var D=x?"remove":"add";y(u,D,"mousemove",$e)}function Pe(x){var D=x?"remove":"add";d[D](u,"selectstart",Re),d[D](u,"click",Re)}function De(){_e(!0),k({})}function Re(x){ye&&x.preventDefault()}function Le(x){K=x.clientX,O=x.clientY;var D=S(x)!==1||x.metaKey||x.ctrlKey;if(!D){var z=x.target,X=Me(z);X&&(ye=X,Oe(),x.type==="mousedown"&&(T(z)?z.focus():x.preventDefault()))}}function $e(x){if(ye){if(S(x)===0){k({});return}if(!(x.clientX!==void 0&&Math.abs(x.clientX-K)<=(_.slideFactorX||0)&&x.clientY!==void 0&&Math.abs(x.clientY-O)<=(_.slideFactorY||0))){if(_.ignoreInputTextSelection){var D=V("clientX",x)||0,z=V("clientY",x)||0,X=c.elementFromPoint(D,z);if(T(X))return}var ie=ye;Oe(!0),Pe(),Xe(),Ye(ie),l.add(G||W,"gu-transit"),Et(),Mt(),Ce=0,ot(x)}}}function Me(x){if(!(se.dragging&&E)&&!pe(x)){for(var D=x;b(x)&&pe(b(x))===!1;)if(_.invalid(x,D)||(x=b(x),!x))return;var z=b(x);if(z&&!_.invalid(x,D)){var X=_.moves(x,z,D,p(x));if(X)return{item:x,source:z}}}}function We(x){return!!Me(x)}function et(x){var D=Me(x);D&&Ye(D)}function Ye(x){Dt(x.item,x.source)&&(G=x.item.cloneNode(!0),se.emit("cloned",G,x.item,"copy")),P=x.source,W=x.item,q=J=p(x.item),se.dragging=!0,se.emit("drag",W,P)}function tt(){return!1}function Xe(){if(se.dragging){var x=G||W;te(x,b(x))}}function Je(){ye=!1,Oe(!0),Pe(!0)}function k(x){if(Je(),!!se.dragging){var D=G||W,z=V("clientX",x)||0,X=V("clientY",x)||0,ie=v(E,z,X),re=ut(ie,z,X);re&&(G&&_.copySortSource||!G||re!==P)?te(D,re):_.removeOnSpill?de():xe()}}function te(x,D){var z=b(x);G&&_.copySortSource&&D===P&&z.removeChild(W),nt(D)?se.emit("cancel",x,P):se.emit("drop",x,D,P,J),ke()}function de(){if(se.dragging){var x=G||W,D=b(x);D&&D.removeChild(x),se.emit(G?"cancel":"remove",x,D,P),ke()}}function xe(x){if(se.dragging){var D=arguments.length>0?x:_.revertOnSpill,z=G||W,X=b(z),ie=nt(X);ie===!1&&D&&(G?X&&X.removeChild(G):P.insertBefore(z,q)),ie||D?se.emit("cancel",z,P,P):se.emit("drop",z,X,P,J),ke()}}function ke(){var x=G||W;Je(),It(),kt(),x&&l.rm(x,"gu-transit"),Q&&clearTimeout(Q),se.dragging=!1,ae&&se.emit("out",x,ae,P),se.emit("dragend",x,Ce),P=W=G=q=J=Q=ae=null}function nt(x,D){var z;return D!==void 0?z=D:E?z=J:z=p(G||W),x===P&&z===q}function ut(x,D,z){for(var X=x;X&&!ie();)X=b(X);return X;function ie(){var re=pe(X);if(re===!1)return!1;var Fe=pt(X,x),ve=mt(X,Fe,D,z),Se=nt(X,ve);return Se?!0:_.accepts(W,X,P,ve)}}function ot(x){if(!E)return;x.preventDefault();var D=V("clientX",x)||0,z=V("clientY",x)||0;E.style.left=D-2+"px",E.style.top=z-2+"px";var X=G||W,ie=v(E,D,z),re=ut(ie,D,z),Fe=re!==null&&re!==ae;(Fe||re===null)&&(be(),ae=re,Ie()),Pt(ie,z);var ve=b(X);if(re===P&&G&&!_.copySortSource){ve&&ve.removeChild(X);return}var Se,Ee=pt(re,ie);if(we=Bt(Ee,re),Ee!==null)Se=mt(re,Ee,D,z);else if(_.revertOnSpill===!0&&!G)Se=q,re=P;else{G&&ve&&ve.removeChild(X),G&&Z&&(Z.style.display="none");return}Z.style.display="block",Vt(Se,X,Fe),Se?jt(Ee,Se):Ot(re);function fe(me){se.emit(me,X,ae,P)}function Ie(){Fe&&fe("over")}function be(){ae&&fe("out")}}function Vt(x,D,z){(x===D||x===p(D))&&(J=p(D)),(x===null&&z||x!==D&&x!==p(D))&&(J=x)}function Nt(x){l.rm(x,"gu-hide")}function it(x){se.dragging&&l.add(x,"gu-hide")}function Mt(){E||(E=document.createElement("div"),E.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;",E.innerHTML=_.getMirrorText&&_.getMirrorText(W)||"控件",l.add(E,"gu-mirror"),_.mirrorContainer.appendChild(E),y(u,"add","mousemove",ot),l.add(_.mirrorContainer,"gu-unselectable"),se.emit("cloned",E,W,"mirror"))}function Et(){if(Z=document.createElement("div"),l.add(Z,"gu-insertion"),W){var x=W.getBoundingClientRect();Z.style.left=x.left+"px",Z.style.top=x.top+"px"}we=!1,_.mirrorContainer.appendChild(Z)}function It(){E&&(l.rm(_.mirrorContainer,"gu-unselectable"),y(u,"remove","mousemove",ot),b(E).removeChild(E),E=null)}function kt(){Z&&(b(Z).removeChild(Z),Z=null)}function pt(x,D){for(var z=D;z!==x&&b(z)!==x;)z=b(z);return z===u?null:z}function Bt(x,D){if(!D)return we;var z=x||D&&D.lastElementChild;if(!z)return!0;var X=getComputedStyle(x),ie=/^inline/.test(X.getPropertyValue("display"))||/^(left|right)$/.test(X.getPropertyValue("float"));if(ie)return!0;if(D){var re=getComputedStyle(D),Fe=re.getPropertyValue("display");if(/flex$/.test(Fe)){var ve=re.getPropertyValue("flex-direction")||"row";if(ve==="row"||ve==="row-reverse")return!ft(D)}return!1}return!0}function ft(x){if(!x.children||!x.children.length)return!1;for(const D of Array.from(x.children)){const X=(D.className&&D.className.split(" ")||[]).filter(ie=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ie));if(!X.length)return!1;for(const ie of X){const re=ie.slice(ie.lastIndexOf("-")+1);if(parseInt(re,10)!==12)return!1}}return!0}function jt(x,D){const z=D.getBoundingClientRect();if(Z.style.left=z.left+"px",Z.style.top=z.top+"px",we){if(Z.style.height=z.height+"px",Z.style.width="4px",x){const X=x.getBoundingClientRect();X.top!==z.top&&(Z.style.left=X.right+"px",Z.style.top=X.top+"px",Z.style.height=X.height+"px")}}else if(Z.style.height="4px",Z.style.width=z.width+"px",ce){const X=ce.getBoundingClientRect();z.top<X.top&&(Z.style.display="none")}D===W&&W&&(Z.style.display="none")}function Ot(x){J=null;var D=x.lastElementChild;if(D){var z=D.getBoundingClientRect();we?(Z.style.left=z.right+"px",Z.style.top=z.top+"px",Z.style.height=z.height+"px",Z.style.width="4px"):(Z.style.left=z.left+"px",Z.style.top=z.bottom+"px",Z.style.height="4px",Z.style.width=z.width+"px"),D===W&&W&&(Z.style.display="none")}else Z.style.display="none"}function Pt(x,D){if(!_.mirrorContainer.contains(x)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ce=m(x),!ce||!ce.contains(x)))return;const z=document.querySelector(".dgComponentSelected"),X=ce.getBoundingClientRect();if(D-30<X.top&&ce.scrollTop>0){let ie=ce.scrollTop<10?ce.scrollTop:10;ce.scrollBy(0,-1*ie),z&&ce.contains(z)&&(Ce=Ce+-1*ie)}if(D+30>X.bottom&&ce.scrollTop<ce.scrollHeight-ce.clientHeight){const ie=ce.scrollHeight-ce.clientHeight-ce.scrollTop;let re=ie<10?ie:10;ce.scrollBy(0,re),z&&ce.contains(z)&&(Ce=Ce+re)}}function mt(x,D,z,X){var ie=_.direction==="horizontal",re=_.direction==="mixed",Fe=D!==x?Se():ve();return Fe;function ve(){var fe=x.children.length,Ie,be,me;for(Ie=0;Ie<fe;Ie++)if(be=x.children[Ie],me=be.getBoundingClientRect(),ie&&me.left+me.width/2>z||!re&&!ie&&me.top+me.height/2>X||re&&me.left+me.width>z&&me.top+me.height>X)return be;return null}function Se(){var fe=D.getBoundingClientRect();if(re){var Ie=X-fe.top,be=z-fe.left,me=fe.bottom-X,Y=fe.right-z,ee=Math.min(be,Y,Ie,me),ge;return we?ge=Y<be:ge=me===ee||Y===ee||be===ee,Ee(ge)}return Ee(ie?z>fe.left+B(fe)/2:X>fe.top+N(fe)/2)}function Ee(fe){return fe?p(D):D}}function Dt(x,D){return typeof _.copy=="boolean"?_.copy:_.copy(x,D)}}function m(h){const M=Array.from(window.scrollContainerList);if(M.length===1){const E=Array.from(window.scrollContainerList)[0];return document.getElementById(E)}const H=g(M);for(const E of H)if(E.contains(h))return E;return null}function g(h){const M=[];return h.forEach(H=>{const E=document.getElementById(H);E&&M.push(E)}),M.sort((H,E)=>H.contains(E)?1:E.contains(H)?-1:0),M}function y(h,M,H,E){var P={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},W={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},K={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?d[M](h,W[H],E):s.navigator.msPointerEnabled?d[M](h,K[H],E):(d[M](h,P[H],E),d[M](h,H,E))}function S(h){if(h.touches!==void 0)return h.touches.length;if(h.which!==void 0&&h.which!==0)return h.which;if(h.buttons!==void 0)return h.buttons;var M=h.button;if(M!==void 0)return M&1?1:M&2?3:M&4?2:0}function v(h,M,H){h=h||{};var E=h.className||"",P;return h.className+=" gu-hide",P=c.elementFromPoint(M,H),h.className=E,P}function C(){return!1}function j(){return!0}function B(h){return h.width||h.right-h.left}function N(h){return h.height||h.bottom-h.top}function b(h){return h.parentNode===c?null:h.parentNode}function T(h){return h.tagName==="INPUT"||h.tagName==="TEXTAREA"||h.tagName==="SELECT"||F(h)}function F(h){return!h||h.contentEditable==="false"?!1:h.contentEditable==="true"?!0:F(b(h))}function p(h){return h.nextElementSibling||M();function M(){var H=h;do H=H.nextSibling;while(H&&H.nodeType!==1);return H}}function w(h){return h.targetTouches&&h.targetTouches.length?h.targetTouches[0]:h.changedTouches&&h.changedTouches.length?h.changedTouches[0]:h}function V(h,M){var H=w(M),E={pageX:"clientX",pageY:"clientY"};return h in E&&!(h in H)&&E[h]in H&&(h=E[h]),H[h]}o.exports=f}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,o,r){o.exports=function(a,d){return Array.prototype.slice.call(a,d)}},{}],4:[function(t,o,r){var s=t("ticky");o.exports=function(d,l,c){d&&s(function(){d.apply(c||null,l||[])})}},{ticky:10}],5:[function(t,o,r){var s=t("atoa"),a=t("./debounce");o.exports=function(l,c){var u=c||{},f={};return l===void 0&&(l={}),l.on=function(m,g){return f[m]?f[m].push(g):f[m]=[g],l},l.once=function(m,g){return g._once=!0,l.on(m,g),l},l.off=function(m,g){var y=arguments.length;if(y===1)delete f[m];else if(y===0)f={};else{var S=f[m];if(!S)return l;S.splice(S.indexOf(g),1)}return l},l.emit=function(){var m=s(arguments);return l.emitterSnapshot(m.shift()).apply(this,m)},l.emitterSnapshot=function(m){var g=(f[m]||[]).slice(0);return function(){var y=s(arguments),S=this||l;if(m==="error"&&u.throws!==!1&&!g.length)throw y.length===1?y[0]:y;return g.forEach(function(C){u.async?a(C,y,S):C.apply(S,y),C._once&&l.off(m,C)}),l}},l}},{"./debounce":4,atoa:3}],6:[function(t,o,r){(function(s){var a=t("custom-event"),d=t("./eventmap"),l=s.document,c=m,u=y,f=[];s.addEventListener||(c=g,u=S),o.exports={add:c,remove:u,fabricate:v};function m(b,T,F,p){return b.addEventListener(T,F,p)}function g(b,T,F){return b.attachEvent("on"+T,j(b,T,F))}function y(b,T,F,p){return b.removeEventListener(T,F,p)}function S(b,T,F){var p=B(b,T,F);if(p)return b.detachEvent("on"+T,p)}function v(b,T,F){var p=d.indexOf(T)===-1?V():w();b.dispatchEvent?b.dispatchEvent(p):b.fireEvent("on"+T,p);function w(){var h;return l.createEvent?(h=l.createEvent("Event"),h.initEvent(T,!0,!0)):l.createEventObject&&(h=l.createEventObject()),h}function V(){return new a(T,{detail:F})}}function C(b,T,F){return function(w){var V=w||s.event;V.target=V.target||V.srcElement,V.preventDefault=V.preventDefault||function(){V.returnValue=!1},V.stopPropagation=V.stopPropagation||function(){V.cancelBubble=!0},V.which=V.which||V.keyCode,F.call(b,V)}}function j(b,T,F){var p=B(b,T,F)||C(b,T,F);return f.push({wrapper:p,element:b,type:T,fn:F}),p}function B(b,T,F){var p=N(b,T,F);if(p){var w=f[p].wrapper;return f.splice(p,1),w}}function N(b,T,F){var p,w;for(p=0;p<f.length;p++)if(w=f[p],w.element===b&&w.type===T&&w.fn===F)return p}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,o,r){(function(s){var a=[],d="",l=/^on/;for(d in s)l.test(d)&&a.push(d.slice(2));o.exports=a}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,o,r){(function(s){var a=s.CustomEvent;function d(){try{var l=new a("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch{}return!1}o.exports=d()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(c,u){var f=document.createEvent("CustomEvent");return u?f.initCustomEvent(c,u.bubbles,u.cancelable,u.detail):f.initCustomEvent(c,!1,!1,void 0),f}:function(c,u){var f=document.createEventObject();return f.type=c,u?(f.bubbles=!!u.bubbles,f.cancelable=!!u.cancelable,f.detail=u.detail):(f.bubbles=!1,f.cancelable=!1,f.detail=void 0),f}}).call(this,typeof je<"u"?je:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,o,r){var s=o.exports={},a,d;function l(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=l}catch{a=l}try{typeof clearTimeout=="function"?d=clearTimeout:d=c}catch{d=c}})();function u(N){if(a===setTimeout)return setTimeout(N,0);if((a===l||!a)&&setTimeout)return a=setTimeout,setTimeout(N,0);try{return a(N,0)}catch{try{return a.call(null,N,0)}catch{return a.call(this,N,0)}}}function f(N){if(d===clearTimeout)return clearTimeout(N);if((d===c||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(N);try{return d(N)}catch{try{return d.call(null,N)}catch{return d.call(this,N)}}}var m=[],g=!1,y,S=-1;function v(){!g||!y||(g=!1,y.length?m=y.concat(m):S=-1,m.length&&C())}function C(){if(!g){var N=u(v);g=!0;for(var b=m.length;b;){for(y=m,m=[];++S<b;)y&&y[S].run();S=-1,b=m.length}y=null,g=!1,f(N)}}s.nextTick=function(N){var b=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)b[T-1]=arguments[T];m.push(new j(N,b)),m.length===1&&!g&&u(C)};function j(N,b){this.fun=N,this.array=b}j.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(N){return[]},s.binding=function(N){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(N){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(t,o,r){(function(s){var a=typeof s=="function",d;a?d=function(l){s(l)}:d=function(l){setTimeout(l,0)},o.exports=d}).call(this,t("timers").setImmediate)},{timers:11}],11:[function(t,o,r){(function(s,a){var d=t("process/browser.js").nextTick,l=Function.prototype.apply,c=Array.prototype.slice,u={},f=0;r.setTimeout=function(){return new m(l.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new m(l.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(g){g.close()};function m(g,y){this._id=g,this._clearFn=y}m.prototype.unref=m.prototype.ref=function(){},m.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(g,y){clearTimeout(g._idleTimeoutId),g._idleTimeout=y},r.unenroll=function(g){clearTimeout(g._idleTimeoutId),g._idleTimeout=-1},r._unrefActive=r.active=function(g){clearTimeout(g._idleTimeoutId);var y=g._idleTimeout;y>=0&&(g._idleTimeoutId=setTimeout(function(){g._onTimeout&&g._onTimeout()},y))},r.setImmediate=typeof s=="function"?s:function(g){var y=f++,S=arguments.length<2?!1:c.call(arguments,1);return u[y]=!0,d(function(){u[y]&&(S?g.apply(null,S):g.call(null),r.clearImmediate(y))}),y},r.clearImmediate=typeof a=="function"?a:function(g){delete u[g]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ui);const He=class He{static getEditorTypesByMDataType(e,t=""){let o=He.fieldControlTypeMapping[e];if(t==="data-grid-column"&&(o!=null&&o.length)){const r=[U["check-group"].type,U["radio-group"].type];o=o.filter(s=>!r.includes(s.key))}return o}static getAllInputTypes(){const e=[];for(const t in He.fieldControlTypeMapping)He.fieldControlTypeMapping[t].forEach(o=>{e.find(r=>r.key===o.key&&r.value===o.value)||e.push({key:o.key,value:o.value})});return e}static mappingDomPropAndSchemaProp(e,t){var s;const o=(s=e.editor)==null?void 0:s.type,r=[];return(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&t&&t.categoryId&&t.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===U["input-group"].type||o===U.textarea.type||o===U["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===U["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===U["combo-list"].type||o===U["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===U["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===U["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===U.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(e.type===U["data-grid-column"].type||e.type===U["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};oe(He,"fieldControlTypeMapping",{String:[{key:U["input-group"].type,value:U["input-group"].name},{key:U.lookup.type,value:U.lookup.name},{key:U["date-picker"].type,value:U["date-picker"].name},{key:U["check-group"].type,value:U["check-group"].name},{key:U["radio-group"].type,value:U["radio-group"].name},{key:U["combo-list"].type,value:U["combo-list"].name},{key:U.textarea.type,value:U.textarea.name},{key:U["time-picker"].type,value:U["time-picker"].name}],Text:[{key:U.textarea.type,value:U.textarea.name},{key:U.lookup.type,value:U.lookup.name}],Decimal:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Integer:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Number:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],BigNumber:[{key:U["number-spinner"].type,value:U["number-spinner"].name}],Date:[{key:U["date-picker"].type,value:U["date-picker"].name}],DateTime:[{key:U["date-picker"].type,value:U["date-picker"].name}],Boolean:[{key:U.switch.type,value:U.switch.name},{key:U["check-box"].type,value:U["check-box"].name}],Enum:[{key:U["combo-list"].type,value:U["combo-list"].name},{key:U["radio-group"].type,value:U["radio-group"].name}],Object:[{key:U.lookup.type,value:U.lookup.name},{key:U["combo-list"].type,value:U["combo-list"].name},{key:U["radio-group"].type,value:U["radio-group"].name}]});let tn=He;var Ft=(i=>(i.Form="Form",i.Variable="Variable",i))(Ft||{});class zi{constructor(e,t){oe(this,"controlsInfo",{});oe(this,"formSchemaUtils");oe(this,"designViewModelUtils");oe(this,"viewModelId","");this.designerHostService=e,this.componentId=t,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils,this.viewModelId=this.formSchemaUtils.getViewModelIdByComponentId(this.componentId)}buildFieldTreeData(){const e=this.designViewModelUtils.getDgViewModel(this.viewModelId);if(!e)return[];const t=this.formSchemaUtils.getComponentById(this.componentId);if(!t)return[];const{componentType:o}=t,r=e.fields;if(o==="data-grid"||o==="form"){const s=this.getAllControlsInComponents(t);return this.controlsInfo.controls=s,this.buildFieldTreeDataByControls(r,s,o)}return[]}getAllControlsInComponents(e){const t=[],o=this.getFormLayoutInCmp(e.contents);if(this.controlsInfo.formLayout=o,o){const r=o.columns||o.contents;this.getAllControlsInLayout(r,t)}return t}buildFieldTreeDataByControls(e,t,o){const r=[],s=new Map,a=[];return t.forEach(d=>{if(d.type===U.fieldset.type){a.push(d);return}const l=this.buildFieldTreeNodeFromControl(d,e,this.componentId,o);if(l)if(l.isInGroupNode){if(!s.has(l.groupId)){const u=this.buildFieldTreeGroupNodeWithBindingEntityField(d,e,a);u&&(s.set(l.groupId,u),r.push(u))}const c=s.get(l.groupId);c!=null&&c.children&&c.children.push(l)}else r.push(l)}),r}buildFieldTreeNodeFromControl(e,t,o,r){let s;return e.binding?e.binding.type===Ft.Variable?s=this.buildFieldTreeNodeWithBindingVariable(e):s=this.buildFieldTreeNodeWithBindingEntityField(e,t,o,r):s=this.buildFieldTreeNodeWithoutControlBinding(e),s}buildFieldTreeNodeWithoutControlBinding(e){return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:e.id,name:e.title||e.text||e.label},groupId:"",expanded:!1,isBindVariable:!1,isComplexField:!1,isGroupNode:!1,isInGroupNode:!1,isNoBinding:!0,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingVariable(e){const t=e.binding.field,o=this.formSchemaUtils.getVariableById(t),r=this.formSchemaUtils.getViewModelById(this.viewModelId),s=r==null?void 0:r.fields.find(d=>d.id===t),a=s&&s.groupId;return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:e,data:{id:t,name:e.title||e.text||e.label,code:e.binding.fullPath||e.binding.path,controlType:e.type,type:o&&o.type,category:o&&o.category},groupId:a,expanded:!1,isBindVariable:!0,isComplexField:!1,isInGroupNode:!!a,isGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:""}}buildFieldTreeNodeWithBindingEntityField(e,t,o,r){const s=e.binding.field,a=t.find(m=>m.id===s);if(!a)return;const{groupId:d}=a,l=a.isSchemaRemoved?{id:s,name:e.title||e.text||e.label}:a,c=a.isSchemaRemoved,u=!a.isSchemaRemoved,f=a.$type==="ComplexField";return{canChangeControlType:u,children:[],componentId:o,componentType:r,control:e,data:l,expanded:!1,groupId:d,isBindVariable:!1,isComplexField:f,isGroupNode:!1,isInGroupNode:!!d,isNoBinding:!1,isRemoved:!!c,nodeType:"field"}}buildFieldTreeGroupNodeWithBindingEntityField(e,t,o){const r=e.binding.field;if(e.binding.type===Ft.Form){const s=t.find(c=>c.id===r);if(!s)return;const{groupId:a,groupName:d}=s,l=o.find(c=>c.id===a);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:l,data:{id:a,name:d},groupId:a,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}else{const s=this.formSchemaUtils.getViewModelById(this.viewModelId),a=s==null?void 0:s.fields.find(u=>u.id===r);if(!a)return;const{groupId:d,groupName:l}=a,c=o.find(u=>u.id===d);return{canChangeControlType:!1,children:[],componentId:"",componentType:"",control:c,data:{id:d,name:l},groupId:d,expanded:!0,isBindVariable:!1,isComplexField:!1,isGroupNode:!0,isInGroupNode:!1,isNoBinding:!1,isRemoved:!1,nodeType:"group"}}}getFormLayoutInCmp(e){if(!e)return{};for(const t of e){if([U["data-grid"].type,U["tree-grid"].type,U["response-form"].type].includes(t.type))return t;if(t.contents){const r=this.getFormLayoutInCmp(t.contents);if(r)return r}}return null}getAllControlsInLayout(e,t){if(e)for(const o of e)o.type===U.fieldset.type&&t.push(o),o.contents?this.getAllControlsInLayout(o.contents,t):t.push(o)}}const Gi=n.defineComponent({name:"FSplitterFormComponent",props:Ai,emits:["cancel","submit"],setup(i,e){const t=n.ref(""),o=n.ref(),r=n.ref(i.data),s=n.ref([{field:"name",title:"名称"},{field:"bindingPath",title:"绑定字段"}]),{schemaService:a,formSchemaUtils:d}=i.designerHostService,l=new To.FNotifyService;l.globalConfig={position:"top-center"};const c={enableSelectRow:!0,multiSelect:!0,multiSelectMode:"OnCheckAndClick",showCheckbox:!0,showSelectAll:!0},u={cascadeOption:{autoCheckChildren:!0,autoCheckParent:!0}};n.onBeforeMount(()=>{const y=d.getViewModelIdByComponentId(i.componentId),{name:S}=a.getTableInfoByViewModelId(y);t.value=S;const v=new zi(i.designerHostService,i.componentId);r.value=v.buildFieldTreeData()});function f(){e.emit("cancel")}function m(){if(!t.value){l.warning({message:"请填写组件标题"});return}const y=o.value.getSelectedItems();if(!y.length){l.warning("请选择字段");return}e.emit("submit",{selections:y,componentTitle:t.value})}function g(y,S){const v=S.raw;return n.createVNode(n.Fragment,null,[v.isRemoved?n.createVNode("span",{title:"绑定字段不存在,请在视图模型中手动移除。"},[n.createTextVNode("绑定字段不存在。 ")]):"",v.isBindVariable?n.createVNode("span",null,[n.createTextVNode("变量:"),v.code,n.createTextVNode(" ")]):"",v.isNoBinding?n.createVNode("span",null,[n.createTextVNode("控件没有绑定信息 ")]):"",!v.isRemoved&&!v.isBindVariable&&!v.isComplexField?n.createVNode("span",null,[v.bindingField,n.createTextVNode(" ")]):""])}return()=>n.createVNode("div",{class:"h-100 d-flex flex-column flex-fill"},[n.createVNode("div",{class:"f-section pt-3 pl-4"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode(" 组件信息 ")])])]),n.createVNode("div",{class:"f-section-content"},[n.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[n.createVNode("div",{class:"col-12 farris-group-wrap"},[n.createVNode("div",{class:"form-group farris-form-group"},[n.createVNode("label",{class:"col-form-label",style:"justify-content: start !important; width: 80px !important;"},[n.createVNode("span",{class:"farris-label-info text-danger"},[n.createTextVNode("*")]),n.createVNode("span",{class:"farris-label-text"},[n.createTextVNode(" 组件标题")])]),n.createVNode("div",{class:"farris-input-wrap"},[n.withDirectives(n.createVNode("input",{class:"form-control",type:"input","onUpdate:modelValue":y=>t.value=y},null),[[n.vModelText,t.value]])])])])])])]),n.createVNode("div",{class:"f-section pl-4 f-utils-fill"},[n.createVNode("div",{class:"f-section-header"},[n.createVNode("div",{class:"f-title"},[n.createVNode("h4",{class:"f-title-text"},[n.createTextVNode(" 组件字段 ")])])]),n.createVNode("div",{class:"f-section-content border f-utils-fill"},[n.createVNode(So,{key:1,ref:o,fit:!0,data:r.value,idField:"id",columns:s.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},selection:c,hierarchy:u},{cellTemplate:({cell:y,row:S})=>y.field==="bindingPath"?g(y,S):y.data!=null?y.data.toString():y.data})])]),n.createVNode("div",{class:"modal-footer"},[n.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:f},[n.createTextVNode("取消")]),n.createVNode("button",{type:"button",class:"btn btn-primary",onClick:m},[n.createTextVNode("确定")])])])}});function nn(){function i(){const t=o=>{const r=Math.random()*16|0;return(o==="x"?r:r&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t)}function e(t,o){const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];let a;if(o=o||r.length,t)for(a=0;a<t;a++)s[a]=r[0|Math.random()*o];else{let d;for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",a=0;a<36;a++)s[a]||(d=0|Math.random()*16,s[a]=r[a===19?d&3|8:d])}return s.join("")}return{guid:i,uuid:e}}const Hi=["moz","ms","webkit"];function _i(){let i=0;return e=>{const t=new Date().getTime(),o=Math.max(0,16-(t-i)),r=setTimeout(()=>{e(t+o)},o);return i=t+o,r}}function Wi(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const i=Hi.filter(e=>`${e}RequestAnimationFrame`in window)[0];return i?window[`${i}RequestAnimationFrame`]:_i()}Wi();function Yi(i,e){let t;const o=n.ref(""),r=n.ref([]),s=n.ref([]),a=n.ref([]),d=i.componentInstance.value.belongedComponentId;function l(p){p.forEach(w=>{w.isGroupNode||(w.isNoBinding||s.value.push(w.data.id),r.value.push(w.control))})}function c(p){var E;const w=i.componentInstance.value.schema;let V={};w.contents&&w.contents.length>0&&(V=w.contents.find(P=>P.type===Ge.DgControl.section.type)||{});const h=Object.assign({},V,{id:p+"-section",mainTitle:o.value,appearance:V.appearance?le.cloneDeep(V.appearance):{class:"f-section-form f-section-in-mainsubcard"},contents:[]}),M=((E=V.contents)==null?void 0:E.find(P=>P.type===Ge.DgControl["response-form"].type))||{},H=Ze(Ge.DgControl["response-form"].type);return Object.assign(H,M,{id:p+"-form",appearance:M.appearance?le.cloneDeep(M.appearance):{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r.value}),h.contents=[H],[h]}function u(p){var V;if(!((V=p.states)!=null&&V.length))return[];const w=[];return p.states.forEach(h=>{r.value.forEach(M=>{function H(E){Object.keys(E).forEach(P=>{const W=E[P];if(W&&W.type==="Variable"&&W.field===h.id){let K=w.find(O=>O.id===h.id);K||(K=Object.assign({},h,{newId:nn().guid()}),w.push(K),a.value.push(h.id)),E[P].field=K.newId}})}H(M),M.editor&&H(M.editor)})}),w.map(h=>{h.id=h.newId,delete h.newId}),w}function f(p,w){const V=[];s.value.forEach(M=>{const H=w.fields.find(E=>E.id===M);V.push(Object.assign({},H,{groupId:null,groupName:null}))});const h=u(w);return{id:p+"-viewmodel",code:p+"-viewmodel",name:o.value,bindTo:w.bindTo,parent:w.parent,fields:V,commands:[],states:h,enableValidation:w.enableValidation}}function m(p,w,V){var E;if(!((E=i==null?void 0:i.parent)!=null&&E.parent)||!e)return;const M=i.parent.parent.componentInstance.value.schema;if(!(M!=null&&M.contents))return;const H=M.contents.findIndex(P=>P.component===d);if(H>-1){const{formSchemaUtils:P}=e;P.getComponents().push(p),P.getViewModels().push(V),M.contents.splice(H+1,0,w)}}function g(){if(!e)return;const p=i.componentInstance.value.schema,{schemaService:w,formSchemaUtils:V}=e,h=V.getViewModelIdByComponentId(d),M=V.getViewModelById(h),{code:H}=w.getTableInfoByViewModelId(h),E=H+"-"+Math.random().toString(36).slice(2,6),P=Ze("component-ref");Object.assign(P,{id:E+"-component-ref",component:E+"-component"});const W=f(E,M),K=Ze("component"),O=c(E);return Object.assign(K,{id:E+"-component",viewModel:E+"-viewmodel",componentType:p.componentType,appearance:p.appearance?le.cloneDeep(p.appearance):null,formColumns:p.formColumns,contents:O}),m(K,P,W),W}function y(){if(!e)return;const{formSchemaUtils:p}=e,w=i.componentInstance.value.schema,V=r.value.map(M=>M.id),h=p.selectNode(w,M=>M.type===Ge.DgControl["response-form"].type);h.contents.forEach(M=>{M.type===Ge.DgControl.fieldset.type&&(M.contents=M.contents.filter(H=>!V.includes(H.id)))}),h.contents=h.contents.filter(M=>!(V.includes(M.id)||M.type===Ge.DgControl.fieldset.type&&M.contents&&M.contents.length===0))}function S(){if(!e)return;const{formSchemaUtils:p}=e,w=p.getViewModelIdByComponentId(d),V=p.getViewModelById(w);V&&V.fields&&(V.fields=V.fields.filter(h=>!s.value.includes(h.id)))}function v(p){if(!e)return;const{formSchemaUtils:w}=e,V=nn().guid(),h=Object.assign({},p,{id:V,code:p.code+V.slice(0,4),name:p.name+V.slice(0,4)}),H=w.getCommands().find(E=>E.id===p.cmpId);return H&&H.refedHandlers.push({host:V,handler:p.handlerName}),h}function C(p){if(!e)return;const{formSchemaUtils:w}=e,V=w.getViewModelIdByComponentId(d),h=w.getViewModelById(V),M={};r.value.forEach(E=>{var K;const P=E.type==="form-group"&&E.editor?E.editor.type:E.type,W=(K=ht[P])==null?void 0:K.events;W&&Object.keys(E).forEach(O=>{const q=Object.keys(W).find(J=>J===O);if(q&&E[q]){const J=h.commands.find(G=>G.code===E[q]);if(J){let G=M[J.code];G||(G=v(J),M[J.code]=G,p.commands.push(G)),E[q]=G.code}}})});const H=["valueChanging","valueChanged"];p.fields.forEach(E=>{H.forEach(P=>{if(E[P]){const W=h.commands.find(K=>K.code===E[P]);if(M[W.code])E[P]=M[W.code].code;else{const K=v(W);M[W.code]=K,p.commands.push(K),E[P]=K.code}}})})}function j(p,w,V){if(p&&(w(p,V),p.contents))for(const h of p.contents)j(h,w,V)}function B(){if(!a.value.length)return;const p=e==null?void 0:e.formSchemaUtils,w=p.getComponentById(d),V=[],h=(E,P)=>{E&&(Object.keys(E).forEach(W=>{const K=E[W];K&&typeof K=="object"&&K.type===an.FormBindingType.Variable&&a.value.includes(K.field)&&!P.includes(K.field)&&P.push(K.field)}),E.editor&&h(E.editor,P))};j(w,h,V);const M=p.getViewModelIdByComponentId(d),H=p.getViewModelById(M);a.value.forEach(E=>{V.includes(E)||(H.states=H.states.filter(P=>P.id!==E))})}function N(p){var h,M;const{selections:w}=p;o.value=p.componentTitle,l(w);const V=g();y(),S(),C(V),B(),(h=t==null?void 0:t.modalRef)!=null&&h.value.close&&((M=t==null?void 0:t.modalRef)==null||M.value.close()),Ut.value++,n.nextTick(()=>{At()})}function b(){var p,w;(p=t==null?void 0:t.modalRef)!=null&&p.value.close&&((w=t==null?void 0:t.modalRef)==null||w.value.close())}function T(){if(e)return()=>n.createVNode(n.Fragment,null,[n.createVNode(Gi,{componentId:i.componentInstance.value.belongedComponentId,designerHostService:e,onSubmit:N,onCancel:b},{default:()=>[n.createTextVNode(" ")]}),n.createTextVNode(" ")])}function F(p){p.stopPropagation(),p.preventDefault(),e&&(t=e.modalService.open({title:"拆分卡片",width:900,height:600,fitContent:!1,showButtons:!1,render:T(),enableEsc:!1,draggable:!0}))}return{openSplitComponentModal:F}}function Xi(i,e){const t=new Ro,{canMove:o,canDelete:r}=t.getTemplateRule(i,e);function s(){return!1}function a(){return r}function d(){return o}function l(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function u(v){const C=new Uo(v,e),{schema:j}=i;return C.getPropertyConfig(j)}function f(){var N,b,T,F;const v=i==null?void 0:i.schema,j=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(v.id);if(v.componentType!=="data-grid"&&v.componentType!=="form"||!((N=i.componentInstance)!=null&&N.value.parent))return;const B=(b=i.componentInstance)==null?void 0:b.value.parent.schema;if((T=B==null?void 0:B.toolbar)!=null&&T.buttons&&B.toolbar.buttons.length){B.toolbar.buttons.forEach(w=>{const V=w.onClick,h=V&&V.split(".");if(!h||h.length<3)return;h[h.length-2]===j&&(w.needRemove=!0)}),B.toolbar.buttons=B.toolbar.buttons.filter(w=>!w.needRemove);const p=(F=i.componentInstance)==null?void 0:F.value.parent;p.parent&&p.parent.updateToolbarItems&&p.parent.updateToolbarItems()}}function m(){const v=e==null?void 0:e.designViewModelUtils,C=e==null?void 0:e.formSchemaUtils,j=i==null?void 0:i.schema;if(v&&C){const B=C.getViewModelIdByComponentId(j.id);v.deleteViewModelById(B),C.deleteComponent(j.id)}}function g(){const v=e==null?void 0:e.designViewModelUtils,C=e==null?void 0:e.formSchemaUtils,j=i==null?void 0:i.schema,B=C.getViewModelIdByComponentId(j.id),N=v.getDgViewModel(B);N!=null&&N.fields&&N.fields.forEach(b=>{const T=C.getExpressions();if(T!=null&&T.length){const F=T.findIndex(p=>p.target===b.id);F>-1&&C.getExpressions().splice(F,1)}})}function y(){f(),g(),m()}function S(){const{schema:v}=i,C=[];return v.componentType==="form"&&C.push({id:"splitFormComponent",title:"拆分卡片",icon:"f-icon fd-i-Family fd_pc-split-card",onClick:j=>{Yi(i,e).openSplitComponentModal(j)}},{id:"addSiblingComponent",title:"添加同级卡片",icon:"f-icon f-icon-plus",onClick:j=>{Li(i,e).addSiblingComponent(j)}}),C}return{canAccepts:s,checkCanDeleteComponent:a,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:l,getStyles:c,getPropsConfig:u,onRemoveComponent:y,getCustomButtons:S}}function Ji(i,e){const t=n.ref(i.width),o=n.ref(i.height);let r;n.watch(e,a=>{a&&(t.value=a.clientWidth,r=new ResizeObserver(d=>{if(!d||d.length<1)return;const c=d[0].contentRect;c&&(t.value=c.width)}),r.observe(a))});function s(){r&&r.disconnect()}return{destory:s,width:t,height:o}}const Qi=n.defineComponent({name:"FVideoDesign",props:rt,setup(i,e){const t=n.ref(),o=n.inject("design-item-context"),r=n.inject("designer-host-service"),s=Xi(o,r),a=Do(t,o,s),{width:d,height:l,destory:c}=Ji(i,t);return n.onMounted(()=>{t.value.componentInstance=a}),n.onUnmounted(()=>{c()}),e.expose(a.value),()=>n.createVNode("div",{ref:t,class:"drag-container","data-dragref":`${o.schema.id}-container`},[n.createVNode("video",{src:i.src,autoplay:i.autoplay,controls:i.controls,loop:i.loop,muted:i.muted,width:d.value,height:l.value},[n.createTextVNode("Your browser does not support the video tag.")])])}}),Zi={install(i){i.component(at.name,at)},register(i,e,t,o){i.video=at,e.video=bt},registerDesigner(i,e,t){i.video=Qi,e.video=bt}};I.FVideo=at,I.default=Zi,I.propsResolver=bt,I.videoProps=rt,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});