@farris/ui-vue 1.5.7 → 1.5.9

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 (128) hide show
  1. package/components/avatar/index.esm.js +5 -5
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/component/index.esm.js +5 -5
  4. package/components/component/index.umd.cjs +1 -1
  5. package/components/condition/index.esm.js +5 -5
  6. package/components/condition/index.umd.cjs +1 -1
  7. package/components/content-container/index.esm.js +5 -5
  8. package/components/content-container/index.umd.cjs +1 -1
  9. package/components/date-picker/index.esm.js +1082 -1421
  10. package/components/date-picker/index.umd.cjs +1 -1
  11. package/components/designer-canvas/index.esm.js +908 -897
  12. package/components/designer-canvas/index.umd.cjs +1 -1
  13. package/components/dynamic-form/index.esm.js +5 -5
  14. package/components/dynamic-form/index.umd.cjs +1 -1
  15. package/components/dynamic-view/index.esm.js +5 -5
  16. package/components/dynamic-view/index.umd.cjs +1 -1
  17. package/components/events-editor/index.esm.js +5 -5
  18. package/components/events-editor/index.umd.cjs +1 -1
  19. package/components/filter-bar/index.esm.js +13 -12
  20. package/components/filter-bar/index.umd.cjs +1 -1
  21. package/components/flow-canvas/index.esm.js +5 -5
  22. package/components/flow-canvas/index.umd.cjs +1 -1
  23. package/components/number-range/index.esm.js +5 -5
  24. package/components/number-range/index.umd.cjs +1 -1
  25. package/components/number-spinner/index.esm.js +5 -5
  26. package/components/number-spinner/index.umd.cjs +1 -1
  27. package/components/page-header/index.esm.js +862 -3625
  28. package/components/page-header/index.umd.cjs +1 -1
  29. package/components/property-panel/index.esm.js +5 -5
  30. package/components/property-panel/index.umd.cjs +1 -1
  31. package/components/query-solution/index.esm.js +77 -76
  32. package/components/query-solution/index.umd.cjs +6 -6
  33. package/components/response-layout/index.esm.js +5 -5
  34. package/components/response-layout/index.umd.cjs +1 -1
  35. package/components/response-toolbar/index.esm.js +500 -3662
  36. package/components/response-toolbar/index.umd.cjs +1 -1
  37. package/components/schema-selector/index.esm.js +3008 -7347
  38. package/components/schema-selector/index.umd.cjs +6 -6
  39. package/components/section/index.esm.js +117 -7544
  40. package/components/section/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +545 -4943
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/components/textarea/index.esm.js +100 -5841
  44. package/components/textarea/index.umd.cjs +2 -2
  45. package/components/time-picker/index.esm.js +5 -5
  46. package/components/time-picker/index.umd.cjs +1 -1
  47. package/components/video/index.esm.js +5 -5
  48. package/components/video/index.umd.cjs +1 -1
  49. package/designer/button-edit/index.css +1 -0
  50. package/designer/button-edit/index.esm.js +1556 -0
  51. package/designer/button-edit/index.umd.cjs +1 -0
  52. package/designer/checkbox/index.esm.js +207 -0
  53. package/designer/checkbox/index.umd.cjs +1 -0
  54. package/designer/checkbox-group/index.esm.js +377 -0
  55. package/designer/checkbox-group/index.umd.cjs +1 -0
  56. package/designer/data-grid/index.css +1 -0
  57. package/designer/data-grid/index.esm.js +14332 -0
  58. package/designer/data-grid/index.umd.cjs +20 -0
  59. package/designer/data-view/index.esm.js +271 -0
  60. package/designer/data-view/index.umd.cjs +1 -0
  61. package/designer/date-picker/index.esm.js +1879 -0
  62. package/designer/date-picker/index.umd.cjs +1 -0
  63. package/designer/drawer/index.css +1 -0
  64. package/designer/drawer/index.esm.js +463 -0
  65. package/designer/drawer/index.umd.cjs +1 -0
  66. package/designer/farris-designer.all.esm.js +16827 -0
  67. package/designer/farris-designer.all.umd.cjs +32 -0
  68. package/designer/index.css +1 -0
  69. package/designer/input-group/index.esm.js +647 -0
  70. package/designer/input-group/index.umd.cjs +1 -0
  71. package/designer/radio-group/index.esm.js +6959 -0
  72. package/designer/radio-group/index.umd.cjs +1 -0
  73. package/designer/response-toolbar/index.esm.js +3015 -0
  74. package/designer/response-toolbar/index.umd.cjs +1 -0
  75. package/designer/section/index.esm.js +744 -0
  76. package/designer/section/index.umd.cjs +1 -0
  77. package/designer/tabs/index.esm.js +2200 -0
  78. package/designer/tabs/index.umd.cjs +1 -0
  79. package/designer/textarea/index.esm.js +249 -0
  80. package/designer/textarea/index.umd.cjs +1 -0
  81. package/designer/tree-grid/index.css +1 -0
  82. package/designer/tree-grid/index.esm.js +1673 -0
  83. package/designer/tree-grid/index.umd.cjs +1 -0
  84. package/farris.all.esm.js +30447 -30444
  85. package/farris.all.umd.cjs +16 -16
  86. package/package.json +1 -1
  87. package/types/date-picker/designer.d.ts +29 -0
  88. package/types/date-picker/index.d.ts +2 -1
  89. package/types/date-picker/src/date-picker.props.d.ts +0 -5
  90. package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
  91. package/types/designer-canvas/index.d.ts +2 -2
  92. package/types/response-toolbar/designer.d.ts +37 -0
  93. package/types/response-toolbar/index.d.ts +6 -5
  94. package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
  95. package/types/response-toolbar/src/composition/types.d.ts +1 -1
  96. package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
  97. package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
  98. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
  99. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
  100. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
  101. package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
  102. package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
  103. package/types/section/designer.d.ts +26 -0
  104. package/types/section/index.d.ts +1 -0
  105. package/types/section/src/designer/section-header.design.component.d.ts +2 -2
  106. package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
  107. package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
  108. package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
  109. package/types/section/src/designer/section.design.props.d.ts +11 -0
  110. package/types/section/src/designer/use-designer-rules.d.ts +1 -2
  111. package/types/section/src/property-config/section.property-config.d.ts +1 -1
  112. package/types/section/src/schema/schema-resolver.d.ts +1 -1
  113. package/types/section/src/section.props.d.ts +0 -10
  114. package/types/tabs/designer.d.ts +28 -0
  115. package/types/tabs/index.d.ts +1 -0
  116. package/types/tabs/src/components/tab-page.props.d.ts +0 -1
  117. package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
  118. package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
  119. package/types/tabs/src/tabs.props.d.ts +0 -11
  120. package/types/textarea/designer.d.ts +28 -0
  121. package/types/textarea/index.d.ts +0 -15
  122. package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
  123. package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
  124. package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
  125. package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
  126. package/types/textarea/src/textarea.props.d.ts +0 -5
  127. package/components/textarea/index.css +0 -1
  128. /package/{components/section → designer/radio-group}/index.css +0 -0
