@knime/jsonforms 0.1.4

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 (67) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +710 -0
  3. package/README.md +125 -0
  4. package/dist/AnyOfTwinlist-GJ6LGkM1.js +17 -0
  5. package/dist/ArrayLayout-CbpSgf0X.js +487 -0
  6. package/dist/ButtonControl-CVu36jz8.js +127 -0
  7. package/dist/CheckboxControl-DYFLb-qW.js +50 -0
  8. package/dist/Checkboxes-DlhdiWWA.js +103 -0
  9. package/dist/CheckboxesControl-DYV72Aua.js +39 -0
  10. package/dist/ColumnFilter-BbweAsmq.js +17 -0
  11. package/dist/ColumnSelect-aw7cYcWC.js +60 -0
  12. package/dist/ComboBoxControl-BqVUWz4q.js +600 -0
  13. package/dist/CredentialsControl-Ci6ZEuKM.js +20 -0
  14. package/dist/CredentialsControlBase-CxYOD3ne.js +110 -0
  15. package/dist/DateControl-ZyQ_vmOW.js +30 -0
  16. package/dist/DateTimeControl-anye7xvC.js +4 -0
  17. package/dist/DropdownControl-JX1LF5Tk.js +4 -0
  18. package/dist/DropdownControl.vue_vue_type_script_setup_true_lang-B5dPfH3x.js +171 -0
  19. package/dist/DynamicValuesControl-CFubOaRb.js +127 -0
  20. package/dist/FileChooserControl-Cf_UaWqV.js +605 -0
  21. package/dist/FileExplorerTab-Ba76jD3y.js +3951 -0
  22. package/dist/HorizontalLayout-5irQmhXp.js +39 -0
  23. package/dist/IntegerControl-CqHJWRgn.js +13 -0
  24. package/dist/IntervalControl-BUhs5_lc.js +549 -0
  25. package/dist/LayoutComponentWrapper-CDw9BDq5.js +36 -0
  26. package/dist/LegacyCredentialsControl-DxRZcRVo.js +62 -0
  27. package/dist/LocalFileChooserControl-DxSeiKxg.js +57 -0
  28. package/dist/MenuItems.vue_vue_type_style_index_0_lang-qMVpH9oC.js +464 -0
  29. package/dist/MultiselectListBox-C4ZnJvJJ.js +579 -0
  30. package/dist/NameFilter-D6EI_V08.js +17 -0
  31. package/dist/NodeDialog.vue.d.ts +8 -0
  32. package/dist/NumberControl-DLo0LCsi.js +13 -0
  33. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-B69hrnY1.js +43 -0
  34. package/dist/NumberInput-BdL-jZ-i.js +219 -0
  35. package/dist/OneOfDropdown-BmbbuaZk.js +15 -0
  36. package/dist/RadioControl-GbwpOdAy.js +13 -0
  37. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-BlImm9is.js +128 -0
  38. package/dist/RichTextControl-CGY3rdM7.js +16895 -0
  39. package/dist/SectionLayout-CqSFyj1K.js +54 -0
  40. package/dist/SimpleButtonControl-BgOrTGEP.js +59 -0
  41. package/dist/SimpleTwinlistControl-ByOlLGIN.js +68 -0
  42. package/dist/SortListControl-Dege54Dj.js +316 -0
  43. package/dist/TextAreaControl-CKviHabr.js +111 -0
  44. package/dist/TextControl-CPL48j4B.js +49 -0
  45. package/dist/TimeControl-CGsLRgR3.js +842 -0
  46. package/dist/TwinlistControl-C4XaH_Xc.js +587 -0
  47. package/dist/TwinlistLoadingInfo-CFlSBQXn.js +1057 -0
  48. package/dist/ValueSwitch-B9oWSkM_.js +138 -0
  49. package/dist/ValueSwitchControl-4ODpL58f.js +13 -0
  50. package/dist/VennDiagramLayout-CabCs-fX.js +104 -0
  51. package/dist/VerticalLayout-D5HeZyKY.js +39 -0
  52. package/dist/VerticalLayoutBase-C0PZ-y5d.js +20 -0
  53. package/dist/arrow-next-CvdR0-WC.js +17 -0
  54. package/dist/arrow-up-Dsq3EgtE.js +30 -0
  55. package/dist/createMissingItem-B00Kg95q.js +4 -0
  56. package/dist/floating-ui.vue.esm-CIFBDytk.js +94 -0
  57. package/dist/getFlattenedSettings-D64OwqpI.js +7 -0
  58. package/dist/index-ZDm2GXeD.js +32714 -0
  59. package/dist/index.d.ts +3 -0
  60. package/dist/knime-jsonforms.js +5 -0
  61. package/dist/layoutComponents/Form.vue.d.ts +2 -0
  62. package/dist/link-BA69Hfx6.js +17 -0
  63. package/dist/loading/LoadingDialog.vue.d.ts +2 -0
  64. package/dist/navigator-BYUFe-z3.js +8 -0
  65. package/dist/style.css +1 -0
  66. package/dist/useHideOnNull-CCfNP3O7.js +42 -0
  67. package/package.json +74 -0
