UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1 lines 319 kB
(function(X,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../tooltip/index.umd.js"),require("../pagination/index.umd.js"),require("../button/index.umd.js"),require("../search-box/index.umd.js"),require("../tags/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../events-editor/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("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/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("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../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("../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("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","../common/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../tooltip/index.umd.js","../pagination/index.umd.js","../button/index.umd.js","../search-box/index.umd.js","../tags/index.umd.js","../dynamic-form/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../events-editor/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","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../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","../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","../notify/index.umd.js"],i):(X=typeof globalThis<"u"?globalThis:X||self,i(X.section={},X.Vue,X.LodashES,X.FResponseToolbar,X.common,X.VueUseCore,X.dataView,null,X.FTransfer,X.FTabs,X.FOrder,null,X.checkbox,X.FFilterBar,X.FTooltip,X.FPagination,X.FButton,X.FSearchBox,X.FTags,X.FDynamicForm,X.dynamicResolver,X.designerCanvas,null,X.FAccordion,X.FAvatar,X.FButtonEdit,X.FButtonGroup,X.FCalendar,X.FCapsule,X.FCheckbox,X.FCheckboxGroup,X.FComboList,X.FComboTree,X.FComponent,X.FColorPicker,X.FContentContainer,X.FDatePicker,X.FDataGrid,X.FDropdown,X.FEventsEditor,X.FFieldSelector,X.FBindingSelector,X.FImageCropper,X.FInputGroup,X.FLayout,X.FListNav,X.FListView,X.FLookup,X.FMappingEditor,X.FNav,X.FNumberRange,X.FNumberSpinner,X.FPageHeader,X.FPageFooter,X.FProgress,X.FQuerySolution,X.FRadioGroup,X.FRate,X.FResponseLayout,X.FResponseLayoutEditorSetting,X.FSection,X.FSmokeDetector,X.FSplitter,X.FStep,X.FSwitch,X.FText,X.FTimePicker,X.FTreeview,X.FUploader,X.FVerifyDetail,X.FVideo,X.FTextArea,X.FSchemaSelector,X.FTreeGrid$1,X.FEventParameter,X.FFilterConditionEditor,X.FFieldset,X.FSortConditionEditor,X.FMenuLookup,X.FDrawer,X.FJsonEditor,X.FPropertyEditor,X.FExpressionEditor,X.FCodeEditor,X.FHtmlTemplate))})(this,function(X,i,Ee,Cn,Se,xn,ke,ou,Ho,qo,Wo,ru,zo,Go,_n,Yo,Uo,Xo,Qo,en,Ko,Sn,iu,Jo,Zo,er,tr,nr,or,Tn,kn,tn,rr,ir,ar,sr,lr,cr,ur,dr,fr,pr,mr,hr,gr,yr,vr,br,wr,Cr,xr,_r,Sr,Tr,kr,Mr,Nr,Er,Fr,Ir,Vr,Or,Dr,Pr,jr,Br,Rr,$r,Lr,Ar,Hr,qr,Wr,zr,Gr,Yr,Ur,Xr,Qr,Kr,Jr,Zr,ei,ti,ni){"use strict";var tu=Object.defineProperty;var nu=(X,i,Ee)=>i in X?tu(X,i,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):X[i]=Ee;var $=(X,i,Ee)=>nu(X,typeof i!="symbol"?i+"":i,Ee);const Mn={},Nn={};function nn(n){const{properties:t,title:e,ignore:o}=n,r=o&&Array.isArray(o),a=Object.keys(t).reduce((s,l)=>((!r||!o.find(c=>c===l))&&(s[l]=t[l].type==="object"&&t[l].properties?nn(t[l]):Ee.cloneDeep(t[l].default)),s),{});if(e&&(!r||!o.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");a.id=`${s}_${Math.random().toString().slice(2,6)}`}return a}function oi(n){const{properties:t,title:e,required:o}=n;if(o&&Array.isArray(o)){const r=o.reduce((a,s)=>(a[s]=t[s].type==="object"&&t[s].properties?nn(t[s]):Ee.cloneDeep(t[s].default),a),{});if(e&&o.find(a=>a==="id")){const a=e.toLowerCase().replace(/-/g,"_");r.id=`${a}_${Math.random().toString().slice(2,6)}`}return r}return{type:e}}function Tt(n,t={},e){const o=Mn[n];if(o){let r=oi(o);const a=Nn[n];return r=a?a({getSchemaByType:Tt},r,t,e):r,r}return null}function ri(n,t){const e=nn(t);return Object.keys(e).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(n,r)&&(o[r]&&Ee.isPlainObject(o[r])&&Ee.isPlainObject(n[r]||!n[r])?Object.assign(o[r],n[r]||{}):o[r]=n[r]),o),e),e}function En(n,t){return Object.keys(n).filter(o=>n[o]!=null).reduce((o,r)=>{if(t.has(r)){const a=t.get(r);if(typeof a=="string")o[a]=n[r];else{const s=a(r,n[r],n);Object.assign(o,s)}}else o[r]=n[r];return o},{})}function ii(n,t,e=new Map){const o=ri(n,t);return En(o,e)}function ai(n={}){function t(u,d,f,g){if(typeof f=="number")return g[u].length===f;if(typeof f=="object"){const p=Object.keys(f)[0],m=f[p];if(p==="not")return Number(g[u].length)!==Number(m);if(p==="moreThan")return Number(g[u].length)>=Number(m);if(p==="lessThan")return Number(g[u].length)<=Number(m)}return!1}function e(u,d,f,g){return g[u]&&g[u].propertyValue&&String(g[u].propertyValue.value)===String(f)}const o=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((u,d)=>(u.set(d,n[d]),u),o);function r(u,d){const f=u;return typeof d=="number"?[{target:f,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:f,operator:"getProperty",param:u,value:!!d}]:typeof d=="object"?Object.keys(d).map(g=>{if(g==="length")return{target:f,operator:"length",param:null,value:d[g]};const p=g,m=d[g];return{target:f,operator:"getProperty",param:p,value:m}}):[]}function a(u){return Object.keys(u).reduce((f,g)=>{const p=r(g,u[g]);return f.push(...p),f},[])}function s(u,d){if(o.has(u.operator)){const f=o.get(u.operator);return f&&f(u.target,u.param,u.value,d)||!1}return!1}function l(u,d){return a(u).reduce((p,m)=>p&&s(m,d),!0)}function c(u,d){const f=Object.keys(u),g=f.includes("allOf"),p=f.includes("anyOf"),m=g||p,y=(m?u[m?g?"allOf":"anyOf":"allOf"]:[u]).map(w=>l(w,d));return g?!y.includes(!1):y.includes(!0)}return{parseValueSchema:c}}const re={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:"筛选条"}},si={},li={};ai();function lt(n,t,e=new Map,o=(s,l,c,u)=>l,r={},a=s=>s){return Mn[t.title]=t,Nn[t.title]=o,si[t.title]=r,li[t.title]=a,(s={},l=!0)=>{if(!l)return En(s,e);const c=ii(s,t,e),u=Object.keys(n).reduce((d,f)=>(d[f]=n[f].default,d),{});return Object.assign(u,c)}}function Bt(n,t){return{customClass:t.class,customStyle:t.style}}function ci(){function n(t,e){const{dataSource:o}=t||{};return o===void 0?{}:{}}return{resolve:n}}function ui(){function n(t,e){return t.selectItemById(e)}return{selectItemById:n}}function di(n,t){if(!n||n.length<1)return null;for(const e of n){if(e.id===t)return e;if(e.children){const o=e.children.find(r=>r.id===t);if(o)return o}}return null}function fi(){function n(t,e){var l;const o=(l=t.toolbar)==null?void 0:l.buttons;if(!o||o.length<1)return null;const[r,a]=e.payloads,s=di(o,a);return s?s.onClick||s.click:null}return{resolve:n}}function pi(){function n(t,e){const{columns:o}=e;return t.updateColumns(o)}return{updateColumns:n}}function mi(n,t,e){return t?{enableAccordion:e.accordionMode}:{enableAccordion:""}}function hi(n,t){return{buttons:t.buttons,buttonPosition:t.position}}const gi=new Map([["appearance",Bt],["expanded","expandStatus"],["enableAccordion",mi],["toolbar",hi]]);function yi(n,t,e){const o=Math.random().toString().slice(2,6),r=e.parentComponentInstance;Object.assign(t,{id:`section-${o}`,appearance:{class:"f-section-in-mainsubcard"},mainTitle:e.mainTitle||t.mainTitle||"标题"});const a=n.getSchemaByType("content-container");Object.assign(a,{id:`container-${o}`,appearance:{class:"f-struct-wrapper"},contents:[t]});const s=r.schema;switch(s&&s.type){case re["splitter-pane"].type:{t.appearance.class="f-section-in-main";break}}const l=r.elementRef,c=window.getComputedStyle(l);return c&&c.display==="flex"&&(a.appearance.class+=" d-block"),a}function vi(n,t,e){return e.parentComponentInstance?yi(n,t,e):t}const bi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"string",default:""},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},expandStatus:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"section-toolbar"},position:{type:"string",default:"inHead"},buttons:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},zt={contentClass:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},on=lt(zt,bi,gi,vi),Fn=fi(),In=Object.assign({},zt,{componentId:{type:String,default:""}});function Vn(n,t,e){let o;function r(c=1){const u=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],d=Array.from(document.body.querySelectorAll(u.join(","))).filter(g=>g).map(g=>{const{display:p,zIndex:m}=window.getComputedStyle(g);return p==="none"?0:parseInt(m,10)}).filter(g=>g);let f=Math.max(...d);return f<1040&&(f=1040),f+c}function a(){o=n.value.nextElementSibling;const c=document&&document.querySelector("body");c&&(c.appendChild(n.value),n.value.style.zIndex=r())}function s(){o?t.value.insertBefore(n.value,o):t.value.appendChild(n.value),n.value.style.zIndex=null}function l(){!n||!t.value||(e.value=!e.value,e.value?a():s())}return{onClickMaxMinIcon:l}}function On(n,t){const e=i.ref(n.buttons),o=i.computed(()=>n.buttonPosition==="inHead"?"right":"left"),r=i.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),a=i.computed(()=>n.buttons&&n.buttons.length>0&&n.buttonPosition==="inHead");function s(l,c){t.emit("click",l,c)}return()=>a.value&&i.createVNode(Cn,{customClass:r.value,items:e.value,onClick:s,alignment:o.value},null)}function wi(n,t,e,o,r,a){const s=i.computed(()=>n.buttonPosition),l=On(n,t),{onClickMaxMinIcon:c}=Vn(o,r,a),u=i.computed(()=>n.enableMaximize),d=i.computed(()=>n.enableAccordion!==""),f=i.computed(()=>{const v={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((S,N)=>(S[N]=!0,S),v),v});function g(v){v.stopPropagation(),n.enableAccordion!==""&&(e.value=!e.value)}function p(){const v=i.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":e.value})),w=i.computed(()=>({"f-icon":!0,"f-icon-maximize":!a.value,"f-icon-minimize":a.value}));return i.createVNode("div",{class:"f-max-accordion"},[u.value?i.createVNode("span",{class:w.value,onClick:c},null):"",d.value?i.createVNode("button",{class:v.value,onClick:g},[i.createVNode("span",null,[e.value?n.collapseLabel:n.expandLabel])]):""])}function m(){return t.slots.header?i.createVNode("div",{class:f.value},[t.slots.header()]):""}function T(){return i.createVNode("div",{class:"f-title"},[i.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),n.subTitle&&i.createVNode("span",null,[n.subTitle])])}function C(){const v=i.computed(()=>{const w={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((N,E)=>(N[E]=!0,N),w),w});return t.slots.headerContent?i.createVNode("div",{class:v.value},[t.slots.headerContent()]):""}function y(){return i.createVNode("div",{class:f.value},[t.slots.headerTitle?t.slots.headerTitle():T(),C(),s.value==="inHead"&&l(),(u.value||d.value)&&p()])}return()=>n.showHeader&&(t.slots.header?m():y())}const Rt=i.defineComponent({name:"FSection",props:zt,emits:["click"],setup(n,t){const e=i.ref(),o=i.ref(),r=i.ref(n.customClass),a=i.computed(()=>n.enableAccordion),s=i.ref(n.expandStatus),l=i.computed(()=>n.buttonPosition),c=i.ref(!1),u=wi(n,t,s,e,o,c),d=On(n,t),f=i.computed(()=>{const C={"f-section":!0,"f-section-accordion":a.value==="default","f-state-collapse":(a.value==="default"||a.value==="custom")&&!s.value,"f-section-custom-accordion":a.value==="custom","f-section-fill":n.fill,"f-section-maximize":c.value};return Se.getCustomClass(C,r.value)}),g=i.computed(()=>{const C={"f-section-content":!0};return Se.getCustomClass(C,n.contentClass)}),p=i.computed(()=>{const C={"f-section-extend":!0};return Se.getCustomClass(C,p.value)});function m(){return t.slots.extend&&i.createVNode("div",{class:p.value},[t.slots.extend()])}function T(){return i.createVNode("div",{class:g.value},[l.value==="inContent"&&d(),t.slots.default&&t.slots.default()])}return i.watch(()=>n.expandStatus,(C,y)=>{C!==y&&(s.value=C)}),i.onMounted(()=>{e.value&&e.value&&(o.value=e.value.parentElement)}),()=>n.visible?i.createVNode("div",{class:f.value,ref:e,style:n.customStyle},[u(),m(),T()]):null}});function Ci(){function n(t,e){var s;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,a=e==null?void 0:e.formSchemaUtils.getComponentById(o.belongedComponentId);return!((t.componentCategory==="input"||t.componentType==="form-group")&&![re["response-layout-item"].type,re["response-form"].type,re.fieldset.type].includes(r)||(t.componentType===re.tabs.type||t.componentType===re.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![re["content-container"].type,re["splitter-pane"].type,re["response-layout-item"].type].includes(r))||t.componentType===re["query-solution"].type||t.componentType===re.fieldset.type&&r!==re["response-form"].type)}return{basalDragulaRuleForContainer:n}}const mt=i.ref(0);function xi(n,t){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=o.top>=e.top,a=o.top<=e.bottom;return r&&a}function rn(n){const t=n.querySelector(".component-btn-group");if(!t)return;t.style.display="";const e=t.getBoundingClientRect();if(!(e.top===0&&e.left===0)){const o=t.querySelector("div");if(o){const r=o.getBoundingClientRect();o.style.top=e.top+"px";let a=e.left-r.width;const s=document.querySelector(".editorDiv");if(s){const l=s.getBoundingClientRect();a<l.left&&({left:a}=n.getBoundingClientRect())}o.style.left=a+"px"}}}function _i(n){if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length&&t.length===1){const e=t[0],o=document.querySelector(`[id=${e}]`);if(o&&o.contains(n))return o}}function an(n){if(!n)return;const t=n.getBoundingClientRect();if(t.width===0&&t.height===0)return;const e=n.querySelector(".component-btn-group");if(e){let o=!0;const r=_i(n);if(r&&(o=xi(n,r)),!o){e.style.display="none";return}rn(n)}}function Dn(n){if(!n)return;let t;n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),t&&an(t)}function Si(n){const t=document.querySelector(".dgComponentSelected");if(!t)return;const e=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=t.querySelector(".component-btn-group");if(r){const a=r.getBoundingClientRect(),s=o.top<e.top;a.top!==0&&s&&rn(t)}}const Ti=i.ref(0);function ki(){Ti.value++}function Mi(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function o(c,u=""){return{path:u+c.code,field:c.id,fullPath:c.code}}function r(c,u=""){return t.getViewModelById(c).states.map(f=>o(f,u))}function a(c){const u=t.getRootViewModelId(),d=r(c);if(c===u)return d;const f=r(u,"root-component.");return[...d,...f]}function s(c){return c.binding&&c.binding.path||c.id||""}function l(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:l}}class Ni{constructor(t){$(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'"}]);$(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});$(this,"getExpressionConverter",(t,e)=>({convertFrom:(o,r,a,s)=>{const l=a.getExpressionRuleValue(t,e||r);return l&&l.value||""},convertTo:(o,r,a,s,l)=>{var c;if(r==="dataPicking"&&(a!=null&&a.target)){const u=`${a.target}_dataPicking`;((c=a.rules)==null?void 0:c.some(f=>f.id===u&&f.value))?o.dictPickingExpressionId=u:delete o.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=t}getExpressionRule(t,e){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(s=>s.target===t);if(!r)return"";const a=r.rules.find(s=>s.type===e);return a||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(e);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(a=>{r.push({key:a.code,name:a.name,description:a.name,category:a.category})}),r}createTreeNode(t,e,o="label"){return{id:t.id,name:t.name,bindingPath:t[o],parents:e}}buildEntityFieldsTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var l;const a=this.createTreeNode(r,e);let s=[];(l=r.type)!=null&&l.fields&&(s=this.buildEntityFieldsTreeData(r.type.fields,[...e,r.label])),o.push({data:a,children:s,expanded:!0})}),o}buildChildEntityTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var c,u;const a=this.createTreeNode(r,e),s=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...e,r.label]),l=this.buildChildEntityTreeData((u=r.type)==null?void 0:u.entities,[...e,r.label]);l!=null&&l.length&&(s==null||s.push(...l)),o.push({data:a,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const o=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),r=this.buildChildEntityTreeData(e.type.entities,[e.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,o){const r=o==="Field"?t.binding.field:t.id,a=this.getExpressionRule(r,e),s=this.getEntitiesAndVariables(),l={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(l.messageType=a.messageType),l}buildRule(t,e,o,r){const{expression:a,message:s,messageType:l}=e,c={id:`${t}_${o}`,type:o,value:a};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=s),o==="dataPicking"&&(c.messageType=l),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,o,r){const a=e==="Field"?t.binding.field:t.id,s=this.buildRule(a,o,r,t.type==="form-group"?t.id:"");let c=this.getExpressionData().find(d=>d.targetType===e&&d.target===a);const u=d=>d.value.trim()==="";if(c){const d=c.rules.find(f=>f.id===s.id);if(d)u(s)?c.rules=c.rules.filter(f=>f.id!==s.id):(Object.assign(d,s),r==="validate"&&t.type==="form-group"&&(d.elementId=t.id));else{if(u(s))return null;c.rules=c.rules||[],c.rules.push(s)}}else{if(u(s))return null;c={target:`${a}`,rules:[s],targetType:e}}return c}getExpressionEditorOptions(t,e,o,r){return o.reduce((a,s)=>{var c,u;const l=e==="Field"?(c=t==null?void 0:t.binding)==null?void 0:c.field:t.id;return a[s]={hide:e==="Field"?!!((u=t==null?void 0:t.binding)!=null&&u.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(l),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,e),onSubmitModal:d=>{const f=this.updateExpression(t,e,d,s);if(r){const g=this.buildRule(l,d,s);r(g)}return f}}},a},{})}getExpressionInfo(t,e,o){const r=e==="Field"?t.binding.field:t.id,a=this.getExpressionRule(r,o),s={value:a&&a.value,targetId:r,targetType:e,expressionType:o};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(t,e,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(t,e,o,r)}}}getExpressionOptions(t,e,o){const r=this.getExpressionInfo(t,e,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,o,e),expressionInfo:r}}}class $t{constructor(t,e){$(this,"componentId");$(this,"viewModelId");$(this,"eventsEditorUtils");$(this,"formSchemaUtils");$(this,"formMetadataConverter");$(this,"designViewModelUtils");$(this,"designViewModelField");$(this,"controlCreatorUtils");$(this,"designerHostService");$(this,"schemaService",null);$(this,"metadataService",null);$(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var o;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(a=>a.id===e)}t.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:re[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},o){const r={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in e)a[s]=Object.assign(a[s]||{},e[s]);return{...r,properties:{...a},setPropertyRelates(s,l){if(s){switch(s&&s.propertyID){case"class":case"style":{mt.value++;break}}o&&o(s,t,l)}}}}getPropertyEditorParams(t,e=[],o="visible",r={},a={}){const{getVariables:s,getControlName:l,getStateMachines:c}=Mi(this.designerHostService),u=this.getRealTargetType(t),d=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:d};return d.map(g=>{switch(g){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":f.expressionConfig=this.getExpressionOptions(t,u,o);break;case"StateMachine":f.stateMachines=c();break;case"Variable":Object.assign(f,{controlName:l(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:s(this.viewModelId),onBeforeOpenVariables:p=>{p.value=s(this.viewModelId)}},a);break}}),f}getVisibleProperty(t,e=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,e==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(t,e="",o={},r){const a={title:"行为",description:""},s=this.getVisibleProperty(t,e);for(const c in o)s[c]=Object.assign(s[c]||{},o[c]);const l=this;return{...a,properties:{...s},setPropertyRelates(c,u){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":l.afterMutilEditorChanged(t,c);break}r&&r(c,u)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const o=e&&e.parent&&e.parent.schema;if(!o)return;const r=o.contents.findIndex(s=>s.id===t),a=Ee.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,a),ki()}addNewVariableToViewModel(t,e){const o=t.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(e).states.push(s)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:a,expressionInfo:s}=e,{targetId:l,targetType:c,expressionType:u,value:d,message:f}=s,g=this.formSchemaUtils.getModule();g.expressions??(g.expressions=[]);const{expressions:p}=g;let m=p.find(C=>C.target===l);m||(m={target:l,rules:[],targetType:c},p.push(m));const T=m.rules.find(C=>C.type===u);if(T)T.value=d,T.message=f;else{const C={id:a,type:u,value:d,message:f};m.rules.push(C)}delete e.expressionInfo}clearExpression(t,e){const o=t.propertyValue;if(o&&o.type==="Expression")return;const a=t.propertyID,s=this.formSchemaUtils.getExpressions(),l=e.binding?e.binding.field:e.id,c=s.find(u=>u.target===l);!c||!c.rules||(c.rules=c.rules.filter(u=>u.type!==a))}getExpressionOptions(t,e,o){return new Ni(this.formSchemaUtils).getExpressionOptions(t,e,o)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}}class Ei extends $t{constructor(t,e){super(t,e)}getPropertyConfig(t){const e=this.getBasicPropConfig(t),o=this.getAppearanceProperties(t),r=this.getBehaviorConfig(t,""),a=this.getExtendConfig(t);return this.propertyConfig.categories={basic:e,appearance:o,behavior:r,extend:a},this.propertyConfig}getAppearanceProperties(t){return{title:"外观",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},fill:{title:"填充内容区域",type:"boolean",description:""},showHeader:{title:"显示标题区域",type:"boolean",description:""},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}},enableAccordion:{title:"面板收折",type:"enum",description:"是否启用分组面板的收折特性",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:[{key:"",value:"不启用"},{key:"default",value:"启用默认收折"}]},refreshPanelAfterChanged:!0},expandStatus:{title:"默认状态",type:"boolean",description:"默认面板是展开还是收起",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{name:"展开",value:!0},{name:"收起",value:!1}],enableClear:!1},visible:t.enableAccordion==="default"}},setPropertyRelates(e,o){if(e)switch(e&&e.propertyID){case"mainTitle":{e.needRefreshControlTree=!0;break}case"showHeader":{const r=document.getElementsByClassName("dgComponentFocused");Array.from(r).forEach(a=>a.classList.remove("dgComponentFocused")),mt.value++;break}}}}}getExtendConfig(t){return{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}}class Fi{getTemplateRule(t,e){const o=e==null?void 0:e.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return a;const s=this.getComponentContext(t),{componentClassList:l}=s;return l.forEach(c=>{if(!c||!r[c])return;const{canMove:u,canDelete:d,canAccept:f}=r[c];a.canMove=a.canMove&&this.resolveRuleValue(u,s),a.canDelete=a.canDelete&&this.resolveRuleValue(d,s),a.canAccept=a.canAccept&&this.resolveRuleValue(f,s)}),a}resolveRuleValue(t,e){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,e)}parseRuleValueSchema(t,e){const o=t.invalidContext||[];let r=!0;for(const a of o){if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:s}=e;if(s&&!s.includes(a.firstLevelChild.class)){r=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:s}=e;if(!s||s.type!==a.firstLevelChild.type){r=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:s}=e;if(s&&!s.includes(a.secondLevelChild.class)){r=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:s}=e;if(!s||s.type!==a.secondLevelChild.type){r=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:s}=e;if(s&&!s.includes(a.parent.class)){r=!1;continue}}if(a.parent.type){const{parentSchema:s}=e;if(s&&s.type!==a.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(t){var T,C,y,v;const e=t.schema,o=e.appearance&&e.appearance.class||"",r=o.split(" ")||[],a=e.contents||[],s=a.length?a[0]:null,l=s&&s.appearance?s.appearance.class:"",c=l?l.split(" "):[],u=(T=s==null?void 0:s.contents)!=null&&T.length?s==null?void 0:s.contents[0]:null,d=u&&u.appearance?u.appearance.class:"",f=d?d.split(" "):[],g=e.type==="component"?(y=(C=t.parent)==null?void 0:C.parent)==null?void 0:y.schema:(v=t.parent)==null?void 0:v.schema,p=g&&g.appearance&&g.appearance.class||"",m=p?p.split(" "):[];return{componentClass:o,componentClassList:r,childContents:a,firstLevelChildSchema:s,firstLevelChildClass:l,firstLevelChildClassList:c,secondLevelChildSchema:u,secondLevelChildClass:d,secondLevelChildClassList:f,parentSchema:g,parentClass:p,parentClassList:m}}}var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Gt(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pn={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(o,r,a){function s(u,d){if(!r[u]){if(!o[u]){var f=typeof Gt=="function"&&Gt;if(!d&&f)return f(u,!0);if(l)return l(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var p=r[u]={exports:{}};o[u][0].call(p.exports,function(m){var T=o[u][1][m];return s(T||m)},p,p.exports,e,o,r,a)}return r[u].exports}for(var l=typeof Gt=="function"&&Gt,c=0;c<a.length;c++)s(a[c]);return s}return e}()({1:[function(e,o,r){var a={},s="(?:^|\\s)",l="(?:\\s|$)";function c(f){var g=a[f];return g?g.lastIndex=0:a[f]=g=new RegExp(s+f+l,"g"),g}function u(f,g){var p=f.className;p.length?c(g).test(p)||(f.className+=" "+g):f.className=g}function d(f,g){f.className=f.className.replace(c(g)," ").trim()}o.exports={add:u,rm:d}},{}],2:[function(e,o,r){(function(a){var s=e("contra/emitter"),l=e("crossvent"),c=e("./classes"),u=document,d=u.documentElement;function f(h,I){var V=arguments.length;V===1&&Array.isArray(h)===!1&&(I=h,h=[]);var _,F,B,R,O,P,G,D,j,U=null,H,A,W=!1,Q=0,ie,J=I||{};J.moves===void 0&&(J.moves=v),J.accepts===void 0&&(J.accepts=v),J.invalid===void 0&&(J.invalid=ht),J.containers===void 0&&(J.containers=h||[]),J.isContainer===void 0&&(J.isContainer=y),J.copy===void 0&&(J.copy=!1),J.copySortSource===void 0&&(J.copySortSource=!1),J.revertOnSpill===void 0&&(J.revertOnSpill=!1),J.removeOnSpill===void 0&&(J.removeOnSpill=!1),J.direction===void 0&&(J.direction="vertical"),J.ignoreInputTextSelection===void 0&&(J.ignoreInputTextSelection=!0),J.mirrorContainer===void 0&&(J.mirrorContainer=u.body);var de=s({containers:J.containers,start:Oe,end:ft,cancel:Be,remove:ze,destroy:z,canMove:Me,dragging:!1});return J.removeOnSpill===!0&&de.on("over",_t).on("out",yt),xe(),de;function he(L){return de.containers.indexOf(L)!==-1||J.isContainer(L)}function xe(L){var Z=L?"remove":"add";m(d,Z,"mousedown",q),m(d,Z,"mouseup",_e)}function De(L){var Z=L?"remove":"add";m(d,Z,"mousemove",ee)}function Re(L){var Z=L?"remove":"add";l[Z](d,"selectstart",ue),l[Z](d,"click",ue)}function z(){xe(!0),_e({})}function ue(L){H&&L.preventDefault()}function q(L){R=L.clientX,O=L.clientY;var Z=T(L)!==1||L.metaKey||L.ctrlKey;if(!Z){var ne=L.target,te=ve(ne);te&&(H=te,De(),L.type==="mousedown"&&(E(ne)?ne.focus():L.preventDefault()))}}function ee(L){if(H){if(T(L)===0){_e({});return}if(!(L.clientX!==void 0&&Math.abs(L.clientX-R)<=(J.slideFactorX||0)&&L.clientY!==void 0&&Math.abs(L.clientY-O)<=(J.slideFactorY||0))){if(J.ignoreInputTextSelection){var Z=x("clientX",L)||0,ne=x("clientY",L)||0,te=u.elementFromPoint(Z,ne);if(E(te))return}var be=H;De(!0),Re(),ft(),ot(be),c.add(D||B,"gu-transit"),St(),Et(),Q=0,pt(L)}}}function ve(L){if(!(de.dragging&&_)&&!he(L)){for(var Z=L;N(L)&&he(N(L))===!1;)if(J.invalid(L,Z)||(L=N(L),!L))return;var ne=N(L);if(ne&&!J.invalid(L,Z)){var te=J.moves(L,ne,Z,k(L));if(te)return{item:L,source:ne}}}}function Me(L){return!!ve(L)}function Oe(L){var Z=ve(L);Z&&ot(Z)}function ot(L){Ie(L.item,L.source)&&(D=L.item.cloneNode(!0),de.emit("cloned",D,L.item,"copy")),F=L.source,B=L.item,P=G=k(L.item),de.dragging=!0,de.emit("drag",B,F)}function ht(){return!1}function ft(){if(de.dragging){var L=D||B;Ve(L,N(L))}}function K(){H=!1,De(!0),Re(!0)}function _e(L){if(K(),!!de.dragging){var Z=D||B,ne=x("clientX",L)||0,te=x("clientY",L)||0,be=C(_,ne,te),ye=xt(be,ne,te);ye&&(D&&J.copySortSource||!D||ye!==F)?Ve(Z,ye):J.removeOnSpill?ze():Be()}}function Ve(L,Z){var ne=N(L);D&&J.copySortSource&&Z===F&&ne.removeChild(B),gt(Z)?de.emit("cancel",L,F):de.emit("drop",L,Z,F,G),at()}function ze(){if(de.dragging){var L=D||B,Z=N(L);Z&&Z.removeChild(L),de.emit(D?"cancel":"remove",L,Z,F),at()}}function Be(L){if(de.dragging){var Z=arguments.length>0?L:J.revertOnSpill,ne=D||B,te=N(ne),be=gt(te);be===!1&&Z&&(D?te&&te.removeChild(D):F.insertBefore(ne,P)),be||Z?de.emit("cancel",ne,F,F):de.emit("drop",ne,te,F,G),at()}}function at(){var L=D||B;K(),oe(),fe(),L&&c.rm(L,"gu-transit"),j&&clearTimeout(j),de.dragging=!1,U&&de.emit("out",L,U,F),de.emit("dragend",L,Q),F=B=D=P=G=j=U=null}function gt(L,Z){var ne;return Z!==void 0?ne=Z:_?ne=G:ne=k(D||B),L===F&&ne===P}function xt(L,Z,ne){for(var te=L;te&&!be();)te=N(te);return te;function be(){var ye=he(te);if(ye===!1)return!1;var je=ge(te,L),Te=we(te,je,Z,ne),Le=gt(te,Te);return Le?!0:J.accepts(B,te,F,Te)}}function pt(L){if(!_)return;L.preventDefault();var Z=x("clientX",L)||0,ne=x("clientY",L)||0;_.style.left=Z-2+"px",_.style.top=ne-2+"px";var te=D||B,be=C(_,Z,ne),ye=xt(be,Z,ne),je=ye!==null&&ye!==U;(je||ye===null)&&(me(),U=ye,st()),pe(be,ne);var Te=N(te);if(ye===F&&D&&!J.copySortSource){Te&&Te.removeChild(te);return}var Le,rt=ge(ye,be);if(W=Pe(rt,ye),rt!==null)Le=we(ye,rt,Z,ne);else if(J.revertOnSpill===!0&&!D)Le=P,ye=F;else{D&&Te&&Te.removeChild(te),D&&A&&(A.style.display="none");return}A.style.display="block",Nt(Le,te,je),Le?Ze(rt,Le):Y(ye);function Xe(Ce){de.emit(Ce,te,U,F)}function st(){je&&Xe("over")}function me(){U&&Xe("out")}}function Nt(L,Z,ne){(L===Z||L===k(Z))&&(G=k(Z)),(L===null&&ne||L!==Z&&L!==k(Z))&&(G=L)}function _t(L){c.rm(L,"gu-hide")}function yt(L){de.dragging&&c.add(L,"gu-hide")}function Et(){_||(_=document.createElement("div"),_.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;",_.innerHTML=J.getMirrorText&&J.getMirrorText(B)||"控件",c.add(_,"gu-mirror"),J.mirrorContainer.appendChild(_),m(d,"add","mousemove",pt),c.add(J.mirrorContainer,"gu-unselectable"),de.emit("cloned",_,B,"mirror"))}function St(){if(A=document.createElement("div"),c.add(A,"gu-insertion"),B){var L=B.getBoundingClientRect();A.style.left=L.left+"px",A.style.top=L.top+"px"}W=!1,J.mirrorContainer.appendChild(A)}function oe(){_&&(c.rm(J.mirrorContainer,"gu-unselectable"),m(d,"remove","mousemove",pt),N(_).removeChild(_),_=null)}function fe(){A&&(N(A).removeChild(A),A=null)}function ge(L,Z){for(var ne=Z;ne!==L&&N(ne)!==L;)ne=N(ne);return ne===d?null:ne}function Pe(L,Z){if(!Z)return W;var ne=L||Z&&Z.lastElementChild;if(!ne)return!0;var te=getComputedStyle(L),be=/^inline/.test(te.getPropertyValue("display"))||/^(left|right)$/.test(te.getPropertyValue("float"));if(be)return!0;if(Z){var ye=getComputedStyle(Z),je=ye.getPropertyValue("display");if(/flex$/.test(je)){var Te=ye.getPropertyValue("flex-direction")||"row";if(Te==="row"||Te==="row-reverse")return!Ge(Z)}return!1}return!0}function Ge(L){if(!L.children||!L.children.length)return!1;for(const Z of Array.from(L.children)){const te=(Z.className&&Z.className.split(" ")||[]).filter(be=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(be));if(!te.length)return!1;for(const be of te){const ye=be.slice(be.lastIndexOf("-")+1);if(parseInt(ye,10)!==12)return!1}}return!0}function Ze(L,Z){const ne=Z.getBoundingClientRect();if(A.style.left=ne.left+"px",A.style.top=ne.top+"px",W){if(A.style.height=ne.height+"px",A.style.width="4px",L){const te=L.getBoundingClientRect();te.top!==ne.top&&(A.style.left=te.right+"px",A.style.top=te.top+"px",A.style.height=te.height+"px")}}else if(A.style.height="4px",A.style.width=ne.width+"px",ie){const te=ie.getBoundingClientRect();ne.top<te.top&&(A.style.display="none")}Z===B&&B&&(A.style.display="none")}function Y(L){G=null;var Z=L.lastElementChild;if(Z){var ne=Z.getBoundingClientRect();W?(A.style.left=ne.right+"px",A.style.top=ne.top+"px",A.style.height=ne.height+"px",A.style.width="4px"):(A.style.left=ne.left+"px",A.style.top=ne.bottom+"px",A.style.height="4px",A.style.width=ne.width+"px"),Z===B&&B&&(A.style.display="none")}else A.style.display="none"}function pe(L,Z){if(!J.mirrorContainer.contains(L)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(ie=g(L),!ie||!ie.contains(L)))return;const ne=document.querySelector(".dgComponentSelected"),te=ie.getBoundingClientRect();if(Z-30<te.top&&ie.scrollTop>0){let be=ie.scrollTop<10?ie.scrollTop:10;ie.scrollBy(0,-1*be),ne&&ie.contains(ne)&&(Q=Q+-1*be)}if(Z+30>te.bottom&&ie.scrollTop<ie.scrollHeight-ie.clientHeight){const be=ie.scrollHeight-ie.clientHeight-ie.scrollTop;let ye=be<10?be:10;ie.scrollBy(0,ye),ne&&ie.contains(ne)&&(Q=Q+ye)}}function we(L,Z,ne,te){var be=J.direction==="horizontal",ye=J.direction==="mixed",je=Z!==L?Le():Te();return je;function Te(){var Xe=L.children.length,st,me,Ce;for(st=0;st<Xe;st++)if(me=L.children[st],Ce=me.getBoundingClientRect(),be&&Ce.left+Ce.width/2>ne||!ye&&!be&&Ce.top+Ce.height/2>te||ye&&Ce.left+Ce.width>ne&&Ce.top+Ce.height>te)return me;return null}function Le(){var Xe=Z.getBoundingClientRect();if(ye){var st=te-Xe.top,me=ne-Xe.left,Ce=Xe.bottom-te,et=Xe.right-ne,Ke=Math.min(me,et,st,Ce),tt;return W?tt=et<me:tt=Ce===Ke||et===Ke||me===Ke,rt(tt)}return rt(be?ne>Xe.left+w(Xe)/2:te>Xe.top+S(Xe)/2)}function rt(Xe){return Xe?k(Z):Z}}function Ie(L,Z){return typeof J.copy=="boolean"?J.copy:J.copy(L,Z)}}function g(h){const I=Array.from(window.scrollContainerList);if(I.length===1){const _=Array.from(window.scrollContainerList)[0];return document.getElementById(_)}const V=p(I);for(const _ of V)if(_.contains(h))return _;return null}function p(h){const I=[];return h.forEach(V=>{const _=document.getElementById(V);_&&I.push(_)}),I.sort((V,_)=>V.contains(_)?1:_.contains(V)?-1:0),I}function m(h,I,V,_){var F={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},R={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};a.navigator.pointerEnabled?l[I](h,B[V],_):a.navigator.msPointerEnabled?l[I](h,R[V],_):(l[I](h,F[V],_),l[I](h,V,_))}function T(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 I=h.button;if(I!==void 0)return I&1?1:I&2?3:I&4?2:0}function C(h,I,V){h=h||{};var _=h.className||"",F;return h.className+=" gu-hide",F=u.elementFromPoint(I,V),h.className=_,F}function y(){return!1}function v(){return!0}function w(h){return h.width||h.right-h.left}function S(h){return h.height||h.bottom-h.top}function N(h){return h.parentNode===u?null:h.parentNode}function E(h){return h.tagName==="INPUT"||h.tagName==="TEXTAREA"||h.tagName==="SELECT"||b(h)}function b(h){return!h||h.contentEditable==="false"?!1:h.contentEditable==="true"?!0:b(N(h))}function k(h){return h.nextElementSibling||I();function I(){var V=h;do V=V.nextSibling;while(V&&V.nodeType!==1);return V}}function M(h){return h.targetTouches&&h.targetTouches.length?h.targetTouches[0]:h.changedTouches&&h.changedTouches.length?h.changedTouches[0]:h}function x(h,I){var V=M(I),_={pageX:"clientX",pageY:"clientY"};return h in _&&!(h in V)&&_[h]in V&&(h=_[h]),V[h]}o.exports=f}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,o,r){o.exports=function(s,l){return Array.prototype.slice.call(s,l)}},{}],4:[function(e,o,r){var a=e("ticky");o.exports=function(l,c,u){l&&a(function(){l.apply(u||null,c||[])})}},{ticky:10}],5:[function(e,o,r){var a=e("atoa"),s=e("./debounce");o.exports=function(c,u){var d=u||{},f={};return c===void 0&&(c={}),c.on=function(g,p){return f[g]?f[g].push(p):f[g]=[p],c},c.once=function(g,p){return p._once=!0,c.on(g,p),c},c.off=function(g,p){var m=arguments.length;if(m===1)delete f[g];else if(m===0)f={};else{var T=f[g];if(!T)return c;T.splice(T.indexOf(p),1)}return c},c.emit=function(){var g=a(arguments);return c.emitterSnapshot(g.shift()).apply(this,g)},c.emitterSnapshot=function(g){var p=(f[g]||[]).sli