@@ -0,0 +1 @@
1
+ (function(Z,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("../../components/common/index.umd.js"),require("../../components/dynamic-resolver/index.umd.js"),require("../../components/response-toolbar/index.umd.js"),require("vue"),require("../../components/designer-canvas/index.umd.js"),require("../../components/property-panel/index.umd.js"),require("lodash-es"),require("../../components/tabs/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../../components/common/index.umd.js","../../components/dynamic-resolver/index.umd.js","../../components/response-toolbar/index.umd.js","vue","../../components/designer-canvas/index.umd.js","../../components/property-panel/index.umd.js","lodash-es","../../components/tabs/index.umd.js"],Y):(Z=typeof globalThis<"u"?globalThis:Z||self,Y(Z["response-toolbar"]={},Z.common,Z.dynamicResolver,Z.responseToolbar,Z.Vue,Z.designerCanvas,Z.propertyPanel,Z.LodashES,Z.tabs))})(this,function(Z,Y,re,je,r,pe,Ae,he,st){"use strict";var ln=Object.defineProperty;var an=(Z,Y,re)=>Y in Z?ln(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:re}):Z[Y]=re;var J=(Z,Y,re)=>an(Z,typeof Y!="symbol"?Y+"":Y,re);const lt=new Map([["buttons","items"],["appearance",re.resolveAppearance]]);function ve(t,d,n){return d}const at={$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:"点击事件"}},ct={$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"]},dt=Object.assign({},je.responseToolbarProps,{componentId:{type:String,default:""}}),ye=re.createPropsResolver(je.responseToolbarProps,at,lt,ve),Ve={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}},ut=re.createPropsResolver(Ve,ct,void 0,ve),ft=re.createResponseToolbarEventHandlerResolver(),pt={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0}};class Oe{constructor(d){J(this,"id","");J(this,"class","btn-secondary");J(this,"icon","");J(this,"groupId","");J(this,"order",-1);J(this,"asDropDownTop",!1);J(this,"text","");J(this,"visible",!0);J(this,"shown",!0);J(this,"responsed",!1);J(this,"tipsEnable",!1);J(this,"tipsText","");J(this,"width",0);J(this,"dropdownClass","");J(this,"onClick",()=>{});J(this,"options");var c,a;this.options=d;const n=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","dropdownClass","onClick"];Object.keys(d).filter(l=>n.indexOf(l)>-1).forEach(l=>{l==="visible"?this[l]=d[l]===void 0?!0:d[l]:this[l]=d[l]}),this.shown=this.visible,(c=d.appearance)!=null&&c.class&&(this.class=(a=d.appearance)==null?void 0:a.class)}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:r.computed(()=>!0)}setWidth(d){this.width=parseInt(d,10)}getWidth(){return this.visible?this.width:!1}}class ht extends Oe{constructor(d){super(d)}}function _e(){function t(d){const n=[];return d.reduce((c,a)=>(a.children&&a.children.length>0?c.push(new me(a)):c.push(new ht(a)),c),n),n}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:gt}=_e();class me extends Oe{constructor(n){super(n);J(this,"placement","");J(this,"visible",!0);J(this,"dropdownClass","");J(this,"menuClass","");J(this,"split",!1);J(this,"children",[]);J(this,"expanded",!1);J(this,"shown",!0);const c=["visible","icon","isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(n).filter(a=>c.indexOf(a)>-1).forEach(a=>{a==="visible"?this[a]=n[a]===void 0?!0:n[a]:this[a]=n[a]}),this.shown=this.visible,n.children&&n.children.length&&(this.children=gt(n.children))}}function Ce(){function t(n){const c={"f-icon":!0};if(n.icon){const a=n.icon.trim().split(" ");a&&a.length&&a.reduce((l,h)=>(l[h]=!0,l),c)}return c}function d(n){return!!(n.icon&&n.icon.trim())}return{iconClass:t,shouldShowIcon:d}}function mt(t,d){function n(s){const e={"dropdown-menu":!0};return Y.getCustomClass(e,s.menuClass)}function c(s){const e={disabled:!s.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return Y.getCustomClass(e,s.dropdownClass)}function a(s){const e={disabled:!s.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return Y.getCustomClass(e,s.dropdownClass)}function l(s){const e={disabled:!s.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0,"f-rt-toggle":!s.split,"btn-icontext":!!(s.icon&&s.icon.trim()),"dropdown-toggle":!s.split};return Y.getCustomClass(e,s.dropdownClass)}function h(s){const e={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(s.icon&&s.icon.trim()),"d-block":!0};return Y.getCustomClass(e,s.dropdownClass)}let g;const m=new Map;function T(s,e,y){s.stopPropagation();const w=y?y.id:"__top_item__";if(e.children&&e.children.length&&(e.expanded=!e.expanded,e.expanded)){if(m.has(w)&&m.get(w)!==e){const M=m.get(w);M&&(M.expanded=!1,m.delete(w))}m.set(w,e)}}function P(s,e){document.body.click(),e.enable&&(s.stopPropagation(),typeof e.onClick=="function"&&e.onClick(s,e.id),t.emit("click",s,e.id))}function C(s,e){const y=s.target;y.className.indexOf("dropdown-item")<0||(y.title=y.scrollWidth>y.clientWidth?e:"")}function v(s,e,y){if(e.tipsEnable&&e.tipsText){const w=r.reactive({content:e.tipsText,enable:e.tipsEnable});return r.withDirectives(r.createVNode("li",{class:a(e),id:e.id,key:e.id+"_"+y,onClick:M=>P(M,e)},[r.createVNode("span",{class:h(e)},[d.shouldShowIcon(e)&&r.createVNode("i",{class:d.iconClass(e)},null),e.text])]),[[r.resolveDirective("tooltip"),w]])}return r.createVNode("li",{class:a(e),id:e.id,onClick:w=>P(w,e)},[r.createVNode("span",{class:h(e),onMouseenter:w=>C(w,e.text)},[d.shouldShowIcon(e)&&r.createVNode("i",{class:d.iconClass(e)},null),e.text])])}function p(s,e,y){e.enable&&(typeof e.onClick=="function"&&y.onClick(s,e.id),t.emit("click",s,e.id),y.split||T(s,e,y))}function i(s,e,y){s&&s.stopPropagation(),T(s,e,y)}function D(s,e){s.stopPropagation();const y=e.id;if(e.children&&e.children.length&&e.expanded&&m.has(y)){const w=m.get(y);w&&(w.expanded=!1,m.delete(y))}}function O(s,e,y){if(e.tipsEnable&&e.tipsText){const w=r.reactive({content:e.tipsText,enable:e.tipsEnable});return r.createVNode("li",{class:c(e),id:e.id,key:e.id+"_"+y,onClick:M=>p(M,e,s)},[r.withDirectives(r.createVNode("span",{class:l(e)},[d.shouldShowIcon(e)&&r.createVNode("i",{class:d.iconClass(e)},null),e.text]),[[r.resolveDirective("tooltip"),w]]),e.split&&r.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:M=>i(M,e,s)},null),g(e,e)])}return r.createVNode("li",{class:c(e),id:e.id,onClick:w=>p(w,e,s),onMouseenter:w=>C(w,e.text)},[r.createVNode("span",{class:l(e)},[d.shouldShowIcon(e)&&r.createVNode("i",{class:d.iconClass(e)},null),e.text]),e.split&&r.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:w=>i(w,e,s)},null),g(e,e)])}function L(s){return s.children.filter(e=>e.visible).map((e,y)=>e.children&&e.children.length?O(s,e,y):v(s,e,y))}function A(s,e,y){const w={display:s.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1040,overflowY:"auto",maxHeight:"none"},M=window.innerWidth,H=window.innerHeight,b=e,o=b==null?void 0:b.getClientRects();if(b&&o&&o.length){const{top:S,width:k,left:f,right:I,height:B}=o[0],x=Math.ceil(B+S);w.top=`${x}px`,w.left=`${f}px`;const W=s.id+"_menu",q=e?e.querySelector("#"+W):null;if(q){q.style.visibility="hidden",q.style.display="block";const j=q.offsetHeight;w.display==="block"&&(q.style.display="block");const V=q.getBoundingClientRect();if(y){w.top=`${S-6}px`;const G=Math.ceil(k+f);w.left=`${G}px`}M-f-k<V.width&&(w.left=`${(y?f:I)-V.width}px`),H-S-B<j?S>j?(w.top=`${S-j-6}px`,w.maxHeight=`${S-16}px`):(w.maxHeight=`${H-x}px`,S>H-S-B&&(w.top="10px",w.maxHeight=`${S-16}px`)):w.maxHeight=`${H-x}px`,q.style.visibility="visible"}}return w}g=function(s,e){var H,b;const y=r.getCurrentInstance(),w=e?e.id:s.id,M=(b=(H=y==null?void 0:y.exposed)==null?void 0:H.elementRef.value)==null?void 0:b.querySelector("#"+w);return r.createVNode("ul",{class:n(s),style:A(s,M,e),id:s.id+"_menu",onWheel:o=>D(o,s)},[L(s)])};function N(){m.forEach(s=>{s.expanded=!1}),m.clear()}return{renderDropdownMenu:g,clearAllDropDownMenu:N}}function bt(t,d,n){const c=r.ref(t.alignment),{renderDropdownMenu:a,clearAllDropDownMenu:l}=mt(d,n);function h(i){const D={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":c.value==="right"||c.value==="center","f-btn-mr":c.value==="left"};return Y.getCustomClass(D,i.dropdownClass)}function g(i){const D={btn:!0,disabled:!i.enable,"f-rt-btn":!0,"btn-icontext":!!(i.icon&&i.icon.trim()),"f-rt-toggle":!i.split,"dropdown-toggle":!i.split};return Y.getCustomClass(D,i.class)}function m(i){const D={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return Y.getCustomClass(D,i.class)}function T(i){return i.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function P(i,D){i.stopPropagation();const O=D.expanded;document.body.click(),typeof D.onClick=="function"&&D.onClick(i,D.id),d.emit("click",i,D.id),D.split||(D.expanded=!O)}function C(i,D){i.stopPropagation();const O=D.expanded;document.body.click(),D.expanded=!O}function v(i,D=!0){if(i.tipsEnable&&i.tipsText){const O=r.reactive({content:i.tipsText,enable:i.tipsEnable});return r.createVNode("div",{id:i.id,class:h(i)},[r.withDirectives(r.createVNode("div",{class:g(i),style:T(i),onClick:L=>i.enable&&P(L,i)},[n.shouldShowIcon(i)&&r.createVNode("i",{class:n.iconClass(i)},null),r.createVNode("span",null,[i.text])]),[[r.resolveDirective("tooltip"),O]]),i.split&&r.createVNode("button",{class:m(i),style:"border-radius:0 6px 6px 0;",onClick:L=>C(L,i)},null),D&&a(i)])}return r.createVNode("div",{id:i.id,class:h(i)},[r.createVNode("div",{class:g(i),style:T(i),onClick:O=>i.enable&&P(O,i)},[n.shouldShowIcon(i)&&r.createVNode("i",{class:n.iconClass(i)},null),r.createVNode("span",null,[i.text])]),i.split&&r.createVNode("button",{class:m(i),style:"border-radius:0 6px 6px 0;",onClick:O=>C(O,i)},null),D&&a(i)])}function p(){l()}return{renderToolbarDropdown:v,clearAllDropDown:p}}const{buildResponseToolbarItems:$e}=_e(),vt=r.defineComponent({name:"FResponseToolbar",props:pt,emits:["click"],setup(t,d){const n=r.ref($e(t.items)),c=r.ref(),a=r.ref(),l=r.ref(),h={id:"__more_buttons__",text:"更多"},g=r.ref(new me(h)),m={id:h.id+"width",text:h.text},T=r.ref(-1),P=Ce();let C=!1;const v=r.computed(()=>g.value.children.length>0),p=r.computed(()=>{const x={"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 Y.getCustomClass(x,t.customClass)}),i=r.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"})),{renderToolbarDropdown:D,clearAllDropDown:O}=bt(t,d,P);function L(x){x&&x.target.closest("ul.dropdown-menu")&&x.type==="wheel"||(n.value.filter(W=>W.children&&W.children.length>0).forEach(W=>{W.expanded=!1}),g.value.expanded=!1,O())}function A(x,W){var V;const q={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":!!(x.icon&&x.icon.trim())},j=((V=x==null?void 0:x.appearance)==null?void 0:V.class)||x.class||"btn-secondary";return Y.getCustomClass(q,j)}function N(x,W){document.body.click(),typeof W.onClick=="function"&&W.onClick(x,W.id),d.emit("click",x,W.id)}function s(x,W){if(x.tipsEnable&&x.tipsText){const q=r.reactive({content:x.tipsText,enable:x.tipsEnable});return r.withDirectives(r.createVNode("button",{type:"button",class:A(x,W),id:x.id,disabled:!x.enable,onClick:j=>N(j,x)},[P.shouldShowIcon(x)&&r.createVNode("i",{class:P.iconClass(x)},null),x.text]),[[r.resolveDirective("tooltip"),q]])}return r.createVNode("button",{type:"button",class:A(x,W),id:x.id,disabled:!x.enable,onClick:q=>N(q,x)},[P.shouldShowIcon(x)&&r.createVNode("i",{class:P.iconClass(x)},null),x.text])}let e=new Map,y=[];function w(x){const W=Math.ceil(parseFloat(getComputedStyle(x).getPropertyValue("margin-left"))),q=Math.ceil(parseFloat(getComputedStyle(x).getPropertyValue("margin-right")));return(W||0)+x.getBoundingClientRect().width+(q||0)}function M(x,W,q){if(W<T.value){let j=q-1;for(;j>=0;j--){const V=x[j],G=w(V);if(W+=G,W>=T.value)break}q=j}return W-=T.value,{start:q,space:W}}function H(x){const W=l.value;let q=x;const V=Array.from(W.children).filter(te=>te.id!=="__more_buttons__"),G=V.length;let z=!1,U=0;for(;U<G;U++){const te=V[U],se=w(te);if(se<=q)q-=se;else{const K=M(V,q,U);U=K.start,q=K.space,z=!0;break}}if(!z&&y.length>0){const te=M(V,q,U);U=te.start,q=te.space}const F=y.length>0;for(;U<G;U++){const te=V[U],se=w(te);e.set(te.id,!0),y[F?"unshift":"push"]({id:te.id,width:se})}return q}function b(x){let W=H(x);if(y.length){let G=0;for(;G<y.length;G++){const z=t.items.find(U=>U.id===y[G].id);if(z&&z.visible!==!1){const U=y[G].width;if(W>=U||G===y.length-1&&W+T.value>=U)W-=U;else break}}for(let z=0;z<G;z++)e.delete(y[z].id);y.splice(0,G-1)}const q=Object.assign({},g.value);q.children=[];const j=new me(q),V=n.value.reduce((G,z)=>{const U=t.items.find(F=>F.id===z.id);return e.has(z.id)?(j.children.push(z),z.shown=!1):z.shown=U.visible!==!1,G.push(z),G},[]);g.value=j,n.value=V}function o(x=-1){if(x===0||!l.value||!a.value)return;x<0&&(x=a.value.getBoundingClientRect().width);const W=l.value.getBoundingClientRect().width;(x>=0&&x<W||y.length)&&(b(x),L())}function S(){return T.value<0&&r.createVNode("div",{style:"position:absolute;top:-30px;visibility:hidden;"},[D(new me(m))])}const k=new ResizeObserver(x=>{if(x.length){const q=x[0].contentRect.width;o(q)}});function f(){e=new Map,y=[]}function I(){a.value&&!C&&(k.observe(a.value),C=!0)}function B(){if(c.value&&T.value<0){const x=c.value.querySelector("#"+m.id);x&&(T.value=w(x))}}return r.onMounted(()=>{B(),o(),I(),document.body.addEventListener("click",L),document.body.addEventListener("wheel",L)}),r.onUnmounted(()=>{k.disconnect(),document.body.removeEventListener("click",L),document.body.removeEventListener("wheel",L)}),r.watch(()=>t.items,()=>{n.value=$e(t.items),g.value.children=[],r.nextTick(()=>{f(),o()})},{deep:!0}),r.watch(()=>t.visible,x=>{x&&r.nextTick(()=>{B(),o(),I()})}),d.expose({elementRef:c}),()=>r.createVNode("div",{class:p.value,id:t.id,ref:c,style:{"overflow-y":T.value<0?"hidden":"initial"}},[t.visible&&S(),t.visible&&r.createVNode("div",{ref:a,class:i.value},[r.createVNode("div",{ref:l,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[n.value.filter(x=>x.shown).map((x,W)=>x.children&&x.children.length>0?D(x):s(x,W)),v.value&&D(g.value)])])])}});class yt extends Ae.BaseControlProperty{constructor(n,c,a="response-toolbar"){super(n,c);J(this,"toolbarType","response-toolbar");this.toolbarType=a}getPropertyConfig(n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.toolbarType!=="tab-toolbar"&&this.getAppearancePropConfig(n),this.toolbarType==="response-toolbar"&&(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"}}}}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 Ct(t,d,n){const c=t.schema;function a(){var D;let i=((D=t.parent)==null?void 0:D.schema.type)||"";["page-header","tabs","section"].findIndex(O=>O===i)===-1&&(i=""),n.toolbarPosition=i}a();function l(i){return!1}function h(i,D){return D.text=i.label,D}function g(){return!1}function m(){return!1}function T(){return!1}function P(){return!0}function C(i){return new yt(i,d,c.type).getPropertyConfig(c)}function v(i){var A;i&&(i.stopPropagation(),i.preventDefault());const{schema:D}=t;D.buttons||(D.buttons=[]);let O="";if(D.type)O=D.type+"-item";else{const N=(A=t.parent)==null?void 0:A.schema.type;O=N==="tabs"?"tab-toolbar-item":N==="section"?"section-toolbar-item":"response-toolbar-item"}const L=re.getSchemaByType(O);L.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,D.buttons.push(L),n.updateToolbarItems(),n.changeSelectedId("")}function p(){return[{id:"appendItem",title:"新增按钮",text:"",icon:"f-icon f-icon-plus-circle text-white",onClick:i=>v(i)}]}return{canAccepts:l,checkCanAddComponent:T,checkCanDeleteComponent:m,checkCanMoveComponent:g,hideNestedPaddingInDesginerView:P,onResolveNewComponentSchema:h,getPropsConfig:C,getCustomButtons:p}}var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function be(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 Le={exports:{}};(function(t,d){(function(n){t.exports=n()})(function(){return function(){function n(c,a,l){function h(T,P){if(!a[T]){if(!c[T]){var C=typeof be=="function"&&be;if(!P&&C)return C(T,!0);if(g)return g(T,!0);var v=new Error("Cannot find module '"+T+"'");throw v.code="MODULE_NOT_FOUND",v}var p=a[T]={exports:{}};c[T][0].call(p.exports,function(i){var D=c[T][1][i];return h(D||i)},p,p.exports,n,c,a,l)}return a[T].exports}for(var g=typeof be=="function"&&be,m=0;m<l.length;m++)h(l[m]);return h}return n}()({1:[function(n,c,a){var l={},h="(?:^|\\s)",g="(?:\\s|$)";function m(C){var v=l[C];return v?v.lastIndex=0:l[C]=v=new RegExp(h+C+g,"g"),v}function T(C,v){var p=C.className;p.length?m(v).test(p)||(C.className+=" "+v):C.className=v}function P(C,v){C.className=C.className.replace(m(v)," ").trim()}c.exports={add:T,rm:P}},{}],2:[function(n,c,a){(function(l){var h=n("contra/emitter"),g=n("crossvent"),m=n("./classes"),T=document,P=T.documentElement;function C(o,S){var k=arguments.length;k===1&&Array.isArray(o)===!1&&(S=o,o=[]);var f,I,B,x,W,q,j,V,G,z=null,U,F,te=!1,se=0,K,_=S||{};_.moves===void 0&&(_.moves=A),_.accepts===void 0&&(_.accepts=A),_.invalid===void 0&&(_.invalid=Gt),_.containers===void 0&&(_.containers=o||[]),_.isContainer===void 0&&(_.isContainer=L),_.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=T.body);var ee=h({containers:_.containers,start:zt,end:Ze,cancel:nt,remove:tt,destroy:qt,canMove:Ht,dragging:!1});return _.removeOnSpill===!0&&ee.on("over",Yt).on("out",Xt),Ye(),ee;function Se(u){return ee.containers.indexOf(u)!==-1||_.isContainer(u)}function Ye(u){var E=u?"remove":"add";i(P,E,"mousedown",Wt),i(P,E,"mouseup",Pe)}function De(u){var E=u?"remove":"add";i(P,E,"mousemove",Ft)}function Xe(u){var E=u?"remove":"add";g[E](P,"selectstart",Qe),g[E](P,"click",Qe)}function qt(){Ye(!0),Pe({})}function Qe(u){U&&u.preventDefault()}function Wt(u){x=u.clientX,W=u.clientY;var E=D(u)!==1||u.metaKey||u.ctrlKey;if(!E){var R=u.target,$=Ie(R);$&&(U=$,De(),u.type==="mousedown"&&(y(R)?R.focus():u.preventDefault()))}}function Ft(u){if(U){if(D(u)===0){Pe({});return}if(!(u.clientX!==void 0&&Math.abs(u.clientX-x)<=(_.slideFactorX||0)&&u.clientY!==void 0&&Math.abs(u.clientY-W)<=(_.slideFactorY||0))){if(_.ignoreInputTextSelection){var E=b("clientX",u)||0,R=b("clientY",u)||0,$=T.elementFromPoint(E,R);if(y($))return}var X=U;De(!0),Xe(),Ze(),Je(X),m.add(V||B,"gu-transit"),Jt(),Qt(),se=0,Me(u)}}}function Ie(u){if(!(ee.dragging&&f)&&!Se(u)){for(var E=u;e(u)&&Se(e(u))===!1;)if(_.invalid(u,E)||(u=e(u),!u))return;var R=e(u);if(R&&!_.invalid(u,E)){var $=_.moves(u,R,E,M(u));if($)return{item:u,source:R}}}}function Ht(u){return!!Ie(u)}function zt(u){var E=Ie(u);E&&Je(E)}function Je(u){sn(u.item,u.source)&&(V=u.item.cloneNode(!0),ee.emit("cloned",V,u.item,"copy")),I=u.source,B=u.item,q=j=M(u.item),ee.dragging=!0,ee.emit("drag",B,I)}function Gt(){return!1}function Ze(){if(ee.dragging){var u=V||B;et(u,e(u))}}function Ke(){U=!1,De(!0),Xe(!0)}function Pe(u){if(Ke(),!!ee.dragging){var E=V||B,R=b("clientX",u)||0,$=b("clientY",u)||0,X=O(f,R,$),Q=ot(X,R,$);Q&&(V&&_.copySortSource||!V||Q!==I)?et(E,Q):_.removeOnSpill?tt():nt()}}function et(u,E){var R=e(u);V&&_.copySortSource&&E===I&&R.removeChild(B),Ee(E)?ee.emit("cancel",u,I):ee.emit("drop",u,E,I,j),ke()}function tt(){if(ee.dragging){var u=V||B,E=e(u);E&&E.removeChild(u),ee.emit(V?"cancel":"remove",u,E,I),ke()}}function nt(u){if(ee.dragging){var E=arguments.length>0?u:_.revertOnSpill,R=V||B,$=e(R),X=Ee($);X===!1&&E&&(V?$&&$.removeChild(V):I.insertBefore(R,q)),X||E?ee.emit("cancel",R,I,I):ee.emit("drop",R,$,I,j),ke()}}function ke(){var u=V||B;Ke(),Zt(),Kt(),u&&m.rm(u,"gu-transit"),G&&clearTimeout(G),ee.dragging=!1,z&&ee.emit("out",u,z,I),ee.emit("dragend",u,se),I=B=V=q=j=G=z=null}function Ee(u,E){var R;return E!==void 0?R=E:f?R=j:R=M(V||B),u===I&&R===q}function ot(u,E,R){for(var $=u;$&&!X();)$=e($);return $;function X(){var Q=Se($);if(Q===!1)return!1;var ce=rt($,u),ie=it($,ce,E,R),ae=Ee($,ie);return ae?!0:_.accepts(B,$,I,ie)}}function Me(u){if(!f)return;u.preventDefault();var E=b("clientX",u)||0,R=b("clientY",u)||0;f.style.left=E-2+"px",f.style.top=R-2+"px";var $=V||B,X=O(f,E,R),Q=ot(X,E,R),ce=Q!==null&&Q!==z;(ce||Q===null)&&(le(),z=Q,fe()),rn(X,R);var ie=e($);if(Q===I&&V&&!_.copySortSource){ie&&ie.removeChild($);return}var ae,ue=rt(Q,X);if(te=en(ue,Q),ue!==null)ae=it(Q,ue,E,R);else if(_.revertOnSpill===!0&&!V)ae=q,Q=I;else{V&&ie&&ie.removeChild($),V&&F&&(F.style.display="none");return}F.style.display="block",Ut(ae,$,ce),ae?nn(ue,ae):on(Q);function ne(oe){ee.emit(oe,$,z,I)}function fe(){ce&&ne("over")}function le(){z&&ne("out")}}function Ut(u,E,R){(u===E||u===M(E))&&(j=M(E)),(u===null&&R||u!==E&&u!==M(E))&&(j=u)}function Yt(u){m.rm(u,"gu-hide")}function Xt(u){ee.dragging&&m.add(u,"gu-hide")}function Qt(){f||(f=document.createElement("div"),f.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;",f.innerHTML=_.getMirrorText&&_.getMirrorText(B)||"控件",m.add(f,"gu-mirror"),_.mirrorContainer.appendChild(f),i(P,"add","mousemove",Me),m.add(_.mirrorContainer,"gu-unselectable"),ee.emit("cloned",f,B,"mirror"))}function Jt(){if(F=document.createElement("div"),m.add(F,"gu-insertion"),B){var u=B.getBoundingClientRect();F.style.left=u.left+"px",F.style.top=u.top+"px"}te=!1,_.mirrorContainer.appendChild(F)}function Zt(){f&&(m.rm(_.mirrorContainer,"gu-unselectable"),i(P,"remove","mousemove",Me),e(f).removeChild(f),f=null)}function Kt(){F&&(e(F).removeChild(F),F=null)}function rt(u,E){for(var R=E;R!==u&&e(R)!==u;)R=e(R);return R===P?null:R}function en(u,E){if(!E)return te;var R=u||E&&E.lastElementChild;if(!R)return!0;var $=getComputedStyle(u),X=/^inline/.test($.getPropertyValue("display"))||/^(left|right)$/.test($.getPropertyValue("float"));if(X)return!0;if(E){var Q=getComputedStyle(E),ce=Q.getPropertyValue("display");if(/flex$/.test(ce)){var ie=Q.getPropertyValue("flex-direction")||"row";if(ie==="row"||ie==="row-reverse")return!tn(E)}return!1}return!0}function tn(u){if(!u.children||!u.children.length)return!1;for(const E of Array.from(u.children)){const $=(E.className&&E.className.split(" ")||[]).filter(X=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(X));if(!$.length)return!1;for(const X of $){const Q=X.slice(X.lastIndexOf("-")+1);if(parseInt(Q,10)!==12)return!1}}return!0}function nn(u,E){const R=E.getBoundingClientRect();if(F.style.left=R.left+"px",F.style.top=R.top+"px",te){if(F.style.height=R.height+"px",F.style.width="4px",u){const $=u.getBoundingClientRect();$.top!==R.top&&(F.style.left=$.right+"px",F.style.top=$.top+"px",F.style.height=$.height+"px")}}else if(F.style.height="4px",F.style.width=R.width+"px",K){const $=K.getBoundingClientRect();R.top<$.top&&(F.style.display="none")}E===B&&B&&(F.style.display="none")}function on(u){j=null;var E=u.lastElementChild;if(E){var R=E.getBoundingClientRect();te?(F.style.left=R.right+"px",F.style.top=R.top+"px",F.style.height=R.height+"px",F.style.width="4px"):(F.style.left=R.left+"px",F.style.top=R.bottom+"px",F.style.height="4px",F.style.width=R.width+"px"),E===B&&B&&(F.style.display="none")}else F.style.display="none"}function rn(u,E){if(!_.mirrorContainer.contains(u)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(K=v(u),!K||!K.contains(u)))return;const R=document.querySelector(".dgComponentSelected"),$=K.getBoundingClientRect();if(E-30<$.top&&K.scrollTop>0){let X=K.scrollTop<10?K.scrollTop:10;K.scrollBy(0,-1*X),R&&K.contains(R)&&(se=se+-1*X)}if(E+30>$.bottom&&K.scrollTop<K.scrollHeight-K.clientHeight){const X=K.scrollHeight-K.clientHeight-K.scrollTop;let Q=X<10?X:10;K.scrollBy(0,Q),R&&K.contains(R)&&(se=se+Q)}}function it(u,E,R,$){var X=_.direction==="horizontal",Q=_.direction==="mixed",ce=E!==u?ae():ie();return ce;function ie(){var ne=u.children.length,fe,le,oe;for(fe=0;fe<ne;fe++)if(le=u.children[fe],oe=le.getBoundingClientRect(),X&&oe.left+oe.width/2>R||!Q&&!X&&oe.top+oe.height/2>$||Q&&oe.left+oe.width>R&&oe.top+oe.height>$)return le;return null}function ae(){var ne=E.getBoundingClientRect();if(Q){var fe=$-ne.top,le=R-ne.left,oe=ne.bottom-$,Be=ne.right-R,Ne=Math.min(le,Be,fe,oe),Re;return te?Re=Be<le:Re=oe===Ne||Be===Ne||le===Ne,ue(Re)}return ue(X?R>ne.left+N(ne)/2:$>ne.top+s(ne)/2)}function ue(ne){return ne?M(E):E}}function sn(u,E){return typeof _.copy=="boolean"?_.copy:_.copy(u,E)}}function v(o){const S=Array.from(window.scrollContainerList);if(S.length===1){const f=Array.from(window.scrollContainerList)[0];return document.getElementById(f)}const k=p(S);for(const f of k)if(f.contains(o))return f;return null}function p(o){const S=[];return o.forEach(k=>{const f=document.getElementById(k);f&&S.push(f)}),S.sort((k,f)=>k.contains(f)?1:f.contains(k)?-1:0),S}function i(o,S,k,f){var I={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},B={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},x={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};l.navigator.pointerEnabled?g[S](o,B[k],f):l.navigator.msPointerEnabled?g[S](o,x[k],f):(g[S](o,I[k],f),g[S](o,k,f))}function D(o){if(o.touches!==void 0)return o.touches.length;if(o.which!==void 0&&o.which!==0)return o.which;if(o.buttons!==void 0)return o.buttons;var S=o.button;if(S!==void 0)return S&1?1:S&2?3:S&4?2:0}function O(o,S,k){o=o||{};var f=o.className||"",I;return o.className+=" gu-hide",I=T.elementFromPoint(S,k),o.className=f,I}function L(){return!1}function A(){return!0}function N(o){return o.width||o.right-o.left}function s(o){return o.height||o.bottom-o.top}function e(o){return o.parentNode===T?null:o.parentNode}function y(o){return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"||w(o)}function w(o){return!o||o.contentEditable==="false"?!1:o.contentEditable==="true"?!0:w(e(o))}function M(o){return o.nextElementSibling||S();function S(){var k=o;do k=k.nextSibling;while(k&&k.nodeType!==1);return k}}function H(o){return o.targetTouches&&o.targetTouches.length?o.targetTouches[0]:o.changedTouches&&o.changedTouches.length?o.changedTouches[0]:o}function b(o,S){var k=H(S),f={pageX:"clientX",pageY:"clientY"};return o in f&&!(o in k)&&f[o]in k&&(o=f[o]),k[o]}c.exports=C}).call(this,typeof de<"u"?de:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(n,c,a){c.exports=function(h,g){return Array.prototype.slice.call(h,g)}},{}],4:[function(n,c,a){var l=n("ticky");c.exports=function(g,m,T){g&&l(function(){g.apply(T||null,m||[])})}},{ticky:10}],5:[function(n,c,a){var l=n("atoa"),h=n("./debounce");c.exports=function(m,T){var P=T||{},C={};return m===void 0&&(m={}),m.on=function(v,p){return C[v]?C[v].push(p):C[v]=[p],m},m.once=function(v,p){return p._once=!0,m.on(v,p),m},m.off=function(v,p){var i=arguments.length;if(i===1)delete C[v];else if(i===0)C={};else{var D=C[v];if(!D)return m;D.splice(D.indexOf(p),1)}return m},m.emit=function(){var v=l(arguments);return m.emitterSnapshot(v.shift()).apply(this,v)},m.emitterSnapshot=function(v){var p=(C[v]||[]).slice(0);return function(){var i=l(arguments),D=this||m;if(v==="error"&&P.throws!==!1&&!p.length)throw i.length===1?i[0]:i;return p.forEach(function(L){P.async?h(L,i,D):L.apply(D,i),L._once&&m.off(v,L)}),m}},m}},{"./debounce":4,atoa:3}],6:[function(n,c,a){(function(l){var h=n("custom-event"),g=n("./eventmap"),m=l.document,T=v,P=i,C=[];l.addEventListener||(T=p,P=D),c.exports={add:T,remove:P,fabricate:O};function v(e,y,w,M){return e.addEventListener(y,w,M)}function p(e,y,w){return e.attachEvent("on"+y,A(e,y,w))}function i(e,y,w,M){return e.removeEventListener(y,w,M)}function D(e,y,w){var M=N(e,y,w);if(M)return e.detachEvent("on"+y,M)}function O(e,y,w){var M=g.indexOf(y)===-1?b():H();e.dispatchEvent?e.dispatchEvent(M):e.fireEvent("on"+y,M);function H(){var o;return m.createEvent?(o=m.createEvent("Event"),o.initEvent(y,!0,!0)):m.createEventObject&&(o=m.createEventObject()),o}function b(){return new h(y,{detail:w})}}function L(e,y,w){return function(H){var b=H||l.event;b.target=b.target||b.srcElement,b.preventDefault=b.preventDefault||function(){b.returnValue=!1},b.stopPropagation=b.stopPropagation||function(){b.cancelBubble=!0},b.which=b.which||b.keyCode,w.call(e,b)}}function A(e,y,w){var M=N(e,y,w)||L(e,y,w);return C.push({wrapper:M,element:e,type:y,fn:w}),M}function N(e,y,w){var M=s(e,y,w);if(M){var H=C[M].wrapper;return C.splice(M,1),H}}function s(e,y,w){var M,H;for(M=0;M<C.length;M++)if(H=C[M],H.element===e&&H.type===y&&H.fn===w)return M}}).call(this,typeof de<"u"?de:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(n,c,a){(function(l){var h=[],g="",m=/^on/;for(g in l)m.test(g)&&h.push(g.slice(2));c.exports=h}).call(this,typeof de<"u"?de:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(n,c,a){(function(l){var h=l.CustomEvent;function g(){try{var m=new h("cat",{detail:{foo:"bar"}});return m.type==="cat"&&m.detail.foo==="bar"}catch{}return!1}c.exports=g()?h:typeof document<"u"&&typeof document.createEvent=="function"?function(T,P){var C=document.createEvent("CustomEvent");return P?C.initCustomEvent(T,P.bubbles,P.cancelable,P.detail):C.initCustomEvent(T,!1,!1,void 0),C}:function(T,P){var C=document.createEventObject();return C.type=T,P?(C.bubbles=!!P.bubbles,C.cancelable=!!P.cancelable,C.detail=P.detail):(C.bubbles=!1,C.cancelable=!1,C.detail=void 0),C}}).call(this,typeof de<"u"?de:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(n,c,a){var l=c.exports={},h,g;function m(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?h=setTimeout:h=m}catch{h=m}try{typeof clearTimeout=="function"?g=clearTimeout:g=T}catch{g=T}})();function P(s){if(h===setTimeout)return setTimeout(s,0);if((h===m||!h)&&setTimeout)return h=setTimeout,setTimeout(s,0);try{return h(s,0)}catch{try{return h.call(null,s,0)}catch{return h.call(this,s,0)}}}function C(s){if(g===clearTimeout)return clearTimeout(s);if((g===T||!g)&&clearTimeout)return g=clearTimeout,clearTimeout(s);try{return g(s)}catch{try{return g.call(null,s)}catch{return g.call(this,s)}}}var v=[],p=!1,i,D=-1;function O(){!p||!i||(p=!1,i.length?v=i.concat(v):D=-1,v.length&&L())}function L(){if(!p){var s=P(O);p=!0;for(var e=v.length;e;){for(i=v,v=[];++D<e;)i&&i[D].run();D=-1,e=v.length}i=null,p=!1,C(s)}}l.nextTick=function(s){var e=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)e[y-1]=arguments[y];v.push(new A(s,e)),v.length===1&&!p&&P(L)};function A(s,e){this.fun=s,this.array=e}A.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={};function N(){}l.on=N,l.addListener=N,l.once=N,l.off=N,l.removeListener=N,l.removeAllListeners=N,l.emit=N,l.prependListener=N,l.prependOnceListener=N,l.listeners=function(s){return[]},l.binding=function(s){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(s){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],10:[function(n,c,a){(function(l){var h=typeof l=="function",g;h?g=function(m){l(m)}:g=function(m){setTimeout(m,0)},c.exports=g}).call(this,n("timers").setImmediate)},{timers:11}],11:[function(n,c,a){(function(l,h){var g=n("process/browser.js").nextTick,m=Function.prototype.apply,T=Array.prototype.slice,P={},C=0;a.setTimeout=function(){return new v(m.call(setTimeout,window,arguments),clearTimeout)},a.setInterval=function(){return new v(m.call(setInterval,window,arguments),clearInterval)},a.clearTimeout=a.clearInterval=function(p){p.close()};function v(p,i){this._id=p,this._clearFn=i}v.prototype.unref=v.prototype.ref=function(){},v.prototype.close=function(){this._clearFn.call(window,this._id)},a.enroll=function(p,i){clearTimeout(p._idleTimeoutId),p._idleTimeout=i},a.unenroll=function(p){clearTimeout(p._idleTimeoutId),p._idleTimeout=-1},a._unrefActive=a.active=function(p){clearTimeout(p._idleTimeoutId);var i=p._idleTimeout;i>=0&&(p._idleTimeoutId=setTimeout(function(){p._onTimeout&&p._onTimeout()},i))},a.setImmediate=typeof l=="function"?l:function(p){var i=C++,D=arguments.length<2?!1:T.call(arguments,1);return P[i]=!0,g(function(){P[i]&&(D?p.apply(null,D):p.call(null),a.clearImmediate(i))}),i},a.clearImmediate=typeof h=="function"?h:function(p){delete P[p]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Le);var xt=Le.exports;const qe=wt(xt);function Tt(t){let d;function n(a,l,h,g){const m=t.schema;if(!(m!=null&&m.buttons))return;let T;if(h){const p=h.getAttribute("id");T=Array.from(l.children).findIndex(i=>i.getAttribute("id")===p)}else T=Array.from(l.children).length;const P=a.getAttribute("id"),C=Array.from(l.children).findIndex(p=>p.getAttribute("id")===P),v=m.buttons[C];C!==T&&C>-1&&T>-1&&(C<T&&(T=T-1),m.buttons.splice(C,1),m.buttons.splice(T,0,v),g(),r.nextTick(()=>{const p=l.querySelector(".dgComponentSelected");p!=null&&p.className.includes("dgComponentSelected")&&(p.classList.remove("dgComponentSelected"),p.classList.remove("dgComponentFocused"),p.click()),pe.canvasChanged.value++}))}function c(a,l,h){d&&d.destroy(),!(!qe||!a||!l)&&(d=qe([a],{mirrorContainer:l,direction:"horizontal",getMirrorText(g){return g.innerText},moves(g,m,T){let P=!0;return T.classList.contains("dropdown-item")?(P=!1,P):(g.classList.contains("no-drag")&&(P=!1),P)}}).on("drop",(g,m,T,P)=>n(g,m,P,h)))}return{dragulaInstance:d,initDragula:c}}function St(t,d,n){const{renderToolbarItemDesigner:c,actionHandlers:a}=n;let l;function h(A){l=A}function g(A,N=null){const s=d.value.find(e=>e.id===A.id);if(s.isDP)if(document.body.click(),typeof N=="boolean")s.expanded=N;else{const e=A.expanded;s.expanded=!e}}a.toggleDropdownMenu=g;function m(A){var s;const N={"dropdown-menu":!0};if(A.class){const e=(s=A.menuClass)==null?void 0:s.split(" ");e&&e.length&&e.reduce((y,w)=>(y[w]=!0,y),N)}return N}function T(A){var e;const N={disabled:A.disabled===!1,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0},s=(e=A.dropdownClass)==null?void 0:e.split(" ");return s&&s.length&&s.reduce((y,w)=>(y[w]=!0,y),N),N}function P(A){const N={disabled:!1,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0,"text-truncate":!0},s=(A.class||"").split(" ");return s&&s.length&&s.reduce((e,y)=>(e[y]=!0,e),N),N}let C;const v=new Map;function p(A,N,s){A.stopPropagation();const e=s?s.id:"__top_item__";if(N.children&&N.children.length&&(N.expanded=!N.expanded,N.expanded)){if(v.has(e)&&v.get(e)!==N){const y=v.get(e);y&&(y.expanded=!1,v.delete(e))}v.set(e,N)}}function i(A){var N;return(N=A.children)==null?void 0:N.map((s,e)=>s.children&&s.children.length?r.createVNode("li",{class:T(s),id:s.id},[r.createVNode("span",{class:P(s),onClick:y=>p(y,s,A)},[s.text,r.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),C(s,s)]):c(s,e,!0))}function D(A,N,s,e){const{height:M,left:H,top:b}=e[0],{width:o,height:S}=s.getBoundingClientRect(),{marginTop:k,marginBottom:f}=getComputedStyle(s),I=Math.ceil(parseFloat(k))+Math.ceil(parseFloat(f)),B=b+M,x=N==null?void 0:N.getBoundingClientRect();function W(){let G=0,z="left";const U=x?x.right:window.innerWidth,F=x?x.left:0;return G=U-H-10,U-H<o&&H-F>U-H&&(z="right",G=H-F-10),{hposition:z,maxWidth:Math.min(G,300)}}let q=0,j="bottom";if(A==="tabs"||A==="section")q=N.getBoundingClientRect().bottom-B-I-10;else{const G=x?x.bottom:window.innerHeight;q=A==="page-header"?G-B:b,q=q-I-10,j=A==="page-header"?"bottom":"top"}const V=W();return{position:j+"-"+V.hposition,maxWidth:V.maxWidth,maxHeight:q}}function O(A){var w,M,H;const N="300px",s={display:A.expanded===!0?"block":"none",position:"absolute",maxWidth:N,minWidth:"120px"};if(!(l!=null&&l.value))return s;const e=l.value.querySelector("#"+A.id),y=e==null?void 0:e.getClientRects();if(e&&y&&y.length>0){const b=e?e.querySelector("#"+A.id+"_menu"):null;if(!b||A.expanded!==!0)return s;b.style.visibility="hidden",b.style.display="block",b.style.maxHeight="auto",b.style.maxWidth=N;let o;switch(a.toolbarPosition){case"tabs":o=(w=l.value)==null?void 0:w.closest(".farris-tabs");break;case"section":o=(M=l.value)==null?void 0:M.closest(".f-section");break;default:o=(H=l.value)==null?void 0:H.closest(".f-page")}const S=D(a.toolbarPosition,o,b,y),{position:k,maxHeight:f,maxWidth:I}=S;b.style.visibility="visible";const B={left:k.indexOf("left")>-1?0:"unset",right:k.indexOf("left")>-1?"unset":0,bottom:k.indexOf("bottom")>-1?"unset":"100%",top:k.indexOf("bottom")>-1?"!00%":"unset",maxWidth:I?I+"px":"300px",maxHeight:f?f+"px":"auto",overflowY:f?"auto":"unset"};Object.assign(s,B)}return s}a.changeMenuPosition=O,C=function(A,N){return r.createVNode("ul",{class:m(A),style:O(A),id:A.id+"_menu"},[i(A)])};function L(A=""){A&&v.has(A)?v.forEach((N,s)=>{s!==A&&(N.expanded=!1,v.delete(s))}):(v.forEach(N=>{N.expanded=!1}),v.clear())}return{renderDropdownMenu:C,clearAllDropDownMenu:L,setResponseToolbarRef:h}}const Dt={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}},We=r.ref(0);function It(t,d){const n=d.getBoundingClientRect(),c=t.getBoundingClientRect(),a=c.top>=n.top,l=c.top<=n.bottom;return a&&l}function Pt(t){const d=t.querySelector(".component-btn-group");if(!d)return;d.style.display="";const n=d.getBoundingClientRect();if(!(n.top===0&&n.left===0)){const c=d.querySelector("div");if(c){const a=c.getBoundingClientRect();c.style.top=n.top+"px";let l=n.left-a.width;const h=document.querySelector(".editorDiv");if(h){const g=h.getBoundingClientRect();l<g.left&&({left:l}=t.getBoundingClientRect())}c.style.left=l+"px"}}}function kt(t){if(!window.scrollContainerList)return;const d=Array.from(window.scrollContainerList);if(d.length&&d.length===1){const n=d[0],c=document.querySelector(`[id=${n}]`);if(c&&c.contains(t))return c}}function Fe(t){if(!t)return;const d=t.getBoundingClientRect();if(d.width===0&&d.height===0)return;const n=t.querySelector(".component-btn-group");if(n){let c=!0;const a=kt(t);if(a&&(c=It(t,a)),!c){n.style.display="none";return}Pt(t)}}function Et(t){if(!t)return;let d;t.className.includes("dgComponentSelected")?d=t:d=t.querySelector(".dgComponentSelected"),d&&Fe(d)}const Mt={},Bt={};function He(t){const{properties:d,title:n,ignore:c}=t,a=c&&Array.isArray(c),l=Object.keys(d).reduce((h,g)=>((!a||!c.find(m=>m===g))&&(h[g]=d[g].type==="object"&&d[g].properties?He(d[g]):he.cloneDeep(d[g].default)),h),{});if(n&&(!a||!c.find(h=>h==="id"))){const h=n.toLowerCase().replace(/-/g,"_");l.id=`${h}_${Math.random().toString().slice(2,6)}`}return l}function Nt(t){const{properties:d,title:n,required:c}=t;if(c&&Array.isArray(c)){const a=c.reduce((l,h)=>(l[h]=d[h].type==="object"&&d[h].properties?He(d[h]):he.cloneDeep(d[h].default),l),{});if(n&&c.find(l=>l==="id")){const l=n.toLowerCase().replace(/-/g,"_");a.id=`${l}_${Math.random().toString().slice(2,6)}`}return a}return{type:n}}function ze(t,d={},n){const c=Mt[t];if(c){let a=Nt(c);const l=Bt[t];return a=l?l({getSchemaByType:ze},a,d,n):a,a}return null}function Rt(t,d,n){var y;const c="",a=r.ref();function l(){return!0}function h(){return!1}function g(){return!0}function m(){return!0}function T(){return!0}function P(w){if(!w||!w.value)return null;const M=r.ref(w==null?void 0:w.value.parent),H=P(M);return H||null}function C(w=d){var o;const{componentInstance:M,designerItemElementRef:H}=w;if(!M||!M.value)return null;const{getCustomButtons:b}=M.value;return M.value.canMove||M.value.canAdd||M.value.canDelete||b&&((o=b())!=null&&o.length)?H:C(w.parent)}function v(){}function p(w){return!!n}function i(){return(d==null?void 0:d.schema.label)||(d==null?void 0:d.schema.title)||(d==null?void 0:d.schema.name)}function D(){}function O(w,M){}function L(w){const{componentType:M}=w,H=r.inject("designer-host-service");let b=ze(M,w,H);const o=M.toLowerCase().replace(/-/g,"_");return b&&!b.id&&b.type===M&&(b.id=`${o}_${Math.random().toString().slice(2,6)}`),b}function A(w){}function N(...w){return[]}function s(){}function e(w){}return a.value={canMove:l(),canSelectParent:h(),canAdd:m(),canDelete:g(),canNested:!T(),contents:[],elementRef:t,parent:(y=d.parent)==null?void 0:y.componentInstance,schema:d.schema,styles:c,canAccepts:p,getBelongedComponentInstance:P,getDraggableDesignItemElement:C,getDraggingDisplayText:i,getPropConfig:N,getDragScopeElement:D,onAcceptMovedChildElement:O,onChildElementMovedOut:A,addNewChildComponentSchema:L,onRemoveComponent:s,triggerBelongedComponentToMoveWhenMoved:r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:r.ref(!1),onPropertyChanged:e,getCustomButtons:v},a}const jt=r.defineComponent({name:"FDesignerInnerItem",props:Dt,emits:["selectionChange","addComponent","removeComponent","clickButton"],setup(t,d){const n=r.ref(t.canMove),c=r.ref(t.canAdd),a=r.ref(t.canDelete),l=r.ref(!1),h=r.ref(t.contentKey),g=r.ref(t.childType),m=r.ref(t.childLabel),T=r.ref(t.modelValue),P=r.ref(""),C=r.ref(),v=r.inject("canvas-dragula"),p=r.ref(),i=r.inject("design-item-context"),D={designerItemElementRef:C,componentInstance:p,schema:T.value,parent:i,setupContext:d};r.provide("design-item-context",D);const O=r.computed(()=>{var B;const f=((B=p.value)==null?void 0:B.getCustomButtons)&&p.value.getCustomButtons();return{"farris-component":!0,"flex-fill":t.id==="root-component","position-relative":n.value||a.value||(f==null?void 0:f.length),"farris-nested":l.value,"can-move":n.value,"d-none":C.value&&C.value.classList.contains("d-none")}}),L=r.computed(()=>{const f={};return P.value&&P.value.split(";").reduce((I,B)=>{const[x,W]=B.split(":");return x&&(I[x]=W),I},f),f});function A(f,I){if(i&&i.schema[h.value]){const B=i.schema[h.value].findIndex(x=>x.id===I.id);if(B>-1){const x=i.schema[h.value].length,W=i.schema[h.value][B%x];i.designerItemElementRef.value.querySelector(`#${W.id}-design-item`),i.schema[h.value].splice(B,1),We.value++,d.emit("removeComponent"),d.emit("selectionChange")}}}function N(f){if(p.value.addNewChildComponentSchema){const I={componentType:g.value,label:m.value,parentComponentInstance:p.value,targetPosition:-1},B=p.value.addNewChildComponentSchema(I);T.value[h.value].push(B),d.emit("addComponent")}}function s(){return c.value&&r.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:f=>{N()}},[r.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function e(f){return a.value&&r.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:r.withModifiers(I=>A(I,f),["stop"])},[r.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function y(){return n.value&&r.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[r.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function w(){var I;const f=((I=p.value)==null?void 0:I.getCustomButtons)&&p.value.getCustomButtons();return f&&!!f.length&&f.map(B=>r.createVNode("div",{role:"button",class:`btn component-settings-button ${B.class||""} ${B.text?"settings-button-extend":""}`,title:B.title,ref:B.id,onClick:x=>B.onClick&&B.onClick(x)},[r.createVNode("i",{class:"f-icon "+B.icon},null),B.text&&r.createVNode("span",{class:"icon-text"},[B.text])]))}function M(f){return r.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[r.createVNode("div",null,[s(),y(),e(f),w()])])}r.watch(()=>t.modelValue,f=>{T.value=f,D.schema=f});function H(f){window.scrollContainerList||(window.scrollContainerList=new Set);const I=f.getAttribute("id");I&&window.scrollContainerList.add(I)}function b(f){const I=f.target;H(I),Et(I)}function o(){var f,I;(I=(f=T.value)==null?void 0:f.contents)!=null&&I.length&&C.value&&C.value.addEventListener("scroll",b)}function S(){const f=C.value,I=r.ref(f.children[1]);return Rt(I,D).value}r.onMounted(()=>{if(C.value){const f=C.value.querySelector(`[data-dragref='${T.value.id}-container']`);p.value=f&&f.componentInstance?f.componentInstance.value:S(),v&&f&&v.attachComponents(f,T.value),l.value=p.value.canNested!==void 0?p.value.canNested:l.value,c.value=p.value.canAdd!==void 0?p.value.canAdd:c.value,a.value=p.value.canDelete!==void 0?p.value.canDelete:a.value,n.value=p.value.canMove!==void 0?p.value.canMove:n.value,P.value=p.value.styles||"",C.value&&(C.value.componentInstance=p,C.value.designItemContext=D)}o(),We.value++}),r.onBeforeUnmount(()=>{C.value&&C.value.removeEventListener("scroll",b)});function k(f){f&&(f.preventDefault(),f.stopPropagation());let I=D.designerItemElementRef;const B=C.value;if(B){const x=document.getElementsByClassName("dgComponentFocused");x&&x.length===1&&x[0]===C.value&&C.value.classList.contains("dgComponentSelected")||(Array.from(x).forEach(q=>q.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(q=>q.classList.remove("dgComponentSelected")),B.classList.add("dgComponentFocused"),d.emit("selectionChange",T.value.type,T.value,t.componentId,p.value),p.value.getDraggableDesignItemElement&&(I=p.value.getDraggableDesignItemElement(D),I&&I.value&&I.value.classList.add("dgComponentSelected")))}Fe(I==null?void 0:I.value)}return()=>r.createVNode("div",{id:`${t.id}-design-item`,ref:C,class:O.value,style:L.value,onClick:k},[M(T.value),d.slots.default&&d.slots.default()])}});class At extends Ae.BaseControlProperty{constructor(n,c,a="response-toolbar-item"){super(n,c);J(this,"toolbarType","response-toolbar-item");this.toolbarType=a}getPropertyConfig(n,c=!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=l=>{if(l)switch(l&&l.propertyID){case"text":{l.needRefreshControlTree=!0;break}}},this.getAppearanceProperties(n,c);const a=this.getPropertyEditorParams(n,["Const","Variable","StateMachine","Expression"],"disabled");return this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:a}}),this.getEventPropConfig(n),this.propertyConfig}getAppearanceProperties(n,c=!1){this.propertyConfig.categories.appearance={title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"",$converter:"/converter/appearance.converter",visible:!c},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 c=[{label:"onClick",name:"点击事件"}],a=this,l=a.eventsEditorUtils.formProperties(n,a.viewModelId,c),h={};h[a.viewModelId]={type:"events-editor",editor:{initialData:l}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:h,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(g,m){const T=g.propertyValue;delete n[a.viewModelId],T&&(T.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(n,a.viewModelId,T.events,T))}}}}function we(t,d){if(!t)return!1;const n=d||[];return(n==null?void 0:n.findIndex(a=>a.id===t))===-1}function Ge(t,d){const n=d||[];let c={parentIndex:-1,itemIndex:-1};return n.some((a,l)=>{if(a.children&&a.children.length>0){const h=a.children.findIndex(g=>g.id===t);return h>-1?(c={parentIndex:l,itemIndex:h},!0):!1}}),c}function Ue(t,d){const n=d||[];let c={parentIndex:-1,itemIndex:-1};const a=n==null?void 0:n.findIndex(l=>l.id===t);return a>-1?{parent:null,item:n[a]}:(n.some((l,h)=>{if(l.children&&l.children.length>0){const g=l.children.findIndex(m=>m.id===t);return g>-1?(c={parentIndex:h,itemIndex:g},!0):!1}}),c.parentIndex<0?{parent:null,item:null}:{parent:n[c.parentIndex],item:n[c.parentIndex].children[c.itemIndex]})}function Vt(t,d){const n=d||[],c=n==null?void 0:n.findIndex(a=>a.id===t);return c>-1&&n[c].children&&n[c].children.length>0?n[c].expanded===!0:!1}function Ot(t,d,n){function c(b){return!1}function a(){return!1}function l(){return!1}function h(){return!1}function g(){return n.toolbarContext.schema.buttons||[]}function m(b,o=""){setTimeout(()=>{var I,B;const S=(I=t.parent)==null?void 0:I.designerItemElementRef.value;let k;o&&(k=S==null?void 0:S.querySelector("#"+o));const f=(B=k||S)==null?void 0:B.querySelector("#"+b);f==null||f.click()},0)}function T(b,o){o.disabled&&o.disabled.expressionId&&(o.disabled.expressionId=`${o.id}_disabled`),o.visible&&o.visible.expressionId&&(o.visible.expressionId=`${o.id}_visible`);const S=d.formSchemaUtils.getExpressions(),k=S.find(I=>I.target===b.id);if(!k||!k.rules||!k.rules.length)return;const f={target:o.id,rules:[],targetType:"Button"};k.rules.forEach(I=>{const B=Object.assign(he.cloneDeep(I),{id:`${o.id}_${I.type}`});f.rules.push(B)}),S.push(f)}function P(){const b=t.schema,o=Object.assign(he.cloneDeep(b),{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null});let S=[];return o.children&&o.children.length&&(S=o.children.map(k=>{const f=he.cloneDeep(k);return Object.assign(f,{id:`${t.schema.type}-cloned-${Math.random().toString(36).slice(2,6)}`,onClick:null}),T(k,f),f}),o.children=S),T(b,o),o}function C(){const b=t.schema.type||"response-toolbar-item",o=re.getSchemaByType(b),S=b.toLowerCase().replace("-","_");return o&&!o.id&&o.type===b&&(o.id=`${S}_${Math.random().toString().slice(2,6)}`,o.text="按钮"),o}function v(b){const o=g(),S=o==null?void 0:o.findIndex(f=>f.id===b),k=S===-1?null:o[S];return{index:S,toolbarItem:k}}function p(){const b=t.schema.id,o=g();return we(b,o)}function i(b){const o=d.formSchemaUtils.getExpressions();if(!o||!o.length)return;const S=k=>{const f=o&&o.findIndex(I=>I.target===k.id);f>-1&&o.splice(f,1)};S(b),b.children&&b.children.length&&b.children.forEach(k=>{S(k)})}function D(b){n.changeSelectedId(b)}function O(){var k,f;const b=g(),{parentIndex:o,itemIndex:S}=Ge(t.schema.id,b);o===-1||S===-1||(i(t.schema),b[o].children.splice(S,1),n.updateToolbarItems(),(k=t.setupContext)==null||k.emit("removeComponent"),(f=t.setupContext)==null||f.emit("selectionChange"))}function L(){var k,f;const b=t.schema.id,o=g(),S=o==null?void 0:o.findIndex(I=>I.id===b);S!==-1&&(i(o[S]),o==null||o.splice(S,1),n.updateToolbarItems(),(k=t.setupContext)==null||k.emit("removeComponent"),(f=t.setupContext)==null||f.emit("selectionChange"),pe.canvasChanged.value++)}function A(b="Append"){var B;const o=g(),{parentIndex:S,itemIndex:k}=Ge(t.schema.id,o);if(S===-1||k===-1)return;const f=C(),I=b==="Copy"?P():Object.assign({},f);o[S].children.splice(k+1,0,I),n.updateToolbarItems(),D(I.id),(B=t.setupContext)==null||B.emit("addComponent")}function N(b,o){const{index:S}=v(o);if(S===-1)return{index:S,schema:null};const k=C(),f=b==="Copy"?P():Object.assign({},k);return{index:S,schema:f}}function s(){var k;const b=t.schema.id,{index:o,schema:S}=N("Copy",b);S&&(g().splice(o+1,0,S),n.updateToolbarItems(),m(S.id),(k=t.setupContext)==null||k.emit("addComponent"))}function e(){var k;const b=t.schema.id,{index:o,schema:S}=N("Append",b);if(S&&t.parent){const I=g()[o].children||[];I.push(S);const B=g();B[o].children=I,n.updateToolbarItems(),D(S.id),(k=t.setupContext)==null||k.emit("addComponent")}}function y(b){let o;switch(t.schema.type){case"tab-toolbar-item":o=new st.TabToolbarItemProperty(b,d);break;default:o=new At(b,d,t.schema.type)}return o.getPropertyConfig(t.schema,p())}function w(b){b.stopPropagation(),b.stopImmediatePropagation()}function M(){const b=[{id:"delete",title:"删除",text:"",icon:"f-icon-yxs_delete",onClick:o=>{w(o),p()?O():L()}},{id:"copy",title:"复制",icon:"f-icon-yxs_copy",onClick:o=>{w(o);const{activeElement:S}=document,k=S?S.tagName.toLowerCase():"";k&&k==="input"||k==="textarea"?(S==null||S.blur(),r.nextTick(()=>{p()?A("Copy"):s()})):p()?A("Copy"):s()}}];return b.push(p()?{id:"appendSiblingButton",title:"",text:"新增同级",icon:"f-icon-plus-circle",onClick:o=>{w(o),A()}}:{id:"appendChildButton",title:"",text:"新增子级",icon:"f-icon-plus-circle",onClick:o=>{w(o),e()}}),b}function H(){const{schema:b}=t;i(b)}return{canAccepts:c,checkCanMoveComponent:a,checkCanDeleteComponent:l,checkCanAddComponent:h,getPropsConfig:y,getCustomButtons:M,onRemoveComponent:H}}const xe=r.defineComponent({name:"FResponseToolbarItemDesign",props:Ve,emits:["Click","dropdown","clearAll"],setup(t,d){const n=r.ref(t.alignment),c=Ce(),a=r.ref(),l=r.inject("designer-host-service"),h=r.inject("design-item-context"),g=r.inject("toolbar-item-action"),m=Ot(h,l,g),T=pe.useDesignerInnerComponent(a,h,m);r.onMounted(()=>{a.value.componentInstance=T}),d.expose(T.value);function P(){const s={"f-icon":!0},e=t.icon?t.icon.trim():"";return Y.getCustomClass(s,e)}function C(){return!!(t.icon&&t.icon.trim())}const v=r.computed(()=>{const s={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 Y.getCustomClass(s,t.class)}),p=r.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"}),i=r.computed(()=>{const s={btn:!0,"dropdown-toggle":!0,"f-btn-mr":n.value==="left","dropdown-toggle-split":!0,"no-drag":!0};return Y.getCustomClass(s,t.class)}),D=r.computed(()=>{let s={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||(s=Y.getCustomClass(s,t.class||"")),t.isDP&&(s=Y.getCustomClass(s,t.dropdownClass||"")),s});function O(s,e){e&&e.stopPropagation(),d.emit(s,{id:t.id,isDP:t.isDP})}function L(){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 A(){return r.createVNode("div",{ref:a,"data-dragref":`${h.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[r.createVNode("div",{class:L(),id:t.id},[r.createVNode("div",{class:v.value,style:p.value,onClick:()=>O("clearAll")},[c.shouldShowIcon(t)&&r.createVNode("i",{class:c.iconClass(t)},null),r.createVNode("span",null,[t.text]),!t.split&&r.createVNode("span",{class:"f-icon f-icon-arrow-chevron-down",style:"margin:0 0.5rem 0 0.25rem;",onClick:s=>O("dropdown",s)},null)]),t.split&&r.createVNode("button",{class:i.value,style:"border-radius:0 6px 6px 0;",onClick:s=>O("dropdown",s)},null),g.renderDropdownMenu(t.item,t.item)])])}function N(){return r.createVNode("li",{ref:a,"data-dragref":`${h.schema.id}-container`,id:t.id,class:D.value},[c.shouldShowIcon(t)&&r.createVNode("i",{class:c.iconClass(t)},null),t.text])}return()=>t.isDP?A():t.isDPItem?N():r.createVNode("div",{ref:a,"data-dragref":`${h.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[r.createVNode("button",{type:"button",class:v.value,id:t.id,onClick:()=>O("clearAll")},[C()&&r.createVNode("i",{class:P()},null),t.text])])}});function _t(t,d,n,c){function a(v,p,i,D){c.changeSelectedId((p==null?void 0:p.id)||""),n&&n.setupContext&&n.setupContext.emit("selectionChange",v,p,i,D)}function l(){}function h(v){const p=v.expanded;c.clearAllDropdown(),c.toggleDropdownMenu(v,!p)}function g(v){c.clearAllDropdown(v.isDP?v.id:"")}function m(v,p=""){const i=t.items||[],D=p||v,O=i.find(L=>L.id===D);return p?O.children.find(L=>L.id===v):O}function T(v,p=!1){if(!p)return;const i=v.target;i!=null&&i.classList.contains("dgComponentFocused")&&(i==null||i.classList.add("dgComponentSelected"))}function P(v,p=!1){if(!p)return;const i=v.target;i!=null&&i.classList.contains("dgComponentFocused")&&(i==null||i.classList.remove("dgComponentSelected"))}function C(v,p,i=!1){const D=m(v.id,v.parent),O=r.ref(D);return r.createVNode(jt,{key:D.id,class:["p-0",i?"d-block no-drag":"d-inline-block"],modelValue:O.value,"onUpdate:modelValue":L=>O.value=L,canMove:!1,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:t.componentId,id:D.id,onSelectionChange:a,onRemoveComponent:l,onMouseenter:L=>T(L,i),onMouseleave:L=>P(L,i)},{default:()=>{var L;return[r.createVNode(xe,{id:D.id,disabled:D.disabled,text:D.text,icon:D.icon,isDP:v.isDP,item:v,split:D.split,isDPItem:v.isDPItem,class:((L=v.appearance)==null?void 0:L.class)||"btn-secondary",alignment:t.alignment||"right",onDropdown:()=>h(v),onClearAll:A=>g(A),componentId:t.componentId},null)]}})}return{renderToolbarItemDesigner:C,actionHandlers:c}}function Te(t,d=!1,n=""){const c=[];return t.reduce((a,l)=>{if(l.children&&l.children.length>0){const h=Te(l.children,!0,l.id);a.push(Object.assign({},l,{children:h,isDPItem:!1,isDP:!0,parent:"",expanded:!1}))}else a.push(Object.assign({},l,{isDPItem:d,isDP:!1,parent:n}));return a},c),c}const ge=r.defineComponent({name:"FResponseToolbarDesign",props:dt,emits:["Click"],setup(t,d){const n=r.ref(Te(t.items)),c=r.ref(),a=r.ref(),l=r.ref(),h=r.ref("");let g=0;const m=15,T=r.inject("designer-host-service"),P=r.inject("design-item-context"),C={clearAllDropdown:j=>{},toggleDropdownMenu:j=>{},updateToolbarItems:()=>{},changeSelectedId:j=>{h.value=j},renderDropdownMenu:(j,V)=>{},toolbarContext:P,changeMenuPosition:(j,V,G)=>({}),toolbarPosition:""},v=Ct(P,T,C),p=pe.useDesignerComponent(l,P,v),i=r.inject("toolbar-item-handler"),{initDragula:D,dragulaInstance:O}=Tt(P),L=Ce(),A=_t(t,a,P,C),N=St(L,n,A),{renderToolbarItemDesigner:s}=A,{clearAllDropDownMenu:e,renderDropdownMenu:y,setResponseToolbarRef:w}=N;r.provide("toolbar-item-action",C),C.renderDropdownMenu=y,w(l),i&&(i.changeSelectedId=function(j){h.value=j});function M(){const j=a.value.querySelector(".dgComponentSelected");j&&pe.setPositionForSelectedElement(j)}function H(){if(h.value)if(we(h.value,n.value)){const{parent:j,item:V}=Ue(h.value,n.value);j&&(C.toggleDropdownMenu(j,!0),setTimeout(()=>{var U;const G=l.value.querySelector("#"+j.id),z=G==null?void 0:G.querySelector("#"+V.id);(((U=z==null?void 0:z.parentElement)==null?void 0:U.className)||"").indexOf("dgComponentFocused")<0&&(z==null||z.click())},0))}else M()}function b(j=""){n.value.filter(V=>V.id!==j&&V.children&&V.children.length>0).forEach(V=>{V.expanded=!1}),e(j)}C.clearAllDropdown=b;function o(){i&&i.updateToolbarItems&&i.updateToolbarItems()}C.updateToolbarItems=o;function S(j){if(j){const V=l.value.querySelector("#"+j.id),G=V.querySelector("#"+j.id+"_menu"),z=C.changeMenuPosition(j,V);Object.keys(z).forEach(U=>{G.style[U]=z[U]})}}function k(){const G=a.value.clientWidth,z=a.value.querySelectorAll(".farris-component>.f-rt-btn");z&&z.forEach(F=>{F.style.maxWidth=G-12+"px"});const U=a.value.querySelectorAll(".farris-component>.f-rt-dropdown");U&&U.forEach(F=>{F.querySelector(".dropdown-toggle-split")?F.querySelector(".f-rt-btn").style.maxWidth=G-38+"px":F.style.maxWidth=G-12+"px"})}const f=new ResizeObserver(j=>{var V;if(j.length){const z=j[0].contentRect.width;if(z===0){g=0;return}if(Math.abs(z-g)>m){if(g=z,we(h.value,n.value)){const{parent:U,item:F}=Ue(h.value,n.value);S(U)}else if(Vt(h.value,n.value)){const U=(V=n.value)==null?void 0:V.find(F=>F.id===h.value);S(U)}else b();k()}}});r.onMounted(()=>{f.observe(l.value),g=l.value.clientWidth,l.value.componentInstance=p,D(a.value,c.value,o)}),r.onUnmounted(()=>{f.disconnect(),O&&O.destroy&&O.destroy()}),d.expose(p.value);const I=r.computed(()=>{const j={"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 Y.getCustomClass(j,t.customClass)}),B=r.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}));r.watch(()=>t.items,()=>{n.value=Te(t.items),r.nextTick(()=>{H(),k()})},{deep:!0});function x(j){j&&(j.stopPropagation(),j.preventDefault());const{schema:V}=P;V.buttons||(V.buttons=[]);const G=re.getSchemaByType("response-toolbar-item");G.id=`toolbar_item_${Math.random().toString().slice(2,6)}`,G.appearance={class:"btn btn-secondary"},V.buttons.push(G)}function W(){return r.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:x},[r.createVNode("span",{class:"f-icon f-icon-amplification mr-1",style:"font-size: 12px;"},null),r.createVNode("span",{class:"farris-tag-add-text"},[r.createTextVNode("添加按钮")])])}function q(){return n.value.map((j,V)=>s(j,V))}return()=>{var j;return r.createVNode("div",{ref:l,"data-dragref":`${P.schema.id}-container`,class:I.value,id:t.id},[r.createVNode("div",{ref:c,class:B.value,onClick:V=>b(V)},[r.createVNode("div",{ref:a,class:"d-block f-response-content"},[(j=n.value)!=null&&j.length?q():W()])])])}}}),$t=ye;ge.register=(t,d,n,c)=>{t["response-toolbar"]=vt,d["response-toolbar"]=ye,c["response-toolbar"]={eventHandlerResolver:ft}},ge.registerDesigner=(t,d,n)=>{t["response-toolbar"]=ge,d["response-toolbar"]=ye,t["response-toolbar-item"]=xe,d["response-toolbar-item"]=ut};const Lt=Y.withInstall(ge);Z.FResponseToolbarDesign=ge,Z.FResponseToolbarItemDesign=xe,Z.default=Lt,Z.responseToolbarResolver=$t,Z.schemaResolver=ve,Object.defineProperties(Z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});