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