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