@farris/ui-vue 1.3.0 → 1.3.1

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 (201) hide show
  1. package/components/accordion/index.esm.js +1 -1
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +472 -366
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/button-edit/index.esm.js +1 -1
  6. package/components/button-edit/index.umd.cjs +1 -1
  7. package/components/calendar/index.esm.js +472 -480
  8. package/components/calendar/index.umd.cjs +1 -1
  9. package/components/capsule/index.esm.js +225 -233
  10. package/components/capsule/index.umd.cjs +1 -1
  11. package/components/checkbox/index.esm.js +615 -517
  12. package/components/checkbox/index.umd.cjs +1 -1
  13. package/components/color-picker/index.esm.js +325 -333
  14. package/components/color-picker/index.umd.cjs +2 -2
  15. package/components/combo-list/index.esm.js +578 -472
  16. package/components/combo-list/index.umd.cjs +1 -1
  17. package/components/combo-tree/index.esm.js +49 -49
  18. package/components/combo-tree/index.umd.cjs +1 -1
  19. package/components/common/index.esm.js +832 -722
  20. package/components/common/index.umd.cjs +1 -1
  21. package/components/component/index.esm.js +303 -981
  22. package/components/component/index.umd.cjs +1 -1
  23. package/components/condition/index.esm.js +8 -8
  24. package/components/condition/index.umd.cjs +1 -1
  25. package/components/content-container/index.esm.js +335 -1002
  26. package/components/content-container/index.umd.cjs +1 -1
  27. package/components/data-grid/index.esm.js +4429 -4312
  28. package/components/data-grid/index.umd.cjs +1 -1
  29. package/components/data-view/index.esm.js +3037 -3020
  30. package/components/data-view/index.umd.cjs +1 -1
  31. package/components/date-picker/index.esm.js +2216 -2119
  32. package/components/date-picker/index.umd.cjs +1 -1
  33. package/components/designer-canvas/index.css +1 -1
  34. package/components/designer-canvas/index.esm.js +914 -883
  35. package/components/designer-canvas/index.umd.cjs +1 -1
  36. package/components/dropdown/index.esm.js +223 -231
  37. package/components/dropdown/index.umd.cjs +2 -2
  38. package/components/dynamic-form/index.esm.js +1691 -2187
  39. package/components/dynamic-form/index.umd.cjs +1 -1
  40. package/components/dynamic-resolver/index.esm.js +143 -136
  41. package/components/dynamic-resolver/index.umd.cjs +1 -1
  42. package/components/events-editor/index.esm.js +250 -258
  43. package/components/events-editor/index.umd.cjs +1 -1
  44. package/components/expression-editor/index.esm.js +1 -1
  45. package/components/expression-editor/index.umd.cjs +1 -1
  46. package/components/external-container/index.esm.js +2672 -3438
  47. package/components/external-container/index.umd.cjs +1 -1
  48. package/components/field-selector/index.esm.js +2965 -2970
  49. package/components/field-selector/index.umd.cjs +1 -1
  50. package/components/filter-bar/index.esm.js +1650 -1602
  51. package/components/filter-bar/index.umd.cjs +1 -1
  52. package/components/flow-canvas/index.css +1 -1
  53. package/components/flow-canvas/index.esm.js +684 -675
  54. package/components/flow-canvas/index.umd.cjs +1 -1
  55. package/components/image-cropper/index.esm.js +453 -461
  56. package/components/image-cropper/index.umd.cjs +1 -1
  57. package/components/input-group/index.esm.js +604 -507
  58. package/components/input-group/index.umd.cjs +1 -1
  59. package/components/layout/index.esm.js +402 -378
  60. package/components/layout/index.umd.cjs +1 -1
  61. package/components/list-nav/index.esm.js +348 -1019
  62. package/components/list-nav/index.umd.cjs +1 -1
  63. package/components/list-view/index.esm.js +1658 -1666
  64. package/components/list-view/index.umd.cjs +1 -1
  65. package/components/lookup/index.esm.js +5209 -5088
  66. package/components/lookup/index.umd.cjs +1 -1
  67. package/components/mapping-editor/index.esm.js +4329 -4213
  68. package/components/mapping-editor/index.umd.cjs +1 -1
  69. package/components/nav/index.esm.js +905 -1357
  70. package/components/nav/index.umd.cjs +3 -3
  71. package/components/number-range/index.esm.js +517 -420
  72. package/components/number-range/index.umd.cjs +1 -1
  73. package/components/number-spinner/index.esm.js +588 -491
  74. package/components/number-spinner/index.umd.cjs +1 -1
  75. package/components/order/index.esm.js +1376 -1965
  76. package/components/order/index.umd.cjs +1 -1
  77. package/components/page-footer/index.esm.js +1 -1
  78. package/components/page-footer/index.umd.cjs +1 -1
  79. package/components/page-header/index.esm.js +1073 -1905
  80. package/components/page-header/index.umd.cjs +1 -1
  81. package/components/pagination/index.esm.js +809 -1237
  82. package/components/pagination/index.umd.cjs +1 -1
  83. package/components/progress/index.esm.js +198 -206
  84. package/components/progress/index.umd.cjs +3 -3
  85. package/components/property-editor/index.esm.js +1297 -1200
  86. package/components/property-editor/index.umd.cjs +2 -2
  87. package/components/property-panel/index.esm.js +609 -507
  88. package/components/property-panel/index.umd.cjs +1 -1
  89. package/components/query-solution/index.esm.js +3391 -3758
  90. package/components/query-solution/index.umd.cjs +1 -1
  91. package/components/radio-button/index.esm.js +1 -1
  92. package/components/radio-button/index.umd.cjs +1 -1
  93. package/components/radio-group/index.esm.js +544 -447
  94. package/components/radio-group/index.umd.cjs +1 -1
  95. package/components/rate/index.esm.js +247 -255
  96. package/components/rate/index.umd.cjs +1 -1
  97. package/components/response-layout/index.esm.js +146 -154
  98. package/components/response-layout/index.umd.cjs +1 -1
  99. package/components/response-layout-editor/index.esm.js +700 -675
  100. package/components/response-layout-editor/index.umd.cjs +1 -1
  101. package/components/response-toolbar/index.esm.js +956 -1786
  102. package/components/response-toolbar/index.umd.cjs +1 -1
  103. package/components/schema-selector/index.esm.js +4963 -5617
  104. package/components/schema-selector/index.umd.cjs +2 -2
  105. package/components/search-box/index.esm.js +158 -161
  106. package/components/search-box/index.umd.cjs +1 -1
  107. package/components/section/index.esm.js +436 -1124
  108. package/components/section/index.umd.cjs +1 -1
  109. package/components/smoke-detector/index.esm.js +92 -100
  110. package/components/smoke-detector/index.umd.cjs +1 -1
  111. package/components/splitter/index.esm.js +571 -1210
  112. package/components/splitter/index.umd.cjs +1 -1
  113. package/components/splitter/style.js +2 -0
  114. package/components/step/index.esm.js +239 -247
  115. package/components/step/index.umd.cjs +1 -1
  116. package/components/switch/index.esm.js +445 -348
  117. package/components/switch/index.umd.cjs +1 -1
  118. package/components/tabs/index.esm.js +2278 -3031
  119. package/components/tabs/index.umd.cjs +1 -1
  120. package/components/tags/index.esm.js +311 -319
  121. package/components/tags/index.umd.cjs +1 -1
  122. package/components/text/index.esm.js +215 -223
  123. package/components/text/index.umd.cjs +1 -1
  124. package/components/textarea/index.esm.js +468 -371
  125. package/components/textarea/index.umd.cjs +1 -1
  126. package/components/time-picker/index.esm.js +1271 -1174
  127. package/components/time-picker/index.umd.cjs +1 -1
  128. package/components/transfer/index.esm.js +469 -477
  129. package/components/transfer/index.umd.cjs +1 -1
  130. package/components/tree-grid/index.esm.js +3060 -3065
  131. package/components/tree-grid/index.umd.cjs +1 -1
  132. package/components/tree-view/index.esm.js +2476 -2481
  133. package/components/tree-view/index.umd.cjs +1 -1
  134. package/components/uploader/index.esm.js +374 -382
  135. package/components/uploader/index.umd.cjs +2 -2
  136. package/components/verify-detail/index.esm.js +248 -256
  137. package/components/verify-detail/index.umd.cjs +1 -1
  138. package/components/video/index.esm.js +414 -1093
  139. package/components/video/index.umd.cjs +1 -1
  140. package/components/weather/index.esm.js +498 -506
  141. package/components/weather/index.umd.cjs +5 -5
  142. package/farris.all.esm.js +20216 -21844
  143. package/farris.all.umd.cjs +9 -9
  144. package/index.css +1 -1
  145. package/package.json +1 -1
  146. package/types/common/directive/area-response.d.ts +10 -0
  147. package/types/common/index.d.ts +8 -0
  148. package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
  149. package/types/common/utils/resolve-field.d.ts +2 -0
  150. package/types/common/utils/use-class.d.ts +7 -0
  151. package/types/component/src/designer/use-designer-rules.d.ts +2 -2
  152. package/types/condition/src/types.d.ts +2 -1
  153. package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
  154. package/types/data-grid/index.d.ts +8 -5
  155. package/types/data-grid/src/data-grid.component.d.ts +3 -2
  156. package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
  157. package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
  158. package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
  159. package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
  160. package/types/data-view/composition/types.d.ts +7 -9
  161. package/types/designer-canvas/index.d.ts +2 -1
  162. package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
  163. package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
  164. package/types/designer-canvas/src/composition/types.d.ts +1 -2
  165. package/types/designer-canvas/src/types.d.ts +2 -1
  166. package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
  167. package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
  168. package/types/dynamic-form/src/property-config/form.property-config.d.ts +1 -1
  169. package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
  170. package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
  171. package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
  172. package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
  173. package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
  174. package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
  175. package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
  176. package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
  177. package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
  178. package/types/property-panel/index.d.ts +2 -1
  179. package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -1
  180. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
  181. package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
  182. package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
  183. package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
  184. package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
  185. package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
  186. package/types/query-solution/src/solutions.d.ts +108 -509
  187. package/types/response-layout-editor/index.d.ts +3 -1
  188. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
  189. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
  190. package/types/section/src/designer/use-designer-rules.d.ts +3 -3
  191. package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
  192. package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
  193. package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
  194. package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
  195. package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
  196. package/types/tree-grid/index.d.ts +3 -3
  197. package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
  198. package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
  199. package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
  200. package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
  201. package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
