@knime/jsonforms 1.14.3 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/AnyOfTwinlist-BmHETHvW.js +28 -0
  3. package/dist/{Button-BxuGKyL5.js → Button-B9RSLVI2.js} +9 -8
  4. package/dist/CheckboxControl-q88fZSZD.js +58 -0
  5. package/dist/Checkboxes-Bofcg7tl.js +120 -0
  6. package/dist/CheckboxesControl-DY0R1PDD.js +47 -0
  7. package/dist/{ComboBoxControl-Dk02x7sN.js → ComboBoxControl-2r1FWcy-.js} +238 -172
  8. package/dist/DateControl-vnkppn62.js +38 -0
  9. package/dist/DateTimeControl-MkF9G3Xz.js +53 -0
  10. package/dist/DateTimeFormatInput-Ds2VLXw1.js +426 -0
  11. package/dist/DateTimeFormatPickerControl-D3OjZCj7.js +47 -0
  12. package/dist/DateTimeFormatPickerWithTypeControl-DDto-oJk.js +85 -0
  13. package/dist/DateTimeInput-DcwhvMD2.js +11321 -0
  14. package/dist/Dropdown-D49sEHBa.js +663 -0
  15. package/dist/DropdownControl-aeEqC-Yg.js +46 -0
  16. package/dist/HorizontalLayout-D0toQmVl.js +39 -0
  17. package/dist/{InputField-BYxW_-G3.js → InputField-C_aZPs-f.js} +48 -36
  18. package/dist/IntegerControl-DAwniqjW.js +33 -0
  19. package/dist/IntervalControl-Bkuhg0Ga.js +647 -0
  20. package/dist/LoadingDropdown-B9jHjdWV.js +50 -0
  21. package/dist/LoadingIcon-RPBUjTO3.js +23 -0
  22. package/dist/ManualTwinlistControl-DGW-7a2Q.js +90 -0
  23. package/dist/MultiSelectListBoxControl-BYHuC9jL.js +48 -0
  24. package/dist/MultimodeTwinlistControl-oIvgI_FP.js +486 -0
  25. package/dist/{MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_37fe7036_lang-DGKMWtLi.js → MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_bd2eaa56_lang-pnMOUiIt.js} +1 -1
  26. package/dist/{MultiselectListBox-CHvGxAhY.js → MultiselectListBox-CfdPbcn1.js} +105 -86
  27. package/dist/NameFilter-BV68t_P5.js +37 -0
  28. package/dist/NumberControl-Dm01CJW9.js +33 -0
  29. package/dist/NumberControlBase-CN5eTKEm.js +58 -0
  30. package/dist/{NumberInput-DJ38AGiR.js → NumberInput-DWTImcA_.js} +72 -54
  31. package/dist/OneOfDropdown-DuXXP0Qn.js +50 -0
  32. package/dist/RadioControl-X6HLs9F1.js +36 -0
  33. package/dist/RadioControlBase-BGUHTIUl.js +111 -0
  34. package/dist/{RichTextControl-CXY1ULxR.js → RichTextControl-B1mJMs1e.js} +5462 -4668
  35. package/dist/SectionHeading-B6JkPyMh.js +31 -0
  36. package/dist/SectionHeading.vue_vue_type_style_index_0_scoped_f06e9b7d_lang-B5ALSUVO.js +15603 -0
  37. package/dist/SectionLayout-7pXn4OHo.js +61 -0
  38. package/dist/SettingsSubPanel-DToMRoLu.js +48 -0
  39. package/dist/SettingsSubPanelLayout-DnZnghFr.js +83 -0
  40. package/dist/SimpleButtonControl-DOSd92Kq.js +84 -0
  41. package/dist/SimpleTwinlistControl-RBfQTk47.js +31 -0
  42. package/dist/SingleSelectControl-C-GLQD-a.js +73 -0
  43. package/dist/SingleSelectListBoxControl-CDg_1QUT.js +260 -0
  44. package/dist/SortListControl-CWuxKIEb.js +445 -0
  45. package/dist/StyledListItem-NqAG7jSw.js +81 -0
  46. package/dist/TextAreaControl-Dt5ZGrae.js +122 -0
  47. package/dist/TextControl-w9vrCC1T.js +54 -0
  48. package/dist/TimeControl-DiNQSV4K.js +46 -0
  49. package/dist/TwinlistControlBase-CMFEecdr.js +47 -0
  50. package/dist/TwinlistLoadingInfo-Cy6HY-97.js +1080 -0
  51. package/dist/TypedStringFilter-FUF8sqOm.js +32 -0
  52. package/dist/ValueSwitch-Ozmr1YfK.js +162 -0
  53. package/dist/ValueSwitchControl-CdFlHo-2.js +33 -0
  54. package/dist/VerticalLayout-DY8gbasK.js +39 -0
  55. package/dist/VerticalLayoutBase-CpN-KONq.js +32 -0
  56. package/dist/ZonedDateTimeControl-Cg3dAfq5.js +79 -0
  57. package/dist/{_baseEach-cjHvi5iT.js → _baseEach-CWap1NWh.js} +4 -4
  58. package/dist/{_baseIteratee-CIxt0KWU.js → _baseIteratee-D0MXvnuf.js} +27 -27
  59. package/dist/{_getTag-sLUyzSDj.js → _getTag-BvpAzjaz.js} +10 -10
  60. package/dist/{arrow-dropdown-DdgjzLAO.js → arrow-dropdown-eS-nVNCv.js} +9 -3
  61. package/dist/{arrow-next-CIOU5o42.js → arrow-next-BmOStWql.js} +9 -3
  62. package/dist/{close-BuY4mhXV.js → close-0dYG2oDA.js} +9 -3
  63. package/dist/floating-ui.vue-CDo9Kas1.js +1055 -0
  64. package/dist/{hotkeys-kwHHtFKz.js → hotkeys-rxnt4egK.js} +1 -1
  65. package/dist/index-CpKfM262.js +376 -0
  66. package/dist/knime-jsonforms.css +1 -1
  67. package/dist/knime-jsonforms.js +133 -110
  68. package/dist/{localTimeUtils-Dv-1R88J.js → localTimeUtils-CfchSrLG.js} +179 -181
  69. package/dist/magic-string.es-BQ9KnLz-.js +659 -0
  70. package/dist/navigator-e30QQMkl.js +4 -0
  71. package/dist/popper-LGjf7Wza.js +905 -0
  72. package/dist/reload-57Xc2t-6.js +23 -0
  73. package/dist/src/higherOrderComponents/control/LabeledControl.vue.d.ts +26 -22
  74. package/dist/src/higherOrderComponents/control/errorMessage/ErrorLine.vue.d.ts +3 -4
  75. package/dist/src/higherOrderComponents/control/errorMessage/ErrorMessages.vue.d.ts +16 -10
  76. package/dist/src/higherOrderComponents/control/errorMessage/withErrorMessage.d.ts +1 -1
  77. package/dist/src/higherOrderComponents/control/util.d.ts +7 -33
  78. package/dist/src/higherOrderComponents/layout/util.d.ts +1 -17
  79. package/dist/src/layoutComponents/Form.vue.d.ts +12 -4
  80. package/dist/src/layoutComponents/HorizontalLayout.vue.d.ts +1 -1
  81. package/dist/src/layoutComponents/SectionLayout.vue.d.ts +13 -5
  82. package/dist/src/layoutComponents/VerticalLayout.vue.d.ts +1 -1
  83. package/dist/src/layoutComponents/VerticalLayoutBase.vue.d.ts +16 -9
  84. package/dist/src/layoutComponents/section/SectionHeading.vue.d.ts +13 -6
  85. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanel.vue.d.ts +2 -2
  86. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanelBackArrow.vue.d.ts +1 -1
  87. package/dist/src/renderers/dateTimeFormatPickerRenderer.d.ts +2 -2
  88. package/dist/src/renderers/defaultRenderers.d.ts +966 -151
  89. package/dist/src/renderers/dropdownRenderer.d.ts +1 -1
  90. package/dist/src/renderers/fallbackRenderers.d.ts +8 -8
  91. package/dist/src/renderers/horizontalLayoutRenderer.d.ts +1 -1
  92. package/dist/src/renderers/sectionLayoutRenderer.d.ts +4 -4
  93. package/dist/src/renderers/simpleButtonRenderer.d.ts +7 -89
  94. package/dist/src/renderers/sortListRenderer.d.ts +853 -20
  95. package/dist/src/renderers/textMessageRenderer.d.ts +65 -1
  96. package/dist/src/renderers/textRenderer.d.ts +1 -1
  97. package/dist/src/renderers/verticalLayoutRenderer.d.ts +2 -2
  98. package/dist/src/renderers/zonedDateTimeRenderer.d.ts +1 -1
  99. package/dist/src/uiComponents/CheckboxControl.vue.d.ts +15 -6
  100. package/dist/src/uiComponents/CheckboxesControl.vue.d.ts +2 -1
  101. package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +2 -1
  102. package/dist/src/uiComponents/DateControl.vue.d.ts +2 -1
  103. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +2 -1
  104. package/dist/src/uiComponents/DateTimeFormatPickerControl.vue.d.ts +2 -1
  105. package/dist/src/uiComponents/DateTimeFormatPickerWithTypeControl.vue.d.ts +2 -1
  106. package/dist/src/uiComponents/DropdownControl.vue.d.ts +2 -1
  107. package/dist/src/uiComponents/IntegerControl.vue.d.ts +2 -1
  108. package/dist/src/uiComponents/IntervalControl.vue.d.ts +2 -1
  109. package/dist/src/uiComponents/MultiSelectListBoxControl.vue.d.ts +2 -1
  110. package/dist/src/uiComponents/NumberControl.vue.d.ts +2 -1
  111. package/dist/src/uiComponents/NumberControlBase.vue.d.ts +5 -9
  112. package/dist/src/uiComponents/OneOfDropdown.vue.d.ts +2 -1
  113. package/dist/src/uiComponents/RadioControl.vue.d.ts +2 -1
  114. package/dist/src/uiComponents/RadioControlBase.vue.d.ts +4 -8
  115. package/dist/src/uiComponents/SimpleButtonControl.vue.d.ts +5 -129
  116. package/dist/src/uiComponents/SingleSelectControl.vue.d.ts +2 -1
  117. package/dist/src/uiComponents/SingleSelectListBoxControl.vue.d.ts +2 -1
  118. package/dist/src/uiComponents/SortListControl.vue.d.ts +845 -12
  119. package/dist/src/uiComponents/TextAreaControl.vue.d.ts +2 -1
  120. package/dist/src/uiComponents/TextControl.vue.d.ts +203 -3
  121. package/dist/src/uiComponents/TextMessageControl.vue.d.ts +2 -1
  122. package/dist/src/uiComponents/TimeControl.vue.d.ts +2 -1
  123. package/dist/src/uiComponents/ValueSwitchControl.vue.d.ts +2 -1
  124. package/dist/src/uiComponents/ZonedDateTimeControl.vue.d.ts +2 -1
  125. package/dist/src/uiComponents/composables/useProvidedState.d.ts +1 -1
  126. package/dist/src/uiComponents/loading/TwinlistLoadingInfo.vue.d.ts +1 -1
  127. package/dist/src/uiComponents/richTextControl/DialogLinkModal.vue.d.ts +3 -1
  128. package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +230 -1
  129. package/dist/src/uiComponents/twinlist/AnyOfTwinlist.vue.d.ts +2 -1
  130. package/dist/src/uiComponents/twinlist/ManualTwinlistControl.vue.d.ts +2 -1
  131. package/dist/src/uiComponents/twinlist/MultimodeTwinlistControl.vue.d.ts +8 -15
  132. package/dist/src/uiComponents/twinlist/NameFilter.vue.d.ts +2 -1
  133. package/dist/src/uiComponents/twinlist/SimpleTwinlistControl.vue.d.ts +2 -1
  134. package/dist/src/uiComponents/twinlist/TwinlistControlBase.vue.d.ts +5 -10
  135. package/dist/src/uiComponents/twinlist/TypedStringFilter.vue.d.ts +2 -1
  136. package/dist/testUtils/component.d.ts +18 -18
  137. package/dist/testing.js +8688 -8655
  138. package/dist/{toString-C_MqBj3_.js → toString-C-X8cE7K.js} +1 -1
  139. package/dist/{useBuiltinValidations-DP7OS71z.js → useBuiltinValidations-D0WuEacN.js} +1 -1
  140. package/dist/useDropdownNavigation-BfCXUheD.js +817 -0
  141. package/dist/usePossibleValues-DTVXBGRC.js +16 -0
  142. package/package.json +14 -14
  143. package/dist/AnyOfTwinlist-Cwxtyt0Q.js +0 -22
  144. package/dist/CheckboxControl-Oe97HhY3.js +0 -40
  145. package/dist/Checkboxes-DIPjJhPO.js +0 -103
  146. package/dist/CheckboxesControl-5QlPmjwv.js +0 -41
  147. package/dist/DateControl-CddCObVg.js +0 -29
  148. package/dist/DateTimeControl-DyXUJBHE.js +0 -54
  149. package/dist/DateTimeFormatInput-bO1zHUyp.js +0 -381
  150. package/dist/DateTimeFormatPickerControl-Dq25_JV2.js +0 -43
  151. package/dist/DateTimeFormatPickerWithTypeControl-DZib_x-B.js +0 -79
  152. package/dist/DateTimeInput-CEYEV8dt.js +0 -11204
  153. package/dist/Dropdown-CJj0CUA8.js +0 -604
  154. package/dist/DropdownControl-BNQKWzTT.js +0 -31
  155. package/dist/HorizontalLayout-6GwurgkR.js +0 -25
  156. package/dist/IntegerControl-DZIY-wb_.js +0 -20
  157. package/dist/IntervalControl-Yts36_MI.js +0 -546
  158. package/dist/LoadingDropdown-Dw-0WQ8x.js +0 -40
  159. package/dist/ManualTwinlistControl-C3NnAug1.js +0 -85
  160. package/dist/MultiSelectListBoxControl-3Q41S4aA.js +0 -34
  161. package/dist/MultimodeTwinlistControl-B2Jven29.js +0 -470
  162. package/dist/NameFilter-D0hKO5Fr.js +0 -24
  163. package/dist/NumberControl-DkeQT1iR.js +0 -20
  164. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-B9K5qEs3.js +0 -53
  165. package/dist/OneOfDropdown-NAgE-mPP.js +0 -34
  166. package/dist/RadioControl-DjrysNQ_.js +0 -24
  167. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-WaVJMdQq.js +0 -114
  168. package/dist/SectionHeading-BU1W5lDr.js +0 -19
  169. package/dist/SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-CsYyUtDa.js +0 -14015
  170. package/dist/SectionLayout-CJP4sYyB.js +0 -46
  171. package/dist/SettingsSubPanel-KxEyzlB6.js +0 -5
  172. package/dist/SettingsSubPanelLayout-YBNVPQOD.js +0 -61
  173. package/dist/SimpleButtonControl-ejyUwJdL.js +0 -61
  174. package/dist/SimpleTwinlistControl-qXQxRI7h.js +0 -28
  175. package/dist/SingleSelectControl-B0JgDv7j.js +0 -58
  176. package/dist/SingleSelectListBoxControl-ClQOxnxW.js +0 -235
  177. package/dist/SortListControl-mvJofiWn.js +0 -375
  178. package/dist/StyledListItem-BXz08pEQ.js +0 -72
  179. package/dist/TextAreaControl-S4aoqAv1.js +0 -111
  180. package/dist/TextControl-rJrjrBw8.js +0 -4
  181. package/dist/TextControl.vue_vue_type_script_setup_true_lang-Bf6GB1zX.js +0 -50
  182. package/dist/TimeControl-DfhE8yu9.js +0 -42
  183. package/dist/TwinlistControlBase-D1l9t7Up.js +0 -40
  184. package/dist/TwinlistLoadingInfo-CQRx9cEu.js +0 -963
  185. package/dist/TypedStringFilter-C6JhWCCC.js +0 -29
  186. package/dist/ValueSwitch-CUYV7v67.js +0 -131
  187. package/dist/ValueSwitchControl-IP9SxrUs.js +0 -20
  188. package/dist/VerticalLayout-D2eQSYgv.js +0 -30
  189. package/dist/VerticalLayoutBase-DRfHwc4t.js +0 -20
  190. package/dist/ZonedDateTimeControl-Bi8cV34A.js +0 -75
  191. package/dist/floating-ui.vue-B-MrqKCT.js +0 -1019
  192. package/dist/index-CoRworrE.js +0 -322
  193. package/dist/magic-string.es-D-aKzDFf.js +0 -858
  194. package/dist/navigator-D_R-txCf.js +0 -7
  195. package/dist/popper-CRR--9mA.js +0 -907
  196. package/dist/reload-BVbCGubF.js +0 -17
  197. package/dist/src/JsonFormsDialog.vue.d.ts +0 -46
  198. package/dist/svgWithTitle-Cr3Pu3wr.js +0 -18
  199. package/dist/useDropdownNavigation-7o7SRJSo.js +0 -781
  200. package/dist/usePossibleValues-lz0Rcu_N.js +0 -20
