@knime/jsonforms 1.5.10 → 1.5.12

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 (62) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{AnyOfTwinlist-DMizLIwn.js → AnyOfTwinlist-DTggNnXP.js} +1 -1
  3. package/dist/{BaseButton-ew6uEaHi.js → BaseButton-I5M4pn6f.js} +1 -1
  4. package/dist/{Button-DI7EKUmu.js → Button-rLCsKJpO.js} +2 -2
  5. package/dist/{Checkbox-DPq-j4rC.js → Checkbox-DrJQzBqF.js} +1 -1
  6. package/dist/{CheckboxControl-Tnv1xVel.js → CheckboxControl-BGwhQMs-.js} +2 -2
  7. package/dist/{Checkboxes-CtN15klz.js → Checkboxes-Br3FkfqS.js} +2 -2
  8. package/dist/{CheckboxesControl-DcVkxf7W.js → CheckboxesControl-C5BkhWew.js} +2 -2
  9. package/dist/{ColumnFilter-Cw2PtnrT.js → ColumnFilter-DfAP8buV.js} +1 -1
  10. package/dist/{ColumnSelect-Df-m3Md2.js → ColumnSelect-vXE_85cR.js} +2 -2
  11. package/dist/{ComboBoxControl-DC3W4kPq.js → ComboBoxControl-CTMdhcN-.js} +4 -4
  12. package/dist/{DateControl-D70zb_g8.js → DateControl-B40Ar3uG.js} +1 -1
  13. package/dist/{DateTimeControl-C-ef6bOV.js → DateTimeControl-CUy0OZUE.js} +2 -2
  14. package/dist/{DateTimeFormatInput-t-O7ZqrA.js → DateTimeFormatInput-U6oDnsJW.js} +5 -5
  15. package/dist/{DateTimeFormatPickerControl-BbOu24lA.js → DateTimeFormatPickerControl-ARLARGoo.js} +2 -2
  16. package/dist/{DateTimeFormatPickerWithTypeControl-9e1ef9Hf.js → DateTimeFormatPickerWithTypeControl-Bu3NEwvJ.js} +3 -3
  17. package/dist/{DateTimeInput-C32yoECp.js → DateTimeInput-C7e1Z-XE.js} +3524 -3603
  18. package/dist/Dropdown-CPOTGnA1.js +605 -0
  19. package/dist/{DropdownControl-YplxM6ck.js → DropdownControl-CzD81Ycz.js} +1 -1
  20. package/dist/{DropdownControl.vue_vue_type_script_setup_true_lang-ByoiTkIU.js → DropdownControl.vue_vue_type_script_setup_true_lang-L2a_FDVR.js} +4 -4
  21. package/dist/{FunctionButton-Cee1Q-EN.js → FunctionButton-dHu7h3Y1.js} +2 -2
  22. package/dist/{HorizontalLayout-BtuP4oCU.js → HorizontalLayout-DpJ-y9Ro.js} +1 -1
  23. package/dist/{InputField-DHXXBWSv.js → InputField-BKnMLu77.js} +1 -1
  24. package/dist/{IntegerControl-B64xghdA.js → IntegerControl-Cly4hd8V.js} +1 -1
  25. package/dist/{IntervalControl-NldC56aj.js → IntervalControl-Bm-31Ea-.js} +6 -6
  26. package/dist/{MultiselectListBox-BUWB5ZWr.js → MultiselectListBox-OkLLUNac.js} +2 -2
  27. package/dist/{NameFilter-BQhzv9F3.js → NameFilter-DvtQFRJE.js} +1 -1
  28. package/dist/{NumberControl-EVY_3Hwl.js → NumberControl-C7SHCfb3.js} +1 -1
  29. package/dist/{NumberControlBase.vue_vue_type_script_setup_true_lang-CA0OxGuU.js → NumberControlBase.vue_vue_type_script_setup_true_lang-QqzXKwDy.js} +2 -2
  30. package/dist/{NumberInput-CI1ee8it.js → NumberInput-AOsXRph2.js} +1 -1
  31. package/dist/{OneOfDropdown-BPZeE-Bn.js → OneOfDropdown-DwbMw791.js} +1 -1
  32. package/dist/{RadioControl-DbX_Wfuv.js → RadioControl-DeFDT7X0.js} +2 -2
  33. package/dist/{RadioControlBase.vue_vue_type_script_setup_true_lang-BJdqHTLu.js → RadioControlBase.vue_vue_type_script_setup_true_lang-DO2v2uzO.js} +2 -2
  34. package/dist/{RichTextControl-Dl4V0nno.js → RichTextControl-BNvBtINB.js} +7 -7
  35. package/dist/{SectionLayout-CF6zovCM.js → SectionLayout-BUlQGeSC.js} +2 -2
  36. package/dist/{SimpleButtonControl-BwlE_a5H.js → SimpleButtonControl-BKhxWUOQ.js} +2 -2
  37. package/dist/{SimpleTwinlistControl-Cbwa6xtL.js → SimpleTwinlistControl-C1U5ZsHa.js} +12 -13
  38. package/dist/{SortListControl-BzbPvx8-.js → SortListControl-CXDHaj82.js} +4 -4
  39. package/dist/{TextAreaControl-BdTbCiQe.js → TextAreaControl-BFu0t-I2.js} +1 -1
  40. package/dist/{TextControl-PPpaK3OZ.js → TextControl-Bn47wzh9.js} +1 -1
  41. package/dist/{TextControl.vue_vue_type_script_setup_true_lang-DndraaDL.js → TextControl.vue_vue_type_script_setup_true_lang-xxo3RxnK.js} +3 -3
  42. package/dist/{TimeControl-CHQYhf6G.js → TimeControl-C_QqGr_G.js} +2 -2
  43. package/dist/{TwinlistControl-CqDn6X1h.js → TwinlistControl-BJthx4lq.js} +70 -71
  44. package/dist/{TwinlistLoadingInfo-PbU9BJjv.js → TwinlistLoadingInfo-a_ymAtQP.js} +69 -89
  45. package/dist/{ValueSwitch-CA4_rkUU.js → ValueSwitch-DeFP0rns.js} +1 -1
  46. package/dist/{ValueSwitchControl-5uuRkxf2.js → ValueSwitchControl-BzNmmWQq.js} +1 -1
  47. package/dist/{VerticalLayout-C4FOz-7p.js → VerticalLayout-56JEav8u.js} +2 -2
  48. package/dist/{VerticalLayoutBase-DQCRpzUA.js → VerticalLayoutBase-DOyKtPzP.js} +1 -1
  49. package/dist/VerticalLayoutBase.vue_vue_type_style_index_0_scoped_99aa13c1_lang-BagkGlzo.js +13312 -0
  50. package/dist/{ZonedDateTimeControl-BcZrk010.js → ZonedDateTimeControl-CC-rPJr7.js} +4 -4
  51. package/dist/{floating-ui.vue.esm-B1dY_Hbh.js → floating-ui.vue-B-MrqKCT.js} +375 -342
  52. package/dist/index-Bf0xDq3g.js +373 -0
  53. package/dist/knime-jsonforms.css +1 -1
  54. package/dist/knime-jsonforms.js +5 -5
  55. package/dist/{localTimeUtils-ClDpVqfn.js → localTimeUtils-D3Z9JesA.js} +1 -1
  56. package/dist/{magic-string.es-D4UQQyt0.js → magic-string.es-DDd2I1su.js} +264 -265
  57. package/dist/{svgWithTitle-C6ghivXy.js → svgWithTitle-B7gWnKbY.js} +1 -1
  58. package/dist/testing.js +2 -2
  59. package/package.json +6 -11
  60. package/dist/Dropdown-B6CD0Mt_.js +0 -692
  61. package/dist/VerticalLayoutBase.vue_vue_type_style_index_0_scoped_99aa13c1_lang-Bke7i9o8.js +0 -14934
  62. package/dist/index-CkuSIXs2.js +0 -331