@@ -1 +1 @@
1
- (function(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../capsule/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../section/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../capsule/index.umd.js","../response-toolbar/index.umd.js","../dynamic-resolver/index.umd.js","../section/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","bignumber.js"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z.tabs={},z.Vue,z.LodashES,z.FCapsule,z.FResponseToolbar,z.dynamicResolver,z.FSection$1,z.designerCanvas,z.common))})(this,function(z,e,Z,at,ke,st,rt,Ee,ge){"use strict";var _n=Object.defineProperty;var Un=(z,e,Z)=>e in z?_n(z,e,{enumerable:!0,configurable:!0,writable:!0,value:Z}):z[e]=Z;var F=(z,e,Z)=>Un(z,typeof e!="symbol"?e+"":e,Z);const ye={},Ie={};function ve(n){const{properties:t,title:o,ignore:a}=n,s=a&&Array.isArray(a),r=Object.keys(t).reduce((l,p)=>((!s||!a.find(m=>m==p))&&(l[p]=t[p].type==="object"&&t[p].properties?ve(t[p]):Z.cloneDeep(t[p].default)),l),{});return(!s||!a.find(l=>l=="id"))&&(r.id=`${o}-${Date.now()}`),r}function Y(n,t={},o){const a=ye[n];if(a){let s=ve(a);const r=Ie[n];return s=r?r({getSchemaByType:Y},s,t,o):s,s}return null}function lt(n,t){const o=ve(t);return Object.keys(n).reduce((a,s)=>(a[s]&&Z.isPlainObject(a[s])&&Z.isPlainObject(n[s])?Object.assign(a[s],n[s]):a[s]=n[s],a),o),o}function it(n,t){return Object.keys(n).filter(a=>n[a]!=null).reduce((a,s)=>{if(t.has(s)){const r=t.get(s);if(typeof r=="string")a[r]=n[s];else{const l=r(s,n[s],n);Object.assign(a,l)}}else a[s]=n[s];return a},{})}function ct(n,t,o=new Map){const a=lt(n,t);return it(a,o)}function dt(n={}){function t(i,C,y,T){if(typeof y=="number")return T[i].length===y;if(typeof y=="object"){const S=Object.keys(y)[0],g=y[S];if(S==="not")return Number(T[i].length)!==Number(g);if(S==="moreThan")return Number(T[i].length)>=Number(g);if(S==="lessThan")return Number(T[i].length)<=Number(g)}return!1}function o(i,C,y,T){return T[i]&&T[i].propertyValue&&String(T[i].propertyValue.value)===String(y)}const a=new Map([["length",t],["getProperty",o]]);Object.keys(n).reduce((i,C)=>(i.set(C,n[C]),i),a);function s(i,C){const y=i;return typeof C=="number"?[{target:y,operator:"length",param:null,value:Number(C)}]:typeof C=="boolean"?[{target:y,operator:"getProperty",param:i,value:!!C}]:typeof C=="object"?Object.keys(C).map(T=>{if(T==="length")return{target:y,operator:"length",param:null,value:C[T]};const S=T,g=C[T];return{target:y,operator:"getProperty",param:S,value:g}}):[]}function r(i){return Object.keys(i).reduce((y,T)=>{const S=s(T,i[T]);return y.push(...S),y},[])}function l(i,C){if(a.has(i.operator)){const y=a.get(i.operator);return y&&y(i.target,i.param,i.value,C)||!1}return!1}function p(i,C){return r(i).reduce((S,g)=>S&&l(g,C),!0)}function m(i,C){const y=Object.keys(i),T=y.includes("allOf"),S=y.includes("anyOf"),g=T||S,d=(g?i[g?T?"allOf":"anyOf":"allOf"]:[i]).map(M=>p(M,C));return T?!d.includes(!1):d.includes(!0)}return{parseValueSchema:m}}const re={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},De={},ut={};dt();function se(n,t,o=new Map,a=(l,p,m)=>p,s={},r=l=>l){return ye[t.title]=t,Ie[t.title]=a,De[t.title]=s,ut[t.title]=r,(l={})=>{const p=ct(l,t,o),m=Object.keys(n).reduce((i,C)=>(i[C]=n[C].default,i),{});return Object.assign(m,p)}}function ce(n,t){return{customClass:t.class,customStyle:t.style}}function pt(){function n(t,o){const a=t.contents;if(!a||a.length<1)return null;const s=a.reduce((m,i)=>{const C=i.toolbar&&i.toolbar.buttons||[];return m.push(...C),m},[]);if(!s||s.length<1)return;const[r,l]=o.payloads,p=s.find(m=>m.id===l);return p?p.onClick||p.click:null}return{resolve:n}}const Ce=new Map([["appearance",ce]]);function ft(n,t,o){const a=Math.random().toString().slice(2,6),s=t.parentComponentInstance,r=n.getSchemaByType("tab-page");r.id=`tab-page-${a}`;const l=n.getSchemaByType("tabs");Object.assign(l,{id:`tabs-${a}`,appearance:{class:"f-component-tabs f-tabs-has-grid"},contents:[r],activeId:r.id});const p=n.getSchemaByType("section");Object.assign(p,{id:`section-${a}`,appearance:{class:"f-section-tabs f-section-in-mainsubcard"},fill:!1,showHeader:!1,contents:[l]});const m=n.getSchemaByType("content-container");Object.assign(m,{id:`container-${a}`,appearance:{class:"f-struct-wrapper"},contents:[p]});const i=s.schema;switch(i&&i.type){case re.splitter.type:{p.appearance.class="f-section-tabs f-section-in-main",l.appearance.class="f-component-tabs";break}}return m}function $e(n,t,o,a){if(o.parentComponentInstance)return ft(n,o);{const r=n.getSchemaByType("tab-page");return t.contents=[r],t}}function mt(n,t,o){return t}const Ae={$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:[]},autoTitleWidth:{description:"",type:"boolean",default:!1},titleLength:{description:"",type:"number",default:7},fill:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},de={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"}},Oe=se(de,Ae,Ce,$e),we=Object.assign({},de,{componentId:{type:String,default:""}}),Re=se(we,Ae,Ce,$e),Fe=pt();function ht(n,t,o){const a=e.ref([]),s=e.ref(n.activeId||""),r=e.ref(!0),l=e.ref([]);e.watch(()=>n.activeId,(f,h)=>{f!==h&&(s.value=f)});function p(f){const h=f.value.findIndex(d=>d.props.show!==!1&&!s.value&&!d.props.disabled);!s.value&&h!==-1&&(s.value=f.value[h].props.id)}function m(f){var d;if(n.autoTitleWidth)return;const h=(d=f.value)==null?void 0:d.querySelectorAll(".st-tab-text");if(h)for(let w=0;w<h.length;w++){const M=h[w].parentNode;h[w].scrollWidth>M.offsetWidth?h[w].classList.contains("farris-title-text-custom")||h[w].classList.add("farris-title-text-custom"):h[w].classList.remove("farris-title-text-custom")}}const i=f=>{f.preventDefault(),f.stopPropagation()};function C(f,h,d=!1){const w=a.value.findIndex(M=>M.props.id===h);a.value=a.value.filter(M=>M.props.id!==h),s.value===h&&(s.value="",p(a)),i(f),e.nextTick(()=>{m(o),d&&(r.value=!0),t.emit("tabRemove",{removeIndex:w,removeId:h,activeId:s.value})})}function y(f){const h=s.value;s.value=f;const d=a.value.find(w=>w.props.id===f);l.value=[],d&&d.props.toolbar&&d.props.toolbar.buttons&&d.props.toolbar.buttons.length&&(l.value=[...d.props.toolbar.buttons]),t.emit("update:activeId",f),t.emit("tabChange",{prevId:h,nextId:s.value})}function T(f){y(f)}function S(f){a.value.findIndex(d=>d.props.id===f.props.id)===-1&&a.value.push(f)}function g(f){a.value.findIndex(d=>d.props.id===f.props.id)!==-1&&(a.value.forEach(d=>{d.props.id===f.props.id&&(d=f)}),e.nextTick(()=>{m(o)}))}return{activeId:s,addTab:S,changeTitleStyle:m,removeTab:C,selectTab:T,selectTabByTabId:y,tabPages:a,updateTab:g,toolbarItems:l}}function bt(n,t,o,a,s){const{activeId:r,removeTab:l,selectTab:p}=s,m=e.computed(()=>({"st-tab-text":!0,"text-truncate":!0,"farris-title-auto":n.autoTitleWidth})),i=e.computed(()=>({"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled})),C=e.computed(()=>({width:`${t.tabWidth}px`})),y=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function T(w){return e.createVNode("span",{class:m.value,title:w.title},[w.title])}function S(w){return w.slots.title?w.slots.title:T}const g=S(o),f=e.ref(t.removeable);function h(){return e.createVNode("span",{class:"st-drop-close",onClick:w=>l(w,t.id),style:{opacity:.6}},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function d(w){p(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}return e.createVNode("li",{class:i.value,style:C.value},[e.createVNode("a",{class:y.value,onClick:d},[g(t),f.value&&h()])])}function gt(n,t,o,a,s){const{shouldShowNavigationButtons:r}=o,{tabPages:l}=s,p=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),m=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),i=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"}));return()=>e.createVNode("div",{class:p.value,style:m.value},[e.createVNode("ul",{class:i.value,ref:t},[l.value.map(C=>bt(n,C.props,C,a,s))])])}function Le(n,t,o,a,s){const r=e.ref(),{shouldShowNavigationButtons:l}=o,{activeId:p,tabPages:m,selectTab:i}=s,C=e.ref(p.value),y=e.computed(()=>m.value.map(f=>({name:f.props.title,value:f.props.id,show:f.props.show,disabled:f.props.disabled}))),T=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":l.value})),S=e.computed(()=>({width:"100%",display:"flex","justify-content":n.justifyContent}));e.onMounted(()=>{r.value&&(t.value=r.value.$el)});function g(f){i(f)}return e.watch(()=>p.value,f=>{f!==C.value&&(C.value=f)},{immediate:!0}),()=>e.createVNode("div",{class:T.value,style:S.value},[e.createVNode(at,{items:y.value,modelValue:C.value,"onUpdate:modelValue":f=>C.value=f,onChange:g,ref:r},null)])}function yt(n,t,o,a){const{activeId:s,removeTab:r,tabPages:l}=a,{selectAndScrollToTab:p}=o,{hideDropDown:m,searchTabText:i}=t,C=e.ref("auto"),y=e.computed(()=>{var w,M;let d=[];return n.searchBoxVisible?d=(w=l.value)==null?void 0:w.filter($=>$.props.title.includes(i.value)):d=(M=l.value)==null?void 0:M.slice(),d}),T=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":n.searchBoxVisible,show:!m.value}));function S(d){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:d.props.disabled,active:d.props.id===s.value,"d-none":d.props.show!==!0}}function g(d){d.preventDefault(),d.stopPropagation()}const f=()=>({width:C.value});function h(){return e.createVNode("div",{class:T.value},[n.searchBoxVisible&&e.createVNode("div",{onClick:d=>g(d),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":d=>i.value=d},null),[[e.vModelText,i.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),y.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:f()},[y.value.map(d=>e.createVNode("li",{class:S(d),onClick:w=>p(w,d.props)},[d.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:w=>r(w,d.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title",title:d.props.title},[d.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:h}}function He(n,t,o,a){const{hideDropDown:s}=t,{renderDropdownMenu:r}=yt(n,t,o,a),l=e.ref(n.showDropdown);function p(){return l.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{s.value=!1}},null),r()])}return{renderMorePagesButtton:p}}function ze(n,t,o,a){const s=e.ref(!1),{selectTabByTabId:r,tabPages:l}=a,p=4;function m(){var d;const f=t.value,h=(d=t.value)==null?void 0:d.parentElement;s.value=h&&f&&h.offsetWidth<f.scrollWidth-p}const i=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!s.value})),C=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!s.value})),y=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!s.value}));function T(f,h){if(!t.value)return;const d=t.value.scrollLeft,w=t.value.scrollWidth-t.value.offsetWidth;if(h>0){if(t.value.scrollLeft>=w)return;t.value.scrollLeft=d+n.scrollStep+f}else if(h<0){if(t.value.scrollLeft<=0)return;t.value.scrollLeft=d-n.scrollStep-f}}function S(f){if(!s.value||!t.value)return;const h=n.tabType==="pills"?".f-capsule-item":".nav-item",d=t.value.querySelectorAll(h),{parentElement:w}=t.value,M=d[f];if(M&&w){const $=w.getBoundingClientRect().left,R=w.getBoundingClientRect().right,j=M.getBoundingClientRect().left,N=M.getBoundingClientRect().right;j<$?T($-j,-1):R<N&&T(N-R,1),n.tabType==="one-page"&&o.scrollTo(f)}}function g(f,h){if(h.disabled)return;r(h.id);const d=l.value.findIndex(w=>w.props.id===h.id);e.nextTick(()=>{S(d)})}return{previousButtonClass:i,nextButtonGroupClass:C,nextButtonClass:y,scrollTab:T,selectAndScrollToTab:g,shouldShowNavigationButtons:s,updateNavigationLayout:m}}function We(n,t){const{tabPages:o}=t,a=e.ref(""),s=e.ref(!0),r=e.computed(()=>n.searchBoxVisible),l=e.computed(()=>r.value?o.value.filter(m=>m.props.title.includes(a.value)):o.value.slice());return{searchTabText:a,hideDropDown:s,shouldShowSearchBox:r,tabsInDropdownMenu:l}}function qe(n,t,o){const a=".farris-tab-page",{tabPages:s}=o;function r(p){const m=t.value;if(m){const i=t.value.querySelectorAll(a);if(i.length>0){const C=i[p],{offsetTop:y}=C,T=y-32>0?y-32:0;m.scrollTop=T}}}function l(p){const m=s.value.findIndex(i=>i.props.id===p);m>-1&&r(m)}return{scrollTo:r,scrollToByPaggId:l}}const te=e.defineComponent({name:"FTabs",props:de,emits:["tabChange","tabRemove","update:activeId","Click"],setup(n,t){const o=e.ref(n.tabType),a=e.shallowRef(),s=e.ref(n.customClass),r=e.shallowRef(),l=e.shallowRef(),p=ht(n,t,r),{activeId:m,changeTitleStyle:i,tabPages:C,addTab:y,updateTab:T,selectTabByTabId:S,toolbarItems:g}=p,f=qe(n,l,p),h=ze(n,r,f,p),{previousButtonClass:d,nextButtonClass:w,nextButtonGroupClass:M,scrollTab:$,updateNavigationLayout:R}=h,j=We(n,p),{hideDropDown:N}=j,B=gt(n,r,h,f,p),k=B,x=Le(n,r,h,f,p),b=new Map([["default",B],["one-page",k],["pills",x]]);e.computed(()=>{const W=C.value.find(_=>_.props.id===m.value);return W==null?void 0:W.slots});const u=e.computed(()=>{const W=C.value.find(H=>H.props.id===m.value);return(W==null?void 0:W.props.toolbarPosition)==="inHead"}),c=e.computed(()=>n.fill||n.tabType==="fill");e.provide("tabs",{activeId:m,addTab:y,updateTab:T,tabPages:C,tabType:o,shouldFillParentContaner:c});const v=e.computed(()=>n.tabType==="pills"),P=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":u.value,"farris-tabs-inContent":!u.value,"farris-tabs-nav-fill":c.value,"farris-tabs-nav-pills":v.value})),D=e.computed(()=>({width:u.value&&n.titleWidth?`${n.titleWidth}%`:""})),V=e.computed(()=>{const W={"farris-tabs":!0,"f-utils-fill-flex-column":c.value,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"};return s.value&&s.value.split(" ").reduce((_,H)=>(_[H]=!0,_),W),W});e.onMounted(()=>{C.value.length&&(m.value=n.activeId||C.value[0].props.id,S(m.value)),e.nextTick(()=>{R()}),i(r),window.addEventListener("click",W=>{var _;N.value||(_=a.value)!=null&&_.contains(W.target)||(N.value=!0)}),window.addEventListener("resize",()=>{R()})});function E(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:d.value,onClick:()=>{$(0,-1)}},null)}function A(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:w.value,onClick:()=>{$(0,1)}},null)}const{renderMorePagesButtton:O}=He(n,j,h,p),L=(W,_)=>{t.emit("Click",W,_,m.value)};function X(){return g.value.length?e.createVNode(ke,{class:"f-utils-fill",items:g.value,onClick:L},null):null}const J=b.get(n.tabType)||b.get("default");function ae(){var W,_,H,U;return e.createVNode("div",{class:P.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(W=t.slots).headerPrefix)==null?void 0:_.call(W)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:D.value},[E(),J&&J(),e.createVNode("div",{class:M.value},[A(),O()])]),X(),e.createVNode("div",{class:"farris-tabs-header-post"},[(U=(H=t.slots).headerSuffix)==null?void 0:U.call(H)])])}const K=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":c.value}));function ee(){var W,_;return e.createVNode("div",{class:K.value,ref:l},[(_=(W=t.slots).default)==null?void 0:_.call(W)])}return()=>e.createVNode("div",{class:V.value,ref:a},[ae(),ee()])}}),vt=new Map([["appearance",ce],["toolbar",Ct]]);function Ct(n,t,o){return t&&t.contents&&t.contents.length&&(t.contents.forEach(a=>{a.title&&(a.text=a.title)}),t.buttons=t.contents,delete t.contents),{toolbar:t}}const wt={$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"]},ue={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"}},Te=st.createPropsResolver(ue,wt,vt);function Tt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const pe=e.defineComponent({name:"FTabPage",props:ue,emits:[],setup(n,t){const o=e.inject("tabs"),a=e.ref(n.show),s={slots:t.slots,props:n},r=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const S=o==null?void 0:o.tabPages.value.findIndex(g=>g.props.id===n.id);!S||S===-1?o==null||o.addTab(s):S>-1&&(a.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const l=e.computed(()=>(n==null?void 0:n.id)===(o==null?void 0:o.activeId.value)),p=e.computed(()=>({display:l.value?"":"none"}));e.watch(()=>n,S=>{o==null||o.updateTab({props:S,slots:t.slots})},{immediate:!0,deep:!0});function m(){var g,f;const S=(f=(g=t.slots).default)==null?void 0:f.call(g);return e.createVNode(rt,{"main-title":n.title,class:"farris-tab-page"},Tt(S)?S:{default:()=>[S]})}const i=e.computed(()=>{var g;return{"farris-tab-page":!0,"f-utils-fill-flex-column":l.value&&o&&((g=o.shouldFillParentContaner)==null?void 0:g.value)}});function C(){var g,f;const S=(f=(g=t.slots).default)==null?void 0:f.call(g);return e.createVNode("div",{class:i.value,style:p.value},[S])}const T=new Map([["default",C],["one-page",m]]).get(r.value)||C;return()=>a.value?T():null}}),xt={width:{Type:Number,default:400},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 xe(){return new DOMException("The request is not allowed","NotAllowedError")}async function St(n){if(!navigator.clipboard)throw xe();return navigator.clipboard.writeText(n)}async function Nt(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const o=window.getSelection(),a=window.document.createRange();o==null||o.removeAllRanges(),a.selectNode(t),o==null||o.addRange(a);let s=!1;try{s=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(t)}if(!s)throw xe()}async function jt(n){try{await St(n)}catch(t){try{await Nt(n)}catch(o){throw o||t||xe()}}}function Mt(){async function n(t){await jt(t)}return{onCopy:n}}function Vt(n,t,o,a){const s=e.ref(14),r=e.ref(140),l=e.ref(""),p=e.ref(a.value.length),m=e.computed(()=>a.value),i=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function C(y){if(y.currentTarget){const T=y.currentTarget.value||"";p.value=T.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:i.value,rows:"4",maxlength:r.value,onInput:y=>C(y)},[m.value]),e.createVNode("span",{class:"textarea-wordcount",title:l.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[p.value+" / "+r.value])])}function Bt(n,t,o,a){const s=Vt(n,t,o,a),r=new Map([["text-area",s]]);function l(p){return r.get(p)||null}return{getEditorRender:l}}function Pt(){const n=e.ref(!1),t=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const a={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 a.opacity=n.value?"0.8":"0",a.display=n.value?"":"none",a}),feedbackMessage:t,toShowFeedback:n}}function kt(n,t){const o=t.getEditorRender(n.promptEditorType);return()=>o&&o()}function Et(n){const t=e.ref(3),o=e.ref(480),a=e.computed(()=>!!n.value&&!!n.value.date),s=e.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),r=e.computed(()=>!!n.value&&!!n.value.detail),l=e.computed(()=>{const h=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":t.value,"max-height":h}}),p=e.computed(()=>n.value&&n.value.detail||""),m=e.computed(()=>!0),i=e.ref(!1),C=e.ref("展开"),y=e.ref("收起"),T=e.computed(()=>{const h={display:"block",color:"#2A87FF"};return h["text-align"]=i.value?"":"right",h});function S(h,d){i.value=!i.value,t.value=i.value?20:3}function g(h){return S()}function f(h){return S()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[a.value&&e.createVNode("div",null,[s.value]),r.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:l.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:p.value},null)]),m.value&&e.createVNode("span",{style:T.value},[i.value&&e.createVNode("span",{onClick:g,style:"cursor: pointer;"},[y.value]),!i.value&&e.createVNode("span",{onClick:f,style:"cursor: pointer;"},[C.value])])])}function It(n){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Dt(n,t,o,a){const s=e.ref(n.exceptionInfo),r=e.computed(()=>{const T={"f-icon":!0},S=`f-icon-${t.value}`;return T[S]=!0,T}),l=e.computed(()=>o.value||s.value&&s.value.message),p=e.computed(()=>a.value),m=e.computed(()=>!!a.value),i=e.computed(()=>!!s.value);function C(){return i.value?Et(s):m.value?It(p):()=>null}const y=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:l.value},null),y()])])}function $t(n,t,o){const{onCopy:a}=t,{toShowFeedback:s}=o,r=e.ref("复制成功"),l=e.ref("复制详细信息"),p=e.ref(n.exceptionInfo||{date:"",message:"",detail:""}),m=e.computed(()=>p.value&&p.value.detail||"");function i(C){a(m.value).catch(y=>{r.value="复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:i,style:"cursor: pointer;"},[l.value])])}function At(n,t,o,a){const s=e.ref(n.type),r=e.ref([]),l=e.ref(n.exceptionInfo),p=e.ref(n.okButtonText),m=e.ref(n.cancelButtonText),i=e.ref(!0),C=e.ref(!0),y=e.computed(()=>!!(r.value&&r.value.length)),T=e.computed(()=>l.value&&l.value.date&&l.value.message&&l.value.detail),S=e.computed(()=>!(r.value&&r.value.length)&&(p.value||m.value)),g=e.computed(()=>C.value&&p.value),f=e.computed(()=>i.value&&m.value),h=$t(n,o,a);function d(M){s.value==="question"&&t.emit("reject"),t.emit("close")}function w(M){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[T.value&&h(),S.value&&f.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:d},[m.value]),S.value&&g.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:w},[p.value]),y.value&&r.value.length&&r.value.map(M=>e.createVNode("button",{type:"button",onClick:M.handle,class:M.class},[M.iconClass&&e.createVNode("span",{class:M.iconClass},null),M.text]))])}const fe=e.defineComponent({name:"FMessageBox",props:xt,emits:["accept","reject","close"],setup(n,t){const o=e.ref(n.type),a=e.ref(n.title),s=e.ref(n.detail),r=e.computed(()=>{const h={"modal-tips":!0,"d-flex":!0,"flex-row":!0},d=`messager-type-${o.value}`;return h[d]=!0,h}),l=e.computed(()=>{const h={};return o.value==="prompt"?h.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(h.padding="0.5rem 1.5rem 1rem 1.5rem"),h}),p=Mt(),m=Bt(n,o,a,s),i=Pt(),{feedbackStyle:C,feedbackMessage:y}=i;function T(){return e.createVNode("div",{style:C.value},[y.value])}function S(){switch(o.value){case"prompt":return kt(n,m);default:return Dt(n,o,a,s)}}const g=S(),f=At(n,t,p,i);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:l.value},[g()]),f(),T()])}}),Ot={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},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},reiszeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1}};class G{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const a=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(a.length>=6){const s=parseInt(a[4],10),r=parseInt(a[5],10);return{x:s,y:r}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new G(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new G(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let a=0;a<t.changedTouches.length;a++)if(t.changedTouches[a].target===o)return new G(t.changedTouches[a].clientX,t.changedTouches[a].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new G(0,0);if(window){const a=window.getComputedStyle(t);if(a){const s=parseInt(a.getPropertyValue("left"),10),r=parseInt(a.getPropertyValue("top"),10);o.x=isNaN(s)?0:s,o.y=isNaN(r)?0:r}return o}return null}static copy(t){return new G(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class oe{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new oe(0,0);if(window){const a=window.getComputedStyle(t);return a&&(o.width=parseInt(a.getPropertyValue("width"),10),o.height=parseInt(a.getPropertyValue("height"),10)),o}return null}static copy(t){return new oe(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function Rt(n,t){const o=e.ref(),a=e.ref(),s=e.ref(),r=e.ref(),l=e.ref(),p=e.ref(),m=e.ref(),i=e.ref(),C=e.ref(),y=e.ref(),T=e.ref(),S=e.ref(),g=e.ref(n.draggable),f=e.ref(!1);function h(){const V=a.value||document.body,E=window.getComputedStyle(V);if(!E||!o.value)return;const A=G.getTransformInfo(o.value),O={};m.value&&(O.deltaL=o.value.offsetLeft-m.value.x,O.deltaT=o.value.offsetTop-m.value.y);const L=E.getPropertyValue("position");O.width=V.clientWidth,O.height=V.clientHeight,O.pr=parseInt(E.getPropertyValue("padding-right"),10),O.pb=parseInt(E.getPropertyValue("padding-bottom"),10),O.position=E.getPropertyValue("position"),L==="static"&&(V.style.position="relative"),O.translateX=A.x,O.translateY=A.y,y.value=O}function d(V){if(o.value){r.value=oe.getCurrent(o.value),l.value=G.getCurrent(o.value),p.value=r.value?oe.copy(r.value):null,m.value=l.value?G.copy(l.value):null,h();const E=V.target.getAttribute("type")||"";i.value={n:!!E.match(/n/),s:!!E.match(/s/),w:!!E.match(/w/),e:!!E.match(/e/)}}}function w(){var V,E,A,O;if(o.value){const L=o.value;i.value&&((i.value.n||i.value.s)&&((V=p.value)!=null&&V.height)&&(L.style.height=p.value.height+"px"),(i.value.w||i.value.e)&&((E=p.value)!=null&&E.width)&&(L.style.width=p.value.width+"px"),m.value&&((A=m.value)!=null&&A.x&&(L.style.left=m.value.x+"px"),(O=m.value)!=null&&O.y&&(L.style.top=m.value.y+"px")))}}function M(){const V=n.minHeight?n.minHeight:1,E=n.minWidth?n.minWidth:1;p.value&&m.value&&i.value&&r.value&&(p.value.height<V&&(p.value.height=V,i.value.n&&l.value&&(m.value.y=l.value.y+(r.value.height-V))),p.value.width<E&&(p.value.width=E,i.value.w&&l.value&&(m.value.x=l.value.x+(r.value.width-E))),n.maxHeight&&p.value.height>n.maxHeight&&(p.value.height=n.maxHeight,l.value&&i.value.n&&(m.value.y=l.value.y+(r.value.height-n.maxHeight))),n.maxWidth&&p.value.width>n.maxWidth&&(p.value.width=n.maxWidth,i.value.w&&l.value&&(m.value.x=l.value.x+(r.value.width-n.maxWidth))))}function $(){if(a.value){const V=y.value;if(m.value&&p.value&&i.value&&r.value){const E=V.width-V.pr-V.deltaL-V.translateX-m.value.x,A=V.height-V.pb-V.deltaT-V.translateY-m.value.y;i.value.n&&m.value.y+V.translateY<0&&l.value&&(m.value.y=-V.translateY,p.value.height=r.value.height+l.value.y+V.translateY),i.value.w&&m.value.x+V.translateX<0&&l.value&&(m.value.x=-V.translateX,p.value.width=r.value.width+l.value.x+V.translateX),p.value.width>E&&(p.value.width=E),p.value.height>A&&(p.value.height=A)}}}function R(V){if(!s.value||!r.value||!l.value||!i.value)return;V.subtract(s.value);const E=V.x,A=V.y;i.value.n?(m.value.y=l.value.y+A,p.value.height=r.value.height-A):i.value.s&&(p.value.height=r.value.height+A),i.value.e?p.value.width=r.value.width+E:i.value.w&&(p.value.width=r.value.width-E,m.value.x=l.value.x+E),$(),M(),w()}function j(V){if(!C.value)return;const E=G.fromEvent(V);E&&R(E)}function N(){if(o.value){const{width:V,height:E,x:A,y:O}=o.value.getBoundingClientRect(),L=G.getTransformInfo(o.value);return{size:{width:V,height:E},position:{x:A-L.x,y:O-L.y}}}return null}function B(V){if(o.value){const E=N();T.value=E}s.value=void 0,r.value=null,l.value=null,p.value=null,m.value=null,i.value=null,C.value=null,document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",B)}function k(){document.addEventListener("mousemove",j),document.addEventListener("mouseup",B)}function x(V){V instanceof MouseEvent&&V.button===2||g.value&&(V.stopPropagation(),V.preventDefault(),s.value=G.fromEvent(V),C.value=V.target,d(V),k())}function b(V){return o.value=V,e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:E=>x(E)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:E=>x(E)},null)])}function u(V=!0){const E=a.value||document.body,A=oe.getCurrent(E),O=o.value;V&&(S.value=N(),S.value.transform=O.style.transform),A&&O&&(p.value=A,O.style.height=p.value.height-14+"px",O.style.width=p.value.width-14+"px",O.style.left="7px",O.style.top="7px",O.style.transform="",T.value={size:p.value,position:{x:0,y:0}},g.value=!1,f.value=!0)}function c(){var V,E;if(S.value){const A={width:S.value.size.width||0,height:S.value.size.height||0},O={x:(window.innerWidth-A.width)/2,y:(window.innerHeight-A.height)/2};(V=p.value)==null||V.set(A),(E=m.value)==null||E.set(O);const L=o.value;L.style.height=A.height+"px",L.style.width=A.width+"px",L.style.left=`${O.x}px`,L.style.top=`${O.y}px`,L.style.transform="",T.value={size:A,position:O},g.value=n.draggable,f.value=!1}}function v(){if(o.value){const V=oe.getCurrent(o.value);if(V){const{width:E,height:A}=V;o.value.style.left=`${(window.innerWidth-E)/2}px`,o.value.style.top=`${(window.innerHeight-A)/2}px`,o.value.style.transform=""}}}function P(){const V=()=>{f.value?u(!1):v()};return window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}}const D=P();return{renderResizeBar:b,boundingElement:a,resizedEventParam:T,maximize:u,restore:c,allowDrag:g,isMaximized:f,unWindowResizeHandle:D}}function Ft(n,t,o){const a=e.ref(),s=e.ref(n.draggable),r=e.ref(n.lockAxis),l=e.ref(),p=e.ref(),m=e.ref(!1),i=e.ref(new G(0,0)),C=e.ref(new G(0,0)),y=e.ref(new G(0,0)),T=e.ref(new G(0,0));e.watch(()=>o.value,N=>{l.value.style.cursor=N?"move":"default"});function S(N,B){if(B.tagName==="BUTTON")return!1;if(B===N)return!0;for(const k in B.children)if(B.children.hasOwnProperty(k)&&S(N,B.children[k]))return!0;return!1}function g(){var x,b;let N=y.value.x+C.value.x,B=y.value.y+C.value.y;r.value==="x"?(N=((x=i.value)==null?void 0:x.x)||0,y.value.x=0):r.value==="y"&&(B=((b=i.value)==null?void 0:b.y)||0,y.value.y=0);const k=`translate3d(${Math.round(N)}px, ${Math.round(B)}px, 0px)`;a.value&&(a.value.style.transform=k),T.value.x=N,T.value.y=B}function f(){if(!p.value||!a.value)return null;const N=p.value.getBoundingClientRect(),B=a.value.getBoundingClientRect(),k={top:N.top<B.top,right:N.right>B.right,bottom:N.bottom>B.bottom,left:N.left<B.left};return k.top||(y.value.y-=B.top-N.top),k.bottom||(y.value.y-=B.bottom-N.bottom),k.right||(y.value.x-=B.right-N.right),k.left||(y.value.x-=B.left-N.left),g(),k}function h(N){N&&(i.value&&N.subtract(i.value),y.value.set(N),g(),f())}function d(N){m.value&&s.value&&(N.stopPropagation(),N.preventDefault(),h(G.fromEvent(N,l.value)))}function w(){var N;m.value&&(m.value=!1,C.value.add(y.value),y.value.reset(),(N=a.value)==null||N.classList.remove("ng-dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",w))}function M(){!m.value&&l.value&&(m.value=!0,l.value.classList.add("ng-dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",w))}function $(){if(a.value){const N=G.getTransformInfo(a.value);C.value.set(N);return}C.value.reset()}function R(N){if(!o.value||N instanceof MouseEvent&&N.button===2)return;const B=N.target||N.srcElement;l.value!==void 0&&B&&!S(B,l.value)||s.value!==!1&&(document.body.click(),N.stopPropagation(),N.preventDefault(),i.value=G.fromEvent(N,a.value),$(),M())}function j(N,B,k){if(s.value&&B){if(N)l.value=N;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)l.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const x=B.querySelector(n.dragHandle);x&&(l.value=x)}}a.value=B,p.value=k,l.value.classList.add("ng-draggable"),l.value.addEventListener("mousedown",R)}}return{registerDraggle:j,resetTranslate:$}}function _e(n,t){if(n){const o=a=>{a.key.toLowerCase()===n.toLowerCase()&&t({event:a,key:n})};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}}}function Lt(n,t){const o=e.ref(n.enableEsc);let a=null;return o.value?(a=_e("Escape",s=>{t.emit("esc",{event:s.event,type:"esc"})}),{remove:a}):null}function Ht(n,t){const o=e.ref(n.enableEnter);let a=null;return o.value?(a=_e("Enter",s=>{t.emit("enter",{event:s.event,type:"enter"})}),{remove:a}):null}const Ue=e.defineComponent({name:"FModal",props:Ot,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter"],setup(n,t){const o=e.ref(n.width||300),a=e.ref(n.height||200),s=e.ref(n.modelValue),r=e.ref(""),l=e.ref(n.class),p=e.ref(n.fitContent),m=e.ref(n.showHeader),i=e.ref(""),C=e.ref(n.showCloseButton),y=e.ref(n.showMaxButton),T=e.ref(!1),S=e.ref(""),g=e.ref(""),f=e.ref(""),h=e.ref(n.showButtons),d=e.ref(n.title),w=e.ref(n.reiszeable),M=e.ref(n.containment||null),$=e.ref();function R(I,q){s.value=!1,t.emit("update:modelValue",!1),q!=null&&t.emit(q?"accept":"cancel"),t.emit("closed",I)}const j=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:I=>{R(I,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:I=>{R(I,!0)}}],N=e.ref(n.buttons&&n.buttons.length?n.buttons:j),B=e.computed(()=>!!i.value),k=e.computed(()=>!!h.value&&!!N.value),x=e.ref(),b=e.ref(),u=e.ref(!1),{renderResizeBar:c,maximize:v,restore:P,boundingElement:D,resizedEventParam:V,allowDrag:E,unWindowResizeHandle:A}=Rt(n),{registerDraggle:O}=Ft(n,t,E);e.watch(()=>n.title,(I,q)=>{I!==q&&(d.value=I)}),e.watch(()=>n.modelValue,(I,q)=>{I!==q&&(s.value=I)}),e.watch(()=>n.showHeader,(I,q)=>{I!==q&&(m.value=I)}),e.watch(()=>n.showButtons,(I,q)=>{I!==q&&(h.value=I)}),e.watch(()=>V.value,(I,q)=>{const ie=I||{},be=q||{};JSON.stringify(ie)!==JSON.stringify(be)&&t.emit("resize",{newSize:I,oldSize:q})});function L(){const I=document.querySelectorAll(".farris-modal").length;(!I||I-1<=0)&&document.body.classList.remove("modal-open"),$.value&&$.value.classList.remove("show")}const X=e.computed(()=>(s.value?document.body.classList.add("modal-open"):L(),s.value)),J=e.computed(()=>{const I={modal:!0,"farris-modal":!0,fade:!0};return I["f-modal-fitContent"]=!!p.value,I.show=!!X.value,I}),ae=e.computed(()=>{var ie;const I={"modal-dialog":!0},q=(ie=l.value)==null?void 0:ie.split(" ");return q==null||q.reduce((be,qn)=>(be[qn]=!0,be),I),I}),K=e.computed(()=>({position:"absolute",top:`${(window.innerHeight-a.value)/2}px`,left:`${(window.innerWidth-o.value)/2}px`,width:`${o.value}px`,height:p.value?"auto":`${a.value}px`})),ee=e.computed(()=>({"modal-content":!0,"modal-content-has-header":m.value})),W=e.computed(()=>{const I={display:m.value?"":"none"};return I["pointer-events"]=E.value?"auto":"none",I}),_=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:u.value})),H=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":S.value==="iframe"}));function U(){return{}}const ne=e.computed(()=>{const I={textAlgin:f.value},q=U();return Object.assign(I,q)});function le(I){if(I.stopPropagation(),u.value){u.value=!1,P();return}v(),u.value=!0}async function Rn(I,q){I.handle&&await I.handle(q,I)&&t.emit("closed",q)}function Fn(I){I.width&&(o.value=I.width),I.height&&(a.value=I.height),I.buttons&&(N.value=I.buttons),I.title&&(d.value=I.title)}let Be=null,Pe=null;e.onMounted(()=>{b.value&&!M.value&&(M.value=b.value.parentElement,D.value=M.value,O(x.value,b.value,D.value)),X.value&&document.body.classList.add("modal-open"),Be=Lt(n,t),Pe=Ht(n,t)}),e.onUnmounted(()=>{L(),A&&A(),Be&&Be.remove(),Pe&&Pe.remove()}),t.expose({modalElementRef:b,updateModalOptions:Fn,close:R,maxDialog:le});function Ln(){return e.createVNode("ul",null,[T.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),y.value&&e.createVNode("li",{onClick:le,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:_.value},null)]),C.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:I=>R(I,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Hn(){return e.createVNode("div",{class:"modal-footer",style:ne.value},[N.value&&N.value.map(I=>e.createVNode("button",{name:I.name,type:"button",class:I.class+(I.iconClass?" btn-icontext":""),onClick:q=>{Rn(I,q)}},[!!I.iconClass&&e.createVNode("i",{class:I.iconClass},null),I.text]))])}function zn(){return e.createVNode("div",{ref:x,class:"modal-header",style:W.value},[e.createVNode("div",{class:"modal-title"},[B.value&&e.createVNode("span",{class:i.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[d.value])]),e.createVNode("div",{class:"actions"},[Ln()])])}function Wn(I){I.stopPropagation()}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>[X.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>{var I,q;return[e.createVNode("div",{class:J.value,style:"display: block",ref:$,onClick:Wn},[e.createVNode("div",{id:r.value,class:ae.value,style:K.value,ref:b},[e.createVNode("div",{class:ee.value},[m.value&&zn(),e.createVNode("div",{class:H.value},[(q=(I=t.slots).default)==null?void 0:q.call(I),S.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:g.value},null)]),k.value&&Hn()]),!p.value&&w.value&&b.value&&c(b.value)])])]}})]})}});function Ge(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function zt(n){const t=document.createElement("div");t.style.display="contents";const o=e.createApp({setup(a,s){e.onUnmounted(()=>{document.body.removeChild(t)});const r=e.ref(),l=e.ref(n.class||""),p=e.ref(!!n.showButtons),m=e.ref(!!n.showHeader),i=e.ref(n.showCloseButton==null?!0:n.showCloseButton),C=e.ref(!0),y=e.ref(n.title||""),T=n.acceptCallback||(()=>{}),S=n.rejectCallback||(()=>{}),g=n.closedCallback||(w=>{}),f=n.resizeHandle||(w=>{}),h=Ge(n),d=w=>{C.value=!1,o.unmount(),g(w)};return e.onMounted(()=>{}),s.expose({modalRef:r}),()=>e.createVNode(Ue,{ref:r,class:l.value,modelValue:C.value,"onUpdate:modelValue":w=>C.value=w,title:y.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":m.value,"show-buttons":p.value,"show-close-button":i.value,"show-max-button":!1,onAccept:T,onCancel:S,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:d,onResize:f},{default:()=>[h&&h(o)]})}});return document.body.appendChild(t),o.mount(t),o}class Wt{constructor(t){F(this,"appContext",null);F(this,"modalRef",e.ref());F(this,"activeModalIndex",e.ref(0));F(this,"modalRefs",{});F(this,"isUseEscCloseModal",e.ref(!1));F(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return zt(o)}open(t){const o=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const a=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),s=e.ref(!0),r=a.value.acceptCallback||(()=>{}),l=a.value.rejectCallback||(()=>{}),p=a.value.closedCallback||((d,w)=>{}),m=a.value.resizeHandle||(d=>{});let i;const C=Ge(a.value),y=d=>{var M;s.value=!1;const w=(M=d==null?void 0:d.target)==null?void 0:M.classList.contains("modal_close");p(d,this.isUseEscCloseModal.value?"esc":w?"icon":"button")},T=d=>{y(d),i&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,o),i=null,this.modalRef.value=null,this.modalRefs){const w=Object.keys(this.modalRefs);w.length>0?this.activeModalIndex.value=Math.max(...w):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},S=d=>{var w;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((w=this.activeModalInstance.value)==null||w.close(d==null?void 0:d.event))},g=()=>e.createVNode(Ue,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":d=>s.value=d},a.value,{onAccept:r,onCancel:l,onClosed:T,onResize:m,onEsc:S}),{default:()=>[C&&C()]});return i=(d=>{const w=e.h(g,d);return w.appContext=this.appContext,e.render(w,o),w})({...a.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:d=>{a.value={...a.value,...d},i&&e.render(e.cloneVNode(i,{...a}),o)},destroy:T,modalRef:this.activeModalInstance}}}class Q{static show(t){let o=new Wt;const a=e.reactive({...t}),s=!1,r=a.type==="error"||a.type==="prompt",l=a.type==="error"?"错误提示":a.type==="prompt"&&a.title||"",p=a.acceptCallback||(()=>{}),m=a.rejectCallback||(()=>{});let i=null;const C=()=>{i&&(i==null||i.destroy(),o=null)};i=o==null?void 0:o.open({class:"modal-message modal-message-type-info",title:l,showButtons:s,showHeader:r,width:a.width||400,fitContent:!0,showMaxButton:!1,render:()=>e.createVNode(fe,e.mergeProps(a,{onAccept:p,onReject:m,onClose:C}),null)})}static info(t,o){const a=e.reactive({type:"info",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Q.show(a)}static warning(t,o){const a=e.reactive({type:"warning",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Q.show(a)}static success(t,o){const a=e.reactive({type:"success",title:t,detail:o,okButtonText:"关闭",cancelButtonText:""});Q.show(a)}static error(t,o,a){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:a,message:t,detail:o}});Q.show(s)}static prompt(t,o){const a=e.reactive({type:"prompt",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消"});Q.show(a)}static question(t,o,a,s){const r=e.reactive({type:"question",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:a,rejectCallback:s});Q.show(r)}}fe.install=n=>{n.component(fe.name,fe),n.provide("FMessageBoxService",Q)};function qt(n,t,o,a,s,r){const{activeId:l,removeTab:p,selectTab:m,removeDesignTab:i,selectDesignTab:C}=s,y=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":n.autoTitleWidth})),T=e.computed(()=>{const k={"farris-component":!0,"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===l.value,"f-state-disable":t.disabled};return k[`${t.id}-design-item`]=!0,k}),S=e.computed(()=>({width:`${t.tabWidth}px`})),g=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===l.value,disabled:t.disabled}));function f(k){return e.createVNode("span",{class:y.value,title:k.title},[k.title])}function h(k){return k.slots.title?k.slots.title:f}const d=h(o),w=e.ref(t.removeable);function M(){return e.createVNode("span",{class:"st-drop-close",onClick:k=>p(k,t.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function $(k){m(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}function R(k){C(k,t.id,r.value)}function j(k){Q.question(`确定删除标签页【${o.props.title}】?`,"",()=>i(k,t.id),()=>{})}function N(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:k=>j(k)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function B(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[N()])])}return e.createVNode("li",{onClick:k=>R(k),class:T.value,style:S.value,id:`${t.id}-design-item`},[B(),e.createVNode("a",{class:g.value,onClick:$},[d(t),w.value&&M()])])}function _t(n,t,o,a,s,r,l){const{shouldShowNavigationButtons:p}=o,{tabPages:m}=s,i=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":p.value})),C=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),y=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"})),T=e.computed(()=>({overflow:"auto"}));function S(f){const{componentType:h}=f;let d=Y(h,f);l&&l.onResolveNewComponentSchema&&(d=l.onResolveNewComponentSchema(f,d));const w=h.toLowerCase().replace("-","_");return d&&!d.id&&d.type===h&&(d.id=`${w}_${Math.random().toString().slice(2,6)}`),d}const g=function(f){var M;const h={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},d=S(h);(M=r.value.schema.contents)==null||M.push(d);const{selectTabByTabId:w}=s;w(d.id)};return()=>e.createVNode("div",{class:i.value,style:C.value},[e.createVNode("ul",{class:y.value,style:T.value,ref:t},[m.value.map(f=>qt(n,f.props,f,a,s,r)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:f=>g()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function Xe(n,t,o){var R;function a(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}a();const s=o&&o.getStyles&&o.getStyles()||"",r=o&&o.getDesignerClass&&o.getDesignerClass()||"",l=e.ref();function p(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function m(){return!1}function i(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function C(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function y(j){if(!j||!j.value)return null;if(j.value.schema&&j.value.schema.type==="component")return j.value;const N=e.ref(j==null?void 0:j.value.parent),B=y(N);return B||null}function T(j=t){const{componentInstance:N,designerItemElementRef:B}=j;return!N||!N.value?null:N.value.canMove?B:T(j.parent)}function S(j){return!!o&&o.canAccepts(j)}function g(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function f(){}function h(j,N){N&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(N)}function d(j,N){const{componentType:B}=j;let k=Y(B,j,N);o&&o.onResolveNewComponentSchema&&(k=o.onResolveNewComponentSchema(j,k));const x=B.toLowerCase().replace("-","_");return k&&!k.id&&k.type===B&&(k.id=`${x}_${Math.random().toString().slice(2,6)}`),k}function w(j,N){const B=String(j.getAttribute("data-controltype")),k=j.getAttribute("data-feature"),x=k?JSON.parse(k):{};x.parentComponentInstance=l.value;let b=Y(B,x);o&&o.onAcceptNewChildElement&&(b=o.onAcceptNewChildElement(j,N,b));const u=B.toLowerCase().replace("-","_");return b&&!b.id&&b.type===B&&(b.id=`${u}_${Math.random().toString().slice(2,6)}`),b}function M(j){}function $(...j){if(o&&o.getPropsConfig)return o.getPropsConfig(...j)}return l.value={canMove:p(),canSelectParent:m(),canDelete:i(),canNested:!C(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(R=t==null?void 0:t.parent)==null?void 0:R.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:r,canAccepts:S,getBelongedComponentInstance:y,getDraggableDesignItemElement:T,getDraggingDisplayText:g,getPropConfig:$,getDragScopeElement:f,onAcceptMovedChildElement:h,onAcceptNewChildElement:w,onChildElementMovedOut:M,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},l}const Ut={$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"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{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}}}}}}}},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"}}},Se=new Map;function Ne(){function n(g,f,h,d){var w;if(typeof h=="number")return((w=d[g])==null?void 0:w.length)===h;if(typeof h=="object"){const M=Object.keys(h)[0],$=h[M];if(M==="not")return Number(d[g].length)!==Number($);if(M==="moreThan")return Number(d[g].length)>=Number($);if(M==="lessThan")return Number(d[g].length)<=Number($)}return!1}function t(g,f,h,d){return typeof h=="boolean"?d.childrenClassList.includes(f)===!!h:!1}function o(g,f,h,d){return typeof h=="boolean"?d.parentClassList.includes(f)===!!h:!1}function a(g,f,h,d){return typeof h=="boolean"?d.parentClassList.includes(f)===!!h:!1}const s=new Map([["length",n],["hasChildren",t],["hasSibling",a],["hasParent",o]]);function r(g,f){const h=g;return typeof f=="number"?[{target:h,operator:"length",param:null,value:Number(f)}]:typeof f=="object"?Object.keys(f).map(d=>{if(d==="length")return{target:h,operator:"length",param:null,value:f[d]};const w=d,M=f[d];return{target:h,operator:g==="children"?"hasChildren":g==="parent"?"hasParent":"hasSibling",param:w,value:M}}):[]}function l(g,f){if(s.has(g.operator)){const h=s.get(g.operator);return h&&h(g.target,g.param,g.value,f)||!1}return!1}function p(g,f){return Object.keys(g).reduce((M,$)=>{const R=r($,g[$]);return M.push(...R),M},[]).reduce((M,$)=>M&&l($,f),!0)}function m(g,f){const h=Object.keys(g),d=h.includes("allOf"),w=h.includes("anyOf"),M=d||w,j=(M?g[M?d?"allOf":"anyOf":"allOf"]:[g]).map(B=>p(B,f));return d?!j.includes(!1):j.includes(!0)}function i(g,f){const h=g.const;return h?typeof h=="boolean"?h:typeof h=="object"?m(h,f):!1:!1}function C(g){return f=>{const h={canAccept:!0,fixed:!1,hidePadding:!1};return g&&g.properties&&Object.keys(g.properties).reduce((d,w)=>{const M=g.properties[w];return d[w]=i(M,f),d},h),h}}function y(g,f,h){if(f.type==="object"&&f.properties){const{rules:d,contents:w}=f.properties;h.set(g,C(d)),w&&Object.keys(w.properties).forEach(M=>y(M,w.properties[M],h))}}function T(){const{properties:g}=Ut;Object.keys(g).forEach(f=>{y(f,g[f],Se)})}function S(g,f){const h={canAccept:!0,fixed:!1,hidePadding:!0};return Se.has(g)?Se.get(g)(f):h}return T(),{getRuleValue:S}}const Gt={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"}},setPropertyRelates(n,t){if(n)switch(n&&n.propertyID){case"title":{n.needRefreshControlTree=!0;break}}}},appearance:{description:"",title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},width:{description:"组件的宽度",title:"宽度(px)",type:"number"},height:{description:"组件的高度",title:"高度(px)",type:"number"}}},behavior:{description:"",title:"行为",properties:{removeable:{description:"是否可移除",type:"boolean",title:"是否可移除"}}}}},Xt={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:"combo-list",textField:"value",valueField:"key",data:[{key:"tabs",value:"标签页"}]}}}},appearance:{description:"",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:"boolean",title:"标题自适应宽度",defaultValue:!1},fill:{description:"flex布局下,填充满剩余部分",type:"boolean",title:"填充"}}}}};function Yt(n,t){const o=Ne();let a=!1,s,r=!1;function l(T){return!1}function p(){return!r}function m(){return!r}function i(){return a}function C(){const T=n,S=T.appearance&&T.appearance.class||"",g=S?S.split(" "):[],f=t==null?void 0:t.schema,h=f&&f.appearance&&f.appearance.class||"",d=h?h.split(" "):[],w=T.contents||[],M=w.length?w[0]:null,$=M&&M.appearance&&M.appearance.class||"",R=$?$.split(" "):[],j=w.length?w.reduce((u,c)=>{const v=c&&c.appearance?c.appearance.class:"",P=v?v.split(" "):[];return u.push(...P),u},[]):[],N=(t==null?void 0:t.parent)&&t.parent.schema,B=N&&N.appearance&&N.appearance.class||"";B&&B.split(" "),s={componentClass:S,componentClassList:g,childContents:w,firstChildContent:M,firstChildClass:$,firstChildClassList:R,parent,parentClass:h,parentClassList:d,children:w,childrenClassList:j};const{canAccept:k,fixed:x,hidePadding:b}=o.getRuleValue(g[0],s);return a=b,r=x,!0}function y(T){var g;return((g=document.querySelector(".dgComponentFocused"))==null?void 0:g.id)===`${n.id}-design-item`?Xt:Gt}return{canAccepts:l,checkCanDeleteComponent:p,checkCanMoveComponent:m,getPropsConfig:y,hideNestedPaddingInDesginerView:i,resolveComponentContext:C}}const me=e.ref(0);function Jt(n,t){const o=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=a.top>=o.top,r=a.top<=o.bottom;return s&&r}function Zt(n){if(!n)return;let t;if(n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),!t)return;const o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;const a=t.querySelector(".component-btn-group");if(a){if(!Jt(t,n)){a.style.display="none";return}a.style.display="";const r=a.getBoundingClientRect(),l=a.querySelector("div");if(l){const p=l.getBoundingClientRect();l.style.top=r.top+"px",l.style.left=r.left-p.width+"px"}}}function Qt(n,t,o,a){const s=e.ref([]),r=e.ref(n.activeId||""),l=e.ref(!0),p=e.ref(),m=e.ref([]);function i(c){const v=c.value.findIndex(P=>P.props.show!==!1&&!r.value&&!P.props.disabled);!r.value&&v!==-1&&(r.value=c.value[v].props.id)}function C(c,v){c.classList.contains(v)||c.classList.add(v)}function y(c,v){c.classList.remove(v)}function T(c){const{parentElement:v}=c;v&&(c.scrollWidth>v.offsetWidth?C(c,"farris-title-text-custom"):y(c,"farris-title-text-custom"))}function S(c){var P;if(n.autoTitleWidth)return;const v=(P=c.value)==null?void 0:P.querySelectorAll(".st-tab-text");v&&v.forEach(D=>T(D))}const g=c=>{c.preventDefault(),c.stopPropagation()};function f(c){s.value=s.value.filter(v=>v.props.id!==c),r.value===c&&(r.value="",i(s))}function h(c,v,P=!1){const D=s.value.findIndex(V=>V.props.id===v);f(v),g(c),e.nextTick(()=>{S(o),P&&(l.value=!0),t.emit("tabRemove",{removeIndex:D,removeId:v,activeId:r.value})})}function d(){const c=s.value.find(D=>D.props.id===r.value);if(m.value=[],c&&c.props.toolbar){const D=c.props.toolbar.hasOwnProperty("contents")?"contents":"buttons";c.props.toolbar[D]&&c.props.toolbar[D].length&&(m.value=[...c.props.toolbar[D]])}const v=a.schema.contents,P=v==null?void 0:v.find(D=>D.id===r.value);p.value=P==null?void 0:P.toolbar}function w(c){const v=r.value;r.value=c,d(),t.emit("tabChange",{prevId:v,nextId:r.value})}function M(c){w(c)}function $(c){s.value.findIndex(P=>P.props.id===c.props.id)===-1&&s.value.push(c)}function R(c){s.value.findIndex(P=>P.props.id===c.props.id)!==-1&&(s.value.forEach(P=>{P.props.id===c.props.id&&(P=c)}),e.nextTick(()=>{S(o)}))}function j(c){c&&(c.stopPropagation(),c.preventDefault())}function N(c,v){j(c);const P=a.schema.contents,D=P==null?void 0:P.findIndex(V=>V.id===v);D===-1||D===void 0||(P==null||P.splice(D,1),f(v),me.value++)}function B(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(v=>v.classList.remove("dgComponentFocused"));const c=document.getElementsByClassName("dgComponentSelected");Array.from(c).forEach(v=>v.classList.remove("dgComponentSelected"))}function k(c){c.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function x(c,v){var E;const{contents:P=[]}=a.schema,D=P==null?void 0:P.findIndex(A=>A.id===c),V=P[D];(E=a==null?void 0:a.setupContext)==null||E.emit("selectionChange",V.type,V,n.componentId,v)}function b(c,v,P){B(),j(c),k(c),x(v,P)}function u(c,v){B(),j(c),k(c)}return{activeId:r,addTab:$,changeTitleStyle:S,removeTab:h,selectTab:M,selectTabByTabId:w,tabPages:s,updateTab:R,toolbarItems:m,removeDesignTab:N,selectDesignTab:b,selectDesignTabToolbar:u,toolbarSchema:p}}const Kt=new Map([["buttons","items"],["appearance",ce]]),en=new Map([["appearance",tn]]);function tn(n,t){return{class:t.class,style:t.style}}function Ye(n,t,o){return t}const nn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar.schema.json",title:"response-toolbar",description:"A Farris Toolbar Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},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"]},je={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar-item.schema.json",title:"response-toolbar-item",description:"A Farris Toolbar Item Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string",default:"btn-primary"},style:{type:"string"}},default:{}},alignment:{description:"对齐",type:"string",default:"right"},text:{description:"文本",type:"string",default:"新增"},icon:{description:"图标",type:"string",default:""},onClick:{description:"点击事件",type:"string",default:""}},required:["id","type","text"]},Je={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:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}},Ze={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};ye[je.title]=je,De[Je.title]=Je;const on=Object.assign({},Ze,{componentId:{type:String,default:""}});se(Ze,nn,Kt,Ye);const Qe={id:{type:String,default:""},items:{type:Object,default:{}},class:{type:String,default:""},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},componentId:{type:String,default:""},alignment:{Type:String,default:"right"}};se(Qe,je,en,Ye);class Ke{constructor(t){F(this,"id","");F(this,"class","btn-secondary");F(this,"icon","");F(this,"groupId","");F(this,"order",-1);F(this,"asDropDownTop",!1);F(this,"text","");F(this,"visible",!0);F(this,"responsed",!1);F(this,"tipsEnable",!1);F(this,"tipsText","");F(this,"width",0);F(this,"onClick",()=>{});F(this,"options");this.options=t;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(t).filter(a=>o.indexOf(a)>-1).forEach(a=>{this[a]=t[a]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:e.computed(()=>!0)}setWidth(t){this.width=parseInt(t,10)}getWidth(){return this.visible?this.width:!1}}class an extends Ke{constructor(t){super(t)}}function sn(){function n(t){const o=[];return t.reduce((a,s)=>(s.children&&s.children.length>0?a.push(new he(s)):a.push(new an(s)),a),o),o}return{buildResponseToolbarItems:n}}const{buildResponseToolbarItems:rn}=sn();class he extends Ke{constructor(o){super(o);F(this,"placement","");F(this,"dropdownClass","");F(this,"menuClass","");F(this,"split",!1);F(this,"children",[]);F(this,"expanded",!1);const a=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(s=>a.indexOf(s)>-1).forEach(s=>{this[s]=o[s]}),o.children&&o.children.length&&(this.children=rn(o.children))}}function ln(){function n(o){const a={"f-icon":!0};if(o.icon){const s=o.icon.trim().split(" ");s&&s.length&&s.reduce((r,l)=>(r[l]=!0,r),a)}return a}function t(o){return!!(o.icon&&o.icon.trim())}return{iconClass:n,shouldShowIcon:t}}function cn(n,t){const o=e.inject("design-item-context"),a=e.inject("toolbar-item-handler",()=>{});function s(){a&&a()}function r(b){const u={"dropdown-menu":!0};if(b.class){const c=b.menuClass.split(" ");c&&c.length&&c.reduce((v,P)=>(v[P]=!0,v),u)}return u}function l(b){const u={disabled:!b.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},c=b.dropdownClass.split(" ");return c&&c.length&&c.reduce((v,P)=>(v[P]=!0,v),u),u}function p(b){const u={disabled:!b.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},c=b.class.split(" ");return c&&c.length&&c.reduce((v,P)=>(v[P]=!0,v),u),u}let m;const i=new Map;function C(b,u,c){var P;((P=b.target)==null?void 0:P.id)===u.id&&b.stopPropagation();const v=c?c.id:"__top_item__";if(u.children&&u.children.length&&(u.expanded=!u.expanded,u.expanded?i.set(v,u):i.delete(v)),i.has(v)&&i.get(v)!==u){const D=i.get(v);D&&(D.expanded=!1)}}function y(b){b&&(b.stopPropagation(),b.preventDefault())}function T(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(u=>u.classList.remove("dgComponentFocused"));const b=document.getElementsByClassName("dgComponentSelected");Array.from(b).forEach(u=>u.classList.remove("dgComponentSelected"))}function S(b){b.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function g(b){const{buttons:u=[]}=o.schema;let c=[];u.forEach(D=>{c=c.concat(D.children||[])});const v=c.findIndex(D=>D.id===b),P=v===-1?null:c[v];return{index:v,item:P}}function f(b){const{buttons:u=[]}=o.schema,c=u.findIndex(P=>P.id===b),v=c===-1?null:u[c];return{index:c,item:v}}function h(b){var v;o.schema;const{index:u,item:c}=g(b);(v=o==null?void 0:o.setupContext)==null||v.emit("selectionChange",c==null?void 0:c.type,c)}const d=function(b){const{componentType:u}=b,c=Y(u,b),v=u.toLowerCase().replace("-","_");return c&&!c.id&&c.type===u&&(c.id=`${v}_${Math.random().toString().slice(2,6)}`),c},w=function(){const b={componentType:"response-toolbar-item",parentComponentInstance:t.value,targetPosition:-1};return d(b)};function M(b,u){y(b),T(),S(b),h(u.id)}function $(b,u,c){y(b);const v=u.id,P=c&&c.id,{buttons:D=[]}=o.schema;if(!P)return;const{index:V}=f(P);if(V===-1)return;const{index:E}=g(v);E!==-1&&(D[V].children.splice(E,1),s())}function R(b,u,c){y(b);const v=c&&c.id,{buttons:P=[]}=o.schema;if(!v)return;const{index:D}=f(v);if(D===-1)return;const V=w(),E=Object.assign({},V,{text:u.text});P[D].children.push(E),s()}function j(b,u,c){y(b);const v=c&&c.id,{buttons:P=[]}=o.schema;if(!v)return;const{index:D}=f(v);if(D===-1)return;const V=w(),E=Object.assign({},V,{text:"按钮"});P[D].children.push(E),s()}function N(b,u){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:c=>$(c,b,u)},[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:c=>R(c,b,u)},[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:c=>j(c,b,u)},[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 B(b){return b.children.map(u=>u.children&&u.children.length?e.createVNode("li",{class:l(u),id:u.id,onClick:c=>u.enable&&C(c,u,b)},[e.createVNode("span",{id:u.id,class:p(u),onMouseover:c=>u.enable&&C(c,u,b)},[u.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),m(u,u)]):e.createVNode("li",{class:p(u),id:u.id,onClick:c=>M(c,u)},[N(u,b),n.shouldShowIcon(u)&&e.createVNode("i",{class:n.iconClass(u)},null),u.text]))}function k(b,u,c){const v={display:b.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},P=document.getElementsByTagName("body")[0].getClientRects()[0].width,D=u,V=D==null?void 0:D.getClientRects();if(D&&V&&V.length){const{top:E,width:A,left:O,right:L,height:X}=V[0],J=Math.ceil(X+E);v.top=`${J}px`,v.left=`${O}px`;const ae=b.id+"_menu",K=u?u.querySelector("#"+ae):null;if(K){v.display==="block"&&(K.style.display="block");const ee=K.getBoundingClientRect();if(c){v.top=`${E-6}px`;const W=Math.ceil(A+O);v.left=`${W}px`}P-O-A<ee.width&&(v.left=`${(c?O:L)-ee.width}px`)}}return v}m=function(b,u){var D,V;const c=e.getCurrentInstance(),v=u?u.id:b.id,P=(V=(D=c==null?void 0:c.exposed)==null?void 0:D.elementRef.value)==null?void 0:V.querySelector("#"+v);return e.createVNode("ul",{class:r(b),style:k(b,P,u),id:b.id+"_menu"},[B(b)])};function x(){i.forEach(b=>{b.expanded=!1}),i.clear()}return{renderDropdownMenu:m,clearAllDropDownMenu:x}}function dn(n,t,o){const a=e.ref(n.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:r}=cn(t,o),l=e.inject("design-item-context"),p=e.inject("toolbar-item-handler",()=>{});function m(){p&&p()}function i(x){const b={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":a.value==="right","f-btn-mr":a.value==="left"},u=x.dropdownClass.split(" ");return u&&u.length&&u.reduce((c,v)=>(c[v]=!0,c),b),b}function C(x){const b={btn:!0,disabled:!x.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(x.icon&&x.icon.trim())};if(x.class){const u=x.class.split(" ");u&&u.length&&u.reduce((c,v)=>(c[v]=!0,c),b)}return b}function y(x){x&&(x.stopPropagation(),x.preventDefault())}function T(x,b){y(x);const u=b.expanded;document.body.click(),b.expanded=!u}const S=function(x){const{componentType:b}=x,u=Y(b,x),c=b.toLowerCase().replace("-","_");return u&&!u.id&&u.type===b&&(u.id=`${c}_${Math.random().toString().slice(2,6)}`),u},g=function(){const x={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return S(x)};function f(x){const b=l.schema.buttons||l.schema.contents,u=b==null?void 0:b.findIndex(v=>v.id===x),c=u===-1?null:b[u];return{index:u,toolbarItem:c}}function h(x,b){var V;const{index:u,toolbarItem:c}=f(b);if(u===-1)return;const v=c.text||"按钮",P=g(),D=Object.assign({},P,{text:v});(V=l.schema.buttons)==null||V.push(D),m()}function d(x,b){const{index:u,toolbarItem:c}=f(b);if(u===-1)return;const v=c.text||"按钮",P=g(),D=Object.assign({},P,{text:v}),V=l.schema.buttons[u].children||[];V.push(D),l.schema.buttons[u].children=V,m()}function w(x,b){const u=l.schema.buttons||l.schema.contents,c=u==null?void 0:u.findIndex(v=>v.id===b);c!==-1&&(u.splice(c,1),m())}function M(x){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:b=>w(b,x)},[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:b=>h(b,x)},[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:b=>d(b,x)},[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 $(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(b=>b.classList.remove("dgComponentFocused"));const x=document.getElementsByClassName("dgComponentSelected");Array.from(x).forEach(b=>b.classList.remove("dgComponentSelected"))}function R(x){x.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function j(x){var v;const b=l.schema.buttons||l.schema.contents,u=b==null?void 0:b.findIndex(P=>P.id===x);if(u===-1)return;const c=b[u];(v=l==null?void 0:l.setupContext)==null||v.emit("selectionChange","response-toolbar-item",c)}function N(x,b){y(x),$(),R(x),y(x),T(x,b),j(b.id)}function B(x){return e.createVNode("div",{id:x.id,class:i(x)},[e.createVNode("div",{class:C(x),style:"display: flex;padding-right: 0.1rem;",onClick:b=>x.enable&&N(b,x)},[M(x.id),t.shouldShowIcon(x)&&e.createVNode("i",{class:t.iconClass(x)},null),e.createVNode("span",null,[x.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(x)])}function k(){r()}return{renderToolbarDropdown:B,clearAllDropDown:k}}function et(){function n(t){var s,r;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const a=(r=o.schema.appearance)==null?void 0:r.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const l=o.schema.type,p=(l==="response-form"||l==="content-container")&&a&&a.includes("farris-form");if(o.schema.type!=="response-layout-item"&&!p)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}class Me{constructor(t,o){F(this,"componentId");F(this,"viewModelId");F(this,"eventsEditorUtils");F(this,"formSchemaUtils");F(this,"formMetadataConverter");F(this,"designViewModelUtils");F(this,"designViewModelField");F(this,"controlCreatorUtils");F(this,"designerHostService");F(this,"schemaService",null);F(this,"metadataService",null);F(this,"propertyConfig",{type:"object",categories:{}});var a;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((a=this.formSchemaUtils)==null?void 0:a.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService,this.schemaService=o.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const a=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=a.fields.find(s=>s.id===o)}t.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(t,o){}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:t.type,name:re[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,o){const a=o&&o.parent&&o.parent.schema;if(!a)return;const s=a.contents.findIndex(l=>l.id===t),r=Z.cloneDeep(a.contents[s]);a.contents.splice(s,1),a.contents.splice(s,0,r)}}class un extends Me{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getBehaviorProperties(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.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",textField:"value",valueField:"key",data:[{key:"response-toolbar",value:re["response-toolbar"].name}]}}}}}getBehaviorProperties(t){this.propertyConfig.categories.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",refreshPanelAfterChanged:!0}}}}}function pn(n,t,o,a){const s=Ne(),r=e.ref(!1),l=e.ref(!1);let p=!0,m=!1,i;function C(j){return i&&i.componentClassList&&i.componentClassList.includes("f-form-layout")&&i.componentClassList.includes("farris-form")?j.sourceType==="control"&&j.controlCategory==="input"||j.sourceType==="move"&&j.controlType==="form-group":!0}function y(j){return!et().basalDragulaRuleForContainer(j)||!p||!C(j),!1}function T(){r.value=!1,l.value=!1;const j=n,N=j.appearance&&j.appearance.class||"",B=N.split(" "),k=j.buttons||[],x=k.length?k[0]:null,b=x&&x.appearance?x.appearance.class:"",u=b?b.split(" "):[],c=k.length?k.reduce((O,L)=>{const X=L&&L.appearance?L.appearance.class:"",J=X?X.split(" "):[];return O.push(...J),O},[]):[],v=o==null?void 0:o.schema,P=v&&v.appearance&&v.appearance.class||"",D=P?P.split(" "):[];i={componentClass:N,componentClassList:B,childContents:k,firstChildContent:x,firstChildClass:b,firstChildClassList:u,parent:v,parentClass:P,parentClassList:D,children:k,childrenClassList:c};const{canAccept:V,fixed:E,hidePadding:A}=s.getRuleValue(B[0],i);return p=V,m=A,!0}function S(j){}function g(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function f(j,N){return N.text=j.label,N}function h(j,N,B){const k=n;if((k.appearance&&k.appearance.class||"").split(" ").includes("f-form-layout")){const u=String(j.innerText),c=Y("form-group");return c.editor=B,c.label=u,c}return B}function d(){return!1}function w(){return!1}function M(){return!0}function $(){return m}function R(j){return new un(j,t).getPropertyConfig(n)}return{canAccepts:y,checkCanAddComponent:M,checkCanDeleteComponent:w,checkCanMoveComponent:d,getStyles:g,hideNestedPaddingInDesginerView:$,onAcceptNewChildElement:h,onAcceptMovedChildElement:S,onResolveNewComponentSchema:f,resolveComponentContext:T,getPropsConfig:R,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:l}}const fn={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function mn(n,t,o){var R;function a(){}const s="",r=e.ref();function l(){return!0}function p(){return!1}function m(){return!0}function i(){return!0}function C(){return!0}function y(j){if(!j||!j.value)return null;const N=e.ref(j==null?void 0:j.value.parent),B=y(N);return B||null}function T(j=t){const{componentInstance:N,designerItemElementRef:B}=j;return!N||!N.value?null:N.value.canMove||N.value.canAdd||N.value.canDelete?B:T(j.parent)}function S(j){return!!o}function g(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function f(){}function h(j,N){}function d(j){const{componentType:N}=j;let B=Y(N,j);const k=N.toLowerCase().replace("-","_");return B&&!B.id&&B.type===N&&(B.id=`${k}_${Math.random().toString().slice(2,6)}`),B}function w(j,N){const B=String(j.getAttribute("data-controltype")),k=j.getAttribute("data-feature"),x=k?JSON.parse(k):{};x.parentComponentInstance=r.value;let b=Y(B,x);const u=B.toLowerCase().replace("-","_");return b&&!b.id&&b.type===B&&(b.id=`${u}_${Math.random().toString().slice(2,6)}`),b}function M(j){}function $(...j){return[]}return r.value={canMove:l(),canSelectParent:p(),canAdd:i(),canDelete:m(),canNested:!C(),contents:[],elementRef:n,parent:(R=t.parent)==null?void 0:R.componentInstance,schema:t.schema,styles:s,canAccepts:S,getBelongedComponentInstance:y,getDraggableDesignItemElement:T,getDraggingDisplayText:g,getPropConfig:$,getDragScopeElement:f,onAcceptMovedChildElement:h,onAcceptNewChildElement:w,onChildElementMovedOut:M,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const tt=e.defineComponent({name:"FDesignerInnerItem",props:fn,emits:["selectionChange","addComponent","removeComponent"],setup(n,t){const o=e.ref(n.canMove),a=e.ref(n.canAdd),s=e.ref(n.canDelete),r=e.ref(!1),l=e.ref(n.contentKey),p=e.ref(n.childType),m=e.ref(n.childLabel),i=e.ref(n.modelValue),C=e.ref(""),y=e.ref(),T=e.inject("canvas-dragula"),S=e.ref(),g=e.inject("design-item-context"),f={designerItemElementRef:y,componentInstance:S,schema:i.value,parent:g,setupContext:t};e.provide("design-item-context",f);const h=e.computed(()=>({"farris-component":!0,"flex-fill":n.id=="root-component","position-relative":o.value||s.value,"farris-nested":r.value,"can-move":o.value,"d-none":y.value&&y.value.classList.contains("d-none")})),d=e.computed(()=>{const u={};return C.value&&C.value.split(";").reduce((c,v)=>{const[P,D]=v.split(":");return P&&(c[P]=D),c},u),u});function w(u,c){if(g&&g.schema[l.value]){const v=g.schema[l.value].findIndex(P=>P.id===c.id);if(v>-1){const P=g.schema[l.value].length,D=g.schema[l.value][v%P];g.designerItemElementRef.value.querySelector(`#${D.id}-design-item`),g.schema[l.value].splice(v,1),g.componentInstance.value.updateDragAndDropRules(),me.value++,t.emit("removeComponent")}}}function M(u){if(S.value.addNewChildComponentSchema){const c={componentType:p.value,label:m.value,parentComponentInstance:S.value,targetPosition:-1},v=S.value.addNewChildComponentSchema(c);i.value[l.value].push(v),t.emit("addComponent")}}function $(){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:u=>{M()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function R(u){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(c=>w(c,u),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function j(){return o.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function N(u){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[$(),j(),R(u)])])}e.watch(()=>n.modelValue,u=>{i.value=u,f.schema=u});function B(u){const c=u.target;Zt(c)}function k(){var u,c;(c=(u=i.value)==null?void 0:u.contents)!=null&&c.length&&y.value&&y.value.addEventListener("scroll",B)}function x(){const u=y.value,c=e.ref(u.children[1]);return mn(c,f).value}e.onMounted(()=>{if(y.value){const u=y.value.querySelector(`[data-dragref='${i.value.id}-container']`);S.value=u&&u.componentInstance?u.componentInstance.value:x(),T&&u&&T.attachComponents(u,i.value),r.value=S.value.canNested!==void 0?S.value.canNested:r.value,a.value=S.value.canAdd!==void 0?S.value.canAdd:a.value,s.value=S.value.canDelete!==void 0?S.value.canDelete:s.value,o.value=S.value.canMove!==void 0?S.value.canMove:o.value,C.value=S.value.styles||"",y.value&&(y.value.componentInstance=S,y.value.designItemContext=f)}k(),me.value++}),e.onBeforeUnmount(()=>{y.value&&y.value.removeEventListener("scroll",B)});function b(u){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(v=>v.classList.remove("dgComponentFocused")),u&&(u.preventDefault(),u.stopPropagation());const c=y.value;if(c){const v=document.getElementsByClassName("dgComponentSelected");if(!(v&&v.length===1&&v[0]===y.value)){Array.from(v).forEach(V=>V.classList.remove("dgComponentSelected")),c.classList.add("dgComponentFocused"),t.emit("selectionChange",i.value.type,i.value,n.componentId,S.value);const D=S.value.getDraggableDesignItemElement(f);D&&D.value&&D.value.classList.add("dgComponentSelected")}}me.value++}return()=>e.createVNode("div",{id:`${n.id}-design-item`,ref:y,class:h.value,style:d.value,onClick:b},[N(i.value),t.slots.default&&t.slots.default()])}});class hn extends Me{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识00",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0,$converter:"/converter/type.converter"},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"}},setPropertyRelates(o,a){}}}getEventPropConfig(t){const o=[{label:"onClick",name:"点击事件"}];var a=this;const s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,p){const m=l.propertyValue;delete t[a.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,m.events,m))}}}}class bn extends Me{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(){this.propertyConfig.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",textField:"value",valueField:"key",data:[{key:"response-toolbar-item",value:re["response-toolbar-item"].name}]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"样式",description:"Appearance",properties:{class:{title:"class",type:"string",description:""},style:{title:"style",type:"string",description:""}}}}getEventPropConfig(t){const o=[{label:"onClick",name:"点击事件"}],a=this,s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(l,p){const m=l.propertyValue;delete t[a.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,m.events,m))}}}}function gn(n,t){Ne();const o=e.ref(!1),a=e.ref(!1);let s=!1,r=!1;function l(h){return!1}function p(h){}function m(){return""}function i(h,d){return d.text=h.label,d}function C(h,d,w){const M=n.schema;if((M.appearance&&M.appearance.class||"").split(" ").includes("f-form-layout")){const j=String(h.innerText),N=Y("form-group");return N.editor=w,N.label=j,N}return w}function y(){return!1}function T(){return!r}function S(){return!1}function g(){return s}function f(h){let d;switch(n.schema.type){case"tab-toolbar-item":d=new hn(h,t);break;default:d=new bn(h,t)}return d.getPropertyConfig(n.schema)}return{canAccepts:l,checkCanAddComponent:S,checkCanDeleteComponent:T,checkCanMoveComponent:y,getStyles:m,hideNestedPaddingInDesginerView:g,onAcceptNewChildElement:C,onAcceptMovedChildElement:p,onResolveNewComponentSchema:i,getPropsConfig:f,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:a}}const yn=e.defineComponent({name:"FResponseToolbarItemDesign",props:Qe,emits:["Click"],setup(n,t){e.ref(),e.ref();const o=e.ref(n.alignment),a={id:"__more_buttons__",text:"More"},s=e.ref(new he(a));e.computed(()=>s.value.children.length>0);const r=e.ref(),l=e.inject("designer-host-service"),p=e.inject("design-item-context"),m=gn(p,l),i=Ee.useDesignerInnerComponent(r,p,m);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{r.value.componentInstance=i}),t.expose(i.value);function C(){const S={"f-icon":!0},g=n.icon?n.icon.trim():"";return ge.getCustomClass(S,g)}function y(){return!!(n.icon&&n.icon.trim())}function T(){const S={btn:!0,"f-rt-btn":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left","btn-icontext":!!(n.icon&&n.icon.trim())};return ge.getCustomClass(S,n.class)}return e.onMounted(()=>{}),e.onUnmounted(()=>{}),()=>e.createVNode("div",{ref:r,"data-dragref":`${p.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[e.createVNode("button",{type:"button",class:T(),id:n.id},[y()&&e.createVNode("i",{class:C()},null),n.text])])}}),vn=e.defineComponent({name:"FResponseToolbarDesign",props:on,emits:["Click"],setup(n,t){const o=e.ref(n.items);let a=new Array(o.value.length).fill(e.ref());const s=e.ref(),r=e.ref(),l=e.ref(n.alignment),p={id:"__more_buttons__",text:"More"},m=e.ref(new he(p)),i=ln();e.computed(()=>m.value.children.length>0);const C=e.ref(),y=e.inject("designer-host-service"),T=e.inject("design-item-context"),S=pn(T.schema,y,T),g=Ee.useDesignerInnerComponent(C,T,S);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{C.value.componentInstance=g}),t.expose(g.value);const f=e.computed(()=>{const x={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};return ge.getCustomClass(x,n.customClass)}),h=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":l.value==="right","justify-content-start":l.value==="left"})),{renderToolbarDropdown:d,clearAllDropDown:w}=dn(n,i,g);function M(){o.value.filter(x=>x.children&&x.children.length>0).forEach(x=>{x.expanded=!1}),m.value.expanded=!1,w()}const $=new Map,R=[];function j(x){const b=r.value;let u=x;const c=Array.from(b.children),v=c[c.length-1].id==="__more_buttons__"?c[c.length-1]:null;if(v){const A=v.computedStyleMap().get("margin-left"),O=v.computedStyleMap().get("margin-right"),L=(A?A.value:0)+v.getBoundingClientRect().width+(O?O.value:0);u-=L}const P=c.filter(A=>A.id!=="__more_buttons__");for(const A of P){const O=A.computedStyleMap().get("margin-left"),L=A.computedStyleMap().get("margin-right"),X=(O?O.value:0)+A.getBoundingClientRect().width+(L?L.value:0);u<X?($.set(A.id,!0),R.push({id:A.id,width:X})):u-=X}if(R.length)for(let A=R.length-1;A>=0;A--){const O=R[A].width;if(u>=O)u-=O,$.delete(R[A].id),R.pop();else break}const D=Object.assign({},m.value);D.children=[];const V=new he(D),E=o.value.reduce((A,O)=>($.has(O.id)&&V.children.push(O),O.visible=!$.has(O.id),A.push(O),A),[]);m.value=V,o.value=E}const N=new ResizeObserver(x=>{if(x.length){const u=x[0].contentRect.width,v=r.value.getBoundingClientRect().width;(u<v||R.length)&&j(u)}});e.onMounted(()=>{const x=s.value;N.observe(x),document.body.addEventListener("click",M)}),e.onUnmounted(()=>{N.disconnect(),document.body.removeEventListener("click",M)}),e.watch(()=>n.items,()=>{o.value=n.items},{deep:!0}),e.watch(o,x=>{a=new Array(o.value.length).fill(e.ref())});function B(x,b,u,c){T&&T.setupContext&&T.setupContext.emit("selectionChange",x,b,u,c)}function k(){const x=r.value.querySelector(".dgComponentFocused.dgComponentSelected");x==null||x.classList.remove("dgComponentSelected"),x==null||x.classList.remove("dgComponentFocused")}return()=>e.createVNode("div",{ref:C,"data-dragref":`${T.schema.id}-container`,class:f.value},[e.createVNode("div",{ref:s,class:h.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.map((x,b)=>e.createVNode(tt,{ref:a[b],class:"p-0 display-inline-block",modelValue:x,"onUpdate:modelValue":u=>x=u,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:n.componentId,id:x.id,style:"padding:0 !important;display:inline-block",onSelectionChange:B,onRemoveComponent:k},{default:()=>{var u;return[e.createVNode(yn,{id:x.id,disable:x.disable,text:x.text,icon:x.icon,class:((u=x.appearance)==null?void 0:u.class)||"btn-secondary",alignment:n.alignment||"right",componentId:n.componentId},null)]}}))])])])}});function Cn(n,t,o,a,s){const{toolbarItems:r,toolbarSchema:l}=n;function p(m,i,C,y){var T;(T=a.setupContext)==null||T.emit("selectionChange",m,i,C,y)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(tt,{modelValue:l.value,"onUpdate:modelValue":m=>l.value=m,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:l.value.id,onSelectionChange:p,componentId:s},{default:()=>[e.createVNode(vn,{items:r.value,componentId:s},null)]})])])}const wn=e.defineComponent({name:"FTabsDesign",props:we,emits:["tabChange","tabRemove"],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Yt(a.schema,a.parent),r=Xe(o,a,s),l=e.ref(n.tabType),p=e.shallowRef(),m=e.shallowRef(),i=Qt(n,t,p,a),{activeId:C,changeTitleStyle:y,tabPages:T,addTab:S,updateTab:g,selectTabByTabId:f,toolbarItems:h}=i,d=qe(n,m,i),w=ze(n,p,d,i),{previousButtonClass:M,nextButtonClass:$,nextButtonGroupClass:R,scrollTab:j,updateNavigationLayout:N}=w,B=We(n,i),{hideDropDown:k}=B,x=_t(n,p,w,d,i,r,s),b=x,u=Le(n,p,w,d,i),c=new Map([["default",x],["one-page",b],["pills",u]]);e.computed(()=>{const H=T.value.find(U=>U.props.id===C.value);return H==null?void 0:H.slots});const v=e.computed(()=>{const H=T.value.find(ne=>ne.props.id===C.value);return(H==null?void 0:H.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:C,addTab:S,updateTab:g,tabPages:T,tabType:l});function P(){const H=r.value.schema.contents||[];return H.length<1?null:H.find(ne=>ne.id===C.value)}function D(){var U;const H=P();h.value=[...(U=H==null?void 0:H.toolbar)==null?void 0:U.contents]}e.provide("toolbar-item-handler",D);const V=e.computed(()=>n.fill||n.tabType==="fill"),E=e.computed(()=>n.tabType==="pills"),A=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":v.value,"farris-tabs-inContent":!v.value,"farris-tabs-nav-fill":V.value,"farris-tabs-nav-pills":E.value})),O=e.computed(()=>({width:v.value&&n.titleWidth?`${n.titleWidth}%`:""})),L=e.computed(()=>({"farris-tabs":!0,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"}));e.onMounted(()=>{T.value.length&&(C.value=n.activeId||T.value[0].props.id,f(C.value)),e.nextTick(()=>{N()}),y(p),window.addEventListener("click",H=>{var U;k.value||(U=o.value)!=null&&U.contains(H.target)||(k.value=!0)}),window.addEventListener("resize",()=>{N()}),o.value.componentInstance=r});function X(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:M.value,onClick:()=>{j(0,-1)}},null)}function J(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:$.value,onClick:()=>{j(0,1)}},null)}const{renderMorePagesButtton:ae}=He(n,B,w,i);function K(){return!!h.value.length&&Cn(i,r,s,a,n.componentId)}const ee=c.get(n.tabType)||c.get("default");function W(){var H,U,ne,le;return e.createVNode("div",{class:A.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(U=(H=t.slots).headerPrefix)==null?void 0:U.call(H)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:O.value},[X(),ee&&ee(),e.createVNode("div",{class:R.value},[J(),ae()])]),K(),e.createVNode("div",{class:"farris-tabs-header-post"},[(le=(ne=t.slots).headerSuffix)==null?void 0:le.call(ne)])])}function _(){var H,U;return e.createVNode("div",{class:"farris-tabs-content",ref:m},[(U=(H=t.slots).default)==null?void 0:U.call(H)])}return t.expose(r.value),()=>e.createVNode("div",{class:L.value,ref:o},[W(),_()])}});function Tn(n,t,o){return t?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function xn(n,t){return t&&t.contents&&t.contents.length&&t.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:t.contents,buttonPosition:t.position}}const Sn=new Map([["appearance",ce],["expanded","expandStatus"],["enableAccordion",Tn],["toolbar",xn]]);function Nn(n,t,o,a){const s=Math.random().toString().slice(2,6),r=o.parentComponentInstance;Object.assign(t,{id:`section-${s}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:t.mainTitle||"标题"});const l=n.getSchemaByType("content-container");Object.assign(l,{id:`container-${s}`,appearance:{class:"f-struct-wrapper"},contents:[t]});const p=r.schema;switch(p&&p.type){case re.splitter.type:{t.appearance.class="f-section-in-main";break}}return l}function jn(n,t,o,a){return o.parentComponentInstance?Nn(n,t,o):t}const Mn={$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"]},nt={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}};se(nt,Mn,Sn,jn);function Vn(n,t,o){let a;function s(){!n||!t.value||(o.value=!o.value,o.value?r():l())}function r(){a=n.value.nextElementSibling;const m=document&&document.querySelector("body");m&&(m.appendChild(n.value),n.value.style.zIndex=p())}function l(){a?t.value.insertBefore(n.value,a):t.value.appendChild(n.value),n.value.style.zIndex=null}function p(m=1){const i=["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(i.join(","))).filter(T=>T).map(T=>{const{display:S,zIndex:g}=window.getComputedStyle(T);return S==="none"?0:parseInt(g,10)}).filter(T=>T);let y=Math.max(...C);return y<1040&&(y=1040),y+m}return{onClickMaxMinIcon:s}}function ot(n,t){const o=e.ref(n.buttons),a=e.computed(()=>n.buttonPosition==="inHead"?"right":"left"),s=e.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),r=e.computed(()=>{n.buttons&&n.buttons.length>0&&n.buttonPosition});function l(p){t.emit("Click",p)}return()=>r&&e.createVNode(ke,{customClass:s.value,items:o.value,onClick:l,alignment:a.value},null)}function Bn(n,t,o,a,s,r){e.ref(n.subTitle);const l=e.computed(()=>n.buttonPosition),p=ot(n,t),{onClickMaxMinIcon:m}=Vn(a,s,r),i=e.computed(()=>!!n.subTitle),C=e.computed(()=>n.enableMaximize),y=e.computed(()=>n.enableAccordion!=""),T=e.computed(()=>{const M={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((R,j)=>(R[j]=!0,R),M),M});function S(M){M.stopPropagation(),n.enableAccordion!==""&&(o.value=!o.value)}function g(){const M=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),$=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!r.value,"f-icon-minimize":r.value}));return e.createVNode("div",{class:"f-max-accordion"},[C.value?e.createVNode("span",{class:$.value,onClick:m},null):"",y.value?e.createVNode("button",{class:M.value,onClick:S},[e.createVNode("span",null,[o.value?n.collapseLabel:n.expandLabel])]):""])}function f(){return t.slots.header?e.createVNode("div",{class:T.value},[t.slots.header()]):""}function h(){return e.createVNode("div",{class:"f-title",onClick:S},[e.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),i.value&&e.createVNode("span",null,[n.subTitle])])}function d(){const M=e.computed(()=>{const $={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((j,N)=>(j[N]=!0,j),$),$});return t.slots.headerContent?e.createVNode("div",{class:M.value},[t.slots.headerContent()]):""}function w(){return e.createVNode("div",{class:T.value},[t.slots.headerTitle?t.slots.headerTitle():h(),d(),l.value==="inHead"&&p(),(C.value||y.value)&&g()])}return()=>n.showHeader&&(t.slots.header?f():w())}const Pn=["moz","ms","webkit"];function kn(){let n=0;return t=>{const o=new Date().getTime(),a=Math.max(0,16-(o-n)),s=setTimeout(()=>{t(o+a)},a);return n=o+a,s}}function En(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=Pn.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:kn()}En();function Ve(n,t){return((t==null?void 0:t.split(" "))||[]).reduce((a,s)=>(s&&(a[s]=!0),a),n),n}const In=e.defineComponent({name:"FSection",props:nt,emits:[],setup(n,t){const o=e.ref();let a=e.ref();const s=e.ref(n.customClass),r=e.computed(()=>n.enableAccordion),l=e.ref(n.expandStatus),p=e.computed(()=>n.buttonPosition),m=e.ref(!1),i=Bn(n,t,l,o,a,m),C=ot(n,t),y=e.computed(()=>{const h={"f-section":!0,"f-section-accordion":r.value==="default","f-state-collapse":(r.value==="default"||r.value==="custom")&&!l.value,"f-section-custom-accordion":r.value==="custom","f-section-fill":n.fill,"f-section-maximize":m.value};return Ve(h,s.value)}),T=e.computed(()=>Ve({"f-section-content":!0},n.contentClass)),S=e.computed(()=>Ve({"f-section-extend":!0},S.value));function g(){return t.slots.extend&&e.createVNode("div",{class:S.value},[t.slots.extend()])}function f(){return e.createVNode("div",{class:T.value},[p.value==="inContent"&&C(),t.slots.default&&t.slots.default()])}return e.watch(()=>n.expandStatus,(h,d)=>{h!==d&&(l.value=h)}),e.onMounted(()=>{o&&o.value&&(a.value=o.value.parentElement)}),()=>e.createVNode("div",{class:y.value,ref:o},[i(),g(),f()])}});function Dn(n,t){function o(s){return!!et().basalDragulaRuleForContainer(s)}function a(s){}return{canAccepts:o,onAcceptMovedChildElement:a}}function $n(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const An=e.defineComponent({name:"FTabPageDesign",props:ue,emits:[],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Dn(a.schema,a.parent),r=Xe(o,a,s);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,t.expose(r.value);const l=e.inject("tabs"),p=e.ref(!0),m={slots:t.slots,props:n},i=e.ref((l==null?void 0:l.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const d=l.tabPages.value.findIndex(w=>w.props.id===n.id);!d||d===-1?l==null||l.addTab(m):d>-1&&(p.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const C=e.computed(()=>(n==null?void 0:n.id)===(l==null?void 0:l.activeId.value)),y=e.computed(()=>({display:C.value?"":"none"}));e.watch(()=>n,d=>{l==null||l.updateTab({props:d,slots:t.slots})},{immediate:!0,deep:!0});function T(){var w,M;const d=(M=(w=t.slots).default)==null?void 0:M.call(w);return e.createVNode(In,{"main-title":n.title,class:"farris-tab-page"},$n(d)?d:{default:()=>[d]})}const S=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function g(){var w,M;const d=(M=(w=t.slots).default)==null?void 0:M.call(w);return e.createVNode("div",{ref:o,class:S.value,"data-dragref":`${a.schema.id}-container`,style:y.value},[d])}const h=new Map([["default",g],["one-page",T]]).get(i.value)||g;return()=>p.value?h():null}}),On=se({text:{type:String,default:""},icon:{type:String,default:""}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-toolbar-item.schema.json",title:"tab-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:"tab-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},text:{description:"文本",type:"string",default:""},icon:{description:"图标",type:"string",default:""},onClick:{description:"点击事件",type:"string",default:""}},required:["id","type","text"]},Ce,mt);te.install=n=>{n.component(te.name,te),n.component(pe.name,pe)},te.register=(n,t,o,a)=>{n.tabs=te,n["tab-page"]=pe,t.tabs=Oe,t["tab-page"]=Te,a.tabs={eventHandlerResolver:Fe}},te.registerDesigner=(n,t,o)=>{n.tabs=wn,n["tab-page"]=An,t.tabs=Re,t["tab-page"]=Te,t["tab-toolbar-item"]=On},z.FTabPage=pe,z.FTabs=te,z.default=te,z.eventHandlerResolver=Fe,z.tabPageProps=ue,z.tabPagePropsResolver=Te,z.tabsDesignProps=we,z.tabsDesignPropsResolver=Re,z.tabsProps=de,z.tabsPropsResolver=Oe,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(F,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../capsule/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../section/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../capsule/index.umd.js","../response-toolbar/index.umd.js","../dynamic-resolver/index.umd.js","../section/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","bignumber.js"],e):(F=typeof globalThis<"u"?globalThis:F||self,e(F.tabs={},F.Vue,F.LodashES,F.FCapsule,F.FResponseToolbar,F.dynamicResolver,F.FSection$1,F.designerCanvas,F.common))})(this,function(F,e,Z,ot,Ie,at,st,Pe,ye){"use strict";var qn=Object.defineProperty;var Wn=(F,e,Z)=>e in F?qn(F,e,{enumerable:!0,configurable:!0,writable:!0,value:Z}):F[e]=Z;var L=(F,e,Z)=>Wn(F,typeof e!="symbol"?e+"":e,Z);const ve={},De={};function Ce(n){const{properties:t,title:o,ignore:a}=n,s=a&&Array.isArray(a),l=Object.keys(t).reduce((r,i)=>((!s||!a.find(d=>d==i))&&(r[i]=t[i].type==="object"&&t[i].properties?Ce(t[i]):Z.cloneDeep(t[i].default)),r),{});return o&&(!s||!a.find(r=>r=="id"))&&(l.id=`${o}-${Date.now()}`),l}function re(n,t={},o){const a=ve[n];if(a){let s=Ce(a);const l=De[n];return s=l?l({getSchemaByType:re},s,t,o):s,s}return null}function rt(n,t){const o=Ce(t);return Object.keys(n).reduce((a,s)=>(a[s]&&Z.isPlainObject(a[s])&&Z.isPlainObject(n[s])?Object.assign(a[s],n[s]):a[s]=n[s],a),o),o}function lt(n,t){return Object.keys(n).filter(a=>n[a]!=null).reduce((a,s)=>{if(t.has(s)){const l=t.get(s);if(typeof l=="string")a[l]=n[s];else{const r=l(s,n[s],n);Object.assign(a,r)}}else a[s]=n[s];return a},{})}function it(n,t,o=new Map){const a=rt(n,t);return lt(a,o)}function ct(n={}){function t(c,m,f,C){if(typeof f=="number")return C[c].length===f;if(typeof f=="object"){const v=Object.keys(f)[0],S=f[v];if(v==="not")return Number(C[c].length)!==Number(S);if(v==="moreThan")return Number(C[c].length)>=Number(S);if(v==="lessThan")return Number(C[c].length)<=Number(S)}return!1}function o(c,m,f,C){return C[c]&&C[c].propertyValue&&String(C[c].propertyValue.value)===String(f)}const a=new Map([["length",t],["getProperty",o]]);Object.keys(n).reduce((c,m)=>(c.set(m,n[m]),c),a);function s(c,m){const f=c;return typeof m=="number"?[{target:f,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:f,operator:"getProperty",param:c,value:!!m}]:typeof m=="object"?Object.keys(m).map(C=>{if(C==="length")return{target:f,operator:"length",param:null,value:m[C]};const v=C,S=m[C];return{target:f,operator:"getProperty",param:v,value:S}}):[]}function l(c){return Object.keys(c).reduce((f,C)=>{const v=s(C,c[C]);return f.push(...v),f},[])}function r(c,m){if(a.has(c.operator)){const f=a.get(c.operator);return f&&f(c.target,c.param,c.value,m)||!1}return!1}function i(c,m){return l(c).reduce((v,S)=>v&&r(S,m),!0)}function d(c,m){const f=Object.keys(c),C=f.includes("allOf"),v=f.includes("anyOf"),S=C||v,b=(S?c[S?C?"allOf":"anyOf":"allOf"]:[c]).map(B=>i(B,m));return C?!b.includes(!1):b.includes(!0)}return{parseValueSchema:d}}const G={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},Ee={},dt={};ct();function le(n,t,o=new Map,a=(r,i,d)=>i,s={},l=r=>r){return ve[t.title]=t,De[t.title]=a,Ee[t.title]=s,dt[t.title]=l,(r={})=>{const i=it(r,t,o),d=Object.keys(n).reduce((c,m)=>(c[m]=n[m].default,c),{});return Object.assign(d,i)}}function ce(n,t){return{customClass:t.class,customStyle:t.style}}function ut(){function n(t,o){const a=t.contents;if(!a||a.length<1)return null;const s=a.reduce((d,c)=>{const m=c.toolbar&&c.toolbar.buttons||[];return d.push(...m),d},[]);if(!s||s.length<1)return;const[l,r]=o.payloads,i=s.find(d=>d.id===r);return i?i.onClick||i.click:null}return{resolve:n}}const we=new Map([["appearance",ce]]);function pt(n,t,o){const a=Math.random().toString().slice(2,6),s=t.parentComponentInstance,l=n.getSchemaByType("tab-page");l.id=`tab-page-${a}`;const r=n.getSchemaByType("tabs");Object.assign(r,{id:`tabs-${a}`,appearance:{class:"f-component-tabs f-tabs-has-grid"},contents:[l],activeId:l.id});const i=n.getSchemaByType("section");Object.assign(i,{id:`section-${a}`,appearance:{class:"f-section-tabs f-section-in-mainsubcard"},fill:!1,showHeader:!1,contents:[r]});const d=n.getSchemaByType("content-container");Object.assign(d,{id:`container-${a}`,appearance:{class:"f-struct-wrapper"},contents:[i]});const c=s.schema;switch(c&&c.type){case G["splitter-pane"].type:{i.appearance.class="f-section-tabs f-section-in-main",r.appearance.class="f-component-tabs";break}}return d}function je(n,t,o,a){if(o.parentComponentInstance)return pt(n,o);{const l=n.getSchemaByType("tab-page");return t.contents=[l],t}}function ft(n,t,o){return t}const $e={$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:[]},autoTitleWidth:{description:"",type:"boolean",default:!1},titleLength:{description:"",type:"number",default:7},fill:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},de={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"}},Re=le(de,$e,we,je),Te=Object.assign({},de,{componentId:{type:String,default:""}}),Oe=le(Te,$e,we,je),Ae=ut();function mt(n,t,o){const a=e.ref([]),s=e.ref(n.activeId||""),l=e.ref(!0),r=e.ref([]);e.watch(()=>n.activeId,(h,x)=>{h!==x&&(s.value=h)});function i(h){const x=h.value.findIndex(b=>b.props.show!==!1&&!s.value&&!b.props.disabled);!s.value&&x!==-1&&(s.value=h.value[x].props.id)}function d(h){var b;if(n.autoTitleWidth)return;const x=(b=h.value)==null?void 0:b.querySelectorAll(".st-tab-text");if(x)for(let w=0;w<x.length;w++){const B=x[w].parentNode;x[w].scrollWidth>B.offsetWidth?x[w].classList.contains("farris-title-text-custom")||x[w].classList.add("farris-title-text-custom"):x[w].classList.remove("farris-title-text-custom")}}const c=h=>{h.preventDefault(),h.stopPropagation()};function m(h,x,b=!1){const w=a.value.findIndex(B=>B.props.id===x);a.value=a.value.filter(B=>B.props.id!==x),s.value===x&&(s.value="",i(a)),c(h),e.nextTick(()=>{d(o),b&&(l.value=!0),t.emit("tabRemove",{removeIndex:w,removeId:x,activeId:s.value})})}function f(h){const x=s.value;s.value=h;const b=a.value.find(w=>w.props.id===h);r.value=[],b&&b.props.toolbar&&b.props.toolbar.buttons&&b.props.toolbar.buttons.length&&(r.value=[...b.props.toolbar.buttons]),t.emit("update:activeId",h),t.emit("tabChange",{prevId:x,nextId:s.value})}function C(h){f(h)}function v(h){a.value.findIndex(b=>b.props.id===h.props.id)===-1&&a.value.push(h)}function S(h){a.value.findIndex(b=>b.props.id===h.props.id)!==-1&&(a.value.forEach(b=>{b.props.id===h.props.id&&(b=h)}),e.nextTick(()=>{d(o)}))}return{activeId:s,addTab:v,changeTitleStyle:d,removeTab:m,selectTab:C,selectTabByTabId:f,tabPages:a,updateTab:S,toolbarItems:r}}function ht(n,t,o,a,s){const{activeId:l,removeTab:r,selectTab:i}=s,d=e.computed(()=>({"st-tab-text":!0,"text-truncate":!0,"farris-title-auto":n.autoTitleWidth})),c=e.computed(()=>({"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===l.value,"f-state-disable":t.disabled})),m=e.computed(()=>({width:`${t.tabWidth}px`})),f=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===l.value,disabled:t.disabled}));function C(w){return e.createVNode("span",{class:d.value,title:w.title},[w.title])}function v(w){return w.slots.title?w.slots.title:C}const S=v(o),h=e.ref(t.removeable);function x(){return e.createVNode("span",{class:"st-drop-close",onClick:w=>r(w,t.id),style:{opacity:.6}},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function b(w){i(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}return e.createVNode("li",{class:c.value,style:m.value},[e.createVNode("a",{class:f.value,onClick:b},[S(t),h.value&&x()])])}function gt(n,t,o,a,s){const{shouldShowNavigationButtons:l}=o,{tabPages:r}=s,i=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":l.value})),d=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),c=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"}));return()=>e.createVNode("div",{class:i.value,style:d.value},[e.createVNode("ul",{class:c.value,ref:t},[r.value.map(m=>ht(n,m.props,m,a,s))])])}function Le(n,t,o,a,s){const l=e.ref(),{shouldShowNavigationButtons:r}=o,{activeId:i,tabPages:d,selectTab:c}=s,m=e.ref(i.value),f=e.computed(()=>d.value.map(h=>({name:h.props.title,value:h.props.id,show:h.props.show,disabled:h.props.disabled}))),C=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),v=e.computed(()=>({width:"100%",display:"flex","justify-content":n.justifyContent}));e.onMounted(()=>{l.value&&(t.value=l.value.$el)});function S(h){c(h)}return e.watch(()=>i.value,h=>{h!==m.value&&(m.value=h)},{immediate:!0}),()=>e.createVNode("div",{class:C.value,style:v.value},[e.createVNode(ot,{items:f.value,modelValue:m.value,"onUpdate:modelValue":h=>m.value=h,onChange:S,ref:l},null)])}function bt(n,t,o,a){const{activeId:s,removeTab:l,tabPages:r}=a,{selectAndScrollToTab:i}=o,{hideDropDown:d,searchTabText:c}=t,m=e.ref("auto"),f=e.computed(()=>{var w,B;let b=[];return n.searchBoxVisible?b=(w=r.value)==null?void 0:w.filter(A=>A.props.title.includes(c.value)):b=(B=r.value)==null?void 0:B.slice(),b}),C=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":n.searchBoxVisible,show:!d.value}));function v(b){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:b.props.disabled,active:b.props.id===s.value,"d-none":b.props.show!==!0}}function S(b){b.preventDefault(),b.stopPropagation()}const h=()=>({width:m.value});function x(){return e.createVNode("div",{class:C.value},[n.searchBoxVisible&&e.createVNode("div",{onClick:b=>S(b),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":b=>c.value=b},null),[[e.vModelText,c.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),f.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:h()},[f.value.map(b=>e.createVNode("li",{class:v(b),onClick:w=>i(w,b.props)},[b.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:w=>l(w,b.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title",title:b.props.title},[b.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:x}}function Fe(n,t,o,a){const{hideDropDown:s}=t,{renderDropdownMenu:l}=bt(n,t,o,a),r=e.ref(n.showDropdown);function i(){return r.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{s.value=!1}},null),l()])}return{renderMorePagesButtton:i}}function He(n,t,o,a){const s=e.ref(!1),{selectTabByTabId:l,tabPages:r}=a,i=4;function d(){var b;const h=t.value,x=(b=t.value)==null?void 0:b.parentElement;s.value=x&&h&&x.offsetWidth<h.scrollWidth-i}const c=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!s.value})),m=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!s.value})),f=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!s.value}));function C(h,x){if(!t.value)return;const b=t.value.scrollLeft,w=t.value.scrollWidth-t.value.offsetWidth;if(x>0){if(t.value.scrollLeft>=w)return;t.value.scrollLeft=b+n.scrollStep+h}else if(x<0){if(t.value.scrollLeft<=0)return;t.value.scrollLeft=b-n.scrollStep-h}}function v(h){if(!s.value||!t.value)return;const x=n.tabType==="pills"?".f-capsule-item":".nav-item",b=t.value.querySelectorAll(x),{parentElement:w}=t.value,B=b[h];if(B&&w){const A=w.getBoundingClientRect().left,k=w.getBoundingClientRect().right,j=B.getBoundingClientRect().left,N=B.getBoundingClientRect().right;j<A?C(A-j,-1):k<N&&C(N-k,1),n.tabType==="one-page"&&o.scrollTo(h)}}function S(h,x){if(x.disabled)return;l(x.id);const b=r.value.findIndex(w=>w.props.id===x.id);e.nextTick(()=>{v(b)})}return{previousButtonClass:c,nextButtonGroupClass:m,nextButtonClass:f,scrollTab:C,selectAndScrollToTab:S,shouldShowNavigationButtons:s,updateNavigationLayout:d}}function ze(n,t){const{tabPages:o}=t,a=e.ref(""),s=e.ref(!0),l=e.computed(()=>n.searchBoxVisible),r=e.computed(()=>l.value?o.value.filter(d=>d.props.title.includes(a.value)):o.value.slice());return{searchTabText:a,hideDropDown:s,shouldShowSearchBox:l,tabsInDropdownMenu:r}}function qe(n,t,o){const a=".farris-tab-page",{tabPages:s}=o;function l(i){const d=t.value;if(d){const c=t.value.querySelectorAll(a);if(c.length>0){const m=c[i],{offsetTop:f}=m,C=f-32>0?f-32:0;d.scrollTop=C}}}function r(i){const d=s.value.findIndex(c=>c.props.id===i);d>-1&&l(d)}return{scrollTo:l,scrollToByPaggId:r}}const te=e.defineComponent({name:"FTabs",props:de,emits:["tabChange","tabRemove","update:activeId","Click"],setup(n,t){const o=e.ref(n.tabType),a=e.shallowRef(),s=e.ref(n.customClass),l=e.shallowRef(),r=e.shallowRef(),i=mt(n,t,l),{activeId:d,changeTitleStyle:c,tabPages:m,addTab:f,updateTab:C,selectTabByTabId:v,toolbarItems:S}=i,h=qe(n,r,i),x=He(n,l,h,i),{previousButtonClass:b,nextButtonClass:w,nextButtonGroupClass:B,scrollTab:A,updateNavigationLayout:k}=x,j=ze(n,i),{hideDropDown:N}=j,E=gt(n,l,x,h,i),$=E,T=Le(n,l,x,h,i),g=new Map([["default",E],["one-page",$],["pills",T]]);e.computed(()=>{const z=m.value.find(_=>_.props.id===d.value);return z==null?void 0:z.slots});const p=e.computed(()=>{const z=m.value.find(J=>J.props.id===d.value);return(z==null?void 0:z.props.toolbarPosition)==="inHead"}),u=e.computed(()=>n.fill||n.tabType==="fill");e.provide("tabs",{activeId:d,addTab:f,updateTab:C,tabPages:m,tabType:o,shouldFillParentContaner:u});const y=e.computed(()=>n.tabType==="pills"),V=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":p.value,"farris-tabs-inContent":!p.value,"farris-tabs-nav-fill":u.value,"farris-tabs-nav-pills":y.value})),D=e.computed(()=>({width:p.value&&n.titleWidth?`${n.titleWidth}%`:""})),M=e.computed(()=>{const z={"farris-tabs":!0,"f-utils-fill-flex-column":u.value,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"};return s.value&&s.value.split(" ").reduce((_,J)=>(_[J]=!0,_),z),z});e.onMounted(()=>{m.value.length&&(d.value=n.activeId||m.value[0].props.id,v(d.value)),e.nextTick(()=>{k()}),c(l),window.addEventListener("click",z=>{var _;N.value||(_=a.value)!=null&&_.contains(z.target)||(N.value=!0)}),window.addEventListener("resize",()=>{k()})});function I(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:b.value,onClick:()=>{A(0,-1)}},null)}function R(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:w.value,onClick:()=>{A(0,1)}},null)}const{renderMorePagesButtton:O}=Fe(n,j,x,i),H=(z,_)=>{t.emit("Click",z,_,d.value)};function Y(){return S.value.length?e.createVNode(Ie,{class:"f-utils-fill",items:S.value,onClick:H},null):null}const ne=g.get(n.tabType)||g.get("default");function se(){var z,_,J,q;return e.createVNode("div",{class:V.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(z=t.slots).headerPrefix)==null?void 0:_.call(z)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:D.value},[I(),ne&&ne(),e.createVNode("div",{class:B.value},[R(),O()])]),Y(),e.createVNode("div",{class:"farris-tabs-header-post"},[(q=(J=t.slots).headerSuffix)==null?void 0:q.call(J)])])}const K=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":u.value}));function oe(){var z,_;return e.createVNode("div",{class:K.value,ref:r},[(_=(z=t.slots).default)==null?void 0:_.call(z)])}return()=>e.createVNode("div",{class:M.value,ref:a},[se(),oe()])}}),yt=new Map([["appearance",ce],["toolbar",vt]]);function vt(n,t,o){return t&&t.contents&&t.contents.length&&(t.contents.forEach(a=>{a.title&&(a.text=a.title)}),t.buttons=t.contents,delete t.contents),{toolbar:t}}const Ct={$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"]},ue={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"}},xe=at.createPropsResolver(ue,Ct,yt);function wt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const pe=e.defineComponent({name:"FTabPage",props:ue,emits:[],setup(n,t){const o=e.inject("tabs"),a=e.ref(n.show),s={slots:t.slots,props:n},l=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const v=o==null?void 0:o.tabPages.value.findIndex(S=>S.props.id===n.id);!v||v===-1?o==null||o.addTab(s):v>-1&&(a.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const r=e.computed(()=>(n==null?void 0:n.id)===(o==null?void 0:o.activeId.value)),i=e.computed(()=>({display:r.value?"":"none"}));e.watch(()=>n,v=>{o==null||o.updateTab({props:v,slots:t.slots})},{immediate:!0,deep:!0});function d(){var S,h;const v=(h=(S=t.slots).default)==null?void 0:h.call(S);return e.createVNode(st,{"main-title":n.title,class:"farris-tab-page"},wt(v)?v:{default:()=>[v]})}const c=e.computed(()=>{var S;return{"farris-tab-page":!0,"f-utils-fill-flex-column":r.value&&o&&((S=o.shouldFillParentContaner)==null?void 0:S.value)}});function m(){var S,h;const v=(h=(S=t.slots).default)==null?void 0:h.call(S);return e.createVNode("div",{class:c.value,style:i.value},[v])}const C=new Map([["default",m],["one-page",d]]).get(l.value)||m;return()=>a.value?C():null}}),Tt={width:{Type:Number,default:400},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 Se(){return new DOMException("The request is not allowed","NotAllowedError")}async function xt(n){if(!navigator.clipboard)throw Se();return navigator.clipboard.writeText(n)}async function St(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const o=window.getSelection(),a=window.document.createRange();o==null||o.removeAllRanges(),a.selectNode(t),o==null||o.addRange(a);let s=!1;try{s=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(t)}if(!s)throw Se()}async function Mt(n){try{await xt(n)}catch(t){try{await St(n)}catch(o){throw o||t||Se()}}}function Nt(){async function n(t){await Mt(t)}return{onCopy:n}}function Vt(n,t,o,a){const s=e.ref(14),l=e.ref(140),r=e.ref(""),i=e.ref(a.value.length),d=e.computed(()=>a.value),c=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function m(f){if(f.currentTarget){const C=f.currentTarget.value||"";i.value=C.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:l.value,onInput:f=>m(f)},[d.value]),e.createVNode("span",{class:"textarea-wordcount",title:r.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[i.value+" / "+l.value])])}function Bt(n,t,o,a){const s=Vt(n,t,o,a),l=new Map([["text-area",s]]);function r(i){return l.get(i)||null}return{getEditorRender:r}}function kt(){const n=e.ref(!1),t=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const a={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 a.opacity=n.value?"0.8":"0",a.display=n.value?"":"none",a}),feedbackMessage:t,toShowFeedback:n}}function It(n,t){const o=t.getEditorRender(n.promptEditorType);return()=>o&&o()}function Pt(n){const t=e.ref(3),o=e.ref(480),a=e.computed(()=>!!n.value&&!!n.value.date),s=e.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),l=e.computed(()=>!!n.value&&!!n.value.detail),r=e.computed(()=>{const x=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":t.value,"max-height":x}}),i=e.computed(()=>n.value&&n.value.detail||""),d=e.computed(()=>!0),c=e.ref(!1),m=e.ref("展开"),f=e.ref("收起"),C=e.computed(()=>{const x={display:"block",color:"#2A87FF"};return x["text-align"]=c.value?"":"right",x});function v(x,b){c.value=!c.value,t.value=c.value?20:3}function S(x){return v()}function h(x){return v()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[a.value&&e.createVNode("div",null,[s.value]),l.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:r.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:i.value},null)]),d.value&&e.createVNode("span",{style:C.value},[c.value&&e.createVNode("span",{onClick:S,style:"cursor: pointer;"},[f.value]),!c.value&&e.createVNode("span",{onClick:h,style:"cursor: pointer;"},[m.value])])])}function Dt(n){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Et(n,t,o,a){const s=e.ref(n.exceptionInfo),l=e.computed(()=>{const C={"f-icon":!0},v=`f-icon-${t.value}`;return C[v]=!0,C}),r=e.computed(()=>o.value||s.value&&s.value.message),i=e.computed(()=>a.value),d=e.computed(()=>!!a.value),c=e.computed(()=>!!s.value);function m(){return c.value?Pt(s):d.value?Dt(i):()=>null}const f=m();return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:l.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:r.value},null),f()])])}function jt(n,t,o){const{onCopy:a}=t,{toShowFeedback:s}=o,l=e.ref("复制成功"),r=e.ref("复制详细信息"),i=e.ref(n.exceptionInfo||{date:"",message:"",detail:""}),d=e.computed(()=>i.value&&i.value.detail||"");function c(m){a(d.value).catch(f=>{l.value="复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:c,style:"cursor: pointer;"},[r.value])])}function $t(n,t,o,a){const s=e.ref(n.type),l=e.ref([]),r=e.ref(n.exceptionInfo),i=e.ref(n.okButtonText),d=e.ref(n.cancelButtonText),c=e.ref(!0),m=e.ref(!0),f=e.computed(()=>!!(l.value&&l.value.length)),C=e.computed(()=>r.value&&r.value.date&&r.value.message&&r.value.detail),v=e.computed(()=>!(l.value&&l.value.length)&&(i.value||d.value)),S=e.computed(()=>m.value&&i.value),h=e.computed(()=>c.value&&d.value),x=jt(n,o,a);function b(B){s.value==="question"&&t.emit("reject"),t.emit("close")}function w(B){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[C.value&&x(),v.value&&h.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:b},[d.value]),v.value&&S.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:w},[i.value]),f.value&&l.value.length&&l.value.map(B=>e.createVNode("button",{type:"button",onClick:B.handle,class:B.class},[B.iconClass&&e.createVNode("span",{class:B.iconClass},null),B.text]))])}const fe=e.defineComponent({name:"FMessageBox",props:Tt,emits:["accept","reject","close"],setup(n,t){const o=e.ref(n.type),a=e.ref(n.title),s=e.ref(n.detail),l=e.computed(()=>{const x={"modal-tips":!0,"d-flex":!0,"flex-row":!0},b=`messager-type-${o.value}`;return x[b]=!0,x}),r=e.computed(()=>{const x={};return o.value==="prompt"?x.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(x.padding="0.5rem 1.5rem 1rem 1.5rem"),x}),i=Nt(),d=Bt(n,o,a,s),c=kt(),{feedbackStyle:m,feedbackMessage:f}=c;function C(){return e.createVNode("div",{style:m.value},[f.value])}function v(){switch(o.value){case"prompt":return It(n,d);default:return Et(n,o,a,s)}}const S=v(),h=$t(n,t,i,c);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:l.value,style:r.value},[S()]),h(),C()])}}),Rt={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},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},reiszeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1}};class U{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const a=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(a.length>=6){const s=parseInt(a[4],10),l=parseInt(a[5],10);return{x:s,y:l}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new U(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new U(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let a=0;a<t.changedTouches.length;a++)if(t.changedTouches[a].target===o)return new U(t.changedTouches[a].clientX,t.changedTouches[a].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new U(0,0);if(window){const a=window.getComputedStyle(t);if(a){const s=parseInt(a.getPropertyValue("left"),10),l=parseInt(a.getPropertyValue("top"),10);o.x=isNaN(s)?0:s,o.y=isNaN(l)?0:l}return o}return null}static copy(t){return new U(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class ae{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new ae(0,0);if(window){const a=window.getComputedStyle(t);return a&&(o.width=parseInt(a.getPropertyValue("width"),10),o.height=parseInt(a.getPropertyValue("height"),10)),o}return null}static copy(t){return new ae(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function Ot(n,t){const o=e.ref(),a=e.ref(),s=e.ref(),l=e.ref(),r=e.ref(),i=e.ref(),d=e.ref(),c=e.ref(),m=e.ref(),f=e.ref(),C=e.ref(),v=e.ref(),S=e.ref(n.draggable),h=e.ref(!1);function x(){const M=a.value||document.body,I=window.getComputedStyle(M);if(!I||!o.value)return;const R=U.getTransformInfo(o.value),O={};d.value&&(O.deltaL=o.value.offsetLeft-d.value.x,O.deltaT=o.value.offsetTop-d.value.y);const H=I.getPropertyValue("position");O.width=M.clientWidth,O.height=M.clientHeight,O.pr=parseInt(I.getPropertyValue("padding-right"),10),O.pb=parseInt(I.getPropertyValue("padding-bottom"),10),O.position=I.getPropertyValue("position"),H==="static"&&(M.style.position="relative"),O.translateX=R.x,O.translateY=R.y,f.value=O}function b(M){if(o.value){l.value=ae.getCurrent(o.value),r.value=U.getCurrent(o.value),i.value=l.value?ae.copy(l.value):null,d.value=r.value?U.copy(r.value):null,x();const I=M.target.getAttribute("type")||"";c.value={n:!!I.match(/n/),s:!!I.match(/s/),w:!!I.match(/w/),e:!!I.match(/e/)}}}function w(){var M,I,R,O;if(o.value){const H=o.value;c.value&&((c.value.n||c.value.s)&&((M=i.value)!=null&&M.height)&&(H.style.height=i.value.height+"px"),(c.value.w||c.value.e)&&((I=i.value)!=null&&I.width)&&(H.style.width=i.value.width+"px"),d.value&&((R=d.value)!=null&&R.x&&(H.style.left=d.value.x+"px"),(O=d.value)!=null&&O.y&&(H.style.top=d.value.y+"px")))}}function B(){const M=n.minHeight?n.minHeight:1,I=n.minWidth?n.minWidth:1;i.value&&d.value&&c.value&&l.value&&(i.value.height<M&&(i.value.height=M,c.value.n&&r.value&&(d.value.y=r.value.y+(l.value.height-M))),i.value.width<I&&(i.value.width=I,c.value.w&&r.value&&(d.value.x=r.value.x+(l.value.width-I))),n.maxHeight&&i.value.height>n.maxHeight&&(i.value.height=n.maxHeight,r.value&&c.value.n&&(d.value.y=r.value.y+(l.value.height-n.maxHeight))),n.maxWidth&&i.value.width>n.maxWidth&&(i.value.width=n.maxWidth,c.value.w&&r.value&&(d.value.x=r.value.x+(l.value.width-n.maxWidth))))}function A(){if(a.value){const M=f.value;if(d.value&&i.value&&c.value&&l.value){const I=M.width-M.pr-M.deltaL-M.translateX-d.value.x,R=M.height-M.pb-M.deltaT-M.translateY-d.value.y;c.value.n&&d.value.y+M.translateY<0&&r.value&&(d.value.y=-M.translateY,i.value.height=l.value.height+r.value.y+M.translateY),c.value.w&&d.value.x+M.translateX<0&&r.value&&(d.value.x=-M.translateX,i.value.width=l.value.width+r.value.x+M.translateX),i.value.width>I&&(i.value.width=I),i.value.height>R&&(i.value.height=R)}}}function k(M){if(!s.value||!l.value||!r.value||!c.value)return;M.subtract(s.value);const I=M.x,R=M.y;c.value.n?(d.value.y=r.value.y+R,i.value.height=l.value.height-R):c.value.s&&(i.value.height=l.value.height+R),c.value.e?i.value.width=l.value.width+I:c.value.w&&(i.value.width=l.value.width-I,d.value.x=r.value.x+I),A(),B(),w()}function j(M){if(!m.value)return;const I=U.fromEvent(M);I&&k(I)}function N(){if(o.value){const{width:M,height:I,x:R,y:O}=o.value.getBoundingClientRect(),H=U.getTransformInfo(o.value);return{size:{width:M,height:I},position:{x:R-H.x,y:O-H.y}}}return null}function E(M){if(o.value){const I=N();C.value=I}s.value=void 0,l.value=null,r.value=null,i.value=null,d.value=null,c.value=null,m.value=null,document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",E)}function $(){document.addEventListener("mousemove",j),document.addEventListener("mouseup",E)}function T(M){M instanceof MouseEvent&&M.button===2||S.value&&(M.stopPropagation(),M.preventDefault(),s.value=U.fromEvent(M),m.value=M.target,b(M),$())}function g(M){return o.value=M,e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:I=>T(I)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:I=>T(I)},null)])}function p(M=!0){const I=a.value||document.body,R=ae.getCurrent(I),O=o.value;M&&(v.value=N(),v.value.transform=O.style.transform),R&&O&&(i.value=R,O.style.height=i.value.height-14+"px",O.style.width=i.value.width-14+"px",O.style.left="7px",O.style.top="7px",O.style.transform="",C.value={size:i.value,position:{x:0,y:0}},S.value=!1,h.value=!0)}function u(){var M,I;if(v.value){const R={width:v.value.size.width||0,height:v.value.size.height||0},O={x:(window.innerWidth-R.width)/2,y:(window.innerHeight-R.height)/2};(M=i.value)==null||M.set(R),(I=d.value)==null||I.set(O);const H=o.value;H.style.height=R.height+"px",H.style.width=R.width+"px",H.style.left=`${O.x}px`,H.style.top=`${O.y}px`,H.style.transform="",C.value={size:R,position:O},S.value=n.draggable,h.value=!1}}function y(){if(o.value){const M=ae.getCurrent(o.value);if(M){const{width:I,height:R}=M;o.value.style.left=`${(window.innerWidth-I)/2}px`,o.value.style.top=`${(window.innerHeight-R)/2}px`,o.value.style.transform=""}}}function V(){const M=()=>{h.value?p(!1):y()};return window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)}}const D=V();return{renderResizeBar:g,boundingElement:a,resizedEventParam:C,maximize:p,restore:u,allowDrag:S,isMaximized:h,unWindowResizeHandle:D}}function At(n,t,o){const a=e.ref(),s=e.ref(n.draggable),l=e.ref(n.lockAxis),r=e.ref(),i=e.ref(),d=e.ref(!1),c=e.ref(new U(0,0)),m=e.ref(new U(0,0)),f=e.ref(new U(0,0)),C=e.ref(new U(0,0));e.watch(()=>o.value,N=>{r.value.style.cursor=N?"move":"default"});function v(N,E){if(E.tagName==="BUTTON")return!1;if(E===N)return!0;for(const $ in E.children)if(E.children.hasOwnProperty($)&&v(N,E.children[$]))return!0;return!1}function S(){var T,g;let N=f.value.x+m.value.x,E=f.value.y+m.value.y;l.value==="x"?(N=((T=c.value)==null?void 0:T.x)||0,f.value.x=0):l.value==="y"&&(E=((g=c.value)==null?void 0:g.y)||0,f.value.y=0);const $=`translate3d(${Math.round(N)}px, ${Math.round(E)}px, 0px)`;a.value&&(a.value.style.transform=$),C.value.x=N,C.value.y=E}function h(){if(!i.value||!a.value)return null;const N=i.value.getBoundingClientRect(),E=a.value.getBoundingClientRect(),$={top:N.top<E.top,right:N.right>E.right,bottom:N.bottom>E.bottom,left:N.left<E.left};return $.top||(f.value.y-=E.top-N.top),$.bottom||(f.value.y-=E.bottom-N.bottom),$.right||(f.value.x-=E.right-N.right),$.left||(f.value.x-=E.left-N.left),S(),$}function x(N){N&&(c.value&&N.subtract(c.value),f.value.set(N),S(),h())}function b(N){d.value&&s.value&&(N.stopPropagation(),N.preventDefault(),x(U.fromEvent(N,r.value)))}function w(){var N;d.value&&(d.value=!1,m.value.add(f.value),f.value.reset(),(N=a.value)==null||N.classList.remove("ng-dragging"),document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",w))}function B(){!d.value&&r.value&&(d.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",b),document.addEventListener("mouseup",w))}function A(){if(a.value){const N=U.getTransformInfo(a.value);m.value.set(N);return}m.value.reset()}function k(N){if(!o.value||N instanceof MouseEvent&&N.button===2)return;const E=N.target||N.srcElement;r.value!==void 0&&E&&!v(E,r.value)||s.value!==!1&&(document.body.click(),N.stopPropagation(),N.preventDefault(),c.value=U.fromEvent(N,a.value),A(),B())}function j(N,E,$){if(s.value&&E){if(N)r.value=N;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)r.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const T=E.querySelector(n.dragHandle);T&&(r.value=T)}}a.value=E,i.value=$,r.value.classList.add("ng-draggable"),r.value.addEventListener("mousedown",k)}}return{registerDraggle:j,resetTranslate:A}}function We(n,t){if(n){const o=a=>{a.key.toLowerCase()===n.toLowerCase()&&t({event:a,key:n})};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}}}function Lt(n,t){const o=e.ref(n.enableEsc);let a=null;return o.value?(a=We("Escape",s=>{t.emit("esc",{event:s.event,type:"esc"})}),{remove:a}):null}function Ft(n,t){const o=e.ref(n.enableEnter);let a=null;return o.value?(a=We("Enter",s=>{t.emit("enter",{event:s.event,type:"enter"})}),{remove:a}):null}const _e=e.defineComponent({name:"FModal",props:Rt,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter"],setup(n,t){const o=e.ref(n.width||300),a=e.ref(n.height||200),s=e.ref(n.modelValue),l=e.ref(""),r=e.ref(n.class),i=e.ref(n.fitContent),d=e.ref(n.showHeader),c=e.ref(""),m=e.ref(n.showCloseButton),f=e.ref(n.showMaxButton),C=e.ref(!1),v=e.ref(""),S=e.ref(""),h=e.ref(""),x=e.ref(n.showButtons),b=e.ref(n.title),w=e.ref(n.reiszeable),B=e.ref(n.containment||null),A=e.ref();function k(P,W){s.value=!1,t.emit("update:modelValue",!1),W!=null&&t.emit(W?"accept":"cancel"),t.emit("closed",P)}const j=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:P=>{k(P,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:P=>{k(P,!0)}}],N=e.ref(n.buttons&&n.buttons.length?n.buttons:j),E=e.computed(()=>!!c.value),$=e.computed(()=>!!x.value&&!!N.value),T=e.ref(),g=e.ref(),p=e.ref(!1),{renderResizeBar:u,maximize:y,restore:V,boundingElement:D,resizedEventParam:M,allowDrag:I,unWindowResizeHandle:R}=Ot(n),{registerDraggle:O}=At(n,t,I);e.watch(()=>n.title,(P,W)=>{P!==W&&(b.value=P)}),e.watch(()=>n.modelValue,(P,W)=>{P!==W&&(s.value=P)}),e.watch(()=>n.showHeader,(P,W)=>{P!==W&&(d.value=P)}),e.watch(()=>n.showButtons,(P,W)=>{P!==W&&(x.value=P)}),e.watch(()=>M.value,(P,W)=>{const ie=P||{},be=W||{};JSON.stringify(ie)!==JSON.stringify(be)&&t.emit("resize",{newSize:P,oldSize:W})});function H(){const P=document.querySelectorAll(".farris-modal").length;(!P||P-1<=0)&&document.body.classList.remove("modal-open"),A.value&&A.value.classList.remove("show")}const Y=e.computed(()=>(s.value?document.body.classList.add("modal-open"):H(),s.value)),ne=e.computed(()=>{const P={modal:!0,"farris-modal":!0,fade:!0};return P["f-modal-fitContent"]=!!i.value,P.show=!!Y.value,P}),se=e.computed(()=>{var ie;const P={"modal-dialog":!0},W=(ie=r.value)==null?void 0:ie.split(" ");return W==null||W.reduce((be,zn)=>(be[zn]=!0,be),P),P}),K=e.computed(()=>({position:"absolute",top:`${(window.innerHeight-a.value)/2}px`,left:`${(window.innerWidth-o.value)/2}px`,width:`${o.value}px`,height:i.value?"auto":`${a.value}px`})),oe=e.computed(()=>({"modal-content":!0,"modal-content-has-header":d.value})),z=e.computed(()=>{const P={display:d.value?"":"none"};return P["pointer-events"]=I.value?"auto":"none",P}),_=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:p.value})),J=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":v.value==="iframe"}));function q(){return{}}const X=e.computed(()=>{const P={textAlgin:h.value},W=q();return Object.assign(P,W)});function ee(P){if(P.stopPropagation(),p.value){p.value=!1,V();return}y(),p.value=!0}async function ge(P,W){P.handle&&await P.handle(W,P)&&t.emit("closed",W)}function On(P){P.width&&(o.value=P.width),P.height&&(a.value=P.height),P.buttons&&(N.value=P.buttons),P.title&&(b.value=P.title)}let Be=null,ke=null;e.onMounted(()=>{g.value&&!B.value&&(B.value=g.value.parentElement,D.value=B.value,O(T.value,g.value,D.value)),Y.value&&document.body.classList.add("modal-open"),Be=Lt(n,t),ke=Ft(n,t)}),e.onUnmounted(()=>{H(),R&&R(),Be&&Be.remove(),ke&&ke.remove()}),t.expose({modalElementRef:g,updateModalOptions:On,close:k,maxDialog:ee});function An(){return e.createVNode("ul",null,[C.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&e.createVNode("li",{onClick:ee,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:_.value},null)]),m.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:P=>k(P,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ln(){return e.createVNode("div",{class:"modal-footer",style:X.value},[N.value&&N.value.map(P=>e.createVNode("button",{name:P.name,type:"button",class:P.class+(P.iconClass?" btn-icontext":""),onClick:W=>{ge(P,W)}},[!!P.iconClass&&e.createVNode("i",{class:P.iconClass},null),P.text]))])}function Fn(){return e.createVNode("div",{ref:T,class:"modal-header",style:z.value},[e.createVNode("div",{class:"modal-title"},[E.value&&e.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[b.value])]),e.createVNode("div",{class:"actions"},[An()])])}function Hn(P){P.stopPropagation()}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>[Y.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>{var P,W;return[e.createVNode("div",{class:ne.value,style:"display: block",ref:A,onClick:Hn},[e.createVNode("div",{id:l.value,class:se.value,style:K.value,ref:g},[e.createVNode("div",{class:oe.value},[d.value&&Fn(),e.createVNode("div",{class:J.value},[(W=(P=t.slots).default)==null?void 0:W.call(P),v.value==="iframe"&&e.createVNode("iframe",{title:l.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:S.value},null)]),$.value&&Ln()]),!i.value&&w.value&&g.value&&u(g.value)])])]}})]})}});function Ue(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Ht(n){const t=document.createElement("div");t.style.display="contents";const o=e.createApp({setup(a,s){e.onUnmounted(()=>{document.body.removeChild(t)});const l=e.ref(),r=e.ref(n.class||""),i=e.ref(!!n.showButtons),d=e.ref(!!n.showHeader),c=e.ref(n.showCloseButton==null?!0:n.showCloseButton),m=e.ref(!0),f=e.ref(n.title||""),C=n.acceptCallback||(()=>{}),v=n.rejectCallback||(()=>{}),S=n.closedCallback||(w=>{}),h=n.resizeHandle||(w=>{}),x=Ue(n),b=w=>{m.value=!1,o.unmount(),S(w)};return e.onMounted(()=>{}),s.expose({modalRef:l}),()=>e.createVNode(_e,{ref:l,class:r.value,modelValue:m.value,"onUpdate:modelValue":w=>m.value=w,title:f.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":d.value,"show-buttons":i.value,"show-close-button":c.value,"show-max-button":!1,onAccept:C,onCancel:v,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:b,onResize:h},{default:()=>[x&&x(o)]})}});return document.body.appendChild(t),o.mount(t),o}class zt{constructor(t){L(this,"appContext",null);L(this,"modalRef",e.ref());L(this,"activeModalIndex",e.ref(0));L(this,"modalRefs",{});L(this,"isUseEscCloseModal",e.ref(!1));L(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return Ht(o)}open(t){const o=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const a=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),s=e.ref(!0),l=a.value.acceptCallback||(()=>{}),r=a.value.rejectCallback||(()=>{}),i=a.value.closedCallback||((b,w)=>{}),d=a.value.resizeHandle||(b=>{});let c;const m=Ue(a.value),f=b=>{var B;s.value=!1;const w=(B=b==null?void 0:b.target)==null?void 0:B.classList.contains("modal_close");i(b,this.isUseEscCloseModal.value?"esc":w?"icon":"button")},C=b=>{f(b),c&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,o),c=null,this.modalRef.value=null,this.modalRefs){const w=Object.keys(this.modalRefs);w.length>0?this.activeModalIndex.value=Math.max(...w):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},v=b=>{var w;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((w=this.activeModalInstance.value)==null||w.close(b==null?void 0:b.event))},S=()=>e.createVNode(_e,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":b=>s.value=b},a.value,{onAccept:l,onCancel:r,onClosed:C,onResize:d,onEsc:v}),{default:()=>[m&&m()]});return c=(b=>{const w=e.h(S,b);return w.appContext=this.appContext,e.render(w,o),w})({...a.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:b=>{a.value={...a.value,...b},c&&e.render(e.cloneVNode(c,{...a}),o)},destroy:C,modalRef:this.activeModalInstance}}}class Q{static show(t){let o=new zt;const a=e.reactive({...t}),s=!1,l=a.type==="error"||a.type==="prompt",r=a.type==="error"?"错误提示":a.type==="prompt"&&a.title||"",i=a.acceptCallback||(()=>{}),d=a.rejectCallback||(()=>{});let c=null;const m=()=>{c&&(c==null||c.destroy(),o=null)};c=o==null?void 0:o.open({class:"modal-message modal-message-type-info",title:r,showButtons:s,showHeader:l,width:a.width||400,fitContent:!0,showMaxButton:!1,render:()=>e.createVNode(fe,e.mergeProps(a,{onAccept:i,onReject:d,onClose:m}),null)})}static info(t,o){const a=e.reactive({type:"info",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Q.show(a)}static warning(t,o){const a=e.reactive({type:"warning",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Q.show(a)}static success(t,o){const a=e.reactive({type:"success",title:t,detail:o,okButtonText:"关闭",cancelButtonText:""});Q.show(a)}static error(t,o,a){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:a,message:t,detail:o}});Q.show(s)}static prompt(t,o){const a=e.reactive({type:"prompt",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消"});Q.show(a)}static question(t,o,a,s){const l=e.reactive({type:"question",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:a,rejectCallback:s});Q.show(l)}}fe.install=n=>{n.component(fe.name,fe),n.provide("FMessageBoxService",Q)};function qt(n,t,o,a,s,l){const{activeId:r,removeTab:i,selectTab:d,removeDesignTab:c,selectDesignTab:m}=s,f=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":n.autoTitleWidth})),C=e.computed(()=>{const $={"farris-component":!0,"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled};return $[`${t.id}-design-item`]=!0,$}),v=e.computed(()=>({width:`${t.tabWidth}px`})),S=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function h($){return e.createVNode("span",{class:f.value,title:$.title},[$.title])}function x($){return $.slots.title?$.slots.title:h}const b=x(o),w=e.ref(t.removeable);function B(){return e.createVNode("span",{class:"st-drop-close",onClick:$=>i($,t.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function A($){d(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}function k($){m($,t.id,l.value)}function j($){Q.question(`确定删除标签页【${o.props.title}】?`,"",()=>c($,t.id),()=>{})}function N(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:$=>j($)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function E(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[N()])])}return e.createVNode("li",{onClick:$=>k($),class:C.value,style:v.value,id:`${t.id}-design-item`},[E(),e.createVNode("a",{class:S.value,onClick:A},[b(t),w.value&&B()])])}function Wt(n,t,o,a,s,l,r){const{shouldShowNavigationButtons:i}=o,{tabPages:d}=s,c=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":i.value})),m=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),f=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"})),C=e.computed(()=>({overflow:"auto"}));function v(h){const{componentType:x}=h;let b=re(x,h);r&&r.onResolveNewComponentSchema&&(b=r.onResolveNewComponentSchema(h,b));const w=x.toLowerCase().replace("-","_");return b&&!b.id&&b.type===x&&(b.id=`${w}_${Math.random().toString().slice(2,6)}`),b}const S=function(h){var B;const x={componentType:"tab-page",label:"Tab1",parentComponentInstance:l.value,targetPosition:-1},b=v(x);(B=l.value.schema.contents)==null||B.push(b);const{selectTabByTabId:w}=s;w(b.id)};return()=>e.createVNode("div",{class:c.value,style:m.value},[e.createVNode("ul",{class:f.value,style:C.value,ref:t},[d.value.map(h=>qt(n,h.props,h,a,s,l)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:h=>S()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function Xe(n,t,o){var A;function a(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}a();const s=o&&o.getStyles&&o.getStyles()||"",l=o&&o.getDesignerClass&&o.getDesignerClass()||"",r=e.ref();function i(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function d(){return!1}function c(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function m(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function f(k){if(!k||!k.value)return null;if(k.value.schema&&k.value.schema.type==="component")return k.value;const j=e.ref(k==null?void 0:k.value.parent),N=f(j);return N||null}function C(k=t){const{componentInstance:j,designerItemElementRef:N}=k;return!j||!j.value?null:j.value.canMove?N:C(k.parent)}function v(k){return!!o&&o.canAccepts(k)}function S(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function h(){}function x(k,j){j&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(j)}function b(k,j){const{componentType:N}=k;let E=re(N,k,j);o&&o.onResolveNewComponentSchema&&(E=o.onResolveNewComponentSchema(k,E));const $=N.toLowerCase().replace("-","_");return E&&!E.id&&E.type===N&&(E.id=`${$}_${Math.random().toString().slice(2,6)}`),E}function w(k){}function B(...k){if(o&&o.getPropsConfig)return o.getPropsConfig(...k)}return r.value={canMove:i(),canSelectParent:d(),canDelete:c(),canNested:!m(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(A=t==null?void 0:t.parent)==null?void 0:A.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:l,canAccepts:v,getBelongedComponentInstance:f,getDraggableDesignItemElement:C,getDraggingDisplayText:S,getPropConfig:B,getDragScopeElement:h,onAcceptMovedChildElement:x,onChildElementMovedOut:w,addNewChildComponentSchema:b,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},r}class Ye{getTemplateRule(t,o){const a=o==null?void 0:o.formSchemaUtils,s=a==null?void 0:a.getFormTemplateRule(),l={canAccept:!0,canDelete:!0,canMove:!0};if(!s)return l;const r=this.getComponentContext(t);return r.componentClassList.forEach(d=>{if(!d||!s[d])return;const{canMove:c,canDelete:m,canAccept:f}=s[d];l.canMove=l.canMove&&this.resolveRuleValue(c,r),l.canDelete=l.canDelete&&this.resolveRuleValue(m,r),l.canAccept=l.canAccept&&this.resolveRuleValue(f,r)}),l}resolveRuleValue(t,o){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,o)}parseRuleValueSchema(t,o){const a=t.invalidContext||[];let s=!0;for(const l of a){if(l.firstLevelChild){if(l.firstLevelChild.class){const r=o.firstLevelChildClassList;if(r&&!r.includes(l.firstLevelChild.class)){s=!1;continue}}if(l.firstLevelChild.type){const r=o.firstLevelChildSchema;if(r&&r.type!==l.firstLevelChild.type){s=!1;continue}}}if(l.secondLevelChild){if(l.secondLevelChild.class){const r=o.secondLevelChildClassList;if(r&&!r.includes(l.secondLevelChild.class)){s=!1;continue}}if(l.secondLevelChild.type){const r=o.secondLevelChildSchema;if(r&&r.type!==l.secondLevelChild.type){s=!1;continue}}}if(l.parent){if(l.parent.class){const r=o.parentClassList;if(r&&!r.includes(l.parent.class)){s=!1;continue}}if(l.parent.type){const r=o.parentSchema;if(r&&r.type!==l.parent.type){s=!1;continue}}}s=!0;break}return!s}getComponentContext(t){var h,x,b,w;const o=t.schema,a=o.appearance&&o.appearance.class||"",s=a.split(" ")||[],l=o.contents||[],r=l.length?l[0]:null,i=r&&r.appearance?r.appearance.class:"",d=i?i.split(" "):[],c=(h=r==null?void 0:r.contents)!=null&&h.length?r==null?void 0:r.contents[0]:null,m=c&&c.appearance?c.appearance.class:"",f=m?m.split(" "):[],C=o.type==="component"?(b=(x=t.parent)==null?void 0:x.parent)==null?void 0:b.schema:(w=t.parent)==null?void 0:w.schema,v=C&&C.appearance&&C.appearance.class||"",S=v?v.split(" "):[];return{componentClass:a,componentClassList:s,childContents:l,firstLevelChildSchema:r,firstLevelChildClass:i,firstLevelChildClassList:d,secondLevelChildSchema:c,secondLevelChildClass:m,secondLevelChildClassList:f,parentSchema:C,parentClass:v,parentClassList:S}}}const _t={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"}},setPropertyRelates(n,t){if(n)switch(n&&n.propertyID){case"title":{n.needRefreshControlTree=!0;break}}}},appearance:{description:"",title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},width:{description:"组件的宽度",title:"宽度(px)",type:"number"},height:{description:"组件的高度",title:"高度(px)",type:"number"}}},behavior:{description:"",title:"行为",properties:{removeable:{description:"是否可移除",type:"boolean",title:"是否可移除"}}}}},Ut={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:"combo-list",textField:"value",valueField:"key",data:[{key:"tabs",value:"标签页"}]}}}},appearance:{description:"",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:"boolean",title:"标题自适应宽度",defaultValue:!1},fill:{description:"flex布局下,填充满剩余部分",type:"boolean",title:"填充"}}}}};function Xt(n,t){const o=n.schema,a=new Ye,{canMove:s,canAccept:l,canDelete:r}=a.getTemplateRule(n,t);function i(C){return l}function d(){return r}function c(){return s}function m(){return!s&&!r}function f(C){var S;return((S=document.querySelector(".dgComponentFocused"))==null?void 0:S.id)===`${o.id}-design-item`?Ut:_t}return{canAccepts:i,checkCanDeleteComponent:d,checkCanMoveComponent:c,getPropsConfig:f,hideNestedPaddingInDesginerView:m}}const me=e.ref(0);function Yt(n,t){const o=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=a.top>=o.top,l=a.top<=o.bottom;return s&&l}function Gt(n){if(!n)return;let t;if(n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),!t)return;const o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;const a=t.querySelector(".component-btn-group");if(a){if(!Yt(t,n)){a.style.display="none";return}a.style.display="";const l=a.getBoundingClientRect(),r=a.querySelector("div");if(r){const i=r.getBoundingClientRect();r.style.top=l.top+"px",r.style.left=l.left-i.width+"px"}}}function Jt(n,t,o,a){const s=e.ref([]),l=e.ref(n.activeId||""),r=e.ref(!0),i=e.ref(),d=e.ref([]);function c(u){const y=u.value.findIndex(V=>V.props.show!==!1&&!l.value&&!V.props.disabled);!l.value&&y!==-1&&(l.value=u.value[y].props.id)}function m(u,y){u.classList.contains(y)||u.classList.add(y)}function f(u,y){u.classList.remove(y)}function C(u){const{parentElement:y}=u;y&&(u.scrollWidth>y.offsetWidth?m(u,"farris-title-text-custom"):f(u,"farris-title-text-custom"))}function v(u){var V;if(n.autoTitleWidth)return;const y=(V=u.value)==null?void 0:V.querySelectorAll(".st-tab-text");y&&y.forEach(D=>C(D))}const S=u=>{u.preventDefault(),u.stopPropagation()};function h(u){s.value=s.value.filter(y=>y.props.id!==u),l.value===u&&(l.value="",c(s))}function x(u,y,V=!1){const D=s.value.findIndex(M=>M.props.id===y);h(y),S(u),e.nextTick(()=>{v(o),V&&(r.value=!0),t.emit("tabRemove",{removeIndex:D,removeId:y,activeId:l.value})})}function b(){const u=s.value.find(D=>D.props.id===l.value);if(d.value=[],u&&u.props.toolbar){const D=u.props.toolbar.hasOwnProperty("contents")?"contents":"buttons";u.props.toolbar[D]&&u.props.toolbar[D].length&&(d.value=[...u.props.toolbar[D]])}const y=a.schema.contents,V=y==null?void 0:y.find(D=>D.id===l.value);i.value=V==null?void 0:V.toolbar}function w(u){const y=l.value;l.value=u,b(),t.emit("tabChange",{prevId:y,nextId:l.value})}function B(u){w(u)}function A(u){s.value.findIndex(V=>V.props.id===u.props.id)===-1&&s.value.push(u)}function k(u){s.value.findIndex(V=>V.props.id===u.props.id)!==-1&&(s.value.forEach(V=>{V.props.id===u.props.id&&(V=u)}),e.nextTick(()=>{v(o)}))}function j(u){u&&(u.stopPropagation(),u.preventDefault())}function N(u,y){j(u);const V=a.schema.contents,D=V==null?void 0:V.findIndex(M=>M.id===y);D===-1||D===void 0||(V==null||V.splice(D,1),h(y),me.value++)}function E(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(y=>y.classList.remove("dgComponentFocused"));const u=document.getElementsByClassName("dgComponentSelected");Array.from(u).forEach(y=>y.classList.remove("dgComponentSelected"))}function $(u){u.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function T(u,y){var I;const{contents:V=[]}=a.schema,D=V==null?void 0:V.findIndex(R=>R.id===u),M=V[D];(I=a==null?void 0:a.setupContext)==null||I.emit("selectionChange",M.type,M,n.componentId,y)}function g(u,y,V){E(),j(u),$(u),T(y,V)}function p(u,y){E(),j(u),$(u)}return{activeId:l,addTab:A,changeTitleStyle:v,removeTab:x,selectTab:B,selectTabByTabId:w,tabPages:s,updateTab:k,toolbarItems:d,removeDesignTab:N,selectDesignTab:g,selectDesignTabToolbar:p,toolbarSchema:i}}const Zt=new Map([["buttons","items"],["appearance",ce]]),Qt=new Map([["appearance",Kt]]);function Kt(n,t){return{class:t.class,style:t.style}}function Ge(n,t,o){return t}const en={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar.schema.json",title:"response-toolbar",description:"A Farris Toolbar Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar"},appearance:{description:"",type:"object",properties:{class:{type:"string"}},default:{}},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}},required:["id","type","buttons"]},Me={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar-item.schema.json",title:"response-toolbar-item",description:"A Farris Toolbar Item Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string",default:"btn-secondary"}},default:{}},alignment:{description:"对齐",type:"string",default:"right"},text:{description:"文本",type:"string",default:"按钮"},icon:{description:"图标",type:"string",default:""},disabled:{description:"禁用",type:"boolean",default:!1},onClick:{description:"点击事件",type:"string",default:""}},required:["id","type","text"]},Je={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:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}},Ze={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};ve[Me.title]=Me,Ee[Je.title]=Je;const tn=Object.assign({},Ze,{componentId:{type:String,default:""}});le(Ze,en,Zt,Ge);const Qe={id:{type:String,default:""},items:{type:Object,default:{}},class:{type:String,default:""},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},componentId:{type:String,default:""},alignment:{Type:String,default:"right"}};le(Qe,Me,Qt,Ge);class Ke{constructor(t){L(this,"id","");L(this,"class","btn-secondary");L(this,"icon","");L(this,"groupId","");L(this,"order",-1);L(this,"asDropDownTop",!1);L(this,"text","");L(this,"visible",!0);L(this,"responsed",!1);L(this,"tipsEnable",!1);L(this,"tipsText","");L(this,"width",0);L(this,"onClick",()=>{});L(this,"options");this.options=t;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(t).filter(a=>o.indexOf(a)>-1).forEach(a=>{this[a]=t[a]})}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:e.computed(()=>!0)}setWidth(t){this.width=parseInt(t,10)}getWidth(){return this.visible?this.width:!1}}class nn extends Ke{constructor(t){super(t)}}function on(){function n(t){const o=[];return t.reduce((a,s)=>(s.children&&s.children.length>0?a.push(new he(s)):a.push(new nn(s)),a),o),o}return{buildResponseToolbarItems:n}}const{buildResponseToolbarItems:an}=on();class he extends Ke{constructor(o){super(o);L(this,"placement","");L(this,"dropdownClass","");L(this,"menuClass","");L(this,"split",!1);L(this,"children",[]);L(this,"expanded",!1);const a=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(s=>a.indexOf(s)>-1).forEach(s=>{this[s]=o[s]}),o.children&&o.children.length&&(this.children=an(o.children))}}function sn(){function n(o){const a={"f-icon":!0};if(o.icon){const s=o.icon.trim().split(" ");s&&s.length&&s.reduce((l,r)=>(l[r]=!0,l),a)}return a}function t(o){return!!(o.icon&&o.icon.trim())}return{iconClass:n,shouldShowIcon:t}}function rn(n,t){const o=e.inject("design-item-context"),a=e.inject("toolbar-item-handler",()=>{});function s(){a&&a()}function l(g){const p={"dropdown-menu":!0};if(g.class){const u=g.menuClass.split(" ");u&&u.length&&u.reduce((y,V)=>(y[V]=!0,y),p)}return p}function r(g){const p={disabled:!g.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},u=g.dropdownClass.split(" ");return u&&u.length&&u.reduce((y,V)=>(y[V]=!0,y),p),p}function i(g){const p={disabled:!g.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},u=g.class.split(" ");return u&&u.length&&u.reduce((y,V)=>(y[V]=!0,y),p),p}let d;const c=new Map;function m(g,p,u){var V;((V=g.target)==null?void 0:V.id)===p.id&&g.stopPropagation();const y=u?u.id:"__top_item__";if(p.children&&p.children.length&&(p.expanded=!p.expanded,p.expanded?c.set(y,p):c.delete(y)),c.has(y)&&c.get(y)!==p){const D=c.get(y);D&&(D.expanded=!1)}}function f(g){g&&(g.stopPropagation(),g.preventDefault())}function C(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(p=>p.classList.remove("dgComponentFocused"));const g=document.getElementsByClassName("dgComponentSelected");Array.from(g).forEach(p=>p.classList.remove("dgComponentSelected"))}function v(g){g.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function S(g){const{buttons:p=[]}=o.schema;let u=[];p.forEach(D=>{u=u.concat(D.children||[])});const y=u.findIndex(D=>D.id===g),V=y===-1?null:u[y];return{index:y,item:V}}function h(g){const{buttons:p=[]}=o.schema,u=p.findIndex(V=>V.id===g),y=u===-1?null:p[u];return{index:u,item:y}}function x(g){var y;o.schema;const{index:p,item:u}=S(g);(y=o==null?void 0:o.setupContext)==null||y.emit("selectionChange",u==null?void 0:u.type,u)}const b=function(g){const{componentType:p}=g,u=re(p,g),y=p.toLowerCase().replace("-","_");return u&&!u.id&&u.type===p&&(u.id=`${y}_${Math.random().toString().slice(2,6)}`),u},w=function(){const g={componentType:"response-toolbar-item",parentComponentInstance:t.value,targetPosition:-1};return b(g)};function B(g,p){f(g),C(),v(g),x(p.id)}function A(g,p,u){f(g);const y=p.id,V=u&&u.id,{buttons:D=[]}=o.schema;if(!V)return;const{index:M}=h(V);if(M===-1)return;const{index:I}=S(y);I!==-1&&(D[M].children.splice(I,1),s())}function k(g,p,u){f(g);const y=u&&u.id,{buttons:V=[]}=o.schema;if(!y)return;const{index:D}=h(y);if(D===-1)return;const M=w(),I=Object.assign({},M,{text:p.text});V[D].children.push(I),s()}function j(g,p,u){f(g);const y=u&&u.id,{buttons:V=[]}=o.schema;if(!y)return;const{index:D}=h(y);if(D===-1)return;const M=w(),I=Object.assign({},M,{text:"按钮"});V[D].children.push(I),s()}function N(g,p){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=>A(u,g,p)},[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=>k(u,g,p)},[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=>j(u,g,p)},[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(g){return g.children.map(p=>p.children&&p.children.length?e.createVNode("li",{class:r(p),id:p.id,onClick:u=>p.enable&&m(u,p,g)},[e.createVNode("span",{id:p.id,class:i(p),onMouseover:u=>p.enable&&m(u,p,g)},[p.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),d(p,p)]):e.createVNode("li",{class:i(p),id:p.id,onClick:u=>B(u,p)},[N(p,g),n.shouldShowIcon(p)&&e.createVNode("i",{class:n.iconClass(p)},null),p.text]))}function $(g,p,u){const y={display:g.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},V=document.getElementsByTagName("body")[0].getClientRects()[0].width,D=p,M=D==null?void 0:D.getClientRects();if(D&&M&&M.length){const{top:I,width:R,left:O,right:H,height:Y}=M[0],ne=Math.ceil(Y+I);y.top=`${ne}px`,y.left=`${O}px`;const se=g.id+"_menu",K=p?p.querySelector("#"+se):null;if(K){y.display==="block"&&(K.style.display="block");const oe=K.getBoundingClientRect();if(u){y.top=`${I-6}px`;const z=Math.ceil(R+O);y.left=`${z}px`}V-O-R<oe.width&&(y.left=`${(u?O:H)-oe.width}px`)}}return y}d=function(g,p){var D,M;const u=e.getCurrentInstance(),y=p?p.id:g.id,V=(M=(D=u==null?void 0:u.exposed)==null?void 0:D.elementRef.value)==null?void 0:M.querySelector("#"+y);return e.createVNode("ul",{class:l(g),style:$(g,V,p),id:g.id+"_menu"},[E(g)])};function T(){c.forEach(g=>{g.expanded=!1}),c.clear()}return{renderDropdownMenu:d,clearAllDropDownMenu:T}}function ln(n,t,o){const a=e.ref(n.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:l}=rn(t,o),r=e.inject("design-item-context"),i=e.inject("toolbar-item-handler",()=>{});function d(){i&&i()}function c(T){const g={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":a.value==="right","f-btn-mr":a.value==="left"},p=T.dropdownClass.split(" ");return p&&p.length&&p.reduce((u,y)=>(u[y]=!0,u),g),g}function m(T){const g={btn:!0,disabled:!T.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(T.icon&&T.icon.trim())};if(T.class){const p=T.class.split(" ");p&&p.length&&p.reduce((u,y)=>(u[y]=!0,u),g)}return g}function f(T){T&&(T.stopPropagation(),T.preventDefault())}function C(T,g){f(T);const p=g.expanded;document.body.click(),g.expanded=!p}const v=function(T){const{componentType:g}=T,p=re(g,T),u=g.toLowerCase().replace("-","_");return p&&!p.id&&p.type===g&&(p.id=`${u}_${Math.random().toString().slice(2,6)}`),p},S=function(){const T={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return v(T)};function h(T){const g=r.schema.buttons||r.schema.contents,p=g==null?void 0:g.findIndex(y=>y.id===T),u=p===-1?null:g[p];return{index:p,toolbarItem:u}}function x(T,g){var M;const{index:p,toolbarItem:u}=h(g);if(p===-1)return;const y=u.text||"按钮",V=S(),D=Object.assign({},V,{text:y});(M=r.schema.buttons)==null||M.push(D),d()}function b(T,g){const{index:p,toolbarItem:u}=h(g);if(p===-1)return;const y=u.text||"按钮",V=S(),D=Object.assign({},V,{text:y}),M=r.schema.buttons[p].children||[];M.push(D),r.schema.buttons[p].children=M,d()}function w(T,g){const p=r.schema.buttons||r.schema.contents,u=p==null?void 0:p.findIndex(y=>y.id===g);u!==-1&&(p.splice(u,1),d())}function B(T){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:g=>w(g,T)},[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:g=>x(g,T)},[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:g=>b(g,T)},[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 A(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused"));const T=document.getElementsByClassName("dgComponentSelected");Array.from(T).forEach(g=>g.classList.remove("dgComponentSelected"))}function k(T){T.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function j(T){var y;const g=r.schema.buttons||r.schema.contents,p=g==null?void 0:g.findIndex(V=>V.id===T);if(p===-1)return;const u=g[p];(y=r==null?void 0:r.setupContext)==null||y.emit("selectionChange","response-toolbar-item",u)}function N(T,g){f(T),A(),k(T),f(T),C(T,g),j(g.id)}function E(T){return e.createVNode("div",{id:T.id,class:c(T)},[e.createVNode("div",{class:m(T),style:"display: flex;padding-right: 0.1rem;",onClick:g=>T.enable&&N(g,T)},[B(T.id),t.shouldShowIcon(T)&&e.createVNode("i",{class:t.iconClass(T)},null),e.createVNode("span",null,[T.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(T)])}function $(){l()}return{renderToolbarDropdown:E,clearAllDropDown:$}}class Ne{constructor(t,o){L(this,"componentId");L(this,"viewModelId");L(this,"eventsEditorUtils");L(this,"formSchemaUtils");L(this,"formMetadataConverter");L(this,"designViewModelUtils");L(this,"designViewModelField");L(this,"controlCreatorUtils");L(this,"designerHostService");L(this,"schemaService",null);L(this,"metadataService",null);L(this,"propertyConfig",{type:"object",categories:{}});var a;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((a=this.formSchemaUtils)==null?void 0:a.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService,this.schemaService=o.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const a=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=a.fields.find(s=>s.id===o)}t.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(t,o){}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:t.type,name:G[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,o){const a=o&&o.parent&&o.parent.schema;if(!a)return;const s=a.contents.findIndex(r=>r.id===t),l=Z.cloneDeep(a.contents[s]);a.contents.splice(s,1),a.contents.splice(s,0,l)}}class cn extends Ne{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getBehaviorProperties(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.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",textField:"value",valueField:"key",data:[{key:"response-toolbar",value:G["response-toolbar"].name}]}}}}}getBehaviorProperties(t){this.propertyConfig.categories.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",refreshPanelAfterChanged:!0}}}}}function dn(n,t){const o=n.schema;function a(m){return!1}function s(m,f){return f.text=m.label,f}function l(){return!1}function r(){return!1}function i(){return!0}function d(){return!0}function c(m){return new cn(m,t).getPropertyConfig(o)}return{canAccepts:a,checkCanAddComponent:i,checkCanDeleteComponent:r,checkCanMoveComponent:l,hideNestedPaddingInDesginerView:d,onResolveNewComponentSchema:s,getPropsConfig:c}}const un={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function pn(n,t,o){var A;function a(){}const s="",l=e.ref();function r(){return!0}function i(){return!1}function d(){return!0}function c(){return!0}function m(){return!0}function f(k){if(!k||!k.value)return null;const j=e.ref(k==null?void 0:k.value.parent),N=f(j);return N||null}function C(k=t){const{componentInstance:j,designerItemElementRef:N}=k;return!j||!j.value?null:j.value.canMove||j.value.canAdd||j.value.canDelete?N:C(k.parent)}function v(k){return!!o}function S(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function h(){}function x(k,j){}function b(k){const{componentType:j}=k;let N=re(j,k);const E=j.toLowerCase().replace("-","_");return N&&!N.id&&N.type===j&&(N.id=`${E}_${Math.random().toString().slice(2,6)}`),N}function w(k){}function B(...k){return[]}return l.value={canMove:r(),canSelectParent:i(),canAdd:c(),canDelete:d(),canNested:!m(),contents:[],elementRef:n,parent:(A=t.parent)==null?void 0:A.componentInstance,schema:t.schema,styles:s,canAccepts:v,getBelongedComponentInstance:f,getDraggableDesignItemElement:C,getDraggingDisplayText:S,getPropConfig:B,getDragScopeElement:h,onAcceptMovedChildElement:x,onChildElementMovedOut:w,addNewChildComponentSchema:b,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},l}const et=e.defineComponent({name:"FDesignerInnerItem",props:un,emits:["selectionChange","addComponent","removeComponent"],setup(n,t){const o=e.ref(n.canMove),a=e.ref(n.canAdd),s=e.ref(n.canDelete),l=e.ref(!1),r=e.ref(n.contentKey),i=e.ref(n.childType),d=e.ref(n.childLabel),c=e.ref(n.modelValue),m=e.ref(""),f=e.ref(),C=e.inject("canvas-dragula"),v=e.ref(),S=e.inject("design-item-context"),h={designerItemElementRef:f,componentInstance:v,schema:c.value,parent:S,setupContext:t};e.provide("design-item-context",h);const x=e.computed(()=>({"farris-component":!0,"flex-fill":n.id=="root-component","position-relative":o.value||s.value,"farris-nested":l.value,"can-move":o.value,"d-none":f.value&&f.value.classList.contains("d-none")})),b=e.computed(()=>{const p={};return m.value&&m.value.split(";").reduce((u,y)=>{const[V,D]=y.split(":");return V&&(u[V]=D),u},p),p});function w(p,u){if(S&&S.schema[r.value]){const y=S.schema[r.value].findIndex(V=>V.id===u.id);if(y>-1){const V=S.schema[r.value].length,D=S.schema[r.value][y%V];S.designerItemElementRef.value.querySelector(`#${D.id}-design-item`),S.schema[r.value].splice(y,1),S.componentInstance.value.updateDragAndDropRules(),me.value++,t.emit("removeComponent")}}}function B(p){if(v.value.addNewChildComponentSchema){const u={componentType:i.value,label:d.value,parentComponentInstance:v.value,targetPosition:-1},y=v.value.addNewChildComponentSchema(u);c.value[r.value].push(y),t.emit("addComponent")}}function A(){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:p=>{B()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function k(p){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(u=>w(u,p),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function j(){return o.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function N(p){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[A(),j(),k(p)])])}e.watch(()=>n.modelValue,p=>{c.value=p,h.schema=p});function E(p){const u=p.target;Gt(u)}function $(){var p,u;(u=(p=c.value)==null?void 0:p.contents)!=null&&u.length&&f.value&&f.value.addEventListener("scroll",E)}function T(){const p=f.value,u=e.ref(p.children[1]);return pn(u,h).value}e.onMounted(()=>{if(f.value){const p=f.value.querySelector(`[data-dragref='${c.value.id}-container']`);v.value=p&&p.componentInstance?p.componentInstance.value:T(),C&&p&&C.attachComponents(p,c.value),l.value=v.value.canNested!==void 0?v.value.canNested:l.value,a.value=v.value.canAdd!==void 0?v.value.canAdd:a.value,s.value=v.value.canDelete!==void 0?v.value.canDelete:s.value,o.value=v.value.canMove!==void 0?v.value.canMove:o.value,m.value=v.value.styles||"",f.value&&(f.value.componentInstance=v,f.value.designItemContext=h)}$(),me.value++}),e.onBeforeUnmount(()=>{f.value&&f.value.removeEventListener("scroll",E)});function g(p){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(y=>y.classList.remove("dgComponentFocused")),p&&(p.preventDefault(),p.stopPropagation());const u=f.value;if(u){const y=document.getElementsByClassName("dgComponentSelected");if(!(y&&y.length===1&&y[0]===f.value)){Array.from(y).forEach(M=>M.classList.remove("dgComponentSelected")),u.classList.add("dgComponentFocused"),t.emit("selectionChange",c.value.type,c.value,n.componentId,v.value);const D=v.value.getDraggableDesignItemElement(h);D&&D.value&&D.value.classList.add("dgComponentSelected")}}me.value++}return()=>e.createVNode("div",{id:`${n.id}-design-item`,ref:f,class:x.value,style:b.value,onClick:g},[N(c.value),t.slots.default&&t.slots.default()])}});class fn extends Ne{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识00",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0,$converter:"/converter/type.converter"},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"}},setPropertyRelates(o,a){}}}getEventPropConfig(t){const o=[{label:"onClick",name:"点击事件"}];var a=this;const s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),l={};l[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:l,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(r,i){const d=r.propertyValue;delete t[a.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,d.events,d))}}}}class mn extends Ne{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(),this.getAppearanceProperties(t),this.getbBehaviorConfig(),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(){this.propertyConfig.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",textField:"value",valueField:"key",data:[{key:"response-toolbar-item",value:G["response-toolbar-item"].name}]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}getbBehaviorConfig(){this.propertyConfig.categories.behavior={title:"行为",description:"Behavior",properties:{disabled:{title:"禁用状态",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"样式",description:"Appearance",properties:{class:{title:"class",type:"string",description:"",$converter:"/converter/appearance.converter"}}}}getEventPropConfig(t){const o=[{label:"onClick",name:"点击事件"}],a=this,s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),l={};l[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:l,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(r,i){const d=r.propertyValue;delete t[a.viewModelId],d&&(d.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,d.events,d))}}}}function hn(n,t){function o(i){return!1}function a(){return!1}function s(){return!0}function l(){return!1}function r(i){let d;switch(n.schema.type){case"tab-toolbar-item":d=new fn(i,t);break;default:d=new mn(i,t)}return d.getPropertyConfig(n.schema)}return{canAccepts:o,checkCanMoveComponent:a,checkCanDeleteComponent:s,checkCanAddComponent:l,getPropsConfig:r}}const gn=e.defineComponent({name:"FResponseToolbarItemDesign",props:Qe,emits:["Click"],setup(n,t){e.ref(),e.ref();const o=e.ref(n.alignment),a={id:"__more_buttons__",text:"More"},s=e.ref(new he(a));e.computed(()=>s.value.children.length>0);const l=e.ref(),r=e.inject("designer-host-service"),i=e.inject("design-item-context"),d=hn(i,r),c=Pe.useDesignerInnerComponent(l,i,d);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{l.value.componentInstance=c}),t.expose(c.value);function m(){const v={"f-icon":!0},S=n.icon?n.icon.trim():"";return ye.getCustomClass(v,S)}function f(){return!!(n.icon&&n.icon.trim())}function C(){const v={btn:!0,"f-rt-btn":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left","btn-icontext":!!(n.icon&&n.icon.trim()),disabled:n.disabled===!0};return ye.getCustomClass(v,n.class)}return()=>e.createVNode("div",{ref:l,"data-dragref":`${i.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[e.createVNode("button",{type:"button",class:C(),id:n.id},[f()&&e.createVNode("i",{class:m()},null),n.text])])}}),bn=e.defineComponent({name:"FResponseToolbarDesign",props:tn,emits:["Click"],setup(n,t){const o=e.ref(n.items);let a=new Array(o.value.length).fill(e.ref());const s=e.ref(),l=e.ref(),r=e.ref(n.alignment),i={id:"__more_buttons__",text:"More"},d=e.ref(new he(i)),c=sn();e.computed(()=>d.value.children.length>0);const m=e.ref(),f=e.inject("designer-host-service"),C=e.inject("design-item-context"),v=dn(C,f),S=Pe.useDesignerInnerComponent(m,C,v);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{m.value.componentInstance=S}),t.expose(S.value);const h=e.computed(()=>{const T={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};return ye.getCustomClass(T,n.customClass)}),x=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":r.value==="right","justify-content-start":r.value==="left"})),{renderToolbarDropdown:b,clearAllDropDown:w}=ln(n,c,S);function B(){o.value.filter(T=>T.children&&T.children.length>0).forEach(T=>{T.expanded=!1}),d.value.expanded=!1,w()}const A=new Map,k=[];function j(T){const g=l.value;let p=T;const u=Array.from(g.children),y=u[u.length-1].id==="__more_buttons__"?u[u.length-1]:null;if(y){const R=y.computedStyleMap().get("margin-left"),O=y.computedStyleMap().get("margin-right"),H=(R?R.value:0)+y.getBoundingClientRect().width+(O?O.value:0);p-=H}const V=u.filter(R=>R.id!=="__more_buttons__");for(const R of V){const O=R.computedStyleMap().get("margin-left"),H=R.computedStyleMap().get("margin-right"),Y=(O?O.value:0)+R.getBoundingClientRect().width+(H?H.value:0);p<Y?(A.set(R.id,!0),k.push({id:R.id,width:Y})):p-=Y}if(k.length)for(let R=k.length-1;R>=0;R--){const O=k[R].width;if(p>=O)p-=O,A.delete(k[R].id),k.pop();else break}const D=Object.assign({},d.value);D.children=[];const M=new he(D),I=o.value.reduce((R,O)=>(A.has(O.id)&&M.children.push(O),O.visible=!A.has(O.id),R.push(O),R),[]);d.value=M,o.value=I}const N=new ResizeObserver(T=>{if(T.length){const p=T[0].contentRect.width,y=l.value.getBoundingClientRect().width;(p<y||k.length)&&j(p)}});e.onMounted(()=>{const T=s.value;N.observe(T),document.body.addEventListener("click",B)}),e.onUnmounted(()=>{N.disconnect(),document.body.removeEventListener("click",B)}),e.watch(()=>n.items,()=>{o.value=n.items},{deep:!0}),e.watch(o,T=>{a=new Array(o.value.length).fill(e.ref())});function E(T,g,p,u){C&&C.setupContext&&C.setupContext.emit("selectionChange",T,g,p,u)}function $(){const T=l.value.querySelector(".dgComponentFocused.dgComponentSelected");T==null||T.classList.remove("dgComponentSelected"),T==null||T.classList.remove("dgComponentFocused")}return()=>e.createVNode("div",{ref:m,"data-dragref":`${C.schema.id}-container`,class:h.value},[e.createVNode("div",{ref:s,class:x.value},[e.createVNode("div",{ref:l,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.map((T,g)=>e.createVNode(et,{ref:a[g],class:"p-0 display-inline-block",modelValue:T,"onUpdate:modelValue":p=>T=p,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:n.componentId,id:T.id,style:"padding:0 !important;display:inline-block",onSelectionChange:E,onRemoveComponent:$},{default:()=>{var p;return[e.createVNode(gn,{id:T.id,disabled:T.disabled,text:T.text,icon:T.icon,class:((p=T.appearance)==null?void 0:p.class)||"btn-secondary",alignment:n.alignment||"right",componentId:n.componentId},null)]}}))])])])}});function yn(n,t,o,a,s){const{toolbarItems:l,toolbarSchema:r}=n;function i(d,c,m,f){var C;(C=a.setupContext)==null||C.emit("selectionChange",d,c,m,f)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(et,{modelValue:r.value,"onUpdate:modelValue":d=>r.value=d,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:r.value.id,onSelectionChange:i,componentId:s},{default:()=>[e.createVNode(bn,{items:l.value,componentId:s},null)]})])])}const vn=e.defineComponent({name:"FTabsDesign",props:Te,emits:["tabChange","tabRemove"],setup(n,t){const o=e.ref(),a=e.inject("designer-host-service"),s=e.inject("design-item-context"),l=Xt(s,a),r=Xe(o,s,l),i=e.ref(n.tabType),d=e.shallowRef(),c=e.shallowRef(),m=Jt(n,t,d,s),{activeId:f,changeTitleStyle:C,tabPages:v,addTab:S,updateTab:h,selectTabByTabId:x,toolbarItems:b}=m,w=qe(n,c,m),B=He(n,d,w,m),{previousButtonClass:A,nextButtonClass:k,nextButtonGroupClass:j,scrollTab:N,updateNavigationLayout:E}=B,$=ze(n,m),{hideDropDown:T}=$,g=Wt(n,d,B,w,m,r,l),p=g,u=Le(n,d,B,w,m),y=new Map([["default",g],["one-page",p],["pills",u]]);e.computed(()=>{const q=v.value.find(X=>X.props.id===f.value);return q==null?void 0:q.slots});const V=e.computed(()=>{const q=v.value.find(ee=>ee.props.id===f.value);return(q==null?void 0:q.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:f,addTab:S,updateTab:h,tabPages:v,tabType:i});function D(){const q=r.value.schema.contents||[];return q.length<1?null:q.find(ee=>ee.id===f.value)}function M(){var X;const q=D();b.value=[...(X=q==null?void 0:q.toolbar)==null?void 0:X.contents]}e.provide("toolbar-item-handler",M);const I=e.computed(()=>n.fill||n.tabType==="fill"),R=e.computed(()=>n.tabType==="pills"),O=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":V.value,"farris-tabs-inContent":!V.value,"farris-tabs-nav-fill":I.value,"farris-tabs-nav-pills":R.value})),H=e.computed(()=>({width:V.value&&n.titleWidth?`${n.titleWidth}%`:""})),Y=e.computed(()=>({"farris-tabs":!0,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"}));e.onMounted(()=>{v.value.length&&(f.value=n.activeId||v.value[0].props.id,x(f.value)),e.nextTick(()=>{E()}),C(d),window.addEventListener("click",q=>{var X;T.value||(X=o.value)!=null&&X.contains(q.target)||(T.value=!0)}),window.addEventListener("resize",()=>{E()}),o.value.componentInstance=r});function ne(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:A.value,onClick:()=>{N(0,-1)}},null)}function se(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:k.value,onClick:()=>{N(0,1)}},null)}const{renderMorePagesButtton:K}=Fe(n,$,B,m);function oe(){return!!b.value.length&&yn(m,r,l,s,n.componentId)}const z=y.get(n.tabType)||y.get("default");function _(){var q,X,ee,ge;return e.createVNode("div",{class:O.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(X=(q=t.slots).headerPrefix)==null?void 0:X.call(q)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:H.value},[ne(),z&&z(),e.createVNode("div",{class:j.value},[se(),K()])]),oe(),e.createVNode("div",{class:"farris-tabs-header-post"},[(ge=(ee=t.slots).headerSuffix)==null?void 0:ge.call(ee)])])}function J(){var q,X;return e.createVNode("div",{class:"farris-tabs-content",ref:c},[(X=(q=t.slots).default)==null?void 0:X.call(q)])}return t.expose(r.value),()=>e.createVNode("div",{class:Y.value,ref:o},[_(),J()])}});function Cn(n,t,o){return t?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function wn(n,t){return t&&t.contents&&t.contents.length&&t.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:t.contents,buttonPosition:t.position}}const Tn=new Map([["appearance",ce],["expanded","expandStatus"],["enableAccordion",Cn],["toolbar",wn]]);function xn(n,t,o,a){const s=Math.random().toString().slice(2,6),l=o.parentComponentInstance;Object.assign(t,{id:`section-${s}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:t.mainTitle||"标题"});const r=n.getSchemaByType("content-container");Object.assign(r,{id:`container-${s}`,appearance:{class:"f-struct-wrapper"},contents:[t]});const i=l.schema;switch(i&&i.type){case G["splitter-pane"].type:{t.appearance.class="f-section-in-main";break}}return r}function Sn(n,t,o,a){return o.parentComponentInstance?xn(n,t,o):t}const Mn={$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"]},tt={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}};le(tt,Mn,Tn,Sn);function Nn(n,t,o){let a;function s(){!n||!t.value||(o.value=!o.value,o.value?l():r())}function l(){a=n.value.nextElementSibling;const d=document&&document.querySelector("body");d&&(d.appendChild(n.value),n.value.style.zIndex=i())}function r(){a?t.value.insertBefore(n.value,a):t.value.appendChild(n.value),n.value.style.zIndex=null}function i(d=1){const c=["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"],m=Array.from(document.body.querySelectorAll(c.join(","))).filter(C=>C).map(C=>{const{display:v,zIndex:S}=window.getComputedStyle(C);return v==="none"?0:parseInt(S,10)}).filter(C=>C);let f=Math.max(...m);return f<1040&&(f=1040),f+d}return{onClickMaxMinIcon:s}}function nt(n,t){const o=e.ref(n.buttons),a=e.computed(()=>n.buttonPosition==="inHead"?"right":"left"),s=e.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),l=e.computed(()=>{n.buttons&&n.buttons.length>0&&n.buttonPosition});function r(i){t.emit("Click",i)}return()=>l&&e.createVNode(Ie,{customClass:s.value,items:o.value,onClick:r,alignment:a.value},null)}function Vn(n,t,o,a,s,l){e.ref(n.subTitle);const r=e.computed(()=>n.buttonPosition),i=nt(n,t),{onClickMaxMinIcon:d}=Nn(a,s,l),c=e.computed(()=>!!n.subTitle),m=e.computed(()=>n.enableMaximize),f=e.computed(()=>n.enableAccordion!=""),C=e.computed(()=>{const B={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((k,j)=>(k[j]=!0,k),B),B});function v(B){B.stopPropagation(),n.enableAccordion!==""&&(o.value=!o.value)}function S(){const B=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),A=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!l.value,"f-icon-minimize":l.value}));return e.createVNode("div",{class:"f-max-accordion"},[m.value?e.createVNode("span",{class:A.value,onClick:d},null):"",f.value?e.createVNode("button",{class:B.value,onClick:v},[e.createVNode("span",null,[o.value?n.collapseLabel:n.expandLabel])]):""])}function h(){return t.slots.header?e.createVNode("div",{class:C.value},[t.slots.header()]):""}function x(){return e.createVNode("div",{class:"f-title",onClick:v},[e.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),c.value&&e.createVNode("span",null,[n.subTitle])])}function b(){const B=e.computed(()=>{const A={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((j,N)=>(j[N]=!0,j),A),A});return t.slots.headerContent?e.createVNode("div",{class:B.value},[t.slots.headerContent()]):""}function w(){return e.createVNode("div",{class:C.value},[t.slots.headerTitle?t.slots.headerTitle():x(),b(),r.value==="inHead"&&i(),(m.value||f.value)&&S()])}return()=>n.showHeader&&(t.slots.header?h():w())}const Bn=["moz","ms","webkit"];function kn(){let n=0;return t=>{const o=new Date().getTime(),a=Math.max(0,16-(o-n)),s=setTimeout(()=>{t(o+a)},a);return n=o+a,s}}function In(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=Bn.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:kn()}In();function Ve(n,t){return((t==null?void 0:t.split(" "))||[]).reduce((a,s)=>(s&&(a[s]=!0),a),n),n}const Pn=e.defineComponent({name:"FSection",props:tt,emits:[],setup(n,t){const o=e.ref();let a=e.ref();const s=e.ref(n.customClass),l=e.computed(()=>n.enableAccordion),r=e.ref(n.expandStatus),i=e.computed(()=>n.buttonPosition),d=e.ref(!1),c=Vn(n,t,r,o,a,d),m=nt(n,t),f=e.computed(()=>{const x={"f-section":!0,"f-section-accordion":l.value==="default","f-state-collapse":(l.value==="default"||l.value==="custom")&&!r.value,"f-section-custom-accordion":l.value==="custom","f-section-fill":n.fill,"f-section-maximize":d.value};return Ve(x,s.value)}),C=e.computed(()=>Ve({"f-section-content":!0},n.contentClass)),v=e.computed(()=>Ve({"f-section-extend":!0},v.value));function S(){return t.slots.extend&&e.createVNode("div",{class:v.value},[t.slots.extend()])}function h(){return e.createVNode("div",{class:C.value},[i.value==="inContent"&&m(),t.slots.default&&t.slots.default()])}return e.watch(()=>n.expandStatus,(x,b)=>{x!==b&&(r.value=x)}),e.onMounted(()=>{o&&o.value&&(a.value=o.value.parentElement)}),()=>e.createVNode("div",{class:f.value,ref:o},[c(),S(),h()])}});function Dn(){function n(t,o){var r;if(!t)return!1;const a=((r=t.targetContainer)==null?void 0:r.componentInstance)&&t.targetContainer.componentInstance.value;if(!a)return!1;const s=a.schema.type,l=o==null?void 0:o.formSchemaUtils.getComponentById(a.belongedComponentId);return!((t.controlCategory==="input"||t.controlType==="form-group")&&![G["response-layout-item"].type,G["response-form"].type].includes(s)||(t.controlType===G.tabs.type||t.controlType===G.section.type)&&((l==null?void 0:l.componentType)!=="frame"||![G["content-container"].type,G["splitter-pane"].type,G["response-layout-item"].type].includes(s)))}return{basalDragulaRuleForContainer:n}}function En(n,t){const o=new Ye,{canAccept:a}=o.getTemplateRule(n,t);function s(l){if(!Dn().basalDragulaRuleForContainer(l,t))return!1;const i=n.schema;return i.contents&&i.contents.length>0?!1:a}return{canAccepts:s}}function jn(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const $n=e.defineComponent({name:"FTabPageDesign",props:ue,emits:[],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=e.inject("designer-host-service"),l=En(a,s),r=Xe(o,a,l);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,t.expose(r.value);const i=e.inject("tabs"),d=e.ref(!0),c={slots:t.slots,props:n},m=e.ref((i==null?void 0:i.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const w=i.tabPages.value.findIndex(B=>B.props.id===n.id);!w||w===-1?i==null||i.addTab(c):w>-1&&(d.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const f=e.computed(()=>(n==null?void 0:n.id)===(i==null?void 0:i.activeId.value)),C=e.computed(()=>({display:f.value?"":"none"}));e.watch(()=>n,w=>{i==null||i.updateTab({props:w,slots:t.slots})},{immediate:!0,deep:!0});function v(){var B,A;const w=(A=(B=t.slots).default)==null?void 0:A.call(B);return e.createVNode(Pn,{"main-title":n.title,class:"farris-tab-page"},jn(w)?w:{default:()=>[w]})}const S=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function h(){var B,A;const w=(A=(B=t.slots).default)==null?void 0:A.call(B);return e.createVNode("div",{ref:o,class:S.value,"data-dragref":`${a.schema.id}-container`,style:C.value},[w])}const b=new Map([["default",h],["one-page",v]]).get(m.value)||h;return()=>d.value?b():null}}),Rn=le({text:{type:String,default:""},icon:{type:String,default:""}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-toolbar-item.schema.json",title:"tab-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:"tab-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},text:{description:"文本",type:"string",default:""},icon:{description:"图标",type:"string",default:""},onClick:{description:"点击事件",type:"string",default:""}},required:["id","type","text"]},we,ft);te.install=n=>{n.component(te.name,te),n.component(pe.name,pe)},te.register=(n,t,o,a)=>{n.tabs=te,n["tab-page"]=pe,t.tabs=Re,t["tab-page"]=xe,a.tabs={eventHandlerResolver:Ae}},te.registerDesigner=(n,t,o)=>{n.tabs=vn,n["tab-page"]=$n,t.tabs=Oe,t["tab-page"]=xe,t["tab-toolbar-item"]=Rn},F.FTabPage=pe,F.FTabs=te,F.default=te,F.eventHandlerResolver=Ae,F.tabPageProps=ue,F.tabPagePropsResolver=xe,F.tabsDesignProps=Te,F.tabsDesignPropsResolver=Oe,F.tabsProps=de,F.tabsPropsResolver=Re,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});