@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,127 @@
1
+ import { defineComponent as R, ref as r, computed as l, onMounted as z, openBlock as d, createBlock as h, unref as p, withCtx as _, createElementVNode as S, createVNode as P, toDisplayString as y, createCommentVNode as C, createElementBlock as U } from "vue";
2
+ import { r as W, q as w, a as j, S as G, L as J, F as K, T as Q, _ as X } from "./index-ZDm2GXeD.js";
3
+ import { g as b } from "./getFlattenedSettings-D64OwqpI.js";
4
+ const Y = { class: "button-wrapper" }, Z = { class: "button-input-text" }, $ = {
5
+ key: 1,
6
+ class: "error-message"
7
+ }, tt = /* @__PURE__ */ R({
8
+ __name: "ButtonControl",
9
+ props: W(),
10
+ setup(B) {
11
+ const m = w("registerWatcher"), k = w("getData"), x = B, { control: s, onChange: E } = j({ props: x }), i = r(null), D = () => {
12
+ i.value = null;
13
+ }, v = r({}), f = (t) => {
14
+ v.value = b(t);
15
+ }, o = r({}), V = l(
16
+ () => {
17
+ var t;
18
+ return ((t = s.value.uischema.options) == null ? void 0 : t.states) ?? [];
19
+ }
20
+ ), g = (t) => {
21
+ D(), o.value = V.value.find(({ id: e }) => e === t);
22
+ }, A = (t) => {
23
+ setTimeout(() => E(t));
24
+ }, F = (t) => {
25
+ if (t === null)
26
+ return;
27
+ const { settingValue: e, setSettingValue: n, buttonState: a } = t;
28
+ n && A(e), g(a);
29
+ }, I = (t, e = () => {
30
+ }) => {
31
+ const { state: n } = t;
32
+ if (n === "SUCCESS") {
33
+ F(t.result);
34
+ return;
35
+ }
36
+ n === "FAIL" && (i.value = t.message[0]), e();
37
+ }, c = r(0), L = G(), u = async ({
38
+ method: t,
39
+ options: e,
40
+ handler: n
41
+ }, a = () => {
42
+ }) => {
43
+ c.value += 1;
44
+ const O = await k({
45
+ method: t,
46
+ options: [L, n, ...e]
47
+ });
48
+ c.value -= 1, I(O, a);
49
+ }, M = async (t) => {
50
+ f(t), await u({
51
+ method: "settings.initializeButton",
52
+ options: [s.value.data],
53
+ handler: s.value.uischema.options.actionHandler
54
+ });
55
+ }, N = (t) => {
56
+ u({
57
+ method: "settings.update",
58
+ options: [b(t)],
59
+ handler: s.value.uischema.options.updateOptions.updateHandler
60
+ });
61
+ }, T = async () => {
62
+ const { id: t, nextState: e } = o.value, n = o.value, a = () => {
63
+ e === o.value.id && (o.value = n);
64
+ };
65
+ typeof e < "u" && g(e), await u(
66
+ {
67
+ method: "settings.invokeButtonAction",
68
+ options: [t, v.value],
69
+ handler: s.value.uischema.options.actionHandler
70
+ },
71
+ a
72
+ );
73
+ };
74
+ z(() => {
75
+ var e, n, a;
76
+ m({
77
+ init: M,
78
+ transformSettings: f,
79
+ dependencies: ((e = s.value.uischema.options) == null ? void 0 : e.dependencies) || []
80
+ });
81
+ const t = (a = (n = s.value.uischema) == null ? void 0 : n.options) == null ? void 0 : a.updateOptions;
82
+ typeof t < "u" && m({
83
+ transformSettings: N,
84
+ dependencies: t.dependencies
85
+ });
86
+ });
87
+ const q = l(
88
+ () => {
89
+ var t;
90
+ return ((t = s.value.uischema.options) == null ? void 0 : t.displayErrorMessage) ?? !0;
91
+ }
92
+ ), H = l(
93
+ () => {
94
+ var t;
95
+ return ((t = s.value.uischema.options) == null ? void 0 : t.showTitleAndDescription) ?? !0;
96
+ }
97
+ );
98
+ return (t, e) => (d(), h(J, {
99
+ control: p(s),
100
+ show: H.value
101
+ }, {
102
+ default: _(({ labelForId: n }) => [
103
+ S("div", Y, [
104
+ P(p(K), {
105
+ id: n,
106
+ disabled: o.value.disabled,
107
+ class: "button-input",
108
+ primary: o.value.primary,
109
+ compact: "",
110
+ onClick: T
111
+ }, {
112
+ default: _(() => [
113
+ S("div", Z, y(o.value.text), 1)
114
+ ]),
115
+ _: 2
116
+ }, 1032, ["id", "disabled", "primary"]),
117
+ c.value > 0 ? (d(), h(p(Q), { key: 0 })) : C("", !0),
118
+ i.value && q.value ? (d(), U("span", $, " Error: " + y(i.value), 1)) : C("", !0)
119
+ ])
120
+ ]),
121
+ _: 1
122
+ }, 8, ["control", "show"]));
123
+ }
124
+ }), ot = /* @__PURE__ */ X(tt, [["__scopeId", "data-v-f789e320"]]);
125
+ export {
126
+ ot as default
127
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as x, ref as f, openBlock as n, createBlock as a, unref as e, withCtx as c, createElementVNode as C, createVNode as l, createTextVNode as b, toDisplayString as g, createCommentVNode as i } from "vue";
2
+ import { r as h, a as _, k, l as V, m as D, R as N, n as R, D as w, E as y, _ as E } from "./index-ZDm2GXeD.js";
3
+ const M = /* @__PURE__ */ x({
4
+ __name: "CheckboxControl",
5
+ props: h(),
6
+ setup(u) {
7
+ const d = u, { control: o, onChange: s, disabled: p } = _({ props: d }), r = f(!1), m = k(o);
8
+ return (S, t) => (n(), a(V, { control: e(o) }, {
9
+ default: c(() => [
10
+ C("div", {
11
+ class: "checkbox-input",
12
+ onMouseover: t[0] || (t[0] = (v) => r.value = !0),
13
+ onMouseleave: t[1] || (t[1] = (v) => r.value = !1)
14
+ }, [
15
+ l(e(D), {
16
+ class: "checkbox",
17
+ disabled: e(p),
18
+ "model-value": e(o).data,
19
+ "onUpdate:modelValue": e(s)
20
+ }, {
21
+ default: c(() => [
22
+ b(g(e(o).label) + " ", 1),
23
+ e(m) ? (n(), a(e(N), {
24
+ key: 0,
25
+ class: "reexecution-icon"
26
+ })) : i("", !0)
27
+ ]),
28
+ _: 1
29
+ }, 8, ["disabled", "model-value", "onUpdate:modelValue"]),
30
+ l(R, {
31
+ hover: r.value,
32
+ onControllingFlowVariableSet: e(s)
33
+ }, null, 8, ["hover", "onControllingFlowVariableSet"]),
34
+ e(o).description ? (n(), a(w, {
35
+ key: 0,
36
+ html: e(o).description,
37
+ hover: r.value
38
+ }, null, 8, ["html", "hover"])) : i("", !0),
39
+ l(y, {
40
+ error: e(o).errors
41
+ }, null, 8, ["error"])
42
+ ], 32)
43
+ ]),
44
+ _: 1
45
+ }, 8, ["control"]));
46
+ }
47
+ }), F = /* @__PURE__ */ E(M, [["__scopeId", "data-v-51ca0c91"]]);
48
+ export {
49
+ F as default
50
+ };
@@ -0,0 +1,103 @@
1
+ import { _ as c, m as u } from "./index-ZDm2GXeD.js";
2
+ import { resolveComponent as f, openBlock as o, createElementBlock as s, normalizeClass as m, Fragment as h, renderList as p, createBlock as x, withCtx as b, createTextVNode as V, toDisplayString as y } from "vue";
3
+ const _ = {
4
+ name: "Checkboxes",
5
+ components: {
6
+ Checkbox: u
7
+ },
8
+ props: {
9
+ /**
10
+ * List of possible values. Each item must have an `id` and a `text` property.
11
+ * @example
12
+ * [{
13
+ * id: 'pdf',
14
+ * text: 'PDF'
15
+ * }, {
16
+ * id: 'XLS',
17
+ * text: 'Excel',
18
+ * }]
19
+ */
20
+ possibleValues: {
21
+ type: Array,
22
+ default: () => [],
23
+ validator(e) {
24
+ return Array.isArray(e) ? e.every(
25
+ (a) => a.hasOwnProperty("id") && a.hasOwnProperty("text")
26
+ ) : !1;
27
+ }
28
+ },
29
+ /**
30
+ * Controls the alignment
31
+ */
32
+ alignment: {
33
+ type: String,
34
+ default: "horizontal",
35
+ validator(e) {
36
+ return ["horizontal", "vertical"].includes(e);
37
+ }
38
+ },
39
+ disabled: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ isValid: {
44
+ default: !0,
45
+ type: Boolean
46
+ },
47
+ /**
48
+ * selected value (which is a list of ids of entries)
49
+ */
50
+ modelValue: {
51
+ type: Array,
52
+ default: () => []
53
+ }
54
+ },
55
+ emits: ["update:modelValue"],
56
+ methods: {
57
+ validate() {
58
+ let e = !this.possibleValues.some((a) => a.invalid);
59
+ return {
60
+ isValid: e,
61
+ errorMessage: e ? null : "One or more of the selected items is invalid."
62
+ };
63
+ },
64
+ onUpdateModelValue(e, a) {
65
+ let t = Array.from(this.modelValue);
66
+ a ? t.indexOf(e) === -1 && t.push(e) : t = t.filter((r) => r !== e), consola.trace("Checkboxes value changed to", t), this.$emit("update:modelValue", t);
67
+ },
68
+ /**
69
+ * Is at least one checkbox checked?
70
+ * @returns {boolean}
71
+ */
72
+ hasSelection() {
73
+ return this.$refs.boxes.some((e) => e.isChecked());
74
+ }
75
+ }
76
+ };
77
+ function k(e, a, t, r, v, d) {
78
+ const i = f("Checkbox");
79
+ return o(), s("div", {
80
+ class: m(["checkboxes", t.alignment])
81
+ }, [
82
+ (o(!0), s(h, null, p(t.possibleValues, (l) => (o(), x(i, {
83
+ ref_for: !0,
84
+ ref: "boxes",
85
+ key: `checkboxes-${l.id}`,
86
+ "model-value": t.modelValue.indexOf(l.id) > -1,
87
+ title: l.text,
88
+ invalid: l.invalid,
89
+ disabled: t.disabled,
90
+ class: "box",
91
+ "onUpdate:modelValue": (n) => d.onUpdateModelValue(l.id, n)
92
+ }, {
93
+ default: b(() => [
94
+ V(y(l.text), 1)
95
+ ]),
96
+ _: 2
97
+ }, 1032, ["model-value", "title", "invalid", "disabled", "onUpdate:modelValue"]))), 128))
98
+ ], 2);
99
+ }
100
+ const A = /* @__PURE__ */ c(_, [["render", k], ["__scopeId", "data-v-565cb857"]]);
101
+ export {
102
+ A as C
103
+ };
@@ -0,0 +1,39 @@
1
+ import { defineComponent as d, computed as p, ref as b, onMounted as C, openBlock as t, createBlock as r, unref as o, withCtx as f, createCommentVNode as v } from "vue";
2
+ import { r as g, a as h, o as _, L as k } from "./index-ZDm2GXeD.js";
3
+ import { C as x } from "./Checkboxes-DlhdiWWA.js";
4
+ const B = /* @__PURE__ */ d({
5
+ __name: "CheckboxesControl",
6
+ props: g(),
7
+ setup(s) {
8
+ const i = s, { control: a, disabled: u, onChange: n } = h({ props: i }), m = p(
9
+ () => {
10
+ var e;
11
+ return (e = a.value.uischema.options) == null ? void 0 : e.checkboxLayout;
12
+ }
13
+ ), l = b(null);
14
+ return C(() => {
15
+ var e;
16
+ l.value = (e = a.value.schema.anyOf) == null ? void 0 : e.map(_);
17
+ }), (e, V) => (t(), r(k, {
18
+ control: o(a),
19
+ "margin-bottom": -10,
20
+ onControllingFlowVariableSet: o(n)
21
+ }, {
22
+ default: f(({ labelForId: c }) => [
23
+ l.value ? (t(), r(o(x), {
24
+ key: 0,
25
+ id: c,
26
+ "possible-values": l.value,
27
+ alignment: m.value,
28
+ disabled: o(u),
29
+ "model-value": o(a).data,
30
+ "onUpdate:modelValue": o(n)
31
+ }, null, 8, ["id", "possible-values", "alignment", "disabled", "model-value", "onUpdate:modelValue"])) : v("", !0)
32
+ ]),
33
+ _: 1
34
+ }, 8, ["control", "onControllingFlowVariableSet"]));
35
+ }
36
+ });
37
+ export {
38
+ B as default
39
+ };
@@ -0,0 +1,17 @@
1
+ import { defineComponent as n, openBlock as e, createBlock as r, mergeProps as t } from "vue";
2
+ import { r as s } from "./index-ZDm2GXeD.js";
3
+ import l from "./TwinlistControl-C4XaH_Xc.js";
4
+ const c = /* @__PURE__ */ n({
5
+ __name: "ColumnFilter",
6
+ props: s(),
7
+ setup(p) {
8
+ return (o, m) => (e(), r(l, t({ ...o.$props, ...o.$attrs }, {
9
+ "unknown-values-text": "Any unknown column",
10
+ "show-unknown-values": "",
11
+ "empty-state-label": "No columns in this list"
12
+ }), null, 16));
13
+ }
14
+ });
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,60 @@
1
+ import { defineComponent as v, computed as h, watchEffect as w, watch as C, onMounted as P, openBlock as b, createBlock as _, mergeProps as y, unref as p } from "vue";
2
+ import { U as D, r as V, a as j, q, V as E, p as I, W as F } from "./index-ZDm2GXeD.js";
3
+ import { _ as S } from "./DropdownControl.vue_vue_type_script_setup_true_lang-B5dPfH3x.js";
4
+ function U(s, n) {
5
+ return D(s, n);
6
+ }
7
+ const g = /* @__PURE__ */ v({
8
+ __name: "ColumnSelect",
9
+ props: V(),
10
+ setup(s) {
11
+ class n extends F {
12
+ toInternalState(e) {
13
+ return e == null ? void 0 : e.selected;
14
+ }
15
+ equals(e, r) {
16
+ return e === r;
17
+ }
18
+ }
19
+ const t = j({
20
+ props: s,
21
+ valueComparator: new n()
22
+ }), l = h(
23
+ () => {
24
+ var o;
25
+ return (o = t.control.value.uischema.options) == null ? void 0 : o.choicesProvider;
26
+ }
27
+ ), m = q("getPossibleValuesFromUiSchema"), a = E(
28
+ I(l, null),
29
+ t.control.value
30
+ ), d = new Promise((o) => {
31
+ w(() => {
32
+ a.value && o(a.value);
33
+ });
34
+ }), c = (o) => {
35
+ var u;
36
+ const e = a.value;
37
+ if (e === null)
38
+ throw new Error("Must not convert data before column choices are fetched.");
39
+ const r = ((u = e.find((f) => f.id === o)) == null ? void 0 : u.compatibleTypes) ?? [];
40
+ return { selected: o, compatibleTypes: r };
41
+ }, i = ({ selected: o }) => o;
42
+ return C(() => a.value, () => {
43
+ const o = t.control.value.data, e = c(i(o));
44
+ U(o, e) || t.onChange(e);
45
+ }), P(async () => {
46
+ l.value || (a.value = await m(
47
+ t.control.value
48
+ ));
49
+ }), (o, e) => (b(), _(S, y({ ...o.$attrs, ...o.$props }, {
50
+ "async-initial-options": p(d),
51
+ "json-forms-control": p(t),
52
+ "control-data-to-dropdown-value": i,
53
+ compact: "",
54
+ "dropdown-value-to-control-data": c
55
+ }), null, 16, ["async-initial-options", "json-forms-control"]));
56
+ }
57
+ });
58
+ export {
59
+ g as default
60
+ };