@knime/jsonforms 1.15.0 → 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 (117) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/AnyOfTwinlist-BmHETHvW.js +28 -0
  3. package/dist/{Button-Cqwayw73.js → Button-B9RSLVI2.js} +8 -7
  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-R0DlbAdT.js → ComboBoxControl-2r1FWcy-.js} +234 -165
  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-Cs0KqlOS.js → DateTimeInput-DcwhvMD2.js} +421 -377
  14. package/dist/{Dropdown-BEx-cvXH.js → Dropdown-D49sEHBa.js} +140 -85
  15. package/dist/DropdownControl-aeEqC-Yg.js +46 -0
  16. package/dist/HorizontalLayout-D0toQmVl.js +39 -0
  17. package/dist/{InputField-OkFB9VHZ.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-2fVBipAl.js → MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_bd2eaa56_lang-pnMOUiIt.js} +1 -1
  26. package/dist/{MultiselectListBox-CMTJnAWr.js → MultiselectListBox-CfdPbcn1.js} +96 -72
  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-BepS3tAK.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-CE6whfV5.js → RichTextControl-B1mJMs1e.js} +4126 -3777
  35. package/dist/SectionHeading-B6JkPyMh.js +31 -0
  36. package/dist/{SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js → SectionHeading.vue_vue_type_style_index_0_scoped_f06e9b7d_lang-B5ALSUVO.js} +5456 -5284
  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-DdH9cM67.js → _baseEach-CWap1NWh.js} +2 -2
  58. package/dist/{_baseIteratee-BGt-t7Os.js → _baseIteratee-D0MXvnuf.js} +3 -3
  59. package/dist/{_getTag-DAFySze4.js → _getTag-BvpAzjaz.js} +1 -1
  60. package/dist/{arrow-dropdown-BAFsD8Su.js → arrow-dropdown-eS-nVNCv.js} +7 -1
  61. package/dist/{arrow-next-BQVCxGb8.js → arrow-next-BmOStWql.js} +7 -1
  62. package/dist/{close-DGt8x-x_.js → close-0dYG2oDA.js} +7 -1
  63. package/dist/knime-jsonforms.css +1 -1
  64. package/dist/knime-jsonforms.js +134 -108
  65. package/dist/{localTimeUtils-NIKgHnIr.js → localTimeUtils-CfchSrLG.js} +1 -1
  66. package/dist/{reload-DCdbNLa2.js → reload-57Xc2t-6.js} +7 -1
  67. package/dist/testing.js +2 -2
  68. package/dist/{toString-BhubvA3m.js → toString-C-X8cE7K.js} +1 -1
  69. package/dist/{useBuiltinValidations-Boxrm71q.js → useBuiltinValidations-D0WuEacN.js} +1 -1
  70. package/dist/{usePossibleValues-DXuWWBh_.js → usePossibleValues-DTVXBGRC.js} +1 -1
  71. package/package.json +4 -4
  72. package/dist/AnyOfTwinlist-Co_sJAsc.js +0 -22
  73. package/dist/CheckboxControl-C10_DX1N.js +0 -40
  74. package/dist/Checkboxes-DWOxHiUX.js +0 -103
  75. package/dist/CheckboxesControl-BMRFgmO_.js +0 -38
  76. package/dist/DateControl-DAGAM92B.js +0 -29
  77. package/dist/DateTimeControl-DJhIb_U4.js +0 -45
  78. package/dist/DateTimeFormatInput-BhLQzC-P.js +0 -373
  79. package/dist/DateTimeFormatPickerControl-V7pxRYaW.js +0 -40
  80. package/dist/DateTimeFormatPickerWithTypeControl-3fa75rGw.js +0 -76
  81. package/dist/DropdownControl-DEIA5VD4.js +0 -31
  82. package/dist/HorizontalLayout-DCfhMNq4.js +0 -25
  83. package/dist/IntegerControl-Om8J7hch.js +0 -20
  84. package/dist/IntervalControl-B7UbyyD-.js +0 -545
  85. package/dist/LoadingDropdown-CINkq_Sw.js +0 -40
  86. package/dist/ManualTwinlistControl-BLTfr2gT.js +0 -79
  87. package/dist/MultiSelectListBoxControl-j1TaFtQj.js +0 -31
  88. package/dist/MultimodeTwinlistControl-BsFqHRFM.js +0 -459
  89. package/dist/NameFilter-d5k6rDVY.js +0 -24
  90. package/dist/NumberControl-Kc3hvVef.js +0 -20
  91. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-BOCR1qXG.js +0 -50
  92. package/dist/OneOfDropdown-CLwVXrbC.js +0 -33
  93. package/dist/RadioControl-DpziR8nA.js +0 -24
  94. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-DVIeg5W1.js +0 -104
  95. package/dist/SectionHeading-D7znCZXu.js +0 -19
  96. package/dist/SectionLayout-BhXDOzqB.js +0 -46
  97. package/dist/SettingsSubPanel-x9uWGoiu.js +0 -5
  98. package/dist/SettingsSubPanelLayout-BPHBM5n5.js +0 -62
  99. package/dist/SimpleButtonControl-DfCSlgZS.js +0 -61
  100. package/dist/SimpleTwinlistControl-CBalniCf.js +0 -25
  101. package/dist/SingleSelectControl-DC4w0ata.js +0 -58
  102. package/dist/SingleSelectListBoxControl-CKj-p8jZ.js +0 -232
  103. package/dist/SortListControl-BIUyPjCi.js +0 -377
  104. package/dist/StyledListItem-D-HJWfo5.js +0 -72
  105. package/dist/TextAreaControl-D28TQZEY.js +0 -108
  106. package/dist/TextControl-DUDBWcHy.js +0 -4
  107. package/dist/TextControl.vue_vue_type_script_setup_true_lang-DpAd3yOu.js +0 -47
  108. package/dist/TimeControl-HRooO_z3.js +0 -36
  109. package/dist/TwinlistControlBase-Brfh5pqZ.js +0 -40
  110. package/dist/TwinlistLoadingInfo-C4Tta00d.js +0 -946
  111. package/dist/TypedStringFilter-CdvgPKhD.js +0 -26
  112. package/dist/ValueSwitch-W4y1YvNM.js +0 -131
  113. package/dist/ValueSwitchControl-BaXH8Cjx.js +0 -20
  114. package/dist/VerticalLayout-ChAmRKNj.js +0 -30
  115. package/dist/VerticalLayoutBase-DAk4vfH5.js +0 -20
  116. package/dist/ZonedDateTimeControl-Qb57KmMT.js +0 -69
  117. package/dist/svgWithTitle-CnTmPYAB.js +0 -18
