@knime/jsonforms 1.21.13 → 1.21.15

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 (97) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{AnyOfTwinlist-RYrVJHV_.js → AnyOfTwinlist-CV39JeCp.js} +1 -1
  3. package/dist/{CheckboxControl-BZQzU-Kr.js → CheckboxControl-CS4nuJTP.js} +1 -1
  4. package/dist/{CheckboxesControl-BwtY2fOR.js → CheckboxesControl-DXJMkZ49.js} +2 -2
  5. package/dist/{ColorControl-CpETHjy6.js → ColorControl-CpBVJh38.js} +1 -1
  6. package/dist/{ColorPreviewControl-3_H8I1ri.js → ColorPreviewControl-0VK3OqwY.js} +1 -1
  7. package/dist/{ComboBoxControl-DqRfhSYY.js → ComboBoxControl-avfNedsG.js} +4 -4
  8. package/dist/DateControl-B8E0JEIV.js +42 -0
  9. package/dist/DateTimeControl-DPjGzRqg.js +78 -0
  10. package/dist/{DateTimeFormatPickerControl-8pdgRAZx.js → DateTimeFormatPickerControl-Cx3yfT3O.js} +1 -1
  11. package/dist/DateTimeFormatPickerWithTypeControl-CodEVQG_.js +586 -0
  12. package/dist/{DropdownControl-BRwJh-oy.js → DropdownControl-DEggcwK1.js} +2 -2
  13. package/dist/{ExecutorCoresControl-iOlO4K2q.js → ExecutorCoresControl-CvCVcaHM.js} +1 -1
  14. package/dist/{ExecutorMemoryControl-BtEuJKmI.js → ExecutorMemoryControl-CpbVJNq4.js} +1 -1
  15. package/dist/{FileUploadControl-Bo7spGQA.js → FileUploadControl-CNUi9QfR.js} +21 -21
  16. package/dist/{GridSelectionControl-N52hhlRg.js → GridSelectionControl-HV2yNE4R.js} +14 -14
  17. package/dist/{HorizontalLayout-CdU7c7fd.js → HorizontalLayout-Cqf3hzxv.js} +1 -1
  18. package/dist/{IntegerControl-CZVvT_hf.js → IntegerControl-Ba5QkLCa.js} +1 -1
  19. package/dist/IntervalControl-DlLV8RQr.js +48 -0
  20. package/dist/{LinkControl-CMeBPEW1.js → LinkControl-COH9jvPg.js} +4 -4
  21. package/dist/{LoadingDropdown.vue_vue_type_script_setup_true_lang-l_tRM6I-.js → LoadingDropdown.vue_vue_type_script_setup_true_lang-Cir2ym2M.js} +5 -5
  22. package/dist/{ManualTwinlistControl-Lq5T8rQ5.js → ManualTwinlistControl-jJGxlq9j.js} +3 -3
  23. package/dist/{MultiSelectListBoxControl-CzeR-Wbl.js → MultiSelectListBoxControl-DcWDraNF.js} +12 -12
  24. package/dist/{MultimodeTwinlistControl-Co2COblq.js → MultimodeTwinlistControl-B-rEhgKQ.js} +1 -1
  25. package/dist/{MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-BFrN-w7G.js → MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-yhmiIg95.js} +5 -5
  26. package/dist/{NameFilter-BfYUOZX-.js → NameFilter-BFKNf9cO.js} +1 -1
  27. package/dist/{NumberControl-D5LeZR7g.js → NumberControl-BAxGZy_4.js} +1 -1
  28. package/dist/{NumberControlBase.vue_vue_type_script_setup_true_lang-yBfQ2lTo.js → NumberControlBase.vue_vue_type_script_setup_true_lang-Dlxx71hk.js} +2 -2
  29. package/dist/{OneOfDropdown-DkXPGVGA.js → OneOfDropdown-DcetHKT5.js} +4 -4
  30. package/dist/{RadioButtonsWithDescriptionControl-BZEiPIT7.js → RadioButtonsWithDescriptionControl-pZ0gJ6iz.js} +4 -4
  31. package/dist/{RadioControl-BM8jzumR.js → RadioControl-B8-nxddP.js} +1 -1
  32. package/dist/{RadioControlBase.vue_vue_type_script_setup_true_lang-DEZ-BDbe.js → RadioControlBase.vue_vue_type_script_setup_true_lang-8xWE-iQR.js} +8 -8
  33. package/dist/ResourceControlBase-ZMTuwwL2.js +86 -0
  34. package/dist/{RichTextControl-BSDuXS-r.js → RichTextControl-kptCYz2A.js} +5874 -4964
  35. package/dist/{SectionHeading-CQPP2Ldw.js → SectionHeading-MlqCj5BS.js} +1 -1
  36. package/dist/{SectionLayout-DVSBUJWh.js → SectionLayout-nV1GnghP.js} +3 -3
  37. package/dist/SettingsSubPanel-Z6urYwz1.js +5 -0
  38. package/dist/{SettingsSubPanelLayout-BGGUILX0.js → SettingsSubPanelLayout-BNMJbUsL.js} +4 -4
  39. package/dist/{SimpleButtonControl-CrZYDy2d.js → SimpleButtonControl-DZFYl2H3.js} +8 -8
  40. package/dist/SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-zrzBlOHh.js +27089 -0
  41. package/dist/{SimpleTwinlistControl-DNXi9aTL.js → SimpleTwinlistControl-Ds2BQOoO.js} +2 -2
  42. package/dist/{SingleSelectControl-UgYnjUWO.js → SingleSelectControl-CLv_Mah-.js} +2 -2
  43. package/dist/{SingleSelectListBoxControl-CxkgaK13.js → SingleSelectListBoxControl-DM_5t3Nv.js} +3 -3
  44. package/dist/{SortListControl-C_ov2UWK.js → SortListControl-COd0WHwd.js} +1 -1
  45. package/dist/{StyledListItem-CzxxmMCV.js → StyledListItem-D3NbpWl3.js} +1 -1
  46. package/dist/{TeamAndSpacesControl-D7oS2zYV.js → TeamAndSpacesControl-A8mWrSE4.js} +1 -1
  47. package/dist/{TeamResourceControl-CYobSLvC.js → TeamResourceControl-CAgwzjRZ.js} +1 -1
  48. package/dist/{TextAreaControl-AG_b-Z5X.js → TextAreaControl-DRBGqA7a.js} +1 -1
  49. package/dist/{TextControl-BSEmxN5j.js → TextControl--Tw-AE3y.js} +1 -1
  50. package/dist/{TextControl.vue_vue_type_script_setup_true_lang-CadH1IKc.js → TextControl.vue_vue_type_script_setup_true_lang-PdbUWJUv.js} +2 -2
  51. package/dist/TimeControl-D_hEPt2Z.js +69 -0
  52. package/dist/TimeframesControl-EKcriaC8.js +345 -0
  53. package/dist/{TwinlistControlBase.vue_vue_type_script_setup_true_lang-SsKJamsg.js → TwinlistControlBase.vue_vue_type_script_setup_true_lang-BRq0ANwm.js} +2 -2
  54. package/dist/{TypedStringFilter-DAcGj5q1.js → TypedStringFilter-UUuSnJNk.js} +1 -1
  55. package/dist/{ValueSwitchControl-CXrI8Yl-.js → ValueSwitchControl-BwERUIyr.js} +1 -1
  56. package/dist/{VerticalLayout-eL6w0Hg9.js → VerticalLayout-BET3pZ_K.js} +2 -2
  57. package/dist/{VerticalLayoutBase-B9SsD2_6.js → VerticalLayoutBase-HYtDwVLA.js} +1 -1
  58. package/dist/ZonedDateTimeControl-CsbZwGMX.js +77 -0
  59. package/dist/{_Uint8Array-Du4fEgNS.js → _Uint8Array-DJimCh8a.js} +5 -7
  60. package/dist/classApi-CHpAZrj3.js +3328 -0
  61. package/dist/knime-jsonforms.css +1 -1
  62. package/dist/knime-jsonforms.js +7 -7
  63. package/dist/plainDateTimeUtils-CR0UhpkD.js +52 -0
  64. package/dist/src/composables/usePlainDateTimeBatch.d.ts +31 -0
  65. package/dist/src/index.d.ts +2 -0
  66. package/dist/src/uiComponents/DateControl.vue.d.ts +1 -1
  67. package/dist/src/uiComponents/DateTimeControl.vue.d.ts +1 -1
  68. package/dist/src/uiComponents/TimeControl.vue.d.ts +1 -1
  69. package/dist/src/utils/plainDateTimeUtils.d.ts +66 -0
  70. package/dist/testing.js +11136 -10284
  71. package/dist/{toString-Cng8dMI8.js → toString-B8vqfiDe.js} +3 -4
  72. package/dist/{useBuiltinValidations-CT2mv4JV.js → useBuiltinValidations-CzYsm8oq.js} +1 -1
  73. package/dist/useDropdownNavigation-CdrbT-CQ.js +2003 -0
  74. package/dist/usePlainDateTimeBatch-Bd2G-GY9.js +34 -0
  75. package/dist/{usePossibleValues-DlVd3QMh.js → usePossibleValues-CGt7yrJ6.js} +1 -1
  76. package/dist/{useUnknownValuesInTwinlist-UbVZb8Wt.js → useUnknownValuesInTwinlist-Bez1tY4_.js} +1 -1
  77. package/package.json +5 -8
  78. package/dist/DateControl-Cg1q7qVH.js +0 -35
  79. package/dist/DateTimeControl-C7EwnT5D.js +0 -44
  80. package/dist/DateTimeFormatPickerWithTypeControl-oBFnJRkM.js +0 -464
  81. package/dist/IntervalControl-DW-jmzYH.js +0 -751
  82. package/dist/ResourceControlBase-Djv2vDNo.js +0 -69
  83. package/dist/SettingsSubPanel-DKVUGp-Q.js +0 -5
  84. package/dist/SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-3pf9Mad5.js +0 -28295
  85. package/dist/TimeControl-GY-l_p55.js +0 -35
  86. package/dist/TimePartInput-BGCbCcks.js +0 -254
  87. package/dist/TimeframesControl-BT_-Fm_A.js +0 -87
  88. package/dist/Tooltip-Bc8zeqxg.js +0 -24
  89. package/dist/ValueSwitch-DnpLqjm_.js +0 -130
  90. package/dist/ZonedDateTimeControl-y5IsH4g_.js +0 -66
  91. package/dist/_baseIteratee-echQG1Gb.js +0 -308
  92. package/dist/arrow-dropdown-DMFBPPcK.js +0 -17
  93. package/dist/floating-ui.vue-Bk6u3tWN.js +0 -1060
  94. package/dist/localTimeUtils-DlStha9G.js +0 -12315
  95. package/dist/popper-iehk3xNV.js +0 -923
  96. package/dist/src/utils/localTimeUtils.d.ts +0 -18
  97. package/dist/useDropdownNavigation-EOwf_fL0.js +0 -946
