@knime/jsonforms 3.4.1 → 3.5.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @knime/jsonforms
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7b5e7c4: add showTime option/prop to ZonedDateTimeControl and KdsZonedDateTimeInput to allow selecting date+timezone only; the time is then set to the start of the selected day in the selected time zone
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [256224e, 7b5e7c4]
12
+ - @knime/kds-components@8.2.0
13
+ - @knime/kds-rich-text-editor@8.2.0
14
+
3
15
  ## 3.4.1
4
16
 
5
17
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { d as e, u as t } from "./src-pP1URsDS.js";
1
+ import { d as e, u as t } from "./src-2ar80j2v.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { createBlock as r, createElementBlock as i, createVNode as a, defineComponent as o, openBlock as s, ref as c, renderSlot as l, unref as u, withCtx as d } from "vue";
4
4
  import { DispatchRenderer as f } from "@jsonforms/vue";
@@ -1,4 +1,4 @@
1
- import { d as e, k as t, u as n } from "./src-pP1URsDS.js";
1
+ import { d as e, k as t, u as n } from "./src-2ar80j2v.js";
2
2
  import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { computed as i, createBlock as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, openBlock as u, ref as d, renderSlot as f, unref as p, withCtx as m } from "vue";
4
4
  import { DispatchRenderer as h } from "@jsonforms/vue";
@@ -1,4 +1,4 @@
1
- import { d as e } from "./src-pP1URsDS.js";
1
+ import { d as e } from "./src-2ar80j2v.js";
2
2
  import { createBlock as t, defineComponent as n, openBlock as r, unref as i, withCtx as a } from "vue";
3
3
  import { DispatchRenderer as o } from "@jsonforms/vue";
4
4
  //#endregion
@@ -0,0 +1,104 @@
1
+ import { t as e } from "./plainDateTimeUtils-5uOCJ4N5.js";
2
+ import { computed as t, createBlock as n, defineComponent as r, openBlock as i, ref as a, unref as o, watch as s } from "vue";
3
+ import { KdsZonedDateTimeInput as c } from "@knime/kds-components";
4
+ //#endregion
5
+ //#region src/uiComponents/ZonedDateTimeControl.vue
6
+ var l = /* @__PURE__ */ r({
7
+ __name: "ZonedDateTimeControl",
8
+ props: {
9
+ control: {},
10
+ handleChange: { type: Function },
11
+ changeValue: { type: Function },
12
+ disabled: { type: Boolean },
13
+ error: { type: Boolean },
14
+ subText: {},
15
+ onRegisterValidation: { type: Function },
16
+ labelForId: {}
17
+ },
18
+ setup(r) {
19
+ let l = r, u = t(() => l.control.uischema.options), d = t(() => e.getMaxGranularity(u.value, { showMilliseconds: !1 })), f = t(() => u.value?.showTime ?? !0), p = a(e.detectGranularity(l.control.data.dateTime)), m = t(() => ({
20
+ ...e.fromString(l.control.data.dateTime),
21
+ timeZone: l.control.data.timeZone
22
+ })), h = t(() => {
23
+ let { date: e, time: t, timeZone: n } = m.value;
24
+ if (e === null || !n) return null;
25
+ try {
26
+ return f.value && t ? e.toPlainDateTime(t).toZonedDateTime(n) : e.toZonedDateTime(n);
27
+ } catch {
28
+ return null;
29
+ }
30
+ }), g, _, v = !1, y = () => {
31
+ v = !1;
32
+ let t = _ ?? p.value, n = g !== void 0, r = _ !== void 0, i = g;
33
+ if (g = void 0, _ = void 0, p.value = t, n) {
34
+ if (i === null) {
35
+ l.changeValue({
36
+ ...l.control.data,
37
+ dateTime: ""
38
+ });
39
+ return;
40
+ }
41
+ l.changeValue({
42
+ ...l.control.data,
43
+ dateTime: e.toString(i.toPlainDate(), i.toPlainTime(), t),
44
+ timeZone: i.timeZoneId
45
+ });
46
+ return;
47
+ }
48
+ if (r) {
49
+ let { date: n, time: r } = e.fromString(l.control.data.dateTime);
50
+ n && l.changeValue({
51
+ ...l.control.data,
52
+ dateTime: e.toString(n, r, t)
53
+ });
54
+ }
55
+ }, b = () => {
56
+ v || (v = !0, queueMicrotask(y));
57
+ }, x = t(() => {
58
+ let { date: e, time: t, timeZone: n } = m.value;
59
+ if (e === null || t === null || !n) return null;
60
+ try {
61
+ return e.toPlainDateTime(t).toZonedDateTime(n);
62
+ } catch {
63
+ return null;
64
+ }
65
+ });
66
+ s([f, x], () => {
67
+ if (f.value || x.value === null) return;
68
+ let e = x.value.startOfDay();
69
+ x.value.equals(e) || (g = e, b());
70
+ }, { immediate: !0 });
71
+ let S = (e) => {
72
+ g = e, b();
73
+ }, C = (e) => {
74
+ _ = e, b();
75
+ };
76
+ return (e, t) => (i(), n(o(c), {
77
+ id: r.labelForId,
78
+ ariaLabel: r.control.label,
79
+ "model-value": h.value,
80
+ granularity: p.value,
81
+ "max-granularity": d.value,
82
+ "possible-values": u.value?.possibleValues,
83
+ disabled: r.disabled,
84
+ error: r.error,
85
+ "sub-text": r.subText,
86
+ "show-time": f.value,
87
+ "onUpdate:modelValue": S,
88
+ "onUpdate:granularity": C
89
+ }, null, 8, [
90
+ "id",
91
+ "ariaLabel",
92
+ "model-value",
93
+ "granularity",
94
+ "max-granularity",
95
+ "possible-values",
96
+ "disabled",
97
+ "error",
98
+ "sub-text",
99
+ "show-time"
100
+ ]));
101
+ }
102
+ });
103
+ //#endregion
104
+ export { l as default };
@@ -1,3 +1,3 @@
1
- import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, j as h, k as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as O, y as k } from "./src-pP1URsDS.js";
1
+ import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, j as h, k as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as O, y as k } from "./src-2ar80j2v.js";
2
2
  import { n as A } from "./useProvidedState-478_KXOe.js";
