@farris/ui-vue 1.2.4 → 1.2.6

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 (279) hide show
  1. package/components/accordion/index.esm.js +58 -58
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/accordion/package.json +1 -1
  4. package/components/avatar/index.esm.js +124 -116
  5. package/components/avatar/index.umd.cjs +1 -1
  6. package/components/avatar/package.json +1 -1
  7. package/components/border-editor/package.json +1 -1
  8. package/components/button/package.json +1 -1
  9. package/components/button-edit/index.css +1 -0
  10. package/components/button-edit/package.json +1 -1
  11. package/components/button-group/package.json +1 -1
  12. package/components/calculator/package.json +1 -1
  13. package/components/calendar/package.json +1 -1
  14. package/components/capsule/index.esm.js +1 -1
  15. package/components/capsule/index.umd.cjs +1 -1
  16. package/components/capsule/package.json +1 -1
  17. package/components/checkbox/index.esm.js +219 -209
  18. package/components/checkbox/index.umd.cjs +1 -1
  19. package/components/checkbox/package.json +1 -1
  20. package/components/color-picker/package.json +1 -1
  21. package/components/combo-list/index.esm.js +36 -28
  22. package/components/combo-list/index.umd.cjs +1 -1
  23. package/components/combo-list/package.json +1 -1
  24. package/components/combo-tree/index.esm.js +340 -107
  25. package/components/combo-tree/index.umd.cjs +1 -1
  26. package/components/combo-tree/package.json +1 -1
  27. package/components/common/index.esm.js +2 -2
  28. package/components/common/index.umd.cjs +1 -1
  29. package/components/common/package.json +1 -1
  30. package/components/component/index.esm.js +36 -29
  31. package/components/component/index.umd.cjs +1 -1
  32. package/components/component/package.json +1 -1
  33. package/components/condition/index.esm.js +406 -402
  34. package/components/condition/index.umd.cjs +1 -1
  35. package/components/condition/package.json +1 -1
  36. package/components/content-container/index.esm.js +9 -13
  37. package/components/content-container/index.umd.cjs +1 -1
  38. package/components/content-container/package.json +1 -1
  39. package/components/{tree-grid/style.css → data-grid/index.css} +1 -1
  40. package/components/data-grid/index.esm.js +4439 -4273
  41. package/components/data-grid/index.umd.cjs +1 -1
  42. package/components/data-grid/package.json +1 -1
  43. package/components/data-view/index.esm.js +2904 -2892
  44. package/components/data-view/index.umd.cjs +1 -1
  45. package/components/data-view/package.json +1 -1
  46. package/components/date-picker/index.esm.js +250 -242
  47. package/components/date-picker/index.umd.cjs +1 -1
  48. package/components/date-picker/package.json +1 -1
  49. package/components/designer-canvas/index.css +1 -0
  50. package/components/designer-canvas/index.esm.js +24 -21
  51. package/components/designer-canvas/index.umd.cjs +1 -1
  52. package/components/designer-canvas/package.json +1 -1
  53. package/components/designer-outline/index.esm.js +44 -42
  54. package/components/designer-outline/index.umd.cjs +1 -1
  55. package/components/designer-outline/package.json +1 -1
  56. package/components/designer-toolbox/index.esm.js +28 -467
  57. package/components/designer-toolbox/index.umd.cjs +1 -1
  58. package/components/designer-toolbox/package.json +1 -1
  59. package/components/discussion-editor/package.json +1 -1
  60. package/components/discussion-list/package.json +1 -1
  61. package/components/drawer/package.json +1 -1
  62. package/components/dropdown/index.esm.js +86 -86
  63. package/components/dropdown/index.umd.cjs +1 -1
  64. package/components/dropdown/package.json +1 -1
  65. package/components/dynamic-form/index.esm.js +984 -928
  66. package/components/dynamic-form/index.umd.cjs +1 -1
  67. package/components/dynamic-form/package.json +1 -1
  68. package/components/dynamic-resolver/index.esm.js +56 -47
  69. package/components/dynamic-resolver/index.umd.cjs +1 -1
  70. package/components/dynamic-resolver/package.json +1 -1
  71. package/components/dynamic-view/index.esm.js +281 -277
  72. package/components/dynamic-view/index.umd.cjs +1 -1
  73. package/components/dynamic-view/package.json +1 -1
  74. package/components/enum-editor/package.json +1 -1
  75. package/components/events-editor/package.json +1 -1
  76. package/components/expression-editor/package.json +1 -1
  77. package/components/external-container/index.css +1 -0
  78. package/components/external-container/index.esm.js +1917 -1901
  79. package/components/external-container/index.umd.cjs +1 -1
  80. package/components/external-container/package.json +1 -1
  81. package/components/field-selector/index.css +1 -0
  82. package/components/field-selector/index.esm.js +4185 -4023
  83. package/components/field-selector/index.umd.cjs +1 -1
  84. package/components/field-selector/package.json +1 -1
  85. package/components/filter-bar/{style.css → index.css} +1 -1
  86. package/components/filter-bar/index.esm.js +595 -581
  87. package/components/filter-bar/index.umd.cjs +1 -1
  88. package/components/filter-bar/package.json +1 -1
  89. package/components/flow-canvas/index.css +1 -0
  90. package/components/flow-canvas/index.esm.js +38 -35
  91. package/components/flow-canvas/index.umd.cjs +1 -1
  92. package/components/flow-canvas/package.json +1 -1
  93. package/components/image-cropper/package.json +1 -1
  94. package/components/input-group/index.esm.js +256 -248
  95. package/components/input-group/index.umd.cjs +1 -1
  96. package/components/input-group/package.json +1 -1
  97. package/components/layout/package.json +1 -1
  98. package/components/list-nav/package.json +1 -1
  99. package/components/list-view/index.esm.js +1522 -1519
  100. package/components/list-view/index.umd.cjs +1 -1
  101. package/components/list-view/package.json +1 -1
  102. package/components/loading/package.json +1 -1
  103. package/components/locale/package.json +1 -1
  104. package/components/lookup/index.css +1 -0
  105. package/components/lookup/index.esm.js +4629 -4410
  106. package/components/lookup/index.umd.cjs +1 -1
  107. package/components/lookup/package.json +1 -1
  108. package/components/mapping-editor/index.css +1 -0
  109. package/components/mapping-editor/index.esm.js +4454 -4255
  110. package/components/mapping-editor/index.umd.cjs +1 -1
  111. package/components/mapping-editor/package.json +1 -1
  112. package/components/message-box/index.css +1 -0
  113. package/components/message-box/index.esm.js +397 -386
  114. package/components/message-box/index.umd.cjs +1 -1
  115. package/components/message-box/package.json +1 -1
  116. package/components/modal/index.css +1 -0
  117. package/components/modal/index.esm.js +308 -297
  118. package/components/modal/index.umd.cjs +1 -1
  119. package/components/modal/package.json +1 -1
  120. package/components/nav/index.esm.js +511 -469
  121. package/components/nav/index.umd.cjs +2 -2
  122. package/components/nav/package.json +1 -1
  123. package/components/notify/package.json +1 -1
  124. package/components/order/index.esm.js +972 -920
  125. package/components/order/index.umd.cjs +1 -1
  126. package/components/order/package.json +1 -1
  127. package/components/page-footer/package.json +1 -1
  128. package/components/page-header/index.esm.js +917 -893
  129. package/components/page-header/index.umd.cjs +1 -1
  130. package/components/page-header/package.json +1 -1
  131. package/components/pagination/index.esm.js +491 -449
  132. package/components/pagination/index.umd.cjs +1 -1
  133. package/components/pagination/package.json +1 -1
  134. package/components/popover/package.json +1 -1
  135. package/components/progress/package.json +1 -1
  136. package/components/property-editor/index.esm.js +108 -101
  137. package/components/property-editor/index.umd.cjs +2 -2
  138. package/components/property-editor/package.json +1 -1
  139. package/components/property-panel/index.esm.js +361 -349
  140. package/components/property-panel/index.umd.cjs +1 -1
  141. package/components/property-panel/package.json +1 -1
  142. package/components/radio-button/package.json +1 -1
  143. package/components/radio-group/index.esm.js +72 -64
  144. package/components/radio-group/index.umd.cjs +1 -1
  145. package/components/radio-group/package.json +1 -1
  146. package/components/rate/package.json +1 -1
  147. package/components/response-layout/package.json +1 -1
  148. package/components/response-layout-editor/{style.css → index.css} +1 -1
  149. package/components/response-layout-editor/index.esm.js +452 -439
  150. package/components/response-layout-editor/index.umd.cjs +1 -1
  151. package/components/response-layout-editor/package.json +1 -1
  152. package/components/response-toolbar/index.esm.js +610 -592
  153. package/components/response-toolbar/index.umd.cjs +1 -1
  154. package/components/response-toolbar/package.json +1 -1
  155. package/components/schema-selector/index.css +1 -0
  156. package/components/schema-selector/index.esm.js +4041 -3749
  157. package/components/schema-selector/index.umd.cjs +8 -1
  158. package/components/schema-selector/package.json +1 -1
  159. package/components/search-box/package.json +1 -1
  160. package/components/section/index.esm.js +21 -14
  161. package/components/section/index.umd.cjs +1 -1
  162. package/components/section/package.json +1 -1
  163. package/components/smoke-detector/package.json +1 -1
  164. package/components/spacing-editor/package.json +1 -1
  165. package/components/splitter/package.json +1 -1
  166. package/components/step/package.json +1 -1
  167. package/components/switch/index.esm.js +159 -178
  168. package/components/switch/index.umd.cjs +1 -1
  169. package/components/switch/package.json +1 -1
  170. package/components/tabs/index.css +1 -0
  171. package/components/tabs/index.esm.js +1450 -1408
  172. package/components/tabs/index.umd.cjs +1 -1
  173. package/components/tabs/package.json +1 -1
  174. package/components/tags/package.json +1 -1
  175. package/components/text/package.json +1 -1
  176. package/components/textarea/index.esm.js +86 -78
  177. package/components/textarea/index.umd.cjs +1 -1
  178. package/components/textarea/package.json +1 -1
  179. package/components/time-picker/index.css +1 -0
  180. package/components/time-picker/index.esm.js +387 -379
  181. package/components/time-picker/index.umd.cjs +1 -1
  182. package/components/time-picker/package.json +1 -1
  183. package/components/tooltip/package.json +1 -1
  184. package/components/transfer/index.esm.js +95 -93
  185. package/components/transfer/index.umd.cjs +1 -1
  186. package/components/transfer/package.json +1 -1
  187. package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
  188. package/components/tree-grid/index.esm.js +4437 -4271
  189. package/components/tree-grid/index.umd.cjs +1 -1
  190. package/components/tree-grid/package.json +1 -1
  191. package/components/tree-view/index.esm.js +1989 -1985
  192. package/components/tree-view/index.umd.cjs +1 -1
  193. package/components/tree-view/package.json +1 -1
  194. package/components/uploader/package.json +1 -1
  195. package/components/verify-detail/package.json +1 -1
  196. package/components/video/package.json +1 -1
  197. package/components/weather/package.json +1 -1
  198. package/farris.all.esm.js +12989 -12513
  199. package/farris.all.umd.cjs +9 -9
  200. package/index.css +1 -0
  201. package/package.json +2 -2
  202. package/types/combo-tree/src/combo-tree.props.d.ts +4 -0
  203. package/types/combo-tree/src/components/tree-container.component.d.ts +13 -3
  204. package/types/combo-tree/src/components/tree-container.props.d.ts +15 -1
  205. package/types/combo-tree/src/schema/schema-mapper.d.ts +2 -0
  206. package/types/combo-tree/src/schema/schema-resolver.d.ts +2 -0
  207. package/types/components.d.ts +1 -0
  208. package/types/condition/index.d.ts +60 -1
  209. package/types/data-grid/index.d.ts +5 -5
  210. package/types/data-grid/src/data-grid.component.d.ts +2 -2
  211. package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
  212. package/types/data-grid/src/property-config/data-grid.property-config.d.ts +1 -1
  213. package/types/data-view/components/column-setting/column-setting.component.d.ts +2 -1
  214. package/types/data-view/composition/types.d.ts +2 -0
  215. package/types/designer-canvas/src/composition/dg-control.d.ts +8 -8
  216. package/types/designer-canvas/src/composition/types.d.ts +1 -0
  217. package/types/dynamic-form/src/designer/use-designer-rules.d.ts +3 -3
  218. package/types/dynamic-form/src/types.d.ts +1 -1
  219. package/types/dynamic-resolver/index.d.ts +1 -0
  220. package/types/dynamic-resolver/src/converter/pagination.converter.d.ts +6 -0
  221. package/types/dynamic-resolver/src/visible-prop-resolver.d.ts +3 -0
  222. package/types/list-view/src/composition/types.d.ts +1 -1
  223. package/types/lookup/src/designer/use-lookup-rules.d.ts +3 -0
  224. package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +8 -0
  225. package/types/lookup/src/property-config/lookup.property-config.d.ts +29 -25
  226. package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
  227. package/types/message-box/index.d.ts +84 -1
  228. package/types/modal/src/modal.component.d.ts +3 -3
  229. package/types/modal/src/modal.props.d.ts +3 -5
  230. package/types/notify/index.d.ts +84 -1
  231. package/types/page-header/src/page-header.props.d.ts +7 -0
  232. package/types/page-header/src/property-config/page-header.property-config.d.ts +1 -1
  233. package/types/property-panel/src/composition/entity/base-property.d.ts +2 -0
  234. package/types/response-toolbar/index.d.ts +9 -3
  235. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
  236. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
  237. package/types/response-toolbar/src/response-toolbar.component.d.ts +4 -2
  238. package/types/response-toolbar/src/response-toolbar.props.d.ts +9 -2
  239. package/types/schema-selector/src/composition/types.d.ts +3 -1
  240. package/types/schema-selector/src/schema-selector-editor.component.d.ts +5 -1
  241. package/types/tabs/src/designer/tab-toolbar.design.component.d.ts +1 -1
  242. package/types/tabs/src/tabs.props.d.ts +8 -0
  243. package/types/tree-grid/src/schema/column-resolver.d.ts +3 -0
  244. package/components/button-edit/style.css +0 -1
  245. package/components/designer-canvas/style.css +0 -1
  246. package/components/external-container/style.css +0 -1
  247. package/components/field-selector/style.css +0 -1
  248. package/components/flow-canvas/style.css +0 -1
  249. package/components/lookup/style.css +0 -1
  250. package/components/mapping-editor/style.css +0 -1
  251. package/components/message-box/style.css +0 -1
  252. package/components/modal/style.css +0 -1
  253. package/components/schema-selector/style.css +0 -1
  254. package/components/tabs/style.css +0 -1
  255. package/components/time-picker/style.css +0 -1
  256. package/style.css +0 -1
  257. package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +0 -19
  258. /package/components/border-editor/{style.css → index.css} +0 -0
  259. /package/components/checkbox/{style.css → index.css} +0 -0
  260. /package/components/date-picker/{style.css → index.css} +0 -0
  261. /package/components/designer-outline/{style.css → index.css} +0 -0
  262. /package/components/designer-toolbox/{style.css → index.css} +0 -0
  263. /package/components/discussion-editor/{style.css → index.css} +0 -0
  264. /package/components/discussion-list/{style.css → index.css} +0 -0
  265. /package/components/drawer/{style.css → index.css} +0 -0
  266. /package/components/events-editor/{style.css → index.css} +0 -0
  267. /package/components/list-view/{style.css → index.css} +0 -0
  268. /package/components/order/{style.css → index.css} +0 -0
  269. /package/components/property-editor/{style.css → index.css} +0 -0
  270. /package/components/property-panel/{style.css → index.css} +0 -0
  271. /package/components/radio-button/{style.css → index.css} +0 -0
  272. /package/components/radio-group/{style.css → index.css} +0 -0
  273. /package/components/smoke-detector/{style.css → index.css} +0 -0
  274. /package/components/spacing-editor/{style.css → index.css} +0 -0
  275. /package/components/splitter/{style.css → index.css} +0 -0
  276. /package/components/switch/{style.css → index.css} +0 -0
  277. /package/components/transfer/{style.css → index.css} +0 -0
  278. /package/components/uploader/{style.css → index.css} +0 -0
  279. /package/components/weather/{style.css → index.css} +0 -0
