@farris/ui-vue 1.3.0 → 1.3.3

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 (305) hide show
  1. package/components/accordion/index.esm.js +103 -99
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +454 -398
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/binding-selector/index.esm.js +444 -0
  6. package/components/binding-selector/index.umd.cjs +1 -0
  7. package/components/binding-selector/package.json +8 -0
  8. package/components/border-editor/index.esm.js +5 -3
  9. package/components/border-editor/index.umd.cjs +1 -1
  10. package/components/button-edit/index.esm.js +143 -139
  11. package/components/button-edit/index.umd.cjs +1 -1
  12. package/components/calendar/index.esm.js +479 -476
  13. package/components/calendar/index.umd.cjs +1 -1
  14. package/components/capsule/index.esm.js +255 -252
  15. package/components/capsule/index.umd.cjs +1 -1
  16. package/components/checkbox/index.esm.js +652 -567
  17. package/components/checkbox/index.umd.cjs +1 -1
  18. package/components/color-picker/index.esm.js +518 -521
  19. package/components/color-picker/index.umd.cjs +2 -2
  20. package/components/combo-list/index.esm.js +659 -553
  21. package/components/combo-list/index.umd.cjs +1 -1
  22. package/components/combo-tree/index.esm.js +162 -155
  23. package/components/combo-tree/index.umd.cjs +1 -1
  24. package/components/common/index.esm.js +866 -747
  25. package/components/common/index.umd.cjs +1 -1
  26. package/components/component/index.esm.js +371 -998
  27. package/components/component/index.umd.cjs +1 -1
  28. package/components/condition/index.esm.js +1174 -1280
  29. package/components/condition/index.umd.cjs +1 -1
  30. package/components/content-container/index.esm.js +340 -991
  31. package/components/content-container/index.umd.cjs +1 -1
  32. package/components/data-grid/index.esm.js +6066 -5847
  33. package/components/data-grid/index.umd.cjs +1 -1
  34. package/components/data-view/index.esm.js +3400 -3486
  35. package/components/data-view/index.umd.cjs +1 -1
  36. package/components/date-picker/index.esm.js +2328 -2446
  37. package/components/date-picker/index.umd.cjs +1 -1
  38. package/components/designer-canvas/index.css +1 -1
  39. package/components/designer-canvas/index.esm.js +9551 -1200
  40. package/components/designer-canvas/index.umd.cjs +1 -1
  41. package/components/designer-outline/index.esm.js +2 -1
  42. package/components/designer-outline/index.umd.cjs +1 -1
  43. package/components/drawer/index.esm.js +34 -38
  44. package/components/drawer/index.umd.cjs +1 -1
  45. package/components/dropdown/index.esm.js +234 -231
  46. package/components/dropdown/index.umd.cjs +2 -2
  47. package/components/dynamic-form/index.esm.js +1996 -2630
  48. package/components/dynamic-form/index.umd.cjs +1 -1
  49. package/components/dynamic-resolver/index.esm.js +138 -123
  50. package/components/dynamic-resolver/index.umd.cjs +1 -1
  51. package/components/dynamic-view/index.esm.js +218 -218
  52. package/components/dynamic-view/index.umd.cjs +1 -1
  53. package/components/event-parameter/index.esm.js +311 -0
  54. package/components/event-parameter/index.umd.cjs +1 -0
  55. package/components/event-parameter/package.json +8 -0
  56. package/components/events-editor/index.css +1 -1
  57. package/components/events-editor/index.esm.js +548 -586
  58. package/components/events-editor/index.umd.cjs +1 -1
  59. package/components/expression-editor/index.esm.js +95 -91
  60. package/components/expression-editor/index.umd.cjs +1 -1
  61. package/components/external-container/index.esm.js +2871 -3736
  62. package/components/external-container/index.umd.cjs +1 -1
  63. package/components/field-selector/index.esm.js +3380 -3645
  64. package/components/field-selector/index.umd.cjs +1 -1
  65. package/components/filter-bar/index.css +1 -1
  66. package/components/filter-bar/index.esm.js +10543 -3207
  67. package/components/filter-bar/index.umd.cjs +1 -1
  68. package/components/flow-canvas/index.css +1 -1
  69. package/components/flow-canvas/index.esm.js +9775 -1312
  70. package/components/flow-canvas/index.umd.cjs +1 -1
  71. package/components/image-cropper/index.esm.js +442 -438
  72. package/components/image-cropper/index.umd.cjs +1 -1
  73. package/components/input-group/index.esm.js +587 -807
  74. package/components/input-group/index.umd.cjs +1 -1
  75. package/components/layout/index.esm.js +415 -381
  76. package/components/layout/index.umd.cjs +1 -1
  77. package/components/list-nav/index.esm.js +361 -1024
  78. package/components/list-nav/index.umd.cjs +1 -1
  79. package/components/list-view/index.esm.js +2265 -2371
  80. package/components/list-view/index.umd.cjs +1 -1
  81. package/components/lookup/index.esm.js +6425 -6257
  82. package/components/lookup/index.umd.cjs +1 -1
  83. package/components/mapping-editor/index.esm.js +6164 -5946
  84. package/components/mapping-editor/index.umd.cjs +1 -1
  85. package/components/message-box/index.esm.js +252 -252
  86. package/components/message-box/index.umd.cjs +1 -1
  87. package/components/modal/index.esm.js +70 -70
  88. package/components/modal/index.umd.cjs +1 -1
  89. package/components/nav/index.esm.js +524 -1474
  90. package/components/nav/index.umd.cjs +3 -3
  91. package/components/number-range/index.esm.js +547 -502
  92. package/components/number-range/index.umd.cjs +1 -1
  93. package/components/number-spinner/index.esm.js +646 -574
  94. package/components/number-spinner/index.umd.cjs +1 -1
  95. package/components/order/index.esm.js +1181 -2028
  96. package/components/order/index.umd.cjs +1 -1
  97. package/components/page-footer/index.esm.js +134 -131
  98. package/components/page-footer/index.umd.cjs +1 -1
  99. package/components/page-header/index.esm.js +1185 -2027
  100. package/components/page-header/index.umd.cjs +1 -1
  101. package/components/pagination/index.esm.js +442 -1368
  102. package/components/pagination/index.umd.cjs +1 -1
  103. package/components/progress/index.esm.js +238 -235
  104. package/components/progress/index.umd.cjs +3 -3
  105. package/components/property-editor/index.esm.js +1635 -1713
  106. package/components/property-editor/index.umd.cjs +2 -2
  107. package/components/property-panel/index.esm.js +791 -716
  108. package/components/property-panel/index.umd.cjs +1 -1
  109. package/components/query-solution/index.css +1 -1
  110. package/components/query-solution/index.esm.js +12203 -5274
  111. package/components/query-solution/index.umd.cjs +6 -1
  112. package/components/radio-button/index.esm.js +97 -97
  113. package/components/radio-button/index.umd.cjs +1 -1
  114. package/components/radio-group/index.css +1 -1
  115. package/components/radio-group/index.esm.js +1873 -520
  116. package/components/radio-group/index.umd.cjs +1 -1
  117. package/components/rate/index.esm.js +299 -300
  118. package/components/rate/index.umd.cjs +1 -1
  119. package/components/response-layout/index.esm.js +176 -173
  120. package/components/response-layout/index.umd.cjs +1 -1
  121. package/components/response-layout-editor/index.esm.js +715 -659
  122. package/components/response-layout-editor/index.umd.cjs +1 -1
  123. package/components/response-toolbar/index.esm.js +1032 -1883
  124. package/components/response-toolbar/index.umd.cjs +1 -1
  125. package/components/schema-selector/index.esm.js +4767 -5693
  126. package/components/schema-selector/index.umd.cjs +2 -2
  127. package/components/search-box/index.esm.js +169 -161
  128. package/components/search-box/index.umd.cjs +1 -1
  129. package/components/section/index.esm.js +490 -1167
  130. package/components/section/index.umd.cjs +1 -1
  131. package/components/smoke-detector/index.esm.js +154 -151
  132. package/components/smoke-detector/index.umd.cjs +1 -1
  133. package/components/splitter/index.esm.js +575 -1204
  134. package/components/splitter/index.umd.cjs +1 -1
  135. package/components/splitter/style.js +2 -0
  136. package/components/step/index.esm.js +279 -276
  137. package/components/step/index.umd.cjs +1 -1
  138. package/components/switch/index.esm.js +478 -428
  139. package/components/switch/index.umd.cjs +1 -1
  140. package/components/tabs/index.esm.js +2591 -3326
  141. package/components/tabs/index.umd.cjs +1 -1
  142. package/components/tags/index.esm.js +442 -439
  143. package/components/tags/index.umd.cjs +1 -1
  144. package/components/text/index.esm.js +309 -307
  145. package/components/text/index.umd.cjs +1 -1
  146. package/components/textarea/index.esm.js +500 -430
  147. package/components/textarea/index.umd.cjs +1 -1
  148. package/components/time-picker/index.esm.js +1391 -1341
  149. package/components/time-picker/index.umd.cjs +1 -1
  150. package/components/transfer/index.esm.js +574 -575
  151. package/components/transfer/index.umd.cjs +1 -1
  152. package/components/tree-grid/index.esm.js +3422 -3536
  153. package/components/tree-grid/index.umd.cjs +1 -1
  154. package/components/tree-view/index.esm.js +2661 -2764
  155. package/components/tree-view/index.umd.cjs +1 -1
  156. package/components/uploader/index.esm.js +675 -674
  157. package/components/uploader/index.umd.cjs +2 -2
  158. package/components/verify-detail/index.esm.js +300 -297
  159. package/components/verify-detail/index.umd.cjs +1 -1
  160. package/components/video/index.esm.js +454 -1089
  161. package/components/video/index.umd.cjs +1 -1
  162. package/components/weather/index.esm.js +709 -706
  163. package/components/weather/index.umd.cjs +5 -5
  164. package/farris.all.esm.js +54780 -52757
  165. package/farris.all.umd.cjs +14 -9
  166. package/index.css +1 -1
  167. package/package.json +1 -1
  168. package/types/binding-selector/index.d.ts +55 -0
  169. package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
  170. package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
  171. package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
  172. package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
  173. package/types/combo-list/src/components/list-container.component.d.ts +6 -6
  174. package/types/combo-list/src/components/list-container.props.d.ts +1 -1
  175. package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
  176. package/types/common/directive/area-response.d.ts +10 -0
  177. package/types/common/entity/entity-schema.d.ts +26 -11
  178. package/types/common/index.d.ts +9 -0
  179. package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
  180. package/types/common/types.d.ts +2 -2
  181. package/types/common/utils/resolve-field.d.ts +2 -0
  182. package/types/common/utils/use-class.d.ts +7 -0
  183. package/types/component/src/designer/use-designer-rules.d.ts +2 -2
  184. package/types/condition/src/condition-fields.design.component.d.ts +18 -0
  185. package/types/condition/src/types.d.ts +5 -4
  186. package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
  187. package/types/data-grid/index.d.ts +8 -5
  188. package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
  189. package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
  190. package/types/data-grid/src/data-grid.component.d.ts +3 -2
  191. package/types/data-grid/src/data-grid.props.d.ts +2 -2
  192. package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
  193. package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
  194. package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
  195. package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
  196. package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
  197. package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
  198. package/types/data-view/composition/types.d.ts +9 -11
  199. package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
  200. package/types/date-picker/src/components/month/month.component.d.ts +3 -3
  201. package/types/date-picker/src/components/year/year.component.d.ts +3 -3
  202. package/types/designer-canvas/index.d.ts +3 -1
  203. package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
  204. package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
  205. package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
  206. package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
  207. package/types/designer-canvas/src/composition/types.d.ts +49 -41
  208. package/types/designer-canvas/src/types.d.ts +10 -21
  209. package/types/dynamic-form/index.d.ts +1 -1
  210. package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
  211. package/types/dynamic-form/src/designer/response-form-use-designer-rules.d.ts +3 -0
  212. package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
  213. package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +1 -1
  214. package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
  215. package/types/dynamic-form/src/types.d.ts +1 -1
  216. package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +6 -1
  217. package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
  218. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
  219. package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
  220. package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
  221. package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
  222. package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
  223. package/types/event-parameter/index.d.ts +31 -0
  224. package/types/event-parameter/src/composition/type.d.ts +77 -0
  225. package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
  226. package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
  227. package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
  228. package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
  229. package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
  230. package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
  231. package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
  232. package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
  233. package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
  234. package/types/field-selector/src/field-selector.component.d.ts +1 -2
  235. package/types/field-selector/src/field-selector.props.d.ts +0 -9
  236. package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
  237. package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
  238. package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
  239. package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
  240. package/types/list-view/src/list-view-table.component.d.ts +15 -0
  241. package/types/lookup/src/composition/use-user-data.d.ts +2 -2
  242. package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
  243. package/types/modal/src/composition/modal.service.d.ts +2 -1
  244. package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
  245. package/types/page-header/src/page-header.component.d.ts +1 -1
  246. package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
  247. package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
  248. package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
  249. package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
  250. package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
  251. package/types/property-panel/index.d.ts +3 -1
  252. package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -1
  253. package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
  254. package/types/property-panel/src/composition/type.d.ts +0 -13
  255. package/types/query-solution/src/composition/types.d.ts +35 -4
  256. package/types/query-solution/src/composition/use-header.d.ts +21 -0
  257. package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
  258. package/types/query-solution/src/composition/use-solution.d.ts +20 -0
  259. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +43 -35
  260. package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
  261. package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
  262. package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
  263. package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
  264. package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
  265. package/types/query-solution/src/property-config/query-solution.property-config.d.ts +12 -0
  266. package/types/query-solution/src/query-solution.d.ts +10 -2
  267. package/types/query-solution/src/solutions.d.ts +108 -509
  268. package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
  269. package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
  270. package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
  271. package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
  272. package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
  273. package/types/response-layout-editor/index.d.ts +3 -1
  274. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
  275. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
  276. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
  277. package/types/section/src/designer/use-designer-rules.d.ts +3 -3
  278. package/types/section/src/property-config/section.property-config.d.ts +17 -17
  279. package/types/section/src/schema/schema-resolver.d.ts +1 -2
  280. package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
  281. package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
  282. package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
  283. package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
  284. package/types/tabs/src/composition/types.d.ts +4 -1
  285. package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
  286. package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
  287. package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
  288. package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
  289. package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
  290. package/types/text/src/composition/types.d.ts +4 -4
  291. package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
  292. package/types/tree-grid/index.d.ts +3 -3
  293. package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
  294. package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
  295. package/types/weather/src/composition/use-weather-color.d.ts +15 -0
  296. package/types/weather/src/composition/use-weather-data.d.ts +15 -0
  297. package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
  298. package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
  299. package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
  300. package/types/dynamic-form/src/designer/use-designer-rules.d.ts +0 -3
  301. package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
  302. package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
  303. package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
  304. package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
  305. package/types/weather/src/composition/types.d.ts +0 -2
