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,63 +1,63 @@
1
1
  import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { Cross as re, CalendarMonth as te } from "impact-nova-icons";
4
- import { cn as ne } from "../../../lib/utils.js";
5
- import { Input as oe } from "../input/input.js";
6
- import { Calendar as ae } from "../../data-display/calendar/calendar.js";
7
- import { Tooltip as x, TooltipTrigger as D, TooltipContent as Y } from "../../feedback/tooltip/tooltip.js";
8
- import { useImpactNovaI18n as ie } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { buildDateBoundsMatcher as ce } from "../../../lib/date-bounds-matcher.js";
10
- import { fiscalCalendarPassThrough as se } from "./fiscal-pass-through.js";
11
- import { DatePickerShell as le } from "./date-picker-shell.js";
12
- import { usePickerDismissActionsRef as fe, usePickerFooterDismissNudge as pe, handleReadonlyPickerKeyDown as de, handlePickerSurfacePointerDown as me } from "./date-input-behavior.js";
3
+ import { Cross as te, CalendarMonth as ne } from "impact-nova-icons";
4
+ import { cn as oe } from "../../../lib/utils.js";
5
+ import { Input as ae } from "../input/input.js";
6
+ import { Calendar as ie } from "../../data-display/calendar/calendar.js";
7
+ import { Tooltip as x, TooltipTrigger as Y, TooltipContent as D } from "../../feedback/tooltip/tooltip.js";
8
+ import { useImpactNovaI18n as ce } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { buildDateBoundsMatcher as se } from "../../../lib/date-bounds-matcher.js";
10
+ import { fiscalCalendarPassThrough as le } from "./fiscal-pass-through.js";
11
+ import { DatePickerShell as fe } from "./date-picker-shell.js";
12
+ import { usePickerDismissActionsRef as pe, usePickerFooterDismissNudge as de, handleReadonlyPickerKeyDown as me, handlePickerSurfacePointerDown as ue } from "./date-input-behavior.js";
13
13
  import { formatYearInput as N } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
