@farris/ui-vue 1.2.9 → 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 (287) hide show
  1. package/components/accordion/index.esm.js +64 -64
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +521 -336
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/button-edit/index.css +1 -1
  6. package/components/button-edit/index.esm.js +99 -97
  7. package/components/button-edit/index.umd.cjs +1 -1
  8. package/components/calendar/index.esm.js +496 -504
  9. package/components/calendar/index.umd.cjs +1 -1
  10. package/components/capsule/index.esm.js +251 -259
  11. package/components/capsule/index.umd.cjs +1 -1
  12. package/components/checkbox/index.esm.js +696 -519
  13. package/components/checkbox/index.umd.cjs +1 -1
  14. package/components/color-picker/index.esm.js +368 -376
  15. package/components/color-picker/index.umd.cjs +2 -2
  16. package/components/combo-list/index.css +1 -0
  17. package/components/combo-list/index.esm.js +1141 -340
  18. package/components/combo-list/index.umd.cjs +1 -1
  19. package/components/combo-tree/index.esm.js +116 -116
  20. package/components/combo-tree/index.umd.cjs +1 -1
  21. package/components/common/index.esm.js +986 -798
  22. package/components/common/index.umd.cjs +1 -1
  23. package/components/component/index.esm.js +463 -998
  24. package/components/component/index.umd.cjs +1 -1
  25. package/components/condition/index.css +1 -0
  26. package/components/condition/index.esm.js +2233 -1057
  27. package/components/condition/index.umd.cjs +1 -1
  28. package/components/content-container/index.esm.js +335 -1002
  29. package/components/content-container/index.umd.cjs +1 -1
  30. package/components/data-grid/index.css +1 -1
  31. package/components/data-grid/index.esm.js +6193 -4702
  32. package/components/data-grid/index.umd.cjs +1 -1
  33. package/components/data-view/index.css +1 -0
  34. package/components/data-view/index.esm.js +4562 -3294
  35. package/components/data-view/index.umd.cjs +1 -1
  36. package/components/date-picker/index.css +1 -1
  37. package/components/date-picker/index.esm.js +3420 -2623
  38. package/components/date-picker/index.umd.cjs +1 -1
  39. package/components/designer-canvas/index.css +1 -1
  40. package/components/designer-canvas/index.esm.js +914 -883
  41. package/components/designer-canvas/index.umd.cjs +1 -1
  42. package/components/designer-outline/index.esm.js +14 -13
  43. package/components/designer-outline/index.umd.cjs +1 -1
  44. package/components/dropdown/index.esm.js +204 -212
  45. package/components/dropdown/index.umd.cjs +2 -2
  46. package/components/dynamic-form/index.css +1 -0
  47. package/components/dynamic-form/index.esm.js +2795 -1835
  48. package/components/dynamic-form/index.umd.cjs +1 -1
  49. package/components/dynamic-resolver/index.esm.js +180 -130
  50. package/components/dynamic-resolver/index.umd.cjs +1 -1
  51. package/components/dynamic-view/index.esm.js +303 -290
  52. package/components/dynamic-view/index.umd.cjs +1 -1
  53. package/components/events-editor/index.esm.js +328 -336
  54. package/components/events-editor/index.umd.cjs +1 -1
  55. package/components/expression-editor/index.esm.js +65 -65
  56. package/components/expression-editor/index.umd.cjs +1 -1
  57. package/components/external-container/index.css +1 -1
  58. package/components/external-container/index.esm.js +3349 -3626
  59. package/components/external-container/index.umd.cjs +1 -1
  60. package/components/field-selector/index.css +1 -1
  61. package/components/field-selector/index.esm.js +5344 -8588
  62. package/components/field-selector/index.umd.cjs +1 -1
  63. package/components/filter-bar/index.css +1 -1
  64. package/components/filter-bar/index.esm.js +2179 -2227
  65. package/components/filter-bar/index.umd.cjs +1 -1
  66. package/components/flow-canvas/index.css +1 -1
  67. package/components/flow-canvas/index.esm.js +684 -675
  68. package/components/flow-canvas/index.umd.cjs +1 -1
  69. package/components/image-cropper/index.esm.js +482 -490
  70. package/components/image-cropper/index.umd.cjs +1 -1
  71. package/components/input-group/index.esm.js +746 -569
  72. package/components/input-group/index.umd.cjs +1 -1
  73. package/components/layout/index.esm.js +409 -385
  74. package/components/layout/index.umd.cjs +1 -1
  75. package/components/list-nav/index.esm.js +348 -1019
  76. package/components/list-nav/index.umd.cjs +1 -1
  77. package/components/list-view/index.css +1 -1
  78. package/components/list-view/index.esm.js +3606 -2388
  79. package/components/list-view/index.umd.cjs +1 -1
  80. package/components/lookup/index.css +1 -1
  81. package/components/lookup/index.esm.js +10871 -8970
  82. package/components/lookup/index.umd.cjs +1 -1
  83. package/components/mapping-editor/index.css +1 -1
  84. package/components/mapping-editor/index.esm.js +6019 -5631
  85. package/components/mapping-editor/index.umd.cjs +1 -1
  86. package/components/message-box/index.css +1 -1
  87. package/components/message-box/index.esm.js +511 -471
  88. package/components/message-box/index.umd.cjs +1 -1
  89. package/components/modal/index.css +1 -1
  90. package/components/modal/index.esm.js +438 -398
  91. package/components/modal/index.umd.cjs +1 -1
  92. package/components/nav/index.esm.js +912 -1281
  93. package/components/nav/index.umd.cjs +3 -3
  94. package/components/notify/index.esm.js +59 -53
  95. package/components/notify/index.umd.cjs +1 -1
  96. package/components/number-range/index.esm.js +660 -484
  97. package/components/number-range/index.umd.cjs +1 -1
  98. package/components/number-spinner/index.esm.js +682 -506
  99. package/components/number-spinner/index.umd.cjs +1 -1
  100. package/components/order/index.css +1 -1
  101. package/components/order/index.esm.js +1848 -1658
  102. package/components/order/index.umd.cjs +1 -1
  103. package/components/page-footer/index.esm.js +100 -100
  104. package/components/page-footer/index.umd.cjs +1 -1
  105. package/components/page-header/index.esm.js +1120 -1923
  106. package/components/page-header/index.umd.cjs +1 -1
  107. package/components/pagination/index.esm.js +875 -1214
  108. package/components/pagination/index.umd.cjs +1 -1
  109. package/components/popover/index.esm.js +71 -70
  110. package/components/popover/index.umd.cjs +1 -1
  111. package/components/progress/index.esm.js +229 -237
  112. package/components/progress/index.umd.cjs +3 -3
  113. package/components/property-editor/index.css +1 -1
  114. package/components/property-editor/index.esm.js +2314 -1521
  115. package/components/property-editor/index.umd.cjs +3 -3
  116. package/components/property-panel/index.esm.js +867 -868
  117. package/components/property-panel/index.umd.cjs +1 -1
  118. package/components/query-solution/index.css +1 -1
  119. package/components/query-solution/index.esm.js +4332 -3623
  120. package/components/query-solution/index.umd.cjs +1 -1
  121. package/components/radio-button/index.esm.js +72 -72
  122. package/components/radio-button/index.umd.cjs +1 -1
  123. package/components/radio-group/index.esm.js +613 -437
  124. package/components/radio-group/index.umd.cjs +1 -1
  125. package/components/rate/index.esm.js +255 -263
  126. package/components/rate/index.umd.cjs +1 -1
  127. package/components/response-layout/index.esm.js +144 -152
  128. package/components/response-layout/index.umd.cjs +1 -1
  129. package/components/response-layout-editor/index.css +1 -1
  130. package/components/response-layout-editor/index.esm.js +1101 -1038
  131. package/components/response-layout-editor/index.umd.cjs +1 -1
  132. package/components/response-toolbar/index.esm.js +935 -1750
  133. package/components/response-toolbar/index.umd.cjs +1 -1
  134. package/components/schema-selector/index.css +1 -1
  135. package/components/schema-selector/index.esm.js +5264 -5677
  136. package/components/schema-selector/index.umd.cjs +2 -2
  137. package/components/search-box/index.esm.js +151 -154
  138. package/components/search-box/index.umd.cjs +1 -1
  139. package/components/section/index.esm.js +438 -1125
  140. package/components/section/index.umd.cjs +1 -1
  141. package/components/smoke-detector/index.esm.js +93 -101
  142. package/components/smoke-detector/index.umd.cjs +1 -1
  143. package/components/splitter/index.esm.js +563 -1202
  144. package/components/splitter/index.umd.cjs +1 -1
  145. package/components/splitter/style.js +2 -0
  146. package/components/step/index.esm.js +248 -256
  147. package/components/step/index.umd.cjs +1 -1
  148. package/components/switch/index.esm.js +549 -373
  149. package/components/switch/index.umd.cjs +1 -1
  150. package/components/tabs/index.css +1 -1
  151. package/components/tabs/index.esm.js +2436 -3110
  152. package/components/tabs/index.umd.cjs +1 -1
  153. package/components/tags/index.esm.js +328 -336
  154. package/components/tags/index.umd.cjs +1 -1
  155. package/components/text/index.esm.js +339 -347
  156. package/components/text/index.umd.cjs +1 -1
  157. package/components/textarea/index.esm.js +554 -378
  158. package/components/textarea/index.umd.cjs +1 -1
  159. package/components/time-picker/index.css +1 -1
  160. package/components/time-picker/index.esm.js +1322 -1144
  161. package/components/time-picker/index.umd.cjs +1 -1
  162. package/components/transfer/index.css +1 -1
  163. package/components/transfer/index.esm.js +537 -543
  164. package/components/transfer/index.umd.cjs +1 -1
  165. package/components/tree-grid/index.css +1 -1
  166. package/components/tree-grid/index.esm.js +5113 -9426
  167. package/components/tree-grid/index.umd.cjs +1 -1
  168. package/components/tree-view/index.css +1 -0
  169. package/components/tree-view/index.esm.js +3900 -2677
  170. package/components/tree-view/index.umd.cjs +1 -1
  171. package/components/uploader/index.esm.js +568 -570
  172. package/components/uploader/index.umd.cjs +2 -2
  173. package/components/verify-detail/index.esm.js +266 -274
  174. package/components/verify-detail/index.umd.cjs +1 -1
  175. package/components/video/index.esm.js +553 -1052
  176. package/components/video/index.umd.cjs +1 -1
  177. package/components/weather/index.esm.js +558 -566
  178. package/components/weather/index.umd.cjs +5 -5
  179. package/farris.all.esm.js +22009 -22688
  180. package/farris.all.umd.cjs +9 -9
  181. package/index.css +1 -1
  182. package/package.json +1 -1
  183. package/types/capsule/src/capsule.props.d.ts +2 -2
  184. package/types/combo-list/src/components/list-container.component.d.ts +0 -3
  185. package/types/combo-list/src/components/list-container.props.d.ts +0 -4
  186. package/types/common/directive/area-response.d.ts +10 -0
  187. package/types/common/index.d.ts +9 -0
  188. package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
  189. package/types/common/types.d.ts +1 -1
  190. package/types/common/utils/encrypt.d.ts +2 -0
  191. package/types/common/utils/resolve-field.d.ts +2 -0
  192. package/types/common/utils/use-class.d.ts +7 -0
  193. package/types/component/src/component.props.d.ts +7 -0
  194. package/types/component/src/designer/use-designer-rules.d.ts +2 -2
  195. package/types/component/src/property-config/component.property-config.d.ts +9 -0
  196. package/types/components.d.ts +1 -0
  197. package/types/condition/src/types.d.ts +2 -1
  198. package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
  199. package/types/data-grid/index.d.ts +11 -5
  200. package/types/data-grid/src/data-grid.component.d.ts +4 -2
  201. package/types/data-grid/src/data-grid.props.d.ts +1 -0
  202. package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
  203. package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
  204. package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
  205. package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
  206. package/types/data-view/composition/types.d.ts +19 -4
  207. package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
  208. package/types/designer-canvas/index.d.ts +2 -1
  209. package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
  210. package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
  211. package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
  212. package/types/designer-canvas/src/composition/types.d.ts +2 -3
  213. package/types/designer-canvas/src/types.d.ts +2 -1
  214. package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
  215. package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
  216. package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
  217. package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
  218. package/types/dynamic-form/src/designer/use-designer-rules.d.ts +1 -1
  219. package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
  220. package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
  221. package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
  222. package/types/dynamic-form/src/types.d.ts +12 -1
  223. package/types/dynamic-resolver/index.d.ts +1 -0
  224. package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
  225. package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
  226. package/types/dynamic-resolver/src/types.d.ts +9 -0
  227. package/types/dynamic-view/index.d.ts +1 -0
  228. package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
  229. package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
  230. package/types/index.d.ts +2 -0
  231. package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
  232. package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
  233. package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
  234. package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
  235. package/types/lookup/src/components/modal-container.component.d.ts +25 -0
  236. package/types/lookup/src/components/modal-container.props.d.ts +29 -0
  237. package/types/lookup/src/composition/types.d.ts +8 -0
  238. package/types/lookup/src/composition/use-check-props.d.ts +9 -2
  239. package/types/lookup/src/composition/use-dialog.d.ts +5 -1
  240. package/types/lookup/src/composition/use-favorite.d.ts +12 -0
  241. package/types/lookup/src/composition/use-http.d.ts +9 -5
  242. package/types/lookup/src/composition/use-input-change.d.ts +3 -0
  243. package/types/lookup/src/composition/use-user-data.d.ts +24 -0
  244. package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
  245. package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
  246. package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
  247. package/types/modal/src/composition/use-draggable.d.ts +2 -1
  248. package/types/modal/src/composition/use-shortcut.d.ts +6 -0
  249. package/types/modal/src/modal.component.d.ts +3 -0
  250. package/types/modal/src/modal.props.d.ts +4 -0
  251. package/types/page-header/src/page-header.props.d.ts +1 -0
  252. package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
  253. package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
  254. package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
  255. package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
  256. package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
  257. package/types/property-panel/index.d.ts +2 -1
  258. package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
  259. package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
  260. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
  261. package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
  262. package/types/{data-grid/src/designer/use-group-column.d.ts → query-solution/src/designer/query-solution-config/composition/use-property.d.ts} +4 -5
  263. package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
  264. package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
  265. package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
  266. package/types/query-solution/src/solutions.d.ts +108 -509
  267. package/types/response-layout-editor/index.d.ts +3 -1
  268. package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
  269. package/types/response-layout-editor/src/type.d.ts +21 -0
  270. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
  271. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
  272. package/types/section/src/designer/use-designer-rules.d.ts +3 -3
  273. package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
  274. package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
  275. package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
  276. package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
  277. package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
  278. package/types/tabs/src/tabs.props.d.ts +1 -0
  279. package/types/tree-grid/index.d.ts +8 -2
  280. package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
  281. package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
  282. package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
  283. package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
  284. package/types/modal/src/composition/use-esc.d.ts +0 -1
  285. package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
  286. package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
  287. package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