@@ -1,9 +1,231 @@
1
- import { defineComponent as T, ref as l, computed as F, createVNode as C, watch as b } from "vue";
2
- import I from "@farris/ui-vue/components/button-edit";
3
- import O from "@farris/ui-vue/components/tree-view";
1
+ import { defineComponent as O, ref as m, inject as P, computed as v, onMounted as M, createVNode as S, watch as h } from "vue";
2
+ import k from "@farris/ui-vue/components/button-edit";
3
+ import { cloneDeep as I } from "lodash-es";
4
+ import N from "@farris/ui-vue/components/tree-view";
4
5
  import { withInstall as D } from "@farris/ui-vue/components/common";
5
- var j = /* @__PURE__ */ ((e) => (e.Text = "text", e.Tag = "tag", e))(j || {}), P = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.auto = "auto", e))(P || {});
6
- const M = {
6
+ const E = {}, H = {};
7
+ function V(e) {
8
+ const { properties: l, title: d } = e, i = Object.keys(l).reduce((u, s) => (u[s] = l[s].type === "object" && l[s].properties ? V(l[s]) : I(l[s].default), u), {});
9
+ return i.id = `${d}-${Date.now()}`, i;
10
+ }
11
+ function R(e, l) {
12
+ const d = V(l);
13
+ return Object.keys(e).reduce((i, u) => (i[u] = e[u], i), d), d;
14
+ }
15
+ function $(e, l) {
16
+ return Object.keys(e).filter((i) => e[i] != null).reduce((i, u) => {
17
+ if (l.has(u)) {
18
+ const s = l.get(u);
19
+ if (typeof s == "string")
20
+ i[s] = e[u];
21
+ else {
22
+ const c = s(u, e[u], e);
23
+ Object.assign(i, c);
24
+ }
25
+ } else
26
+ i[u] = e[u];
27
+ return i;
28
+ }, {});
29
+ }
30
+ function L(e, l, d = /* @__PURE__ */ new Map()) {
31
+ const i = R(e, l);
32
+ return $(i, d);
33
+ }
34
+ function A(e = {}) {
35
+ function l(n, t, a, r) {
36
+ if (typeof a == "number")
37
+ return r[n].length === a;
38
+ if (typeof a == "object") {
39
+ const o = Object.keys(a)[0], f = a[o];
40
+ if (o === "not")
41
+ return Number(r[n].length) !== Number(f);
42
+ if (o === "moreThan")
43
+ return Number(r[n].length) >= Number(f);
44
+ if (o === "lessThan")
45
+ return Number(r[n].length) <= Number(f);
46
+ }
47
+ return !1;
48
+ }
49
+ function d(n, t, a, r) {
50
+ return r[n] && r[n].propertyValue && String(r[n].propertyValue.value) === String(a);
51
+ }
52
+ const i = /* @__PURE__ */ new Map([
53
+ ["length", l],
54
+ ["getProperty", d]
55
+ ]);
56
+ Object.keys(e).reduce((n, t) => (n.set(t, e[t]), n), i);
57
+ function u(n, t) {
58
+ const a = n;
59
+ return typeof t == "number" ? [{ target: a, operator: "length", param: null, value: Number(t) }] : typeof t == "boolean" ? [{ target: a, operator: "getProperty", param: n, value: !!t }] : typeof t == "object" ? Object.keys(t).map((r) => {
60
+ if (r === "length")
61
+ return { target: a, operator: "length", param: null, value: t[r] };
62
+ const o = r, f = t[r];
63
+ return { target: a, operator: "getProperty", param: o, value: f };
64
+ }) : [];
65
+ }
66
+ function s(n) {
67
+ return Object.keys(n).reduce((a, r) => {
68
+ const o = u(r, n[r]);
69
+ return a.push(...o), a;
70
+ }, []);
71
+ }
72
+ function c(n, t) {
73
+ if (i.has(n.operator)) {
74
+ const a = i.get(n.operator);
75
+ return a && a(n.target, n.param, n.value, t) || !1;
76
+ }
77
+ return !1;
78
+ }
79
+ function y(n, t) {
80
+ return s(n).reduce((o, f) => o && c(f, t), !0);
81
+ }
82
+ function g(n, t) {
83
+ const a = Object.keys(n), r = a.includes("allOf"), o = a.includes("anyOf"), f = r || o, p = (f ? n[f ? r ? "allOf" : "anyOf" : "allOf"] : [n]).map((F) => y(F, t));
84
+ return r ? !p.includes(!1) : p.includes(!0);
85
+ }
86
+ return { parseValueSchema: g };
87
+ }
88
+ const q = {}, U = {};
89
+ A();
90
+ function W(e, l, d = /* @__PURE__ */ new Map(), i = (c, y, g) => y, u = {}, s = (c) => c) {
91
+ return E[l.title] = l, H[l.title] = i, q[l.title] = u, U[l.title] = s, (c = {}) => {
92
+ const y = L(c, l, d), g = Object.keys(e).reduce((n, t) => (n[t] = e[t].default, n), {});
93
+ return Object.assign(g, y);
94
+ };
95
+ }
96
+ function z(e, l) {
97
+ return { customClass: l.class, customStyle: l.style };
98
+ }
99
+ const G = /* @__PURE__ */ new Map([
100
+ ["appearance", z]
101
+ ]), J = "https://json-schema.org/draft/2020-12/schema", Q = "https://farris-design.gitee.io/combo-list.schema.json", X = "combo-list", Y = "A Farris Input Component", Z = "object", _ = {
102
+ id: {
103
+ description: "The unique identifier for a combo list",
104
+ type: "string"
105
+ },
106
+ type: {
107
+ description: "The type string of number combo list component",
108
+ type: "string",
109
+ default: "combo-list"
110
+ },
111
+ appearance: {
112
+ description: "",
113
+ type: "object",
114
+ properties: {
115
+ class: {
116
+ type: "string"
117
+ },
118
+ style: {
119
+ type: "string"
120
+ }
121
+ },
122
+ default: {}
123
+ },
124
+ binding: {
125
+ description: "",
126
+ type: "object",
127
+ default: {}
128
+ },
129
+ editable: {
130
+ description: "",
131
+ type: "boolean",
132
+ default: !0
133
+ },
134
+ enableLinkLabel: {
135
+ description: "",
136
+ type: "boolean",
137
+ default: !1
138
+ },
139
+ label: {
140
+ description: "",
141
+ type: "string",
142
+ default: ""
143
+ },
144
+ lableWidth: {
145
+ description: "",
146
+ type: "number"
147
+ },
148
+ placeholder: {
149
+ description: "",
150
+ type: "string",
151
+ default: ""
152
+ },
153
+ valueField: {
154
+ description: "",
155
+ type: "string",
156
+ default: "id"
157
+ },
158
+ titleField: {
159
+ description: "",
160
+ type: "string",
161
+ default: "name"
162
+ },
163
+ textField: {
164
+ description: "",
165
+ type: "string",
166
+ default: "name"
167
+ },
168
+ data: {
169
+ description: "",
170
+ type: "array"
171
+ },
172
+ readonly: {
173
+ description: "",
174
+ type: "boolean",
175
+ default: !1
176
+ },
177
+ required: {
178
+ description: "",
179
+ type: "boolean",
180
+ default: !1
181
+ },
182
+ tabindex: {
183
+ description: "",
184
+ type: "number",
185
+ default: -1
186
+ },
187
+ textAlign: {
188
+ description: "",
189
+ type: "string",
190
+ enum: [
191
+ "left",
192
+ "middle",
193
+ "right"
194
+ ],
195
+ default: "left"
196
+ },
197
+ visible: {
198
+ description: "",
199
+ type: "boolean",
200
+ default: !0
201
+ },
202
+ onBlur: {
203
+ description: "",
204
+ type: "string",
205
+ default: ""
206
+ },
207
+ onClickLinkLabel: {
208
+ description: "",
209
+ type: "sting",
210
+ default: ""
211
+ }
212
+ }, K = [
213
+ "id",
214
+ "type"
215
+ ], ee = {
216
+ $schema: J,
217
+ $id: Q,
218
+ title: X,
219
+ description: Y,
220
+ type: Z,
221
+ properties: _,
222
+ required: K
223
+ };
224
+ function te(e, l, d) {
225
+ return l;
226
+ }
227
+ var ae = /* @__PURE__ */ ((e) => (e.Text = "text", e.Tag = "tag", e))(ae || {}), ne = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.auto = "auto", e))(ne || {});
228
+ const B = {
7
229
  /**
8
230
  * 组件标识
9
231
  */
@@ -103,10 +325,6 @@ const M = {
103
325
  * 默认为`false`
104
326
  */
105
327
  readonly: { type: Boolean, default: !1 },
106
- /**
107
- * 远端数据源信息
108
- */
109
- remote: { type: Object, default: null },
110
328
  /**
111
329
  * 可选,是否支持远端过滤
112
330
  * 默认`false`
@@ -152,9 +370,15 @@ const M = {
152
370
  /**
153
371
  * 作为内嵌编辑器被创建后默认选中文本
154
372
  */
155
- selectOnCreated: { type: Boolean, default: !1 }
156
- }, N = {
157
- dataSource: { type: Array, default: [] },
373
+ selectOnCreated: { type: Boolean, default: !1 },
374
+ /**
375
+ * 树表展示格式化函数
376
+ */
377
+ formatter: { type: Function, default: null },
378
+ editorParams: { type: Object },
379
+ repositoryToken: { type: Symbol, default: null }
380
+ }, le = W(B, ee, G, te), re = {
381
+ data: { type: Array, default: [] },
158
382
  enableSearch: { type: Boolean, default: !1 },
159
383
  idField: { type: String, default: "id" },
160
384
  multiSelect: { default: !1, type: Boolean },
@@ -164,149 +388,158 @@ const M = {
164
388
  titleField: { type: String, default: "name" },
165
389
  width: { type: Number },
166
390
  height: { type: Number },
167
- valueField: { type: String, default: "id" }
168
- }, E = /* @__PURE__ */ T({
391
+ valueField: { type: String, default: "id" },
392
+ formatter: { type: Function },
393
+ maxHeight: { type: Number, default: 350 },
394
+ repositoryToken: { type: Symbol, default: null },
395
+ editorParams: { type: Object }
396
+ }, ie = /* @__PURE__ */ O({
169
397
  name: "FComboTreeContainer",
170
- props: N,
398
+ props: re,
171
399
  emits: ["selectionChange"],
172
- setup(e, o) {
173
- const r = l(e.dataSource), u = l([]), m = l(e.separator), y = l(e.width), s = l(e.height), h = l(String(e.selectedValues).split(m.value)), v = F(() => [{
400
+ setup(e, l) {
401
+ const d = m(e.data), i = m([]), u = m(e.separator), s = m(e.width), c = m(e.height), y = m(e.maxHeight), g = m(String(e.selectedValues).split(u.value));
402
+ let n = null;
403
+ e.repositoryToken && (n = P(e.repositoryToken));
404
+ const t = v(() => [{
174
405
  field: e.textField,
175
406
  title: "",
176
- dataType: "string"
177
- }]), S = F(() => {
178
- const t = {};
179
- return y.value !== void 0 && (t.width = `${y.value}px`), s.value !== void 0 && (t.height = `${s.value}px`), t;
407
+ dataType: "string",
408
+ formatter: e.formatter
409
+ }]), a = v(() => {
410
+ const o = {};
411
+ return s.value !== void 0 && (o.width = `${s.value}px`), c.value !== void 0 && (o.height = `${c.value}px`), y.value !== void 0 && y.value > 0 && (o.maxHeight = `${y.value}px`, o.overflow = "auto"), o;
180
412
  });
181
- function c(t) {
182
- u.value = t.map((a) => Object.assign({}, a)), h.value = t.map((a) => a[e.idField]), o.emit("selectionChange", u.value);
413
+ function r(o) {
414
+ i.value = o.map((f) => Object.assign({}, f)), g.value = o.map((f) => f[e.idField]), l.emit("selectionChange", i.value);
183
415
  }
184
- return () => C("div", {
416
+ return M(() => {
417
+ n && n.getData(e.editorParams).then((o) => {
418
+ d.value = o;
419
+ });
420
+ }), () => S("div", {
185
421
  class: "f-combo-tree-container",
186
- style: S.value
187
- }, [C(O, {
188
- data: r.value,
422
+ style: a.value
423
+ }, [S(N, {
424
+ data: d.value,
189
425
  idField: e.idField,
190
- columns: v.value,
191
- "selection-values": h.value,
192
- onSelectionChange: c
426
+ columns: t.value,
427
+ "selection-values": g.value,
428
+ onSelectionChange: r
193
429
  }, null)]);
194
430
  }
195
431
  });
196
- function A(e) {
197
- const o = l(""), r = l(e.modelValue), u = l(e.data || []), m = l(e.editable);
198
- function y(t) {
199
- const a = String(t).split(e.separator).map((d) => [d, !0]), n = new Map(a);
200
- return u.value.filter((d) => n.has(String(d[e.valueField])));
201
- }
432
+ function oe(e) {
433
+ const l = m(""), d = m(e.modelValue), i = m(e.data || []), u = m(e.editable);
202
434
  function s(t) {
203
- const a = y(t).map((n) => n[e.textField]).join(e.separator);
204
- o.value = m.value ? a || t : a;
435
+ const a = String(t).split(e.separator).map((o) => [o, !0]), r = new Map(a);
436
+ return i.value.filter((o) => r.has(String(o[e.valueField])));
437
+ }
438
+ function c(t) {
439
+ const a = s(t).map((r) => r[e.textField]).join(e.separator);
440
+ l.value = u.value ? a || t : a;
205
441
  }
206
- function h(t) {
207
- const a = t.split(e.separator).map((d) => [d, !0]), n = new Map(a);
208
- return u.value.filter((d) => n.has(d[e.textField]));
442
+ function y(t) {
443
+ const a = t.split(e.separator).map((o) => [o, !0]), r = new Map(a);
444
+ return i.value.filter((o) => r.has(o[e.textField]));
209
445
  }
210
- function v(t) {
446
+ function g(t) {
211
447
  const a = {};
212
448
  return a[e.idField] = t, a[e.textField] = t, [a];
213
449
  }
214
- function S(t) {
215
- let a = h(t);
216
- const n = a && a.length > 0;
217
- return m.value && !n && (a = v(t)), a;
450
+ function n(t) {
451
+ let a = y(t);
452
+ const r = a && a.length > 0;
453
+ return u.value && !r && (a = g(t)), a;
218
454
  }
219
- function c() {
220
- const { url: t, method: a = "GET", headers: n = {}, body: d = null } = e.remote;
221
- fetch(t, { method: a, headers: n, body: d }).then((f) => {
222
- if (f.status === 200)
223
- return f.json();
224
- throw new Error(f.statusText);
225
- }).then((f) => {
226
- u.value = f;
227
- }).catch((f) => {
228
- console.error(f);
229
- });
230
- }
231
- return e.remote && c(), b(() => e.data, () => {
232
- u.value = e.data;
233
- }), b([u], ([t]) => {
455
+ return h(() => e.data, () => {
456
+ i.value = e.data;
457
+ }), h([i], ([t]) => {
234
458
  if (e.modelValue) {
235
- const a = t.find((n) => n[e.valueField] === e.modelValue);
236
- a && (o.value = a[e.textField]);
459
+ const a = t.find((r) => r[e.valueField] === e.modelValue);
460
+ a && (l.value = a[e.textField]);
237
461
  }
238
- }), b(() => e.modelValue, (t) => {
239
- r.value = t, s(t);
240
- }), s(e.modelValue), { dataSource: u, displayText: o, editable: m, modelValue: r, getItemsByDisplayText: h, getItemsByValue: y, getSelectedItemsByDisplayText: S };
462
+ }), h(() => e.modelValue, (t) => {
463
+ d.value = t, c(t);
464
+ }), c(e.modelValue), { dataSource: i, displayText: l, editable: u, modelValue: d, getItemsByDisplayText: y, getItemsByValue: s, getSelectedItemsByDisplayText: n };
241
465
  }
242
- const H = /* @__PURE__ */ T({
466
+ const C = /* @__PURE__ */ O({
243
467
  name: "FComboTree",
244
- props: M,
468
+ props: B,
245
469
  emits: ["clear", "update:modelValue", "change"],
246
- setup(e, o) {
470
+ setup(e, l) {
247
471
  return () => {
248
- const r = l(), u = l(e.disabled), m = l(e.enableClear), y = l(e.enableSearch), s = l(e.readonly), {
249
- dataSource: h,
250
- displayText: v,
251
- editable: S,
252
- modelValue: c,
253
- getSelectedItemsByDisplayText: t
254
- } = A(e), a = F(() => e.multiSelect);
255
- F(() => r.value ? r.value.elementRef.getBoundingClientRect().width : 0);
256
- function n() {
257
- !a.value && r.value && r.value.hidePopup();
472
+ const d = m(), i = m(e.disabled), u = m(e.enableClear), s = m(e.enableSearch), c = m(e.readonly), {
473
+ dataSource: y,
474
+ displayText: g,
475
+ editable: n,
476
+ modelValue: t,
477
+ getSelectedItemsByDisplayText: a
478
+ } = oe(e), r = v(() => e.multiSelect);
479
+ v(() => d.value ? d.value.elementRef.getBoundingClientRect().width : 0);
480
+ function o() {
481
+ !r.value && d.value && d.value.hidePopup();
258
482
  }
259
- function d(i) {
260
- v.value = i.map((g) => g[e.textField]).join(e.separator), c.value = i.map((g) => g[e.valueField]).join(e.separator), o.emit("update:modelValue", c.value), o.emit("change", i, c.value), n();
483
+ function f(p) {
484
+ g.value = p.map((b) => b[e.textField]).join(e.separator), t.value = p.map((b) => b[e.valueField]).join(e.separator), l.emit("update:modelValue", t.value), l.emit("change", p, t.value), o();
261
485
  }
262
- function x(i) {
263
- c.value = "", o.emit("update:modelValue", ""), o.emit("clear");
486
+ function x(p) {
487
+ t.value = "", l.emit("update:modelValue", ""), l.emit("clear");
264
488
  }
265
- function f(i) {
266
- const g = t(i);
267
- d(g);
489
+ function T(p) {
490
+ const b = a(p);
491
+ f(b);
268
492
  }
269
- return b([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([i, g, B, V, w]) => {
270
- u.value = i, S.value = g, m.value = B, y.value = V, s.value = w;
271
- }), C(I, {
272
- ref: r,
493
+ return h([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([p, b, F, j, w]) => {
494
+ i.value = p, n.value = b, u.value = F, s.value = j, c.value = w;
495
+ }), S(k, {
496
+ ref: d,
273
497
  id: e.id,
274
- disable: u.value,
275
- readonly: s.value,
498
+ disable: i.value,
499
+ readonly: c.value,
276
500
  forcePlaceholder: e.forcePlaceholder,
277
- editable: S.value,
501
+ editable: n.value,
278
502
  buttonContent: e.dropDownIcon,
279
503
  placeholder: e.placeholder,
280
- enableClear: m.value,
504
+ enableClear: u.value,
281
505
  maxLength: e.maxLength,
282
506
  tabIndex: e.tabIndex,
283
507
  enableTitle: e.enableTitle,
284
508
  multiSelect: e.multiSelect,
285
509
  inputType: e.multiSelect ? "tag" : "text",
286
- modelValue: v.value,
287
- "onUpdate:modelValue": (i) => v.value = i,
510
+ modelValue: g.value,
511
+ "onUpdate:modelValue": (p) => g.value = p,
288
512
  onClear: x,
289
- onChange: f,
513
+ onChange: T,
290
514
  focusOnCreated: e.focusOnCreated,
291
515
  selectOnCreated: e.selectOnCreated
292
516
  }, {
293
- default: () => [C(E, {
517
+ default: () => [S(ie, {
518
+ maxHeight: e.maxHeight,
294
519
  idField: e.idField,
295
520
  valueField: e.valueField,
296
521
  textField: e.textField,
297
522
  titleField: e.titleField,
298
- dataSource: h.value,
299
- selectedValues: c.value,
300
- onSelectionChange: d
523
+ data: y.value,
524
+ selectedValues: t.value,
525
+ onSelectionChange: f,
526
+ formatter: e.formatter,
527
+ editorParams: e.editorParams,
528
+ repositoryToken: e.repositoryToken
301
529
  }, null)]
302
530
  });
303
531
  };
304
532
  }
305
- }), q = D(H);
533
+ });
534
+ C.register = (e, l, d, i) => {
535
+ e["combo-tree"] = C, l["combo-tree"] = le;
536
+ };
537
+ const me = D(C);
306
538
  export {
307
- H as FComboTree,
308
- P as Placement,
309
- j as ViewType,
310
- M as comboTreeProps,
311
- q as default
539
+ C as FComboTree,
540
+ ne as Placement,
541
+ ae as ViewType,
542
+ B as comboTreeProps,
543
+ me as default,
544
+ le as propsResolver
312
545
  };
@@ -1 +1 @@
1
- (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@farris/ui-vue/components/button-edit"),require("@farris/ui-vue/components/tree-view"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","@farris/ui-vue/components/button-edit","@farris/ui-vue/components/tree-view","@farris/ui-vue/components/common"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["combo-tree"]={},n.Vue,n.FButtonEdit,n.FTreeView,n.common))})(this,function(n,t,B,w,O){"use strict";var C=(e=>(e.Text="text",e.Tag="tag",e))(C||{}),F=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(F||{});const T={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{type:Boolean,default:!1},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!0},fitEditor:{type:Boolean,default:!1},forcePlaceholder:{type:Boolean,default:!1},hidePanelOnClear:{type:Boolean,default:!0},idField:{type:String,default:"id"},mapFields:{type:Object},maxHeight:{type:Number,default:350},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{type:Boolean,default:!1},remote:{type:Object,default:null},remoteSearch:{type:Boolean,default:!1},separator:{type:String,default:","},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},valueField:{type:String,default:"id"},viewType:{type:String,default:"text"},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},I={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},height:{type:Number},valueField:{type:String,default:"id"}},p=t.defineComponent({name:"FComboTreeContainer",props:I,emits:["selectionChange"],setup(e,r){const c=t.ref(e.dataSource),d=t.ref([]),s=t.ref(e.separator),h=t.ref(e.width),y=t.ref(e.height),b=t.ref(String(e.selectedValues).split(s.value)),S=t.computed(()=>[{field:e.textField,title:"",dataType:"string"}]),v=t.computed(()=>{const a={};return h.value!==void 0&&(a.width=`${h.value}px`),y.value!==void 0&&(a.height=`${y.value}px`),a});function f(a){d.value=a.map(l=>Object.assign({},l)),b.value=a.map(l=>l[e.idField]),r.emit("selectionChange",d.value)}return()=>t.createVNode("div",{class:"f-combo-tree-container",style:v.value},[t.createVNode(w,{data:c.value,idField:e.idField,columns:S.value,"selection-values":b.value,onSelectionChange:f},null)])}});function P(e){const r=t.ref(""),c=t.ref(e.modelValue),d=t.ref(e.data||[]),s=t.ref(e.editable);function h(a){const l=String(a).split(e.separator).map(u=>[u,!0]),i=new Map(l);return d.value.filter(u=>i.has(String(u[e.valueField])))}function y(a){const l=h(a).map(i=>i[e.textField]).join(e.separator);r.value=s.value?l||a:l}function b(a){const l=a.split(e.separator).map(u=>[u,!0]),i=new Map(l);return d.value.filter(u=>i.has(u[e.textField]))}function S(a){const l={};return l[e.idField]=a,l[e.textField]=a,[l]}function v(a){let l=b(a);const i=l&&l.length>0;return s.value&&!i&&(l=S(a)),l}function f(){const{url:a,method:l="GET",headers:i={},body:u=null}=e.remote;fetch(a,{method:l,headers:i,body:u}).then(m=>{if(m.status===200)return m.json();throw new Error(m.statusText)}).then(m=>{d.value=m}).catch(m=>{console.error(m)})}return e.remote&&f(),t.watch(()=>e.data,()=>{d.value=e.data}),t.watch([d],([a])=>{if(e.modelValue){const l=a.find(i=>i[e.valueField]===e.modelValue);l&&(r.value=l[e.textField])}}),t.watch(()=>e.modelValue,a=>{c.value=a,y(a)}),y(e.modelValue),{dataSource:d,displayText:r,editable:s,modelValue:c,getItemsByDisplayText:b,getItemsByValue:h,getSelectedItemsByDisplayText:v}}const x=t.defineComponent({name:"FComboTree",props:T,emits:["clear","update:modelValue","change"],setup(e,r){return()=>{const c=t.ref(),d=t.ref(e.disabled),s=t.ref(e.enableClear),h=t.ref(e.enableSearch),y=t.ref(e.readonly),{dataSource:b,displayText:S,editable:v,modelValue:f,getSelectedItemsByDisplayText:a}=P(e),l=t.computed(()=>e.multiSelect);t.computed(()=>c.value?c.value.elementRef.getBoundingClientRect().width:0);function i(){!l.value&&c.value&&c.value.hidePopup()}function u(o){S.value=o.map(g=>g[e.textField]).join(e.separator),f.value=o.map(g=>g[e.valueField]).join(e.separator),r.emit("update:modelValue",f.value),r.emit("change",o,f.value),i()}function V(o){f.value="",r.emit("update:modelValue",""),r.emit("clear")}function m(o){const g=a(o);u(g)}return t.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([o,g,D,N,M])=>{d.value=o,v.value=g,s.value=D,h.value=N,y.value=M}),t.createVNode(B,{ref:c,id:e.id,disable:d.value,readonly:y.value,forcePlaceholder:e.forcePlaceholder,editable:v.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:s.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:S.value,"onUpdate:modelValue":o=>S.value=o,onClear:V,onChange:m,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated},{default:()=>[t.createVNode(p,{idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:b.value,selectedValues:f.value,onSelectionChange:u},null)]})}}}),j=O.withInstall(x);n.FComboTree=x,n.Placement=F,n.ViewType=C,n.comboTreeProps=T,n.default=j,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(y,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@farris/ui-vue/components/button-edit"),require("lodash-es"),require("@farris/ui-vue/components/tree-view"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","@farris/ui-vue/components/button-edit","lodash-es","@farris/ui-vue/components/tree-view","@farris/ui-vue/components/common"],r):(y=typeof globalThis<"u"?globalThis:y||self,r(y["combo-tree"]={},y.Vue,y.FButtonEdit,y.LodashES,y.FTreeView,y.common))})(this,function(y,r,w,j,P,M){"use strict";const N={},k={};function T(e){const{properties:l,title:s}=e,o=Object.keys(l).reduce((d,c)=>(d[c]=l[c].type==="object"&&l[c].properties?T(l[c]):j.cloneDeep(l[c].default),d),{});return o.id=`${s}-${Date.now()}`,o}function E(e,l){const s=T(l);return Object.keys(e).reduce((o,d)=>(o[d]=e[d],o),s),s}function I(e,l){return Object.keys(e).filter(o=>e[o]!=null).reduce((o,d)=>{if(l.has(d)){const c=l.get(d);if(typeof c=="string")o[c]=e[d];else{const f=c(d,e[d],e);Object.assign(o,f)}}else o[d]=e[d];return o},{})}function D(e,l,s=new Map){const o=E(e,l);return I(o,s)}function $(e={}){function l(a,t,n,i){if(typeof n=="number")return i[a].length===n;if(typeof n=="object"){const u=Object.keys(n)[0],m=n[u];if(u==="not")return Number(i[a].length)!==Number(m);if(u==="moreThan")return Number(i[a].length)>=Number(m);if(u==="lessThan")return Number(i[a].length)<=Number(m)}return!1}function s(a,t,n,i){return i[a]&&i[a].propertyValue&&String(i[a].propertyValue.value)===String(n)}const o=new Map([["length",l],["getProperty",s]]);Object.keys(e).reduce((a,t)=>(a.set(t,e[t]),a),o);function d(a,t){const n=a;return typeof t=="number"?[{target:n,operator:"length",param:null,value:Number(t)}]:typeof t=="boolean"?[{target:n,operator:"getProperty",param:a,value:!!t}]:typeof t=="object"?Object.keys(t).map(i=>{if(i==="length")return{target:n,operator:"length",param:null,value:t[i]};const u=i,m=t[i];return{target:n,operator:"getProperty",param:u,value:m}}):[]}function c(a){return Object.keys(a).reduce((n,i)=>{const u=d(i,a[i]);return n.push(...u),n},[])}function f(a,t){if(o.has(a.operator)){const n=o.get(a.operator);return n&&n(a.target,a.param,a.value,t)||!1}return!1}function p(a,t){return c(a).reduce((u,m)=>u&&f(m,t),!0)}function b(a,t){const n=Object.keys(a),i=n.includes("allOf"),u=n.includes("anyOf"),m=i||u,g=(m?a[m?i?"allOf":"anyOf":"allOf"]:[a]).map(F=>p(F,t));return i?!g.includes(!1):g.includes(!0)}return{parseValueSchema:b}}const R={},q={};$();function H(e,l,s=new Map,o=(f,p,b)=>p,d={},c=f=>f){return N[l.title]=l,k[l.title]=o,R[l.title]=d,q[l.title]=c,(f={})=>{const p=D(f,l,s),b=Object.keys(e).reduce((a,t)=>(a[t]=e[t].default,a),{});return Object.assign(b,p)}}function L(e,l){return{customClass:l.class,customStyle:l.style}}const A=new Map([["appearance",L]]),_={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},data:{description:"",type:"array"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};function U(e,l,s){return l}var x=(e=>(e.Text="text",e.Tag="tag",e))(x||{}),V=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(V||{});const v={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{type:Boolean,default:!1},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!0},fitEditor:{type:Boolean,default:!1},forcePlaceholder:{type:Boolean,default:!1},hidePanelOnClear:{type:Boolean,default:!0},idField:{type:String,default:"id"},mapFields:{type:Object},maxHeight:{type:Number,default:350},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{type:Boolean,default:!1},remoteSearch:{type:Boolean,default:!1},separator:{type:String,default:","},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},valueField:{type:String,default:"id"},viewType:{type:String,default:"text"},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},formatter:{type:Function,default:null},editorParams:{type:Object},repositoryToken:{type:Symbol,default:null}},O=H(v,_,A,U),W={data:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},height:{type:Number},valueField:{type:String,default:"id"},formatter:{type:Function},maxHeight:{type:Number,default:350},repositoryToken:{type:Symbol,default:null},editorParams:{type:Object}},z=r.defineComponent({name:"FComboTreeContainer",props:W,emits:["selectionChange"],setup(e,l){const s=r.ref(e.data),o=r.ref([]),d=r.ref(e.separator),c=r.ref(e.width),f=r.ref(e.height),p=r.ref(e.maxHeight),b=r.ref(String(e.selectedValues).split(d.value));let a=null;e.repositoryToken&&(a=r.inject(e.repositoryToken));const t=r.computed(()=>[{field:e.textField,title:"",dataType:"string",formatter:e.formatter}]),n=r.computed(()=>{const u={};return c.value!==void 0&&(u.width=`${c.value}px`),f.value!==void 0&&(u.height=`${f.value}px`),p.value!==void 0&&p.value>0&&(u.maxHeight=`${p.value}px`,u.overflow="auto"),u});function i(u){o.value=u.map(m=>Object.assign({},m)),b.value=u.map(m=>m[e.idField]),l.emit("selectionChange",o.value)}return r.onMounted(()=>{a&&a.getData(e.editorParams).then(u=>{s.value=u})}),()=>r.createVNode("div",{class:"f-combo-tree-container",style:n.value},[r.createVNode(P,{data:s.value,idField:e.idField,columns:t.value,"selection-values":b.value,onSelectionChange:i},null)])}});function G(e){const l=r.ref(""),s=r.ref(e.modelValue),o=r.ref(e.data||[]),d=r.ref(e.editable);function c(t){const n=String(t).split(e.separator).map(u=>[u,!0]),i=new Map(n);return o.value.filter(u=>i.has(String(u[e.valueField])))}function f(t){const n=c(t).map(i=>i[e.textField]).join(e.separator);l.value=d.value?n||t:n}function p(t){const n=t.split(e.separator).map(u=>[u,!0]),i=new Map(n);return o.value.filter(u=>i.has(u[e.textField]))}function b(t){const n={};return n[e.idField]=t,n[e.textField]=t,[n]}function a(t){let n=p(t);const i=n&&n.length>0;return d.value&&!i&&(n=b(t)),n}return r.watch(()=>e.data,()=>{o.value=e.data}),r.watch([o],([t])=>{if(e.modelValue){const n=t.find(i=>i[e.valueField]===e.modelValue);n&&(l.value=n[e.textField])}}),r.watch(()=>e.modelValue,t=>{s.value=t,f(t)}),f(e.modelValue),{dataSource:o,displayText:l,editable:d,modelValue:s,getItemsByDisplayText:p,getItemsByValue:c,getSelectedItemsByDisplayText:a}}const S=r.defineComponent({name:"FComboTree",props:v,emits:["clear","update:modelValue","change"],setup(e,l){return()=>{const s=r.ref(),o=r.ref(e.disabled),d=r.ref(e.enableClear),c=r.ref(e.enableSearch),f=r.ref(e.readonly),{dataSource:p,displayText:b,editable:a,modelValue:t,getSelectedItemsByDisplayText:n}=G(e),i=r.computed(()=>e.multiSelect);r.computed(()=>s.value?s.value.elementRef.getBoundingClientRect().width:0);function u(){!i.value&&s.value&&s.value.hidePopup()}function m(g){b.value=g.map(h=>h[e.textField]).join(e.separator),t.value=g.map(h=>h[e.valueField]).join(e.separator),l.emit("update:modelValue",t.value),l.emit("change",g,t.value),u()}function C(g){t.value="",l.emit("update:modelValue",""),l.emit("clear")}function B(g){const h=n(g);m(h)}return r.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([g,h,F,Q,X])=>{o.value=g,a.value=h,d.value=F,c.value=Q,f.value=X}),r.createVNode(w,{ref:s,id:e.id,disable:o.value,readonly:f.value,forcePlaceholder:e.forcePlaceholder,editable:a.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:d.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:b.value,"onUpdate:modelValue":g=>b.value=g,onClear:C,onChange:B,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated},{default:()=>[r.createVNode(z,{maxHeight:e.maxHeight,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,data:p.value,selectedValues:t.value,onSelectionChange:m,formatter:e.formatter,editorParams:e.editorParams,repositoryToken:e.repositoryToken},null)]})}}});S.register=(e,l,s,o)=>{e["combo-tree"]=S,l["combo-tree"]=O};const J=M.withInstall(S);y.FComboTree=S,y.Placement=V,y.ViewType=x,y.comboTreeProps=v,y.default=J,y.propsResolver=O,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -3,6 +3,6 @@
3
3
  "version": "1.1.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
- "style": "style.css",
6
+ "style": "index.css",
7
7
  "types": "../types/combo-tree/index.d.ts"
8
8
  }
@@ -1833,7 +1833,7 @@ const un = (t) => {
1833
1833
  }, t;
1834
1834
  }, sn = Symbol("checkboxGroupContext");
1835
1835
  function cn(t, e, n, r) {
1836
- const a = m(() => n == null ? void 0 : n.name), i = m(() => t.disabled || (n == null ? void 0 : n.disabled)), o = m(() => (n == null ? void 0 : n.mode) === "tag"), u = m(() => (n == null ? void 0 : n.mode) === "button"), c = m(() => !o.value && !u.value), f = m(() => (n == null ? void 0 : n.size) === "small"), w = m(() => (n == null ? void 0 : n.size) === "large"), x = m(() => (n == null ? void 0 : n.size) === "middle" || (n == null ? void 0 : n.size) !== "small" && (n == null ? void 0 : n.size) !== "large"), g = m(() => n ? n.modelValue === t.value || n.modelValue.includes(t.value) : t.checked), M = m(() => ({
1836
+ const a = m(() => n == null ? void 0 : n.name), i = m(() => t.disabled || (n == null ? void 0 : n.disabled)), o = m(() => (n == null ? void 0 : n.mode) === "tag"), u = m(() => (n == null ? void 0 : n.mode) === "button"), c = m(() => !o.value && !u.value), f = m(() => (n == null ? void 0 : n.size) === "small"), w = m(() => (n == null ? void 0 : n.size) === "large"), x = m(() => (n == null ? void 0 : n.size) === "middle" || (n == null ? void 0 : n.size) !== "small" && (n == null ? void 0 : n.size) !== "large"), g = m(() => n ? n.modelValue === t.value || n.modelValue.includes(t.value) : t.checked || t.modelValue), M = m(() => ({
1837
1837
  btn: !0,
1838
1838
  "f-radio-button": !0,
1839
1839
  "btn-sm": f.value,
@@ -1869,7 +1869,7 @@ function cn(t, e, n, r) {
1869
1869
  r.emit("update:modelValue", k), r.emit("changeValue", k);
1870
1870
  }
1871
1871
  else
1872
- e.emit("update:checked", !g.value), e.emit("changeValue", !g.value), e.emit("change", { originalEvent: b, checked: !g.value });
1872
+ e.emit("update:checked", !g.value), e.emit("update:modelValue", !g.value), e.emit("changeValue", !g.value), e.emit("change", { originalEvent: b, checked: !g.value });
1873
1873
  }
1874
1874
  };
1875
1875
  }