- import { viewMonthFromYear as ue } from "../../data-display/calendar/calendar-year-utils.js";
15
- const he = t.forwardRef(
14
+ import { viewMonthFromYear as he, isYearRangeSelection as ge } from "../../data-display/calendar/calendar-year-utils.js";
15
+ const ye = t.forwardRef(
16
16
  ({
17
- value: n,
17
+ value: y,
18
18
  onChange: d,
19
19
  placeholder: S,
20
- minDate: v,
21
- maxDate: A,
22
- startMonth: I,
23
- endMonth: M,
20
+ minDate: A,
21
+ maxDate: I,
22
+ startMonth: M,
23
+ endMonth: O,
24
24
  showFooter: l = !0,
25
25
  disabled: o,
26
- className: O,
27
- calendarKind: T,
28
- fiscalMode: w,
29
- granularity: K,
30
- fiscalMonthPattern: j,
31
- fiscalYearStartMonth: F,
32
- fiscalConfig: y,
33
- weekStartsOn: L,
34
- showPresets: $,
35
- showPeriodBoundaries: z,
36
- autoNavigateToAvailable: E,
37
- showIntervalCaption: H = !1,
38
- ...V
39
- }, B) => {
40
- const { t: a } = ie(), q = S ?? a("datePicker.selectYearRange"), k = y?.fyLabel ?? "fy-long", m = t.useRef(null), P = t.useRef(null);
41
- t.useImperativeHandle(B, () => m.current);
42
- const [i, c] = t.useState(!1), u = t.useRef(!1), R = fe(), { footerFlashKey: G, footerFlashTarget: J, popoverHandlers: Q } = pe(l, i, R, P), [C, f] = t.useState(n), [U, W] = t.useState(ue(n?.from));
26
+ className: T,
27
+ calendarKind: w,
28
+ fiscalMode: K,
29
+ granularity: j,
30
+ fiscalMonthPattern: F,
31
+ fiscalYearStartMonth: L,
32
+ fiscalConfig: k,
33
+ weekStartsOn: $,
34
+ showPresets: z,
35
+ showPeriodBoundaries: E,
36
+ autoNavigateToAvailable: H,
37
+ showIntervalCaption: V = !1,
38
+ ...B
39
+ }, q) => {
40
+ const { t: a } = ce(), G = S ?? a("datePicker.selectYearRange"), P = k?.fyLabel ?? "fy-long", m = t.useRef(null), R = t.useRef(null);
41
+ t.useImperativeHandle(q, () => m.current);
42
+ const [i, c] = t.useState(!1), u = t.useRef(!1), v = pe(), { footerFlashKey: J, footerFlashTarget: Q, popoverHandlers: U } = de(l, i, v, R), n = ge(y) ? y : void 0, [C, f] = t.useState(n), [W, X] = t.useState(he(n?.from));
43
43
  t.useEffect(() => {
44
44
  i || f(n);
45
45
  }, [i, n]);
46
- const p = t.useCallback(() => c(!1), []), X = se({
47
- calendarKind: T,
48
- fiscalMode: w,
49
- granularity: K,
50
- fiscalMonthPattern: j,
51
- fiscalYearStartMonth: F,
52
- fiscalConfig: y,
53
- weekStartsOn: L,
54
- showPresets: $,
55
- showPeriodBoundaries: z,
56
- autoNavigateToAvailable: E
57
- }), Z = (e) => {
46
+ const p = t.useCallback(() => c(!1), []), Z = le({
47
+ calendarKind: w,
48
+ fiscalMode: K,
49
+ granularity: j,
50
+ fiscalMonthPattern: F,
51
+ fiscalYearStartMonth: L,
52
+ fiscalConfig: k,
53
+ weekStartsOn: $,
54
+ showPresets: z,
55
+ showPeriodBoundaries: E,
56
+ autoNavigateToAvailable: H
57
+ }), _ = (e) => {
58
58
  const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
59
59
  f(s), l || (d?.(s), s?.to && p());
60
- }, _ = () => {
60
+ }, ee = () => {
61
61
  d?.(C), p();
62
62
  }, h = () => {
63
63
  f(n), p();
@@ -65,11 +65,11 @@ const he = t.forwardRef(
65
65
  f(void 0), d?.(void 0), l || p();
66
66
  };
67
67
  t.useLayoutEffect(() => {
68
- R.current = { onDismiss: h, resolveFlash: () => "cancel" };
68
+ v.current = { onDismiss: h, resolveFlash: () => "cancel" };
69
69
  });
70
- const ee = n?.from ? `${N(n.from, k)}${n.to ? ` – ${N(n.to, k)}` : ""}` : "";
70
+ const re = n?.from ? `${N(n.from, P)}${n.to ? ` – ${N(n.to, P)}` : ""}` : "";
71
71
  return /* @__PURE__ */ r(
72
- le,
72
+ fe,
73
73
  {
74
74
  open: i,
75
75
  disabled: o,
@@ -80,26 +80,26 @@ const he = t.forwardRef(
80
80
  onOpenAutoFocus: (e) => {
81
81
  u.current || e.preventDefault(), u.current = !1;
82
82
  },
83
- popoverHandlers: Q,
83
+ popoverHandlers: U,
84
84
  trigger: /* @__PURE__ */ r(
85
85
  "div",
86
86
  {
87
- ref: P,
87
+ ref: R,
88
88
  "data-component": "year-range-picker",
89
89
  "data-state": i ? "open" : "closed",
90
- onPointerDown: (e) => me({
90
+ onPointerDown: (e) => ue({
91
91
  disabled: o,
92
92
  event: e,
93
93
  onOpen: () => c(!0),
94
94
  focusField: () => m.current?.focus()
95
95
  }),
96
96
  children: /* @__PURE__ */ r(
97
- oe,
97
+ ae,
98
98
  {
99
99
  ref: m,
100
- value: ee,
100
+ value: re,
101
101
  readOnly: !0,
102
- onKeyDown: (e) => de(e, {
102
+ onKeyDown: (e) => me(e, {
103
103
  disabled: o,
104
104
  open: i,
105
105
  onOpen: () => c(!0),
@@ -109,13 +109,13 @@ const he = t.forwardRef(
109
109
  }
110
110
  }),
111
111
  onClick: () => !o && c(!0),
112
- placeholder: q,
112
+ placeholder: G,
113
113
  disabled: o,
114
114
  "data-form-control": "input",
115
- className: ne("cursor-pointer", O),
115
+ className: oe("cursor-pointer", T),
116
116
  suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
117
117
  n?.from && !o ? /* @__PURE__ */ g(x, { children: [
118
- /* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ r(
118
+ /* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ r(
119
119
  "button",
120
120
  {
121
121
  type: "button",
@@ -125,13 +125,13 @@ const he = t.forwardRef(
125
125
  e.stopPropagation(), b();
126
126
  },
127
127
  className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
128
- children: /* @__PURE__ */ r(re, { className: "size-3 hover:text-content" })
128
+ children: /* @__PURE__ */ r(te, { className: "size-3 hover:text-content" })
129
129
  }
130
130
  ) }),
131
- /* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("calendar.clear") })
131
+ /* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("calendar.clear") })
132
132
  ] }) : null,
133
133
  /* @__PURE__ */ g(x, { children: [
134
- /* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ r(
134
+ /* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ r(
135
135
  "button",
136
136
  {
137
137
  type: "button",
@@ -142,44 +142,44 @@ const he = t.forwardRef(
142
142
  e.stopPropagation(), o || c((s) => !s);
143
143
  },
144
144
  className: "inline-flex items-center justify-center border-none bg-transparent p-0",
145
- children: /* @__PURE__ */ r(te, { className: "h-4 w-4 text-secondary-foreground" })
145
+ children: /* @__PURE__ */ r(ne, { className: "h-4 w-4 text-secondary-foreground" })
146
146
  }
147
147
  ) }),
148
- /* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("datePicker.selectYearRange") })
148
+ /* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("datePicker.selectYearRange") })
149
149
  ] })
150
150
  ] }),
151
- ...V
151
+ ...B
152
152
  }
153
153
  )
154
154
  }
155
155
  ),
156
156
  children: /* @__PURE__ */ r(
157
- ae,
157
+ ie,
158
158
  {
159
159
  pickerType: "year",
160
160
  yearMode: "range",
161
161
  selectedYear: C,
162
- footerFlashKey: G,
163
- footerFlashTarget: J,
164
- onYearSelect: Z,
165
- month: U,
166
- onMonthChange: W,
167
- disabled: ce(v, A),
168
- startMonth: I,
169
- endMonth: M,
162
+ footerFlashKey: J,
163
+ footerFlashTarget: Q,
164
+ onYearSelect: _,
165
+ month: W,
166
+ onMonthChange: X,
167
+ disabled: se(A, I),
168
+ startMonth: M,
169
+ endMonth: O,
170
170
  showFooter: l,
171
- onApply: _,
171
+ onApply: ee,
172
172
  onCancel: h,
173
173
  onClear: b,
174
- showIntervalCaption: H,
175
- ...X
174
+ showIntervalCaption: V,
175
+ ...Z
176
176
  }
177
177
  )
178
178
  }
179
179
  );
180
180
  }
181
181
  );
182
- he.displayName = "YearRangePicker";
182
+ ye.displayName = "YearRangePicker";
183
183
  export {
184
- he as YearRangePicker
184
+ ye as YearRangePicker
185
185
  };
@@ -1,39 +1,39 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Controller as w } from "react-hook-form";
4
- import { Info as T } from "impact-nova-icons";
3
+ import { Controller as V } from "react-hook-form";
4
+ import { Info as w } from "impact-nova-icons";
5
5
  import { Chip as f } from "../../components/primitives/chips/chips.js";
6
- import { Checkbox as z } from "../../components/forms/checkbox/checkbox.js";
6
+ import { Checkbox as T } from "../../components/forms/checkbox/checkbox.js";
7
7
  import { cn as i } from "../../lib/utils.js";
8
- import { getFieldTestId as V } from "../utils/fieldTestIds.js";
9
- const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertiary", G = ({
10
- field: s,
8
+ import { getFieldTestId as z } from "../utils/fieldTestIds.js";
9
+ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertiary", R = ({
10
+ field: l,
11
11
  validationRules: h,
12
- isDisabled: n,
13
- formHelpers: v
12
+ isDisabled: a,
13
+ formHelpers: n
14
14
  }) => {
15
- if (s.fieldType !== "chips") return null;
16
- const u = s, d = u.options ?? [], g = u.chipsType ?? "single", b = u.allowDeselect === !0, C = v.form.control, N = s.id;
15
+ if (l.fieldType !== "chips") return null;
16
+ const d = l, p = d.options ?? [], g = d.chipsType ?? "single", b = d.allowDeselect === !0, N = n.form.control, c = l.id;
17
17
  return /* @__PURE__ */ t(
18
- w,
18
+ V,
19
19
  {
20
- name: N,
21
- control: C,
22
- disabled: n,
20
+ name: c,
21
+ control: N,
22
+ disabled: a,
23
23
  rules: h,
24
- render: ({ field: a, fieldState: p }) => {
25
- const c = a.value, k = typeof c == "string" ? c : "", m = Array.isArray(c) ? c : [], l = !!p.error, x = l ? p.error?.message : s.helpText;
26
- return /* @__PURE__ */ o("div", { "data-testid": V(s.id), children: [
27
- s.label ? /* @__PURE__ */ o(
24
+ render: ({ field: C, fieldState: x }) => {
25
+ const o = C.value, k = typeof o == "string" ? o : "", m = Array.isArray(o) ? o : [], r = !!x.error, v = r ? x.error?.message : l.helpText;
26
+ return /* @__PURE__ */ u("div", { "data-testid": z(l.id), children: [
27
+ l.label ? /* @__PURE__ */ u(
28
28
  "div",
29
29
  {
30
30
  className: i(
31
31
  j,
32
- l && "text-destructive"
32
+ r && "text-destructive"
33
33
  ),
34
34
  children: [
35
- s.label,
36
- s.isRequired ? /* @__PURE__ */ t("span", { className: "ml-1 text-destructive", children: "*" }) : null
35
+ l.label,
36
+ l.isRequired ? /* @__PURE__ */ t("span", { className: "ml-1 text-destructive", children: "*" }) : null
37
37
  ]
38
38
  }
39
39
  ) : null,
@@ -41,11 +41,11 @@ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertia
41
41
  "div",
42
42
  {
43
43
  role: "radiogroup",
44
- "aria-label": s.label,
45
- "aria-invalid": l,
44
+ "aria-label": l.label,
45
+ "aria-invalid": r,
46
46
  className: "mb-2 flex w-full flex-wrap items-center gap-3",
47
- children: d.map((e) => {
48
- const r = k === e.value;
47
+ children: p.map((e) => {
48
+ const s = k === e.value;
49
49
  return /* @__PURE__ */ t(
50
50
  f,
51
51
  {
@@ -53,19 +53,19 @@ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertia
53
53
  shape: "rounded",
54
54
  size: "lg",
55
55
  selectionMode: "single",
56
- selected: r,
57
- disabled: n,
56
+ selected: s,
57
+ disabled: a,
58
58
  className: i(
59
59
  "cursor-pointer gap-2 focus-visible:ring-0 focus-visible:ring-offset-0",
60
- l && !r && "!border-destructive !text-destructive"
60
+ r && !s && "!border-destructive !text-destructive"
61
61
  ),
62
62
  onClick: () => {
63
- if (!n) {
64
- if (r && b) {
65
- a.onChange("");
63
+ if (!a) {
64
+ if (s && b) {
65
+ n.setValue(c, "");
66
66
  return;
67
67
  }
68
- r || a.onChange(e.value);
68
+ s || n.setValue(c, e.value);
69
69
  }
70
70
  },
71
71
  children: /* @__PURE__ */ t("span", { className: "text-sm", children: e.label })
@@ -74,52 +74,53 @@ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertia
74
74
  );
75
75
  })
76
76
  }
77
- ) : /* @__PURE__ */ t("div", { className: "mb-2 flex w-full flex-wrap gap-3", children: d.map((e) => {
78
- const r = m.includes(e.value);
79
- return /* @__PURE__ */ o(
77
+ ) : /* @__PURE__ */ t("div", { className: "mb-2 flex w-full flex-wrap gap-3", children: p.map((e) => {
78
+ const s = m.includes(e.value);
79
+ return /* @__PURE__ */ u(
80
80
  f,
81
81
  {
82
82
  variant: "outline",
83
83
  shape: "rounded",
84
84
  size: "lg",
85
- selected: r,
85
+ selected: s,
86
86
  className: i(
87
87
  "cursor-pointer gap-2 focus-visible:ring-0 focus-visible:ring-offset-0",
88
- l && !r && "!border-destructive !text-destructive"
88
+ r && !s && "!border-destructive !text-destructive"
89
89
  ),
90
90
  onClick: () => {
91
- n || (r ? a.onChange(
91
+ a || (s ? n.setValue(
92
+ c,
92
93
  m.filter(
93
94
  (y) => y !== e.value
94
95
  )
95
- ) : a.onChange([
96
+ ) : n.setValue(c, [
96
97
  ...m,
97
98
  e.value
98
99
  ]));
99
100
  },
100
101
  children: [
101
- /* @__PURE__ */ t(z, { checked: r, disabled: n }),
102
+ /* @__PURE__ */ t(T, { checked: s, disabled: a }),
102
103
  /* @__PURE__ */ t("span", { className: "text-sm", children: e.label })
103
104
  ]
104
105
  },
105
106
  e.value
106
107
  );
107
108
  }) }),
108
- x ? /* @__PURE__ */ o(
109
+ v ? /* @__PURE__ */ u(
109
110
  "div",
110
111
  {
111
112
  className: i(
112
113
  "mt-1 flex items-center gap-1",
113
- l && "text-destructive"
114
+ r && "text-destructive"
114
115
  ),
115
116
  children: [
116
117
  /* @__PURE__ */ t(
117
- T,
118
+ w,
118
119
  {
119
120
  size: "xs",
120
121
  className: i(
121
122
  "shrink-0",
122
- l ? "text-destructive" : "text-content-icon"
123
+ r ? "text-destructive" : "text-content-icon"
123
124
  )
124
125
  }
125
126
  ),
@@ -128,9 +129,9 @@ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertia
128
129
  {
129
130
  className: i(
130
131
  "text-[12px] font-medium leading-[18px] text-navigation-muted",
131
- l && "text-destructive"
132
+ r && "text-destructive"
132
133
  ),
133
- children: x
134
+ children: v
134
135
  }
135
136
  )
136
137
  ]
@@ -142,5 +143,5 @@ const j = "mb-[6px] block text-xs font-medium leading-[18px] text-content-tertia
142
143
  );
143
144
  };
144
145
  export {
145
- G as ChipsField
146
+ R as ChipsField
146
147
  };
@@ -1,50 +1,50 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Controller as g } from "react-hook-form";
3
+ import { Controller as S } from "react-hook-form";
4
4
  import { DateRangePicker as v } from "../../components/forms/date-picker/date-range-picker.js";
5
- import { toLocalDate as a } from "../utils/calendar-boundary.js";
6
- import { handleMinMaxProp as S } from "../utils/date.utils.js";
7
- const T = ({
5
+ import { toLocalDate as c } from "../utils/calendar-boundary.js";
6
+ import { resolveDateRangeMinMax as P } from "../utils/date.utils.js";
7
+ const Y = ({
8
8
  field: r,
9
- validationRules: h,
9
+ validationRules: d,
10
10
  isDisabled: l,
11
- formHelpers: s
11
+ formHelpers: n
12
12
  }) => {
13
13
  const t = r.fieldType === "date_range" ? r : null;
14
14
  if (!t) return null;
15
- const c = s.form.control, { minDate: m, maxDate: u } = S(t);
16
- return /* @__PURE__ */ n(
17
- g,
15
+ const h = n.form.control, { minDate: m, maxDate: u, startMonth: p, endMonth: g } = P(t);
16
+ return /* @__PURE__ */ a(
17
+ S,
18
18
  {
19
19
  name: r.id,
20
- control: c,
20
+ control: h,
21
21
  disabled: l,
22
- rules: h,
23
- render: ({ field: p, fieldState: i }) => {
24
- const d = !!i.error, e = p.value;
25
- return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
22
+ rules: d,
23
+ render: ({ field: f, fieldState: s }) => {
24
+ const i = !!s.error, o = f.value;
25
+ return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
26
26
  v,
27
27
  {
28
28
  label: r.label,
29
29
  minDate: m,
30
30
  maxDate: u,
31
- startMonth: t.startMonth ? a(t.startMonth) : void 0,
32
- endMonth: t.endMonth ? a(t.endMonth) : void 0,
31
+ startMonth: p,
32
+ endMonth: g,
33
33
  value: {
34
- from: e?.start ? a(e.start) : void 0,
35
- to: e?.end ? a(e.end) : void 0
34
+ from: o?.start ? c(o.start) : void 0,
35
+ to: o?.end ? c(o.end) : void 0
36
36
  },
37
- onChange: (o) => {
38
- const M = o?.from ? `${o.from.getFullYear()}-${String(o.from.getMonth() + 1).padStart(2, "0")}-${String(o.from.getDate()).padStart(2, "0")}` : null, f = o?.to ? `${o.to.getFullYear()}-${String(o.to.getMonth() + 1).padStart(2, "0")}-${String(o.to.getDate()).padStart(2, "0")}` : null;
39
- s.setValue(r.id, { start: M, end: f });
37
+ onChange: (e) => {
38
+ const M = e?.from ? `${e.from.getFullYear()}-${String(e.from.getMonth() + 1).padStart(2, "0")}-${String(e.from.getDate()).padStart(2, "0")}` : null, D = e?.to ? `${e.to.getFullYear()}-${String(e.to.getMonth() + 1).padStart(2, "0")}-${String(e.to.getDate()).padStart(2, "0")}` : null;
39
+ n.setValue(r.id, { start: M, end: D });
40
40
  },
41
41
  startPlaceholder: t.startPlaceholder || "Start Date",
42
42
  endPlaceholder: t.endPlaceholder || "End Date",
43
43
  placeholder: r.placeholder,
44
44
  required: r.isRequired,
45
45
  disabled: l,
46
- error: d,
47
- helperText: d ? i.error?.message : r.helpText,
46
+ error: i,
47
+ helperText: i ? s.error?.message : r.helpText,
48
48
  showFooter: !0,
49
49
  calendarKind: t.calendarKind,
50
50
  fiscalMode: t.fiscalMode,
@@ -59,5 +59,5 @@ const T = ({
59
59
  );
60
60
  };
61
61
  export {
62
- T as DateRangeField
62
+ Y as DateRangeField
63
63
  };