impact-nova 2.5.13 → 2.5.14
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.
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
- package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
- package/dist/components/data-display/calendar/calendar-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
- package/dist/components/data-display/calendar/calendar-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
- package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
- package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
- package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
- package/dist/components/data-display/calendar/calendar-selection.js +52 -23
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
- package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
- package/dist/components/data-display/calendar/calendar.js +146 -143
- package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/date-picker.js +60 -58
- package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
- package/dist/components/forms/date-picker/date-range-picker.js +66 -64
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
- package/dist/components/forms/date-picker/month-picker.js +61 -59
- package/dist/components/forms/date-picker/month-range-picker.js +63 -61
- package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
- package/dist/components/forms/date-picker/quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
- package/dist/components/forms/date-picker/week-picker.js +130 -126
- package/dist/components/forms/date-picker/week-range-picker.js +159 -155
- package/dist/components/forms/date-picker/year-picker.js +52 -48
- package/dist/components/forms/date-picker/year-range-picker.js +52 -48
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/form-react/Fields/DateInputField.js +51 -50
- package/dist/form-react/Fields/DateRangeField.js +14 -13
- package/dist/form-react/Fields/MonthRangeField.js +29 -28
- package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
- package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
- package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/MultiYearPickerField.js +57 -0
- package/dist/form-react/Fields/WeekRangePicker.js +33 -32
- package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearPickerField.js +57 -0
- package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearRangePickerField.js +57 -0
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
- package/dist/form-react/types/fields.types.d.ts +69 -1
- package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
- package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
- package/dist/impact-nova-components.css +13 -6
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -28
- package/dist/lib/fiscal-calendar/types.d.ts +0 -7
- package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
- package/dist/lib/fiscal-calendar/week-selection.js +52 -79
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- package/dist/lib/hash/fnv1a128.js +0 -21
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Controller as
|
|
4
|
-
import { DateRangePicker as
|
|
3
|
+
import { Controller as g } from "react-hook-form";
|
|
4
|
+
import { DateRangePicker as v } from "../../components/forms/date-picker/date-range-picker.js";
|
|
5
5
|
import { toLocalDate as a } from "../utils/calendar-boundary.js";
|
|
6
|
-
import { handleMinMaxProp as
|
|
7
|
-
const
|
|
6
|
+
import { handleMinMaxProp as S } from "../utils/date.utils.js";
|
|
7
|
+
const T = ({
|
|
8
8
|
field: r,
|
|
9
9
|
validationRules: h,
|
|
10
10
|
isDisabled: l,
|
|
@@ -12,18 +12,18 @@ const Y = ({
|
|
|
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 } =
|
|
15
|
+
const c = s.form.control, { minDate: m, maxDate: u } = S(t);
|
|
16
16
|
return /* @__PURE__ */ n(
|
|
17
|
-
|
|
17
|
+
g,
|
|
18
18
|
{
|
|
19
19
|
name: r.id,
|
|
20
20
|
control: c,
|
|
21
21
|
disabled: l,
|
|
22
22
|
rules: h,
|
|
23
|
-
render: ({ field: p, fieldState:
|
|
24
|
-
const
|
|
23
|
+
render: ({ field: p, fieldState: i }) => {
|
|
24
|
+
const d = !!i.error, e = p.value;
|
|
25
25
|
return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
26
|
-
|
|
26
|
+
v,
|
|
27
27
|
{
|
|
28
28
|
label: r.label,
|
|
29
29
|
minDate: m,
|
|
@@ -43,14 +43,15 @@ const Y = ({
|
|
|
43
43
|
placeholder: r.placeholder,
|
|
44
44
|
required: r.isRequired,
|
|
45
45
|
disabled: l,
|
|
46
|
-
error:
|
|
47
|
-
helperText:
|
|
46
|
+
error: d,
|
|
47
|
+
helperText: d ? i.error?.message : r.helpText,
|
|
48
48
|
showFooter: !0,
|
|
49
49
|
calendarKind: t.calendarKind,
|
|
50
50
|
fiscalMode: t.fiscalMode,
|
|
51
51
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
52
52
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
53
|
-
showPresets: t.showPresets
|
|
53
|
+
showPresets: t.showPresets,
|
|
54
|
+
autoNavigateToAvailable: t.autoNavigateToAvailable
|
|
54
55
|
}
|
|
55
56
|
) });
|
|
56
57
|
}
|
|
@@ -58,5 +59,5 @@ const Y = ({
|
|
|
58
59
|
);
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
T as DateRangeField
|
|
62
63
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MonthRangePicker as
|
|
4
|
-
import { getFieldTestId as
|
|
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
5
|
import { toLocalDate as o } from "../utils/calendar-boundary.js";
|
|
6
|
-
const w = (
|
|
7
|
-
if (
|
|
8
|
-
const [
|
|
9
|
-
return { year: parseInt(
|
|
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 };
|
|
10
10
|
}
|
|
11
|
-
const [s, l] =
|
|
11
|
+
const [s, l] = a.split("-");
|
|
12
12
|
return { year: parseInt(s, 10), month: parseInt(l, 10) - 1 };
|
|
13
13
|
}, O = ({
|
|
14
|
-
field:
|
|
14
|
+
field: a,
|
|
15
15
|
validationRules: s,
|
|
16
16
|
isDisabled: l,
|
|
17
|
-
formHelpers:
|
|
17
|
+
formHelpers: r
|
|
18
18
|
}) => {
|
|
19
|
-
const
|
|
19
|
+
const i = r.form.control, t = a.fieldType === "month_range" ? a : null;
|
|
20
20
|
if (!t) return null;
|
|
21
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
22
|
return /* @__PURE__ */ u(
|
|
23
|
-
|
|
23
|
+
x,
|
|
24
24
|
{
|
|
25
|
-
name:
|
|
26
|
-
control:
|
|
25
|
+
name: a.id,
|
|
26
|
+
control: i,
|
|
27
27
|
defaultValue: t.defaultRange ? { start: t.defaultRange.start || null, end: t.defaultRange.end || null } : void 0,
|
|
28
28
|
rules: s,
|
|
29
|
-
render: ({ field:
|
|
30
|
-
const f = !!M.error, n =
|
|
31
|
-
return /* @__PURE__ */ u("div", { "data-testid":
|
|
32
|
-
|
|
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,
|
|
33
33
|
{
|
|
34
|
-
label:
|
|
34
|
+
label: a.label,
|
|
35
35
|
displayFormat: y,
|
|
36
36
|
...Y && {
|
|
37
37
|
value: {
|
|
@@ -41,31 +41,32 @@ const w = (r) => {
|
|
|
41
41
|
},
|
|
42
42
|
onChange: (e) => {
|
|
43
43
|
if (!e?.from || !e?.to) {
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const S = { start: null, end: null };
|
|
45
|
+
d.onChange(S), r.setValue(a.id, S);
|
|
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(),
|
|
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
49
|
start: $,
|
|
50
|
-
end:
|
|
50
|
+
end: v
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
d.onChange(g), r.setValue(a.id, g);
|
|
53
53
|
},
|
|
54
|
-
placeholder:
|
|
54
|
+
placeholder: a.placeholder,
|
|
55
55
|
minDate: c,
|
|
56
56
|
maxDate: h,
|
|
57
57
|
startMonth: c || o(t.startMonth),
|
|
58
58
|
endMonth: h || o(t.endMonth),
|
|
59
|
-
required:
|
|
59
|
+
required: a.isRequired,
|
|
60
60
|
disabled: l,
|
|
61
61
|
error: f,
|
|
62
|
-
helperText: f ? M.error?.message :
|
|
62
|
+
helperText: f ? M.error?.message : a.helpText,
|
|
63
63
|
showFooter: !0,
|
|
64
64
|
calendarKind: t.calendarKind,
|
|
65
65
|
fiscalMode: t.fiscalMode,
|
|
66
66
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
67
67
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
68
|
-
showPresets: t.showPresets
|
|
68
|
+
showPresets: t.showPresets,
|
|
69
|
+
autoNavigateToAvailable: t.autoNavigateToAvailable
|
|
69
70
|
}
|
|
70
71
|
) });
|
|
71
72
|
}
|
|
@@ -3,38 +3,39 @@ import { Controller as d } from "react-hook-form";
|
|
|
3
3
|
import { MultiMonthPicker as p } from "../../components/forms/date-picker/multi-month-picker.js";
|
|
4
4
|
import { getFieldTestId as M } from "../utils/fieldTestIds.js";
|
|
5
5
|
import { toLocalDate as t } from "../utils/calendar-boundary.js";
|
|
6
|
-
const
|
|
6
|
+
const D = ({
|
|
7
7
|
field: r,
|
|
8
8
|
validationRules: m,
|
|
9
|
-
isDisabled:
|
|
10
|
-
formHelpers:
|
|
9
|
+
isDisabled: u,
|
|
10
|
+
formHelpers: h
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const s = h.form.control, e = r.fieldType === "multi_month_picker" ? r : null;
|
|
13
13
|
return e ? /* @__PURE__ */ o(
|
|
14
14
|
d,
|
|
15
15
|
{
|
|
16
16
|
name: r.id,
|
|
17
|
-
control:
|
|
17
|
+
control: s,
|
|
18
18
|
rules: m,
|
|
19
|
-
render: ({ field:
|
|
20
|
-
const l = !!
|
|
19
|
+
render: ({ field: a, fieldState: n }) => {
|
|
20
|
+
const l = !!n.error, i = a.value;
|
|
21
21
|
return /* @__PURE__ */ o("div", { "data-testid": M(r.id), children: /* @__PURE__ */ o(
|
|
22
22
|
p,
|
|
23
23
|
{
|
|
24
24
|
label: r.label,
|
|
25
25
|
value: Array.isArray(i) ? i : void 0,
|
|
26
26
|
onChange: (c) => {
|
|
27
|
-
|
|
27
|
+
a.onChange(c ?? []);
|
|
28
28
|
},
|
|
29
29
|
placeholder: r.placeholder,
|
|
30
30
|
required: r.isRequired,
|
|
31
|
-
disabled:
|
|
31
|
+
disabled: u,
|
|
32
32
|
error: l,
|
|
33
|
-
helperText: l ?
|
|
33
|
+
helperText: l ? n.error?.message : r.helpText,
|
|
34
34
|
minDate: t(e.minDate),
|
|
35
35
|
maxDate: t(e.maxDate),
|
|
36
36
|
startMonth: t(e.startMonth),
|
|
37
|
-
endMonth: t(e.endMonth)
|
|
37
|
+
endMonth: t(e.endMonth),
|
|
38
|
+
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
38
39
|
}
|
|
39
40
|
) });
|
|
40
41
|
}
|
|
@@ -42,5 +43,5 @@ const b = ({
|
|
|
42
43
|
) : null;
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
D as MultiMonthPickerField
|
|
46
47
|
};
|
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiWeekPicker as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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 = ({
|
|
7
8
|
field: e,
|
|
8
|
-
validationRules:
|
|
9
|
-
isDisabled:
|
|
9
|
+
validationRules: s,
|
|
10
|
+
isDisabled: u,
|
|
10
11
|
formHelpers: c
|
|
11
12
|
}) => {
|
|
12
13
|
const d = c.form.control, r = e.fieldType === "multi_week_picker" ? e : null;
|
|
13
|
-
return r ? /* @__PURE__ */
|
|
14
|
-
|
|
14
|
+
return r ? /* @__PURE__ */ a(
|
|
15
|
+
h,
|
|
15
16
|
{
|
|
16
17
|
name: e.id,
|
|
17
18
|
control: d,
|
|
18
|
-
rules:
|
|
19
|
-
render: ({ field: t, fieldState:
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
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,
|
|
23
24
|
{
|
|
24
25
|
label: e.label,
|
|
25
|
-
value: Array.isArray(
|
|
26
|
-
onChange: (
|
|
27
|
-
t.onChange(
|
|
26
|
+
value: Array.isArray(l) ? l : void 0,
|
|
27
|
+
onChange: (m) => {
|
|
28
|
+
t.onChange(m ?? []);
|
|
28
29
|
},
|
|
29
30
|
placeholder: e.placeholder,
|
|
30
31
|
required: e.isRequired,
|
|
31
|
-
disabled:
|
|
32
|
-
error:
|
|
33
|
-
helperText:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
disabled: u,
|
|
33
|
+
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
|
|
46
|
+
})
|
|
39
47
|
}
|
|
40
48
|
) });
|
|
41
49
|
}
|
|
@@ -43,5 +51,5 @@ const M = ({
|
|
|
43
51
|
) : null;
|
|
44
52
|
};
|
|
45
53
|
export {
|
|
46
|
-
|
|
54
|
+
x as MultiWeekPickerField
|
|
47
55
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormFieldProps } from '../types/reactHookForm.types';
|
|
3
|
+
import { UseReactHookFormReturn } from '../hooks/useReactHookForm';
|
|
4
|
+
interface MultiYearPickerFieldProps extends FormFieldProps {
|
|
5
|
+
formHelpers: UseReactHookFormReturn;
|
|
6
|
+
}
|
|
7
|
+
export declare const MultiYearPickerField: FC<MultiYearPickerFieldProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
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 f } from "../utils/fieldTestIds.js";
|
|
5
|
+
import { toLocalDate as o } from "../utils/calendar-boundary.js";
|
|
6
|
+
const g = ({
|
|
7
|
+
field: r,
|
|
8
|
+
validationRules: h,
|
|
9
|
+
isDisabled: u,
|
|
10
|
+
formHelpers: n
|
|
11
|
+
}) => {
|
|
12
|
+
const e = r.fieldType === "multi_year_picker" ? r : null;
|
|
13
|
+
if (!e) return null;
|
|
14
|
+
const c = n.form.control, d = e.defaultValue?.map((t) => ({ year: t }));
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
18
|
+
name: r.id,
|
|
19
|
+
control: c,
|
|
20
|
+
defaultValue: d,
|
|
21
|
+
rules: h,
|
|
22
|
+
render: ({ field: t, fieldState: l }) => {
|
|
23
|
+
const s = !!l.error, m = t.value;
|
|
24
|
+
return /* @__PURE__ */ a("div", { "data-testid": f(r.id), children: /* @__PURE__ */ a(
|
|
25
|
+
M,
|
|
26
|
+
{
|
|
27
|
+
label: r.label,
|
|
28
|
+
value: m ?? void 0,
|
|
29
|
+
onChange: (i) => {
|
|
30
|
+
t.onChange(i ?? null), n.setValue(r.id, i ?? null);
|
|
31
|
+
},
|
|
32
|
+
placeholder: r.placeholder,
|
|
33
|
+
minDate: o(e.minDate),
|
|
34
|
+
maxDate: o(e.maxDate),
|
|
35
|
+
startMonth: o(e.startMonth),
|
|
36
|
+
endMonth: o(e.endMonth),
|
|
37
|
+
required: r.isRequired,
|
|
38
|
+
disabled: u,
|
|
39
|
+
error: s,
|
|
40
|
+
helperText: s ? l.error?.message : r.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
|
+
showPresets: e.showPresets,
|
|
48
|
+
...e.componentProps
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
g as MultiYearPickerField
|
|
57
|
+
};
|
|
@@ -1,62 +1,63 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { WeekRangePicker as
|
|
4
|
-
import { toLocalDate as
|
|
5
|
-
import { resolveWeekSelection as
|
|
6
|
-
import { resolveWeekRangeMinMax as
|
|
7
|
-
const
|
|
8
|
-
calendarKind:
|
|
9
|
-
fiscalMode:
|
|
10
|
-
granularity:
|
|
11
|
-
fiscalMonthPattern:
|
|
12
|
-
fiscalYearStartMonth:
|
|
13
|
-
weekStartsOn:
|
|
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 M } 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 f = (e, a) => Y(e, {
|
|
8
|
+
calendarKind: a.calendarKind,
|
|
9
|
+
fiscalMode: a.fiscalMode ?? "basic",
|
|
10
|
+
granularity: a.granularity,
|
|
11
|
+
fiscalMonthPattern: a.fiscalMonthPattern,
|
|
12
|
+
fiscalYearStartMonth: a.fiscalYearStartMonth ?? 1,
|
|
13
|
+
weekStartsOn: a.weekStartsOn ?? 1
|
|
14
14
|
}), C = ({
|
|
15
15
|
field: e,
|
|
16
|
-
validationRules:
|
|
17
|
-
isDisabled:
|
|
16
|
+
validationRules: a,
|
|
17
|
+
isDisabled: S,
|
|
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:
|
|
22
|
+
const { minDate: p, maxDate: u, 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
|
-
control:
|
|
28
|
-
rules:
|
|
29
|
-
render: ({ field:
|
|
30
|
-
const
|
|
27
|
+
control: v,
|
|
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);
|
|
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:
|
|
37
|
-
to:
|
|
36
|
+
from: f(s, t),
|
|
37
|
+
to: f(i, t)
|
|
38
38
|
} : void 0,
|
|
39
39
|
onChange: (o) => {
|
|
40
|
-
const
|
|
41
|
-
d.setValue(e.id, { start: P, end:
|
|
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;
|
|
41
|
+
d.setValue(e.id, { start: P, end: T });
|
|
42
42
|
},
|
|
43
43
|
placeholder: t.placeholder,
|
|
44
|
-
startMonth:
|
|
45
|
-
endMonth:
|
|
44
|
+
startMonth: D,
|
|
45
|
+
endMonth: u ?? k,
|
|
46
46
|
required: e.isRequired,
|
|
47
|
-
disabled:
|
|
48
|
-
error:
|
|
49
|
-
helperText:
|
|
47
|
+
disabled: S,
|
|
48
|
+
error: h,
|
|
49
|
+
helperText: h ? m.error?.message : e.helpText,
|
|
50
50
|
calendarKind: t.calendarKind,
|
|
51
51
|
fiscalMode: t.fiscalMode,
|
|
52
52
|
weekStartsOn: t.weekStartsOn,
|
|
53
|
-
minDate:
|
|
54
|
-
maxDate:
|
|
53
|
+
minDate: p,
|
|
54
|
+
maxDate: u,
|
|
55
55
|
granularity: t.granularity,
|
|
56
56
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
57
57
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
58
58
|
showFooter: t.showFooter,
|
|
59
59
|
showPeriodBoundaries: t.showPeriodBoundaries,
|
|
60
|
+
autoNavigateToAvailable: t.autoNavigateToAvailable,
|
|
60
61
|
format: t.dateFormat
|
|
61
62
|
}
|
|
62
63
|
) });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormFieldProps } from '../types/reactHookForm.types';
|
|
3
|
+
import { UseReactHookFormReturn } from '../hooks/useReactHookForm';
|
|
4
|
+
interface YearPickerFieldProps extends FormFieldProps {
|
|
5
|
+
formHelpers: UseReactHookFormReturn;
|
|
6
|
+
}
|
|
7
|
+
export declare const YearPickerField: FC<YearPickerFieldProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t } 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 o } from "../utils/calendar-boundary.js";
|
|
6
|
+
const C = ({
|
|
7
|
+
field: r,
|
|
8
|
+
validationRules: d,
|
|
9
|
+
isDisabled: h,
|
|
10
|
+
formHelpers: a
|
|
11
|
+
}) => {
|
|
12
|
+
const e = r.fieldType === "year_picker" ? r : null;
|
|
13
|
+
if (!e) return null;
|
|
14
|
+
const c = a.form.control;
|
|
15
|
+
return /* @__PURE__ */ t(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
name: r.id,
|
|
19
|
+
control: c,
|
|
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__ */ t("div", { "data-testid": M(r.id), children: /* @__PURE__ */ t(
|
|
25
|
+
p,
|
|
26
|
+
{
|
|
27
|
+
label: r.label,
|
|
28
|
+
value: u ?? void 0,
|
|
29
|
+
onChange: (i) => {
|
|
30
|
+
n.onChange(i ?? null), a.setValue(r.id, i ?? null);
|
|
31
|
+
},
|
|
32
|
+
placeholder: r.placeholder,
|
|
33
|
+
minDate: o(e.minDate),
|
|
34
|
+
maxDate: o(e.maxDate),
|
|
35
|
+
startMonth: o(e.startMonth),
|
|
36
|
+
endMonth: o(e.endMonth),
|
|
37
|
+
required: r.isRequired,
|
|
38
|
+
disabled: h,
|
|
39
|
+
error: s,
|
|
40
|
+
helperText: s ? l.error?.message : r.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
|
+
showPresets: e.showPresets,
|
|
48
|
+
...e.componentProps
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
C as YearPickerField
|
|
57
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormFieldProps } from '../types/reactHookForm.types';
|
|
3
|
+
import { UseReactHookFormReturn } from '../hooks/useReactHookForm';
|
|
4
|
+
interface YearRangePickerFieldProps extends FormFieldProps {
|
|
5
|
+
formHelpers: UseReactHookFormReturn;
|
|
6
|
+
}
|
|
7
|
+
export declare const YearRangePickerField: FC<YearRangePickerFieldProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as o } 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 = ({
|
|
7
|
+
field: r,
|
|
8
|
+
validationRules: d,
|
|
9
|
+
isDisabled: h,
|
|
10
|
+
formHelpers: a
|
|
11
|
+
}) => {
|
|
12
|
+
const e = r.fieldType === "year_range" ? r : null;
|
|
13
|
+
if (!e) return null;
|
|
14
|
+
const c = a.form.control, u = e.defaultRange ? { from: { year: e.defaultRange.start }, to: { year: e.defaultRange.end } } : void 0;
|
|
15
|
+
return /* @__PURE__ */ o(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
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__ */ o("div", { "data-testid": f(r.id), children: /* @__PURE__ */ o(
|
|
25
|
+
g,
|
|
26
|
+
{
|
|
27
|
+
label: r.label,
|
|
28
|
+
value: m ?? void 0,
|
|
29
|
+
onChange: (i) => {
|
|
30
|
+
n.onChange(i ?? null), a.setValue(r.id, i ?? null);
|
|
31
|
+
},
|
|
32
|
+
placeholder: r.placeholder,
|
|
33
|
+
minDate: t(e.minDate),
|
|
34
|
+
maxDate: t(e.maxDate),
|
|
35
|
+
startMonth: t(e.startMonth),
|
|
36
|
+
endMonth: t(e.endMonth),
|
|
37
|
+
required: r.isRequired,
|
|
38
|
+
disabled: h,
|
|
39
|
+
error: s,
|
|
40
|
+
helperText: s ? l.error?.message : r.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
|
+
showPresets: e.showPresets,
|
|
48
|
+
...e.componentProps
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
C as YearRangePickerField
|
|
57
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Register all
|
|
2
|
+
* Register all 26 built-in field types. Safe to call multiple times — runs once.
|
|
3
3
|
*
|
|
4
4
|
* Consumers must call this at app startup (or use `registerFieldType` selectively)
|
|
5
5
|
* before rendering any `FieldRenderer` / `ReactHooksForm`.
|