@@ -1,113 +1,117 @@
1
- import { withInstall as De } from "../common/index.esm.js";
2
- import { ref as i, defineComponent as ye, computed as I, watch as q, nextTick as ue, createVNode as T, inject as Be, onMounted as Ae } from "vue";
3
- import { isPlainObject as he, cloneDeep as Ce } from "lodash-es";
4
- function Se(a, e, v) {
1
+ import { withInstall as Be } from "../common/index.esm.js";
2
+ import { ref as i, defineComponent as he, computed as R, watch as F, nextTick as ue, createVNode as k, inject as De, onMounted as Ae } from "vue";
3
+ import { isPlainObject as me, cloneDeep as Se } from "lodash-es";
4
+ function Oe(t, e, v) {
5
5
  return e;
6
6
  }
7
- const be = {}, Te = {};
8
- function fe(a) {
9
- const { properties: e, title: v, ignore: g } = a, n = g && Array.isArray(g), h = Object.keys(e).reduce((y, w) => ((!n || !g.find((C) => C == w)) && (y[w] = e[w].type === "object" && e[w].properties ? fe(e[w]) : Ce(e[w].default)), y), {});
10
- return (!n || !g.find((y) => y == "id")) && (h.id = `${v}-${Date.now()}`), h;
7
+ const ye = {}, be = {};
8
+ function ie(t) {
9
+ const { properties: e, title: v, ignore: g } = t, n = g && Array.isArray(g), h = Object.keys(e).reduce((b, B) => ((!n || !g.find((O) => O === B)) && (b[B] = e[B].type === "object" && e[B].properties ? ie(e[B]) : Se(e[B].default)), b), {});
10
+ if (v && (!n || !g.find((b) => b === "id"))) {
11
+ const b = v.toLowerCase().replace(/-/g, "_");
12
+ h.id = `${b}_${Math.random().toString().slice(2, 6)}`;
13
+ }
14
+ return h;
11
15
  }
12
- function ie(a, e = {}, v) {
13
- const g = be[a];
16
+ function Te(t, e = {}, v) {
17
+ const g = ye[t];
14
18
  if (g) {
15
- let n = fe(g);
16
- const h = Te[a];
17
- return n = h ? h({ getSchemaByType: ie }, n, e, v) : n, n;
19
+ let n = ie(g);
20
+ const h = be[t];
21
+ return n = h ? h({ getSchemaByType: Te }, n, e, v) : n, n;
18
22
  }
19
23
  return null;
20
24
  }
21
- function Oe(a, e) {
22
- const v = fe(e);
23
- return Object.keys(a).reduce((g, n) => (g[n] && he(g[n]) && he(a[n]) ? Object.assign(g[n], a[n]) : g[n] = a[n], g), v), v;
25
+ function je(t, e) {
26
+ const v = ie(e);
27
+ return Object.keys(v).reduce((g, n) => (g[n] && me(g[n]) && me(t[n] || !t[n]) ? Object.assign(g[n], t[n] || {}) : g[n] = t[n], g), v), v;
24
28
  }
25
- function je(a, e) {
26
- return Object.keys(a).filter((g) => a[g] != null).reduce((g, n) => {
29
+ function Ce(t, e) {
30
+ return Object.keys(t).filter((g) => t[g] != null).reduce((g, n) => {
27
31
  if (e.has(n)) {
28
32
  const h = e.get(n);
29
33
  if (typeof h == "string")
30
- g[h] = a[n];
34
+ g[h] = t[n];
31
35
  else {
32
- const y = h(n, a[n], a);
33
- Object.assign(g, y);
36
+ const b = h(n, t[n], t);
37
+ Object.assign(g, b);
34
38
  }
35
39
  } else
36
- g[n] = a[n];
40
+ g[n] = t[n];
37
41
  return g;
38
42
  }, {});
39
43
  }
40
- function Me(a, e, v = /* @__PURE__ */ new Map()) {
41
- const g = Oe(a, e);
42
- return je(g, v);
44
+ function Me(t, e, v = /* @__PURE__ */ new Map()) {
45
+ const g = je(t, e);
46
+ return Ce(g, v);
43
47
  }
44
- function Ee(a = {}) {
45
- function e(c, p, d, f) {
46
- if (typeof d == "number")
47
- return f[c].length === d;
48
- if (typeof d == "object") {
49
- const k = Object.keys(d)[0], D = d[k];
50
- if (k === "not")
51
- return Number(f[c].length) !== Number(D);
52
- if (k === "moreThan")
53
- return Number(f[c].length) >= Number(D);
54
- if (k === "lessThan")
55
- return Number(f[c].length) <= Number(D);
48
+ function Ee(t = {}) {
49
+ function e(c, p, f, d) {
50
+ if (typeof f == "number")
51
+ return d[c].length === f;
52
+ if (typeof f == "object") {
53
+ const w = Object.keys(f)[0], D = f[w];
54
+ if (w === "not")
55
+ return Number(d[c].length) !== Number(D);
56
+ if (w === "moreThan")
57
+ return Number(d[c].length) >= Number(D);
58
+ if (w === "lessThan")
59
+ return Number(d[c].length) <= Number(D);
56
60
  }
57
61
  return !1;
58
62
  }
59
- function v(c, p, d, f) {
60
- return f[c] && f[c].propertyValue && String(f[c].propertyValue.value) === String(d);
63
+ function v(c, p, f, d) {
64
+ return d[c] && d[c].propertyValue && String(d[c].propertyValue.value) === String(f);
61
65
  }
62
66
  const g = /* @__PURE__ */ new Map([
63
67
  ["length", e],
64
68
  ["getProperty", v]
65
69
  ]);
66
- Object.keys(a).reduce((c, p) => (c.set(p, a[p]), c), g);
70
+ Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c), g);
67
71
  function n(c, p) {
68
- const d = c;
69
- return typeof p == "number" ? [{ target: d, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: d, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((f) => {
70
- if (f === "length")
71
- return { target: d, operator: "length", param: null, value: p[f] };
72
- const k = f, D = p[f];
73
- return { target: d, operator: "getProperty", param: k, value: D };
72
+ const f = c;
73
+ return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((d) => {
74
+ if (d === "length")
75
+ return { target: f, operator: "length", param: null, value: p[d] };
76
+ const w = d, D = p[d];
77
+ return { target: f, operator: "getProperty", param: w, value: D };
74
78
  }) : [];
75
79
  }
76
80
  function h(c) {
77
- return Object.keys(c).reduce((d, f) => {
78
- const k = n(f, c[f]);
79
- return d.push(...k), d;
81
+ return Object.keys(c).reduce((f, d) => {
82
+ const w = n(d, c[d]);
83
+ return f.push(...w), f;
80
84
  }, []);
81
85
  }
82
- function y(c, p) {
86
+ function b(c, p) {
83
87
  if (g.has(c.operator)) {
84
- const d = g.get(c.operator);
85
- return d && d(c.target, c.param, c.value, p) || !1;
88
+ const f = g.get(c.operator);
89
+ return f && f(c.target, c.param, c.value, p) || !1;
86
90
  }
87
91
  return !1;
88
92
  }
89
- function w(c, p) {
90
- return h(c).reduce((k, D) => k && y(D, p), !0);
93
+ function B(c, p) {
94
+ return h(c).reduce((w, D) => w && b(D, p), !0);
91
95
  }
92
- function C(c, p) {
93
- const d = Object.keys(c), f = d.includes("allOf"), k = d.includes("anyOf"), D = f || k, b = (D ? c[D ? f ? "allOf" : "anyOf" : "allOf"] : [c]).map((F) => w(F, p));
94
- return f ? !b.includes(!1) : b.includes(!0);
96
+ function O(c, p) {
97
+ const f = Object.keys(c), d = f.includes("allOf"), w = f.includes("anyOf"), D = d || w, T = (D ? c[D ? d ? "allOf" : "anyOf" : "allOf"] : [c]).map((N) => B(N, p));
98
+ return d ? !T.includes(!1) : T.includes(!0);
95
99
  }
96
- return { parseValueSchema: C };
100
+ return { parseValueSchema: O };
97
101
  }
98
- const Pe = {}, Ie = {};
102
+ const Pe = {}, Re = {};
99
103
  Ee();
100
- function Le(a, e, v = /* @__PURE__ */ new Map(), g = (y, w, C) => w, n = {}, h = (y) => y) {
101
- return be[e.title] = e, Te[e.title] = g, Pe[e.title] = n, Ie[e.title] = h, (y = {}) => {
102
- const w = Me(y, e, v), C = Object.keys(a).reduce((c, p) => (c[p] = a[p].default, c), {});
103
- return Object.assign(C, w);
104
+ function Le(t, e, v = /* @__PURE__ */ new Map(), g = (b, B, O, c) => B, n = {}, h = (b) => b) {
105
+ return ye[e.title] = e, be[e.title] = g, Pe[e.title] = n, Re[e.title] = h, (b = {}) => {
106
+ const B = Me(b, e, v), O = Object.keys(t).reduce((c, p) => (c[p] = t[p].default, c), {});
107
+ return Object.assign(O, B);
104
108
  };
105
109
  }
106
- function Re(a, e) {
110
+ function Ie(t, e) {
107
111
  return { customClass: e.class, customStyle: e.style };
108
112
  }
109
113
  const Ne = /* @__PURE__ */ new Map([
110
- ["appearance", Re]
114
+ ["appearance", Ie]
111
115
  ]), $e = "tags", Ve = "A Farris Component", Fe = "object", We = {
112
116
  basic: {
113
117
  description: "Basic Infomation",
@@ -130,12 +134,12 @@ const Ne = /* @__PURE__ */ new Map([
130
134
  }
131
135
  }
132
136
  }
133
- }, xe = {
137
+ }, qe = {
134
138
  title: $e,
135
139
  description: Ve,
136
140
  type: Fe,
137
141
  categories: We
138
- }, qe = "https://json-schema.org/draft/2020-12/schema", He = "https://farris-design.gitee.io/tags.schema.json", _e = "tags", Xe = "A Farris Component", Je = "object", ze = {
142
+ }, He = "https://json-schema.org/draft/2020-12/schema", _e = "https://farris-design.gitee.io/tags.schema.json", Xe = "tags", ze = "A Farris Component", Ge = "object", Je = {
139
143
  id: {
140
144
  description: "The unique identifier for tags",
141
145
  type: "string"
@@ -197,18 +201,18 @@ const Ne = /* @__PURE__ */ new Map([
197
201
  type: "boolean",
198
202
  default: !0
199
203
  }
200
- }, Ge = [
204
+ }, Qe = [
201
205
  "id",
202
206
  "type"
203
- ], Qe = {
204
- $schema: qe,
205
- $id: He,
206
- title: _e,
207
- description: Xe,
208
- type: Je,
209
- properties: ze,
210
- required: Ge
211
- }, de = {
207
+ ], Ue = {
208
+ $schema: He,
209
+ $id: _e,
210
+ title: Xe,
211
+ description: ze,
212
+ type: Ge,
213
+ properties: Je,
214
+ required: Qe
215
+ }, fe = {
212
216
  activeTag: { type: String, default: "" },
213
217
  addButtonText: { type: String, default: "" },
214
218
  customClass: { type: String, default: "" },
@@ -224,215 +228,215 @@ const Ne = /* @__PURE__ */ new Map([
224
228
  wrapText: { type: Boolean, default: !1 },
225
229
  draggable: { type: Boolean, default: !1 },
226
230
  disable: { type: Boolean, default: !1 }
227
- }, ke = Le(de, Qe, Ne, Se, xe);
228
- function we(a, e, v, g) {
231
+ }, ke = Le(fe, Ue, Ne, Oe, qe);
232
+ function we(t, e, v, g) {
229
233
  const n = i(-1), h = i(!1);
230
- function y(p, d, f) {
231
- p.stopPropagation(), d && setTimeout(() => {
232
- n.value = f, h.value = !0, d.moving = !0;
234
+ function b(p, f, d) {
235
+ p.stopPropagation(), f && setTimeout(() => {
236
+ n.value = d, h.value = !0, f.moving = !0;
233
237
  });
234
238
  }
235
- function w(p, d) {
236
- if (p.preventDefault(), n.value !== d) {
237
- const f = g.value[n.value], k = g.value;
238
- k.splice(n.value, 1), k.splice(d, 0, f), n.value = d;
239
+ function B(p, f) {
240
+ if (p.preventDefault(), n.value !== f) {
241
+ const d = g.value[n.value], w = g.value;
242
+ w.splice(n.value, 1), w.splice(f, 0, d), n.value = f;
239
243
  }
240
244
  }
241
- function C(p, d) {
245
+ function O(p, f) {
242
246
  p.preventDefault(), p.dataTransfer && (p.dataTransfer.dropEffect = "move");
243
247
  }
244
- function c(p, d) {
245
- d && (d.moving = !1), v.value = g.value.filter((f) => f.type === "Tag").map((f) => f.payload), h.value = !1, e.emit("change", v.value);
248
+ function c(p, f) {
249
+ f && (f.moving = !1), v.value = g.value.filter((d) => d.type === "Tag").map((d) => d.payload), h.value = !1, e.emit("change", v.value);
246
250
  }
247
251
  return {
248
- dragstart: y,
249
- dragenter: w,
250
- dragover: C,
252
+ dragstart: b,
253
+ dragenter: B,
254
+ dragover: O,
251
255
  dragend: c,
252
256
  isDragging: h
253
257
  };
254
258
  }
255
- const G = /* @__PURE__ */ ye({
259
+ const z = /* @__PURE__ */ he({
256
260
  name: "FTags",
257
- props: de,
261
+ props: fe,
258
262
  emits: ["remove", "selectionChange", "change"],
259
- setup(a, e) {
260
- const v = i(a.selectable), g = i(a.customClass), n = i(a.data), h = i(a.tagType), y = i(a.tagStyle), w = i(a.showColor), C = i(a.customStyle), c = i(a.activeTag), p = i(a.showClose), d = i(a.addButtonText), f = i(), k = i(a.wrapText), D = i();
261
- i(a.disable);
262
- const B = i(!1);
263
+ setup(t, e) {
264
+ const v = i(t.selectable), g = i(t.customClass), n = i(t.data), h = i(t.tagType), b = i(t.tagStyle), B = i(t.showColor), O = i(t.customStyle), c = i(t.activeTag), p = i(t.showClose), f = i(t.addButtonText), d = i(), w = i(t.wrapText), D = i();
265
+ i(t.disable);
266
+ const A = i(!1);
263
267
  function P() {
264
- const r = n.value.map((s) => ({
268
+ const s = n.value.map((l) => ({
265
269
  type: "Tag",
266
- payload: s
270
+ payload: l
267
271
  }));
268
- return a.showAddButton && r.push({
272
+ return t.showAddButton && s.push({
269
273
  type: "AddButton"
270
- }), r;
271
- }
272
- const b = i(P());
273
- function $(r) {
274
- n.value = r, b.value = P();
275
- }
276
- const F = I(() => b.value.findIndex((r) => r.type === "Input")), W = we(a, e, n, b), {
277
- dragstart: L,
278
- dragenter: m,
279
- dragover: O,
280
- dragend: A
281
- } = W;
282
- q(() => a.data, (r) => $(r)), q(() => a.showAddButton, () => {
283
- b.value = P();
284
- }), q(() => a.disable, (r) => {
285
- b.value = P();
286
- }), q(() => a.activeTag, (r) => {
287
- c.value = r;
288
- }), q(B, (r) => {
289
- const s = [...b.value];
290
- r ? s.length > 0 && s[s.length - 1].type !== "Input" && (s.splice(s.length - 1, 1), s.splice(s.length, 0, {
274
+ }), s;
275
+ }
276
+ const T = i(P());
277
+ function I(s) {
278
+ n.value = s, T.value = P();
279
+ }
280
+ const N = R(() => T.value.findIndex((s) => s.type === "Input")), $ = we(t, e, n, T), {
281
+ dragstart: m,
282
+ dragenter: y,
283
+ dragover: S,
284
+ dragend: C
285
+ } = $;
286
+ F(() => t.data, (s) => I(s)), F(() => t.showAddButton, () => {
287
+ T.value = P();
288
+ }), F(() => t.disable, (s) => {
289
+ T.value = P();
290
+ }), F(() => t.activeTag, (s) => {
291
+ c.value = s;
292
+ }), F(A, (s) => {
293
+ const l = [...T.value];
294
+ s ? l.length > 0 && l[l.length - 1].type !== "Input" && (l.splice(l.length - 1, 1), l.splice(l.length, 0, {
291
295
  type: "Input"
292
- }), b.value = s, ue(() => {
296
+ }), T.value = l, ue(() => {
293
297
  var u;
294
298
  D.value && ((u = D.value) == null || u.focus());
295
- })) : s.length > 0 && s[s.length - 1].type !== "AddButton" && (s.splice(s.length - 1, 1), s.splice(s.length, 0, {
299
+ })) : l.length > 0 && l[l.length - 1].type !== "AddButton" && (l.splice(l.length - 1, 1), l.splice(l.length, 0, {
296
300
  type: "AddButton"
297
- }), b.value = s);
301
+ }), T.value = l);
298
302
  });
299
- const M = I(() => {
300
- const r = {
303
+ const W = R(() => {
304
+ const s = {
301
305
  "farris-tags": !0,
302
306
  "farris-tags-checkable": v.value,
303
- "farris-tags-nowrap": !k.value
307
+ "farris-tags-nowrap": !w.value
304
308
  };
305
- return g.value.split(" ").reduce((s, u) => (s[u] = !0, s), r), r;
309
+ return g.value.split(" ").reduce((l, u) => (l[u] = !0, l), s), s;
306
310
  });
307
- function V(r) {
308
- const s = {
311
+ function G(s) {
312
+ const l = {
309
313
  "farris-tag-item": !0,
310
- "farris-tag-item-checked": v.value && r.checked,
314
+ "farris-tag-item-checked": v.value && s.checked,
311
315
  "farris-tag-item-checkable": v.value,
312
- "farris-tag-item-has-color": w.value,
313
- "farris-tag-item-actived": c.value === r.name
316
+ "farris-tag-item-has-color": B.value,
317
+ "farris-tag-item-actived": c.value === s.name
314
318
  };
315
319
  if (h.value) {
316
320
  const u = `farris-tag-item-${h.value}`;
317
- s[u] = !0;
321
+ l[u] = !0;
318
322
  }
319
- return s;
320
- }
321
- const R = I(() => {
322
- const r = {};
323
- return C.value && C.value.split(";").reduce((s, u) => {
324
- const j = u.split(":");
325
- return s[j[0]] = j[1], s;
326
- }, r), r;
323
+ return l;
324
+ }
325
+ const J = R(() => {
326
+ const s = {};
327
+ return O.value && O.value.split(";").reduce((l, u) => {
328
+ const M = u.split(":");
329
+ return l[M[0]] = M[1], l;
330
+ }, s), s;
327
331
  });
328
- function H(r, s) {
329
- !a.disable && v.value && (!s.hasOwnProperty("selectable") || s.selectable) && (s.checked = !s.checked, c.value = s.checked ? s.name : "", s.checked && n.value.filter((u) => u.name !== s.name).forEach((u) => {
330
- u.checked = !s.checked;
331
- }), e.emit("change", n.value), e.emit("selectionChange", s));
332
+ function Q(s, l) {
333
+ !t.disable && v.value && (!l.hasOwnProperty("selectable") || l.selectable) && (l.checked = !l.checked, c.value = l.checked ? l.name : "", l.checked && n.value.filter((u) => u.name !== l.name).forEach((u) => {
334
+ u.checked = !l.checked;
335
+ }), e.emit("change", n.value), e.emit("selectionChange", l));
332
336
  }
333
- function Q(r, s) {
337
+ function U(s, l) {
334
338
  let u;
335
- switch (r.key) {
339
+ switch (s.key) {
336
340
  case "Backspace":
337
- n.value = n.value.filter((j) => j.name !== s.name), e.emit("change", n.value);
341
+ n.value = n.value.filter((M) => M.name !== l.name), e.emit("change", n.value);
338
342
  break;
339
343
  case "ArrowLeft":
340
- u = Math.max(f.value.scrollLeft + 20, 0), f.value.scrollLeft = u;
344
+ u = Math.max(d.value.scrollLeft + 20, 0), d.value.scrollLeft = u;
341
345
  break;
342
346
  case "ArrowRight":
343
- u = Math.max(f.value.scrollLeft - 20, 0), f.value.scrollLeft = u;
347
+ u = Math.max(d.value.scrollLeft - 20, 0), d.value.scrollLeft = u;
344
348
  }
345
349
  }
346
- function U(r, s) {
347
- const u = n.value.findIndex((j) => j.name === s.name);
350
+ function Y(s, l) {
351
+ const u = n.value.findIndex((M) => M.name === l.name);
348
352
  if (u > -1) {
349
- const [j] = n.value.splice(u, 1);
350
- b.value = P(), e.emit("change", n.value), e.emit("remove", {
353
+ const [M] = n.value.splice(u, 1);
354
+ T.value = P(), e.emit("change", n.value), e.emit("remove", {
351
355
  tags: n.value,
352
- remove: j
356
+ remove: M
353
357
  });
354
358
  }
355
- r.stopPropagation();
359
+ s.stopPropagation();
356
360
  }
357
- const Y = I(() => ({
361
+ const Z = R(() => ({
358
362
  "farris-tag-item": !0,
359
363
  "farris-tag-add-button": !0,
360
- "farris-tag-add-button-disabled": !a.enableAddButton
364
+ "farris-tag-add-button-disabled": !t.enableAddButton
361
365
  }));
362
- function Z(r) {
363
- r.stopPropagation(), B.value = !0;
366
+ function x(s) {
367
+ s.stopPropagation(), A.value = !0;
364
368
  }
365
369
  function K() {
366
- return !a.disable && T("li", {
367
- class: Y.value,
368
- onClick: (r) => Z(r)
369
- }, [T("span", {
370
+ return !t.disable && k("li", {
371
+ class: Z.value,
372
+ onClick: (s) => x(s)
373
+ }, [k("span", {
370
374
  class: "f-icon f-icon-amplification"
371
- }, null), d.value && T("span", {
375
+ }, null), f.value && k("span", {
372
376
  class: "farris-tag-add-text"
373
- }, [d.value])]);
377
+ }, [f.value])]);
374
378
  }
375
- function _(r, s, u) {
376
- r > -1 && (n.value.splice(r, 0, {
377
- name: s,
379
+ function q(s, l, u) {
380
+ s > -1 && (n.value.splice(s, 0, {
381
+ name: l,
378
382
  value: u,
379
383
  selectable: v.value
380
- }), b.value = P(), B.value = !1, e.emit("change", n.value));
384
+ }), T.value = P(), A.value = !1, e.emit("change", n.value));
381
385
  }
382
- function X(r) {
383
- if (r && r.value) {
384
- const s = r.value, u = F.value;
385
- _(u, s, s), r.innerText = "";
386
+ function H(s) {
387
+ if (s && s.value) {
388
+ const l = s.value, u = N.value;
389
+ q(u, l, l), s.innerText = "";
386
390
  } else
387
- B.value = !1;
391
+ A.value = !1;
388
392
  }
389
- function ee(r) {
390
- const s = r.target;
391
- s && s.value ? X(s) : B.value = !1;
393
+ function ee(s) {
394
+ const l = s.target;
395
+ l && l.value ? H(l) : A.value = !1;
392
396
  }
393
- function ge(r) {
394
- r.key === "Enter" && X(r.target);
397
+ function de(s) {
398
+ s.key === "Enter" && H(s.target);
395
399
  }
396
400
  function te() {
397
- return !a.disable && T("li", {
401
+ return !t.disable && k("li", {
398
402
  class: "farris-tag-input-box"
399
- }, [T("input", {
403
+ }, [k("input", {
400
404
  title: "farris-tag-input-box",
401
405
  ref: D,
402
406
  class: "form-control",
403
- onKeyup: ge,
407
+ onKeyup: de,
404
408
  onBlur: ee
405
409
  }, null)]);
406
410
  }
407
- function ae(r, s) {
408
- return T("li", {
409
- class: V(r),
410
- style: R.value,
411
+ function ae(s, l) {
412
+ return k("li", {
413
+ class: G(s),
414
+ style: J.value,
411
415
  tabindex: 0,
412
- id: r.name,
413
- key: r.name,
414
- onClick: (u) => H(u, r),
415
- onKeydown: (u) => Q(u, r),
416
+ id: s.name,
417
+ key: s.name,
418
+ onClick: (u) => Q(u, s),
419
+ onKeydown: (u) => U(u, s),
416
420
  draggable: "true",
417
- onDragstart: (u) => L(u, r, s),
418
- onDragenter: (u) => m(u, s),
419
- onDragend: (u) => A(u, r),
420
- onDragover: (u) => O(u, s)
421
- }, [T("span", {
422
- title: r.name,
421
+ onDragstart: (u) => m(u, s, l),
422
+ onDragenter: (u) => y(u, l),
423
+ onDragend: (u) => C(u, s),
424
+ onDragover: (u) => S(u, l)
425
+ }, [k("span", {
426
+ title: s.name,
423
427
  class: "tag-box"
424
- }, [r.name]), !a.disable && p.value && T("span", {
428
+ }, [s.name]), !t.disable && p.value && k("span", {
425
429
  class: "tag-delete"
426
- }, [T("i", {
430
+ }, [k("i", {
427
431
  class: "f-icon f-icon-close",
428
- onClick: (u) => U(u, r)
432
+ onClick: (u) => Y(u, s)
429
433
  }, null)])]);
430
434
  }
431
- function J() {
432
- return b.value.map((r, s) => {
433
- switch (r.type) {
435
+ function _() {
436
+ return T.value.map((s, l) => {
437
+ switch (s.type) {
434
438
  case "Tag":
435
- return ae(r.payload, s);
439
+ return ae(s.payload, l);
436
440
  case "AddButton":
437
441
  return K();
438
442
  case "Input":
@@ -440,367 +444,366 @@ const G = /* @__PURE__ */ ye({
440
444
  }
441
445
  });
442
446
  }
443
- const z = I(() => ({
447
+ const X = R(() => ({
444
448
  "farris-tags-item-container": !0,
445
- "farris-tag-item-capsule": y.value === "capsule"
449
+ "farris-tag-item-capsule": b.value === "capsule"
446
450
  }));
447
- function ne(r) {
448
- const s = Math.max(f.value.scrollLeft - r.deltaX, 0);
449
- f.value.scrollLeft = s;
451
+ function ne(s) {
452
+ const l = Math.max(d.value.scrollLeft - s.deltaX, 0);
453
+ d.value.scrollLeft = l;
450
454
  }
451
- function re(r) {
455
+ function se(s) {
452
456
  var u;
453
- r.preventDefault(), r.stopPropagation();
454
- const s = (u = r.dataTransfer) == null ? void 0 : u.getData("Text");
455
- if (s) {
456
- const j = s.split(":"), le = j[0], x = j[1];
457
- [...n.value].findIndex((t) => (console.log(`${t.value} === ${x} is ${t.value === x}`), t.value === x)) > -1 || _(n.value.length, le, x);
457
+ s.preventDefault(), s.stopPropagation();
458
+ const l = (u = s.dataTransfer) == null ? void 0 : u.getData("Text");
459
+ if (l) {
460
+ const M = l.split(":"), re = M[0], V = M[1];
461
+ [...n.value].findIndex((a) => (console.log(`${a.value} === ${V} is ${a.value === V}`), a.value === V)) > -1 || q(n.value.length, re, V);
458
462
  }
459
463
  }
460
- function se(r) {
461
- r.preventDefault();
462
- }
463
- return () => T("div", {
464
- class: M.value,
465
- onDrop: re,
466
- onDragover: se
467
- }, [T("ul", {
468
- ref: f,
469
- class: z.value,
470
- onWheel: (r) => ne(r)
471
- }, [J()])]);
464
+ function le(s) {
465
+ s.preventDefault();
466
+ }
467
+ return () => k("div", {
468
+ class: W.value,
469
+ onDrop: se,
470
+ onDragover: le
471
+ }, [k("ul", {
472
+ ref: d,
473
+ class: X.value,
474
+ onWheel: (s) => ne(s)
475
+ }, [_()])]);
472
476
  }
473
477
  });
474
- function Ue(a, e, v) {
475
- var L;
476
- function g() {
477
- }
478
- const n = "", h = "", y = i();
479
- function w() {
478
+ function Ye(t, e, v) {
479
+ var $;
480
+ const g = "", n = "", h = i();
481
+ function b() {
480
482
  return (e == null ? void 0 : e.schema.componentType) !== "frame";
481
483
  }
482
- function C() {
484
+ function B() {
483
485
  return !1;
484
486
  }
485
- function c() {
487
+ function O() {
486
488
  return (e == null ? void 0 : e.schema.componentType) !== "frame";
487
489
  }
488
- function p() {
490
+ function c() {
489
491
  return (e == null ? void 0 : e.schema.componentType) === "frame";
490
492
  }
491
- function d(m) {
493
+ function p(m) {
492
494
  if (!m || !m.value)
493
495
  return null;
494
496
  if (m.value.schema && m.value.schema.type === "component")
495
497
  return m.value;
496
- const O = i(m == null ? void 0 : m.value.parent), A = d(O);
497
- return A || null;
498
+ const y = i(m == null ? void 0 : m.value.parent), S = p(y);
499
+ return S || null;
498
500
  }
499
501
  function f(m = e) {
500
- const { componentInstance: O, designerItemElementRef: A } = m;
501
- return !O || !O.value ? null : O.value.canMove ? A : f(m.parent);
502
+ const { componentInstance: y, designerItemElementRef: S } = m;
503
+ return !y || !y.value ? null : y.value.canMove ? S : f(m.parent);
502
504
  }
503
- function k(m) {
505
+ function d(m) {
504
506
  return !!v;
505
507
  }
506
- function D() {
508
+ function w() {
507
509
  return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
508
510
  }
509
- function B() {
511
+ function D() {
510
512
  }
511
- function P(m, O) {
513
+ function A(m, y) {
512
514
  }
513
- function b(m, O) {
514
- const { componentType: A } = m;
515
- let M = ie(A, m, O);
516
- const V = A.toLowerCase().replace("-", "_");
517
- return M && !M.id && M.type === A && (M.id = `${V}_${Math.random().toString().slice(2, 6)}`), M;
515
+ function P(m, y) {
516
+ const { componentType: S } = m;
517
+ let C = Te(S, m, y);
518
+ const W = S.toLowerCase().replace(/-/g, "_");
519
+ return C && !C.id && C.type === S && (C.id = `${W}_${Math.random().toString().slice(2, 6)}`), C;
518
520
  }
519
- function $(m, O) {
520
- const A = String(m.getAttribute("data-controltype")), M = m.getAttribute("data-feature"), V = M ? JSON.parse(M) : {};
521
- V.parentComponentInstance = y.value;
522
- let R = ie(A, V);
523
- const H = A.toLowerCase().replace("-", "_");
524
- return R && !R.id && R.type === A && (R.id = `${H}_${Math.random().toString().slice(2, 6)}`), R;
521
+ function T(m) {
525
522
  }
526
- function F(m) {
523
+ function I(...m) {
527
524
  }
528
- function W(...m) {
525
+ function N() {
526
+ e != null && e.schema.contents && e.schema.contents.map((m) => {
527
+ var C;
528
+ let y = m.id;
529
+ m.type === "component-ref" && (y = m.component);
530
+ const S = t.value.querySelector(`#${y}-design-item`);
531
+ (C = S == null ? void 0 : S.componentInstance) != null && C.value.onRemoveComponent && S.componentInstance.value.onRemoveComponent();
532
+ });
529
533
  }
530
- return y.value = {
531
- canMove: w(),
532
- canSelectParent: C(),
533
- canDelete: c(),
534
- canNested: !p(),
534
+ return h.value = {
535
+ canMove: b(),
536
+ canSelectParent: B(),
537
+ canDelete: O(),
538
+ canNested: !c(),
535
539
  contents: e == null ? void 0 : e.schema.contents,
536
- elementRef: a,
537
- parent: (L = e == null ? void 0 : e.parent) == null ? void 0 : L.componentInstance,
540
+ elementRef: t,
541
+ parent: ($ = e == null ? void 0 : e.parent) == null ? void 0 : $.componentInstance,
538
542
  schema: e == null ? void 0 : e.schema,
539
- styles: n,
540
- designerClass: h,
541
- canAccepts: k,
542
- getBelongedComponentInstance: d,
543
+ styles: g,
544
+ designerClass: n,
545
+ canAccepts: d,
546
+ getBelongedComponentInstance: p,
543
547
  getDraggableDesignItemElement: f,
544
- getDraggingDisplayText: D,
545
- getPropConfig: W,
546
- getDragScopeElement: B,
547
- onAcceptMovedChildElement: P,
548
- onAcceptNewChildElement: $,
549
- onChildElementMovedOut: F,
550
- addNewChildComponentSchema: b,
551
- updateDragAndDropRules: g,
548
+ getDraggingDisplayText: w,
549
+ getPropConfig: I,
550
+ getDragScopeElement: D,
551
+ onAcceptMovedChildElement: A,
552
+ onChildElementMovedOut: T,
553
+ addNewChildComponentSchema: P,
552
554
  triggerBelongedComponentToMoveWhenMoved: i(!1),
553
- triggerBelongedComponentToDeleteWhenDeleted: i(!1)
554
- }, y;
555
+ triggerBelongedComponentToDeleteWhenDeleted: i(!1),
556
+ onRemoveComponent: N
557
+ }, h;
555
558
  }
556
- const Ye = /* @__PURE__ */ ye({
559
+ const Ze = /* @__PURE__ */ he({
557
560
  name: "FTagsDesign",
558
- props: de,
561
+ props: fe,
559
562
  emits: ["remove", "selectionChange", "change"],
560
- setup(a, e) {
561
- const v = i(a.selectable), g = i(a.customClass), n = i(a.data), h = i(a.tagType), y = i(a.tagStyle), w = i(a.showColor), C = i(a.activeTag), c = i(a.customStyle), p = i(a.showClose), d = i(a.showAddButton), f = i(a.showInput), k = i(a.addButtonText), D = i(a.enableAddButton);
562
- i(a.placeholder), i(""), i();
563
- const B = i(), P = i(a.wrapText), b = i(), $ = i(), F = Be("design-item-context"), W = Ue($, F);
563
+ setup(t, e) {
564
+ const v = i(t.selectable), g = i(t.customClass), n = i(t.data), h = i(t.tagType), b = i(t.tagStyle), B = i(t.showColor), O = i(t.activeTag), c = i(t.customStyle), p = i(t.showClose), f = i(t.showAddButton), d = i(t.showInput), w = i(t.addButtonText), D = i(t.enableAddButton);
565
+ i(t.placeholder), i(""), i();
566
+ const A = i(), P = i(t.wrapText), T = i(), I = i(), N = De("design-item-context"), $ = Ye(I, N);
564
567
  Ae(() => {
565
- $.value.componentInstance = W;
566
- }), e.expose(W.value);
567
- function L() {
568
- const t = n.value.map((l) => ({
568
+ I.value.componentInstance = $;
569
+ }), e.expose($.value);
570
+ function m() {
571
+ const a = n.value.map((r) => ({
569
572
  type: "Tag",
570
- payload: l
573
+ payload: r
571
574
  }));
572
- return d.value && t.push({
575
+ return f.value && a.push({
573
576
  type: "AddButton"
574
- }), t;
575
- }
576
- const m = i(L());
577
- function O(t) {
578
- n.value = t, m.value = L();
579
- }
580
- const A = I(() => m.value.findIndex((t) => t.type === "Input")), M = we(a, e, n, m), {
581
- dragstart: V,
582
- dragenter: R,
583
- dragover: H,
584
- dragend: Q
585
- } = M;
586
- q(() => a.data, (t) => O(t));
587
- const U = I(() => {
588
- const t = {
577
+ }), a;
578
+ }
579
+ const y = i(m());
580
+ function S(a) {
581
+ n.value = a, y.value = m();
582
+ }
583
+ const C = R(() => y.value.findIndex((a) => a.type === "Input")), W = we(t, e, n, y), {
584
+ dragstart: G,
585
+ dragenter: J,
586
+ dragover: Q,
587
+ dragend: U
588
+ } = W;
589
+ F(() => t.data, (a) => S(a));
590
+ const Y = R(() => {
591
+ const a = {
589
592
  "farris-tags": !0,
590
593
  "farris-tags-checkable": v.value,
591
594
  "farris-tags-nowrap": !P.value
592
595
  };
593
- return g.value.split(" ").reduce((l, o) => (l[o] = !0, l), t), t;
596
+ return g.value.split(" ").reduce((r, o) => (r[o] = !0, r), a), a;
594
597
  });
595
- function Y(t) {
596
- const l = {
598
+ function Z(a) {
599
+ const r = {
597
600
  "farris-tag-item": !0,
598
- "farris-tag-item-checked": v.value && t.checked,
601
+ "farris-tag-item-checked": v.value && a.checked,
599
602
  "farris-tag-item-checkable": v.value,
600
- "farris-tag-item-has-color": w.value,
601
- "farris-tag-item-actived": C.value === t.name
603
+ "farris-tag-item-has-color": B.value,
604
+ "farris-tag-item-actived": O.value === a.name
602
605
  };
603
606
  if (h.value) {
604
607
  const o = `farris-tag-item-${h.value}`;
605
- l[o] = !0;
608
+ r[o] = !0;
606
609
  }
607
- return l;
608
- }
609
- const Z = I(() => {
610
- const t = {};
611
- return c.value && c.value.split(";").reduce((l, o) => {
612
- const S = o.split(":");
613
- return l[S[0]] = S[1], l;
614
- }, t), t;
610
+ return r;
611
+ }
612
+ const x = R(() => {
613
+ const a = {};
614
+ return c.value && c.value.split(";").reduce((r, o) => {
615
+ const j = o.split(":");
616
+ return r[j[0]] = j[1], r;
617
+ }, a), a;
615
618
  });
616
- function K(t, l) {
617
- v.value && l.selectable && (l.checked = !l.checked, C.value = l.checked ? l.name : "", l.checked && n.value.filter((o) => o.name !== l.name).forEach((o) => {
618
- o.checked = !l.checked;
619
- }), e.emit("change", n.value), e.emit("selectionChange", l));
619
+ function K(a, r) {
620
+ v.value && r.selectable && (r.checked = !r.checked, O.value = r.checked ? r.name : "", r.checked && n.value.filter((o) => o.name !== r.name).forEach((o) => {
621
+ o.checked = !r.checked;
622
+ }), e.emit("change", n.value), e.emit("selectionChange", r));
620
623
  }
621
- function _(t, l) {
624
+ function q(a, r) {
622
625
  let o;
623
- switch (t.key) {
626
+ switch (a.key) {
624
627
  case "Backspace":
625
- n.value = n.value.filter((S) => S.name !== l.name), e.emit("change", n.value);
628
+ n.value = n.value.filter((j) => j.name !== r.name), e.emit("change", n.value);
626
629
  break;
627
630
  case "ArrowLeft":
628
- o = Math.max(B.value.scrollLeft + 20, 0), B.value.scrollLeft = o;
631
+ o = Math.max(A.value.scrollLeft + 20, 0), A.value.scrollLeft = o;
629
632
  break;
630
633
  case "ArrowRight":
631
- o = Math.max(B.value.scrollLeft - 20, 0), B.value.scrollLeft = o;
634
+ o = Math.max(A.value.scrollLeft - 20, 0), A.value.scrollLeft = o;
632
635
  }
633
636
  }
634
- function X(t, l) {
635
- const o = n.value.findIndex((S) => S.name === l.name);
637
+ function H(a, r) {
638
+ const o = n.value.findIndex((j) => j.name === r.name);
636
639
  if (o > -1) {
637
- const [S] = n.value.splice(o, 1);
638
- m.value = L(), e.emit("change", n.value), e.emit("remove", n.value, S, o);
640
+ const [j] = n.value.splice(o, 1);
641
+ y.value = m(), e.emit("change", n.value), e.emit("remove", n.value, j, o);
639
642
  }
640
- t.stopPropagation();
643
+ a.stopPropagation();
641
644
  }
642
- const ee = I(() => ({
645
+ const ee = R(() => ({
643
646
  "farris-tag-item": !0,
644
647
  "farris-tag-add-button": !0,
645
648
  "farris-tag-add-button-disabled": !D.value
646
649
  }));
647
- function ge(t) {
650
+ function de(a) {
648
651
  }
649
652
  function te() {
650
- return T("li", {
653
+ return k("li", {
651
654
  class: ee.value,
652
- onClick: (t) => void 0
653
- }, [T("span", {
655
+ onClick: (a) => void 0
656
+ }, [k("span", {
654
657
  class: "f-icon f-icon-amplification"
655
- }, null), T("span", {
658
+ }, null), k("span", {
656
659
  class: "farris-tag-add-text"
657
- }, [k.value])]);
658
- }
659
- function ae(t) {
660
- if (t && !t.innerText) {
661
- const l = A.value;
662
- if (l > 0) {
663
- const [o] = n.value.splice(l - 1, 1);
664
- m.value.splice(l - 1, 1), e.emit("remove", n.value, o, l - 1);
660
+ }, [w.value])]);
661
+ }
662
+ function ae(a) {
663
+ if (a && !a.innerText) {
664
+ const r = C.value;
665
+ if (r > 0) {
666
+ const [o] = n.value.splice(r - 1, 1);
667
+ y.value.splice(r - 1, 1), e.emit("remove", n.value, o, r - 1);
665
668
  }
666
669
  }
667
670
  }
668
- function J(t, l, o) {
669
- t > -1 && (n.value.splice(t, 0, {
670
- name: l,
671
+ function _(a, r, o) {
672
+ a > -1 && (n.value.splice(a, 0, {
673
+ name: r,
671
674
  value: o,
672
675
  selectable: v.value
673
- }), m.value = L(), e.emit("change", n.value));
676
+ }), y.value = m(), e.emit("change", n.value));
674
677
  }
675
- function z(t) {
676
- if (t && t.innerText) {
677
- const l = t.innerText, o = A.value;
678
- J(o, l, l), t.innerText = "";
678
+ function X(a) {
679
+ if (a && a.innerText) {
680
+ const r = a.innerText, o = C.value;
681
+ _(o, r, r), a.innerText = "";
679
682
  }
680
683
  }
681
- function ne(t) {
682
- const l = t.target;
683
- l && (l.innerText ? z(l) : e.emit("change", n.value));
684
+ function ne(a) {
685
+ const r = a.target;
686
+ r && (r.innerText ? X(r) : e.emit("change", n.value));
684
687
  }
685
- function re(t) {
686
- t.key === "Enter" && z(t.target), t.key === "Backspace" && (ae(t.target), ue(() => {
687
- var l;
688
- b.value && ((l = b.value) == null || l.focus());
688
+ function se(a) {
689
+ a.key === "Enter" && X(a.target), a.key === "Backspace" && (ae(a.target), ue(() => {
690
+ var r;
691
+ T.value && ((r = T.value) == null || r.focus());
689
692
  }));
690
693
  }
691
- function se() {
692
- return T("li", {
694
+ function le() {
695
+ return k("li", {
693
696
  class: "farris-tag-input-box"
694
- }, [T("div", {
695
- ref: b,
697
+ }, [k("div", {
698
+ ref: T,
696
699
  class: "form-control",
697
700
  contenteditable: "true",
698
- onKeyup: re,
701
+ onKeyup: se,
699
702
  onBlur: ne
700
703
  }, null)]);
701
704
  }
702
- function r(t, l) {
703
- return T("li", {
704
- class: Y(t),
705
- style: Z.value,
705
+ function s(a, r) {
706
+ return k("li", {
707
+ class: Z(a),
708
+ style: x.value,
706
709
  tabindex: 0,
707
- id: t.name,
708
- key: t.name,
709
- onClick: (o) => K(o, t),
710
- onKeydown: (o) => _(o, t),
710
+ id: a.name,
711
+ key: a.name,
712
+ onClick: (o) => K(o, a),
713
+ onKeydown: (o) => q(o, a),
711
714
  draggable: "true",
712
- onDragstart: (o) => V(o, t, l),
713
- onDragenter: (o) => R(o, l),
714
- onDragend: (o) => Q(o, t),
715
- onDragover: (o) => H(o, l)
716
- }, [T("div", {
717
- title: t.name,
715
+ onDragstart: (o) => G(o, a, r),
716
+ onDragenter: (o) => J(o, r),
717
+ onDragend: (o) => U(o, a),
718
+ onDragover: (o) => Q(o, r)
719
+ }, [k("div", {
720
+ title: a.name,
718
721
  class: "tag-box"
719
- }, [t.name]), p.value && T("span", {
722
+ }, [a.name]), p.value && k("span", {
720
723
  class: "tag-delete"
721
- }, [T("i", {
724
+ }, [k("i", {
722
725
  class: "f-icon f-icon-close",
723
- onClick: (o) => X(o, t)
726
+ onClick: (o) => H(o, a)
724
727
  }, null)])]);
725
728
  }
726
- function s() {
727
- return m.value.map((t, l) => {
728
- switch (t.type) {
729
+ function l() {
730
+ return y.value.map((a, r) => {
731
+ switch (a.type) {
729
732
  case "Tag":
730
- return r(t.payload, l);
733
+ return s(a.payload, r);
731
734
  case "AddButton":
732
735
  return te();
733
736
  case "Input":
734
- return se();
737
+ return le();
735
738
  }
736
739
  });
737
740
  }
738
- const u = I(() => ({
741
+ const u = R(() => ({
739
742
  "farris-tags-item-container": !0,
740
- "farris-tag-item-capsule": y.value === "capsule"
743
+ "farris-tag-item-capsule": b.value === "capsule"
741
744
  }));
742
- function j(t) {
743
- const l = Math.max(B.value.scrollLeft - t.deltaX, 0);
744
- B.value.scrollLeft = l;
745
- }
746
- function le(t) {
747
- const l = B.value, o = n.value.length - 1;
748
- if (l) {
749
- const S = Array.from(l.children).filter((N) => N.className.indexOf("farris-tag-item") > -1).findIndex((N) => {
750
- const E = N.getBoundingClientRect(), oe = window.getComputedStyle(N), me = parseInt(oe["margin-left"], 10) + E.width + parseInt(oe["margin-right"], 10);
751
- return E.left + me > t;
745
+ function M(a) {
746
+ const r = Math.max(A.value.scrollLeft - a.deltaX, 0);
747
+ A.value.scrollLeft = r;
748
+ }
749
+ function re(a) {
750
+ const r = A.value, o = n.value.length - 1;
751
+ if (r) {
752
+ const j = Array.from(r.children).filter((L) => L.className.indexOf("farris-tag-item") > -1).findIndex((L) => {
753
+ const E = L.getBoundingClientRect(), oe = window.getComputedStyle(L), ve = parseInt(oe["margin-left"], 10) + E.width + parseInt(oe["margin-right"], 10);
754
+ return E.left + ve > a;
752
755
  });
753
- if (S > -1)
754
- return S;
756
+ if (j > -1)
757
+ return j;
755
758
  }
756
759
  return o;
757
760
  }
758
- function x(t) {
759
- if (f.value) {
760
- const o = le(t.clientX) + 1, N = m.value.filter((E) => E.type !== "Input");
761
- N.splice(o, 0, {
761
+ function V(a) {
762
+ if (d.value) {
763
+ const o = re(a.clientX) + 1, L = y.value.filter((E) => E.type !== "Input");
764
+ L.splice(o, 0, {
762
765
  type: "Input"
763
- }), m.value = N, ue(() => {
766
+ }), y.value = L, ue(() => {
764
767
  var E;
765
- b.value && ((E = b.value) == null || E.focus());
768
+ T.value && ((E = T.value) == null || E.focus());
766
769
  });
767
770
  }
768
771
  }
769
- function pe(t) {
772
+ function ge(a) {
770
773
  var o;
771
- t.preventDefault(), t.stopPropagation();
772
- const l = (o = t.dataTransfer) == null ? void 0 : o.getData("Text");
773
- if (l) {
774
- const S = l.split(":"), N = S[0], E = S[1];
775
- [...n.value].findIndex((ce) => (console.log(`${ce.value} === ${E} is ${ce.value === E}`), ce.value === E)) > -1 || J(n.value.length, N, E);
774
+ a.preventDefault(), a.stopPropagation();
775
+ const r = (o = a.dataTransfer) == null ? void 0 : o.getData("Text");
776
+ if (r) {
777
+ const j = r.split(":"), L = j[0], E = j[1];
778
+ [...n.value].findIndex((ce) => (console.log(`${ce.value} === ${E} is ${ce.value === E}`), ce.value === E)) > -1 || _(n.value.length, L, E);
776
779
  }
777
780
  }
778
- function ve(t) {
779
- t.preventDefault();
780
- }
781
- return () => T("div", {
782
- ref: $,
783
- class: U.value,
784
- onClick: x,
785
- onDrop: pe,
786
- onDragover: ve
787
- }, [T("ul", {
788
- ref: B,
781
+ function pe(a) {
782
+ a.preventDefault();
783
+ }
784
+ return () => k("div", {
785
+ ref: I,
786
+ class: Y.value,
787
+ onClick: V,
788
+ onDrop: ge,
789
+ onDragover: pe
790
+ }, [k("ul", {
791
+ ref: A,
789
792
  class: u.value,
790
- onWheel: (t) => j(t)
791
- }, [s()])]);
793
+ onWheel: (a) => M(a)
794
+ }, [l()])]);
792
795
  }
793
796
  });
794
- G.register = (a, e, v, g) => {
795
- a.tags = G, e.tags = ke;
797
+ z.register = (t, e, v, g) => {
798
+ t.tags = z, e.tags = ke;
796
799
  };
797
- G.registerDesigner = (a, e, v) => {
798
- a.tags = Ye, e.tags = ke;
800
+ z.registerDesigner = (t, e, v) => {
801
+ t.tags = Ze, e.tags = ke;
799
802
  };
800
- const tt = De(G);
803
+ const tt = Be(z);
801
804
  export {
802
- G as FTags,
805
+ z as FTags,
803
806
  tt as default,
804
807
  ke as propsResolver,
805
- de as tagsProps
808
+ fe as tagsProps
806
809
  };