3
3
  export { m as FieldControl, h as Form, r as JsonFormsDialog, t as LabeledControl, T as SectionHeading, g as SettingsSubPanel, _ as SimpleArrayLayout, S as SimpleButtonControl, y as TextControl, u as VerticalLayoutBase, O as controlProps, k as controlToRenderer, s as controls, b as defaultRenderers, i as defineControl, p as defineLayout, n as getAsyncSetupMethod, e as handleAsyncComponents, x as inputFormats, f as layoutProps, o as layoutToRenderer, C as layouts, D as mapControls, a as mapLayouts, d as priorityRanks, w as toDataPathSegments, l as toRenderers, A as useProvidedState, E as withDescriptionButton, v as withDescriptionButtonLayout, c as withLabel };
@@ -539,7 +539,7 @@ var st = 500, ct = ({ data: e, uischema: t }) => {
539
539
  name: "TextControl",
540
540
  control: Ht,
541
541
  tester: z(Q.fallback, R)
542
- }), Wt = g(() => import("./VerticalLayout-p7_m2Jqj.js")), Gt = {
542
+ }), Wt = g(() => import("./VerticalLayout-DJWwKloZ.js")), Gt = {
543
543
  name: "VerticalLayout",
544
544
  layout: Wt,
545
545
  tester: z(Q.default, B("VerticalLayout"))
@@ -708,11 +708,11 @@ var st = 500, ct = ({ data: e, uischema: t }) => {
708
708
  name: "RichTextControl",
709
709
  control: Cn,
710
710
  tester: z(Q.default, M(R, Z(X.richTextInput)))
711
- }), Tn = g(() => import("./SectionLayout-CWwQSAQT.js")), En = B("Section"), Dn = {
711
+ }), Tn = g(() => import("./SectionLayout-CTHfZNfB.js")), En = B("Section"), Dn = {
712
712
  name: "SectionLayout",
713
713
  layout: Tn,
714
714
  tester: z(Q.default, En)
715
- }, On = g(() => import("./SettingsSubPanelLayout-CeUyfI3O.js")), kn = B("SettingsSubPanelLayout"), An = {
715
+ }, On = g(() => import("./SettingsSubPanelLayout-Dt_WNkLJ.js")), kn = B("SettingsSubPanelLayout"), An = {
716
716
  name: "SettingsSubPanelLayout",
717
717
  layout: On,
718
718
  tester: z(Q.default, kn)
@@ -1067,7 +1067,7 @@ var st = 500, ct = ({ data: e, uischema: t }) => {
1067
1067
  name: "ValueSwitchControl",
1068
1068
  control: gr,
1069
1069
  tester: z(Q.default, M(L, Z(X.valueSwitch)))
1070
- }), vr = g({ loader: () => import("./ZonedDateTimeControl-DoE2T9iz.js") }), yr = {
1070
+ }), vr = g({ loader: () => import("./ZonedDateTimeControl-Co3v2EVv.js") }), yr = {
1071
1071
  checkboxesRenderer: bt,
1072
1072
  colorPreviewRenderer: xt,
1073
1073
  colorRenderer: Ct,
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, o as t } from "./src-pP1URsDS.js";
1
+ import { A as e, o as t } from "./src-2ar80j2v.js";
2
2
  import { ref as n } from "vue";
3
3
  import "@jsonforms/vue";
4
4
  import { vi as r } from "vitest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/jsonforms",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "JSONForms integration for KNIME frontends",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,11 +14,11 @@
