@farris/ui-vue 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +1 -1
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +2 -2
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +7 -5
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +1 -1
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +3 -2
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +1 -1
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +498 -495
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +833 -832
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1 -1
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +3 -2
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1 -1
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +256 -254
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +416 -394
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +388 -386
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +1 -1
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +77 -76
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +4 -2
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +118 -118
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +80 -81
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +237 -237
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +1 -1
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +1 -1
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +9 -3
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +114 -112
- package/components/order/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1 -1
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +1 -1
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +485 -463
- package/components/query-solution/index.umd.cjs +3 -3
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +1 -1
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +544 -545
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +6 -4
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/section/index.esm.js +1 -1
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +9 -7
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +77 -78
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +5 -3
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +1 -1
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +2 -2
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/video/index.esm.js +1 -1
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.esm.js +211 -211
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/checkbox/index.esm.js +1 -1
- package/designer/checkbox/index.umd.cjs +1 -1
- package/designer/checkbox-group/index.esm.js +25 -26
- package/designer/checkbox-group/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +15 -9
- package/designer/data-grid/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +917 -916
- package/designer/farris-designer.all.umd.cjs +5 -5
- package/designer/input-group/index.esm.js +2 -1
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +685 -689
- package/designer/list-view/index.umd.cjs +3 -3
- package/designer/radio-group/index.esm.js +7 -3
- package/designer/radio-group/index.umd.cjs +1 -1
- package/farris.all.esm.js +5641 -5603
- package/farris.all.umd.cjs +21 -21
- package/locales/data-grid/ui/en.json +2 -1
- package/locales/data-grid/ui/zh-CHS.json +2 -1
- package/locales/data-grid/ui/zh-CHT.json +2 -1
- package/locales/designer/en.json +2 -1
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +2 -1
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(te,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js"),require("../dynamic-resolver/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","vue-i18n","../designer-canvas/index.umd.js","../dynamic-resolver/index.umd.js"],c):(te=typeof globalThis<"u"?globalThis:te||self,c(te["response-toolbar"]={},te.Vue,te.LodashES,te.common,te.vueI18n,te.designerCanvas,te.dynamicResolver))})(this,function(te,c,de,re,wt,_e,xt){"use strict";var Qn=Object.defineProperty;var Zn=(te,c,de)=>c in te?Qn(te,c,{enumerable:!0,configurable:!0,writable:!0,value:de}):te[c]=de;var Y=(te,c,de)=>Zn(te,typeof c!="symbol"?c+"":c,de);class Le{constructor(e){Y(this,"id","");Y(this,"class","btn-secondary");Y(this,"icon","");Y(this,"groupId","");Y(this,"order",-1);Y(this,"asDropDownTop",!1);Y(this,"text","");Y(this,"visible",!0);Y(this,"shown",!0);Y(this,"responsed",!1);Y(this,"tipsEnable",!1);Y(this,"tipsText","");Y(this,"width",0);Y(this,"dropdownClass","");Y(this,"onClick",()=>{});Y(this,"options");var o,r;this.options=e;const n=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","dropdownClass","onClick"];Object.keys(e).filter(i=>n.indexOf(i)>-1).forEach(i=>{i==="visible"?this[i]=e[i]===void 0?!0:e[i]:this[i]=e[i]}),this.shown=this.visible,(o=e.appearance)!=null&&o.class&&(this.class=(r=e.appearance)==null?void 0:r.class)}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:c.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class qe extends Le{constructor(e){super(e)}}function We(){function t(e){const n=[];return e.reduce((o,r)=>(r.children&&r.children.length>0?o.push(new we(r)):o.push(new qe(r)),o),n),n}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:Tt}=We();class we extends Le{constructor(n){super(n);Y(this,"placement","");Y(this,"visible",!0);Y(this,"dropdownClass","");Y(this,"menuClass","");Y(this,"split",!1);Y(this,"children",[]);Y(this,"expanded",!1);Y(this,"shown",!0);const o=["visible","icon","isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(n).filter(r=>o.indexOf(r)>-1).forEach(r=>{r==="visible"?this[r]=n[r]===void 0?!0:n[r]:this[r]=n[r]}),this.shown=this.visible,n.children&&n.children.length&&(this.children=Tt(n.children))}}class St{constructor(e,n){Y(this,"id");Y(this,"name");Y(this,"presetId",[]);Y(this,"responsedIndex",[]);Y(this,"width");this.id=e,this.name=n,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}}function Ue(t,e){let n;function o(l){const{properties:f,title:g,ignore:u}=l,s=u&&Array.isArray(u),S=Object.keys(f).reduce((R,k)=>((!s||!u.find(F=>F===k))&&(R[k]=f[k].type==="object"&&f[k].properties?o(f[k]):de.cloneDeep(f[k].default)),R),{});if(g&&(!s||!u.find(R=>R==="id"))){const R=g.toLowerCase().replace(/-/g,"_");S.id=`${R}_${Math.random().toString().slice(2,6)}`}return S}function r(l){const{properties:f,title:g,required:u}=l;if(u&&Array.isArray(u)){const s=u.reduce((S,R)=>(S[R]=f[R].type==="object"&&f[R].properties?o(f[R]):de.cloneDeep(f[R].default),S),{});if(g&&u.find(S=>S==="id")){const S=g.toLowerCase().replace(/-/g,"_");s.id=`${S}_${Math.random().toString().slice(2,6)}`}return s}return{type:g}}function i(l,f={},g){const u=t[l];if(u){let s=r(u);const S=e[l];return s=S?S({getSchemaByType:i},s,f,g):s,n!=null&&n.appendIdentifyForNewControl&&n.appendIdentifyForNewControl(s),s}return null}function a(l,f){const g=o(f);return Object.keys(g).reduce((u,s)=>(Object.prototype.hasOwnProperty.call(l,s)&&(u[s]&&de.isPlainObject(u[s])&&de.isPlainObject(l[s]||!l[s])?Object.assign(u[s],l[s]||{}):u[s]=l[s]),u),g),g}function b(l,f){return Object.keys(l).filter(u=>l[u]!=null).reduce((u,s)=>{if(f.has(s)){const S=f.get(s);if(typeof S=="string")u[S]=l[s];else{const R=S(s,l[s],l);Object.assign(u,R)}}else u[s]=l[s];return u},{})}function d(l,f,g=new Map){const u=a(l,f);return b(u,g)}function m(l){var g;const f=l.type;if(f){const u=t[f];if(!u)return l;const s=a(l,u),S=((g=l.editor)==null?void 0:g.type)||"";if(S){const R=t[S],k=a(l.editor,R);s.editor=k}return s}return l}function y(l){n=l}return{getSchemaByType:i,resolveSchemaWithDefaultValue:m,resolveSchemaToProps:d,mappingSchemaToProps:b,setDesignerContext:y}}const ze={},Ge={},{getSchemaByType:Ye,resolveSchemaWithDefaultValue:Et,resolveSchemaToProps:It,mappingSchemaToProps:Pt,setDesignerContext:Jn}=Ue(ze,Ge);function Mt(t={}){function e(m,y,l,f){if(typeof l=="number")return f[m].length===l;if(typeof l=="object"){const g=Object.keys(l)[0],u=l[g];if(g==="not")return Number(f[m].length)!==Number(u);if(g==="moreThan")return Number(f[m].length)>=Number(u);if(g==="lessThan")return Number(f[m].length)<=Number(u)}return!1}function n(m,y,l,f){return f[m]&&f[m].propertyValue&&String(f[m].propertyValue.value)===String(l)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((m,y)=>(m.set(y,t[y]),m),o);function r(m,y){const l=m;return typeof y=="number"?[{target:l,operator:"length",param:null,value:Number(y)}]:typeof y=="boolean"?[{target:l,operator:"getProperty",param:m,value:!!y}]:typeof y=="object"?Object.keys(y).map(f=>{if(f==="length")return{target:l,operator:"length",param:null,value:y[f]};const g=f,u=y[f];return{target:l,operator:"getProperty",param:g,value:u}}):[]}function i(m){return Object.keys(m).reduce((l,f)=>{const g=r(f,m[f]);return l.push(...g),l},[])}function a(m,y){if(o.has(m.operator)){const l=o.get(m.operator);return l&&l(m.target,m.param,m.value,y)||!1}return!1}function b(m,y){return i(m).reduce((g,u)=>g&&a(u,y),!0)}function d(m,y){const l=Object.keys(m),f=l.includes("allOf"),g=l.includes("anyOf"),u=f||g,R=(u?m[u?f?"allOf":"anyOf":"allOf"]:[m]).map(F=>b(F,y));return f?!R.includes(!1):R.includes(!0)}return{parseValueSchema:d}}const Dt={convertTo:(t,e,n,o)=>{t.appearance||(t.appearance={}),t.appearance[e]=n},convertFrom:(t,e,n)=>t.appearance?t.appearance[e]:t[e]},kt={convertFrom:(t,e,n)=>t.buttons&&t.buttons.length?`共 ${t.buttons.length} 项`:"无"},Nt={convertTo:(t,e,n,o)=>{t.editor&&(t.editor[e]=n)},convertFrom:(t,e,n)=>t.editor&&Object.prototype.hasOwnProperty.call(t.editor,e)?t.editor[e]:t[e]},Ee={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"}},Bt={convertFrom:(t,e,n)=>{var r;const o=t.editor&&t.editor[e]?t.editor[e]:t[e];return((r=Ee[o])==null?void 0:r.name)||o}},Rt={convertTo:(t,e,n,o)=>{t[e]=t[e]},convertFrom:(t,e,n)=>t.editor?n.getRealEditorType(t.editor.type):""},Vt={convertTo:(t,e,n,o)=>{(t.type==="data-grid-column"||t.type==="tree-grid-column")&&(t.formatter?t.formatter[e]=n:t.formatter={[e]:n})},convertFrom:(t,e,n)=>{if(t.formatter){if(e==="trueText")return t.formatter.trueText;if(e==="falseText")return t.formatter.falseText;if(e==="prefix")return t.formatter.prefix;if(e==="suffix")return t.formatter.suffix;if(e==="precision")return t.formatter.precision;if(e==="decimal")return t.formatter.decimal;if(e==="thousand")return t.formatter.thousand;if(e==="dateFormat")return t.formatter.dateFormat||"yyyy-MM-dd";if(e==="customFormat")return t.formatter.customFormat;if(e==="type")return t.formatter.type||"none"}return"none"}},Ot={convertTo:(t,e,n,o)=>{t.command?t.command[e]=n:t.command={[e]:n},e==="enable"&&n&&(t.command.commands||(t.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(t,e,n)=>t.command&&e==="enable"?t.command.enable:""},Ft={convertTo:(t,e,n,o)=>{t.column?t.column[e]=n:t.column={[e]:n},e==="fitColumns"&&n&&(t.column.fitMode||(t.column.fitMode="average"))},convertFrom:(t,e,n)=>{if(t.column){if(e==="fitColumns")return t.column.fitColumns;if(e==="fitMode")return t.column.fitMode}return""}},jt={convertTo:(t,e,n,o)=>{t.summary?t.summary[e]=n:t.summary={[e]:n},e==="enable"&&n&&(t.summary?t.summary.groupFields||(t.summary.groupFields=[]):t.summary={enable:n,groupFields:[]})},convertFrom:(t,e,n)=>t.summary&&e==="enable"?t.summary.enable:t.type==="data-grid-column"?t.enableSummary===void 0?!1:t.enableSummary:""},At={convertTo:(t,e,n,o)=>{t.group?t.group[e]=n:t.group={[e]:n},e==="enable"&&n&&(t.group?t.group.groupFields||(t.group.groupFields=[]):t.group={enable:n,groupFields:[],showSummary:!1})},convertFrom:(t,e,n)=>{if(t.group){if(e==="enable")return t.group.enable;if(e==="showSummary")return t.group.showSummary}}},$t={convertFrom:(t,e)=>t.binding?t.binding.path:"",convertTo:(t,e,n)=>{if(n&&n.length>0){const o=n[0];t.binding||(t.binding={}),t.binding.type="Form",t.binding.path=o.bindingField,t.binding.field=o.id,t.binding.fullPath=o.path,t.path=o.bindingPath}}},_t={convertTo:(t,e,n,o)=>{t.pagination||(t.pagination={}),t.pagination[e]=n},convertFrom:(t,e,n)=>t.pagination?t.pagination[e]:t[e]},Lt={convertTo:(t,e,n,o)=>{t.rowNumber||(t.rowNumber={}),t.rowNumber[e]=n},convertFrom:(t,e,n)=>t.rowNumber?t.rowNumber[e]:t[e]},qt={convertTo:(t,e,n,o)=>{t.selection||(t.selection={}),t.selection[e]=n},convertFrom:(t,e,n)=>{var o,r;return e==="showCheckbox"?(o=t.selection)!=null&&o.multiSelect?!0:(r=t.selection)==null?void 0:r.showCheckbox:t.selection?t.selection[e]:t[e]}},Wt={convertFrom:(t,e,n)=>t[e]&&t[e].length?`共 ${t[e].length} 项`:""},Ut={convertFrom:(t,e)=>t[e]||"",convertTo:(t,e,n)=>{t[e]=n}},zt={convertTo:(t,e,n,o)=>{t.size||(t.size={}),t.size[e]=n},convertFrom:(t,e,n)=>t.size?t.size[e]:t[e]},Gt={convertFrom:(t,e,n)=>{var o,r;return(o=t.formatter)!=null&&o.data&&e==="formatterEnumData"&&!t.formatterEnumData?(r=t.formatter)==null?void 0:r.data:t.formatterEnumData}},Yt={convertTo:(t,e,n,o)=>{t.sort||(t.sort={}),t.sort[e]=n},convertFrom:(t,e,n)=>{var o,r;if(e==="mode")return((o=t.sort)==null?void 0:o.mode)||"client";if(e==="multiSort")return!!((r=t.sort)!=null&&r.multiSort)}},Xt={convertTo:(t,e,n,o)=>{t.filter||(t.filter={}),t.filter[e]=n},convertFrom:(t,e,n)=>{var o;if(e==="mode")return((o=t.filter)==null?void 0:o.mode)||"client"}},Ht={convertTo:(t,e,n,o)=>{t.rowOption?t.rowOption[e]=n:t.rowOption={[e]:n}},convertFrom:(t,e,n)=>{if(t.rowOption){if(e==="customRowStyle")return t.rowOption.customRowStyle;if(e==="customCellStyle")return t.rowOption.customCellStyle}return""}};function Xe(t,e,n){const o=new Map([["/converter/appearance.converter",Dt],["/converter/buttons.converter",kt],["/converter/property-editor.converter",Nt],["/converter/items-count.converter",Wt],["/converter/type.converter",Bt],["/converter/change-editor.converter",Rt],["/converter/change-formatter.converter",Vt],["/converter/column-command.converter",Ot],["/converter/column-option.converter",Ft],["/converter/summary.converter",jt],["/converter/group.converter",At],["/converter/form-group-label.converter",Ut],["/converter/field-selector.converter",$t],["/converter/pagination.converter",_t],["/converter/row-number.converter",Lt],["/converter/grid-selection.converter",qt],["/converter/size.converter",zt],["/converter/change-formatter-enum.converter",Gt],["/converter/grid-sort.converter",Yt],["/converter/grid-filter.converter",Xt],["/converter/row-option.converter",Ht]]),r=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),i=Mt();function a(u,s){return()=>i.parseValueSchema(u,s)}function b(u,s,S){return u.includes("visible")&&s.visible!==void 0?typeof s.visible=="boolean"?()=>!!s.visible:s.visible===void 0?!0:a(s.visible,S):()=>!0}function d(u,s,S){return u.includes("readonly")&&s.readonly!==void 0?typeof s.readonly=="boolean"?()=>!!s.readonly:a(s.readonly,S):()=>!1}function m(u,s){const S=u.$converter||s;return typeof S=="string"&&S&&o.has(S)?o.get(S)||null:S||null}function y(u,s,S,R,k,F="",M=""){return Object.keys(u).map(O=>{const E=c.ref(1),p=O,D=u[O],C=Object.keys(D),v=D.title,I=D.type,h=r.get(I)||{type:"input-group",enableClear:!1},w=D.editor?Object.assign({},h,D.editor):Object.assign({},h),N=b(C,D,s),T=d(C,D,s);w.readonly=w.readonly===void 0?T():w.readonly;const B=D.type==="cascade"?y(D.properties,s,S,R,k,F,M):[],L=!0;let q=m(D,M);const W=c.computed({get(){if(E.value){if(["class","style"].find(V=>V===p)&&!q&&(q=o.get("/converter/appearance.converter")||null),q&&q.convertFrom)return q.convertFrom(S,O,k,F);const ee=S[O];return Object.prototype.hasOwnProperty.call(D,"defaultValue")&&(ee===void 0||typeof ee=="string"&&ee==="")?D.type==="boolean"?D.defaultValue:D.defaultValue||"":ee}return null},set(ee){E.value+=1,q&&q.convertTo?(q.convertTo(R,O,ee,k,F),q.convertTo(S,O,ee,k,F)):(R[O]=ee,S[O]=ee)}}),{refreshPanelAfterChanged:_,description:Q,isExpand:X,parentPropertyID:Z}=D,z={propertyID:p,propertyName:v,propertyType:I,propertyValue:W,editor:w,visible:N,readonly:T,cascadeConfig:B,hideCascadeTitle:L,refreshPanelAfterChanged:_,description:Q,isExpand:X,parentPropertyID:Z};return s[p]=z,z})}function l(u,s,S={}){const R={},k=t[u];return k&&k.categories?Object.keys(k.categories).map(M=>{const P=k.categories[M],O=P==null?void 0:P.title,E=y(P.properties||{},R,{},S,s);return{categoryId:M,categoryName:O,properties:E}}):[]}function f(u,s,S,R,k=""){const F=s.$ref.schema,M=s.$ref.converter,P=S[F],O=P.type,E=n(P),p={},D=t[O];if(D&&D.categories){const C=D.categories[u],v=C==null?void 0:C.title;M&&Object.keys(C.properties).forEach(w=>{C.properties[w].$converter=M});const I=(C==null?void 0:C.properties)||{},h=y(I,p,E,P,R,k);return{categoryId:u,categoryName:v,properties:h}}return{categoryId:u,categoryName:"",properties:[]}}function g(u,s,S,R,k){const F=u.type,M=n(u),P={};let O=k||t[F];if(O&&Object.keys(O).length===0&&S&&S.getPropConfig&&(O=S.getPropConfig(R)),O&&O.categories){const E=[];return Object.keys(O.categories).map(p=>{const D=O.categories[p];if(D.$ref){E.push(f(p,D,u,s,R));return}const C=D==null?void 0:D.title,v=D==null?void 0:D.tabId,I=D==null?void 0:D.tabName,h=D==null?void 0:D.hide,w=D==null?void 0:D.hideTitle,N=y(D.properties||{},P,M,u,s,R,D.$converter),{setPropertyRelates:T}=D,B=D==null?void 0:D.parentPropertyID;E.push({categoryId:p,categoryName:C,tabId:v,tabName:I,hide:h,properties:N,hideTitle:w,setPropertyRelates:T,parentPropertyID:B})}),E}return[]}return{getPropertyConfigBySchema:g,getPropertyConfigByType:l,propertyConverterMap:o}}const He={},Qe={};Xe(He,Qe,Et);const Ze={},Je={},{getSchemaByType:Qt,resolveSchemaWithDefaultValue:Zt,resolveSchemaToProps:Kn,mappingSchemaToProps:eo,setDesignerContext:to}=Ue(Ze,Je),Ke={},et={};Xe(Ke,et,Zt);function tt(t,e,n=new Map,o=(a,b,d,m)=>b,r={},i=a=>a){return ze[e.title]=e,Ge[e.title]=o,He[e.title]=r,Qe[e.title]=i,Ze[e.title]=e,Je[e.title]=o,Ke[e.title]=r,et[e.title]=i,(a={},b=!0)=>{if(!b)return Pt(a,n);const d=It(a,e,n),m=Object.keys(t).reduce((y,l)=>(y[l]=t[l].default,y),{});return Object.assign(m,d)}}function Jt(t,e){return{customClass:e.class,customStyle:e.style}}function Kt(t,e){if(!t||t.length<1)return null;for(const n of t){if(n.id===e)return n;if(n.children){const o=n.children.find(r=>r.id===e);if(o)return o}}return null}function en(){function t(e,n){const o=e.buttons;if(!o||o.length<1)return null;const[r,i]=n.payloads,a=Kt(o,i);return a?a.onClick||a.click:null}return{resolve:t}}const tn=new Map([["buttons","items"],["appearance",Jt]]);function nt(t,e,n){return e}const nn={$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:""},visible:{description:"",type:"boolean",default:!0}},required:["id","type","buttons"],events:{onClick:"点击事件"}},on={$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:""}}},alignment:{description:"对齐",type:"string",default:"right"},text:{description:"文本",type:"string",default:"按钮"},icon:{description:"图标",type:"string",default:""},disabled:{description:"禁用",type:"boolean",default:!1},visible:{description:"是否可见",type:"boolean",default:!0},onClick:{description:"点击事件",type:"string",default:""},tipsEnable:{description:"",type:"boolean",default:!1},tipsText:{description:"",type:"string",default:""},dropdownClass:{description:"处于下拉菜单时的样式",type:"string",default:""},split:{description:"",type:"boolean",default:!1}},required:["id","type","text"],events:{onClick:"点击事件"}},Pe={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0}},rn=Object.assign({},Pe,{componentId:{type:String,default:""}}),Me=tt(Pe,nn,tn,nt),ot={id:{type:String,default:""},item:{type:Object,default:{}},items:{type:Object,default:{}},class:{type:String,default:"btn-secondary"},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},componentId:{type:String,default:""},expanded:{type:Boolean,default:!1},alignment:{Type:String,default:"right"},split:{type:Boolean,default:!1},isDP:{type:Boolean,default:!1},isDPItem:{type:Boolean,default:!1}},sn=tt(ot,on,void 0,nt),an=en();function De(){function t(n){const o={"f-icon":!0};if(n.icon){const r=n.icon.trim().split(" ");r&&r.length&&r.reduce((i,a)=>(i[a]=!0,i),o)}return o}function e(n){return!!(n.icon&&n.icon.trim())}return{iconClass:t,shouldShowIcon:e}}function ln(t,e){function n(E){const p={"dropdown-menu":!0};return re.getCustomClass(p,E.menuClass)}function o(E){const p={disabled:!E.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return re.getCustomClass(p,E.dropdownClass)}function r(E){const p={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return re.getCustomClass(p,E.dropdownClass)}function i(E){const p={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0,"f-rt-toggle":!E.split,"btn-icontext":!!(E.icon&&E.icon.trim()),"dropdown-toggle":!E.split};return re.getCustomClass(p,E.dropdownClass)}function a(E){const p={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(E.icon&&E.icon.trim()),"d-block":!0};return re.getCustomClass(p,E.dropdownClass)}let b;const d=new Map;let m="";function y(E){m="#"+E}function l(E,p,D){E.stopPropagation();const C=D?D.id:"__top_item__";if(p.children&&p.children.length&&(p.expanded=!p.expanded,p.expanded)){if(d.has(C)&&d.get(C)!==p){const v=d.get(C);v&&(v.expanded=!1,d.delete(C))}d.set(C,p)}}function f(E,p){document.body.click(),p.enable&&(E.stopPropagation(),typeof p.onClick=="function"&&p.onClick(E,p.id),t.emit("click",E,p.id))}function g(E,p){const D=E.target;D.className.indexOf("dropdown-item")<0||(D.title=D.scrollWidth>D.clientWidth?p:"")}function u(E,p,D){if(p.tipsEnable&&p.tipsText){const C=c.reactive({content:p.tipsText,enable:p.tipsEnable});return c.withDirectives(c.createVNode("li",{class:r(p),id:p.id,key:p.id+"_"+D,onClick:v=>f(v,p)},[c.createVNode("span",{class:a(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text])]),[[c.resolveDirective("tooltip"),C]])}return c.createVNode("li",{class:r(p),id:p.id,onClick:C=>f(C,p)},[c.createVNode("span",{class:a(p),onMouseenter:C=>g(C,p.text)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text])])}function s(E,p,D){p.enable&&(typeof p.onClick=="function"&&D.onClick(E,p.id),t.emit("click",E,p.id),D.split||l(E,p,D))}function S(E,p,D){E&&E.stopPropagation(),l(E,p,D)}function R(E,p){E.stopPropagation();const D=p.id;if(p.children&&p.children.length&&p.expanded&&d.has(D)){const C=d.get(D);C&&(C.expanded=!1,d.delete(D))}}function k(E,p,D){if(p.tipsEnable&&p.tipsText){const C=c.reactive({content:p.tipsText,enable:p.tipsEnable});return c.createVNode("li",{class:o(p),id:p.id,key:p.id+"_"+D,onClick:v=>s(v,p,E)},[c.withDirectives(c.createVNode("span",{class:i(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text]),[[c.resolveDirective("tooltip"),C]]),p.split&&c.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:v=>S(v,p,E)},null),b(p,p)])}return c.createVNode("li",{class:o(p),id:p.id,onClick:C=>s(C,p,E),onMouseenter:C=>g(C,p.text)},[c.createVNode("span",{class:i(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text]),p.split&&c.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:C=>S(C,p,E)},null),b(p,p)])}function F(E){return E.children.filter(p=>p.visible).map((p,D)=>p.children&&p.children.length?k(E,p,D):u(E,p,D))}function M(E,p){if(!E)return 1080;let D=-1;const C=E.children.length;for(let v=0;v<C;v++)if(E.children[v].id===p){D=v;break}return 1080+C-D}function P(E,p,D){var B,L;const C={display:E.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},v=document.querySelector(m);if(!v)return C;const I=c.getCurrentInstance();let h=(L=(B=I==null?void 0:I.exposed)==null?void 0:B.elementRef.value)==null?void 0:L.querySelector("#"+p);if(h||(h=v==null?void 0:v.querySelector("#"+p)),!h)return C;const w=window.innerWidth,N=window.innerHeight,T=h==null?void 0:h.getClientRects();if(h&&T&&T.length){const{top:q,width:W,left:_,right:Q,height:X}=T[0],Z=Math.ceil(X+q);C.top=`${Z}px`,C.left=`${_}px`;const z=E.id+"_menu",ee=(h==null?void 0:h.querySelector("#"+z))||(v==null?void 0:v.querySelector("#"+z))||null;if(ee){ee.style.visibility="hidden",ee.style.display="block";const V=ee.offsetHeight;C.zIndex=E.expanded?M(v,z):1080,C.display==="block"&&(ee.style.display="block");const U=ee.getBoundingClientRect();if(D){C.top=`${q-6}px`;const j=Math.ceil(W+_);C.left=`${j}px`}w-_-W<U.width&&(C.left=`${(D?_:Q)-U.width}px`),N-q-X<V?q>V?(C.top=`${q-V-6}px`,C.maxHeight=`${q-16}px`):(C.maxHeight=`${N-Z}px`,q>N-q-X&&(C.top="10px",C.maxHeight=`${q-16}px`)):C.maxHeight=`${N-Z}px`,ee.style.visibility="visible"}}return C}b=function(E,p){const D=p?p.id:E.id;return c.createVNode(c.Teleport,{to:m,disabled:!E.expanded},{default:()=>[c.createVNode("ul",{class:n(E),style:P(E,D,p),id:E.id+"_menu",onWheel:C=>R(C,E)},[F(E)])]})};function O(){d.forEach(E=>{E.expanded=!1}),d.clear()}return{renderDropdownMenu:b,clearAllDropDownMenu:O,updateContainerId:y}}function cn(t,e,n){const o=c.ref(t.alignment),{renderDropdownMenu:r,clearAllDropDownMenu:i,updateContainerId:a}=ln(e,n);function b(s){const S={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right"||o.value==="center","f-btn-mr":o.value==="left"};return re.getCustomClass(S,s.dropdownClass)}function d(s){const S={btn:!0,disabled:!s.enable,"f-rt-btn":!0,"btn-icontext":!!(s.icon&&s.icon.trim()),"f-rt-toggle":!s.split,"dropdown-toggle":!s.split};return re.getCustomClass(S,s.class)}function m(s){const S={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return re.getCustomClass(S,s.class)}function y(s){return s.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function l(s,S){s.stopPropagation();const R=S.expanded;document.body.click(),typeof S.onClick=="function"&&S.onClick(s,S.id),e.emit("click",s,S.id),S.split||(S.expanded=!R)}function f(s,S){s.stopPropagation();const R=S.expanded;document.body.click(),S.expanded=!R}function g(s,S=!0){if(s.tipsEnable&&s.tipsText){const R=c.reactive({content:s.tipsText,enable:s.tipsEnable});return c.createVNode("div",{id:s.id,class:b(s)},[c.withDirectives(c.createVNode("div",{class:d(s),style:y(s),onClick:k=>s.enable&&l(k,s)},[n.shouldShowIcon(s)&&c.createVNode("i",{class:n.iconClass(s)},null),c.createVNode("span",null,[s.text])]),[[c.resolveDirective("tooltip"),R]]),s.split&&c.createVNode("button",{class:m(s),style:"border-radius:0 6px 6px 0;",onClick:k=>f(k,s)},null),S&&r(s)])}return c.createVNode("div",{id:s.id,class:b(s)},[c.createVNode("div",{class:d(s),style:y(s),onClick:R=>s.enable&&l(R,s)},[n.shouldShowIcon(s)&&c.createVNode("i",{class:n.iconClass(s)},null),c.createVNode("span",null,[s.text])]),s.split&&c.createVNode("button",{class:m(s),style:"border-radius:0 6px 6px 0;",onClick:R=>f(R,s)},null),S&&r(s)])}function u(){i()}return{renderToolbarDropdown:g,clearAllDropDown:u,updateContainerId:a}}const{buildResponseToolbarItems:rt}=We(),xe=c.defineComponent({name:"FResponseToolbar",props:Pe,emits:["click"],setup(t,e){const{t:n}=wt.useI18n(),o=c.ref(rt(t.items)),r=c.ref(),i=c.ref(),a=c.ref(),b={id:"__more_buttons__",text:n("responseToolbar.more")},d=c.ref(new we(b)),m={id:b.id+"width",text:b.text},y=c.ref(-1),l=De();let f=!1;const{guid:g,uuid:u}=re.useGuid(),s=t.id?t.id:"toolbar-"+g(),S=c.ref(),R="dropdown-container-"+s+"-"+u(4),{renderToolbarDropdown:k,clearAllDropDown:F,updateContainerId:M}=cn(t,e,l);M(R);const P=c.computed(()=>d.value.children.length>0),O=c.computed(()=>t.visible?d.value.children.length>0?!0:o.value.findIndex(V=>V.shown&&V.children&&V.children.length>0)>-1:!1);function E(){t.visible&&!S.value&&document&&(S.value=document.createElement("div"),S.value.id=R,document.body.appendChild(S.value))}E();function p(){S.value&&document.body.contains(S.value)&&(document.body.removeChild(S.value),S.value=null)}c.watch(O,(V,U)=>{V?E():p()});const D=c.computed(()=>{const V={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":t.buttonSize==="sm","f-response-toolbar-lg":t.buttonSize==="lg","d-none":!t.visible};return re.getCustomClass(V,t.customClass)}),C=c.computed(()=>({"w-100":!0,"d-flex":!0,"flex-nowrap":!0,"justify-content-end":t.alignment==="right","justify-content-start":t.alignment==="left","justify-content-center":t.alignment==="center"}));function v(V){V&&V.target.closest("ul.dropdown-menu")&&V.type==="wheel"||(o.value.filter(U=>U.children&&U.children.length>0).forEach(U=>{U.expanded=!1}),d.value.expanded=!1,F())}function I(V,U){var se;const j={btn:!0,"f-rt-btn":!0,"f-btn-ml":t.alignment==="right"||U>0&&t.alignment==="center","f-btn-mr":t.alignment==="left","btn-icontext":!!(V.icon&&V.icon.trim())},H=((se=V==null?void 0:V.appearance)==null?void 0:se.class)||V.class||"btn-secondary";return re.getCustomClass(j,H)}function h(V,U){document.body.click(),typeof U.onClick=="function"&&U.onClick(V,U.id),e.emit("click",V,U.id)}function w(V,U){if(V.tipsEnable&&V.tipsText){const j=c.reactive({content:V.tipsText,enable:V.tipsEnable});return c.withDirectives(c.createVNode("button",{type:"button",class:I(V,U),id:V.id,disabled:!V.enable,onClick:H=>h(H,V)},[l.shouldShowIcon(V)&&c.createVNode("i",{class:l.iconClass(V)},null),V.text]),[[c.resolveDirective("tooltip"),j]])}return c.createVNode("button",{type:"button",class:I(V,U),id:V.id,disabled:!V.enable,onClick:j=>h(j,V)},[l.shouldShowIcon(V)&&c.createVNode("i",{class:l.iconClass(V)},null),V.text])}let N=new Map,T=[];function B(V){const U=Math.ceil(parseFloat(getComputedStyle(V).getPropertyValue("margin-left"))),j=Math.ceil(parseFloat(getComputedStyle(V).getPropertyValue("margin-right")));return(U||0)+V.getBoundingClientRect().width+(j||0)}function L(V,U,j){if(U<y.value){let H=j-1;for(;H>=0;H--){const se=V[H],ie=B(se);if(U+=ie,U>=y.value)break}j=H}return U-=y.value,{start:j,space:U}}function q(V){const U=a.value;let j=V;const se=Array.from(U.children).filter(le=>le.id!=="__more_buttons__"),ie=se.length;let oe=!1,ne=0;for(;ne<ie;ne++){const le=se[ne],ve=B(le);if(ve<=j)j-=ve;else{const ye=L(se,j,ne);ne=ye.start,j=ye.space,oe=!0;break}}if(!oe&&T.length>0){const le=L(se,j,ne);ne=le.start,j=le.space}const Te=T.length>0;for(;ne<ie;ne++){const le=se[ne],ve=B(le);N.set(le.id,!0);const ye=T.find(Se=>Se.id===le.id);ye?ye.width=ve:T[Te?"unshift":"push"]({id:le.id,width:ve})}return j}function W(V){let U=q(V);if(T.length){let ie=0;for(;ie<T.length;ie++){const oe=t.items.find(ne=>ne.id===T[ie].id);if(oe&&oe.visible!==!1){const ne=T[ie].width;if(U>=ne||ie===T.length-1&&U+y.value>=ne)U-=ne;else break}}for(let oe=0;oe<ie;oe++)N.delete(T[oe].id);T.splice(0,ie-1)}const j=Object.assign({},d.value);j.children=[];const H=new we(j),se=o.value.reduce((ie,oe)=>{const ne=t.items.find(Te=>Te.id===oe.id);return N.has(oe.id)?(H.children.push(oe),oe.shown=!1):oe.shown=ne.visible!==!1,ie.push(oe),ie},[]);d.value=H,o.value=se}function _(V=-1){if(V===0||!a.value||!i.value)return;V<0&&(V=i.value.getBoundingClientRect().width);const U=a.value.getBoundingClientRect().width;(V>=0&&V<U||T.length)&&(W(V),v())}function Q(){return y.value<0&&c.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[k(new we(m))])}const X=new ResizeObserver(V=>{if(V.length){const j=V[0].contentRect.width;_(j)}});function Z(){N=new Map,T=[]}function z(){i.value&&!f&&(X.observe(i.value),f=!0)}function ee(){if(r.value&&y.value<0){const V=r.value.querySelector("#"+m.id);V&&(y.value=B(V))}}return c.onMounted(()=>{ee(),_(),z(),document.body.addEventListener("click",v),document.body.addEventListener("wheel",v)}),c.onUnmounted(()=>{X.disconnect(),p(),document.body.removeEventListener("click",v),document.body.removeEventListener("wheel",v)}),c.watch(()=>t.items,()=>{o.value=rt(t.items),d.value.children=[],c.nextTick(()=>{Z(),_()})},{deep:!0}),c.watch(()=>t.visible,V=>{V&&c.nextTick(()=>{ee(),_(),z()})}),e.expose({elementRef:r}),()=>c.createVNode("div",{class:D.value,id:s,ref:r,style:{"overflow-y":y.value<0?"hidden":"initial"}},[t.visible&&Q(),t.visible&&c.createVNode("div",{ref:i,class:C.value},[c.createVNode("div",{ref:a,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(V=>V.shown).map((V,U)=>V.children&&V.children.length>0?k(V):w(V,U)),P.value&&k(d.value)])])])}}),dn=c.ref(0);function un(){dn.value++}const Ce=c.ref(0);function fn(t,e){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top>=n.top,i=o.top<=n.bottom;return r&&i}function it(t){const e=t.querySelector(".component-btn-group");if(!e)return;e.style.display="";const n=e.getBoundingClientRect();if(!(n.top===0&&n.left===0)){const o=e.querySelector("div");if(o){const r=o.getBoundingClientRect();o.style.top=n.top+"px";let i=n.left-r.width;const a=document.querySelector(".editorDiv");if(a){const b=a.getBoundingClientRect();i<b.left&&({left:i}=t.getBoundingClientRect())}o.style.left=i+"px"}}}function pn(t){if(!window.scrollContainerList)return;const e=Array.from(window.scrollContainerList);if(e.length&&e.length===1){const n=e[0],o=document.querySelector(`[id=${n}]`);if(o&&o.contains(t))return o}}function st(t){if(!t)return;const e=t.getBoundingClientRect();if(e.width===0&&e.height===0)return;const n=t.querySelector(".component-btn-group");if(n){let o=!0;const r=pn(t);if(r&&(o=fn(t,r)),!o){n.style.display="none";return}it(t)}}function gn(t){if(!t)return;let e;t.className.includes("dgComponentSelected")?e=t:e=t.querySelector(".dgComponentSelected"),e&&st(e)}function mn(t){const{formSchemaUtils:e,formStateMachineUtils:n}=t;function o(d,m=""){return{path:m+d.code,field:d.id,fullPath:d.code}}function r(d,m=""){return e.getViewModelById(d).states.map(l=>o(l,m))}function i(d){const m=e.getRootViewModelId(),y=r(d);if(d===m)return y;const l=r(m,"root-component.");return[...y,...l]}function a(d){return d.binding&&d.binding.path||d.id||""}function b(){return n&&n.getRenderStates()||[]}return{getVariables:i,getControlName:a,getStateMachines:b}}class hn{constructor(e){Y(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);Y(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Y(this,"getExpressionConverter",(e,n)=>({convertFrom:(o,r,i,a)=>{const b=i.getExpressionRuleValue(e,n||r);return b&&b.value||""},convertTo:(o,r,i,a,b)=>{var d;if(r==="dataPicking"&&(i!=null&&i.target)){const m=`${i.target}_dataPicking`;((d=i.rules)==null?void 0:d.some(l=>l.id===m&&l.value))?o.dictPickingExpressionId=m:delete o.dictPickingExpressionId}a.updateExpression(i)}}));this.formSchemaService=e}getExpressionRule(e,n){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(a=>a.target===e);if(!r)return"";const i=r.rules.find(a=>a.type===n);return i||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const n=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(n);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(i=>{r.push({key:i.code,name:i.name,description:i.name,category:i.category})}),r}createTreeNode(e,n,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:n,type:"field"}}buildEntityFieldsTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var b;const i=this.createTreeNode(r,n);let a=[];(b=r.type)!=null&&b.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...n,r.label])),o.push({data:i,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var d,m;const i=this.createTreeNode(r,n);i.type="entity";const a=this.buildEntityFieldsTreeData((d=r.type)==null?void 0:d.fields,[...n,r.label]),b=this.buildChildEntityTreeData((m=r.type)==null?void 0:m.entities,[...n,r.label]);b!=null&&b.length&&(a==null||a.push(...b)),o.push({data:i,children:a||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const n=e[0];if(!(n!=null&&n.type))return[];const o=this.buildEntityFieldsTreeData(n.type.fields,[n.code]),r=this.buildChildEntityTreeData(n.type.entities,[n.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:n.code,fields:[{data:this.createTreeNode(n,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,n,o){const r=o==="Field"?e.binding.field:e.id,i=this.getExpressionRule(r,n),a=this.getEntitiesAndVariables(),b={message:["validate","required","dataPicking"].includes(n)&&i?i.message:"",...a};return i.messageType!=null&&(b.messageType=i.messageType),b}buildRule(e,n,o,r){const{expression:i,message:a,messageType:b}=n,d={id:`${e}_${o}`,type:o,value:i};return(o==="validate"||o==="dataPicking"||o==="required")&&(d.message=a),o==="dataPicking"&&(d.messageType=b),o==="validate"&&r&&(d.elementId=r),d}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,o,r){const i=n==="Field"?e.binding.field:e.id,a=this.buildRule(i,o,r,e.type==="form-group"?e.id:"");let d=this.getExpressionData().find(y=>y.targetType===n&&y.target===i);const m=y=>y.value.trim()==="";if(d){const y=d.rules.find(l=>l.id===a.id);if(y)m(a)?d.rules=d.rules.filter(l=>l.id!==a.id):(Object.assign(y,a),r==="validate"&&e.type==="form-group"&&(y.elementId=e.id));else{if(m(a))return null;d.rules=d.rules||[],d.rules.push(a)}}else{if(m(a))return null;d={target:`${i}`,rules:[a],targetType:n}}return d}getExpressionEditorOptions(e,n,o,r){return o.reduce((i,a)=>{var d,m;const b=n==="Field"?(d=e==null?void 0:e.binding)==null?void 0:d.field:e.id;return i[a]={hide:n==="Field"?!!((m=e==null?void 0:e.binding)!=null&&m.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(b),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[a]}编辑器`,showMessage:a==="validate"||a==="dataPicking"||a==="required",showMessageType:a==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,a,n),onSubmitModal:y=>{const l=this.updateExpression(e,n,y,a);if(r){const f=this.buildRule(b,y,a);r(f)}return l}}},i},{})}getExpressionInfo(e,n,o){const r=n==="Field"?e.binding.field:e.id,i=this.getExpressionRule(r,o),a={value:i&&i.value,targetId:r,targetType:n,expressionType:o};return i&&i.message&&(a.message=i.message),a}getExpressionConfig(e,n,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,n,o,r)}}}getExpressionOptions(e,n,o){const r=this.getExpressionInfo(e,n,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,n),expressionInfo:r}}}class ke{constructor(e,n){Y(this,"componentId");Y(this,"viewModelId");Y(this,"eventsEditorUtils");Y(this,"formSchemaUtils");Y(this,"formMetadataConverter");Y(this,"designViewModelUtils");Y(this,"designViewModelField");Y(this,"controlCreatorUtils");Y(this,"designerHostService");Y(this,"designerContext");Y(this,"schemaService",null);Y(this,"metadataService",null);Y(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService,this.designerContext=n.designerContext}getFormDesignerInstance(){var e,n;return(n=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:n.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const n=e.binding&&e.binding.type==="Form"&&e.binding.field;if(n){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===n)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:Ee[e.type]&&Ee[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},o){const r={title:"外观",description:"Appearance"},i={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const a in n)i[a]=Object.assign(i[a]||{},n[a]);return{...r,properties:{...i},setPropertyRelates(a,b){if(a){switch(a&&a.propertyID){case"class":case"style":{Ce.value++;break}}o&&o(a,e,b)}}}}getPropertyEditorParams(e,n=[],o="visible",r={},i={},a=""){const{getVariables:b,getControlName:d,getStateMachines:m}=mn(this.designerHostService),y=this.getRealTargetType(e),l=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:l};return l.map(g=>{switch(g){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,y,a||o);break;case"StateMachine":f.stateMachines=m();break;case"Variable":Object.assign(f,{controlName:d(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:b(this.viewModelId),onBeforeOpenVariables:u=>{u.value=b(this.viewModelId)}},i);break}}),f}getVisibleProperty(e,n=""){var i;let o=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?o=["Const","Expression"]:n==="form-group"&&!((i=e.binding)!=null&&i.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,n="",o={},r){const i={title:"行为",description:""},a=this.getVisibleProperty(e,n);for(const d in o)a[d]=Object.assign(a[d]||{},o[d]);const b=this;return{...i,properties:{...a},setPropertyRelates(d,m){if(d){switch(d.propertyID){case"disabled":case"readonly":case"visible":b.afterMutilEditorChanged(e,d);break}r&&r(d,m)}}}}afterMutilEditorChanged(e,n){this.addNewVariableToViewModel(n,this.viewModelId),this.updateExpressionValue(n),this.clearExpression(n,e)}updateElementByParentContainer(e,n){const o=n&&n.parent&&n.parent.schema;if(!o)return;const r=o.contents.findIndex(a=>a.id===e),i=de.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,i),un()}addNewVariableToViewModel(e,n){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const a={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(a.code)||this.formSchemaUtils.getViewModelById(n).states.push(a)}updateExpressionValue(e){const n=e.propertyValue;if(!((n&&n.type)==="Expression"&&n.expressionInfo))return;const{expressionId:i,expressionInfo:a}=n,{targetId:b,targetType:d,expressionType:m,value:y,message:l}=a,f=this.formSchemaUtils.getModule();f.expressions=f.expressions||[];const{expressions:g}=f;let u=g.find(S=>S.target===b);u||(u={target:b,rules:[],targetType:d},g.push(u));const s=u.rules.find(S=>S.type===m);if(s)s.value=y,s.message=l;else{const S={id:i,type:m,value:y,message:l};u.rules.push(S)}delete n.expressionInfo}clearExpression(e,n){const o=e.propertyValue;if(o&&o.type==="Expression")return;const i=e.propertyID,a=this.formSchemaUtils.getExpressions(),b=n.binding?n.binding.field:n.id,d=a.find(m=>m.target===b);!d||!d.rules||(d.rules=d.rules.filter(m=>m.type!==i))}getExpressionOptions(e,n,o){return new hn(this.formSchemaUtils).getExpressionOptions(e,n,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const n={};return n[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},n}}class bn extends ke{constructor(n,o,r="response-toolbar"){super(n,o);Y(this,"toolbarType","response-toolbar");this.toolbarType=r}getPropertyConfig(n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.toolbarType!=="tab-toolbar"&&this.getAppearancePropConfig(n),this.propertyConfig.categories.behavior=this.getBehaviorConfig(n),this.propertyConfig}getAppearancePropConfig(n){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}}}}getBehaviorProperties(n){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 vn(t,e,n){const o=t.schema;function r(){var s;let u=((s=t.parent)==null?void 0:s.schema.type)||"";["page-header","tabs","section"].findIndex(S=>S===u)===-1&&(u=""),n.toolbarPosition=u}r();function i(u){return!1}function a(u,s){return s.text=u.label,s}function b(){return!1}function d(){return!1}function m(){return!1}function y(){return!0}function l(u){return new bn(u,e,o.type).getPropertyConfig(o)}function f(u){var k;u&&(u.stopPropagation(),u.preventDefault());const{schema:s}=t;s.buttons||(s.buttons=[]);let S="";if(s.type)S=s.type+"-item";else{const F=(k=t.parent)==null?void 0:k.schema.type;S=F==="tabs"?"tab-toolbar-item":F==="section"?"section-toolbar-item":"response-toolbar-item"}const R=Ye(S);R.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,s.buttons.push(R),n.updateToolbarItems(),n.changeSelectedId("")}function g(){return[{id:"appendItem",title:"新增按钮",text:"",icon:"f-icon f-icon-plus-circle text-white",onClick:u=>f(u)}]}return{canAccepts:i,checkCanAddComponent:m,checkCanDeleteComponent:d,checkCanMoveComponent:b,hideNestedPaddingInDesginerView:y,onResolveNewComponentSchema:a,getPropsConfig:l,getCustomButtons:g}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ie(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var at={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(o,r,i){function a(m,y){if(!r[m]){if(!o[m]){var l=typeof Ie=="function"&&Ie;if(!y&&l)return l(m,!0);if(b)return b(m,!0);var f=new Error("Cannot find module '"+m+"'");throw f.code="MODULE_NOT_FOUND",f}var g=r[m]={exports:{}};o[m][0].call(g.exports,function(u){var s=o[m][1][u];return a(s||u)},g,g.exports,n,o,r,i)}return r[m].exports}for(var b=typeof Ie=="function"&&Ie,d=0;d<i.length;d++)a(i[d]);return a}return n}()({1:[function(n,o,r){var i={},a="(?:^|\\s)",b="(?:\\s|$)";function d(l){var f=i[l];return f?f.lastIndex=0:i[l]=f=new RegExp(a+l+b,"g"),f}function m(l,f){var g=l.className;g.length?d(f).test(g)||(l.className+=" "+f):l.className=f}function y(l,f){l.className=l.className.replace(d(f)," ").trim()}o.exports={add:m,rm:y}},{}],2:[function(n,o,r){(function(i){var a=n("contra/emitter"),b=n("crossvent"),d=n("./classes"),m=document,y=m.documentElement;function l(v,I){var h=arguments.length;h===1&&Array.isArray(v)===!1&&(I=v,v=[]);var w,N,T,B,L,q,W,_,Q,X=null,Z,z,ee=!1,V=0,U,j=I||{};j.moves===void 0&&(j.moves=k),j.accepts===void 0&&(j.accepts=k),j.invalid===void 0&&(j.invalid=Fn),j.containers===void 0&&(j.containers=v||[]),j.isContainer===void 0&&(j.isContainer=R),j.copy===void 0&&(j.copy=!1),j.copySortSource===void 0&&(j.copySortSource=!1),j.revertOnSpill===void 0&&(j.revertOnSpill=!1),j.removeOnSpill===void 0&&(j.removeOnSpill=!1),j.direction===void 0&&(j.direction="vertical"),j.ignoreInputTextSelection===void 0&&(j.ignoreInputTextSelection=!0),j.mirrorContainer===void 0&&(j.mirrorContainer=m.body);var H=a({containers:j.containers,start:On,end:pt,cancel:bt,remove:ht,destroy:Te,canMove:Vn,dragging:!1});return j.removeOnSpill===!0&&H.on("over",An).on("out",$n),ie(),H;function se(x){return H.containers.indexOf(x)!==-1||j.isContainer(x)}function ie(x){var A=x?"remove":"add";u(y,A,"mousedown",ve),u(y,A,"mouseup",Re)}function oe(x){var A=x?"remove":"add";u(y,A,"mousemove",ye)}function ne(x){var A=x?"remove":"add";b[A](y,"selectstart",le),b[A](y,"click",le)}function Te(){ie(!0),Re({})}function le(x){Z&&x.preventDefault()}function ve(x){B=x.clientX,L=x.clientY;var A=s(x)!==1||x.metaKey||x.ctrlKey;if(!A){var $=x.target,G=Se($);G&&(Z=G,oe(),x.type==="mousedown"&&(O($)?$.focus():x.preventDefault()))}}function ye(x){if(Z){if(s(x)===0){Re({});return}if(!(x.clientX!==void 0&&Math.abs(x.clientX-B)<=(j.slideFactorX||0)&&x.clientY!==void 0&&Math.abs(x.clientY-L)<=(j.slideFactorY||0))){if(j.ignoreInputTextSelection){var A=C("clientX",x)||0,$=C("clientY",x)||0,G=m.elementFromPoint(A,$);if(O(G))return}var J=Z;oe(!0),ne(),pt(),ft(J),d.add(_||T,"gu-transit"),Ln(),_n(),V=0,Fe(x)}}}function Se(x){if(!(H.dragging&&w)&&!se(x)){for(var A=x;P(x)&&se(P(x))===!1;)if(j.invalid(x,A)||(x=P(x),!x))return;var $=P(x);if($&&!j.invalid(x,A)){var G=j.moves(x,$,A,p(x));if(G)return{item:x,source:$}}}}function Vn(x){return!!Se(x)}function On(x){var A=Se(x);A&&ft(A)}function ft(x){Hn(x.item,x.source)&&(_=x.item.cloneNode(!0),H.emit("cloned",_,x.item,"copy")),N=x.source,T=x.item,q=W=p(x.item),H.dragging=!0,H.emit("drag",T,N)}function Fn(){return!1}function pt(){if(H.dragging){var x=_||T;mt(x,P(x))}}function gt(){Z=!1,oe(!0),ne(!0)}function Re(x){if(gt(),!!H.dragging){var A=_||T,$=C("clientX",x)||0,G=C("clientY",x)||0,J=S(w,$,G),K=vt(J,$,G);K&&(_&&j.copySortSource||!_||K!==N)?mt(A,K):j.removeOnSpill?ht():bt()}}function mt(x,A){var $=P(x);_&&j.copySortSource&&A===N&&$.removeChild(T),Oe(A)?H.emit("cancel",x,N):H.emit("drop",x,A,N,W),Ve()}function ht(){if(H.dragging){var x=_||T,A=P(x);A&&A.removeChild(x),H.emit(_?"cancel":"remove",x,A,N),Ve()}}function bt(x){if(H.dragging){var A=arguments.length>0?x:j.revertOnSpill,$=_||T,G=P($),J=Oe(G);J===!1&&A&&(_?G&&G.removeChild(_):N.insertBefore($,q)),J||A?H.emit("cancel",$,N,N):H.emit("drop",$,G,N,W),Ve()}}function Ve(){var x=_||T;gt(),qn(),Wn(),x&&d.rm(x,"gu-transit"),Q&&clearTimeout(Q),H.dragging=!1,X&&H.emit("out",x,X,N),H.emit("dragend",x,V),N=T=_=q=W=Q=X=null}function Oe(x,A){var $;return A!==void 0?$=A:w?$=W:$=p(_||T),x===N&&$===q}function vt(x,A,$){for(var G=x;G&&!J();)G=P(G);return G;function J(){var K=se(G);if(K===!1)return!1;var ge=yt(G,x),ue=Ct(G,ge,A,$),pe=Oe(G,ue);return pe?!0:j.accepts(T,G,N,ue)}}function Fe(x){if(!w)return;x.preventDefault();var A=C("clientX",x)||0,$=C("clientY",x)||0;w.style.left=A-2+"px",w.style.top=$-2+"px";var G=_||T,J=S(w,A,$),K=vt(J,A,$),ge=K!==null&&K!==X;(ge||K===null)&&(fe(),X=K,be()),Xn(J,$);var ue=P(G);if(K===N&&_&&!j.copySortSource){ue&&ue.removeChild(G);return}var pe,he=yt(K,J);if(ee=Un(he,K),he!==null)pe=Ct(K,he,A,$);else if(j.revertOnSpill===!0&&!_)pe=q,K=N;else{_&&ue&&ue.removeChild(G),_&&z&&(z.style.display="none");return}z.style.display="block",jn(pe,G,ge),pe?Gn(he,pe):Yn(K);function ae(ce){H.emit(ce,G,X,N)}function be(){ge&&ae("over")}function fe(){X&&ae("out")}}function jn(x,A,$){(x===A||x===p(A))&&(W=p(A)),(x===null&&$||x!==A&&x!==p(A))&&(W=x)}function An(x){d.rm(x,"gu-hide")}function $n(x){H.dragging&&d.add(x,"gu-hide")}function _n(){w||(w=document.createElement("div"),w.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;",w.innerHTML=j.getMirrorText&&j.getMirrorText(T)||"控件",d.add(w,"gu-mirror"),j.mirrorContainer.appendChild(w),u(y,"add","mousemove",Fe),d.add(j.mirrorContainer,"gu-unselectable"),H.emit("cloned",w,T,"mirror"))}function Ln(){if(z=document.createElement("div"),d.add(z,"gu-insertion"),T){var x=T.getBoundingClientRect();z.style.left=x.left+"px",z.style.top=x.top+"px"}ee=!1,j.mirrorContainer.appendChild(z)}function qn(){w&&(d.rm(j.mirrorContainer,"gu-unselectable"),u(y,"remove","mousemove",Fe),P(w).removeChild(w),w=null)}function Wn(){z&&(P(z).removeChild(z),z=null)}function yt(x,A){for(var $=A;$!==x&&P($)!==x;)$=P($);return $===y?null:$}function Un(x,A){if(!A)return ee;var $=x||A&&A.lastElementChild;if(!$)return!0;var G=getComputedStyle(x),J=/^inline/.test(G.getPropertyValue("display"))||/^(left|right)$/.test(G.getPropertyValue("float"));if(J)return!0;if(A){var K=getComputedStyle(A),ge=K.getPropertyValue("display");if(/flex$/.test(ge)){var ue=K.getPropertyValue("flex-direction")||"row";if(ue==="row"||ue==="row-reverse")return!zn(A)}return!1}return!0}function zn(x){if(!x.children||!x.children.length)return!1;for(const A of Array.from(x.children)){const G=(A.className&&A.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!G.length)return!1;for(const J of G){const K=J.slice(J.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function Gn(x,A){const $=A.getBoundingClientRect();if(z.style.left=$.left+"px",z.style.top=$.top+"px",ee){if(z.style.height=$.height+"px",z.style.width="4px",x){const G=x.getBoundingClientRect();G.top!==$.top&&(z.style.left=G.right+"px",z.style.top=G.top+"px",z.style.height=G.height+"px")}}else if(z.style.height="4px",z.style.width=$.width+"px",U){const G=U.getBoundingClientRect();$.top<G.top&&(z.style.display="none")}A===T&&T&&(z.style.display="none")}function Yn(x){W=null;var A=x.lastElementChild;if(A){var $=A.getBoundingClientRect();ee?(z.style.left=$.right+"px",z.style.top=$.top+"px",z.style.height=$.height+"px",z.style.width="4px"):(z.style.left=$.left+"px",z.style.top=$.bottom+"px",z.style.height="4px",z.style.width=$.width+"px"),A===T&&T&&(z.style.display="none")}else z.style.display="none"}function Xn(x,A){if(!j.mirrorContainer.contains(x)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(U=f(x),!U||!U.contains(x)))return;const $=document.querySelector(".dgComponentSelected"),G=U.getBoundingClientRect();if(A-30<G.top&&U.scrollTop>0){let J=U.scrollTop<10?U.scrollTop:10;U.scrollBy(0,-1*J),$&&U.contains($)&&(V=V+-1*J)}if(A+30>G.bottom&&U.scrollTop<U.scrollHeight-U.clientHeight){const J=U.scrollHeight-U.clientHeight-U.scrollTop;let K=J<10?J:10;U.scrollBy(0,K),$&&U.contains($)&&(V=V+K)}}function Ct(x,A,$,G){var J=j.direction==="horizontal",K=j.direction==="mixed",ge=A!==x?pe():ue();return ge;function ue(){var ae=x.children.length,be,fe,ce;for(be=0;be<ae;be++)if(fe=x.children[be],ce=fe.getBoundingClientRect(),J&&ce.left+ce.width/2>$||!K&&!J&&ce.top+ce.height/2>G||K&&ce.left+ce.width>$&&ce.top+ce.height>G)return fe;return null}function pe(){var ae=A.getBoundingClientRect();if(K){var be=G-ae.top,fe=$-ae.left,ce=ae.bottom-G,je=ae.right-$,Ae=Math.min(fe,je,be,ce),$e;return ee?$e=je<fe:$e=ce===Ae||je===Ae||fe===Ae,he($e)}return he(J?$>ae.left+F(ae)/2:G>ae.top+M(ae)/2)}function he(ae){return ae?p(A):A}}function Hn(x,A){return typeof j.copy=="boolean"?j.copy:j.copy(x,A)}}function f(v){const I=Array.from(window.scrollContainerList);if(I.length===1){const w=Array.from(window.scrollContainerList)[0];return document.getElementById(w)}const h=g(I);for(const w of h)if(w.contains(v))return w;return null}function g(v){const I=[];return v.forEach(h=>{const w=document.getElementById(h);w&&I.push(w)}),I.sort((h,w)=>h.contains(w)?1:w.contains(h)?-1:0),I}function u(v,I,h,w){var N={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},T={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};i.navigator.pointerEnabled?b[I](v,T[h],w):i.navigator.msPointerEnabled?b[I](v,B[h],w):(b[I](v,N[h],w),b[I](v,h,w))}function s(v){if(v.touches!==void 0)return v.touches.length;if(v.which!==void 0&&v.which!==0)return v.which;if(v.buttons!==void 0)return v.buttons;var I=v.button;if(I!==void 0)return I&1?1:I&2?3:I&4?2:0}function S(v,I,h){v=v||{};var w=v.className||"",N;return v.className+=" gu-hide",N=m.elementFromPoint(I,h),v.className=w,N}function R(){return!1}function k(){return!0}function F(v){return v.width||v.right-v.left}function M(v){return v.height||v.bottom-v.top}function P(v){return v.parentNode===m?null:v.parentNode}function O(v){return v.tagName==="INPUT"||v.tagName==="TEXTAREA"||v.tagName==="SELECT"||E(v)}function E(v){return!v||v.contentEditable==="false"?!1:v.contentEditable==="true"?!0:E(P(v))}function p(v){return v.nextElementSibling||I();function I(){var h=v;do h=h.nextSibling;while(h&&h.nodeType!==1);return h}}function D(v){return v.targetTouches&&v.targetTouches.length?v.targetTouches[0]:v.changedTouches&&v.changedTouches.length?v.changedTouches[0]:v}function C(v,I){var h=D(I),w={pageX:"clientX",pageY:"clientY"};return v in w&&!(v in h)&&w[v]in h&&(v=w[v]),h[v]}o.exports=l}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,o,r){o.exports=function(a,b){return Array.prototype.slice.call(a,b)}},{}],4:[function(n,o,r){var i=n("ticky");o.exports=function(b,d,m){b&&i(function(){b.apply(m||null,d||[])})}},{ticky:10}],5:[function(n,o,r){var i=n("atoa"),a=n("./debounce");o.exports=function(d,m){var y=m||{},l={};return d===void 0&&(d={}),d.on=function(f,g){return l[f]?l[f].push(g):l[f]=[g],d},d.once=function(f,g){return g._once=!0,d.on(f,g),d},d.off=function(f,g){var u=arguments.length;if(u===1)delete l[f];else if(u===0)l={};else{var s=l[f];if(!s)return d;s.splice(s.indexOf(g),1)}return d},d.emit=function(){var f=i(arguments);return d.emitterSnapshot(f.shift()).apply(this,f)},d.emitterSnapshot=function(f){var g=(l[f]||[]).slice(0);return function(){var u=i(arguments),s=this||d;if(f==="error"&&y.throws!==!1&&!g.length)throw u.length===1?u[0]:u;return g.forEach(function(R){y.async?a(R,u,s):R.apply(s,u),R._once&&d.off(f,R)}),d}},d}},{"./debounce":4,atoa:3}],6:[function(n,o,r){(function(i){var a=n("custom-event"),b=n("./eventmap"),d=i.document,m=f,y=u,l=[];i.addEventListener||(m=g,y=s),o.exports={add:m,remove:y,fabricate:S};function f(P,O,E,p){return P.addEventListener(O,E,p)}function g(P,O,E){return P.attachEvent("on"+O,k(P,O,E))}function u(P,O,E,p){return P.removeEventListener(O,E,p)}function s(P,O,E){var p=F(P,O,E);if(p)return P.detachEvent("on"+O,p)}function S(P,O,E){var p=b.indexOf(O)===-1?C():D();P.dispatchEvent?P.dispatchEvent(p):P.fireEvent("on"+O,p);function D(){var v;return d.createEvent?(v=d.createEvent("Event"),v.initEvent(O,!0,!0)):d.createEventObject&&(v=d.createEventObject()),v}function C(){return new a(O,{detail:E})}}function R(P,O,E){return function(D){var C=D||i.event;C.target=C.target||C.srcElement,C.preventDefault=C.preventDefault||function(){C.returnValue=!1},C.stopPropagation=C.stopPropagation||function(){C.cancelBubble=!0},C.which=C.which||C.keyCode,E.call(P,C)}}function k(P,O,E){var p=F(P,O,E)||R(P,O,E);return l.push({wrapper:p,element:P,type:O,fn:E}),p}function F(P,O,E){var p=M(P,O,E);if(p){var D=l[p].wrapper;return l.splice(p,1),D}}function M(P,O,E){var p,D;for(p=0;p<l.length;p++)if(D=l[p],D.element===P&&D.type===O&&D.fn===E)return p}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,o,r){(function(i){var a=[],b="",d=/^on/;for(b in i)d.test(b)&&a.push(b.slice(2));o.exports=a}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,o,r){(function(i){var a=i.CustomEvent;function b(){try{var d=new a("cat",{detail:{foo:"bar"}});return d.type==="cat"&&d.detail.foo==="bar"}catch{}return!1}o.exports=b()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(m,y){var l=document.createEvent("CustomEvent");return y?l.initCustomEvent(m,y.bubbles,y.cancelable,y.detail):l.initCustomEvent(m,!1,!1,void 0),l}:function(m,y){var l=document.createEventObject();return l.type=m,y?(l.bubbles=!!y.bubbles,l.cancelable=!!y.cancelable,l.detail=y.detail):(l.bubbles=!1,l.cancelable=!1,l.detail=void 0),l}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,o,r){var i=o.exports={},a,b;function d(){throw new Error("setTimeout has not been defined")}function m(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=d}catch{a=d}try{typeof clearTimeout=="function"?b=clearTimeout:b=m}catch{b=m}})();function y(M){if(a===setTimeout)return setTimeout(M,0);if((a===d||!a)&&setTimeout)return a=setTimeout,setTimeout(M,0);try{return a(M,0)}catch{try{return a.call(null,M,0)}catch{return a.call(this,M,0)}}}function l(M){if(b===clearTimeout)return clearTimeout(M);if((b===m||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(M);try{return b(M)}catch{try{return b.call(null,M)}catch{return b.call(this,M)}}}var f=[],g=!1,u,s=-1;function S(){!g||!u||(g=!1,u.length?f=u.concat(f):s=-1,f.length&&R())}function R(){if(!g){var M=y(S);g=!0;for(var P=f.length;P;){for(u=f,f=[];++s<P;)u&&u[s].run();s=-1,P=f.length}u=null,g=!1,l(M)}}i.nextTick=function(M){var P=new Array(arguments.length-1);if(arguments.length>1)for(var O=1;O<arguments.length;O++)P[O-1]=arguments[O];f.push(new k(M,P)),f.length===1&&!g&&y(R)};function k(M,P){this.fun=M,this.array=P}k.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function F(){}i.on=F,i.addListener=F,i.once=F,i.off=F,i.removeListener=F,i.removeAllListeners=F,i.emit=F,i.prependListener=F,i.prependOnceListener=F,i.listeners=function(M){return[]},i.binding=function(M){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(M){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],10:[function(n,o,r){(function(i){var a=typeof i=="function",b;a?b=function(d){i(d)}:b=function(d){setTimeout(d,0)},o.exports=b}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,o,r){(function(i,a){var b=n("process/browser.js").nextTick,d=Function.prototype.apply,m=Array.prototype.slice,y={},l=0;r.setTimeout=function(){return new f(d.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new f(d.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(g){g.close()};function f(g,u){this._id=g,this._clearFn=u}f.prototype.unref=f.prototype.ref=function(){},f.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(g,u){clearTimeout(g._idleTimeoutId),g._idleTimeout=u},r.unenroll=function(g){clearTimeout(g._idleTimeoutId),g._idleTimeout=-1},r._unrefActive=r.active=function(g){clearTimeout(g._idleTimeoutId);var u=g._idleTimeout;u>=0&&(g._idleTimeoutId=setTimeout(function(){g._onTimeout&&g._onTimeout()},u))},r.setImmediate=typeof i=="function"?i:function(g){var u=l++,s=arguments.length<2?!1:m.call(arguments,1);return y[u]=!0,b(function(){y[u]&&(s?g.apply(null,s):g.call(null),r.clearImmediate(u))}),u},r.clearImmediate=typeof a=="function"?a:function(g){delete y[g]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(at);var Cn=at.exports;const lt=yn(Cn);function wn(t){let e;function n(r,i,a,b){const d=t.schema;if(!(d!=null&&d.buttons))return;let m;if(a){const g=a.getAttribute("id");m=Array.from(i.children).findIndex(u=>u.getAttribute("id")===g)}else m=Array.from(i.children).length;const y=r.getAttribute("id"),l=Array.from(i.children).findIndex(g=>g.getAttribute("id")===y),f=d.buttons[l];l!==m&&l>-1&&m>-1&&(l<m&&(m=m-1),d.buttons.splice(l,1),d.buttons.splice(m,0,f),b(),c.nextTick(()=>{const g=i.querySelector(".dgComponentSelected");g!=null&&g.className.includes("dgComponentSelected")&&(g.classList.remove("dgComponentSelected"),g.classList.remove("dgComponentFocused"),g.click()),Ce.value++}))}function o(r,i,a){e&&e.destroy(),!(!lt||!r||!i)&&(e=lt([r],{mirrorContainer:i,direction:"horizontal",getMirrorText(b){return b.innerText},moves(b,d,m){let y=!0;return m.classList.contains("dropdown-item")?(y=!1,y):(b.classList.contains("no-drag")&&(y=!1),y)}}).on("drop",(b,d,m,y)=>n(b,d,y,a)))}return{dragulaInstance:e,initDragula:o}}function xn(t,e,n){const{renderToolbarItemDesigner:o,actionHandlers:r}=n;let i;function a(k){i=k}function b(k,F=null){const M=e.value.find(P=>P.id===k.id);if(M.isDP)if(document.body.click(),typeof F=="boolean")M.expanded=F;else{const P=k.expanded;M.expanded=!P}}r.toggleDropdownMenu=b;function d(k){var M;const F={"dropdown-menu":!0};if(k.class){const P=(M=k.menuClass)==null?void 0:M.split(" ");P&&P.length&&P.reduce((O,E)=>(O[E]=!0,O),F)}return F}function m(k){var P;const F={disabled:k.disabled===!1,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},M=(P=k.dropdownClass)==null?void 0:P.split(" ");return M&&M.length&&M.reduce((O,E)=>(O[E]=!0,O),F),F}function y(k){const F={disabled:!1,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0,"text-truncate":!0},M=(k.class||"").split(" ");return M&&M.length&&M.reduce((P,O)=>(P[O]=!0,P),F),F}let l;const f=new Map;function g(k,F,M){k.stopPropagation();const P=M?M.id:"__top_item__";if(F.children&&F.children.length&&(F.expanded=!F.expanded,F.expanded)){if(f.has(P)&&f.get(P)!==F){const O=f.get(P);O&&(O.expanded=!1,f.delete(P))}f.set(P,F)}}function u(k){var F;return(F=k.children)==null?void 0:F.map((M,P)=>M.children&&M.children.length?c.createVNode("li",{class:m(M),id:M.id},[c.createVNode("span",{class:y(M),onClick:O=>g(O,M,k)},[M.text,c.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),l(M,M)]):o(M,P,!0))}function s(k,F,M,P){const{height:p,left:D,top:C}=P[0],{width:v,height:I}=M.getBoundingClientRect(),{marginTop:h,marginBottom:w}=getComputedStyle(M),N=Math.ceil(parseFloat(h))+Math.ceil(parseFloat(w)),T=C+p,B=F==null?void 0:F.getBoundingClientRect();function L(){let Q=0,X="left";const Z=B?B.right:window.innerWidth,z=B?B.left:0;return Q=Z-D-10,Z-D<v&&D-z>Z-D&&(X="right",Q=D-z-10),{hposition:X,maxWidth:Math.min(Q,300)}}let q=0,W="bottom";if(k==="tabs"||k==="section")q=F.getBoundingClientRect().bottom-T-N-10;else{const Q=B?B.bottom:window.innerHeight;q=k==="page-header"?Q-T:C,q=q-N-10,W=k==="page-header"?"bottom":"top"}const _=L();return{position:W+"-"+_.hposition,maxWidth:_.maxWidth,maxHeight:q}}function S(k){var E,p,D;const F="300px",M={display:k.expanded===!0?"block":"none",position:"absolute",maxWidth:F,minWidth:"120px"};if(!(i!=null&&i.value))return M;const P=i.value.querySelector("#"+k.id),O=P==null?void 0:P.getClientRects();if(P&&O&&O.length>0){const C=P?P.querySelector("#"+k.id+"_menu"):null;if(!C||k.expanded!==!0)return M;C.style.visibility="hidden",C.style.display="block",C.style.maxHeight="auto",C.style.maxWidth=F;let v;switch(r.toolbarPosition){case"tabs":v=(E=i.value)==null?void 0:E.closest(".farris-tabs");break;case"section":v=(p=i.value)==null?void 0:p.closest(".f-section");break;default:v=(D=i.value)==null?void 0:D.closest(".f-page")}const I=s(r.toolbarPosition,v,C,O),{position:h,maxHeight:w,maxWidth:N}=I;C.style.visibility="visible";const T={left:h.indexOf("left")>-1?0:"unset",right:h.indexOf("left")>-1?"unset":0,bottom:h.indexOf("bottom")>-1?"unset":"100%",top:h.indexOf("bottom")>-1?"!00%":"unset",maxWidth:N?N+"px":"300px",maxHeight:w?w+"px":"auto",overflowY:w?"auto":"unset"};Object.assign(M,T)}return M}r.changeMenuPosition=S,l=function(k,F){return c.createVNode("ul",{class:d(k),style:S(k),id:k.id+"_menu"},[u(k)])};function R(k=""){k&&f.has(k)?f.forEach((F,M)=>{M!==k&&(F.expanded=!1,f.delete(M))}):(f.forEach(F=>{F.expanded=!1}),f.clear())}return{renderDropdownMenu:l,clearAllDropDownMenu:R,setResponseToolbarRef:a}}const Tn={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 Sn(t,e,n){var D;const o="",r=c.ref();let i;function a(){return!0}function b(){return!1}function d(){return!0}function m(){return!0}function y(){return!0}function l(C){if(!C||!C.value)return null;const v=c.ref(C==null?void 0:C.value.parent),I=l(v);return I||null}function f(C=e){var w;const{componentInstance:v,designerItemElementRef:I}=C;if(!v||!v.value)return null;const{getCustomButtons:h}=v.value;return v.value.canMove||v.value.canAdd||v.value.canDelete||h&&((w=h())!=null&&w.length)?I:f(C.parent)}function g(){}function u(C){return!!n}function s(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function S(){}function R(C,v){}function k(C){const{componentType:v}=C,I=c.inject("designer-host-service");let h=xt.getSchemaByTypeForDesigner(v,C,I);const w=v.toLowerCase().replace(/-/g,"_");return h&&!h.id&&h.type===v&&(h.id=`${w}_${Math.random().toString().slice(2,6)}`),h}function F(C){}function M(...C){return[]}function P(){}function O(C){var I;if(!(e!=null&&e.schema))return;let v="";{const{text:h,title:w,label:N,mainTitle:T,name:B,type:L}=e.schema;v=h||w||N||T||B||((I=Ee[L])==null?void 0:I.name)}v&&(!i&&C&&(i=C.formSchemaUtils),i.getControlBasicInfoMap().set(e.schema.id,{componentTitle:v,parentPathName:v}))}function E(C){var w;const{changeObject:v}=C,{propertyID:I,propertyValue:h}=v;["text","title","label","name","mainTitle"].includes((w=C==null?void 0:C.changeObject)==null?void 0:w.propertyID)&&I&&h&&O()}function p(C){E(C)}return r.value={canMove:a(),canSelectParent:b(),canAdd:m(),canDelete:d(),canNested:!y(),contents:[],elementRef:t,parent:(D=e.parent)==null?void 0:D.componentInstance,schema:e.schema,styles:o,canAccepts:u,getBelongedComponentInstance:l,getDraggableDesignItemElement:f,getDraggingDisplayText:s,getPropConfig:M,getDragScopeElement:S,onAcceptMovedChildElement:R,onChildElementMovedOut:F,addNewChildComponentSchema:k,onRemoveComponent:P,triggerBelongedComponentToMoveWhenMoved:c.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:c.ref(!1),onPropertyChanged:p,getCustomButtons:g,setComponentBasicInfoMap:O},r}const En=c.defineComponent({name:"FDesignerInnerItem",props:Tn,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,e){const n=c.ref(t.canMove),o=c.ref(t.canAdd),r=c.ref(t.canDelete),i=c.ref(!1),a=c.ref(t.contentKey),b=c.ref(t.childType),d=c.ref(t.childLabel),m=c.ref(t.modelValue),y=c.ref(""),l=c.ref(),f=c.inject("canvas-dragula"),g=c.ref(),u=c.inject("design-item-context"),s={designerItemElementRef:l,componentInstance:g,schema:m.value,parent:u,setupContext:e};c.provide("design-item-context",s);const S=c.inject("designer-host-service"),R=c.inject("external-container-id"),k=c.computed(()=>{var L;const T=((L=g.value)==null?void 0:L.getCustomButtons)&&g.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||r.value||(T==null?void 0:T.length),"farris-nested":i.value,"can-move":n.value,"d-none":l.value&&l.value.classList.contains("d-none")}}),F=c.computed(()=>{const T={};return y.value&&y.value.split(";").reduce((B,L)=>{const[q,W]=L.split(":");return q&&(B[q]=W),B},T),T});function M(T,B){if(u&&u.schema[a.value]){const L=u.schema[a.value].findIndex(q=>q.id===B.id);if(L>-1){const q=u.schema[a.value].length,W=u.schema[a.value][L%q];u.designerItemElementRef.value.querySelector(`#${W.id}-design-item`),u.schema[a.value].splice(L,1),Ce.value++,e.emit("removeComponent"),e.emit("selectionChange")}}}function P(T){if(g.value.addNewChildComponentSchema){const B={componentType:b.value,label:d.value,parentComponentInstance:g.value,targetPosition:-1},L=g.value.addNewChildComponentSchema(B);m.value[a.value].push(L),e.emit("addComponent")}}function O(){return o.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:T=>{P()}},[c.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function E(T){return r.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:c.withModifiers(B=>M(B,T),["stop"])},[c.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function p(){return n.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[c.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function D(){var B;const T=((B=g.value)==null?void 0:B.getCustomButtons)&&g.value.getCustomButtons();return T&&!!T.length&&T.map(L=>c.createVNode("div",{role:"button",class:`btn component-settings-button ${L.class||""} ${L.text?"settings-button-extend":""}`,title:L.title,ref:L.id,onClick:q=>L.onClick&&L.onClick(q)},[c.createVNode("i",{class:"f-icon "+L.icon},null),L.text&&c.createVNode("span",{class:"icon-text"},[L.text])]))}function C(T){return c.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[c.createVNode("div",null,[O(),p(),E(T),D()])])}c.watch(()=>t.modelValue,T=>{m.value=T,s.schema=T});function v(T){window.scrollContainerList||(window.scrollContainerList=new Set);const B=T.getAttribute("id");B&&window.scrollContainerList.add(B)}function I(T){const B=T.target;v(B),gn(B)}function h(){var T,B;(B=(T=m.value)==null?void 0:T.contents)!=null&&B.length&&l.value&&l.value.addEventListener("scroll",I)}function w(){const T=l.value,B=c.ref(T.children[1]);return Sn(B,s).value}c.onMounted(()=>{if(l.value){const T=l.value.querySelector(`[data-dragref='${m.value.id}-container']`);g.value=T&&T.componentInstance?T.componentInstance.value:w(),f&&T&&f.attachComponents(T,m.value),i.value=g.value.canNested!==void 0?g.value.canNested:i.value,o.value=g.value.canAdd!==void 0?g.value.canAdd:o.value,r.value=g.value.canDelete!==void 0?g.value.canDelete:r.value,n.value=g.value.canMove!==void 0?g.value.canMove:n.value,y.value=g.value.styles||"",l.value&&(l.value.componentInstance=g,l.value.designItemContext=s),g.value.setComponentBasicInfoMap(S)}h(),Ce.value++}),c.onBeforeUnmount(()=>{l.value&&l.value.removeEventListener("scroll",I)});function N(T){if(T&&(T.preventDefault(),T.stopPropagation()),R){const q=document.getElementById(`${R}-design-item`);q&&q.click();return}let B=s.designerItemElementRef;const L=l.value;if(L){const q=document.getElementsByClassName("dgComponentFocused");q&&q.length===1&&q[0]===l.value&&l.value.classList.contains("dgComponentSelected")||(Array.from(q).forEach(_=>_.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(_=>_.classList.remove("dgComponentSelected")),L.classList.add("dgComponentFocused"),e.emit("selectionChange",m.value.type,m.value,t.componentId,g.value),g.value.getDraggableDesignItemElement&&(B=g.value.getDraggableDesignItemElement(s),B&&B.value&&B.value.classList.add("dgComponentSelected")))}st(B==null?void 0:B.value)}return()=>c.createVNode("div",{id:`${t.id}-design-item`,ref:l,class:k.value,style:F.value,onClick:N},[C(m.value),e.slots.default&&e.slots.default()])}});class In extends ke{constructor(e,n){super(e,n)}getPropertyConfig(e,n=!1){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(e,n),this.getbBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearanceProperties(e,n=!1){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式",visible:!n},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(e.children&&e.children.length>0)}}}}getbBehaviorConfig(e){const n=this.getPropertyEditorParams(e,["Const","Variable","StateMachine","Expression"],"disabled");this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:n}})}getEventPropConfig(e){const n=[{label:"onClick",name:"点击事件"}],o=this,r=o.eventsEditorUtils.formProperties(e,o.viewModelId,n),i=o.createBaseEventProperty(r);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,b){const d=a.propertyValue;delete e[o.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,d.events,d))}}}}class Pn extends ke{constructor(n,o,r="response-toolbar-item"){super(n,o);Y(this,"toolbarType","response-toolbar-item");this.toolbarType=r}getPropertyConfig(n,o=!1){this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.propertyConfig.categories.basic.setPropertyRelates=i=>{if(i)switch(i&&i.propertyID){case"text":{i.needRefreshControlTree=!0;break}}},this.getAppearanceProperties(n,o);const r=this.getPropertyEditorParams(n,["Const","Variable","StateMachine","Expression"],"disabled");return this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:r}}),this.getEventPropConfig(n),this.propertyConfig}getAppearanceProperties(n,o=!1){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"",$converter:"/converter/appearance.converter",parentPropertyID:"appearance",visible:!o},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(n.children&&n.children.length>0)},tipsEnable:{title:"启用提示",type:"boolean",description:"当启用提示时,鼠标滑过按钮会有消息提示框",refreshPanelAfterChanged:!0,visible:this.toolbarType==="response-toolbar-item"},tipsText:{title:"提示消息内容",type:"string",description:"消息提示框内的展示内容",visible:n.tipsEnable===!0}}}}getEventPropConfig(n){const o=[{label:"onClick",name:"点击事件"}],r=this,i=r.eventsEditorUtils.formProperties(n,r.viewModelId,o),a=r.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(b,d){const m=b.propertyValue;delete n[r.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(n,r.viewModelId,m.events,m))}}}}function Ne(t,e){if(!t)return!1;const n=e||[];return(n==null?void 0:n.findIndex(r=>r.id===t))===-1}function ct(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};return n.some((r,i)=>{if(r.children&&r.children.length>0){const a=r.children.findIndex(b=>b.id===t);return a>-1?(o={parentIndex:i,itemIndex:a},!0):!1}}),o}function dt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};const r=n==null?void 0:n.findIndex(i=>i.id===t);return r>-1?{parent:null,item:n[r]}:(n.some((i,a)=>{if(i.children&&i.children.length>0){const b=i.children.findIndex(d=>d.id===t);return b>-1?(o={parentIndex:a,itemIndex:b},!0):!1}}),o.parentIndex<0?{parent:null,item:null}:{parent:n[o.parentIndex],item:n[o.parentIndex].children[o.itemIndex]})}function Mn(t,e){const n=e||[],o=n==null?void 0:n.findIndex(r=>r.id===t);return o>-1&&n[o].children&&n[o].children.length>0?n[o].expanded===!0:!1}function Dn(t,e,n){function o(I){return!1}function r(){return!1}function i(){return!1}function a(){return!1}function b(){return n.toolbarContext.schema.buttons||[]}function d(I,h=""){setTimeout(()=>{var B,L;const w=(B=t.parent)==null?void 0:B.designerItemElementRef.value;let N;h&&(N=w==null?void 0:w.querySelector("#"+h));const T=(L=N||w)==null?void 0:L.querySelector("#"+I);T==null||T.click()},0)}function m(I,h){h.disabled&&h.disabled.expressionId&&(h.disabled.expressionId=`${h.id}_disabled`),h.visible&&h.visible.expressionId&&(h.visible.expressionId=`${h.id}_visible`);const w=e.formSchemaUtils.getExpressions(),N=w.find(B=>B.target===I.id);if(!N||!N.rules||!N.rules.length)return;const T={target:h.id,rules:[],targetType:"Button"};N.rules.forEach(B=>{const L=Object.assign(de.cloneDeep(B),{id:`${h.id}_${B.type}`});T.rules.push(L)}),w.push(T)}function y(){var N;const I=t.schema,h=Object.assign(de.cloneDeep(I),{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null});(N=e==null?void 0:e.designerContext)!=null&&N.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(h);let w=[];return h.children&&h.children.length&&(w=h.children.map(T=>{var L;const B=de.cloneDeep(T);return Object.assign(B,{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null}),(L=e==null?void 0:e.designerContext)!=null&&L.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(B),m(T,B),B}),h.children=w),m(I,h),h}function l(){const I=t.schema.type||"response-toolbar-item",h=Qt(I),w=I.toLowerCase().replace("-","_");return h&&!h.id&&h.type===I&&(h.id=`${w}_${Math.random().toString().slice(2,6)}`,h.text="按钮"),h}function f(I){const h=b(),w=h==null?void 0:h.findIndex(T=>T.id===I),N=w===-1?null:h[w];return{index:w,toolbarItem:N}}function g(){const I=t.schema.id,h=b();return Ne(I,h)}function u(I){const h=e.formSchemaUtils.getExpressions();if(!h||!h.length)return;const w=N=>{const T=h&&h.findIndex(B=>B.target===N.id);T>-1&&h.splice(T,1)};w(I),I.children&&I.children.length&&I.children.forEach(N=>{w(N)})}function s(I){n.changeSelectedId(I)}function S(I){e.formSchemaUtils.removeCommunicationInComponent(I),I.children&&I.children.length&&I.children.forEach(h=>{e.formSchemaUtils.removeCommunicationInComponent(h)})}function R(){var N,T,B;if((N=e==null?void 0:e.designerContext)!=null&&N.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const I=b(),{parentIndex:h,itemIndex:w}=ct(t.schema.id,I);h===-1||w===-1||(u(t.schema),S(t.schema),I[h].children.splice(w,1),n.updateToolbarItems(),(T=t.setupContext)==null||T.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function k(){var N,T,B;if((N=e==null?void 0:e.designerContext)!=null&&N.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const I=t.schema.id,h=b(),w=h==null?void 0:h.findIndex(L=>L.id===I);w!==-1&&(u(h[w]),S(h[w]),h==null||h.splice(w,1),n.updateToolbarItems(),(T=t.setupContext)==null||T.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function F(I="Append"){var L;const h=b(),{parentIndex:w,itemIndex:N}=ct(t.schema.id,h);if(w===-1||N===-1)return;const T=l(),B=I==="Copy"?y():Object.assign({},T);h[w].children.splice(N+1,0,B),n.updateToolbarItems(),s(B.id),(L=t.setupContext)==null||L.emit("addComponent")}function M(I,h){const{index:w}=f(h);if(w===-1)return{index:w,schema:null};const N=l(),T=I==="Copy"?y():Object.assign({},N);return{index:w,schema:T}}function P(){var N;const I=t.schema.id,{index:h,schema:w}=M("Copy",I);w&&(b().splice(h+1,0,w),n.updateToolbarItems(),d(w.id),(N=t.setupContext)==null||N.emit("addComponent"))}function O(){var N;const I=t.schema.id,{index:h,schema:w}=M("Append",I);if(w&&t.parent){const B=b()[h].children||[];B.push(w);const L=b();L[h].children=B,n.updateToolbarItems(),s(w.id),(N=t.setupContext)==null||N.emit("addComponent")}}function E(I){let h;switch(t.schema.type){case"tab-toolbar-item":h=new In(I,e);break;default:h=new Pn(I,e,t.schema.type)}return h.getPropertyConfig(t.schema,g())}function p(I){I.stopPropagation(),I.stopImmediatePropagation()}function D(){const I=[{id:"delete",title:"删除",text:"",icon:"f-icon-yxs_delete",onClick:h=>{p(h),g()?R():k()}},{id:"copy",title:"复制",icon:"f-icon-yxs_copy",onClick:h=>{p(h);const{activeElement:w}=document,N=w?w.tagName.toLowerCase():"";N&&N==="input"||N==="textarea"?(w==null||w.blur(),c.nextTick(()=>{g()?F("Copy"):P()})):g()?F("Copy"):P()}}];return I.push(g()?{id:"appendSiblingButton",title:"",text:"新增同级",icon:"f-icon-plus-circle",onClick:h=>{p(h),F()}}:{id:"appendChildButton",title:"",text:"新增子级",icon:"f-icon-plus-circle",onClick:h=>{p(h),O()}}),I}function C(){const{schema:I}=t;u(I)}function v(){var I,h,w,N;if(t&&e){const{formSchemaUtils:T}=e,{schema:B}=t;switch(B.type){case"response-toolbar-item":{T.getControlBasicInfoMap().set(B.id,{componentTitle:B.text,parentPathName:B.text});break}case"tab-toolbar-item":case"section-toolbar-item":{let L;const q=(I=t.parent)==null?void 0:I.parent;(q==null?void 0:q.schema.type)==="tabs"||(q==null?void 0:q.schema.type)==="section"?L=(h=q.componentInstance)==null?void 0:h.value:L=(N=(w=q==null?void 0:q.parent)==null?void 0:w.componentInstance)==null?void 0:N.value,L!=null&&L.setComponentBasicInfoMap&&L.setComponentBasicInfoMap()}}}}return{canAccepts:o,checkCanMoveComponent:r,checkCanDeleteComponent:i,checkCanAddComponent:a,getPropsConfig:E,getCustomButtons:D,onRemoveComponent:C,setComponentBasicInfoMap:v}}const ut=c.defineComponent({name:"FResponseToolbarItemDesign",props:ot,emits:["Click","dropdown","clearAll"],setup(t,e){const n=c.ref(t.alignment),o=De(),r=c.ref(),i=c.inject("designer-host-service"),a=c.inject("design-item-context"),b=c.inject("toolbar-item-action"),d=Dn(a,i,b),m=_e.useDesignerInnerComponent(r,a,d);c.onMounted(()=>{r.value.componentInstance=m}),e.expose(m.value);function y(){const M={"f-icon":!0},P=t.icon?t.icon.trim():"";return re.getCustomClass(M,P)}function l(){return!!(t.icon&&t.icon.trim())}const f=c.computed(()=>{const M={btn:!0,"f-rt-btn":!0,"f-btn-ml":!t.isDP&&(n.value==="right"||n.value==="center"),"f-btn-mr":!t.isDP&&n.value==="left","btn-icontext":!!(t.icon&&t.icon.trim()),disabled:t.disabled===!0,"no-drag":!0,"text-truncate":!0};return re.getCustomClass(M,t.class)}),g=c.computed(()=>t.split?{display:"flex","align-items":"center"}:{display:"flex","align-items":"center","border-radius":"6px","padding-right":"0.1rem","border-top-right-radius":"6px","border-bottom-right-radius":"6px"}),u=c.computed(()=>{const M={btn:!0,"dropdown-toggle":!0,"f-btn-mr":n.value==="left","dropdown-toggle-split":!0,"no-drag":!0};return re.getCustomClass(M,t.class)}),s=c.computed(()=>{let M={btn:!t.isDPItem,disabled:t.disabled===!0,"dropdown-item":t.isDPItem,"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!t.isDPItem&&!!(t.icon&&t.icon.trim()),"dropdown-item-icontext":t.isDPItem&&!!(t.icon&&t.icon.trim()),"no-drag":!0};return t.isDPItem||(M=re.getCustomClass(M,t.class||"")),t.isDP&&(M=re.getCustomClass(M,t.dropdownClass||"")),M});function S(M,P){P&&P.stopPropagation(),e.emit(M,{id:t.id,isDP:t.isDP})}function R(){return{"btn-group":!0,"no-drag":!0,"f-rt-dropdown":!0,"f-btn-ml":n.value==="right"||n.value==="center","f-btn-mr":n.value==="left"}}function k(){return c.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[c.createVNode("div",{class:R(),id:t.id},[c.createVNode("div",{class:f.value,style:g.value,onClick:()=>S("clearAll")},[o.shouldShowIcon(t)&&c.createVNode("i",{class:o.iconClass(t)},null),c.createVNode("span",null,[t.text]),!t.split&&c.createVNode("span",{class:"f-icon f-icon-arrow-chevron-down",style:"margin:0 0.5rem 0 0.25rem;",onClick:M=>S("dropdown",M)},null)]),t.split&&c.createVNode("button",{class:u.value,style:"border-radius:0 6px 6px 0;",onClick:M=>S("dropdown",M)},null),b.renderDropdownMenu(t.item,t.item)])])}function F(){return c.createVNode("li",{ref:r,"data-dragref":`${a.schema.id}-container`,id:t.id,class:s.value},[o.shouldShowIcon(t)&&c.createVNode("i",{class:o.iconClass(t)},null),t.text])}return()=>t.isDP?k():t.isDPItem?F():c.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[c.createVNode("button",{type:"button",class:f.value,id:t.id,onClick:()=>S("clearAll")},[l()&&c.createVNode("i",{class:y()},null),t.text])])}});function kn(t,e,n,o){function r(f,g,u,s){o.changeSelectedId((g==null?void 0:g.id)||""),n&&n.setupContext&&n.setupContext.emit("selectionChange",f,g,u,s)}function i(){}function a(f){const g=f.expanded;o.clearAllDropdown(),o.toggleDropdownMenu(f,!g)}function b(f){o.clearAllDropdown(f.isDP?f.id:"")}function d(f,g=""){const u=t.items||[],s=g||f,S=u.find(R=>R.id===s);return g?S.children.find(R=>R.id===f):S}function m(f,g=!1){if(!g)return;const u=f.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.add("dgComponentSelected"))}function y(f,g=!1){if(!g)return;const u=f.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.remove("dgComponentSelected"))}function l(f,g,u=!1){const s=d(f.id,f.parent),S=c.ref(s);return c.createVNode(En,{key:s.id,class:["p-0",u?"d-block no-drag":"d-inline-block"],modelValue:S.value,"onUpdate:modelValue":R=>S.value=R,canMove:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:t.componentId,id:s.id,onSelectionChange:r,onRemoveComponent:i,onMouseenter:R=>m(R,u),onMouseleave:R=>y(R,u)},{default:()=>{var R;return[c.createVNode(ut,{id:s.id,disabled:s.disabled,text:s.text,icon:s.icon,isDP:f.isDP,item:f,split:s.split,isDPItem:f.isDPItem,class:((R=f.appearance)==null?void 0:R.class)||"btn-secondary",alignment:t.alignment||"right",onDropdown:()=>a(f),onClearAll:k=>b(k),componentId:t.componentId},null)]}})}return{renderToolbarItemDesigner:l,actionHandlers:o}}function Be(t,e=!1,n=""){const o=[];return t.reduce((r,i)=>{if(i.children&&i.children.length>0){const a=Be(i.children,!0,i.id);r.push(Object.assign({},i,{children:a,isDPItem:!1,isDP:!0,parent:"",expanded:!1}))}else r.push(Object.assign({},i,{isDPItem:e,isDP:!1,parent:n}));return r},o),o}const Nn=c.defineComponent({name:"FResponseToolbarDesign",props:rn,emits:["Click"],setup(t,e){const n=c.ref(Be(t.items)),o=c.ref(),r=c.ref(),i=c.ref(),a=c.ref("");let b=0;const d=15,m=c.inject("designer-host-service"),y=c.inject("design-item-context"),l={clearAllDropdown:W=>{},toggleDropdownMenu:W=>{},updateToolbarItems:()=>{},changeSelectedId:W=>{a.value=W},renderDropdownMenu:(W,_)=>{},toolbarContext:y,changeMenuPosition:(W,_,Q)=>({}),toolbarPosition:""},f=vn(y,m,l),g=_e.useDesignerComponent(i,y,f),u=c.inject("toolbar-item-handler"),{initDragula:s,dragulaInstance:S}=wn(y),R=De(),k=kn(t,r,y,l),F=xn(R,n,k),{renderToolbarItemDesigner:M}=k,{clearAllDropDownMenu:P,renderDropdownMenu:O,setResponseToolbarRef:E}=F;c.provide("toolbar-item-action",l),l.renderDropdownMenu=O,E(i),u&&(u.changeSelectedId=function(W){a.value=W});function p(){const W=r.value.querySelector(".dgComponentSelected");W&&it(W)}function D(){if(a.value)if(Ne(a.value,n.value)){const{parent:W,item:_}=dt(a.value,n.value);W&&(l.toggleDropdownMenu(W,!0),setTimeout(()=>{var Z;const Q=i.value.querySelector("#"+W.id),X=Q==null?void 0:Q.querySelector("#"+_.id);(((Z=X==null?void 0:X.parentElement)==null?void 0:Z.className)||"").indexOf("dgComponentFocused")<0&&(X==null||X.click())},0))}else p()}function C(W=""){n.value.filter(_=>_.id!==W&&_.children&&_.children.length>0).forEach(_=>{_.expanded=!1}),P(W)}l.clearAllDropdown=C;function v(){u&&u.updateToolbarItems&&u.updateToolbarItems()}l.updateToolbarItems=v;function I(W){if(W){const _=i.value.querySelector("#"+W.id),Q=_.querySelector("#"+W.id+"_menu"),X=l.changeMenuPosition(W,_);Object.keys(X).forEach(Z=>{Q.style[Z]=X[Z]})}}function h(){const Q=r.value.clientWidth,X=r.value.querySelectorAll(".farris-component>.f-rt-btn");X&&X.forEach(z=>{z.style.maxWidth=Q-12+"px"});const Z=r.value.querySelectorAll(".farris-component>.f-rt-dropdown");Z&&Z.forEach(z=>{z.querySelector(".dropdown-toggle-split")?z.querySelector(".f-rt-btn").style.maxWidth=Q-38+"px":z.style.maxWidth=Q-12+"px"})}const w=new ResizeObserver(W=>{var _;if(W.length){const X=W[0].contentRect.width;if(X===0){b=0;return}if(Math.abs(X-b)>d){if(b=X,Ne(a.value,n.value)){const{parent:Z,item:z}=dt(a.value,n.value);I(Z)}else if(Mn(a.value,n.value)){const Z=(_=n.value)==null?void 0:_.find(z=>z.id===a.value);I(Z)}else C();h()}}});c.onMounted(()=>{w.observe(i.value),b=i.value.clientWidth,i.value.componentInstance=g,s(r.value,o.value,v)}),c.onUnmounted(()=>{w.disconnect(),S&&S.destroy&&S.destroy()}),e.expose(g.value);const N=c.computed(()=>{const W={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":t.buttonSize==="sm","f-response-toolbar-lg":t.buttonSize==="lg"};return re.getCustomClass(W,t.customClass)}),T=c.computed(()=>({"text-left":t.alignment==="left","text-right":t.alignment==="right","justify-content-end":t.alignment==="right","justify-content-start":t.alignment==="left","justify-content-center":t.alignment==="center","no-drag":!0,"w-100":!0}));c.watch(()=>t.items,()=>{n.value=Be(t.items),c.nextTick(()=>{D(),h()})},{deep:!0});function B(W){W&&(W.stopPropagation(),W.preventDefault());const{schema:_}=y;_.buttons||(_.buttons=[]);const Q=Ye("response-toolbar-item");Q.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,Q.appearance={class:"btn btn-secondary"},_.buttons.push(Q)}function L(){return c.createVNode("li",{style:"border-width: 1px;border-style: dashed;display: inline-block;padding: 0 8px;line-height: 24px; border-radius: 3px; cursor: default;color: #B4BCCC;",onClick:B},[c.createVNode("span",{class:"f-icon f-icon-amplification mr-1",style:"font-size: 12px;"},null),c.createVNode("span",{class:"farris-tag-add-text"},[c.createTextVNode("添加按钮")])])}function q(){return n.value.map((W,_)=>M(W,_))}return()=>{var W;return c.createVNode("div",{ref:i,"data-dragref":`${y.schema.id}-container`,class:N.value,id:t.id},[c.createVNode("div",{ref:o,class:T.value,onClick:_=>C(_)},[c.createVNode("div",{ref:r,class:"d-block f-response-content"},[(W=n.value)!=null&&W.length?q():L()])])])}}}),Bn=Me;xe.register=(t,e,n,o)=>{t["response-toolbar"]=xe,e["response-toolbar"]=Me,o["response-toolbar"]={eventHandlerResolver:an}},xe.registerDesigner=(t,e,n)=>{t["response-toolbar"]=Nn,e["response-toolbar"]=Me,t["response-toolbar-item"]=ut,e["response-toolbar-item"]=sn};const Rn=re.withInstall(xe);te.FResponseToolbar=xe,te.ResponseToolbarDropDownItem=we,te.ResponseToolbarGroup=St,te.ResponseToolbarItem=qe,te.default=Rn,te.responseToolbarResolver=Bn,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(te,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js"),require("../dynamic-resolver/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","vue-i18n","../designer-canvas/index.umd.js","../dynamic-resolver/index.umd.js"],c):(te=typeof globalThis<"u"?globalThis:te||self,c(te["response-toolbar"]={},te.Vue,te.LodashES,te.common,te.vueI18n,te.designerCanvas,te.dynamicResolver))})(this,function(te,c,de,re,wt,_e,xt){"use strict";var Qn=Object.defineProperty;var Zn=(te,c,de)=>c in te?Qn(te,c,{enumerable:!0,configurable:!0,writable:!0,value:de}):te[c]=de;var Y=(te,c,de)=>Zn(te,typeof c!="symbol"?c+"":c,de);class Le{constructor(e){Y(this,"id","");Y(this,"class","btn-secondary");Y(this,"icon","");Y(this,"groupId","");Y(this,"order",-1);Y(this,"asDropDownTop",!1);Y(this,"text","");Y(this,"visible",!0);Y(this,"shown",!0);Y(this,"responsed",!1);Y(this,"tipsEnable",!1);Y(this,"tipsText","");Y(this,"width",0);Y(this,"dropdownClass","");Y(this,"onClick",()=>{});Y(this,"options");var o,r;this.options=e;const n=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","dropdownClass","onClick"];Object.keys(e).filter(i=>n.indexOf(i)>-1).forEach(i=>{i==="visible"?this[i]=e[i]===void 0?!0:e[i]:this[i]=e[i]}),this.shown=this.visible,(o=e.appearance)!=null&&o.class&&(this.class=(r=e.appearance)==null?void 0:r.class)}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:c.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class qe extends Le{constructor(e){super(e)}}function We(){function t(e){const n=[];return e.reduce((o,r)=>(r.children&&r.children.length>0?o.push(new we(r)):o.push(new qe(r)),o),n),n}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:Tt}=We();class we extends Le{constructor(n){super(n);Y(this,"placement","");Y(this,"visible",!0);Y(this,"dropdownClass","");Y(this,"menuClass","");Y(this,"split",!1);Y(this,"children",[]);Y(this,"expanded",!1);Y(this,"shown",!0);const o=["visible","icon","isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(n).filter(r=>o.indexOf(r)>-1).forEach(r=>{r==="visible"?this[r]=n[r]===void 0?!0:n[r]:this[r]=n[r]}),this.shown=this.visible,n.children&&n.children.length&&(this.children=Tt(n.children))}}class St{constructor(e,n){Y(this,"id");Y(this,"name");Y(this,"presetId",[]);Y(this,"responsedIndex",[]);Y(this,"width");this.id=e,this.name=n,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}}function Ue(t,e){let n;function o(a){const{properties:f,title:g,ignore:u}=a,s=u&&Array.isArray(u),S=Object.keys(f).reduce((R,k)=>((!s||!u.find(F=>F===k))&&(R[k]=f[k].type==="object"&&f[k].properties?o(f[k]):de.cloneDeep(f[k].default)),R),{});if(g&&(!s||!u.find(R=>R==="id"))){const R=g.toLowerCase().replace(/-/g,"_");S.id=`${R}_${Math.random().toString().slice(2,6)}`}return S}function r(a){const{properties:f,title:g,required:u}=a;if(u&&Array.isArray(u)){const s=u.reduce((S,R)=>(S[R]=f[R].type==="object"&&f[R].properties?o(f[R]):de.cloneDeep(f[R].default),S),{});if(g&&u.find(S=>S==="id")){const S=g.toLowerCase().replace(/-/g,"_");s.id=`${S}_${Math.random().toString().slice(2,6)}`}return s}return{type:g}}function i(a,f={},g){const u=t[a];if(u){let s=r(u);const S=e[a];return s=S?S({getSchemaByType:i},s,f,g):s,n!=null&&n.appendIdentifyForNewControl&&n.appendIdentifyForNewControl(s),s}return null}function l(a,f){const g=o(f);return Object.keys(g).reduce((u,s)=>(Object.prototype.hasOwnProperty.call(a,s)&&(u[s]&&de.isPlainObject(u[s])&&de.isPlainObject(a[s]||!a[s])?Object.assign(u[s],a[s]||{}):u[s]=a[s]),u),g),g}function b(a,f){return Object.keys(a).filter(u=>a[u]!=null).reduce((u,s)=>{if(f.has(s)){const S=f.get(s);if(typeof S=="string")u[S]=a[s];else{const R=S(s,a[s],a);Object.assign(u,R)}}else u[s]=a[s];return u},{})}function d(a,f,g=new Map){const u=l(a,f);return b(u,g)}function m(a){var g;const f=a.type;if(f){const u=t[f];if(!u)return a;const s=l(a,u),S=((g=a.editor)==null?void 0:g.type)||"";if(S){const R=t[S],k=l(a.editor,R);s.editor=k}return s}return a}function y(a){n=a}return{getSchemaByType:i,resolveSchemaWithDefaultValue:m,resolveSchemaToProps:d,mappingSchemaToProps:b,setDesignerContext:y}}const ze={},Ge={},{getSchemaByType:Ye,resolveSchemaWithDefaultValue:Et,resolveSchemaToProps:It,mappingSchemaToProps:Pt,setDesignerContext:Jn}=Ue(ze,Ge);function Mt(t={}){function e(m,y,a,f){if(typeof a=="number")return f[m].length===a;if(typeof a=="object"){const g=Object.keys(a)[0],u=a[g];if(g==="not")return Number(f[m].length)!==Number(u);if(g==="moreThan")return Number(f[m].length)>=Number(u);if(g==="lessThan")return Number(f[m].length)<=Number(u)}return!1}function n(m,y,a,f){return f[m]&&f[m].propertyValue&&String(f[m].propertyValue.value)===String(a)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((m,y)=>(m.set(y,t[y]),m),o);function r(m,y){const a=m;return typeof y=="number"?[{target:a,operator:"length",param:null,value:Number(y)}]:typeof y=="boolean"?[{target:a,operator:"getProperty",param:m,value:!!y}]:typeof y=="object"?Object.keys(y).map(f=>{if(f==="length")return{target:a,operator:"length",param:null,value:y[f]};const g=f,u=y[f];return{target:a,operator:"getProperty",param:g,value:u}}):[]}function i(m){return Object.keys(m).reduce((a,f)=>{const g=r(f,m[f]);return a.push(...g),a},[])}function l(m,y){if(o.has(m.operator)){const a=o.get(m.operator);return a&&a(m.target,m.param,m.value,y)||!1}return!1}function b(m,y){return i(m).reduce((g,u)=>g&&l(u,y),!0)}function d(m,y){const a=Object.keys(m),f=a.includes("allOf"),g=a.includes("anyOf"),u=f||g,R=(u?m[u?f?"allOf":"anyOf":"allOf"]:[m]).map(F=>b(F,y));return f?!R.includes(!1):R.includes(!0)}return{parseValueSchema:d}}const Dt={convertTo:(t,e,n,o)=>{t.appearance||(t.appearance={}),t.appearance[e]=n},convertFrom:(t,e,n)=>t.appearance?t.appearance[e]:t[e]},kt={convertFrom:(t,e,n)=>t.buttons&&t.buttons.length?`共 ${t.buttons.length} 项`:"无"},Nt={convertTo:(t,e,n,o)=>{t.editor&&(t.editor[e]=n)},convertFrom:(t,e,n)=>t.editor&&Object.prototype.hasOwnProperty.call(t.editor,e)?t.editor[e]:t[e]},Ee={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"}},Bt={convertFrom:(t,e,n)=>{var r;const o=t.editor&&t.editor[e]?t.editor[e]:t[e];return((r=Ee[o])==null?void 0:r.name)||o}},Rt={convertTo:(t,e,n,o)=>{t[e]=t[e]},convertFrom:(t,e,n)=>t.editor?n.getRealEditorType(t.editor.type):""},Vt={convertTo:(t,e,n,o)=>{(t.type==="data-grid-column"||t.type==="tree-grid-column")&&(t.formatter?t.formatter[e]=n:t.formatter={[e]:n})},convertFrom:(t,e,n)=>{if(t.formatter){if(e==="trueText")return t.formatter.trueText;if(e==="falseText")return t.formatter.falseText;if(e==="prefix")return t.formatter.prefix;if(e==="suffix")return t.formatter.suffix;if(e==="precision")return t.formatter.precision;if(e==="decimal")return t.formatter.decimal;if(e==="thousand")return t.formatter.thousand;if(e==="dateFormat")return t.formatter.dateFormat||"yyyy-MM-dd";if(e==="customFormat")return t.formatter.customFormat;if(e==="type")return t.formatter.type||"none"}return"none"}},Ot={convertTo:(t,e,n,o)=>{t.command?t.command[e]=n:t.command={[e]:n},e==="enable"&&n&&(t.command.commands||(t.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(t,e,n)=>t.command&&e==="enable"?t.command.enable:""},Ft={convertTo:(t,e,n,o)=>{t.column?t.column[e]=n:t.column={[e]:n},e==="fitColumns"&&n&&(t.column.fitMode||(t.column.fitMode="average"))},convertFrom:(t,e,n)=>{if(t.column){if(e==="fitColumns")return t.column.fitColumns;if(e==="fitMode")return t.column.fitMode}return""}},jt={convertTo:(t,e,n,o)=>{t.summary?t.summary[e]=n:t.summary={[e]:n},e==="enable"&&n&&(t.summary?t.summary.groupFields||(t.summary.groupFields=[]):t.summary={enable:n,groupFields:[]})},convertFrom:(t,e,n)=>t.summary&&e==="enable"?t.summary.enable:t.type==="data-grid-column"?t.enableSummary===void 0?!1:t.enableSummary:""},At={convertTo:(t,e,n,o)=>{t.group?t.group[e]=n:t.group={[e]:n},e==="enable"&&n&&(t.group?t.group.groupFields||(t.group.groupFields=[]):t.group={enable:n,groupFields:[],showSummary:!1})},convertFrom:(t,e,n)=>{if(t.group){if(e==="enable")return t.group.enable;if(e==="showSummary")return t.group.showSummary}}},$t={convertFrom:(t,e)=>t.binding?t.binding.path:"",convertTo:(t,e,n)=>{if(n&&n.length>0){const o=n[0];t.binding||(t.binding={}),t.binding.type="Form",t.binding.path=o.bindingField,t.binding.field=o.id,t.binding.fullPath=o.path,t.path=o.bindingPath}}},_t={convertTo:(t,e,n,o)=>{t.pagination||(t.pagination={}),t.pagination[e]=n},convertFrom:(t,e,n)=>t.pagination?t.pagination[e]:t[e]},Lt={convertTo:(t,e,n,o)=>{t.rowNumber||(t.rowNumber={}),t.rowNumber[e]=n},convertFrom:(t,e,n)=>t.rowNumber?t.rowNumber[e]:t[e]},qt={convertTo:(t,e,n,o)=>{t.selection||(t.selection={}),t.selection[e]=n},convertFrom:(t,e,n)=>{var o,r;return e==="showCheckbox"?(o=t.selection)!=null&&o.multiSelect?!0:(r=t.selection)==null?void 0:r.showCheckbox:t.selection?t.selection[e]:t[e]}},Wt={convertFrom:(t,e,n)=>t[e]&&t[e].length?`共 ${t[e].length} 项`:""},Ut={convertFrom:(t,e)=>t[e]||"",convertTo:(t,e,n)=>{t[e]=n}},zt={convertTo:(t,e,n,o)=>{t.size||(t.size={}),t.size[e]=n},convertFrom:(t,e,n)=>t.size?t.size[e]:t[e]},Gt={convertFrom:(t,e,n)=>{var o,r;return(o=t.formatter)!=null&&o.data&&e==="formatterEnumData"&&!t.formatterEnumData?(r=t.formatter)==null?void 0:r.data:t.formatterEnumData}},Yt={convertTo:(t,e,n,o)=>{t.sort||(t.sort={}),t.sort[e]=n},convertFrom:(t,e,n)=>{var o,r;if(e==="mode")return((o=t.sort)==null?void 0:o.mode)||"client";if(e==="multiSort")return!!((r=t.sort)!=null&&r.multiSort)}},Xt={convertTo:(t,e,n,o)=>{t.filter||(t.filter={}),t.filter[e]=n},convertFrom:(t,e,n)=>{var o;if(e==="mode")return((o=t.filter)==null?void 0:o.mode)||"client"}},Ht={convertTo:(t,e,n,o)=>{t.rowOption?t.rowOption[e]=n:t.rowOption={[e]:n}},convertFrom:(t,e,n)=>{if(t.rowOption){if(e==="customRowStyle")return t.rowOption.customRowStyle;if(e==="customCellStyle")return t.rowOption.customCellStyle}return""}};function Xe(t,e,n){const o=new Map([["/converter/appearance.converter",Dt],["/converter/buttons.converter",kt],["/converter/property-editor.converter",Nt],["/converter/items-count.converter",Wt],["/converter/type.converter",Bt],["/converter/change-editor.converter",Rt],["/converter/change-formatter.converter",Vt],["/converter/column-command.converter",Ot],["/converter/column-option.converter",Ft],["/converter/summary.converter",jt],["/converter/group.converter",At],["/converter/form-group-label.converter",Ut],["/converter/field-selector.converter",$t],["/converter/pagination.converter",_t],["/converter/row-number.converter",Lt],["/converter/grid-selection.converter",qt],["/converter/size.converter",zt],["/converter/change-formatter-enum.converter",Gt],["/converter/grid-sort.converter",Yt],["/converter/grid-filter.converter",Xt],["/converter/row-option.converter",Ht]]),r=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),i=Mt();function l(u,s){return()=>i.parseValueSchema(u,s)}function b(u,s,S){return u.includes("visible")&&s.visible!==void 0?typeof s.visible=="boolean"?()=>!!s.visible:s.visible===void 0?!0:l(s.visible,S):()=>!0}function d(u,s,S){return u.includes("readonly")&&s.readonly!==void 0?typeof s.readonly=="boolean"?()=>!!s.readonly:l(s.readonly,S):()=>!1}function m(u,s){const S=u.$converter||s;return typeof S=="string"&&S&&o.has(S)?o.get(S)||null:S||null}function y(u,s,S,R,k,F="",M=""){return Object.keys(u).map(O=>{const E=c.ref(1),p=O,D=u[O],C=Object.keys(D),v=D.title,I=D.type,h=r.get(I)||{type:"input-group",enableClear:!1},w=D.editor?Object.assign({},h,D.editor):Object.assign({},h),N=b(C,D,s),T=d(C,D,s);w.readonly=w.readonly===void 0?T():w.readonly;const B=D.type==="cascade"?y(D.properties,s,S,R,k,F,M):[],L=!0;let q=m(D,M);const W=c.computed({get(){if(E.value){if(["class","style"].find(V=>V===p)&&!q&&(q=o.get("/converter/appearance.converter")||null),q&&q.convertFrom)return q.convertFrom(S,O,k,F);const ee=S[O];return Object.prototype.hasOwnProperty.call(D,"defaultValue")&&(ee===void 0||typeof ee=="string"&&ee==="")?D.type==="boolean"?D.defaultValue:D.defaultValue||"":ee}return null},set(ee){E.value+=1,q&&q.convertTo?(q.convertTo(R,O,ee,k,F),q.convertTo(S,O,ee,k,F)):(R[O]=ee,S[O]=ee)}}),{refreshPanelAfterChanged:_,description:Q,isExpand:X,parentPropertyID:Z}=D,z={propertyID:p,propertyName:v,propertyType:I,propertyValue:W,editor:w,visible:N,readonly:T,cascadeConfig:B,hideCascadeTitle:L,refreshPanelAfterChanged:_,description:Q,isExpand:X,parentPropertyID:Z};return s[p]=z,z})}function a(u,s,S={}){const R={},k=t[u];return k&&k.categories?Object.keys(k.categories).map(M=>{const P=k.categories[M],O=P==null?void 0:P.title,E=y(P.properties||{},R,{},S,s);return{categoryId:M,categoryName:O,properties:E}}):[]}function f(u,s,S,R,k=""){const F=s.$ref.schema,M=s.$ref.converter,P=S[F],O=P.type,E=n(P),p={},D=t[O];if(D&&D.categories){const C=D.categories[u],v=C==null?void 0:C.title;M&&Object.keys(C.properties).forEach(w=>{C.properties[w].$converter=M});const I=(C==null?void 0:C.properties)||{},h=y(I,p,E,P,R,k);return{categoryId:u,categoryName:v,properties:h}}return{categoryId:u,categoryName:"",properties:[]}}function g(u,s,S,R,k){const F=u.type,M=n(u),P={};let O=k||t[F];if(O&&Object.keys(O).length===0&&S&&S.getPropConfig&&(O=S.getPropConfig(R)),O&&O.categories){const E=[];return Object.keys(O.categories).map(p=>{const D=O.categories[p];if(D.$ref){E.push(f(p,D,u,s,R));return}const C=D==null?void 0:D.title,v=D==null?void 0:D.tabId,I=D==null?void 0:D.tabName,h=D==null?void 0:D.hide,w=D==null?void 0:D.hideTitle,N=y(D.properties||{},P,M,u,s,R,D.$converter),{setPropertyRelates:T}=D,B=D==null?void 0:D.parentPropertyID;E.push({categoryId:p,categoryName:C,tabId:v,tabName:I,hide:h,properties:N,hideTitle:w,setPropertyRelates:T,parentPropertyID:B})}),E}return[]}return{getPropertyConfigBySchema:g,getPropertyConfigByType:a,propertyConverterMap:o}}const He={},Qe={};Xe(He,Qe,Et);const Ze={},Je={},{getSchemaByType:Qt,resolveSchemaWithDefaultValue:Zt,resolveSchemaToProps:Kn,mappingSchemaToProps:eo,setDesignerContext:to}=Ue(Ze,Je),Ke={},et={};Xe(Ke,et,Zt);function tt(t,e,n=new Map,o=(l,b,d,m)=>b,r={},i=l=>l){return ze[e.title]=e,Ge[e.title]=o,He[e.title]=r,Qe[e.title]=i,Ze[e.title]=e,Je[e.title]=o,Ke[e.title]=r,et[e.title]=i,(l={},b=!0)=>{if(!b)return Pt(l,n);const d=It(l,e,n),m=Object.keys(t).reduce((y,a)=>(y[a]=t[a].default,y),{});return Object.assign(m,d)}}function Jt(t,e){return{customClass:e.class,customStyle:e.style}}function Kt(t,e){if(!t||t.length<1)return null;for(const n of t){if(n.id===e)return n;if(n.children){const o=n.children.find(r=>r.id===e);if(o)return o}}return null}function en(){function t(e,n){const o=e.buttons;if(!o||o.length<1)return null;const[r,i]=n.payloads,l=Kt(o,i);return l?l.onClick||l.click:null}return{resolve:t}}const tn=new Map([["buttons","items"],["appearance",Jt]]);function nt(t,e,n){return e}const nn={$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:""},visible:{description:"",type:"boolean",default:!0}},required:["id","type","buttons"],events:{onClick:"点击事件"}},on={$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:""}}},alignment:{description:"对齐",type:"string",default:"right"},text:{description:"文本",type:"string",default:"按钮"},icon:{description:"图标",type:"string",default:""},disabled:{description:"禁用",type:"boolean",default:!1},visible:{description:"是否可见",type:"boolean",default:!0},onClick:{description:"点击事件",type:"string",default:""},tipsEnable:{description:"",type:"boolean",default:!1},tipsText:{description:"",type:"string",default:""},dropdownClass:{description:"处于下拉菜单时的样式",type:"string",default:""},split:{description:"",type:"boolean",default:!1}},required:["id","type","text"],events:{onClick:"点击事件"}},Pe={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0}},rn=Object.assign({},Pe,{componentId:{type:String,default:""}}),Me=tt(Pe,nn,tn,nt),ot={id:{type:String,default:""},item:{type:Object,default:{}},items:{type:Object,default:{}},class:{type:String,default:"btn-secondary"},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},componentId:{type:String,default:""},expanded:{type:Boolean,default:!1},alignment:{Type:String,default:"right"},split:{type:Boolean,default:!1},isDP:{type:Boolean,default:!1},isDPItem:{type:Boolean,default:!1}},sn=tt(ot,on,void 0,nt),ln=en();function De(){function t(n){const o={"f-icon":!0};if(n.icon){const r=n.icon.trim().split(" ");r&&r.length&&r.reduce((i,l)=>(i[l]=!0,i),o)}return o}function e(n){return!!(n.icon&&n.icon.trim())}return{iconClass:t,shouldShowIcon:e}}function an(t,e){function n(E){const p={"dropdown-menu":!0};return re.getCustomClass(p,E.menuClass)}function o(E){const p={disabled:!E.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return re.getCustomClass(p,E.dropdownClass)}function r(E){const p={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return re.getCustomClass(p,E.dropdownClass)}function i(E){const p={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0,"f-rt-toggle":!E.split,"btn-icontext":!!(E.icon&&E.icon.trim()),"dropdown-toggle":!E.split};return re.getCustomClass(p,E.dropdownClass)}function l(E){const p={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(E.icon&&E.icon.trim()),"d-block":!0};return re.getCustomClass(p,E.dropdownClass)}let b;const d=new Map;let m="";function y(E){m="#"+E}function a(E,p,D){E.stopPropagation();const C=D?D.id:"__top_item__";if(p.children&&p.children.length&&(p.expanded=!p.expanded,p.expanded)){if(d.has(C)&&d.get(C)!==p){const v=d.get(C);v&&(v.expanded=!1,d.delete(C))}d.set(C,p)}}function f(E,p){document.body.click(),p.enable&&(E.stopPropagation(),typeof p.onClick=="function"&&p.onClick(E,p.id),t.emit("click",E,p.id))}function g(E,p){const D=E.target;D.className.indexOf("dropdown-item")<0||(D.title=D.scrollWidth>D.clientWidth?p:"")}function u(E,p,D){if(p.tipsEnable&&p.tipsText){const C=c.reactive({content:p.tipsText,enable:p.tipsEnable});return c.withDirectives(c.createVNode("li",{class:r(p),id:p.id,key:p.id+"_"+D,onClick:v=>f(v,p)},[c.createVNode("span",{class:l(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text])]),[[c.resolveDirective("tooltip"),C]])}return c.createVNode("li",{class:r(p),id:p.id,onClick:C=>f(C,p)},[c.createVNode("span",{class:l(p),onMouseenter:C=>g(C,p.text)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text])])}function s(E,p,D){p.enable&&(typeof p.onClick=="function"&&D.onClick(E,p.id),t.emit("click",E,p.id),D.split||a(E,p,D))}function S(E,p,D){E&&E.stopPropagation(),a(E,p,D)}function R(E,p){E.stopPropagation();const D=p.id;if(p.children&&p.children.length&&p.expanded&&d.has(D)){const C=d.get(D);C&&(C.expanded=!1,d.delete(D))}}function k(E,p,D){if(p.tipsEnable&&p.tipsText){const C=c.reactive({content:p.tipsText,enable:p.tipsEnable});return c.createVNode("li",{class:o(p),id:p.id,key:p.id+"_"+D,onClick:v=>s(v,p,E)},[c.withDirectives(c.createVNode("span",{class:i(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text]),[[c.resolveDirective("tooltip"),C]]),p.split&&c.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:v=>S(v,p,E)},null),b(p,p)])}return c.createVNode("li",{class:o(p),id:p.id,onClick:C=>s(C,p,E),onMouseenter:C=>g(C,p.text)},[c.createVNode("span",{class:i(p)},[e.shouldShowIcon(p)&&c.createVNode("i",{class:e.iconClass(p)},null),p.text]),p.split&&c.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:C=>S(C,p,E)},null),b(p,p)])}function F(E){return E.children.filter(p=>p.visible).map((p,D)=>p.children&&p.children.length?k(E,p,D):u(E,p,D))}function M(E,p){if(!E)return 1080;let D=-1;const C=E.children.length;for(let v=0;v<C;v++)if(E.children[v].id===p){D=v;break}return 1080+C-D}function P(E,p,D){var B,L;const C={display:E.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},v=document.querySelector(m);if(!v)return C;const I=c.getCurrentInstance();let h=(L=(B=I==null?void 0:I.exposed)==null?void 0:B.elementRef.value)==null?void 0:L.querySelector("#"+p);if(h||(h=v==null?void 0:v.querySelector("#"+p)),!h)return C;const w=window.innerWidth,N=window.innerHeight,T=h==null?void 0:h.getClientRects();if(h&&T&&T.length){const{top:q,width:W,left:_,right:Q,height:X}=T[0],Z=Math.ceil(X+q);C.top=`${Z}px`,C.left=`${_}px`;const z=E.id+"_menu",ee=(h==null?void 0:h.querySelector("#"+z))||(v==null?void 0:v.querySelector("#"+z))||null;if(ee){ee.style.visibility="hidden",ee.style.display="block";const V=ee.offsetHeight;C.zIndex=E.expanded?M(v,z):1080,C.display==="block"&&(ee.style.display="block");const U=ee.getBoundingClientRect();if(D){C.top=`${q-6}px`;const j=Math.ceil(W+_);C.left=`${j}px`}w-_-W<U.width&&(C.left=`${(D?_:Q)-U.width}px`),N-q-X<V?q>V?(C.top=`${q-V-6}px`,C.maxHeight=`${q-16}px`):(C.maxHeight=`${N-Z}px`,q>N-q-X&&(C.top="10px",C.maxHeight=`${q-16}px`)):C.maxHeight=`${N-Z}px`,ee.style.visibility="visible"}}return C}b=function(E,p){const D=p?p.id:E.id;return c.createVNode(c.Teleport,{to:m,disabled:!E.expanded},{default:()=>[c.createVNode("ul",{class:n(E),style:P(E,D,p),id:E.id+"_menu",onWheel:C=>R(C,E)},[F(E)])]})};function O(){d.forEach(E=>{E.expanded=!1}),d.clear()}return{renderDropdownMenu:b,clearAllDropDownMenu:O,updateContainerId:y}}function cn(t,e,n){const o=c.ref(t.alignment),{renderDropdownMenu:r,clearAllDropDownMenu:i,updateContainerId:l}=an(e,n);function b(s){const S={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right"||o.value==="center","f-btn-mr":o.value==="left"};return re.getCustomClass(S,s.dropdownClass)}function d(s){const S={btn:!0,disabled:!s.enable,"f-rt-btn":!0,"btn-icontext":!!(s.icon&&s.icon.trim()),"f-rt-toggle":!s.split,"dropdown-toggle":!s.split};return re.getCustomClass(S,s.class)}function m(s){const S={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return re.getCustomClass(S,s.class)}function y(s){return s.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function a(s,S){s.stopPropagation();const R=S.expanded;document.body.click(),typeof S.onClick=="function"&&S.onClick(s,S.id),e.emit("click",s,S.id),S.split||(S.expanded=!R)}function f(s,S){s.stopPropagation();const R=S.expanded;document.body.click(),S.expanded=!R}function g(s,S=!0){if(s.tipsEnable&&s.tipsText){const R=c.reactive({content:s.tipsText,enable:s.tipsEnable});return c.createVNode("div",{id:s.id,class:b(s)},[c.withDirectives(c.createVNode("div",{class:d(s),style:y(s),onClick:k=>s.enable&&a(k,s)},[n.shouldShowIcon(s)&&c.createVNode("i",{class:n.iconClass(s)},null),c.createVNode("span",null,[s.text])]),[[c.resolveDirective("tooltip"),R]]),s.split&&c.createVNode("button",{class:m(s),style:"border-radius:0 6px 6px 0;",onClick:k=>f(k,s)},null),S&&r(s)])}return c.createVNode("div",{id:s.id,class:b(s)},[c.createVNode("div",{class:d(s),style:y(s),onClick:R=>s.enable&&a(R,s)},[n.shouldShowIcon(s)&&c.createVNode("i",{class:n.iconClass(s)},null),c.createVNode("span",null,[s.text])]),s.split&&c.createVNode("button",{class:m(s),style:"border-radius:0 6px 6px 0;",onClick:R=>f(R,s)},null),S&&r(s)])}function u(){i()}return{renderToolbarDropdown:g,clearAllDropDown:u,updateContainerId:l}}const{buildResponseToolbarItems:rt}=We(),xe=c.defineComponent({name:"FResponseToolbar",props:Pe,emits:["click"],setup(t,e){const{t:n}=wt.useI18n(),o=c.ref(rt(t.items)),r=c.ref(),i=c.ref(),l=c.ref(),b={id:"__more_buttons__",text:n("responseToolbar.more")},d=c.ref(new we(b)),m={id:b.id+"width",text:b.text},y=c.ref(-1),a=De();let f=!1;const{guid:g,uuid:u}=re.useGuid(),s=t.id?t.id:"toolbar-"+g(),S=c.ref(),R="dropdown-container-"+s+"-"+u(4),{renderToolbarDropdown:k,clearAllDropDown:F,updateContainerId:M}=cn(t,e,a);M(R);const P=c.computed(()=>d.value.children.length>0),O=c.computed(()=>t.visible?d.value.children.length>0?!0:o.value.findIndex(V=>V.shown&&V.children&&V.children.length>0)>-1:!1);function E(){t.visible&&!S.value&&document&&(S.value=document.createElement("div"),S.value.id=R,document.body.appendChild(S.value))}E();function p(){S.value&&document.body.contains(S.value)&&(document.body.removeChild(S.value),S.value=null)}c.watch(O,(V,U)=>{V?E():p()});const D=c.computed(()=>{const V={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":t.buttonSize==="sm","f-response-toolbar-lg":t.buttonSize==="lg","d-none":!t.visible};return re.getCustomClass(V,t.customClass)}),C=c.computed(()=>({"w-100":!0,"d-flex":!0,"flex-nowrap":!0,"justify-content-end":t.alignment==="right","justify-content-start":t.alignment==="left","justify-content-center":t.alignment==="center"}));function v(V){V&&V.target.closest("ul.dropdown-menu")&&V.type==="wheel"||(o.value.filter(U=>U.children&&U.children.length>0).forEach(U=>{U.expanded=!1}),d.value.expanded=!1,F())}function I(V,U){var se;const j={btn:!0,"f-rt-btn":!0,"f-btn-ml":t.alignment==="right"||U>0&&t.alignment==="center","f-btn-mr":t.alignment==="left","btn-icontext":!!(V.icon&&V.icon.trim())},H=((se=V==null?void 0:V.appearance)==null?void 0:se.class)||V.class||"btn-secondary";return re.getCustomClass(j,H)}function h(V,U){document.body.click(),typeof U.onClick=="function"&&U.onClick(V,U.id),e.emit("click",V,U.id)}function w(V,U){if(V.tipsEnable&&V.tipsText){const j=c.reactive({content:V.tipsText,enable:V.tipsEnable});return c.withDirectives(c.createVNode("button",{type:"button",class:I(V,U),id:V.id,disabled:!V.enable,onClick:H=>h(H,V)},[a.shouldShowIcon(V)&&c.createVNode("i",{class:a.iconClass(V)},null),V.text]),[[c.resolveDirective("tooltip"),j]])}return c.createVNode("button",{type:"button",class:I(V,U),id:V.id,disabled:!V.enable,onClick:j=>h(j,V)},[a.shouldShowIcon(V)&&c.createVNode("i",{class:a.iconClass(V)},null),V.text])}let N=new Map,T=[];function B(V){const U=Math.ceil(parseFloat(getComputedStyle(V).getPropertyValue("margin-left"))),j=Math.ceil(parseFloat(getComputedStyle(V).getPropertyValue("margin-right")));return(U||0)+V.getBoundingClientRect().width+(j||0)}function L(V,U,j){if(U<y.value){let H=j-1;for(;H>=0;H--){const se=V[H],ie=B(se);if(U+=ie,U>=y.value)break}j=H}return U-=y.value,j=j<0?0:j,{start:j,space:U}}function q(V){const U=l.value;let j=V;const se=Array.from(U.children).filter(ae=>ae.id!=="__more_buttons__"),ie=se.length;let oe=!1,ne=0;for(;ne<ie;ne++){const ae=se[ne],ve=B(ae);if(ve<=j)j-=ve;else{const ye=L(se,j,ne);ne=ye.start,j=ye.space,oe=!0;break}}if(!oe&&T.length>0){const ae=L(se,j,ne);ne=ae.start,j=ae.space}const Te=T.length>0;for(;ne<ie;ne++){const ae=se[ne],ve=B(ae);N.set(ae.id,!0);const ye=T.find(Se=>Se.id===ae.id);ye?ye.width=ve:T[Te?"unshift":"push"]({id:ae.id,width:ve})}return j}function W(V){let U=q(V);if(T.length){let ie=0;for(;ie<T.length;ie++){const oe=t.items.find(ne=>ne.id===T[ie].id);if(oe&&oe.visible!==!1){const ne=T[ie].width;if(U>=ne||ie===T.length-1&&U+y.value>=ne)U-=ne;else break}}for(let oe=0;oe<ie;oe++)N.delete(T[oe].id);T.splice(0,ie-1)}const j=Object.assign({},d.value);j.children=[];const H=new we(j),se=o.value.reduce((ie,oe)=>{const ne=t.items.find(Te=>Te.id===oe.id);return N.has(oe.id)?(H.children.push(oe),oe.shown=!1):oe.shown=ne.visible!==!1,ie.push(oe),ie},[]);d.value=H,o.value=se}function _(V=-1){if(V===0||!l.value||!i.value)return;V<0&&(V=i.value.getBoundingClientRect().width);const U=l.value.getBoundingClientRect().width;(V>=0&&V<U||T.length)&&(W(V),v())}function Q(){return y.value<0&&c.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[k(new we(m))])}const X=new ResizeObserver(V=>{if(V.length){const j=V[0].contentRect.width;_(j)}});function Z(){N=new Map,T=[]}function z(){i.value&&!f&&(X.observe(i.value),f=!0)}function ee(){if(r.value&&y.value<0){const V=r.value.querySelector("#"+m.id);V&&(y.value=B(V))}}return c.onMounted(()=>{ee(),_(),z(),document.body.addEventListener("click",v),document.body.addEventListener("wheel",v)}),c.onUnmounted(()=>{X.disconnect(),p(),document.body.removeEventListener("click",v),document.body.removeEventListener("wheel",v)}),c.watch(()=>t.items,()=>{o.value=rt(t.items),d.value.children=[],c.nextTick(()=>{Z(),_()})},{deep:!0}),c.watch(()=>t.visible,V=>{V&&c.nextTick(()=>{ee(),_(),z()})}),e.expose({elementRef:r}),()=>c.createVNode("div",{class:D.value,id:s,ref:r,style:{"overflow-y":y.value<0?"hidden":"initial"}},[t.visible&&Q(),t.visible&&c.createVNode("div",{ref:i,class:C.value},[c.createVNode("div",{ref:l,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(V=>V.shown).map((V,U)=>V.children&&V.children.length>0?k(V):w(V,U)),P.value&&k(d.value)])])])}}),dn=c.ref(0);function un(){dn.value++}const Ce=c.ref(0);function fn(t,e){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top>=n.top,i=o.top<=n.bottom;return r&&i}function it(t){const e=t.querySelector(".component-btn-group");if(!e)return;e.style.display="";const n=e.getBoundingClientRect();if(!(n.top===0&&n.left===0)){const o=e.querySelector("div");if(o){const r=o.getBoundingClientRect();o.style.top=n.top+"px";let i=n.left-r.width;const l=document.querySelector(".editorDiv");if(l){const b=l.getBoundingClientRect();i<b.left&&({left:i}=t.getBoundingClientRect())}o.style.left=i+"px"}}}function pn(t){if(!window.scrollContainerList)return;const e=Array.from(window.scrollContainerList);if(e.length&&e.length===1){const n=e[0],o=document.querySelector(`[id=${n}]`);if(o&&o.contains(t))return o}}function st(t){if(!t)return;const e=t.getBoundingClientRect();if(e.width===0&&e.height===0)return;const n=t.querySelector(".component-btn-group");if(n){let o=!0;const r=pn(t);if(r&&(o=fn(t,r)),!o){n.style.display="none";return}it(t)}}function gn(t){if(!t)return;let e;t.className.includes("dgComponentSelected")?e=t:e=t.querySelector(".dgComponentSelected"),e&&st(e)}function mn(t){const{formSchemaUtils:e,formStateMachineUtils:n}=t;function o(d,m=""){return{path:m+d.code,field:d.id,fullPath:d.code}}function r(d,m=""){return e.getViewModelById(d).states.map(a=>o(a,m))}function i(d){const m=e.getRootViewModelId(),y=r(d);if(d===m)return y;const a=r(m,"root-component.");return[...y,...a]}function l(d){return d.binding&&d.binding.path||d.id||""}function b(){return n&&n.getRenderStates()||[]}return{getVariables:i,getControlName:l,getStateMachines:b}}class hn{constructor(e){Y(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);Y(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});Y(this,"getExpressionConverter",(e,n)=>({convertFrom:(o,r,i,l)=>{const b=i.getExpressionRuleValue(e,n||r);return b&&b.value||""},convertTo:(o,r,i,l,b)=>{var d;if(r==="dataPicking"&&(i!=null&&i.target)){const m=`${i.target}_dataPicking`;((d=i.rules)==null?void 0:d.some(a=>a.id===m&&a.value))?o.dictPickingExpressionId=m:delete o.dictPickingExpressionId}l.updateExpression(i)}}));this.formSchemaService=e}getExpressionRule(e,n){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(l=>l.target===e);if(!r)return"";const i=r.rules.find(l=>l.type===n);return i||""}getContextFormVariables(){const{module:e}=this.formSchemaService.getFormSchema();if(!e.viewmodels||e.viewmodels.length===0)return[];const n=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(n);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(i=>{r.push({key:i.code,name:i.name,description:i.name,category:i.category})}),r}createTreeNode(e,n,o="label"){return{id:e.id,name:e.name,bindingPath:e[o],parents:n,type:"field"}}buildEntityFieldsTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var b;const i=this.createTreeNode(r,n);let l=[];(b=r.type)!=null&&b.fields&&(l=this.buildEntityFieldsTreeData(r.type.fields,[...n,r.label])),o.push({data:i,children:l,expanded:!0})}),o}buildChildEntityTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var d,m;const i=this.createTreeNode(r,n);i.type="entity";const l=this.buildEntityFieldsTreeData((d=r.type)==null?void 0:d.fields,[...n,r.label]),b=this.buildChildEntityTreeData((m=r.type)==null?void 0:m.entities,[...n,r.label]);b!=null&&b.length&&(l==null||l.push(...b)),o.push({data:i,children:l||[],expanded:!0})}),o}getEntitiesTreeData(){const e=this.formSchemaService.getSchemaEntities();if(!(e!=null&&e.length))return[];const n=e[0];if(!(n!=null&&n.type))return[];const o=this.buildEntityFieldsTreeData(n.type.fields,[n.code]),r=this.buildChildEntityTreeData(n.type.entities,[n.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:n.code,fields:[{data:this.createTreeNode(n,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(e,n,o){const r=o==="Field"?e.binding.field:e.id,i=this.getExpressionRule(r,n),l=this.getEntitiesAndVariables(),b={message:["validate","required","dataPicking"].includes(n)&&i?i.message:"",...l};return i.messageType!=null&&(b.messageType=i.messageType),b}buildRule(e,n,o,r){const{expression:i,message:l,messageType:b}=n,d={id:`${e}_${o}`,type:o,value:i};return(o==="validate"||o==="dataPicking"||o==="required")&&(d.message=l),o==="dataPicking"&&(d.messageType=b),o==="validate"&&r&&(d.elementId=r),d}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,o,r){const i=n==="Field"?e.binding.field:e.id,l=this.buildRule(i,o,r,e.type==="form-group"?e.id:"");let d=this.getExpressionData().find(y=>y.targetType===n&&y.target===i);const m=y=>y.value.trim()==="";if(d){const y=d.rules.find(a=>a.id===l.id);if(y)m(l)?d.rules=d.rules.filter(a=>a.id!==l.id):(Object.assign(y,l),r==="validate"&&e.type==="form-group"&&(y.elementId=e.id));else{if(m(l))return null;d.rules=d.rules||[],d.rules.push(l)}}else{if(m(l))return null;d={target:`${i}`,rules:[l],targetType:n}}return d}getExpressionEditorOptions(e,n,o,r){return o.reduce((i,l)=>{var d,m;const b=n==="Field"?(d=e==null?void 0:e.binding)==null?void 0:d.field:e.id;return i[l]={hide:n==="Field"?!!((m=e==null?void 0:e.binding)!=null&&m.field):!1,description:"",title:this.expressionNames[l],type:"string",$converter:this.getExpressionConverter(b),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[l]}编辑器`,showMessage:l==="validate"||l==="dataPicking"||l==="required",showMessageType:l==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(e,l,n),onSubmitModal:y=>{const a=this.updateExpression(e,n,y,l);if(r){const f=this.buildRule(b,y,l);r(f)}return a}}},i},{})}getExpressionInfo(e,n,o){const r=n==="Field"?e.binding.field:e.id,i=this.getExpressionRule(r,o),l={value:i&&i.value,targetId:r,targetType:n,expressionType:o};return i&&i.message&&(l.message=i.message),l}getExpressionConfig(e,n,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",hide:!e.binding,properties:{...this.getExpressionEditorOptions(e,n,o,r)}}}getExpressionOptions(e,n,o){const r=this.getExpressionInfo(e,n,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(e,o,n),expressionInfo:r}}}class ke{constructor(e,n){Y(this,"componentId");Y(this,"viewModelId");Y(this,"eventsEditorUtils");Y(this,"formSchemaUtils");Y(this,"formMetadataConverter");Y(this,"designViewModelUtils");Y(this,"designViewModelField");Y(this,"controlCreatorUtils");Y(this,"designerHostService");Y(this,"designerContext");Y(this,"schemaService",null);Y(this,"metadataService",null);Y(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=e,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService,this.designerContext=n.designerContext}getFormDesignerInstance(){var e,n;return(n=(e=this.designerContext)==null?void 0:e.instances)==null?void 0:n.formDesigner.value}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var o;const n=e.binding&&e.binding.type==="Form"&&e.binding.field;if(n){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===n)}e.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:e.type,name:Ee[e.type]&&Ee[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},o){const r={title:"外观",description:"Appearance"},i={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const l in n)i[l]=Object.assign(i[l]||{},n[l]);return{...r,properties:{...i},setPropertyRelates(l,b){if(l){switch(l&&l.propertyID){case"class":case"style":{Ce.value++;break}}o&&o(l,e,b)}}}}getPropertyEditorParams(e,n=[],o="visible",r={},i={},l=""){const{getVariables:b,getControlName:d,getStateMachines:m}=mn(this.designerHostService),y=this.getRealTargetType(e),a=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],f={type:"property-editor",propertyTypes:a};return a.map(g=>{switch(g){case"Const":Object.assign(f,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":f.expressionConfig=this.getExpressionOptions(e,y,l||o);break;case"StateMachine":f.stateMachines=m();break;case"Variable":Object.assign(f,{controlName:d(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:b(this.viewModelId),onBeforeOpenVariables:u=>{u.value=b(this.viewModelId)}},i);break}}),f}getVisibleProperty(e,n=""){var i;let o=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?o=["Const","Expression"]:n==="form-group"&&!((i=e.binding)!=null&&i.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,n="",o={},r){const i={title:"行为",description:""},l=this.getVisibleProperty(e,n);for(const d in o)l[d]=Object.assign(l[d]||{},o[d]);const b=this;return{...i,properties:{...l},setPropertyRelates(d,m){if(d){switch(d.propertyID){case"disabled":case"readonly":case"visible":b.afterMutilEditorChanged(e,d);break}r&&r(d,m)}}}}afterMutilEditorChanged(e,n){this.addNewVariableToViewModel(n,this.viewModelId),this.updateExpressionValue(n),this.clearExpression(n,e)}updateElementByParentContainer(e,n){const o=n&&n.parent&&n.parent.schema;if(!o)return;const r=o.contents.findIndex(l=>l.id===e),i=de.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,i),un()}addNewVariableToViewModel(e,n){const o=e.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const l={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(l.code)||this.formSchemaUtils.getViewModelById(n).states.push(l)}updateExpressionValue(e){const n=e.propertyValue;if(!((n&&n.type)==="Expression"&&n.expressionInfo))return;const{expressionId:i,expressionInfo:l}=n,{targetId:b,targetType:d,expressionType:m,value:y,message:a}=l,f=this.formSchemaUtils.getModule();f.expressions=f.expressions||[];const{expressions:g}=f;let u=g.find(S=>S.target===b);u||(u={target:b,rules:[],targetType:d},g.push(u));const s=u.rules.find(S=>S.type===m);if(s)s.value=y,s.message=a;else{const S={id:i,type:m,value:y,message:a};u.rules.push(S)}delete n.expressionInfo}clearExpression(e,n){const o=e.propertyValue;if(o&&o.type==="Expression")return;const i=e.propertyID,l=this.formSchemaUtils.getExpressions(),b=n.binding?n.binding.field:n.id,d=l.find(m=>m.target===b);!d||!d.rules||(d.rules=d.rules.filter(m=>m.type!==i))}getExpressionOptions(e,n,o){return new hn(this.formSchemaUtils).getExpressionOptions(e,n,o)}getRealTargetType(e){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(e.type)>-1?"Button":e.binding&&e.binding.field?"Field":"Container"}createBaseEventProperty(e){const n={};return n[this.viewModelId]={type:"events-editor",editor:{initialData:e,viewSourceHandle:o=>{var r;((r=o.controller)==null?void 0:r.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(o)}}},n}}class bn extends ke{constructor(n,o,r="response-toolbar"){super(n,o);Y(this,"toolbarType","response-toolbar");this.toolbarType=r}getPropertyConfig(n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.toolbarType!=="tab-toolbar"&&this.getAppearancePropConfig(n),this.propertyConfig.categories.behavior=this.getBehaviorConfig(n),this.propertyConfig}getAppearancePropConfig(n){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}}}}getBehaviorProperties(n){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 vn(t,e,n){const o=t.schema;function r(){var s;let u=((s=t.parent)==null?void 0:s.schema.type)||"";["page-header","tabs","section"].findIndex(S=>S===u)===-1&&(u=""),n.toolbarPosition=u}r();function i(u){return!1}function l(u,s){return s.text=u.label,s}function b(){return!1}function d(){return!1}function m(){return!1}function y(){return!0}function a(u){return new bn(u,e,o.type).getPropertyConfig(o)}function f(u){var k;u&&(u.stopPropagation(),u.preventDefault());const{schema:s}=t;s.buttons||(s.buttons=[]);let S="";if(s.type)S=s.type+"-item";else{const F=(k=t.parent)==null?void 0:k.schema.type;S=F==="tabs"?"tab-toolbar-item":F==="section"?"section-toolbar-item":"response-toolbar-item"}const R=Ye(S);R.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,s.buttons.push(R),n.updateToolbarItems(),n.changeSelectedId("")}function g(){return[{id:"appendItem",title:"新增按钮",text:"",icon:"f-icon f-icon-plus-circle text-white",onClick:u=>f(u)}]}return{canAccepts:i,checkCanAddComponent:m,checkCanDeleteComponent:d,checkCanMoveComponent:b,hideNestedPaddingInDesginerView:y,onResolveNewComponentSchema:l,getPropsConfig:a,getCustomButtons:g}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ie(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var lt={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(o,r,i){function l(m,y){if(!r[m]){if(!o[m]){var a=typeof Ie=="function"&&Ie;if(!y&&a)return a(m,!0);if(b)return b(m,!0);var f=new Error("Cannot find module '"+m+"'");throw f.code="MODULE_NOT_FOUND",f}var g=r[m]={exports:{}};o[m][0].call(g.exports,function(u){var s=o[m][1][u];return l(s||u)},g,g.exports,n,o,r,i)}return r[m].exports}for(var b=typeof Ie=="function"&&Ie,d=0;d<i.length;d++)l(i[d]);return l}return n}()({1:[function(n,o,r){var i={},l="(?:^|\\s)",b="(?:\\s|$)";function d(a){var f=i[a];return f?f.lastIndex=0:i[a]=f=new RegExp(l+a+b,"g"),f}function m(a,f){var g=a.className;g.length?d(f).test(g)||(a.className+=" "+f):a.className=f}function y(a,f){a.className=a.className.replace(d(f)," ").trim()}o.exports={add:m,rm:y}},{}],2:[function(n,o,r){(function(i){var l=n("contra/emitter"),b=n("crossvent"),d=n("./classes"),m=document,y=m.documentElement;function a(v,I){var h=arguments.length;h===1&&Array.isArray(v)===!1&&(I=v,v=[]);var w,N,T,B,L,q,W,_,Q,X=null,Z,z,ee=!1,V=0,U,j=I||{};j.moves===void 0&&(j.moves=k),j.accepts===void 0&&(j.accepts=k),j.invalid===void 0&&(j.invalid=Fn),j.containers===void 0&&(j.containers=v||[]),j.isContainer===void 0&&(j.isContainer=R),j.copy===void 0&&(j.copy=!1),j.copySortSource===void 0&&(j.copySortSource=!1),j.revertOnSpill===void 0&&(j.revertOnSpill=!1),j.removeOnSpill===void 0&&(j.removeOnSpill=!1),j.direction===void 0&&(j.direction="vertical"),j.ignoreInputTextSelection===void 0&&(j.ignoreInputTextSelection=!0),j.mirrorContainer===void 0&&(j.mirrorContainer=m.body);var H=l({containers:j.containers,start:On,end:pt,cancel:bt,remove:ht,destroy:Te,canMove:Vn,dragging:!1});return j.removeOnSpill===!0&&H.on("over",An).on("out",$n),ie(),H;function se(x){return H.containers.indexOf(x)!==-1||j.isContainer(x)}function ie(x){var A=x?"remove":"add";u(y,A,"mousedown",ve),u(y,A,"mouseup",Re)}function oe(x){var A=x?"remove":"add";u(y,A,"mousemove",ye)}function ne(x){var A=x?"remove":"add";b[A](y,"selectstart",ae),b[A](y,"click",ae)}function Te(){ie(!0),Re({})}function ae(x){Z&&x.preventDefault()}function ve(x){B=x.clientX,L=x.clientY;var A=s(x)!==1||x.metaKey||x.ctrlKey;if(!A){var $=x.target,G=Se($);G&&(Z=G,oe(),x.type==="mousedown"&&(O($)?$.focus():x.preventDefault()))}}function ye(x){if(Z){if(s(x)===0){Re({});return}if(!(x.clientX!==void 0&&Math.abs(x.clientX-B)<=(j.slideFactorX||0)&&x.clientY!==void 0&&Math.abs(x.clientY-L)<=(j.slideFactorY||0))){if(j.ignoreInputTextSelection){var A=C("clientX",x)||0,$=C("clientY",x)||0,G=m.elementFromPoint(A,$);if(O(G))return}var J=Z;oe(!0),ne(),pt(),ft(J),d.add(_||T,"gu-transit"),Ln(),_n(),V=0,Fe(x)}}}function Se(x){if(!(H.dragging&&w)&&!se(x)){for(var A=x;P(x)&&se(P(x))===!1;)if(j.invalid(x,A)||(x=P(x),!x))return;var $=P(x);if($&&!j.invalid(x,A)){var G=j.moves(x,$,A,p(x));if(G)return{item:x,source:$}}}}function Vn(x){return!!Se(x)}function On(x){var A=Se(x);A&&ft(A)}function ft(x){Hn(x.item,x.source)&&(_=x.item.cloneNode(!0),H.emit("cloned",_,x.item,"copy")),N=x.source,T=x.item,q=W=p(x.item),H.dragging=!0,H.emit("drag",T,N)}function Fn(){return!1}function pt(){if(H.dragging){var x=_||T;mt(x,P(x))}}function gt(){Z=!1,oe(!0),ne(!0)}function Re(x){if(gt(),!!H.dragging){var A=_||T,$=C("clientX",x)||0,G=C("clientY",x)||0,J=S(w,$,G),K=vt(J,$,G);K&&(_&&j.copySortSource||!_||K!==N)?mt(A,K):j.removeOnSpill?ht():bt()}}function mt(x,A){var $=P(x);_&&j.copySortSource&&A===N&&$.removeChild(T),Oe(A)?H.emit("cancel",x,N):H.emit("drop",x,A,N,W),Ve()}function ht(){if(H.dragging){var x=_||T,A=P(x);A&&A.removeChild(x),H.emit(_?"cancel":"remove",x,A,N),Ve()}}function bt(x){if(H.dragging){var A=arguments.length>0?x:j.revertOnSpill,$=_||T,G=P($),J=Oe(G);J===!1&&A&&(_?G&&G.removeChild(_):N.insertBefore($,q)),J||A?H.emit("cancel",$,N,N):H.emit("drop",$,G,N,W),Ve()}}function Ve(){var x=_||T;gt(),qn(),Wn(),x&&d.rm(x,"gu-transit"),Q&&clearTimeout(Q),H.dragging=!1,X&&H.emit("out",x,X,N),H.emit("dragend",x,V),N=T=_=q=W=Q=X=null}function Oe(x,A){var $;return A!==void 0?$=A:w?$=W:$=p(_||T),x===N&&$===q}function vt(x,A,$){for(var G=x;G&&!J();)G=P(G);return G;function J(){var K=se(G);if(K===!1)return!1;var ge=yt(G,x),ue=Ct(G,ge,A,$),pe=Oe(G,ue);return pe?!0:j.accepts(T,G,N,ue)}}function Fe(x){if(!w)return;x.preventDefault();var A=C("clientX",x)||0,$=C("clientY",x)||0;w.style.left=A-2+"px",w.style.top=$-2+"px";var G=_||T,J=S(w,A,$),K=vt(J,A,$),ge=K!==null&&K!==X;(ge||K===null)&&(fe(),X=K,be()),Xn(J,$);var ue=P(G);if(K===N&&_&&!j.copySortSource){ue&&ue.removeChild(G);return}var pe,he=yt(K,J);if(ee=Un(he,K),he!==null)pe=Ct(K,he,A,$);else if(j.revertOnSpill===!0&&!_)pe=q,K=N;else{_&&ue&&ue.removeChild(G),_&&z&&(z.style.display="none");return}z.style.display="block",jn(pe,G,ge),pe?Gn(he,pe):Yn(K);function le(ce){H.emit(ce,G,X,N)}function be(){ge&&le("over")}function fe(){X&&le("out")}}function jn(x,A,$){(x===A||x===p(A))&&(W=p(A)),(x===null&&$||x!==A&&x!==p(A))&&(W=x)}function An(x){d.rm(x,"gu-hide")}function $n(x){H.dragging&&d.add(x,"gu-hide")}function _n(){w||(w=document.createElement("div"),w.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;",w.innerHTML=j.getMirrorText&&j.getMirrorText(T)||"控件",d.add(w,"gu-mirror"),j.mirrorContainer.appendChild(w),u(y,"add","mousemove",Fe),d.add(j.mirrorContainer,"gu-unselectable"),H.emit("cloned",w,T,"mirror"))}function Ln(){if(z=document.createElement("div"),d.add(z,"gu-insertion"),T){var x=T.getBoundingClientRect();z.style.left=x.left+"px",z.style.top=x.top+"px"}ee=!1,j.mirrorContainer.appendChild(z)}function qn(){w&&(d.rm(j.mirrorContainer,"gu-unselectable"),u(y,"remove","mousemove",Fe),P(w).removeChild(w),w=null)}function Wn(){z&&(P(z).removeChild(z),z=null)}function yt(x,A){for(var $=A;$!==x&&P($)!==x;)$=P($);return $===y?null:$}function Un(x,A){if(!A)return ee;var $=x||A&&A.lastElementChild;if(!$)return!0;var G=getComputedStyle(x),J=/^inline/.test(G.getPropertyValue("display"))||/^(left|right)$/.test(G.getPropertyValue("float"));if(J)return!0;if(A){var K=getComputedStyle(A),ge=K.getPropertyValue("display");if(/flex$/.test(ge)){var ue=K.getPropertyValue("flex-direction")||"row";if(ue==="row"||ue==="row-reverse")return!zn(A)}return!1}return!0}function zn(x){if(!x.children||!x.children.length)return!1;for(const A of Array.from(x.children)){const G=(A.className&&A.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!G.length)return!1;for(const J of G){const K=J.slice(J.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function Gn(x,A){const $=A.getBoundingClientRect();if(z.style.left=$.left+"px",z.style.top=$.top+"px",ee){if(z.style.height=$.height+"px",z.style.width="4px",x){const G=x.getBoundingClientRect();G.top!==$.top&&(z.style.left=G.right+"px",z.style.top=G.top+"px",z.style.height=G.height+"px")}}else if(z.style.height="4px",z.style.width=$.width+"px",U){const G=U.getBoundingClientRect();$.top<G.top&&(z.style.display="none")}A===T&&T&&(z.style.display="none")}function Yn(x){W=null;var A=x.lastElementChild;if(A){var $=A.getBoundingClientRect();ee?(z.style.left=$.right+"px",z.style.top=$.top+"px",z.style.height=$.height+"px",z.style.width="4px"):(z.style.left=$.left+"px",z.style.top=$.bottom+"px",z.style.height="4px",z.style.width=$.width+"px"),A===T&&T&&(z.style.display="none")}else z.style.display="none"}function Xn(x,A){if(!j.mirrorContainer.contains(x)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(U=f(x),!U||!U.contains(x)))return;const $=document.querySelector(".dgComponentSelected"),G=U.getBoundingClientRect();if(A-30<G.top&&U.scrollTop>0){let J=U.scrollTop<10?U.scrollTop:10;U.scrollBy(0,-1*J),$&&U.contains($)&&(V=V+-1*J)}if(A+30>G.bottom&&U.scrollTop<U.scrollHeight-U.clientHeight){const J=U.scrollHeight-U.clientHeight-U.scrollTop;let K=J<10?J:10;U.scrollBy(0,K),$&&U.contains($)&&(V=V+K)}}function Ct(x,A,$,G){var J=j.direction==="horizontal",K=j.direction==="mixed",ge=A!==x?pe():ue();return ge;function ue(){var le=x.children.length,be,fe,ce;for(be=0;be<le;be++)if(fe=x.children[be],ce=fe.getBoundingClientRect(),J&&ce.left+ce.width/2>$||!K&&!J&&ce.top+ce.height/2>G||K&&ce.left+ce.width>$&&ce.top+ce.height>G)return fe;return null}function pe(){var le=A.getBoundingClientRect();if(K){var be=G-le.top,fe=$-le.left,ce=le.bottom-G,je=le.right-$,Ae=Math.min(fe,je,be,ce),$e;return ee?$e=je<fe:$e=ce===Ae||je===Ae||fe===Ae,he($e)}return he(J?$>le.left+F(le)/2:G>le.top+M(le)/2)}function he(le){return le?p(A):A}}function Hn(x,A){return typeof j.copy=="boolean"?j.copy:j.copy(x,A)}}function f(v){const I=Array.from(window.scrollContainerList);if(I.length===1){const w=Array.from(window.scrollContainerList)[0];return document.getElementById(w)}const h=g(I);for(const w of h)if(w.contains(v))return w;return null}function g(v){const I=[];return v.forEach(h=>{const w=document.getElementById(h);w&&I.push(w)}),I.sort((h,w)=>h.contains(w)?1:w.contains(h)?-1:0),I}function u(v,I,h,w){var N={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},T={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};i.navigator.pointerEnabled?b[I](v,T[h],w):i.navigator.msPointerEnabled?b[I](v,B[h],w):(b[I](v,N[h],w),b[I](v,h,w))}function s(v){if(v.touches!==void 0)return v.touches.length;if(v.which!==void 0&&v.which!==0)return v.which;if(v.buttons!==void 0)return v.buttons;var I=v.button;if(I!==void 0)return I&1?1:I&2?3:I&4?2:0}function S(v,I,h){v=v||{};var w=v.className||"",N;return v.className+=" gu-hide",N=m.elementFromPoint(I,h),v.className=w,N}function R(){return!1}function k(){return!0}function F(v){return v.width||v.right-v.left}function M(v){return v.height||v.bottom-v.top}function P(v){return v.parentNode===m?null:v.parentNode}function O(v){return v.tagName==="INPUT"||v.tagName==="TEXTAREA"||v.tagName==="SELECT"||E(v)}function E(v){return!v||v.contentEditable==="false"?!1:v.contentEditable==="true"?!0:E(P(v))}function p(v){return v.nextElementSibling||I();function I(){var h=v;do h=h.nextSibling;while(h&&h.nodeType!==1);return h}}function D(v){return v.targetTouches&&v.targetTouches.length?v.targetTouches[0]:v.changedTouches&&v.changedTouches.length?v.changedTouches[0]:v}function C(v,I){var h=D(I),w={pageX:"clientX",pageY:"clientY"};return v in w&&!(v in h)&&w[v]in h&&(v=w[v]),h[v]}o.exports=a}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,o,r){o.exports=function(l,b){return Array.prototype.slice.call(l,b)}},{}],4:[function(n,o,r){var i=n("ticky");o.exports=function(b,d,m){b&&i(function(){b.apply(m||null,d||[])})}},{ticky:10}],5:[function(n,o,r){var i=n("atoa"),l=n("./debounce");o.exports=function(d,m){var y=m||{},a={};return d===void 0&&(d={}),d.on=function(f,g){return a[f]?a[f].push(g):a[f]=[g],d},d.once=function(f,g){return g._once=!0,d.on(f,g),d},d.off=function(f,g){var u=arguments.length;if(u===1)delete a[f];else if(u===0)a={};else{var s=a[f];if(!s)return d;s.splice(s.indexOf(g),1)}return d},d.emit=function(){var f=i(arguments);return d.emitterSnapshot(f.shift()).apply(this,f)},d.emitterSnapshot=function(f){var g=(a[f]||[]).slice(0);return function(){var u=i(arguments),s=this||d;if(f==="error"&&y.throws!==!1&&!g.length)throw u.length===1?u[0]:u;return g.forEach(function(R){y.async?l(R,u,s):R.apply(s,u),R._once&&d.off(f,R)}),d}},d}},{"./debounce":4,atoa:3}],6:[function(n,o,r){(function(i){var l=n("custom-event"),b=n("./eventmap"),d=i.document,m=f,y=u,a=[];i.addEventListener||(m=g,y=s),o.exports={add:m,remove:y,fabricate:S};function f(P,O,E,p){return P.addEventListener(O,E,p)}function g(P,O,E){return P.attachEvent("on"+O,k(P,O,E))}function u(P,O,E,p){return P.removeEventListener(O,E,p)}function s(P,O,E){var p=F(P,O,E);if(p)return P.detachEvent("on"+O,p)}function S(P,O,E){var p=b.indexOf(O)===-1?C():D();P.dispatchEvent?P.dispatchEvent(p):P.fireEvent("on"+O,p);function D(){var v;return d.createEvent?(v=d.createEvent("Event"),v.initEvent(O,!0,!0)):d.createEventObject&&(v=d.createEventObject()),v}function C(){return new l(O,{detail:E})}}function R(P,O,E){return function(D){var C=D||i.event;C.target=C.target||C.srcElement,C.preventDefault=C.preventDefault||function(){C.returnValue=!1},C.stopPropagation=C.stopPropagation||function(){C.cancelBubble=!0},C.which=C.which||C.keyCode,E.call(P,C)}}function k(P,O,E){var p=F(P,O,E)||R(P,O,E);return a.push({wrapper:p,element:P,type:O,fn:E}),p}function F(P,O,E){var p=M(P,O,E);if(p){var D=a[p].wrapper;return a.splice(p,1),D}}function M(P,O,E){var p,D;for(p=0;p<a.length;p++)if(D=a[p],D.element===P&&D.type===O&&D.fn===E)return p}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,o,r){(function(i){var l=[],b="",d=/^on/;for(b in i)d.test(b)&&l.push(b.slice(2));o.exports=l}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,o,r){(function(i){var l=i.CustomEvent;function b(){try{var d=new l("cat",{detail:{foo:"bar"}});return d.type==="cat"&&d.detail.foo==="bar"}catch{}return!1}o.exports=b()?l:typeof document<"u"&&typeof document.createEvent=="function"?function(m,y){var a=document.createEvent("CustomEvent");return y?a.initCustomEvent(m,y.bubbles,y.cancelable,y.detail):a.initCustomEvent(m,!1,!1,void 0),a}:function(m,y){var a=document.createEventObject();return a.type=m,y?(a.bubbles=!!y.bubbles,a.cancelable=!!y.cancelable,a.detail=y.detail):(a.bubbles=!1,a.cancelable=!1,a.detail=void 0),a}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,o,r){var i=o.exports={},l,b;function d(){throw new Error("setTimeout has not been defined")}function m(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?l=setTimeout:l=d}catch{l=d}try{typeof clearTimeout=="function"?b=clearTimeout:b=m}catch{b=m}})();function y(M){if(l===setTimeout)return setTimeout(M,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(M,0);try{return l(M,0)}catch{try{return l.call(null,M,0)}catch{return l.call(this,M,0)}}}function a(M){if(b===clearTimeout)return clearTimeout(M);if((b===m||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(M);try{return b(M)}catch{try{return b.call(null,M)}catch{return b.call(this,M)}}}var f=[],g=!1,u,s=-1;function S(){!g||!u||(g=!1,u.length?f=u.concat(f):s=-1,f.length&&R())}function R(){if(!g){var M=y(S);g=!0;for(var P=f.length;P;){for(u=f,f=[];++s<P;)u&&u[s].run();s=-1,P=f.length}u=null,g=!1,a(M)}}i.nextTick=function(M){var P=new Array(arguments.length-1);if(arguments.length>1)for(var O=1;O<arguments.length;O++)P[O-1]=arguments[O];f.push(new k(M,P)),f.length===1&&!g&&y(R)};function k(M,P){this.fun=M,this.array=P}k.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function F(){}i.on=F,i.addListener=F,i.once=F,i.off=F,i.removeListener=F,i.removeAllListeners=F,i.emit=F,i.prependListener=F,i.prependOnceListener=F,i.listeners=function(M){return[]},i.binding=function(M){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(M){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],10:[function(n,o,r){(function(i){var l=typeof i=="function",b;l?b=function(d){i(d)}:b=function(d){setTimeout(d,0)},o.exports=b}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,o,r){(function(i,l){var b=n("process/browser.js").nextTick,d=Function.prototype.apply,m=Array.prototype.slice,y={},a=0;r.setTimeout=function(){return new f(d.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new f(d.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(g){g.close()};function f(g,u){this._id=g,this._clearFn=u}f.prototype.unref=f.prototype.ref=function(){},f.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(g,u){clearTimeout(g._idleTimeoutId),g._idleTimeout=u},r.unenroll=function(g){clearTimeout(g._idleTimeoutId),g._idleTimeout=-1},r._unrefActive=r.active=function(g){clearTimeout(g._idleTimeoutId);var u=g._idleTimeout;u>=0&&(g._idleTimeoutId=setTimeout(function(){g._onTimeout&&g._onTimeout()},u))},r.setImmediate=typeof i=="function"?i:function(g){var u=a++,s=arguments.length<2?!1:m.call(arguments,1);return y[u]=!0,b(function(){y[u]&&(s?g.apply(null,s):g.call(null),r.clearImmediate(u))}),u},r.clearImmediate=typeof l=="function"?l:function(g){delete y[g]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(lt);var Cn=lt.exports;const at=yn(Cn);function wn(t){let e;function n(r,i,l,b){const d=t.schema;if(!(d!=null&&d.buttons))return;let m;if(l){const g=l.getAttribute("id");m=Array.from(i.children).findIndex(u=>u.getAttribute("id")===g)}else m=Array.from(i.children).length;const y=r.getAttribute("id"),a=Array.from(i.children).findIndex(g=>g.getAttribute("id")===y),f=d.buttons[a];a!==m&&a>-1&&m>-1&&(a<m&&(m=m-1),d.buttons.splice(a,1),d.buttons.splice(m,0,f),b(),c.nextTick(()=>{const g=i.querySelector(".dgComponentSelected");g!=null&&g.className.includes("dgComponentSelected")&&(g.classList.remove("dgComponentSelected"),g.classList.remove("dgComponentFocused"),g.click()),Ce.value++}))}function o(r,i,l){e&&e.destroy(),!(!at||!r||!i)&&(e=at([r],{mirrorContainer:i,direction:"horizontal",getMirrorText(b){return b.innerText},moves(b,d,m){let y=!0;return m.classList.contains("dropdown-item")?(y=!1,y):(b.classList.contains("no-drag")&&(y=!1),y)}}).on("drop",(b,d,m,y)=>n(b,d,y,l)))}return{dragulaInstance:e,initDragula:o}}function xn(t,e,n){const{renderToolbarItemDesigner:o,actionHandlers:r}=n;let i;function l(k){i=k}function b(k,F=null){const M=e.value.find(P=>P.id===k.id);if(M.isDP)if(document.body.click(),typeof F=="boolean")M.expanded=F;else{const P=k.expanded;M.expanded=!P}}r.toggleDropdownMenu=b;function d(k){var M;const F={"dropdown-menu":!0};if(k.class){const P=(M=k.menuClass)==null?void 0:M.split(" ");P&&P.length&&P.reduce((O,E)=>(O[E]=!0,O),F)}return F}function m(k){var P;const F={disabled:k.disabled===!1,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},M=(P=k.dropdownClass)==null?void 0:P.split(" ");return M&&M.length&&M.reduce((O,E)=>(O[E]=!0,O),F),F}function y(k){const F={disabled:!1,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0,"text-truncate":!0},M=(k.class||"").split(" ");return M&&M.length&&M.reduce((P,O)=>(P[O]=!0,P),F),F}let a;const f=new Map;function g(k,F,M){k.stopPropagation();const P=M?M.id:"__top_item__";if(F.children&&F.children.length&&(F.expanded=!F.expanded,F.expanded)){if(f.has(P)&&f.get(P)!==F){const O=f.get(P);O&&(O.expanded=!1,f.delete(P))}f.set(P,F)}}function u(k){var F;return(F=k.children)==null?void 0:F.map((M,P)=>M.children&&M.children.length?c.createVNode("li",{class:m(M),id:M.id},[c.createVNode("span",{class:y(M),onClick:O=>g(O,M,k)},[M.text,c.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),a(M,M)]):o(M,P,!0))}function s(k,F,M,P){const{height:p,left:D,top:C}=P[0],{width:v,height:I}=M.getBoundingClientRect(),{marginTop:h,marginBottom:w}=getComputedStyle(M),N=Math.ceil(parseFloat(h))+Math.ceil(parseFloat(w)),T=C+p,B=F==null?void 0:F.getBoundingClientRect();function L(){let Q=0,X="left";const Z=B?B.right:window.innerWidth,z=B?B.left:0;return Q=Z-D-10,Z-D<v&&D-z>Z-D&&(X="right",Q=D-z-10),{hposition:X,maxWidth:Math.min(Q,300)}}let q=0,W="bottom";if(k==="tabs"||k==="section")q=F.getBoundingClientRect().bottom-T-N-10;else{const Q=B?B.bottom:window.innerHeight;q=k==="page-header"?Q-T:C,q=q-N-10,W=k==="page-header"?"bottom":"top"}const _=L();return{position:W+"-"+_.hposition,maxWidth:_.maxWidth,maxHeight:q}}function S(k){var E,p,D;const F="300px",M={display:k.expanded===!0?"block":"none",position:"absolute",maxWidth:F,minWidth:"120px"};if(!(i!=null&&i.value))return M;const P=i.value.querySelector("#"+k.id),O=P==null?void 0:P.getClientRects();if(P&&O&&O.length>0){const C=P?P.querySelector("#"+k.id+"_menu"):null;if(!C||k.expanded!==!0)return M;C.style.visibility="hidden",C.style.display="block",C.style.maxHeight="auto",C.style.maxWidth=F;let v;switch(r.toolbarPosition){case"tabs":v=(E=i.value)==null?void 0:E.closest(".farris-tabs");break;case"section":v=(p=i.value)==null?void 0:p.closest(".f-section");break;default:v=(D=i.value)==null?void 0:D.closest(".f-page")}const I=s(r.toolbarPosition,v,C,O),{position:h,maxHeight:w,maxWidth:N}=I;C.style.visibility="visible";const T={left:h.indexOf("left")>-1?0:"unset",right:h.indexOf("left")>-1?"unset":0,bottom:h.indexOf("bottom")>-1?"unset":"100%",top:h.indexOf("bottom")>-1?"!00%":"unset",maxWidth:N?N+"px":"300px",maxHeight:w?w+"px":"auto",overflowY:w?"auto":"unset"};Object.assign(M,T)}return M}r.changeMenuPosition=S,a=function(k,F){return c.createVNode("ul",{class:d(k),style:S(k),id:k.id+"_menu"},[u(k)])};function R(k=""){k&&f.has(k)?f.forEach((F,M)=>{M!==k&&(F.expanded=!1,f.delete(M))}):(f.forEach(F=>{F.expanded=!1}),f.clear())}return{renderDropdownMenu:a,clearAllDropDownMenu:R,setResponseToolbarRef:l}}const Tn={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 Sn(t,e,n){var D;const o="",r=c.ref();let i;function l(){return!0}function b(){return!1}function d(){return!0}function m(){return!0}function y(){return!0}function a(C){if(!C||!C.value)return null;const v=c.ref(C==null?void 0:C.value.parent),I=a(v);return I||null}function f(C=e){var w;const{componentInstance:v,designerItemElementRef:I}=C;if(!v||!v.value)return null;const{getCustomButtons:h}=v.value;return v.value.canMove||v.value.canAdd||v.value.canDelete||h&&((w=h())!=null&&w.length)?I:f(C.parent)}function g(){}function u(C){return!!n}function s(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function S(){}function R(C,v){}function k(C){const{componentType:v}=C,I=c.inject("designer-host-service");let h=xt.getSchemaByTypeForDesigner(v,C,I);const w=v.toLowerCase().replace(/-/g,"_");return h&&!h.id&&h.type===v&&(h.id=`${w}_${Math.random().toString().slice(2,6)}`),h}function F(C){}function M(...C){return[]}function P(){}function O(C){var I;if(!(e!=null&&e.schema))return;let v="";{const{text:h,title:w,label:N,mainTitle:T,name:B,type:L}=e.schema;v=h||w||N||T||B||((I=Ee[L])==null?void 0:I.name)}v&&(!i&&C&&(i=C.formSchemaUtils),i.getControlBasicInfoMap().set(e.schema.id,{componentTitle:v,parentPathName:v}))}function E(C){var w;const{changeObject:v}=C,{propertyID:I,propertyValue:h}=v;["text","title","label","name","mainTitle"].includes((w=C==null?void 0:C.changeObject)==null?void 0:w.propertyID)&&I&&h&&O()}function p(C){E(C)}return r.value={canMove:l(),canSelectParent:b(),canAdd:m(),canDelete:d(),canNested:!y(),contents:[],elementRef:t,parent:(D=e.parent)==null?void 0:D.componentInstance,schema:e.schema,styles:o,canAccepts:u,getBelongedComponentInstance:a,getDraggableDesignItemElement:f,getDraggingDisplayText:s,getPropConfig:M,getDragScopeElement:S,onAcceptMovedChildElement:R,onChildElementMovedOut:F,addNewChildComponentSchema:k,onRemoveComponent:P,triggerBelongedComponentToMoveWhenMoved:c.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:c.ref(!1),onPropertyChanged:p,getCustomButtons:g,setComponentBasicInfoMap:O},r}const En=c.defineComponent({name:"FDesignerInnerItem",props:Tn,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,e){const n=c.ref(t.canMove),o=c.ref(t.canAdd),r=c.ref(t.canDelete),i=c.ref(!1),l=c.ref(t.contentKey),b=c.ref(t.childType),d=c.ref(t.childLabel),m=c.ref(t.modelValue),y=c.ref(""),a=c.ref(),f=c.inject("canvas-dragula"),g=c.ref(),u=c.inject("design-item-context"),s={designerItemElementRef:a,componentInstance:g,schema:m.value,parent:u,setupContext:e};c.provide("design-item-context",s);const S=c.inject("designer-host-service"),R=c.inject("external-container-id"),k=c.computed(()=>{var L;const T=((L=g.value)==null?void 0:L.getCustomButtons)&&g.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||r.value||(T==null?void 0:T.length),"farris-nested":i.value,"can-move":n.value,"d-none":a.value&&a.value.classList.contains("d-none")}}),F=c.computed(()=>{const T={};return y.value&&y.value.split(";").reduce((B,L)=>{const[q,W]=L.split(":");return q&&(B[q]=W),B},T),T});function M(T,B){if(u&&u.schema[l.value]){const L=u.schema[l.value].findIndex(q=>q.id===B.id);if(L>-1){const q=u.schema[l.value].length,W=u.schema[l.value][L%q];u.designerItemElementRef.value.querySelector(`#${W.id}-design-item`),u.schema[l.value].splice(L,1),Ce.value++,e.emit("removeComponent"),e.emit("selectionChange")}}}function P(T){if(g.value.addNewChildComponentSchema){const B={componentType:b.value,label:d.value,parentComponentInstance:g.value,targetPosition:-1},L=g.value.addNewChildComponentSchema(B);m.value[l.value].push(L),e.emit("addComponent")}}function O(){return o.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:T=>{P()}},[c.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function E(T){return r.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:c.withModifiers(B=>M(B,T),["stop"])},[c.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function p(){return n.value&&c.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[c.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function D(){var B;const T=((B=g.value)==null?void 0:B.getCustomButtons)&&g.value.getCustomButtons();return T&&!!T.length&&T.map(L=>c.createVNode("div",{role:"button",class:`btn component-settings-button ${L.class||""} ${L.text?"settings-button-extend":""}`,title:L.title,ref:L.id,onClick:q=>L.onClick&&L.onClick(q)},[c.createVNode("i",{class:"f-icon "+L.icon},null),L.text&&c.createVNode("span",{class:"icon-text"},[L.text])]))}function C(T){return c.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[c.createVNode("div",null,[O(),p(),E(T),D()])])}c.watch(()=>t.modelValue,T=>{m.value=T,s.schema=T});function v(T){window.scrollContainerList||(window.scrollContainerList=new Set);const B=T.getAttribute("id");B&&window.scrollContainerList.add(B)}function I(T){const B=T.target;v(B),gn(B)}function h(){var T,B;(B=(T=m.value)==null?void 0:T.contents)!=null&&B.length&&a.value&&a.value.addEventListener("scroll",I)}function w(){const T=a.value,B=c.ref(T.children[1]);return Sn(B,s).value}c.onMounted(()=>{if(a.value){const T=a.value.querySelector(`[data-dragref='${m.value.id}-container']`);g.value=T&&T.componentInstance?T.componentInstance.value:w(),f&&T&&f.attachComponents(T,m.value),i.value=g.value.canNested!==void 0?g.value.canNested:i.value,o.value=g.value.canAdd!==void 0?g.value.canAdd:o.value,r.value=g.value.canDelete!==void 0?g.value.canDelete:r.value,n.value=g.value.canMove!==void 0?g.value.canMove:n.value,y.value=g.value.styles||"",a.value&&(a.value.componentInstance=g,a.value.designItemContext=s),g.value.setComponentBasicInfoMap(S)}h(),Ce.value++}),c.onBeforeUnmount(()=>{a.value&&a.value.removeEventListener("scroll",I)});function N(T){if(T&&(T.preventDefault(),T.stopPropagation()),R){const q=document.getElementById(`${R}-design-item`);q&&q.click();return}let B=s.designerItemElementRef;const L=a.value;if(L){const q=document.getElementsByClassName("dgComponentFocused");q&&q.length===1&&q[0]===a.value&&a.value.classList.contains("dgComponentSelected")||(Array.from(q).forEach(_=>_.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(_=>_.classList.remove("dgComponentSelected")),L.classList.add("dgComponentFocused"),e.emit("selectionChange",m.value.type,m.value,t.componentId,g.value),g.value.getDraggableDesignItemElement&&(B=g.value.getDraggableDesignItemElement(s),B&&B.value&&B.value.classList.add("dgComponentSelected")))}st(B==null?void 0:B.value)}return()=>c.createVNode("div",{id:`${t.id}-design-item`,ref:a,class:k.value,style:F.value,onClick:N},[C(m.value),e.slots.default&&e.slots.default()])}});class In extends ke{constructor(e,n){super(e,n)}getPropertyConfig(e,n=!1){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(e,n),this.getbBehaviorConfig(e),this.getEventPropConfig(e),this.propertyConfig}getAppearanceProperties(e,n=!1){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式",visible:!n},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(e.children&&e.children.length>0)}}}}getbBehaviorConfig(e){const n=this.getPropertyEditorParams(e,["Const","Variable","StateMachine","Expression"],"disabled");this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:n}})}getEventPropConfig(e){const n=[{label:"onClick",name:"点击事件"}],o=this,r=o.eventsEditorUtils.formProperties(e,o.viewModelId,n),i=o.createBaseEventProperty(r);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,b){const d=l.propertyValue;delete e[o.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,d.events,d))}}}}class Pn extends ke{constructor(n,o,r="response-toolbar-item"){super(n,o);Y(this,"toolbarType","response-toolbar-item");this.toolbarType=r}getPropertyConfig(n,o=!1){this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.propertyConfig.categories.basic.setPropertyRelates=i=>{if(i)switch(i&&i.propertyID){case"text":{i.needRefreshControlTree=!0;break}}},this.getAppearanceProperties(n,o);const r=this.getPropertyEditorParams(n,["Const","Variable","StateMachine","Expression"],"disabled");return this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:r}}),this.getEventPropConfig(n),this.propertyConfig}getAppearanceProperties(n,o=!1){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"",$converter:"/converter/appearance.converter",parentPropertyID:"appearance",visible:!o},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(n.children&&n.children.length>0)},tipsEnable:{title:"启用提示",type:"boolean",description:"当启用提示时,鼠标滑过按钮会有消息提示框",refreshPanelAfterChanged:!0,visible:this.toolbarType==="response-toolbar-item"},tipsText:{title:"提示消息内容",type:"string",description:"消息提示框内的展示内容",visible:n.tipsEnable===!0}}}}getEventPropConfig(n){const o=[{label:"onClick",name:"点击事件"}],r=this,i=r.eventsEditorUtils.formProperties(n,r.viewModelId,o),l=r.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:l,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(b,d){const m=b.propertyValue;delete n[r.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(n,r.viewModelId,m.events,m))}}}}function Ne(t,e){if(!t)return!1;const n=e||[];return(n==null?void 0:n.findIndex(r=>r.id===t))===-1}function ct(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};return n.some((r,i)=>{if(r.children&&r.children.length>0){const l=r.children.findIndex(b=>b.id===t);return l>-1?(o={parentIndex:i,itemIndex:l},!0):!1}}),o}function dt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};const r=n==null?void 0:n.findIndex(i=>i.id===t);return r>-1?{parent:null,item:n[r]}:(n.some((i,l)=>{if(i.children&&i.children.length>0){const b=i.children.findIndex(d=>d.id===t);return b>-1?(o={parentIndex:l,itemIndex:b},!0):!1}}),o.parentIndex<0?{parent:null,item:null}:{parent:n[o.parentIndex],item:n[o.parentIndex].children[o.itemIndex]})}function Mn(t,e){const n=e||[],o=n==null?void 0:n.findIndex(r=>r.id===t);return o>-1&&n[o].children&&n[o].children.length>0?n[o].expanded===!0:!1}function Dn(t,e,n){function o(I){return!1}function r(){return!1}function i(){return!1}function l(){return!1}function b(){return n.toolbarContext.schema.buttons||[]}function d(I,h=""){setTimeout(()=>{var B,L;const w=(B=t.parent)==null?void 0:B.designerItemElementRef.value;let N;h&&(N=w==null?void 0:w.querySelector("#"+h));const T=(L=N||w)==null?void 0:L.querySelector("#"+I);T==null||T.click()},0)}function m(I,h){h.disabled&&h.disabled.expressionId&&(h.disabled.expressionId=`${h.id}_disabled`),h.visible&&h.visible.expressionId&&(h.visible.expressionId=`${h.id}_visible`);const w=e.formSchemaUtils.getExpressions(),N=w.find(B=>B.target===I.id);if(!N||!N.rules||!N.rules.length)return;const T={target:h.id,rules:[],targetType:"Button"};N.rules.forEach(B=>{const L=Object.assign(de.cloneDeep(B),{id:`${h.id}_${B.type}`});T.rules.push(L)}),w.push(T)}function y(){var N;const I=t.schema,h=Object.assign(de.cloneDeep(I),{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null});(N=e==null?void 0:e.designerContext)!=null&&N.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(h);let w=[];return h.children&&h.children.length&&(w=h.children.map(T=>{var L;const B=de.cloneDeep(T);return Object.assign(B,{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null}),(L=e==null?void 0:e.designerContext)!=null&&L.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(B),m(T,B),B}),h.children=w),m(I,h),h}function a(){const I=t.schema.type||"response-toolbar-item",h=Qt(I),w=I.toLowerCase().replace("-","_");return h&&!h.id&&h.type===I&&(h.id=`${w}_${Math.random().toString().slice(2,6)}`,h.text="按钮"),h}function f(I){const h=b(),w=h==null?void 0:h.findIndex(T=>T.id===I),N=w===-1?null:h[w];return{index:w,toolbarItem:N}}function g(){const I=t.schema.id,h=b();return Ne(I,h)}function u(I){const h=e.formSchemaUtils.getExpressions();if(!h||!h.length)return;const w=N=>{const T=h&&h.findIndex(B=>B.target===N.id);T>-1&&h.splice(T,1)};w(I),I.children&&I.children.length&&I.children.forEach(N=>{w(N)})}function s(I){n.changeSelectedId(I)}function S(I){e.formSchemaUtils.removeCommunicationInComponent(I),I.children&&I.children.length&&I.children.forEach(h=>{e.formSchemaUtils.removeCommunicationInComponent(h)})}function R(){var N,T,B;if((N=e==null?void 0:e.designerContext)!=null&&N.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const I=b(),{parentIndex:h,itemIndex:w}=ct(t.schema.id,I);h===-1||w===-1||(u(t.schema),S(t.schema),I[h].children.splice(w,1),n.updateToolbarItems(),(T=t.setupContext)==null||T.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function k(){var N,T,B;if((N=e==null?void 0:e.designerContext)!=null&&N.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const I=t.schema.id,h=b(),w=h==null?void 0:h.findIndex(L=>L.id===I);w!==-1&&(u(h[w]),S(h[w]),h==null||h.splice(w,1),n.updateToolbarItems(),(T=t.setupContext)==null||T.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function F(I="Append"){var L;const h=b(),{parentIndex:w,itemIndex:N}=ct(t.schema.id,h);if(w===-1||N===-1)return;const T=a(),B=I==="Copy"?y():Object.assign({},T);h[w].children.splice(N+1,0,B),n.updateToolbarItems(),s(B.id),(L=t.setupContext)==null||L.emit("addComponent")}function M(I,h){const{index:w}=f(h);if(w===-1)return{index:w,schema:null};const N=a(),T=I==="Copy"?y():Object.assign({},N);return{index:w,schema:T}}function P(){var N;const I=t.schema.id,{index:h,schema:w}=M("Copy",I);w&&(b().splice(h+1,0,w),n.updateToolbarItems(),d(w.id),(N=t.setupContext)==null||N.emit("addComponent"))}function O(){var N;const I=t.schema.id,{index:h,schema:w}=M("Append",I);if(w&&t.parent){const B=b()[h].children||[];B.push(w);const L=b();L[h].children=B,n.updateToolbarItems(),s(w.id),(N=t.setupContext)==null||N.emit("addComponent")}}function E(I){let h;switch(t.schema.type){case"tab-toolbar-item":h=new In(I,e);break;default:h=new Pn(I,e,t.schema.type)}return h.getPropertyConfig(t.schema,g())}function p(I){I.stopPropagation(),I.stopImmediatePropagation()}function D(){const I=[{id:"delete",title:"删除",text:"",icon:"f-icon-yxs_delete",onClick:h=>{p(h),g()?R():k()}},{id:"copy",title:"复制",icon:"f-icon-yxs_copy",onClick:h=>{p(h);const{activeElement:w}=document,N=w?w.tagName.toLowerCase():"";N&&N==="input"||N==="textarea"?(w==null||w.blur(),c.nextTick(()=>{g()?F("Copy"):P()})):g()?F("Copy"):P()}}];return I.push(g()?{id:"appendSiblingButton",title:"",text:"新增同级",icon:"f-icon-plus-circle",onClick:h=>{p(h),F()}}:{id:"appendChildButton",title:"",text:"新增子级",icon:"f-icon-plus-circle",onClick:h=>{p(h),O()}}),I}function C(){const{schema:I}=t;u(I)}function v(){var I,h,w,N;if(t&&e){const{formSchemaUtils:T}=e,{schema:B}=t;switch(B.type){case"response-toolbar-item":{T.getControlBasicInfoMap().set(B.id,{componentTitle:B.text,parentPathName:B.text});break}case"tab-toolbar-item":case"section-toolbar-item":{let L;const q=(I=t.parent)==null?void 0:I.parent;(q==null?void 0:q.schema.type)==="tabs"||(q==null?void 0:q.schema.type)==="section"?L=(h=q.componentInstance)==null?void 0:h.value:L=(N=(w=q==null?void 0:q.parent)==null?void 0:w.componentInstance)==null?void 0:N.value,L!=null&&L.setComponentBasicInfoMap&&L.setComponentBasicInfoMap()}}}}return{canAccepts:o,checkCanMoveComponent:r,checkCanDeleteComponent:i,checkCanAddComponent:l,getPropsConfig:E,getCustomButtons:D,onRemoveComponent:C,setComponentBasicInfoMap:v}}const ut=c.defineComponent({name:"FResponseToolbarItemDesign",props:ot,emits:["Click","dropdown","clearAll"],setup(t,e){const n=c.ref(t.alignment),o=De(),r=c.ref(),i=c.inject("designer-host-service"),l=c.inject("design-item-context"),b=c.inject("toolbar-item-action"),d=Dn(l,i,b),m=_e.useDesignerInnerComponent(r,l,d);c.onMounted(()=>{r.value.componentInstance=m}),e.expose(m.value);function y(){const M={"f-icon":!0},P=t.icon?t.icon.trim():"";return re.getCustomClass(M,P)}function a(){return!!(t.icon&&t.icon.trim())}const f=c.computed(()=>{const M={btn:!0,"f-rt-btn":!0,"f-btn-ml":!t.isDP&&(n.value==="right"||n.value==="center"),"f-btn-mr":!t.isDP&&n.value==="left","btn-icontext":!!(t.icon&&t.icon.trim()),disabled:t.disabled===!0,"no-drag":!0,"text-truncate":!0};return re.getCustomClass(M,t.class)}),g=c.computed(()=>t.split?{display:"flex","align-items":"center"}:{display:"flex","align-items":"center","border-radius":"6px","padding-right":"0.1rem","border-top-right-radius":"6px","border-bottom-right-radius":"6px"}),u=c.computed(()=>{const M={btn:!0,"dropdown-toggle":!0,"f-btn-mr":n.value==="left","dropdown-toggle-split":!0,"no-drag":!0};return re.getCustomClass(M,t.class)}),s=c.computed(()=>{let M={btn:!t.isDPItem,disabled:t.disabled===!0,"dropdown-item":t.isDPItem,"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!t.isDPItem&&!!(t.icon&&t.icon.trim()),"dropdown-item-icontext":t.isDPItem&&!!(t.icon&&t.icon.trim()),"no-drag":!0};return t.isDPItem||(M=re.getCustomClass(M,t.class||"")),t.isDP&&(M=re.getCustomClass(M,t.dropdownClass||"")),M});function S(M,P){P&&P.stopPropagation(),e.emit(M,{id:t.id,isDP:t.isDP})}function R(){return{"btn-group":!0,"no-drag":!0,"f-rt-dropdown":!0,"f-btn-ml":n.value==="right"||n.value==="center","f-btn-mr":n.value==="left"}}function k(){return c.createVNode("div",{ref:r,"data-dragref":`${l.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[c.createVNode("div",{class:R(),id:t.id},[c.createVNode("div",{class:f.value,style:g.value,onClick:()=>S("clearAll")},[o.shouldShowIcon(t)&&c.createVNode("i",{class:o.iconClass(t)},null),c.createVNode("span",null,[t.text]),!t.split&&c.createVNode("span",{class:"f-icon f-icon-arrow-chevron-down",style:"margin:0 0.5rem 0 0.25rem;",onClick:M=>S("dropdown",M)},null)]),t.split&&c.createVNode("button",{class:u.value,style:"border-radius:0 6px 6px 0;",onClick:M=>S("dropdown",M)},null),b.renderDropdownMenu(t.item,t.item)])])}function F(){return c.createVNode("li",{ref:r,"data-dragref":`${l.schema.id}-container`,id:t.id,class:s.value},[o.shouldShowIcon(t)&&c.createVNode("i",{class:o.iconClass(t)},null),t.text])}return()=>t.isDP?k():t.isDPItem?F():c.createVNode("div",{ref:r,"data-dragref":`${l.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[c.createVNode("button",{type:"button",class:f.value,id:t.id,onClick:()=>S("clearAll")},[a()&&c.createVNode("i",{class:y()},null),t.text])])}});function kn(t,e,n,o){function r(f,g,u,s){o.changeSelectedId((g==null?void 0:g.id)||""),n&&n.setupContext&&n.setupContext.emit("selectionChange",f,g,u,s)}function i(){}function l(f){const g=f.expanded;o.clearAllDropdown(),o.toggleDropdownMenu(f,!g)}function b(f){o.clearAllDropdown(f.isDP?f.id:"")}function d(f,g=""){const u=t.items||[],s=g||f,S=u.find(R=>R.id===s);return g?S.children.find(R=>R.id===f):S}function m(f,g=!1){if(!g)return;const u=f.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.add("dgComponentSelected"))}function y(f,g=!1){if(!g)return;const u=f.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.remove("dgComponentSelected"))}function a(f,g,u=!1){const s=d(f.id,f.parent),S=c.ref(s);return c.createVNode(En,{key:s.id,class:["p-0",u?"d-block no-drag":"d-inline-block"],modelValue:S.value,"onUpdate:modelValue":R=>S.value=R,canMove:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:t.componentId,id:s.id,onSelectionChange:r,onRemoveComponent:i,onMouseenter:R=>m(R,u),onMouseleave:R=>y(R,u)},{default:()=>{var R;return[c.createVNode(ut,{id:s.id,disabled:s.disabled,text:s.text,icon:s.icon,isDP:f.isDP,item:f,split:s.split,isDPItem:f.isDPItem,class:((R=f.appearance)==null?void 0:R.class)||"btn-secondary",alignment:t.alignment||"right",onDropdown:()=>l(f),onClearAll:k=>b(k),componentId:t.componentId},null)]}})}return{renderToolbarItemDesigner:a,actionHandlers:o}}function Be(t,e=!1,n=""){const o=[];return t.reduce((r,i)=>{if(i.children&&i.children.length>0){const l=Be(i.children,!0,i.id);r.push(Object.assign({},i,{children:l,isDPItem:!1,isDP:!0,parent:"",expanded:!1}))}else r.push(Object.assign({},i,{isDPItem:e,isDP:!1,parent:n}));return r},o),o}const Nn=c.defineComponent({name:"FResponseToolbarDesign",props:rn,emits:["Click"],setup(t,e){const n=c.ref(Be(t.items)),o=c.ref(),r=c.ref(),i=c.ref(),l=c.ref("");let b=0;const d=15,m=c.inject("designer-host-service"),y=c.inject("design-item-context"),a={clearAllDropdown:W=>{},toggleDropdownMenu:W=>{},updateToolbarItems:()=>{},changeSelectedId:W=>{l.value=W},renderDropdownMenu:(W,_)=>{},toolbarContext:y,changeMenuPosition:(W,_,Q)=>({}),toolbarPosition:""},f=vn(y,m,a),g=_e.useDesignerComponent(i,y,f),u=c.inject("toolbar-item-handler"),{initDragula:s,dragulaInstance:S}=wn(y),R=De(),k=kn(t,r,y,a),F=xn(R,n,k),{renderToolbarItemDesigner:M}=k,{clearAllDropDownMenu:P,renderDropdownMenu:O,setResponseToolbarRef:E}=F;c.provide("toolbar-item-action",a),a.renderDropdownMenu=O,E(i),u&&(u.changeSelectedId=function(W){l.value=W});function p(){const W=r.value.querySelector(".dgComponentSelected");W&&it(W)}function D(){if(l.value)if(Ne(l.value,n.value)){const{parent:W,item:_}=dt(l.value,n.value);W&&(a.toggleDropdownMenu(W,!0),setTimeout(()=>{var Z;const Q=i.value.querySelector("#"+W.id),X=Q==null?void 0:Q.querySelector("#"+_.id);(((Z=X==null?void 0:X.parentElement)==null?void 0:Z.className)||"").indexOf("dgComponentFocused")<0&&(X==null||X.click())},0))}else p()}function C(W=""){n.value.filter(_=>_.id!==W&&_.children&&_.children.length>0).forEach(_=>{_.expanded=!1}),P(W)}a.clearAllDropdown=C;function v(){u&&u.updateToolbarItems&&u.updateToolbarItems()}a.updateToolbarItems=v;function I(W){if(W){const _=i.value.querySelector("#"+W.id),Q=_.querySelector("#"+W.id+"_menu"),X=a.changeMenuPosition(W,_);Object.keys(X).forEach(Z=>{Q.style[Z]=X[Z]})}}function h(){const Q=r.value.clientWidth,X=r.value.querySelectorAll(".farris-component>.f-rt-btn");X&&X.forEach(z=>{z.style.maxWidth=Q-12+"px"});const Z=r.value.querySelectorAll(".farris-component>.f-rt-dropdown");Z&&Z.forEach(z=>{z.querySelector(".dropdown-toggle-split")?z.querySelector(".f-rt-btn").style.maxWidth=Q-38+"px":z.style.maxWidth=Q-12+"px"})}const w=new ResizeObserver(W=>{var _;if(W.length){const X=W[0].contentRect.width;if(X===0){b=0;return}if(Math.abs(X-b)>d){if(b=X,Ne(l.value,n.value)){const{parent:Z,item:z}=dt(l.value,n.value);I(Z)}else if(Mn(l.value,n.value)){const Z=(_=n.value)==null?void 0:_.find(z=>z.id===l.value);I(Z)}else C();h()}}});c.onMounted(()=>{w.observe(i.value),b=i.value.clientWidth,i.value.componentInstance=g,s(r.value,o.value,v)}),c.onUnmounted(()=>{w.disconnect(),S&&S.destroy&&S.destroy()}),e.expose(g.value);const N=c.computed(()=>{const W={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":t.buttonSize==="sm","f-response-toolbar-lg":t.buttonSize==="lg"};return re.getCustomClass(W,t.customClass)}),T=c.computed(()=>({"text-left":t.alignment==="left","text-right":t.alignment==="right","justify-content-end":t.alignment==="right","justify-content-start":t.alignment==="left","justify-content-center":t.alignment==="center","no-drag":!0,"w-100":!0}));c.watch(()=>t.items,()=>{n.value=Be(t.items),c.nextTick(()=>{D(),h()})},{deep:!0});function B(W){W&&(W.stopPropagation(),W.preventDefault());const{schema:_}=y;_.buttons||(_.buttons=[]);const Q=Ye("response-toolbar-item");Q.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,Q.appearance={class:"btn btn-secondary"},_.buttons.push(Q)}function L(){return c.createVNode("li",{style:"border-width: 1px;border-style: dashed;display: inline-block;padding: 0 8px;line-height: 24px; border-radius: 3px; cursor: default;color: #B4BCCC;",onClick:B},[c.createVNode("span",{class:"f-icon f-icon-amplification mr-1",style:"font-size: 12px;"},null),c.createVNode("span",{class:"farris-tag-add-text"},[c.createTextVNode("添加按钮")])])}function q(){return n.value.map((W,_)=>M(W,_))}return()=>{var W;return c.createVNode("div",{ref:i,"data-dragref":`${y.schema.id}-container`,class:N.value,id:t.id},[c.createVNode("div",{ref:o,class:T.value,onClick:_=>C(_)},[c.createVNode("div",{ref:r,class:"d-block f-response-content"},[(W=n.value)!=null&&W.length?q():L()])])])}}}),Bn=Me;xe.register=(t,e,n,o)=>{t["response-toolbar"]=xe,e["response-toolbar"]=Me,o["response-toolbar"]={eventHandlerResolver:ln}},xe.registerDesigner=(t,e,n)=>{t["response-toolbar"]=Nn,e["response-toolbar"]=Me,t["response-toolbar-item"]=ut,e["response-toolbar-item"]=sn};const Rn=re.withInstall(xe);te.FResponseToolbar=xe,te.ResponseToolbarDropDownItem=we,te.ResponseToolbarGroup=St,te.ResponseToolbarItem=qe,te.default=Rn,te.responseToolbarResolver=Bn,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -5334,7 +5334,7 @@ function ur(e, t, n, o) {
|
|
|
5334
5334
|
}, [s.value])]);
|
|
5335
5335
|
}
|
|
5336
5336
|
function dr(e, t, n, o, a) {
|
|
5337
|
-
const i = h(e.type), l = h(e.buttons), s = h(e.exceptionInfo), c = h(a.ok || e.okButtonText), r = h(a.cancel || e.cancelButtonText), u = h(e.showCancelButton), f = h(e.showOkButton), v = R(() => !!(l.value && l.value.length)), p = R(() => s.value && s.value.
|
|
5337
|
+
const i = h(e.type), l = h(e.buttons), s = h(e.exceptionInfo), c = h(a.ok || e.okButtonText), r = h(a.cancel || e.cancelButtonText), u = h(e.showCancelButton), f = h(e.showOkButton), v = R(() => !!(l.value && l.value.length)), p = R(() => !!(s.value && s.value.detail)), m = R(() => !(l.value && l.value.length) && (f.value || u.value)), g = ur(e, n, o, a);
|
|
5338
5338
|
c.value === "关闭" ? c.value = a.close : c.value === "知道了" && (c.value = a.exception.roger);
|
|
5339
5339
|
function b(C) {
|
|
5340
5340
|
i.value === "question" && t.emit("reject"), t.emit("close");
|
|
@@ -6937,7 +6937,8 @@ class Rr extends Bt {
|
|
|
6937
6937
|
editor: {
|
|
6938
6938
|
nullable: !0,
|
|
6939
6939
|
min: 0,
|
|
6940
|
-
decimals: 0
|
|
6940
|
+
decimals: 0,
|
|
6941
|
+
needValid: !0
|
|
6941
6942
|
}
|
|
6942
6943
|
}
|
|
6943
6944
|
}
|
|
@@ -6989,7 +6990,8 @@ class jr extends Bt {
|
|
|
6989
6990
|
min: 0,
|
|
6990
6991
|
decimals: 0,
|
|
6991
6992
|
max: 100,
|
|
6992
|
-
nullable: !0
|
|
6993
|
+
nullable: !0,
|
|
6994
|
+
needValid: !0
|
|
6993
6995
|
}
|
|
6994
6996
|
},
|
|
6995
6997
|
autoTitleWidth: {
|
|
@@ -12490,7 +12492,7 @@ function qu(e, t, n, o) {
|
|
|
12490
12492
|
if (!!t.slots.default) {
|
|
12491
12493
|
if (!p && !i.value && !await l())
|
|
12492
12494
|
return;
|
|
12493
|
-
i.value = !i.value, await ge(), c();
|
|
12495
|
+
i.value = !i.value, i.value && (await ge(), c());
|
|
12494
12496
|
}
|
|
12495
12497
|
}
|
|
12496
12498
|
async function u(p = !1) {
|