@@ -1,692 +0,0 @@
1
- import { getCurrentScope as Q, onScopeDispose as J, unref as Z, toRef as $, readonly as ee, customRef as te, ref as v, watch as E, defineComponent as ne, h as se, computed as W, toRefs as oe, nextTick as ie, resolveComponent as S, openBlock as m, createBlock as I, withCtx as D, createElementVNode as w, normalizeClass as V, normalizeStyle as re, createElementBlock as y, withModifiers as k, renderSlot as _, toDisplayString as T, createCommentVNode as C, withKeys as le, createVNode as N, withDirectives as ae, Fragment as O, renderList as R, createTextVNode as de, vShow as ue, pushScopeId as ce, popScopeId as fe } from "vue";
2
- import { A as pe } from "./arrow-dropdown-DjUxzjqC.js";
3
- import { C as he } from "./close-h7XT0ja0.js";
4
- /* empty css */
5
- import { u as me } from "./useSearch-hpyYQ_6y.js";
6
- import { F as ye } from "./FunctionButton-Cee1Q-EN.js";
7
- import { a as ge, b as we, d as xe, f as ve, h as Ve, j as be, k as Ee } from "./_getTag-DS8v0_uf.js";
8
- import { i as Se } from "./toString-DkbNkGT4.js";
9
- import { _ as ke } from "./VerticalLayoutBase.vue_vue_type_style_index_0_scoped_99aa13c1_lang-Bke7i9o8.js";
10
- const Ce = (e) => e.ctrlKey || e.metaKey || e.altKey || e.shiftKey, Oe = (e, t) => (Array.isArray(t) ? t : [t]).includes(e.key) && !Ce(e);
11
- var Ie = "[object Map]", De = "[object Set]", _e = Object.prototype, Te = _e.hasOwnProperty;
12
- function Ae(e) {
13
- if (e == null)
14
- return !0;
15
- if (ge(e) && (Se(e) || typeof e == "string" || typeof e.splice == "function" || we(e) || xe(e) || ve(e)))
16
- return !e.length;
17
- var t = Ve(e);
18
- if (t == Ie || t == De)
19
- return !e.size;
20
- if (be(e))
21
- return !Ee(e).length;
22
- for (var n in e)
23
- if (Te.call(e, n))
24
- return !1;
25
- return !0;
26
- }
27
- function K(e) {
28
- return Q() ? (J(e), !0) : !1;
29
- }
30
- function g(e) {
31
- return typeof e == "function" ? e() : Z(e);
32
- }
33
- const L = typeof window < "u" && typeof document < "u";
34
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
35
- const Me = Object.prototype.toString, F = (e) => Me.call(e) === "[object Object]", x = () => {
36
- }, B = /* @__PURE__ */ Pe();
37
- function Pe() {
38
- var e, t;
39
- return L && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
40
- }
41
- function Be(...e) {
42
- if (e.length !== 1)
43
- return $(...e);
44
- const t = e[0];
45
- return typeof t == "function" ? ee(te(() => ({ get: t, set: x }))) : v(t);
46
- }
47
- function b(e) {
48
- var t;
49
- const n = g(e);
50
- return (t = n == null ? void 0 : n.$el) != null ? t : n;
51
- }
52
- const j = L ? window : void 0;
53
- function A(...e) {
54
- let t, n, o, i;
55
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = j) : [t, n, o, i] = e, !t)
56
- return x;
57
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
58
- const s = [], h = () => {
59
- s.forEach((u) => u()), s.length = 0;
60
- }, a = (u, d, l, r) => (u.addEventListener(d, l, r), () => u.removeEventListener(d, l, r)), f = E(
61
- () => [b(t), g(i)],
62
- ([u, d]) => {
63
- if (h(), !u)
64
- return;
65
- const l = F(d) ? { ...d } : d;
66
- s.push(
67
- ...n.flatMap((r) => o.map((c) => a(u, r, c, l)))
68
- );
69
- },
70
- { immediate: !0, flush: "post" }
71
- ), p = () => {
72
- f(), h();
73
- };
74
- return K(p), p;
75
- }
76
- let H = !1;
77
- function Ke(e, t, n = {}) {
78
- const { window: o = j, ignore: i = [], capture: s = !0, detectIframe: h = !1 } = n;
79
- if (!o)
80
- return x;
81
- B && !H && (H = !0, Array.from(o.document.body.children).forEach((l) => l.addEventListener("click", x)), o.document.documentElement.addEventListener("click", x));
82
- let a = !0;
83
- const f = (l) => i.some((r) => {
84
- if (typeof r == "string")
85
- return Array.from(o.document.querySelectorAll(r)).some((c) => c === l.target || l.composedPath().includes(c));
86
- {
87
- const c = b(r);
88
- return c && (l.target === c || l.composedPath().includes(c));
89
- }
90
- }), u = [
91
- A(o, "click", (l) => {
92
- const r = b(e);
93
- if (!(!r || r === l.target || l.composedPath().includes(r))) {
94
- if (l.detail === 0 && (a = !f(l)), !a) {
95
- a = !0;
96
- return;
97
- }
98
- t(l);
99
- }
100
- }, { passive: !0, capture: s }),
101
- A(o, "pointerdown", (l) => {
102
- const r = b(e);
103
- a = !f(l) && !!(r && !l.composedPath().includes(r));
104
- }, { passive: !0 }),
105
- h && A(o, "blur", (l) => {
106
- setTimeout(() => {
107
- var r;
108
- const c = b(e);
109
- ((r = o.document.activeElement) == null ? void 0 : r.tagName) === "IFRAME" && !(c != null && c.contains(o.document.activeElement)) && t(l);
110
- }, 0);
111
- })
112
- ].filter(Boolean);
113
- return () => u.forEach((l) => l());
114
- }
115
- const Le = /* @__PURE__ */ ne({
116
- name: "OnClickOutside",
117
- props: ["as", "options"],
118
- emits: ["trigger"],
119
- setup(e, { slots: t, emit: n }) {
120
- const o = v();
121
- return Ke(o, (i) => {
122
- n("trigger", i);
123
- }, e.options), () => {
124
- if (t.default)
125
- return se(e.as || "div", { ref: o }, t.default());
126
- };
127
- }
128
- });
129
- function Ne(e) {
130
- var t;
131
- const n = g(e);
132
- return (t = n == null ? void 0 : n.$el) != null ? t : n;
133
- }
134
- const Re = L ? window : void 0;
135
- function He(...e) {
136
- let t, n, o, i;
137
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, i] = e, t = Re) : [t, n, o, i] = e, !t)
138
- return x;
139
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
140
- const s = [], h = () => {
141
- s.forEach((u) => u()), s.length = 0;
142
- }, a = (u, d, l, r) => (u.addEventListener(d, l, r), () => u.removeEventListener(d, l, r)), f = E(
143
- () => [Ne(t), g(i)],
144
- ([u, d]) => {
145
- if (h(), !u)
146
- return;
147
- const l = F(d) ? { ...d } : d;
148
- s.push(
149
- ...n.flatMap((r) => o.map((c) => a(u, r, c, l)))
150
- );
151
- },
152
- { immediate: !0, flush: "post" }
153
- ), p = () => {
154
- f(), h();
155
- };
156
- return K(p), p;
157
- }
158
- function M(e) {
159
- return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
160
- }
161
- function Y(e) {
162
- const t = window.getComputedStyle(e);
163
- if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
164
- return !0;
165
- {
166
- const n = e.parentNode;
167
- return !n || n.tagName === "BODY" ? !1 : Y(n);
168
- }
169
- }
170
- function We(e) {
171
- const t = e || window.event, n = t.target;
172
- return Y(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
173
- }
174
- const P = /* @__PURE__ */ new WeakMap();
175
- function Fe(e, t = !1) {
176
- const n = v(t);
177
- let o = null, i = "";
178
- E(Be(e), (a) => {
179
- const f = M(g(a));
180
- if (f) {
181
- const p = f;
182
- if (P.get(p) || P.set(p, p.style.overflow), p.style.overflow !== "hidden" && (i = p.style.overflow), p.style.overflow === "hidden")
183
- return n.value = !0;
184
- if (n.value)
185
- return p.style.overflow = "hidden";
186
- }
187
- }, {
188
- immediate: !0
189
- });
190
- const s = () => {
191
- const a = M(g(e));
192
- !a || n.value || (B && (o = He(
193
- a,
194
- "touchmove",
195
- (f) => {
196
- We(f);
197
- },
198
- { passive: !1 }
199
- )), a.style.overflow = "hidden", n.value = !0);
200
- }, h = () => {
201
- const a = M(g(e));
202
- !a || !n.value || (B && (o == null || o()), a.style.overflow = i, P.delete(a), n.value = !1);
203
- };
204
- return K(h), W({
205
- get() {
206
- return n.value;
207
- },
208
- set(a) {
209
- a ? s() : h();
210
- }
211
- });
212
- }
213
- function je() {
214
- let e = !1;
215
- const t = v(!1);
216
- return (n, o) => {
217
- if (t.value = o.value, e)
218
- return;
219
- e = !0;
220
- const i = Fe(n, o.value);
221
- E(t, (s) => i.value = s);
222
- };
223
- }
224
- je();
225
- let Ye = 0;
226
- const G = "ArrowDown", z = "ArrowUp", U = "Home", q = "End", Ge = "Escape", X = "Enter", ze = [G, z, U, q, X], Ue = {
227
- name: "Dropdown",
228
- components: {
229
- DropdownIcon: pe,
230
- OnClickOutside: Le,
231
- FunctionButton: ye,
232
- CloseIcon: he
233
- },
234
- props: {
235
- id: {
236
- type: String,
237
- default() {
238
- return `Dropdown-${Ye++}`;
239
- }
240
- },
241
- modelValue: {
242
- type: String,
243
- default: null
244
- },
245
- name: {
246
- type: String,
247
- default: null
248
- },
249
- placeholder: {
250
- type: String,
251
- default: null
252
- },
253
- ariaLabel: {
254
- type: String,
255
- required: !0
256
- },
257
- isValid: {
258
- default: !0,
259
- type: Boolean
260
- },
261
- disabled: {
262
- default: !1,
263
- type: Boolean
264
- },
265
- /**
266
- * The direction of the dropdown menu. When set to 'up', the menu will appear above the input field.
267
- * Defaults to 'down'.
268
- */
269
- direction: {
270
- default: "down",
271
- type: String
272
- },
273
- /**
274
- * List of possible values. Each item must have an `id` and a `text` property. To use slots an additional
275
- * slotData object must be passed which contains the data to be displayed.
276
- *
277
- * IMPORTANT: All values have to have a slotData object otherwise the slot will not be displayed and the
278
- * usual text is rendered instead.
279
- * @example
280
- * [{
281
- * id: 'pdf',
282
- * text: 'PDF'
283
- * }, {
284
- * id: 'XLS',
285
- * text: 'Excel',
286
- * }, {
287
- * id: 'JPG',
288
- * text: 'Jpeg',
289
- * slotData: {
290
- * fullName: 'Joint Photographic Experts Group',
291
- * year: '1992'
292
- * description: 'Commonly used method of lossy compression for digital images'
293
- * }
294
- * }]
295
- */
296
- possibleValues: {
297
- type: Array,
298
- default: () => []
299
- },
300
- caseSensitiveSearch: {
301
- type: Boolean,
302
- default: !1
303
- },
304
- compact: {
305
- type: Boolean,
306
- default: !1
307
- }
308
- },
309
- emits: ["update:modelValue"],
310
- setup(e) {
311
- const { caseSensitiveSearch: t, possibleValues: n } = oe(e), o = v(!1), i = W(() => {
312
- let a = {};
313
- for (let f of n.value)
314
- a[f.id] = f.text;
315
- return a;
316
- }), s = v(i.value[e.modelValue]);
317
- E(
318
- () => e.modelValue,
319
- (a) => {
320
- s.value = i.value[a];
321
- }
322
- );
323
- const h = me(
324
- s,
325
- t,
326
- n,
327
- o
328
- );
329
- return {
330
- searchValue: s,
331
- useFilterValues: o,
332
- currentPossibleValues: h
333
- };
334
- },
335
- data() {
336
- return {
337
- typingTimeout: null,
338
- isExpanded: !1,
339
- searchQuery: "",
340
- candidate: this.modelValue,
341
- emptyState: "Nothing found",
342
- optionRefs: /* @__PURE__ */ new Map(),
343
- slotContainerHeight: 0
344
- };
345
- },
346
- computed: {
347
- groupedValues() {
348
- const e = {};
349
- for (const t of this.currentPossibleValues) {
350
- const n = t.group || "";
351
- e[n] || (e[n] = { label: t.group, items: [] }), e[n].items.push(t);
352
- }
353
- return Object.values(e);
354
- },
355
- orderedGroupedValues() {
356
- const e = this.groupedValues.filter(
357
- (n) => n.items[0].group
358
- ), t = this.groupedValues.filter(
359
- (n) => !n.items[0].group
360
- );
361
- return [...e, ...t];
362
- },
363
- flatOrderedValues() {
364
- return this.orderedGroupedValues.flatMap((e) => e.items);
365
- },
366
- selectedIndex() {
367
- return this.flatOrderedValues.map((e) => e.id).indexOf(this.candidate);
368
- },
369
- showPlaceholder() {
370
- return !this.modelValue;
371
- },
372
- displayTextMap() {
373
- let e = {};
374
- for (let t of this.possibleValues)
375
- e[t.id] = t.text;
376
- return e;
377
- },
378
- displayText() {
379
- return this.showPlaceholder ? this.placeholder : this.displayTextMap.hasOwnProperty(this.modelValue) ? this.displayTextMap[this.modelValue] : `(MISSING) ${this.modelValue.toString()}`;
380
- },
381
- isMissing() {
382
- return this.modelValue && !this.displayTextMap.hasOwnProperty(this.modelValue);
383
- },
384
- hasRightIcon() {
385
- var e, t;
386
- return (t = (e = this.$slots)["icon-right"]) == null ? void 0 : t.call(e).length;
387
- },
388
- hasOptionTemplate() {
389
- return this.possibleValues.length === 0 ? !1 : this.possibleValues.every(
390
- (e) => e.slotData && !Ae(e.slotData)
391
- );
392
- },
393
- selectedOption() {
394
- return this.possibleValues.find((e) => e.id === this.modelValue);
395
- },
396
- hasNoFilteredPossibleValues() {
397
- return this.currentPossibleValues.length === 0;
398
- },
399
- nonEmptySearchValue() {
400
- var e;
401
- return ((e = this.searchValue) == null ? void 0 : e.length) > 0;
402
- },
403
- possibleValuesIsProvided() {
404
- return !!this.possibleValues.length;
405
- },
406
- isDisabled() {
407
- return this.disabled || !this.possibleValuesIsProvided;
408
- },
409
- closeIconTooltip() {
410
- return "Clear";
411
- }
412
- },
413
- watch: {
414
- currentPossibleValues(e) {
415
- var t;
416
- this.candidate = (t = e[0]) == null ? void 0 : t.id;
417
- },
418
- isExpanded() {
419
- this.useFilterValues = !1;
420
- }
421
- },
422
- methods: {
423
- updateCandidate(e) {
424
- this.candidate = e;
425
- },
426
- isCurrentValue(e) {
427
- return this.candidate === e;
428
- },
429
- getButtonRef() {
430
- return this.$refs.button;
431
- },
432
- getOptionsRefs() {
433
- return this.$refs.options;
434
- },
435
- getSearchInput() {
436
- return this.$refs.searchInput;
437
- },
438
- getListBoxNodeRef() {
439
- return this.$refs.ul;
440
- },
441
- emitAndClose(e) {
442
- this.$emit("update:modelValue", e), this.toggleExpanded();
443
- },
444
- scrollTo(e) {
445
- let t = this.getListBoxNodeRef();
446
- if (t.scrollHeight >= t.clientHeight) {
447
- let n = this.optionRefs.get(e);
448
- if (!n) {
449
- consola.error(
450
- `trying to scroll to element with Id ${e.toString()} which does not exist`
451
- );
452
- return;
453
- }
454
- let o = t.clientHeight + t.scrollTop, i = n.offsetTop + n.offsetHeight;
455
- i > o ? t.scrollTop = i - t.clientHeight : n.offsetTop < t.scrollTop && (t.scrollTop = n.offsetTop);
456
- }
457
- },
458
- onArrowDown() {
459
- let e = this.selectedIndex + 1;
460
- if (e >= this.flatOrderedValues.length)
461
- return;
462
- const t = this.flatOrderedValues[e].id;
463
- this.updateCandidate(t), this.scrollTo(t);
464
- },
465
- onArrowUp() {
466
- let e = this.selectedIndex - 1;
467
- if (e < 0)
468
- return;
469
- const t = this.flatOrderedValues[e].id;
470
- this.updateCandidate(t), this.scrollTo(t);
471
- },
472
- onEnter() {
473
- this.hasNoFilteredPossibleValues || typeof this.candidate > "u" || this.emitAndClose(this.candidate);
474
- },
475
- onEndKey() {
476
- let e = this.flatOrderedValues.length - 1;
477
- this.updateCandidate(this.flatOrderedValues[e].id);
478
- const t = this.getListBoxNodeRef();
479
- t.scrollTop = t.scrollHeight;
480
- },
481
- onHomeKey() {
482
- this.updateCandidate(this.flatOrderedValues[0].id), this.getListBoxNodeRef().scrollTop = 0;
483
- },
484
- toggleExpanded() {
485
- this.isExpanded ? this.collapse() : this.expand();
486
- },
487
- async expand() {
488
- var e, t;
489
- this.isDisabled || (this.searchValue = this.displayTextMap[this.modelValue], this.hasOptionTemplate && (this.slotContainerHeight = ((e = this.$refs.slotContainer) == null ? void 0 : e.clientHeight) ?? 0), this.isExpanded = !0, this.candidate === this.modelValue && (this.isMissing || this.showPlaceholder) && this.updateCandidate((t = this.currentPossibleValues[0]) == null ? void 0 : t.id), await ie(), this.getSearchInput().focus(), this.getSearchInput().select(), this.candidate && this.scrollTo(this.candidate));
490
- },
491
- collapse() {
492
- this.isExpanded = !1, this.getButtonRef().focus();
493
- },
494
- /* NOTE: we use a single keyDown method because @keydown.up bindings are not testable. */
495
- handleKeyDownButton(e) {
496
- this.isExpanded ? this.handleKeyDownOnExpanded(e) : Oe(e, ze) && (this.expand(), e.preventDefault());
497
- },
498
- handleKeyDownOnExpanded(e) {
499
- e.key === G && (this.onArrowDown(), e.preventDefault()), e.key === z && (this.onArrowUp(), e.preventDefault()), e.key === q && (this.onEndKey(), e.preventDefault()), e.key === U && (this.onHomeKey(), e.preventDefault()), e.key === Ge && (this.collapse(), e.preventDefault(), e.stopPropagation()), e.key === X && (this.onEnter(), e.preventDefault());
500
- },
501
- hasSelection() {
502
- return !!(this.modelValue && !this.isMissing);
503
- },
504
- getCurrentSelectedId() {
505
- try {
506
- return this.flatOrderedValues[this.selectedIndex].id;
507
- } catch {
508
- return "";
509
- }
510
- },
511
- generateId(e, t = null) {
512
- if (!t)
513
- return `${e}-${this.id}`;
514
- let n = String(t).replace(/[^\w]/gi, "");
515
- return `${e}-${this.id}-${n}`;
516
- },
517
- closeDropdown() {
518
- this.searchValue = this.displayTextMap[this.modelValue], this.isExpanded = !1;
519
- },
520
- handleSearch(e) {
521
- this.useFilterValues = !0, this.searchValue = e;
522
- },
523
- handleResetInput() {
524
- this.searchValue = "", this.getSearchInput().focus();
525
- }
526
- }
527
- }, qe = (e) => (ce("data-v-67482aeb"), e = e(), fe(), e), Xe = ["id"], Qe = ["id", "aria-label", "aria-labelledby", "aria-expanded"], Je = ["value"], Ze = {
528
- key: 1,
529
- ref: "slotContainer"
530
- }, $e = { class: "right" }, et = {
531
- key: 0,
532
- class: "loading-icon"
533
- }, tt = ["aria-activedescendant"], nt = {
534
- key: 0,
535
- class: "empty-state"
536
- }, st = /* @__PURE__ */ qe(() => /* @__PURE__ */ w("span", { class: "group-divider" }, null, -1)), ot = ["id", "title", "aria-selected", "onMouseenter", "onClick"], it = ["id", "name", "value"];
537
- function rt(e, t, n, o, i, s) {
538
- const h = S("CloseIcon"), a = S("FunctionButton"), f = S("DropdownIcon"), p = S("OnClickOutside");
539
- return m(), I(p, { onTrigger: s.closeDropdown }, {
540
- default: D(() => {
541
- var u;
542
- return [
543
- w("div", {
544
- id: n.id,
545
- class: V([
546
- "dropdown",
547
- {
548
- collapsed: !i.isExpanded,
549
- invalid: !n.isValid,
550
- disabled: s.isDisabled,
551
- compact: n.compact
552
- }
553
- ])
554
- }, [
555
- w("div", {
556
- id: s.generateId("button"),
557
- ref: "button",
558
- role: "button",
559
- tabindex: "0",
560
- "aria-haspopup": "listbox",
561
- class: V({
562
- placeholder: s.showPlaceholder && !i.isExpanded,
563
- missing: s.isMissing && !i.isExpanded,
564
- "has-option-template": s.hasOptionTemplate && !i.isExpanded
565
- }),
566
- style: re({
567
- ...i.isExpanded && s.hasOptionTemplate && {
568
- height: `calc(${i.slotContainerHeight}px + 0 * var(--form-border-width))`,
569
- boxSizing: "content-box"
570
- }
571
- }),
572
- "aria-label": n.ariaLabel,
573
- "aria-labelledby": s.generateId("button"),
574
- "aria-expanded": i.isExpanded,
575
- onClick: t[3] || (t[3] = (...d) => s.toggleExpanded && s.toggleExpanded(...d)),
576
- onKeydown: t[4] || (t[4] = (...d) => s.handleKeyDownButton && s.handleKeyDownButton(...d))
577
- }, [
578
- i.isExpanded ? (m(), y("input", {
579
- key: 0,
580
- ref: "searchInput",
581
- value: o.searchValue,
582
- tabindex: "0",
583
- role: "searchbox",
584
- class: "search-input",
585
- type: "text",
586
- onClick: t[0] || (t[0] = k(() => {
587
- }, ["stop"])),
588
- onInput: t[1] || (t[1] = (d) => s.handleSearch(d.target.value))
589
- }, null, 40, Je)) : s.hasOptionTemplate ? (m(), y("div", Ze, [
590
- _(e.$slots, "option", {
591
- slotData: (u = s.selectedOption) == null ? void 0 : u.slotData,
592
- isMissing: s.isMissing,
593
- selectedValue: n.modelValue,
594
- expanded: !1
595
- })
596
- ], 512)) : (m(), y("span", {
597
- key: 2,
598
- ref: "span"
599
- }, T(s.displayText), 513)),
600
- w("div", $e, [
601
- s.hasRightIcon ? (m(), y("div", et, [
602
- _(e.$slots, "icon-right")
603
- ])) : C("", !0),
604
- i.isExpanded && s.nonEmptySearchValue ? (m(), I(a, {
605
- key: 1,
606
- ref: "closeButton",
607
- title: "Close",
608
- tabindex: "0",
609
- class: "button",
610
- compact: n.compact,
611
- onKeydown: t[2] || (t[2] = le(k(() => {
612
- }, ["stop"]), ["enter"])),
613
- onClick: k(s.handleResetInput, ["stop"])
614
- }, {
615
- default: D(() => [
616
- N(h, { class: "icon" })
617
- ]),
618
- _: 1
619
- }, 8, ["compact", "onClick"])) : C("", !0),
620
- !i.isExpanded || !s.nonEmptySearchValue ? (m(), I(a, {
621
- key: 2,
622
- class: "button",
623
- compact: n.compact,
624
- disabled: s.isDisabled,
625
- title: i.isExpanded ? "Cancel" : "Expand",
626
- tabindex: i.isExpanded ? 0 : -1,
627
- onClick: k(s.toggleExpanded, ["stop"])
628
- }, {
629
- default: D(() => [
630
- N(f, {
631
- class: V(["dropdown-icon", "icon"])
632
- })
633
- ]),
634
- _: 1
635
- }, 8, ["compact", "disabled", "title", "tabindex", "onClick"])) : C("", !0)
636
- ])
637
- ], 46, Qe),
638
- ae(w("ul", {
639
- ref: "ul",
640
- role: "listbox",
641
- tabindex: "-1",
642
- "aria-activedescendant": i.isExpanded ? s.generateId("option", s.getCurrentSelectedId()) : void 0,
643
- class: V({ "drops-upwards": n.direction === "up" })
644
- }, [
645
- s.hasNoFilteredPossibleValues ? (m(), y("div", nt, T(i.emptyState), 1)) : C("", !0),
646
- (m(!0), y(O, null, R(s.orderedGroupedValues, (d, l) => (m(), y(O, { key: l }, [
647
- st,
648
- (m(!0), y(O, null, R(d.items, (r) => (m(), y("li", {
649
- id: s.generateId("option", r.id),
650
- key: `listbox-${r.id}`,
651
- ref_for: !0,
652
- ref: (c) => i.optionRefs.set(r.id, c),
653
- role: "option",
654
- title: typeof r.title > "u" ? r.text : r.title,
655
- class: V({
656
- focused: s.isCurrentValue(r.id),
657
- noselect: !0,
658
- empty: r.text.trim() === "",
659
- "has-option-template": s.hasOptionTemplate
660
- }),
661
- "aria-selected": s.isCurrentValue(r.id),
662
- onMouseenter: (c) => s.updateCandidate(r.id),
663
- onClick: (c) => s.emitAndClose(r.id)
664
- }, [
665
- s.hasOptionTemplate ? _(e.$slots, "option", {
666
- key: 0,
667
- slotData: r.slotData,
668
- expanded: !0
669
- }) : (m(), y(O, { key: 1 }, [
670
- de(T(r.text), 1)
671
- ], 64))
672
- ], 42, ot))), 128))
673
- ], 64))), 128))
674
- ], 10, tt), [
675
- [ue, i.isExpanded]
676
- ]),
677
- w("input", {
678
- id: n.id,
679
- type: "hidden",
680
- name: n.name,
681
- value: n.modelValue
682
- }, null, 8, it)
683
- ], 10, Xe)
684
- ];
685
- }),
686
- _: 3
687
- }, 8, ["onTrigger"]);
688
- }
689
- const yt = /* @__PURE__ */ ke(Ue, [["render", rt], ["__scopeId", "data-v-67482aeb"]]);
690
- export {
691
- yt as D
692
- };