impact-nova 2.5.17 → 2.5.19

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 (77) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +116 -0
  5. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
  6. package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
  8. package/dist/components/data/data-table/data-table-column-apply.js +84 -73
  9. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
  10. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
  11. package/dist/components/data/data-table/data-table-column-list.js +94 -64
  12. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
  13. package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
  14. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
  15. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
  16. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
  17. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
  18. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
  19. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
  20. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
  21. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
  22. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
  23. package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
  24. package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
  25. package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
  26. package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
  27. package/dist/components/data/nested-list/components/SortableItem.js +62 -60
  28. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
  29. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
  30. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
  31. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
  32. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
  33. package/dist/components/data/nested-list/nested-list-constants.js +10 -4
  34. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
  35. package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
  36. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
  37. package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
  38. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
  39. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
  40. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
  41. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
  42. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
  43. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
  44. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
  45. package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
  46. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
  47. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
  48. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
  49. package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
  50. package/dist/components/data/nested-list/nested-list.js +322 -336
  51. package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
  52. package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
  53. package/dist/components/data-display/calendar/calendar-year-utils.js +9 -9
  54. package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
  55. package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
  56. package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
  57. package/dist/components/forms/date-picker/year-range-picker.js +79 -79
  58. package/dist/form-react/Fields/ChipsField.js +49 -48
  59. package/dist/form-react/Fields/DateRangeField.js +25 -25
  60. package/dist/form-react/Fields/MonthRangeField.js +57 -57
  61. package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
  62. package/dist/form-react/Fields/MultiWeekPickerField.js +43 -41
  63. package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
  64. package/dist/form-react/Fields/SelectField.js +24 -26
  65. package/dist/form-react/Fields/WeekRangePicker.js +16 -16
  66. package/dist/form-react/Fields/YearPickerField.js +27 -27
  67. package/dist/form-react/Fields/YearRangePickerField.js +29 -29
  68. package/dist/form-react/types/fields.types.d.ts +30 -0
  69. package/dist/form-react/utils/date.utils.d.ts +51 -2
  70. package/dist/form-react/utils/date.utils.js +195 -63
  71. package/dist/impact-nova.css +1 -1
  72. package/dist/lib/hash/fnv1a128.d.ts +16 -0
  73. package/dist/lib/hash/fnv1a128.js +21 -0
  74. package/dist/llms/rules/ag-grid.js +1 -1
  75. package/dist/llms/rules/installation.js +1 -1
  76. package/dist/llms/rules/requirements.js +1 -1
  77. package/package.json +1 -1
