@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 66.9 kB
JavaScript
(function(G,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js"],n):(G=typeof globalThis<"u"?globalThis:G||self,n(G.drawer={},G.Vue,G.LodashES,G.common,G.designerCanvas))})(this,function(G,n,re,de,Oe){"use strict";var Cn=Object.defineProperty;var Tn=(G,n,re)=>n in G?Cn(G,n,{enumerable:!0,configurable:!0,writable:!0,value:re}):G[n]=re;var q=(G,n,re)=>Tn(G,typeof n!="symbol"?n+"":n,re);const Re={},_e={};function we(o){const{properties:e,title:t,ignore:i}=o,l=i&&Array.isArray(i),s=Object.keys(e).reduce((d,v)=>((!l||!i.find(p=>p===v))&&(d[v]=e[v].type==="object"&&e[v].properties?we(e[v]):re.cloneDeep(e[v].default)),d),{});if(t&&(!l||!i.find(d=>d==="id"))){const d=t.toLowerCase().replace(/-/g,"_");s.id=`${d}_${Math.random().toString().slice(2,6)}`}return s}function ft(o){const{properties:e,title:t,required:i}=o;if(i&&Array.isArray(i)){const l=i.reduce((s,d)=>(s[d]=e[d].type==="object"&&e[d].properties?we(e[d]):re.cloneDeep(e[d].default),s),{});if(t&&i.find(s=>s==="id")){const s=t.toLowerCase().replace(/-/g,"_");l.id=`${s}_${Math.random().toString().slice(2,6)}`}return l}return{type:t}}function pe(o,e={},t){const i=Re[o];if(i){let l=ft(i);const s=_e[o];return l=s?s({getSchemaByType:pe},l,e,t):l,l}return null}function pt(o,e){const t=we(e);return Object.keys(t).reduce((i,l)=>(Object.prototype.hasOwnProperty.call(o,l)&&(i[l]&&re.isPlainObject(i[l])&&re.isPlainObject(o[l]||!o[l])?Object.assign(i[l],o[l]||{}):i[l]=o[l]),i),t),t}function Le(o,e){return Object.keys(o).filter(i=>o[i]!=null).reduce((i,l)=>{if(e.has(l)){const s=e.get(l);if(typeof s=="string")i[s]=o[l];else{const d=s(l,o[l],o);Object.assign(i,d)}}else i[l]=o[l];return i},{})}function mt(o,e,t=new Map){const i=pt(o,e);return Le(i,t)}function ht(o={}){function e(u,g,c,m){if(typeof c=="number")return m[u].length===c;if(typeof c=="object"){const r=Object.keys(c)[0],a=c[r];if(r==="not")return Number(m[u].length)!==Number(a);if(r==="moreThan")return Number(m[u].length)>=Number(a);if(r==="lessThan")return Number(m[u].length)<=Number(a)}return!1}function t(u,g,c,m){return m[u]&&m[u].propertyValue&&String(m[u].propertyValue.value)===String(c)}const i=new Map([["length",e],["getProperty",t]]);Object.keys(o).reduce((u,g)=>(u.set(g,o[g]),u),i);function l(u,g){const c=u;return typeof g=="number"?[{target:c,operator:"length",param:null,value:Number(g)}]:typeof g=="boolean"?[{target:c,operator:"getProperty",param:u,value:!!g}]:typeof g=="object"?Object.keys(g).map(m=>{if(m==="length")return{target:c,operator:"length",param:null,value:g[m]};const r=m,a=g[m];return{target:c,operator:"getProperty",param:r,value:a}}):[]}function s(u){return Object.keys(u).reduce((c,m)=>{const r=l(m,u[m]);return c.push(...r),c},[])}function d(u,g){if(i.has(u.operator)){const c=i.get(u.operator);return c&&c(u.target,u.param,u.value,g)||!1}return!1}function v(u,g){return s(u).reduce((r,a)=>r&&d(a,g),!0)}function p(u,g){const c=Object.keys(u),m=c.includes("allOf"),r=c.includes("anyOf"),a=m||r,$=(a?u[a?m?"allOf":"anyOf":"allOf"]:[u]).map(A=>v(A,g));return m?!$.includes(!1):$.includes(!0)}return{parseValueSchema:p}}const gt={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:"标签页工具栏按钮"},"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:"抽屉"}},vt={},yt={};ht();function Ce(o,e,t=new Map,i=(d,v,p,u)=>v,l={},s=d=>d){return Re[e.title]=e,_e[e.title]=i,vt[e.title]=l,yt[e.title]=s,(d={},v=!0)=>{if(!v)return Le(d,t);const p=mt(d,e,t),u=Object.keys(o).reduce((g,c)=>(g[c]=o[c].default,g),{});return Object.assign(u,p)}}function Fe(o,e){return{customClass:e.class,customStyle:e.style}}function bt(){function o(e,t){const i=e.buttons;if(!i||i.length<1)return null;const[l,s]=t.payloads,d=i.find(v=>v.id===s);return d?d.onClick||d.click:null}return{resolve:o}}function wt(o,e,t){return e}const Ct=new Map([["appearance",Fe]]),Tt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/drawer.schema.json",title:"drawer",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for drawer",type:"string"},type:{description:"The type string of drawer",type:"string",default:"drawer"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0},title:{description:"",type:"string",default:"标题"},position:{description:"",type:"string",default:"right"},width:{description:"",type:"number"},showMask:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{appearance:{description:"",type:"object",properties:{class:{type:"string",default:"col-3"}}},id:{description:"",type:"string"},type:{description:"",type:"string",default:"response-toolbar"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}}}},required:["id","type","contents"]},Te={title:{type:String,default:""},modelValue:{type:Boolean,default:!1},position:{type:String,default:"right"},appendTo:{type:String,default:"body"},showEntry:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},showMask:{type:Boolean,default:!0},width:{type:[String,Number],default:300},height:{type:[String,Number],default:300},backgroundColor:{type:String,default:""},closeByMask:{type:Boolean,default:!0},wrapperClass:{type:String,default:""},entryClass:{type:String,default:""},buttons:{type:Array,default:[]}},Se=Object.assign({},Te,{componentId:{type:String,default:""}}),De=Ce(Se,Tt,Ct,wt);class qe{constructor(e){q(this,"id","");q(this,"class","btn-secondary");q(this,"icon","");q(this,"groupId","");q(this,"order",-1);q(this,"asDropDownTop",!1);q(this,"text","");q(this,"visible",!0);q(this,"responsed",!1);q(this,"tipsEnable",!1);q(this,"tipsText","");q(this,"width",0);q(this,"onClick",()=>{});q(this,"options");var i,l;this.options=e;const t=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(e).filter(s=>t.indexOf(s)>-1).forEach(s=>{this[s]=e[s]}),(i=e.appearance)!=null&&i.class&&(this.class=(l=e.appearance)==null?void 0:l.class)}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:n.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class St extends qe{constructor(e){super(e)}}function He(){function o(e){const t=[];return e.reduce((i,l)=>(l.children&&l.children.length>0?i.push(new me(l)):i.push(new St(l)),i),t),t}return{buildResponseToolbarItems:o}}const{buildResponseToolbarItems:Dt}=He();class me extends qe{constructor(t){super(t);q(this,"placement","");q(this,"dropdownClass","");q(this,"menuClass","");q(this,"split",!1);q(this,"children",[]);q(this,"expanded",!1);const i=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(t).filter(l=>i.indexOf(l)>-1).forEach(l=>{this[l]=t[l]}),t.children&&t.children.length&&(this.children=Dt(t.children))}}const Pt=new Map([["buttons","items"],["appearance",Fe]]);function Ue(o,e,t){return e}const Nt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar.schema.json",title:"response-toolbar",description:"A Farris Toolbar Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar"},appearance:{description:"",type:"object",properties:{class:{type:"string",default:""}}},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]},buttonSize:{type:"string",default:""}},required:["id","type","buttons"]},kt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar-item.schema.json",title:"response-toolbar-item",description:"A Farris Toolbar Item Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string",default:"btn-secondary"}}},alignment:{description:"对齐",type:"string",default:"right"},text:{description:"文本",type:"string",default:"按钮"},icon:{description:"图标",type:"string",default:""},disabled:{description:"禁用",type:"boolean",default:!1},onClick:{description:"点击事件",type:"string",default:""}},required:["id","type","text"]},Pe={customClass:{type:String,default:""},buttonSize:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}},Mt=Object.assign({},Pe,{componentId:{type:String,default:""}}),Ne=Ce(Pe,Nt,Pt,Ue),We={id:{type:String,default:""},items:{type:Object,default:{}},class:{type:String,default:""},text:{type:String,default:""},icon:{type:String,default:""},componentId:{type:String,default:""},alignment:{Type:String,default:"right"}},Et=Ce(We,kt,void 0,Ue),Vt=bt();function Bt(){function o(t){const i={"f-icon":!0};if(t.icon){const l=t.icon.trim().split(" ");l&&l.length&&l.reduce((s,d)=>(s[d]=!0,s),i)}return i}function e(t){return!!(t.icon&&t.icon.trim())}return{iconClass:o,shouldShowIcon:e}}function xt(o,e){function t(r){const a={"dropdown-menu":!0};if(r.class){const w=r.menuClass.split(" ");w&&w.length&&w.reduce((B,$)=>(B[$]=!0,B),a)}return a}function i(r){const a={disabled:!r.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},w=r.dropdownClass.split(" ");return w&&w.length&&w.reduce((B,$)=>(B[$]=!0,B),a),a}function l(r){const a={disabled:!r.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0},w=r.class.split(" ");return w&&w.length&&w.reduce((B,$)=>(B[$]=!0,B),a),a}let s;const d=new Map;function v(r,a,w){var $;(($=r.target)==null?void 0:$.id)===a.id&&r.stopPropagation();const B=w?w.id:"__top_item__";if(a.children&&a.children.length&&(a.expanded=!a.expanded,a.expanded?d.set(B,a):d.delete(B)),d.has(B)&&d.get(B)!==a){const O=d.get(B);O&&(O.expanded=!1)}}function p(r,a){document.body.click(),a.enable&&(typeof a.onClick=="function"&&a.onClick(r,a.id),o.emit("click",r,a.id))}function u(r,a){const w=r.target;w.className.indexOf("dropdown-item")<0||(w.title=w.scrollWidth>w.clientWidth?a:"")}function g(r){return r.children.map(a=>a.children&&a.children.length?n.createVNode("li",{class:i(a),id:a.id,onClick:w=>a.enable&&v(w,a,r)},[n.createVNode("span",{id:a.id,class:l(a),onMouseover:w=>a.enable&&v(w,a,r)},[a.text,n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),s(a,a)]):n.createVNode("li",{class:l(a),id:a.id,onClick:w=>p(w,a),onMouseover:w=>a.enable&&v(w,a,r),onMouseenter:w=>u(w,a.text)},[e.shouldShowIcon(a)&&n.createVNode("i",{class:e.iconClass(a)},null),a.text]))}function c(r,a,w){var j;const B={display:r.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"180px",minWidth:"120px",zIndex:1e4},$=(j=document.getElementsByTagName("body")[0].getClientRects()[0])==null?void 0:j.width,O=a,A=O==null?void 0:O.getClientRects();if(O&&A&&A.length){const{top:C,width:T,left:h,right:N,height:V}=A[0],E=Math.ceil(V+C);B.top=`${E}px`,B.left=`${h}px`;const y=r.id+"_menu",R=a?a.querySelector("#"+y):null;if(R){R.style.visibility="hidden",R.style.display="block";const k=R.offsetHeight;B.display==="block"&&(R.style.display="block");const D=R.getBoundingClientRect();if(w){B.top=`${C-6}px`;const b=Math.ceil(T+h);B.left=`${b}px`}$-h-T<D.width&&(B.left=`${(w?h:N)-D.width}px`),window.innerHeight-C-V<k&&(C>k?B.top=`${C-k-6}px`:(B.maxHeight=`${C-16}px`,B.overflowY="auto",C-V>window.innerHeight-C&&(B.top="10px"))),R.style.visibility="visible"}}return B}s=function(r,a){var O,A;const w=n.getCurrentInstance(),B=a?a.id:r.id,$=(A=(O=w==null?void 0:w.exposed)==null?void 0:O.elementRef.value)==null?void 0:A.querySelector("#"+B);return n.createVNode("ul",{class:t(r),style:c(r,$,a),id:r.id+"_menu"},[g(r)])};function m(){d.forEach(r=>{r.expanded=!1}),d.clear()}return{renderDropdownMenu:s,clearAllDropDownMenu:m}}function It(o,e,t){const i=n.ref(o.alignment),{renderDropdownMenu:l,clearAllDropDownMenu:s}=xt(e,t);function d(c){const m={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":i.value==="right"||i.value==="center","f-btn-mr":i.value==="left"},r=c.dropdownClass.split(" ");return r&&r.length&&r.reduce((a,w)=>(a[w]=!0,a),m),m}function v(c){const m={btn:!0,disabled:!c.enable,"f-rt-btn":!0,"btn-icontext":!!(c.icon&&c.icon.trim())};if(c.class){const r=c.class.split(" ");r&&r.length&&r.reduce((a,w)=>(a[w]=!0,a),m)}return m}function p(c,m){c.stopPropagation();const r=m.expanded;document.body.click(),m.expanded=!r}function u(c,m=!0){return n.createVNode("div",{id:c.id,class:d(c)},[n.createVNode("div",{class:v(c),style:"display: flex;padding-right: 0.1rem;border-top-right-radius: 6px;border-bottom-right-radius: 6px",onClick:r=>c.enable&&p(r,c)},[t.shouldShowIcon(c)&&n.createVNode("i",{class:t.iconClass(c)},null),n.createVNode("span",null,[c.text]),n.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),m&&l(c)])}function g(){s()}return{renderToolbarDropdown:u,clearAllDropDown:g}}const{buildResponseToolbarItems:ze}=He(),he=n.defineComponent({name:"FResponseToolbar",props:Pe,emits:["click"],setup(o,e){const t=n.ref(ze(o.items)),i=n.ref(),l=n.ref(),s=n.ref(),d=n.ref(o.alignment),v={id:"__more_buttons__",text:"更多"},p=n.ref(new me(v)),u={id:v.id+"width",text:v.text},g=n.ref(-1),c=Bt(),m=n.computed(()=>p.value.children.length>0),r=n.computed(()=>{const b={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":o.buttonSize==="sm","f-response-toolbar-lg":o.buttonSize==="lg"};return de.getCustomClass(b,o.customClass)}),a=n.computed(()=>({"w-100":!0,"d-flex":!0,"flex-nowrap":!0,"justify-content-end":d.value==="right","justify-content-start":d.value==="left","justify-content-center":d.value==="center"})),{renderToolbarDropdown:w,clearAllDropDown:B}=It(o,e,c);function $(b){b&&b.target.closest("ul.dropdown-menu")&&b.type==="wheel"||(t.value.filter(P=>P.children&&P.children.length>0).forEach(P=>{P.expanded=!1}),p.value.expanded=!1,B())}function O(b,P){var J;const F={btn:!0,"f-rt-btn":!0,"f-btn-ml":d.value==="right"||P>0&&d.value==="center","f-btn-mr":d.value==="left","btn-icontext":!!(b.icon&&b.icon.trim())},X=((J=b==null?void 0:b.appearance)==null?void 0:J.class)||b.class;if(X){const U=X.split(" ");U&&U.length&&U.reduce((_,z)=>(_[z]=!0,_),F)}return F}function A(b,P){document.body.click(),typeof P.onClick=="function"&&P.onClick(b,P.id),e.emit("click",b,P.id)}function j(b,P){return n.createVNode("button",{type:"button",class:O(b,P),id:b.id,disabled:!b.enable,onClick:F=>A(F,b)},[c.shouldShowIcon(b)&&n.createVNode("i",{class:c.iconClass(b)},null),b.text])}let C=new Map,T=[];function h(b){const P=b.computedStyleMap().get("margin-left"),F=b.computedStyleMap().get("margin-right");return(P?P.value:0)+b.getBoundingClientRect().width+(F?F.value:0)}function N(b,P,F){if(P<g.value){let X=F-1;for(;X>=0;X--){const J=b[X],U=h(J);if(P+=U,P>=g.value)break}F=X}return P-=g.value,{start:F,space:P}}function V(b){const P=s.value;let F=b;const J=Array.from(P.children).filter(Z=>Z.id!=="__more_buttons__"),U=J.length;let _=!1,z=0;for(;z<U;z++){const Z=J[z],L=h(Z);if(L<=F)F-=L;else{const ae=N(J,F,z);z=ae.start,F=ae.space,_=!0;break}}if(!_&&T.length>0){const Z=N(J,F,z);z=Z.start,F=Z.space}const ne=T.length>0;for(;z<U;z++){const Z=J[z],L=h(Z);C.set(Z.id,!0),T[ne?"unshift":"push"]({id:Z.id,width:L})}return F}function E(b){let P=V(b);if(T.length){let U=0;for(;U<T.length;U++){const _=o.items.find(z=>z.id===T[U].id);if(_&&_.visible!==!1){const z=T[U].width;if(P>=z||U===T.length-1&&P+g.value>=z)P-=z;else break}}for(let _=0;_<U;_++)C.delete(T[_].id);T.splice(0,U-1)}const F=Object.assign({},p.value);F.children=[];const X=new me(F),J=t.value.reduce((U,_)=>{const z=o.items.find(ne=>ne.id===_.id);return C.has(_.id)?(X.children.push(_),_.visible=!1):_.visible=z.visible!==!1,U.push(_),U},[]);p.value=X,t.value=J}function y(b=-1){var X;if(b===0)return;b<0&&(b=((X=l.value)==null?void 0:X.getBoundingClientRect().width)||-1);const F=s.value.getBoundingClientRect().width;(b>=0&&b<F||T.length)&&(E(b),$())}function R(){return g.value<0&&n.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[w(new me(u))])}const k=new ResizeObserver(b=>{if(b.length){const F=b[0].contentRect.width;y(F)}});function D(){C=new Map,T=[]}return n.onMounted(()=>{if(g.value<0){const P=i.value.querySelector("#"+u.id);P&&(g.value=h(P))}y();const b=l.value;k.observe(b),document.body.addEventListener("click",$),document.body.addEventListener("wheel",$)}),n.onUnmounted(()=>{k.disconnect(),document.body.removeEventListener("click",$),document.body.removeEventListener("wheel",$)}),n.watch(()=>o.items,()=>{t.value=ze(o.items),n.nextTick(()=>{D(),y()})},{deep:!0}),e.expose({elementRef:i}),()=>n.createVNode("div",{class:r.value,ref:i,style:{"overflow-y":g.value<0?"hidden":"initial"}},[R(),n.createVNode("div",{ref:l,class:a.value},[n.createVNode("div",{ref:s,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[t.value.filter(b=>b.visible).map((b,P)=>b.children&&b.children.length>0?w(b):j(b,P)),m.value&&w(p.value)])])])}}),At=n.ref(0);function $t(){At.value++}const ve=n.ref(0);function jt(o,e){const t=e.getBoundingClientRect(),i=o.getBoundingClientRect(),l=i.top>=t.top,s=i.top<=t.bottom;return l&&s}function Ot(o){const e=o.querySelector(".component-btn-group");if(!e)return;e.style.display="";const t=e.getBoundingClientRect();if(!(t.top===0&&t.left===0)){const i=e.querySelector("div");if(i){const l=i.getBoundingClientRect();i.style.top=t.top+"px";let s=t.left-l.width;const d=document.querySelector(".editorDiv");if(d){const v=d.getBoundingClientRect();s<v.left&&({left:s}=o.getBoundingClientRect())}i.style.left=s+"px"}}}function Rt(o){if(!window.scrollContainerList)return;const e=Array.from(window.scrollContainerList);if(e.length&&e.length===1){const t=e[0],i=document.querySelector(`[id=${t}]`);if(i&&i.contains(o))return i}}function Xe(o){if(!o)return;const e=o.getBoundingClientRect();if(e.width===0&&e.height===0)return;const t=o.querySelector(".component-btn-group");if(t){let i=!0;const l=Rt(o);if(l&&(i=jt(o,l)),!i){t.style.display="none";return}Ot(o)}}function _t(o){if(!o)return;let e;o.className.includes("dgComponentSelected")?e=o:e=o.querySelector(".dgComponentSelected"),e&&Xe(e)}class ye{constructor(e,t){q(this,"componentId");q(this,"viewModelId");q(this,"eventsEditorUtils");q(this,"formSchemaUtils");q(this,"formMetadataConverter");q(this,"designViewModelUtils");q(this,"designViewModelField");q(this,"controlCreatorUtils");q(this,"designerHostService");q(this,"schemaService",null);q(this,"metadataService",null);q(this,"propertyConfig",{type:"object",categories:{}});var i;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((i=this.formSchemaUtils)==null?void 0:i.getViewModelIdByComponentId(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 i;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const l=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=l.fields.find(s=>s.id===t)}e.updateOn=(i=this.designViewModelField)==null?void 0:i.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",editable:!1,data:[{value:e.type,name:gt[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}},setPropertyRelates(t,i){if(t)switch(t&&t.propertyID){case"class":case"style":{ve.value++;break}}}}}updateElementByParentContainer(e,t){const i=t&&t.parent&&t.parent.schema;if(!i)return;const l=i.contents.findIndex(d=>d.id===e),s=re.cloneDeep(i.contents[l]);i.contents.splice(l,1),i.contents.splice(l,0,s),$t()}}class Lt extends ye{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.getAppearancePropConfig(e),this.propertyConfig}getAppearancePropConfig(e){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"}}}}getBehaviorProperties(e){this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{alignment:{title:"对齐方式",description:"在工具栏区域内按钮组的位置",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中"},{value:"right",name:"右对齐"}]}}}}}}function Ft(o,e){const t=o.schema;function i(m){return!1}function l(m,r){return r.text=m.label,r}function s(){return!1}function d(){return!1}function v(){return!0}function p(){return!0}function u(m){return new Lt(m,e).getPropertyConfig(t)}function g(m){m&&(m.stopPropagation(),m.preventDefault());const{schema:r}=o;r.buttons||(r.buttons=[]);const a=pe("response-toolbar-item");a.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,a.appearance={class:"btn btn-secondary"},r.buttons.push(a)}function c(){return[{id:"appendItem",title:"新增按钮",icon:"f-icon f-icon-plus-circle text-white",onClick:m=>g(m)}]}return{canAccepts:i,checkCanAddComponent:v,checkCanDeleteComponent:d,checkCanMoveComponent:s,hideNestedPaddingInDesginerView:p,onResolveNewComponentSchema:l,getPropsConfig:u,getCustomButtons:c}}const qt={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function Ht(o,e,t){var C;const i="",l=n.ref();function s(){return!0}function d(){return!1}function v(){return!0}function p(){return!0}function u(){return!0}function g(T){if(!T||!T.value)return null;const h=n.ref(T==null?void 0:T.value.parent),N=g(h);return N||null}function c(T=e){const{componentInstance:h,designerItemElementRef:N}=T;return!h||!h.value?null:h.value.canMove||h.value.canAdd||h.value.canDelete?N:c(T.parent)}function m(T){return!!t}function r(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function a(){}function w(T,h){}function B(T){const{componentType:h}=T,N=n.inject("designer-host-service");let V=pe(h,T,N);const E=h.toLowerCase().replace(/-/g,"_");return V&&!V.id&&V.type===h&&(V.id=`${E}_${Math.random().toString().slice(2,6)}`),V}function $(T){}function O(...T){return[]}function A(){}function j(T){}return l.value={canMove:s(),canSelectParent:d(),canAdd:p(),canDelete:v(),canNested:!u(),contents:[],elementRef:o,parent:(C=e.parent)==null?void 0:C.componentInstance,schema:e.schema,styles:i,canAccepts:m,getBelongedComponentInstance:g,getDraggableDesignItemElement:c,getDraggingDisplayText:r,getPropConfig:O,getDragScopeElement:a,onAcceptMovedChildElement:w,onChildElementMovedOut:$,addNewChildComponentSchema:B,onRemoveComponent:A,triggerBelongedComponentToMoveWhenMoved:n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:n.ref(!1),onPropertyChanged:j},l}const Ye=n.defineComponent({name:"FDesignerInnerItem",props:qt,emits:["selectionChange","addComponent","removeComponent"],setup(o,e){const t=n.ref(o.canMove),i=n.ref(o.canAdd),l=n.ref(o.canDelete),s=n.ref(!1),d=n.ref(o.contentKey),v=n.ref(o.childType),p=n.ref(o.childLabel),u=n.ref(o.modelValue),g=n.ref(""),c=n.ref(),m=n.inject("canvas-dragula"),r=n.ref(),a=n.inject("design-item-context"),w={designerItemElementRef:c,componentInstance:r,schema:u.value,parent:a,setupContext:e};n.provide("design-item-context",w);const B=n.computed(()=>({"farris-component":!0,"flex-fill":o.id==="root-component","position-relative":t.value||l.value,"farris-nested":s.value,"can-move":t.value,"d-none":c.value&&c.value.classList.contains("d-none")})),$=n.computed(()=>{const k={};return g.value&&g.value.split(";").reduce((D,b)=>{const[P,F]=b.split(":");return P&&(D[P]=F),D},k),k});function O(k,D){if(a&&a.schema[d.value]){const b=a.schema[d.value].findIndex(P=>P.id===D.id);if(b>-1){const P=a.schema[d.value].length,F=a.schema[d.value][b%P];a.designerItemElementRef.value.querySelector(`#${F.id}-design-item`),a.schema[d.value].splice(b,1),ve.value++,e.emit("removeComponent"),e.emit("selectionChange")}}}function A(k){if(r.value.addNewChildComponentSchema){const D={componentType:v.value,label:p.value,parentComponentInstance:r.value,targetPosition:-1},b=r.value.addNewChildComponentSchema(D);u.value[d.value].push(b),e.emit("addComponent")}}function j(){return i.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:k=>{A()}},[n.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function C(k){return l.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:n.withModifiers(D=>O(D,k),["stop"])},[n.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function T(){return t.value&&n.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[n.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function h(k){return n.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[n.createVNode("div",null,[j(),T(),C(k)])])}n.watch(()=>o.modelValue,k=>{u.value=k,w.schema=k});function N(k){window.scrollContainerList||(window.scrollContainerList=new Set);const D=k.getAttribute("id");D&&window.scrollContainerList.add(D)}function V(k){const D=k.target;N(D),_t(D)}function E(){var k,D;(D=(k=u.value)==null?void 0:k.contents)!=null&&D.length&&c.value&&c.value.addEventListener("scroll",V)}function y(){const k=c.value,D=n.ref(k.children[1]);return Ht(D,w).value}n.onMounted(()=>{if(c.value){const k=c.value.querySelector(`[data-dragref='${u.value.id}-container']`);r.value=k&&k.componentInstance?k.componentInstance.value:y(),m&&k&&m.attachComponents(k,u.value),s.value=r.value.canNested!==void 0?r.value.canNested:s.value,i.value=r.value.canAdd!==void 0?r.value.canAdd:i.value,l.value=r.value.canDelete!==void 0?r.value.canDelete:l.value,t.value=r.value.canMove!==void 0?r.value.canMove:t.value,g.value=r.value.styles||"",c.value&&(c.value.componentInstance=r,c.value.designItemContext=w)}E(),ve.value++}),n.onBeforeUnmount(()=>{c.value&&c.value.removeEventListener("scroll",V)});function R(k){k&&(k.preventDefault(),k.stopPropagation());let D=w.designerItemElementRef;const b=c.value;if(b){const P=document.getElementsByClassName("dgComponentFocused");P&&P.length===1&&P[0]===c.value||(Array.from(P).forEach(X=>X.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(X=>X.classList.remove("dgComponentSelected")),b.classList.add("dgComponentFocused"),e.emit("selectionChange",u.value.type,u.value,o.componentId,r.value),r.value.getDraggableDesignItemElement&&(D=r.value.getDraggableDesignItemElement(w),D&&D.value&&D.value.classList.add("dgComponentSelected")))}Xe(D==null?void 0:D.value)}return()=>n.createVNode("div",{id:`${o.id}-design-item`,ref:c,class:B.value,style:$.value,onClick:R},[h(u.value),e.slots.default&&e.slots.default()])}});class Ut extends ye{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(e),this.getbBehaviorConfig(),this.getEventPropConfig(e),this.propertyConfig}getAppearanceProperties(e){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},icon:{title:"图标",type:"string",description:""}}}}getbBehaviorConfig(){this.propertyConfig.categories.behavior={title:"行为",description:"Behavior",properties:{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:{enableClear:!0,editable:!0}}}}}getEventPropConfig(e){const t=[{label:"onClick",name:"点击事件"}],i=this,l=i.eventsEditorUtils.formProperties(e,i.viewModelId,t),s={};s[i.viewModelId]={type:"events-editor",editor:{initialData:l}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(d,v){const p=d.propertyValue;delete e[i.viewModelId],p&&(p.setPropertyRelates=this.setPropertyRelates,i.eventsEditorUtils.saveRelatedParameters(e,i.viewModelId,p.events,p))}}}}class Wt extends ye{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(e),this.getBehaviorConfig(),this.getEventPropConfig(e),this.propertyConfig}getBehaviorConfig(){this.propertyConfig.categories.behavior={title:"行为",description:"Behavior",properties:{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:{enableClear:!0,editable:!0}}}}}getAppearanceProperties(e){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"",$converter:"/converter/appearance.converter"},icon:{title:"图标",type:"string",description:""}},setPropertyRelates(t){if(t)switch(t&&t.propertyID){case"text":{t.needRefreshControlTree=!0;break}}}}}getEventPropConfig(e){const t=[{label:"onClick",name:"点击事件"}],i=this,l=i.eventsEditorUtils.formProperties(e,i.viewModelId,t),s={};s[i.viewModelId]={type:"events-editor",editor:{initialData:l}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(d,v){const p=d.propertyValue;delete e[i.viewModelId],p&&(p.setPropertyRelates=this.setPropertyRelates,i.eventsEditorUtils.saveRelatedParameters(e,i.viewModelId,p.events,p))}}}}function zt(o,e){function t(u){return!1}function i(){return!1}function l(){return!0}function s(){return!1}function d(u){let g;switch(o.schema.type){case"tab-toolbar-item":g=new Ut(u,e);break;default:g=new Wt(u,e)}return g.getPropertyConfig(o.schema)}function v(){o.designerItemElementRef.value&&n.nextTick(()=>{o.designerItemElementRef.value.click()})}function p(u){if(!u)return;const{changeObject:g}=u;g&&["text","icon","class"].includes(g.propertyID)&&v()}return{canAccepts:t,checkCanMoveComponent:i,checkCanDeleteComponent:l,checkCanAddComponent:s,getPropsConfig:d,onPropertyChanged:p}}const Ge=n.defineComponent({name:"FResponseToolbarItemDesign",props:We,emits:["Click"],setup(o,e){n.ref(),n.ref();const t=n.ref(o.alignment),i={id:"__more_buttons__",text:"More"},l=n.ref(new me(i));n.computed(()=>l.value.children.length>0);const s=n.ref(),d=n.inject("designer-host-service"),v=n.inject("design-item-context"),p=zt(v,d),u=Oe.useDesignerInnerComponent(s,v,p);n.inject("toolbar-item-handler",()=>{}),n.onMounted(()=>{s.value.componentInstance=u}),e.expose(u.value);function g(){const r={"f-icon":!0},a=o.icon?o.icon.trim():"";return de.getCustomClass(r,a)}function c(){return!!(o.icon&&o.icon.trim())}function m(){const r={btn:!0,"f-rt-btn":!0,"f-btn-ml":t.value==="right"||t.value==="center","f-btn-mr":t.value==="left","btn-icontext":!!(o.icon&&o.icon.trim()),disabled:o.disabled===!0,"no-drag":!0};return de.getCustomClass(r,o.class)}return()=>n.createVNode("div",{ref:s,"data-dragref":`${v.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[n.createVNode("button",{type:"button",class:m(),id:o.id},[c()&&n.createVNode("i",{class:g()},null),o.text])])}});var le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function be(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Qe={exports:{}};(function(o,e){(function(t){o.exports=t()})(function(){return function(){function t(i,l,s){function d(u,g){if(!l[u]){if(!i[u]){var c=typeof be=="function"&&be;if(!g&&c)return c(u,!0);if(v)return v(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var r=l[u]={exports:{}};i[u][0].call(r.exports,function(a){var w=i[u][1][a];return d(w||a)},r,r.exports,t,i,l,s)}return l[u].exports}for(var v=typeof be=="function"&&be,p=0;p<s.length;p++)d(s[p]);return d}return t}()({1:[function(t,i,l){var s={},d="(?:^|\\s)",v="(?:\\s|$)";function p(c){var m=s[c];return m?m.lastIndex=0:s[c]=m=new RegExp(d+c+v,"g"),m}function u(c,m){var r=c.className;r.length?p(m).test(r)||(c.className+=" "+m):c.className=m}function g(c,m){c.className=c.className.replace(p(m)," ").trim()}i.exports={add:u,rm:g}},{}],2:[function(t,i,l){(function(s){var d=t("contra/emitter"),v=t("crossvent"),p=t("./classes"),u=document,g=u.documentElement;function c(y,R){var k=arguments.length;k===1&&Array.isArray(y)===!1&&(R=y,y=[]);var D,b,P,F,X,J,U,_,z,ne=null,Z,L,ae=!1,fe=0,Q,x=R||{};x.moves===void 0&&(x.moves=O),x.accepts===void 0&&(x.accepts=O),x.invalid===void 0&&(x.invalid=sn),x.containers===void 0&&(x.containers=y||[]),x.isContainer===void 0&&(x.isContainer=$),x.copy===void 0&&(x.copy=!1),x.copySortSource===void 0&&(x.copySortSource=!1),x.revertOnSpill===void 0&&(x.revertOnSpill=!1),x.removeOnSpill===void 0&&(x.removeOnSpill=!1),x.direction===void 0&&(x.direction="vertical"),x.ignoreInputTextSelection===void 0&&(x.ignoreInputTextSelection=!0),x.mirrorContainer===void 0&&(x.mirrorContainer=u.body);var Y=d({containers:x.containers,start:an,end:rt,cancel:lt,remove:st,destroy:tn,canMove:rn,dragging:!1});return x.removeOnSpill===!0&&Y.on("over",cn).on("out",un),et(),Y;function ke(f){return Y.containers.indexOf(f)!==-1||x.isContainer(f)}function et(f){var S=f?"remove":"add";a(g,S,"mousedown",nn),a(g,S,"mouseup",Ve)}function Me(f){var S=f?"remove":"add";a(g,S,"mousemove",on)}function tt(f){var S=f?"remove":"add";v[S](g,"selectstart",nt),v[S](g,"click",nt)}function tn(){et(!0),Ve({})}function nt(f){Z&&f.preventDefault()}function nn(f){F=f.clientX,X=f.clientY;var S=w(f)!==1||f.metaKey||f.ctrlKey;if(!S){var M=f.target,I=Ee(M);I&&(Z=I,Me(),f.type==="mousedown"&&(T(M)?M.focus():f.preventDefault()))}}function on(f){if(Z){if(w(f)===0){Ve({});return}if(!(f.clientX!==void 0&&Math.abs(f.clientX-F)<=(x.slideFactorX||0)&&f.clientY!==void 0&&Math.abs(f.clientY-X)<=(x.slideFactorY||0))){if(x.ignoreInputTextSelection){var S=E("clientX",f)||0,M=E("clientY",f)||0,I=u.elementFromPoint(S,M);if(T(I))return}var H=Z;Me(!0),tt(),rt(),ot(H),p.add(_||P,"gu-transit"),fn(),dn(),fe=0,Ie(f)}}}function Ee(f){if(!(Y.dragging&&D)&&!ke(f)){for(var S=f;C(f)&&ke(C(f))===!1;)if(x.invalid(f,S)||(f=C(f),!f))return;var M=C(f);if(M&&!x.invalid(f,S)){var I=x.moves(f,M,S,N(f));if(I)return{item:f,source:M}}}}function rn(f){return!!Ee(f)}function an(f){var S=Ee(f);S&&ot(S)}function ot(f){wn(f.item,f.source)&&(_=f.item.cloneNode(!0),Y.emit("cloned",_,f.item,"copy")),b=f.source,P=f.item,J=U=N(f.item),Y.dragging=!0,Y.emit("drag",P,b)}function sn(){return!1}function rt(){if(Y.dragging){var f=_||P;at(f,C(f))}}function it(){Z=!1,Me(!0),tt(!0)}function Ve(f){if(it(),!!Y.dragging){var S=_||P,M=E("clientX",f)||0,I=E("clientY",f)||0,H=B(D,M,I),W=ct(H,M,I);W&&(_&&x.copySortSource||!_||W!==b)?at(S,W):x.removeOnSpill?st():lt()}}function at(f,S){var M=C(f);_&&x.copySortSource&&S===b&&M.removeChild(P),xe(S)?Y.emit("cancel",f,b):Y.emit("drop",f,S,b,U),Be()}function st(){if(Y.dragging){var f=_||P,S=C(f);S&&S.removeChild(f),Y.emit(_?"cancel":"remove",f,S,b),Be()}}function lt(f){if(Y.dragging){var S=arguments.length>0?f:x.revertOnSpill,M=_||P,I=C(M),H=xe(I);H===!1&&S&&(_?I&&I.removeChild(_):b.insertBefore(M,J)),H||S?Y.emit("cancel",M,b,b):Y.emit("drop",M,I,b,U),Be()}}function Be(){var f=_||P;it(),pn(),mn(),f&&p.rm(f,"gu-transit"),z&&clearTimeout(z),Y.dragging=!1,ne&&Y.emit("out",f,ne,b),Y.emit("dragend",f,fe),b=P=_=J=U=z=ne=null}function xe(f,S){var M;return S!==void 0?M=S:D?M=U:M=N(_||P),f===b&&M===J}function ct(f,S,M){for(var I=f;I&&!H();)I=C(I);return I;function H(){var W=ke(I);if(W===!1)return!1;var se=ut(I,f),te=dt(I,se,S,M),ie=xe(I,te);return ie?!0:x.accepts(P,I,b,te)}}function Ie(f){if(!D)return;f.preventDefault();var S=E("clientX",f)||0,M=E("clientY",f)||0;D.style.left=S-2+"px",D.style.top=M-2+"px";var I=_||P,H=B(D,S,M),W=ct(H,S,M),se=W!==null&&W!==ne;(se||W===null)&&(oe(),ne=W,ue()),bn(H,M);var te=C(I);if(W===b&&_&&!x.copySortSource){te&&te.removeChild(I);return}var ie,ce=ut(W,H);if(ae=hn(ce,W),ce!==null)ie=dt(W,ce,S,M);else if(x.revertOnSpill===!0&&!_)ie=J,W=b;else{_&&te&&te.removeChild(I),_&&L&&(L.style.display="none");return}L.style.display="block",ln(ie,I,se),ie?vn(ce,ie):yn(W);function K(ee){Y.emit(ee,I,ne,b)}function ue(){se&&K("over")}function oe(){ne&&K("out")}}function ln(f,S,M){(f===S||f===N(S))&&(U=N(S)),(f===null&&M||f!==S&&f!==N(S))&&(U=f)}function cn(f){p.rm(f,"gu-hide")}function un(f){Y.dragging&&p.add(f,"gu-hide")}function dn(){D||(D=document.createElement("div"),D.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",D.innerHTML=x.getMirrorText&&x.getMirrorText(P)||"控件",p.add(D,"gu-mirror"),x.mirrorContainer.appendChild(D),a(g,"add","mousemove",Ie),p.add(x.mirrorContainer,"gu-unselectable"),Y.emit("cloned",D,P,"mirror"))}function fn(){if(L=document.createElement("div"),p.add(L,"gu-insertion"),P){var f=P.getBoundingClientRect();L.style.left=f.left+"px",L.style.top=f.top+"px"}ae=!1,x.mirrorContainer.appendChild(L)}function pn(){D&&(p.rm(x.mirrorContainer,"gu-unselectable"),a(g,"remove","mousemove",Ie),C(D).removeChild(D),D=null)}function mn(){L&&(C(L).removeChild(L),L=null)}function ut(f,S){for(var M=S;M!==f&&C(M)!==f;)M=C(M);return M===g?null:M}function hn(f,S){if(!S)return ae;var M=f||S&&S.lastElementChild;if(!M)return!0;var I=getComputedStyle(f),H=/^inline/.test(I.getPropertyValue("display"))||/^(left|right)$/.test(I.getPropertyValue("float"));if(H)return!0;if(S){var W=getComputedStyle(S),se=W.getPropertyValue("display");if(/flex$/.test(se)){var te=W.getPropertyValue("flex-direction")||"row";if(te==="row"||te==="row-reverse")return!gn(S)}return!1}return!0}function gn(f){if(!f.children||!f.children.length)return!1;for(const S of Array.from(f.children)){const I=(S.className&&S.className.split(" ")||[]).filter(H=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(H));if(!I.length)return!1;for(const H of I){const W=H.slice(H.lastIndexOf("-")+1);if(parseInt(W,10)!==12)return!1}}return!0}function vn(f,S){const M=S.getBoundingClientRect();if(L.style.left=M.left+"px",L.style.top=M.top+"px",ae){if(L.style.height=M.height+"px",L.style.width="4px",f){const I=f.getBoundingClientRect();I.top!==M.top&&(L.style.left=I.right+"px",L.style.top=I.top+"px",L.style.height=I.height+"px")}}else if(L.style.height="4px",L.style.width=M.width+"px",Q){const I=Q.getBoundingClientRect();M.top<I.top&&(L.style.display="none")}S===P&&P&&(L.style.display="none")}function yn(f){U=null;var S=f.lastElementChild;if(S){var M=S.getBoundingClientRect();ae?(L.style.left=M.right+"px",L.style.top=M.top+"px",L.style.height=M.height+"px",L.style.width="4px"):(L.style.left=M.left+"px",L.style.top=M.bottom+"px",L.style.height="4px",L.style.width=M.width+"px"),S===P&&P&&(L.style.display="none")}else L.style.display="none"}function bn(f,S){if(!x.mirrorContainer.contains(f)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(Q=m(f),!Q||!Q.contains(f)))return;const M=document.querySelector(".dgComponentSelected"),I=Q.getBoundingClientRect();if(S-30<I.top&&Q.scrollTop>0){let H=Q.scrollTop<10?Q.scrollTop:10;Q.scrollBy(0,-1*H),M&&Q.contains(M)&&(fe=fe+-1*H)}if(S+30>I.bottom&&Q.scrollTop<Q.scrollHeight-Q.clientHeight){const H=Q.scrollHeight-Q.clientHeight-Q.scrollTop;let W=H<10?H:10;Q.scrollBy(0,W),M&&Q.contains(M)&&(fe=fe+W)}}function dt(f,S,M,I){var H=x.direction==="horizontal",W=x.direction==="mixed",se=S!==f?ie():te();return se;function te(){var K=f.children.length,ue,oe,ee;for(ue=0;ue<K;ue++)if(oe=f.children[ue],ee=oe.getBoundingClientRect(),H&&ee.left+ee.width/2>M||!W&&!H&&ee.top+ee.height/2>I||W&&ee.left+ee.width>M&&ee.top+ee.height>I)return oe;return null}function ie(){var K=S.getBoundingClientRect();if(W){var ue=I-K.top,oe=M-K.left,ee=K.bottom-I,Ae=K.right-M,$e=Math.min(oe,Ae,ue,ee),je;return ae?je=Ae<oe:je=ee===$e||Ae===$e||oe===$e,ce(je)}return ce(H?M>K.left+A(K)/2:I>K.top+j(K)/2)}function ce(K){return K?N(S):S}}function wn(f,S){return typeof x.copy=="boolean"?x.copy:x.copy(f,S)}}function m(y){const R=Array.from(window.scrollContainerList);if(R.length===1){const D=Array.from(window.scrollContainerList)[0];return document.getElementById(D)}const k=r(R);for(const D of k)if(D.contains(y))return D;return null}function r(y){const R=[];return y.forEach(k=>{const D=document.getElementById(k);D&&R.push(D)}),R.sort((k,D)=>k.contains(D)?1:D.contains(k)?-1:0),R}function a(y,R,k,D){var b={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},P={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},F={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?v[R](y,P[k],D):s.navigator.msPointerEnabled?v[R](y,F[k],D):(v[R](y,b[k],D),v[R](y,k,D))}function w(y){if(y.touches!==void 0)return y.touches.length;if(y.which!==void 0&&y.which!==0)return y.which;if(y.buttons!==void 0)return y.buttons;var R=y.button;if(R!==void 0)return R&1?1:R&2?3:R&4?2:0}function B(y,R,k){y=y||{};var D=y.className||"",b;return y.className+=" gu-hide",b=u.elementFromPoint(R,k),y.className=D,b}function $(){return!1}function O(){return!0}function A(y){return y.width||y.right-y.left}function j(y){return y.height||y.bottom-y.top}function C(y){return y.parentNode===u?null:y.parentNode}function T(y){return y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||h(y)}function h(y){return!y||y.contentEditable==="false"?!1:y.contentEditable==="true"?!0:h(C(y))}function N(y){return y.nextElementSibling||R();function R(){var k=y;do k=k.nextSibling;while(k&&k.nodeType!==1);return k}}function V(y){return y.targetTouches&&y.targetTouches.length?y.targetTouches[0]:y.changedTouches&&y.changedTouches.length?y.changedTouches[0]:y}function E(y,R){var k=V(R),D={pageX:"clientX",pageY:"clientY"};return y in D&&!(y in k)&&D[y]in k&&(y=D[y]),k[y]}i.exports=c}).call(this,typeof le<"u"?le:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,i,l){i.exports=function(d,v){return Array.prototype.slice.call(d,v)}},{}],4:[function(t,i,l){var s=t("ticky");i.exports=function(v,p,u){v&&s(function(){v.apply(u||null,p||[])})}},{ticky:10}],5:[function(t,i,l){var s=t("atoa"),d=t("./debounce");i.exports=function(p,u){var g=u||{},c={};return p===void 0&&(p={}),p.on=function(m,r){return c[m]?c[m].push(r):c[m]=[r],p},p.once=function(m,r){return r._once=!0,p.on(m,r),p},p.off=function(m,r){var a=arguments.length;if(a===1)delete c[m];else if(a===0)c={};else{var w=c[m];if(!w)return p;w.splice(w.indexOf(r),1)}return p},p.emit=function(){var m=s(arguments);return p.emitterSnapshot(m.shift()).apply(this,m)},p.emitterSnapshot=function(m){var r=(c[m]||[]).slice(0);return function(){var a=s(arguments),w=this||p;if(m==="error"&&g.throws!==!1&&!r.length)throw a.length===1?a[0]:a;return r.forEach(function($){g.async?d($,a,w):$.apply(w,a),$._once&&p.off(m,$)}),p}},p}},{"./debounce":4,atoa:3}],6:[function(t,i,l){(function(s){var d=t("custom-event"),v=t("./eventmap"),p=s.document,u=m,g=a,c=[];s.addEventListener||(u=r,g=w),i.exports={add:u,remove:g,fabricate:B};function m(C,T,h,N){return C.addEventListener(T,h,N)}function r(C,T,h){return C.attachEvent("on"+T,O(C,T,h))}function a(C,T,h,N){return C.removeEventListener(T,h,N)}function w(C,T,h){var N=A(C,T,h);if(N)return C.detachEvent("on"+T,N)}function B(C,T,h){var N=v.indexOf(T)===-1?E():V();C.dispatchEvent?C.dispatchEvent(N):C.fireEvent("on"+T,N);function V(){var y;return p.createEvent?(y=p.createEvent("Event"),y.initEvent(T,!0,!0)):p.createEventObject&&(y=p.createEventObject()),y}function E(){return new d(T,{detail:h})}}function $(C,T,h){return function(V){var E=V||s.event;E.target=E.target||E.srcElement,E.preventDefault=E.preventDefault||function(){E.returnValue=!1},E.stopPropagation=E.stopPropagation||function(){E.cancelBubble=!0},E.which=E.which||E.keyCode,h.call(C,E)}}function O(C,T,h){var N=A(C,T,h)||$(C,T,h);return c.push({wrapper:N,element:C,type:T,fn:h}),N}function A(C,T,h){var N=j(C,T,h);if(N){var V=c[N].wrapper;return c.splice(N,1),V}}function j(C,T,h){var N,V;for(N=0;N<c.length;N++)if(V=c[N],V.element===C&&V.type===T&&V.fn===h)return N}}).call(this,typeof le<"u"?le:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,i,l){(function(s){var d=[],v="",p=/^on/;for(v in s)p.test(v)&&d.push(v.slice(2));i.exports=d}).call(this,typeof le<"u"?le:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(t,i,l){(function(s){var d=s.CustomEvent;function v(){try{var p=new d("cat",{detail:{foo:"bar"}});return p.type==="cat"&&p.detail.foo==="bar"}catch{}return!1}i.exports=v()?d:typeof document<"u"&&typeof document.createEvent=="function"?function(u,g){var c=document.createEvent("CustomEvent");return g?c.initCustomEvent(u,g.bubbles,g.cancelable,g.detail):c.initCustomEvent(u,!1,!1,void 0),c}:function(u,g){var c=document.createEventObject();return c.type=u,g?(c.bubbles=!!g.bubbles,c.cancelable=!!g.cancelable,c.detail=g.detail):(c.bubbles=!1,c.cancelable=!1,c.detail=void 0),c}}).call(this,typeof le<"u"?le:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(t,i,l){var s=i.exports={},d,v;function p(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?d=setTimeout:d=p}catch{d=p}try{typeof clearTimeout=="function"?v=clearTimeout:v=u}catch{v=u}})();function g(j){if(d===setTimeout)return setTimeout(j,0);if((d===p||!d)&&setTimeout)return d=setTimeout,setTimeout(j,0);try{return d(j,0)}catch{try{return d.call(null,j,0)}catch{return d.call(this,j,0)}}}function c(j){if(v===clearTimeout)return clearTimeout(j);if((v===u||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(j);try{return v(j)}catch{try{return v.call(null,j)}catch{return v.call(this,j)}}}var m=[],r=!1,a,w=-1;function B(){!r||!a||(r=!1,a.length?m=a.c