@@ -0,0 +1,663 @@
1
+ import { defineComponent as G, shallowRef as T, h as U, watch as _, toValue as f, computed as B, unref as z, nextTick as X, toRefs as q, ref as M, resolveComponent as v, createBlock as E, openBlock as c, withCtx as C, createElementVNode as m, normalizeClass as y, withDirectives as Q, normalizeStyle as J, createElementBlock as h, withModifiers as x, renderSlot as D, toDisplayString as O, createCommentVNode as V, withKeys as Z, createVNode as P, Fragment as w, renderList as K, createTextVNode as $, vShow as ee } from "vue";
2
+ import { o as te, t as se, b as R, i as N, c as k, w as ne, d as ie, e as oe } from "./index-CpKfM262.js";
3
+ import { A as le } from "./arrow-dropdown-eS-nVNCv.js";
4
+ import { C as re } from "./close-0dYG2oDA.js";
5
+ /* empty css */
6
+ import { u as ae } from "./useSearch-hpyYQ_6y.js";
7
+ import { v as de, B as ue, _ as ce } from "./SectionHeading.vue_vue_type_style_index_0_scoped_f06e9b7d_lang-B5ALSUVO.js";
8
+ import { i as he } from "./hotkeys-rxnt4egK.js";
9
+ import { d as pe, a as fe, b as me, i as ge, e as ye, h as ve, c as xe } from "./_getTag-BvpAzjaz.js";
10
+ import { i as Ve } from "./isArray-WzO_os3q.js";
11
+ var we = "[object Map]", be = "[object Set]", Ee = Object.prototype, Ce = Ee.hasOwnProperty;
12
+ function De(e) {
13
+ if (e == null)
14
+ return !0;
15
+ if (pe(e) && (Ve(e) || typeof e == "string" || typeof e.splice == "function" || fe(e) || me(e) || ge(e)))
16
+ return !e.length;
17
+ var t = ye(e);
18
+ if (t == we || t == be)
19
+ return !e.size;
20
+ if (ve(e))
21
+ return !xe(e).length;
22
+ for (var s in e)
23
+ if (Ce.call(e, s))
24
+ return !1;
25
+ return !0;
26
+ }
27
+ const Oe = /* @__PURE__ */ G({
28
+ name: "OnClickOutside",
29
+ props: ["as", "options"],
30
+ emits: ["trigger"],
31
+ setup(e, { slots: t, emit: s }) {
32
+ const a = T();
33
+ return te(a, (i) => {
34
+ s("trigger", i);
35
+ }, e.options), () => {
36
+ if (t.default)
37
+ return U(e.as || "div", { ref: a }, t.default());
38
+ };
39
+ }
40
+ }), ke = oe ? window : void 0;
41
+ function Se(e) {
42
+ var t;
43
+ const s = f(e);
44
+ return (t = s?.$el) != null ? t : s;
45
+ }
46
+ function Ie(...e) {
47
+ const t = [], s = () => {
48
+ t.forEach((o) => o()), t.length = 0;
49
+ }, a = (o, l, r, u) => (o.addEventListener(l, r, u), () => o.removeEventListener(l, r, u)), i = B(() => {
50
+ const o = k(f(e[0])).filter((l) => l != null);
51
+ return o.every((l) => typeof l != "string") ? o : void 0;
52
+ }), n = ne(
53
+ () => {
54
+ var o, l;
55
+ return [
56
+ (l = (o = i.value) == null ? void 0 : o.map((r) => Se(r))) != null ? l : [ke].filter((r) => r != null),
57
+ k(f(i.value ? e[1] : e[0])),
58
+ k(z(i.value ? e[2] : e[1])),
59
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
60
+ f(i.value ? e[3] : e[2])
61
+ ];
62
+ },
63
+ ([o, l, r, u]) => {
64
+ if (s(), !o?.length || !l?.length || !r?.length)
65
+ return;
66
+ const b = ie(u) ? { ...u } : u;
67
+ t.push(
68
+ ...o.flatMap(
69
+ (d) => l.flatMap(
70
+ (g) => r.map((j) => a(d, g, j, b))
71
+ )
72
+ )
73
+ );
74
+ },
75
+ { flush: "post" }
76
+ ), p = () => {
77
+ n(), s();
78
+ };
79
+ return R(s), p;
80
+ }
81
+ function S(e) {
82
+ return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
83
+ }
84
+ function A(e) {
85
+ const t = window.getComputedStyle(e);
86
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
87
+ return !0;
88
+ {
89
+ const s = e.parentNode;
90
+ return !s || s.tagName === "BODY" ? !1 : A(s);
91
+ }
92
+ }
93
+ function Te(e) {
94
+ const t = e || window.event, s = t.target;
95
+ return A(s) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
96
+ }
97
+ const I = /* @__PURE__ */ new WeakMap();
98
+ function _e(e, t = !1) {
99
+ const s = T(t);
100
+ let a = null, i = "";
101
+ _(se(e), (o) => {
102
+ const l = S(f(o));
103
+ if (l) {
104
+ const r = l;
105
+ if (I.get(r) || I.set(r, r.style.overflow), r.style.overflow !== "hidden" && (i = r.style.overflow), r.style.overflow === "hidden")
106
+ return s.value = !0;
107
+ if (s.value)
108
+ return r.style.overflow = "hidden";
109
+ }
110
+ }, {
111
+ immediate: !0
112
+ });
113
+ const n = () => {
114
+ const o = S(f(e));
115
+ !o || s.value || (N && (a = Ie(
116
+ o,
117
+ "touchmove",
118
+ (l) => {
119
+ Te(l);
120
+ },
121
+ { passive: !1 }
122
+ )), o.style.overflow = "hidden", s.value = !0);
123
+ }, p = () => {
124
+ const o = S(f(e));
125
+ !o || !s.value || (N && a?.(), o.style.overflow = i, I.delete(o), s.value = !1);
126
+ };
127
+ return R(p), B({
128
+ get() {
129
+ return s.value;
130
+ },
131
+ set(o) {
132
+ o ? n() : p();
133
+ }
134
+ });
135
+ }
136
+ function Be() {
137
+ let e = !1;
138
+ const t = T(!1);
139
+ return (s, a) => {
140
+ if (t.value = a.value, e)
141
+ return;
142
+ e = !0;
143
+ const i = _e(s, a.value);
144
+ _(t, (n) => i.value = n);
145
+ };
146
+ }
147
+ Be();
148
+ const L = "ArrowDown", H = "ArrowUp", F = "Home", W = "End", Me = "Escape", Y = "Enter", Pe = [L, H, F, W, Y], Ke = {
149
+ name: "Dropdown",
150
+ components: {
151
+ DropdownIcon: le,
152
+ OnClickOutside: Oe,
153
+ FunctionButton: de,
154
+ CloseIcon: re
155
+ },
156
+ props: {
157
+ id: {
158
+ type: String,
159
+ default() {
160
+ return `Dropdown-${ue()}`;
161
+ }
162
+ },
163
+ modelValue: {
164
+ type: String,
165
+ default: null
166
+ },
167
+ name: {
168
+ type: String,
169
+ default: null
170
+ },
171
+ placeholder: {
172
+ type: String,
173
+ default: null
174
+ },
175
+ ariaLabel: {
176
+ type: String,
177
+ required: !0
178
+ },
179
+ isValid: {
180
+ default: !0,
181
+ type: Boolean
182
+ },
183
+ disabled: {
184
+ default: !1,
185
+ type: Boolean
186
+ },
187
+ /**
188
+ * The direction of the dropdown menu. When set to 'up', the menu will appear above the input field.
189
+ * Defaults to 'down'.
190
+ */
191
+ direction: {
192
+ default: "down",
193
+ type: String
194
+ },
195
+ /**
196
+ * List of possible values. Each item must have an `id` and a `text` property. To use slots an additional
197
+ * slotData object must be passed which contains the data to be displayed.
198
+ *
199
+ * IMPORTANT: All values have to have a slotData object otherwise the slot will not be displayed and the
200
+ * usual text is rendered instead.
201
+ * @example
202
+ * [{
203
+ * id: 'pdf',
204
+ * text: 'PDF'
205
+ * }, {
206
+ * id: 'XLS',
207
+ * text: 'Excel',
208
+ * }, {
209
+ * id: 'JPG',
210
+ * text: 'Jpeg',
211
+ * slotData: {
212
+ * fullName: 'Joint Photographic Experts Group',
213
+ * year: '1992'
214
+ * description: 'Commonly used method of lossy compression for digital images'
215
+ * }
216
+ * }]
217
+ */
218
+ possibleValues: {
219
+ type: Array,
220
+ default: () => []
221
+ },
222
+ caseSensitiveSearch: {
223
+ type: Boolean,
224
+ default: !1
225
+ },
226
+ compact: {
227
+ type: Boolean,
228
+ default: !1
229
+ }
230
+ },
231
+ emits: ["update:modelValue"],
232
+ setup(e) {
233
+ const { caseSensitiveSearch: t, possibleValues: s } = q(e), a = M(!1), i = B(() => {
234
+ const o = {};
235
+ for (const l of s.value)
236
+ o[l.id] = l.text;
237
+ return o;
238
+ }), n = M(i.value[e.modelValue]);
239
+ _(
240
+ () => e.modelValue,
241
+ (o) => {
242
+ n.value = i.value[o];
243
+ }
244
+ );
245
+ const p = ae(
246
+ n,
247
+ t,
248
+ s,
249
+ a
250
+ );
251
+ return {
252
+ searchValue: n,
253
+ useFilterValues: a,
254
+ currentPossibleValues: p
255
+ };
256
+ },
257
+ data() {
258
+ return {
259
+ typingTimeout: null,
260
+ isExpanded: !1,
261
+ searchQuery: "",
262
+ candidate: this.modelValue,
263
+ emptyState: "Nothing found",
264
+ optionRefs: /* @__PURE__ */ new Map(),
265
+ slotContainerHeight: 0
266
+ };
267
+ },
268
+ computed: {
269
+ groupedValues() {
270
+ const e = {};
271
+ for (const t of this.currentPossibleValues) {
272
+ const s = t.group || "";
273
+ e[s] || (e[s] = { label: t.group, items: [] }), e[s].items.push(t);
274
+ }
275
+ return Object.values(e);
276
+ },
277
+ orderedGroupedValues() {
278
+ const e = this.groupedValues.filter(
279
+ (s) => s.items[0].group
280
+ ), t = this.groupedValues.filter(
281
+ (s) => !s.items[0].group
282
+ );
283
+ return [...e, ...t];
284
+ },
285
+ flatOrderedValues() {
286
+ return this.orderedGroupedValues.flatMap((e) => e.items);
287
+ },
288
+ selectedIndex() {
289
+ return this.flatOrderedValues.map((e) => e.id).indexOf(this.candidate);
290
+ },
291
+ showPlaceholder() {
292
+ return !this.modelValue;
293
+ },
294
+ displayTextMap() {
295
+ const e = {};
296
+ for (const t of this.possibleValues)
297
+ e[t.id] = t.text;
298
+ return e;
299
+ },
300
+ displayText() {
301
+ return this.showPlaceholder ? this.placeholder : this.displayTextMap.hasOwnProperty(this.modelValue) ? this.displayTextMap[this.modelValue] : `(MISSING) ${this.modelValue.toString()}`;
302
+ },
303
+ isMissing() {
304
+ return this.modelValue && !this.displayTextMap.hasOwnProperty(this.modelValue);
305
+ },
306
+ hasRightIcon() {
307
+ return this.$slots["icon-right"]?.().length;
308
+ },
309
+ hasOptionTemplate() {
310
+ return this.possibleValues.length === 0 ? !1 : this.possibleValues.every(
311
+ (e) => e.slotData && !De(e.slotData)
312
+ );
313
+ },
314
+ selectedOption() {
315
+ return this.possibleValues.find((e) => e.id === this.modelValue);
316
+ },
317
+ hasNoFilteredPossibleValues() {
318
+ return this.currentPossibleValues.length === 0;
319
+ },
320
+ nonEmptySearchValue() {
321
+ return this.searchValue?.length > 0;
322
+ },
323
+ possibleValuesIsProvided() {
324
+ return !!this.possibleValues.length;
325
+ },
326
+ isDisabled() {
327
+ return this.disabled || !this.possibleValuesIsProvided;
328
+ },
329
+ closeIconTooltip() {
330
+ return "Clear";
331
+ }
332
+ },
333
+ watch: {
334
+ currentPossibleValues(e) {
335
+ this.candidate = e[0]?.id;
336
+ },
337
+ isExpanded() {
338
+ this.useFilterValues = !1;
339
+ }
340
+ },
341
+ methods: {
342
+ updateCandidate(e) {
343
+ this.candidate = e;
344
+ },
345
+ isCurrentValue(e) {
346
+ return this.candidate === e;
347
+ },
348
+ getButtonRef() {
349
+ return this.$refs.button;
350
+ },
351
+ getOptionsRefs() {
352
+ return this.$refs.options;
353
+ },
354
+ getSearchInput() {
355
+ return this.$refs.searchInput;
356
+ },
357
+ getListBoxNodeRef() {
358
+ return this.$refs.ul;
359
+ },
360
+ emitAndClose(e) {
361
+ this.$emit("update:modelValue", e), this.toggleExpanded();
362
+ },
363
+ scrollTo(e) {
364
+ const t = this.getListBoxNodeRef();
365
+ if (t.scrollHeight >= t.clientHeight) {
366
+ const s = this.optionRefs.get(e);
367
+ if (!s) {
368
+ consola.error(
369
+ `trying to scroll to element with Id ${e.toString()} which does not exist`
370
+ );
371
+ return;
372
+ }
373
+ const a = t.clientHeight + t.scrollTop, i = s.offsetTop + s.offsetHeight;
374
+ i > a ? t.scrollTop = i - t.clientHeight : s.offsetTop < t.scrollTop && (t.scrollTop = s.offsetTop);
375
+ }
376
+ },
377
+ onArrowDown() {
378
+ const e = this.selectedIndex + 1;
379
+ if (e >= this.flatOrderedValues.length)
380
+ return;
381
+ const t = this.flatOrderedValues[e].id;
382
+ this.updateCandidate(t), this.scrollTo(t);
383
+ },
384
+ onArrowUp() {
385
+ const e = this.selectedIndex - 1;
386
+ if (e < 0)
387
+ return;
388
+ const t = this.flatOrderedValues[e].id;
389
+ this.updateCandidate(t), this.scrollTo(t);
390
+ },
391
+ onEnter() {
392
+ this.hasNoFilteredPossibleValues || typeof this.candidate > "u" || this.emitAndClose(this.candidate);
393
+ },
394
+ onEndKey() {
395
+ const e = this.flatOrderedValues.length - 1;
396
+ this.updateCandidate(this.flatOrderedValues[e].id);
397
+ const t = this.getListBoxNodeRef();
398
+ t.scrollTop = t.scrollHeight;
399
+ },
400
+ onHomeKey() {
401
+ this.updateCandidate(this.flatOrderedValues[0].id), this.getListBoxNodeRef().scrollTop = 0;
402
+ },
403
+ toggleExpanded() {
404
+ this.isExpanded ? this.collapse() : this.expand();
405
+ },
406
+ async expand() {
407
+ this.isDisabled || (this.searchValue = this.displayTextMap[this.modelValue], this.hasOptionTemplate && (this.slotContainerHeight = this.$refs.slotContainer?.clientHeight ?? 0), this.isExpanded = !0, this.candidate === this.modelValue && (this.isMissing || this.showPlaceholder) && this.updateCandidate(this.currentPossibleValues[0]?.id), await X(), this.getSearchInput().focus(), this.getSearchInput().select(), this.candidate && this.scrollTo(this.candidate));
408
+ },
409
+ collapse() {
410
+ this.isExpanded = !1, this.getButtonRef().focus();
411
+ },
412
+ /* NOTE: we use a single keyDown method because @keydown.up bindings are not testable. */
413
+ handleKeyDownButton(e) {
414
+ this.isExpanded ? this.handleKeyDownOnExpanded(e) : he(e, Pe) && (this.expand(), e.preventDefault());
415
+ },
416
+ handleKeyDownOnExpanded(e) {
417
+ e.key === L && (this.onArrowDown(), e.preventDefault()), e.key === H && (this.onArrowUp(), e.preventDefault()), e.key === W && (this.onEndKey(), e.preventDefault()), e.key === F && (this.onHomeKey(), e.preventDefault()), e.key === Me && (this.collapse(), e.preventDefault(), e.stopPropagation()), e.key === Y && (this.onEnter(), e.preventDefault());
418
+ },
419
+ hasSelection() {
420
+ return !!(this.modelValue && !this.isMissing);
421
+ },
422
+ getCurrentSelectedId() {
423
+ try {
424
+ return this.flatOrderedValues[this.selectedIndex].id;
425
+ } catch {
426
+ return "";
427
+ }
428
+ },
429
+ generateId(e, t = null) {
430
+ if (!t)
431
+ return `${e}-${this.id}`;
432
+ const s = String(t).replace(/[^\w]/gi, "");
433
+ return `${e}-${this.id}-${s}`;
434
+ },
435
+ closeDropdown() {
436
+ this.searchValue = this.displayTextMap[this.modelValue], this.isExpanded = !1;
437
+ },
438
+ handleSearch(e) {
439
+ this.useFilterValues = !0, this.searchValue = e;
440
+ },
441
+ handleResetInput() {
442
+ this.searchValue = "", this.getSearchInput().focus();
443
+ }
444
+ }
445
+ }, Ne = ["id"], Re = ["id", "aria-label", "aria-labelledby", "aria-expanded"], Ae = ["value"], Le = {
446
+ key: 1,
447
+ ref: "slotContainer"
448
+ }, He = { class: "right" }, Fe = {
449
+ key: 0,
450
+ class: "loading-icon"
451
+ }, We = ["aria-activedescendant"], Ye = {
452
+ key: 0,
453
+ class: "empty-state"
454
+ }, je = ["id", "title", "aria-selected", "onMouseenter", "onClick"], Ge = ["id", "name", "value"];
455
+ function Ue(e, t, s, a, i, n) {
456
+ const p = v("CloseIcon"), o = v("FunctionButton"), l = v("DropdownIcon"), r = v("OnClickOutside");
457
+ return c(), E(r, { onTrigger: n.closeDropdown }, {
458
+ default: C(() => [
459
+ m("div", {
460
+ id: s.id,
461
+ class: y([
462
+ "dropdown",
463
+ {
464
+ collapsed: !i.isExpanded,
465
+ invalid: !s.isValid,
466
+ disabled: n.isDisabled,
467
+ compact: s.compact
468
+ }
469
+ ])
470
+ }, [
471
+ m("div", {
472
+ id: n.generateId("button"),
473
+ ref: "button",
474
+ role: "button",
475
+ tabindex: "0",
476
+ "aria-haspopup": "listbox",
477
+ class: y({
478
+ placeholder: n.showPlaceholder && !i.isExpanded,
479
+ missing: n.isMissing && !i.isExpanded,
480
+ "has-option-template": n.hasOptionTemplate && !i.isExpanded
481
+ }),
482
+ style: J({
483
+ ...i.isExpanded && n.hasOptionTemplate && {
484
+ height: `calc(${i.slotContainerHeight}px + 0 * var(--form-border-width))`,
485
+ boxSizing: "content-box"
486
+ }
487
+ }),
488
+ "aria-label": s.ariaLabel,
489
+ "aria-labelledby": n.generateId("button"),
490
+ "aria-expanded": i.isExpanded,
491
+ onClick: t[3] || (t[3] = (...u) => n.toggleExpanded && n.toggleExpanded(...u)),
492
+ onKeydown: t[4] || (t[4] = (...u) => n.handleKeyDownButton && n.handleKeyDownButton(...u))
493
+ }, [
494
+ i.isExpanded ? (c(), h("input", {
495
+ key: 0,
496
+ ref: "searchInput",
497
+ value: a.searchValue,
498
+ tabindex: "0",
499
+ role: "searchbox",
500
+ class: "search-input",
501
+ type: "text",
502
+ onClick: t[0] || (t[0] = x(() => {
503
+ }, ["stop"])),
504
+ onInput: t[1] || (t[1] = (u) => n.handleSearch(u.target.value))
505
+ }, null, 40, Ae)) : n.hasOptionTemplate ? (c(), h(
506
+ "div",
507
+ Le,
508
+ [
509
+ D(e.$slots, "option", {
510
+ slotData: n.selectedOption?.slotData,
511
+ isMissing: n.isMissing,
512
+ selectedValue: s.modelValue,
513
+ expanded: !1
514
+ })
515
+ ],
516
+ 512
517
+ /* NEED_PATCH */
518
+ )) : (c(), h(
519
+ "span",
520
+ {
521
+ key: 2,
522
+ ref: "span"
523
+ },
524
+ O(n.displayText),
525
+ 513
526
+ /* TEXT, NEED_PATCH */
527
+ )),
528
+ m("div", He, [
529
+ n.hasRightIcon ? (c(), h("div", Fe, [
530
+ D(e.$slots, "icon-right")
531
+ ])) : V("v-if", !0),
532
+ i.isExpanded && n.nonEmptySearchValue ? (c(), E(o, {
533
+ key: 1,
534
+ ref: "closeButton",
535
+ title: "Close",
536
+ tabindex: "0",
537
+ class: "button",
538
+ compact: s.compact,
539
+ onKeydown: t[2] || (t[2] = Z(x(() => {
540
+ }, ["stop"]), ["enter"])),
541
+ onClick: x(n.handleResetInput, ["stop"])
542
+ }, {
543
+ default: C(() => [
544
+ P(p, { class: "icon" })
545
+ ]),
546
+ _: 1
547
+ /* STABLE */
548
+ }, 8, ["compact", "onClick"])) : V("v-if", !0),
549
+ !i.isExpanded || !n.nonEmptySearchValue ? (c(), E(o, {
550
+ key: 2,
551
+ class: "button",
552
+ compact: s.compact,
553
+ disabled: n.isDisabled,
554
+ title: i.isExpanded ? "Cancel" : "Expand",
555
+ tabindex: i.isExpanded ? 0 : -1,
556
+ onClick: x(n.toggleExpanded, ["stop"])
557
+ }, {
558
+ default: C(() => [
559
+ P(l, {
560
+ class: y(["dropdown-icon", "icon"])
561
+ })
562
+ ]),
563
+ _: 1
564
+ /* STABLE */
565
+ }, 8, ["compact", "disabled", "title", "tabindex", "onClick"])) : V("v-if", !0)
566
+ ])
567
+ ], 46, Re),
568
+ Q(m("ul", {
569
+ ref: "ul",
570
+ role: "listbox",
571
+ tabindex: "-1",
572
+ "aria-activedescendant": i.isExpanded ? n.generateId("option", n.getCurrentSelectedId()) : void 0,
573
+ class: y({ "drops-upwards": s.direction === "up" })
574
+ }, [
575
+ n.hasNoFilteredPossibleValues ? (c(), h(
576
+ "div",
577
+ Ye,
578
+ O(i.emptyState),
579
+ 1
580
+ /* TEXT */
581
+ )) : V("v-if", !0),
582
+ (c(!0), h(
583
+ w,
584
+ null,
585
+ K(n.orderedGroupedValues, (u, b) => (c(), h(
586
+ w,
587
+ { key: b },
588
+ [
589
+ t[5] || (t[5] = m(
590
+ "span",
591
+ { class: "group-divider" },
592
+ null,
593
+ -1
594
+ /* CACHED */
595
+ )),
596
+ (c(!0), h(
597
+ w,
598
+ null,
599
+ K(u.items, (d) => (c(), h("li", {
600
+ id: n.generateId("option", d.id),
601
+ key: `listbox-${d.id}`,
602
+ ref_for: !0,
603
+ ref: (g) => i.optionRefs.set(d.id, g),
604
+ role: "option",
605
+ title: typeof d.title > "u" ? d.text : d.title,
606
+ class: y({
607
+ focused: n.isCurrentValue(d.id),
608
+ noselect: !0,
609
+ empty: d.text.trim() === "",
610
+ "has-option-template": n.hasOptionTemplate,
611
+ special: d.isSpecial
612
+ }),
613
+ "aria-selected": n.isCurrentValue(d.id),
614
+ onMouseenter: (g) => n.updateCandidate(d.id),
615
+ onClick: (g) => n.emitAndClose(d.id)
616
+ }, [
617
+ n.hasOptionTemplate ? D(e.$slots, "option", {
618
+ key: 0,
619
+ slotData: d.slotData,
620
+ expanded: !0
621
+ }) : (c(), h(
622
+ w,
623
+ { key: 1 },
624
+ [
625
+ $(
626
+ O(d.text),
627
+ 1
628
+ /* TEXT */
629
+ )
630
+ ],
631
+ 64
632
+ /* STABLE_FRAGMENT */
633
+ ))
634
+ ], 42, je))),
635
+ 128
636
+ /* KEYED_FRAGMENT */
637
+ ))
638
+ ],
639
+ 64
640
+ /* STABLE_FRAGMENT */
641
+ ))),
642
+ 128
643
+ /* KEYED_FRAGMENT */
644
+ ))
645
+ ], 10, We), [
646
+ [ee, i.isExpanded]
647
+ ]),
648
+ m("input", {
649
+ id: s.id,
650
+ type: "hidden",
651
+ name: s.name,
652
+ value: s.modelValue
653
+ }, null, 8, Ge)
654
+ ], 10, Ne)
655
+ ]),
656
+ _: 3
657
+ /* FORWARDED */
658
+ }, 8, ["onTrigger"]);
659
+ }
660
+ const nt = /* @__PURE__ */ ce(Ke, [["render", Ue], ["__scopeId", "data-v-4996d969"], ["__file", "/Users/albrecht/Documents/KNIME/git/webapps-common/packages/components/src/components/forms/Dropdown/Dropdown.vue"]]);
661
+ export {
662
+ nt as D
663
+ };
@@ -0,0 +1,46 @@
1
+ import { defineComponent as n, toRef as l, createElementBlock as i, openBlock as s, Fragment as d, createCommentVNode as u, createVNode as c } from "vue";
2
+ import { u as p } from "./usePossibleValues-DTVXBGRC.js";
3
+ import { L as m } from "./LoadingDropdown-B9jHjdWV.js";
4
+ import { _ as b } from "./SectionHeading.vue_vue_type_style_index_0_scoped_f06e9b7d_lang-B5ALSUVO.js";
5
+ const _ = /* @__PURE__ */ n({
6
+ __name: "DropdownControl",
7
+ props: {
8
+ control: { type: Object, required: !0 },
9
+ handleChange: { type: Function, required: !0 },
10
+ changeValue: { type: Function, required: !0 },
11
+ disabled: { type: Boolean, required: !0 },
12
+ isValid: { type: Boolean, required: !0 },
13
+ onRegisterValidation: { type: Function, required: !0 },
14
+ labelForId: { type: String, required: !0 }
15
+ },
16
+ setup(a, { expose: r }) {
17
+ r();
18
+ const e = a, { possibleValues: o } = p(l(e, "control")), t = { props: e, possibleValues: o, LoadingDropdown: m };
19
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
20
+ }
21
+ });
22
+ function f(a, r, e, o, t, V) {
23
+ return s(), i(
24
+ d,
25
+ null,
26
+ [
27
+ u(" eslint-disable vue/attribute-hyphenation typescript complains with ':aria-label' instead of ':ariaLabel'"),
28
+ c(o.LoadingDropdown, {
29
+ id: e.labelForId ?? "",
30
+ ariaLabel: e.control.label,
31
+ disabled: e.disabled,
32
+ "model-value": e.control.data ?? "",
33
+ "possible-values": o.possibleValues,
34
+ "is-valid": e.isValid,
35
+ compact: "",
36
+ "onUpdate:modelValue": e.changeValue
37
+ }, null, 8, ["id", "ariaLabel", "disabled", "model-value", "possible-values", "is-valid", "onUpdate:modelValue"])
38
+ ],
39
+ 2112
40
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
41
+ );
42
+ }
43
+ const q = /* @__PURE__ */ b(_, [["render", f], ["__file", "/Users/albrecht/Documents/KNIME/git/webapps-common/packages/jsonforms/src/uiComponents/DropdownControl.vue"]]);
44
+ export {
45
+ q as default
46
+ };