@@ -1,72 +1,72 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { Controller as x } from "react-hook-form";
3
- import { MonthRangePicker as F } from "../../components/forms/date-picker/month-range-picker.js";
4
- import { getFieldTestId as T } from "../utils/fieldTestIds.js";
5
- import { toLocalDate as o } from "../utils/calendar-boundary.js";
6
- const w = (a) => {
7
- if (a.includes("/")) {
8
- const [r, i] = a.split("/");
9
- return { year: parseInt(i, 10), month: parseInt(r, 10) - 1 };
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Controller as F } from "react-hook-form";
3
+ import { MonthRangePicker as b } from "../../components/forms/date-picker/month-range-picker.js";
4
+ import { getFieldTestId as w } from "../utils/fieldTestIds.js";
5
+ import { resolveMonthRangeMinMax as I } from "../utils/date.utils.js";
6
+ const D = (r) => {
7
+ if (r.includes("/")) {
8
+ const [a, l] = r.split("/");
9
+ return { year: parseInt(l, 10), month: parseInt(a, 10) - 1 };
10
10
  }
11
- const [s, l] = a.split("-");
12
- return { year: parseInt(s, 10), month: parseInt(l, 10) - 1 };
13
- }, O = ({
14
- field: a,
15
- validationRules: s,
16
- isDisabled: l,
17
- formHelpers: r
11
+ const [n, s] = r.split("-");
12
+ return { year: parseInt(n, 10), month: parseInt(s, 10) - 1 };
13
+ }, K = ({
14
+ field: r,
15
+ validationRules: n,
16
+ isDisabled: s,
17
+ formHelpers: a
18
18
  }) => {
19
- const i = r.form.control, t = a.fieldType === "month_range" ? a : null;
20
- if (!t) return null;
21
- const y = t.displayFormat || "MM/YYYY", c = t.minMonthsOffset != null ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - t.minMonthsOffset, 1) : t.disablePastMonths ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1) : o(t.minDate), h = t.maxMonthsOffset != null ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() + t.maxMonthsOffset, 1) : o(t.maxDate);
22
- return /* @__PURE__ */ u(
23
- x,
19
+ const l = a.form.control, e = r.fieldType === "month_range" ? r : null;
20
+ if (!e) return null;
21
+ const y = e.displayFormat || "MM/YYYY", { minDate: u, maxDate: c, startMonth: v, endMonth: $ } = I(e);
22
+ return /* @__PURE__ */ i(
23
+ F,
24
24
  {
25
- name: a.id,
26
- control: i,
27
- defaultValue: t.defaultRange ? { start: t.defaultRange.start || null, end: t.defaultRange.end || null } : void 0,
28
- rules: s,
29
- render: ({ field: d, fieldState: M }) => {
30
- const f = !!M.error, n = d.value, p = n?.start ? w(n.start) : null, m = n?.end ? w(n.end) : null, Y = p && m;
31
- return /* @__PURE__ */ u("div", { "data-testid": T(a.id), children: /* @__PURE__ */ u(
32
- F,
25
+ name: r.id,
26
+ control: l,
27
+ defaultValue: e.defaultRange ? { start: e.defaultRange.start || null, end: e.defaultRange.end || null } : void 0,
28
+ rules: n,
29
+ render: ({ field: d, fieldState: p }) => {
30
+ const M = !!p.error, o = d.value, h = o?.start ? D(o.start) : null, S = o?.end ? D(o.end) : null, x = h && S;
31
+ return /* @__PURE__ */ i("div", { "data-testid": w(r.id), children: /* @__PURE__ */ i(
32
+ b,
33
33
  {
34
- label: a.label,
34
+ label: r.label,
35
35
  displayFormat: y,
36
- ...Y && {
36
+ ...x && {
37
37
  value: {
38
- from: p,
39
- to: m
38
+ from: h,
39
+ to: S
40
40
  }
41
41
  },
42
- onChange: (e) => {
43
- if (!e?.from || !e?.to) {
44
- const S = { start: null, end: null };
45
- d.onChange(S), r.setValue(a.id, S);
42
+ onChange: (t) => {
43
+ if (!t?.from || !t?.to) {
44
+ const g = { start: null, end: null };
45
+ d.onChange(g), a.setValue(r.id, g);
46
46
  return;
47
47
  }
48
- const $ = e.from.start ? `${e.from.start.getFullYear()}-${String(e.from.start.getMonth() + 1).padStart(2, "0")}-${String(e.from.start.getDate()).padStart(2, "0")}` : `${e.from.year}-${String(e.from.month + 1).padStart(2, "0")}-01`, D = e.to.end ? e.to.end.getDate() : new Date(e.to.year, e.to.month + 1, 0).getDate(), v = e.to.end ? `${e.to.end.getFullYear()}-${String(e.to.end.getMonth() + 1).padStart(2, "0")}-${String(D).padStart(2, "0")}` : `${e.to.year}-${String(e.to.month + 1).padStart(2, "0")}-${String(D).padStart(2, "0")}`, g = {
49
- start: $,
50
- end: v
48
+ const Y = t.from.start ? `${t.from.start.getFullYear()}-${String(t.from.start.getMonth() + 1).padStart(2, "0")}-${String(t.from.start.getDate()).padStart(2, "0")}` : `${t.from.year}-${String(t.from.month + 1).padStart(2, "0")}-01`, m = t.to.end ? t.to.end.getDate() : new Date(t.to.year, t.to.month + 1, 0).getDate(), T = t.to.end ? `${t.to.end.getFullYear()}-${String(t.to.end.getMonth() + 1).padStart(2, "0")}-${String(m).padStart(2, "0")}` : `${t.to.year}-${String(t.to.month + 1).padStart(2, "0")}-${String(m).padStart(2, "0")}`, f = {
49
+ start: Y,
50
+ end: T
51
51
  };
52
- d.onChange(g), r.setValue(a.id, g);
52
+ d.onChange(f), a.setValue(r.id, f);
53
53
  },
54
- placeholder: a.placeholder,
55
- minDate: c,
56
- maxDate: h,
57
- startMonth: c || o(t.startMonth),
58
- endMonth: h || o(t.endMonth),
59
- required: a.isRequired,
60
- disabled: l,
61
- error: f,
62
- helperText: f ? M.error?.message : a.helpText,
54
+ placeholder: r.placeholder,
55
+ minDate: u,
56
+ maxDate: c,
57
+ startMonth: v ?? u,
58
+ endMonth: $ ?? c,
59
+ required: r.isRequired,
60
+ disabled: s,
61
+ error: M,
62
+ helperText: M ? p.error?.message : r.helpText,
63
63
  showFooter: !0,
64
- calendarKind: t.calendarKind,
65
- fiscalMode: t.fiscalMode,
66
- fiscalYearStartMonth: t.fiscalYearStartMonth,
67
- fiscalMonthPattern: t.fiscalMonthPattern,
68
- showPresets: t.showPresets,
69
- autoNavigateToAvailable: t.autoNavigateToAvailable
64
+ calendarKind: e.calendarKind,
65
+ fiscalMode: e.fiscalMode,
66
+ fiscalYearStartMonth: e.fiscalYearStartMonth,
67
+ fiscalMonthPattern: e.fiscalMonthPattern,
68
+ showPresets: e.showPresets,
69
+ autoNavigateToAvailable: e.autoNavigateToAvailable
70
70
  }
71
71
  ) });
72
72
  }
@@ -74,5 +74,5 @@ const w = (a) => {
74
74
  );
75
75
  };
76
76
  export {
77
- O as MonthRangeField
77
+ K as MonthRangeField
78
78
  };
@@ -1,47 +1,49 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Controller as d } from "react-hook-form";
3
- import { MultiMonthPicker as p } from "../../components/forms/date-picker/multi-month-picker.js";
4
- import { getFieldTestId as M } from "../utils/fieldTestIds.js";
5
- import { toLocalDate as t } from "../utils/calendar-boundary.js";
6
- const D = ({
2
+ import { Controller as v } from "react-hook-form";
3
+ import { MultiMonthPicker as g } from "../../components/forms/date-picker/multi-month-picker.js";
4
+ import { getFieldTestId as x } from "../utils/fieldTestIds.js";
5
+ import { resolveMonthRangeMinMax as T } from "../utils/date.utils.js";
6
+ const q = ({
7
7
  field: r,
8
- validationRules: m,
8
+ validationRules: i,
9
9
  isDisabled: u,
10
- formHelpers: h
10
+ formHelpers: m
11
11
  }) => {
12
- const s = h.form.control, e = r.fieldType === "multi_month_picker" ? r : null;
13
- return e ? /* @__PURE__ */ o(
14
- d,
12
+ const s = m.form.control, e = r.fieldType === "multi_month_picker" ? r : null;
13
+ if (!e) return null;
14
+ const { minDate: h, maxDate: c, startMonth: d, endMonth: p } = T(e);
15
+ return /* @__PURE__ */ o(
16
+ v,
15
17
  {
16
18
  name: r.id,
17
19
  control: s,
18
- rules: m,
19
- render: ({ field: a, fieldState: n }) => {
20
- const l = !!n.error, i = a.value;
21
- return /* @__PURE__ */ o("div", { "data-testid": M(r.id), children: /* @__PURE__ */ o(
22
- p,
20
+ rules: i,
21
+ render: ({ field: t, fieldState: n }) => {
22
+ const a = !!n.error, l = t.value;
23
+ return /* @__PURE__ */ o("div", { "data-testid": x(r.id), children: /* @__PURE__ */ o(
24
+ g,
23
25
  {
24
26
  label: r.label,
25
- value: Array.isArray(i) ? i : void 0,
26
- onChange: (c) => {
27
- a.onChange(c ?? []);
27
+ value: Array.isArray(l) ? l : void 0,
28
+ onChange: (M) => {
29
+ t.onChange(M ?? []);
28
30
  },
29
31
  placeholder: r.placeholder,
30
32
  required: r.isRequired,
31
33
  disabled: u,
32
- error: l,
33
- helperText: l ? n.error?.message : r.helpText,
34
- minDate: t(e.minDate),
35
- maxDate: t(e.maxDate),
36
- startMonth: t(e.startMonth),
37
- endMonth: t(e.endMonth),
34
+ error: a,
35
+ helperText: a ? n.error?.message : r.helpText,
36
+ minDate: h,
37
+ maxDate: c,
38
+ startMonth: d,
39
+ endMonth: p,
38
40
  autoNavigateToAvailable: e.autoNavigateToAvailable
39
41
  }
40
42
  ) });
41
43
  }
42
44
  }
43
- ) : null;
45
+ );
44
46
  };
45
47
  export {
46
- D as MultiMonthPickerField
48
+ q as MultiMonthPickerField
47
49
  };
@@ -1,55 +1,57 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { Controller as h } from "react-hook-form";
3
- import { MultiWeekPicker as p } from "../../components/forms/date-picker/multi-week-picker.js";
4
- import { fiscalCalendarPassThrough as f } from "../../components/forms/date-picker/fiscal-pass-through.js";
5
- import { getFieldTestId as g } from "../utils/fieldTestIds.js";
6
- import { toLocalDate as n } from "../utils/calendar-boundary.js";
7
- const x = ({
8
- field: e,
9
- validationRules: s,
10
- isDisabled: u,
11
- formHelpers: c
2
+ import { Controller as p } from "react-hook-form";
3
+ import { MultiWeekPicker as g } from "../../components/forms/date-picker/multi-week-picker.js";
4
+ import { fiscalCalendarPassThrough as k } from "../../components/forms/date-picker/fiscal-pass-through.js";
5
+ import { getFieldTestId as M } from "../utils/fieldTestIds.js";
6
+ import { resolveWeekRangeMinMax as f } from "../utils/date.utils.js";
7
+ const y = ({
8
+ field: r,
9
+ validationRules: l,
10
+ isDisabled: s,
11
+ formHelpers: u
12
12
  }) => {
13
- const d = c.form.control, r = e.fieldType === "multi_week_picker" ? e : null;
14
- return r ? /* @__PURE__ */ a(
15
- h,
13
+ const c = u.form.control, e = r.fieldType === "multi_week_picker" ? r : null;
14
+ if (!e) return null;
15
+ const { minDate: d, maxDate: m } = f(e);
16
+ return /* @__PURE__ */ a(
17
+ p,
16
18
  {
17
- name: e.id,
18
- control: d,
19
- rules: s,
20
- render: ({ field: t, fieldState: o }) => {
21
- const i = !!o.error, l = t.value;
22
- return /* @__PURE__ */ a("div", { "data-testid": g(e.id), children: /* @__PURE__ */ a(
23
- p,
19
+ name: r.id,
20
+ control: c,
21
+ rules: l,
22
+ render: ({ field: o, fieldState: t }) => {
23
+ const i = !!t.error, n = o.value;
24
+ return /* @__PURE__ */ a("div", { "data-testid": M(r.id), children: /* @__PURE__ */ a(
25
+ g,
24
26
  {
25
- label: e.label,
26
- value: Array.isArray(l) ? l : void 0,
27
- onChange: (m) => {
28
- t.onChange(m ?? []);
27
+ label: r.label,
28
+ value: Array.isArray(n) ? n : void 0,
29
+ onChange: (h) => {
30
+ o.onChange(h ?? []);
29
31
  },
30
- placeholder: e.placeholder,
31
- required: e.isRequired,
32
- disabled: u,
32
+ placeholder: r.placeholder,
33
+ required: r.isRequired,
34
+ disabled: s,
33
35
  error: i,
34
- helperText: i ? o.error?.message : e.helpText,
35
- minDate: n(r.minDate),
36
- maxDate: n(r.maxDate),
37
- ...f({
38
- calendarKind: r.calendarKind,
39
- fiscalMode: r.fiscalMode,
40
- granularity: r.granularity,
41
- fiscalMonthPattern: r.fiscalMonthPattern,
42
- fiscalYearStartMonth: r.fiscalYearStartMonth,
43
- weekStartsOn: r.weekStartsOn,
44
- showPeriodBoundaries: r.showPeriodBoundaries,
45
- autoNavigateToAvailable: r.autoNavigateToAvailable
36
+ helperText: i ? t.error?.message : r.helpText,
37
+ minDate: d,
38
+ maxDate: m,
39
+ ...k({
40
+ calendarKind: e.calendarKind,
41
+ fiscalMode: e.fiscalMode,
42
+ granularity: e.granularity,
43
+ fiscalMonthPattern: e.fiscalMonthPattern,
44
+ fiscalYearStartMonth: e.fiscalYearStartMonth,
45
+ weekStartsOn: e.weekStartsOn,
46
+ showPeriodBoundaries: e.showPeriodBoundaries,
47
+ autoNavigateToAvailable: e.autoNavigateToAvailable
46
48
  })
47
49
  }
48
50
  ) });
49
51
  }
50
52
  }
51
- ) : null;
53
+ );
52
54
  };
53
55
  export {
54
- x as MultiWeekPickerField
56
+ y as MultiWeekPickerField
55
57
  };
@@ -1,52 +1,52 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Controller as p } from "react-hook-form";
3
- import { MultiYearPicker as M } from "../../components/forms/date-picker/multi-year-picker.js";
4
- import { getFieldTestId as w } from "../utils/fieldTestIds.js";
5
- import { toLocalDate as o } from "../utils/calendar-boundary.js";
6
- const g = ({
7
- field: t,
8
- validationRules: h,
9
- isDisabled: u,
10
- formHelpers: n
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Controller as v } from "react-hook-form";
3
+ import { MultiYearPicker as P } from "../../components/forms/date-picker/multi-year-picker.js";
4
+ import { getFieldTestId as Y } from "../utils/fieldTestIds.js";
5
+ import { resolveYearRangeMinMax as g } from "../utils/date.utils.js";
6
+ const T = ({
7
+ field: e,
8
+ validationRules: u,
9
+ isDisabled: c,
10
+ formHelpers: a
11
11
  }) => {
12
- const e = t.fieldType === "multi_year_picker" ? t : null;
13
- if (!e) return null;
14
- const c = n.form.control, d = e.defaultValue?.map((r) => ({ year: r }));
15
- return /* @__PURE__ */ a(
16
- p,
12
+ const r = e.fieldType === "multi_year_picker" ? e : null;
13
+ if (!r) return null;
14
+ const { minDate: h, maxDate: d, startMonth: m, endMonth: p } = g(r), M = a.form.control, w = r.defaultValue?.map((t) => ({ year: t }));
15
+ return /* @__PURE__ */ o(
16
+ v,
17
17
  {
18
- name: t.id,
19
- control: c,
20
- defaultValue: d,
21
- rules: h,
22
- render: ({ field: r, fieldState: l }) => {
23
- const s = !!l.error, m = r.value;
24
- return /* @__PURE__ */ a("div", { "data-testid": w(t.id), children: /* @__PURE__ */ a(
25
- M,
18
+ name: e.id,
19
+ control: M,
20
+ defaultValue: w,
21
+ rules: u,
22
+ render: ({ field: t, fieldState: n }) => {
23
+ const l = !!n.error, s = t.value, f = Array.isArray(s) ? s : void 0;
24
+ return /* @__PURE__ */ o("div", { "data-testid": Y(e.id), children: /* @__PURE__ */ o(
25
+ P,
26
26
  {
27
- label: t.label,
28
- value: m ?? void 0,
27
+ label: e.label,
28
+ value: f,
29
29
  onChange: (i) => {
30
- r.onChange(i ?? null), n.setValue(t.id, i ?? null);
30
+ t.onChange(i ?? null), a.setValue(e.id, i ?? null);
31
31
  },
32
- placeholder: t.placeholder,
33
- minDate: o(e.minDate),
34
- maxDate: o(e.maxDate),
35
- startMonth: o(e.startMonth),
36
- endMonth: o(e.endMonth),
37
- required: t.isRequired,
38
- disabled: u,
39
- error: s,
40
- helperText: s ? l.error?.message : t.helpText,
41
- showFooter: e.showFooter,
42
- showIntervalCaption: e.showIntervalCaption,
43
- calendarKind: e.calendarKind,
44
- fiscalMode: e.fiscalMode,
45
- fiscalYearStartMonth: e.fiscalYearStartMonth,
46
- fiscalMonthPattern: e.fiscalMonthPattern,
47
- weekStartsOn: e.weekStartsOn,
48
- showPresets: e.showPresets,
49
- ...e.componentProps
32
+ placeholder: e.placeholder,
33
+ minDate: h,
34
+ maxDate: d,
35
+ startMonth: m,
36
+ endMonth: p,
37
+ required: e.isRequired,
38
+ disabled: c,
39
+ error: l,
40
+ helperText: l ? n.error?.message : e.helpText,
41
+ showFooter: r.showFooter,
42
+ showIntervalCaption: r.showIntervalCaption,
43
+ calendarKind: r.calendarKind,
44
+ fiscalMode: r.fiscalMode,
45
+ fiscalYearStartMonth: r.fiscalYearStartMonth,
46
+ fiscalMonthPattern: r.fiscalMonthPattern,
47
+ weekStartsOn: r.weekStartsOn,
48
+ showPresets: r.showPresets,
49
+ ...r.componentProps
50
50
  }
51
51
  ) });
52
52
  }
@@ -54,5 +54,5 @@ const g = ({
54
54
  );
55
55
  };
56
56
  export {
57
- g as MultiYearPickerField
57
+ T as MultiYearPickerField
58
58
  };
@@ -1,47 +1,46 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { useState as A } from "react";
3
- import { Controller as M } from "react-hook-form";
4
- import { Select as f } from "../../components/forms/select/select.js";
3
+ import { Controller as f } from "react-hook-form";
4
+ import { Select as M } from "../../components/forms/select/select.js";
5
5
  import { useSelectOptions as x } from "../hooks/useSelectOptions.js";
6
- import { getFieldTestId as E } from "../utils/fieldTestIds.js";
7
- import { isEmptyValue as R } from "../../form-engine/is-empty-value.js";
8
- const $ = ({
6
+ import { getFieldTestId as T } from "../utils/fieldTestIds.js";
7
+ const L = ({
9
8
  field: e,
10
9
  validationRules: p,
11
- isDisabled: m,
12
- formHelpers: s,
13
- supportedValues: u
10
+ isDisabled: u,
11
+ formHelpers: n,
12
+ supportedValues: d
14
13
  }) => {
15
- const t = e.fieldType === "select" ? e : null, [d, n] = A(!1), S = s.form.control, h = u?.[e.id], { options: g, isLoading: b, error: y, refetch: O } = x({
14
+ const t = e.fieldType === "select" ? e : null, [m, i] = A(!1), S = n.form.control, h = d?.[e.id], { options: g, isLoading: b, error: O, refetch: C } = x({
16
15
  apiConfig: t?.apiConfig,
17
- formHelpers: s,
16
+ formHelpers: n,
18
17
  initialOptions: t?.options,
19
18
  id: e.id,
20
- isEnabled: d,
19
+ isEnabled: m,
21
20
  getSelectOptionsName: t?.getSelectOptionsName,
22
21
  fieldSupportedValues: h,
23
22
  cascadingDependency: e.cascadingDependency
24
23
  });
25
24
  return t ? /* @__PURE__ */ c(
26
- M,
25
+ f,
27
26
  {
28
27
  name: e.id,
29
28
  control: S,
30
29
  rules: p,
31
30
  render: ({ field: o, fieldState: l }) => {
32
- const a = !!l.error, i = o.value, C = t?.isMultiSelect ? e.id : `${e.id}-${R(i) ? "empty" : "has-value"}`;
31
+ const s = !!l.error, a = o.value, y = t?.isMultiSelect ? a ?? [] : a?.[0] ?? null;
33
32
  return /* @__PURE__ */ c(
34
- f,
33
+ M,
35
34
  {
36
35
  id: e.id,
37
36
  label: e.label,
38
37
  placeholder: e?.placeholder,
39
38
  required: e.isRequired,
40
39
  isReadOnly: e.isFieldReadonly,
41
- disabled: m,
40
+ disabled: u,
42
41
  options: g,
43
42
  maxSelectableOptions: t?.maxSelectLimit,
44
- value: t?.isMultiSelect ? i ?? [] : i?.[0],
43
+ value: y,
45
44
  onChange: (r) => {
46
45
  t?.isMultiSelect ? o.onChange(
47
46
  Array.isArray(r) ? r : []
@@ -54,22 +53,21 @@ const $ = ({
54
53
  multiple: t?.isMultiSelect,
55
54
  isSelectAllEnabled: !t?.disableSelectAll,
56
55
  labelOrientation: t?.labelOrientation || "top",
57
- error: a,
58
- helperText: a ? l.error?.message : e.helpText,
56
+ error: s,
57
+ helperText: s ? l.error?.message : e.helpText,
59
58
  ignoreAccents: !0,
60
59
  isLoading: b,
61
- fetchError: y,
62
- onRefetch: O,
63
- onMenuOpen: () => n(!0),
64
- onMenuClose: () => n(!1),
65
- "data-testid": E(e.id)
66
- },
67
- C
60
+ fetchError: O,
61
+ onRefetch: C,
62
+ onMenuOpen: () => i(!0),
63
+ onMenuClose: () => i(!1),
64
+ "data-testid": T(e.id)
65
+ }
68
66
  );
69
67
  }
70
68
  }
71
69
  ) : null;
72
70
  };
73
71
  export {
74
- $ as SelectField
72
+ L as SelectField
75
73
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { Controller as b } from "react-hook-form";
3
3
  import { WeekRangePicker as x } from "../../components/forms/date-picker/week-range-picker.js";
4
- import { toLocalDate as M } from "../utils/calendar-boundary.js";
4
+ import { toLocalDate as f } from "../utils/calendar-boundary.js";
5
5
  import { resolveWeekSelection as Y } from "../../lib/fiscal-calendar/week-selection.js";
6
6
  import { resolveWeekRangeMinMax as $ } from "../utils/date.utils.js";
7
- const f = (e, a) => Y(e, {
7
+ const S = (e, a) => Y(e, {
8
8
  calendarKind: a.calendarKind,
9
9
  fiscalMode: a.fiscalMode ?? "basic",
10
10
  granularity: a.granularity,
@@ -14,44 +14,44 @@ const f = (e, a) => Y(e, {
14
14
  }), C = ({
15
15
  field: e,
16
16
  validationRules: a,
17
- isDisabled: S,
17
+ isDisabled: p,
18
18
  formHelpers: d
19
19
  }) => {
20
20
  const t = e.fieldType === "week_range" ? e : null;
21
21
  if (!t) return null;
22
- const { minDate: p, maxDate: u, startMonth: D, endMonth: k } = $(t), v = d.form.control;
22
+ const { minDate: u, maxDate: m, startMonth: D, endMonth: k } = $(t), v = d.form.control;
23
23
  return /* @__PURE__ */ c(
24
24
  b,
25
25
  {
26
26
  name: e.id,
27
27
  control: v,
28
28
  rules: a,
29
- render: ({ field: w, fieldState: m }) => {
30
- const h = !!m.error, r = w.value, s = r?.start ? M(r.start) ?? null : null, i = r?.end ? M(r.end) ?? null : null, F = !!(s && i);
29
+ render: ({ field: w, fieldState: h }) => {
30
+ const g = !!h.error, r = w.value, s = r?.start ? f(r.start) ?? null : null, i = r?.end ? f(r.end) ?? null : null, F = !!(s && i);
31
31
  return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
32
32
  x,
33
33
  {
34
34
  label: e.label,
35
35
  value: F && s && i ? {
36
- from: f(s, t),
37
- to: f(i, t)
36
+ from: S(s, t),
37
+ to: S(i, t)
38
38
  } : void 0,
39
39
  onChange: (o) => {
40
- const g = o?.from ? { from: o.from, to: o.to ?? o.from } : void 0, n = g?.from?.startDate, l = g?.to?.endDate, P = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, T = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
40
+ const M = o?.from ? { from: o.from, to: o.to ?? o.from } : void 0, n = M?.from?.startDate, l = M?.to?.endDate, P = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, T = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
41
41
  d.setValue(e.id, { start: P, end: T });
42
42
  },
43
43
  placeholder: t.placeholder,
44
- startMonth: D,
45
- endMonth: u ?? k,
44
+ startMonth: u ?? D,
45
+ endMonth: m ?? k,
46
46
  required: e.isRequired,
47
- disabled: S,
48
- error: h,
49
- helperText: h ? m.error?.message : e.helpText,
47
+ disabled: p,
48
+ error: g,
49
+ helperText: g ? h.error?.message : e.helpText,
50
50
  calendarKind: t.calendarKind,
51
51
  fiscalMode: t.fiscalMode,
52
52
  weekStartsOn: t.weekStartsOn,
53
- minDate: p,
54
- maxDate: u,
53
+ minDate: u,
54
+ maxDate: m,
55
55
  granularity: t.granularity,
56
56
  fiscalMonthPattern: t.fiscalMonthPattern,
57
57
  fiscalYearStartMonth: t.fiscalYearStartMonth,