@@ -0,0 +1,219 @@
1
+ import { X as h, _ as p } from "./index-ZDm2GXeD.js";
2
+ import { resolveComponent as f, openBlock as o, createElementBlock as d, normalizeClass as l, createElementVNode as n, createCommentVNode as V, withModifiers as r, createVNode as m } from "vue";
3
+ const c = 200, g = 50, v = 0.1, E = 1, I = {
4
+ name: "NumberInput",
5
+ components: {
6
+ ArrowIcon: h
7
+ },
8
+ props: {
9
+ modelValue: {
10
+ default: 0,
11
+ type: [Number, String],
12
+ validator(t) {
13
+ return typeof t == "string" ? t.toLowerCase().includes("e") : typeof t == "number";
14
+ }
15
+ },
16
+ id: {
17
+ type: String,
18
+ default: null
19
+ },
20
+ name: {
21
+ type: String,
22
+ default: null
23
+ },
24
+ min: {
25
+ default: Number.MIN_SAFE_INTEGER,
26
+ type: Number
27
+ },
28
+ max: {
29
+ default: Number.MAX_SAFE_INTEGER,
30
+ type: Number
31
+ },
32
+ /**
33
+ * Validity controlled by the parent component to be flexible.
34
+ */
35
+ isValid: {
36
+ default: !0,
37
+ type: Boolean
38
+ },
39
+ /**
40
+ * Sets the significant digit of the spinner input.
41
+ *
42
+ * Possible values: 'double' | 'integer'
43
+ */
44
+ type: {
45
+ default: "double",
46
+ type: String
47
+ },
48
+ inputClasses: {
49
+ default: "",
50
+ type: String
51
+ },
52
+ disabled: {
53
+ default: !1,
54
+ type: Boolean
55
+ },
56
+ compact: {
57
+ type: Boolean,
58
+ default: !1
59
+ }
60
+ },
61
+ emits: ["update:modelValue"],
62
+ data() {
63
+ return {
64
+ clicked: !1,
65
+ // false to prevent unintended 'mouseup' or 'mouseleave' events.
66
+ hovered: !1,
67
+ initialValue: 0,
68
+ localValue: "",
69
+ spinnerArrowTimeout: null,
70
+ spinnerArrowInterval: null
71
+ };
72
+ },
73
+ computed: {
74
+ isInteger() {
75
+ return this.type === "integer";
76
+ },
77
+ stepSize() {
78
+ return this.isInteger ? E : v;
79
+ },
80
+ inputClassList() {
81
+ let t = this.inputClasses;
82
+ return this.hovered && (t += " hover"), t;
83
+ },
84
+ inputValue() {
85
+ return typeof this.localValue == "number" && isNaN(this.localValue) ? "" : this.isInteger ? this.localValue : this.localValue.toString();
86
+ }
87
+ },
88
+ watch: {
89
+ modelValue: {
90
+ handler() {
91
+ this.parseValue(this.localValue) !== this.parseValue(this.modelValue) && (this.localValue = this.parseValue(this.modelValue));
92
+ },
93
+ immediate: !0
94
+ }
95
+ },
96
+ mounted() {
97
+ this.localValue = this.parseValue(this.modelValue), this.initialValue = this.localValue;
98
+ },
99
+ methods: {
100
+ getInputRef() {
101
+ return this.$refs.input;
102
+ },
103
+ parseValue(t) {
104
+ return this.isInteger ? parseInt(t.toString(), 10) : parseFloat(t.toString());
105
+ },
106
+ getParsedValue() {
107
+ return this.parseValue(this.localValue);
108
+ },
109
+ onInput(t) {
110
+ const e = t.target.value;
111
+ t && !e && (t.data === "." || t.data === "-") || (e || (this.getInputRef().value = ""), this.updateAndEmit({ newValue: e }));
112
+ },
113
+ updateAndEmit({ newValue: t }) {
114
+ this.localValue = t, this.$emit("update:modelValue", this.getParsedValue());
115
+ },
116
+ onBlur() {
117
+ this.localValue = this.getParsedValue(), this.getInputRef().valueAsNumber = this.localValue;
118
+ },
119
+ validate(t) {
120
+ let e = !0, a;
121
+ return t = typeof t > "u" ? this.getParsedValue() : this.parseValue(t), typeof t != "number" || isNaN(t) ? (e = !1, a = "Current value is not a number.") : (this.min > t || this.max < t) && (e = !1, a = "Current value is outside allowed range."), { isValid: e, errorMessage: a };
122
+ },
123
+ /**
124
+ * Change value updates the actual value of the input field if a valid new value
125
+ * can be found. It prevents users from further invalidating the value in the input
126
+ * by moving in the wrong direction (lower than min/higher than max).
127
+ *
128
+ * @param {Number} increment - the amount by which to change the current value.
129
+ * @returns {undefined}
130
+ */
131
+ changeValue(t) {
132
+ let e = this.getParsedValue();
133
+ this.validate(e).isValid || (e = this.findNearestValidValue(e));
134
+ let a = e + t;
135
+ a = Math.round(a * 10) / 10, this.validate(a).isValid && this.updateAndEmit({ newValue: a });
136
+ },
137
+ findNearestValidValue(t) {
138
+ return t < this.min ? this.min : t > this.max ? this.max : this.initialValue;
139
+ },
140
+ /**
141
+ * This method is the callback handler for mouse events on the input field controls.
142
+ * It is fired when either the up-arrow or down-arrow is pressed by the user. It manages
143
+ * both mousedown and mouseup events. It clears any existing timeouts or intervals which
144
+ * may have been set previously. It also recognizes when the mouse leaves the button
145
+ * (which could cause a mouseup event to be missed) and therefore uses the this.clicked
146
+ * data property to ensure it doesn't get stuck in an interval.
147
+ *
148
+ * @param {Event} e - the DOM event object which triggered the handler.
149
+ * @param {String} type - the type of button pressed (either 'increased' or 'decreased').
150
+ * @returns {undefined}
151
+ */
152
+ mouseEvent(t, e) {
153
+ if (this.disabled)
154
+ return;
155
+ this.spinnerArrowInterval !== null && clearTimeout(this.spinnerArrowInterval), this.spinnerArrowTimeout !== null && clearInterval(this.spinnerArrowTimeout);
156
+ let a = this.stepSize;
157
+ if (e === "decrease" && (a *= -1), t.type === "mousedown") {
158
+ this.clicked = !0, this.spinnerArrowTimeout = setTimeout(() => {
159
+ this.spinnerArrowInterval = setInterval(() => {
160
+ this.changeValue(a);
161
+ }, g);
162
+ }, c);
163
+ return;
164
+ }
165
+ this.clicked && (this.clicked = !1, this.changeValue(a));
166
+ },
167
+ toggleHover() {
168
+ this.hovered = !this.hovered;
169
+ }
170
+ }
171
+ }, b = ["id", "name", "value", "min", "max", "step", "disabled"], N = {
172
+ key: 0,
173
+ class: "invalid-marker"
174
+ };
175
+ function A(t, e, a, w, y, s) {
176
+ const u = f("ArrowIcon");
177
+ return o(), d("div", {
178
+ class: l(["wrapper", { disabled: a.disabled, compact: a.compact }])
179
+ }, [
180
+ n("input", {
181
+ id: a.id,
182
+ ref: "input",
183
+ name: a.name,
184
+ type: "number",
185
+ role: "spinButton",
186
+ value: s.inputValue,
187
+ min: a.min,
188
+ max: a.max,
189
+ step: s.stepSize,
190
+ class: l(s.inputClassList),
191
+ disabled: a.disabled,
192
+ onInput: e[0] || (e[0] = (i) => s.onInput(i)),
193
+ onBlur: e[1] || (e[1] = (...i) => s.onBlur && s.onBlur(...i)),
194
+ onMouseenter: e[2] || (e[2] = (...i) => s.toggleHover && s.toggleHover(...i)),
195
+ onMouseleave: e[3] || (e[3] = (...i) => s.toggleHover && s.toggleHover(...i))
196
+ }, null, 42, b),
197
+ a.isValid ? V("", !0) : (o(), d("span", N)),
198
+ n("span", {
199
+ class: l(["increase", { disabled: a.disabled }]),
200
+ onMousedown: e[4] || (e[4] = r((i) => s.mouseEvent(i, "increase"), ["prevent"])),
201
+ onMouseup: e[5] || (e[5] = r((i) => s.mouseEvent(i, "increase"), ["prevent"])),
202
+ onMouseleave: e[6] || (e[6] = (i) => s.mouseEvent(i, "increase"))
203
+ }, [
204
+ m(u)
205
+ ], 34),
206
+ n("span", {
207
+ class: l(["decrease", { disabled: a.disabled }]),
208
+ onMousedown: e[7] || (e[7] = r((i) => s.mouseEvent(i, "decrease"), ["prevent"])),
209
+ onMouseup: e[8] || (e[8] = r((i) => s.mouseEvent(i, "decrease"), ["prevent"])),
210
+ onMouseleave: e[9] || (e[9] = (i) => s.mouseEvent(i, "decrease"))
211
+ }, [
212
+ m(u)
213
+ ], 34)
214
+ ], 2);
215
+ }
216
+ const M = /* @__PURE__ */ p(I, [["render", A], ["__scopeId", "data-v-6b79dc2b"]]);
217
+ export {
218
+ M as N
219
+ };
@@ -0,0 +1,15 @@
1
+ import { defineComponent as i, openBlock as c, createBlock as m, mergeProps as l, unref as f } from "vue";
2
+ import { r as u, j as _, o as d } from "./index-ZDm2GXeD.js";
3
+ import { _ as O } from "./DropdownControl.vue_vue_type_script_setup_true_lang-B5dPfH3x.js";
4
+ const k = /* @__PURE__ */ i({
5
+ __name: "OneOfDropdown",
6
+ props: u(),
7
+ setup(r) {
8
+ var o, n;
9
+ const e = r, { control: t } = _(e), p = ((n = (o = t.value.schema) == null ? void 0 : o.oneOf) == null ? void 0 : n.map(d)) ?? [], a = Promise.resolve(p);
10
+ return (s, h) => (c(), m(O, l({ ...s.$attrs, ...s.$props }, { "async-initial-options": f(a) }), null, 16, ["async-initial-options"]));
11
+ }
12
+ });
13
+ export {
14
+ k as default
15
+ };
@@ -0,0 +1,13 @@
1
+ import { defineComponent as o, openBlock as e, createBlock as p, mergeProps as n } from "vue";
2
+ import { r as t } from "./index-ZDm2GXeD.js";
3
+ import { _ as s } from "./RadioControlBase.vue_vue_type_script_setup_true_lang-BlImm9is.js";
4
+ const f = /* @__PURE__ */ o({
5
+ __name: "RadioControl",
6
+ props: t(),
7
+ setup(a) {
8
+ return (r, m) => (e(), p(s, n(r.$props, { type: "radio" }), null, 16));
9
+ }
10
+ });
11
+ export {
12
+ f as default
13
+ };
@@ -0,0 +1,128 @@
1
+ import { resolveComponent as h, openBlock as c, createBlock as p, normalizeClass as V, defineComponent as y, computed as d, ref as C, onMounted as S, unref as u, withCtx as w, resolveDynamicComponent as R, createCommentVNode as k } from "vue";
2
+ import { _ as x, r as O, a as z, o as L, L as U } from "./index-ZDm2GXeD.js";
3
+ import { B as D, V as F } from "./ValueSwitch-B9oWSkM_.js";
4
+ const M = {
5
+ name: "RadioButtons",
6
+ components: {
7
+ BaseRadioButtons: D
8
+ },
9
+ props: {
10
+ // these props are passed to BaseRadioButtons
11
+ id: {
12
+ type: String,
13
+ default: null
14
+ },
15
+ modelValue: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ disabled: {
20
+ default: !1,
21
+ type: Boolean
22
+ },
23
+ /**
24
+ * List of possible values. Each item must have an `id` and a `text` property
25
+ * @example
26
+ * [{
27
+ * id: 'pdf',
28
+ * text: 'PDF'
29
+ * }, {
30
+ * id: 'XLS',
31
+ * text: 'Excel',
32
+ * }]
33
+ */
34
+ possibleValues: {
35
+ type: Array,
36
+ default: () => []
37
+ },
38
+ // additional props
39
+ alignment: {
40
+ type: String,
41
+ default: "horizontal",
42
+ validator(o) {
43
+ return ["horizontal", "vertical"].includes(o);
44
+ }
45
+ }
46
+ },
47
+ emits: ["update:modelValue"],
48
+ methods: {
49
+ hasSelection() {
50
+ return this.$refs.radioButton.$refs.input.some((o) => o.checked);
51
+ }
52
+ }
53
+ };
54
+ function $(o, a, t, l, b, f) {
55
+ const r = h("BaseRadioButtons");
56
+ return c(), p(r, {
57
+ id: t.id,
58
+ ref: "radioButton",
59
+ "possible-values": t.possibleValues,
60
+ "model-value": t.modelValue,
61
+ disabled: t.disabled,
62
+ class: V(["radio-buttons", t.alignment, { disabled: t.disabled }]),
63
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => o.$emit("update:modelValue", m))
64
+ }, null, 8, ["id", "possible-values", "model-value", "disabled", "class"]);
65
+ }
66
+ const v = /* @__PURE__ */ x(M, [["render", $], ["__scopeId", "data-v-e428929b"]]), q = 0, A = -10, j = /* @__PURE__ */ y({
67
+ __name: "RadioControlBase",
68
+ props: {
69
+ ...O(),
70
+ type: {
71
+ type: String,
72
+ required: !0,
73
+ default: "radio"
74
+ }
75
+ },
76
+ setup(o) {
77
+ const a = o, { onChange: t, control: l, disabled: b } = z({ props: a }), f = d(() => {
78
+ var e;
79
+ return (e = l.value.uischema.options) == null ? void 0 : e.radioLayout;
80
+ }), r = d(
81
+ () => {
82
+ var e;
83
+ return ((e = l.value.uischema.options) == null ? void 0 : e.disabledOptions) ?? [];
84
+ }
85
+ ), m = (e) => r.value.includes(e.id) ? { ...e, disabled: !0 } : e, g = d(() => {
86
+ switch (a.type) {
87
+ case "valueSwitch":
88
+ return F;
89
+ case "radio":
90
+ return v;
91
+ default:
92
+ return v;
93
+ }
94
+ }), i = C(null);
95
+ S(() => {
96
+ var e, n, s;
97
+ i.value = (s = (n = (e = l.value) == null ? void 0 : e.schema) == null ? void 0 : n.oneOf) == null ? void 0 : s.map(L).map(m);
98
+ });
99
+ const B = (e) => {
100
+ var n;
101
+ (n = i.value) != null && n.filter(({ id: s }) => e === s).length && t(e);
102
+ }, _ = d(
103
+ () => a.type === "valueSwitch" ? q : A
104
+ );
105
+ return (e, n) => (c(), p(U, {
106
+ control: u(l),
107
+ "margin-bottom": _.value,
108
+ onControllingFlowVariableSet: B
109
+ }, {
110
+ default: w(({ labelForId: s }) => [
111
+ i.value ? (c(), p(R(g.value), {
112
+ key: 0,
113
+ id: s,
114
+ "possible-values": i.value,
115
+ alignment: f.value,
116
+ disabled: u(b),
117
+ "model-value": u(l).data,
118
+ compact: "",
119
+ "onUpdate:modelValue": u(t)
120
+ }, null, 8, ["id", "possible-values", "alignment", "disabled", "model-value", "onUpdate:modelValue"])) : k("", !0)
121
+ ]),
122
+ _: 1
123
+ }, 8, ["control", "margin-bottom"]));
124
+ }
125
+ });
126
+ export {
127
+ j as _
128
+ };