@knime/jsonforms 3.0.0 → 3.1.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 (204) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/AnyOfTwinlist-iPxS5C9Y.js +24 -0
  3. package/dist/CheckboxControl-C99OdmDL.js +41 -0
  4. package/dist/CheckboxesControl-BZhMhT9x.js +47 -0
  5. package/dist/ColorControl-D1dNnNbO.js +38 -0
  6. package/dist/ColorPreviewControl-B4zix2kb.js +67 -0
  7. package/dist/ComboBoxControl-BGWAD9IW.js +47 -0
  8. package/dist/DateControl-D0HfVrtz.js +49 -0
  9. package/dist/DateTimeControl-kTQZI9JC.js +103 -0
  10. package/dist/DateTimeFormatPickerControl-BiYcsKSn.js +44 -0
  11. package/dist/DropdownControl-jsayV3N5.js +42 -0
  12. package/dist/ExecutorCoresControl-DNo2SaC6.js +26 -0
  13. package/dist/ExecutorMemoryControl-C8RLYQdd.js +26 -0
  14. package/dist/FileUploadControl-Cv3xWTAS.js +58 -0
  15. package/dist/GridSelectionControl-BqtaGQYg.js +86 -0
  16. package/dist/HorizontalLayout-B_lETfCu.js +29 -0
  17. package/dist/IntegerControl-Cr8SO0xH.js +22 -0
  18. package/dist/IntervalControl-BdjKEwLy.js +53 -0
  19. package/dist/LinkControl-QMwkCJlj.js +37 -0
  20. package/dist/LoadingDropdown-BpU4Uiin.js +61 -0
  21. package/dist/ManualTwinlistControl-CPILp7H_.js +75 -0
  22. package/dist/NameFilter-CYYPRj-2.js +29 -0
  23. package/dist/NumberControl-ODy5GAlR.js +22 -0
  24. package/dist/NumberControlBase-Cl3QcvzB.js +56 -0
  25. package/dist/OneOfDropdown-CMPRAraI.js +44 -0
  26. package/dist/ProgressButtonControl-BimHrSZd.js +51 -0
  27. package/dist/RadioButtonsWithDescriptionControl-DJu3ODo7.js +58 -0
  28. package/dist/RadioControl-D_NE5s4n.js +22 -0
  29. package/dist/RadioControlBase-knF86px0.js +69 -0
  30. package/dist/ResourceControlBase-BVMVVYns.js +64 -0
  31. package/dist/RichTextControl-JIM904_P.js +72 -0
  32. package/dist/SectionLayout-BDYjoUXM.js +41 -0
  33. package/dist/SettingsSubPanelLayout-DVw_AsU6.js +53 -0
  34. package/dist/SimpleTwinlistControl-BNnOmbN-.js +24 -0
  35. package/dist/SingleSelectControl-CJV9VMZm.js +58 -0
  36. package/dist/SortListControl-D-ifoRva.js +71 -0
  37. package/dist/TeamAndSpacesControl-D1FvyeCV.js +56 -0
  38. package/dist/TeamResourceControl-DyCO6-Nk.js +26 -0
  39. package/dist/TextAreaControl-7QziyTgn.js +40 -0
  40. package/dist/TimeControl-B29iTlhP.js +71 -0
  41. package/dist/TimeframesControl-Wvu--J0V.js +46 -0
  42. package/dist/TwinlistControlBase-300a_qUR.js +55 -0
  43. package/dist/TypedStringFilter-Ek7bQ-7j.js +35 -0
  44. package/dist/ValueSwitchControl-H2t2Wgo6.js +22 -0
  45. package/dist/VerticalLayout-zV890HYr.js +32 -0
  46. package/dist/ZonedDateTimeControl-DoE2T9iz.js +88 -0
  47. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  48. package/dist/inject-DEsHVs5q.js +5 -0
  49. package/dist/knime-jsonforms.css +2 -1
  50. package/dist/knime-jsonforms.d.ts +1 -1
  51. package/dist/knime-jsonforms.js +3 -219
  52. package/dist/plainDateTimeUtils-5uOCJ4N5.js +58 -0
  53. package/dist/rolldown-runtime-Dy4uBu1J.js +11 -0
  54. package/dist/src/JsonFormsDialog.vue.d.ts +53 -435
  55. package/dist/src/higherOrderComponents/control/DescriptionPopover.vue.d.ts +2 -1
  56. package/dist/src/higherOrderComponents/control/LabeledControl.vue.d.ts +21 -21
  57. package/dist/src/layoutComponents/Form.vue.d.ts +9 -12
  58. package/dist/src/layoutComponents/HorizontalLayout.vue.d.ts +2 -1
  59. package/dist/src/layoutComponents/SectionLayout.vue.d.ts +9 -13
  60. package/dist/src/layoutComponents/SettingsSubPanelLayout.vue.d.ts +9 -13
  61. package/dist/src/layoutComponents/VerticalLayout.vue.d.ts +2 -1
  62. package/dist/src/layoutComponents/VerticalLayoutBase.vue.d.ts +10 -14
  63. package/dist/src/layoutComponents/section/SectionHeading.vue.d.ts +7 -15
  64. package/dist/src/layoutComponents/settingsSubPanel/SettingsSubPanel.vue.d.ts +11 -10
  65. package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayout.vue.d.ts +2 -1
  66. package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayoutItemControls.vue.d.ts +3 -2
  67. package/dist/src/loading/LoadingDialog.vue.d.ts +2 -1
  68. package/dist/src/renderers/checkboxRenderer.d.ts +5 -4
  69. package/dist/src/renderers/colorPreviewRenderer.d.ts +1 -1
  70. package/dist/src/renderers/defaultRenderers.d.ts +22 -21
  71. package/dist/src/renderers/fallbackRenderers.d.ts +6 -5
  72. package/dist/src/renderers/horizontalLayoutRenderer.d.ts +1 -1
  73. package/dist/src/renderers/linkRenderer.d.ts +1 -1
  74. package/dist/src/renderers/progressButtonRenderer.d.ts +3 -3
  75. package/dist/src/renderers/sectionLayoutRenderer.d.ts +3 -3
  76. package/dist/src/renderers/sectionSubPanelLayoutRenderer.d.ts +3 -3
  77. package/dist/src/renderers/simpleButtonRenderer.d.ts +3 -3
  78. package/dist/src/renderers/verticalLayoutRenderer.d.ts +2 -2
  79. package/dist/src/uiComponents/CheckboxControl.vue.d.ts +11 -14
  80. package/dist/src/uiComponents/CheckboxesControl.vue.d.ts +2 -1
  81. package/dist/src/uiComponents/ColorControl.vue.d.ts +2 -1
  82. package/dist/src/uiComponents/ColorPreviewControl.vue.d.ts +2 -1
  83. package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +2 -1
  84. package/dist/src/uiComponents/DateControl.vue.d.ts +2 -1
  85. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +2 -1
  86. package/dist/src/uiComponents/DateTimeFormatPickerControl.vue.d.ts +2 -1
  87. package/dist/src/uiComponents/DropdownControl.vue.d.ts +2 -1
  88. package/dist/src/uiComponents/FieldControl.vue.d.ts +12 -7
  89. package/dist/src/uiComponents/FieldRenderer.vue.d.ts +12 -7
  90. package/dist/src/uiComponents/FileUploadControl.vue.d.ts +2 -3
  91. package/dist/src/uiComponents/GridSelectionControl.vue.d.ts +2 -1
  92. package/dist/src/uiComponents/IntegerControl.vue.d.ts +2 -1
  93. package/dist/src/uiComponents/IntervalControl.vue.d.ts +2 -1
  94. package/dist/src/uiComponents/LinkControl.vue.d.ts +2 -1
  95. package/dist/src/uiComponents/NumberControl.vue.d.ts +2 -1
  96. package/dist/src/uiComponents/NumberControlBase.vue.d.ts +2 -1
  97. package/dist/src/uiComponents/OneOfDropdown.vue.d.ts +2 -1
  98. package/dist/src/uiComponents/PasswordControl.vue.d.ts +2 -1
  99. package/dist/src/uiComponents/ProgressButtonControl.vue.d.ts +9 -13
  100. package/dist/src/uiComponents/QuantityControl.vue.d.ts +2 -1
  101. package/dist/src/uiComponents/RadioButtonsWithDescriptionControl.vue.d.ts +2 -1
  102. package/dist/src/uiComponents/RadioControl.vue.d.ts +2 -1
  103. package/dist/src/uiComponents/RadioControlBase.vue.d.ts +2 -1
  104. package/dist/src/uiComponents/SimpleButtonControl.vue.d.ts +9 -13
  105. package/dist/src/uiComponents/SingleSelectControl.vue.d.ts +2 -1
  106. package/dist/src/uiComponents/SortListControl.vue.d.ts +2 -1
  107. package/dist/src/uiComponents/TeamAndSpacesControl.vue.d.ts +2 -1
  108. package/dist/src/uiComponents/TextAreaControl.vue.d.ts +2 -1
  109. package/dist/src/uiComponents/TextControl.vue.d.ts +3 -454
  110. package/dist/src/uiComponents/TextMessageControl.vue.d.ts +2 -1
  111. package/dist/src/uiComponents/TimeControl.vue.d.ts +2 -1
  112. package/dist/src/uiComponents/TimeframesControl.vue.d.ts +2 -1
  113. package/dist/src/uiComponents/UsernameControl.vue.d.ts +2 -1
  114. package/dist/src/uiComponents/ValueSwitchControl.vue.d.ts +2 -1
  115. package/dist/src/uiComponents/ZonedDateTimeControl.vue.d.ts +2 -1
  116. package/dist/src/uiComponents/colorPreview/ColorPreviewEmptyState.vue.d.ts +2 -1
  117. package/dist/src/uiComponents/colorPreview/GradientPreview.vue.d.ts +2 -1
  118. package/dist/src/uiComponents/colorPreview/PalettePreview.vue.d.ts +2 -1
  119. package/dist/src/uiComponents/loading/LoadingDropdown.vue.d.ts +3 -2
  120. package/dist/src/uiComponents/resourceControls/ExecutorCoresControl.vue.d.ts +2 -1
  121. package/dist/src/uiComponents/resourceControls/ExecutorMemoryControl.vue.d.ts +2 -1
  122. package/dist/src/uiComponents/resourceControls/ResourceControlBase.vue.d.ts +2 -1
  123. package/dist/src/uiComponents/resourceControls/TeamResourceControl.vue.d.ts +2 -1
  124. package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +2 -141
  125. package/dist/src/uiComponents/twinlist/AnyOfTwinlist.vue.d.ts +2 -1
  126. package/dist/src/uiComponents/twinlist/ManualTwinlistControl.vue.d.ts +2 -1
  127. package/dist/src/uiComponents/twinlist/MultimodeTwinlistControl.vue.d.ts +3 -2
  128. package/dist/src/uiComponents/twinlist/NameFilter.vue.d.ts +2 -1
  129. package/dist/src/uiComponents/twinlist/SimpleTwinlistControl.vue.d.ts +2 -1
  130. package/dist/src/uiComponents/twinlist/TwinlistControlBase.vue.d.ts +2 -1
  131. package/dist/src/uiComponents/twinlist/TypedStringFilter.vue.d.ts +2 -1
  132. package/dist/src-DwqijroM.js +1269 -0
  133. package/dist/temporal-polyfill-D4u1I_Z-.js +3114 -0
  134. package/dist/testing.d.ts +1 -1
  135. package/dist/testing.js +108 -19153
  136. package/dist/toKdsPossibleValues-Dd_qzlUI.js +14 -0
  137. package/dist/useBuiltinValidations-B_Drc2y-.js +43 -0
  138. package/dist/usePossibleValues-Cx6iSt_X.js +15 -0
  139. package/dist/useProvidedState-478_KXOe.js +26 -0
  140. package/dist/useUnknownValuesInTwinlist-BvCTc3hC.js +205 -0
  141. package/dist/utils-DmZLgn8X.js +12 -0
  142. package/package.json +21 -11
  143. package/dist/AnyOfTwinlist-CcodfEXw.js +0 -23
  144. package/dist/CheckboxControl-B_MAR82s.js +0 -41
  145. package/dist/CheckboxesControl--bG4aF6O.js +0 -39
  146. package/dist/ColorControl-CEp2Ei7R.js +0 -29
  147. package/dist/ColorPreviewControl-j0uQH95J.js +0 -90
  148. package/dist/ComboBoxControl-BpJzwiv6.js +0 -39
  149. package/dist/DateControl-83Fi6P5y.js +0 -44
  150. package/dist/DateTimeControl-C-D8bFm3.js +0 -103
  151. package/dist/DateTimeFormatPickerControl-B9gl_66T.js +0 -35
  152. package/dist/DropdownControl-CtveoldX.js +0 -32
  153. package/dist/ExecutorCoresControl-CErHidL7.js +0 -39
  154. package/dist/ExecutorMemoryControl-DgSM86Yg.js +0 -35
  155. package/dist/FileUploadControl-BBfnxURy.js +0 -56
  156. package/dist/GridSelectionControl-BaI4j0Jj.js +0 -117
  157. package/dist/HorizontalLayout-D1SRCyhL.js +0 -26
  158. package/dist/IntegerControl-v93Xw4DJ.js +0 -21
  159. package/dist/IntervalControl-CVlO_mFO.js +0 -52
  160. package/dist/LinkControl-j8GrcZZG.js +0 -36
  161. package/dist/LoadingDropdown.vue_vue_type_script_setup_true_lang-DFSHuMQ6.js +0 -57
  162. package/dist/ManualTwinlistControl-BzJehuHs.js +0 -74
  163. package/dist/MultimodeTwinlistControl-Br0DrpsZ.js +0 -4
  164. package/dist/MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-CHcU__0y.js +0 -159
  165. package/dist/NameFilter-BjuVseuX.js +0 -25
  166. package/dist/NumberControl-BF76FEhD.js +0 -21
  167. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-DMTsK83k.js +0 -52
  168. package/dist/OneOfDropdown-DpXmZauV.js +0 -35
  169. package/dist/ProgressButtonControl-t8QMA22a.js +0 -52
  170. package/dist/RadioButtonsWithDescriptionControl-CeZ4qYCr.js +0 -58
  171. package/dist/RadioControl-DOn1Kre5.js +0 -21
  172. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-CExBvDXt.js +0 -57
  173. package/dist/ResourceControlBase-CX97xRiy.js +0 -70
  174. package/dist/RichTextControl-BrVmkMgh.js +0 -60
  175. package/dist/SectionHeading-YAJTwOE4.js +0 -61
  176. package/dist/SectionLayout-BYOxuxY2.js +0 -47
  177. package/dist/SettingsSubPanel-DgISjowU.js +0 -5
  178. package/dist/SettingsSubPanelLayout-BQJCnTqx.js +0 -69
  179. package/dist/SimpleButtonControl-GTX19t2_.js +0 -50
  180. package/dist/SimpleButtonControl.vue_vue_type_style_index_0_scoped_c79c6b71_lang-Ccuf283K.js +0 -1284
  181. package/dist/SimpleTwinlistControl-DOH1_L25.js +0 -23
  182. package/dist/SingleSelectControl-mY_yYOyk.js +0 -58
  183. package/dist/SortListControl-D-Um5gEW.js +0 -81
  184. package/dist/TeamAndSpacesControl-fGumynvr.js +0 -66
  185. package/dist/TeamResourceControl--1Sj3-Ks.js +0 -35
  186. package/dist/TextAreaControl-Cwq-lNBk.js +0 -30
  187. package/dist/TextControl-MvbrNTGW.js +0 -4
  188. package/dist/TextControl.vue_vue_type_script_setup_true_lang-Cbv0bM2X.js +0 -53
  189. package/dist/TimeControl-WG0SC4_b.js +0 -71
  190. package/dist/TimeframesControl-CX5eKOGZ.js +0 -53
  191. package/dist/TwinlistControlBase.vue_vue_type_script_setup_true_lang-BKCvZF3X.js +0 -45
  192. package/dist/TypedStringFilter-BnWygKQJ.js +0 -27
  193. package/dist/ValueSwitchControl-BByKe7NK.js +0 -21
  194. package/dist/VerticalLayout-DIBkvSZ9.js +0 -30
  195. package/dist/VerticalLayoutBase-BEDnWcoh.js +0 -20
  196. package/dist/ZonedDateTimeControl-B45OygrC.js +0 -97
  197. package/dist/index-Blg1O3Fz.js +0 -15
  198. package/dist/index-_VUHzju5.js +0 -3210
  199. package/dist/magic-string.es-uPKorP4O.js +0 -663
  200. package/dist/plainDateTimeUtils-BZSKqp9i.js +0 -52
  201. package/dist/toKdsPossibleValues-BklBg3gG.js +0 -14
  202. package/dist/useBuiltinValidations-_4IBMopQ.js +0 -74
  203. package/dist/usePossibleValues-CXVLf00v.js +0 -16
  204. package/dist/useUnknownValuesInTwinlist-uXOCQkVS.js +0 -65