@@ -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,ae,et,Be,tt,nt,Pe,ge){"use strict";var Rn=Object.defineProperty;var On=(z,e,ae)=>e in z?Rn(z,e,{enumerable:!0,configurable:!0,writable:!0,value:ae}):z[e]=ae;var F=(z,e,ae)=>On(z,typeof e!="symbol"?e+"":e,ae);const ye={},ke={};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(h=>h==p))&&(l[p]=t[p].type==="object"&&t[p].properties?ve(t[p]):ae.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=ke[n];return s=r?r({getSchemaByType:Y},s,t,o):s,s}return null}function ot(n,t){const o=ve(t);return Object.keys(n).reduce((a,s)=>(a[s]&&typeof a[s]=="object"?Object.assign(a[s],n[s]):a[s]=n[s],a),o),o}function at(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 st(n,t,o=new Map){const a=ot(n,t);return at(a,o)}function rt(n={}){function t(c,v,w,x){if(typeof w=="number")return x[c].length===w;if(typeof w=="object"){const S=Object.keys(w)[0],g=w[S];if(S==="not")return Number(x[c].length)!==Number(g);if(S==="moreThan")return Number(x[c].length)>=Number(g);if(S==="lessThan")return Number(x[c].length)<=Number(g)}return!1}function o(c,v,w,x){return x[c]&&x[c].propertyValue&&String(x[c].propertyValue.value)===String(w)}const a=new Map([["length",t],["getProperty",o]]);Object.keys(n).reduce((c,v)=>(c.set(v,n[v]),c),a);function s(c,v){const w=c;return typeof v=="number"?[{target:w,operator:"length",param:null,value:Number(v)}]:typeof v=="boolean"?[{target:w,operator:"getProperty",param:c,value:!!v}]:typeof v=="object"?Object.keys(v).map(x=>{if(x==="length")return{target:w,operator:"length",param:null,value:v[x]};const S=x,g=v[x];return{target:w,operator:"getProperty",param:S,value:g}}):[]}function r(c){return Object.keys(c).reduce((w,x)=>{const S=s(x,c[x]);return w.push(...S),w},[])}function l(c,v){if(a.has(c.operator)){const w=a.get(c.operator);return w&&w(c.target,c.param,c.value,v)||!1}return!1}function p(c,v){return r(c).reduce((S,g)=>S&&l(g,v),!0)}function h(c,v){const w=Object.keys(c),x=w.includes("allOf"),S=w.includes("anyOf"),g=x||S,d=(g?c[g?x?"allOf":"anyOf":"allOf"]:[c]).map(j=>p(j,v));return x?!d.includes(!1):d.includes(!0)}return{parseValueSchema:h}}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"}},Ie={},lt={};rt();function se(n,t,o=new Map,a=(l,p,h)=>p,s={},r=l=>l){return ye[t.title]=t,ke[t.title]=a,Ie[t.title]=s,lt[t.title]=r,(l={})=>{const p=st(l,t,o),h=Object.keys(n).reduce((c,v)=>(c[v]=n[v].default,c),{});return Object.assign(h,p)}}function ie(n,t){return{customClass:t.class,customStyle:t.style}}const Ce=new Map([["appearance",ie]]);function it(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 h=n.getSchemaByType("content-container");Object.assign(h,{id:`container-${a}`,appearance:{class:"f-struct-wrapper"},contents:[p]});const c=s.schema;switch(c&&c.type){case re.splitter.type:{p.appearance.class="f-section-tabs f-section-in-main",l.appearance.class="f-component-tabs";break}}return h}function Ee(n,t,o,a){if(o.parentComponentInstance)return it(n,o);{const r=n.getSchemaByType("tab-page");return t.contents=[r],t}}function ct(n,t,o){return t}const De={$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"]},ce={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"}},$e=se(ce,De,Ce,Ee),we=Object.assign({},ce,{componentId:{type:String,default:""}}),Ae=se(we,De,Ce,Ee);function dt(n,t,o){const a=e.ref([]),s=e.ref(n.activeId||""),r=e.ref(!0),l=e.ref([]);e.watch(()=>n.activeId,(f,m)=>{f!==m&&(s.value=f)});function p(f){const m=f.value.findIndex(d=>d.props.show!==!1&&!s.value&&!d.props.disabled);!s.value&&m!==-1&&(s.value=f.value[m].props.id)}function h(f){var d;if(n.autoTitleWidth)return;const m=(d=f.value)==null?void 0:d.querySelectorAll(".st-tab-text");if(m)for(let T=0;T<m.length;T++){const j=m[T].parentNode;m[T].scrollWidth>j.offsetWidth?m[T].classList.contains("farris-title-text-custom")||m[T].classList.add("farris-title-text-custom"):m[T].classList.remove("farris-title-text-custom")}}const c=f=>{f.preventDefault(),f.stopPropagation()};function v(f,m,d=!1){const T=a.value.findIndex(j=>j.props.id===m);a.value=a.value.filter(j=>j.props.id!==m),s.value===m&&(s.value="",p(a)),c(f),e.nextTick(()=>{h(o),d&&(r.value=!0),t.emit("tabRemove",{removeIndex:T,removeId:m,activeId:s.value})})}function w(f){const m=s.value;s.value=f;const d=a.value.find(T=>T.props.id===f);l.value=[],d&&d.props.toolbar&&d.props.toolbar.contents&&d.props.toolbar.contents.length&&(l.value=[...d.props.toolbar.contents]),t.emit("update:activeId",f),t.emit("tabChange",{prevId:m,nextId:s.value})}function x(f){w(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(()=>{h(o)}))}return{activeId:s,addTab:S,changeTitleStyle:h,removeTab:v,selectTab:x,selectTabByTabId:w,tabPages:a,updateTab:g,toolbarItems:l}}function ut(n,t,o,a,s){const{activeId:r,removeTab:l,selectTab:p}=s,h=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===r.value,"f-state-disable":t.disabled})),v=e.computed(()=>({width:`${t.tabWidth}px`})),w=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function x(T){return e.createVNode("span",{class:h.value,title:T.title},[T.title])}function S(T){return T.slots.title?T.slots.title:x}const g=S(o),f=e.ref(t.removeable);function m(){return e.createVNode("span",{class:"st-drop-close",onClick:T=>l(T,t.id),style:{opacity:.6}},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function d(T){p(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}return e.createVNode("li",{class:c.value,style:v.value},[e.createVNode("a",{class:w.value,onClick:d},[g(t),f.value&&m()])])}function pt(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})),h=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:p.value,style:h.value},[e.createVNode("ul",{class:c.value,ref:t},[l.value.map(v=>ut(n,v.props,v,a,s))])])}function Re(n,t,o,a,s){const r=e.ref(),{shouldShowNavigationButtons:l}=o,{activeId:p,tabPages:h,selectTab:c}=s,v=e.ref(p.value),w=e.computed(()=>h.value.map(f=>({name:f.props.title,value:f.props.id,show:f.props.show,disabled:f.props.disabled}))),x=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){c(f)}return e.watch(()=>p.value,f=>{f!==v.value&&(v.value=f)},{immediate:!0}),()=>e.createVNode("div",{class:x.value,style:S.value},[e.createVNode(et,{items:w.value,modelValue:v.value,"onUpdate:modelValue":f=>v.value=f,onChange:g,ref:r},null)])}function ft(n,t,o,a){const{activeId:s,removeTab:r,tabPages:l}=a,{selectAndScrollToTab:p}=o,{hideDropDown:h,searchTabText:c}=t,v=e.ref("auto"),w=e.computed(()=>{var T,j;let d=[];return n.searchBoxVisible?d=(T=l.value)==null?void 0:T.filter($=>$.props.title.includes(c.value)):d=(j=l.value)==null?void 0:j.slice(),d}),x=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":n.searchBoxVisible,show:!h.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:v.value});function m(){return e.createVNode("div",{class:x.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=>c.value=d},null),[[e.vModelText,c.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),w.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:f()},[w.value.map(d=>e.createVNode("li",{class:S(d),onClick:T=>p(T,d.props)},[d.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:T=>r(T,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:m}}function Oe(n,t,o,a){const{hideDropDown:s}=t,{renderDropdownMenu:r}=ft(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 Fe(n,t,o,a){const s=e.ref(!1),{selectTabByTabId:r,tabPages:l}=a,p=4;function h(){var d;const f=t.value,m=(d=t.value)==null?void 0:d.parentElement;s.value=m&&f&&m.offsetWidth<f.scrollWidth-p}const c=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!s.value})),v=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!s.value})),w=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!s.value}));function x(f,m){if(!t.value)return;const d=t.value.scrollLeft,T=t.value.scrollWidth-t.value.offsetWidth;if(m>0){if(t.value.scrollLeft>=T)return;t.value.scrollLeft=d+n.scrollStep+f}else if(m<0){if(t.value.scrollLeft<=0)return;t.value.scrollLeft=d-n.scrollStep-f}}function S(f){if(!s.value||!t.value)return;const m=n.tabType==="pills"?".f-capsule-item":".nav-item",d=t.value.querySelectorAll(m),{parentElement:T}=t.value,j=d[f];if(j&&T){const $=T.getBoundingClientRect().left,O=T.getBoundingClientRect().right,y=j.getBoundingClientRect().left,M=j.getBoundingClientRect().right;y<$?x($-y,-1):O<M&&x(M-O,1),n.tabType==="one-page"&&o.scrollTo(f)}}function g(f,m){if(m.disabled)return;r(m.id);const d=l.value.findIndex(T=>T.props.id===m.id);e.nextTick(()=>{S(d)})}return{previousButtonClass:c,nextButtonGroupClass:v,nextButtonClass:w,scrollTab:x,selectAndScrollToTab:g,shouldShowNavigationButtons:s,updateNavigationLayout:h}}function Le(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(h=>h.props.title.includes(a.value)):o.value.slice());return{searchTabText:a,hideDropDown:s,shouldShowSearchBox:r,tabsInDropdownMenu:l}}function He(n,t,o){const a=".farris-tab-page",{tabPages:s}=o;function r(p){const h=t.value;if(h){const c=t.value.querySelectorAll(a);if(c.length>0){const v=c[p],{offsetTop:w}=v,x=w-32>0?w-32:0;h.scrollTop=x}}}function l(p){const h=s.value.findIndex(c=>c.props.id===p);h>-1&&r(h)}return{scrollTo:r,scrollToByPaggId:l}}const ee=e.defineComponent({name:"FTabs",props:ce,emits:["tabChange","tabRemove","update:activeId"],setup(n,t){const o=e.ref(n.tabType),a=e.shallowRef(),s=e.ref(n.customClass),r=e.shallowRef(),l=e.shallowRef(),p=dt(n,t,r),{activeId:h,changeTitleStyle:c,tabPages:v,addTab:w,updateTab:x,selectTabByTabId:S,toolbarItems:g}=p,f=He(n,l,p),m=Fe(n,r,f,p),{previousButtonClass:d,nextButtonClass:T,nextButtonGroupClass:j,scrollTab:$,updateNavigationLayout:O}=m,y=Le(n,p),{hideDropDown:M}=y,P=pt(n,r,m,f,p),I=P,N=Re(n,r,m,f,p),b=new Map([["default",P],["one-page",I],["pills",N]]);e.computed(()=>{const W=v.value.find(G=>G.props.id===h.value);return W==null?void 0:W.slots});const u=e.computed(()=>{const W=v.value.find(H=>H.props.id===h.value);return(W==null?void 0:W.props.toolbarPosition)==="inHead"}),i=e.computed(()=>n.fill||n.tabType==="fill");e.provide("tabs",{activeId:h,addTab:w,updateTab:x,tabPages:v,tabType:o,shouldFillParentContaner:i});const C=e.computed(()=>n.tabType==="pills"),B=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":u.value,"farris-tabs-inContent":!u.value,"farris-tabs-nav-fill":i.value,"farris-tabs-nav-pills":C.value})),D=e.computed(()=>({width:u.value&&n.titleWidth?`${n.titleWidth}%`:""})),V=e.computed(()=>{const W={"farris-tabs":!0,"f-utils-fill-flex-column":i.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((G,H)=>(G[H]=!0,G),W),W});e.onMounted(()=>{v.value.length&&(h.value=n.activeId||v.value[0].props.id,S(h.value)),e.nextTick(()=>{O()}),c(r),window.addEventListener("click",W=>{var G;M.value||(G=a.value)!=null&&G.contains(W.target)||(M.value=!0)}),window.addEventListener("resize",()=>{O()})});function k(){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:T.value,onClick:()=>{$(0,1)}},null)}const{renderMorePagesButtton:R}=Oe(n,y,m,p),L=W=>{t.emit("Click",W)};function X(){return g.value.length?e.createVNode(Be,{items:g.value,onClick:L},null):null}const J=b.get(n.tabType)||b.get("default");function oe(){var W,G,H,_;return e.createVNode("div",{class:B.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(G=(W=t.slots).headerPrefix)==null?void 0:G.call(W)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:D.value},[k(),J&&J(),e.createVNode("div",{class:j.value},[A(),R()])]),X(),e.createVNode("div",{class:"farris-tabs-header-post"},[(_=(H=t.slots).headerSuffix)==null?void 0:_.call(H)])])}const Q=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":i.value}));function K(){var W,G;return e.createVNode("div",{class:Q.value,ref:l},[(G=(W=t.slots).default)==null?void 0:G.call(W)])}return()=>e.createVNode("div",{class:V.value,ref:a},[oe(),K()])}}),mt=new Map([["appearance",ie],["toolbar",ht]]);function ht(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 bt={$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"]},de={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=tt.createPropsResolver(de,bt,mt);function gt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const ue=e.defineComponent({name:"FTabPage",props:de,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 h(){var g,f;const S=(f=(g=t.slots).default)==null?void 0:f.call(g);return e.createVNode(nt,{"main-title":n.title,class:"farris-tab-page"},gt(S)?S:{default:()=>[S]})}const c=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 v(){var g,f;const S=(f=(g=t.slots).default)==null?void 0:f.call(g);return e.createVNode("div",{class:c.value,style:p.value},[S])}const x=new Map([["default",v],["one-page",h]]).get(r.value)||v;return()=>a.value?x():null}}),yt={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 vt(n){if(!navigator.clipboard)throw xe();return navigator.clipboard.writeText(n)}async function Ct(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 wt(n){try{await vt(n)}catch(t){try{await Ct(n)}catch(o){throw o||t||xe()}}}function Tt(){async function n(t){await wt(t)}return{onCopy:n}}function xt(n,t,o,a){const s=e.ref(14),r=e.ref(140),l=e.ref(""),p=e.ref(a.value.length),h=e.computed(()=>a.value),c=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function v(w){if(w.currentTarget){const x=w.currentTarget.value||"";p.value=x.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:c.value,rows:"4",maxlength:r.value,onInput:w=>v(w)},[h.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 St(n,t,o,a){const s=xt(n,t,o,a),r=new Map([["text-area",s]]);function l(p){return r.get(p)||null}return{getEditorRender:l}}function Nt(){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 jt(n,t){const o=t.getEditorRender(n.promptEditorType);return()=>o&&o()}function Mt(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 m=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":t.value,"max-height":m}}),p=e.computed(()=>n.value&&n.value.detail||""),h=e.computed(()=>!0),c=e.ref(!1),v=e.ref("展开"),w=e.ref("收起"),x=e.computed(()=>{const m={display:"block",color:"#2A87FF"};return m["text-align"]=c.value?"":"right",m});function S(m,d){c.value=!c.value,t.value=c.value?20:3}function g(m){return S()}function f(m){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)]),h.value&&e.createVNode("span",{style:x.value},[c.value&&e.createVNode("span",{onClick:g,style:"cursor: pointer;"},[w.value]),!c.value&&e.createVNode("span",{onClick:f,style:"cursor: pointer;"},[v.value])])])}function Vt(n){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Bt(n,t,o,a){const s=e.ref(n.exceptionInfo),r=e.computed(()=>{const x={"f-icon":!0},S=`f-icon-${t.value}`;return x[S]=!0,x}),l=e.computed(()=>o.value||s.value&&s.value.message),p=e.computed(()=>a.value),h=e.computed(()=>!!a.value),c=e.computed(()=>!!s.value);function v(){return c.value?Mt(s):h.value?Vt(p):()=>null}const w=v();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),w()])])}function Pt(n,t,o){const{onCopy:a}=t,{toShowFeedback:s}=o,r=e.ref("复制成功"),l=e.ref("复制详细信息"),p=e.ref(n.exceptionInfo||{date:"",message:"",detail:""}),h=e.computed(()=>p.value&&p.value.detail||"");function c(v){a(h.value).catch(w=>{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:c,style:"cursor: pointer;"},[l.value])])}function kt(n,t,o,a){const s=e.ref(n.type),r=e.ref([]),l=e.ref(n.exceptionInfo),p=e.ref(n.okButtonText),h=e.ref(n.cancelButtonText),c=e.ref(!0),v=e.ref(!0),w=e.computed(()=>!!(r.value&&r.value.length)),x=e.computed(()=>l.value&&l.value.date&&l.value.message&&l.value.detail),S=e.computed(()=>!(r.value&&r.value.length)&&(p.value||h.value)),g=e.computed(()=>v.value&&p.value),f=e.computed(()=>c.value&&h.value),m=Pt(n,o,a);function d(j){s.value==="question"&&t.emit("reject"),t.emit("close")}function T(j){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[x.value&&m(),S.value&&f.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:d},[h.value]),S.value&&g.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[p.value]),w.value&&r.value.length&&r.value.map(j=>e.createVNode("button",{type:"button",onClick:j.handle,class:j.class},[j.iconClass&&e.createVNode("span",{class:j.iconClass},null),j.text]))])}const pe=e.defineComponent({name:"FMessageBox",props:yt,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 m={"modal-tips":!0,"d-flex":!0,"flex-row":!0},d=`messager-type-${o.value}`;return m[d]=!0,m}),l=e.computed(()=>{const m={};return o.value==="prompt"?m.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(m.padding="0.5rem 1.5rem 1rem 1.5rem"),m}),p=Tt(),h=St(n,o,a,s),c=Nt(),{feedbackStyle:v,feedbackMessage:w}=c;function x(){return e.createVNode("div",{style:v.value},[w.value])}function S(){switch(o.value){case"prompt":return jt(n,h);default:return Bt(n,o,a,s)}}const g=S(),f=kt(n,t,p,c);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:l.value},[g()]),f(),x()])}}),It={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}};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),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 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),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 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 ne{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new ne(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 ne(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function Et(n,t){const o=e.ref(),a=e.ref(),s=e.ref(),r=e.ref(),l=e.ref(),p=e.ref(),h=e.ref(),c=e.ref(),v=e.ref(),w=e.ref(),x=e.ref(),S=e.ref(),g=e.ref(n.draggable),f=e.ref(!1);function m(){const V=a.value||document.body,k=window.getComputedStyle(V);if(!k||!o.value)return;const A=U.getTransformInfo(o.value),R={};h.value&&(R.deltaL=o.value.offsetLeft-h.value.x,R.deltaT=o.value.offsetTop-h.value.y);const L=k.getPropertyValue("position");R.width=V.clientWidth,R.height=V.clientHeight,R.pr=parseInt(k.getPropertyValue("padding-right"),10),R.pb=parseInt(k.getPropertyValue("padding-bottom"),10),R.position=k.getPropertyValue("position"),L==="static"&&(V.style.position="relative"),R.translateX=A.x,R.translateY=A.y,w.value=R}function d(V){if(o.value){r.value=ne.getCurrent(o.value),l.value=U.getCurrent(o.value),p.value=r.value?ne.copy(r.value):null,h.value=l.value?U.copy(l.value):null,m();const k=V.target.getAttribute("type")||"";c.value={n:!!k.match(/n/),s:!!k.match(/s/),w:!!k.match(/w/),e:!!k.match(/e/)}}}function T(){var V,k,A,R;if(o.value){const L=o.value;c.value&&((c.value.n||c.value.s)&&((V=p.value)!=null&&V.height)&&(L.style.height=p.value.height+"px"),(c.value.w||c.value.e)&&((k=p.value)!=null&&k.width)&&(L.style.width=p.value.width+"px"),h.value&&((A=h.value)!=null&&A.x&&(L.style.left=h.value.x+"px"),(R=h.value)!=null&&R.y&&(L.style.top=h.value.y+"px")))}}function j(){const V=n.minHeight?n.minHeight:1,k=n.minWidth?n.minWidth:1;p.value&&h.value&&c.value&&r.value&&(p.value.height<V&&(p.value.height=V,c.value.n&&l.value&&(h.value.y=l.value.y+(r.value.height-V))),p.value.width<k&&(p.value.width=k,c.value.w&&l.value&&(h.value.x=l.value.x+(r.value.width-k))),n.maxHeight&&p.value.height>n.maxHeight&&(p.value.height=n.maxHeight,l.value&&c.value.n&&(h.value.y=l.value.y+(r.value.height-n.maxHeight))),n.maxWidth&&p.value.width>n.maxWidth&&(p.value.width=n.maxWidth,c.value.w&&l.value&&(h.value.x=l.value.x+(r.value.width-n.maxWidth))))}function $(){if(a.value){const V=w.value;if(h.value&&p.value&&c.value&&r.value){const k=V.width-V.pr-V.deltaL-V.translateX-h.value.x,A=V.height-V.pb-V.deltaT-V.translateY-h.value.y;c.value.n&&h.value.y+V.translateY<0&&l.value&&(h.value.y=-V.translateY,p.value.height=r.value.height+l.value.y+V.translateY),c.value.w&&h.value.x+V.translateX<0&&l.value&&(h.value.x=-V.translateX,p.value.width=r.value.width+l.value.x+V.translateX),p.value.width>k&&(p.value.width=k),p.value.height>A&&(p.value.height=A)}}}function O(V){if(!s.value||!r.value||!l.value||!c.value)return;V.subtract(s.value);const k=V.x,A=V.y;c.value.n?(h.value.y=l.value.y+A,p.value.height=r.value.height-A):c.value.s&&(p.value.height=r.value.height+A),c.value.e?p.value.width=r.value.width+k:c.value.w&&(p.value.width=r.value.width-k,h.value.x=l.value.x+k),$(),j(),T()}function y(V){if(!v.value)return;const k=U.fromEvent(V);k&&O(k)}function M(){if(o.value){const{width:V,height:k,x:A,y:R}=o.value.getBoundingClientRect(),L=U.getTransformInfo(o.value);return{size:{width:V,height:k},position:{x:A-L.x,y:R-L.y}}}return null}function P(V){if(o.value){const k=M();x.value=k}s.value=void 0,r.value=null,l.value=null,p.value=null,h.value=null,c.value=null,v.value=null,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",P)}function I(){document.addEventListener("mousemove",y),document.addEventListener("mouseup",P)}function N(V){V instanceof MouseEvent&&V.button===2||g.value&&(V.stopPropagation(),V.preventDefault(),s.value=U.fromEvent(V),v.value=V.target,d(V),I())}function b(V){return o.value=V,e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"ng-resizable-handle ng-resizable-n",type:"n",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-e",type:"e",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-s",type:"s",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-w",type:"w",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-ne",type:"ne",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-se ng-resizable-diagonal",type:"se",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-sw",type:"sw",onMousedown:k=>N(k)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-nw",type:"nw",onMousedown:k=>N(k)},null)])}function u(V=!0){const k=a.value||document.body,A=ne.getCurrent(k),R=o.value;V&&(S.value=M(),S.value.transform=R.style.transform),A&&R&&(p.value=A,R.style.height=p.value.height-14+"px",R.style.width=p.value.width-14+"px",R.style.left="7px",R.style.top="7px",R.style.transform="",x.value={size:p.value,position:{x:0,y:0}},g.value=!1,f.value=!0)}function i(){var V,k;if(S.value){const A={width:S.value.size.width||0,height:S.value.size.height||0},R={x:(window.innerWidth-A.width)/2,y:(window.innerHeight-A.height)/2};(V=p.value)==null||V.set(A),(k=h.value)==null||k.set(R);const L=o.value;L.style.height=A.height+"px",L.style.width=A.width+"px",L.style.left=`${R.x}px`,L.style.top=`${R.y}px`,L.style.transform="",x.value={size:A,position:R},g.value=n.draggable,f.value=!1}}function C(){if(o.value){const V=ne.getCurrent(o.value);if(V){const{width:k,height:A}=V;o.value.style.left=`${(window.innerWidth-k)/2}px`,o.value.style.top=`${(window.innerHeight-A)/2}px`,o.value.style.transform=""}}}function B(){const V=()=>{f.value?u(!1):C()};return window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}}const D=B();return{renderResizeBar:b,boundingElement:a,resizedEventParam:x,maximize:u,restore:i,allowDrag:g,isMaximized:f,unWindowResizeHandle:D}}function Dt(n,t){const o=e.ref(),a=e.ref(n.draggable),s=e.ref(n.lockAxis),r=e.ref(),l=e.ref(),p=e.ref(!1),h=e.ref(new U(0,0)),c=e.ref(new U(0,0)),v=e.ref(new U(0,0)),w=e.ref(new U(0,0));function x(y,M){if(M.tagName==="BUTTON")return!1;if(M===y)return!0;for(const P in M.children)if(M.children.hasOwnProperty(P)&&x(y,M.children[P]))return!0;return!1}function S(){var I,N;let y=v.value.x+c.value.x,M=v.value.y+c.value.y;s.value==="x"?(y=((I=h.value)==null?void 0:I.x)||0,v.value.x=0):s.value==="y"&&(M=((N=h.value)==null?void 0:N.y)||0,v.value.y=0);const P=`translate3d(${Math.round(y)}px, ${Math.round(M)}px, 0px)`;o.value&&(o.value.style.transform=P),w.value.x=y,w.value.y=M}function g(){if(!l.value||!o.value)return null;const y=l.value.getBoundingClientRect(),M=o.value.getBoundingClientRect(),P={top:y.top<M.top,right:y.right>M.right,bottom:y.bottom>M.bottom,left:y.left<M.left};return P.top||(v.value.y-=M.top-y.top),P.bottom||(v.value.y-=M.bottom-y.bottom),P.right||(v.value.x-=M.right-y.right),P.left||(v.value.x-=M.left-y.left),S(),P}function f(y){y&&(h.value&&y.subtract(h.value),v.value.set(y),S(),g())}function m(y){p.value&&a.value&&(y.stopPropagation(),y.preventDefault(),f(U.fromEvent(y,r.value)))}function d(){var y;p.value&&(p.value=!1,c.value.add(v.value),v.value.reset(),(y=o.value)==null||y.classList.remove("ng-dragging"),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d))}function T(){!p.value&&r.value&&(p.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",m),document.addEventListener("mouseup",d))}function j(){if(o.value){const y=U.getTransformInfo(o.value);c.value.set(y);return}c.value.reset()}function $(y){if(y instanceof MouseEvent&&y.button===2)return;const M=y.target||y.srcElement;r.value!==void 0&&M&&!x(M,r.value)||a.value!==!1&&(y.stopPropagation(),y.preventDefault(),h.value=U.fromEvent(y,o.value),j(),T())}function O(y,M,P){if(y&&a.value&&M){if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)r.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const I=M.querySelector(n.dragHandle);I&&(r.value=I)}}else r.value=y;o.value=M,l.value=P,r.value.classList.add("ng-draggable"),r.value.addEventListener("mousedown",$)}}return{registerDraggle:O,resetTranslate:j}}function $t(n,t){const o=e.ref(n.enableEsc);function a(s){s.key==="Escape"&&n.enableEsc&&t.emit("esc",{event:s,type:"esc"})}o.value&&document.addEventListener("keydown",a)}const ze=e.defineComponent({name:"FModal",props:It,emits:["update:modelValue","accept","cancel","closed","resize","esc"],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),h=e.ref(n.showHeader),c=e.ref(""),v=e.ref(n.showCloseButton),w=e.ref(n.showMaxButton),x=e.ref(!1),S=e.ref(""),g=e.ref(""),f=e.ref(""),m=e.ref(n.showButtons),d=e.ref(n.title),T=e.ref(n.reiszeable),j=e.ref(n.containment||null),$=e.ref();function O(E,q){s.value=!1,t.emit("update:modelValue",!1),q!=null&&t.emit(q?"accept":"cancel"),t.emit("closed",E)}const y=[{name:"cancel",text:"取消",class:"btn btn-light",handle:E=>{O(E,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:E=>{O(E,!0)}}],M=e.ref(n.buttons&&n.buttons.length?n.buttons:y),P=e.computed(()=>!!c.value),I=e.computed(()=>!!m.value&&!!M.value),N=e.ref(),b=e.ref(),u=e.ref(!1),{renderResizeBar:i,maximize:C,restore:B,boundingElement:D,resizedEventParam:V,allowDrag:k,unWindowResizeHandle:A}=Et(n),{registerDraggle:R}=Dt(n);e.watch(()=>n.title,(E,q)=>{E!==q&&(d.value=E)}),e.watch(()=>n.modelValue,(E,q)=>{E!==q&&(s.value=E)}),e.watch(()=>n.showHeader,(E,q)=>{E!==q&&(h.value=E)}),e.watch(()=>n.showButtons,(E,q)=>{E!==q&&(m.value=E)}),e.watch(()=>V.value,(E,q)=>{const le=E||{},be=q||{};JSON.stringify(le)!==JSON.stringify(be)&&t.emit("resize",{newSize:E,oldSize:q})});function L(){const E=document.querySelectorAll(".farris-modal").length;(!E||E-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 E={modal:!0,"farris-modal":!0,fade:!0};return E["f-modal-fitContent"]=!!p.value,E.show=!!X.value,E}),oe=e.computed(()=>{var le;const E={"modal-dialog":!0},q=(le=l.value)==null?void 0:le.split(" ");return q==null||q.reduce((be,An)=>(be[An]=!0,be),E),E}),Q=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`})),K=e.computed(()=>({"modal-content":!0,"modal-content-has-header":h.value})),W=e.computed(()=>{const E={display:h.value?"":"none"};return E["pointer-events"]=k.value?"auto":"none",E}),G=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 _(){return{}}const te=e.computed(()=>{const E={textAlgin:f.value},q=_();return Object.assign(E,q)});function he(E){if(E.stopPropagation(),u.value){u.value=!1,B();return}C(),u.value=!0}async function In(E,q){E.handle&&await E.handle(q,E)&&t.emit("closed",q)}function En(E){E.width&&(o.value=E.width),E.height&&(a.value=E.height),E.buttons&&(M.value=E.buttons),E.title&&(d.value=E.title)}e.onMounted(()=>{b.value&&!j.value&&(j.value=b.value.parentElement,D.value=j.value,R(N.value,b.value,D.value)),X.value&&document.body.classList.add("modal-open"),$t(n,t)}),e.onUnmounted(()=>{L(),A&&A()}),t.expose({modalElementRef:b,updateModalOptions:En,close:O});function Dn(){return e.createVNode("ul",null,[x.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),w.value&&e.createVNode("li",{onClick:he,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:G.value},null)]),v.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:E=>O(E,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function $n(){return e.createVNode("div",{class:"modal-footer",style:te.value},[M.value&&M.value.map(E=>e.createVNode("button",{name:E.name,type:"button",class:E.class+(E.iconClass?" btn-icontext":""),onClick:q=>{In(E,q)}},[!!E.iconClass&&e.createVNode("i",{class:E.iconClass},null),E.text]))])}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>{var E,q;return[X.value&&e.createVNode("div",{class:J.value,style:"display: block",ref:$},[e.createVNode("div",{id:r.value,class:oe.value,style:Q.value,ref:b},[e.createVNode("div",{class:K.value},[e.createVNode("div",{ref:N,class:"modal-header",style:W.value},[e.createVNode("div",{class:"modal-title"},[P.value&&e.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[d.value])]),e.createVNode("div",{class:"actions"},[Dn()])]),e.createVNode("div",{class:H.value},[(q=(E=t.slots).default)==null?void 0:q.call(E),S.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:g.value},null)]),I.value&&$n()]),!p.value&&T.value&&b.value&&i(b.value)])])]}})}});function We(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function At(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),h=e.ref(!!n.showHeader),c=e.ref(n.showCloseButton==null?!0:n.showCloseButton),v=e.ref(!0),w=e.ref(n.title||""),x=n.acceptCallback||(()=>{}),S=n.rejectCallback||(()=>{}),g=n.closedCallback||(T=>{}),f=n.resizeHandle||(T=>{}),m=We(n),d=T=>{v.value=!1,o.unmount(),g(T)};return e.onMounted(()=>{}),s.expose({modalRef:r}),()=>e.createVNode(ze,{ref:r,class:l.value,modelValue:v.value,"onUpdate:modelValue":T=>v.value=T,title:w.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":h.value,"show-buttons":p.value,"show-close-button":c.value,"show-max-button":!1,onAccept:x,onCancel:S,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:d,onResize:f},{default:()=>[m&&m(o)]})}});return document.body.appendChild(t),o.mount(t),o}class Rt{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 At(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,T)=>{}),h=a.value.resizeHandle||(d=>{});let c;const v=We(a.value),w=d=>{var j;s.value=!1;const T=(j=d==null?void 0:d.target)==null?void 0:j.classList.contains("modal_close");p(d,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},x=d=>{w(d),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 T=Object.keys(this.modalRefs);T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},S=d=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(d==null?void 0:d.event))},g=()=>e.createVNode(ze,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":d=>s.value=d},a.value,{onAccept:r,onCancel:l,onClosed:x,onResize:h,onEsc:S}),{default:()=>[v&&v()]});return c=(d=>{const T=e.h(g,d);return T.appContext=this.appContext,e.render(T,o),T})({...a.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:d=>{a.value={...a.value,...d},c&&e.render(e.cloneVNode(c,{...a}),o)},destroy:x,modalRef:this.activeModalInstance}}}class Z{static show(t){let o=new Rt;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||(()=>{}),h=a.rejectCallback||(()=>{});let c=null;const v=()=>{c&&(c==null||c.destroy(),o=null)};c=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(pe,e.mergeProps(a,{onAccept:p,onReject:h,onClose:v}),null)})}static info(t,o){const a=e.reactive({type:"info",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Z.show(a)}static warning(t,o){const a=e.reactive({type:"warning",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});Z.show(a)}static success(t,o){const a=e.reactive({type:"success",title:t,detail:o,okButtonText:"关闭",cancelButtonText:""});Z.show(a)}static error(t,o,a){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:a,message:t,detail:o}});Z.show(s)}static prompt(t,o){const a=e.reactive({type:"prompt",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消"});Z.show(a)}static question(t,o,a,s){const r=e.reactive({type:"question",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:a,rejectCallback:s});Z.show(r)}}pe.install=n=>{n.component(pe.name,pe),n.provide("FMessageBoxService",Z)};function Ot(n,t,o,a,s,r){const{activeId:l,removeTab:p,selectTab:h,removeDesignTab:c,selectDesignTab:v}=s,w=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":n.autoTitleWidth})),x=e.computed(()=>{const I={"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 I[`${t.id}-design-item`]=!0,I}),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(I){return e.createVNode("span",{class:w.value,title:I.title},[I.title])}function m(I){return I.slots.title?I.slots.title:f}const d=m(o),T=e.ref(t.removeable);function j(){return e.createVNode("span",{class:"st-drop-close",onClick:I=>p(I,t.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function $(I){h(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}function O(I){v(I,t.id,r.value)}function y(I){Z.question(`确定删除标签页【${o.props.title}】?`,"",()=>c(I,t.id),()=>{})}function M(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:I=>y(I)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function P(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[M()])])}return e.createVNode("li",{onClick:I=>O(I),class:x.value,style:S.value,id:`${t.id}-design-item`},[P(),e.createVNode("a",{class:g.value,onClick:$},[d(t),T.value&&j()])])}function Ft(n,t,o,a,s,r,l){const{shouldShowNavigationButtons:p}=o,{tabPages:h}=s,c=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":p.value})),v=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),w=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"})),x=e.computed(()=>({overflow:"auto"}));function S(f){const{componentType:m}=f;let d=Y(m,f);l&&l.onResolveNewComponentSchema&&(d=l.onResolveNewComponentSchema(f,d));const T=m.toLowerCase().replace("-","_");return d&&!d.id&&d.type===m&&(d.id=`${T}_${Math.random().toString().slice(2,6)}`),d}const g=function(f){var j;const m={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},d=S(m);(j=r.value.schema.contents)==null||j.push(d);const{selectTabByTabId:T}=s;T(d.id)};return()=>e.createVNode("div",{class:c.value,style:v.value},[e.createVNode("ul",{class:w.value,style:x.value,ref:t},[h.value.map(f=>Ot(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 qe(n,t,o){var O;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 h(){return!1}function c(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function v(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function w(y){if(!y||!y.value)return null;if(y.value.schema&&y.value.schema.type==="component")return y.value;const M=e.ref(y==null?void 0:y.value.parent),P=w(M);return P||null}function x(y=t){const{componentInstance:M,designerItemElementRef:P}=y;return!M||!M.value?null:M.value.canMove?P:x(y.parent)}function S(y){return!!o&&o.canAccepts(y)}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 m(y,M){M&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(M)}function d(y,M){const{componentType:P}=y;let I=Y(P,y,M);o&&o.onResolveNewComponentSchema&&(I=o.onResolveNewComponentSchema(y,I));const N=P.toLowerCase().replace("-","_");return I&&!I.id&&I.type===P&&(I.id=`${N}_${Math.random().toString().slice(2,6)}`),I}function T(y,M){const P=String(y.getAttribute("data-controltype")),I=y.getAttribute("data-feature"),N=I?JSON.parse(I):{};N.parentComponentInstance=l.value;let b=Y(P,N);o&&o.onAcceptNewChildElement&&(b=o.onAcceptNewChildElement(y,M,b));const u=P.toLowerCase().replace("-","_");return b&&!b.id&&b.type===P&&(b.id=`${u}_${Math.random().toString().slice(2,6)}`),b}function j(y){}function $(...y){if(o&&o.getPropsConfig)return o.getPropsConfig(...y)}return l.value={canMove:p(),canSelectParent:h(),canDelete:c(),canNested:!v(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(O=t==null?void 0:t.parent)==null?void 0:O.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:r,canAccepts:S,getBelongedComponentInstance:w,getDraggableDesignItemElement:x,getDraggingDisplayText:g,getPropConfig:$,getDragScopeElement:f,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:j,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},l}const Lt={$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,m,d){var T;if(typeof m=="number")return((T=d[g])==null?void 0:T.length)===m;if(typeof m=="object"){const j=Object.keys(m)[0],$=m[j];if(j==="not")return Number(d[g].length)!==Number($);if(j==="moreThan")return Number(d[g].length)>=Number($);if(j==="lessThan")return Number(d[g].length)<=Number($)}return!1}function t(g,f,m,d){return typeof m=="boolean"?d.childrenClassList.includes(f)===!!m:!1}function o(g,f,m,d){return typeof m=="boolean"?d.parentClassList.includes(f)===!!m:!1}function a(g,f,m,d){return typeof m=="boolean"?d.parentClassList.includes(f)===!!m:!1}const s=new Map([["length",n],["hasChildren",t],["hasSibling",a],["hasParent",o]]);function r(g,f){const m=g;return typeof f=="number"?[{target:m,operator:"length",param:null,value:Number(f)}]:typeof f=="object"?Object.keys(f).map(d=>{if(d==="length")return{target:m,operator:"length",param:null,value:f[d]};const T=d,j=f[d];return{target:m,operator:g==="children"?"hasChildren":g==="parent"?"hasParent":"hasSibling",param:T,value:j}}):[]}function l(g,f){if(s.has(g.operator)){const m=s.get(g.operator);return m&&m(g.target,g.param,g.value,f)||!1}return!1}function p(g,f){return Object.keys(g).reduce((j,$)=>{const O=r($,g[$]);return j.push(...O),j},[]).reduce((j,$)=>j&&l($,f),!0)}function h(g,f){const m=Object.keys(g),d=m.includes("allOf"),T=m.includes("anyOf"),j=d||T,y=(j?g[j?d?"allOf":"anyOf":"allOf"]:[g]).map(P=>p(P,f));return d?!y.includes(!1):y.includes(!0)}function c(g,f){const m=g.const;return m?typeof m=="boolean"?m:typeof m=="object"?h(m,f):!1:!1}function v(g){return f=>{const m={canAccept:!0,fixed:!1,hidePadding:!1};return g&&g.properties&&Object.keys(g.properties).reduce((d,T)=>{const j=g.properties[T];return d[T]=c(j,f),d},m),m}}function w(g,f,m){if(f.type==="object"&&f.properties){const{rules:d,contents:T}=f.properties;m.set(g,v(d)),T&&Object.keys(T.properties).forEach(j=>w(j,T.properties[j],m))}}function x(){const{properties:g}=Lt;Object.keys(g).forEach(f=>{w(f,g[f],Se)})}function S(g,f){const m={canAccept:!0,fixed:!1,hidePadding:!0};return Se.has(g)?Se.get(g)(f):m}return x(),{getRuleValue:S}}const Ht={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:"是否可移除"}}}}},zt={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 Wt(n,t){const o=Ne();let a=!1,s,r=!1;function l(x){return!1}function p(){return!r}function h(){return!r}function c(){return a}function v(){const x=n,S=x.appearance&&x.appearance.class||"",g=S?S.split(" "):[],f=t==null?void 0:t.schema,m=f&&f.appearance&&f.appearance.class||"",d=m?m.split(" "):[],T=x.contents||[],j=T.length?T[0]:null,$=j&&j.appearance&&j.appearance.class||"",O=$?$.split(" "):[],y=T.length?T.reduce((u,i)=>{const C=i&&i.appearance?i.appearance.class:"",B=C?C.split(" "):[];return u.push(...B),u},[]):[],M=(t==null?void 0:t.parent)&&t.parent.schema,P=M&&M.appearance&&M.appearance.class||"";P&&P.split(" "),s={componentClass:S,componentClassList:g,childContents:T,firstChildContent:j,firstChildClass:$,firstChildClassList:O,parent,parentClass:m,parentClassList:d,children:T,childrenClassList:y};const{canAccept:I,fixed:N,hidePadding:b}=o.getRuleValue(g[0],s);return a=b,r=N,!0}function w(x){var g;return((g=document.querySelector(".dgComponentFocused"))==null?void 0:g.id)===`${n.id}-design-item`?zt:Ht}return{canAccepts:l,checkCanDeleteComponent:p,checkCanMoveComponent:h,getPropsConfig:w,hideNestedPaddingInDesginerView:c,resolveComponentContext:v}}const fe=e.ref(0);function qt(n,t){const o=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=a.top>=o.top,r=a.top<=o.bottom;return s&&r}function _t(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(!qt(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 Ut(n,t,o,a){const s=e.ref([]),r=e.ref(n.activeId||""),l=e.ref(!0),p=e.ref(),h=e.ref([]);function c(i){const C=i.value.findIndex(B=>B.props.show!==!1&&!r.value&&!B.props.disabled);!r.value&&C!==-1&&(r.value=i.value[C].props.id)}function v(i,C){i.classList.contains(C)||i.classList.add(C)}function w(i,C){i.classList.remove(C)}function x(i){const{parentElement:C}=i;C&&(i.scrollWidth>C.offsetWidth?v(i,"farris-title-text-custom"):w(i,"farris-title-text-custom"))}function S(i){var B;if(n.autoTitleWidth)return;const C=(B=i.value)==null?void 0:B.querySelectorAll(".st-tab-text");C&&C.forEach(D=>x(D))}const g=i=>{i.preventDefault(),i.stopPropagation()};function f(i){s.value=s.value.filter(C=>C.props.id!==i),r.value===i&&(r.value="",c(s))}function m(i,C,B=!1){const D=s.value.findIndex(V=>V.props.id===C);f(C),g(i),e.nextTick(()=>{S(o),B&&(l.value=!0),t.emit("tabRemove",{removeIndex:D,removeId:C,activeId:r.value})})}function d(){const i=s.value.find(D=>D.props.id===r.value);if(h.value=[],i&&i.props.toolbar){const D=i.props.toolbar.hasOwnProperty("contents")?"contents":"buttons";i.props.toolbar[D]&&i.props.toolbar[D].length&&(h.value=[...i.props.toolbar[D]])}const C=a.schema.contents,B=C==null?void 0:C.find(D=>D.id===r.value);p.value=B==null?void 0:B.toolbar}function T(i){const C=r.value;r.value=i,d(),t.emit("tabChange",{prevId:C,nextId:r.value})}function j(i){T(i)}function $(i){s.value.findIndex(B=>B.props.id===i.props.id)===-1&&s.value.push(i)}function O(i){s.value.findIndex(B=>B.props.id===i.props.id)!==-1&&(s.value.forEach(B=>{B.props.id===i.props.id&&(B=i)}),e.nextTick(()=>{S(o)}))}function y(i){i&&(i.stopPropagation(),i.preventDefault())}function M(i,C){y(i);const B=a.schema.contents,D=B==null?void 0:B.findIndex(V=>V.id===C);D===-1||D===void 0||(B==null||B.splice(D,1),f(C),fe.value++)}function P(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused"));const i=document.getElementsByClassName("dgComponentSelected");Array.from(i).forEach(C=>C.classList.remove("dgComponentSelected"))}function I(i){i.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function N(i,C){var k;const{contents:B=[]}=a.schema,D=B==null?void 0:B.findIndex(A=>A.id===i),V=B[D];(k=a==null?void 0:a.setupContext)==null||k.emit("selectionChange",V.type,V,n.componentId,C)}function b(i,C,B){P(),y(i),I(i),N(C,B)}function u(i,C){P(),y(i),I(i)}return{activeId:r,addTab:$,changeTitleStyle:S,removeTab:m,selectTab:j,selectTabByTabId:T,tabPages:s,updateTab:O,toolbarItems:h,removeDesignTab:M,selectDesignTab:b,selectDesignTabToolbar:u,toolbarSchema:p}}const Gt=new Map([["buttons","items"],["appearance",ie]]),Xt=new Map([["appearance",Yt]]);function Yt(n,t){return{class:t.class,style:t.style}}function _e(n,t,o){return t}const Jt={$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:"The alignment of Response Toolbar Button.",type:"string",default:"right"},text:{description:"The items of Response Toolbar.",type:"string",default:"新增"},icon:{description:"The icon of response toolbar item.",type:"string",default:""},click:{description:"The event of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},Ue={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:""}}}}},Ge={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};ye[je.title]=je,Ie[Ue.title]=Ue;const Zt=Object.assign({},Ge,{componentId:{type:String,default:""}});se(Ge,Jt,Gt,_e);const Xe={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(Xe,je,Xt,_e);class Ye{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 Qt extends Ye{constructor(t){super(t)}}function Kt(){function n(t){const o=[];return t.reduce((a,s)=>(s.children&&s.children.length>0?a.push(new me(s)):a.push(new Qt(s)),a),o),o}return{buildResponseToolbarItems:n}}const{buildResponseToolbarItems:en}=Kt();class me extends Ye{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=en(o.children))}}function tn(){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 nn(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 i=b.menuClass.split(" ");i&&i.length&&i.reduce((C,B)=>(C[B]=!0,C),u)}return u}function l(b){const u={disabled:!b.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},i=b.dropdownClass.split(" ");return i&&i.length&&i.reduce((C,B)=>(C[B]=!0,C),u),u}function p(b){const u={disabled:!b.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},i=b.class.split(" ");return i&&i.length&&i.reduce((C,B)=>(C[B]=!0,C),u),u}let h;const c=new Map;function v(b,u,i){var B;((B=b.target)==null?void 0:B.id)===u.id&&b.stopPropagation();const C=i?i.id:"__top_item__";if(u.children&&u.children.length&&(u.expanded=!u.expanded,u.expanded?c.set(C,u):c.delete(C)),c.has(C)&&c.get(C)!==u){const D=c.get(C);D&&(D.expanded=!1)}}function w(b){b&&(b.stopPropagation(),b.preventDefault())}function x(){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 i=[];u.forEach(D=>{i=i.concat(D.children||[])});const C=i.findIndex(D=>D.id===b),B=C===-1?null:i[C];return{index:C,item:B}}function f(b){const{buttons:u=[]}=o.schema,i=u.findIndex(B=>B.id===b),C=i===-1?null:u[i];return{index:i,item:C}}function m(b){var C;o.schema;const{index:u,item:i}=g(b);(C=o==null?void 0:o.setupContext)==null||C.emit("selectionChange",i==null?void 0:i.type,i)}const d=function(b){const{componentType:u}=b,i=Y(u,b),C=u.toLowerCase().replace("-","_");return i&&!i.id&&i.type===u&&(i.id=`${C}_${Math.random().toString().slice(2,6)}`),i},T=function(){const b={componentType:"response-toolbar-item",parentComponentInstance:t.value,targetPosition:-1};return d(b)};function j(b,u){w(b),x(),S(b),m(u.id)}function $(b,u,i){w(b);const C=u.id,B=i&&i.id,{buttons:D=[]}=o.schema;if(!B)return;const{index:V}=f(B);if(V===-1)return;const{index:k}=g(C);k!==-1&&(D[V].children.splice(k,1),s())}function O(b,u,i){w(b);const C=i&&i.id,{buttons:B=[]}=o.schema;if(!C)return;const{index:D}=f(C);if(D===-1)return;const V=T(),k=Object.assign({},V,{text:u.text});B[D].children.push(k),s()}function y(b,u,i){w(b);const C=i&&i.id,{buttons:B=[]}=o.schema;if(!C)return;const{index:D}=f(C);if(D===-1)return;const V=T(),k=Object.assign({},V,{text:"按钮"});B[D].children.push(k),s()}function M(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:i=>$(i,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:i=>O(i,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:i=>y(i,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 P(b){return b.children.map(u=>u.children&&u.children.length?e.createVNode("li",{class:l(u),id:u.id,onClick:i=>u.enable&&v(i,u,b)},[e.createVNode("span",{id:u.id,class:p(u),onMouseover:i=>u.enable&&v(i,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)]),h(u,u)]):e.createVNode("li",{class:p(u),id:u.id,onClick:i=>j(i,u)},[M(u,b),n.shouldShowIcon(u)&&e.createVNode("i",{class:n.iconClass(u)},null),u.text]))}function I(b,u,i){const C={display:b.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},B=document.getElementsByTagName("body")[0].getClientRects()[0].width,D=u,V=D==null?void 0:D.getClientRects();if(D&&V&&V.length){const{top:k,width:A,left:R,right:L,height:X}=V[0],J=Math.ceil(X+k);C.top=`${J}px`,C.left=`${R}px`;const oe=b.id+"_menu",Q=u?u.querySelector("#"+oe):null;if(Q){C.display==="block"&&(Q.style.display="block");const K=Q.getBoundingClientRect();if(i){C.top=`${k-6}px`;const W=Math.ceil(A+R);C.left=`${W}px`}B-R-A<K.width&&(C.left=`${(i?R:L)-K.width}px`)}}return C}h=function(b,u){var D,V;const i=e.getCurrentInstance(),C=u?u.id:b.id,B=(V=(D=i==null?void 0:i.exposed)==null?void 0:D.elementRef.value)==null?void 0:V.querySelector("#"+C);return e.createVNode("ul",{class:r(b),style:I(b,B,u),id:b.id+"_menu"},[P(b)])};function N(){c.forEach(b=>{b.expanded=!1}),c.clear()}return{renderDropdownMenu:h,clearAllDropDownMenu:N}}function on(n,t,o){const a=e.ref(n.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:r}=nn(t,o),l=e.inject("design-item-context"),p=e.inject("toolbar-item-handler",()=>{});function h(){p&&p()}function c(N){const b={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":a.value==="right","f-btn-mr":a.value==="left"},u=N.dropdownClass.split(" ");return u&&u.length&&u.reduce((i,C)=>(i[C]=!0,i),b),b}function v(N){const b={btn:!0,disabled:!N.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(N.icon&&N.icon.trim())};if(N.class){const u=N.class.split(" ");u&&u.length&&u.reduce((i,C)=>(i[C]=!0,i),b)}return b}function w(N){N&&(N.stopPropagation(),N.preventDefault())}function x(N,b){w(N);const u=b.expanded;document.body.click(),b.expanded=!u}const S=function(N){const{componentType:b}=N,u=Y(b,N),i=b.toLowerCase().replace("-","_");return u&&!u.id&&u.type===b&&(u.id=`${i}_${Math.random().toString().slice(2,6)}`),u},g=function(){const N={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return S(N)};function f(N){const b=l.schema.buttons||l.schema.contents,u=b==null?void 0:b.findIndex(C=>C.id===N),i=u===-1?null:b[u];return{index:u,toolbarItem:i}}function m(N,b){var V;const{index:u,toolbarItem:i}=f(b);if(u===-1)return;const C=i.text||"按钮",B=g(),D=Object.assign({},B,{text:C});(V=l.schema.buttons)==null||V.push(D),h()}function d(N,b){const{index:u,toolbarItem:i}=f(b);if(u===-1)return;const C=i.text||"按钮",B=g(),D=Object.assign({},B,{text:C}),V=l.schema.buttons[u].children||[];V.push(D),l.schema.buttons[u].children=V,h()}function T(N,b){const u=l.schema.buttons||l.schema.contents,i=u==null?void 0:u.findIndex(C=>C.id===b);i!==-1&&(u.splice(i,1),h())}function j(N){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=>T(b,N)},[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=>m(b,N)},[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,N)},[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 N=document.getElementsByClassName("dgComponentSelected");Array.from(N).forEach(b=>b.classList.remove("dgComponentSelected"))}function O(N){N.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function y(N){var C;const b=l.schema.buttons||l.schema.contents,u=b==null?void 0:b.findIndex(B=>B.id===N);if(u===-1)return;const i=b[u];(C=l==null?void 0:l.setupContext)==null||C.emit("selectionChange","response-toolbar-item",i)}function M(N,b){w(N),$(),O(N),w(N),x(N,b),y(b.id)}function P(N){return e.createVNode("div",{id:N.id,class:c(N)},[e.createVNode("div",{class:v(N),style:"display: flex;padding-right: 0.1rem;",onClick:b=>N.enable&&M(b,N)},[j(N.id),t.shouldShowIcon(N)&&e.createVNode("i",{class:t.iconClass(N)},null),e.createVNode("span",null,[N.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(N)])}function I(){r()}return{renderToolbarDropdown:P,clearAllDropDown:I}}function Je(){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"}}}}}class an 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 sn(n,t,o,a){const s=Ne(),r=e.ref(!1),l=e.ref(!1);let p=!0,h=!1,c;function v(y){return c&&c.componentClassList&&c.componentClassList.includes("f-form-layout")&&c.componentClassList.includes("farris-form")?y.sourceType==="control"&&y.controlCategory==="input"||y.sourceType==="move"&&y.controlType==="form-group":!0}function w(y){return!Je().basalDragulaRuleForContainer(y)||!p||!v(y),!1}function x(){r.value=!1,l.value=!1;const y=n,M=y.appearance&&y.appearance.class||"",P=M.split(" "),I=y.buttons||[],N=I.length?I[0]:null,b=N&&N.appearance?N.appearance.class:"",u=b?b.split(" "):[],i=I.length?I.reduce((R,L)=>{const X=L&&L.appearance?L.appearance.class:"",J=X?X.split(" "):[];return R.push(...J),R},[]):[],C=o==null?void 0:o.schema,B=C&&C.appearance&&C.appearance.class||"",D=B?B.split(" "):[];c={componentClass:M,componentClassList:P,childContents:I,firstChildContent:N,firstChildClass:b,firstChildClassList:u,parent:C,parentClass:B,parentClassList:D,children:I,childrenClassList:i};const{canAccept:V,fixed:k,hidePadding:A}=s.getRuleValue(P[0],c);return p=V,h=A,!0}function S(y){}function g(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function f(y,M){return M.text=y.label,M}function m(y,M,P){const I=n;if((I.appearance&&I.appearance.class||"").split(" ").includes("f-form-layout")){const u=String(y.innerText),i=Y("form-group");return i.editor=P,i.label=u,i}return P}function d(){return!1}function T(){return!1}function j(){return!0}function $(){return h}function O(y){return new an(y,t).getPropertyConfig(n)}return{canAccepts:w,checkCanAddComponent:j,checkCanDeleteComponent:T,checkCanMoveComponent:d,getStyles:g,hideNestedPaddingInDesginerView:$,onAcceptNewChildElement:m,onAcceptMovedChildElement:S,onResolveNewComponentSchema:f,resolveComponentContext:x,getPropsConfig:O,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:l}}const rn={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}};function ln(n,t,o){var O;function a(){}const s="",r=e.ref();function l(){return!0}function p(){return!1}function h(){return!0}function c(){return!0}function v(){return!0}function w(y){if(!y||!y.value)return null;const M=e.ref(y==null?void 0:y.value.parent),P=w(M);return P||null}function x(y=t){const{componentInstance:M,designerItemElementRef:P}=y;return!M||!M.value?null:M.value.canMove||M.value.canAdd||M.value.canDelete?P:x(y.parent)}function S(y){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 m(y,M){}function d(y){const{componentType:M}=y;let P=Y(M,y);const I=M.toLowerCase().replace("-","_");return P&&!P.id&&P.type===M&&(P.id=`${I}_${Math.random().toString().slice(2,6)}`),P}function T(y,M){const P=String(y.getAttribute("data-controltype")),I=y.getAttribute("data-feature"),N=I?JSON.parse(I):{};N.parentComponentInstance=r.value;let b=Y(P,N);const u=P.toLowerCase().replace("-","_");return b&&!b.id&&b.type===P&&(b.id=`${u}_${Math.random().toString().slice(2,6)}`),b}function j(y){}function $(...y){return[]}return r.value={canMove:l(),canSelectParent:p(),canAdd:c(),canDelete:h(),canNested:!v(),contents:[],elementRef:n,parent:(O=t.parent)==null?void 0:O.componentInstance,schema:t.schema,styles:s,canAccepts:S,getBelongedComponentInstance:w,getDraggableDesignItemElement:x,getDraggingDisplayText:g,getPropConfig:$,getDragScopeElement:f,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:j,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const Ze=e.defineComponent({name:"FDesignerInnerItem",props:rn,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),h=e.ref(n.childLabel),c=e.ref(n.modelValue),v=e.ref(""),w=e.ref(),x=e.inject("canvas-dragula"),S=e.ref(),g=e.inject("design-item-context"),f={designerItemElementRef:w,componentInstance:S,schema:c.value,parent:g,setupContext:t};e.provide("design-item-context",f);const m=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":w.value&&w.value.classList.contains("d-none")})),d=e.computed(()=>{const u={};return v.value&&v.value.split(";").reduce((i,C)=>{const[B,D]=C.split(":");return B&&(i[B]=D),i},u),u});function T(u,i){if(g&&g.schema[l.value]){const C=g.schema[l.value].findIndex(B=>B.id===i.id);if(C>-1){const B=g.schema[l.value].length,D=g.schema[l.value][C%B];g.designerItemElementRef.value.querySelector(`#${D.id}-design-item`),g.schema[l.value].splice(C,1),g.componentInstance.value.updateDragAndDropRules(),fe.value++,t.emit("removeComponent")}}}function j(u){if(S.value.addNewChildComponentSchema){const i={componentType:p.value,label:h.value,parentComponentInstance:S.value,targetPosition:-1},C=S.value.addNewChildComponentSchema(i);c.value[l.value].push(C),t.emit("addComponent")}}function $(){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:u=>{j()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function O(u){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(i=>T(i,u),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function y(){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 M(u){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[$(),y(),O(u)])])}e.watch(()=>n.modelValue,u=>{c.value=u,f.schema=u});function P(u){const i=u.target;_t(i)}function I(){var u,i;(i=(u=c.value)==null?void 0:u.contents)!=null&&i.length&&w.value&&w.value.addEventListener("scroll",P)}function N(){const u=w.value,i=e.ref(u.children[1]);return ln(i,f).value}e.onMounted(()=>{if(w.value){const u=w.value.querySelector(`[data-dragref='${c.value.id}-container']`);S.value=u&&u.componentInstance?u.componentInstance.value:N(),x&&u&&x.attachComponents(u,c.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,v.value=S.value.styles||"",w.value&&(w.value.componentInstance=S,w.value.designItemContext=f)}I(),fe.value++}),e.onBeforeUnmount(()=>{w.value&&w.value.removeEventListener("scroll",P)});function b(u){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused")),u&&(u.preventDefault(),u.stopPropagation());const i=w.value;if(i){const C=document.getElementsByClassName("dgComponentSelected");if(!(C&&C.length===1&&C[0]===w.value)){Array.from(C).forEach(V=>V.classList.remove("dgComponentSelected")),i.classList.add("dgComponentFocused"),t.emit("selectionChange",c.value.type,c.value,n.componentId,S.value);const D=S.value.getDraggableDesignItemElement(f);D&&D.value&&D.value.classList.add("dgComponentSelected")}}fe.value++}return()=>e.createVNode("div",{id:`${n.id}-design-item`,ref:w,class:m.value,style:d.value,onClick:b},[M(c.value),t.slots.default&&t.slots.default()])}});class cn 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:"click",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 h=l.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}class dn 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:"click",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 h=l.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}function un(n,t){Ne();const o=e.ref(!1),a=e.ref(!1);let s=!1,r=!1;function l(m){return!1}function p(m){}function h(){return""}function c(m,d){return d.text=m.label,d}function v(m,d,T){const j=n.schema;if((j.appearance&&j.appearance.class||"").split(" ").includes("f-form-layout")){const y=String(m.innerText),M=Y("form-group");return M.editor=T,M.label=y,M}return T}function w(){return!1}function x(){return!r}function S(){return!1}function g(){return s}function f(m){let d;switch(n.schema.type){case"tab-toolbar-item":d=new cn(m,t);break;default:d=new dn(m,t)}return d.getPropertyConfig(n.schema)}return{canAccepts:l,checkCanAddComponent:S,checkCanDeleteComponent:x,checkCanMoveComponent:w,getStyles:h,hideNestedPaddingInDesginerView:g,onAcceptNewChildElement:v,onAcceptMovedChildElement:p,onResolveNewComponentSchema:c,getPropsConfig:f,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:a}}const pn=e.defineComponent({name:"FResponseToolbarItemDesign",props:Xe,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 me(a));e.computed(()=>s.value.children.length>0);const r=e.ref(),l=e.inject("designer-host-service"),p=e.inject("design-item-context"),h=un(p,l),c=Pe.useDesignerInnerComponent(r,p,h);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{r.value.componentInstance=c}),t.expose(c.value);function v(){const S={"f-icon":!0},g=n.icon?n.icon.trim():"";return ge.getCustomClass(S,g)}function w(){return!!(n.icon&&n.icon.trim())}function x(){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:x(),id:n.id},[w()&&e.createVNode("i",{class:v()},null),n.text])])}}),fn=e.defineComponent({name:"FResponseToolbarDesign",props:Zt,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"},h=e.ref(new me(p)),c=tn();e.computed(()=>h.value.children.length>0);const v=e.ref(),w=e.inject("designer-host-service"),x=e.inject("design-item-context"),S=sn(x.schema,w,x),g=Pe.useDesignerInnerComponent(v,x,S);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{v.value.componentInstance=g}),t.expose(g.value);const f=e.computed(()=>{const N={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};return ge.getCustomClass(N,n.customClass)}),m=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":l.value==="right","justify-content-start":l.value==="left"})),{renderToolbarDropdown:d,clearAllDropDown:T}=on(n,c,g);function j(){o.value.filter(N=>N.children&&N.children.length>0).forEach(N=>{N.expanded=!1}),h.value.expanded=!1,T()}const $=new Map,O=[];function y(N){const b=r.value;let u=N;const i=Array.from(b.children),C=i[i.length-1].id==="__more_buttons__"?i[i.length-1]:null;if(C){const A=C.computedStyleMap().get("margin-left"),R=C.computedStyleMap().get("margin-right"),L=(A?A.value:0)+C.getBoundingClientRect().width+(R?R.value:0);u-=L}const B=i.filter(A=>A.id!=="__more_buttons__");for(const A of B){const R=A.computedStyleMap().get("margin-left"),L=A.computedStyleMap().get("margin-right"),X=(R?R.value:0)+A.getBoundingClientRect().width+(L?L.value:0);u<X?($.set(A.id,!0),O.push({id:A.id,width:X})):u-=X}if(O.length)for(let A=O.length-1;A>=0;A--){const R=O[A].width;if(u>=R)u-=R,$.delete(O[A].id),O.pop();else break}const D=Object.assign({},h.value);D.children=[];const V=new me(D),k=o.value.reduce((A,R)=>($.has(R.id)&&V.children.push(R),R.visible=!$.has(R.id),A.push(R),A),[]);h.value=V,o.value=k}const M=new ResizeObserver(N=>{if(N.length){const u=N[0].contentRect.width,C=r.value.getBoundingClientRect().width;(u<C||O.length)&&y(u)}});e.onMounted(()=>{const N=s.value;M.observe(N),document.body.addEventListener("click",j)}),e.onUnmounted(()=>{M.disconnect(),document.body.removeEventListener("click",j)}),e.watch(()=>n.items,()=>{o.value=n.items},{deep:!0}),e.watch(o,N=>{a=new Array(o.value.length).fill(e.ref())});function P(N,b,u,i){x&&x.setupContext&&x.setupContext.emit("selectionChange",N,b,u,i)}function I(){const N=r.value.querySelector(".dgComponentFocused.dgComponentSelected");N==null||N.classList.remove("dgComponentSelected"),N==null||N.classList.remove("dgComponentFocused")}return()=>e.createVNode("div",{ref:v,"data-dragref":`${x.schema.id}-container`,class:f.value},[e.createVNode("div",{ref:s,class:m.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.map((N,b)=>e.createVNode(Ze,{ref:a[b],class:"p-0 display-inline-block",modelValue:N,"onUpdate:modelValue":u=>N=u,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:n.componentId,id:N.id,style:"padding:0 !important;display:inline-block",onSelectionChange:P,onRemoveComponent:I},{default:()=>{var u;return[e.createVNode(pn,{id:N.id,disable:N.disable,text:N.text,icon:N.icon,class:((u=N.appearance)==null?void 0:u.class)||"btn-secondary",alignment:n.alignment||"right",componentId:n.componentId},null)]}}))])])])}});function mn(n,t,o,a,s){const{toolbarItems:r,toolbarSchema:l}=n;function p(h,c,v,w){var x;(x=a.setupContext)==null||x.emit("selectionChange",h,c,v,w)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(Ze,{modelValue:l.value,"onUpdate:modelValue":h=>l.value=h,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:l.value.id,onSelectionChange:p,componentId:s},{default:()=>[e.createVNode(fn,{items:r.value,componentId:s},null)]})])])}const hn=e.defineComponent({name:"FTabsDesign",props:we,emits:["tabChange","tabRemove"],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Wt(a.schema,a.parent),r=qe(o,a,s),l=e.ref(n.tabType),p=e.shallowRef(),h=e.shallowRef(),c=Ut(n,t,p,a),{activeId:v,changeTitleStyle:w,tabPages:x,addTab:S,updateTab:g,selectTabByTabId:f,toolbarItems:m}=c,d=He(n,h,c),T=Fe(n,p,d,c),{previousButtonClass:j,nextButtonClass:$,nextButtonGroupClass:O,scrollTab:y,updateNavigationLayout:M}=T,P=Le(n,c),{hideDropDown:I}=P,N=Ft(n,p,T,d,c,r,s),b=N,u=Re(n,p,T,d,c),i=new Map([["default",N],["one-page",b],["pills",u]]);e.computed(()=>{const H=x.value.find(_=>_.props.id===v.value);return H==null?void 0:H.slots});const C=e.computed(()=>{const H=x.value.find(te=>te.props.id===v.value);return(H==null?void 0:H.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:v,addTab:S,updateTab:g,tabPages:x,tabType:l});function B(){const H=r.value.schema.contents||[];return H.length<1?null:H.find(te=>te.id===v.value)}function D(){var _;const H=B();m.value=[...(_=H==null?void 0:H.toolbar)==null?void 0:_.contents]}e.provide("toolbar-item-handler",D);const V=e.computed(()=>n.fill||n.tabType==="fill"),k=e.computed(()=>n.tabType==="pills"),A=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":C.value,"farris-tabs-inContent":!C.value,"farris-tabs-nav-fill":V.value,"farris-tabs-nav-pills":k.value})),R=e.computed(()=>({width:C.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(()=>{x.value.length&&(v.value=n.activeId||x.value[0].props.id,f(v.value)),e.nextTick(()=>{M()}),w(p),window.addEventListener("click",H=>{var _;I.value||(_=o.value)!=null&&_.contains(H.target)||(I.value=!0)}),window.addEventListener("resize",()=>{M()}),o.value.componentInstance=r});function X(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:j.value,onClick:()=>{y(0,-1)}},null)}function J(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:$.value,onClick:()=>{y(0,1)}},null)}const{renderMorePagesButtton:oe}=Oe(n,P,T,c);function Q(){return!!m.value.length&&mn(c,r,s,a,n.componentId)}const K=i.get(n.tabType)||i.get("default");function W(){var H,_,te,he;return e.createVNode("div",{class:A.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(H=t.slots).headerPrefix)==null?void 0:_.call(H)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:R.value},[X(),K&&K(),e.createVNode("div",{class:O.value},[J(),oe()])]),Q(),e.createVNode("div",{class:"farris-tabs-header-post"},[(he=(te=t.slots).headerSuffix)==null?void 0:he.call(te)])])}function G(){var H,_;return e.createVNode("div",{class:"farris-tabs-content",ref:h},[(_=(H=t.slots).default)==null?void 0:_.call(H)])}return t.expose(r.value),()=>e.createVNode("div",{class:L.value,ref:o},[W(),G()])}});function bn(n,t,o){return t?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function gn(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 yn=new Map([["appearance",ie],["expanded","expandStatus"],["enableAccordion",bn],["toolbar",gn]]);function vn(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 Cn(n,t,o,a){return o.parentComponentInstance?vn(n,t,o):t}const wn={$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"]},Qe={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(Qe,wn,yn,Cn);function Tn(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 h=document&&document.querySelector("body");h&&(h.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(h=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"],v=Array.from(document.body.querySelectorAll(c.join(","))).filter(x=>x).map(x=>{const{display:S,zIndex:g}=window.getComputedStyle(x);return S==="none"?0:parseInt(g,10)}).filter(x=>x);let w=Math.max(...v);return w<1040&&(w=1040),w+h}return{onClickMaxMinIcon:s}}function Ke(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(Be,{customClass:s.value,items:o.value,onClick:l,alignment:a.value},null)}function xn(n,t,o,a,s,r){e.ref(n.subTitle);const l=e.computed(()=>n.buttonPosition),p=Ke(n,t),{onClickMaxMinIcon:h}=Tn(a,s,r),c=e.computed(()=>!!n.subTitle),v=e.computed(()=>n.enableMaximize),w=e.computed(()=>n.enableAccordion!=""),x=e.computed(()=>{const j={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((O,y)=>(O[y]=!0,O),j),j});function S(j){j.stopPropagation(),n.enableAccordion!==""&&(o.value=!o.value)}function g(){const j=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"},[v.value?e.createVNode("span",{class:$.value,onClick:h},null):"",w.value?e.createVNode("button",{class:j.value,onClick:S},[e.createVNode("span",null,[o.value?n.collapseLabel:n.expandLabel])]):""])}function f(){return t.slots.header?e.createVNode("div",{class:x.value},[t.slots.header()]):""}function m(){return e.createVNode("div",{class:"f-title",onClick:S},[e.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),c.value&&e.createVNode("span",null,[n.subTitle])])}function d(){const j=e.computed(()=>{const $={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((y,M)=>(y[M]=!0,y),$),$});return t.slots.headerContent?e.createVNode("div",{class:j.value},[t.slots.headerContent()]):""}function T(){return e.createVNode("div",{class:x.value},[t.slots.headerTitle?t.slots.headerTitle():m(),d(),l.value==="inHead"&&p(),(v.value||w.value)&&g()])}return()=>n.showHeader&&(t.slots.header?f():T())}const Sn=["moz","ms","webkit"];function Nn(){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 jn(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=Sn.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:Nn()}jn();function Ve(n,t){return((t==null?void 0:t.split(" "))||[]).reduce((a,s)=>(s&&(a[s]=!0),a),n),n}const Mn=e.defineComponent({name:"FSection",props:Qe,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),h=e.ref(!1),c=xn(n,t,l,o,a,h),v=Ke(n,t),w=e.computed(()=>{const m={"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":h.value};return Ve(m,s.value)}),x=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:x.value},[p.value==="inContent"&&v(),t.slots.default&&t.slots.default()])}return e.watch(()=>n.expandStatus,(m,d)=>{m!==d&&(l.value=m)}),e.onMounted(()=>{o&&o.value&&(a.value=o.value.parentElement)}),()=>e.createVNode("div",{class:w.value,ref:o},[c(),g(),f()])}});function Vn(n,t){function o(s){return!!Je().basalDragulaRuleForContainer(s)}function a(s){}return{canAccepts:o,onAcceptMovedChildElement:a}}function Bn(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const Pn=e.defineComponent({name:"FTabPageDesign",props:de,emits:[],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Vn(a.schema,a.parent),r=qe(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),h={slots:t.slots,props:n},c=e.ref((l==null?void 0:l.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const d=l.tabPages.value.findIndex(T=>T.props.id===n.id);!d||d===-1?l==null||l.addTab(h):d>-1&&(p.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const v=e.computed(()=>(n==null?void 0:n.id)===(l==null?void 0:l.activeId.value)),w=e.computed(()=>({display:v.value?"":"none"}));e.watch(()=>n,d=>{l==null||l.updateTab({props:d,slots:t.slots})},{immediate:!0,deep:!0});function x(){var T,j;const d=(j=(T=t.slots).default)==null?void 0:j.call(T);return e.createVNode(Mn,{"main-title":n.title,class:"farris-tab-page"},Bn(d)?d:{default:()=>[d]})}const S=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function g(){var T,j;const d=(j=(T=t.slots).default)==null?void 0:j.call(T);return e.createVNode("div",{ref:o,class:S.value,"data-dragref":`${a.schema.id}-container`,style:w.value},[d])}const m=new Map([["default",g],["one-page",x]]).get(c.value)||g;return()=>p.value?m():null}}),kn=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:"The items of Response Toolbar.",type:"string",default:""},icon:{description:"The icon of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},Ce,ct);ee.install=n=>{n.component(ee.name,ee),n.component(ue.name,ue)},ee.register=(n,t,o)=>{n.tabs=ee,n["tab-page"]=ue,t.tabs=$e,t["tab-page"]=Te},ee.registerDesigner=(n,t,o)=>{n.tabs=hn,n["tab-page"]=Pn,t.tabs=Ae,t["tab-page"]=Te,t["tab-toolbar-item"]=kn},z.FTabPage=ue,z.FTabs=ee,z.default=ee,z.tabPageProps=de,z.tabPagePropsResolver=Te,z.tabsDesignProps=we,z.tabsDesignPropsResolver=Ae,z.tabsProps=ce,z.tabsPropsResolver=$e,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"}})});