@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.
Files changed (108) hide show
  1. package/components/avatar/index.esm.js +1 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/button-edit/index.esm.js +2 -2
  4. package/components/button-edit/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +7 -5
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/common/index.esm.js +1 -1
  8. package/components/common/index.umd.cjs +1 -1
  9. package/components/component/index.esm.js +1 -1
  10. package/components/component/index.umd.cjs +1 -1
  11. package/components/condition/index.esm.js +3 -2
  12. package/components/condition/index.umd.cjs +1 -1
  13. package/components/content-container/index.esm.js +1 -1
  14. package/components/content-container/index.umd.cjs +1 -1
  15. package/components/data-view/index.esm.js +498 -495
  16. package/components/data-view/index.umd.cjs +1 -1
  17. package/components/date-picker/index.esm.js +833 -832
  18. package/components/date-picker/index.umd.cjs +1 -1
  19. package/components/designer-canvas/index.esm.js +1 -1
  20. package/components/designer-canvas/index.umd.cjs +1 -1
  21. package/components/dynamic-form/index.esm.js +3 -2
  22. package/components/dynamic-form/index.umd.cjs +1 -1
  23. package/components/events-editor/index.esm.js +1 -1
  24. package/components/events-editor/index.umd.cjs +1 -1
  25. package/components/expression-editor/index.esm.js +256 -254
  26. package/components/expression-editor/index.umd.cjs +2 -2
  27. package/components/filter-bar/index.esm.js +416 -394
  28. package/components/filter-bar/index.umd.cjs +1 -1
  29. package/components/filter-condition-editor/index.esm.js +388 -386
  30. package/components/filter-condition-editor/index.umd.cjs +1 -1
  31. package/components/flow-canvas/index.esm.js +1 -1
  32. package/components/flow-canvas/index.umd.cjs +1 -1
  33. package/components/language-textbox/index.esm.js +77 -76
  34. package/components/language-textbox/index.umd.cjs +1 -1
  35. package/components/list-nav/index.esm.js +4 -2
  36. package/components/list-nav/index.umd.cjs +1 -1
  37. package/components/lookup/index.esm.js +118 -118
  38. package/components/lookup/index.umd.cjs +1 -1
  39. package/components/mapping-editor/index.esm.js +80 -81
  40. package/components/mapping-editor/index.umd.cjs +1 -1
  41. package/components/message-box/index.esm.js +237 -237
  42. package/components/message-box/index.umd.cjs +1 -1
  43. package/components/modal/index.esm.js +1 -1
  44. package/components/modal/index.umd.cjs +1 -1
  45. package/components/number-range/index.esm.js +1 -1
  46. package/components/number-range/index.umd.cjs +1 -1
  47. package/components/number-spinner/index.esm.js +9 -3
  48. package/components/number-spinner/index.umd.cjs +1 -1
  49. package/components/order/index.esm.js +114 -112
  50. package/components/order/index.umd.cjs +1 -1
  51. package/components/page-header/index.esm.js +1 -1
  52. package/components/page-header/index.umd.cjs +1 -1
  53. package/components/property-panel/index.esm.js +1 -1
  54. package/components/property-panel/index.umd.cjs +1 -1
  55. package/components/query-solution/index.esm.js +485 -463
  56. package/components/query-solution/index.umd.cjs +3 -3
  57. package/components/radio-group/index.esm.js +30 -30
  58. package/components/radio-group/index.umd.cjs +1 -1
  59. package/components/response-layout/index.esm.js +1 -1
  60. package/components/response-layout/index.umd.cjs +1 -1
  61. package/components/response-layout-editor/index.esm.js +544 -545
  62. package/components/response-layout-editor/index.umd.cjs +1 -1
  63. package/components/response-toolbar/index.esm.js +1 -1
  64. package/components/response-toolbar/index.umd.cjs +1 -1
  65. package/components/schema-selector/index.esm.js +6 -4
  66. package/components/schema-selector/index.umd.cjs +2 -2
  67. package/components/section/index.esm.js +1 -1
  68. package/components/section/index.umd.cjs +1 -1
  69. package/components/sort-condition-editor/index.esm.js +9 -7
  70. package/components/sort-condition-editor/index.umd.cjs +1 -1
  71. package/components/switch/index.esm.js +77 -78
  72. package/components/switch/index.umd.cjs +1 -1
  73. package/components/tabs/index.esm.js +5 -3
  74. package/components/tabs/index.umd.cjs +1 -1
  75. package/components/textarea/index.esm.js +1 -1
  76. package/components/textarea/index.umd.cjs +1 -1
  77. package/components/time-picker/index.esm.js +2 -2
  78. package/components/time-picker/index.umd.cjs +1 -1
  79. package/components/video/index.esm.js +1 -1
  80. package/components/video/index.umd.cjs +1 -1
  81. package/designer/button-edit/index.esm.js +211 -211
  82. package/designer/button-edit/index.umd.cjs +1 -1
  83. package/designer/checkbox/index.esm.js +1 -1
  84. package/designer/checkbox/index.umd.cjs +1 -1
  85. package/designer/checkbox-group/index.esm.js +25 -26
  86. package/designer/checkbox-group/index.umd.cjs +1 -1
  87. package/designer/data-grid/index.esm.js +15 -9
  88. package/designer/data-grid/index.umd.cjs +2 -2
  89. package/designer/farris-designer.all.esm.js +917 -916
  90. package/designer/farris-designer.all.umd.cjs +5 -5
  91. package/designer/input-group/index.esm.js +2 -1
  92. package/designer/input-group/index.umd.cjs +1 -1
  93. package/designer/list-view/index.esm.js +685 -689
  94. package/designer/list-view/index.umd.cjs +3 -3
  95. package/designer/radio-group/index.esm.js +7 -3
  96. package/designer/radio-group/index.umd.cjs +1 -1
  97. package/farris.all.esm.js +5641 -5603
  98. package/farris.all.umd.cjs +21 -21
  99. package/locales/data-grid/ui/en.json +2 -1
  100. package/locales/data-grid/ui/zh-CHS.json +2 -1
  101. package/locales/data-grid/ui/zh-CHT.json +2 -1
  102. package/locales/designer/en.json +2 -1
  103. package/locales/designer/zh-CHS.json +2 -1
  104. package/locales/designer/zh-CHT.json +2 -1
  105. package/locales/ui/en.json +2 -1
  106. package/locales/ui/zh-CHS.json +2 -1
  107. package/locales/ui/zh-CHT.json +2 -1
  108. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(ne,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","../common/index.umd.js","../dynamic-resolver/index.umd.js","vue-i18n","../designer-canvas/index.umd.js"],i):(ne=typeof globalThis<"u"?globalThis:ne||self,i(ne["page-header"]={},ne.Vue,ne.LodashES,ne.FResponseToolbar$1,ne.common,ne.dynamicResolver,ne.vueI18n,ne.designerCanvas))})(this,function(ne,i,de,Ot,ee,We,At,He){"use strict";var fo=Object.defineProperty;var po=(ne,i,de)=>i in ne?fo(ne,i,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[i]=de;var G=(ne,i,de)=>po(ne,typeof i!="symbol"?i+"":i,de);function ze(t,e){let n;function o(d){const{properties:p,title:b,ignore:u}=d,l=u&&Array.isArray(u),P=Object.keys(p).reduce((I,M)=>((!l||!u.find(O=>O===M))&&(I[M]=p[M].type==="object"&&p[M].properties?o(p[M]):de.cloneDeep(p[M].default)),I),{});if(b&&(!l||!u.find(I=>I==="id"))){const I=b.toLowerCase().replace(/-/g,"_");P.id=`${I}_${Math.random().toString().slice(2,6)}`}return P}function r(d){const{properties:p,title:b,required:u}=d;if(u&&Array.isArray(u)){const l=u.reduce((P,I)=>(P[I]=p[I].type==="object"&&p[I].properties?o(p[I]):de.cloneDeep(p[I].default),P),{});if(b&&u.find(P=>P==="id")){const P=b.toLowerCase().replace(/-/g,"_");l.id=`${P}_${Math.random().toString().slice(2,6)}`}return l}return{type:b}}function s(d,p={},b){const u=t[d];if(u){let l=r(u);const P=e[d];return l=P?P({getSchemaByType:s},l,p,b):l,n!=null&&n.appendIdentifyForNewControl&&n.appendIdentifyForNewControl(l),l}return null}function a(d,p){const b=o(p);return Object.keys(b).reduce((u,l)=>(Object.prototype.hasOwnProperty.call(d,l)&&(u[l]&&de.isPlainObject(u[l])&&de.isPlainObject(d[l]||!d[l])?Object.assign(u[l],d[l]||{}):u[l]=d[l]),u),b),b}function m(d,p){return Object.keys(d).filter(u=>d[u]!=null).reduce((u,l)=>{if(p.has(l)){const P=p.get(l);if(typeof P=="string")u[P]=d[l];else{const I=P(l,d[l],d);Object.assign(u,I)}}else u[l]=d[l];return u},{})}function c(d,p,b=new Map){const u=a(d,p);return m(u,b)}function h(d){var b;const p=d.type;if(p){const u=t[p];if(!u)return d;const l=a(d,u),P=((b=d.editor)==null?void 0:b.type)||"";if(P){const I=t[P],M=a(d.editor,I);l.editor=M}return l}return d}function w(d){n=d}return{getSchemaByType:s,resolveSchemaWithDefaultValue:h,resolveSchemaToProps:c,mappingSchemaToProps:m,setDesignerContext:w}}const Ge={},Ye={},{getSchemaByType:Xe,resolveSchemaWithDefaultValue:$t,resolveSchemaToProps:Rt,mappingSchemaToProps:jt,setDesignerContext:go}=ze(Ge,Ye);function _t(t={}){function e(h,w,d,p){if(typeof d=="number")return p[h].length===d;if(typeof d=="object"){const b=Object.keys(d)[0],u=d[b];if(b==="not")return Number(p[h].length)!==Number(u);if(b==="moreThan")return Number(p[h].length)>=Number(u);if(b==="lessThan")return Number(p[h].length)<=Number(u)}return!1}function n(h,w,d,p){return p[h]&&p[h].propertyValue&&String(p[h].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((h,w)=>(h.set(w,t[w]),h),o);function r(h,w){const d=h;return typeof w=="number"?[{target:d,operator:"length",param:null,value:Number(w)}]:typeof w=="boolean"?[{target:d,operator:"getProperty",param:h,value:!!w}]:typeof w=="object"?Object.keys(w).map(p=>{if(p==="length")return{target:d,operator:"length",param:null,value:w[p]};const b=p,u=w[p];return{target:d,operator:"getProperty",param:b,value:u}}):[]}function s(h){return Object.keys(h).reduce((d,p)=>{const b=r(p,h[p]);return d.push(...b),d},[])}function a(h,w){if(o.has(h.operator)){const d=o.get(h.operator);return d&&d(h.target,h.param,h.value,w)||!1}return!1}function m(h,w){return s(h).reduce((b,u)=>b&&a(u,w),!0)}function c(h,w){const d=Object.keys(h),p=d.includes("allOf"),b=d.includes("anyOf"),u=p||b,I=(u?h[u?p?"allOf":"anyOf":"allOf"]:[h]).map(O=>m(O,w));return p?!I.includes(!1):I.includes(!0)}return{parseValueSchema:c}}const Lt={convertTo:(t,e,n,o)=>{t.appearance||(t.appearance={}),t.appearance[e]=n},convertFrom:(t,e,n)=>t.appearance?t.appearance[e]:t[e]},qt={convertFrom:(t,e,n)=>t.buttons&&t.buttons.length?`共 ${t.buttons.length} 项`:"无"},Ut={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]},we={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:"多语输入框"}},Wt={convertFrom:(t,e,n)=>{var r;const o=t.editor&&t.editor[e]?t.editor[e]:t[e];return((r=we[o])==null?void 0:r.name)||o}},Ht={convertTo:(t,e,n,o)=>{t[e]=t[e]},convertFrom:(t,e,n)=>t.editor?n.getRealEditorType(t.editor.type):""},zt={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"}},Gt={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:""},Yt={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""}},Xt={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:""},Qt={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}}},Zt={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}}},Jt={convertTo:(t,e,n,o)=>{t.pagination||(t.pagination={}),t.pagination[e]=n},convertFrom:(t,e,n)=>t.pagination?t.pagination[e]:t[e]},Kt={convertTo:(t,e,n,o)=>{t.rowNumber||(t.rowNumber={}),t.rowNumber[e]=n},convertFrom:(t,e,n)=>t.rowNumber?t.rowNumber[e]:t[e]},en={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]}},tn={convertFrom:(t,e,n)=>t[e]&&t[e].length?`共 ${t[e].length} 项`:""},nn={convertFrom:(t,e)=>t[e]||"",convertTo:(t,e,n)=>{t[e]=n}},on={convertTo:(t,e,n,o)=>{t.size||(t.size={}),t.size[e]=n},convertFrom:(t,e,n)=>t.size?t.size[e]:t[e]},rn={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}},sn={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)}},an={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"}},ln={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 Qe(t,e,n){const o=new Map([["/converter/appearance.converter",Lt],["/converter/buttons.converter",qt],["/converter/property-editor.converter",Ut],["/converter/items-count.converter",tn],["/converter/type.converter",Wt],["/converter/change-editor.converter",Ht],["/converter/change-formatter.converter",zt],["/converter/column-command.converter",Gt],["/converter/column-option.converter",Yt],["/converter/summary.converter",Xt],["/converter/group.converter",Qt],["/converter/form-group-label.converter",nn],["/converter/field-selector.converter",Zt],["/converter/pagination.converter",Jt],["/converter/row-number.converter",Kt],["/converter/grid-selection.converter",en],["/converter/size.converter",on],["/converter/change-formatter-enum.converter",rn],["/converter/grid-sort.converter",sn],["/converter/grid-filter.converter",an],["/converter/row-option.converter",ln]]),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}]]),s=_t();function a(u,l){return()=>s.parseValueSchema(u,l)}function m(u,l,P){return u.includes("visible")&&l.visible!==void 0?typeof l.visible=="boolean"?()=>!!l.visible:l.visible===void 0?!0:a(l.visible,P):()=>!0}function c(u,l,P){return u.includes("readonly")&&l.readonly!==void 0?typeof l.readonly=="boolean"?()=>!!l.readonly:a(l.readonly,P):()=>!1}function h(u,l){const P=u.$converter||l;return typeof P=="string"&&P&&o.has(P)?o.get(P)||null:P||null}function w(u,l,P,I,M,O="",N=""){return Object.keys(u).map(F=>{const E=i.ref(1),g=F,V=u[F],S=Object.keys(V),C=V.title,v=V.type,f=r.get(v)||{type:"input-group",enableClear:!1},y=V.editor?Object.assign({},f,V.editor):Object.assign({},f),k=m(S,V,l),x=c(S,V,l);y.readonly=y.readonly===void 0?x():y.readonly;const B=V.type==="cascade"?w(V.properties,l,P,I,M,O,N):[],j=!0;let _=h(V,N);const L=i.computed({get(){if(E.value){if(["class","style"].find(A=>A===g)&&!_&&(_=o.get("/converter/appearance.converter")||null),_&&_.convertFrom)return _.convertFrom(P,F,M,O);const te=P[F];return Object.prototype.hasOwnProperty.call(V,"defaultValue")&&(te===void 0||typeof te=="string"&&te==="")?V.type==="boolean"?V.defaultValue:V.defaultValue||"":te}return null},set(te){E.value+=1,_&&_.convertTo?(_.convertTo(I,F,te,M,O),_.convertTo(P,F,te,M,O)):(I[F]=te,P[F]=te)}}),{refreshPanelAfterChanged:q,description:Q,isExpand:Y,parentPropertyID:Z}=V,H={propertyID:g,propertyName:C,propertyType:v,propertyValue:L,editor:y,visible:k,readonly:x,cascadeConfig:B,hideCascadeTitle:j,refreshPanelAfterChanged:q,description:Q,isExpand:Y,parentPropertyID:Z};return l[g]=H,H})}function d(u,l,P={}){const I={},M=t[u];return M&&M.categories?Object.keys(M.categories).map(N=>{const T=M.categories[N],F=T==null?void 0:T.title,E=w(T.properties||{},I,{},P,l);return{categoryId:N,categoryName:F,properties:E}}):[]}function p(u,l,P,I,M=""){const O=l.$ref.schema,N=l.$ref.converter,T=P[O],F=T.type,E=n(T),g={},V=t[F];if(V&&V.categories){const S=V.categories[u],C=S==null?void 0:S.title;N&&Object.keys(S.properties).forEach(y=>{S.properties[y].$converter=N});const v=(S==null?void 0:S.properties)||{},f=w(v,g,E,T,I,M);return{categoryId:u,categoryName:C,properties:f}}return{categoryId:u,categoryName:"",properties:[]}}function b(u,l,P,I,M){const O=u.type,N=n(u),T={};let F=M||t[O];if(F&&Object.keys(F).length===0&&P&&P.getPropConfig&&(F=P.getPropConfig(I)),F&&F.categories){const E=[];return Object.keys(F.categories).map(g=>{const V=F.categories[g];if(V.$ref){E.push(p(g,V,u,l,I));return}const S=V==null?void 0:V.title,C=V==null?void 0:V.tabId,v=V==null?void 0:V.tabName,f=V==null?void 0:V.hide,y=V==null?void 0:V.hideTitle,k=w(V.properties||{},T,N,u,l,I,V.$converter),{setPropertyRelates:x}=V,B=V==null?void 0:V.parentPropertyID;E.push({categoryId:g,categoryName:S,tabId:C,tabName:v,hide:f,properties:k,hideTitle:y,setPropertyRelates:x,parentPropertyID:B})}),E}return[]}return{getPropertyConfigBySchema:b,getPropertyConfigByType:d,propertyConverterMap:o}}const Ze={},Je={};Qe(Ze,Je,$t);const Ke={},et={},{getSchemaByType:cn,resolveSchemaWithDefaultValue:dn,resolveSchemaToProps:mo,mappingSchemaToProps:ho,setDesignerContext:bo}=ze(Ke,et),tt={},nt={};Qe(tt,nt,dn);function Se(t,e,n=new Map,o=(a,m,c,h)=>m,r={},s=a=>a){return Ge[e.title]=e,Ye[e.title]=o,Ze[e.title]=r,Je[e.title]=s,Ke[e.title]=e,et[e.title]=o,tt[e.title]=r,nt[e.title]=s,(a={},m=!0)=>{if(!m)return jt(a,n);const c=Rt(a,e,n),h=Object.keys(t).reduce((w,d)=>(w[d]=t[d].default,w),{});return Object.assign(h,c)}}function ot(t,e){return{customClass:e.class,customStyle:e.style}}function un(t,e){var o,r;const n={};if(e!=null&&e.buttons){const s=[];(o=e==null?void 0:e.buttons)==null||o.map(a=>{const m={};Object.keys(a).map(c=>{var h;c==="appearance"?m.class=((h=a[c])==null?void 0:h.class)||"":m[c]=a[c]}),s.push(m)}),n.buttons=s}return(r=e==null?void 0:e.appearance)!=null&&r.class&&(n.buttonClass=e.appearance.class||"col-6"),e!=null&&e.id&&(n.toolbarId=e.id),e&&Object.prototype.hasOwnProperty.call(e,"visible")&&(n.buttonsVisible=e.visible),n}function rt(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 fn(){function t(e,n){var m;const o=(m=e.toolbar)==null?void 0:m.buttons;if(!o||o.length<1)return null;const[r,s]=n.payloads,a=rt(o,s);return a?a.onClick||a.click:null}return{resolve:t}}function pn(){function t(e,n){const o=e.buttons;if(!o||o.length<1)return null;const[r,s]=n.payloads,a=rt(o,s);return a?a.onClick||a.click:null}return{resolve:t}}const it=new Map([["appearance",ot],["toolbar",un]]),st={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/page-header.schema.json",title:"page-header",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Page Header",type:"string"},type:{description:"The type string of Page Header component",type:"string",default:"page-header"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},showIcon:{description:"",type:"boolean",default:!0},icon:{description:"",type:"string",default:"f-icon-page-title-record"},iconClass:{description:"",type:"string",default:"f-text-orna-bill"},title:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},toolbar:{description:"",type:"object",properties:{appearance:{description:"",type:"object",properties:{class:{type:"string",default:"col-6"}}},id:{description:"",type:"string"},type:{description:"",type:"string",default:"response-toolbar"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0}}},titleContentClass:{description:"",type:"string",default:""},contentClass:{description:"",type:"string",default:""},downContentClass:{description:"",type:"string",default:""},showPagination:{description:"",type:"boolean",default:!1},prePaginationDisabled:{description:"",type:"boolean",default:!0},nextPaginationDisabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},titleContentHtml:{description:"",type:"string",default:""},titleRenderFunction:{description:"",type:"function",default:null},contentHtml:{description:"",type:"string",default:""},contentRenderFunction:{description:"",type:"function",default:null},downContentHtml:{description:"",type:"string",default:""},downContentRenderFunction:{description:"",type:"function",default:null}},required:["id","type"]};function at(t,e,n){return e.title="标题",e}const Pe={customClass:{type:String,default:""},showIcon:{type:Boolean,default:!0},icon:{type:String,default:"f-icon-page-title-record"},iconClass:{type:String,default:"f-text-orna-bill"},title:{type:String,default:""},subTitle:{type:String,default:""},buttonClass:{type:String,default:"col-6"},toolbarId:{type:String,default:""},buttons:{type:Array,default:[]},titleContentClass:{type:String,default:""},contentClass:{type:String,default:""},downContentClass:{type:String,default:""},showPagination:{type:Boolean,default:!1},prePaginationDisabled:{type:Boolean,default:!0},nextPaginationDisabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},buttonsVisible:{type:Boolean,default:!0},titleRenderFunction:{type:Function},contentRenderFunction:{type:Function},downContentRenderFunction:{type:Function}},Ve=Object.assign({},Pe,{componentId:{type:String,default:""},titleContentHtml:{type:String,default:""},contentHtml:{type:String,default:""},downContentHtml:{type:String,default:""}}),lt=Se(Pe,st,it,at),ct=Se(Ve,st,it,at),dt=fn(),Ee=i.defineComponent({name:"FPageHeader",props:Pe,emits:["click","prePaginationClick","nextPaginationClick"],setup(t,e){const n=i.ref(t.buttons),o=(M,O)=>{e.emit("click",M,O)},r=i.computed(()=>{const M={"f-page-header":!0,"d-none":!t.visible};return ee.getCustomClass(M,t.customClass)}),s=i.computed(()=>{const M={"f-title-icon":!0};return ee.getCustomClass(M,t.iconClass)}),a=i.computed(()=>{const M={"f-icon":!0};return ee.getCustomClass(M,t.icon)}),m=i.computed(()=>{const M={"f-title":!0};return ee.getCustomClass(M,t.titleContentClass)}),c=i.computed(()=>{const M={"f-content":!0};return ee.getCustomClass(M,t.contentClass)}),h=i.computed(()=>{const M={"f-page-header-extend":!0};return ee.getCustomClass(M,t.downContentClass)}),w=i.computed(()=>({"f-icon f-icon-arrow-w":!0,"f-state-disabled":t.prePaginationDisabled})),d=i.computed(()=>({"f-icon f-icon-arrow-e":!0,"f-state-disabled":t.nextPaginationDisabled}));function p(M){t.prePaginationDisabled||e.emit("prePaginationClick",M)}function b(M){t.nextPaginationDisabled||e.emit("nextPaginationClick",M)}function u(){return e.slots.titleContent?i.createVNode("div",{class:m.value},[i.createTextVNode(" "),e.slots.titleContent()]):t.titleRenderFunction?i.createVNode("div",{class:m.value},[t.titleRenderFunction()]):i.createVNode("div",{class:"f-title"},[t.showIcon&&t.icon?i.createVNode("span",{class:s.value},[i.createVNode("i",{class:a.value},null)]):"",i.createVNode("h4",{class:"f-title-text"},[t.title]),t.subTitle?i.createVNode("h5",{class:"f-title-subtitle"},[t.subTitle]):"",t.showPagination?i.createVNode("div",{class:"f-title-pagination"},[i.createVNode("span",{class:w.value,onClick:p},null),i.createVNode("span",{class:d.value,onClick:b},null)]):""])}function l(){return e.slots.content?i.createVNode("div",{class:c.value},[i.createTextVNode(" "),e.slots.content()]):t.contentRenderFunction?i.createVNode("div",{class:c.value},[t.contentRenderFunction()]):null}function P(){if(t.buttons&&t.buttons.length>0)return i.createVNode(Ot,{id:t.toolbarId,customClass:t.buttonClass,visible:t.buttonsVisible,items:n.value,onClick:o},null)}function I(){return e.slots.downContent?i.createVNode("div",{class:h.value},[i.createTextVNode(" "),e.slots.downContent()]):t.downContentRenderFunction?i.createVNode("div",{class:h.value},[t.downContentRenderFunction()]):null}return i.watch(()=>t.buttons,M=>{n.value=M},{deep:!0}),()=>t.visible?i.createVNode("div",{class:r.value},[i.createVNode("nav",{class:"f-page-header-base"},[u(),l(),P()]),I()]):null}});function gn(t,e,n){var C;const o=n&&n.getStyles&&n.getStyles()||"",r=n&&n.getDesignerClass&&n.getDesignerClass()||"",s=i.ref();let a;function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function c(){return!1}function h(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function w(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function d(v){if(!v||!v.value)return null;if(v.value.schema&&v.value.schema.type==="component")return v.value;const f=i.ref(v==null?void 0:v.value.parent),y=d(f);return y||null}function p(v=e){var x;if(n!=null&&n.getDraggableDesignItemElement)return n.getDraggableDesignItemElement(v);const{componentInstance:f,designerItemElementRef:y}=v;if(!f||!f.value)return null;const{getCustomButtons:k}=f.value;return f.value.canMove||k&&((x=k())!=null&&x.length)?y:p(v.parent)}function b(v){return!!n&&n.canAccepts(v)}function u(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function l(){}function P(v,f){var y;!v||!f||(n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(v,f),(y=e==null?void 0:e.setupContext)==null||y.emit("dragEnd"))}function I(v,f){const{componentType:y}=v;let k=We.getSchemaByTypeForDesigner(y,v,f);n&&n.onResolveNewComponentSchema&&(k=n.onResolveNewComponentSchema(v,k));const x=y.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===y&&(k.id=`${x}_${Math.random().toString().slice(2,6)}`),k}function M(v){v&&n!=null&&n.onChildElementMovedOut&&n.onChildElementMovedOut(v)}function O(...v){if(n&&n.getPropsConfig)return n.getPropsConfig(...v)}function N(v){if(!v)return;const f=e==null?void 0:e.schema,{formSchemaUtils:y}=v;if(f&&y.getExpressions().length){const k=y.getExpressions().findIndex(x=>x.target===f.id);k>-1&&y.getExpressions().splice(k,1)}}function T(v){if(!v||!(e!=null&&e.schema))return;const f=e.schema,{formSchemaUtils:y}=v;y.removeCommunicationInComponent(f)}function F(v){n&&n.onRemoveComponent&&n.onRemoveComponent(),N(v),T(v),e!=null&&e.schema.contents&&e.schema.contents.map(f=>{let y=f.id;f.type==="component-ref"&&(y=f.component);const k=t.value.querySelectorAll(`#${y}-design-item`);k!=null&&k.length&&Array.from(k).map(x=>{var B;(B=x==null?void 0:x.componentInstance)!=null&&B.value.onRemoveComponent&&x.componentInstance.value.onRemoveComponent(v)})})}function E(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function g(v){var y,k;if(!((y=e==null?void 0:e.schema)!=null&&y.id))return;if(!a&&v&&(a=v.formSchemaUtils),n!=null&&n.setComponentBasicInfoMap){n.setComponentBasicInfoMap();return}let f="";if(n!=null&&n.getComponentTitle)f=n.getComponentTitle();else{const{text:x,title:B,label:j,mainTitle:_,name:L,type:q}=e.schema;f=x||B||j||_||L||((k=we[q])==null?void 0:k.name)}f&&a.getControlBasicInfoMap().set(e.schema.id,{componentTitle:f,parentPathName:f})}function V(v){var x;const{changeObject:f}=v,{propertyID:y,propertyValue:k}=f;if(["text","title","label","name","mainTitle"].includes((x=v==null?void 0:v.changeObject)==null?void 0:x.propertyID)&&y&&k&&(g(),a)){const B=a.getControlBasicInfoMap(),j=B.keys().toArray().filter(_=>{var L,q;return((L=B.get(_))==null?void 0:L.reliedComponentId)===((q=e==null?void 0:e.schema)==null?void 0:q.id)});j!=null&&j.length&&j.forEach(_=>{const L=B.get(_).parentPathName.split(" > ");L[0]=k,B.get(_).parentPathName=L.join(" > ")})}}function S(v){if(V(v),n&&n.onPropertyChanged)return n.onPropertyChanged(v)}return s.value={canMove:m(),canSelectParent:c(),canDelete:h(),canNested:!w(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:b,getBelongedComponentInstance:d,getDraggableDesignItemElement:p,getDraggingDisplayText:u,getPropConfig:O,getDragScopeElement:l,onAcceptMovedChildElement:P,onChildElementMovedOut:M,addNewChildComponentSchema:I,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||i.ref(!1),onRemoveComponent:F,getCustomButtons:E,onPropertyChanged:S,setComponentBasicInfoMap:g,updateContextSchema:e==null?void 0:e.updateContextSchema},s}const mn=i.ref(0);function hn(){mn.value++}const Ce=i.ref(0);function bn(t,e){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top>=n.top,s=o.top<=n.bottom;return r&&s}function ut(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 s=n.left-r.width;const a=document.querySelector(".editorDiv");if(a){const m=a.getBoundingClientRect();s<m.left&&({left:s}=t.getBoundingClientRect())}o.style.left=s+"px"}}}function vn(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 ft(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=vn(t);if(r&&(o=bn(t,r)),!o){n.style.display="none";return}ut(t)}}function yn(t){if(!t)return;let e;t.className.includes("dgComponentSelected")?e=t:e=t.querySelector(".dgComponentSelected"),e&&ft(e)}function Cn(t){const{formSchemaUtils:e,formStateMachineUtils:n}=t;function o(c,h=""){return{path:h+c.code,field:c.id,fullPath:c.code}}function r(c,h=""){return e.getViewModelById(c).states.map(d=>o(d,h))}function s(c){const h=e.getRootViewModelId(),w=r(c);if(c===h)return w;const d=r(h,"root-component.");return[...w,...d]}function a(c){return c.binding&&c.binding.path||c.id||""}function m(){return n&&n.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:m}}class wn{constructor(e){G(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'"}]);G(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});G(this,"getExpressionConverter",(e,n)=>({convertFrom:(o,r,s,a)=>{const m=s.getExpressionRuleValue(e,n||r);return m&&m.value||""},convertTo:(o,r,s,a,m)=>{var c;if(r==="dataPicking"&&(s!=null&&s.target)){const h=`${s.target}_dataPicking`;((c=s.rules)==null?void 0:c.some(d=>d.id===h&&d.value))?o.dictPickingExpressionId=h:delete o.dictPickingExpressionId}a.updateExpression(s)}}));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 s=r.rules.find(a=>a.type===n);return s||""}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(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.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 m;const s=this.createTreeNode(r,n);let a=[];(m=r.type)!=null&&m.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...n,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var c,h;const s=this.createTreeNode(r,n);s.type="entity";const a=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...n,r.label]),m=this.buildChildEntityTreeData((h=r.type)==null?void 0:h.entities,[...n,r.label]);m!=null&&m.length&&(a==null||a.push(...m)),o.push({data:s,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,s=this.getExpressionRule(r,n),a=this.getEntitiesAndVariables(),m={message:["validate","required","dataPicking"].includes(n)&&s?s.message:"",...a};return s.messageType!=null&&(m.messageType=s.messageType),m}buildRule(e,n,o,r){const{expression:s,message:a,messageType:m}=n,c={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=a),o==="dataPicking"&&(c.messageType=m),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,o,r){const s=n==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let c=this.getExpressionData().find(w=>w.targetType===n&&w.target===s);const h=w=>w.value.trim()==="";if(c){const w=c.rules.find(d=>d.id===a.id);if(w)h(a)?c.rules=c.rules.filter(d=>d.id!==a.id):(Object.assign(w,a),r==="validate"&&e.type==="form-group"&&(w.elementId=e.id));else{if(h(a))return null;c.rules=c.rules||[],c.rules.push(a)}}else{if(h(a))return null;c={target:`${s}`,rules:[a],targetType:n}}return c}getExpressionEditorOptions(e,n,o,r){return o.reduce((s,a)=>{var c,h;const m=n==="Field"?(c=e==null?void 0:e.binding)==null?void 0:c.field:e.id;return s[a]={hide:n==="Field"?!!((h=e==null?void 0:e.binding)!=null&&h.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(m),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:w=>{const d=this.updateExpression(e,n,w,a);if(r){const p=this.buildRule(m,w,a);r(p)}return d}}},s},{})}getExpressionInfo(e,n,o){const r=n==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:n,expressionType:o};return s&&s.message&&(a.message=s.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 De{constructor(e,n){G(this,"componentId");G(this,"viewModelId");G(this,"eventsEditorUtils");G(this,"formSchemaUtils");G(this,"formMetadataConverter");G(this,"designViewModelUtils");G(this,"designViewModelField");G(this,"controlCreatorUtils");G(this,"designerHostService");G(this,"designerContext");G(this,"schemaService",null);G(this,"metadataService",null);G(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(s=>s.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:we[e.type]&&we[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},o){const r={title:"外观",description:"Appearance"},s={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)s[a]=Object.assign(s[a]||{},n[a]);return{...r,properties:{...s},setPropertyRelates(a,m){if(a){switch(a&&a.propertyID){case"class":case"style":{Ce.value++;break}}o&&o(a,e,m)}}}}getPropertyEditorParams(e,n=[],o="visible",r={},s={},a=""){const{getVariables:m,getControlName:c,getStateMachines:h}=Cn(this.designerHostService),w=this.getRealTargetType(e),d=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],p={type:"property-editor",propertyTypes:d};return d.map(b=>{switch(b){case"Const":Object.assign(p,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":p.expressionConfig=this.getExpressionOptions(e,w,a||o);break;case"StateMachine":p.stateMachines=h();break;case"Variable":Object.assign(p,{controlName:c(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:m(this.viewModelId),onBeforeOpenVariables:u=>{u.value=m(this.viewModelId)}},s);break}}),p}getVisibleProperty(e,n=""){var s;let o=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?o=["Const","Expression"]:n==="form-group"&&!((s=e.binding)!=null&&s.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,n="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,n);for(const c in o)a[c]=Object.assign(a[c]||{},o[c]);const m=this;return{...s,properties:{...a},setPropertyRelates(c,h){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":m.afterMutilEditorChanged(e,c);break}r&&r(c,h)}}}}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),s=de.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),hn()}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:s,expressionInfo:a}=n,{targetId:m,targetType:c,expressionType:h,value:w,message:d}=a,p=this.formSchemaUtils.getModule();p.expressions=p.expressions||[];const{expressions:b}=p;let u=b.find(P=>P.target===m);u||(u={target:m,rules:[],targetType:c},b.push(u));const l=u.rules.find(P=>P.type===h);if(l)l.value=w,l.message=d;else{const P={id:s,type:h,value:w,message:d};u.rules.push(P)}delete n.expressionInfo}clearExpression(e,n){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),m=n.binding?n.binding.field:n.id,c=a.find(h=>h.target===m);!c||!c.rules||(c.rules=c.rules.filter(h=>h.type!==s))}getExpressionOptions(e,n,o){return new wn(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 xn extends De{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e),this.propertyConfig.categories.template=this.getTemplateConfig(e),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e),this.propertyConfig}getAppearanceProperties(e){return{title:"外观",description:"",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式"},icon:{title:"图标",type:"string",description:"图标"},title:{title:"标题",type:"string",description:"标题"}},setPropertyRelates(n,o){if(n)switch(n&&n.propertyID){case"title":{n.needRefreshControlTree=!0;break}}}}}getTemplateConfig(e){return{title:"模板配置",description:"",properties:{titleContentClass:{title:"标题模板class",type:"string",description:"标题模板外层容器的自定义样式"},titleContentHtml:{title:"标题模板",type:"string",description:"设置标题HTML模板,替代图标和标题文字区域",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}},contentClass:{title:"内容模板class",type:"string",description:"内容模板外层容器的自定义样式"},contentHtml:{title:"内容模板",type:"string",description:"设置页头中间区域的模板",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}},downContentClass:{title:"扩展模板class",type:"string",description:"扩展模板外层容器的自定义样式"},downContentHtml:{title:"扩展模板",type:"string",description:"设置页头下方区域的模板",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}}}}}}function Tn(t,e){function n(m){return!1}function o(){return!1}function r(){return!1}function s(){return!0}function a(m){return new xn(m,e).getPropertyConfig(t)}return{canAccepts:n,hideNestedPaddingInDesginerView:s,getPropsConfig:a,checkCanDeleteComponent:o,checkCanMoveComponent:r}}class pt{constructor(e){G(this,"id","");G(this,"class","btn-secondary");G(this,"icon","");G(this,"groupId","");G(this,"order",-1);G(this,"asDropDownTop",!1);G(this,"text","");G(this,"visible",!0);G(this,"shown",!0);G(this,"responsed",!1);G(this,"tipsEnable",!1);G(this,"tipsText","");G(this,"width",0);G(this,"dropdownClass","");G(this,"onClick",()=>{});G(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(s=>n.indexOf(s)>-1).forEach(s=>{s==="visible"?this[s]=e[s]===void 0?!0:e[s]:this[s]=e[s]}),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:i.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class Sn extends pt{constructor(e){super(e)}}function gt(){function t(e){const n=[];return e.reduce((o,r)=>(r.children&&r.children.length>0?o.push(new Me(r)):o.push(new Sn(r)),o),n),n}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:Pn}=gt();class Me extends pt{constructor(n){super(n);G(this,"placement","");G(this,"visible",!0);G(this,"dropdownClass","");G(this,"menuClass","");G(this,"split",!1);G(this,"children",[]);G(this,"expanded",!1);G(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=Pn(n.children))}}const En=new Map([["buttons","items"],["appearance",ot]]);function mt(t,e,n){return e}const Dn={$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:"点击事件"}},Mn={$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:"点击事件"}},Be={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0}},kn=Object.assign({},Be,{componentId:{type:String,default:""}}),Ie=Se(Be,Dn,En,mt),ht={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}},Nn=Se(ht,Mn,void 0,mt),Vn=pn();function Fe(){function t(n){const o={"f-icon":!0};if(n.icon){const r=n.icon.trim().split(" ");r&&r.length&&r.reduce((s,a)=>(s[a]=!0,s),o)}return o}function e(n){return!!(n.icon&&n.icon.trim())}return{iconClass:t,shouldShowIcon:e}}function Bn(t,e){function n(E){const g={"dropdown-menu":!0};return ee.getCustomClass(g,E.menuClass)}function o(E){const g={disabled:!E.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return ee.getCustomClass(g,E.dropdownClass)}function r(E){const g={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return ee.getCustomClass(g,E.dropdownClass)}function s(E){const g={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 ee.getCustomClass(g,E.dropdownClass)}function a(E){const g={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(E.icon&&E.icon.trim()),"d-block":!0};return ee.getCustomClass(g,E.dropdownClass)}let m;const c=new Map;let h="";function w(E){h="#"+E}function d(E,g,V){E.stopPropagation();const S=V?V.id:"__top_item__";if(g.children&&g.children.length&&(g.expanded=!g.expanded,g.expanded)){if(c.has(S)&&c.get(S)!==g){const C=c.get(S);C&&(C.expanded=!1,c.delete(S))}c.set(S,g)}}function p(E,g){document.body.click(),g.enable&&(E.stopPropagation(),typeof g.onClick=="function"&&g.onClick(E,g.id),t.emit("click",E,g.id))}function b(E,g){const V=E.target;V.className.indexOf("dropdown-item")<0||(V.title=V.scrollWidth>V.clientWidth?g:"")}function u(E,g,V){if(g.tipsEnable&&g.tipsText){const S=i.reactive({content:g.tipsText,enable:g.tipsEnable});return i.withDirectives(i.createVNode("li",{class:r(g),id:g.id,key:g.id+"_"+V,onClick:C=>p(C,g)},[i.createVNode("span",{class:a(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text])]),[[i.resolveDirective("tooltip"),S]])}return i.createVNode("li",{class:r(g),id:g.id,onClick:S=>p(S,g)},[i.createVNode("span",{class:a(g),onMouseenter:S=>b(S,g.text)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text])])}function l(E,g,V){g.enable&&(typeof g.onClick=="function"&&V.onClick(E,g.id),t.emit("click",E,g.id),V.split||d(E,g,V))}function P(E,g,V){E&&E.stopPropagation(),d(E,g,V)}function I(E,g){E.stopPropagation();const V=g.id;if(g.children&&g.children.length&&g.expanded&&c.has(V)){const S=c.get(V);S&&(S.expanded=!1,c.delete(V))}}function M(E,g,V){if(g.tipsEnable&&g.tipsText){const S=i.reactive({content:g.tipsText,enable:g.tipsEnable});return i.createVNode("li",{class:o(g),id:g.id,key:g.id+"_"+V,onClick:C=>l(C,g,E)},[i.withDirectives(i.createVNode("span",{class:s(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text]),[[i.resolveDirective("tooltip"),S]]),g.split&&i.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:C=>P(C,g,E)},null),m(g,g)])}return i.createVNode("li",{class:o(g),id:g.id,onClick:S=>l(S,g,E),onMouseenter:S=>b(S,g.text)},[i.createVNode("span",{class:s(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text]),g.split&&i.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:S=>P(S,g,E)},null),m(g,g)])}function O(E){return E.children.filter(g=>g.visible).map((g,V)=>g.children&&g.children.length?M(E,g,V):u(E,g,V))}function N(E,g){if(!E)return 1080;let V=-1;const S=E.children.length;for(let C=0;C<S;C++)if(E.children[C].id===g){V=C;break}return 1080+S-V}function T(E,g,V){var B,j;const S={display:E.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},C=document.querySelector(h);if(!C)return S;const v=i.getCurrentInstance();let f=(j=(B=v==null?void 0:v.exposed)==null?void 0:B.elementRef.value)==null?void 0:j.querySelector("#"+g);if(f||(f=C==null?void 0:C.querySelector("#"+g)),!f)return S;const y=window.innerWidth,k=window.innerHeight,x=f==null?void 0:f.getClientRects();if(f&&x&&x.length){const{top:_,width:L,left:q,right:Q,height:Y}=x[0],Z=Math.ceil(Y+_);S.top=`${Z}px`,S.left=`${q}px`;const H=E.id+"_menu",te=(f==null?void 0:f.querySelector("#"+H))||(C==null?void 0:C.querySelector("#"+H))||null;if(te){te.style.visibility="hidden",te.style.display="block";const A=te.offsetHeight;S.zIndex=E.expanded?N(C,H):1080,S.display==="block"&&(te.style.display="block");const W=te.getBoundingClientRect();if(V){S.top=`${_-6}px`;const $=Math.ceil(L+q);S.left=`${$}px`}y-q-L<W.width&&(S.left=`${(V?q:Q)-W.width}px`),k-_-Y<A?_>A?(S.top=`${_-A-6}px`,S.maxHeight=`${_-16}px`):(S.maxHeight=`${k-Z}px`,_>k-_-Y&&(S.top="10px",S.maxHeight=`${_-16}px`)):S.maxHeight=`${k-Z}px`,te.style.visibility="visible"}}return S}m=function(E,g){const V=g?g.id:E.id;return i.createVNode(i.Teleport,{to:h,disabled:!E.expanded},{default:()=>[i.createVNode("ul",{class:n(E),style:T(E,V,g),id:E.id+"_menu",onWheel:S=>I(S,E)},[O(E)])]})};function F(){c.forEach(E=>{E.expanded=!1}),c.clear()}return{renderDropdownMenu:m,clearAllDropDownMenu:F,updateContainerId:w}}function In(t,e,n){const o=i.ref(t.alignment),{renderDropdownMenu:r,clearAllDropDownMenu:s,updateContainerId:a}=Bn(e,n);function m(l){const P={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right"||o.value==="center","f-btn-mr":o.value==="left"};return ee.getCustomClass(P,l.dropdownClass)}function c(l){const P={btn:!0,disabled:!l.enable,"f-rt-btn":!0,"btn-icontext":!!(l.icon&&l.icon.trim()),"f-rt-toggle":!l.split,"dropdown-toggle":!l.split};return ee.getCustomClass(P,l.class)}function h(l){const P={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return ee.getCustomClass(P,l.class)}function w(l){return l.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function d(l,P){l.stopPropagation();const I=P.expanded;document.body.click(),typeof P.onClick=="function"&&P.onClick(l,P.id),e.emit("click",l,P.id),P.split||(P.expanded=!I)}function p(l,P){l.stopPropagation();const I=P.expanded;document.body.click(),P.expanded=!I}function b(l,P=!0){if(l.tipsEnable&&l.tipsText){const I=i.reactive({content:l.tipsText,enable:l.tipsEnable});return i.createVNode("div",{id:l.id,class:m(l)},[i.withDirectives(i.createVNode("div",{class:c(l),style:w(l),onClick:M=>l.enable&&d(M,l)},[n.shouldShowIcon(l)&&i.createVNode("i",{class:n.iconClass(l)},null),i.createVNode("span",null,[l.text])]),[[i.resolveDirective("tooltip"),I]]),l.split&&i.createVNode("button",{class:h(l),style:"border-radius:0 6px 6px 0;",onClick:M=>p(M,l)},null),P&&r(l)])}return i.createVNode("div",{id:l.id,class:m(l)},[i.createVNode("div",{class:c(l),style:w(l),onClick:I=>l.enable&&d(I,l)},[n.shouldShowIcon(l)&&i.createVNode("i",{class:n.iconClass(l)},null),i.createVNode("span",null,[l.text])]),l.split&&i.createVNode("button",{class:h(l),style:"border-radius:0 6px 6px 0;",onClick:I=>p(I,l)},null),P&&r(l)])}function u(){s()}return{renderToolbarDropdown:b,clearAllDropDown:u,updateContainerId:a}}const{buildResponseToolbarItems:bt}=gt(),ke=i.defineComponent({name:"FResponseToolbar",props:Be,emits:["click"],setup(t,e){const{t:n}=At.useI18n(),o=i.ref(bt(t.items)),r=i.ref(),s=i.ref(),a=i.ref(),m={id:"__more_buttons__",text:n("responseToolbar.more")},c=i.ref(new Me(m)),h={id:m.id+"width",text:m.text},w=i.ref(-1),d=Fe();let p=!1;const{guid:b,uuid:u}=ee.useGuid(),l=t.id?t.id:"toolbar-"+b(),P=i.ref(),I="dropdown-container-"+l+"-"+u(4),{renderToolbarDropdown:M,clearAllDropDown:O,updateContainerId:N}=In(t,e,d);N(I);const T=i.computed(()=>c.value.children.length>0),F=i.computed(()=>t.visible?c.value.children.length>0?!0:o.value.findIndex(A=>A.shown&&A.children&&A.children.length>0)>-1:!1);function E(){t.visible&&!P.value&&document&&(P.value=document.createElement("div"),P.value.id=I,document.body.appendChild(P.value))}E();function g(){P.value&&document.body.contains(P.value)&&(document.body.removeChild(P.value),P.value=null)}i.watch(F,(A,W)=>{A?E():g()});const V=i.computed(()=>{const A={"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 ee.getCustomClass(A,t.customClass)}),S=i.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 C(A){A&&A.target.closest("ul.dropdown-menu")&&A.type==="wheel"||(o.value.filter(W=>W.children&&W.children.length>0).forEach(W=>{W.expanded=!1}),c.value.expanded=!1,O())}function v(A,W){var se;const $={btn:!0,"f-rt-btn":!0,"f-btn-ml":t.alignment==="right"||W>0&&t.alignment==="center","f-btn-mr":t.alignment==="left","btn-icontext":!!(A.icon&&A.icon.trim())},X=((se=A==null?void 0:A.appearance)==null?void 0:se.class)||A.class||"btn-secondary";return ee.getCustomClass($,X)}function f(A,W){document.body.click(),typeof W.onClick=="function"&&W.onClick(A,W.id),e.emit("click",A,W.id)}function y(A,W){if(A.tipsEnable&&A.tipsText){const $=i.reactive({content:A.tipsText,enable:A.tipsEnable});return i.withDirectives(i.createVNode("button",{type:"button",class:v(A,W),id:A.id,disabled:!A.enable,onClick:X=>f(X,A)},[d.shouldShowIcon(A)&&i.createVNode("i",{class:d.iconClass(A)},null),A.text]),[[i.resolveDirective("tooltip"),$]])}return i.createVNode("button",{type:"button",class:v(A,W),id:A.id,disabled:!A.enable,onClick:$=>f($,A)},[d.shouldShowIcon(A)&&i.createVNode("i",{class:d.iconClass(A)},null),A.text])}let k=new Map,x=[];function B(A){const W=Math.ceil(parseFloat(getComputedStyle(A).getPropertyValue("margin-left"))),$=Math.ceil(parseFloat(getComputedStyle(A).getPropertyValue("margin-right")));return(W||0)+A.getBoundingClientRect().width+($||0)}function j(A,W,$){if(W<w.value){let X=$-1;for(;X>=0;X--){const se=A[X],ie=B(se);if(W+=ie,W>=w.value)break}$=X}return W-=w.value,{start:$,space:W}}function _(A){const W=a.value;let $=A;const se=Array.from(W.children).filter(le=>le.id!=="__more_buttons__"),ie=se.length;let re=!1,oe=0;for(;oe<ie;oe++){const le=se[oe],ve=B(le);if(ve<=$)$-=ve;else{const ye=j(se,$,oe);oe=ye.start,$=ye.space,re=!0;break}}if(!re&&x.length>0){const le=j(se,$,oe);oe=le.start,$=le.space}const xe=x.length>0;for(;oe<ie;oe++){const le=se[oe],ve=B(le);k.set(le.id,!0);const ye=x.find(Te=>Te.id===le.id);ye?ye.width=ve:x[xe?"unshift":"push"]({id:le.id,width:ve})}return $}function L(A){let W=_(A);if(x.length){let ie=0;for(;ie<x.length;ie++){const re=t.items.find(oe=>oe.id===x[ie].id);if(re&&re.visible!==!1){const oe=x[ie].width;if(W>=oe||ie===x.length-1&&W+w.value>=oe)W-=oe;else break}}for(let re=0;re<ie;re++)k.delete(x[re].id);x.splice(0,ie-1)}const $=Object.assign({},c.value);$.children=[];const X=new Me($),se=o.value.reduce((ie,re)=>{const oe=t.items.find(xe=>xe.id===re.id);return k.has(re.id)?(X.children.push(re),re.shown=!1):re.shown=oe.visible!==!1,ie.push(re),ie},[]);c.value=X,o.value=se}function q(A=-1){if(A===0||!a.value||!s.value)return;A<0&&(A=s.value.getBoundingClientRect().width);const W=a.value.getBoundingClientRect().width;(A>=0&&A<W||x.length)&&(L(A),C())}function Q(){return w.value<0&&i.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[M(new Me(h))])}const Y=new ResizeObserver(A=>{if(A.length){const $=A[0].contentRect.width;q($)}});function Z(){k=new Map,x=[]}function H(){s.value&&!p&&(Y.observe(s.value),p=!0)}function te(){if(r.value&&w.value<0){const A=r.value.querySelector("#"+h.id);A&&(w.value=B(A))}}return i.onMounted(()=>{te(),q(),H(),document.body.addEventListener("click",C),document.body.addEventListener("wheel",C)}),i.onUnmounted(()=>{Y.disconnect(),g(),document.body.removeEventListener("click",C),document.body.removeEventListener("wheel",C)}),i.watch(()=>t.items,()=>{o.value=bt(t.items),c.value.children=[],i.nextTick(()=>{Z(),q()})},{deep:!0}),i.watch(()=>t.visible,A=>{A&&i.nextTick(()=>{te(),q(),H()})}),e.expose({elementRef:r}),()=>i.createVNode("div",{class:V.value,id:l,ref:r,style:{"overflow-y":w.value<0?"hidden":"initial"}},[t.visible&&Q(),t.visible&&i.createVNode("div",{ref:s,class:S.value},[i.createVNode("div",{ref:a,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(A=>A.shown).map((A,W)=>A.children&&A.children.length>0?M(A):y(A,W)),T.value&&M(c.value)])])])}});class Fn extends De{constructor(n,o,r="response-toolbar"){super(n,o);G(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 On(t,e,n){const o=t.schema;function r(){var l;let u=((l=t.parent)==null?void 0:l.schema.type)||"";["page-header","tabs","section"].findIndex(P=>P===u)===-1&&(u=""),n.toolbarPosition=u}r();function s(u){return!1}function a(u,l){return l.text=u.label,l}function m(){return!1}function c(){return!1}function h(){return!1}function w(){return!0}function d(u){return new Fn(u,e,o.type).getPropertyConfig(o)}function p(u){var M;u&&(u.stopPropagation(),u.preventDefault());const{schema:l}=t;l.buttons||(l.buttons=[]);let P="";if(l.type)P=l.type+"-item";else{const O=(M=t.parent)==null?void 0:M.schema.type;P=O==="tabs"?"tab-toolbar-item":O==="section"?"section-toolbar-item":"response-toolbar-item"}const I=Xe(P);I.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,l.buttons.push(I),n.updateToolbarItems(),n.changeSelectedId("")}function b(){return[{id:"appendItem",title:"新增按钮",text:"",icon:"f-icon f-icon-plus-circle text-white",onClick:u=>p(u)}]}return{canAccepts:s,checkCanAddComponent:h,checkCanDeleteComponent:c,checkCanMoveComponent:m,hideNestedPaddingInDesginerView:w,onResolveNewComponentSchema:a,getPropsConfig:d,getCustomButtons:b}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function An(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ne(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 vt={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(o,r,s){function a(h,w){if(!r[h]){if(!o[h]){var d=typeof Ne=="function"&&Ne;if(!w&&d)return d(h,!0);if(m)return m(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var b=r[h]={exports:{}};o[h][0].call(b.exports,function(u){var l=o[h][1][u];return a(l||u)},b,b.exports,n,o,r,s)}return r[h].exports}for(var m=typeof Ne=="function"&&Ne,c=0;c<s.length;c++)a(s[c]);return a}return n}()({1:[function(n,o,r){var s={},a="(?:^|\\s)",m="(?:\\s|$)";function c(d){var p=s[d];return p?p.lastIndex=0:s[d]=p=new RegExp(a+d+m,"g"),p}function h(d,p){var b=d.className;b.length?c(p).test(b)||(d.className+=" "+p):d.className=p}function w(d,p){d.className=d.className.replace(c(p)," ").trim()}o.exports={add:h,rm:w}},{}],2:[function(n,o,r){(function(s){var a=n("contra/emitter"),m=n("crossvent"),c=n("./classes"),h=document,w=h.documentElement;function d(C,v){var f=arguments.length;f===1&&Array.isArray(C)===!1&&(v=C,C=[]);var y,k,x,B,j,_,L,q,Q,Y=null,Z,H,te=!1,A=0,W,$=v||{};$.moves===void 0&&($.moves=M),$.accepts===void 0&&($.accepts=M),$.invalid===void 0&&($.invalid=Zn),$.containers===void 0&&($.containers=C||[]),$.isContainer===void 0&&($.isContainer=I),$.copy===void 0&&($.copy=!1),$.copySortSource===void 0&&($.copySortSource=!1),$.revertOnSpill===void 0&&($.revertOnSpill=!1),$.removeOnSpill===void 0&&($.removeOnSpill=!1),$.direction===void 0&&($.direction="vertical"),$.ignoreInputTextSelection===void 0&&($.ignoreInputTextSelection=!0),$.mirrorContainer===void 0&&($.mirrorContainer=h.body);var X=a({containers:$.containers,start:Qn,end:Dt,cancel:Vt,remove:Nt,destroy:xe,canMove:Xn,dragging:!1});return $.removeOnSpill===!0&&X.on("over",Kn).on("out",eo),ie(),X;function se(D){return X.containers.indexOf(D)!==-1||$.isContainer(D)}function ie(D){var R=D?"remove":"add";u(w,R,"mousedown",ve),u(w,R,"mouseup",$e)}function re(D){var R=D?"remove":"add";u(w,R,"mousemove",ye)}function oe(D){var R=D?"remove":"add";m[R](w,"selectstart",le),m[R](w,"click",le)}function xe(){ie(!0),$e({})}function le(D){Z&&D.preventDefault()}function ve(D){B=D.clientX,j=D.clientY;var R=l(D)!==1||D.metaKey||D.ctrlKey;if(!R){var U=D.target,z=Te(U);z&&(Z=z,re(),D.type==="mousedown"&&(F(U)?U.focus():D.preventDefault()))}}function ye(D){if(Z){if(l(D)===0){$e({});return}if(!(D.clientX!==void 0&&Math.abs(D.clientX-B)<=($.slideFactorX||0)&&D.clientY!==void 0&&Math.abs(D.clientY-j)<=($.slideFactorY||0))){if($.ignoreInputTextSelection){var R=S("clientX",D)||0,U=S("clientY",D)||0,z=h.elementFromPoint(R,U);if(F(z))return}var J=Z;re(!0),oe(),Dt(),Et(J),c.add(q||x,"gu-transit"),no(),to(),A=0,_e(D)}}}function Te(D){if(!(X.dragging&&y)&&!se(D)){for(var R=D;T(D)&&se(T(D))===!1;)if($.invalid(D,R)||(D=T(D),!D))return;var U=T(D);if(U&&!$.invalid(D,R)){var z=$.moves(D,U,R,g(D));if(z)return{item:D,source:U}}}}function Xn(D){return!!Te(D)}function Qn(D){var R=Te(D);R&&Et(R)}function Et(D){uo(D.item,D.source)&&(q=D.item.cloneNode(!0),X.emit("cloned",q,D.item,"copy")),k=D.source,x=D.item,_=L=g(D.item),X.dragging=!0,X.emit("drag",x,k)}function Zn(){return!1}function Dt(){if(X.dragging){var D=q||x;kt(D,T(D))}}function Mt(){Z=!1,re(!0),oe(!0)}function $e(D){if(Mt(),!!X.dragging){var R=q||x,U=S("clientX",D)||0,z=S("clientY",D)||0,J=P(y,U,z),K=Bt(J,U,z);K&&(q&&$.copySortSource||!q||K!==k)?kt(R,K):$.removeOnSpill?Nt():Vt()}}function kt(D,R){var U=T(D);q&&$.copySortSource&&R===k&&U.removeChild(x),je(R)?X.emit("cancel",D,k):X.emit("drop",D,R,k,L),Re()}function Nt(){if(X.dragging){var D=q||x,R=T(D);R&&R.removeChild(D),X.emit(q?"cancel":"remove",D,R,k),Re()}}function Vt(D){if(X.dragging){var R=arguments.length>0?D:$.revertOnSpill,U=q||x,z=T(U),J=je(z);J===!1&&R&&(q?z&&z.removeChild(q):k.insertBefore(U,_)),J||R?X.emit("cancel",U,k,k):X.emit("drop",U,z,k,L),Re()}}function Re(){var D=q||x;Mt(),oo(),ro(),D&&c.rm(D,"gu-transit"),Q&&clearTimeout(Q),X.dragging=!1,Y&&X.emit("out",D,Y,k),X.emit("dragend",D,A),k=x=q=_=L=Q=Y=null}function je(D,R){var U;return R!==void 0?U=R:y?U=L:U=g(q||x),D===k&&U===_}function Bt(D,R,U){for(var z=D;z&&!J();)z=T(z);return z;function J(){var K=se(z);if(K===!1)return!1;var ge=It(z,D),ue=Ft(z,ge,R,U),pe=je(z,ue);return pe?!0:$.accepts(x,z,k,ue)}}function _e(D){if(!y)return;D.preventDefault();var R=S("clientX",D)||0,U=S("clientY",D)||0;y.style.left=R-2+"px",y.style.top=U-2+"px";var z=q||x,J=P(y,R,U),K=Bt(J,R,U),ge=K!==null&&K!==Y;(ge||K===null)&&(fe(),Y=K,be()),co(J,U);var ue=T(z);if(K===k&&q&&!$.copySortSource){ue&&ue.removeChild(z);return}var pe,he=It(K,J);if(te=io(he,K),he!==null)pe=Ft(K,he,R,U);else if($.revertOnSpill===!0&&!q)pe=_,K=k;else{q&&ue&&ue.removeChild(z),q&&H&&(H.style.display="none");return}H.style.display="block",Jn(pe,z,ge),pe?ao(he,pe):lo(K);function ae(ce){X.emit(ce,z,Y,k)}function be(){ge&&ae("over")}function fe(){Y&&ae("out")}}function Jn(D,R,U){(D===R||D===g(R))&&(L=g(R)),(D===null&&U||D!==R&&D!==g(R))&&(L=D)}function Kn(D){c.rm(D,"gu-hide")}function eo(D){X.dragging&&c.add(D,"gu-hide")}function to(){y||(y=document.createElement("div"),y.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;",y.innerHTML=$.getMirrorText&&$.getMirrorText(x)||"控件",c.add(y,"gu-mirror"),$.mirrorContainer.appendChild(y),u(w,"add","mousemove",_e),c.add($.mirrorContainer,"gu-unselectable"),X.emit("cloned",y,x,"mirror"))}function no(){if(H=document.createElement("div"),c.add(H,"gu-insertion"),x){var D=x.getBoundingClientRect();H.style.left=D.left+"px",H.style.top=D.top+"px"}te=!1,$.mirrorContainer.appendChild(H)}function oo(){y&&(c.rm($.mirrorContainer,"gu-unselectable"),u(w,"remove","mousemove",_e),T(y).removeChild(y),y=null)}function ro(){H&&(T(H).removeChild(H),H=null)}function It(D,R){for(var U=R;U!==D&&T(U)!==D;)U=T(U);return U===w?null:U}function io(D,R){if(!R)return te;var U=D||R&&R.lastElementChild;if(!U)return!0;var z=getComputedStyle(D),J=/^inline/.test(z.getPropertyValue("display"))||/^(left|right)$/.test(z.getPropertyValue("float"));if(J)return!0;if(R){var K=getComputedStyle(R),ge=K.getPropertyValue("display");if(/flex$/.test(ge)){var ue=K.getPropertyValue("flex-direction")||"row";if(ue==="row"||ue==="row-reverse")return!so(R)}return!1}return!0}function so(D){if(!D.children||!D.children.length)return!1;for(const R of Array.from(D.children)){const z=(R.className&&R.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!z.length)return!1;for(const J of z){const K=J.slice(J.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function ao(D,R){const U=R.getBoundingClientRect();if(H.style.left=U.left+"px",H.style.top=U.top+"px",te){if(H.style.height=U.height+"px",H.style.width="4px",D){const z=D.getBoundingClientRect();z.top!==U.top&&(H.style.left=z.right+"px",H.style.top=z.top+"px",H.style.height=z.height+"px")}}else if(H.style.height="4px",H.style.width=U.width+"px",W){const z=W.getBoundingClientRect();U.top<z.top&&(H.style.display="none")}R===x&&x&&(H.style.display="none")}function lo(D){L=null;var R=D.lastElementChild;if(R){var U=R.getBoundingClientRect();te?(H.style.left=U.right+"px",H.style.top=U.top+"px",H.style.height=U.height+"px",H.style.width="4px"):(H.style.left=U.left+"px",H.style.top=U.bottom+"px",H.style.height="4px",H.style.width=U.width+"px"),R===x&&x&&(H.style.display="none")}else H.style.display="none"}function co(D,R){if(!$.mirrorContainer.contains(D)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(W=p(D),!W||!W.contains(D)))return;const U=document.querySelector(".dgComponentSelected"),z=W.getBoundingClientRect();if(R-30<z.top&&W.scrollTop>0){let J=W.scrollTop<10?W.scrollTop:10;W.scrollBy(0,-1*J),U&&W.contains(U)&&(A=A+-1*J)}if(R+30>z.bottom&&W.scrollTop<W.scrollHeight-W.clientHeight){const J=W.scrollHeight-W.clientHeight-W.scrollTop;let K=J<10?J:10;W.scrollBy(0,K),U&&W.contains(U)&&(A=A+K)}}function Ft(D,R,U,z){var J=$.direction==="horizontal",K=$.direction==="mixed",ge=R!==D?pe():ue();return ge;function ue(){var ae=D.children.length,be,fe,ce;for(be=0;be<ae;be++)if(fe=D.children[be],ce=fe.getBoundingClientRect(),J&&ce.left+ce.width/2>U||!K&&!J&&ce.top+ce.height/2>z||K&&ce.left+ce.width>U&&ce.top+ce.height>z)return fe;return null}function pe(){var ae=R.getBoundingClientRect();if(K){var be=z-ae.top,fe=U-ae.left,ce=ae.bottom-z,Le=ae.right-U,qe=Math.min(fe,Le,be,ce),Ue;return te?Ue=Le<fe:Ue=ce===qe||Le===qe||fe===qe,he(Ue)}return he(J?U>ae.left+O(ae)/2:z>ae.top+N(ae)/2)}function he(ae){return ae?g(R):R}}function uo(D,R){return typeof $.copy=="boolean"?$.copy:$.copy(D,R)}}function p(C){const v=Array.from(window.scrollContainerList);if(v.length===1){const y=Array.from(window.scrollContainerList)[0];return document.getElementById(y)}const f=b(v);for(const y of f)if(y.contains(C))return y;return null}function b(C){const v=[];return C.forEach(f=>{const y=document.getElementById(f);y&&v.push(y)}),v.sort((f,y)=>f.contains(y)?1:y.contains(f)?-1:0),v}function u(C,v,f,y){var k={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},x={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?m[v](C,x[f],y):s.navigator.msPointerEnabled?m[v](C,B[f],y):(m[v](C,k[f],y),m[v](C,f,y))}function l(C){if(C.touches!==void 0)return C.touches.length;if(C.which!==void 0&&C.which!==0)return C.which;if(C.buttons!==void 0)return C.buttons;var v=C.button;if(v!==void 0)return v&1?1:v&2?3:v&4?2:0}function P(C,v,f){C=C||{};var y=C.className||"",k;return C.className+=" gu-hide",k=h.elementFromPoint(v,f),C.className=y,k}function I(){return!1}function M(){return!0}function O(C){return C.width||C.right-C.left}function N(C){return C.height||C.bottom-C.top}function T(C){return C.parentNode===h?null:C.parentNode}function F(C){return C.tagName==="INPUT"||C.tagName==="TEXTAREA"||C.tagName==="SELECT"||E(C)}function E(C){return!C||C.contentEditable==="false"?!1:C.contentEditable==="true"?!0:E(T(C))}function g(C){return C.nextElementSibling||v();function v(){var f=C;do f=f.nextSibling;while(f&&f.nodeType!==1);return f}}function V(C){return C.targetTouches&&C.targetTouches.length?C.targetTouches[0]:C.changedTouches&&C.changedTouches.length?C.changedTouches[0]:C}function S(C,v){var f=V(v),y={pageX:"clientX",pageY:"clientY"};return C in y&&!(C in f)&&y[C]in f&&(C=y[C]),f[C]}o.exports=d}).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,m){return Array.prototype.slice.call(a,m)}},{}],4:[function(n,o,r){var s=n("ticky");o.exports=function(m,c,h){m&&s(function(){m.apply(h||null,c||[])})}},{ticky:10}],5:[function(n,o,r){var s=n("atoa"),a=n("./debounce");o.exports=function(c,h){var w=h||{},d={};return c===void 0&&(c={}),c.on=function(p,b){return d[p]?d[p].push(b):d[p]=[b],c},c.once=function(p,b){return b._once=!0,c.on(p,b),c},c.off=function(p,b){var u=arguments.length;if(u===1)delete d[p];else if(u===0)d={};else{var l=d[p];if(!l)return c;l.splice(l.indexOf(b),1)}return c},c.emit=function(){var p=s(arguments);return c.emitterSnapshot(p.shift()).apply(this,p)},c.emitterSnapshot=function(p){var b=(d[p]||[]).slice(0);return function(){var u=s(arguments),l=this||c;if(p==="error"&&w.throws!==!1&&!b.length)throw u.length===1?u[0]:u;return b.forEach(function(I){w.async?a(I,u,l):I.apply(l,u),I._once&&c.off(p,I)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(n,o,r){(function(s){var a=n("custom-event"),m=n("./eventmap"),c=s.document,h=p,w=u,d=[];s.addEventListener||(h=b,w=l),o.exports={add:h,remove:w,fabricate:P};function p(T,F,E,g){return T.addEventListener(F,E,g)}function b(T,F,E){return T.attachEvent("on"+F,M(T,F,E))}function u(T,F,E,g){return T.removeEventListener(F,E,g)}function l(T,F,E){var g=O(T,F,E);if(g)return T.detachEvent("on"+F,g)}function P(T,F,E){var g=m.indexOf(F)===-1?S():V();T.dispatchEvent?T.dispatchEvent(g):T.fireEvent("on"+F,g);function V(){var C;return c.createEvent?(C=c.createEvent("Event"),C.initEvent(F,!0,!0)):c.createEventObject&&(C=c.createEventObject()),C}function S(){return new a(F,{detail:E})}}function I(T,F,E){return function(V){var S=V||s.event;S.target=S.target||S.srcElement,S.preventDefault=S.preventDefault||function(){S.returnValue=!1},S.stopPropagation=S.stopPropagation||function(){S.cancelBubble=!0},S.which=S.which||S.keyCode,E.call(T,S)}}function M(T,F,E){var g=O(T,F,E)||I(T,F,E);return d.push({wrapper:g,element:T,type:F,fn:E}),g}function O(T,F,E){var g=N(T,F,E);if(g){var V=d[g].wrapper;return d.splice(g,1),V}}function N(T,F,E){var g,V;for(g=0;g<d.length;g++)if(V=d[g],V.element===T&&V.type===F&&V.fn===E)return g}}).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(s){var a=[],m="",c=/^on/;for(m in s)c.test(m)&&a.push(m.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(s){var a=s.CustomEvent;function m(){try{var c=new a("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=m()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(h,w){var d=document.createEvent("CustomEvent");return w?d.initCustomEvent(h,w.bubbles,w.cancelable,w.detail):d.initCustomEvent(h,!1,!1,void 0),d}:function(h,w){var d=document.createEventObject();return d.type=h,w?(d.bubbles=!!w.bubbles,d.cancelable=!!w.cancelable,d.detail=w.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,o,r){var s=o.exports={},a,m;function c(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=c}catch{a=c}try{typeof clearTimeout=="function"?m=clearTimeout:m=h}catch{m=h}})();function w(N){if(a===setTimeout)return setTimeout(N,0);if((a===c||!a)&&setTimeout)return a=setTimeout,setTimeout(N,0);try{return a(N,0)}catch{try{return a.call(null,N,0)}catch{return a.call(this,N,0)}}}function d(N){if(m===clearTimeout)return clearTimeout(N);if((m===h||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(N);try{return m(N)}catch{try{return m.call(null,N)}catch{return m.call(this,N)}}}var p=[],b=!1,u,l=-1;function P(){!b||!u||(b=!1,u.length?p=u.concat(p):l=-1,p.length&&I())}function I(){if(!b){var N=w(P);b=!0;for(var T=p.length;T;){for(u=p,p=[];++l<T;)u&&u[l].run();l=-1,T=p.length}u=null,b=!1,d(N)}}s.nextTick=function(N){var T=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)T[F-1]=arguments[F];p.push(new M(N,T)),p.length===1&&!b&&w(I)};function M(N,T){this.fun=N,this.array=T}M.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function O(){}s.on=O,s.addListener=O,s.once=O,s.off=O,s.removeListener=O,s.removeAllListeners=O,s.emit=O,s.prependListener=O,s.prependOnceListener=O,s.listeners=function(N){return[]},s.binding=function(N){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(N){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(n,o,r){(function(s){var a=typeof s=="function",m;a?m=function(c){s(c)}:m=function(c){setTimeout(c,0)},o.exports=m}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,o,r){(function(s,a){var m=n("process/browser.js").nextTick,c=Function.prototype.apply,h=Array.prototype.slice,w={},d=0;r.setTimeout=function(){return new p(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new p(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(b){b.close()};function p(b,u){this._id=b,this._clearFn=u}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(b,u){clearTimeout(b._idleTimeoutId),b._idleTimeout=u},r.unenroll=function(b){clearTimeout(b._idleTimeoutId),b._idleTimeout=-1},r._unrefActive=r.active=function(b){clearTimeout(b._idleTimeoutId);var u=b._idleTimeout;u>=0&&(b._idleTimeoutId=setTimeout(function(){b._onTimeout&&b._onTimeout()},u))},r.setImmediate=typeof s=="function"?s:function(b){var u=d++,l=arguments.length<2?!1:h.call(arguments,1);return w[u]=!0,m(function(){w[u]&&(l?b.apply(null,l):b.call(null),r.clearImmediate(u))}),u},r.clearImmediate=typeof a=="function"?a:function(b){delete w[b]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(vt);var $n=vt.exports;const yt=An($n);function Rn(t){let e;function n(r,s,a,m){const c=t.schema;if(!(c!=null&&c.buttons))return;let h;if(a){const b=a.getAttribute("id");h=Array.from(s.children).findIndex(u=>u.getAttribute("id")===b)}else h=Array.from(s.children).length;const w=r.getAttribute("id"),d=Array.from(s.children).findIndex(b=>b.getAttribute("id")===w),p=c.buttons[d];d!==h&&d>-1&&h>-1&&(d<h&&(h=h-1),c.buttons.splice(d,1),c.buttons.splice(h,0,p),m(),i.nextTick(()=>{const b=s.querySelector(".dgComponentSelected");b!=null&&b.className.includes("dgComponentSelected")&&(b.classList.remove("dgComponentSelected"),b.classList.remove("dgComponentFocused"),b.click()),Ce.value++}))}function o(r,s,a){e&&e.destroy(),!(!yt||!r||!s)&&(e=yt([r],{mirrorContainer:s,direction:"horizontal",getMirrorText(m){return m.innerText},moves(m,c,h){let w=!0;return h.classList.contains("dropdown-item")?(w=!1,w):(m.classList.contains("no-drag")&&(w=!1),w)}}).on("drop",(m,c,h,w)=>n(m,c,w,a)))}return{dragulaInstance:e,initDragula:o}}function jn(t,e,n){const{renderToolbarItemDesigner:o,actionHandlers:r}=n;let s;function a(M){s=M}function m(M,O=null){const N=e.value.find(T=>T.id===M.id);if(N.isDP)if(document.body.click(),typeof O=="boolean")N.expanded=O;else{const T=M.expanded;N.expanded=!T}}r.toggleDropdownMenu=m;function c(M){var N;const O={"dropdown-menu":!0};if(M.class){const T=(N=M.menuClass)==null?void 0:N.split(" ");T&&T.length&&T.reduce((F,E)=>(F[E]=!0,F),O)}return O}function h(M){var T;const O={disabled:M.disabled===!1,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},N=(T=M.dropdownClass)==null?void 0:T.split(" ");return N&&N.length&&N.reduce((F,E)=>(F[E]=!0,F),O),O}function w(M){const O={disabled:!1,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0,"text-truncate":!0},N=(M.class||"").split(" ");return N&&N.length&&N.reduce((T,F)=>(T[F]=!0,T),O),O}let d;const p=new Map;function b(M,O,N){M.stopPropagation();const T=N?N.id:"__top_item__";if(O.children&&O.children.length&&(O.expanded=!O.expanded,O.expanded)){if(p.has(T)&&p.get(T)!==O){const F=p.get(T);F&&(F.expanded=!1,p.delete(T))}p.set(T,O)}}function u(M){var O;return(O=M.children)==null?void 0:O.map((N,T)=>N.children&&N.children.length?i.createVNode("li",{class:h(N),id:N.id},[i.createVNode("span",{class:w(N),onClick:F=>b(F,N,M)},[N.text,i.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),d(N,N)]):o(N,T,!0))}function l(M,O,N,T){const{height:g,left:V,top:S}=T[0],{width:C,height:v}=N.getBoundingClientRect(),{marginTop:f,marginBottom:y}=getComputedStyle(N),k=Math.ceil(parseFloat(f))+Math.ceil(parseFloat(y)),x=S+g,B=O==null?void 0:O.getBoundingClientRect();function j(){let Q=0,Y="left";const Z=B?B.right:window.innerWidth,H=B?B.left:0;return Q=Z-V-10,Z-V<C&&V-H>Z-V&&(Y="right",Q=V-H-10),{hposition:Y,maxWidth:Math.min(Q,300)}}let _=0,L="bottom";if(M==="tabs"||M==="section")_=O.getBoundingClientRect().bottom-x-k-10;else{const Q=B?B.bottom:window.innerHeight;_=M==="page-header"?Q-x:S,_=_-k-10,L=M==="page-header"?"bottom":"top"}const q=j();return{position:L+"-"+q.hposition,maxWidth:q.maxWidth,maxHeight:_}}function P(M){var E,g,V;const O="300px",N={display:M.expanded===!0?"block":"none",position:"absolute",maxWidth:O,minWidth:"120px"};if(!(s!=null&&s.value))return N;const T=s.value.querySelector("#"+M.id),F=T==null?void 0:T.getClientRects();if(T&&F&&F.length>0){const S=T?T.querySelector("#"+M.id+"_menu"):null;if(!S||M.expanded!==!0)return N;S.style.visibility="hidden",S.style.display="block",S.style.maxHeight="auto",S.style.maxWidth=O;let C;switch(r.toolbarPosition){case"tabs":C=(E=s.value)==null?void 0:E.closest(".farris-tabs");break;case"section":C=(g=s.value)==null?void 0:g.closest(".f-section");break;default:C=(V=s.value)==null?void 0:V.closest(".f-page")}const v=l(r.toolbarPosition,C,S,F),{position:f,maxHeight:y,maxWidth:k}=v;S.style.visibility="visible";const x={left:f.indexOf("left")>-1?0:"unset",right:f.indexOf("left")>-1?"unset":0,bottom:f.indexOf("bottom")>-1?"unset":"100%",top:f.indexOf("bottom")>-1?"!00%":"unset",maxWidth:k?k+"px":"300px",maxHeight:y?y+"px":"auto",overflowY:y?"auto":"unset"};Object.assign(N,x)}return N}r.changeMenuPosition=P,d=function(M,O){return i.createVNode("ul",{class:c(M),style:P(M),id:M.id+"_menu"},[u(M)])};function I(M=""){M&&p.has(M)?p.forEach((O,N)=>{N!==M&&(O.expanded=!1,p.delete(N))}):(p.forEach(O=>{O.expanded=!1}),p.clear())}return{renderDropdownMenu:d,clearAllDropDownMenu:I,setResponseToolbarRef:a}}const _n={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 Ln(t,e,n){var V;const o="",r=i.ref();let s;function a(){return!0}function m(){return!1}function c(){return!0}function h(){return!0}function w(){return!0}function d(S){if(!S||!S.value)return null;const C=i.ref(S==null?void 0:S.value.parent),v=d(C);return v||null}function p(S=e){var y;const{componentInstance:C,designerItemElementRef:v}=S;if(!C||!C.value)return null;const{getCustomButtons:f}=C.value;return C.value.canMove||C.value.canAdd||C.value.canDelete||f&&((y=f())!=null&&y.length)?v:p(S.parent)}function b(){}function u(S){return!!n}function l(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function P(){}function I(S,C){}function M(S){const{componentType:C}=S,v=i.inject("designer-host-service");let f=We.getSchemaByTypeForDesigner(C,S,v);const y=C.toLowerCase().replace(/-/g,"_");return f&&!f.id&&f.type===C&&(f.id=`${y}_${Math.random().toString().slice(2,6)}`),f}function O(S){}function N(...S){return[]}function T(){}function F(S){var v;if(!(e!=null&&e.schema))return;let C="";{const{text:f,title:y,label:k,mainTitle:x,name:B,type:j}=e.schema;C=f||y||k||x||B||((v=we[j])==null?void 0:v.name)}C&&(!s&&S&&(s=S.formSchemaUtils),s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:C,parentPathName:C}))}function E(S){var y;const{changeObject:C}=S,{propertyID:v,propertyValue:f}=C;["text","title","label","name","mainTitle"].includes((y=S==null?void 0:S.changeObject)==null?void 0:y.propertyID)&&v&&f&&F()}function g(S){E(S)}return r.value={canMove:a(),canSelectParent:m(),canAdd:h(),canDelete:c(),canNested:!w(),contents:[],elementRef:t,parent:(V=e.parent)==null?void 0:V.componentInstance,schema:e.schema,styles:o,canAccepts:u,getBelongedComponentInstance:d,getDraggableDesignItemElement:p,getDraggingDisplayText:l,getPropConfig:N,getDragScopeElement:P,onAcceptMovedChildElement:I,onChildElementMovedOut:O,addNewChildComponentSchema:M,onRemoveComponent:T,triggerBelongedComponentToMoveWhenMoved:i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:i.ref(!1),onPropertyChanged:g,getCustomButtons:b,setComponentBasicInfoMap:F},r}const Ct=i.defineComponent({name:"FDesignerInnerItem",props:_n,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,e){const n=i.ref(t.canMove),o=i.ref(t.canAdd),r=i.ref(t.canDelete),s=i.ref(!1),a=i.ref(t.contentKey),m=i.ref(t.childType),c=i.ref(t.childLabel),h=i.ref(t.modelValue),w=i.ref(""),d=i.ref(),p=i.inject("canvas-dragula"),b=i.ref(),u=i.inject("design-item-context"),l={designerItemElementRef:d,componentInstance:b,schema:h.value,parent:u,setupContext:e};i.provide("design-item-context",l);const P=i.inject("designer-host-service"),I=i.inject("external-container-id"),M=i.computed(()=>{var j;const x=((j=b.value)==null?void 0:j.getCustomButtons)&&b.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||r.value||(x==null?void 0:x.length),"farris-nested":s.value,"can-move":n.value,"d-none":d.value&&d.value.classList.contains("d-none")}}),O=i.computed(()=>{const x={};return w.value&&w.value.split(";").reduce((B,j)=>{const[_,L]=j.split(":");return _&&(B[_]=L),B},x),x});function N(x,B){if(u&&u.schema[a.value]){const j=u.schema[a.value].findIndex(_=>_.id===B.id);if(j>-1){const _=u.schema[a.value].length,L=u.schema[a.value][j%_];u.designerItemElementRef.value.querySelector(`#${L.id}-design-item`),u.schema[a.value].splice(j,1),Ce.value++,e.emit("removeComponent"),e.emit("selectionChange")}}}function T(x){if(b.value.addNewChildComponentSchema){const B={componentType:m.value,label:c.value,parentComponentInstance:b.value,targetPosition:-1},j=b.value.addNewChildComponentSchema(B);h.value[a.value].push(j),e.emit("addComponent")}}function F(){return o.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:x=>{T()}},[i.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function E(x){return r.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:i.withModifiers(B=>N(B,x),["stop"])},[i.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function g(){return n.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[i.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function V(){var B;const x=((B=b.value)==null?void 0:B.getCustomButtons)&&b.value.getCustomButtons();return x&&!!x.length&&x.map(j=>i.createVNode("div",{role:"button",class:`btn component-settings-button ${j.class||""} ${j.text?"settings-button-extend":""}`,title:j.title,ref:j.id,onClick:_=>j.onClick&&j.onClick(_)},[i.createVNode("i",{class:"f-icon "+j.icon},null),j.text&&i.createVNode("span",{class:"icon-text"},[j.text])]))}function S(x){return i.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[i.createVNode("div",null,[F(),g(),E(x),V()])])}i.watch(()=>t.modelValue,x=>{h.value=x,l.schema=x});function C(x){window.scrollContainerList||(window.scrollContainerList=new Set);const B=x.getAttribute("id");B&&window.scrollContainerList.add(B)}function v(x){const B=x.target;C(B),yn(B)}function f(){var x,B;(B=(x=h.value)==null?void 0:x.contents)!=null&&B.length&&d.value&&d.value.addEventListener("scroll",v)}function y(){const x=d.value,B=i.ref(x.children[1]);return Ln(B,l).value}i.onMounted(()=>{if(d.value){const x=d.value.querySelector(`[data-dragref='${h.value.id}-container']`);b.value=x&&x.componentInstance?x.componentInstance.value:y(),p&&x&&p.attachComponents(x,h.value),s.value=b.value.canNested!==void 0?b.value.canNested:s.value,o.value=b.value.canAdd!==void 0?b.value.canAdd:o.value,r.value=b.value.canDelete!==void 0?b.value.canDelete:r.value,n.value=b.value.canMove!==void 0?b.value.canMove:n.value,w.value=b.value.styles||"",d.value&&(d.value.componentInstance=b,d.value.designItemContext=l),b.value.setComponentBasicInfoMap(P)}f(),Ce.value++}),i.onBeforeUnmount(()=>{d.value&&d.value.removeEventListener("scroll",v)});function k(x){if(x&&(x.preventDefault(),x.stopPropagation()),I){const _=document.getElementById(`${I}-design-item`);_&&_.click();return}let B=l.designerItemElementRef;const j=d.value;if(j){const _=document.getElementsByClassName("dgComponentFocused");_&&_.length===1&&_[0]===d.value&&d.value.classList.contains("dgComponentSelected")||(Array.from(_).forEach(q=>q.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(q=>q.classList.remove("dgComponentSelected")),j.classList.add("dgComponentFocused"),e.emit("selectionChange",h.value.type,h.value,t.componentId,b.value),b.value.getDraggableDesignItemElement&&(B=b.value.getDraggableDesignItemElement(l),B&&B.value&&B.value.classList.add("dgComponentSelected")))}ft(B==null?void 0:B.value)}return()=>i.createVNode("div",{id:`${t.id}-design-item`,ref:d,class:M.value,style:O.value,onClick:k},[S(h.value),e.slots.default&&e.slots.default()])}});class qn extends De{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),s=o.createBaseEventProperty(r);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,m){const c=a.propertyValue;delete e[o.viewModelId],c&&(c.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,c.events,c))}}}}class Un extends De{constructor(n,o,r="response-toolbar-item"){super(n,o);G(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=s=>{if(s)switch(s&&s.propertyID){case"text":{s.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,s=r.eventsEditorUtils.formProperties(n,r.viewModelId,o),a=r.createBaseEventProperty(s);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(m,c){const h=m.propertyValue;delete n[r.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(n,r.viewModelId,h.events,h))}}}}function Oe(t,e){if(!t)return!1;const n=e||[];return(n==null?void 0:n.findIndex(r=>r.id===t))===-1}function wt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};return n.some((r,s)=>{if(r.children&&r.children.length>0){const a=r.children.findIndex(m=>m.id===t);return a>-1?(o={parentIndex:s,itemIndex:a},!0):!1}}),o}function xt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};const r=n==null?void 0:n.findIndex(s=>s.id===t);return r>-1?{parent:null,item:n[r]}:(n.some((s,a)=>{if(s.children&&s.children.length>0){const m=s.children.findIndex(c=>c.id===t);return m>-1?(o={parentIndex:a,itemIndex:m},!0):!1}}),o.parentIndex<0?{parent:null,item:null}:{parent:n[o.parentIndex],item:n[o.parentIndex].children[o.itemIndex]})}function Wn(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 Hn(t,e,n){function o(v){return!1}function r(){return!1}function s(){return!1}function a(){return!1}function m(){return n.toolbarContext.schema.buttons||[]}function c(v,f=""){setTimeout(()=>{var B,j;const y=(B=t.parent)==null?void 0:B.designerItemElementRef.value;let k;f&&(k=y==null?void 0:y.querySelector("#"+f));const x=(j=k||y)==null?void 0:j.querySelector("#"+v);x==null||x.click()},0)}function h(v,f){f.disabled&&f.disabled.expressionId&&(f.disabled.expressionId=`${f.id}_disabled`),f.visible&&f.visible.expressionId&&(f.visible.expressionId=`${f.id}_visible`);const y=e.formSchemaUtils.getExpressions(),k=y.find(B=>B.target===v.id);if(!k||!k.rules||!k.rules.length)return;const x={target:f.id,rules:[],targetType:"Button"};k.rules.forEach(B=>{const j=Object.assign(de.cloneDeep(B),{id:`${f.id}_${B.type}`});x.rules.push(j)}),y.push(x)}function w(){var k;const v=t.schema,f=Object.assign(de.cloneDeep(v),{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null});(k=e==null?void 0:e.designerContext)!=null&&k.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(f);let y=[];return f.children&&f.children.length&&(y=f.children.map(x=>{var j;const B=de.cloneDeep(x);return Object.assign(B,{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null}),(j=e==null?void 0:e.designerContext)!=null&&j.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(B),h(x,B),B}),f.children=y),h(v,f),f}function d(){const v=t.schema.type||"response-toolbar-item",f=cn(v),y=v.toLowerCase().replace("-","_");return f&&!f.id&&f.type===v&&(f.id=`${y}_${Math.random().toString().slice(2,6)}`,f.text="按钮"),f}function p(v){const f=m(),y=f==null?void 0:f.findIndex(x=>x.id===v),k=y===-1?null:f[y];return{index:y,toolbarItem:k}}function b(){const v=t.schema.id,f=m();return Oe(v,f)}function u(v){const f=e.formSchemaUtils.getExpressions();if(!f||!f.length)return;const y=k=>{const x=f&&f.findIndex(B=>B.target===k.id);x>-1&&f.splice(x,1)};y(v),v.children&&v.children.length&&v.children.forEach(k=>{y(k)})}function l(v){n.changeSelectedId(v)}function P(v){e.formSchemaUtils.removeCommunicationInComponent(v),v.children&&v.children.length&&v.children.forEach(f=>{e.formSchemaUtils.removeCommunicationInComponent(f)})}function I(){var k,x,B;if((k=e==null?void 0:e.designerContext)!=null&&k.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const v=m(),{parentIndex:f,itemIndex:y}=wt(t.schema.id,v);f===-1||y===-1||(u(t.schema),P(t.schema),v[f].children.splice(y,1),n.updateToolbarItems(),(x=t.setupContext)==null||x.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function M(){var k,x,B;if((k=e==null?void 0:e.designerContext)!=null&&k.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const v=t.schema.id,f=m(),y=f==null?void 0:f.findIndex(j=>j.id===v);y!==-1&&(u(f[y]),P(f[y]),f==null||f.splice(y,1),n.updateToolbarItems(),(x=t.setupContext)==null||x.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function O(v="Append"){var j;const f=m(),{parentIndex:y,itemIndex:k}=wt(t.schema.id,f);if(y===-1||k===-1)return;const x=d(),B=v==="Copy"?w():Object.assign({},x);f[y].children.splice(k+1,0,B),n.updateToolbarItems(),l(B.id),(j=t.setupContext)==null||j.emit("addComponent")}function N(v,f){const{index:y}=p(f);if(y===-1)return{index:y,schema:null};const k=d(),x=v==="Copy"?w():Object.assign({},k);return{index:y,schema:x}}function T(){var k;const v=t.schema.id,{index:f,schema:y}=N("Copy",v);y&&(m().splice(f+1,0,y),n.updateToolbarItems(),c(y.id),(k=t.setupContext)==null||k.emit("addComponent"))}function F(){var k;const v=t.schema.id,{index:f,schema:y}=N("Append",v);if(y&&t.parent){const B=m()[f].children||[];B.push(y);const j=m();j[f].children=B,n.updateToolbarItems(),l(y.id),(k=t.setupContext)==null||k.emit("addComponent")}}function E(v){let f;switch(t.schema.type){case"tab-toolbar-item":f=new qn(v,e);break;default:f=new Un(v,e,t.schema.type)}return f.getPropertyConfig(t.schema,b())}function g(v){v.stopPropagation(),v.stopImmediatePropagation()}function V(){const v=[{id:"delete",title:"删除",text:"",icon:"f-icon-yxs_delete",onClick:f=>{g(f),b()?I():M()}},{id:"copy",title:"复制",icon:"f-icon-yxs_copy",onClick:f=>{g(f);const{activeElement:y}=document,k=y?y.tagName.toLowerCase():"";k&&k==="input"||k==="textarea"?(y==null||y.blur(),i.nextTick(()=>{b()?O("Copy"):T()})):b()?O("Copy"):T()}}];return v.push(b()?{id:"appendSiblingButton",title:"",text:"新增同级",icon:"f-icon-plus-circle",onClick:f=>{g(f),O()}}:{id:"appendChildButton",title:"",text:"新增子级",icon:"f-icon-plus-circle",onClick:f=>{g(f),F()}}),v}function S(){const{schema:v}=t;u(v)}function C(){var v,f,y,k;if(t&&e){const{formSchemaUtils:x}=e,{schema:B}=t;switch(B.type){case"response-toolbar-item":{x.getControlBasicInfoMap().set(B.id,{componentTitle:B.text,parentPathName:B.text});break}case"tab-toolbar-item":case"section-toolbar-item":{let j;const _=(v=t.parent)==null?void 0:v.parent;(_==null?void 0:_.schema.type)==="tabs"||(_==null?void 0:_.schema.type)==="section"?j=(f=_.componentInstance)==null?void 0:f.value:j=(k=(y=_==null?void 0:_.parent)==null?void 0:y.componentInstance)==null?void 0:k.value,j!=null&&j.setComponentBasicInfoMap&&j.setComponentBasicInfoMap()}}}}return{canAccepts:o,checkCanMoveComponent:r,checkCanDeleteComponent:s,checkCanAddComponent:a,getPropsConfig:E,getCustomButtons:V,onRemoveComponent:S,setComponentBasicInfoMap:C}}const Tt=i.defineComponent({name:"FResponseToolbarItemDesign",props:ht,emits:["Click","dropdown","clearAll"],setup(t,e){const n=i.ref(t.alignment),o=Fe(),r=i.ref(),s=i.inject("designer-host-service"),a=i.inject("design-item-context"),m=i.inject("toolbar-item-action"),c=Hn(a,s,m),h=He.useDesignerInnerComponent(r,a,c);i.onMounted(()=>{r.value.componentInstance=h}),e.expose(h.value);function w(){const N={"f-icon":!0},T=t.icon?t.icon.trim():"";return ee.getCustomClass(N,T)}function d(){return!!(t.icon&&t.icon.trim())}const p=i.computed(()=>{const N={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 ee.getCustomClass(N,t.class)}),b=i.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=i.computed(()=>{const N={btn:!0,"dropdown-toggle":!0,"f-btn-mr":n.value==="left","dropdown-toggle-split":!0,"no-drag":!0};return ee.getCustomClass(N,t.class)}),l=i.computed(()=>{let N={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||(N=ee.getCustomClass(N,t.class||"")),t.isDP&&(N=ee.getCustomClass(N,t.dropdownClass||"")),N});function P(N,T){T&&T.stopPropagation(),e.emit(N,{id:t.id,isDP:t.isDP})}function I(){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 M(){return i.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[i.createVNode("div",{class:I(),id:t.id},[i.createVNode("div",{class:p.value,style:b.value,onClick:()=>P("clearAll")},[o.shouldShowIcon(t)&&i.createVNode("i",{class:o.iconClass(t)},null),i.createVNode("span",null,[t.text]),!t.split&&i.createVNode("span",{class:"f-icon f-icon-arrow-chevron-down",style:"margin:0 0.5rem 0 0.25rem;",onClick:N=>P("dropdown",N)},null)]),t.split&&i.createVNode("button",{class:u.value,style:"border-radius:0 6px 6px 0;",onClick:N=>P("dropdown",N)},null),m.renderDropdownMenu(t.item,t.item)])])}function O(){return i.createVNode("li",{ref:r,"data-dragref":`${a.schema.id}-container`,id:t.id,class:l.value},[o.shouldShowIcon(t)&&i.createVNode("i",{class:o.iconClass(t)},null),t.text])}return()=>t.isDP?M():t.isDPItem?O():i.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[i.createVNode("button",{type:"button",class:p.value,id:t.id,onClick:()=>P("clearAll")},[d()&&i.createVNode("i",{class:w()},null),t.text])])}});function zn(t,e,n,o){function r(p,b,u,l){o.changeSelectedId((b==null?void 0:b.id)||""),n&&n.setupContext&&n.setupContext.emit("selectionChange",p,b,u,l)}function s(){}function a(p){const b=p.expanded;o.clearAllDropdown(),o.toggleDropdownMenu(p,!b)}function m(p){o.clearAllDropdown(p.isDP?p.id:"")}function c(p,b=""){const u=t.items||[],l=b||p,P=u.find(I=>I.id===l);return b?P.children.find(I=>I.id===p):P}function h(p,b=!1){if(!b)return;const u=p.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.add("dgComponentSelected"))}function w(p,b=!1){if(!b)return;const u=p.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.remove("dgComponentSelected"))}function d(p,b,u=!1){const l=c(p.id,p.parent),P=i.ref(l);return i.createVNode(Ct,{key:l.id,class:["p-0",u?"d-block no-drag":"d-inline-block"],modelValue:P.value,"onUpdate:modelValue":I=>P.value=I,canMove:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:t.componentId,id:l.id,onSelectionChange:r,onRemoveComponent:s,onMouseenter:I=>h(I,u),onMouseleave:I=>w(I,u)},{default:()=>{var I;return[i.createVNode(Tt,{id:l.id,disabled:l.disabled,text:l.text,icon:l.icon,isDP:p.isDP,item:p,split:l.split,isDPItem:p.isDPItem,class:((I=p.appearance)==null?void 0:I.class)||"btn-secondary",alignment:t.alignment||"right",onDropdown:()=>a(p),onClearAll:M=>m(M),componentId:t.componentId},null)]}})}return{renderToolbarItemDesigner:d,actionHandlers:o}}function Ae(t,e=!1,n=""){const o=[];return t.reduce((r,s)=>{if(s.children&&s.children.length>0){const a=Ae(s.children,!0,s.id);r.push(Object.assign({},s,{children:a,isDPItem:!1,isDP:!0,parent:"",expanded:!1}))}else r.push(Object.assign({},s,{isDPItem:e,isDP:!1,parent:n}));return r},o),o}const St=i.defineComponent({name:"FResponseToolbarDesign",props:kn,emits:["Click"],setup(t,e){const n=i.ref(Ae(t.items)),o=i.ref(),r=i.ref(),s=i.ref(),a=i.ref("");let m=0;const c=15,h=i.inject("designer-host-service"),w=i.inject("design-item-context"),d={clearAllDropdown:L=>{},toggleDropdownMenu:L=>{},updateToolbarItems:()=>{},changeSelectedId:L=>{a.value=L},renderDropdownMenu:(L,q)=>{},toolbarContext:w,changeMenuPosition:(L,q,Q)=>({}),toolbarPosition:""},p=On(w,h,d),b=He.useDesignerComponent(s,w,p),u=i.inject("toolbar-item-handler"),{initDragula:l,dragulaInstance:P}=Rn(w),I=Fe(),M=zn(t,r,w,d),O=jn(I,n,M),{renderToolbarItemDesigner:N}=M,{clearAllDropDownMenu:T,renderDropdownMenu:F,setResponseToolbarRef:E}=O;i.provide("toolbar-item-action",d),d.renderDropdownMenu=F,E(s),u&&(u.changeSelectedId=function(L){a.value=L});function g(){const L=r.value.querySelector(".dgComponentSelected");L&&ut(L)}function V(){if(a.value)if(Oe(a.value,n.value)){const{parent:L,item:q}=xt(a.value,n.value);L&&(d.toggleDropdownMenu(L,!0),setTimeout(()=>{var Z;const Q=s.value.querySelector("#"+L.id),Y=Q==null?void 0:Q.querySelector("#"+q.id);(((Z=Y==null?void 0:Y.parentElement)==null?void 0:Z.className)||"").indexOf("dgComponentFocused")<0&&(Y==null||Y.click())},0))}else g()}function S(L=""){n.value.filter(q=>q.id!==L&&q.children&&q.children.length>0).forEach(q=>{q.expanded=!1}),T(L)}d.clearAllDropdown=S;function C(){u&&u.updateToolbarItems&&u.updateToolbarItems()}d.updateToolbarItems=C;function v(L){if(L){const q=s.value.querySelector("#"+L.id),Q=q.querySelector("#"+L.id+"_menu"),Y=d.changeMenuPosition(L,q);Object.keys(Y).forEach(Z=>{Q.style[Z]=Y[Z]})}}function f(){const Q=r.value.clientWidth,Y=r.value.querySelectorAll(".farris-component>.f-rt-btn");Y&&Y.forEach(H=>{H.style.maxWidth=Q-12+"px"});const Z=r.value.querySelectorAll(".farris-component>.f-rt-dropdown");Z&&Z.forEach(H=>{H.querySelector(".dropdown-toggle-split")?H.querySelector(".f-rt-btn").style.maxWidth=Q-38+"px":H.style.maxWidth=Q-12+"px"})}const y=new ResizeObserver(L=>{var q;if(L.length){const Y=L[0].contentRect.width;if(Y===0){m=0;return}if(Math.abs(Y-m)>c){if(m=Y,Oe(a.value,n.value)){const{parent:Z,item:H}=xt(a.value,n.value);v(Z)}else if(Wn(a.value,n.value)){const Z=(q=n.value)==null?void 0:q.find(H=>H.id===a.value);v(Z)}else S();f()}}});i.onMounted(()=>{y.observe(s.value),m=s.value.clientWidth,s.value.componentInstance=b,l(r.value,o.value,C)}),i.onUnmounted(()=>{y.disconnect(),P&&P.destroy&&P.destroy()}),e.expose(b.value);const k=i.computed(()=>{const L={"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 ee.getCustomClass(L,t.customClass)}),x=i.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}));i.watch(()=>t.items,()=>{n.value=Ae(t.items),i.nextTick(()=>{V(),f()})},{deep:!0});function B(L){L&&(L.stopPropagation(),L.preventDefault());const{schema:q}=w;q.buttons||(q.buttons=[]);const Q=Xe("response-toolbar-item");Q.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,Q.appearance={class:"btn btn-secondary"},q.buttons.push(Q)}function j(){return i.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},[i.createVNode("span",{class:"f-icon f-icon-amplification mr-1",style:"font-size: 12px;"},null),i.createVNode("span",{class:"farris-tag-add-text"},[i.createTextVNode("添加按钮")])])}function _(){return n.value.map((L,q)=>N(L,q))}return()=>{var L;return i.createVNode("div",{ref:s,"data-dragref":`${w.schema.id}-container`,class:k.value,id:t.id},[i.createVNode("div",{ref:o,class:x.value,onClick:q=>S(q)},[i.createVNode("div",{ref:r,class:"d-block f-response-content"},[(L=n.value)!=null&&L.length?_():j()])])])}}}),Pt=Ie;ke.register=(t,e,n,o)=>{t["response-toolbar"]=ke,e["response-toolbar"]=Ie,o["response-toolbar"]={eventHandlerResolver:Vn}},ke.registerDesigner=(t,e,n)=>{t["response-toolbar"]=St,e["response-toolbar"]=Ie,t["response-toolbar-item"]=Tt,e["response-toolbar-item"]=Nn},ee.withInstall(ke);const Gn=i.defineComponent({name:"FPageHeaderDesign",props:Ve,emits:["click"],setup(t,e){const n=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),s=Tn(r.schema,o),a=gn(n,r,s),m=i.ref(r.schema.toolbar||{type:"response-toolbar",buttons:[]}),c=i.ref(Pt(m.value));i.onMounted(()=>{n.value.componentInstance=a}),i.watch(()=>r.schema.toolbar,()=>{m.value=r.schema.toolbar||{type:"response-toolbar",buttons:[]},c.value=Pt(m.value)},{deep:!0});const h=i.computed(()=>[...c.value.items]);function w(T,F,E,g){r&&r.setupContext&&r.setupContext.emit("selectionChange",T,F,E,g)}e.expose(a.value);function d(T,F){T&&F&&F.split(" ").reduce((g,V)=>(g[V]=!0,g),T)}const p=i.computed(()=>{const T={"f-title-icon":!0};return d(T,t.iconClass),T}),b=i.computed(()=>{const T={"f-icon":!0};return d(T,t.icon),T}),u=i.computed(()=>{const T={"text-right":!0,"col-6":!0};return d(T,t.buttonClass||""),T}),l=i.computed(()=>{const T={"f-title":!0};return ee.getCustomClass(T,t.titleContentClass)}),P=i.computed(()=>{const T={"f-content":!0};return ee.getCustomClass(T,t.contentClass)}),I=i.computed(()=>{const T={"f-page-header-extend":!0};return ee.getCustomClass(T,t.downContentClass)});function M(){return t.titleContentHtml?i.createVNode("div",{class:l.value,innerHTML:t.titleContentHtml},null):i.createVNode("div",{class:"f-title"},[t.showIcon&&t.icon?i.createVNode("span",{class:p.value},[i.createVNode("i",{class:b.value},null)]):"",i.createVNode("h4",{class:"f-title-text"},[t.title])])}function O(){return t.contentHtml?i.createVNode("div",{class:P.value,innerHTML:t.contentHtml},null):null}function N(){return t.downContentHtml?i.createVNode("div",{class:I.value,innerHTML:t.downContentHtml},null):null}return()=>i.createVNode("div",{ref:n},[i.createVNode("nav",{class:"f-page-header-base"},[M(),O(),i.createVNode(Ct,{class:u.value,modelValue:m.value,"onUpdate:modelValue":T=>m.value=T,canAdd:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:m.value.id,componentId:t.componentId,onSelectionChange:w},{default:()=>[i.createVNode(St,{id:m.value.id,customClass:"w-100",items:h.value,componentId:t.componentId},null)]})]),N()])}}),Yn={install(t){t.component(Ee.name,Ee)},register(t,e,n,o){t["page-header"]=Ee,e["page-header"]=lt,o["page-header"]={eventHandlerResolver:dt}},registerDesigner(t,e,n){t["page-header"]=Gn,e["page-header"]=ct}};ne.PageHeader=Ee,ne.default=Yn,ne.eventHandlerResolver=dt,ne.pageHeaderDesignerProps=Ve,ne.pageHeaderProps=Pe,ne.propsDesignResolver=ct,ne.propsResolver=lt,Object.defineProperties(ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(ne,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("vue-i18n"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","../common/index.umd.js","../dynamic-resolver/index.umd.js","vue-i18n","../designer-canvas/index.umd.js"],i):(ne=typeof globalThis<"u"?globalThis:ne||self,i(ne["page-header"]={},ne.Vue,ne.LodashES,ne.FResponseToolbar$1,ne.common,ne.dynamicResolver,ne.vueI18n,ne.designerCanvas))})(this,function(ne,i,de,Ot,ee,We,At,He){"use strict";var fo=Object.defineProperty;var po=(ne,i,de)=>i in ne?fo(ne,i,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[i]=de;var G=(ne,i,de)=>po(ne,typeof i!="symbol"?i+"":i,de);function ze(t,e){let n;function o(d){const{properties:p,title:b,ignore:u}=d,l=u&&Array.isArray(u),P=Object.keys(p).reduce((I,M)=>((!l||!u.find(O=>O===M))&&(I[M]=p[M].type==="object"&&p[M].properties?o(p[M]):de.cloneDeep(p[M].default)),I),{});if(b&&(!l||!u.find(I=>I==="id"))){const I=b.toLowerCase().replace(/-/g,"_");P.id=`${I}_${Math.random().toString().slice(2,6)}`}return P}function r(d){const{properties:p,title:b,required:u}=d;if(u&&Array.isArray(u)){const l=u.reduce((P,I)=>(P[I]=p[I].type==="object"&&p[I].properties?o(p[I]):de.cloneDeep(p[I].default),P),{});if(b&&u.find(P=>P==="id")){const P=b.toLowerCase().replace(/-/g,"_");l.id=`${P}_${Math.random().toString().slice(2,6)}`}return l}return{type:b}}function s(d,p={},b){const u=t[d];if(u){let l=r(u);const P=e[d];return l=P?P({getSchemaByType:s},l,p,b):l,n!=null&&n.appendIdentifyForNewControl&&n.appendIdentifyForNewControl(l),l}return null}function a(d,p){const b=o(p);return Object.keys(b).reduce((u,l)=>(Object.prototype.hasOwnProperty.call(d,l)&&(u[l]&&de.isPlainObject(u[l])&&de.isPlainObject(d[l]||!d[l])?Object.assign(u[l],d[l]||{}):u[l]=d[l]),u),b),b}function m(d,p){return Object.keys(d).filter(u=>d[u]!=null).reduce((u,l)=>{if(p.has(l)){const P=p.get(l);if(typeof P=="string")u[P]=d[l];else{const I=P(l,d[l],d);Object.assign(u,I)}}else u[l]=d[l];return u},{})}function c(d,p,b=new Map){const u=a(d,p);return m(u,b)}function h(d){var b;const p=d.type;if(p){const u=t[p];if(!u)return d;const l=a(d,u),P=((b=d.editor)==null?void 0:b.type)||"";if(P){const I=t[P],M=a(d.editor,I);l.editor=M}return l}return d}function w(d){n=d}return{getSchemaByType:s,resolveSchemaWithDefaultValue:h,resolveSchemaToProps:c,mappingSchemaToProps:m,setDesignerContext:w}}const Ge={},Ye={},{getSchemaByType:Xe,resolveSchemaWithDefaultValue:$t,resolveSchemaToProps:Rt,mappingSchemaToProps:jt,setDesignerContext:go}=ze(Ge,Ye);function _t(t={}){function e(h,w,d,p){if(typeof d=="number")return p[h].length===d;if(typeof d=="object"){const b=Object.keys(d)[0],u=d[b];if(b==="not")return Number(p[h].length)!==Number(u);if(b==="moreThan")return Number(p[h].length)>=Number(u);if(b==="lessThan")return Number(p[h].length)<=Number(u)}return!1}function n(h,w,d,p){return p[h]&&p[h].propertyValue&&String(p[h].propertyValue.value)===String(d)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((h,w)=>(h.set(w,t[w]),h),o);function r(h,w){const d=h;return typeof w=="number"?[{target:d,operator:"length",param:null,value:Number(w)}]:typeof w=="boolean"?[{target:d,operator:"getProperty",param:h,value:!!w}]:typeof w=="object"?Object.keys(w).map(p=>{if(p==="length")return{target:d,operator:"length",param:null,value:w[p]};const b=p,u=w[p];return{target:d,operator:"getProperty",param:b,value:u}}):[]}function s(h){return Object.keys(h).reduce((d,p)=>{const b=r(p,h[p]);return d.push(...b),d},[])}function a(h,w){if(o.has(h.operator)){const d=o.get(h.operator);return d&&d(h.target,h.param,h.value,w)||!1}return!1}function m(h,w){return s(h).reduce((b,u)=>b&&a(u,w),!0)}function c(h,w){const d=Object.keys(h),p=d.includes("allOf"),b=d.includes("anyOf"),u=p||b,I=(u?h[u?p?"allOf":"anyOf":"allOf"]:[h]).map(O=>m(O,w));return p?!I.includes(!1):I.includes(!0)}return{parseValueSchema:c}}const Lt={convertTo:(t,e,n,o)=>{t.appearance||(t.appearance={}),t.appearance[e]=n},convertFrom:(t,e,n)=>t.appearance?t.appearance[e]:t[e]},qt={convertFrom:(t,e,n)=>t.buttons&&t.buttons.length?`共 ${t.buttons.length} 项`:"无"},Ut={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]},we={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:"多语输入框"}},Wt={convertFrom:(t,e,n)=>{var r;const o=t.editor&&t.editor[e]?t.editor[e]:t[e];return((r=we[o])==null?void 0:r.name)||o}},Ht={convertTo:(t,e,n,o)=>{t[e]=t[e]},convertFrom:(t,e,n)=>t.editor?n.getRealEditorType(t.editor.type):""},zt={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"}},Gt={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:""},Yt={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""}},Xt={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:""},Qt={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}}},Zt={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}}},Jt={convertTo:(t,e,n,o)=>{t.pagination||(t.pagination={}),t.pagination[e]=n},convertFrom:(t,e,n)=>t.pagination?t.pagination[e]:t[e]},Kt={convertTo:(t,e,n,o)=>{t.rowNumber||(t.rowNumber={}),t.rowNumber[e]=n},convertFrom:(t,e,n)=>t.rowNumber?t.rowNumber[e]:t[e]},en={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]}},tn={convertFrom:(t,e,n)=>t[e]&&t[e].length?`共 ${t[e].length} 项`:""},nn={convertFrom:(t,e)=>t[e]||"",convertTo:(t,e,n)=>{t[e]=n}},on={convertTo:(t,e,n,o)=>{t.size||(t.size={}),t.size[e]=n},convertFrom:(t,e,n)=>t.size?t.size[e]:t[e]},rn={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}},sn={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)}},an={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"}},ln={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 Qe(t,e,n){const o=new Map([["/converter/appearance.converter",Lt],["/converter/buttons.converter",qt],["/converter/property-editor.converter",Ut],["/converter/items-count.converter",tn],["/converter/type.converter",Wt],["/converter/change-editor.converter",Ht],["/converter/change-formatter.converter",zt],["/converter/column-command.converter",Gt],["/converter/column-option.converter",Yt],["/converter/summary.converter",Xt],["/converter/group.converter",Qt],["/converter/form-group-label.converter",nn],["/converter/field-selector.converter",Zt],["/converter/pagination.converter",Jt],["/converter/row-number.converter",Kt],["/converter/grid-selection.converter",en],["/converter/size.converter",on],["/converter/change-formatter-enum.converter",rn],["/converter/grid-sort.converter",sn],["/converter/grid-filter.converter",an],["/converter/row-option.converter",ln]]),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}]]),s=_t();function a(u,l){return()=>s.parseValueSchema(u,l)}function m(u,l,P){return u.includes("visible")&&l.visible!==void 0?typeof l.visible=="boolean"?()=>!!l.visible:l.visible===void 0?!0:a(l.visible,P):()=>!0}function c(u,l,P){return u.includes("readonly")&&l.readonly!==void 0?typeof l.readonly=="boolean"?()=>!!l.readonly:a(l.readonly,P):()=>!1}function h(u,l){const P=u.$converter||l;return typeof P=="string"&&P&&o.has(P)?o.get(P)||null:P||null}function w(u,l,P,I,M,O="",N=""){return Object.keys(u).map(F=>{const E=i.ref(1),g=F,V=u[F],S=Object.keys(V),C=V.title,v=V.type,f=r.get(v)||{type:"input-group",enableClear:!1},y=V.editor?Object.assign({},f,V.editor):Object.assign({},f),k=m(S,V,l),x=c(S,V,l);y.readonly=y.readonly===void 0?x():y.readonly;const B=V.type==="cascade"?w(V.properties,l,P,I,M,O,N):[],j=!0;let _=h(V,N);const L=i.computed({get(){if(E.value){if(["class","style"].find(A=>A===g)&&!_&&(_=o.get("/converter/appearance.converter")||null),_&&_.convertFrom)return _.convertFrom(P,F,M,O);const te=P[F];return Object.prototype.hasOwnProperty.call(V,"defaultValue")&&(te===void 0||typeof te=="string"&&te==="")?V.type==="boolean"?V.defaultValue:V.defaultValue||"":te}return null},set(te){E.value+=1,_&&_.convertTo?(_.convertTo(I,F,te,M,O),_.convertTo(P,F,te,M,O)):(I[F]=te,P[F]=te)}}),{refreshPanelAfterChanged:q,description:Q,isExpand:Y,parentPropertyID:Z}=V,H={propertyID:g,propertyName:C,propertyType:v,propertyValue:L,editor:y,visible:k,readonly:x,cascadeConfig:B,hideCascadeTitle:j,refreshPanelAfterChanged:q,description:Q,isExpand:Y,parentPropertyID:Z};return l[g]=H,H})}function d(u,l,P={}){const I={},M=t[u];return M&&M.categories?Object.keys(M.categories).map(N=>{const T=M.categories[N],F=T==null?void 0:T.title,E=w(T.properties||{},I,{},P,l);return{categoryId:N,categoryName:F,properties:E}}):[]}function p(u,l,P,I,M=""){const O=l.$ref.schema,N=l.$ref.converter,T=P[O],F=T.type,E=n(T),g={},V=t[F];if(V&&V.categories){const S=V.categories[u],C=S==null?void 0:S.title;N&&Object.keys(S.properties).forEach(y=>{S.properties[y].$converter=N});const v=(S==null?void 0:S.properties)||{},f=w(v,g,E,T,I,M);return{categoryId:u,categoryName:C,properties:f}}return{categoryId:u,categoryName:"",properties:[]}}function b(u,l,P,I,M){const O=u.type,N=n(u),T={};let F=M||t[O];if(F&&Object.keys(F).length===0&&P&&P.getPropConfig&&(F=P.getPropConfig(I)),F&&F.categories){const E=[];return Object.keys(F.categories).map(g=>{const V=F.categories[g];if(V.$ref){E.push(p(g,V,u,l,I));return}const S=V==null?void 0:V.title,C=V==null?void 0:V.tabId,v=V==null?void 0:V.tabName,f=V==null?void 0:V.hide,y=V==null?void 0:V.hideTitle,k=w(V.properties||{},T,N,u,l,I,V.$converter),{setPropertyRelates:x}=V,B=V==null?void 0:V.parentPropertyID;E.push({categoryId:g,categoryName:S,tabId:C,tabName:v,hide:f,properties:k,hideTitle:y,setPropertyRelates:x,parentPropertyID:B})}),E}return[]}return{getPropertyConfigBySchema:b,getPropertyConfigByType:d,propertyConverterMap:o}}const Ze={},Je={};Qe(Ze,Je,$t);const Ke={},et={},{getSchemaByType:cn,resolveSchemaWithDefaultValue:dn,resolveSchemaToProps:mo,mappingSchemaToProps:ho,setDesignerContext:bo}=ze(Ke,et),tt={},nt={};Qe(tt,nt,dn);function Se(t,e,n=new Map,o=(a,m,c,h)=>m,r={},s=a=>a){return Ge[e.title]=e,Ye[e.title]=o,Ze[e.title]=r,Je[e.title]=s,Ke[e.title]=e,et[e.title]=o,tt[e.title]=r,nt[e.title]=s,(a={},m=!0)=>{if(!m)return jt(a,n);const c=Rt(a,e,n),h=Object.keys(t).reduce((w,d)=>(w[d]=t[d].default,w),{});return Object.assign(h,c)}}function ot(t,e){return{customClass:e.class,customStyle:e.style}}function un(t,e){var o,r;const n={};if(e!=null&&e.buttons){const s=[];(o=e==null?void 0:e.buttons)==null||o.map(a=>{const m={};Object.keys(a).map(c=>{var h;c==="appearance"?m.class=((h=a[c])==null?void 0:h.class)||"":m[c]=a[c]}),s.push(m)}),n.buttons=s}return(r=e==null?void 0:e.appearance)!=null&&r.class&&(n.buttonClass=e.appearance.class||"col-6"),e!=null&&e.id&&(n.toolbarId=e.id),e&&Object.prototype.hasOwnProperty.call(e,"visible")&&(n.buttonsVisible=e.visible),n}function rt(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 fn(){function t(e,n){var m;const o=(m=e.toolbar)==null?void 0:m.buttons;if(!o||o.length<1)return null;const[r,s]=n.payloads,a=rt(o,s);return a?a.onClick||a.click:null}return{resolve:t}}function pn(){function t(e,n){const o=e.buttons;if(!o||o.length<1)return null;const[r,s]=n.payloads,a=rt(o,s);return a?a.onClick||a.click:null}return{resolve:t}}const it=new Map([["appearance",ot],["toolbar",un]]),st={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/page-header.schema.json",title:"page-header",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Page Header",type:"string"},type:{description:"The type string of Page Header component",type:"string",default:"page-header"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},showIcon:{description:"",type:"boolean",default:!0},icon:{description:"",type:"string",default:"f-icon-page-title-record"},iconClass:{description:"",type:"string",default:"f-text-orna-bill"},title:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},toolbar:{description:"",type:"object",properties:{appearance:{description:"",type:"object",properties:{class:{type:"string",default:"col-6"}}},id:{description:"",type:"string"},type:{description:"",type:"string",default:"response-toolbar"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0}}},titleContentClass:{description:"",type:"string",default:""},contentClass:{description:"",type:"string",default:""},downContentClass:{description:"",type:"string",default:""},showPagination:{description:"",type:"boolean",default:!1},prePaginationDisabled:{description:"",type:"boolean",default:!0},nextPaginationDisabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},titleContentHtml:{description:"",type:"string",default:""},titleRenderFunction:{description:"",type:"function",default:null},contentHtml:{description:"",type:"string",default:""},contentRenderFunction:{description:"",type:"function",default:null},downContentHtml:{description:"",type:"string",default:""},downContentRenderFunction:{description:"",type:"function",default:null}},required:["id","type"]};function at(t,e,n){return e.title="标题",e}const Pe={customClass:{type:String,default:""},showIcon:{type:Boolean,default:!0},icon:{type:String,default:"f-icon-page-title-record"},iconClass:{type:String,default:"f-text-orna-bill"},title:{type:String,default:""},subTitle:{type:String,default:""},buttonClass:{type:String,default:"col-6"},toolbarId:{type:String,default:""},buttons:{type:Array,default:[]},titleContentClass:{type:String,default:""},contentClass:{type:String,default:""},downContentClass:{type:String,default:""},showPagination:{type:Boolean,default:!1},prePaginationDisabled:{type:Boolean,default:!0},nextPaginationDisabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},buttonsVisible:{type:Boolean,default:!0},titleRenderFunction:{type:Function},contentRenderFunction:{type:Function},downContentRenderFunction:{type:Function}},Ve=Object.assign({},Pe,{componentId:{type:String,default:""},titleContentHtml:{type:String,default:""},contentHtml:{type:String,default:""},downContentHtml:{type:String,default:""}}),lt=Se(Pe,st,it,at),ct=Se(Ve,st,it,at),dt=fn(),Ee=i.defineComponent({name:"FPageHeader",props:Pe,emits:["click","prePaginationClick","nextPaginationClick"],setup(t,e){const n=i.ref(t.buttons),o=(M,O)=>{e.emit("click",M,O)},r=i.computed(()=>{const M={"f-page-header":!0,"d-none":!t.visible};return ee.getCustomClass(M,t.customClass)}),s=i.computed(()=>{const M={"f-title-icon":!0};return ee.getCustomClass(M,t.iconClass)}),a=i.computed(()=>{const M={"f-icon":!0};return ee.getCustomClass(M,t.icon)}),m=i.computed(()=>{const M={"f-title":!0};return ee.getCustomClass(M,t.titleContentClass)}),c=i.computed(()=>{const M={"f-content":!0};return ee.getCustomClass(M,t.contentClass)}),h=i.computed(()=>{const M={"f-page-header-extend":!0};return ee.getCustomClass(M,t.downContentClass)}),w=i.computed(()=>({"f-icon f-icon-arrow-w":!0,"f-state-disabled":t.prePaginationDisabled})),d=i.computed(()=>({"f-icon f-icon-arrow-e":!0,"f-state-disabled":t.nextPaginationDisabled}));function p(M){t.prePaginationDisabled||e.emit("prePaginationClick",M)}function b(M){t.nextPaginationDisabled||e.emit("nextPaginationClick",M)}function u(){return e.slots.titleContent?i.createVNode("div",{class:m.value},[i.createTextVNode(" "),e.slots.titleContent()]):t.titleRenderFunction?i.createVNode("div",{class:m.value},[t.titleRenderFunction()]):i.createVNode("div",{class:"f-title"},[t.showIcon&&t.icon?i.createVNode("span",{class:s.value},[i.createVNode("i",{class:a.value},null)]):"",i.createVNode("h4",{class:"f-title-text"},[t.title]),t.subTitle?i.createVNode("h5",{class:"f-title-subtitle"},[t.subTitle]):"",t.showPagination?i.createVNode("div",{class:"f-title-pagination"},[i.createVNode("span",{class:w.value,onClick:p},null),i.createVNode("span",{class:d.value,onClick:b},null)]):""])}function l(){return e.slots.content?i.createVNode("div",{class:c.value},[i.createTextVNode(" "),e.slots.content()]):t.contentRenderFunction?i.createVNode("div",{class:c.value},[t.contentRenderFunction()]):null}function P(){if(t.buttons&&t.buttons.length>0)return i.createVNode(Ot,{id:t.toolbarId,customClass:t.buttonClass,visible:t.buttonsVisible,items:n.value,onClick:o},null)}function I(){return e.slots.downContent?i.createVNode("div",{class:h.value},[i.createTextVNode(" "),e.slots.downContent()]):t.downContentRenderFunction?i.createVNode("div",{class:h.value},[t.downContentRenderFunction()]):null}return i.watch(()=>t.buttons,M=>{n.value=M},{deep:!0}),()=>t.visible?i.createVNode("div",{class:r.value},[i.createVNode("nav",{class:"f-page-header-base"},[u(),l(),P()]),I()]):null}});function gn(t,e,n){var C;const o=n&&n.getStyles&&n.getStyles()||"",r=n&&n.getDesignerClass&&n.getDesignerClass()||"",s=i.ref();let a;function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function c(){return!1}function h(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function w(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function d(v){if(!v||!v.value)return null;if(v.value.schema&&v.value.schema.type==="component")return v.value;const f=i.ref(v==null?void 0:v.value.parent),y=d(f);return y||null}function p(v=e){var x;if(n!=null&&n.getDraggableDesignItemElement)return n.getDraggableDesignItemElement(v);const{componentInstance:f,designerItemElementRef:y}=v;if(!f||!f.value)return null;const{getCustomButtons:k}=f.value;return f.value.canMove||k&&((x=k())!=null&&x.length)?y:p(v.parent)}function b(v){return!!n&&n.canAccepts(v)}function u(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function l(){}function P(v,f){var y;!v||!f||(n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(v,f),(y=e==null?void 0:e.setupContext)==null||y.emit("dragEnd"))}function I(v,f){const{componentType:y}=v;let k=We.getSchemaByTypeForDesigner(y,v,f);n&&n.onResolveNewComponentSchema&&(k=n.onResolveNewComponentSchema(v,k));const x=y.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===y&&(k.id=`${x}_${Math.random().toString().slice(2,6)}`),k}function M(v){v&&n!=null&&n.onChildElementMovedOut&&n.onChildElementMovedOut(v)}function O(...v){if(n&&n.getPropsConfig)return n.getPropsConfig(...v)}function N(v){if(!v)return;const f=e==null?void 0:e.schema,{formSchemaUtils:y}=v;if(f&&y.getExpressions().length){const k=y.getExpressions().findIndex(x=>x.target===f.id);k>-1&&y.getExpressions().splice(k,1)}}function T(v){if(!v||!(e!=null&&e.schema))return;const f=e.schema,{formSchemaUtils:y}=v;y.removeCommunicationInComponent(f)}function F(v){n&&n.onRemoveComponent&&n.onRemoveComponent(),N(v),T(v),e!=null&&e.schema.contents&&e.schema.contents.map(f=>{let y=f.id;f.type==="component-ref"&&(y=f.component);const k=t.value.querySelectorAll(`#${y}-design-item`);k!=null&&k.length&&Array.from(k).map(x=>{var B;(B=x==null?void 0:x.componentInstance)!=null&&B.value.onRemoveComponent&&x.componentInstance.value.onRemoveComponent(v)})})}function E(){if(n&&n.getCustomButtons)return n.getCustomButtons()}function g(v){var y,k;if(!((y=e==null?void 0:e.schema)!=null&&y.id))return;if(!a&&v&&(a=v.formSchemaUtils),n!=null&&n.setComponentBasicInfoMap){n.setComponentBasicInfoMap();return}let f="";if(n!=null&&n.getComponentTitle)f=n.getComponentTitle();else{const{text:x,title:B,label:j,mainTitle:_,name:L,type:q}=e.schema;f=x||B||j||_||L||((k=we[q])==null?void 0:k.name)}f&&a.getControlBasicInfoMap().set(e.schema.id,{componentTitle:f,parentPathName:f})}function V(v){var x;const{changeObject:f}=v,{propertyID:y,propertyValue:k}=f;if(["text","title","label","name","mainTitle"].includes((x=v==null?void 0:v.changeObject)==null?void 0:x.propertyID)&&y&&k&&(g(),a)){const B=a.getControlBasicInfoMap(),j=B.keys().toArray().filter(_=>{var L,q;return((L=B.get(_))==null?void 0:L.reliedComponentId)===((q=e==null?void 0:e.schema)==null?void 0:q.id)});j!=null&&j.length&&j.forEach(_=>{const L=B.get(_).parentPathName.split(" > ");L[0]=k,B.get(_).parentPathName=L.join(" > ")})}}function S(v){if(V(v),n&&n.onPropertyChanged)return n.onPropertyChanged(v)}return s.value={canMove:m(),canSelectParent:c(),canDelete:h(),canNested:!w(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(C=e==null?void 0:e.parent)==null?void 0:C.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:b,getBelongedComponentInstance:d,getDraggableDesignItemElement:p,getDraggingDisplayText:u,getPropConfig:O,getDragScopeElement:l,onAcceptMovedChildElement:P,onChildElementMovedOut:M,addNewChildComponentSchema:I,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||i.ref(!1),onRemoveComponent:F,getCustomButtons:E,onPropertyChanged:S,setComponentBasicInfoMap:g,updateContextSchema:e==null?void 0:e.updateContextSchema},s}const mn=i.ref(0);function hn(){mn.value++}const Ce=i.ref(0);function bn(t,e){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top>=n.top,s=o.top<=n.bottom;return r&&s}function ut(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 s=n.left-r.width;const a=document.querySelector(".editorDiv");if(a){const m=a.getBoundingClientRect();s<m.left&&({left:s}=t.getBoundingClientRect())}o.style.left=s+"px"}}}function vn(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 ft(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=vn(t);if(r&&(o=bn(t,r)),!o){n.style.display="none";return}ut(t)}}function yn(t){if(!t)return;let e;t.className.includes("dgComponentSelected")?e=t:e=t.querySelector(".dgComponentSelected"),e&&ft(e)}function Cn(t){const{formSchemaUtils:e,formStateMachineUtils:n}=t;function o(c,h=""){return{path:h+c.code,field:c.id,fullPath:c.code}}function r(c,h=""){return e.getViewModelById(c).states.map(d=>o(d,h))}function s(c){const h=e.getRootViewModelId(),w=r(c);if(c===h)return w;const d=r(h,"root-component.");return[...w,...d]}function a(c){return c.binding&&c.binding.path||c.id||""}function m(){return n&&n.getRenderStates()||[]}return{getVariables:s,getControlName:a,getStateMachines:m}}class wn{constructor(e){G(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'"}]);G(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});G(this,"getExpressionConverter",(e,n)=>({convertFrom:(o,r,s,a)=>{const m=s.getExpressionRuleValue(e,n||r);return m&&m.value||""},convertTo:(o,r,s,a,m)=>{var c;if(r==="dataPicking"&&(s!=null&&s.target)){const h=`${s.target}_dataPicking`;((c=s.rules)==null?void 0:c.some(d=>d.id===h&&d.value))?o.dictPickingExpressionId=h:delete o.dictPickingExpressionId}a.updateExpression(s)}}));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 s=r.rules.find(a=>a.type===n);return s||""}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(s=>{r.push({key:s.code,name:s.name,description:s.name,category:s.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 m;const s=this.createTreeNode(r,n);let a=[];(m=r.type)!=null&&m.fields&&(a=this.buildEntityFieldsTreeData(r.type.fields,[...n,r.label])),o.push({data:s,children:a,expanded:!0})}),o}buildChildEntityTreeData(e=null,n){const o=[];return e==null||e.forEach(r=>{var c,h;const s=this.createTreeNode(r,n);s.type="entity";const a=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...n,r.label]),m=this.buildChildEntityTreeData((h=r.type)==null?void 0:h.entities,[...n,r.label]);m!=null&&m.length&&(a==null||a.push(...m)),o.push({data:s,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,s=this.getExpressionRule(r,n),a=this.getEntitiesAndVariables(),m={message:["validate","required","dataPicking"].includes(n)&&s?s.message:"",...a};return s.messageType!=null&&(m.messageType=s.messageType),m}buildRule(e,n,o,r){const{expression:s,message:a,messageType:m}=n,c={id:`${e}_${o}`,type:o,value:s};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=a),o==="dataPicking"&&(c.messageType=m),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:e}=this.formSchemaService.getFormSchema().module;return e||[]}updateExpression(e,n,o,r){const s=n==="Field"?e.binding.field:e.id,a=this.buildRule(s,o,r,e.type==="form-group"?e.id:"");let c=this.getExpressionData().find(w=>w.targetType===n&&w.target===s);const h=w=>w.value.trim()==="";if(c){const w=c.rules.find(d=>d.id===a.id);if(w)h(a)?c.rules=c.rules.filter(d=>d.id!==a.id):(Object.assign(w,a),r==="validate"&&e.type==="form-group"&&(w.elementId=e.id));else{if(h(a))return null;c.rules=c.rules||[],c.rules.push(a)}}else{if(h(a))return null;c={target:`${s}`,rules:[a],targetType:n}}return c}getExpressionEditorOptions(e,n,o,r){return o.reduce((s,a)=>{var c,h;const m=n==="Field"?(c=e==null?void 0:e.binding)==null?void 0:c.field:e.id;return s[a]={hide:n==="Field"?!!((h=e==null?void 0:e.binding)!=null&&h.field):!1,description:"",title:this.expressionNames[a],type:"string",$converter:this.getExpressionConverter(m),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:w=>{const d=this.updateExpression(e,n,w,a);if(r){const p=this.buildRule(m,w,a);r(p)}return d}}},s},{})}getExpressionInfo(e,n,o){const r=n==="Field"?e.binding.field:e.id,s=this.getExpressionRule(r,o),a={value:s&&s.value,targetId:r,targetType:n,expressionType:o};return s&&s.message&&(a.message=s.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 De{constructor(e,n){G(this,"componentId");G(this,"viewModelId");G(this,"eventsEditorUtils");G(this,"formSchemaUtils");G(this,"formMetadataConverter");G(this,"designViewModelUtils");G(this,"designViewModelField");G(this,"controlCreatorUtils");G(this,"designerHostService");G(this,"designerContext");G(this,"schemaService",null);G(this,"metadataService",null);G(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(s=>s.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:we[e.type]&&we[e.type].name}]}}}}}getAppearanceConfig(e=null,n={},o){const r={title:"外观",description:"Appearance"},s={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)s[a]=Object.assign(s[a]||{},n[a]);return{...r,properties:{...s},setPropertyRelates(a,m){if(a){switch(a&&a.propertyID){case"class":case"style":{Ce.value++;break}}o&&o(a,e,m)}}}}getPropertyEditorParams(e,n=[],o="visible",r={},s={},a=""){const{getVariables:m,getControlName:c,getStateMachines:h}=Cn(this.designerHostService),w=this.getRealTargetType(e),d=n&&n.length>0?n:["Const","Variable","StateMachine","Expression"],p={type:"property-editor",propertyTypes:d};return d.map(b=>{switch(b){case"Const":Object.assign(p,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":p.expressionConfig=this.getExpressionOptions(e,w,a||o);break;case"StateMachine":p.stateMachines=h();break;case"Variable":Object.assign(p,{controlName:c(e),newVariablePrefix:"is",newVariableType:"Boolean",variables:m(this.viewModelId),onBeforeOpenVariables:u=>{u.value=m(this.viewModelId)}},s);break}}),p}getVisibleProperty(e,n=""){var s;let o=["Const","Variable","StateMachine","Expression"];return n==="gridFieldEditor"?o=["Const","Expression"]:n==="form-group"&&!((s=e.binding)!=null&&s.field)&&(o=["Const","Variable","StateMachine"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(e,o,"visible")}}}getBehaviorConfig(e,n="",o={},r){const s={title:"行为",description:""},a=this.getVisibleProperty(e,n);for(const c in o)a[c]=Object.assign(a[c]||{},o[c]);const m=this;return{...s,properties:{...a},setPropertyRelates(c,h){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":m.afterMutilEditorChanged(e,c);break}r&&r(c,h)}}}}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),s=de.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,s),hn()}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:s,expressionInfo:a}=n,{targetId:m,targetType:c,expressionType:h,value:w,message:d}=a,p=this.formSchemaUtils.getModule();p.expressions=p.expressions||[];const{expressions:b}=p;let u=b.find(P=>P.target===m);u||(u={target:m,rules:[],targetType:c},b.push(u));const l=u.rules.find(P=>P.type===h);if(l)l.value=w,l.message=d;else{const P={id:s,type:h,value:w,message:d};u.rules.push(P)}delete n.expressionInfo}clearExpression(e,n){const o=e.propertyValue;if(o&&o.type==="Expression")return;const s=e.propertyID,a=this.formSchemaUtils.getExpressions(),m=n.binding?n.binding.field:n.id,c=a.find(h=>h.target===m);!c||!c.rules||(c.rules=c.rules.filter(h=>h.type!==s))}getExpressionOptions(e,n,o){return new wn(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 xn extends De{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e),this.propertyConfig.categories.template=this.getTemplateConfig(e),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e),this.propertyConfig}getAppearanceProperties(e){return{title:"外观",description:"",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式"},icon:{title:"图标",type:"string",description:"图标"},title:{title:"标题",type:"string",description:"标题"}},setPropertyRelates(n,o){if(n)switch(n&&n.propertyID){case"title":{n.needRefreshControlTree=!0;break}}}}}getTemplateConfig(e){return{title:"模板配置",description:"",properties:{titleContentClass:{title:"标题模板class",type:"string",description:"标题模板外层容器的自定义样式"},titleContentHtml:{title:"标题模板",type:"string",description:"设置标题HTML模板,替代图标和标题文字区域",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}},contentClass:{title:"内容模板class",type:"string",description:"内容模板外层容器的自定义样式"},contentHtml:{title:"内容模板",type:"string",description:"设置页头中间区域的模板",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}},downContentClass:{title:"扩展模板class",type:"string",description:"扩展模板外层容器的自定义样式"},downContentHtml:{title:"扩展模板",type:"string",description:"设置页头下方区域的模板",refreshPanelAfterChanged:!0,editor:{type:"code-editor",language:"html"}}}}}}function Tn(t,e){function n(m){return!1}function o(){return!1}function r(){return!1}function s(){return!0}function a(m){return new xn(m,e).getPropertyConfig(t)}return{canAccepts:n,hideNestedPaddingInDesginerView:s,getPropsConfig:a,checkCanDeleteComponent:o,checkCanMoveComponent:r}}class pt{constructor(e){G(this,"id","");G(this,"class","btn-secondary");G(this,"icon","");G(this,"groupId","");G(this,"order",-1);G(this,"asDropDownTop",!1);G(this,"text","");G(this,"visible",!0);G(this,"shown",!0);G(this,"responsed",!1);G(this,"tipsEnable",!1);G(this,"tipsText","");G(this,"width",0);G(this,"dropdownClass","");G(this,"onClick",()=>{});G(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(s=>n.indexOf(s)>-1).forEach(s=>{s==="visible"?this[s]=e[s]===void 0?!0:e[s]:this[s]=e[s]}),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:i.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class Sn extends pt{constructor(e){super(e)}}function gt(){function t(e){const n=[];return e.reduce((o,r)=>(r.children&&r.children.length>0?o.push(new Me(r)):o.push(new Sn(r)),o),n),n}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:Pn}=gt();class Me extends pt{constructor(n){super(n);G(this,"placement","");G(this,"visible",!0);G(this,"dropdownClass","");G(this,"menuClass","");G(this,"split",!1);G(this,"children",[]);G(this,"expanded",!1);G(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=Pn(n.children))}}const En=new Map([["buttons","items"],["appearance",ot]]);function mt(t,e,n){return e}const Dn={$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:"点击事件"}},Mn={$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:"点击事件"}},Be={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0}},kn=Object.assign({},Be,{componentId:{type:String,default:""}}),Ie=Se(Be,Dn,En,mt),ht={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}},Nn=Se(ht,Mn,void 0,mt),Vn=pn();function Fe(){function t(n){const o={"f-icon":!0};if(n.icon){const r=n.icon.trim().split(" ");r&&r.length&&r.reduce((s,a)=>(s[a]=!0,s),o)}return o}function e(n){return!!(n.icon&&n.icon.trim())}return{iconClass:t,shouldShowIcon:e}}function Bn(t,e){function n(E){const g={"dropdown-menu":!0};return ee.getCustomClass(g,E.menuClass)}function o(E){const g={disabled:!E.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return ee.getCustomClass(g,E.dropdownClass)}function r(E){const g={disabled:!E.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return ee.getCustomClass(g,E.dropdownClass)}function s(E){const g={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 ee.getCustomClass(g,E.dropdownClass)}function a(E){const g={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(E.icon&&E.icon.trim()),"d-block":!0};return ee.getCustomClass(g,E.dropdownClass)}let m;const c=new Map;let h="";function w(E){h="#"+E}function d(E,g,V){E.stopPropagation();const S=V?V.id:"__top_item__";if(g.children&&g.children.length&&(g.expanded=!g.expanded,g.expanded)){if(c.has(S)&&c.get(S)!==g){const C=c.get(S);C&&(C.expanded=!1,c.delete(S))}c.set(S,g)}}function p(E,g){document.body.click(),g.enable&&(E.stopPropagation(),typeof g.onClick=="function"&&g.onClick(E,g.id),t.emit("click",E,g.id))}function b(E,g){const V=E.target;V.className.indexOf("dropdown-item")<0||(V.title=V.scrollWidth>V.clientWidth?g:"")}function u(E,g,V){if(g.tipsEnable&&g.tipsText){const S=i.reactive({content:g.tipsText,enable:g.tipsEnable});return i.withDirectives(i.createVNode("li",{class:r(g),id:g.id,key:g.id+"_"+V,onClick:C=>p(C,g)},[i.createVNode("span",{class:a(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text])]),[[i.resolveDirective("tooltip"),S]])}return i.createVNode("li",{class:r(g),id:g.id,onClick:S=>p(S,g)},[i.createVNode("span",{class:a(g),onMouseenter:S=>b(S,g.text)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text])])}function l(E,g,V){g.enable&&(typeof g.onClick=="function"&&V.onClick(E,g.id),t.emit("click",E,g.id),V.split||d(E,g,V))}function P(E,g,V){E&&E.stopPropagation(),d(E,g,V)}function I(E,g){E.stopPropagation();const V=g.id;if(g.children&&g.children.length&&g.expanded&&c.has(V)){const S=c.get(V);S&&(S.expanded=!1,c.delete(V))}}function M(E,g,V){if(g.tipsEnable&&g.tipsText){const S=i.reactive({content:g.tipsText,enable:g.tipsEnable});return i.createVNode("li",{class:o(g),id:g.id,key:g.id+"_"+V,onClick:C=>l(C,g,E)},[i.withDirectives(i.createVNode("span",{class:s(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text]),[[i.resolveDirective("tooltip"),S]]),g.split&&i.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:C=>P(C,g,E)},null),m(g,g)])}return i.createVNode("li",{class:o(g),id:g.id,onClick:S=>l(S,g,E),onMouseenter:S=>b(S,g.text)},[i.createVNode("span",{class:s(g)},[e.shouldShowIcon(g)&&i.createVNode("i",{class:e.iconClass(g)},null),g.text]),g.split&&i.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:S=>P(S,g,E)},null),m(g,g)])}function O(E){return E.children.filter(g=>g.visible).map((g,V)=>g.children&&g.children.length?M(E,g,V):u(E,g,V))}function N(E,g){if(!E)return 1080;let V=-1;const S=E.children.length;for(let C=0;C<S;C++)if(E.children[C].id===g){V=C;break}return 1080+S-V}function T(E,g,V){var B,j;const S={display:E.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},C=document.querySelector(h);if(!C)return S;const v=i.getCurrentInstance();let f=(j=(B=v==null?void 0:v.exposed)==null?void 0:B.elementRef.value)==null?void 0:j.querySelector("#"+g);if(f||(f=C==null?void 0:C.querySelector("#"+g)),!f)return S;const y=window.innerWidth,k=window.innerHeight,x=f==null?void 0:f.getClientRects();if(f&&x&&x.length){const{top:_,width:L,left:q,right:Q,height:Y}=x[0],Z=Math.ceil(Y+_);S.top=`${Z}px`,S.left=`${q}px`;const H=E.id+"_menu",te=(f==null?void 0:f.querySelector("#"+H))||(C==null?void 0:C.querySelector("#"+H))||null;if(te){te.style.visibility="hidden",te.style.display="block";const A=te.offsetHeight;S.zIndex=E.expanded?N(C,H):1080,S.display==="block"&&(te.style.display="block");const W=te.getBoundingClientRect();if(V){S.top=`${_-6}px`;const $=Math.ceil(L+q);S.left=`${$}px`}y-q-L<W.width&&(S.left=`${(V?q:Q)-W.width}px`),k-_-Y<A?_>A?(S.top=`${_-A-6}px`,S.maxHeight=`${_-16}px`):(S.maxHeight=`${k-Z}px`,_>k-_-Y&&(S.top="10px",S.maxHeight=`${_-16}px`)):S.maxHeight=`${k-Z}px`,te.style.visibility="visible"}}return S}m=function(E,g){const V=g?g.id:E.id;return i.createVNode(i.Teleport,{to:h,disabled:!E.expanded},{default:()=>[i.createVNode("ul",{class:n(E),style:T(E,V,g),id:E.id+"_menu",onWheel:S=>I(S,E)},[O(E)])]})};function F(){c.forEach(E=>{E.expanded=!1}),c.clear()}return{renderDropdownMenu:m,clearAllDropDownMenu:F,updateContainerId:w}}function In(t,e,n){const o=i.ref(t.alignment),{renderDropdownMenu:r,clearAllDropDownMenu:s,updateContainerId:a}=Bn(e,n);function m(l){const P={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right"||o.value==="center","f-btn-mr":o.value==="left"};return ee.getCustomClass(P,l.dropdownClass)}function c(l){const P={btn:!0,disabled:!l.enable,"f-rt-btn":!0,"btn-icontext":!!(l.icon&&l.icon.trim()),"f-rt-toggle":!l.split,"dropdown-toggle":!l.split};return ee.getCustomClass(P,l.class)}function h(l){const P={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return ee.getCustomClass(P,l.class)}function w(l){return l.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function d(l,P){l.stopPropagation();const I=P.expanded;document.body.click(),typeof P.onClick=="function"&&P.onClick(l,P.id),e.emit("click",l,P.id),P.split||(P.expanded=!I)}function p(l,P){l.stopPropagation();const I=P.expanded;document.body.click(),P.expanded=!I}function b(l,P=!0){if(l.tipsEnable&&l.tipsText){const I=i.reactive({content:l.tipsText,enable:l.tipsEnable});return i.createVNode("div",{id:l.id,class:m(l)},[i.withDirectives(i.createVNode("div",{class:c(l),style:w(l),onClick:M=>l.enable&&d(M,l)},[n.shouldShowIcon(l)&&i.createVNode("i",{class:n.iconClass(l)},null),i.createVNode("span",null,[l.text])]),[[i.resolveDirective("tooltip"),I]]),l.split&&i.createVNode("button",{class:h(l),style:"border-radius:0 6px 6px 0;",onClick:M=>p(M,l)},null),P&&r(l)])}return i.createVNode("div",{id:l.id,class:m(l)},[i.createVNode("div",{class:c(l),style:w(l),onClick:I=>l.enable&&d(I,l)},[n.shouldShowIcon(l)&&i.createVNode("i",{class:n.iconClass(l)},null),i.createVNode("span",null,[l.text])]),l.split&&i.createVNode("button",{class:h(l),style:"border-radius:0 6px 6px 0;",onClick:I=>p(I,l)},null),P&&r(l)])}function u(){s()}return{renderToolbarDropdown:b,clearAllDropDown:u,updateContainerId:a}}const{buildResponseToolbarItems:bt}=gt(),ke=i.defineComponent({name:"FResponseToolbar",props:Be,emits:["click"],setup(t,e){const{t:n}=At.useI18n(),o=i.ref(bt(t.items)),r=i.ref(),s=i.ref(),a=i.ref(),m={id:"__more_buttons__",text:n("responseToolbar.more")},c=i.ref(new Me(m)),h={id:m.id+"width",text:m.text},w=i.ref(-1),d=Fe();let p=!1;const{guid:b,uuid:u}=ee.useGuid(),l=t.id?t.id:"toolbar-"+b(),P=i.ref(),I="dropdown-container-"+l+"-"+u(4),{renderToolbarDropdown:M,clearAllDropDown:O,updateContainerId:N}=In(t,e,d);N(I);const T=i.computed(()=>c.value.children.length>0),F=i.computed(()=>t.visible?c.value.children.length>0?!0:o.value.findIndex(A=>A.shown&&A.children&&A.children.length>0)>-1:!1);function E(){t.visible&&!P.value&&document&&(P.value=document.createElement("div"),P.value.id=I,document.body.appendChild(P.value))}E();function g(){P.value&&document.body.contains(P.value)&&(document.body.removeChild(P.value),P.value=null)}i.watch(F,(A,W)=>{A?E():g()});const V=i.computed(()=>{const A={"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 ee.getCustomClass(A,t.customClass)}),S=i.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 C(A){A&&A.target.closest("ul.dropdown-menu")&&A.type==="wheel"||(o.value.filter(W=>W.children&&W.children.length>0).forEach(W=>{W.expanded=!1}),c.value.expanded=!1,O())}function v(A,W){var se;const $={btn:!0,"f-rt-btn":!0,"f-btn-ml":t.alignment==="right"||W>0&&t.alignment==="center","f-btn-mr":t.alignment==="left","btn-icontext":!!(A.icon&&A.icon.trim())},X=((se=A==null?void 0:A.appearance)==null?void 0:se.class)||A.class||"btn-secondary";return ee.getCustomClass($,X)}function f(A,W){document.body.click(),typeof W.onClick=="function"&&W.onClick(A,W.id),e.emit("click",A,W.id)}function y(A,W){if(A.tipsEnable&&A.tipsText){const $=i.reactive({content:A.tipsText,enable:A.tipsEnable});return i.withDirectives(i.createVNode("button",{type:"button",class:v(A,W),id:A.id,disabled:!A.enable,onClick:X=>f(X,A)},[d.shouldShowIcon(A)&&i.createVNode("i",{class:d.iconClass(A)},null),A.text]),[[i.resolveDirective("tooltip"),$]])}return i.createVNode("button",{type:"button",class:v(A,W),id:A.id,disabled:!A.enable,onClick:$=>f($,A)},[d.shouldShowIcon(A)&&i.createVNode("i",{class:d.iconClass(A)},null),A.text])}let k=new Map,x=[];function B(A){const W=Math.ceil(parseFloat(getComputedStyle(A).getPropertyValue("margin-left"))),$=Math.ceil(parseFloat(getComputedStyle(A).getPropertyValue("margin-right")));return(W||0)+A.getBoundingClientRect().width+($||0)}function j(A,W,$){if(W<w.value){let X=$-1;for(;X>=0;X--){const se=A[X],ie=B(se);if(W+=ie,W>=w.value)break}$=X}return W-=w.value,$=$<0?0:$,{start:$,space:W}}function _(A){const W=a.value;let $=A;const se=Array.from(W.children).filter(le=>le.id!=="__more_buttons__"),ie=se.length;let re=!1,oe=0;for(;oe<ie;oe++){const le=se[oe],ve=B(le);if(ve<=$)$-=ve;else{const ye=j(se,$,oe);oe=ye.start,$=ye.space,re=!0;break}}if(!re&&x.length>0){const le=j(se,$,oe);oe=le.start,$=le.space}const xe=x.length>0;for(;oe<ie;oe++){const le=se[oe],ve=B(le);k.set(le.id,!0);const ye=x.find(Te=>Te.id===le.id);ye?ye.width=ve:x[xe?"unshift":"push"]({id:le.id,width:ve})}return $}function L(A){let W=_(A);if(x.length){let ie=0;for(;ie<x.length;ie++){const re=t.items.find(oe=>oe.id===x[ie].id);if(re&&re.visible!==!1){const oe=x[ie].width;if(W>=oe||ie===x.length-1&&W+w.value>=oe)W-=oe;else break}}for(let re=0;re<ie;re++)k.delete(x[re].id);x.splice(0,ie-1)}const $=Object.assign({},c.value);$.children=[];const X=new Me($),se=o.value.reduce((ie,re)=>{const oe=t.items.find(xe=>xe.id===re.id);return k.has(re.id)?(X.children.push(re),re.shown=!1):re.shown=oe.visible!==!1,ie.push(re),ie},[]);c.value=X,o.value=se}function q(A=-1){if(A===0||!a.value||!s.value)return;A<0&&(A=s.value.getBoundingClientRect().width);const W=a.value.getBoundingClientRect().width;(A>=0&&A<W||x.length)&&(L(A),C())}function Q(){return w.value<0&&i.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[M(new Me(h))])}const Y=new ResizeObserver(A=>{if(A.length){const $=A[0].contentRect.width;q($)}});function Z(){k=new Map,x=[]}function H(){s.value&&!p&&(Y.observe(s.value),p=!0)}function te(){if(r.value&&w.value<0){const A=r.value.querySelector("#"+h.id);A&&(w.value=B(A))}}return i.onMounted(()=>{te(),q(),H(),document.body.addEventListener("click",C),document.body.addEventListener("wheel",C)}),i.onUnmounted(()=>{Y.disconnect(),g(),document.body.removeEventListener("click",C),document.body.removeEventListener("wheel",C)}),i.watch(()=>t.items,()=>{o.value=bt(t.items),c.value.children=[],i.nextTick(()=>{Z(),q()})},{deep:!0}),i.watch(()=>t.visible,A=>{A&&i.nextTick(()=>{te(),q(),H()})}),e.expose({elementRef:r}),()=>i.createVNode("div",{class:V.value,id:l,ref:r,style:{"overflow-y":w.value<0?"hidden":"initial"}},[t.visible&&Q(),t.visible&&i.createVNode("div",{ref:s,class:S.value},[i.createVNode("div",{ref:a,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(A=>A.shown).map((A,W)=>A.children&&A.children.length>0?M(A):y(A,W)),T.value&&M(c.value)])])])}});class Fn extends De{constructor(n,o,r="response-toolbar"){super(n,o);G(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 On(t,e,n){const o=t.schema;function r(){var l;let u=((l=t.parent)==null?void 0:l.schema.type)||"";["page-header","tabs","section"].findIndex(P=>P===u)===-1&&(u=""),n.toolbarPosition=u}r();function s(u){return!1}function a(u,l){return l.text=u.label,l}function m(){return!1}function c(){return!1}function h(){return!1}function w(){return!0}function d(u){return new Fn(u,e,o.type).getPropertyConfig(o)}function p(u){var M;u&&(u.stopPropagation(),u.preventDefault());const{schema:l}=t;l.buttons||(l.buttons=[]);let P="";if(l.type)P=l.type+"-item";else{const O=(M=t.parent)==null?void 0:M.schema.type;P=O==="tabs"?"tab-toolbar-item":O==="section"?"section-toolbar-item":"response-toolbar-item"}const I=Xe(P);I.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,l.buttons.push(I),n.updateToolbarItems(),n.changeSelectedId("")}function b(){return[{id:"appendItem",title:"新增按钮",text:"",icon:"f-icon f-icon-plus-circle text-white",onClick:u=>p(u)}]}return{canAccepts:s,checkCanAddComponent:h,checkCanDeleteComponent:c,checkCanMoveComponent:m,hideNestedPaddingInDesginerView:w,onResolveNewComponentSchema:a,getPropsConfig:d,getCustomButtons:b}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function An(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ne(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 vt={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(o,r,s){function a(h,w){if(!r[h]){if(!o[h]){var d=typeof Ne=="function"&&Ne;if(!w&&d)return d(h,!0);if(m)return m(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var b=r[h]={exports:{}};o[h][0].call(b.exports,function(u){var l=o[h][1][u];return a(l||u)},b,b.exports,n,o,r,s)}return r[h].exports}for(var m=typeof Ne=="function"&&Ne,c=0;c<s.length;c++)a(s[c]);return a}return n}()({1:[function(n,o,r){var s={},a="(?:^|\\s)",m="(?:\\s|$)";function c(d){var p=s[d];return p?p.lastIndex=0:s[d]=p=new RegExp(a+d+m,"g"),p}function h(d,p){var b=d.className;b.length?c(p).test(b)||(d.className+=" "+p):d.className=p}function w(d,p){d.className=d.className.replace(c(p)," ").trim()}o.exports={add:h,rm:w}},{}],2:[function(n,o,r){(function(s){var a=n("contra/emitter"),m=n("crossvent"),c=n("./classes"),h=document,w=h.documentElement;function d(C,v){var f=arguments.length;f===1&&Array.isArray(C)===!1&&(v=C,C=[]);var y,k,x,B,j,_,L,q,Q,Y=null,Z,H,te=!1,A=0,W,$=v||{};$.moves===void 0&&($.moves=M),$.accepts===void 0&&($.accepts=M),$.invalid===void 0&&($.invalid=Zn),$.containers===void 0&&($.containers=C||[]),$.isContainer===void 0&&($.isContainer=I),$.copy===void 0&&($.copy=!1),$.copySortSource===void 0&&($.copySortSource=!1),$.revertOnSpill===void 0&&($.revertOnSpill=!1),$.removeOnSpill===void 0&&($.removeOnSpill=!1),$.direction===void 0&&($.direction="vertical"),$.ignoreInputTextSelection===void 0&&($.ignoreInputTextSelection=!0),$.mirrorContainer===void 0&&($.mirrorContainer=h.body);var X=a({containers:$.containers,start:Qn,end:Dt,cancel:Vt,remove:Nt,destroy:xe,canMove:Xn,dragging:!1});return $.removeOnSpill===!0&&X.on("over",Kn).on("out",eo),ie(),X;function se(D){return X.containers.indexOf(D)!==-1||$.isContainer(D)}function ie(D){var R=D?"remove":"add";u(w,R,"mousedown",ve),u(w,R,"mouseup",$e)}function re(D){var R=D?"remove":"add";u(w,R,"mousemove",ye)}function oe(D){var R=D?"remove":"add";m[R](w,"selectstart",le),m[R](w,"click",le)}function xe(){ie(!0),$e({})}function le(D){Z&&D.preventDefault()}function ve(D){B=D.clientX,j=D.clientY;var R=l(D)!==1||D.metaKey||D.ctrlKey;if(!R){var U=D.target,z=Te(U);z&&(Z=z,re(),D.type==="mousedown"&&(F(U)?U.focus():D.preventDefault()))}}function ye(D){if(Z){if(l(D)===0){$e({});return}if(!(D.clientX!==void 0&&Math.abs(D.clientX-B)<=($.slideFactorX||0)&&D.clientY!==void 0&&Math.abs(D.clientY-j)<=($.slideFactorY||0))){if($.ignoreInputTextSelection){var R=S("clientX",D)||0,U=S("clientY",D)||0,z=h.elementFromPoint(R,U);if(F(z))return}var J=Z;re(!0),oe(),Dt(),Et(J),c.add(q||x,"gu-transit"),no(),to(),A=0,_e(D)}}}function Te(D){if(!(X.dragging&&y)&&!se(D)){for(var R=D;T(D)&&se(T(D))===!1;)if($.invalid(D,R)||(D=T(D),!D))return;var U=T(D);if(U&&!$.invalid(D,R)){var z=$.moves(D,U,R,g(D));if(z)return{item:D,source:U}}}}function Xn(D){return!!Te(D)}function Qn(D){var R=Te(D);R&&Et(R)}function Et(D){uo(D.item,D.source)&&(q=D.item.cloneNode(!0),X.emit("cloned",q,D.item,"copy")),k=D.source,x=D.item,_=L=g(D.item),X.dragging=!0,X.emit("drag",x,k)}function Zn(){return!1}function Dt(){if(X.dragging){var D=q||x;kt(D,T(D))}}function Mt(){Z=!1,re(!0),oe(!0)}function $e(D){if(Mt(),!!X.dragging){var R=q||x,U=S("clientX",D)||0,z=S("clientY",D)||0,J=P(y,U,z),K=Bt(J,U,z);K&&(q&&$.copySortSource||!q||K!==k)?kt(R,K):$.removeOnSpill?Nt():Vt()}}function kt(D,R){var U=T(D);q&&$.copySortSource&&R===k&&U.removeChild(x),je(R)?X.emit("cancel",D,k):X.emit("drop",D,R,k,L),Re()}function Nt(){if(X.dragging){var D=q||x,R=T(D);R&&R.removeChild(D),X.emit(q?"cancel":"remove",D,R,k),Re()}}function Vt(D){if(X.dragging){var R=arguments.length>0?D:$.revertOnSpill,U=q||x,z=T(U),J=je(z);J===!1&&R&&(q?z&&z.removeChild(q):k.insertBefore(U,_)),J||R?X.emit("cancel",U,k,k):X.emit("drop",U,z,k,L),Re()}}function Re(){var D=q||x;Mt(),oo(),ro(),D&&c.rm(D,"gu-transit"),Q&&clearTimeout(Q),X.dragging=!1,Y&&X.emit("out",D,Y,k),X.emit("dragend",D,A),k=x=q=_=L=Q=Y=null}function je(D,R){var U;return R!==void 0?U=R:y?U=L:U=g(q||x),D===k&&U===_}function Bt(D,R,U){for(var z=D;z&&!J();)z=T(z);return z;function J(){var K=se(z);if(K===!1)return!1;var ge=It(z,D),ue=Ft(z,ge,R,U),pe=je(z,ue);return pe?!0:$.accepts(x,z,k,ue)}}function _e(D){if(!y)return;D.preventDefault();var R=S("clientX",D)||0,U=S("clientY",D)||0;y.style.left=R-2+"px",y.style.top=U-2+"px";var z=q||x,J=P(y,R,U),K=Bt(J,R,U),ge=K!==null&&K!==Y;(ge||K===null)&&(fe(),Y=K,be()),co(J,U);var ue=T(z);if(K===k&&q&&!$.copySortSource){ue&&ue.removeChild(z);return}var pe,he=It(K,J);if(te=io(he,K),he!==null)pe=Ft(K,he,R,U);else if($.revertOnSpill===!0&&!q)pe=_,K=k;else{q&&ue&&ue.removeChild(z),q&&H&&(H.style.display="none");return}H.style.display="block",Jn(pe,z,ge),pe?ao(he,pe):lo(K);function ae(ce){X.emit(ce,z,Y,k)}function be(){ge&&ae("over")}function fe(){Y&&ae("out")}}function Jn(D,R,U){(D===R||D===g(R))&&(L=g(R)),(D===null&&U||D!==R&&D!==g(R))&&(L=D)}function Kn(D){c.rm(D,"gu-hide")}function eo(D){X.dragging&&c.add(D,"gu-hide")}function to(){y||(y=document.createElement("div"),y.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;",y.innerHTML=$.getMirrorText&&$.getMirrorText(x)||"控件",c.add(y,"gu-mirror"),$.mirrorContainer.appendChild(y),u(w,"add","mousemove",_e),c.add($.mirrorContainer,"gu-unselectable"),X.emit("cloned",y,x,"mirror"))}function no(){if(H=document.createElement("div"),c.add(H,"gu-insertion"),x){var D=x.getBoundingClientRect();H.style.left=D.left+"px",H.style.top=D.top+"px"}te=!1,$.mirrorContainer.appendChild(H)}function oo(){y&&(c.rm($.mirrorContainer,"gu-unselectable"),u(w,"remove","mousemove",_e),T(y).removeChild(y),y=null)}function ro(){H&&(T(H).removeChild(H),H=null)}function It(D,R){for(var U=R;U!==D&&T(U)!==D;)U=T(U);return U===w?null:U}function io(D,R){if(!R)return te;var U=D||R&&R.lastElementChild;if(!U)return!0;var z=getComputedStyle(D),J=/^inline/.test(z.getPropertyValue("display"))||/^(left|right)$/.test(z.getPropertyValue("float"));if(J)return!0;if(R){var K=getComputedStyle(R),ge=K.getPropertyValue("display");if(/flex$/.test(ge)){var ue=K.getPropertyValue("flex-direction")||"row";if(ue==="row"||ue==="row-reverse")return!so(R)}return!1}return!0}function so(D){if(!D.children||!D.children.length)return!1;for(const R of Array.from(D.children)){const z=(R.className&&R.className.split(" ")||[]).filter(J=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J));if(!z.length)return!1;for(const J of z){const K=J.slice(J.lastIndexOf("-")+1);if(parseInt(K,10)!==12)return!1}}return!0}function ao(D,R){const U=R.getBoundingClientRect();if(H.style.left=U.left+"px",H.style.top=U.top+"px",te){if(H.style.height=U.height+"px",H.style.width="4px",D){const z=D.getBoundingClientRect();z.top!==U.top&&(H.style.left=z.right+"px",H.style.top=z.top+"px",H.style.height=z.height+"px")}}else if(H.style.height="4px",H.style.width=U.width+"px",W){const z=W.getBoundingClientRect();U.top<z.top&&(H.style.display="none")}R===x&&x&&(H.style.display="none")}function lo(D){L=null;var R=D.lastElementChild;if(R){var U=R.getBoundingClientRect();te?(H.style.left=U.right+"px",H.style.top=U.top+"px",H.style.height=U.height+"px",H.style.width="4px"):(H.style.left=U.left+"px",H.style.top=U.bottom+"px",H.style.height="4px",H.style.width=U.width+"px"),R===x&&x&&(H.style.display="none")}else H.style.display="none"}function co(D,R){if(!$.mirrorContainer.contains(D)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(W=p(D),!W||!W.contains(D)))return;const U=document.querySelector(".dgComponentSelected"),z=W.getBoundingClientRect();if(R-30<z.top&&W.scrollTop>0){let J=W.scrollTop<10?W.scrollTop:10;W.scrollBy(0,-1*J),U&&W.contains(U)&&(A=A+-1*J)}if(R+30>z.bottom&&W.scrollTop<W.scrollHeight-W.clientHeight){const J=W.scrollHeight-W.clientHeight-W.scrollTop;let K=J<10?J:10;W.scrollBy(0,K),U&&W.contains(U)&&(A=A+K)}}function Ft(D,R,U,z){var J=$.direction==="horizontal",K=$.direction==="mixed",ge=R!==D?pe():ue();return ge;function ue(){var ae=D.children.length,be,fe,ce;for(be=0;be<ae;be++)if(fe=D.children[be],ce=fe.getBoundingClientRect(),J&&ce.left+ce.width/2>U||!K&&!J&&ce.top+ce.height/2>z||K&&ce.left+ce.width>U&&ce.top+ce.height>z)return fe;return null}function pe(){var ae=R.getBoundingClientRect();if(K){var be=z-ae.top,fe=U-ae.left,ce=ae.bottom-z,Le=ae.right-U,qe=Math.min(fe,Le,be,ce),Ue;return te?Ue=Le<fe:Ue=ce===qe||Le===qe||fe===qe,he(Ue)}return he(J?U>ae.left+O(ae)/2:z>ae.top+N(ae)/2)}function he(ae){return ae?g(R):R}}function uo(D,R){return typeof $.copy=="boolean"?$.copy:$.copy(D,R)}}function p(C){const v=Array.from(window.scrollContainerList);if(v.length===1){const y=Array.from(window.scrollContainerList)[0];return document.getElementById(y)}const f=b(v);for(const y of f)if(y.contains(C))return y;return null}function b(C){const v=[];return C.forEach(f=>{const y=document.getElementById(f);y&&v.push(y)}),v.sort((f,y)=>f.contains(y)?1:y.contains(f)?-1:0),v}function u(C,v,f,y){var k={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},x={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?m[v](C,x[f],y):s.navigator.msPointerEnabled?m[v](C,B[f],y):(m[v](C,k[f],y),m[v](C,f,y))}function l(C){if(C.touches!==void 0)return C.touches.length;if(C.which!==void 0&&C.which!==0)return C.which;if(C.buttons!==void 0)return C.buttons;var v=C.button;if(v!==void 0)return v&1?1:v&2?3:v&4?2:0}function P(C,v,f){C=C||{};var y=C.className||"",k;return C.className+=" gu-hide",k=h.elementFromPoint(v,f),C.className=y,k}function I(){return!1}function M(){return!0}function O(C){return C.width||C.right-C.left}function N(C){return C.height||C.bottom-C.top}function T(C){return C.parentNode===h?null:C.parentNode}function F(C){return C.tagName==="INPUT"||C.tagName==="TEXTAREA"||C.tagName==="SELECT"||E(C)}function E(C){return!C||C.contentEditable==="false"?!1:C.contentEditable==="true"?!0:E(T(C))}function g(C){return C.nextElementSibling||v();function v(){var f=C;do f=f.nextSibling;while(f&&f.nodeType!==1);return f}}function V(C){return C.targetTouches&&C.targetTouches.length?C.targetTouches[0]:C.changedTouches&&C.changedTouches.length?C.changedTouches[0]:C}function S(C,v){var f=V(v),y={pageX:"clientX",pageY:"clientY"};return C in y&&!(C in f)&&y[C]in f&&(C=y[C]),f[C]}o.exports=d}).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,m){return Array.prototype.slice.call(a,m)}},{}],4:[function(n,o,r){var s=n("ticky");o.exports=function(m,c,h){m&&s(function(){m.apply(h||null,c||[])})}},{ticky:10}],5:[function(n,o,r){var s=n("atoa"),a=n("./debounce");o.exports=function(c,h){var w=h||{},d={};return c===void 0&&(c={}),c.on=function(p,b){return d[p]?d[p].push(b):d[p]=[b],c},c.once=function(p,b){return b._once=!0,c.on(p,b),c},c.off=function(p,b){var u=arguments.length;if(u===1)delete d[p];else if(u===0)d={};else{var l=d[p];if(!l)return c;l.splice(l.indexOf(b),1)}return c},c.emit=function(){var p=s(arguments);return c.emitterSnapshot(p.shift()).apply(this,p)},c.emitterSnapshot=function(p){var b=(d[p]||[]).slice(0);return function(){var u=s(arguments),l=this||c;if(p==="error"&&w.throws!==!1&&!b.length)throw u.length===1?u[0]:u;return b.forEach(function(I){w.async?a(I,u,l):I.apply(l,u),I._once&&c.off(p,I)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(n,o,r){(function(s){var a=n("custom-event"),m=n("./eventmap"),c=s.document,h=p,w=u,d=[];s.addEventListener||(h=b,w=l),o.exports={add:h,remove:w,fabricate:P};function p(T,F,E,g){return T.addEventListener(F,E,g)}function b(T,F,E){return T.attachEvent("on"+F,M(T,F,E))}function u(T,F,E,g){return T.removeEventListener(F,E,g)}function l(T,F,E){var g=O(T,F,E);if(g)return T.detachEvent("on"+F,g)}function P(T,F,E){var g=m.indexOf(F)===-1?S():V();T.dispatchEvent?T.dispatchEvent(g):T.fireEvent("on"+F,g);function V(){var C;return c.createEvent?(C=c.createEvent("Event"),C.initEvent(F,!0,!0)):c.createEventObject&&(C=c.createEventObject()),C}function S(){return new a(F,{detail:E})}}function I(T,F,E){return function(V){var S=V||s.event;S.target=S.target||S.srcElement,S.preventDefault=S.preventDefault||function(){S.returnValue=!1},S.stopPropagation=S.stopPropagation||function(){S.cancelBubble=!0},S.which=S.which||S.keyCode,E.call(T,S)}}function M(T,F,E){var g=O(T,F,E)||I(T,F,E);return d.push({wrapper:g,element:T,type:F,fn:E}),g}function O(T,F,E){var g=N(T,F,E);if(g){var V=d[g].wrapper;return d.splice(g,1),V}}function N(T,F,E){var g,V;for(g=0;g<d.length;g++)if(V=d[g],V.element===T&&V.type===F&&V.fn===E)return g}}).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(s){var a=[],m="",c=/^on/;for(m in s)c.test(m)&&a.push(m.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(s){var a=s.CustomEvent;function m(){try{var c=new a("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=m()?a:typeof document<"u"&&typeof document.createEvent=="function"?function(h,w){var d=document.createEvent("CustomEvent");return w?d.initCustomEvent(h,w.bubbles,w.cancelable,w.detail):d.initCustomEvent(h,!1,!1,void 0),d}:function(h,w){var d=document.createEventObject();return d.type=h,w?(d.bubbles=!!w.bubbles,d.cancelable=!!w.cancelable,d.detail=w.detail):(d.bubbles=!1,d.cancelable=!1,d.detail=void 0),d}}).call(this,typeof me<"u"?me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,o,r){var s=o.exports={},a,m;function c(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=c}catch{a=c}try{typeof clearTimeout=="function"?m=clearTimeout:m=h}catch{m=h}})();function w(N){if(a===setTimeout)return setTimeout(N,0);if((a===c||!a)&&setTimeout)return a=setTimeout,setTimeout(N,0);try{return a(N,0)}catch{try{return a.call(null,N,0)}catch{return a.call(this,N,0)}}}function d(N){if(m===clearTimeout)return clearTimeout(N);if((m===h||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(N);try{return m(N)}catch{try{return m.call(null,N)}catch{return m.call(this,N)}}}var p=[],b=!1,u,l=-1;function P(){!b||!u||(b=!1,u.length?p=u.concat(p):l=-1,p.length&&I())}function I(){if(!b){var N=w(P);b=!0;for(var T=p.length;T;){for(u=p,p=[];++l<T;)u&&u[l].run();l=-1,T=p.length}u=null,b=!1,d(N)}}s.nextTick=function(N){var T=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)T[F-1]=arguments[F];p.push(new M(N,T)),p.length===1&&!b&&w(I)};function M(N,T){this.fun=N,this.array=T}M.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function O(){}s.on=O,s.addListener=O,s.once=O,s.off=O,s.removeListener=O,s.removeAllListeners=O,s.emit=O,s.prependListener=O,s.prependOnceListener=O,s.listeners=function(N){return[]},s.binding=function(N){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(N){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],10:[function(n,o,r){(function(s){var a=typeof s=="function",m;a?m=function(c){s(c)}:m=function(c){setTimeout(c,0)},o.exports=m}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,o,r){(function(s,a){var m=n("process/browser.js").nextTick,c=Function.prototype.apply,h=Array.prototype.slice,w={},d=0;r.setTimeout=function(){return new p(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new p(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(b){b.close()};function p(b,u){this._id=b,this._clearFn=u}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(b,u){clearTimeout(b._idleTimeoutId),b._idleTimeout=u},r.unenroll=function(b){clearTimeout(b._idleTimeoutId),b._idleTimeout=-1},r._unrefActive=r.active=function(b){clearTimeout(b._idleTimeoutId);var u=b._idleTimeout;u>=0&&(b._idleTimeoutId=setTimeout(function(){b._onTimeout&&b._onTimeout()},u))},r.setImmediate=typeof s=="function"?s:function(b){var u=d++,l=arguments.length<2?!1:h.call(arguments,1);return w[u]=!0,m(function(){w[u]&&(l?b.apply(null,l):b.call(null),r.clearImmediate(u))}),u},r.clearImmediate=typeof a=="function"?a:function(b){delete w[b]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(vt);var $n=vt.exports;const yt=An($n);function Rn(t){let e;function n(r,s,a,m){const c=t.schema;if(!(c!=null&&c.buttons))return;let h;if(a){const b=a.getAttribute("id");h=Array.from(s.children).findIndex(u=>u.getAttribute("id")===b)}else h=Array.from(s.children).length;const w=r.getAttribute("id"),d=Array.from(s.children).findIndex(b=>b.getAttribute("id")===w),p=c.buttons[d];d!==h&&d>-1&&h>-1&&(d<h&&(h=h-1),c.buttons.splice(d,1),c.buttons.splice(h,0,p),m(),i.nextTick(()=>{const b=s.querySelector(".dgComponentSelected");b!=null&&b.className.includes("dgComponentSelected")&&(b.classList.remove("dgComponentSelected"),b.classList.remove("dgComponentFocused"),b.click()),Ce.value++}))}function o(r,s,a){e&&e.destroy(),!(!yt||!r||!s)&&(e=yt([r],{mirrorContainer:s,direction:"horizontal",getMirrorText(m){return m.innerText},moves(m,c,h){let w=!0;return h.classList.contains("dropdown-item")?(w=!1,w):(m.classList.contains("no-drag")&&(w=!1),w)}}).on("drop",(m,c,h,w)=>n(m,c,w,a)))}return{dragulaInstance:e,initDragula:o}}function jn(t,e,n){const{renderToolbarItemDesigner:o,actionHandlers:r}=n;let s;function a(M){s=M}function m(M,O=null){const N=e.value.find(T=>T.id===M.id);if(N.isDP)if(document.body.click(),typeof O=="boolean")N.expanded=O;else{const T=M.expanded;N.expanded=!T}}r.toggleDropdownMenu=m;function c(M){var N;const O={"dropdown-menu":!0};if(M.class){const T=(N=M.menuClass)==null?void 0:N.split(" ");T&&T.length&&T.reduce((F,E)=>(F[E]=!0,F),O)}return O}function h(M){var T;const O={disabled:M.disabled===!1,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},N=(T=M.dropdownClass)==null?void 0:T.split(" ");return N&&N.length&&N.reduce((F,E)=>(F[E]=!0,F),O),O}function w(M){const O={disabled:!1,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0,"text-truncate":!0},N=(M.class||"").split(" ");return N&&N.length&&N.reduce((T,F)=>(T[F]=!0,T),O),O}let d;const p=new Map;function b(M,O,N){M.stopPropagation();const T=N?N.id:"__top_item__";if(O.children&&O.children.length&&(O.expanded=!O.expanded,O.expanded)){if(p.has(T)&&p.get(T)!==O){const F=p.get(T);F&&(F.expanded=!1,p.delete(T))}p.set(T,O)}}function u(M){var O;return(O=M.children)==null?void 0:O.map((N,T)=>N.children&&N.children.length?i.createVNode("li",{class:h(N),id:N.id},[i.createVNode("span",{class:w(N),onClick:F=>b(F,N,M)},[N.text,i.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),d(N,N)]):o(N,T,!0))}function l(M,O,N,T){const{height:g,left:V,top:S}=T[0],{width:C,height:v}=N.getBoundingClientRect(),{marginTop:f,marginBottom:y}=getComputedStyle(N),k=Math.ceil(parseFloat(f))+Math.ceil(parseFloat(y)),x=S+g,B=O==null?void 0:O.getBoundingClientRect();function j(){let Q=0,Y="left";const Z=B?B.right:window.innerWidth,H=B?B.left:0;return Q=Z-V-10,Z-V<C&&V-H>Z-V&&(Y="right",Q=V-H-10),{hposition:Y,maxWidth:Math.min(Q,300)}}let _=0,L="bottom";if(M==="tabs"||M==="section")_=O.getBoundingClientRect().bottom-x-k-10;else{const Q=B?B.bottom:window.innerHeight;_=M==="page-header"?Q-x:S,_=_-k-10,L=M==="page-header"?"bottom":"top"}const q=j();return{position:L+"-"+q.hposition,maxWidth:q.maxWidth,maxHeight:_}}function P(M){var E,g,V;const O="300px",N={display:M.expanded===!0?"block":"none",position:"absolute",maxWidth:O,minWidth:"120px"};if(!(s!=null&&s.value))return N;const T=s.value.querySelector("#"+M.id),F=T==null?void 0:T.getClientRects();if(T&&F&&F.length>0){const S=T?T.querySelector("#"+M.id+"_menu"):null;if(!S||M.expanded!==!0)return N;S.style.visibility="hidden",S.style.display="block",S.style.maxHeight="auto",S.style.maxWidth=O;let C;switch(r.toolbarPosition){case"tabs":C=(E=s.value)==null?void 0:E.closest(".farris-tabs");break;case"section":C=(g=s.value)==null?void 0:g.closest(".f-section");break;default:C=(V=s.value)==null?void 0:V.closest(".f-page")}const v=l(r.toolbarPosition,C,S,F),{position:f,maxHeight:y,maxWidth:k}=v;S.style.visibility="visible";const x={left:f.indexOf("left")>-1?0:"unset",right:f.indexOf("left")>-1?"unset":0,bottom:f.indexOf("bottom")>-1?"unset":"100%",top:f.indexOf("bottom")>-1?"!00%":"unset",maxWidth:k?k+"px":"300px",maxHeight:y?y+"px":"auto",overflowY:y?"auto":"unset"};Object.assign(N,x)}return N}r.changeMenuPosition=P,d=function(M,O){return i.createVNode("ul",{class:c(M),style:P(M),id:M.id+"_menu"},[u(M)])};function I(M=""){M&&p.has(M)?p.forEach((O,N)=>{N!==M&&(O.expanded=!1,p.delete(N))}):(p.forEach(O=>{O.expanded=!1}),p.clear())}return{renderDropdownMenu:d,clearAllDropDownMenu:I,setResponseToolbarRef:a}}const _n={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 Ln(t,e,n){var V;const o="",r=i.ref();let s;function a(){return!0}function m(){return!1}function c(){return!0}function h(){return!0}function w(){return!0}function d(S){if(!S||!S.value)return null;const C=i.ref(S==null?void 0:S.value.parent),v=d(C);return v||null}function p(S=e){var y;const{componentInstance:C,designerItemElementRef:v}=S;if(!C||!C.value)return null;const{getCustomButtons:f}=C.value;return C.value.canMove||C.value.canAdd||C.value.canDelete||f&&((y=f())!=null&&y.length)?v:p(S.parent)}function b(){}function u(S){return!!n}function l(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function P(){}function I(S,C){}function M(S){const{componentType:C}=S,v=i.inject("designer-host-service");let f=We.getSchemaByTypeForDesigner(C,S,v);const y=C.toLowerCase().replace(/-/g,"_");return f&&!f.id&&f.type===C&&(f.id=`${y}_${Math.random().toString().slice(2,6)}`),f}function O(S){}function N(...S){return[]}function T(){}function F(S){var v;if(!(e!=null&&e.schema))return;let C="";{const{text:f,title:y,label:k,mainTitle:x,name:B,type:j}=e.schema;C=f||y||k||x||B||((v=we[j])==null?void 0:v.name)}C&&(!s&&S&&(s=S.formSchemaUtils),s.getControlBasicInfoMap().set(e.schema.id,{componentTitle:C,parentPathName:C}))}function E(S){var y;const{changeObject:C}=S,{propertyID:v,propertyValue:f}=C;["text","title","label","name","mainTitle"].includes((y=S==null?void 0:S.changeObject)==null?void 0:y.propertyID)&&v&&f&&F()}function g(S){E(S)}return r.value={canMove:a(),canSelectParent:m(),canAdd:h(),canDelete:c(),canNested:!w(),contents:[],elementRef:t,parent:(V=e.parent)==null?void 0:V.componentInstance,schema:e.schema,styles:o,canAccepts:u,getBelongedComponentInstance:d,getDraggableDesignItemElement:p,getDraggingDisplayText:l,getPropConfig:N,getDragScopeElement:P,onAcceptMovedChildElement:I,onChildElementMovedOut:O,addNewChildComponentSchema:M,onRemoveComponent:T,triggerBelongedComponentToMoveWhenMoved:i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:i.ref(!1),onPropertyChanged:g,getCustomButtons:b,setComponentBasicInfoMap:F},r}const Ct=i.defineComponent({name:"FDesignerInnerItem",props:_n,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,e){const n=i.ref(t.canMove),o=i.ref(t.canAdd),r=i.ref(t.canDelete),s=i.ref(!1),a=i.ref(t.contentKey),m=i.ref(t.childType),c=i.ref(t.childLabel),h=i.ref(t.modelValue),w=i.ref(""),d=i.ref(),p=i.inject("canvas-dragula"),b=i.ref(),u=i.inject("design-item-context"),l={designerItemElementRef:d,componentInstance:b,schema:h.value,parent:u,setupContext:e};i.provide("design-item-context",l);const P=i.inject("designer-host-service"),I=i.inject("external-container-id"),M=i.computed(()=>{var j;const x=((j=b.value)==null?void 0:j.getCustomButtons)&&b.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||r.value||(x==null?void 0:x.length),"farris-nested":s.value,"can-move":n.value,"d-none":d.value&&d.value.classList.contains("d-none")}}),O=i.computed(()=>{const x={};return w.value&&w.value.split(";").reduce((B,j)=>{const[_,L]=j.split(":");return _&&(B[_]=L),B},x),x});function N(x,B){if(u&&u.schema[a.value]){const j=u.schema[a.value].findIndex(_=>_.id===B.id);if(j>-1){const _=u.schema[a.value].length,L=u.schema[a.value][j%_];u.designerItemElementRef.value.querySelector(`#${L.id}-design-item`),u.schema[a.value].splice(j,1),Ce.value++,e.emit("removeComponent"),e.emit("selectionChange")}}}function T(x){if(b.value.addNewChildComponentSchema){const B={componentType:m.value,label:c.value,parentComponentInstance:b.value,targetPosition:-1},j=b.value.addNewChildComponentSchema(B);h.value[a.value].push(j),e.emit("addComponent")}}function F(){return o.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:x=>{T()}},[i.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function E(x){return r.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:i.withModifiers(B=>N(B,x),["stop"])},[i.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function g(){return n.value&&i.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[i.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function V(){var B;const x=((B=b.value)==null?void 0:B.getCustomButtons)&&b.value.getCustomButtons();return x&&!!x.length&&x.map(j=>i.createVNode("div",{role:"button",class:`btn component-settings-button ${j.class||""} ${j.text?"settings-button-extend":""}`,title:j.title,ref:j.id,onClick:_=>j.onClick&&j.onClick(_)},[i.createVNode("i",{class:"f-icon "+j.icon},null),j.text&&i.createVNode("span",{class:"icon-text"},[j.text])]))}function S(x){return i.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[i.createVNode("div",null,[F(),g(),E(x),V()])])}i.watch(()=>t.modelValue,x=>{h.value=x,l.schema=x});function C(x){window.scrollContainerList||(window.scrollContainerList=new Set);const B=x.getAttribute("id");B&&window.scrollContainerList.add(B)}function v(x){const B=x.target;C(B),yn(B)}function f(){var x,B;(B=(x=h.value)==null?void 0:x.contents)!=null&&B.length&&d.value&&d.value.addEventListener("scroll",v)}function y(){const x=d.value,B=i.ref(x.children[1]);return Ln(B,l).value}i.onMounted(()=>{if(d.value){const x=d.value.querySelector(`[data-dragref='${h.value.id}-container']`);b.value=x&&x.componentInstance?x.componentInstance.value:y(),p&&x&&p.attachComponents(x,h.value),s.value=b.value.canNested!==void 0?b.value.canNested:s.value,o.value=b.value.canAdd!==void 0?b.value.canAdd:o.value,r.value=b.value.canDelete!==void 0?b.value.canDelete:r.value,n.value=b.value.canMove!==void 0?b.value.canMove:n.value,w.value=b.value.styles||"",d.value&&(d.value.componentInstance=b,d.value.designItemContext=l),b.value.setComponentBasicInfoMap(P)}f(),Ce.value++}),i.onBeforeUnmount(()=>{d.value&&d.value.removeEventListener("scroll",v)});function k(x){if(x&&(x.preventDefault(),x.stopPropagation()),I){const _=document.getElementById(`${I}-design-item`);_&&_.click();return}let B=l.designerItemElementRef;const j=d.value;if(j){const _=document.getElementsByClassName("dgComponentFocused");_&&_.length===1&&_[0]===d.value&&d.value.classList.contains("dgComponentSelected")||(Array.from(_).forEach(q=>q.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(q=>q.classList.remove("dgComponentSelected")),j.classList.add("dgComponentFocused"),e.emit("selectionChange",h.value.type,h.value,t.componentId,b.value),b.value.getDraggableDesignItemElement&&(B=b.value.getDraggableDesignItemElement(l),B&&B.value&&B.value.classList.add("dgComponentSelected")))}ft(B==null?void 0:B.value)}return()=>i.createVNode("div",{id:`${t.id}-design-item`,ref:d,class:M.value,style:O.value,onClick:k},[S(h.value),e.slots.default&&e.slots.default()])}});class qn extends De{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),s=o.createBaseEventProperty(r);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,m){const c=a.propertyValue;delete e[o.viewModelId],c&&(c.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(e,o.viewModelId,c.events,c))}}}}class Un extends De{constructor(n,o,r="response-toolbar-item"){super(n,o);G(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=s=>{if(s)switch(s&&s.propertyID){case"text":{s.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,s=r.eventsEditorUtils.formProperties(n,r.viewModelId,o),a=r.createBaseEventProperty(s);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(m,c){const h=m.propertyValue;delete n[r.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,r.eventsEditorUtils.saveRelatedParameters(n,r.viewModelId,h.events,h))}}}}function Oe(t,e){if(!t)return!1;const n=e||[];return(n==null?void 0:n.findIndex(r=>r.id===t))===-1}function wt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};return n.some((r,s)=>{if(r.children&&r.children.length>0){const a=r.children.findIndex(m=>m.id===t);return a>-1?(o={parentIndex:s,itemIndex:a},!0):!1}}),o}function xt(t,e){const n=e||[];let o={parentIndex:-1,itemIndex:-1};const r=n==null?void 0:n.findIndex(s=>s.id===t);return r>-1?{parent:null,item:n[r]}:(n.some((s,a)=>{if(s.children&&s.children.length>0){const m=s.children.findIndex(c=>c.id===t);return m>-1?(o={parentIndex:a,itemIndex:m},!0):!1}}),o.parentIndex<0?{parent:null,item:null}:{parent:n[o.parentIndex],item:n[o.parentIndex].children[o.itemIndex]})}function Wn(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 Hn(t,e,n){function o(v){return!1}function r(){return!1}function s(){return!1}function a(){return!1}function m(){return n.toolbarContext.schema.buttons||[]}function c(v,f=""){setTimeout(()=>{var B,j;const y=(B=t.parent)==null?void 0:B.designerItemElementRef.value;let k;f&&(k=y==null?void 0:y.querySelector("#"+f));const x=(j=k||y)==null?void 0:j.querySelector("#"+v);x==null||x.click()},0)}function h(v,f){f.disabled&&f.disabled.expressionId&&(f.disabled.expressionId=`${f.id}_disabled`),f.visible&&f.visible.expressionId&&(f.visible.expressionId=`${f.id}_visible`);const y=e.formSchemaUtils.getExpressions(),k=y.find(B=>B.target===v.id);if(!k||!k.rules||!k.rules.length)return;const x={target:f.id,rules:[],targetType:"Button"};k.rules.forEach(B=>{const j=Object.assign(de.cloneDeep(B),{id:`${f.id}_${B.type}`});x.rules.push(j)}),y.push(x)}function w(){var k;const v=t.schema,f=Object.assign(de.cloneDeep(v),{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null});(k=e==null?void 0:e.designerContext)!=null&&k.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(f);let y=[];return f.children&&f.children.length&&(y=f.children.map(x=>{var j;const B=de.cloneDeep(x);return Object.assign(B,{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null}),(j=e==null?void 0:e.designerContext)!=null&&j.appendIdentifyForNewControl&&e.designerContext.appendIdentifyForNewControl(B),h(x,B),B}),f.children=y),h(v,f),f}function d(){const v=t.schema.type||"response-toolbar-item",f=cn(v),y=v.toLowerCase().replace("-","_");return f&&!f.id&&f.type===v&&(f.id=`${y}_${Math.random().toString().slice(2,6)}`,f.text="按钮"),f}function p(v){const f=m(),y=f==null?void 0:f.findIndex(x=>x.id===v),k=y===-1?null:f[y];return{index:y,toolbarItem:k}}function b(){const v=t.schema.id,f=m();return Oe(v,f)}function u(v){const f=e.formSchemaUtils.getExpressions();if(!f||!f.length)return;const y=k=>{const x=f&&f.findIndex(B=>B.target===k.id);x>-1&&f.splice(x,1)};y(v),v.children&&v.children.length&&v.children.forEach(k=>{y(k)})}function l(v){n.changeSelectedId(v)}function P(v){e.formSchemaUtils.removeCommunicationInComponent(v),v.children&&v.children.length&&v.children.forEach(f=>{e.formSchemaUtils.removeCommunicationInComponent(f)})}function I(){var k,x,B;if((k=e==null?void 0:e.designerContext)!=null&&k.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const v=m(),{parentIndex:f,itemIndex:y}=wt(t.schema.id,v);f===-1||y===-1||(u(t.schema),P(t.schema),v[f].children.splice(y,1),n.updateToolbarItems(),(x=t.setupContext)==null||x.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function M(){var k,x,B;if((k=e==null?void 0:e.designerContext)!=null&&k.checkCanDeleteControl&&!e.designerContext.checkCanDeleteControl(t.schema))return;const v=t.schema.id,f=m(),y=f==null?void 0:f.findIndex(j=>j.id===v);y!==-1&&(u(f[y]),P(f[y]),f==null||f.splice(y,1),n.updateToolbarItems(),(x=t.setupContext)==null||x.emit("removeComponent"),(B=t.setupContext)==null||B.emit("selectionChange"),Ce.value++)}function O(v="Append"){var j;const f=m(),{parentIndex:y,itemIndex:k}=wt(t.schema.id,f);if(y===-1||k===-1)return;const x=d(),B=v==="Copy"?w():Object.assign({},x);f[y].children.splice(k+1,0,B),n.updateToolbarItems(),l(B.id),(j=t.setupContext)==null||j.emit("addComponent")}function N(v,f){const{index:y}=p(f);if(y===-1)return{index:y,schema:null};const k=d(),x=v==="Copy"?w():Object.assign({},k);return{index:y,schema:x}}function T(){var k;const v=t.schema.id,{index:f,schema:y}=N("Copy",v);y&&(m().splice(f+1,0,y),n.updateToolbarItems(),c(y.id),(k=t.setupContext)==null||k.emit("addComponent"))}function F(){var k;const v=t.schema.id,{index:f,schema:y}=N("Append",v);if(y&&t.parent){const B=m()[f].children||[];B.push(y);const j=m();j[f].children=B,n.updateToolbarItems(),l(y.id),(k=t.setupContext)==null||k.emit("addComponent")}}function E(v){let f;switch(t.schema.type){case"tab-toolbar-item":f=new qn(v,e);break;default:f=new Un(v,e,t.schema.type)}return f.getPropertyConfig(t.schema,b())}function g(v){v.stopPropagation(),v.stopImmediatePropagation()}function V(){const v=[{id:"delete",title:"删除",text:"",icon:"f-icon-yxs_delete",onClick:f=>{g(f),b()?I():M()}},{id:"copy",title:"复制",icon:"f-icon-yxs_copy",onClick:f=>{g(f);const{activeElement:y}=document,k=y?y.tagName.toLowerCase():"";k&&k==="input"||k==="textarea"?(y==null||y.blur(),i.nextTick(()=>{b()?O("Copy"):T()})):b()?O("Copy"):T()}}];return v.push(b()?{id:"appendSiblingButton",title:"",text:"新增同级",icon:"f-icon-plus-circle",onClick:f=>{g(f),O()}}:{id:"appendChildButton",title:"",text:"新增子级",icon:"f-icon-plus-circle",onClick:f=>{g(f),F()}}),v}function S(){const{schema:v}=t;u(v)}function C(){var v,f,y,k;if(t&&e){const{formSchemaUtils:x}=e,{schema:B}=t;switch(B.type){case"response-toolbar-item":{x.getControlBasicInfoMap().set(B.id,{componentTitle:B.text,parentPathName:B.text});break}case"tab-toolbar-item":case"section-toolbar-item":{let j;const _=(v=t.parent)==null?void 0:v.parent;(_==null?void 0:_.schema.type)==="tabs"||(_==null?void 0:_.schema.type)==="section"?j=(f=_.componentInstance)==null?void 0:f.value:j=(k=(y=_==null?void 0:_.parent)==null?void 0:y.componentInstance)==null?void 0:k.value,j!=null&&j.setComponentBasicInfoMap&&j.setComponentBasicInfoMap()}}}}return{canAccepts:o,checkCanMoveComponent:r,checkCanDeleteComponent:s,checkCanAddComponent:a,getPropsConfig:E,getCustomButtons:V,onRemoveComponent:S,setComponentBasicInfoMap:C}}const Tt=i.defineComponent({name:"FResponseToolbarItemDesign",props:ht,emits:["Click","dropdown","clearAll"],setup(t,e){const n=i.ref(t.alignment),o=Fe(),r=i.ref(),s=i.inject("designer-host-service"),a=i.inject("design-item-context"),m=i.inject("toolbar-item-action"),c=Hn(a,s,m),h=He.useDesignerInnerComponent(r,a,c);i.onMounted(()=>{r.value.componentInstance=h}),e.expose(h.value);function w(){const N={"f-icon":!0},T=t.icon?t.icon.trim():"";return ee.getCustomClass(N,T)}function d(){return!!(t.icon&&t.icon.trim())}const p=i.computed(()=>{const N={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 ee.getCustomClass(N,t.class)}),b=i.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=i.computed(()=>{const N={btn:!0,"dropdown-toggle":!0,"f-btn-mr":n.value==="left","dropdown-toggle-split":!0,"no-drag":!0};return ee.getCustomClass(N,t.class)}),l=i.computed(()=>{let N={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||(N=ee.getCustomClass(N,t.class||"")),t.isDP&&(N=ee.getCustomClass(N,t.dropdownClass||"")),N});function P(N,T){T&&T.stopPropagation(),e.emit(N,{id:t.id,isDP:t.isDP})}function I(){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 M(){return i.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[i.createVNode("div",{class:I(),id:t.id},[i.createVNode("div",{class:p.value,style:b.value,onClick:()=>P("clearAll")},[o.shouldShowIcon(t)&&i.createVNode("i",{class:o.iconClass(t)},null),i.createVNode("span",null,[t.text]),!t.split&&i.createVNode("span",{class:"f-icon f-icon-arrow-chevron-down",style:"margin:0 0.5rem 0 0.25rem;",onClick:N=>P("dropdown",N)},null)]),t.split&&i.createVNode("button",{class:u.value,style:"border-radius:0 6px 6px 0;",onClick:N=>P("dropdown",N)},null),m.renderDropdownMenu(t.item,t.item)])])}function O(){return i.createVNode("li",{ref:r,"data-dragref":`${a.schema.id}-container`,id:t.id,class:l.value},[o.shouldShowIcon(t)&&i.createVNode("i",{class:o.iconClass(t)},null),t.text])}return()=>t.isDP?M():t.isDPItem?O():i.createVNode("div",{ref:r,"data-dragref":`${a.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[i.createVNode("button",{type:"button",class:p.value,id:t.id,onClick:()=>P("clearAll")},[d()&&i.createVNode("i",{class:w()},null),t.text])])}});function zn(t,e,n,o){function r(p,b,u,l){o.changeSelectedId((b==null?void 0:b.id)||""),n&&n.setupContext&&n.setupContext.emit("selectionChange",p,b,u,l)}function s(){}function a(p){const b=p.expanded;o.clearAllDropdown(),o.toggleDropdownMenu(p,!b)}function m(p){o.clearAllDropdown(p.isDP?p.id:"")}function c(p,b=""){const u=t.items||[],l=b||p,P=u.find(I=>I.id===l);return b?P.children.find(I=>I.id===p):P}function h(p,b=!1){if(!b)return;const u=p.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.add("dgComponentSelected"))}function w(p,b=!1){if(!b)return;const u=p.target;u!=null&&u.classList.contains("dgComponentFocused")&&(u==null||u.classList.remove("dgComponentSelected"))}function d(p,b,u=!1){const l=c(p.id,p.parent),P=i.ref(l);return i.createVNode(Ct,{key:l.id,class:["p-0",u?"d-block no-drag":"d-inline-block"],modelValue:P.value,"onUpdate:modelValue":I=>P.value=I,canMove:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:t.componentId,id:l.id,onSelectionChange:r,onRemoveComponent:s,onMouseenter:I=>h(I,u),onMouseleave:I=>w(I,u)},{default:()=>{var I;return[i.createVNode(Tt,{id:l.id,disabled:l.disabled,text:l.text,icon:l.icon,isDP:p.isDP,item:p,split:l.split,isDPItem:p.isDPItem,class:((I=p.appearance)==null?void 0:I.class)||"btn-secondary",alignment:t.alignment||"right",onDropdown:()=>a(p),onClearAll:M=>m(M),componentId:t.componentId},null)]}})}return{renderToolbarItemDesigner:d,actionHandlers:o}}function Ae(t,e=!1,n=""){const o=[];return t.reduce((r,s)=>{if(s.children&&s.children.length>0){const a=Ae(s.children,!0,s.id);r.push(Object.assign({},s,{children:a,isDPItem:!1,isDP:!0,parent:"",expanded:!1}))}else r.push(Object.assign({},s,{isDPItem:e,isDP:!1,parent:n}));return r},o),o}const St=i.defineComponent({name:"FResponseToolbarDesign",props:kn,emits:["Click"],setup(t,e){const n=i.ref(Ae(t.items)),o=i.ref(),r=i.ref(),s=i.ref(),a=i.ref("");let m=0;const c=15,h=i.inject("designer-host-service"),w=i.inject("design-item-context"),d={clearAllDropdown:L=>{},toggleDropdownMenu:L=>{},updateToolbarItems:()=>{},changeSelectedId:L=>{a.value=L},renderDropdownMenu:(L,q)=>{},toolbarContext:w,changeMenuPosition:(L,q,Q)=>({}),toolbarPosition:""},p=On(w,h,d),b=He.useDesignerComponent(s,w,p),u=i.inject("toolbar-item-handler"),{initDragula:l,dragulaInstance:P}=Rn(w),I=Fe(),M=zn(t,r,w,d),O=jn(I,n,M),{renderToolbarItemDesigner:N}=M,{clearAllDropDownMenu:T,renderDropdownMenu:F,setResponseToolbarRef:E}=O;i.provide("toolbar-item-action",d),d.renderDropdownMenu=F,E(s),u&&(u.changeSelectedId=function(L){a.value=L});function g(){const L=r.value.querySelector(".dgComponentSelected");L&&ut(L)}function V(){if(a.value)if(Oe(a.value,n.value)){const{parent:L,item:q}=xt(a.value,n.value);L&&(d.toggleDropdownMenu(L,!0),setTimeout(()=>{var Z;const Q=s.value.querySelector("#"+L.id),Y=Q==null?void 0:Q.querySelector("#"+q.id);(((Z=Y==null?void 0:Y.parentElement)==null?void 0:Z.className)||"").indexOf("dgComponentFocused")<0&&(Y==null||Y.click())},0))}else g()}function S(L=""){n.value.filter(q=>q.id!==L&&q.children&&q.children.length>0).forEach(q=>{q.expanded=!1}),T(L)}d.clearAllDropdown=S;function C(){u&&u.updateToolbarItems&&u.updateToolbarItems()}d.updateToolbarItems=C;function v(L){if(L){const q=s.value.querySelector("#"+L.id),Q=q.querySelector("#"+L.id+"_menu"),Y=d.changeMenuPosition(L,q);Object.keys(Y).forEach(Z=>{Q.style[Z]=Y[Z]})}}function f(){const Q=r.value.clientWidth,Y=r.value.querySelectorAll(".farris-component>.f-rt-btn");Y&&Y.forEach(H=>{H.style.maxWidth=Q-12+"px"});const Z=r.value.querySelectorAll(".farris-component>.f-rt-dropdown");Z&&Z.forEach(H=>{H.querySelector(".dropdown-toggle-split")?H.querySelector(".f-rt-btn").style.maxWidth=Q-38+"px":H.style.maxWidth=Q-12+"px"})}const y=new ResizeObserver(L=>{var q;if(L.length){const Y=L[0].contentRect.width;if(Y===0){m=0;return}if(Math.abs(Y-m)>c){if(m=Y,Oe(a.value,n.value)){const{parent:Z,item:H}=xt(a.value,n.value);v(Z)}else if(Wn(a.value,n.value)){const Z=(q=n.value)==null?void 0:q.find(H=>H.id===a.value);v(Z)}else S();f()}}});i.onMounted(()=>{y.observe(s.value),m=s.value.clientWidth,s.value.componentInstance=b,l(r.value,o.value,C)}),i.onUnmounted(()=>{y.disconnect(),P&&P.destroy&&P.destroy()}),e.expose(b.value);const k=i.computed(()=>{const L={"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 ee.getCustomClass(L,t.customClass)}),x=i.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}));i.watch(()=>t.items,()=>{n.value=Ae(t.items),i.nextTick(()=>{V(),f()})},{deep:!0});function B(L){L&&(L.stopPropagation(),L.preventDefault());const{schema:q}=w;q.buttons||(q.buttons=[]);const Q=Xe("response-toolbar-item");Q.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,Q.appearance={class:"btn btn-secondary"},q.buttons.push(Q)}function j(){return i.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},[i.createVNode("span",{class:"f-icon f-icon-amplification mr-1",style:"font-size: 12px;"},null),i.createVNode("span",{class:"farris-tag-add-text"},[i.createTextVNode("添加按钮")])])}function _(){return n.value.map((L,q)=>N(L,q))}return()=>{var L;return i.createVNode("div",{ref:s,"data-dragref":`${w.schema.id}-container`,class:k.value,id:t.id},[i.createVNode("div",{ref:o,class:x.value,onClick:q=>S(q)},[i.createVNode("div",{ref:r,class:"d-block f-response-content"},[(L=n.value)!=null&&L.length?_():j()])])])}}}),Pt=Ie;ke.register=(t,e,n,o)=>{t["response-toolbar"]=ke,e["response-toolbar"]=Ie,o["response-toolbar"]={eventHandlerResolver:Vn}},ke.registerDesigner=(t,e,n)=>{t["response-toolbar"]=St,e["response-toolbar"]=Ie,t["response-toolbar-item"]=Tt,e["response-toolbar-item"]=Nn},ee.withInstall(ke);const Gn=i.defineComponent({name:"FPageHeaderDesign",props:Ve,emits:["click"],setup(t,e){const n=i.ref(),o=i.inject("designer-host-service"),r=i.inject("design-item-context"),s=Tn(r.schema,o),a=gn(n,r,s),m=i.ref(r.schema.toolbar||{type:"response-toolbar",buttons:[]}),c=i.ref(Pt(m.value));i.onMounted(()=>{n.value.componentInstance=a}),i.watch(()=>r.schema.toolbar,()=>{m.value=r.schema.toolbar||{type:"response-toolbar",buttons:[]},c.value=Pt(m.value)},{deep:!0});const h=i.computed(()=>[...c.value.items]);function w(T,F,E,g){r&&r.setupContext&&r.setupContext.emit("selectionChange",T,F,E,g)}e.expose(a.value);function d(T,F){T&&F&&F.split(" ").reduce((g,V)=>(g[V]=!0,g),T)}const p=i.computed(()=>{const T={"f-title-icon":!0};return d(T,t.iconClass),T}),b=i.computed(()=>{const T={"f-icon":!0};return d(T,t.icon),T}),u=i.computed(()=>{const T={"text-right":!0,"col-6":!0};return d(T,t.buttonClass||""),T}),l=i.computed(()=>{const T={"f-title":!0};return ee.getCustomClass(T,t.titleContentClass)}),P=i.computed(()=>{const T={"f-content":!0};return ee.getCustomClass(T,t.contentClass)}),I=i.computed(()=>{const T={"f-page-header-extend":!0};return ee.getCustomClass(T,t.downContentClass)});function M(){return t.titleContentHtml?i.createVNode("div",{class:l.value,innerHTML:t.titleContentHtml},null):i.createVNode("div",{class:"f-title"},[t.showIcon&&t.icon?i.createVNode("span",{class:p.value},[i.createVNode("i",{class:b.value},null)]):"",i.createVNode("h4",{class:"f-title-text"},[t.title])])}function O(){return t.contentHtml?i.createVNode("div",{class:P.value,innerHTML:t.contentHtml},null):null}function N(){return t.downContentHtml?i.createVNode("div",{class:I.value,innerHTML:t.downContentHtml},null):null}return()=>i.createVNode("div",{ref:n},[i.createVNode("nav",{class:"f-page-header-base"},[M(),O(),i.createVNode(Ct,{class:u.value,modelValue:m.value,"onUpdate:modelValue":T=>m.value=T,canAdd:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:m.value.id,componentId:t.componentId,onSelectionChange:w},{default:()=>[i.createVNode(St,{id:m.value.id,customClass:"w-100",items:h.value,componentId:t.componentId},null)]})]),N()])}}),Yn={install(t){t.component(Ee.name,Ee)},register(t,e,n,o){t["page-header"]=Ee,e["page-header"]=lt,o["page-header"]={eventHandlerResolver:dt}},registerDesigner(t,e,n){t["page-header"]=Gn,e["page-header"]=ct}};ne.PageHeader=Ee,ne.default=Yn,ne.eventHandlerResolver=dt,ne.pageHeaderDesignerProps=Ve,ne.pageHeaderProps=Pe,ne.propsDesignResolver=ct,ne.propsResolver=lt,Object.defineProperties(ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});