impact-nova 2.5.18 → 2.5.20

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 (30) hide show
  1. package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
  2. package/dist/components/data-display/calendar/calendar-year-utils.js +9 -9
  3. package/dist/components/data-display/calendar/calendar.js +194 -190
  4. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +6 -6
  5. package/dist/components/forms/date-picker/fiscal-pass-through.js +7 -3
  6. package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
  7. package/dist/components/forms/date-picker/multi-week-picker.js +1 -1
  8. package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
  9. package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
  10. package/dist/components/forms/date-picker/week-picker.js +123 -123
  11. package/dist/components/forms/date-picker/week-range-picker.js +188 -188
  12. package/dist/components/forms/date-picker/year-range-picker.js +79 -79
  13. package/dist/form-react/Fields/DateRangeField.js +25 -25
  14. package/dist/form-react/Fields/MonthRangeField.js +57 -57
  15. package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
  16. package/dist/form-react/Fields/MultiWeekPickerField.js +41 -38
  17. package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
  18. package/dist/form-react/Fields/WeekRangePicker.js +18 -16
  19. package/dist/form-react/Fields/YearPickerField.js +27 -27
  20. package/dist/form-react/Fields/YearRangePickerField.js +29 -29
  21. package/dist/form-react/types/fields.types.d.ts +34 -0
  22. package/dist/form-react/utils/date.utils.d.ts +52 -2
  23. package/dist/form-react/utils/date.utils.js +198 -62
  24. package/dist/lib/fiscal-calendar/index.d.ts +2 -2
  25. package/dist/lib/fiscal-calendar/index.js +26 -24
  26. package/dist/lib/fiscal-calendar/week-selection.d.ts +5 -0
  27. package/dist/lib/fiscal-calendar/week-selection.js +56 -49
  28. package/dist/llms/rules/installation.js +1 -1
  29. package/dist/llms/rules/requirements.js +1 -1
  30. package/package.json +1 -1
@@ -1,55 +1,58 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { Controller as h } from "react-hook-form";
2
+ import { Controller as f } from "react-hook-form";
3
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,
4
+ import { fiscalCalendarPassThrough as g } from "../../components/forms/date-picker/fiscal-pass-through.js";
5
+ import { getFieldTestId as k } from "../utils/fieldTestIds.js";
6
+ import { resolveWeekRangeMinMax as M } from "../utils/date.utils.js";
7
+ const b = ({
8
+ field: r,
9
+ validationRules: l,
10
+ isDisabled: s,
11
11
  formHelpers: c
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 u = c.form.control, e = r.fieldType === "multi_week_picker" ? r : null;
14
+ if (!e) return null;
15
+ const { minDate: d, maxDate: m } = M(e);
16
+ return /* @__PURE__ */ a(
17
+ f,
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(
19
+ name: r.id,
20
+ control: u,
21
+ rules: l,
22
+ render: ({ field: o, fieldState: t }) => {
23
+ const i = !!t.error, n = o.value;
24
+ return /* @__PURE__ */ a("div", { "data-testid": k(r.id), children: /* @__PURE__ */ a(
23
25
  p,
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
+ ...g({
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
+ fiscalConfig: e.fiscalConfig,
47
+ showPeriodBoundaries: e.showPeriodBoundaries,
48
+ autoNavigateToAvailable: e.autoNavigateToAvailable
46
49
  })
47
50
  }
48
51
  ) });
49
52
  }
50
53
  }
51
- ) : null;
54
+ );
52
55
  };
53
56
  export {
54
- x as MultiWeekPickerField
57
+ b as MultiWeekPickerField
55
58
  };
