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.
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
- package/dist/components/data/data-table/column-picker-authority.js +116 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +94 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
- package/dist/components/data-display/calendar/calendar-year-utils.js +9 -9
- package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
- package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
- package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
- package/dist/components/forms/date-picker/year-range-picker.js +79 -79
- package/dist/form-react/Fields/ChipsField.js +49 -48
- package/dist/form-react/Fields/DateRangeField.js +25 -25
- package/dist/form-react/Fields/MonthRangeField.js +57 -57
- package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
- package/dist/form-react/Fields/MultiWeekPickerField.js +43 -41
- package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
- package/dist/form-react/Fields/SelectField.js +24 -26
- package/dist/form-react/Fields/WeekRangePicker.js +16 -16
- package/dist/form-react/Fields/YearPickerField.js +27 -27
- package/dist/form-react/Fields/YearRangePickerField.js +29 -29
- package/dist/form-react/types/fields.types.d.ts +30 -0
- package/dist/form-react/utils/date.utils.d.ts +51 -2
- package/dist/form-react/utils/date.utils.js +195 -63
- package/dist/impact-nova.css +1 -1
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- 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
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MonthRangePicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
const [
|
|
9
|
-
return { year: parseInt(
|
|
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 [
|
|
12
|
-
return { year: parseInt(
|
|
13
|
-
},
|
|
14
|
-
field:
|
|
15
|
-
validationRules:
|
|
16
|
-
isDisabled:
|
|
17
|
-
formHelpers:
|
|
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
|
|
20
|
-
if (!
|
|
21
|
-
const y =
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
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:
|
|
26
|
-
control:
|
|
27
|
-
defaultValue:
|
|
28
|
-
rules:
|
|
29
|
-
render: ({ field: d, fieldState:
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
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:
|
|
34
|
+
label: r.label,
|
|
35
35
|
displayFormat: y,
|
|
36
|
-
...
|
|
36
|
+
...x && {
|
|
37
37
|
value: {
|
|
38
|
-
from:
|
|
39
|
-
to:
|
|
38
|
+
from: h,
|
|
39
|
+
to: S
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
onChange: (
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
d.onChange(
|
|
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
|
|
49
|
-
start:
|
|
50
|
-
end:
|
|
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(
|
|
52
|
+
d.onChange(f), a.setValue(r.id, f);
|
|
53
53
|
},
|
|
54
|
-
placeholder:
|
|
55
|
-
minDate:
|
|
56
|
-
maxDate:
|
|
57
|
-
startMonth:
|
|
58
|
-
endMonth:
|
|
59
|
-
required:
|
|
60
|
-
disabled:
|
|
61
|
-
error:
|
|
62
|
-
helperText:
|
|
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:
|
|
65
|
-
fiscalMode:
|
|
66
|
-
fiscalYearStartMonth:
|
|
67
|
-
fiscalMonthPattern:
|
|
68
|
-
showPresets:
|
|
69
|
-
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
|
-
|
|
77
|
+
K as MonthRangeField
|
|
78
78
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiMonthPicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
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:
|
|
8
|
+
validationRules: i,
|
|
9
9
|
isDisabled: u,
|
|
10
|
-
formHelpers:
|
|
10
|
+
formHelpers: m
|
|
11
11
|
}) => {
|
|
12
|
-
const s =
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
19
|
-
render: ({ field:
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ o("div", { "data-testid":
|
|
22
|
-
|
|
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(
|
|
26
|
-
onChange: (
|
|
27
|
-
|
|
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:
|
|
33
|
-
helperText:
|
|
34
|
-
minDate:
|
|
35
|
-
maxDate:
|
|
36
|
-
startMonth:
|
|
37
|
-
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
|
-
)
|
|
45
|
+
);
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
q as MultiMonthPickerField
|
|
47
49
|
};
|
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiWeekPicker as
|
|
4
|
-
import { fiscalCalendarPassThrough as
|
|
5
|
-
import { getFieldTestId as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
field:
|
|
9
|
-
validationRules:
|
|
10
|
-
isDisabled:
|
|
11
|
-
formHelpers:
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
18
|
-
control:
|
|
19
|
-
rules:
|
|
20
|
-
render: ({ field:
|
|
21
|
-
const i = !!
|
|
22
|
-
return /* @__PURE__ */ a("div", { "data-testid":
|
|
23
|
-
|
|
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:
|
|
26
|
-
value: Array.isArray(
|
|
27
|
-
onChange: (
|
|
28
|
-
|
|
27
|
+
label: r.label,
|
|
28
|
+
value: Array.isArray(n) ? n : void 0,
|
|
29
|
+
onChange: (h) => {
|
|
30
|
+
o.onChange(h ?? []);
|
|
29
31
|
},
|
|
30
|
-
placeholder:
|
|
31
|
-
required:
|
|
32
|
-
disabled:
|
|
32
|
+
placeholder: r.placeholder,
|
|
33
|
+
required: r.isRequired,
|
|
34
|
+
disabled: s,
|
|
33
35
|
error: i,
|
|
34
|
-
helperText: i ?
|
|
35
|
-
minDate:
|
|
36
|
-
maxDate:
|
|
37
|
-
...
|
|
38
|
-
calendarKind:
|
|
39
|
-
fiscalMode:
|
|
40
|
-
granularity:
|
|
41
|
-
fiscalMonthPattern:
|
|
42
|
-
fiscalYearStartMonth:
|
|
43
|
-
weekStartsOn:
|
|
44
|
-
showPeriodBoundaries:
|
|
45
|
-
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
|
-
)
|
|
53
|
+
);
|
|
52
54
|
};
|
|
53
55
|
export {
|
|
54
|
-
|
|
56
|
+
y as MultiWeekPickerField
|
|
55
57
|
};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiYearPicker as
|
|
4
|
-
import { getFieldTestId as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
field:
|
|
8
|
-
validationRules:
|
|
9
|
-
isDisabled:
|
|
10
|
-
formHelpers:
|
|
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
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
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:
|
|
19
|
-
control:
|
|
20
|
-
defaultValue:
|
|
21
|
-
rules:
|
|
22
|
-
render: ({ field:
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
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:
|
|
28
|
-
value:
|
|
27
|
+
label: e.label,
|
|
28
|
+
value: f,
|
|
29
29
|
onChange: (i) => {
|
|
30
|
-
|
|
30
|
+
t.onChange(i ?? null), a.setValue(e.id, i ?? null);
|
|
31
31
|
},
|
|
32
|
-
placeholder:
|
|
33
|
-
minDate:
|
|
34
|
-
maxDate:
|
|
35
|
-
startMonth:
|
|
36
|
-
endMonth:
|
|
37
|
-
required:
|
|
38
|
-
disabled:
|
|
39
|
-
error:
|
|
40
|
-
helperText:
|
|
41
|
-
showFooter:
|
|
42
|
-
showIntervalCaption:
|
|
43
|
-
calendarKind:
|
|
44
|
-
fiscalMode:
|
|
45
|
-
fiscalYearStartMonth:
|
|
46
|
-
fiscalMonthPattern:
|
|
47
|
-
weekStartsOn:
|
|
48
|
-
showPresets:
|
|
49
|
-
...
|
|
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
|
-
|
|
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
|
|
4
|
-
import { Select as
|
|
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
|
|
7
|
-
|
|
8
|
-
const $ = ({
|
|
6
|
+
import { getFieldTestId as T } from "../utils/fieldTestIds.js";
|
|
7
|
+
const L = ({
|
|
9
8
|
field: e,
|
|
10
9
|
validationRules: p,
|
|
11
|
-
isDisabled:
|
|
12
|
-
formHelpers:
|
|
13
|
-
supportedValues:
|
|
10
|
+
isDisabled: u,
|
|
11
|
+
formHelpers: n,
|
|
12
|
+
supportedValues: d
|
|
14
13
|
}) => {
|
|
15
|
-
const t = e.fieldType === "select" ? e : null, [
|
|
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:
|
|
16
|
+
formHelpers: n,
|
|
18
17
|
initialOptions: t?.options,
|
|
19
18
|
id: e.id,
|
|
20
|
-
isEnabled:
|
|
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
|
-
|
|
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
|
|
31
|
+
const s = !!l.error, a = o.value, y = t?.isMultiSelect ? a ?? [] : a?.[0] ?? null;
|
|
33
32
|
return /* @__PURE__ */ c(
|
|
34
|
-
|
|
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:
|
|
40
|
+
disabled: u,
|
|
42
41
|
options: g,
|
|
43
42
|
maxSelectableOptions: t?.maxSelectLimit,
|
|
44
|
-
value:
|
|
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:
|
|
58
|
-
helperText:
|
|
56
|
+
error: s,
|
|
57
|
+
helperText: s ? l.error?.message : e.helpText,
|
|
59
58
|
ignoreAccents: !0,
|
|
60
59
|
isLoading: b,
|
|
61
|
-
fetchError:
|
|
62
|
-
onRefetch:
|
|
63
|
-
onMenuOpen: () =>
|
|
64
|
-
onMenuClose: () =>
|
|
65
|
-
"data-testid":
|
|
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
|
-
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
30
|
-
const
|
|
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:
|
|
37
|
-
to:
|
|
36
|
+
from: S(s, t),
|
|
37
|
+
to: S(i, t)
|
|
38
38
|
} : void 0,
|
|
39
39
|
onChange: (o) => {
|
|
40
|
-
const
|
|
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:
|
|
44
|
+
startMonth: u ?? D,
|
|
45
|
+
endMonth: m ?? k,
|
|
46
46
|
required: e.isRequired,
|
|
47
|
-
disabled:
|
|
48
|
-
error:
|
|
49
|
-
helperText:
|
|
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:
|
|
54
|
-
maxDate:
|
|
53
|
+
minDate: u,
|
|
54
|
+
maxDate: m,
|
|
55
55
|
granularity: t.granularity,
|
|
56
56
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
57
57
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|