@@ -1,104 +0,0 @@
1
- import { resolveComponent as p, createBlock as c, openBlock as m, normalizeClass as b, defineComponent as f, computed as n, ref as v, toRef as V, onMounted as B, createCommentVNode as h, resolveDynamicComponent as y } from "vue";
2
- import { o as _ } from "./index-Blg1O3Fz.js";
3
- import { u as g } from "./usePossibleValues-DXuWWBh_.js";
4
- import { B as C, V as R } from "./ValueSwitch-W4y1YvNM.js";
5
- import { _ as O } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
6
- const S = {
7
- name: "RadioButtons",
8
- components: {
9
- BaseRadioButtons: C
10
- },
11
- props: {
12
- // these props are passed to BaseRadioButtons
13
- id: {
14
- type: String,
15
- default: null
16
- },
17
- modelValue: {
18
- type: String,
19
- default: ""
20
- },
21
- disabled: {
22
- default: !1,
23
- type: Boolean
24
- },
25
- /**
26
- * List of possible values. Each item must have an `id` and a `text` property
27
- * @example
28
- * [{
29
- * id: 'pdf',
30
- * text: 'PDF'
31
- * }, {
32
- * id: 'XLS',
33
- * text: 'Excel',
34
- * }]
35
- */
36
- possibleValues: {
37
- type: Array,
38
- default: () => []
39
- },
40
- // additional props
41
- alignment: {
42
- type: String,
43
- default: "horizontal",
44
- validator(t) {
45
- return ["horizontal", "vertical"].includes(t);
46
- }
47
- }
48
- },
49
- emits: ["update:modelValue"],
50
- methods: {
51
- hasSelection() {
52
- return this.$refs.radioButton.$refs.input.some((t) => t.checked);
53
- }
54
- }
55
- };
56
- function F(t, e, o, i, d, u) {
57
- const l = p("BaseRadioButtons");
58
- return m(), c(l, {
59
- id: o.id,
60
- ref: "radioButton",
61
- "possible-values": o.possibleValues,
62
- "model-value": o.modelValue,
63
- disabled: o.disabled,
64
- class: b(["radio-buttons", o.alignment, { disabled: o.disabled }]),
65
- "onUpdate:modelValue": e[0] || (e[0] = (s) => t.$emit("update:modelValue", s))
66
- }, null, 8, ["id", "possible-values", "model-value", "disabled", "class"]);
67
- }
68
- const k = /* @__PURE__ */ O(S, [["render", F], ["__scopeId", "data-v-e428929b"]]), A = /* @__PURE__ */ f({
69
- __name: "RadioControlBase",
70
- props: {
71
- control: {},
72
- handleChange: { type: Function },
73
- changeValue: { type: Function },
74
- disabled: { type: Boolean },
75
- isValid: { type: Boolean },
76
- onRegisterValidation: { type: Function },
77
- labelForId: {},
78
- type: {}
79
- },
80
- setup(t) {
81
- const e = t, o = n(() => e.control.uischema.options?.radioLayout), i = n(
82
- () => e.control.uischema.options?.disabledOptions ?? []
83
- ), d = (a) => i.value.includes(a.id) ? { ...a, disabled: !0 } : a, u = n(
84
- () => e.type === "valueSwitch" ? R : k
85
- ), l = v(null), { possibleValues: s } = g(V(e, "control")), r = n(
86
- () => (l.value ?? s.value)?.map(d)
87
- );
88
- return B(() => {
89
- l.value = e.control?.schema?.oneOf ? e.control.schema.oneOf.map(_) : null;
90
- }), (a, z) => r.value ? (m(), c(y(u.value), {
91
- key: 0,
92
- id: a.labelForId,
93
- "possible-values": r.value,
94
- alignment: o.value,
95
- disabled: a.disabled,
96
- "model-value": a.control.data,
97
- compact: "",
98
- "onUpdate:modelValue": a.changeValue
99
- }, null, 8, ["id", "possible-values", "alignment", "disabled", "model-value", "onUpdate:modelValue"])) : h("", !0);
100
- }
101
- });
102
- export {
103
- A as _
104
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as o, createElementBlock as n, openBlock as s, createElementVNode as t, renderSlot as r, toDisplayString as i } from "vue";
2
- import { _ as c } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
3
- const a = { class: "section-header" }, d = { class: "section-header-layout-container" }, _ = /* @__PURE__ */ o({
4
- __name: "SectionHeading",
5
- props: {
6
- titleText: {}
7
- },
8
- setup(l) {
9
- return (e, p) => (s(), n("div", a, [
10
- t("div", d, [
11
- t("h3", null, i(e.titleText), 1),
12
- r(e.$slots, "right-buttons", {}, void 0, !0)
13
- ])
14
- ]));
15
- }
16
- }), u = /* @__PURE__ */ c(_, [["__scopeId", "data-v-625edfbe"]]);
17
- export {
18
- u as S
19
- };
@@ -1,46 +0,0 @@
1
- import { defineComponent as u, ref as i, createElementBlock as m, openBlock as l, createVNode as s, withCtx as r, renderSlot as p, createBlock as c, unref as d } from "vue";
2
- import { x as f, _ as y } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
3
- import { V as h } from "./VerticalLayoutBase-DAk4vfH5.js";
4
- import { S as v } from "./SectionHeading-D7znCZXu.js";
5
- const b = /* @__PURE__ */ u({
6
- __name: "SectionLayout",
7
- props: {
8
- layout: {}
9
- },
10
- setup($) {
11
- const o = i(!1);
12
- return (e, t) => (l(), m("div", {
13
- class: "section",
14
- onMouseover: t[0] || (t[0] = (a) => o.value = !0),
15
- onMouseleave: t[1] || (t[1] = (a) => o.value = !1)
16
- }, [
17
- s(v, {
18
- "title-text": e.layout.uischema.label
19
- }, {
20
- "right-buttons": r(() => [
21
- p(e.$slots, "buttons", { hover: o.value }, void 0, !0)
22
- ]),
23
- _: 3
24
- }, 8, ["title-text"]),
25
- s(h, {
26
- elements: e.layout.uischema.elements
27
- }, {
28
- default: r(({ element: a, index: n }) => [
29
- (l(), c(d(f), {
30
- key: `${e.layout.path}-${n}`,
31
- schema: e.layout.schema,
32
- uischema: a,
33
- path: e.layout.path,
34
- enabled: e.layout.enabled,
35
- renderers: e.layout.renderers,
36
- cells: e.layout.cells
37
- }, null, 8, ["schema", "uischema", "path", "enabled", "renderers", "cells"]))
38
- ]),
39
- _: 1
40
- }, 8, ["elements"])
41
- ], 32));
42
- }
43
- }), V = /* @__PURE__ */ y(b, [["__scopeId", "data-v-84fc355c"]]);
44
- export {
45
- V as default
46
- };
@@ -1,5 +0,0 @@
1
- import { _ as a, z as s } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
2
- const _ = /* @__PURE__ */ a(s, [["__scopeId", "data-v-11a709c8"]]);
3
- export {
4
- _ as S
5
- };
@@ -1,62 +0,0 @@
1
- import { defineComponent as i, createBlock as n, openBlock as s, withCtx as t, createVNode as a, unref as l, createElementVNode as m } from "vue";
2
- import { x as c, v as p, _ as d } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
3
- import { N as f } from "./arrow-next-BQVCxGb8.js";
4
- import { V as h } from "./VerticalLayoutBase-DAk4vfH5.js";
5
- import { S as y } from "./SectionHeading-D7znCZXu.js";
6
- import { S as b } from "./SettingsSubPanel-x9uWGoiu.js";
7
- const S = /* @__PURE__ */ i({
8
- __name: "SettingsSubPanelLayout",
9
- props: {
10
- layout: {}
11
- },
12
- setup(_) {
13
- return (e, r) => (s(), n(b, {
14
- "show-back-arrow": "",
15
- "background-color-override": "var(--knime-gray-ultra-light"
16
- }, {
17
- "expand-button": t(({ expand: o }) => [
18
- a(y, {
19
- "title-text": e.layout.uischema.label
20
- }, {
21
- "right-buttons": t(() => [
22
- a(l(p), {
23
- compact: "",
24
- class: "set-button",
25
- onClick: o
26
- }, {
27
- default: t(() => [
28
- r[0] || (r[0] = m("span", null, "Set", -1)),
29
- a(l(f))
30
- ]),
31
- _: 2,
32
- __: [0]
33
- }, 1032, ["onClick"])
34
- ]),
35
- _: 2
36
- }, 1032, ["title-text"])
37
- ]),
38
- default: t(() => [
39
- a(h, {
40
- elements: e.layout.uischema.elements
41
- }, {
42
- default: t(({ element: o, index: u }) => [
43
- (s(), n(l(c), {
44
- key: `${e.layout.path}-${u}`,
45
- schema: e.layout.schema,
46
- uischema: o,
47
- path: e.layout.path,
48
- enabled: e.layout.enabled,
49
- renderers: e.layout.renderers,
50
- cells: e.layout.cells
51
- }, null, 8, ["schema", "uischema", "path", "enabled", "renderers", "cells"]))
52
- ]),
53
- _: 1
54
- }, 8, ["elements"])
55
- ]),
56
- _: 1
57
- }));
58
- }
59
- }), V = /* @__PURE__ */ d(S, [["__scopeId", "data-v-eab8ed9f"]]);
60
- export {
61
- V as default
62
- };
@@ -1,61 +0,0 @@
1
- import { defineComponent as u, createBlock as p, openBlock as s, resolveDynamicComponent as f, computed as r, ref as g, createElementBlock as _, createVNode as b, renderSlot as y, unref as B, withCtx as C, createCommentVNode as h, createTextVNode as I, toDisplayString as V } from "vue";
2
- import { A as k, _ as F } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
3
- import { R as S } from "./reload-DCdbNLa2.js";
4
- import { B as $ } from "./Button-Cqwayw73.js";
5
- const x = /* @__PURE__ */ u({
6
- __name: "DynamicIcon",
7
- props: {
8
- icon: {}
9
- },
10
- setup(a) {
11
- const e = {
12
- reload: S
13
- };
14
- return (t, l) => (s(), p(f(e[t.icon])));
15
- }
16
- }), D = /* @__PURE__ */ u({
17
- __name: "SimpleButtonControl",
18
- props: {
19
- control: {},
20
- handleChange: { type: Function },
21
- changeValue: { type: Function },
22
- disabled: { type: Boolean },
23
- labelForId: {},
24
- isValid: { type: Boolean },
25
- messages: {},
26
- onRegisterValidation: { type: Function }
27
- },
28
- setup(a) {
29
- const e = a, t = r(() => !e.control.enabled), l = r(() => e.control.uischema.options.triggerId), i = r(
30
- () => e.control.uischema.options.icon
31
- ), d = k("trigger"), m = () => {
32
- d({ id: l.value });
33
- }, n = g(!1);
34
- return (c, o) => (s(), _("div", {
35
- class: "simple-button-input",
36
- onMouseover: o[0] || (o[0] = (v) => n.value = !0),
37
- onMouseleave: o[1] || (o[1] = (v) => n.value = !1)
38
- }, [
39
- b(B($), {
40
- compact: "",
41
- "with-border": "",
42
- disabled: t.value,
43
- class: "button-input",
44
- onClick: m
45
- }, {
46
- default: C(() => [
47
- i.value ? (s(), p(x, {
48
- key: 0,
49
- icon: i.value
50
- }, null, 8, ["icon"])) : h("", !0),
51
- I(V(c.control.label), 1)
52
- ]),
53
- _: 1
54
- }, 8, ["disabled"]),
55
- y(c.$slots, "buttons", { hover: n.value }, void 0, !0)
56
- ], 32));
57
- }
58
- }), j = /* @__PURE__ */ F(D, [["__scopeId", "data-v-71d12dcd"]]);
59
- export {
60
- j as default
61
- };
@@ -1,25 +0,0 @@
1
- import { defineComponent as s, toRef as i, createBlock as l, openBlock as a, mergeProps as r, unref as p } from "vue";
2
- import { u as c } from "./usePossibleValues-DXuWWBh_.js";
3
- import { T as u } from "./TwinlistControlBase-Brfh5pqZ.js";
4
- const h = /* @__PURE__ */ s({
5
- __name: "SimpleTwinlistControl",
6
- props: {
7
- control: {},
8
- handleChange: { type: Function },
9
- changeValue: { type: Function },
10
- disabled: { type: Boolean },
11
- isValid: { type: Boolean },
12
- onRegisterValidation: { type: Function },
13
- labelForId: {}
14
- },
15
- setup(e) {
16
- const o = e, t = i(o, "control"), { possibleValues: n } = c(t);
17
- return (m, d) => (a(), l(u, r(o, {
18
- "possible-values": p(n),
19
- "twinlist-size": o.control.uischema.options?.twinlistSize
20
- }), null, 16, ["possible-values", "twinlist-size"]));
21
- }
22
- });
23
- export {
24
- h as default
25
- };
@@ -1,58 +0,0 @@
1
- import { defineComponent as I, computed as n, toRef as y, createBlock as v, openBlock as w } from "vue";
2
- import { u as F } from "./usePossibleValues-DXuWWBh_.js";
3
- import { L as R } from "./LoadingDropdown-CINkq_Sw.js";
4
- const t = "__special__", i = "__regular__", L = /* @__PURE__ */ I({
5
- __name: "SingleSelectControl",
6
- props: {
7
- control: {},
8
- handleChange: { type: Function },
9
- changeValue: { type: Function },
10
- disabled: { type: Boolean },
11
- isValid: { type: Boolean },
12
- onRegisterValidation: { type: Function },
13
- labelForId: {}
14
- },
15
- setup(p) {
16
- const r = p, d = n(
17
- () => r.control.uischema.options.specialChoices
18
- ), { possibleValues: c } = F(
19
- y(r, "control")
20
- ), l = (e) => `${t}${e}`, s = (e) => `${i}${e}`, h = ({
21
- id: e,
22
- text: o
23
- }) => ({
24
- id: l(e),
25
- text: o,
26
- isSpecial: !0
27
- }), f = ({
28
- id: e,
29
- text: o
30
- }) => ({
31
- id: s(e),
32
- text: o
33
- }), a = n(() => c.value === null ? null : d.value.map(h).concat(c.value.map(f))), C = (e) => {
34
- if (!e.startsWith(i) && !e.startsWith(t))
35
- throw new Error(`Expected id to start with ${i}`);
36
- }, m = (e) => e ? (C(e), e.startsWith(t) ? { specialChoice: e.slice(t.length) } : { regularChoice: e.slice(i.length) }) : null, b = (e) => typeof e > "u" || e === null ? "" : "regularChoice" in e && e.regularChoice ? s(e.regularChoice) : "specialChoice" in e && e.specialChoice ? l(e.specialChoice) : "", g = (e) => typeof e > "u" || e === null ? "" : "regularChoice" in e && e.regularChoice ? e.regularChoice : "specialChoice" in e && e.specialChoice ? e.specialChoice : "", u = n({
37
- get: () => {
38
- const e = b(r.control.data);
39
- return a.value && !a.value.some((o) => o.id === e) ? g(r.control.data) : e;
40
- },
41
- set: (e) => {
42
- r.changeValue(m(e));
43
- }
44
- });
45
- return (e, o) => (w(), v(R, {
46
- id: e.labelForId,
47
- modelValue: u.value,
48
- "onUpdate:modelValue": o[0] || (o[0] = (_) => u.value = _),
49
- "possible-values": a.value,
50
- ariaLabel: e.control.label,
51
- disabled: e.disabled,
52
- compact: ""
53
- }, null, 8, ["id", "modelValue", "possible-values", "ariaLabel", "disabled"]));
54
- }
55
- });
56
- export {
57
- L as default
58
- };
@@ -1,232 +0,0 @@
1
- import { resolveComponent as m, createElementBlock as u, openBlock as a, normalizeClass as c, createElementVNode as V, normalizeStyle as h, Fragment as y, renderList as I, createBlock as f, defineComponent as x, toRef as g, createCommentVNode as v, unref as o } from "vue";
2
- import { u as S } from "./usePossibleValues-DXuWWBh_.js";
3
- import { S as C } from "./StyledListItem-D-HJWfo5.js";
4
- import { _ as L, B as _ } from "./SectionHeading.vue_vue_type_style_index_0_scoped_625edfbe_lang-DR31vaIu.js";
5
- const B = 40, w = 38, H = 36, T = 35, K = {
6
- name: "ListBox",
7
- components: {
8
- StyledListItem: C
9
- },
10
- props: {
11
- id: {
12
- type: String,
13
- default() {
14
- return `ListBox-${_()}`;
15
- }
16
- },
17
- modelValue: {
18
- type: String,
19
- default: ""
20
- },
21
- /**
22
- * Controls the size of the list. Number of visible items (for others user need to scroll)
23
- * 0 means all
24
- */
25
- size: {
26
- type: Number,
27
- default: 0,
28
- validator(e) {
29
- return e >= 0;
30
- }
31
- },
32
- isValid: {
33
- default: !0,
34
- type: Boolean
35
- },
36
- ariaLabel: {
37
- type: String,
38
- required: !0
39
- },
40
- /**
41
- * List of possible values. Each item must have an `id` and a `text` property
42
- * @example
43
- * [{
44
- * id: 'pdf',
45
- * text: 'PDF'
46
- * }, {
47
- * id: 'XLS',
48
- * text: 'Excel',
49
- * }]
50
- */
51
- possibleValues: {
52
- type: Array,
53
- default: () => [],
54
- validator(e) {
55
- return Array.isArray(e) ? e.every(
56
- (t) => t.hasOwnProperty("id") && t.hasOwnProperty("text")
57
- ) : !1;
58
- }
59
- },
60
- disabled: {
61
- type: Boolean,
62
- default: !1
63
- }
64
- },
65
- emits: ["update:modelValue"],
66
- data() {
67
- return {
68
- selectedIndex: -1,
69
- invalidPossibleValueIds: [],
70
- optionLineHeight: 22
71
- };
72
- },
73
- computed: {
74
- ulSizeStyle() {
75
- const e = (t) => `${t * this.optionLineHeight + 2}px`;
76
- return this.size > 0 ? { height: e(this.size) } : { minHeight: e(2) };
77
- },
78
- selectableValues() {
79
- return [
80
- ...this.invalidPossibleValueIds.map((e) => this.generateInvalidItem(e)),
81
- ...this.possibleValues
82
- ];
83
- }
84
- },
85
- watch: {
86
- modelValue(e) {
87
- this.updateSelectedIndexAndInvalidValue(e);
88
- }
89
- },
90
- mounted() {
91
- this.updateSelectedIndexAndInvalidValue(this.modelValue);
92
- },
93
- methods: {
94
- updateSelectedIndexAndInvalidValue(e) {
95
- const t = this.selectableValues.findIndex((l) => l.id === e);
96
- t === -1 && e ? (this.invalidPossibleValueIds.includes(e) || this.invalidPossibleValueIds.push(e), this.selectedIndex = this.selectableValues.findIndex(
97
- (l) => l.id === e
98
- )) : this.selectedIndex = t;
99
- },
100
- isCurrentValue(e) {
101
- return this.modelValue === e;
102
- },
103
- setSelected(e, t) {
104
- this.disabled || (consola.trace("ListBox setSelected on", e), this.selectedIndex = t, this.$emit("update:modelValue", e));
105
- },
106
- scrollToCurrent() {
107
- const e = this.$refs.ul;
108
- if (e.scrollHeight > e.clientHeight) {
109
- const t = this.$refs.options[this.selectedIndex], l = e.clientHeight + e.scrollTop, n = t.offsetTop + t.offsetHeight;
110
- n > l ? e.scrollTop = n - e.clientHeight : t.offsetTop < e.scrollTop && (e.scrollTop = t.offsetTop);
111
- }
112
- },
113
- onArrowDown() {
114
- if (this.disabled)
115
- return;
116
- const e = this.selectedIndex + 1;
117
- e >= this.selectableValues.length || (this.setSelected(this.selectableValues[e].id, e), this.scrollToCurrent());
118
- },
119
- onArrowUp() {
120
- if (this.disabled)
121
- return;
122
- const e = this.selectedIndex - 1;
123
- e < 0 || (this.setSelected(this.selectableValues[e].id, e), this.scrollToCurrent());
124
- },
125
- onEndKey() {
126
- if (this.disabled)
127
- return;
128
- const e = this.selectableValues.length - 1;
129
- this.setSelected(this.selectableValues[e].id, e), this.$refs.ul.scrollTop = this.$refs.ul.scrollHeight;
130
- },
131
- onHomeKey() {
132
- if (this.disabled)
133
- return;
134
- const e = 0;
135
- this.setSelected(this.selectableValues[e].id, e), this.$refs.ul.scrollTop = 0;
136
- },
137
- handleKeyDown(e) {
138
- this.disabled || (e.keyCode === B && (this.onArrowDown(), e.preventDefault()), e.keyCode === w && (this.onArrowUp(), e.preventDefault()), e.keyCode === T && (this.onEndKey(), e.preventDefault()), e.keyCode === H && (this.onHomeKey(), e.preventDefault()));
139
- },
140
- hasSelection() {
141
- return this.selectedIndex >= 0;
142
- },
143
- validate() {
144
- return { isValid: !this.getCurrentItem().invalid, errorMessage: null };
145
- },
146
- getCurrentItem() {
147
- return this.selectableValues[this.selectedIndex] || { id: "", text: "" };
148
- },
149
- generateInvalidItem(e) {
150
- return {
151
- id: e,
152
- text: `(MISSING) ${e}`,
153
- invalid: !0
154
- };
155
- },
156
- generateOptionId(e) {
157
- if (!e || !e.id)
158
- return "";
159
- const t = e.id.replace(/[^\w]/gi, "");
160
- return `option-${this.id}-${t}`;
161
- }
162
- }
163
- }, k = ["id", "tabindex", "aria-label", "aria-activedescendant"];
164
- function D(e, t, l, n, d, s) {
165
- const p = m("StyledListItem");
166
- return a(), u("div", {
167
- class: c(["list-box", { invalid: !l.isValid, disabled: l.disabled }])
168
- }, [
169
- V("ul", {
170
- id: l.id,
171
- ref: "ul",
172
- role: "listbox",
173
- tabindex: l.disabled ? -1 : 0,
174
- "aria-label": l.ariaLabel,
175
- style: h(s.ulSizeStyle),
176
- "aria-activedescendant": s.generateOptionId(s.getCurrentItem()),
177
- onKeydown: t[0] || (t[0] = (...i) => s.handleKeyDown && s.handleKeyDown(...i))
178
- }, [
179
- (a(!0), u(y, null, I(s.selectableValues, (i, r) => (a(), f(p, {
180
- id: s.generateOptionId(i),
181
- key: `listbox-${i.id}`,
182
- ref_for: !0,
183
- ref: "options",
184
- style: h({ "line-height": `${d.optionLineHeight}px` }),
185
- text: i.text,
186
- title: i.text,
187
- class: c({
188
- focused: s.isCurrentValue(i.id),
189
- noselect: !0,
190
- empty: i.text.trim() === ""
191
- }),
192
- "aria-selected": s.isCurrentValue(i.id),
193
- "line-height": d.optionLineHeight,
194
- selected: s.isCurrentValue(i.id),
195
- invalid: i.invalid,
196
- special: i.special,
197
- disabled: l.disabled,
198
- onClick: (b) => !l.disabled && s.setSelected(i.id, r),
199
- onFocus: (b) => !l.disabled && s.setSelected(i.id, r)
200
- }, null, 8, ["id", "style", "text", "title", "class", "aria-selected", "line-height", "selected", "invalid", "special", "disabled", "onClick", "onFocus"]))), 128))
201
- ], 44, k)
202
- ], 2);
203
- }
204
- const z = /* @__PURE__ */ L(K, [["render", D], ["__scopeId", "data-v-ef9a5a49"]]), N = /* @__PURE__ */ x({
205
- __name: "SingleSelectListBoxControl",
206
- props: {
207
- control: {},
208
- handleChange: { type: Function },
209
- changeValue: { type: Function },
210
- disabled: { type: Boolean },
211
- isValid: { type: Boolean },
212
- onRegisterValidation: { type: Function },
213
- labelForId: {}
214
- },
215
- setup(e) {
216
- const t = e, { possibleValues: l } = S(g(t, "control"));
217
- return (n, d) => o(l) ? (a(), f(o(z), {
218
- key: 0,
219
- id: n.labelForId,
220
- "possible-values": o(l),
221
- disabled: n.disabled,
222
- "model-value": n.control.data,
223
- "is-valid": n.isValid,
224
- ariaLabel: n.control.label,
225
- size: n.control.uischema.options?.size,
226
- "onUpdate:modelValue": n.changeValue
227
- }, null, 8, ["id", "possible-values", "disabled", "model-value", "is-valid", "ariaLabel", "size", "onUpdate:modelValue"])) : v("", !0);
228
- }
229
- });
230
- export {
231
- N as default
232
- };