@farris/ui-vue 1.1.7 → 1.1.8

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 (142) hide show
  1. package/components/accordion/package.json +1 -1
  2. package/components/avatar/package.json +1 -1
  3. package/components/border-editor/index.esm.js +1362 -1361
  4. package/components/border-editor/index.umd.cjs +6 -6
  5. package/components/border-editor/package.json +1 -1
  6. package/components/button/package.json +1 -1
  7. package/components/button-edit/package.json +1 -1
  8. package/components/button-group/package.json +1 -1
  9. package/components/calculator/package.json +1 -1
  10. package/components/calendar/package.json +1 -1
  11. package/components/capsule/package.json +1 -1
  12. package/components/checkbox/package.json +1 -1
  13. package/components/color-picker/package.json +1 -1
  14. package/components/combo-list/index.esm.js +22 -21
  15. package/components/combo-list/index.umd.cjs +1 -1
  16. package/components/combo-list/package.json +1 -1
  17. package/components/combo-tree/index.esm.js +1370 -1369
  18. package/components/combo-tree/index.umd.cjs +1 -1
  19. package/components/combo-tree/package.json +1 -1
  20. package/components/common/package.json +1 -1
  21. package/components/component/package.json +1 -1
  22. package/components/condition/index.esm.js +180 -179
  23. package/components/condition/index.umd.cjs +1 -1
  24. package/components/condition/package.json +1 -1
  25. package/components/content-container/package.json +1 -1
  26. package/components/data-grid/index.esm.js +22 -21
  27. package/components/data-grid/index.umd.cjs +1 -1
  28. package/components/data-grid/package.json +1 -1
  29. package/components/data-view/index.esm.js +22 -21
  30. package/components/data-view/index.umd.cjs +1 -1
  31. package/components/data-view/package.json +1 -1
  32. package/components/date-picker/package.json +1 -1
  33. package/components/designer-canvas/index.esm.js +2270 -2269
  34. package/components/designer-canvas/index.umd.cjs +7 -7
  35. package/components/designer-canvas/package.json +1 -1
  36. package/components/designer-outline/index.esm.js +22 -21
  37. package/components/designer-outline/index.umd.cjs +1 -1
  38. package/components/designer-outline/package.json +1 -1
  39. package/components/designer-toolbox/package.json +1 -1
  40. package/components/discussion-editor/package.json +1 -1
  41. package/components/discussion-list/package.json +1 -1
  42. package/components/dropdown/package.json +1 -1
  43. package/components/dynamic-form/index.esm.js +180 -179
  44. package/components/dynamic-form/index.umd.cjs +1 -1
  45. package/components/dynamic-form/package.json +1 -1
  46. package/components/dynamic-resolver/package.json +1 -1
  47. package/components/dynamic-view/index.esm.js +3661 -3660
  48. package/components/dynamic-view/index.umd.cjs +1 -1
  49. package/components/dynamic-view/package.json +1 -1
  50. package/components/enum-editor/package.json +1 -1
  51. package/components/events-editor/package.json +1 -1
  52. package/components/expression-editor/package.json +1 -1
  53. package/components/external-container/index.esm.js +1365 -1364
  54. package/components/external-container/index.umd.cjs +7 -7
  55. package/components/external-container/package.json +1 -1
  56. package/components/field-selector/index.esm.js +182 -181
  57. package/components/field-selector/index.umd.cjs +1 -1
  58. package/components/field-selector/package.json +1 -1
  59. package/components/filter-bar/index.esm.js +182 -181
  60. package/components/filter-bar/index.umd.cjs +1 -1
  61. package/components/filter-bar/package.json +1 -1
  62. package/components/flow-canvas/index.esm.js +22 -21
  63. package/components/flow-canvas/index.umd.cjs +7 -7
  64. package/components/flow-canvas/package.json +1 -1
  65. package/components/image-cropper/package.json +1 -1
  66. package/components/input-group/package.json +1 -1
  67. package/components/layout/package.json +1 -1
  68. package/components/list-nav/package.json +1 -1
  69. package/components/list-view/index.esm.js +183 -182
  70. package/components/list-view/index.umd.cjs +1 -1
  71. package/components/list-view/package.json +1 -1
  72. package/components/loading/package.json +1 -1
  73. package/components/locale/package.json +1 -1
  74. package/components/lookup/index.esm.js +185 -184
  75. package/components/lookup/index.umd.cjs +1 -1
  76. package/components/lookup/package.json +1 -1
  77. package/components/mapping-editor/index.esm.js +181 -180
  78. package/components/mapping-editor/index.umd.cjs +1 -1
  79. package/components/mapping-editor/package.json +1 -1
  80. package/components/message-box/package.json +1 -1
  81. package/components/modal/package.json +1 -1
  82. package/components/nav/package.json +1 -1
  83. package/components/notify/package.json +1 -1
  84. package/components/order/index.esm.js +182 -181
  85. package/components/order/index.umd.cjs +1 -1
  86. package/components/order/package.json +1 -1
  87. package/components/page-footer/package.json +1 -1
  88. package/components/page-header/package.json +1 -1
  89. package/components/pagination/package.json +1 -1
  90. package/components/plugin/package.json +1 -1
  91. package/components/popover/package.json +1 -1
  92. package/components/progress/package.json +1 -1
  93. package/components/property-editor/index.esm.js +2810 -2810
  94. package/components/property-editor/index.umd.cjs +7 -7
  95. package/components/property-editor/package.json +1 -1
  96. package/components/property-panel/index.esm.js +180 -179
  97. package/components/property-panel/index.umd.cjs +1 -1
  98. package/components/property-panel/package.json +1 -1
  99. package/components/radio-button/package.json +1 -1
  100. package/components/radio-group/package.json +1 -1
  101. package/components/rate/package.json +1 -1
  102. package/components/response-layout/package.json +1 -1
  103. package/components/response-layout-editor/index.esm.js +182 -181
  104. package/components/response-layout-editor/index.umd.cjs +1 -1
  105. package/components/response-layout-editor/package.json +1 -1
  106. package/components/response-toolbar/package.json +1 -1
  107. package/components/schema-selector/index.esm.js +22 -21
  108. package/components/schema-selector/index.umd.cjs +1 -1
  109. package/components/schema-selector/package.json +1 -1
  110. package/components/search-box/package.json +1 -1
  111. package/components/section/package.json +1 -1
  112. package/components/smoke-detector/package.json +1 -1
  113. package/components/spacing-editor/index.esm.js +22 -21
  114. package/components/spacing-editor/index.umd.cjs +1 -1
  115. package/components/spacing-editor/package.json +1 -1
  116. package/components/splitter/package.json +1 -1
  117. package/components/step/package.json +1 -1
  118. package/components/switch/package.json +1 -1
  119. package/components/tabs/index.esm.js +939 -938
  120. package/components/tabs/index.umd.cjs +1 -1
  121. package/components/tabs/package.json +1 -1
  122. package/components/tags/package.json +1 -1
  123. package/components/text/package.json +1 -1
  124. package/components/time-picker/package.json +1 -1
  125. package/components/tooltip/package.json +1 -1
  126. package/components/transfer/index.esm.js +183 -182
  127. package/components/transfer/index.umd.cjs +1 -1
  128. package/components/transfer/package.json +1 -1
  129. package/components/tree-grid/index.esm.js +22 -21
  130. package/components/tree-grid/index.umd.cjs +7 -7
  131. package/components/tree-grid/package.json +1 -1
  132. package/components/tree-view/index.esm.js +186 -185
  133. package/components/tree-view/index.umd.cjs +1 -1
  134. package/components/tree-view/package.json +1 -1
  135. package/components/uploader/package.json +1 -1
  136. package/components/verify-detail/package.json +1 -1
  137. package/components/video/package.json +1 -1
  138. package/components/weather/package.json +1 -1
  139. package/farris.all.esm.js +26 -26
  140. package/farris.all.umd.cjs +2 -2
  141. package/package.json +1 -1
  142. package/types/property-editor/src/composition/use-initialized-value.d.ts +1 -1
