@farris/ui-vue 1.2.9 → 1.3.0

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