@@ -0,0 +1,34 @@
1
+ import { computed as s, ref as f } from "vue";
2
+ import { p as g } from "./plainDateTimeUtils-CR0UhpkD.js";
3
+ const G = (n) => {
4
+ const u = s(
5
+ () => g.fromString(n.getDateTime())
6
+ ), c = s(() => u.value.date), m = s(() => u.value.time), i = f(
7
+ g.detectGranularity(n.getDateTime())
8
+ );
9
+ let t, a, o, r = !1;
10
+ const v = () => {
11
+ r = !1;
12
+ const e = t === void 0 ? c.value : t, h = a === void 0 ? m.value : a, d = o ?? i.value;
13
+ t = void 0, a = void 0, o = void 0, i.value = d, n.commit(e, h, d);
14
+ }, l = () => {
15
+ r || (r = !0, queueMicrotask(v));
16
+ };
17
+ return {
18
+ datePart: c,
19
+ timePart: m,
20
+ granularity: i,
21
+ onDateChange: (e) => {
22
+ t = e, l();
23
+ },
24
+ onTimeChange: (e) => {
25
+ a = e, l();
26
+ },
27
+ onGranularityChange: (e) => {
28
+ o = e, l();
29
+ }
30
+ };
31
+ };
32
+ export {
33
+ G as u
34
+ };
@@ -1,5 +1,5 @@
1
1
  import { computed as l } from "vue";