@@ -0,0 +1,14 @@
1
+ //#region src/uiComponents/twinlist/toKdsPossibleValues.ts
2
+ var e = (e) => e.map((e) => ({
3
+ id: e.id,
4
+ text: e.text,
5
+ ...e.type ? {
6
+ type: e.type.id,
7
+ accessory: {
8
+ type: "dataType",
9
+ name: e.type.id
10
+ }
11
+ } : {}
12
+ }));
13
+ //#endregion
14
+ export { e as t };
@@ -0,0 +1,43 @@
1
+ import { n as e } from "./useProvidedState-478_KXOe.js";
2
+ import { computed as t, onUnmounted as n, toRef as r } from "vue";
3
+ //#region src/uiComponents/composables/useBuiltinValidations.ts
4
+ var i = (e = {}) => e.validation || null, a = (e) => e.replace(/^validation\./, ""), o = (t) => {
5
+ let n = (t.providedOptions ?? []).filter((e) => e.startsWith("validation."));
6
+ return n.length === 0 ? null : n.reduce((n, i) => ({
7
+ ...n,
8
+ [a(i)]: e(r(t), i)
9
+ }), {});
10
+ }, s = (e) => Object.entries(e), c = (e, t) => {
11
+ let n = s(e).map(([e, { parameters: n, errorMessage: r }]) => ({
12
+ validate: t[e](n),
13
+ errorMessage: r
14
+ }));
15
+ return (e) => ({ errors: n.filter(({ validate: t }) => !t(e)).map(({ errorMessage: e }) => e) });
16
+ }, l = (e, t, n) => e === null ? null : c({ [t]: e }, n), u = (e, n, r, i) => {
17
+ let a = [];
18
+ if (e) {
19
+ let t = c(e, r);
20
+ a.push(i(t));
21
+ }
22
+ return n && s(n).map(([e, n]) => t(() => l(n.value, e, r))).map(i).forEach((e) => a.push(e)), a;
23
+ }, d = ({ validations: e, providedValidations: n }) => {
24
+ let r = s(e || {}).reduce((e, [t, { parameters: n }]) => ({
25
+ ...e,
26
+ [t]: n
27
+ }), {});
28
+ return t(() => n === null ? r : s(n).map(([e, t]) => ({
29
+ key: e,
30
+ providedValidation: t.value
31
+ })).filter(({ providedValidation: e }) => e !== null).reduce((e, { key: t, providedValidation: n }) => ({
32
+ ...e,
33
+ [t]: n.parameters
34
+ }), r));
35
+ }, f = (e, t) => {
36
+ let { uischema: r } = t.control, { options: a } = r, s = i(a), c = o(r), l = u(s, c, e, t.onRegisterValidation);
37
+ return n(() => l.forEach((e) => e())), d({
38
+ validations: s,
39
+ providedValidations: c
40
+ });
41
+ };
42
+ //#endregion
43
+ export { f as t };
@@ -0,0 +1,15 @@
1
+ import { n as e } from "./useProvidedState-478_KXOe.js";
2
+ import { computed as t } from "vue";
3
+ //#region src/uiComponents/composables/usePossibleValues.ts
4
+ var n = (n, r) => {
5
+ let i = t(() => n.value.uischema), a = e(i, "possibleValues");
6
+ return { possibleValues: t(() => i.value.providedOptions?.includes("possibleValues") ? a.value : i.value.options?.possibleValues ?? (r?.defaultOnNonProvided === void 0 ? [] : r?.defaultOnNonProvided)) };
7
+ }, r = (e) => {
8
+ let n = t(() => e.value.uischema.options);
9
+ return {
10
+ includedLabel: n.value?.includedLabel ?? "Includes",
11
+ excludedLabel: n.value?.excludedLabel ?? "Excludes"
12
+ };
13
+ };
14
+ //#endregion
15
+ export { n, r as t };
@@ -0,0 +1,26 @@
1
+ import { t as e } from "./inject-DEsHVs5q.js";
2
+ import { onMounted as t, ref as n, unref as r } from "vue";
3
+ //#region src/uiComponents/composables/useProvidedState.ts
4
+ var i = (i, a, o = null) => {
5
+ let s = e("addStateProviderListener"), c = n(i.value.options?.[a] ?? o), l = r(i), u = "scope" in l ? { scope: l.scope } : { id: l.id };
6
+ return t(() => {
7
+ (i.value.providedOptions ?? []).includes(a) && s({
8
+ ...u,
9
+ providedOptionName: a
10
+ }, (e) => {
11
+ c.value = e;
12
+ });
13
+ }), c;
14
+ }, a = (i, a, o = null) => {
15
+ let s = e("addStateProviderListener"), c = n(o), l = r(i);
16
+ return t(() => {
17
+ s({
18
+ ...l,
19
+ providedOptionName: a
20
+ }, (e) => {
21
+ c.value = e;
22
+ });
23
+ }), c;
24
+ };
25
+ //#endregion
26
+ export { i as n, a as t };
@@ -0,0 +1,205 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { n as t, r as n, t as r } from "./utils-DmZLgn8X.js";
3
+ import { n as i, t as a } from "./usePossibleValues-Cx6iSt_X.js";
4
+ import { t as o } from "./toKdsPossibleValues-Dd_qzlUI.js";
5
+ import { computed as s, createBlock as c, defineComponent as l, mergeProps as u, openBlock as d, ref as f, toRef as p, unref as m, watch as h } from "vue";
6
+ import { KdsTwinList as g, kdsTwinListSearchMode as _ } from "@knime/kds-components";
7
+ //#region src/uiComponents/twinlist/MultimodeTwinlistControl.vue?vue&type=script&setup=true&lang.ts
8
+ var v = /*@__PURE__*/ l({
9
+ __name: "MultimodeTwinlistControl",
10
+ props: {
11
+ control: {},
12
+ handleChange: {},
13
+ changeValue: {},
14
+ disabled: { type: Boolean },
15
+ error: { type: Boolean },
16
+ subText: {},
17
+ onRegisterValidation: {},
18
+ labelForId: {},
19
+ showUnknownValues: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ showTypeFilter: {
24
+ type: Boolean,
25
+ default: !1
26
+ }
27
+ },
28
+ setup(e) {
29
+ let t = e, { possibleValues: r } = i(p(t, "control")), { excludedLabel: l, includedLabel: f } = a(p(t, "control")), { selectedAndDeselected: h, setCurrentManualFilter: v } = S({
30
+ data: s(() => t.control.data),
31
+ possibleValueIds: s(() => r.value?.map(({ id: e }) => e) ?? null)
32
+ }), y = (e) => {
33
+ let r = n(t.control.data, e);
34
+ t.changeValue(r), v(r.manualFilter);
35
+ }, b = s(() => o(r.value ?? [])), x = null, C = () => {
36
+ if (x !== null) {
37
+ let e = x;
38
+ x = null, y(e);
39
+ }
40
+ }, w = (e) => {
41
+ x === null ? (x = e, queueMicrotask(C)) : x = n(x, e);
42
+ }, T = (e) => {
43
+ w({
44
+ manualFilter: { manuallySelected: e },
45
+ selected: e
46
+ });
47
+ }, E = (e) => {
48
+ w({ manualFilter: { manuallyDeselected: e } });
49
+ }, D = (e) => {
50
+ e !== null && w({ manualFilter: { includeUnknownColumns: e } });
51
+ }, O = s(() => {
52
+ switch (t.control.data.mode.toUpperCase()) {
53
+ case "WILDCARD":
54
+ case "REGEX": return _.PATTERN;
55
+ case "TYPE": return _.TYPE;
56
+ default: return _.MANUAL;
57
+ }
58
+ }), k = s(() => t.control.data.mode.toUpperCase() === "REGEX"), A = (e) => {
59
+ let t;
60
+ switch (e) {
61
+ case _.PATTERN:
62
+ t = k.value ? "REGEX" : "WILDCARD";
63
+ break;
64
+ case _.TYPE:
65
+ t = "TYPE";
66
+ break;
67
+ default: t = "MANUAL";
68
+ }
69
+ y({ mode: t });
70
+ }, j = (e) => {
71
+ O.value === _.PATTERN && y({ mode: e ? "REGEX" : "WILDCARD" });
72
+ }, M = (e) => {
73
+ y({ patternFilter: { pattern: e } });
74
+ }, N = (e) => {
75
+ y({ patternFilter: { isInverted: e } });
76
+ }, P = (e) => {
77
+ y({ patternFilter: { isCaseSensitive: e } });
78
+ }, F = () => {
79
+ let e = t.control.data.typeFilter;
80
+ if (!e) return [];
81
+ let n = e.selectedTypes, r = new Map((e.typeDisplays ?? []).map(({ id: e, text: t }) => [e, t]));
82
+ return n.map((e) => ({
83
+ id: e,
84
+ text: r.get(e) || e
85
+ }));
86
+ }, I = s(() => {
87
+ if (!t.showTypeFilter) return;
88
+ let e = /* @__PURE__ */ new Map();
89
+ return r.value?.forEach((t) => {
90
+ t.type && e.set(t.type.id, t.type.text);
91
+ }), F().forEach(({ id: t, text: n }) => {
92
+ e.has(t) || e.set(t, n);
93
+ }), [...e.entries()].map(([e, t]) => ({
94
+ id: e,
95
+ text: t,
96
+ accessory: {
97
+ type: "dataType",
98
+ name: e
99
+ }
100
+ }));
101
+ }), L = (e) => {
102
+ let t = (I.value ?? []).filter((t) => e.includes(t.id)).map(({ id: e, text: t }) => ({
103
+ id: e,
104
+ text: t
105
+ }));
106
+ y({ typeFilter: {
107
+ selectedTypes: e,
108
+ typeDisplays: t
109
+ } });
110
+ };
111
+ return (n, r) => (d(), c(m(g), u(n.$attrs, {
112
+ id: e.labelForId,
113
+ ariaLabel: e.control.label,
114
+ disabled: e.disabled,
115
+ mode: O.value,
116
+ "manually-included": m(h).selected ?? [],
117
+ "manually-excluded": m(h).deselected ?? [],
118
+ "include-unknown-values": t.showUnknownValues ? t.control.data.manualFilter.includeUnknownColumns : null,
119
+ pattern: e.control.data.patternFilter.pattern,
120
+ "case-sensitive": e.control.data.patternFilter.isCaseSensitive,
121
+ "exclude-matches": e.control.data.patternFilter.isInverted,
122
+ "use-regex": k.value,
123
+ "selected-types": e.control.data.typeFilter?.selectedTypes ?? [],
124
+ "possible-values": b.value,
125
+ "filter-types": I.value,
126
+ "enable-pattern-filter": !0,
127
+ loading: m(h).selected === null,
128
+ "exclude-label": m(l),
129
+ "include-label": m(f),
130
+ error: e.error,
131
+ "sub-text": e.subText,
132
+ "onUpdate:mode": A,
133
+ "onUpdate:manuallyIncluded": T,
134
+ "onUpdate:manuallyExcluded": E,
135
+ "onUpdate:includeUnknownValues": D,
136
+ "onUpdate:pattern": M,
137
+ "onUpdate:caseSensitive": P,
138
+ "onUpdate:excludeMatches": N,
139
+ "onUpdate:useRegex": j,
140
+ "onUpdate:selectedTypes": L
141
+ }), null, 16, [
142
+ "id",
143
+ "ariaLabel",
144
+ "disabled",
145
+ "mode",
146
+ "manually-included",
147
+ "manually-excluded",
148
+ "include-unknown-values",
149
+ "pattern",
150
+ "case-sensitive",
151
+ "exclude-matches",
152
+ "use-regex",
153
+ "selected-types",
154
+ "possible-values",
155
+ "filter-types",
156
+ "loading",
157
+ "exclude-label",
158
+ "include-label",
159
+ "error",
160
+ "sub-text"
161
+ ]));
162
+ }
163
+ }), y = /* @__PURE__ */ e({ default: () => b }), b = v, x = ({ knownValuesSide: e, possibleValueIds: n, unknownValuesSide: i }) => {
164
+ let a = new Set(e.previous), o = new Set(n), s = (e) => t(e, o);
165
+ i.setNext([...s(i.previous), ...t(n, a)]), e.setNext([...s(e.previous), ...r(n, a)]);
166
+ }, S = ({ data: e, possibleValueIds: t }) => {
167
+ let n = f({
168
+ selected: null,
169
+ deselected: null
170
+ }), r = f(null), i = (e) => {
171
+ r.value = e;
172
+ }, a = () => {
173
+ if (!r.value || !t.value) return;
174
+ let e, i, { manuallyDeselected: a, manuallySelected: o, includeUnknownColumns: s } = r.value, c = {
175
+ previous: a,
176
+ setNext: (t) => {
177
+ e = t;
178
+ }
179
+ }, l = {
180
+ previous: o,
181
+ setNext: (e) => {
182
+ i = e;
183
+ }
184
+ }, u = s ? c : l, d = s ? l : c;
185
+ x({
186
+ possibleValueIds: t.value,
187
+ knownValuesSide: u,
188
+ unknownValuesSide: d
189
+ }), n.value = {
190
+ selected: i,
191
+ deselected: e
192
+ };
193
+ };
194
+ return h(() => e.value.manualFilter, (e) => {
195
+ Object.is(r.value, e) ? n.value = {
196
+ selected: e.manuallySelected,
197
+ deselected: e.manuallyDeselected
198
+ } : (r.value = e, a());
199
+ }, { immediate: !0 }), h(() => t.value, a, { immediate: !0 }), {
200
+ selectedAndDeselected: n,
201
+ setCurrentManualFilter: i
202
+ };
203
+ };
204
+ //#endregion
205
+ export { b as n, y as r, S as t };
@@ -0,0 +1,12 @@
1
+ //#region src/utils/index.ts
2
+ var e = ({ const: e, title: t }) => ({
3
+ id: e,
4
+ text: t
5
+ }), t = (e) => e && typeof e == "object" && !Array.isArray(e), n = (e, r) => {
6
+ let i = { ...e };
7
+ return t(r) && Object.keys(r).forEach((a) => {
8
+ t(r[a]) ? t(e) && !(a in e) ? Object.assign(i, { [a]: r[a] }) : i[a] = n(e[a], r[a]) : Object.assign(i, { [a]: r[a] });
9
+ }), i;
10
+ }, r = (e, t) => n(e, t), i = (e, t) => e.filter((e) => !t.has(e)), a = (e, t) => e.filter((e) => t.has(e));
11
+ //#endregion
12
+ export { e as i, i as n, r, a as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/jsonforms",
3
- "version": "3.0.0",
3
+ "version": "3.1.1",
4
4
  "description": "JSONForms integration for KNIME frontends",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,34 +16,44 @@
16
16
  "@jsonforms/vue": "3.8.0",
17
17
  "ajv": "8.20.0",
18
18
  "temporal-polyfill": "^1.0.1",
19
- "@knime/kds-components": "^2.1.0",
20
- "@knime/kds-rich-text-editor": "^2.1.0",
19
+ "@knime/kds-components": "^2.6.2",
20
+ "@knime/kds-rich-text-editor": "^2.6.2",
21
21
  "@knime/utils": "^1.12.1"
22
22
  },