@@ -1 +1 @@
1
- (function(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z.tabs={},z.Vue,z.LodashES))})(this,function(z,e,ee){"use strict";var hn=Object.defineProperty;var yn=(z,e,ee)=>e in z?hn(z,e,{enumerable:!0,configurable:!0,writable:!0,value:ee}):z[e]=ee;var W=(z,e,ee)=>yn(z,typeof e!="symbol"?e+"":e,ee);const de={},we={};function ue(t){const{properties:n,title:o}=t,s=Object.keys(n).reduce((a,r)=>(a[r]=n[r].type==="object"&&n[r].properties?ue(n[r]):ee.cloneDeep(n[r].default),a),{});return s.id=`${o}-${Date.now()}`,s}function Y(t,n={}){const o=de[t];if(o){let s=ue(o);const a=we[t];return s=a?a({getSchemaByType:Y},s,n):s,s}return null}function _e(t,n){const o=ue(n);return Object.keys(t).reduce((s,a)=>(s[a]=t[a],s),o),o}function qe(t,n){return Object.keys(t).filter(s=>t[s]!=null).reduce((s,a)=>{if(n.has(a)){const r=n.get(a);if(typeof r=="string")s[r]=t[a];else{const m=r(a,t[a],t);Object.assign(s,m)}}else s[a]=t[a];return s},{})}function We(t,n,o=new Map){const s=_e(t,n);return qe(s,o)}function ze(t={}){function n(y,C,c,i){if(typeof c=="number")return i[y].length===c;if(typeof c=="object"){const h=Object.keys(c)[0],b=c[h];if(h==="not")return Number(i[y].length)!==Number(b);if(h==="moreThan")return Number(i[y].length)>=Number(b);if(h==="lessThan")return Number(i[y].length)<=Number(b)}return!1}function o(y,C,c,i){return i[y]&&i[y].propertyValue&&String(i[y].propertyValue.value)===String(c)}const s=new Map([["length",n],["getProperty",o]]);Object.keys(t).reduce((y,C)=>(y.set(C,t[C]),y),s);function a(y,C){const c=y;return typeof C=="number"?[{target:c,operator:"length",param:null,value:Number(C)}]:typeof C=="boolean"?[{target:c,operator:"getProperty",param:y,value:!!C}]:typeof C=="object"?Object.keys(C).map(i=>{if(i==="length")return{target:c,operator:"length",param:null,value:C[i]};const h=i,b=C[i];return{target:c,operator:"getProperty",param:h,value:b}}):[]}function r(y){return Object.keys(y).reduce((c,i)=>{const h=a(i,y[i]);return c.push(...h),c},[])}function m(y,C){if(s.has(y.operator)){const c=s.get(y.operator);return c&&c(y.target,y.param,y.value,C)||!1}return!1}function T(y,C){return r(y).reduce((h,b)=>h&&m(b,C),!0)}function w(y,C){const c=Object.keys(y),i=c.includes("allOf"),h=c.includes("anyOf"),b=i||h,f=(b?y[b?i?"allOf":"anyOf":"allOf"]:[y]).map(V=>T(V,C));return i?!f.includes(!1):f.includes(!0)}return{parseValueSchema:w}}const Te={},Ue={};ze();function te(t,n,o=new Map,s=(m,T,w)=>T,a={},r=m=>m){return de[n.title]=n,we[n.title]=s,Te[n.title]=a,Ue[n.title]=r,(m={})=>{const T=We(m,n,o),w=Object.keys(t).reduce((y,C)=>(y[C]=t[C].default,y),{});return Object.assign(w,T)}}function oe(t,n){return{customClass:n.class}}const Ge=new Map([["appearance",oe]]);function Je(t,n,o){const s=t.getSchemaByType("tab-page");return n.contents=[s],n}const Ze={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tabs.schema.json",title:"tabs",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Tabs",type:"string"},type:{description:"The type string of Tabs component",type:"string",default:"tabs"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]}},required:["id","type","contents"]},Qe={title:"tabs",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"Splitter",enum:[]}},title:{title:"标题",type:"string",description:"标题"}}},appearance:{description:"",title:"外观",properties:{size:{description:"",type:"cascade",title:"尺寸",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}},titleWidth:{description:"标题区域宽度占页面比",type:"number",title:"标题区域宽度(%)",min:0,decimals:0,max:100},autoTitleWidth:{description:"开启,则显示全部字符;关闭,最多显示7个字符",type:"select",title:"标题自适应宽度",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},defaultValue:!1},contentFill:{description:"flex布局下,填充满剩余部分",type:"select",title:"填充",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},defaultValue:!1}}},behavior:{description:"",title:"行为",properties:{visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}}}}}},se={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropdown:{type:Boolean,default:!0},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1},justifyContent:{type:String,default:"left"}},pe=te(se,Ze,Ge,Je,Qe);function Xe(t,n,o){const s=e.ref([]),a=e.ref(t.activeId||""),r=e.ref(!0),m=e.ref([]);function T(p){const l=p.value.findIndex(f=>f.props.show!==!1&&!a.value&&!f.props.disabled);!a.value&&l!==-1&&(a.value=p.value[l].props.id)}function w(p){var f;if(t.autoTitleWidth)return;const l=(f=p.value)==null?void 0:f.querySelectorAll(".st-tab-text");if(l)for(let N=0;N<l.length;N++){const V=l[N].parentNode;l[N].scrollWidth>V.offsetWidth?l[N].classList.contains("farris-title-text-custom")||l[N].classList.add("farris-title-text-custom"):l[N].classList.remove("farris-title-text-custom")}}const y=p=>{p.preventDefault(),p.stopPropagation()};function C(p,l,f=!1){const N=s.value.findIndex(V=>V.props.id===l);s.value=s.value.filter(V=>V.props.id!==l),a.value===l&&(a.value="",T(s)),y(p),e.nextTick(()=>{w(o),f&&(r.value=!0),n.emit("tabRemove",{removeIndex:N,removeId:l,activeId:a.value})})}function c(p){const l=a.value;a.value=p;const f=s.value.find(N=>N.props.id===p);m.value=[],f&&f.props.toolbar&&f.props.toolbar.contents&&f.props.toolbar.contents.length&&(m.value=[...f.props.toolbar.contents]),n.emit("tabChange",{prevId:l,nextId:a.value})}function i(p){c(p)}function h(p){s.value.findIndex(f=>f.props.id===p.props.id)===-1&&s.value.push(p)}function b(p){s.value.findIndex(f=>f.props.id===p.props.id)!==-1&&(s.value.forEach(f=>{f.props.id===p.props.id&&(f=p)}),e.nextTick(()=>{w(o)}))}return{activeId:a,addTab:h,changeTitleStyle:w,removeTab:C,selectTab:i,selectTabByTabId:c,tabPages:s,updateTab:b,toolbarItems:m}}function Ye(t,n,o,s,a){const{activeId:r,removeTab:m,selectTab:T}=a,w=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":t.autoTitleWidth})),y=e.computed(()=>({"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===r.value,"f-state-disable":n.disabled})),C=e.computed(()=>({width:`${n.tabWidth}px`})),c=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===r.value,disabled:n.disabled}));function i(N){return e.createVNode("span",{class:w.value,title:N.title},[N.title])}function h(N){return N.slots.title?N.slots.title:i}const b=h(o),p=e.ref(n.removeable);function l(){return e.createVNode("span",{class:"st-drop-close",onClick:N=>m(N,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function f(N){T(n.id),t.tabType==="one-page"&&s.scrollToByPaggId(n.id)}return e.createVNode("li",{class:y.value,style:C.value},[e.createVNode("a",{class:c.value,onClick:f},[b(n),p.value&&l()])])}function Ke(t,n,o,s,a){const{shouldShowNavigationButtons:r}=o,{tabPages:m}=a,T=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),w=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),y=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":t.fill||t.tabType==="fill","nav-pills":t.tabType==="pills","flex-row":t.position==="top"||t.position==="bottom","flex-column":t.position==="left"||t.position==="right"}));return()=>e.createVNode("div",{class:T.value,style:w.value},[e.createVNode("ul",{class:y.value,ref:n},[m.value.map(C=>Ye(t,C.props,C,s,a))])])}const et={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/capsule.schema.json",title:"capsule",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a capsule",type:"string"},type:{description:"The type string of capsule component",type:"string",default:"capsule"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},tt=new Map([["appearance",oe]]);function nt(t,n,o){return n}const ot={title:"capsule",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},xe={items:{Type:Array,default:[{name:"升序",value:"asc",icon:"f-icon f-icon-col-ascendingorder"},{name:"降序",value:"desc",icon:"f-icon f-icon-col-descendingorder"}]},modelValue:{type:String,default:""},type:{type:String,default:"primary"}},st={name:{type:String,default:""},value:{type:String,default:""},isActive:{type:Boolean,default:!1},icon:{type:String,default:""},index:{type:Number,default:0}};te(xe,et,tt,nt,ot);const at=e.defineComponent({name:"FCapsuleItem",props:st,emits:["mounted","active"],setup(t,n){const o=e.ref(),s=e.ref(t.isActive);e.watch(()=>t.isActive,m=>{s.value=m});const a=e.computed(()=>({"f-capsule-item":!0,"f-capsule-active-item":s.value}));e.onMounted(()=>{n.emit("mounted",o,t.value)});function r(m){n.emit("active",m,{name:t.name,value:t.value})}return()=>e.createVNode("div",{ref:o,class:a.value,onClick:m=>r(m)},[t.icon&&e.createVNode("i",{class:t.icon},null),t.name])}}),rt=e.defineComponent({name:"FCapsule",props:xe,emits:["change","update:modelValue"],setup(t,n){const o=e.ref(t.items),s=e.ref(),a=2,r=e.ref(t.modelValue),m=e.ref("none"),T=e.ref(t.type),w=e.computed(()=>{const v={"f-capsule-container":!0};return T.value&&(v[T.value]=!0),v}),y=e.computed(()=>({})),C=e.computed(()=>({"f-capsule":!0})),c=e.ref(a),i=e.ref(0),h=e.ref(0),b=e.computed(()=>({left:`${c.value}px`,width:`${i.value}px`,transition:m.value})),p=e.computed(()=>({width:`${h.value}px`})),l=new Map;function f(v){var S;if(l.has(v.value)){const A=(S=l.get(v.value))==null?void 0:S.value;if(A){const j=A.getBoundingClientRect(),d=s.value.getBoundingClientRect();c.value=j.left-d.left+a+s.value.scrollLeft,i.value=j.width-2*a}}}function N(v,S){const A=v.value;r.value=A,n.emit("update:modelValue",A),f(v),S&&n.emit("change",A)}function V(v){const S=o.value.findIndex(A=>A.value===v);S>-1&&N(o.value[S],!1)}e.watch(()=>t.modelValue,v=>{r.value=v,V(r.value)}),e.watch(()=>t.items,async v=>{o.value=v,await e.nextTick(),V(r.value),h.value=Array.from(l.values()).reduce((S,A)=>(S+=A.value.clientWidth,S),0)}),e.onMounted(async()=>{V(r.value),await e.nextTick(),m.value="0.1s ease-out all",h.value=Array.from(l.values()).reduce((v,S)=>(v+=S.value.clientWidth,v),0)});function E(v,S){N(S,!0)}function O(v,S){l.set(S,v)}function B(v,S){return e.createVNode(at,{name:v.name,value:v.value,isActive:v.value===r.value,index:S,onMounted:O,onActive:E},null)}return()=>e.createVNode("span",{ref:s,class:w.value,style:y.value},[e.createVNode("span",{class:"f-capsule-pane"},[o.value.map((v,S)=>B(v,S))]),e.createVNode("small",{class:C.value,style:b.value},null),e.createVNode("div",{class:"f-capsule-board",style:p.value},null)])}});function Ne(t,n,o,s,a){const r=e.ref(),{shouldShowNavigationButtons:m}=o,{activeId:T,tabPages:w}=a,y=e.computed(()=>w.value.map(h=>({name:h.props.title,value:h.props.id}))),C=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":m.value})),c=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{r.value&&(n.value=r.value.$el)});function i(){}return()=>e.createVNode("div",{class:C.value,style:c.value},[e.createVNode(rt,{items:y.value,modelValue:T.value,"onUpdate:modelValue":h=>T.value=h,onChange:i,ref:r},null)])}function ct(t,n,o,s){const{activeId:a,removeTab:r,tabPages:m}=s,{selectAndScrollToTab:T}=o,{hideDropDown:w,searchTabText:y}=n,C=e.ref("auto"),c=e.computed(()=>{var N,V;let f=[];return t.searchBoxVisible?f=(N=m.value)==null?void 0:N.filter(E=>E.props.title.includes(y.value)):f=(V=m.value)==null?void 0:V.slice(),f}),i=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!w.value}));function h(f){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:f.props.disabled,active:f.props.id===a.value,"d-none":f.props.show!==!0}}function b(f){f.preventDefault(),f.stopPropagation()}const p=()=>({width:C.value});function l(){return e.createVNode("div",{class:i.value},[t.searchBoxVisible&&e.createVNode("div",{onClick:f=>b(f),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":f=>y.value=f},null),[[e.vModelText,y.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),c.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:p()},[c.value.map(f=>e.createVNode("li",{class:h(f),onClick:N=>T(N,f.props)},[f.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:N=>r(N,f.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title"},[f.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:l}}function Se(t,n,o,s){const{hideDropDown:a}=n,{renderDropdownMenu:r}=ct(t,n,o,s),m=e.ref(t.showDropdown);function T(){return m.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{a.value=!1}},null),r()])}return{renderMorePagesButtton:T}}function je(t,n,o,s){const a=e.ref(!1),{selectTabByTabId:r,tabPages:m}=s,T=4;function w(){var f;const p=n.value,l=(f=n.value)==null?void 0:f.parentElement;a.value=l&&p&&l.offsetWidth<p.scrollWidth-T}const y=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!a.value})),C=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!a.value})),c=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!a.value}));function i(p,l){if(!n.value)return;const f=n.value.scrollLeft,N=n.value.scrollWidth-n.value.offsetWidth;if(l>0){if(n.value.scrollLeft>=N)return;n.value.scrollLeft=f+t.scrollStep+p}else if(l<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=f-t.scrollStep-p}}function h(p){if(!a.value||!n.value)return;const l=t.tabType==="pills"?".f-capsule-item":".nav-item",f=n.value.querySelectorAll(l),{parentElement:N}=n.value,V=f[p];if(V&&N){const E=N.getBoundingClientRect().left,O=N.getBoundingClientRect().right,B=V.getBoundingClientRect().left,v=V.getBoundingClientRect().right;B<E?i(E-B,-1):O<v&&i(v-O,1),t.tabType==="one-page"&&o.scrollTo(p)}}function b(p,l){if(l.disabled)return;r(l.id);const f=m.value.findIndex(N=>N.props.id===l.id);e.nextTick(()=>{h(f)})}return{previousButtonClass:y,nextButtonGroupClass:C,nextButtonClass:c,scrollTab:i,selectAndScrollToTab:b,shouldShowNavigationButtons:a,updateNavigationLayout:w}}function Ve(t,n){const{tabPages:o}=n,s=e.ref(""),a=e.ref(!0),r=e.computed(()=>t.searchBoxVisible),m=e.computed(()=>r.value?o.value.filter(w=>w.props.title.includes(s.value)):o.value.slice());return{searchTabText:s,hideDropDown:a,shouldShowSearchBox:r,tabsInDropdownMenu:m}}function $e(t,n,o){const s=".farris-tab-page",{tabPages:a}=o;function r(T){const w=n.value;if(w){const y=n.value.querySelectorAll(s);if(y.length>0){const C=y[T],{offsetTop:c}=C,i=c-32>0?c-32:0;w.scrollTop=i}}}function m(T){const w=a.value.findIndex(y=>y.props.id===T);w>-1&&r(w)}return{scrollTo:r,scrollToByPaggId:m}}const lt=new Map([["buttons","items"]]);function it(t,n,o){return n}const dt={$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"},style:{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:[]}},required:["id","type","buttons"]},Be={$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"},style:{type:"string"}},default:{}},text:{description:"The items of Response Toolbar.",type:"string",default:""},icon:{description:"The icon of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},ut={title:"response-toolbar",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}}}},behavior:{title:"行为",description:"",properties:{alignment:{title:"对齐方式",description:"The alignment of Response Toolbar Button.",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"right",name:"右对齐"},{value:"left",name:"左对齐"}]}},buttons:{title:"按钮",description:"The items of Response Toolbar.",type:"array",default:[],$converter:"/converter/buttons.converter"}}}}},ke={title:"response-toolbar-item",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}},fe={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};de[Be.title]=Be,Te[ke.title]=ke,te(fe,dt,lt,it,ut);class Me{constructor(n){W(this,"id","");W(this,"class","btn-secondary");W(this,"icon","");W(this,"groupId","");W(this,"order",-1);W(this,"asDropDownTop",!1);W(this,"text","");W(this,"visible",!0);W(this,"responsed",!1);W(this,"tipsEnable",!1);W(this,"tipsText","");W(this,"width",0);W(this,"onClick",()=>{});W(this,"options");this.options=n;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(n).filter(s=>o.indexOf(s)>-1).forEach(s=>{this[s]=n[s]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:e.computed(()=>!0)}setWidth(n){this.width=parseInt(n,10)}getWidth(){return this.visible?this.width:!1}}class pt extends Me{constructor(n){super(n)}}function me(){function t(n){const o=[];return n.reduce((s,a)=>(a.children&&a.children.length>0?s.push(new ne(a)):s.push(new pt(a)),s),o),o}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:ft}=me();class ne extends Me{constructor(o){super(o);W(this,"placement","");W(this,"dropdownClass","");W(this,"menuClass","");W(this,"split",!1);W(this,"children",[]);W(this,"expanded",!1);const s=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(a=>s.indexOf(a)>-1).forEach(a=>{this[a]=o[a]}),o.children&&o.children.length&&(this.children=ft(o.children))}}function De(){function t(o){const s={"f-icon":!0};if(o.icon){const a=o.icon.trim().split(" ");a&&a.length&&a.reduce((r,m)=>(r[m]=!0,r),s)}return s}function n(o){return!!(o.icon&&o.icon.trim())}return{iconClass:t,shouldShowIcon:n}}function mt(t){function n(c){const i={"dropdown-menu":!0};if(c.class){const h=c.menuClass.split(" ");h&&h.length&&h.reduce((b,p)=>(b[p]=!0,b),i)}return i}function o(c){const i={disabled:!c.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},h=c.dropdownClass.split(" ");return h&&h.length&&h.reduce((b,p)=>(b[p]=!0,b),i),i}function s(c){const i={disabled:!c.enable,"dropdown-item":!0,"f-rt-btn":!0},h=c.class.split(" ");return h&&h.length&&h.reduce((b,p)=>(b[p]=!0,b),i),i}let a;const r=new Map;function m(c,i,h){var p;((p=c.target)==null?void 0:p.id)===i.id&&c.stopPropagation();const b=h?h.id:"__top_item__";if(i.children&&i.children.length&&(i.expanded=!i.expanded,i.expanded?r.set(b,i):r.delete(b)),r.has(b)&&r.get(b)!==i){const l=r.get(b);l&&(l.expanded=!1)}}function T(c,i){document.body.click(),i.enable&&i.onClick(c,i.id)}function w(c){return c.children.map(i=>i.children&&i.children.length?e.createVNode("li",{class:o(i),id:i.id,onClick:h=>i.enable&&m(h,i,c)},[e.createVNode("span",{id:i.id,class:s(i),onMouseover:h=>i.enable&&m(h,i,c)},[i.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),a(i,i)]):e.createVNode("li",{class:s(i),id:i.id,onClick:h=>T(h,i),onMouseover:h=>i.enable&&m(h,i,c)},[t.shouldShowIcon(i)&&e.createVNode("i",{class:t.iconClass(i)},null),i.text]))}function y(c,i,h){const b={display:c.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},p=document.getElementsByTagName("body")[0].getClientRects()[0].width,l=i,f=l==null?void 0:l.getClientRects();if(l&&f&&f.length){const{top:N,width:V,left:E,right:O,height:B}=f[0],v=Math.ceil(B+N);b.top=`${v}px`,b.left=`${E}px`;const S=c.id+"_menu",A=i?i.querySelector("#"+S):null;if(A){b.display==="block"&&(A.style.display="block");const j=A.getBoundingClientRect();if(h){b.top=`${N-6}px`;const d=Math.ceil(V+E);b.left=`${d}px`}p-E-V<j.width&&(b.left=`${(h?E:O)-j.width}px`)}}return b}a=function(c,i){var l,f;const h=e.getCurrentInstance(),b=i?i.id:c.id,p=(f=(l=h==null?void 0:h.exposed)==null?void 0:l.elementRef.value)==null?void 0:f.querySelector("#"+b);return e.createVNode("ul",{class:n(c),style:y(c,p,i),id:c.id+"_menu"},[w(c)])};function C(){r.forEach(c=>{c.expanded=!1}),r.clear()}return{renderDropdownMenu:a,clearAllDropDownMenu:C}}function bt(t,n){const o=e.ref(t.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:a}=mt(n);function r(C){const c={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left"},i=C.dropdownClass.split(" ");return i&&i.length&&i.reduce((h,b)=>(h[b]=!0,h),c),c}function m(C){const c={btn:!0,disabled:!C.enable,"f-rt-btn":!0,"btn-icontext":!!(C.icon&&C.icon.trim())};if(C.class){const i=C.class.split(" ");i&&i.length&&i.reduce((h,b)=>(h[b]=!0,h),c)}return c}function T(C,c){C.stopPropagation();const i=c.expanded;document.body.click(),c.expanded=!i}function w(C){return e.createVNode("div",{id:C.id,class:r(C)},[e.createVNode("div",{class:m(C),style:"display: flex;padding-right: 0.1rem;",onClick:c=>C.enable&&T(c,C)},[n.shouldShowIcon(C)&&e.createVNode("i",{class:n.iconClass(C)},null),e.createVNode("span",null,[C.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),s(C)])}function y(){a()}return{renderToolbarDropdown:w,clearAllDropDown:y}}const{buildResponseToolbarItems:Oe}=me(),Ee=e.defineComponent({name:"FResponseToolbar",props:fe,emits:[],setup(t,n){const o=e.ref(Oe(t.items)),s=e.ref(),a=e.ref(),r=e.ref(),m=e.ref(t.alignment),T={id:"__more_buttons__",text:"更多"},w=e.ref(new ne(T)),y=De(),C=e.computed(()=>w.value.children.length>0),c=e.computed(()=>{const v={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};if(t.customClass){const S=t.customClass.split(" ");S&&S.length&&S.reduce((A,j)=>(A[j]=!0,A),v)}return v}),i=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":m.value==="right","justify-content-start":m.value==="left"})),{renderToolbarDropdown:h,clearAllDropDown:b}=bt(t,y);function p(){o.value.filter(v=>v.children&&v.children.length>0).forEach(v=>{v.expanded=!1}),w.value.expanded=!1,b()}function l(v){const S={btn:!0,"f-rt-btn":!0,"f-btn-ml":m.value==="right","f-btn-mr":m.value==="left","btn-icontext":!!(v.icon&&v.icon.trim())};if(v.class){const A=v.class.split(" ");A&&A.length&&A.reduce((j,d)=>(j[d]=!0,j),S)}return S}function f(v,S){document.body.click(),S.onClick(v,S.id)}function N(v){return e.createVNode("button",{type:"button",class:l(v),id:v.id,disabled:!v.enable,onClick:S=>f(S,v)},[y.shouldShowIcon(v)&&e.createVNode("i",{class:y.iconClass(v)},null),v.text])}const V=new Map,E=[];function O(v){const S=r.value;let A=v;const j=Array.from(S.children),d=j[j.length-1].id==="__more_buttons__"?j[j.length-1]:null;if(d){const M=d.computedStyleMap().get("margin-left"),R=d.computedStyleMap().get("margin-right"),q=(M?M.value:0)+d.getBoundingClientRect().width+(R?R.value:0);A-=q}const g=j.filter(M=>M.id!=="__more_buttons__");for(const M of g){const R=M.computedStyleMap().get("margin-left"),q=M.computedStyleMap().get("margin-right"),Q=(R?R.value:0)+M.getBoundingClientRect().width+(q?q.value:0);A<Q?(V.set(M.id,!0),E.push({id:M.id,width:Q})):A-=Q}if(E.length)for(let M=E.length-1;M>=0;M--){const R=E[M].width;if(A>=R)A-=R,V.delete(E[M].id),E.pop();else break}const u=Object.assign({},w.value);u.children=[];const x=new ne(u),k=o.value.reduce((M,R)=>(V.has(R.id)&&x.children.push(R),R.visible=!V.has(R.id),M.push(R),M),[]);w.value=x,o.value=k}const B=new ResizeObserver(v=>{if(v.length){const A=v[0].contentRect.width,d=r.value.getBoundingClientRect().width;(A<d||E.length)&&(O(A),p())}});return e.onMounted(()=>{const v=a.value;B.observe(v),document.body.addEventListener("click",p),document.body.addEventListener("wheel",p)}),e.onUnmounted(()=>{B.disconnect(),document.body.removeEventListener("click",p),document.body.removeEventListener("wheel",p)}),e.watch(()=>t.items,()=>{o.value=Oe(t.items)}),n.expose({elementRef:s}),()=>e.createVNode("div",{class:c.value,ref:s},[e.createVNode("div",{ref:a,class:i.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(v=>v.visible).map(v=>v.children&&v.children.length>0?h(v):N(v)),C.value&&h(w.value)])])])}}),ae=e.defineComponent({name:"FTabs",props:se,emits:["tabChange","tabRemove"],setup(t,n){const o=e.ref(t.tabType),s=e.shallowRef(),a=e.ref(t.customClass),r=e.shallowRef(),m=e.shallowRef(),T=Xe(t,n,r),{activeId:w,changeTitleStyle:y,tabPages:C,addTab:c,updateTab:i,selectTabByTabId:h,toolbarItems:b}=T,p=$e(t,m,T),l=je(t,r,p,T),{previousButtonClass:f,nextButtonClass:N,nextButtonGroupClass:V,scrollTab:E,updateNavigationLayout:O}=l,B=Ve(t,T),{hideDropDown:v}=B,S=Ke(t,r,l,p,T),A=S,j=Ne(t,r,l,p,T),d=new Map([["default",S],["one-page",A],["pills",j]]);e.computed(()=>{const P=C.value.find(H=>H.props.id===w.value);return P==null?void 0:P.slots});const g=e.computed(()=>{const P=C.value.find(L=>L.props.id===w.value);return(P==null?void 0:P.props.toolbarPosition)==="inHead"}),u=e.computed(()=>t.fill||t.tabType==="fill");e.provide("tabs",{activeId:w,addTab:c,updateTab:i,tabPages:C,tabType:o,shouldFillParentContaner:u});const x=e.computed(()=>t.tabType==="pills"),k=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":g.value,"farris-tabs-inContent":!g.value,"farris-tabs-nav-fill":u.value,"farris-tabs-nav-pills":x.value})),M=e.computed(()=>({width:g.value&&t.titleWidth?`${t.titleWidth}%`:""})),R=e.computed(()=>{const P={"farris-tabs":!0,"f-utils-fill-flex-column":u.value,"flex-column":t.position==="top","flex-column-reverse":t.position==="bottom","flex-row":t.position==="left","flex-row-reverse":t.position==="right","one-page":t.tabType==="one-page"};return a.value&&a.value.split(" ").reduce((H,L)=>(H[L]=!0,H),P),P});e.onMounted(()=>{C.value.length&&(w.value=t.activeId||C.value[0].props.id,h(w.value)),e.nextTick(()=>{O()}),y(r),window.addEventListener("click",P=>{var H;v.value||(H=s.value)!=null&&H.contains(P.target)||(v.value=!0)}),window.addEventListener("resize",()=>{O()})});function q(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:f.value,onClick:()=>{E(0,-1)}},null)}function Q(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:N.value,onClick:()=>{E(0,1)}},null)}const{renderMorePagesButtton:G}=Se(t,B,l,T),J=P=>{n.emit("Click",P)};function K(){return b.value.length?e.createVNode(Ee,{items:b.value,onClick:J},null):null}const F=d.get(t.tabType)||d.get("default");function $(){var P,H,L,_;return e.createVNode("div",{class:k.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(H=(P=n.slots).headerPrefix)==null?void 0:H.call(P)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:M.value},[q(),F&&F(),e.createVNode("div",{class:V.value},[Q(),G()])]),K(),e.createVNode("div",{class:"farris-tabs-header-post"},[(_=(L=n.slots).headerSuffix)==null?void 0:_.call(L)])])}const D=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":u.value}));function I(){var P,H;return e.createVNode("div",{class:D.value,ref:m},[(H=(P=n.slots).default)==null?void 0:H.call(P)])}return()=>e.createVNode("div",{class:R.value,ref:s},[$(),I()])}}),ht=new Map([["appearance",oe],["toolbar",yt]]);function yt(t,n,o){return n&&n.contents&&n.contents.length&&n.contents.forEach(s=>{s.title&&(s.text=s.title)}),{toolbar:n}}const gt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-page.schema.json",title:"tab-page",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a tab-page Item",type:"string"},type:{description:"The type string of tab-page Item component",type:"string",default:"tab-page"},contents:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"标题"},toolbar:{description:"",type:"object"}},required:["id","type","contents"]},Ct={title:"tab-page",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"工具栏按钮的标识",title:"标识",type:"string",readonly:!0},title:{description:"工具栏按钮的标识",title:"标题",type:"string"}}},appearance:{description:"",title:"外观",properties:{appearance:{description:"",type:"cascade",title:"样式",properties:{class:{description:"组件的CSS样式",title:"class样式",type:"string"},style:{description:"组件的内容样式",title:"style样式",type:"modal",showClearButton:!0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}},size:{description:"",type:"cascade",title:"尺寸",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}}}},behavior:{description:"",title:"行为",properties:{visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}},removeable:{description:"是否可移除",type:"boolean",title:"是否可移除",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}},headerTemplate:{description:"标签页模板",type:"modal",title:"标签页模板",editor:{type:"code-editor"},editorParams:{language:"html"}}}}}},re={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object,default:{}},toolbarPosition:{type:String,default:"inHead"}},be=te(re,gt,ht,void 0,Ct);function vt(t,n,o){return n?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function wt(t,n){return n&&n.contents&&n.contents.length&&n.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:n.contents,buttonPosition:n.position}}const Tt=new Map([["appearance",oe],["expanded","expandStatus"],["enableAccordion",vt],["toolbar",wt]]);function xt(t,n,o){return n}const Nt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},St={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},mainTitle:{title:"主标题",type:"string",description:""},subTitle:{title:"副标题",type:"string",description:""}}},appearance:{title:"样式",description:"Appearance",properties:{class:{title:"class",type:"string",description:""},style:{title:"style",type:"string",description:""}}},behavior:{title:"行为",description:"",properties:{visible:{title:"可见",type:"boolean",description:""},fill:{title:"填充",type:"boolean",description:"To fill the space of parent container in flex layout."},showHeader:{title:"显示标题区域",type:"boolean",description:""},enableMaximize:{title:"显示最大化",type:"boolean",description:"",visible:{showHeader:!0}},enableCollapse:{title:"显示收折",type:"boolean",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},visible:{showHeader:!0}},expanded:{title:"展开",type:"boolean",description:"",readonly:{enableCollapse:!1},editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},visible:{showHeader:!0}},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}},accordionMode:{title:"收折模式",type:"enum",description:"",readonly:{enableAccordion:!1},visible:{showHeader:!0},editor:{type:"combo-list",data:[{value:"default",name:"默认"}]}}}},toolbar:{title:"工具栏",description:"",properties:{buttonSize:{title:"按钮尺寸",type:"enum",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"default",name:"标准"},{value:"large",name:"大尺寸"}]}},popupDirection:{title:"弹出方向",type:"enum",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"default",name:"自适应"},{value:"top",name:"向上"},{value:"bottom",name:"向下"}]}}}},extends:{title:"扩展样式",description:"",properties:{headerClass:{title:"标题区",type:"string",description:""},titleClass:{title:"主标题",type:"string",description:""},contentClass:{title:"内容区",type:"string",description:""},toolbarClass:{type:"string",title:"工具栏",description:""}}}}},Ae={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}};te(Ae,Nt,Tt,xt,St);function jt(t,n,o){let s;function a(){!t||!n.value||(o.value=!o.value,o.value?r():m())}function r(){s=t.value.nextElementSibling;const w=document&&document.querySelector("body");w&&(w.appendChild(t.value),t.value.style.zIndex=T())}function m(){s?n.value.insertBefore(t.value,s):n.value.appendChild(t.value),t.value.style.zIndex=null}function T(w=1){const y=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],C=Array.from(document.body.querySelectorAll(y.join(","))).filter(i=>i).map(i=>{const{display:h,zIndex:b}=window.getComputedStyle(i);return h==="none"?0:parseInt(b,10)}).filter(i=>i);let c=Math.max(...C);return c<1040&&(c=1040),c+w}return{onClickMaxMinIcon:a}}function Ie(t,n){const o=e.ref(t.buttons),s=e.computed(()=>t.buttonPosition==="inHead"?"right":"left"),a=e.computed(()=>"f-section-toolbar"+(t.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),r=e.computed(()=>{t.buttons&&t.buttons.length>0&&t.buttonPosition});function m(T){n.emit("Click",T)}return()=>r&&e.createVNode(Ee,{customClass:a.value,items:o.value,onClick:m,alignment:s.value},null)}function Vt(t,n,o,s,a,r){const m=e.ref(t.mainTitle),T=e.ref(t.subTitle),w=e.computed(()=>t.buttonPosition),y=Ie(t,n),{onClickMaxMinIcon:C}=jt(s,a,r),c=e.computed(()=>!!t.subTitle),i=e.computed(()=>t.enableMaximize),h=e.computed(()=>t.enableAccordion!=""),b=e.computed(()=>{const O={"f-section-header":!0};return n.slots.header&&t.headerClass.split(" ").reduce((v,S)=>(v[S]=!0,v),O),O});function p(O){O.stopPropagation(),t.enableAccordion!==""&&(o.value=!o.value)}function l(){const O=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),B=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!r.value,"f-icon-minimize":r.value}));return e.createVNode("div",{class:"f-max-accordion"},[i.value?e.createVNode("span",{class:B.value,onClick:C},null):"",h.value?e.createVNode("button",{class:O.value,onClick:p},[e.createVNode("span",null,[o.value?t.collapseLabel:t.expandLabel])]):""])}function f(){return n.slots.header?e.createVNode("div",{class:b.value},[n.slots.header()]):""}function N(){return e.createVNode("div",{class:"f-title",onClick:p},[e.createVNode("h4",{class:"f-title-text"},[m.value]),c.value&&e.createVNode("span",null,[T.value])])}function V(){const O=e.computed(()=>{const B={"f-content":!0};return t.headerContentClass&&t.headerContentClass.split(" ").reduce((S,A)=>(S[A]=!0,S),B),B});return n.slots.headerContent?e.createVNode("div",{class:O.value},[n.slots.headerContent()]):""}function E(){return e.createVNode("div",{class:b.value},[n.slots.headerTitle?n.slots.headerTitle():N(),V(),w.value==="inHead"&&y(),(i.value||h.value)&&l()])}return()=>t.showHeader&&(n.slots.header?f():E())}const Pe=e.defineComponent({name:"FSection",props:Ae,emits:[],setup(t,n){const o=e.ref();let s=e.ref();const a=e.ref(t.customClass),r=e.computed(()=>t.enableAccordion),m=e.ref(t.expandStatus),T=e.computed(()=>t.buttonPosition),w=e.ref(!1),y=Vt(t,n,m,o,s,w),C=Ie(t,n),c=e.computed(()=>{const l={"f-section":!0,"f-section-accordion":r.value==="default","f-state-collapse":(r.value==="default"||r.value==="custom")&&!m.value,"f-section-custom-accordion":r.value==="custom","f-section-fill":t.fill,"f-section-maximize":w.value};return a.value&&a.value.split(" ").reduce((f,N)=>(f[N]=!0,f),l),l}),i=e.computed(()=>{const l=t.contentClass.split(" "),f={"f-section-content":!0};return l.reduce((N,V)=>(N[V]=!0,N),f),f}),h=e.computed(()=>{const l=t.extendClass.split(" "),f={"f-section-extend":!0};return l.reduce((N,V)=>(N[V]=!0,N),f),f});function b(){return n.slots.extend&&e.createVNode("div",{class:h.value},[n.slots.extend()])}function p(){return e.createVNode("div",{class:i.value},[T.value==="inContent"&&C(),n.slots.default&&n.slots.default()])}return e.onMounted(()=>{o&&o.value&&(s.value=o.value.parentElement)}),()=>e.createVNode("div",{class:c.value,ref:o},[y(),b(),p()])}});function $t(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const ce=e.defineComponent({name:"FTabPage",props:re,emits:[],setup(t,n){const o=e.inject("tabs"),s=e.ref(t.show),a={slots:n.slots,props:t},r=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const h=o==null?void 0:o.tabPages.value.findIndex(b=>b.props.id===t.id);!h||h===-1?o==null||o.addTab(a):h>-1&&(s.value=!1,console.warn(`已经存在id为${t.id}的页签啦`))}),e.onUnmounted(()=>{});const m=e.computed(()=>(t==null?void 0:t.id)===(o==null?void 0:o.activeId.value)),T=e.computed(()=>({display:m.value?"":"none"}));e.watch(()=>t,h=>{o==null||o.updateTab({props:h,slots:n.slots})},{immediate:!0,deep:!0});function w(){var b,p;const h=(p=(b=n.slots).default)==null?void 0:p.call(b);return e.createVNode(Pe,{"main-title":t.title,class:"farris-tab-page"},$t(h)?h:{default:()=>[h]})}const y=e.computed(()=>{var b;return{"farris-tab-page":!0,"f-utils-fill-flex-column":m.value&&o&&((b=o.shouldFillParentContaner)==null?void 0:b.value)}});function C(){var b,p;const h=(p=(b=n.slots).default)==null?void 0:p.call(b);return e.createVNode("div",{class:y.value,style:T.value},[h])}const i=new Map([["default",C],["one-page",w]]).get(r.value)||C;return()=>s.value?i():null}}),Bt={type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"}};function he(){return new DOMException("The request is not allowed","NotAllowedError")}async function kt(t){if(!navigator.clipboard)throw he();return navigator.clipboard.writeText(t)}async function Mt(t){const n=document.createElement("span");n.textContent=t,n.style.whiteSpace="pre",n.style.webkitUserSelect="auto",n.style.userSelect="all",document.body.appendChild(n);const o=window.getSelection(),s=window.document.createRange();o==null||o.removeAllRanges(),s.selectNode(n),o==null||o.addRange(s);let a=!1;try{a=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(n)}if(!a)throw he()}async function Dt(t){try{await kt(t)}catch(n){try{await Mt(t)}catch(o){throw o||n||he()}}}function Ot(){async function t(n){await Dt(n)}return{onCopy:t}}function Et(t,n,o,s){const a=e.ref(14),r=e.ref(140),m=e.ref(""),T=e.ref(s.value.length),w=e.computed(()=>s.value),y=e.computed(()=>({"font-size":`${a.value}px`,height:"100%"}));function C(c){if(c.currentTarget){const i=c.currentTarget.value||"";T.value=i.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:y.value,rows:"4",maxlength:r.value,onInput:c=>C(c)},[w.value]),e.createVNode("span",{class:"textarea-wordcount",title:m.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[T.value+" / "+r.value])])}function At(t,n,o,s){const a=Et(t,n,o,s),r=new Map([["text-area",a]]);function m(T){return r.get(T)||null}return{getEditorRender:m}}function It(){const t=e.ref(!1),n=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const s={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return s.opacity=t.value?"0.8":"0",s.display=t.value?"":"none",s}),feedbackMessage:n,toShowFeedback:t}}function Pt(t,n){const o=n.getEditorRender(t.promptEditorType);return()=>o&&o()}function Rt(t){const n=e.ref(3),o=e.ref(480),s=e.computed(()=>!!t.value&&!!t.value.date),a=e.computed(()=>`发生时间 : ${t.value&&t.value.date||""}`),r=e.computed(()=>!!t.value&&!!t.value.detail),m=e.computed(()=>{const l=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":n.value,"max-height":l}}),T=e.computed(()=>t.value&&t.value.detail||""),w=e.computed(()=>!0),y=e.ref(!1),C=e.ref("展开"),c=e.ref("收起"),i=e.computed(()=>{const l={display:"block",color:"#2A87FF"};return l["text-align"]=y.value?"":"right",l});function h(l,f){y.value=!y.value,n.value=y.value?20:3}function b(l){return h()}function p(l){return h()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[s.value&&e.createVNode("div",null,[a.value]),r.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:m.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:T.value},null)]),w.value&&e.createVNode("span",{style:i.value},[y.value&&e.createVNode("span",{onClick:b,style:"cursor: pointer;"},[c.value]),!y.value&&e.createVNode("span",{onClick:p,style:"cursor: pointer;"},[C.value])])])}function Ft(t){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value},null)}function Ht(t,n,o,s){const a=e.ref(t.exceptionInfo),r=e.computed(()=>{const i={"f-icon":!0},h=`f-icon-${n.value}`;return i[h]=!0,i}),m=e.computed(()=>o.value||a.value&&a.value.message),T=e.computed(()=>s.value),w=e.computed(()=>!!s.value),y=e.computed(()=>!!a.value);function C(){return y.value?Rt(a):w.value?Ft(T):()=>null}const c=C();return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:r.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:m.value},null),c()])])}function Lt(t,n,o){const{onCopy:s}=n,{toShowFeedback:a}=o,r=e.ref("复制成功"),m=e.ref("复制详细信息"),T=e.ref(t.exceptionInfo||{date:"",message:"",detail:""}),w=e.computed(()=>T.value&&T.value.detail||"");function y(C){s(w.value).catch(c=>{r.value="复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:y,style:"cursor: pointer;"},[m.value])])}function _t(t,n,o,s){const a=e.ref(t.type),r=e.ref([]),m=e.ref(t.exceptionInfo),T=e.ref(t.okButtonText),w=e.ref(t.cancelButtonText),y=e.ref(!0),C=e.ref(!0),c=e.computed(()=>!!(r.value&&r.value.length)),i=e.computed(()=>m.value&&m.value.date&&m.value.message&&m.value.detail),h=e.computed(()=>!(r.value&&r.value.length)&&(T.value||w.value)),b=e.computed(()=>C.value&&T.value),p=e.computed(()=>y.value&&w.value),l=Lt(t,o,s);function f(V){a.value==="question"&&n.emit("reject"),n.emit("close")}function N(V){a.value==="question"&&n.emit("accept"),n.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[i.value&&l(),h.value&&p.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:f},[w.value]),h.value&&b.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:N},[T.value]),c.value&&r.value.length&&r.value.map(V=>e.createVNode("button",{type:"button",onClick:V.handle,class:V.class},[V.iconClass&&e.createVNode("span",{class:V.iconClass},null),V.text]))])}const qt=e.defineComponent({name:"FMessageBox",props:Bt,emits:["accept","reject","close"],setup(t,n){const o=e.ref(t.type),s=e.ref(t.title),a=e.ref(t.detail),r=e.computed(()=>{const l={"modal-tips":!0,"d-flex":!0,"flex-row":!0},f=`messager-type-${o.value}`;return l[f]=!0,l}),m=e.computed(()=>{const l={};return o.value==="prompt"?l.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(l.padding="0.5rem 1.5rem 1rem 1.5rem"),l}),T=Ot(),w=At(t,o,s,a),y=It(),{feedbackStyle:C,feedbackMessage:c}=y;function i(){return e.createVNode("div",{style:C.value},[c.value])}function h(){switch(o.value){case"prompt":return Pt(t,w);default:return Ht(t,o,s,a)}}const b=h(),p=_t(t,n,T,y);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:m.value},[b()]),p(),i()])}}),Wt={class:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1}},Re=e.defineComponent({name:"FModal",props:Wt,emits:["update:modelValue","accept","cancel","closed"],setup(t,n){const o=e.ref(t.width),s=e.ref(t.height),a=e.ref(t.modelValue),r=e.ref(""),m=e.ref(t.class),T=e.ref(t.fitContent),w=e.ref(t.showHeader),y=e.ref(""),C=e.ref(!0),c=e.ref(!1),i=e.ref(!1),h=e.ref(""),b=e.ref(""),p=e.ref(""),l=e.ref(t.showButtons),f=e.ref(t.title);function N(F,$){a.value=!1,n.emit("update:modelValue",!1),$!=null&&n.emit($?"accept":"cancel"),n.emit("closed",F)}const V=[{name:"cancel",text:"取消",class:"btn btn-light",handle:F=>{N(F,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:F=>{N(F,!0)}}],E=e.ref(t.buttons&&t.buttons.length?t.buttons:V),O=e.computed(()=>!!y.value),B=e.computed(()=>!!l.value&&!!E.value);e.ref(),e.ref(),e.watch(()=>t.modelValue,()=>{a.value=t.modelValue});const v=e.ref(!1),S=e.computed(()=>a.value),A=e.computed(()=>{const F={modal:!0,"farris-modal":!0,"fe-cmp-page-modal":t.showFloatingClose};return F["f-modal-fitContent"]=T.value,F}),j=e.computed(()=>({display:S.value?"block":"none !important"})),d=e.computed(()=>{const F={"modal-dialog":!0};return m.value.split(" ").reduce((D,I)=>(D[I]=!0,D),F),F}),g=e.computed(()=>({position:"absolute",top:"50%",left:"50%",width:`${o.value}px`,height:T.value?"auto":`${s.value}px`,"margin-left":`${0-o.value/2}px`,"margin-top":T.value?"auto":`${0-s.value/2}px`})),u=e.computed(()=>({"modal-content":!0,"modal-content-has-header":w.value})),x=e.computed(()=>({display:w.value?"":"none"})),k=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:v.value})),M=e.computed(()=>({height:"10px","z-index":1,display:w.value?"none":""})),R=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe"}));function q(){return{}}const Q=e.computed(()=>{const F={textAlgin:p.value},$=q();return Object.assign(F,$)});function G(F){}async function J(F,$){if(F.handle){const D=await F.handle($,F);D&&N($,D)}}function K(){return e.createVNode("div",{class:"action-wrapper",onClick:F=>N(F,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>{var F,$;return[e.createVNode("div",{class:A.value,style:j.value},[e.createVNode("div",{id:r.value,class:d.value,style:g.value},[t.showFloatingClose&&K(),e.createVNode("div",{class:u.value},[e.createVNode("div",{ref:"modalHeaderRef",class:"modal-header",style:x.value},[e.createVNode("div",{class:"modal-title"},[O.value&&e.createVNode("span",{class:y.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[f.value])]),e.createVNode("div",{class:"actions"},[e.createVNode("ul",null,[i.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&e.createVNode("li",{onClick:G,class:"f-btn-icon f-bare"},[e.createVNode("span",{class:k.value},null)]),C.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:D=>N(D,!1)},[e.createVNode("span",{class:"f-icon modal_close"},null)])])])]),e.createVNode("div",{ref:"dragableElementRef",class:"f-utils-absolute-all",style:M.value},null),e.createVNode("div",{class:R.value},[($=(F=n.slots).default)==null?void 0:$.call(F),h.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:b.value},null)]),B.value&&e.createVNode("div",{class:"modal-footer",style:Q.value},[E.value&&E.value.map(D=>e.createVNode("button",{name:D.name,type:"button",class:D.class+(D.iconClass?" btn-icontext":""),onClick:I=>{J(D,I)}},[!!D.iconClass&&e.createVNode("i",{class:D.iconClass},null),D.text]))])])])])]}})}}),ye={install(t){}};function Fe(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function zt(t){const n=document.createElement("div");n.style.display="contents";const o=e.createApp({setup(){e.onUnmounted(()=>{document.body.removeChild(n)});const s=e.ref(),a=e.ref(t.class||""),r=e.ref(!!t.showButtons),m=e.ref(!!t.showHeader),T=e.ref(!!t.showFloatingClose),w=e.ref(!0),y=e.ref(t.title||""),C=t.acceptCallback||(()=>{}),c=t.rejectCallback||(()=>{}),i=t.closedCallback||(p=>{}),h=Fe(t),b=p=>{w.value=!1,o.unmount(),i(p)};return e.onMounted(()=>{}),()=>e.createVNode(Re,{ref:s,class:a.value,modelValue:w.value,"onUpdate:modelValue":p=>w.value=p,title:y.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":m.value,"show-buttons":r.value,showFloatingClose:T.value,onAccept:C,onCancel:c,fitContent:t.fitContent,onClosed:b},{default:()=>[h&&h(o)]})}});return document.body.appendChild(n),ye&&ye.install&&o.use(ye),o.mount(n),o}class Ut{static show(n){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return zt(o)}renderModal(n,o,s){const a=e.h(Re,o,s);return e.render(a,n),a}renderNull(n){setTimeout(()=>{e.render(null,n)},500)}open(n){const o=document.createElement("div");o.style.display="contents";const s=Object.assign({title:"",showButtons:!0,showHeader:!0},n),a=e.ref(s.class||""),r=e.ref(!!s.showButtons),m=e.ref(!!s.showHeader),T=e.ref(!!s.showFloatingClose),w=e.ref(!0),y=e.ref(s.title||""),C=s.acceptCallback||(()=>{}),c=s.rejectCallback||(()=>{}),i=s.closedCallback||(l=>{});Fe(s);const h=l=>{w.value=!1,i(l)};function b(l){w.value=l}const p={class:a.value,modelValue:w.value,title:y.value,width:s.width,height:s.height,buttons:s.buttons,showHeader:m.value,showButtons:r.value,showFloatingClose:T.value,onAccept:C,onCancel:c,fitContent:s.fitContent,onClosed:h};this.renderModal(o,{...p,"onUpdate:modelValue":b})}}class Gt{static show(n){const o=e.reactive({...n}),s=!1,a=o.type==="error"||o.type==="prompt",r=o.type==="error"?"错误提示":o.type==="prompt"&&o.title||"",m=o.acceptCallback||(()=>{}),T=o.rejectCallback||(()=>{});let w;const y=()=>{w&&w.unmount()};w=Ut.show({class:"modal-message modal-message-type-info",title:r,showButtons:s,showHeader:a,render:()=>e.createVNode(qt,e.mergeProps(o,{onAccept:m,onReject:T,onClose:y}),null)})}static info(n,o){const s=e.reactive({type:"info",title:n,detail:o,okButtonText:"知道了",cancelButtonText:""});this.show(s)}static warning(n,o){const s=e.reactive({type:"warning",title:n,detail:o,okButtonText:"知道了",cancelButtonText:""});this.show(s)}static success(n,o){const s=e.reactive({type:"success",title:n,detail:o,okButtonText:"关闭",cancelButtonText:""});this.show(s)}static error(n,o,s){const a=e.reactive({type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:s,message:n,detail:o}});this.show(a)}static prompt(n,o){const s=e.reactive({type:"prompt",title:n,detail:o,okButtonText:"确定",cancelButtonText:"取消"});this.show(s)}static question(n,o,s,a){const r=e.reactive({type:"question",title:n,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:s,rejectCallback:a});this.show(r)}}function Jt(t,n,o,s,a){const{activeId:r,removeTab:m,selectTab:T,removeDesignTab:w,selectDesignTab:y}=a,C=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":t.autoTitleWidth})),c=e.computed(()=>{const S={"farris-component":!0,"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===r.value,"f-state-disable":n.disabled};return S[`${n.id}-design-item`]=!0,S}),i=e.computed(()=>({width:`${n.tabWidth}px`})),h=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===r.value,disabled:n.disabled}));function b(S){return e.createVNode("span",{class:C.value,title:S.title},[S.title])}function p(S){return S.slots.title?S.slots.title:b}const l=p(o),f=e.ref(n.removeable);function N(){return e.createVNode("span",{class:"st-drop-close",onClick:S=>m(S,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function V(S){T(n.id),t.tabType==="one-page"&&s.scrollToByPaggId(n.id)}function E(S){y(S,n.id)}function O(S){Gt.question(`确定删除标签页【${o.props.title}】?`,"",()=>w(S,n.id),()=>{})}function B(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:S=>O(S)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[B()])])}return e.createVNode("li",{onClick:S=>E(S),class:c.value,style:i.value,id:`${n.id}-design-item`},[v(),e.createVNode("a",{class:h.value,onClick:V},[l(n),f.value&&N()])])}function Zt(t,n,o,s,a,r,m){const{shouldShowNavigationButtons:T}=o,{tabPages:w}=a,y=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":T.value})),C=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),c=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":t.fill||t.tabType==="fill","nav-pills":t.tabType==="pills","flex-row":t.position==="top"||t.position==="bottom","flex-column":t.position==="left"||t.position==="right"})),i=e.computed(()=>({overflow:"auto"}));function h(p){const{componentType:l}=p;let f=Y(l,p);m&&m.onResolveNewComponentSchema&&(f=m.onResolveNewComponentSchema(p,f));const N=l.toLowerCase().replace("-","_");return f&&!f.id&&f.type===l&&(f.id=`${N}_${Math.random().toString().slice(2,6)}`),f}const b=function(p){var V;const l={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},f=h(l);(V=r.value.schema.contents)==null||V.push(f);const{selectTabByTabId:N}=a;N(f.id)};return()=>e.createVNode("div",{class:y.value,style:C.value},[e.createVNode("ul",{class:c.value,style:i.value,ref:n},[w.value.map(p=>Jt(t,p.props,p,s,a)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:p=>b()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function ge(t,n,o){var O;function s(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}s();const a=o&&o.getStyles&&o.getStyles()||"",r=o&&o.getDesignerClass&&o.getDesignerClass()||"",m=e.ref();function T(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function w(){return!1}function y(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function C(){return(n==null?void 0:n.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function c(B){if(!B||!B.value)return null;if(B.value.schema&&B.value.schema.type==="component")return B.value;const v=e.ref(B==null?void 0:B.value.parent),S=c(v);return S||null}function i(B=n){const{componentInstance:v,designerItemElementRef:S}=B;return!v||!v.value?null:v.value.canMove?S:i(B.parent)}function h(B){return!!o&&o.canAccepts(B)}function b(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function p(){}function l(B,v){v&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(v)}function f(B){const{componentType:v}=B;let S=Y(v,B);o&&o.onResolveNewComponentSchema&&(S=o.onResolveNewComponentSchema(B,S));const A=v.toLowerCase().replace("-","_");return S&&!S.id&&S.type===v&&(S.id=`${A}_${Math.random().toString().slice(2,6)}`),S}function N(B,v){const S=String(B.getAttribute("data-controltype")),A=B.getAttribute("data-feature"),j=A?JSON.parse(A):{};j.parentComponentInstance=m.value;let d=Y(S,j);o&&o.onAcceptNewChildElement&&(d=o.onAcceptNewChildElement(B,v,d));const g=S.toLowerCase().replace("-","_");return d&&!d.id&&d.type===S&&(d.id=`${g}_${Math.random().toString().slice(2,6)}`),d}function V(B){}function E(){return o&&o.getPropsConfig?o.getPropsConfig():[]}return m.value={canMove:T(),canSelectParent:w(),canDelete:y(),canNested:!C(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(O=n==null?void 0:n.parent)==null?void 0:O.componentInstance,schema:n==null?void 0:n.schema,styles:a,designerClass:r,canAccepts:h,getBelongedComponentInstance:c,getDraggableDesignItemElement:i,getDraggingDisplayText:b,getPropConfig:E,getDragScopeElement:p,onAcceptMovedChildElement:l,onAcceptNewChildElement:N,onChildElementMovedOut:V,addNewChildComponentSchema:f,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},m}const Qt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},Ce=new Map;function Xt(){function t(b,p,l,f){var N;if(typeof l=="number")return((N=f[b])==null?void 0:N.length)===l;if(typeof l=="object"){const V=Object.keys(l)[0],E=l[V];if(V==="not")return Number(f[b].length)!==Number(E);if(V==="moreThan")return Number(f[b].length)>=Number(E);if(V==="lessThan")return Number(f[b].length)<=Number(E)}return!1}function n(b,p,l,f){return typeof l=="boolean"?f.childrenClassList.includes(p)===!!l:!1}function o(b,p,l,f){return typeof l=="boolean"?f.parentClassList.includes(p)===!!l:!1}function s(b,p,l,f){return typeof l=="boolean"?f.parentClassList.includes(p)===!!l:!1}const a=new Map([["length",t],["hasChildren",n],["hasSibling",s],["hasParent",o]]);function r(b,p){const l=b;return typeof p=="number"?[{target:l,operator:"length",param:null,value:Number(p)}]:typeof p=="object"?Object.keys(p).map(f=>{if(f==="length")return{target:l,operator:"length",param:null,value:p[f]};const N=f,V=p[f];return{target:l,operator:b==="children"?"hasChildren":b==="parent"?"hasParent":"hasSibling",param:N,value:V}}):[]}function m(b,p){if(a.has(b.operator)){const l=a.get(b.operator);return l&&l(b.target,b.param,b.value,p)||!1}return!1}function T(b,p){return Object.keys(b).reduce((V,E)=>{const O=r(E,b[E]);return V.push(...O),V},[]).reduce((V,E)=>V&&m(E,p),!0)}function w(b,p){const l=Object.keys(b),f=l.includes("allOf"),N=l.includes("anyOf"),V=f||N,B=(V?b[V?f?"allOf":"anyOf":"allOf"]:[b]).map(S=>T(S,p));return f?!B.includes(!1):B.includes(!0)}function y(b,p){const l=b.const;return l?typeof l=="boolean"?l:typeof l=="object"?w(l,p):!1:!1}function C(b){return p=>{const l={canAccept:!0,fixed:!1,hidePadding:!1};return b&&b.properties&&Object.keys(b.properties).reduce((f,N)=>{const V=b.properties[N];return f[N]=y(V,p),f},l),l}}function c(b,p,l){if(p.type==="object"&&p.properties){const{rules:f,contents:N}=p.properties;l.set(b,C(f)),N&&Object.keys(N.properties).forEach(V=>c(V,N.properties[V],l))}}function i(){const{properties:b}=Qt;Object.keys(b).forEach(p=>{c(p,b[p],Ce)})}function h(b,p){const l={canAccept:!0,fixed:!1,hidePadding:!0};return Ce.has(b)?Ce.get(b)(p):l}return i(),{getRuleValue:h}}function Yt(t,n){const o=Xt();let s=!1,a,r=!1;function m(c){return!1}function T(){return!r}function w(){return!r}function y(){return s}function C(){const c=t,i=c.appearance&&c.appearance.class||"",h=i?i.split(" "):[],b=n==null?void 0:n.schema,p=b&&b.appearance&&b.appearance.class||"",l=p?p.split(" "):[],f=c.contents||[],N=f.length?f[0]:null,V=N&&N.appearance&&N.appearance.class||"",E=V?V.split(" "):[],O=f.length?f.reduce((d,g)=>{const u=g&&g.appearance?g.appearance.class:"",x=u?u.split(" "):[];return d.push(...x),d},[]):[],B=(n==null?void 0:n.parent)&&n.parent.schema,v=B&&B.appearance&&B.appearance.class||"";v&&v.split(" "),a={componentClass:i,componentClassList:h,childContents:f,firstChildContent:N,firstChildClass:V,firstChildClassList:E,parent,parentClass:p,parentClassList:l,children:f,childrenClassList:O};const{canAccept:S,fixed:A,hidePadding:j}=o.getRuleValue(h[0],a);return s=j,r=A,!0}return{canAccepts:m,checkCanDeleteComponent:T,checkCanMoveComponent:w,hideNestedPaddingInDesginerView:y,resolveComponentContext:C}}function Kt(t,n,o,s){const a=e.ref([]),r=e.ref(t.activeId||""),m=e.ref(!0),T=e.ref(),w=e.ref([]);function y(u){const x=u.value.findIndex(k=>k.props.show!==!1&&!r.value&&!k.props.disabled);!r.value&&x!==-1&&(r.value=u.value[x].props.id)}function C(u,x){u.classList.contains(x)||u.classList.add(x)}function c(u,x){u.classList.remove(x)}function i(u){const{parentElement:x}=u;x&&(u.scrollWidth>x.offsetWidth?C(u,"farris-title-text-custom"):c(u,"farris-title-text-custom"))}function h(u){var k;if(t.autoTitleWidth)return;const x=(k=u.value)==null?void 0:k.querySelectorAll(".st-tab-text");x&&x.forEach(M=>i(M))}const b=u=>{u.preventDefault(),u.stopPropagation()};function p(u){a.value=a.value.filter(x=>x.props.id!==u),r.value===u&&(r.value="",y(a))}function l(u,x,k=!1){const M=a.value.findIndex(R=>R.props.id===x);p(x),b(u),e.nextTick(()=>{h(o),k&&(m.value=!0),n.emit("tabRemove",{removeIndex:M,removeId:x,activeId:r.value})})}function f(){const u=a.value.find(M=>M.props.id===r.value);w.value=[],u&&u.props.toolbar&&u.props.toolbar.buttons&&u.props.toolbar.buttons.length&&(w.value=[...u.props.toolbar.buttons]);const x=s.schema.contents,k=x==null?void 0:x.find(M=>M.id===r.value);T.value=k==null?void 0:k.toolbar}function N(u){const x=r.value;r.value=u,f(),n.emit("tabChange",{prevId:x,nextId:r.value})}function V(u){N(u)}function E(u){a.value.findIndex(k=>k.props.id===u.props.id)===-1&&a.value.push(u)}function O(u){a.value.findIndex(k=>k.props.id===u.props.id)!==-1&&(a.value.forEach(k=>{k.props.id===u.props.id&&(k=u)}),e.nextTick(()=>{h(o)}))}function B(u){u&&(u.stopPropagation(),u.preventDefault())}function v(u,x){B(u);const k=s.schema.contents,M=k==null?void 0:k.findIndex(R=>R.id===x);M===-1||M===void 0||(k==null||k.splice(M,1),p(x))}function S(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(x=>x.classList.remove("dgComponentFocused"));const u=document.getElementsByClassName("dgComponentSelected");Array.from(u).forEach(x=>x.classList.remove("dgComponentSelected"))}function A(u){u.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function j(u){var R;const{contents:x=[]}=s.schema,k=x==null?void 0:x.findIndex(q=>q.id===u),M=x[k];(R=s==null?void 0:s.setupContext)==null||R.emit("selectionChange",M.type,M)}function d(u,x){S(),B(u),A(u),j(x)}function g(u,x){S(),B(u),A(u)}return{activeId:r,addTab:E,changeTitleStyle:h,removeTab:l,selectTab:V,selectTabByTabId:N,tabPages:a,updateTab:O,toolbarItems:w,removeDesignTab:v,selectDesignTab:d,selectDesignTabToolbar:g,toolbarSchema:T}}function en(t,n){const o=e.inject("design-item-context"),s=e.inject("toolbar-item-handler",()=>{});function a(){s&&s()}function r(d){const g={"dropdown-menu":!0};if(d.class){const u=d.menuClass.split(" ");u&&u.length&&u.reduce((x,k)=>(x[k]=!0,x),g)}return g}function m(d){const g={disabled:!d.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},u=d.dropdownClass.split(" ");return u&&u.length&&u.reduce((x,k)=>(x[k]=!0,x),g),g}function T(d){const g={disabled:!d.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},u=d.class.split(" ");return u&&u.length&&u.reduce((x,k)=>(x[k]=!0,x),g),g}let w;const y=new Map;function C(d,g,u){var k;((k=d.target)==null?void 0:k.id)===g.id&&d.stopPropagation();const x=u?u.id:"__top_item__";if(g.children&&g.children.length&&(g.expanded=!g.expanded,g.expanded?y.set(x,g):y.delete(x)),y.has(x)&&y.get(x)!==g){const M=y.get(x);M&&(M.expanded=!1)}}function c(d){d&&(d.stopPropagation(),d.preventDefault())}function i(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused"));const d=document.getElementsByClassName("dgComponentSelected");Array.from(d).forEach(g=>g.classList.remove("dgComponentSelected"))}function h(d){d.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function b(d){const{buttons:g=[]}=o.schema;let u=[];g.forEach(M=>{u=u.concat(M.children||[])});const x=u.findIndex(M=>M.id===d),k=x===-1?null:u[x];return{index:x,item:k}}function p(d){const{buttons:g=[]}=o.schema,u=g.findIndex(k=>k.id===d),x=u===-1?null:g[u];return{index:u,item:x}}function l(d){var x;o.schema;const{index:g,item:u}=b(d);(x=o==null?void 0:o.setupContext)==null||x.emit("selectionChange",u==null?void 0:u.type,u)}const f=function(d){const{componentType:g}=d,u=Y(g,d),x=g.toLowerCase().replace("-","_");return u&&!u.id&&u.type===g&&(u.id=`${x}_${Math.random().toString().slice(2,6)}`),u},N=function(){const d={componentType:"response-toolbar-item",parentComponentInstance:n.value,targetPosition:-1};return f(d)};function V(d,g){c(d),i(),h(d),l(g.id)}function E(d,g,u){c(d);const x=g.id,k=u&&u.id,{buttons:M=[]}=o.schema;if(!k)return;const{index:R}=p(k);if(R===-1)return;const{index:q}=b(x);q!==-1&&(M[R].children.splice(q,1),a())}function O(d,g,u){c(d);const x=u&&u.id,{buttons:k=[]}=o.schema;if(!x)return;const{index:M}=p(x);if(M===-1)return;const R=N(),q=Object.assign({},R,{text:g.text});k[M].children.push(q),a()}function B(d,g,u){c(d);const x=u&&u.id,{buttons:k=[]}=o.schema;if(!x)return;const{index:M}=p(x);if(M===-1)return;const R=N(),q=Object.assign({},R,{text:"按钮"});k[M].children.push(q),a()}function v(d,g){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:u=>E(u,d,g)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:u=>O(u,d,g)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增同级",ref:"appendSame",style:"width:85px!important;padding:0 5px;position:static;",onClick:u=>B(u,d,g)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增同级")])])])])}function S(d){return d.children.map(g=>g.children&&g.children.length?e.createVNode("li",{class:m(g),id:g.id,onClick:u=>g.enable&&C(u,g,d)},[e.createVNode("span",{id:g.id,class:T(g),onMouseover:u=>g.enable&&C(u,g,d)},[g.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),w(g,g)]):e.createVNode("li",{class:T(g),id:g.id,onClick:u=>V(u,g)},[v(g,d),t.shouldShowIcon(g)&&e.createVNode("i",{class:t.iconClass(g)},null),g.text]))}function A(d,g,u){const x={display:d.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},k=document.getElementsByTagName("body")[0].getClientRects()[0].width,M=g,R=M==null?void 0:M.getClientRects();if(M&&R&&R.length){const{top:q,width:Q,left:G,right:J,height:K}=R[0],F=Math.ceil(K+q);x.top=`${F}px`,x.left=`${G}px`;const $=d.id+"_menu",D=g?g.querySelector("#"+$):null;if(D){x.display==="block"&&(D.style.display="block");const I=D.getBoundingClientRect();if(u){x.top=`${q-6}px`;const P=Math.ceil(Q+G);x.left=`${P}px`}k-G-Q<I.width&&(x.left=`${(u?G:J)-I.width}px`)}}return x}w=function(d,g){var M,R;const u=e.getCurrentInstance(),x=g?g.id:d.id,k=(R=(M=u==null?void 0:u.exposed)==null?void 0:M.elementRef.value)==null?void 0:R.querySelector("#"+x);return e.createVNode("ul",{class:r(d),style:A(d,k,g),id:d.id+"_menu"},[S(d)])};function j(){y.forEach(d=>{d.expanded=!1}),y.clear()}return{renderDropdownMenu:w,clearAllDropDownMenu:j}}function tn(t,n,o){const s=e.ref(t.alignment),{renderDropdownMenu:a,clearAllDropDownMenu:r}=en(n,o),m=e.inject("design-item-context"),T=e.inject("toolbar-item-handler",()=>{});function w(){T&&T()}function y(j){const d={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":s.value==="right","f-btn-mr":s.value==="left"},g=j.dropdownClass.split(" ");return g&&g.length&&g.reduce((u,x)=>(u[x]=!0,u),d),d}function C(j){const d={btn:!0,disabled:!j.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(j.icon&&j.icon.trim())};if(j.class){const g=j.class.split(" ");g&&g.length&&g.reduce((u,x)=>(u[x]=!0,u),d)}return d}function c(j){j&&(j.stopPropagation(),j.preventDefault())}function i(j,d){c(j);const g=d.expanded;document.body.click(),d.expanded=!g}const h=function(j){const{componentType:d}=j,g=Y(d,j),u=d.toLowerCase().replace("-","_");return g&&!g.id&&g.type===d&&(g.id=`${u}_${Math.random().toString().slice(2,6)}`),g},b=function(){const j={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return h(j)};function p(j){const d=m.schema.buttons||m.schema.contents,g=d==null?void 0:d.findIndex(x=>x.id===j),u=g===-1?null:d[g];return{index:g,toolbarItem:u}}function l(j,d){var R;const{index:g,toolbarItem:u}=p(d);if(g===-1)return;const x=u.text||"按钮",k=b(),M=Object.assign({},k,{text:x});(R=m.schema.buttons)==null||R.push(M),w()}function f(j,d){const{index:g,toolbarItem:u}=p(d);if(g===-1)return;const x=u.text||"按钮",k=b(),M=Object.assign({},k,{text:x}),R=m.schema.buttons[g].children||[];R.push(M),m.schema.buttons[g].children=R,w()}function N(j,d){const g=m.schema.buttons||m.schema.contents,u=g==null?void 0:g.findIndex(x=>x.id===d);u!==-1&&(g.splice(u,1),w())}function V(j){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:d=>N(d,j)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:d=>l(d,j)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:d=>f(d,j)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function E(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(d=>d.classList.remove("dgComponentFocused"));const j=document.getElementsByClassName("dgComponentSelected");Array.from(j).forEach(d=>d.classList.remove("dgComponentSelected"))}function O(j){j.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function B(j){var x;const d=m.schema.buttons||m.schema.contents,g=d==null?void 0:d.findIndex(k=>k.id===j);if(g===-1)return;const u=d[g];(x=m==null?void 0:m.setupContext)==null||x.emit("selectionChange","response-toolbar-item",u)}function v(j,d){c(j),E(),O(j),c(j),i(j,d),B(d.id)}function S(j){return e.createVNode("div",{id:j.id,class:y(j)},[e.createVNode("div",{class:C(j),style:"display: flex;padding-right: 0.1rem;",onClick:d=>j.enable&&v(d,j)},[V(j.id),n.shouldShowIcon(j)&&e.createVNode("i",{class:n.iconClass(j)},null),e.createVNode("span",null,[j.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),a(j)])}function A(){r()}return{renderToolbarDropdown:S,clearAllDropDown:A}}const{buildResponseToolbarItems:He}=me(),nn=e.defineComponent({name:"FResponseToolbarDesign",props:fe,emits:["Click"],setup(t,n){const o=e.ref(He(t.items)),s=e.ref(),a=e.ref(),r=e.ref(t.alignment),m={id:"__more_buttons__",text:"More"},T=e.ref(new ne(m)),w=De(),y=e.computed(()=>T.value.children.length>0),C=e.ref(),c=e.inject("design-item-context"),i=ge(C,c),h=e.inject("toolbar-item-handler",()=>{});e.onMounted(()=>{C.value.componentInstance=i}),n.expose(i.value);function b(){h&&h()}const p=e.computed(()=>({"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0})),l=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":r.value==="right","justify-content-start":r.value==="left"})),{renderToolbarDropdown:f,clearAllDropDown:N}=tn(t,w,i);function V(){o.value.filter($=>$.children&&$.children.length>0).forEach($=>{$.expanded=!1}),T.value.expanded=!1,N()}function E($){const D={"f-icon":!0};if($.icon){const I=$.icon.trim().split(" ");I&&I.length&&I.reduce((P,H)=>(P[H]=!0,P),D)}return D}function O($){return!!($.icon&&$.icon.trim())}function B($){const D={btn:!0,"f-rt-btn":!0,"f-btn-ml":r.value==="right","f-btn-mr":r.value==="left","btn-icontext":!!($.icon&&$.icon.trim())};if($.class){const I=$.class.split(" ");I&&I.length&&I.reduce((P,H)=>(P[H]=!0,P),D)}return D}function v($){$&&($.stopPropagation(),$.preventDefault())}function S(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(D=>D.classList.remove("dgComponentFocused"));const $=document.getElementsByClassName("dgComponentSelected");Array.from($).forEach(D=>D.classList.remove("dgComponentSelected"))}function A($){$.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function j($){var H;const D=c.schema.buttons||c.schema.contents,I=D==null?void 0:D.findIndex(L=>L.id===$);if(I===-1)return;const P=D[I];(H=c==null?void 0:c.setupContext)==null||H.emit("selectionChange","response-toolbar-item",P)}const d=function($){const{componentType:D}=$,I=Y(D,$),P=D.toLowerCase().replace("-","_");return I&&!I.id&&I.type===D&&(I.id=`${P}_${Math.random().toString().slice(2,6)}`),I},g=function(){const $={componentType:"response-toolbar-item",parentComponentInstance:i.value,targetPosition:-1};return d($)};function u($,D){S(),A($),v($),j(D)}function x($,D){const I=c.schema.buttons||c.schema.contents,P=I==null?void 0:I.findIndex(H=>H.id===D);P!==-1&&(I.splice(P,1),b())}function k($){const D=c.schema.buttons||c.schema.contents,I=D==null?void 0:D.findIndex(H=>H.id===$),P=I===-1?null:D[I];return{index:I,toolbarItem:P}}function M($,D){var Z;const{index:I,toolbarItem:P}=k(D);if(I===-1)return;const H=P.text||"按钮",L=g(),_=Object.assign({},L,{text:H});(Z=c.schema.buttons)==null||Z.push(_),b()}function R($,D){const{index:I,toolbarItem:P}=k(D);if(I===-1)return;const H=P.text||"按钮",L=g(),_=Object.assign({},L,{text:H}),Z=c.schema.buttons[I].items||[];Z.push(_),c.schema.buttons[I].children=Z,b()}function q($){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:D=>x(D,$)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:D=>M(D,$)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:D=>R(D,$)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function Q($){return e.createVNode("div",{class:"farris-component position-relative",style:"display:inline-block!important;",onClick:D=>u(D,$.id)},[q($.id),e.createVNode("button",{type:"button",class:B($),id:$.id,disabled:!$.enable},[O($)&&e.createVNode("i",{class:E($)},null),$.text])])}const G=new Map,J=[];function K($){const D=a.value;let I=$;const P=Array.from(D.children),H=P[P.length-1].id==="__more_buttons__"?P[P.length-1]:null;if(H){const U=H.computedStyleMap().get("margin-left"),X=H.computedStyleMap().get("margin-right"),ie=(U?U.value:0)+H.getBoundingClientRect().width+(X?X.value:0);I-=ie}const L=P.filter(U=>U.id!=="__more_buttons__");for(const U of L){const X=U.computedStyleMap().get("margin-left"),ie=U.computedStyleMap().get("margin-right"),ve=(X?X.value:0)+U.getBoundingClientRect().width+(ie?ie.value:0);I<ve?(G.set(U.id,!0),J.push({id:U.id,width:ve})):I-=ve}if(J.length)for(let U=J.length-1;U>=0;U--){const X=J[U].width;if(I>=X)I-=X,G.delete(J[U].id),J.pop();else break}const _=Object.assign({},T.value);_.children=[];const Z=new ne(_),le=o.value.reduce((U,X)=>(G.has(X.id)&&Z.children.push(X),X.visible=!G.has(X.id),U.push(X),U),[]);T.value=Z,o.value=le}const F=new ResizeObserver($=>{if($.length){const I=$[0].contentRect.width,H=a.value.getBoundingClientRect().width;(I<H||J.length)&&K(I)}});return e.onMounted(()=>{const $=s.value;F.observe($),document.body.addEventListener("click",V)}),e.onUnmounted(()=>{F.disconnect(),document.body.removeEventListener("click",V)}),e.watch(()=>t.items,()=>{o.value=He(t.items)}),()=>e.createVNode("div",{ref:C,class:p.value},[e.createVNode("div",{ref:s,class:l.value},[e.createVNode("div",{ref:a,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter($=>$.visible).map($=>$.children&&$.children.length>0?f($):Q($)),y.value&&f(T.value)])])])}}),on={id:{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}},Le=e.ref(0);function sn(t,n){const o=n.getBoundingClientRect(),s=t.getBoundingClientRect(),a=s.top>=o.top,r=s.top<=o.bottom;return a&&r}function an(t){if(!t)return;let n;if(t.className.includes("dgComponentSelected")?n=t:n=t.querySelector(".dgComponentSelected"),!n)return;const o=n.getBoundingClientRect();if(o.width===0&&o.height===0)return;const s=n.querySelector(".component-btn-group");if(s){if(!sn(n,t)){s.style.display="none";return}s.style.display="";const r=s.getBoundingClientRect(),m=s.querySelector("div");if(m){const T=m.getBoundingClientRect();m.style.top=r.top+"px",m.style.left=r.left-T.width+"px"}}}function rn(t,n,o){var E;function s(){}const a="",r=e.ref();function m(){return!0}function T(){return!1}function w(){return!0}function y(){return!0}function C(O){if(!O||!O.value)return null;const B=e.ref(O==null?void 0:O.value.parent),v=C(B);return v||null}function c(O=n){const{componentInstance:B,designerItemElementRef:v}=O;return!B||!B.value?null:B.value.canMove?v:c(O.parent)}function i(O){return!!o}function h(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function b(){}function p(O,B){}function l(O){const{componentType:B}=O;let v=Y(B,O);const S=B.toLowerCase().replace("-","_");return v&&!v.id&&v.type===B&&(v.id=`${S}_${Math.random().toString().slice(2,6)}`),v}function f(O,B){const v=String(O.getAttribute("data-controltype")),S=O.getAttribute("data-feature"),A=S?JSON.parse(S):{};A.parentComponentInstance=r.value;let j=Y(v,A);const d=v.toLowerCase().replace("-","_");return j&&!j.id&&j.type===v&&(j.id=`${d}_${Math.random().toString().slice(2,6)}`),j}function N(O){}function V(){return[]}return r.value={canMove:m(),canSelectParent:T(),canDelete:w(),canNested:!y(),contents:[],elementRef:t,parent:(E=n.parent)==null?void 0:E.componentInstance,schema:n.schema,styles:a,canAccepts:i,getBelongedComponentInstance:C,getDraggableDesignItemElement:c,getDraggingDisplayText:h,getPropConfig:V,getDragScopeElement:b,onAcceptMovedChildElement:p,onAcceptNewChildElement:f,onChildElementMovedOut:N,addNewChildComponentSchema:l,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const cn=e.defineComponent({name:"FDesignerInnerItem",props:on,emits:["selectionChange","addComponent"],setup(t,n){const o=e.ref(t.canMove),s=e.ref(t.canAdd),a=e.ref(t.canDelete),r=e.ref(!1),m=e.ref(t.contentKey),T=e.ref(t.childType),w=e.ref(t.childLabel),y=e.ref(t.modelValue),C=e.ref(""),c=e.ref(),i=e.inject("canvas-dragula"),h=e.ref(),b=e.inject("design-item-context"),p={designerItemElementRef:c,componentInstance:h,schema:y.value,parent:b,setupContext:n};e.provide("design-item-context",p);const l=e.computed(()=>({"farris-component":!0,"position-relative":o.value&&a.value,"farris-nested":r.value,"can-move":o.value,"d-none":c.value&&c.value.classList.contains("d-none")})),f=e.computed(()=>{const d={};return C.value&&C.value.split(";").reduce((g,u)=>{const[x,k]=u.split(":");return x&&(g[x]=k),g},d),d});function N(d,g){if(b&&b.schema[m.value]){const u=b.schema[m.value].findIndex(x=>x.id===g.id);b.schema[m.value].splice(u,1),b.componentInstance.value.updateDragAndDropRules()}}function V(d){if(h.value.addNewChildComponentSchema){const g={componentType:T.value,label:w.value,parentComponentInstance:h.value,targetPosition:-1},u=h.value.addNewChildComponentSchema(g);y.value[m.value].push(u),n.emit("addComponent")}}function E(){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:d=>{V()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function O(d){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:g=>{N(g,d)}},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function B(d){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[E(),O(d)])])}e.watch(()=>t.modelValue,d=>{y.value=d,p.schema=d});function v(d){const g=d.target;an(g)}function S(){var d,g;(g=(d=y.value)==null?void 0:d.contents)!=null&&g.length&&c.value&&c.value.addEventListener("scroll",v)}function A(){const d=c.value,g=e.ref(d.children[1]);return rn(g,p).value}e.onMounted(()=>{if(c.value){const d=c.value.querySelector(`[data-dragref='${y.value.id}-container']`);h.value=d&&d.componentInstance?d.componentInstance.value:A(),i&&d&&i.attachComponents(d,y.value),r.value=h.value.canNested!==void 0?h.value.canNested:r.value,o.value=h.value.canMove!==void 0?h.value.canMove:o.value,C.value=h.value.styles||"",c.value&&(c.value.componentInstance=h,c.value.designItemContext=p)}S(),Le.value++}),e.onBeforeUnmount(()=>{c.value&&c.value.removeEventListener("scroll",v)});function j(d){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(u=>u.classList.remove("dgComponentFocused")),d&&(d.preventDefault(),d.stopPropagation());const g=c.value;if(g){const u=document.getElementsByClassName("dgComponentSelected");if(!(u&&u.length===1&&u[0]===c.value)){Array.from(u).forEach(M=>M.classList.remove("dgComponentSelected")),g.classList.add("dgComponentFocused"),n.emit("selectionChange",y.value.type,y.value);const k=h.value.getDraggableDesignItemElement(p);k&&k.value&&k.value.classList.add("dgComponentSelected")}}Le.value++}return()=>e.createVNode("div",{id:`${t.id}-design-item`,ref:c,class:l.value,style:f.value,onClick:j},[B(y.value),n.slots.default&&n.slots.default()])}});function ln(t,n,o,s){const{toolbarItems:a,toolbarSchema:r}=t,m=w=>{};function T(w,y){var C;(C=s.setupContext)==null||C.emit("selectionChange",w,y)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(cn,{modelValue:r.value,"onUpdate:modelValue":w=>r.value=w,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",onSelectionChange:T},{default:()=>[e.createVNode(nn,{items:a.value,onClick:m},null)]})])])}const dn=e.defineComponent({name:"FTabsDesign",props:se,emits:["tabChange","tabRemove"],setup(t,n){const o=e.ref(),s=e.inject("design-item-context"),a=Yt(s.schema,s.parent),r=ge(o,s,a),m=e.ref(t.tabType),T=e.shallowRef(),w=e.shallowRef(),y=Kt(t,n,T,s),{activeId:C,changeTitleStyle:c,tabPages:i,addTab:h,updateTab:b,selectTabByTabId:p,toolbarItems:l}=y,f=$e(t,w,y),N=je(t,T,f,y),{previousButtonClass:V,nextButtonClass:E,nextButtonGroupClass:O,scrollTab:B,updateNavigationLayout:v}=N,S=Ve(t,y),{hideDropDown:A}=S,j=Zt(t,T,N,f,y,r,a),d=j,g=Ne(t,T,N,f,y),u=new Map([["default",j],["one-page",d],["pills",g]]);e.computed(()=>{const L=i.value.find(_=>_.props.id===C.value);return L==null?void 0:L.slots});const x=e.computed(()=>{const L=i.value.find(Z=>Z.props.id===C.value);return(L==null?void 0:L.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:C,addTab:h,updateTab:b,tabPages:i,tabType:m});function k(){const L=r.value.schema.contents||[];return L.length<1?null:L.find(Z=>Z.id===C.value)}function M(){var _;const L=k();l.value=[...(_=L==null?void 0:L.toolbar)==null?void 0:_.buttons]}e.provide("toolbar-item-handler",M);const R=e.computed(()=>t.fill||t.tabType==="fill"),q=e.computed(()=>t.tabType==="pills"),Q=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":x.value,"farris-tabs-inContent":!x.value,"farris-tabs-nav-fill":R.value,"farris-tabs-nav-pills":q.value})),G=e.computed(()=>({width:x.value&&t.titleWidth?`${t.titleWidth}%`:""})),J=e.computed(()=>({"farris-tabs":!0,"flex-column":t.position==="top","flex-column-reverse":t.position==="bottom","flex-row":t.position==="left","flex-row-reverse":t.position==="right","one-page":t.tabType==="one-page"}));e.onMounted(()=>{i.value.length&&(C.value=t.activeId||i.value[0].props.id,p(C.value)),e.nextTick(()=>{v()}),c(T),window.addEventListener("click",L=>{var _;A.value||(_=o.value)!=null&&_.contains(L.target)||(A.value=!0)}),window.addEventListener("resize",()=>{v()}),o.value.componentInstance=r});function K(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:V.value,onClick:()=>{B(0,-1)}},null)}function F(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:E.value,onClick:()=>{B(0,1)}},null)}const{renderMorePagesButtton:$}=Se(t,S,N,y);function D(){return!!l.value.length&&ln(y,r,a,s)}const I=u.get(t.tabType)||u.get("default");function P(){var L,_,Z,le;return e.createVNode("div",{class:Q.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(L=n.slots).headerPrefix)==null?void 0:_.call(L)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:G.value},[K(),I&&I(),e.createVNode("div",{class:O.value},[F(),$()])]),D(),e.createVNode("div",{class:"farris-tabs-header-post"},[(le=(Z=n.slots).headerSuffix)==null?void 0:le.call(Z)])])}function H(){var L,_;return e.createVNode("div",{class:"farris-tabs-content",ref:w},[(_=(L=n.slots).default)==null?void 0:_.call(L)])}return n.expose(r.value),()=>e.createVNode("div",{class:J.value,ref:o},[P(),H()])}});function un(){function t(n){var a,r;if(!n)return!1;const o=((a=n.targetContainer)==null?void 0:a.componentInstance)&&n.targetContainer.componentInstance.value;if(!o)return!1;const s=(r=o.schema.appearance)==null?void 0:r.class;if(n.controlCategory==="input"||n.controlType==="form-group"){const m=o.schema.type,T=(m==="response-form"||m==="content-container")&&s&&s.includes("farris-form");if(o.schema.type!=="response-layout-item"&&!T)return!1}return n.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}function pn(t,n){function o(a){return!!un().basalDragulaRuleForContainer(a)}function s(a){}return{canAccepts:o,onAcceptMovedChildElement:s}}function fn(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const mn=e.defineComponent({name:"FTabPageDesign",props:re,emits:[],setup(t,n){const o=e.ref(),s=e.inject("design-item-context"),a=pn(s.schema,s.parent),r=ge(o,s,a);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,n.expose(r.value);const m=e.inject("tabs"),T=e.ref(!0),w={slots:n.slots,props:t},y=e.ref((m==null?void 0:m.tabType.value)||"default");function C(){t.id===m.activeId.value?s.designerItemElementRef.value.classList.remove("d-none"):s.designerItemElementRef.value.classList.add("d-none")}e.onMounted(()=>{o.value.componentInstance=r;const l=m.tabPages.value.findIndex(f=>f.props.id===t.id);!l||l===-1?m==null||m.addTab(w):l>-1&&(T.value=!1,console.warn(`已经存在id为${t.id}的页签啦`)),C()}),e.onUnmounted(()=>{});const c=e.computed(()=>({display:(t==null?void 0:t.id)===(m==null?void 0:m.activeId.value)?"":"none"}));e.watch(()=>t,l=>{m==null||m.updateTab({props:l,slots:n.slots})},{immediate:!0,deep:!0}),e.watch(m.activeId,C);function i(){var f,N;const l=(N=(f=n.slots).default)==null?void 0:N.call(f);return e.createVNode(Pe,{"main-title":t.title,class:"farris-tab-page"},fn(l)?l:{default:()=>[l]})}function h(){var f,N;const l=(N=(f=n.slots).default)==null?void 0:N.call(f);return e.createVNode("div",{ref:o,class:"farris-tab-page drag-container","data-dragref":`${s.schema.id}-container`,style:c.value},[l])}const p=new Map([["default",h],["one-page",i]]).get(y.value)||h;return()=>T.value?p():null}}),bn={install(t){t.component(ae.name,ae),t.component(ce.name,ce)},register(t,n,o){t.tabs=ae,t["tab-page"]=ce,n.tabs=pe,n["tab-page"]=be},registerDesigner(t,n,o){t.tabs=dn,t["tab-page"]=mn,n.tabs=pe,n["tab-page"]=be}};z.FTabPage=ce,z.FTabs=ae,z.default=bn,z.tabPageProps=re,z.tabPagePropsResolver=be,z.tabsProps=se,z.tabsPropsResolver=pe,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z.tabs={},z.Vue,z.LodashES))})(this,function(z,e,ee){"use strict";var hn=Object.defineProperty;var yn=(z,e,ee)=>e in z?hn(z,e,{enumerable:!0,configurable:!0,writable:!0,value:ee}):z[e]=ee;var W=(z,e,ee)=>yn(z,typeof e!="symbol"?e+"":e,ee);const de={},we={};function ue(t){const{properties:n,title:o}=t,s=Object.keys(n).reduce((a,r)=>(a[r]=n[r].type==="object"&&n[r].properties?ue(n[r]):ee.cloneDeep(n[r].default),a),{});return s.id=`${o}-${Date.now()}`,s}function Y(t,n={}){const o=de[t];if(o){let s=ue(o);const a=we[t];return s=a?a({getSchemaByType:Y},s,n):s,s}return null}function _e(t,n){const o=ue(n);return Object.keys(t).reduce((s,a)=>(s[a]=t[a],s),o),o}function qe(t,n){return Object.keys(t).filter(s=>t[s]!=null).reduce((s,a)=>{if(n.has(a)){const r=n.get(a);if(typeof r=="string")s[r]=t[a];else{const b=r(a,t[a],t);Object.assign(s,b)}}else s[a]=t[a];return s},{})}function We(t,n,o=new Map){const s=_e(t,n);return qe(s,o)}function ze(t={}){function n(y,C,c,l){if(typeof c=="number")return l[y].length===c;if(typeof c=="object"){const h=Object.keys(c)[0],m=c[h];if(h==="not")return Number(l[y].length)!==Number(m);if(h==="moreThan")return Number(l[y].length)>=Number(m);if(h==="lessThan")return Number(l[y].length)<=Number(m)}return!1}function o(y,C,c,l){return l[y]&&l[y].propertyValue&&String(l[y].propertyValue.value)===String(c)}const s=new Map([["length",n],["getProperty",o]]);Object.keys(t).reduce((y,C)=>(y.set(C,t[C]),y),s);function a(y,C){const c=y;return typeof C=="number"?[{target:c,operator:"length",param:null,value:Number(C)}]:typeof C=="boolean"?[{target:c,operator:"getProperty",param:y,value:!!C}]:typeof C=="object"?Object.keys(C).map(l=>{if(l==="length")return{target:c,operator:"length",param:null,value:C[l]};const h=l,m=C[l];return{target:c,operator:"getProperty",param:h,value:m}}):[]}function r(y){return Object.keys(y).reduce((c,l)=>{const h=a(l,y[l]);return c.push(...h),c},[])}function b(y,C){if(s.has(y.operator)){const c=s.get(y.operator);return c&&c(y.target,y.param,y.value,C)||!1}return!1}function T(y,C){return r(y).reduce((h,m)=>h&&b(m,C),!0)}function w(y,C){const c=Object.keys(y),l=c.includes("allOf"),h=c.includes("anyOf"),m=l||h,p=(m?y[m?l?"allOf":"anyOf":"allOf"]:[y]).map(j=>T(j,C));return l?!p.includes(!1):p.includes(!0)}return{parseValueSchema:w}}const Te={},Ue={};ze();function te(t,n,o=new Map,s=(b,T,w)=>T,a={},r=b=>b){return de[n.title]=n,we[n.title]=s,Te[n.title]=a,Ue[n.title]=r,(b={})=>{const T=We(b,n,o),w=Object.keys(t).reduce((y,C)=>(y[C]=t[C].default,y),{});return Object.assign(w,T)}}function oe(t,n){return{customClass:n.class}}const Ge=new Map([["appearance",oe]]);function Je(t,n,o){const s=t.getSchemaByType("tab-page");return n.contents=[s],n}const Ze={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tabs.schema.json",title:"tabs",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Tabs",type:"string"},type:{description:"The type string of Tabs component",type:"string",default:"tabs"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]}},required:["id","type","contents"]},Qe={title:"tabs",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"Splitter",enum:[]}},title:{title:"标题",type:"string",description:"标题"}}},appearance:{description:"",title:"外观",properties:{size:{description:"",type:"cascade",title:"尺寸",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}},titleWidth:{description:"标题区域宽度占页面比",type:"number",title:"标题区域宽度(%)",min:0,decimals:0,max:100},autoTitleWidth:{description:"开启,则显示全部字符;关闭,最多显示7个字符",type:"select",title:"标题自适应宽度",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},defaultValue:!1},contentFill:{description:"flex布局下,填充满剩余部分",type:"select",title:"填充",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},defaultValue:!1}}},behavior:{description:"",title:"行为",properties:{visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}}}}}},se={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropdown:{type:Boolean,default:!0},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1},justifyContent:{type:String,default:"left"}},pe=te(se,Ze,Ge,Je,Qe);function Xe(t,n,o){const s=e.ref([]),a=e.ref(t.activeId||""),r=e.ref(!0),b=e.ref([]);function T(u){const f=u.value.findIndex(p=>p.props.show!==!1&&!a.value&&!p.props.disabled);!a.value&&f!==-1&&(a.value=u.value[f].props.id)}function w(u){var p;if(t.autoTitleWidth)return;const f=(p=u.value)==null?void 0:p.querySelectorAll(".st-tab-text");if(f)for(let x=0;x<f.length;x++){const j=f[x].parentNode;f[x].scrollWidth>j.offsetWidth?f[x].classList.contains("farris-title-text-custom")||f[x].classList.add("farris-title-text-custom"):f[x].classList.remove("farris-title-text-custom")}}const y=u=>{u.preventDefault(),u.stopPropagation()};function C(u,f,p=!1){const x=s.value.findIndex(j=>j.props.id===f);s.value=s.value.filter(j=>j.props.id!==f),a.value===f&&(a.value="",T(s)),y(u),e.nextTick(()=>{w(o),p&&(r.value=!0),n.emit("tabRemove",{removeIndex:x,removeId:f,activeId:a.value})})}function c(u){const f=a.value;a.value=u;const p=s.value.find(x=>x.props.id===u);b.value=[],p&&p.props.toolbar&&p.props.toolbar.contents&&p.props.toolbar.contents.length&&(b.value=[...p.props.toolbar.contents]),n.emit("tabChange",{prevId:f,nextId:a.value})}function l(u){c(u)}function h(u){s.value.findIndex(p=>p.props.id===u.props.id)===-1&&s.value.push(u)}function m(u){s.value.findIndex(p=>p.props.id===u.props.id)!==-1&&(s.value.forEach(p=>{p.props.id===u.props.id&&(p=u)}),e.nextTick(()=>{w(o)}))}return{activeId:a,addTab:h,changeTitleStyle:w,removeTab:C,selectTab:l,selectTabByTabId:c,tabPages:s,updateTab:m,toolbarItems:b}}function Ye(t,n,o,s,a){const{activeId:r,removeTab:b,selectTab:T}=a,w=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":t.autoTitleWidth})),y=e.computed(()=>({"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===r.value,"f-state-disable":n.disabled})),C=e.computed(()=>({width:`${n.tabWidth}px`})),c=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===r.value,disabled:n.disabled}));function l(x){return e.createVNode("span",{class:w.value,title:x.title},[x.title])}function h(x){return x.slots.title?x.slots.title:l}const m=h(o),u=e.ref(n.removeable);function f(){return e.createVNode("span",{class:"st-drop-close",onClick:x=>b(x,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function p(x){T(n.id),t.tabType==="one-page"&&s.scrollToByPaggId(n.id)}return e.createVNode("li",{class:y.value,style:C.value},[e.createVNode("a",{class:c.value,onClick:p},[m(n),u.value&&f()])])}function Ke(t,n,o,s,a){const{shouldShowNavigationButtons:r}=o,{tabPages:b}=a,T=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),w=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),y=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":t.fill||t.tabType==="fill","nav-pills":t.tabType==="pills","flex-row":t.position==="top"||t.position==="bottom","flex-column":t.position==="left"||t.position==="right"}));return()=>e.createVNode("div",{class:T.value,style:w.value},[e.createVNode("ul",{class:y.value,ref:n},[b.value.map(C=>Ye(t,C.props,C,s,a))])])}const et={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/capsule.schema.json",title:"capsule",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a capsule",type:"string"},type:{description:"The type string of capsule component",type:"string",default:"capsule"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeHolder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},tt=new Map([["appearance",oe]]);function nt(t,n,o){return n}const ot={title:"capsule",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},xe={items:{Type:Array,default:[{name:"升序",value:"asc",icon:"f-icon f-icon-col-ascendingorder"},{name:"降序",value:"desc",icon:"f-icon f-icon-col-descendingorder"}]},modelValue:{type:String,default:""},type:{type:String,default:"primary"}},st={name:{type:String,default:""},value:{type:String,default:""},isActive:{type:Boolean,default:!1},icon:{type:String,default:""},index:{type:Number,default:0}};te(xe,et,tt,nt,ot);const at=e.defineComponent({name:"FCapsuleItem",props:st,emits:["mounted","active"],setup(t,n){const o=e.ref(),s=e.ref(t.isActive);e.watch(()=>t.isActive,b=>{s.value=b});const a=e.computed(()=>({"f-capsule-item":!0,"f-capsule-active-item":s.value}));e.onMounted(()=>{n.emit("mounted",o,t.value)});function r(b){n.emit("active",b,{name:t.name,value:t.value})}return()=>e.createVNode("div",{ref:o,class:a.value,onClick:b=>r(b)},[t.icon&&e.createVNode("i",{class:t.icon},null),t.name])}}),rt=e.defineComponent({name:"FCapsule",props:xe,emits:["change","update:modelValue"],setup(t,n){const o=e.ref(t.items),s=e.ref(),a=2,r=e.ref(t.modelValue),b=e.ref("none"),T=e.ref(t.type),w=e.computed(()=>{const v={"f-capsule-container":!0};return T.value&&(v[T.value]=!0),v}),y=e.computed(()=>({})),C=e.computed(()=>({"f-capsule":!0})),c=e.ref(a),l=e.ref(0),h=e.ref(0),m=e.computed(()=>({left:`${c.value}px`,width:`${l.value}px`,transition:b.value})),u=e.computed(()=>({width:`${h.value}px`})),f=new Map;function p(v){var S;if(f.has(v.value)){const A=(S=f.get(v.value))==null?void 0:S.value;if(A){const V=A.getBoundingClientRect(),i=s.value.getBoundingClientRect();c.value=V.left-i.left+a+s.value.scrollLeft,l.value=V.width-2*a}}}function x(v,S){const A=v.value;r.value=A,n.emit("update:modelValue",A),p(v),S&&n.emit("change",A)}function j(v){const S=o.value.findIndex(A=>A.value===v);S>-1&&x(o.value[S],!1)}e.watch(()=>t.modelValue,v=>{r.value=v,j(r.value)}),e.watch(()=>t.items,async v=>{o.value=v,await e.nextTick(),j(r.value),h.value=Array.from(f.values()).reduce((S,A)=>(S+=A.value.clientWidth,S),0)}),e.onMounted(async()=>{j(r.value),await e.nextTick(),b.value="0.1s ease-out all",h.value=Array.from(f.values()).reduce((v,S)=>(v+=S.value.clientWidth,v),0)});function E(v,S){x(S,!0)}function O(v,S){f.set(S,v)}function B(v,S){return e.createVNode(at,{name:v.name,value:v.value,isActive:v.value===r.value,index:S,onMounted:O,onActive:E},null)}return()=>e.createVNode("span",{ref:s,class:w.value,style:y.value},[e.createVNode("span",{class:"f-capsule-pane"},[o.value.map((v,S)=>B(v,S))]),e.createVNode("small",{class:C.value,style:m.value},null),e.createVNode("div",{class:"f-capsule-board",style:u.value},null)])}});function Ne(t,n,o,s,a){const r=e.ref(),{shouldShowNavigationButtons:b}=o,{activeId:T,tabPages:w}=a,y=e.computed(()=>w.value.map(h=>({name:h.props.title,value:h.props.id}))),C=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":b.value})),c=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{r.value&&(n.value=r.value.$el)});function l(){}return()=>e.createVNode("div",{class:C.value,style:c.value},[e.createVNode(rt,{items:y.value,modelValue:T.value,"onUpdate:modelValue":h=>T.value=h,onChange:l,ref:r},null)])}function ct(t,n,o,s){const{activeId:a,removeTab:r,tabPages:b}=s,{selectAndScrollToTab:T}=o,{hideDropDown:w,searchTabText:y}=n,C=e.ref("auto"),c=e.computed(()=>{var x,j;let p=[];return t.searchBoxVisible?p=(x=b.value)==null?void 0:x.filter(E=>E.props.title.includes(y.value)):p=(j=b.value)==null?void 0:j.slice(),p}),l=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!w.value}));function h(p){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:p.props.disabled,active:p.props.id===a.value,"d-none":p.props.show!==!0}}function m(p){p.preventDefault(),p.stopPropagation()}const u=()=>({width:C.value});function f(){return e.createVNode("div",{class:l.value},[t.searchBoxVisible&&e.createVNode("div",{onClick:p=>m(p),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":p=>y.value=p},null),[[e.vModelText,y.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),c.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:u()},[c.value.map(p=>e.createVNode("li",{class:h(p),onClick:x=>T(x,p.props)},[p.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:x=>r(x,p.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title"},[p.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:f}}function Se(t,n,o,s){const{hideDropDown:a}=n,{renderDropdownMenu:r}=ct(t,n,o,s),b=e.ref(t.showDropdown);function T(){return b.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{a.value=!1}},null),r()])}return{renderMorePagesButtton:T}}function je(t,n,o,s){const a=e.ref(!1),{selectTabByTabId:r,tabPages:b}=s,T=4;function w(){var p;const u=n.value,f=(p=n.value)==null?void 0:p.parentElement;a.value=f&&u&&f.offsetWidth<u.scrollWidth-T}const y=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!a.value})),C=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!a.value})),c=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!a.value}));function l(u,f){if(!n.value)return;const p=n.value.scrollLeft,x=n.value.scrollWidth-n.value.offsetWidth;if(f>0){if(n.value.scrollLeft>=x)return;n.value.scrollLeft=p+t.scrollStep+u}else if(f<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=p-t.scrollStep-u}}function h(u){if(!a.value||!n.value)return;const f=t.tabType==="pills"?".f-capsule-item":".nav-item",p=n.value.querySelectorAll(f),{parentElement:x}=n.value,j=p[u];if(j&&x){const E=x.getBoundingClientRect().left,O=x.getBoundingClientRect().right,B=j.getBoundingClientRect().left,v=j.getBoundingClientRect().right;B<E?l(E-B,-1):O<v&&l(v-O,1),t.tabType==="one-page"&&o.scrollTo(u)}}function m(u,f){if(f.disabled)return;r(f.id);const p=b.value.findIndex(x=>x.props.id===f.id);e.nextTick(()=>{h(p)})}return{previousButtonClass:y,nextButtonGroupClass:C,nextButtonClass:c,scrollTab:l,selectAndScrollToTab:m,shouldShowNavigationButtons:a,updateNavigationLayout:w}}function Ve(t,n){const{tabPages:o}=n,s=e.ref(""),a=e.ref(!0),r=e.computed(()=>t.searchBoxVisible),b=e.computed(()=>r.value?o.value.filter(w=>w.props.title.includes(s.value)):o.value.slice());return{searchTabText:s,hideDropDown:a,shouldShowSearchBox:r,tabsInDropdownMenu:b}}function $e(t,n,o){const s=".farris-tab-page",{tabPages:a}=o;function r(T){const w=n.value;if(w){const y=n.value.querySelectorAll(s);if(y.length>0){const C=y[T],{offsetTop:c}=C,l=c-32>0?c-32:0;w.scrollTop=l}}}function b(T){const w=a.value.findIndex(y=>y.props.id===T);w>-1&&r(w)}return{scrollTo:r,scrollToByPaggId:b}}const lt=new Map([["buttons","items"]]);function it(t,n,o){return n}const dt={$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"},style:{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:[]}},required:["id","type","buttons"]},Be={$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"},style:{type:"string"}},default:{}},text:{description:"The items of Response Toolbar.",type:"string",default:""},icon:{description:"The icon of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},ut={title:"response-toolbar",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}}}},behavior:{title:"行为",description:"",properties:{alignment:{title:"对齐方式",description:"The alignment of Response Toolbar Button.",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"right",name:"右对齐"},{value:"left",name:"左对齐"}]}},buttons:{title:"按钮",description:"The items of Response Toolbar.",type:"array",default:[],$converter:"/converter/buttons.converter"}}}}},ke={title:"response-toolbar-item",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}},fe={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};de[Be.title]=Be,Te[ke.title]=ke,te(fe,dt,lt,it,ut);class Me{constructor(n){W(this,"id","");W(this,"class","btn-secondary");W(this,"icon","");W(this,"groupId","");W(this,"order",-1);W(this,"asDropDownTop",!1);W(this,"text","");W(this,"visible",!0);W(this,"responsed",!1);W(this,"tipsEnable",!1);W(this,"tipsText","");W(this,"width",0);W(this,"onClick",()=>{});W(this,"options");this.options=n;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(n).filter(s=>o.indexOf(s)>-1).forEach(s=>{this[s]=n[s]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:e.computed(()=>!0)}setWidth(n){this.width=parseInt(n,10)}getWidth(){return this.visible?this.width:!1}}class pt extends Me{constructor(n){super(n)}}function me(){function t(n){const o=[];return n.reduce((s,a)=>(a.children&&a.children.length>0?s.push(new ne(a)):s.push(new pt(a)),s),o),o}return{buildResponseToolbarItems:t}}const{buildResponseToolbarItems:ft}=me();class ne extends Me{constructor(o){super(o);W(this,"placement","");W(this,"dropdownClass","");W(this,"menuClass","");W(this,"split",!1);W(this,"children",[]);W(this,"expanded",!1);const s=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(a=>s.indexOf(a)>-1).forEach(a=>{this[a]=o[a]}),o.children&&o.children.length&&(this.children=ft(o.children))}}function De(){function t(o){const s={"f-icon":!0};if(o.icon){const a=o.icon.trim().split(" ");a&&a.length&&a.reduce((r,b)=>(r[b]=!0,r),s)}return s}function n(o){return!!(o.icon&&o.icon.trim())}return{iconClass:t,shouldShowIcon:n}}function mt(t){function n(c){const l={"dropdown-menu":!0};if(c.class){const h=c.menuClass.split(" ");h&&h.length&&h.reduce((m,u)=>(m[u]=!0,m),l)}return l}function o(c){const l={disabled:!c.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},h=c.dropdownClass.split(" ");return h&&h.length&&h.reduce((m,u)=>(m[u]=!0,m),l),l}function s(c){const l={disabled:!c.enable,"dropdown-item":!0,"f-rt-btn":!0},h=c.class.split(" ");return h&&h.length&&h.reduce((m,u)=>(m[u]=!0,m),l),l}let a;const r=new Map;function b(c,l,h){var u;((u=c.target)==null?void 0:u.id)===l.id&&c.stopPropagation();const m=h?h.id:"__top_item__";if(l.children&&l.children.length&&(l.expanded=!l.expanded,l.expanded?r.set(m,l):r.delete(m)),r.has(m)&&r.get(m)!==l){const f=r.get(m);f&&(f.expanded=!1)}}function T(c,l){document.body.click(),l.enable&&l.onClick(c,l.id)}function w(c){return c.children.map(l=>l.children&&l.children.length?e.createVNode("li",{class:o(l),id:l.id,onClick:h=>l.enable&&b(h,l,c)},[e.createVNode("span",{id:l.id,class:s(l),onMouseover:h=>l.enable&&b(h,l,c)},[l.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),a(l,l)]):e.createVNode("li",{class:s(l),id:l.id,onClick:h=>T(h,l),onMouseover:h=>l.enable&&b(h,l,c)},[t.shouldShowIcon(l)&&e.createVNode("i",{class:t.iconClass(l)},null),l.text]))}function y(c,l,h){const m={display:c.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},u=document.getElementsByTagName("body")[0].getClientRects()[0].width,f=l,p=f==null?void 0:f.getClientRects();if(f&&p&&p.length){const{top:x,width:j,left:E,right:O,height:B}=p[0],v=Math.ceil(B+x);m.top=`${v}px`,m.left=`${E}px`;const S=c.id+"_menu",A=l?l.querySelector("#"+S):null;if(A){m.display==="block"&&(A.style.display="block");const V=A.getBoundingClientRect();if(h){m.top=`${x-6}px`;const i=Math.ceil(j+E);m.left=`${i}px`}u-E-j<V.width&&(m.left=`${(h?E:O)-V.width}px`)}}return m}a=function(c,l){var f,p;const h=e.getCurrentInstance(),m=l?l.id:c.id,u=(p=(f=h==null?void 0:h.exposed)==null?void 0:f.elementRef.value)==null?void 0:p.querySelector("#"+m);return e.createVNode("ul",{class:n(c),style:y(c,u,l),id:c.id+"_menu"},[w(c)])};function C(){r.forEach(c=>{c.expanded=!1}),r.clear()}return{renderDropdownMenu:a,clearAllDropDownMenu:C}}function bt(t,n){const o=e.ref(t.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:a}=mt(n);function r(C){const c={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left"},l=C.dropdownClass.split(" ");return l&&l.length&&l.reduce((h,m)=>(h[m]=!0,h),c),c}function b(C){const c={btn:!0,disabled:!C.enable,"f-rt-btn":!0,"btn-icontext":!!(C.icon&&C.icon.trim())};if(C.class){const l=C.class.split(" ");l&&l.length&&l.reduce((h,m)=>(h[m]=!0,h),c)}return c}function T(C,c){C.stopPropagation();const l=c.expanded;document.body.click(),c.expanded=!l}function w(C){return e.createVNode("div",{id:C.id,class:r(C)},[e.createVNode("div",{class:b(C),style:"display: flex;padding-right: 0.1rem;",onClick:c=>C.enable&&T(c,C)},[n.shouldShowIcon(C)&&e.createVNode("i",{class:n.iconClass(C)},null),e.createVNode("span",null,[C.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),s(C)])}function y(){a()}return{renderToolbarDropdown:w,clearAllDropDown:y}}const{buildResponseToolbarItems:Oe}=me(),Ee=e.defineComponent({name:"FResponseToolbar",props:fe,emits:[],setup(t,n){const o=e.ref(Oe(t.items)),s=e.ref(),a=e.ref(),r=e.ref(),b=e.ref(t.alignment),T={id:"__more_buttons__",text:"更多"},w=e.ref(new ne(T)),y=De(),C=e.computed(()=>w.value.children.length>0),c=e.computed(()=>{const v={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};if(t.customClass){const S=t.customClass.split(" ");S&&S.length&&S.reduce((A,V)=>(A[V]=!0,A),v)}return v}),l=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":b.value==="right","justify-content-start":b.value==="left"})),{renderToolbarDropdown:h,clearAllDropDown:m}=bt(t,y);function u(){o.value.filter(v=>v.children&&v.children.length>0).forEach(v=>{v.expanded=!1}),w.value.expanded=!1,m()}function f(v){const S={btn:!0,"f-rt-btn":!0,"f-btn-ml":b.value==="right","f-btn-mr":b.value==="left","btn-icontext":!!(v.icon&&v.icon.trim())};if(v.class){const A=v.class.split(" ");A&&A.length&&A.reduce((V,i)=>(V[i]=!0,V),S)}return S}function p(v,S){document.body.click(),S.onClick(v,S.id)}function x(v){return e.createVNode("button",{type:"button",class:f(v),id:v.id,disabled:!v.enable,onClick:S=>p(S,v)},[y.shouldShowIcon(v)&&e.createVNode("i",{class:y.iconClass(v)},null),v.text])}const j=new Map,E=[];function O(v){const S=r.value;let A=v;const V=Array.from(S.children),i=V[V.length-1].id==="__more_buttons__"?V[V.length-1]:null;if(i){const M=i.computedStyleMap().get("margin-left"),R=i.computedStyleMap().get("margin-right"),q=(M?M.value:0)+i.getBoundingClientRect().width+(R?R.value:0);A-=q}const g=V.filter(M=>M.id!=="__more_buttons__");for(const M of g){const R=M.computedStyleMap().get("margin-left"),q=M.computedStyleMap().get("margin-right"),Q=(R?R.value:0)+M.getBoundingClientRect().width+(q?q.value:0);A<Q?(j.set(M.id,!0),E.push({id:M.id,width:Q})):A-=Q}if(E.length)for(let M=E.length-1;M>=0;M--){const R=E[M].width;if(A>=R)A-=R,j.delete(E[M].id),E.pop();else break}const d=Object.assign({},w.value);d.children=[];const N=new ne(d),k=o.value.reduce((M,R)=>(j.has(R.id)&&N.children.push(R),R.visible=!j.has(R.id),M.push(R),M),[]);w.value=N,o.value=k}const B=new ResizeObserver(v=>{if(v.length){const A=v[0].contentRect.width,i=r.value.getBoundingClientRect().width;(A<i||E.length)&&(O(A),u())}});return e.onMounted(()=>{const v=a.value;B.observe(v),document.body.addEventListener("click",u),document.body.addEventListener("wheel",u)}),e.onUnmounted(()=>{B.disconnect(),document.body.removeEventListener("click",u),document.body.removeEventListener("wheel",u)}),e.watch(()=>t.items,()=>{o.value=Oe(t.items)}),n.expose({elementRef:s}),()=>e.createVNode("div",{class:c.value,ref:s},[e.createVNode("div",{ref:a,class:l.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter(v=>v.visible).map(v=>v.children&&v.children.length>0?h(v):x(v)),C.value&&h(w.value)])])])}}),ae=e.defineComponent({name:"FTabs",props:se,emits:["tabChange","tabRemove"],setup(t,n){const o=e.ref(t.tabType),s=e.shallowRef(),a=e.ref(t.customClass),r=e.shallowRef(),b=e.shallowRef(),T=Xe(t,n,r),{activeId:w,changeTitleStyle:y,tabPages:C,addTab:c,updateTab:l,selectTabByTabId:h,toolbarItems:m}=T,u=$e(t,b,T),f=je(t,r,u,T),{previousButtonClass:p,nextButtonClass:x,nextButtonGroupClass:j,scrollTab:E,updateNavigationLayout:O}=f,B=Ve(t,T),{hideDropDown:v}=B,S=Ke(t,r,f,u,T),A=S,V=Ne(t,r,f,u,T),i=new Map([["default",S],["one-page",A],["pills",V]]);e.computed(()=>{const I=C.value.find(H=>H.props.id===w.value);return I==null?void 0:I.slots});const g=e.computed(()=>{const I=C.value.find(L=>L.props.id===w.value);return(I==null?void 0:I.props.toolbarPosition)==="inHead"}),d=e.computed(()=>t.fill||t.tabType==="fill");e.provide("tabs",{activeId:w,addTab:c,updateTab:l,tabPages:C,tabType:o,shouldFillParentContaner:d});const N=e.computed(()=>t.tabType==="pills"),k=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":g.value,"farris-tabs-inContent":!g.value,"farris-tabs-nav-fill":d.value,"farris-tabs-nav-pills":N.value})),M=e.computed(()=>({width:g.value&&t.titleWidth?`${t.titleWidth}%`:""})),R=e.computed(()=>{const I={"farris-tabs":!0,"f-utils-fill-flex-column":d.value,"flex-column":t.position==="top","flex-column-reverse":t.position==="bottom","flex-row":t.position==="left","flex-row-reverse":t.position==="right","one-page":t.tabType==="one-page"};return a.value&&a.value.split(" ").reduce((H,L)=>(H[L]=!0,H),I),I});e.onMounted(()=>{C.value.length&&(w.value=t.activeId||C.value[0].props.id,h(w.value)),e.nextTick(()=>{O()}),y(r),window.addEventListener("click",I=>{var H;v.value||(H=s.value)!=null&&H.contains(I.target)||(v.value=!0)}),window.addEventListener("resize",()=>{O()})});function q(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:p.value,onClick:()=>{E(0,-1)}},null)}function Q(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:x.value,onClick:()=>{E(0,1)}},null)}const{renderMorePagesButtton:G}=Se(t,B,f,T),J=I=>{n.emit("Click",I)};function K(){return m.value.length?e.createVNode(Ee,{items:m.value,onClick:J},null):null}const F=i.get(t.tabType)||i.get("default");function $(){var I,H,L,_;return e.createVNode("div",{class:k.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(H=(I=n.slots).headerPrefix)==null?void 0:H.call(I)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:M.value},[q(),F&&F(),e.createVNode("div",{class:j.value},[Q(),G()])]),K(),e.createVNode("div",{class:"farris-tabs-header-post"},[(_=(L=n.slots).headerSuffix)==null?void 0:_.call(L)])])}const D=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":d.value}));function P(){var I,H;return e.createVNode("div",{class:D.value,ref:b},[(H=(I=n.slots).default)==null?void 0:H.call(I)])}return()=>e.createVNode("div",{class:R.value,ref:s},[$(),P()])}}),ht=new Map([["appearance",oe],["toolbar",yt]]);function yt(t,n,o){return n&&n.contents&&n.contents.length&&n.contents.forEach(s=>{s.title&&(s.text=s.title)}),{toolbar:n}}const gt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-page.schema.json",title:"tab-page",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a tab-page Item",type:"string"},type:{description:"The type string of tab-page Item component",type:"string",default:"tab-page"},contents:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"标题"},toolbar:{description:"",type:"object"}},required:["id","type","contents"]},Ct={title:"tab-page",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"工具栏按钮的标识",title:"标识",type:"string",readonly:!0},title:{description:"工具栏按钮的标识",title:"标题",type:"string"}}},appearance:{description:"",title:"外观",properties:{appearance:{description:"",type:"cascade",title:"样式",properties:{class:{description:"组件的CSS样式",title:"class样式",type:"string"},style:{description:"组件的内容样式",title:"style样式",type:"modal",showClearButton:!0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}},size:{description:"",type:"cascade",title:"尺寸",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0}}}}},behavior:{description:"",title:"行为",properties:{visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}},removeable:{description:"是否可移除",type:"boolean",title:"是否可移除",editor:{type:"combo-list",data:[{value:!0,name:"是"},{value:!1,name:"否"}]}},headerTemplate:{description:"标签页模板",type:"modal",title:"标签页模板",editor:{type:"code-editor"},editorParams:{language:"html"}}}}}},re={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object,default:{}},toolbarPosition:{type:String,default:"inHead"}},be=te(re,gt,ht,void 0,Ct);function vt(t,n,o){return n?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function wt(t,n){return n&&n.contents&&n.contents.length&&n.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:n.contents,buttonPosition:n.position}}const Tt=new Map([["appearance",oe],["expanded","expandStatus"],["enableAccordion",vt],["toolbar",wt]]);function xt(t,n,o){return n}const Nt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},St={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},mainTitle:{title:"主标题",type:"string",description:""},subTitle:{title:"副标题",type:"string",description:""}}},appearance:{title:"样式",description:"Appearance",properties:{class:{title:"class",type:"string",description:""},style:{title:"style",type:"string",description:""}}},behavior:{title:"行为",description:"",properties:{visible:{title:"可见",type:"boolean",description:""},fill:{title:"填充",type:"boolean",description:"To fill the space of parent container in flex layout."},showHeader:{title:"显示标题区域",type:"boolean",description:""},enableMaximize:{title:"显示最大化",type:"boolean",description:"",visible:{showHeader:!0}},enableCollapse:{title:"显示收折",type:"boolean",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},visible:{showHeader:!0}},expanded:{title:"展开",type:"boolean",description:"",readonly:{enableCollapse:!1},editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:!0,name:"是"},{value:!1,name:"否"}]},visible:{showHeader:!0}},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}},accordionMode:{title:"收折模式",type:"enum",description:"",readonly:{enableAccordion:!1},visible:{showHeader:!0},editor:{type:"combo-list",data:[{value:"default",name:"默认"}]}}}},toolbar:{title:"工具栏",description:"",properties:{buttonSize:{title:"按钮尺寸",type:"enum",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"default",name:"标准"},{value:"large",name:"大尺寸"}]}},popupDirection:{title:"弹出方向",type:"enum",description:"",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"default",name:"自适应"},{value:"top",name:"向上"},{value:"bottom",name:"向下"}]}}}},extends:{title:"扩展样式",description:"",properties:{headerClass:{title:"标题区",type:"string",description:""},titleClass:{title:"主标题",type:"string",description:""},contentClass:{title:"内容区",type:"string",description:""},toolbarClass:{type:"string",title:"工具栏",description:""}}}}},Ae={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}};te(Ae,Nt,Tt,xt,St);function jt(t,n,o){let s;function a(){!t||!n.value||(o.value=!o.value,o.value?r():b())}function r(){s=t.value.nextElementSibling;const w=document&&document.querySelector("body");w&&(w.appendChild(t.value),t.value.style.zIndex=T())}function b(){s?n.value.insertBefore(t.value,s):n.value.appendChild(t.value),t.value.style.zIndex=null}function T(w=1){const y=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],C=Array.from(document.body.querySelectorAll(y.join(","))).filter(l=>l).map(l=>{const{display:h,zIndex:m}=window.getComputedStyle(l);return h==="none"?0:parseInt(m,10)}).filter(l=>l);let c=Math.max(...C);return c<1040&&(c=1040),c+w}return{onClickMaxMinIcon:a}}function Pe(t,n){const o=e.ref(t.buttons),s=e.computed(()=>t.buttonPosition==="inHead"?"right":"left"),a=e.computed(()=>"f-section-toolbar"+(t.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),r=e.computed(()=>{t.buttons&&t.buttons.length>0&&t.buttonPosition});function b(T){n.emit("Click",T)}return()=>r&&e.createVNode(Ee,{customClass:a.value,items:o.value,onClick:b,alignment:s.value},null)}function Vt(t,n,o,s,a,r){const b=e.ref(t.mainTitle),T=e.ref(t.subTitle),w=e.computed(()=>t.buttonPosition),y=Pe(t,n),{onClickMaxMinIcon:C}=jt(s,a,r),c=e.computed(()=>!!t.subTitle),l=e.computed(()=>t.enableMaximize),h=e.computed(()=>t.enableAccordion!=""),m=e.computed(()=>{const O={"f-section-header":!0};return n.slots.header&&t.headerClass.split(" ").reduce((v,S)=>(v[S]=!0,v),O),O});function u(O){O.stopPropagation(),t.enableAccordion!==""&&(o.value=!o.value)}function f(){const O=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),B=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!r.value,"f-icon-minimize":r.value}));return e.createVNode("div",{class:"f-max-accordion"},[l.value?e.createVNode("span",{class:B.value,onClick:C},null):"",h.value?e.createVNode("button",{class:O.value,onClick:u},[e.createVNode("span",null,[o.value?t.collapseLabel:t.expandLabel])]):""])}function p(){return n.slots.header?e.createVNode("div",{class:m.value},[n.slots.header()]):""}function x(){return e.createVNode("div",{class:"f-title",onClick:u},[e.createVNode("h4",{class:"f-title-text"},[b.value]),c.value&&e.createVNode("span",null,[T.value])])}function j(){const O=e.computed(()=>{const B={"f-content":!0};return t.headerContentClass&&t.headerContentClass.split(" ").reduce((S,A)=>(S[A]=!0,S),B),B});return n.slots.headerContent?e.createVNode("div",{class:O.value},[n.slots.headerContent()]):""}function E(){return e.createVNode("div",{class:m.value},[n.slots.headerTitle?n.slots.headerTitle():x(),j(),w.value==="inHead"&&y(),(l.value||h.value)&&f()])}return()=>t.showHeader&&(n.slots.header?p():E())}const Ie=e.defineComponent({name:"FSection",props:Ae,emits:[],setup(t,n){const o=e.ref();let s=e.ref();const a=e.ref(t.customClass),r=e.computed(()=>t.enableAccordion),b=e.ref(t.expandStatus),T=e.computed(()=>t.buttonPosition),w=e.ref(!1),y=Vt(t,n,b,o,s,w),C=Pe(t,n),c=e.computed(()=>{const f={"f-section":!0,"f-section-accordion":r.value==="default","f-state-collapse":(r.value==="default"||r.value==="custom")&&!b.value,"f-section-custom-accordion":r.value==="custom","f-section-fill":t.fill,"f-section-maximize":w.value};return a.value&&a.value.split(" ").reduce((p,x)=>(p[x]=!0,p),f),f}),l=e.computed(()=>{const f=t.contentClass.split(" "),p={"f-section-content":!0};return f.reduce((x,j)=>(x[j]=!0,x),p),p}),h=e.computed(()=>{const f=t.extendClass.split(" "),p={"f-section-extend":!0};return f.reduce((x,j)=>(x[j]=!0,x),p),p});function m(){return n.slots.extend&&e.createVNode("div",{class:h.value},[n.slots.extend()])}function u(){return e.createVNode("div",{class:l.value},[T.value==="inContent"&&C(),n.slots.default&&n.slots.default()])}return e.onMounted(()=>{o&&o.value&&(s.value=o.value.parentElement)}),()=>e.createVNode("div",{class:c.value,ref:o},[y(),m(),u()])}});function $t(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const ce=e.defineComponent({name:"FTabPage",props:re,emits:[],setup(t,n){const o=e.inject("tabs"),s=e.ref(t.show),a={slots:n.slots,props:t},r=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const h=o==null?void 0:o.tabPages.value.findIndex(m=>m.props.id===t.id);!h||h===-1?o==null||o.addTab(a):h>-1&&(s.value=!1,console.warn(`已经存在id为${t.id}的页签啦`))}),e.onUnmounted(()=>{});const b=e.computed(()=>(t==null?void 0:t.id)===(o==null?void 0:o.activeId.value)),T=e.computed(()=>({display:b.value?"":"none"}));e.watch(()=>t,h=>{o==null||o.updateTab({props:h,slots:n.slots})},{immediate:!0,deep:!0});function w(){var m,u;const h=(u=(m=n.slots).default)==null?void 0:u.call(m);return e.createVNode(Ie,{"main-title":t.title,class:"farris-tab-page"},$t(h)?h:{default:()=>[h]})}const y=e.computed(()=>{var m;return{"farris-tab-page":!0,"f-utils-fill-flex-column":b.value&&o&&((m=o.shouldFillParentContaner)==null?void 0:m.value)}});function C(){var m,u;const h=(u=(m=n.slots).default)==null?void 0:u.call(m);return e.createVNode("div",{class:y.value,style:T.value},[h])}const l=new Map([["default",C],["one-page",w]]).get(r.value)||C;return()=>s.value?l():null}}),Bt={type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"}};function he(){return new DOMException("The request is not allowed","NotAllowedError")}async function kt(t){if(!navigator.clipboard)throw he();return navigator.clipboard.writeText(t)}async function Mt(t){const n=document.createElement("span");n.textContent=t,n.style.whiteSpace="pre",n.style.webkitUserSelect="auto",n.style.userSelect="all",document.body.appendChild(n);const o=window.getSelection(),s=window.document.createRange();o==null||o.removeAllRanges(),s.selectNode(n),o==null||o.addRange(s);let a=!1;try{a=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(n)}if(!a)throw he()}async function Dt(t){try{await kt(t)}catch(n){try{await Mt(t)}catch(o){throw o||n||he()}}}function Ot(){async function t(n){await Dt(n)}return{onCopy:t}}function Et(t,n,o,s){const a=e.ref(14),r=e.ref(140),b=e.ref(""),T=e.ref(s.value.length),w=e.computed(()=>s.value),y=e.computed(()=>({"font-size":`${a.value}px`,height:"100%"}));function C(c){if(c.currentTarget){const l=c.currentTarget.value||"";T.value=l.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:y.value,rows:"4",maxlength:r.value,onInput:c=>C(c)},[w.value]),e.createVNode("span",{class:"textarea-wordcount",title:b.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[T.value+" / "+r.value])])}function At(t,n,o,s){const a=Et(t,n,o,s),r=new Map([["text-area",a]]);function b(T){return r.get(T)||null}return{getEditorRender:b}}function Pt(){const t=e.ref(!1),n=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const s={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return s.opacity=t.value?"0.8":"0",s.display=t.value?"":"none",s}),feedbackMessage:n,toShowFeedback:t}}function It(t,n){const o=n.getEditorRender(t.promptEditorType);return()=>o&&o()}function Rt(t){const n=e.ref(3),o=e.ref(480),s=e.computed(()=>!!t.value&&!!t.value.date),a=e.computed(()=>`发生时间 : ${t.value&&t.value.date||""}`),r=e.computed(()=>!!t.value&&!!t.value.detail),b=e.computed(()=>{const f=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":n.value,"max-height":f}}),T=e.computed(()=>t.value&&t.value.detail||""),w=e.computed(()=>!0),y=e.ref(!1),C=e.ref("展开"),c=e.ref("收起"),l=e.computed(()=>{const f={display:"block",color:"#2A87FF"};return f["text-align"]=y.value?"":"right",f});function h(f,p){y.value=!y.value,n.value=y.value?20:3}function m(f){return h()}function u(f){return h()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[s.value&&e.createVNode("div",null,[a.value]),r.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:b.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:T.value},null)]),w.value&&e.createVNode("span",{style:l.value},[y.value&&e.createVNode("span",{onClick:m,style:"cursor: pointer;"},[c.value]),!y.value&&e.createVNode("span",{onClick:u,style:"cursor: pointer;"},[C.value])])])}function Ft(t){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value},null)}function Ht(t,n,o,s){const a=e.ref(t.exceptionInfo),r=e.computed(()=>{const l={"f-icon":!0},h=`f-icon-${n.value}`;return l[h]=!0,l}),b=e.computed(()=>o.value||a.value&&a.value.message),T=e.computed(()=>s.value),w=e.computed(()=>!!s.value),y=e.computed(()=>!!a.value);function C(){return y.value?Rt(a):w.value?Ft(T):()=>null}const c=C();return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:r.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:b.value},null),c()])])}function Lt(t,n,o){const{onCopy:s}=n,{toShowFeedback:a}=o,r=e.ref("复制成功"),b=e.ref("复制详细信息"),T=e.ref(t.exceptionInfo||{date:"",message:"",detail:""}),w=e.computed(()=>T.value&&T.value.detail||"");function y(C){s(w.value).catch(c=>{r.value="复制失败"}).finally(()=>{a.value=!0,setTimeout(()=>{a.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:y,style:"cursor: pointer;"},[b.value])])}function _t(t,n,o,s){const a=e.ref(t.type),r=e.ref([]),b=e.ref(t.exceptionInfo),T=e.ref(t.okButtonText),w=e.ref(t.cancelButtonText),y=e.ref(!0),C=e.ref(!0),c=e.computed(()=>!!(r.value&&r.value.length)),l=e.computed(()=>b.value&&b.value.date&&b.value.message&&b.value.detail),h=e.computed(()=>!(r.value&&r.value.length)&&(T.value||w.value)),m=e.computed(()=>C.value&&T.value),u=e.computed(()=>y.value&&w.value),f=Lt(t,o,s);function p(j){a.value==="question"&&n.emit("reject"),n.emit("close")}function x(j){a.value==="question"&&n.emit("accept"),n.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[l.value&&f(),h.value&&u.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:p},[w.value]),h.value&&m.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:x},[T.value]),c.value&&r.value.length&&r.value.map(j=>e.createVNode("button",{type:"button",onClick:j.handle,class:j.class},[j.iconClass&&e.createVNode("span",{class:j.iconClass},null),j.text]))])}const qt=e.defineComponent({name:"FMessageBox",props:Bt,emits:["accept","reject","close"],setup(t,n){const o=e.ref(t.type),s=e.ref(t.title),a=e.ref(t.detail),r=e.computed(()=>{const f={"modal-tips":!0,"d-flex":!0,"flex-row":!0},p=`messager-type-${o.value}`;return f[p]=!0,f}),b=e.computed(()=>{const f={};return o.value==="prompt"?f.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(f.padding="0.5rem 1.5rem 1rem 1.5rem"),f}),T=Ot(),w=At(t,o,s,a),y=Pt(),{feedbackStyle:C,feedbackMessage:c}=y;function l(){return e.createVNode("div",{style:C.value},[c.value])}function h(){switch(o.value){case"prompt":return It(t,w);default:return Ht(t,o,s,a)}}const m=h(),u=_t(t,n,T,y);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:b.value},[m()]),u(),l()])}}),Wt={class:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1}},Re=e.defineComponent({name:"FModal",props:Wt,emits:["update:modelValue","accept","cancel","closed"],setup(t,n){const o=e.ref(t.width),s=e.ref(t.height),a=e.ref(t.modelValue),r=e.ref(""),b=e.ref(t.class),T=e.ref(t.fitContent),w=e.ref(t.showHeader),y=e.ref(""),C=e.ref(!0),c=e.ref(!1),l=e.ref(!1),h=e.ref(""),m=e.ref(""),u=e.ref(""),f=e.ref(t.showButtons),p=e.ref(t.title);function x(F,$){a.value=!1,n.emit("update:modelValue",!1),$!=null&&n.emit($?"accept":"cancel"),n.emit("closed",F)}const j=[{name:"cancel",text:"取消",class:"btn btn-light",handle:F=>{x(F,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:F=>{x(F,!0)}}],E=e.ref(t.buttons&&t.buttons.length?t.buttons:j),O=e.computed(()=>!!y.value),B=e.computed(()=>!!f.value&&!!E.value);e.ref(),e.ref(),e.watch(()=>t.modelValue,()=>{a.value=t.modelValue});const v=e.ref(!1),S=e.computed(()=>a.value),A=e.computed(()=>{const F={modal:!0,"farris-modal":!0,"fe-cmp-page-modal":t.showFloatingClose};return F["f-modal-fitContent"]=T.value,F}),V=e.computed(()=>({display:S.value?"block":"none !important"})),i=e.computed(()=>{const F={"modal-dialog":!0};return b.value.split(" ").reduce((D,P)=>(D[P]=!0,D),F),F}),g=e.computed(()=>({position:"absolute",top:"50%",left:"50%",width:`${o.value}px`,height:T.value?"auto":`${s.value}px`,"margin-left":`${0-o.value/2}px`,"margin-top":T.value?"auto":`${0-s.value/2}px`})),d=e.computed(()=>({"modal-content":!0,"modal-content-has-header":w.value})),N=e.computed(()=>({display:w.value?"":"none"})),k=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:v.value})),M=e.computed(()=>({height:"10px","z-index":1,display:w.value?"none":""})),R=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe"}));function q(){return{}}const Q=e.computed(()=>{const F={textAlgin:u.value},$=q();return Object.assign(F,$)});function G(F){}async function J(F,$){if(F.handle){const D=await F.handle($,F);D&&x($,D)}}function K(){return e.createVNode("div",{class:"action-wrapper",onClick:F=>x(F,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>{var F,$;return[e.createVNode("div",{class:A.value,style:V.value},[e.createVNode("div",{id:r.value,class:i.value,style:g.value},[t.showFloatingClose&&K(),e.createVNode("div",{class:d.value},[e.createVNode("div",{ref:"modalHeaderRef",class:"modal-header",style:N.value},[e.createVNode("div",{class:"modal-title"},[O.value&&e.createVNode("span",{class:y.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[p.value])]),e.createVNode("div",{class:"actions"},[e.createVNode("ul",null,[l.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),c.value&&e.createVNode("li",{onClick:G,class:"f-btn-icon f-bare"},[e.createVNode("span",{class:k.value},null)]),C.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:D=>x(D,!1)},[e.createVNode("span",{class:"f-icon modal_close"},null)])])])]),e.createVNode("div",{ref:"dragableElementRef",class:"f-utils-absolute-all",style:M.value},null),e.createVNode("div",{class:R.value},[($=(F=n.slots).default)==null?void 0:$.call(F),h.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:m.value},null)]),B.value&&e.createVNode("div",{class:"modal-footer",style:Q.value},[E.value&&E.value.map(D=>e.createVNode("button",{name:D.name,type:"button",class:D.class+(D.iconClass?" btn-icontext":""),onClick:P=>{J(D,P)}},[!!D.iconClass&&e.createVNode("i",{class:D.iconClass},null),D.text]))])])])])]}})}}),ye={install(t){}};function Fe(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function zt(t){const n=document.createElement("div");n.style.display="contents";const o=e.createApp({setup(){e.onUnmounted(()=>{document.body.removeChild(n)});const s=e.ref(),a=e.ref(t.class||""),r=e.ref(!!t.showButtons),b=e.ref(!!t.showHeader),T=e.ref(!!t.showFloatingClose),w=e.ref(!0),y=e.ref(t.title||""),C=t.acceptCallback||(()=>{}),c=t.rejectCallback||(()=>{}),l=t.closedCallback||(u=>{}),h=Fe(t),m=u=>{w.value=!1,o.unmount(),l(u)};return e.onMounted(()=>{}),()=>e.createVNode(Re,{ref:s,class:a.value,modelValue:w.value,"onUpdate:modelValue":u=>w.value=u,title:y.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":b.value,"show-buttons":r.value,showFloatingClose:T.value,onAccept:C,onCancel:c,fitContent:t.fitContent,onClosed:m},{default:()=>[h&&h(o)]})}});return document.body.appendChild(n),ye&&ye.install&&o.use(ye),o.mount(n),o}class Ut{static show(n){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return zt(o)}renderModal(n,o,s){const a=e.h(Re,o,s);return e.render(a,n),a}renderNull(n){setTimeout(()=>{e.render(null,n)},500)}open(n){const o=document.createElement("div");o.style.display="contents";const s=Object.assign({title:"",showButtons:!0,showHeader:!0},n),a=e.ref(s.class||""),r=e.ref(!!s.showButtons),b=e.ref(!!s.showHeader),T=e.ref(!!s.showFloatingClose),w=e.ref(!0),y=e.ref(s.title||""),C=s.acceptCallback||(()=>{}),c=s.rejectCallback||(()=>{}),l=s.closedCallback||(f=>{});Fe(s);const h=f=>{w.value=!1,l(f)};function m(f){w.value=f}const u={class:a.value,modelValue:w.value,title:y.value,width:s.width,height:s.height,buttons:s.buttons,showHeader:b.value,showButtons:r.value,showFloatingClose:T.value,onAccept:C,onCancel:c,fitContent:s.fitContent,onClosed:h};this.renderModal(o,{...u,"onUpdate:modelValue":m})}}class Gt{static show(n){const o=e.reactive({...n}),s=!1,a=o.type==="error"||o.type==="prompt",r=o.type==="error"?"错误提示":o.type==="prompt"&&o.title||"",b=o.acceptCallback||(()=>{}),T=o.rejectCallback||(()=>{});let w;const y=()=>{w&&w.unmount()};w=Ut.show({class:"modal-message modal-message-type-info",title:r,showButtons:s,showHeader:a,render:()=>e.createVNode(qt,e.mergeProps(o,{onAccept:b,onReject:T,onClose:y}),null)})}static info(n,o){const s=e.reactive({type:"info",title:n,detail:o,okButtonText:"知道了",cancelButtonText:""});this.show(s)}static warning(n,o){const s=e.reactive({type:"warning",title:n,detail:o,okButtonText:"知道了",cancelButtonText:""});this.show(s)}static success(n,o){const s=e.reactive({type:"success",title:n,detail:o,okButtonText:"关闭",cancelButtonText:""});this.show(s)}static error(n,o,s){const a=e.reactive({type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:s,message:n,detail:o}});this.show(a)}static prompt(n,o){const s=e.reactive({type:"prompt",title:n,detail:o,okButtonText:"确定",cancelButtonText:"取消"});this.show(s)}static question(n,o,s,a){const r=e.reactive({type:"question",title:n,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:s,rejectCallback:a});this.show(r)}}function Jt(t,n,o,s,a){const{activeId:r,removeTab:b,selectTab:T,removeDesignTab:w,selectDesignTab:y}=a,C=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":t.autoTitleWidth})),c=e.computed(()=>{const S={"farris-component":!0,"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===r.value,"f-state-disable":n.disabled};return S[`${n.id}-design-item`]=!0,S}),l=e.computed(()=>({width:`${n.tabWidth}px`})),h=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===r.value,disabled:n.disabled}));function m(S){return e.createVNode("span",{class:C.value,title:S.title},[S.title])}function u(S){return S.slots.title?S.slots.title:m}const f=u(o),p=e.ref(n.removeable);function x(){return e.createVNode("span",{class:"st-drop-close",onClick:S=>b(S,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function j(S){T(n.id),t.tabType==="one-page"&&s.scrollToByPaggId(n.id)}function E(S){y(S,n.id)}function O(S){Gt.question(`确定删除标签页【${o.props.title}】?`,"",()=>w(S,n.id),()=>{})}function B(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:S=>O(S)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[B()])])}return e.createVNode("li",{onClick:S=>E(S),class:c.value,style:l.value,id:`${n.id}-design-item`},[v(),e.createVNode("a",{class:h.value,onClick:j},[f(n),p.value&&x()])])}function Zt(t,n,o,s,a,r,b){const{shouldShowNavigationButtons:T}=o,{tabPages:w}=a,y=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":T.value})),C=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),c=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":t.fill||t.tabType==="fill","nav-pills":t.tabType==="pills","flex-row":t.position==="top"||t.position==="bottom","flex-column":t.position==="left"||t.position==="right"})),l=e.computed(()=>({overflow:"auto"}));function h(u){const{componentType:f}=u;let p=Y(f,u);b&&b.onResolveNewComponentSchema&&(p=b.onResolveNewComponentSchema(u,p));const x=f.toLowerCase().replace("-","_");return p&&!p.id&&p.type===f&&(p.id=`${x}_${Math.random().toString().slice(2,6)}`),p}const m=function(u){var j;const f={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},p=h(f);(j=r.value.schema.contents)==null||j.push(p);const{selectTabByTabId:x}=a;x(p.id)};return()=>e.createVNode("div",{class:y.value,style:C.value},[e.createVNode("ul",{class:c.value,style:l.value,ref:n},[w.value.map(u=>Jt(t,u.props,u,s,a)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:u=>m()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function ge(t,n,o){var O;function s(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}s();const a=o&&o.getStyles&&o.getStyles()||"",r=o&&o.getDesignerClass&&o.getDesignerClass()||"",b=e.ref();function T(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function w(){return!1}function y(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function C(){return(n==null?void 0:n.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function c(B){if(!B||!B.value)return null;if(B.value.schema&&B.value.schema.type==="component")return B.value;const v=e.ref(B==null?void 0:B.value.parent),S=c(v);return S||null}function l(B=n){const{componentInstance:v,designerItemElementRef:S}=B;return!v||!v.value?null:v.value.canMove?S:l(B.parent)}function h(B){return!!o&&o.canAccepts(B)}function m(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function u(){}function f(B,v){v&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(v)}function p(B){const{componentType:v}=B;let S=Y(v,B);o&&o.onResolveNewComponentSchema&&(S=o.onResolveNewComponentSchema(B,S));const A=v.toLowerCase().replace("-","_");return S&&!S.id&&S.type===v&&(S.id=`${A}_${Math.random().toString().slice(2,6)}`),S}function x(B,v){const S=String(B.getAttribute("data-controltype")),A=B.getAttribute("data-feature"),V=A?JSON.parse(A):{};V.parentComponentInstance=b.value;let i=Y(S,V);o&&o.onAcceptNewChildElement&&(i=o.onAcceptNewChildElement(B,v,i));const g=S.toLowerCase().replace("-","_");return i&&!i.id&&i.type===S&&(i.id=`${g}_${Math.random().toString().slice(2,6)}`),i}function j(B){}function E(){return o&&o.getPropsConfig?o.getPropsConfig():[]}return b.value={canMove:T(),canSelectParent:w(),canDelete:y(),canNested:!C(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(O=n==null?void 0:n.parent)==null?void 0:O.componentInstance,schema:n==null?void 0:n.schema,styles:a,designerClass:r,canAccepts:h,getBelongedComponentInstance:c,getDraggableDesignItemElement:l,getDraggingDisplayText:m,getPropConfig:E,getDragScopeElement:u,onAcceptMovedChildElement:f,onAcceptNewChildElement:x,onChildElementMovedOut:j,addNewChildComponentSchema:p,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},b}const Qt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},Ce=new Map;function Xt(){function t(m,u,f,p){var x;if(typeof f=="number")return((x=p[m])==null?void 0:x.length)===f;if(typeof f=="object"){const j=Object.keys(f)[0],E=f[j];if(j==="not")return Number(p[m].length)!==Number(E);if(j==="moreThan")return Number(p[m].length)>=Number(E);if(j==="lessThan")return Number(p[m].length)<=Number(E)}return!1}function n(m,u,f,p){return typeof f=="boolean"?p.childrenClassList.includes(u)===!!f:!1}function o(m,u,f,p){return typeof f=="boolean"?p.parentClassList.includes(u)===!!f:!1}function s(m,u,f,p){return typeof f=="boolean"?p.parentClassList.includes(u)===!!f:!1}const a=new Map([["length",t],["hasChildren",n],["hasSibling",s],["hasParent",o]]);function r(m,u){const f=m;return typeof u=="number"?[{target:f,operator:"length",param:null,value:Number(u)}]:typeof u=="object"?Object.keys(u).map(p=>{if(p==="length")return{target:f,operator:"length",param:null,value:u[p]};const x=p,j=u[p];return{target:f,operator:m==="children"?"hasChildren":m==="parent"?"hasParent":"hasSibling",param:x,value:j}}):[]}function b(m,u){if(a.has(m.operator)){const f=a.get(m.operator);return f&&f(m.target,m.param,m.value,u)||!1}return!1}function T(m,u){return Object.keys(m).reduce((j,E)=>{const O=r(E,m[E]);return j.push(...O),j},[]).reduce((j,E)=>j&&b(E,u),!0)}function w(m,u){const f=Object.keys(m),p=f.includes("allOf"),x=f.includes("anyOf"),j=p||x,B=(j?m[j?p?"allOf":"anyOf":"allOf"]:[m]).map(S=>T(S,u));return p?!B.includes(!1):B.includes(!0)}function y(m,u){const f=m.const;return f?typeof f=="boolean"?f:typeof f=="object"?w(f,u):!1:!1}function C(m){return u=>{const f={canAccept:!0,fixed:!1,hidePadding:!1};return m&&m.properties&&Object.keys(m.properties).reduce((p,x)=>{const j=m.properties[x];return p[x]=y(j,u),p},f),f}}function c(m,u,f){if(u.type==="object"&&u.properties){const{rules:p,contents:x}=u.properties;f.set(m,C(p)),x&&Object.keys(x.properties).forEach(j=>c(j,x.properties[j],f))}}function l(){const{properties:m}=Qt;Object.keys(m).forEach(u=>{c(u,m[u],Ce)})}function h(m,u){const f={canAccept:!0,fixed:!1,hidePadding:!0};return Ce.has(m)?Ce.get(m)(u):f}return l(),{getRuleValue:h}}function Yt(t,n){const o=Xt();let s=!1,a,r=!1;function b(c){return!1}function T(){return!r}function w(){return!r}function y(){return s}function C(){const c=t,l=c.appearance&&c.appearance.class||"",h=l?l.split(" "):[],m=n==null?void 0:n.schema,u=m&&m.appearance&&m.appearance.class||"",f=u?u.split(" "):[],p=c.contents||[],x=p.length?p[0]:null,j=x&&x.appearance&&x.appearance.class||"",E=j?j.split(" "):[],O=p.length?p.reduce((i,g)=>{const d=g&&g.appearance?g.appearance.class:"",N=d?d.split(" "):[];return i.push(...N),i},[]):[],B=(n==null?void 0:n.parent)&&n.parent.schema,v=B&&B.appearance&&B.appearance.class||"";v&&v.split(" "),a={componentClass:l,componentClassList:h,childContents:p,firstChildContent:x,firstChildClass:j,firstChildClassList:E,parent,parentClass:u,parentClassList:f,children:p,childrenClassList:O};const{canAccept:S,fixed:A,hidePadding:V}=o.getRuleValue(h[0],a);return s=V,r=A,!0}return{canAccepts:b,checkCanDeleteComponent:T,checkCanMoveComponent:w,hideNestedPaddingInDesginerView:y,resolveComponentContext:C}}function Kt(t,n,o,s){const a=e.ref([]),r=e.ref(t.activeId||""),b=e.ref(!0),T=e.ref(),w=e.ref([]);function y(d){const N=d.value.findIndex(k=>k.props.show!==!1&&!r.value&&!k.props.disabled);!r.value&&N!==-1&&(r.value=d.value[N].props.id)}function C(d,N){d.classList.contains(N)||d.classList.add(N)}function c(d,N){d.classList.remove(N)}function l(d){const{parentElement:N}=d;N&&(d.scrollWidth>N.offsetWidth?C(d,"farris-title-text-custom"):c(d,"farris-title-text-custom"))}function h(d){var k;if(t.autoTitleWidth)return;const N=(k=d.value)==null?void 0:k.querySelectorAll(".st-tab-text");N&&N.forEach(M=>l(M))}const m=d=>{d.preventDefault(),d.stopPropagation()};function u(d){a.value=a.value.filter(N=>N.props.id!==d),r.value===d&&(r.value="",y(a))}function f(d,N,k=!1){const M=a.value.findIndex(R=>R.props.id===N);u(N),m(d),e.nextTick(()=>{h(o),k&&(b.value=!0),n.emit("tabRemove",{removeIndex:M,removeId:N,activeId:r.value})})}function p(){const d=a.value.find(M=>M.props.id===r.value);w.value=[],d&&d.props.toolbar&&d.props.toolbar.buttons&&d.props.toolbar.buttons.length&&(w.value=[...d.props.toolbar.buttons]);const N=s.schema.contents,k=N==null?void 0:N.find(M=>M.id===r.value);T.value=k==null?void 0:k.toolbar}function x(d){const N=r.value;r.value=d,p(),n.emit("tabChange",{prevId:N,nextId:r.value})}function j(d){x(d)}function E(d){a.value.findIndex(k=>k.props.id===d.props.id)===-1&&a.value.push(d)}function O(d){a.value.findIndex(k=>k.props.id===d.props.id)!==-1&&(a.value.forEach(k=>{k.props.id===d.props.id&&(k=d)}),e.nextTick(()=>{h(o)}))}function B(d){d&&(d.stopPropagation(),d.preventDefault())}function v(d,N){B(d);const k=s.schema.contents,M=k==null?void 0:k.findIndex(R=>R.id===N);M===-1||M===void 0||(k==null||k.splice(M,1),u(N))}function S(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(N=>N.classList.remove("dgComponentFocused"));const d=document.getElementsByClassName("dgComponentSelected");Array.from(d).forEach(N=>N.classList.remove("dgComponentSelected"))}function A(d){d.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function V(d){var R;const{contents:N=[]}=s.schema,k=N==null?void 0:N.findIndex(q=>q.id===d),M=N[k];(R=s==null?void 0:s.setupContext)==null||R.emit("selectionChange",M.type,M)}function i(d,N){S(),B(d),A(d),V(N)}function g(d,N){S(),B(d),A(d)}return{activeId:r,addTab:E,changeTitleStyle:h,removeTab:f,selectTab:j,selectTabByTabId:x,tabPages:a,updateTab:O,toolbarItems:w,removeDesignTab:v,selectDesignTab:i,selectDesignTabToolbar:g,toolbarSchema:T}}function en(t,n){const o=e.inject("design-item-context"),s=e.inject("toolbar-item-handler",()=>{});function a(){s&&s()}function r(i){const g={"dropdown-menu":!0};if(i.class){const d=i.menuClass.split(" ");d&&d.length&&d.reduce((N,k)=>(N[k]=!0,N),g)}return g}function b(i){const g={disabled:!i.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},d=i.dropdownClass.split(" ");return d&&d.length&&d.reduce((N,k)=>(N[k]=!0,N),g),g}function T(i){const g={disabled:!i.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},d=i.class.split(" ");return d&&d.length&&d.reduce((N,k)=>(N[k]=!0,N),g),g}let w;const y=new Map;function C(i,g,d){var k;((k=i.target)==null?void 0:k.id)===g.id&&i.stopPropagation();const N=d?d.id:"__top_item__";if(g.children&&g.children.length&&(g.expanded=!g.expanded,g.expanded?y.set(N,g):y.delete(N)),y.has(N)&&y.get(N)!==g){const M=y.get(N);M&&(M.expanded=!1)}}function c(i){i&&(i.stopPropagation(),i.preventDefault())}function l(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused"));const i=document.getElementsByClassName("dgComponentSelected");Array.from(i).forEach(g=>g.classList.remove("dgComponentSelected"))}function h(i){i.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function m(i){const{buttons:g=[]}=o.schema;let d=[];g.forEach(M=>{d=d.concat(M.children||[])});const N=d.findIndex(M=>M.id===i),k=N===-1?null:d[N];return{index:N,item:k}}function u(i){const{buttons:g=[]}=o.schema,d=g.findIndex(k=>k.id===i),N=d===-1?null:g[d];return{index:d,item:N}}function f(i){var N;o.schema;const{index:g,item:d}=m(i);(N=o==null?void 0:o.setupContext)==null||N.emit("selectionChange",d==null?void 0:d.type,d)}const p=function(i){const{componentType:g}=i,d=Y(g,i),N=g.toLowerCase().replace("-","_");return d&&!d.id&&d.type===g&&(d.id=`${N}_${Math.random().toString().slice(2,6)}`),d},x=function(){const i={componentType:"response-toolbar-item",parentComponentInstance:n.value,targetPosition:-1};return p(i)};function j(i,g){c(i),l(),h(i),f(g.id)}function E(i,g,d){c(i);const N=g.id,k=d&&d.id,{buttons:M=[]}=o.schema;if(!k)return;const{index:R}=u(k);if(R===-1)return;const{index:q}=m(N);q!==-1&&(M[R].children.splice(q,1),a())}function O(i,g,d){c(i);const N=d&&d.id,{buttons:k=[]}=o.schema;if(!N)return;const{index:M}=u(N);if(M===-1)return;const R=x(),q=Object.assign({},R,{text:g.text});k[M].children.push(q),a()}function B(i,g,d){c(i);const N=d&&d.id,{buttons:k=[]}=o.schema;if(!N)return;const{index:M}=u(N);if(M===-1)return;const R=x(),q=Object.assign({},R,{text:"按钮"});k[M].children.push(q),a()}function v(i,g){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:d=>E(d,i,g)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:d=>O(d,i,g)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增同级",ref:"appendSame",style:"width:85px!important;padding:0 5px;position:static;",onClick:d=>B(d,i,g)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增同级")])])])])}function S(i){return i.children.map(g=>g.children&&g.children.length?e.createVNode("li",{class:b(g),id:g.id,onClick:d=>g.enable&&C(d,g,i)},[e.createVNode("span",{id:g.id,class:T(g),onMouseover:d=>g.enable&&C(d,g,i)},[g.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),w(g,g)]):e.createVNode("li",{class:T(g),id:g.id,onClick:d=>j(d,g)},[v(g,i),t.shouldShowIcon(g)&&e.createVNode("i",{class:t.iconClass(g)},null),g.text]))}function A(i,g,d){const N={display:i.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},k=document.getElementsByTagName("body")[0].getClientRects()[0].width,M=g,R=M==null?void 0:M.getClientRects();if(M&&R&&R.length){const{top:q,width:Q,left:G,right:J,height:K}=R[0],F=Math.ceil(K+q);N.top=`${F}px`,N.left=`${G}px`;const $=i.id+"_menu",D=g?g.querySelector("#"+$):null;if(D){N.display==="block"&&(D.style.display="block");const P=D.getBoundingClientRect();if(d){N.top=`${q-6}px`;const I=Math.ceil(Q+G);N.left=`${I}px`}k-G-Q<P.width&&(N.left=`${(d?G:J)-P.width}px`)}}return N}w=function(i,g){var M,R;const d=e.getCurrentInstance(),N=g?g.id:i.id,k=(R=(M=d==null?void 0:d.exposed)==null?void 0:M.elementRef.value)==null?void 0:R.querySelector("#"+N);return e.createVNode("ul",{class:r(i),style:A(i,k,g),id:i.id+"_menu"},[S(i)])};function V(){y.forEach(i=>{i.expanded=!1}),y.clear()}return{renderDropdownMenu:w,clearAllDropDownMenu:V}}function tn(t,n,o){const s=e.ref(t.alignment),{renderDropdownMenu:a,clearAllDropDownMenu:r}=en(n,o),b=e.inject("design-item-context"),T=e.inject("toolbar-item-handler",()=>{});function w(){T&&T()}function y(V){const i={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":s.value==="right","f-btn-mr":s.value==="left"},g=V.dropdownClass.split(" ");return g&&g.length&&g.reduce((d,N)=>(d[N]=!0,d),i),i}function C(V){const i={btn:!0,disabled:!V.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(V.icon&&V.icon.trim())};if(V.class){const g=V.class.split(" ");g&&g.length&&g.reduce((d,N)=>(d[N]=!0,d),i)}return i}function c(V){V&&(V.stopPropagation(),V.preventDefault())}function l(V,i){c(V);const g=i.expanded;document.body.click(),i.expanded=!g}const h=function(V){const{componentType:i}=V,g=Y(i,V),d=i.toLowerCase().replace("-","_");return g&&!g.id&&g.type===i&&(g.id=`${d}_${Math.random().toString().slice(2,6)}`),g},m=function(){const V={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return h(V)};function u(V){const i=b.schema.buttons||b.schema.contents,g=i==null?void 0:i.findIndex(N=>N.id===V),d=g===-1?null:i[g];return{index:g,toolbarItem:d}}function f(V,i){var R;const{index:g,toolbarItem:d}=u(i);if(g===-1)return;const N=d.text||"按钮",k=m(),M=Object.assign({},k,{text:N});(R=b.schema.buttons)==null||R.push(M),w()}function p(V,i){const{index:g,toolbarItem:d}=u(i);if(g===-1)return;const N=d.text||"按钮",k=m(),M=Object.assign({},k,{text:N}),R=b.schema.buttons[g].children||[];R.push(M),b.schema.buttons[g].children=R,w()}function x(V,i){const g=b.schema.buttons||b.schema.contents,d=g==null?void 0:g.findIndex(N=>N.id===i);d!==-1&&(g.splice(d,1),w())}function j(V){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:i=>x(i,V)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:i=>f(i,V)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:i=>p(i,V)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function E(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(i=>i.classList.remove("dgComponentFocused"));const V=document.getElementsByClassName("dgComponentSelected");Array.from(V).forEach(i=>i.classList.remove("dgComponentSelected"))}function O(V){V.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function B(V){var N;const i=b.schema.buttons||b.schema.contents,g=i==null?void 0:i.findIndex(k=>k.id===V);if(g===-1)return;const d=i[g];(N=b==null?void 0:b.setupContext)==null||N.emit("selectionChange","response-toolbar-item",d)}function v(V,i){c(V),E(),O(V),c(V),l(V,i),B(i.id)}function S(V){return e.createVNode("div",{id:V.id,class:y(V)},[e.createVNode("div",{class:C(V),style:"display: flex;padding-right: 0.1rem;",onClick:i=>V.enable&&v(i,V)},[j(V.id),n.shouldShowIcon(V)&&e.createVNode("i",{class:n.iconClass(V)},null),e.createVNode("span",null,[V.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),a(V)])}function A(){r()}return{renderToolbarDropdown:S,clearAllDropDown:A}}const{buildResponseToolbarItems:He}=me(),nn=e.defineComponent({name:"FResponseToolbarDesign",props:fe,emits:["Click"],setup(t,n){const o=e.ref(He(t.items)),s=e.ref(),a=e.ref(),r=e.ref(t.alignment),b={id:"__more_buttons__",text:"More"},T=e.ref(new ne(b)),w=De(),y=e.computed(()=>T.value.children.length>0),C=e.ref(),c=e.inject("design-item-context"),l=ge(C,c),h=e.inject("toolbar-item-handler",()=>{});e.onMounted(()=>{C.value.componentInstance=l}),n.expose(l.value);function m(){h&&h()}const u=e.computed(()=>({"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0})),f=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":r.value==="right","justify-content-start":r.value==="left"})),{renderToolbarDropdown:p,clearAllDropDown:x}=tn(t,w,l);function j(){o.value.filter($=>$.children&&$.children.length>0).forEach($=>{$.expanded=!1}),T.value.expanded=!1,x()}function E($){const D={"f-icon":!0};if($.icon){const P=$.icon.trim().split(" ");P&&P.length&&P.reduce((I,H)=>(I[H]=!0,I),D)}return D}function O($){return!!($.icon&&$.icon.trim())}function B($){const D={btn:!0,"f-rt-btn":!0,"f-btn-ml":r.value==="right","f-btn-mr":r.value==="left","btn-icontext":!!($.icon&&$.icon.trim())};if($.class){const P=$.class.split(" ");P&&P.length&&P.reduce((I,H)=>(I[H]=!0,I),D)}return D}function v($){$&&($.stopPropagation(),$.preventDefault())}function S(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(D=>D.classList.remove("dgComponentFocused"));const $=document.getElementsByClassName("dgComponentSelected");Array.from($).forEach(D=>D.classList.remove("dgComponentSelected"))}function A($){$.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function V($){var H;const D=c.schema.buttons||c.schema.contents,P=D==null?void 0:D.findIndex(L=>L.id===$);if(P===-1)return;const I=D[P];(H=c==null?void 0:c.setupContext)==null||H.emit("selectionChange","response-toolbar-item",I)}const i=function($){const{componentType:D}=$,P=Y(D,$),I=D.toLowerCase().replace("-","_");return P&&!P.id&&P.type===D&&(P.id=`${I}_${Math.random().toString().slice(2,6)}`),P},g=function(){const $={componentType:"response-toolbar-item",parentComponentInstance:l.value,targetPosition:-1};return i($)};function d($,D){S(),A($),v($),V(D)}function N($,D){const P=c.schema.buttons||c.schema.contents,I=P==null?void 0:P.findIndex(H=>H.id===D);I!==-1&&(P.splice(I,1),m())}function k($){const D=c.schema.buttons||c.schema.contents,P=D==null?void 0:D.findIndex(H=>H.id===$),I=P===-1?null:D[P];return{index:P,toolbarItem:I}}function M($,D){var Z;const{index:P,toolbarItem:I}=k(D);if(P===-1)return;const H=I.text||"按钮",L=g(),_=Object.assign({},L,{text:H});(Z=c.schema.buttons)==null||Z.push(_),m()}function R($,D){const{index:P,toolbarItem:I}=k(D);if(P===-1)return;const H=I.text||"按钮",L=g(),_=Object.assign({},L,{text:H}),Z=c.schema.buttons[P].items||[];Z.push(_),c.schema.buttons[P].children=Z,m()}function q($){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:D=>N(D,$)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:D=>M(D,$)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:D=>R(D,$)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function Q($){return e.createVNode("div",{class:"farris-component position-relative",style:"display:inline-block!important;",onClick:D=>d(D,$.id)},[q($.id),e.createVNode("button",{type:"button",class:B($),id:$.id,disabled:!$.enable},[O($)&&e.createVNode("i",{class:E($)},null),$.text])])}const G=new Map,J=[];function K($){const D=a.value;let P=$;const I=Array.from(D.children),H=I[I.length-1].id==="__more_buttons__"?I[I.length-1]:null;if(H){const U=H.computedStyleMap().get("margin-left"),X=H.computedStyleMap().get("margin-right"),ie=(U?U.value:0)+H.getBoundingClientRect().width+(X?X.value:0);P-=ie}const L=I.filter(U=>U.id!=="__more_buttons__");for(const U of L){const X=U.computedStyleMap().get("margin-left"),ie=U.computedStyleMap().get("margin-right"),ve=(X?X.value:0)+U.getBoundingClientRect().width+(ie?ie.value:0);P<ve?(G.set(U.id,!0),J.push({id:U.id,width:ve})):P-=ve}if(J.length)for(let U=J.length-1;U>=0;U--){const X=J[U].width;if(P>=X)P-=X,G.delete(J[U].id),J.pop();else break}const _=Object.assign({},T.value);_.children=[];const Z=new ne(_),le=o.value.reduce((U,X)=>(G.has(X.id)&&Z.children.push(X),X.visible=!G.has(X.id),U.push(X),U),[]);T.value=Z,o.value=le}const F=new ResizeObserver($=>{if($.length){const P=$[0].contentRect.width,H=a.value.getBoundingClientRect().width;(P<H||J.length)&&K(P)}});return e.onMounted(()=>{const $=s.value;F.observe($),document.body.addEventListener("click",j)}),e.onUnmounted(()=>{F.disconnect(),document.body.removeEventListener("click",j)}),e.watch(()=>t.items,()=>{o.value=He(t.items)}),()=>e.createVNode("div",{ref:C,class:u.value},[e.createVNode("div",{ref:s,class:f.value},[e.createVNode("div",{ref:a,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.filter($=>$.visible).map($=>$.children&&$.children.length>0?p($):Q($)),y.value&&p(T.value)])])])}}),on={id:{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}},Le=e.ref(0);function sn(t,n){const o=n.getBoundingClientRect(),s=t.getBoundingClientRect(),a=s.top>=o.top,r=s.top<=o.bottom;return a&&r}function an(t){if(!t)return;let n;if(t.className.includes("dgComponentSelected")?n=t:n=t.querySelector(".dgComponentSelected"),!n)return;const o=n.getBoundingClientRect();if(o.width===0&&o.height===0)return;const s=n.querySelector(".component-btn-group");if(s){if(!sn(n,t)){s.style.display="none";return}s.style.display="";const r=s.getBoundingClientRect(),b=s.querySelector("div");if(b){const T=b.getBoundingClientRect();b.style.top=r.top+"px",b.style.left=r.left-T.width+"px"}}}function rn(t,n,o){var E;function s(){}const a="",r=e.ref();function b(){return!0}function T(){return!1}function w(){return!0}function y(){return!0}function C(O){if(!O||!O.value)return null;const B=e.ref(O==null?void 0:O.value.parent),v=C(B);return v||null}function c(O=n){const{componentInstance:B,designerItemElementRef:v}=O;return!B||!B.value?null:B.value.canMove?v:c(O.parent)}function l(O){return!!o}function h(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function m(){}function u(O,B){}function f(O){const{componentType:B}=O;let v=Y(B,O);const S=B.toLowerCase().replace("-","_");return v&&!v.id&&v.type===B&&(v.id=`${S}_${Math.random().toString().slice(2,6)}`),v}function p(O,B){const v=String(O.getAttribute("data-controltype")),S=O.getAttribute("data-feature"),A=S?JSON.parse(S):{};A.parentComponentInstance=r.value;let V=Y(v,A);const i=v.toLowerCase().replace("-","_");return V&&!V.id&&V.type===v&&(V.id=`${i}_${Math.random().toString().slice(2,6)}`),V}function x(O){}function j(){return[]}return r.value={canMove:b(),canSelectParent:T(),canDelete:w(),canNested:!y(),contents:[],elementRef:t,parent:(E=n.parent)==null?void 0:E.componentInstance,schema:n.schema,styles:a,canAccepts:l,getBelongedComponentInstance:C,getDraggableDesignItemElement:c,getDraggingDisplayText:h,getPropConfig:j,getDragScopeElement:m,onAcceptMovedChildElement:u,onAcceptNewChildElement:p,onChildElementMovedOut:x,addNewChildComponentSchema:f,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const cn=e.defineComponent({name:"FDesignerInnerItem",props:on,emits:["selectionChange","addComponent"],setup(t,n){const o=e.ref(t.canMove),s=e.ref(t.canAdd),a=e.ref(t.canDelete),r=e.ref(!1),b=e.ref(t.contentKey),T=e.ref(t.childType),w=e.ref(t.childLabel),y=e.ref(t.modelValue),C=e.ref(""),c=e.ref(),l=e.inject("canvas-dragula"),h=e.ref(),m=e.inject("design-item-context"),u={designerItemElementRef:c,componentInstance:h,schema:y.value,parent:m,setupContext:n};e.provide("design-item-context",u);const f=e.computed(()=>({"farris-component":!0,"position-relative":o.value&&a.value,"farris-nested":r.value,"can-move":o.value,"d-none":c.value&&c.value.classList.contains("d-none")})),p=e.computed(()=>{const i={};return C.value&&C.value.split(";").reduce((g,d)=>{const[N,k]=d.split(":");return N&&(g[N]=k),g},i),i});function x(i,g){if(m&&m.schema[b.value]){const d=m.schema[b.value].findIndex(N=>N.id===g.id);m.schema[b.value].splice(d,1),m.componentInstance.value.updateDragAndDropRules()}}function j(i){if(h.value.addNewChildComponentSchema){const g={componentType:T.value,label:w.value,parentComponentInstance:h.value,targetPosition:-1},d=h.value.addNewChildComponentSchema(g);y.value[b.value].push(d),n.emit("addComponent")}}function E(){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:i=>{j()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function O(i){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:g=>{x(g,i)}},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function B(i){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[E(),O(i)])])}e.watch(()=>t.modelValue,i=>{y.value=i,u.schema=i});function v(i){const g=i.target;an(g)}function S(){var i,g;(g=(i=y.value)==null?void 0:i.contents)!=null&&g.length&&c.value&&c.value.addEventListener("scroll",v)}function A(){const i=c.value,g=e.ref(i.children[1]);return rn(g,u).value}e.onMounted(()=>{if(c.value){const i=c.value.querySelector(`[data-dragref='${y.value.id}-container']`);h.value=i&&i.componentInstance?i.componentInstance.value:A(),l&&i&&l.attachComponents(i,y.value),r.value=h.value.canNested!==void 0?h.value.canNested:r.value,o.value=h.value.canMove!==void 0?h.value.canMove:o.value,C.value=h.value.styles||"",c.value&&(c.value.componentInstance=h,c.value.designItemContext=u)}S(),Le.value++}),e.onBeforeUnmount(()=>{c.value&&c.value.removeEventListener("scroll",v)});function V(i){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(d=>d.classList.remove("dgComponentFocused")),i&&(i.preventDefault(),i.stopPropagation());const g=c.value;if(g){const d=document.getElementsByClassName("dgComponentSelected");if(!(d&&d.length===1&&d[0]===c.value)){Array.from(d).forEach(M=>M.classList.remove("dgComponentSelected")),g.classList.add("dgComponentFocused"),n.emit("selectionChange",y.value.type,y.value);const k=h.value.getDraggableDesignItemElement(u);k&&k.value&&k.value.classList.add("dgComponentSelected")}}Le.value++}return()=>e.createVNode("div",{id:`${t.id}-design-item`,ref:c,class:f.value,style:p.value,onClick:V},[B(y.value),n.slots.default&&n.slots.default()])}});function ln(t,n,o,s){const{toolbarItems:a,toolbarSchema:r}=t,b=w=>{};function T(w,y){var C;(C=s.setupContext)==null||C.emit("selectionChange",w,y)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(cn,{modelValue:r.value,"onUpdate:modelValue":w=>r.value=w,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",onSelectionChange:T},{default:()=>[e.createVNode(nn,{items:a.value,onClick:b},null)]})])])}const dn=e.defineComponent({name:"FTabsDesign",props:se,emits:["tabChange","tabRemove"],setup(t,n){const o=e.ref(),s=e.inject("design-item-context"),a=Yt(s.schema,s.parent),r=ge(o,s,a),b=e.ref(t.tabType),T=e.shallowRef(),w=e.shallowRef(),y=Kt(t,n,T,s),{activeId:C,changeTitleStyle:c,tabPages:l,addTab:h,updateTab:m,selectTabByTabId:u,toolbarItems:f}=y,p=$e(t,w,y),x=je(t,T,p,y),{previousButtonClass:j,nextButtonClass:E,nextButtonGroupClass:O,scrollTab:B,updateNavigationLayout:v}=x,S=Ve(t,y),{hideDropDown:A}=S,V=Zt(t,T,x,p,y,r,a),i=V,g=Ne(t,T,x,p,y),d=new Map([["default",V],["one-page",i],["pills",g]]);e.computed(()=>{const L=l.value.find(_=>_.props.id===C.value);return L==null?void 0:L.slots});const N=e.computed(()=>{const L=l.value.find(Z=>Z.props.id===C.value);return(L==null?void 0:L.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:C,addTab:h,updateTab:m,tabPages:l,tabType:b});function k(){const L=r.value.schema.contents||[];return L.length<1?null:L.find(Z=>Z.id===C.value)}function M(){var _;const L=k();f.value=[...(_=L==null?void 0:L.toolbar)==null?void 0:_.buttons]}e.provide("toolbar-item-handler",M);const R=e.computed(()=>t.fill||t.tabType==="fill"),q=e.computed(()=>t.tabType==="pills"),Q=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":N.value,"farris-tabs-inContent":!N.value,"farris-tabs-nav-fill":R.value,"farris-tabs-nav-pills":q.value})),G=e.computed(()=>({width:N.value&&t.titleWidth?`${t.titleWidth}%`:""})),J=e.computed(()=>({"farris-tabs":!0,"flex-column":t.position==="top","flex-column-reverse":t.position==="bottom","flex-row":t.position==="left","flex-row-reverse":t.position==="right","one-page":t.tabType==="one-page"}));e.onMounted(()=>{l.value.length&&(C.value=t.activeId||l.value[0].props.id,u(C.value)),e.nextTick(()=>{v()}),c(T),window.addEventListener("click",L=>{var _;A.value||(_=o.value)!=null&&_.contains(L.target)||(A.value=!0)}),window.addEventListener("resize",()=>{v()}),o.value.componentInstance=r});function K(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:j.value,onClick:()=>{B(0,-1)}},null)}function F(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:E.value,onClick:()=>{B(0,1)}},null)}const{renderMorePagesButtton:$}=Se(t,S,x,y);function D(){return!!f.value.length&&ln(y,r,a,s)}const P=d.get(t.tabType)||d.get("default");function I(){var L,_,Z,le;return e.createVNode("div",{class:Q.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(L=n.slots).headerPrefix)==null?void 0:_.call(L)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:G.value},[K(),P&&P(),e.createVNode("div",{class:O.value},[F(),$()])]),D(),e.createVNode("div",{class:"farris-tabs-header-post"},[(le=(Z=n.slots).headerSuffix)==null?void 0:le.call(Z)])])}function H(){var L,_;return e.createVNode("div",{class:"farris-tabs-content",ref:w},[(_=(L=n.slots).default)==null?void 0:_.call(L)])}return n.expose(r.value),()=>e.createVNode("div",{class:J.value,ref:o},[I(),H()])}});function un(){function t(n){var a,r;if(!n)return!1;const o=((a=n.targetContainer)==null?void 0:a.componentInstance)&&n.targetContainer.componentInstance.value;if(!o)return!1;const s=(r=o.schema.appearance)==null?void 0:r.class;if(n.controlCategory==="input"||n.controlType==="form-group"){const b=o.schema.type,T=(b==="response-form"||b==="content-container")&&s&&s.includes("farris-form");if(o.schema.type!=="response-layout-item"&&!T)return!1}return n.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}function pn(t,n){function o(a){return!!un().basalDragulaRuleForContainer(a)}function s(a){}return{canAccepts:o,onAcceptMovedChildElement:s}}function fn(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const mn=e.defineComponent({name:"FTabPageDesign",props:re,emits:[],setup(t,n){const o=e.ref(),s=e.inject("design-item-context"),a=pn(s.schema,s.parent),r=ge(o,s,a);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,n.expose(r.value);const b=e.inject("tabs"),T=e.ref(!0),w={slots:n.slots,props:t},y=e.ref((b==null?void 0:b.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const p=b.tabPages.value.findIndex(x=>x.props.id===t.id);!p||p===-1?b==null||b.addTab(w):p>-1&&(T.value=!1,console.warn(`已经存在id为${t.id}的页签啦`))}),e.onUnmounted(()=>{});const C=e.computed(()=>(t==null?void 0:t.id)===(b==null?void 0:b.activeId.value)),c=e.computed(()=>({display:C.value?"":"none"}));e.watch(()=>t,p=>{b==null||b.updateTab({props:p,slots:n.slots})},{immediate:!0,deep:!0});function l(){var x,j;const p=(j=(x=n.slots).default)==null?void 0:j.call(x);return e.createVNode(Ie,{"main-title":t.title,class:"farris-tab-page"},fn(p)?p:{default:()=>[p]})}const h=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function m(){var x,j;const p=(j=(x=n.slots).default)==null?void 0:j.call(x);return e.createVNode("div",{ref:o,class:h.value,"data-dragref":`${s.schema.id}-container`,style:c.value},[p])}const f=new Map([["default",m],["one-page",l]]).get(y.value)||m;return()=>T.value?f():null}}),bn={install(t){t.component(ae.name,ae),t.component(ce.name,ce)},register(t,n,o){t.tabs=ae,t["tab-page"]=ce,n.tabs=pe,n["tab-page"]=be},registerDesigner(t,n,o){t.tabs=dn,t["tab-page"]=mn,n.tabs=pe,n["tab-page"]=be}};z.FTabPage=ce,z.FTabs=ae,z.default=bn,z.tabPageProps=re,z.tabPagePropsResolver=be,z.tabsProps=se,z.tabsPropsResolver=pe,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabs",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "style": "style.css",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tags",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "style": "style.css",