2
- import { u as d } from "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-3pf9Mad5.js";
2
+ import { u as d } from "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-zrzBlOHh.js";
3
3
  const t = (s, e) => {
4
4
  const u = l(() => s.value.uischema), o = d(u, "possibleValues");
5
5
  return { possibleValues: l(() => u.value.providedOptions?.includes("possibleValues") ? o.value : u.value.options?.possibleValues ?? (typeof e?.defaultOnNonProvided > "u" ? [] : e?.defaultOnNonProvided)) };
@@ -1,6 +1,6 @@
1
1
  import { ref as v, watch as m } from "vue";
2
2
  import { g as S, a as g } from "./index-Blg1O3Fz.js";
3
- import "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-3pf9Mad5.js";
3
+ import "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-zrzBlOHh.js";
4
4
  const w = ({
5
5
  knownValuesSide: s,
6
6
  possibleValueIds: l,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/jsonforms",
3
- "version": "1.21.13",
3
+ "version": "1.21.15",
4
4
  "description": "Internal JSON Forms integration for frontend KNIME projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,11 +16,9 @@
16
16
  "@jsonforms/core": "3.4.0",
17
17
  "@jsonforms/vue": "3.4.0",
18
18
  "@jsonforms/vue-vanilla": "3.4.0",
19
- "@knime/kds-components": "0.23.2",
19
+ "@knime/kds-components": "0.25.1",
20
20
  "ajv": "8.18.0",
21
- "date-fns": "2.30.0",
22
- "focus-trap-vue": "4.0.3",
23
- "tabbable": "6.2.0",
21
+ "temporal-polyfill": "^0.3.2",
24
22
  "uuid": "14.0.0",
25
23
  "@knime/components": "1.46.6",
26
24
  "@knime/rich-text-editor": "1.8.23",
@@ -37,14 +35,13 @@
37
35
  "consola": "3.4.2",
38
36
  "lodash-es": "4.18.1",
39
37
  "modern-normalize": "3.0.1",
40
- "postcss": "8.5.6",
38
+ "postcss": "8.5.10",
41
39
  "type-fest": "4.26.1",
42
40
  "typescript": "^5.9.3",
43
- "v-calendar": "git://github.com/knime-oss/v-calendar.git#048477f",
44
41
  "vite": "^7.3.1",
45
42
  "vite-plugin-dts": "4.5.4",
46
43
  "vite-svg-loader": "5.1.0",
47
- "vitest": "4.0.18",
44
+ "vitest": "4.1.5",
48
45
  "vue": "~3.5.18",
49
46
  "vue-tsc": "3.0.4"
50
47
  },
@@ -1,35 +0,0 @@
1
- import { defineComponent as i, computed as d, openBlock as s, createBlock as u, unref as r } from "vue";
2
- import { f as m, t as c, D as p } from "./localTimeUtils-DlStha9G.js";
3
- const b = /* @__PURE__ */ i({
4
- __name: "DateControl",
5
- props: {
6
- control: {},
7
- handleChange: { type: Function },
8
- changeValue: { type: Function },
9
- disabled: { type: Boolean },
10
- isValid: { type: Boolean },
11
- onRegisterValidation: { type: Function },
12
- labelForId: {}
13
- },
14
- setup(e) {
15
- const o = e, t = d({
16
- get: () => c(o.control.data),
17
- set: (a) => o.changeValue(m(a))
18
- });
19
- return (a, l) => (s(), u(r(p), {
20
- id: e.labelForId,
21
- modelValue: t.value,
22
- "onUpdate:modelValue": l[0] || (l[0] = (n) => t.value = n),
23
- "two-lines": "",
24
- required: !0,
25
- "show-time": !1,
26
- compact: "",
27
- disabled: e.disabled,
28
- "is-valid": e.isValid,
29
- timezone: "UTC"
30
- }, null, 8, ["id", "modelValue", "disabled", "is-valid"]));
31
- }
32
- });
33
- export {
34
- b as default
35
- };
@@ -1,44 +0,0 @@
1
- import { defineComponent as r, computed as o, openBlock as v, createBlock as p, unref as h } from "vue";
2
- import { t, f as w, D as f } from "./localTimeUtils-DlStha9G.js";
3
- const x = /* @__PURE__ */ r({
4
- __name: "DateTimeControl",
5
- props: {
6
- control: {},
7
- handleChange: { type: Function },
8
- changeValue: { type: Function },
9
- disabled: { type: Boolean },
10
- isValid: { type: Boolean },
11
- onRegisterValidation: { type: Function },
12
- labelForId: {}
13
- },
14
- setup(a) {
15
- const l = a, e = o(() => l.control.uischema.options), s = o(
16
- () => e.value?.minimum ? t(e.value.minimum) : null
17
- ), u = o(
18
- () => e.value?.maximum ? t(e.value.maximum) : null
19
- ), d = o(() => e.value?.twoLines ?? !0), i = o({
20
- get: () => t(l.control.data),
21
- set: (n) => l.changeValue(w(n))
22
- });
23
- return (n, m) => (v(), p(h(f), {
24
- id: a.labelForId,
25
- modelValue: i.value,
26
- "onUpdate:modelValue": m[0] || (m[0] = (c) => i.value = c),
27
- "two-lines": d.value,
28
- required: !0,
29
- "show-time": e.value?.showTime,
30
- "show-seconds": e.value?.showSeconds,
31
- "show-milliseconds": e.value?.showMilliseconds,
32
- timezone: "UTC",
33
- "date-format": e.value?.dateFormat,
34
- min: s.value,
35
- max: u.value,
36
- "is-valid": a.isValid,
37
- compact: "",
38
- disabled: a.disabled
39
- }, null, 8, ["id", "modelValue", "two-lines", "show-time", "show-seconds", "show-milliseconds", "date-format", "min", "max", "is-valid", "disabled"]));
40
- }
41
- });
42
- export {
43
- x as default
44
- };
@@ -1,464 +0,0 @@
1
- import { openBlock as p, createElementBlock as T, createElementVNode as h, h as Q, defineComponent as D, createBlock as z, unref as g, useCssVars as q, computed as y, ref as x, watch as C, reactive as G, onMounted as J, nextTick as O, onUnmounted as X, withCtx as Y, createCommentVNode as A, createVNode as _, Fragment as ee, renderList as te, normalizeClass as S, toDisplayString as H, useModel as oe, withDirectives as le, vModelText as ae, normalizeStyle as se, mergeModels as ne } from "vue";
2
- import { _ as M, Q as ie, u as re } from "./SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-3pf9Mad5.js";
3
- import { V as R } from "./ValueSwitch-DnpLqjm_.js";
4
- import { u as de, a as ce, o as ue, s as me, f as pe } from "./floating-ui.vue-Bk6u3tWN.js";
5
- import { u as ve, F as fe } from "./useDropdownNavigation-EOwf_fL0.js";
6
- const he = {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- fill: "none",
9
- stroke: "#000",
10
- "stroke-linejoin": "round",
11
- viewBox: "0 0 32 32"
12
- };
13
- function ye(a, r) {
14
- return p(), T("svg", he, [...r[0] || (r[0] = [
15
- h("path", { d: "m11.9 22.3 2.7 4.4-4.5 2.8m4.5-2.8C9 26 4.7 21.7 4.7 16c0-5.1 3.4-9.4 8.1-10.8M20 9.7l-2.6-4.4 4.5-2.8m-4.5 2.8c5.6.7 9.9 5 9.9 10.7 0 5.1-3.4 9.4-8.1 10.8" }, null, -1)
16
- ])]);
17
- }
18
- const Te = { render: ye }, ge = (a, r) => ({
19
- render() {
20
- const s = a.render({}, []), d = Q("title", r);
21
- return d.ns = "svg", s.children.unshift(d), s;
22
- }
23
- }), we = /* @__PURE__ */ D({
24
- __name: "LoadingIcon",
25
- setup(a) {
26
- const r = ge(Te, "Loading…");
27
- return (s, d) => (p(), z(g(r)));
28
- }
29
- }), xe = /* @__PURE__ */ M(we, [["__scopeId", "data-v-6b552b81"]]), Ee = {
30
- xmlns: "http://www.w3.org/2000/svg",
31
- fill: "none",
32
- "stroke-linejoin": "round",
33
- viewBox: "0 0 32 32"
34
- };
35
- function Fe(a, r) {
36
- return p(), T("svg", Ee, [...r[0] || (r[0] = [
37
- h("path", {
38
- fill: "#000",
39
- d: "M2 3.842v-.5a.5.5 0 0 0-.5.5zm22.611 0h.5a.5.5 0 0 0-.5-.5zm-.5 7.48a.5.5 0 1 0 1 0zM2 21.43h-.5a.5.5 0 0 0 .5.5zm10.298.5a.5.5 0 1 0 0-1zm5.283 8.222h-.5a.5.5 0 0 0 .765.424zm3.278-2.046.265.424a.5.5 0 0 0 .235-.424zm0-5.87-.366-.34a.5.5 0 0 0-.134.34zM27.613 15l.366.341a.5.5 0 0 0-.366-.841zm-10.032 7.235h.5a.5.5 0 0 0-.128-.334zM11.063 15v-.5a.5.5 0 0 0-.372.835zm-.69-9.483V2h-1v3.517zM16.155 2v3.517h1V2zM2 4.342h22.611v-1H2zm22.111-.5v7.48h1v-7.48zM2.5 21.43V3.842h-1V21.43zM2 8.362h22.611v-1H2zM12.298 20.93h-6.81v1h6.81zm-6.81 0H2v1h3.488zm12.358 9.646 3.278-2.046-.53-.849-3.278 2.047zm3.513-2.47v-5.87h-1v5.87zm-.135-5.528 6.755-7.236-.731-.682-6.755 7.235zm-4.143-.342v7.916h1v-7.916zm.872-.334-6.519-7.236-.743.67 6.519 7.235zm-6.89-6.401h16.55v-1h-16.55z"
40
- }, null, -1)
41
- ])]);
42
- }
43
- const _e = { render: Fe }, be = { class: "popover" }, Ve = { class: "formats-container-border-host" }, Ie = {
44
- key: 0,
45
- class: "no-formats-available"
46
- }, De = {
47
- key: 1,
48
- class: "no-formats-available"
49
- }, Me = ["onClick"], ke = { class: "format-pattern" }, Ce = { class: "format-preview" }, U = 1, ze = /* @__PURE__ */ D({
50
- __name: "DateTimeFormatPickerPopover",
51
- props: {
52
- allFormats: {},
53
- selectedType: {},
54
- initialSelectedPattern: {},
55
- showTypeSwitch: { type: Boolean }
56
- },
57
- emits: ["commit", "cancel"],
58
- setup(a, { emit: r }) {
59
- q((e) => ({
60
- v3b9e5e3a: U
61
- }));
62
- const s = r, d = a, b = y(() => [
63
- {
64
- id: "RECENT",
65
- text: "Recent"
66
- },
67
- {
68
- id: "STANDARD",
69
- text: "ISO"
70
- },
71
- {
72
- id: "EUROPEAN",
73
- text: "European"
74
- },
75
- {
76
- id: "AMERICAN",
77
- text: "United States"
78
- }
79
- ]), V = y(() => [
80
- {
81
- id: "DATE",
82
- text: "Date"
83
- },
84
- {
85
- id: "DATE_TIME",
86
- text: "Date & time"
87
- },
88
- {
89
- id: "TIME",
90
- text: "Time"
91
- },
92
- {
93
- id: "ZONED_DATE_TIME",
94
- text: "Zoned date & time"
95
- }
96
- ]), c = x(null), m = x(null), n = x("RECENT"), u = x(d.selectedType);
97
- C(
98
- () => d.selectedType,
99
- (e) => {
100
- m.value = e;
101
- }
102
- );
103
- const l = y(
104
- () => d.allFormats?.filter(
105
- (e) => e.category === n.value && e.temporalType === u.value
106
- ) ?? null
107
- ), v = x(null), f = G({}), E = (e) => `${e.format}-${e.category}-${e.temporalType}`, L = (e) => (t) => {
108
- f[E(e)] = t;
109
- }, F = (e) => ({
110
- format: e.format,
111
- temporalType: e.temporalType
112
- }), {
113
- currentIndex: P,
114
- onKeydown: N,
115
- resetNavigation: W,
116
- setElement: Z
117
- } = ve({
118
- keepOpenedOnTab: !0,
119
- getFirstElement: () => ({
120
- index: 0,
121
- onClick: () => s(
122
- "commit",
123
- F(l.value[0])
124
- )
125
- }),
126
- getLastElement: () => {
127
- const e = l.value.length - 1;
128
- return {
129
- index: e,
130
- onClick: () => s(
131
- "commit",
132
- F(l.value[e])
133
- )
134
- };
135
- },
136
- getNextElement: (e, t) => {
137
- if (e = e === null || e === -1 ? null : e, t === 1) {
138
- const i = ((e ?? -1) + 1) % l.value.length;
139
- return {
140
- index: i,
141
- onClick: () => s(
142
- "commit",
143
- F(l.value[i])
144
- )
145
- };
146
- } else {
147
- const i = ((e ?? 0) - 1 + l.value.length) % l.value.length;
148
- return {
149
- index: i,
150
- onClick: () => s(
151
- "commit",
152
- F(l.value[i])
153
- )
154
- };
155
- }
156
- },
157
- close: () => {
158
- s("cancel");
159
- }
160
- }), K = (e) => {
161
- const t = e.parentElement;
162
- if (t && t.scrollHeight > t.clientHeight) {
163
- const o = t.offsetTop + U, i = t.clientHeight + t.scrollTop, w = e.offsetTop + e.offsetHeight - o;
164
- w > i ? t.scrollTop = w - t.clientHeight : e.offsetTop - t.scrollTop < o && (t.scrollTop = e.offsetTop - o);
165
- }
166
- }, $ = (e) => {
167
- const t = f[`${e}-${n.value}-${u.value}`];
168
- t && K(t);
169
- }, B = async (e, t, o) => {
170
- u.value = t ?? u.value, n.value = o ?? n.value, await O(), m.value = e, $(e);
171
- const i = l.value.findIndex(
172
- (w) => w.format === e
173
- );
174
- Z({
175
- index: i,
176
- onClick: () => s(
177
- "commit",
178
- F(l.value[i])
179
- )
180
- });
181
- };
182
- C(P, (e) => {
183
- if (e === null)
184
- return;
185
- const t = l.value?.[e]?.format;
186
- t && $(t);
187
- }), C([u, n], () => {
188
- u.value === c.value?.temporalType && n.value === c.value?.category ? B(
189
- c.value.format,
190
- c.value.temporalType,
191
- c.value.category
192
- ) : (m.value = null, W());
193
- });
194
- const I = x(!1);
195
- return J(async () => {
196
- if (!d.allFormats)
197
- return;
198
- const e = [
199
- "RECENT",
200
- "STANDARD",
201
- "EUROPEAN",
202
- "AMERICAN"
203
- ], t = d.allFormats.filter((o) => d.initialSelectedPattern === o.format).filter(
204
- (o) => (
205
- // if the type switch is hidden, filter to only formats with the same type
206
- d.selectedType === o.temporalType || d.showTypeSwitch
207
- )
208
- ).sort((o, i) => {
209
- const w = e.indexOf(o.category), k = e.indexOf(i.category);
210
- return w - k;
211
- });
212
- if (t.length > 0) {
213
- const o = t[0].format, i = t[0].temporalType, w = t[0].category;
214
- await B(o, i, w);
215
- const k = l.value.findIndex(
216
- (j) => j.format === o
217
- );
218
- c.value = {
219
- format: o,
220
- index: k,
221
- category: w,
222
- temporalType: i
223
- };
224
- }
225
- O(() => I.value = !0);
226
- }), X(() => I.value = !1), (e, t) => (p(), z(g(fe), {
227
- active: I.value,
228
- "onUpdate:active": t[3] || (t[3] = (o) => I.value = o),
229
- "initial-focus": () => v.value ?? !1
230
- }, {
231
- default: Y(() => [
232
- h("div", be, [
233
- a.showTypeSwitch ? (p(), z(R, {
234
- key: 0,
235
- id: "selectedFormatType",
236
- ref: "typeSwitchRef",
237
- modelValue: u.value,
238
- "onUpdate:modelValue": t[0] || (t[0] = (o) => u.value = o),
239
- compact: "",
240
- "possible-values": V.value,
241
- class: "filter-switch"
242
- }, null, 8, ["modelValue", "possible-values"])) : A("", !0),
243
- _(R, {
244
- id: "selectedFormatStandard",
245
- ref: "standardSwitchRef",
246
- modelValue: n.value,
247
- "onUpdate:modelValue": t[1] || (t[1] = (o) => n.value = o),
248
- compact: "",
249
- "possible-values": b.value,
250
- class: "filter-switch"
251
- }, null, 8, ["modelValue", "possible-values"]),
252
- h("div", Ve, [
253
- h("div", {
254
- id: "dateFormats",
255
- ref_key: "formatContainerRef",
256
- ref: v,
257
- class: "formats-container",
258
- tabindex: "0",
259
- role: "menu",
260
- onKeydown: t[2] || (t[2] = //@ts-ignore
261
- (...o) => g(N) && g(N)(...o))
262
- }, [
263
- l.value === null ? (p(), T("div", Ie, [
264
- _(xe, { class: "loading-spinner" })
265
- ])) : l.value.length === 0 ? (p(), T("div", De, " No formats available ")) : (p(!0), T(ee, { key: 2 }, te(l.value, (o, i) => (p(), T("div", {
266
- key: E(o),
267
- ref_for: !0,
268
- ref: L(o),
269
- class: S([{
270
- highlighted: i === g(P),
271
- applied: i === c.value?.index && o.category === c.value.category && o.temporalType === c.value.temporalType
272
- }, "single-format"]),
273
- role: "menuitem",
274
- onClick: () => s("commit", F(o))
275
- }, [
276
- h("span", ke, H(o.format), 1),
277
- h("span", Ce, H(o.example), 1)
278
- ], 10, Me))), 128))
279
- ], 544)
280
- ])
281
- ])
282
- ]),
283
- _: 1
284
- }, 8, ["active", "initial-focus"]));
285
- }
286
- }), Ae = /* @__PURE__ */ M(ze, [["__scopeId", "data-v-8bb40d8b"]]), Se = { class: "input-fields" }, Re = ["disabled"], Pe = {
287
- key: 0,
288
- class: "invalid-marker"
289
- }, Ne = ["disabled"], $e = {}, Be = /* @__PURE__ */ D({
290
- ...$e,
291
- __name: "DateTimeFormatInput",
292
- props: /* @__PURE__ */ ne({
293
- disabled: { type: Boolean, default: !1 },
294
- compact: { type: Boolean, default: !1 },
295
- isValid: { type: Boolean, default: !0 },
296
- allDefaultFormats: {},
297
- allowedTypes: { default: () => [
298
- "DATE",
299
- "TIME",
300
- "DATE_TIME",
301
- "ZONED_DATE_TIME"
302
- ] },
303
- showTypeSwitchInPopover: { type: Boolean, default: !0 }
304
- }, {
305
- modelValue: {
306
- default: {
307
- format: "yyyy-MM-dd",
308
- temporalType: "DATE"
309
- }
310
- },
311
- modelModifiers: {}
312
- }),
313
- emits: ["update:modelValue"],
314
- setup(a) {
315
- const r = a, s = oe(a, "modelValue"), d = y({
316
- get: () => s.value.format,
317
- set: (v) => {
318
- s.value = {
319
- ...s.value,
320
- format: v
321
- };
322
- }
323
- }), b = "Format like 'yyyy-MM-dd'", V = y(() => r.isValid), c = x(null), m = x(null), n = x(!1), u = (v) => {
324
- s.value = v, n.value = !1;
325
- };
326
- ie(m, () => n.value = !1, {
327
- ignore: [c]
328
- });
329
- const { floatingStyles: l } = de(
330
- c,
331
- m,
332
- {
333
- middleware: [
334
- ue({
335
- mainAxis: 2,
336
- crossAxis: 0
337
- }),
338
- me(),
339
- pe({
340
- mainAxis: !0,
341
- crossAxis: !1
342
- })
343
- ],
344
- placement: "top-end",
345
- whileElementsMounted: ce
346
- }
347
- );
348
- return (v, f) => (p(), T("div", null, [
349
- h("div", {
350
- class: S(["wrapper", { disabled: a.disabled, compact: a.compact }])
351
- }, [
352
- h("span", Se, [
353
- le(h("input", {
354
- "onUpdate:modelValue": f[0] || (f[0] = (E) => d.value = E),
355
- type: "text",
356
- disabled: a.disabled,
357
- placeholder: b,
358
- spellcheck: "false",
359
- onFocus: f[1] || (f[1] = (E) => n.value = !1)
360
- }, null, 40, Re), [
361
- [ae, d.value]
362
- ]),
363
- V.value ? A("", !0) : (p(), T("span", Pe)),
364
- h("button", {
365
- ref_key: "togglePopoverButtonRef",
366
- ref: c,
367
- class: S(["trigger-popover-button", { active: n.value }]),
368
- disabled: a.disabled,
369
- onClick: f[2] || (f[2] = (E) => n.value = !n.value)
370
- }, [
371
- _(g(_e))
372
- ], 10, Ne)
373
- ])
374
- ], 2),
375
- n.value ? (p(), T("div", {
376
- key: 0,
377
- ref_key: "floatingPopoverRef",
378
- ref: m,
379
- class: "popover",
380
- style: se(g(l))
381
- }, [
382
- _(Ae, {
383
- "all-formats": a.allDefaultFormats,
384
- "initial-selected-pattern": s.value.format,
385
- "selected-type": s.value.temporalType,
386
- "show-type-switch": a.showTypeSwitchInPopover,
387
- onCommit: u,
388
- onCancel: f[3] || (f[3] = (E) => n.value = !1)
389
- }, null, 8, ["all-formats", "initial-selected-pattern", "selected-type", "show-type-switch"])
390
- ], 4)) : A("", !0)
391
- ]));
392
- }
393
- }), Oe = /* @__PURE__ */ M(Be, [["__scopeId", "data-v-1577d5ce"]]), He = ["id"], Ue = /* @__PURE__ */ D({
394
- __name: "DateTimeFormatPickerWithTypeControl",
395
- props: {
396
- control: {},
397
- handleChange: { type: Function },
398
- changeValue: { type: Function },
399
- disabled: { type: Boolean },
400
- isValid: { type: Boolean },
401
- onRegisterValidation: { type: Function },
402
- labelForId: {}
403
- },
404
- setup(a) {
405
- const r = a, s = y(
406
- () => r.control.uischema
407
- ), d = y(() => s.value.options), b = y(() => d.value?.allowedFormats), V = re(s, "dateTimeFormats"), c = [
408
- {
409
- id: "DATE",
410
- text: "Date"
411
- },
412
- {
413
- id: "DATE_TIME",
414
- text: "Date & time"
415
- },
416
- {
417
- id: "TIME",
418
- text: "Time"
419
- },
420
- {
421
- id: "ZONED_DATE_TIME",
422
- text: "Zoned date & time"
423
- }
424
- ], m = y({
425
- get: () => r.control.data,
426
- set: (u) => {
427
- r.changeValue(u);
428
- }
429
- }), n = y({
430
- get: () => m.value.temporalType,
431
- set: (u) => {
432
- m.value = {
433
- ...m.value,
434
- temporalType: u
435
- };
436
- }
437
- });
438
- return (u, l) => (p(), T("div", {
439
- id: a.labelForId,
440
- class: "control-container"
441
- }, [
442
- _(g(R), {
443
- modelValue: n.value,
444
- "onUpdate:modelValue": l[0] || (l[0] = (v) => n.value = v),
445
- compact: "",
446
- "possible-values": c,
447
- disabled: a.disabled
448
- }, null, 8, ["modelValue", "disabled"]),
449
- _(g(Oe), {
450
- modelValue: m.value,
451
- "onUpdate:modelValue": l[1] || (l[1] = (v) => m.value = v),
452
- compact: "",
453
- disabled: a.disabled,
454
- "show-type-switch-in-popover": !1,
455
- "allowed-formats": b.value,
456
- "all-default-formats": g(V),
457
- "is-valid": !0
458
- }, null, 8, ["modelValue", "disabled", "allowed-formats", "all-default-formats"])
459
- ], 8, He));
460
- }
461
- }), Qe = /* @__PURE__ */ M(Ue, [["__scopeId", "data-v-8517cafd"]]);
462
- export {
463
- Qe as default
464
- };