23
23
  "peerDependencies": {
24
+ "@vue/test-utils": "^2.4.0",
24
25
  "@vueuse/core": "~13.8.0",
25
26
  "consola": "^3.4.2",
27
+ "vitest": ">=2",
26
28
  "vue": "~3.5.0"
27
29
  },
30
+ "peerDependenciesMeta": {
31
+ "@vue/test-utils": {
32
+ "optional": true
33
+ },
34
+ "vitest": {
35
+ "optional": true
36
+ }
37
+ },
28
38
  "devDependencies": {
29
39
  "@storybook/addon-docs": "^10.4.6",
30
40
  "@storybook/vue3-vite": "^10.4.6",
31
41
  "@vitejs/plugin-vue": "^6.0.7",
32
- "@vitest/coverage-v8": "^4.1.9",
42
+ "@vitest/coverage-v8": "^4.1.10",
33
43
  "@vue/test-utils": "^2.4.11",
34
44
  "@vue/tsconfig": "^0.9.1",
35
45
  "@vueuse/core": "~14.3.0",
36
46
  "consola": "^3.4.2",
37
47
  "storybook": "^10.4.6",
38
- "type-fest": "4.26.1",
39
- "typescript": "^5.9.3",
40
- "vite": "^7.3.2",
41
- "vite-plugin-dts": "^4.5.4",
48
+ "type-fest": "5.8.0",
49
+ "typescript": "^6.0.3",
50
+ "vite": "^8.1.3",
51
+ "vite-plugin-dts": "^5.0.3",
42
52
  "vite-svg-loader": "^5.1.1",
43
- "vitest": "^4.1.9",
53
+ "vitest": "^4.1.10",
44
54
  "vue": "3.5.39",
45
- "vue-tsc": "^3.3.4",
46
- "@knime/kds-styles": "^2.1.0"
55
+ "vue-tsc": "^3.3.7",
56
+ "@knime/kds-styles": "^2.6.2"
47
57
  },