@@ -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,17 +1,18 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { Controller as b } from "react-hook-form";
3
- import { WeekRangePicker as x } from "../../components/forms/date-picker/week-range-picker.js";
4
- import { toLocalDate as f } from "../utils/calendar-boundary.js";
5
- import { resolveWeekSelection as Y } from "../../lib/fiscal-calendar/week-selection.js";
6
- import { resolveWeekRangeMinMax as $ } from "../utils/date.utils.js";
7
- const S = (e, a) => Y(e, {
2
+ import { Controller as T } from "react-hook-form";
3
+ import { WeekRangePicker as b } from "../../components/forms/date-picker/week-range-picker.js";
4
+ import { toLocalDate as M } from "../utils/calendar-boundary.js";
5
+ import { resolveWeekSelection as x } from "../../lib/fiscal-calendar/week-selection.js";
6
+ import { resolveWeekRangeMinMax as Y } from "../utils/date.utils.js";
7
+ const S = (e, a) => x(e, {
8
8
  calendarKind: a.calendarKind,
9
9
  fiscalMode: a.fiscalMode ?? "basic",
10
10
  granularity: a.granularity,
11
11
  fiscalMonthPattern: a.fiscalMonthPattern,
12
12
  fiscalYearStartMonth: a.fiscalYearStartMonth ?? 1,
13
- weekStartsOn: a.weekStartsOn ?? 1
14
- }), C = ({
13
+ weekStartsOn: a.weekStartsOn,
14
+ fiscalConfig: a.fiscalConfig
15
+ }), B = ({
15
16
  field: e,
16
17
  validationRules: a,
17
18
  isDisabled: p,
@@ -19,26 +20,26 @@ const S = (e, a) => Y(e, {
19
20
  }) => {
20
21
  const t = e.fieldType === "week_range" ? e : null;
21
22
  if (!t) return null;
22
- const { minDate: u, maxDate: m, startMonth: D, endMonth: k } = $(t), v = d.form.control;
23
+ const { minDate: u, maxDate: m, startMonth: D, endMonth: k } = Y(t), v = d.form.control;
23
24
  return /* @__PURE__ */ c(
24
- b,
25
+ T,
25
26
  {
26
27
  name: e.id,
27
28
  control: v,
28
29
  rules: a,
29
30
  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
+ const g = !!h.error, r = w.value, s = r?.start ? M(r.start) ?? null : null, i = r?.end ? M(r.end) ?? null : null, C = !!(s && i);
31
32
  return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
32
- x,
33
+ b,
33
34
  {
34
35
  label: e.label,
35
- value: F && s && i ? {
36
+ value: C && s && i ? {
36
37
  from: S(s, t),
37
38
  to: S(i, t)
38
39
  } : void 0,
39
40
  onChange: (o) => {
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
- d.setValue(e.id, { start: P, end: T });
41
+ const f = o?.from ? { from: o.from, to: o.to ?? o.from } : void 0, n = f?.from?.startDate, l = f?.to?.endDate, F = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, P = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
42
+ d.setValue(e.id, { start: F, end: P });
42
43
  },
43
44
  placeholder: t.placeholder,
44
45
  startMonth: u ?? D,
@@ -55,6 +56,7 @@ const S = (e, a) => Y(e, {
55
56
  granularity: t.granularity,
56
57
  fiscalMonthPattern: t.fiscalMonthPattern,
57
58
  fiscalYearStartMonth: t.fiscalYearStartMonth,
59
+ fiscalConfig: t.fiscalConfig,
58
60
  showFooter: t.showFooter,
59
61
  showPeriodBoundaries: t.showPeriodBoundaries,
60
62
  autoNavigateToAvailable: t.autoNavigateToAvailable,
@@ -66,5 +68,5 @@ const S = (e, a) => Y(e, {
66
68
  );
67
69
  };
68
70
  export {
69
- C as WeekRangeField
71
+ B as WeekRangeField
70
72
  };
@@ -1,43 +1,43 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Controller as m } from "react-hook-form";
3
- import { YearPicker as p } from "../../components/forms/date-picker/year-picker.js";
4
- import { getFieldTestId as M } from "../utils/fieldTestIds.js";
5
- import { toLocalDate as t } from "../utils/calendar-boundary.js";
6
- const x = ({
2
+ import { Controller as f } from "react-hook-form";
3
+ import { YearPicker as w } from "../../components/forms/date-picker/year-picker.js";
4
+ import { getFieldTestId as v } from "../utils/fieldTestIds.js";
5
+ import { resolveYearRangeMinMax as P } from "../utils/date.utils.js";
6
+ const Y = ({
7
7
  field: r,
8
- validationRules: d,
9
- isDisabled: h,
10
- formHelpers: a
8
+ validationRules: i,
9
+ isDisabled: c,
10
+ formHelpers: t
11
11
  }) => {
12
12
  const e = r.fieldType === "year_picker" ? r : null;
13
13
  if (!e) return null;
14
- const c = a.form.control;
14
+ const { minDate: d, maxDate: u, startMonth: h, endMonth: m } = P(e), p = t.form.control;
15
15
  return /* @__PURE__ */ o(
16
- m,
16
+ f,
17
17
  {
18
18
  name: r.id,
19
- control: c,
19
+ control: p,
20
20
  defaultValue: e.defaultValue != null ? { year: e.defaultValue } : void 0,
21
- rules: d,
22
- render: ({ field: n, fieldState: l }) => {
23
- const s = !!l.error, u = n.value;
24
- return /* @__PURE__ */ o("div", { "data-testid": M(r.id), children: /* @__PURE__ */ o(
25
- p,
21
+ rules: i,
22
+ render: ({ field: a, fieldState: n }) => {
23
+ const l = !!n.error, M = a.value;
24
+ return /* @__PURE__ */ o("div", { "data-testid": v(r.id), children: /* @__PURE__ */ o(
25
+ w,
26
26
  {
27
27
  label: r.label,
28
- value: u ?? void 0,
29
- onChange: (i) => {
30
- n.onChange(i ?? null), a.setValue(r.id, i ?? null);
28
+ value: M ?? void 0,
29
+ onChange: (s) => {
30
+ a.onChange(s ?? null), t.setValue(r.id, s ?? null);
31
31
  },
32
32
  placeholder: r.placeholder,
33
- minDate: t(e.minDate),
34
- maxDate: t(e.maxDate),
35
- startMonth: t(e.startMonth),
36
- endMonth: t(e.endMonth),
33
+ minDate: d,
34
+ maxDate: u,
35
+ startMonth: h,
36
+ endMonth: m,
37
37
  required: r.isRequired,
38
- disabled: h,
39
- error: s,
40
- helperText: s ? l.error?.message : r.helpText,
38
+ disabled: c,
39
+ error: l,
40
+ helperText: l ? n.error?.message : r.helpText,
41
41
  showFooter: e.showFooter,
42
42
  showIntervalCaption: e.showIntervalCaption,
43
43
  calendarKind: e.calendarKind,
@@ -54,5 +54,5 @@ const x = ({
54
54
  );
55
55
  };
56
56
  export {
57
- x as YearPickerField
57
+ Y as YearPickerField
58
58
  };
@@ -1,43 +1,43 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Controller as p } from "react-hook-form";
3
- import { YearRangePicker as g } from "../../components/forms/date-picker/year-range-picker.js";
4
- import { getFieldTestId as f } from "../utils/fieldTestIds.js";
5
- import { toLocalDate as t } from "../utils/calendar-boundary.js";
6
- const C = ({
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Controller as w } from "react-hook-form";
3
+ import { YearRangePicker as v } from "../../components/forms/date-picker/year-range-picker.js";
4
+ import { getFieldTestId as y } from "../utils/fieldTestIds.js";
5
+ import { resolveYearRangeMinMax as R } from "../utils/date.utils.js";
6
+ const k = ({
7
7
  field: r,
8
- validationRules: d,
9
- isDisabled: h,
10
- formHelpers: o
8
+ validationRules: c,
9
+ isDisabled: d,
10
+ formHelpers: t
11
11
  }) => {
12
12
  const e = r.fieldType === "year_range" ? r : null;
13
13
  if (!e) return null;
14
- const c = o.form.control, u = e.defaultRange ? { from: { year: e.defaultRange.start }, to: { year: e.defaultRange.end } } : void 0;
15
- return /* @__PURE__ */ a(
16
- p,
14
+ const { minDate: h, maxDate: u, startMonth: m, endMonth: p } = R(e), g = t.form.control, f = e.defaultRange ? { from: { year: e.defaultRange.start }, to: { year: e.defaultRange.end } } : void 0;
15
+ return /* @__PURE__ */ o(
16
+ w,
17
17
  {
18
18
  name: r.id,
19
- control: c,
20
- defaultValue: u,
21
- rules: d,
22
- render: ({ field: n, fieldState: l }) => {
23
- const s = !!l.error, m = n.value;
24
- return /* @__PURE__ */ a("div", { "data-testid": f(r.id), children: /* @__PURE__ */ a(
25
- g,
19
+ control: g,
20
+ defaultValue: f,
21
+ rules: c,
22
+ render: ({ field: n, fieldState: s }) => {
23
+ const l = !!s.error, a = n.value, M = a && typeof a == "object" && !Array.isArray(a) && ("from" in a || "to" in a) ? a : void 0;
24
+ return /* @__PURE__ */ o("div", { "data-testid": y(r.id), children: /* @__PURE__ */ o(
25
+ v,
26
26
  {
27
27
  label: r.label,
28
- value: m ?? void 0,
28
+ value: M,
29
29
  onChange: (i) => {
30
- n.onChange(i ?? null), o.setValue(r.id, i ?? null);
30
+ n.onChange(i ?? null), t.setValue(r.id, i ?? null);
31
31
  },
32
32
  placeholder: r.placeholder,
33
- minDate: t(e.minDate),
34
- maxDate: t(e.maxDate),
35
- startMonth: t(e.startMonth),
36
- endMonth: t(e.endMonth),
33
+ minDate: h,
34
+ maxDate: u,
35
+ startMonth: m,
36
+ endMonth: p,
37
37
  required: r.isRequired,
38
- disabled: h,
39
- error: s,
40
- helperText: s ? l.error?.message : r.helpText,
38
+ disabled: d,
39
+ error: l,
40
+ helperText: l ? s.error?.message : r.helpText,
41
41
  showFooter: e.showFooter,
42
42
  showIntervalCaption: e.showIntervalCaption,
43
43
  calendarKind: e.calendarKind,
@@ -54,5 +54,5 @@ const C = ({
54
54
  );
55
55
  };
56
56
  export {
57
- C as YearRangePickerField
57
+ k as YearRangePickerField
58
58
  };
@@ -1,6 +1,7 @@
1
1
  import { Option } from '../../components/forms/select';
2
2
  import { HTMLInputTypeAttribute } from 'react';
3
3
  import { FieldOutputValue } from './fieldsOutput.types';
4
+ import { FiscalCalendarConfig } from '../../lib/fiscal-calendar';
4
5
  export type ValidationRule = {
5
6
  /** Regex pattern string to test against */
6
7
  regex?: string;
@@ -219,6 +220,8 @@ export type WeekRangeField = BaseField & {
219
220
  granularity?: "day" | "week" | "period" | "quarter" | "year";
220
221
  fiscalMonthPattern?: number[];
221
222
  fiscalYearStartMonth?: number;
223
+ /** Canonical retail/NRF config. Wins over fiscalYearStartMonth and fiscalMonthPattern. */
224
+ fiscalConfig?: FiscalCalendarConfig;
222
225
  showFooter?: boolean;
223
226
  /** Draw `(` / `)` on fiscal period start/end days. Default false. */
224
227
  showPeriodBoundaries?: boolean;
@@ -235,12 +238,25 @@ export type MultiWeekRangeField = BaseField & {
235
238
  fieldType: "multi_week_picker";
236
239
  minDate?: string;
237
240
  maxDate?: string;
241
+ /** Minimum selectable start date = today + N days (0 = today, blocks past dates). */
242
+ minStartOffsetDays?: number;
243
+ /** When true, blocks weeks before the current week (minDate = current week start). */
244
+ disablePastWeeks?: boolean;
245
+ /** First month shown in the picker navigation (ISO date string). */
246
+ startMonth?: string;
247
+ /** Last month shown in the picker navigation (ISO date string). */
248
+ endMonth?: string;
249
+ /** Earliest week: week start of the week N weeks before the current week (0 = current week). */
250
+ minWeeksOffset?: number;
251
+ /** Latest week: week end of the week N weeks after the current week. */
252
+ maxWeeksOffset?: number;
238
253
  calendarKind?: "gregorian" | "fiscal";
239
254
  fiscalMode?: "basic" | "advanced" | "custom";
240
255
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
241
256
  granularity?: "day" | "week" | "period" | "quarter" | "year";
242
257
  fiscalMonthPattern?: number[];
243
258
  fiscalYearStartMonth?: number;
259
+ fiscalConfig?: FiscalCalendarConfig;
244
260
  showPeriodBoundaries?: boolean;
245
261
  /** When true, open on the first enabled week. Navigate only. */
246
262
  autoNavigateToAvailable?: boolean;
@@ -281,6 +297,12 @@ export type MultiMonthPickerField = BaseField & {
281
297
  maxDate?: string;
282
298
  startMonth?: string;
283
299
  endMonth?: string;
300
+ /** Number of months before the current month to set as the minimum selectable month */
301
+ minMonthsOffset?: number;
302
+ /** Number of months after the current month to set as the maximum selectable month */
303
+ maxMonthsOffset?: number;
304
+ /** When true, blocks months before the current month. */
305
+ disablePastMonths?: boolean;
284
306
  /** When true, open on the first enabled month. Navigate only. */
285
307
  autoNavigateToAvailable?: boolean;
286
308
  };
@@ -289,6 +311,10 @@ export type YearPickerField = BaseField & {
289
311
  defaultValue?: number;
290
312
  minDate?: string;
291
313
  maxDate?: string;
314
+ /** Earliest year: year start of the year N years before today (0 = current year). Takes precedence over `minDate`. */
315
+ minYearsOffset?: number;
316
+ /** Latest year: year end of the year N years after today (0 = current year). Takes precedence over `maxDate`. */
317
+ maxYearsOffset?: number;
292
318
  startMonth?: string;
293
319
  endMonth?: string;
294
320
  showFooter?: boolean;
@@ -307,6 +333,10 @@ export type MultiYearPickerField = BaseField & {
307
333
  defaultValue?: number[];
308
334
  minDate?: string;
309
335
  maxDate?: string;
336
+ /** Earliest year: year start of the year N years before today (0 = current year). Takes precedence over `minDate`. */
337
+ minYearsOffset?: number;
338
+ /** Latest year: year end of the year N years after today (0 = current year). Takes precedence over `maxDate`. */
339
+ maxYearsOffset?: number;
310
340
  startMonth?: string;
311
341
  endMonth?: string;
312
342
  showFooter?: boolean;
@@ -328,6 +358,10 @@ export type YearRangePickerField = BaseField & {
328
358
  };
329
359
  minDate?: string;
330
360
  maxDate?: string;
361
+ /** Earliest year: year start of the year N years before today (0 = current year). Takes precedence over `minDate`. */
362
+ minYearsOffset?: number;
363
+ /** Latest year: year end of the year N years after today (0 = current year). Takes precedence over `maxDate`. */
364
+ maxYearsOffset?: number;
331
365
  startMonth?: string;
332
366
  endMonth?: string;
333
367
  showFooter?: boolean;
@@ -1,4 +1,4 @@
1
- import { DateRangeField, WeekRangeField } from '../types/fields.types';
1
+ import { DateRangeField, MonthRangeField, MultiMonthPickerField, WeekRangeField, YearRangePickerField } from '../types/fields.types';
2
2
  export declare const DEFAULT_PICKER_DATE_FORMAT = "yyyy-MM-dd";
3
3
  /**
4
4
  * Makes a remote-config date format safe for the date-fns based pickers.
@@ -19,15 +19,65 @@ export declare function handleDateFnsFormat(configFormat?: string): string;
19
19
  export declare function formatDateByConfigFormat(d: Date, df?: string): string;
20
20
  export declare function startOfDayDate(d: Date): Date;
21
21
  export declare function addDaysDate(d: Date, n: number): Date;
22
- type WeekRangeBoundsField = Pick<WeekRangeField, "minDate" | "maxDate" | "minStartOffsetDays" | "disablePastWeeks" | "minWeeksOffset" | "maxWeeksOffset" | "startMonth" | "endMonth" | "calendarKind" | "fiscalMode" | "granularity" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "weekStartsOn">;
22
+ export declare function addYearsDate(d: Date, n: number): Date;
23
+ type DateRangeBoundsField = Pick<DateRangeField, "minDate" | "maxDate" | "minStartOffsetDays" | "startMonth" | "endMonth">;
24
+ type WeekRangeBoundsField = {
25
+ minDate?: string;
26
+ maxDate?: string;
27
+ minStartOffsetDays?: number;
28
+ disablePastWeeks?: boolean;
29
+ minWeeksOffset?: number;
30
+ maxWeeksOffset?: number;
31
+ startMonth?: string;
32
+ endMonth?: string;
33
+ calendarKind?: WeekRangeField["calendarKind"];
34
+ fiscalMode?: WeekRangeField["fiscalMode"];
35
+ granularity?: WeekRangeField["granularity"];
36
+ fiscalMonthPattern?: WeekRangeField["fiscalMonthPattern"];
37
+ fiscalYearStartMonth?: WeekRangeField["fiscalYearStartMonth"];
38
+ weekStartsOn?: WeekRangeField["weekStartsOn"];
39
+ fiscalConfig?: WeekRangeField["fiscalConfig"];
40
+ };
23
41
  export declare const handleMinMaxProp: (dateRangeField: DateRangeField) => {
24
42
  minDate: Date | undefined;
25
43
  maxDate: Date | undefined;
26
44
  };
45
+ export declare const resolveDateRangeMinMax: (dateRangeField: DateRangeBoundsField) => {
46
+ minDate: Date | undefined;
47
+ maxDate: Date | undefined;
48
+ startMonth: Date | undefined;
49
+ endMonth: Date | undefined;
50
+ };
27
51
  export declare const resolveWeekRangeMinMax: (weekRangeField: WeekRangeBoundsField) => {
28
52
  minDate: Date | undefined;
29
53
  maxDate: Date | undefined;
30
54
  startMonth: Date | undefined;
31
55
  endMonth: Date | undefined;
32
56
  };
57
+ type MonthRangeBoundsField = Pick<MonthRangeField | MultiMonthPickerField, "minDate" | "maxDate" | "startMonth" | "endMonth" | "minMonthsOffset" | "maxMonthsOffset" | "disablePastMonths">;
58
+ export declare const resolveMonthRangeMinMax: (monthRangeField: MonthRangeBoundsField) => {
59
+ minDate: Date | undefined;
60
+ maxDate: Date | undefined;
61
+ startMonth: Date | undefined;
62
+ endMonth: Date | undefined;
63
+ };
64
+ type YearRangeBoundsField = Pick<YearRangePickerField, "minDate" | "maxDate" | "minYearsOffset" | "maxYearsOffset" | "startMonth" | "endMonth" | "calendarKind" | "fiscalMode" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "weekStartsOn">;
65
+ /**
66
+ * Resolves selectable year bounds. `minYearsOffset` / `maxYearsOffset` win over
67
+ * static `minDate` / `maxDate` so existing hardcoded configs keep working when
68
+ * offsets are omitted.
69
+ */
70
+ export declare const resolveYearRangeMinMax: (yearRangeField: YearRangeBoundsField) => {
71
+ minDate: Date | undefined;
72
+ maxDate: Date | undefined;
73
+ startMonth: Date | undefined;
74
+ endMonth: Date | undefined;
75
+ };
76
+ /** Quarter pickers navigate by year — reuse year-bound resolution for min/max/month caps. */
77
+ export declare const resolveQuarterRangeMinMax: (yearRangeField: YearRangeBoundsField) => {
78
+ minDate: Date | undefined;
79
+ maxDate: Date | undefined;
80
+ startMonth: Date | undefined;
81
+ endMonth: Date | undefined;
82
+ };
33
83
  export {};