14
14
  "dependencies": {
15
15
  "@jsonforms/core": "3.8.0",
16
16
  "@jsonforms/vue": "3.8.0",
17
+ "@knime/kds-components": "^8.2.0",
18
+ "@knime/kds-rich-text-editor": "^8.2.0",
19
+ "@knime/utils": "^2.0.2",
17
20
  "ajv": "8.20.0",
18
- "temporal-polyfill": "^1.0.1",
19
- "@knime/kds-rich-text-editor": "^8.0.0",
20
- "@knime/kds-components": "^8.0.0",
21
- "@knime/utils": "^2.0.2"
21
+ "temporal-polyfill": "^1.0.1"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@vue/test-utils": "^2.4.0",
@@ -36,10 +36,12 @@
36
36
  }
37
37
  },
38
38
  "devDependencies": {
39
+ "@knime/kds-code-editor": "^8.2.0",
40
+ "@knime/kds-styles": "^8.2.0",
39
41
  "@storybook/addon-docs": "^10.4.6",
40
42
  "@storybook/vue3-vite": "^10.4.6",
41
43
  "@vitejs/plugin-vue": "^6.0.8",
42
- "@vitest/coverage-v8": "^4.1.10",
44
+ "@vitest/coverage-v8": "^4.1.11",
43
45
  "@vue/test-utils": "^2.4.11",
44
46
  "@vue/tsconfig": "^0.9.1",
45
47
  "@vueuse/core": "~14.3.0",
@@ -50,10 +52,9 @@
50
52
  "vite": "^8.1.3",
51
53
  "vite-plugin-dts": "^5.0.3",
52
54
  "vite-svg-loader": "^5.1.1",
53
- "vitest": "^4.1.10",
55
+ "vitest": "^4.1.11",
54
56
  "vue": "3.5.40",
55
- "vue-tsc": "^3.3.8",
56
- "@knime/kds-styles": "^8.0.0"
57
+ "vue-tsc": "^3.3.8"
57
58
  },
58
59
  "exports": {
59
60
  ".": {
@@ -1,88 +0,0 @@
1
- import { t as e } from "./temporal-polyfill-D4u1I_Z-.js";
2
- import { t } from "./plainDateTimeUtils-5uOCJ4N5.js";
3
- import { computed as n, createBlock as r, defineComponent as i, openBlock as a, ref as o, unref as s } from "vue";
4
- import { KdsZonedDateTimeInput as c } from "@knime/kds-components";
5
- //#endregion
6
- //#region src/uiComponents/ZonedDateTimeControl.vue
7
- var l = /* @__PURE__ */ i({
8
- __name: "ZonedDateTimeControl",
9
- props: {
10
- control: {},
11
- handleChange: { type: Function },
12
- changeValue: { type: Function },
13
- disabled: { type: Boolean },
14
- error: { type: Boolean },
15
- subText: {},
16
- onRegisterValidation: { type: Function },
17
- labelForId: {}
18
- },
19
- setup(i) {
20
- let l = i, u = n(() => l.control.uischema.options), d = n(() => t.getMaxGranularity(u.value, { showMilliseconds: !1 })), f = o(t.detectGranularity(l.control.data.dateTime)), p = n(() => {
21
- let { date: n, time: r } = t.fromString(l.control.data.dateTime);
22
- if (n === null) return null;
23
- let i = n.toPlainDateTime(r ?? e.PlainTime.from("00:00:00")), a = l.control.data.timeZone;
24
- if (!a) return null;
25
- try {
26
- return i.toZonedDateTime(a);
27
- } catch {
28
- return null;
29
- }
30
- }), m, h, g = !1, _ = () => {
31
- g = !1;
32
- let e = h ?? f.value, n = m !== void 0, r = h !== void 0, i = m;
33
- if (m = void 0, h = void 0, f.value = e, n) {
34
- if (i === null) {
35
- l.changeValue({
36
- ...l.control.data,
37
- dateTime: ""
38
- });
39
- return;
40
- }
41
- l.changeValue({
42
- ...l.control.data,
43
- dateTime: t.toString(i.toPlainDate(), i.toPlainTime(), e),
44
- timeZone: i.timeZoneId
45
- });
46
- return;
47
- }
48
- if (r) {
49
- let { date: n, time: r } = t.fromString(l.control.data.dateTime);
50
- n && l.changeValue({
51
- ...l.control.data,
52
- dateTime: t.toString(n, r, e)
53
- });
54
- }
55
- }, v = () => {
56
- g || (g = !0, queueMicrotask(_));
57
- }, y = (e) => {
58
- m = e, v();
59
- }, b = (e) => {
60
- h = e, v();
61
- };
62
- return (e, t) => (a(), r(s(c), {
63
- id: i.labelForId,
64
- ariaLabel: i.control.label,
65
- "model-value": p.value,
66
- granularity: f.value,
67
- "max-granularity": d.value,
68
- "possible-values": u.value?.possibleValues,
69
- disabled: i.disabled,
70
- error: i.error,
71
- "sub-text": i.subText,
72
- "onUpdate:modelValue": y,
73
- "onUpdate:granularity": b
74
- }, null, 8, [
75
- "id",
76
- "ariaLabel",
77
- "model-value",
78
- "granularity",
79
- "max-granularity",
80
- "possible-values",
81
- "disabled",
82
- "error",
83
- "sub-text"
84
- ]));
85
- }
86
- });
87
- //#endregion
88
- export { l as default };