48
58
  "exports": {
49
59
  ".": {
@@ -1,23 +0,0 @@
1
- import { defineComponent as s, openBlock as p, createBlock as t, mergeProps as r, unref as a } from "vue";
2
- import { o as l } from "./index-Blg1O3Fz.js";
3
- import { _ as i } from "./TwinlistControlBase.vue_vue_type_script_setup_true_lang-BKCvZF3X.js";
4
- const d = /* @__PURE__ */ s({
5
- __name: "AnyOfTwinlist",
6
- props: {
7
- control: {},
8
- handleChange: { type: Function },
9
- changeValue: { type: Function },
10
- disabled: { type: Boolean },
11
- error: { type: Boolean },
12
- subText: {},
13
- onRegisterValidation: { type: Function },
14
- labelForId: {}
15
- },
16
- setup(e) {
17
- const o = e.control.schema.anyOf.map(l);
18
- return (n, u) => (p(), t(i, r(n.$props, { "possible-values": a(o) }), null, 16, ["possible-values"]));
19
- }
20
- });
21
- export {
22
- d as default
23
- };
@@ -1,41 +0,0 @@
1
- import { defineComponent as a, ref as s, openBlock as d, createElementBlock as u, createElementVNode as c, createVNode as i, unref as b, renderSlot as r } from "vue";
2
- import { KdsCheckbox as v } from "@knime/kds-components";
3
- import { _ as m } from "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_c79c6b71_lang-Ccuf283K.js";
4
- const f = { class: "checkbox-container" }, x = /* @__PURE__ */ a({
5
- __name: "CheckboxControl",
6
- props: {
7
- control: {},
8
- handleChange: { type: Function },
9
- changeValue: { type: Function },
10
- disabled: { type: Boolean },
11
- labelForId: {},
12
- error: { type: Boolean },
13
- subText: {},
14
- onRegisterValidation: { type: Function }
15
- },
16
- setup(e) {
17
- const t = s(!1);
18
- return (n, o) => (d(), u("div", {
19
- class: "checkbox-input",
20
- onMouseover: o[1] || (o[1] = (l) => t.value = !0),
21
- onMouseleave: o[2] || (o[2] = (l) => t.value = !1)
22
- }, [
23
- c("div", f, [
24
- i(b(v), {
25
- class: "checkbox",
26
- disabled: e.disabled,
27
- "model-value": e.control.data,
28
- label: e.control.label,
29
- error: e.error,
30
- "sub-text": e.subText,
31
- "onUpdate:modelValue": o[0] || (o[0] = (l) => e.changeValue(l === !0))
32
- }, null, 8, ["disabled", "model-value", "label", "error", "sub-text"]),
33
- r(n.$slots, "icon", {}, void 0, !0)
34
- ]),
35
- r(n.$slots, "buttons", { hover: t.value }, void 0, !0)
36
- ], 32));
37
- }
38
- }), C = /* @__PURE__ */ m(x, [["__scopeId", "data-v-4f590a2d"]]);
39
- export {
40
- C as default
41
- };
@@ -1,39 +0,0 @@
1
- import { defineComponent as u, computed as l, ref as r, toRef as c, onMounted as i, openBlock as d, createBlock as m, unref as p, createCommentVNode as b } from "vue";
2
- import { KdsCheckboxGroup as f } from "@knime/kds-components";
3
- import { o as h } from "./index-Blg1O3Fz.js";
4
- import { u as v } from "./usePossibleValues-CXVLf00v.js";
5
- const F = /* @__PURE__ */ u({
6
- __name: "CheckboxesControl",
7
- props: {
8
- control: {},
9
- handleChange: { type: Function },
10
- changeValue: { type: Function },
11
- disabled: { type: Boolean },
12
- error: { type: Boolean },
13
- subText: {},
14
- onRegisterValidation: { type: Function },
15
- labelForId: {}
16
- },
17
- setup(e) {
18
- const o = e, n = l(
19
- () => o.control.uischema.options?.checkboxLayout
20
- ), t = r(null), { possibleValues: s } = v(c(o, "control")), a = l(() => t.value ?? s.value);
21
- return i(() => {
22
- t.value = o.control.schema.anyOf ? o.control.schema.anyOf.map(h) : null;
23
- }), (x, y) => a.value ? (d(), m(p(f), {
24
- key: 0,
25
- id: e.labelForId,
26
- class: "checkboxes",
27
- "possible-values": a.value,
28
- alignment: n.value,
29
- disabled: e.disabled,
30
- "model-value": e.control.data,
31
- error: e.error,
32
- "sub-text": e.subText,
33
- "onUpdate:modelValue": e.changeValue
34
- }, null, 8, ["id", "possible-values", "alignment", "disabled", "model-value", "error", "sub-text", "onUpdate:modelValue"])) : b("", !0);
35
- }
36
- });
37
- export {
38
- F as default
39
- };
@@ -1,29 +0,0 @@
1
- import { defineComponent as o, openBlock as a, createBlock as l, unref as t } from "vue";
2
- import { KdsColorInput as n } from "@knime/kds-components";
3
- const c = /* @__PURE__ */ o({
4
- __name: "ColorControl",
5
- props: {
6
- control: {},
7
- handleChange: { type: Function },
8
- changeValue: { type: Function },
9
- disabled: { type: Boolean },
10
- error: { type: Boolean },
11
- subText: {},
12
- onRegisterValidation: { type: Function },
13
- labelForId: {}
14
- },
15
- setup(e) {
16
- return (r, d) => (a(), l(t(n), {
17
- id: e.labelForId,
18
- ariaLabel: e.control.label,
19
- "model-value": e.control.data ?? "",
20
- disabled: e.disabled,
21
- error: e.error,
22
- "sub-text": e.subText,
23
- "onUpdate:modelValue": e.changeValue
24
- }, null, 8, ["id", "ariaLabel", "model-value", "disabled", "error", "sub-text", "onUpdate:modelValue"]));
25
- }
26
- });
27
- export {
28
- c as default
29
- };
@@ -1,90 +0,0 @@
1
- import { defineComponent as u, openBlock as e, createElementBlock as o, createVNode as y, unref as p, computed as s, normalizeStyle as m, createBlock as d, Fragment as f, renderList as k } from "vue";
2
- import { KdsEmptyState as w } from "@knime/kds-components";
3
- import { _ as v, u as C } from "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_c79c6b71_lang-Ccuf283K.js";
4
- const P = { class: "empty-state-wrapper" }, $ = /* @__PURE__ */ u({
5
- __name: "ColorPreviewEmptyState",
6
- setup(r) {
7
- return (t, l) => (e(), o("div", P, [
8
- y(p(w), { headline: "No colors" })
9
- ]));
10
- }
11
- }), g = /* @__PURE__ */ v($, [["__scopeId", "data-v-7a09310d"]]), x = { class: "gradient-preview" }, b = /* @__PURE__ */ u({
12
- __name: "GradientPreview",
13
- props: {
14
- gradient: {}
15
- },
16
- setup(r) {
17
- const t = r, l = s(() => t.gradient.colors.length > 0), a = s(() => {
18
- const n = t.gradient.stops;
19
- return n === null ? t.gradient.colors.join(", ") : t.gradient.colors.map((i, _) => `${i} ${n[_]}%`).join(", ");
20
- }), c = s(
21
- () => `linear-gradient(to right in lab, ${a.value})`
22
- );
23
- return (n, i) => (e(), o("div", x, [
24
- l.value ? (e(), o("div", {
25
- key: 0,
26
- class: "gradient-bar",
27
- style: m({ background: c.value })
28
- }, null, 4)) : (e(), d(g, { key: 1 }))
29
- ]));
30
- }
31
- }), S = /* @__PURE__ */ v(b, [["__scopeId", "data-v-8a745225"]]), B = { class: "palette-preview" }, F = 8, E = /* @__PURE__ */ u({
32
- __name: "PalettePreview",
33
- props: {
34
- palette: {}
35
- },
36
- setup(r) {
37
- const t = r, l = s(() => t.palette.colors.length > 0), a = s(
38
- () => Math.max(1, Math.min(F, t.palette.colors.length))
39
- ), c = s(() => ({
40
- gridTemplateColumns: `repeat(${a.value}, minmax(0, 1fr))`
41
- }));
42
- return (n, i) => (e(), o("div", B, [
43
- l.value ? (e(), o("div", {
44
- key: 0,
45
- class: "palette-grid",
46
- style: m(c.value)
47
- }, [
48
- (e(!0), o(f, null, k(r.palette.colors, (_, h) => (e(), o("div", {
49
- key: h,
50
- class: "color-cell",
51
- style: m({ background: _ })
52
- }, null, 4))), 128))
53
- ], 4)) : (e(), d(g, {
54
- key: 1,
55
- class: "empty-state"
56
- }))
57
- ]));
58
- }
59
- }), G = /* @__PURE__ */ v(E, [["__scopeId", "data-v-ad83046f"]]), I = { class: "color-preview" }, j = /* @__PURE__ */ u({
60
- __name: "ColorPreviewControl",
61
- props: {
62
- control: {},
63
- handleChange: { type: Function },
64
- changeValue: { type: Function },
65
- disabled: { type: Boolean },
66
- labelForId: {},
67
- error: { type: Boolean },
68
- subText: {},
69
- onRegisterValidation: { type: Function }
70
- },
71
- setup(r) {
72
- const t = r, l = s(
73
- () => t.control.uischema
74
- ), a = C(l, "previewColors", {
75
- colors: []
76
- }), c = (n) => !("stops" in n);
77
- return (n, i) => (e(), o("div", I, [
78
- c(p(a)) ? (e(), d(G, {
79
- key: 0,
80
- palette: p(a)
81
- }, null, 8, ["palette"])) : (e(), d(S, {
82
- key: 1,
83
- gradient: p(a)
84
- }, null, 8, ["gradient"]))
85
- ]));
86
- }
87
- });
88
- export {
89
- j as default
90
- };
@@ -1,39 +0,0 @@
1
- import { defineComponent as r, toRef as d, computed as a, openBlock as c, createBlock as b, unref as u } from "vue";
2
- import { KdsMultiSelectDropdown as m } from "@knime/kds-components";
3
- import { u as v } from "./usePossibleValues-CXVLf00v.js";
4
- const w = /* @__PURE__ */ r({
5
- __name: "ComboBoxControl",
6
- props: {
7
- control: {},
8
- handleChange: { type: Function },
9
- changeValue: { type: Function },
10
- disabled: { type: Boolean },
11
- error: { type: Boolean },
12
- subText: {},
13
- onRegisterValidation: { type: Function },
14
- labelForId: {}
15
- },
16
- setup(e) {
17
- const l = e, { possibleValues: o } = v(d(l, "control")), t = a(
18
- () => o.value === null || o.value.length === 0
19
- ), n = a(
20
- () => l.control.uischema.providedOptions?.includes("possibleValues") || l.control.uischema.options?.possibleValues !== void 0
21
- ), i = a(
22
- () => l.disabled || t.value && n.value
23
- );
24
- return (p, V) => (c(), b(u(m), {
25
- id: e.labelForId,
26
- "model-value": e.control.data,
27
- "allow-new-values": !n.value,
28
- ariaLabel: e.control.label,
29
- disabled: i.value,
30
- "possible-values": t.value ? e.control.data.map((s) => ({ id: s, text: s })) : u(o),
31
- error: e.error,
32
- "sub-text": e.subText,
33
- "onUpdate:modelValue": e.changeValue
34
- }, null, 8, ["id", "model-value", "allow-new-values", "ariaLabel", "disabled", "possible-values", "error", "sub-text", "onUpdate:modelValue"]));
35
- }
36
- });
37
- export {
38
- w as default
39
- };