impact-nova 2.5.7 → 2.5.9
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/ag-grid-react/ag-grid.types.d.ts +2 -2
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
- package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
- package/dist/components/data-display/calendar/calendar-config.js +31 -20
- package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
- package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
- package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +196 -102
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +41 -0
- package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
- package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
- package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
- package/dist/components/data-display/calendar/calendar-footer.js +88 -66
- package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
- package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
- package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
- package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
- package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
- package/dist/components/data-display/calendar/calendar-selection.js +31 -0
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
- package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
- package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +303 -181
- package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
- package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
- package/dist/components/data-display/calendar/index.d.ts +1 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
- package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
- package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +25 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
- package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
- package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
- package/dist/components/forms/date-picker/date-picker.js +187 -167
- package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
- package/dist/components/forms/date-picker/date-range-picker.js +273 -224
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
- package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
- package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
- package/dist/components/forms/date-picker/index.d.ts +12 -0
- package/dist/components/forms/date-picker/index.js +19 -7
- package/dist/components/forms/date-picker/month-picker.js +225 -182
- package/dist/components/forms/date-picker/month-range-picker.js +134 -110
- package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
- package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
- package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
- package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
- package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
- package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-picker.js +176 -0
- package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
- package/dist/components/forms/date-picker/week-picker.js +148 -137
- package/dist/components/forms/date-picker/week-range-picker.js +216 -205
- package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-picker.js +176 -0
- package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-range-picker.js +179 -0
- package/dist/components/forms/smart-input/smart-input.js +106 -85
- package/dist/components/forms/smart-input/smart-input.types.d.ts +5 -0
- package/dist/components/forms/textarea/textarea.js +29 -28
- package/dist/components/forms/textarea/textarea.types.d.ts +1 -0
- package/dist/form-react/Fields/DateInputField.js +63 -58
- package/dist/form-react/Fields/DateRangeField.js +42 -37
- package/dist/form-react/Fields/MonthRangeField.js +50 -45
- package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
- package/dist/form-react/Fields/TextField.js +25 -24
- package/dist/form-react/Fields/WeekRangePicker.js +44 -45
- package/dist/form-react/components/FieldRenderer.js +21 -23
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
- package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
- package/dist/form-react/registry/resolveFieldComponent.js +9 -133
- package/dist/form-react/types/fields.types.d.ts +25 -4
- package/dist/form-react/utils/date.utils.d.ts +1 -1
- package/dist/form-react/utils/date.utils.js +38 -38
- package/dist/i18n/defaultMessages.d.ts +19 -1
- package/dist/i18n/defaultMessages.js +37 -20
- package/dist/i18n/locales/de.js +18 -1
- package/dist/i18n/locales/es.js +18 -1
- package/dist/i18n/locales/hi.js +18 -1
- package/dist/i18n/locales/kn.js +18 -1
- package/dist/impact-nova-components.css +379 -3
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +528 -516
- package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
- package/dist/lib/fiscal-calendar/build-year.js +173 -0
- package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
- package/dist/lib/fiscal-calendar/civil-date.js +94 -0
- package/dist/lib/fiscal-calendar/index.d.ts +10 -0
- package/dist/lib/fiscal-calendar/index.js +40 -0
- package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
- package/dist/lib/fiscal-calendar/lookup.js +70 -0
- package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
- package/dist/lib/fiscal-calendar/presets.js +99 -0
- package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
- package/dist/lib/fiscal-calendar/selection.js +32 -0
- package/dist/lib/fiscal-calendar/types.d.ts +145 -0
- package/dist/lib/fiscal-calendar/types.js +10 -0
- package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
- package/dist/lib/fiscal-calendar/week-selection.js +107 -0
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
- package/dist/lib/fiscal-calendar.d.ts +0 -62
- package/dist/lib/fiscal-calendar.js +0 -99
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useWatch as
|
|
2
|
+
import { useRef as w, useEffect as y } from "react";
|
|
3
|
+
import { useWatch as b, Controller as V } from "react-hook-form";
|
|
4
4
|
import { SmartInput as x } from "../../components/forms/smart-input/smart-input.js";
|
|
5
|
-
import { readOptionFlag as
|
|
6
|
-
const
|
|
5
|
+
import { readOptionFlag as p } from "../utils/optionFlag.js";
|
|
6
|
+
const I = ({
|
|
7
7
|
field: e,
|
|
8
8
|
validationRules: u,
|
|
9
9
|
isDisabled: i,
|
|
10
10
|
formHelpers: r
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const n = e.fieldType === "text" ? e : null, o = n?.allowNegativeDependency, l = !!o, c = !!n?.nonNegative, d = b({
|
|
13
13
|
control: r.form.control,
|
|
14
|
-
name:
|
|
14
|
+
name: o?.fieldId ?? "",
|
|
15
15
|
disabled: !l
|
|
16
|
-
}), f = !c || l &&
|
|
17
|
-
r.form.getValues(
|
|
18
|
-
|
|
19
|
-
), s =
|
|
20
|
-
return
|
|
16
|
+
}), f = !c || l && p(
|
|
17
|
+
r.form.getValues(o.fieldId),
|
|
18
|
+
o.optionFlag
|
|
19
|
+
), s = w(!0);
|
|
20
|
+
return y(() => {
|
|
21
21
|
if (!l) return;
|
|
22
22
|
if (s.current) {
|
|
23
23
|
s.current = !1;
|
|
@@ -25,8 +25,8 @@ const T = ({
|
|
|
25
25
|
}
|
|
26
26
|
const t = r.form.getValues(e.id);
|
|
27
27
|
t != null && String(t).trim() !== "" && r.form.trigger(e.id);
|
|
28
|
-
}, [l,
|
|
29
|
-
|
|
28
|
+
}, [l, d, e.id, r.form]), n ? /* @__PURE__ */ m(
|
|
29
|
+
V,
|
|
30
30
|
{
|
|
31
31
|
name: e.id,
|
|
32
32
|
control: r.form.control,
|
|
@@ -34,26 +34,26 @@ const T = ({
|
|
|
34
34
|
...u,
|
|
35
35
|
validate: (t) => {
|
|
36
36
|
if (typeof u.validate == "function") {
|
|
37
|
-
const
|
|
37
|
+
const a = u.validate(
|
|
38
38
|
t,
|
|
39
39
|
r.form.getValues()
|
|
40
40
|
);
|
|
41
|
-
if (
|
|
41
|
+
if (a !== !0) return a;
|
|
42
42
|
}
|
|
43
|
-
return c && l && !
|
|
44
|
-
r.form.getValues(
|
|
45
|
-
|
|
43
|
+
return c && l && !p(
|
|
44
|
+
r.form.getValues(o.fieldId),
|
|
45
|
+
o.optionFlag
|
|
46
46
|
) && typeof t == "string" && Number(t) < 0 ? `${e.label || "Value"} must be a non-negative number` : !0;
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
render: ({ field: t, fieldState:
|
|
50
|
-
const g = !!
|
|
49
|
+
render: ({ field: t, fieldState: a }) => {
|
|
50
|
+
const g = !!a.error, h = t.value;
|
|
51
51
|
return /* @__PURE__ */ m(
|
|
52
52
|
x,
|
|
53
53
|
{
|
|
54
54
|
name: e.id,
|
|
55
55
|
label: e.label,
|
|
56
|
-
type:
|
|
56
|
+
type: n.type,
|
|
57
57
|
value: h ?? void 0,
|
|
58
58
|
onChange: (v) => t.onChange(v),
|
|
59
59
|
onBlur: t.onBlur,
|
|
@@ -61,9 +61,10 @@ const T = ({
|
|
|
61
61
|
required: e.isRequired && !i,
|
|
62
62
|
disabled: i,
|
|
63
63
|
error: g,
|
|
64
|
-
helperText: g ?
|
|
64
|
+
helperText: g ? a?.error?.message : e?.helpText,
|
|
65
65
|
allowNegative: f,
|
|
66
|
-
allowDecimal:
|
|
66
|
+
allowDecimal: n.allowDecimal ?? !0,
|
|
67
|
+
allowSpecialCharacters: n.allowSpecialCharacters
|
|
67
68
|
}
|
|
68
69
|
);
|
|
69
70
|
}
|
|
@@ -71,5 +72,5 @@ const T = ({
|
|
|
71
72
|
) : null;
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
I as TextField
|
|
75
76
|
};
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { WeekRangePicker as
|
|
4
|
-
import { toLocalDate as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
formHelpers: i
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Controller as x } from "react-hook-form";
|
|
3
|
+
import { WeekRangePicker as Y } from "../../components/forms/date-picker/week-range-picker.js";
|
|
4
|
+
import { toLocalDate as u } from "../utils/calendar-boundary.js";
|
|
5
|
+
import { resolveWeekSelection as $ } from "../../lib/fiscal-calendar/week-selection.js";
|
|
6
|
+
import { resolveWeekRangeMinMax as v } from "../utils/date.utils.js";
|
|
7
|
+
const M = (r, e) => $(r, {
|
|
8
|
+
calendarKind: e.calendarKind,
|
|
9
|
+
fiscalMode: e.fiscalMode ?? "basic",
|
|
10
|
+
granularity: e.granularity,
|
|
11
|
+
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
12
|
+
fiscalYearStartMonth: e.fiscalYearStartMonth ?? 1,
|
|
13
|
+
weekStartsOn: e.weekStartsOn ?? 1
|
|
14
|
+
}), T = ({
|
|
15
|
+
field: r,
|
|
16
|
+
validationRules: e,
|
|
17
|
+
isDisabled: D,
|
|
18
|
+
formHelpers: l
|
|
20
19
|
}) => {
|
|
21
|
-
const t =
|
|
20
|
+
const t = r.fieldType === "week_range" ? r : null;
|
|
22
21
|
if (!t) return null;
|
|
23
|
-
const { minDate:
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
22
|
+
const { minDate: s, maxDate: c, startMonth: S, endMonth: f } = v(t), g = l.form.control;
|
|
23
|
+
return /* @__PURE__ */ n(
|
|
24
|
+
x,
|
|
26
25
|
{
|
|
27
|
-
name:
|
|
26
|
+
name: r.id,
|
|
28
27
|
control: g,
|
|
29
|
-
rules:
|
|
30
|
-
render: ({ field:
|
|
31
|
-
const d = !!
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
28
|
+
rules: e,
|
|
29
|
+
render: ({ field: p, fieldState: i }) => {
|
|
30
|
+
const d = !!i.error, o = p.value, h = o?.start ? u(o.start) ?? null : null, m = o?.end ? u(o.end) ?? null : null, k = h && m;
|
|
31
|
+
return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
32
|
+
Y,
|
|
34
33
|
{
|
|
35
|
-
label:
|
|
34
|
+
label: r.label,
|
|
36
35
|
...k && {
|
|
37
36
|
value: {
|
|
38
|
-
from:
|
|
39
|
-
to:
|
|
37
|
+
from: M(h, t),
|
|
38
|
+
to: M(m, t)
|
|
40
39
|
}
|
|
41
40
|
},
|
|
42
|
-
onChange: (
|
|
43
|
-
const w =
|
|
44
|
-
|
|
41
|
+
onChange: (a) => {
|
|
42
|
+
const w = a?.from?.startDate ? `${a.from.startDate.getFullYear()}-${String(a.from.startDate.getMonth() + 1).padStart(2, "0")}-${String(a.from.startDate.getDate()).padStart(2, "0")}` : null, F = a?.to?.endDate ? `${a.to.endDate.getFullYear()}-${String(a.to.endDate.getMonth() + 1).padStart(2, "0")}-${String(a.to.endDate.getDate()).padStart(2, "0")}` : null;
|
|
43
|
+
l.setValue(r.id, { start: w, end: F });
|
|
45
44
|
},
|
|
46
45
|
placeholder: t.placeholder,
|
|
47
|
-
startMonth:
|
|
48
|
-
endMonth:
|
|
49
|
-
required:
|
|
50
|
-
disabled:
|
|
46
|
+
startMonth: s ?? S,
|
|
47
|
+
endMonth: c ?? f,
|
|
48
|
+
required: r.isRequired,
|
|
49
|
+
disabled: D,
|
|
51
50
|
error: d,
|
|
52
|
-
helperText: d ?
|
|
53
|
-
|
|
51
|
+
helperText: d ? i.error?.message : r.helpText,
|
|
52
|
+
calendarKind: t.calendarKind,
|
|
54
53
|
fiscalMode: t.fiscalMode,
|
|
55
54
|
weekStartsOn: t.weekStartsOn,
|
|
56
|
-
minDate:
|
|
57
|
-
maxDate:
|
|
58
|
-
|
|
55
|
+
minDate: s,
|
|
56
|
+
maxDate: c,
|
|
57
|
+
granularity: t.granularity,
|
|
59
58
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
60
59
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
61
60
|
showFooter: t.showFooter,
|
|
@@ -67,5 +66,5 @@ const p = (e) => {
|
|
|
67
66
|
);
|
|
68
67
|
};
|
|
69
68
|
export {
|
|
70
|
-
|
|
69
|
+
T as WeekRangeField
|
|
71
70
|
};
|
|
@@ -1,68 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as c } from "react";
|
|
3
3
|
import { SetToEmptyWrapper as u } from "./SetToEmptyWrapper.js";
|
|
4
4
|
import { ObjectFieldRenderer as T } from "./ObjectFieldRenderer.js";
|
|
5
5
|
import { ArrayFieldRenderer as b } from "./ArrayFieldRenderer.js";
|
|
6
6
|
import { buildFieldPath as v } from "../utils/fieldPath.utils.js";
|
|
7
7
|
import { renderRegisteredField as E } from "../registry/resolveFieldComponent.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
R();
|
|
12
|
-
const g = ({
|
|
8
|
+
import { buildFieldValidationRules as R } from "../utils/buildFieldValidationRules.js";
|
|
9
|
+
import { buildEvaluateFieldValidationOptions as S } from "../utils/evaluateFieldValidation.js";
|
|
10
|
+
const $ = ({
|
|
13
11
|
field: e,
|
|
14
12
|
formHelpers: o,
|
|
15
13
|
isVisible: s,
|
|
16
|
-
disabled:
|
|
17
|
-
formConfig:
|
|
18
|
-
supportedValues:
|
|
14
|
+
disabled: a,
|
|
15
|
+
formConfig: n,
|
|
16
|
+
supportedValues: r,
|
|
19
17
|
fieldPathPrefix: i
|
|
20
18
|
}) => {
|
|
21
19
|
const t = c(
|
|
22
20
|
() => i ? { ...e, id: v(e.id, i) } : e,
|
|
23
21
|
[e, i]
|
|
24
|
-
),
|
|
22
|
+
), p = c(() => R(
|
|
25
23
|
t,
|
|
26
|
-
|
|
24
|
+
S(o, t.id)
|
|
27
25
|
), [t, o]);
|
|
28
26
|
if (!s)
|
|
29
27
|
return null;
|
|
30
28
|
if (e.fieldType === "object")
|
|
31
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ d(
|
|
32
30
|
T,
|
|
33
31
|
{
|
|
34
32
|
field: e,
|
|
35
33
|
fieldPathPrefix: i,
|
|
36
34
|
formHelpers: o,
|
|
37
|
-
formConfig:
|
|
38
|
-
supportedValues:
|
|
35
|
+
formConfig: n,
|
|
36
|
+
supportedValues: r
|
|
39
37
|
}
|
|
40
38
|
);
|
|
41
39
|
if (e.fieldType === "array")
|
|
42
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ d(
|
|
43
41
|
b,
|
|
44
42
|
{
|
|
45
43
|
field: e,
|
|
46
44
|
fieldPathPrefix: i,
|
|
47
45
|
formHelpers: o,
|
|
48
|
-
formConfig:
|
|
49
|
-
supportedValues:
|
|
46
|
+
formConfig: n,
|
|
47
|
+
supportedValues: r
|
|
50
48
|
}
|
|
51
49
|
);
|
|
52
|
-
const l = !!t.allowSetToEmpty && o.setToEmptyFields.has(t.id), y =
|
|
50
|
+
const l = !!t.allowSetToEmpty && o.setToEmptyFields.has(t.id), y = a || l, F = {
|
|
53
51
|
field: l ? { ...t, placeholder: "Set to empty" } : t,
|
|
54
52
|
formHelpers: o,
|
|
55
|
-
validationRules:
|
|
53
|
+
validationRules: p,
|
|
56
54
|
isDisabled: y,
|
|
57
|
-
formConfig:
|
|
58
|
-
supportedValues:
|
|
55
|
+
formConfig: n,
|
|
56
|
+
supportedValues: r
|
|
59
57
|
}, m = E(
|
|
60
58
|
e.fieldType,
|
|
61
59
|
F,
|
|
62
60
|
o.formContext?.customFieldTypes
|
|
63
61
|
);
|
|
64
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ d("div", { className: `col-span-${t.colSpan || 1}`, children: t.allowSetToEmpty ? /* @__PURE__ */ d(u, { fieldId: t.id, formHelpers: o, children: m }) : m });
|
|
65
63
|
};
|
|
66
64
|
export {
|
|
67
|
-
|
|
65
|
+
$ as FieldRenderer
|
|
68
66
|
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Register all 23 built-in field types. Safe to call multiple times — runs once.
|
|
3
|
+
*
|
|
4
|
+
* Consumers must call this at app startup (or use `registerFieldType` selectively)
|
|
5
|
+
* before rendering any `FieldRenderer` / `ReactHooksForm`.
|
|
6
|
+
*
|
|
7
|
+
* The `rich_text` field type requires optional peer deps: `lexical`, `@lexical/react`.
|
|
8
|
+
* If you don't need rich text, register fields selectively to avoid the dependency.
|
|
9
|
+
*/
|
|
2
10
|
export declare function registerDefaultFieldTypes(): void;
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import { lazy as t, createElement as r, Suspense as l } from "react";
|
|
2
1
|
import { registerFieldType as e } from "./fieldRegistry.js";
|
|
3
|
-
import { SelectField as
|
|
4
|
-
import { ButtonsGroupField as
|
|
5
|
-
import { RadioField as
|
|
6
|
-
import { TextField as
|
|
7
|
-
import { TextAreaField as
|
|
8
|
-
import { DateRangeField as
|
|
9
|
-
import { DateInputField as
|
|
10
|
-
import { WeekRangeField as
|
|
11
|
-
import { MonthRangeField as
|
|
12
|
-
import { MultiWeekPickerField as
|
|
13
|
-
import { MultiMonthPickerField as
|
|
14
|
-
import { FileUploadField as
|
|
15
|
-
import { FillFormByPasteField as
|
|
16
|
-
import { FillFormByFileUploadField as
|
|
17
|
-
import { ChipsField as
|
|
18
|
-
import { TextFieldWithBackendValidation as
|
|
19
|
-
import { SwitchField as
|
|
20
|
-
import { CheckboxField as
|
|
21
|
-
import { LabelField as
|
|
22
|
-
import { DividerField as
|
|
23
|
-
import { DividerWithLabelField as
|
|
24
|
-
import { NumericComboboxField as
|
|
25
|
-
import { SliderRangeField as
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}))
|
|
30
|
-
);
|
|
31
|
-
let o = !1;
|
|
32
|
-
function ie() {
|
|
33
|
-
o || (o = !0, e("divider", w), e("divider_with_label", v), e("label", T), e("select", m), e("button_group", d), e("radio", p), e("text", a), e("numeric_combobox", D), e("text_area", f), e("date", n), e("date_range", F), e("week_range", _), e("multi_week_picker", u), e("month_range", c), e("multi_month_picker", h), e("file_upload", s), e("fill_form_by_paste", b), e("fill_form_by_file_upload", x), e("chips", k), e("text_with_backend_validation", g), e("switch", y), e("checkbox", R), e("slider_range", B), e(
|
|
34
|
-
"rich_text",
|
|
35
|
-
(i) => r(l, { fallback: null }, r(M, i))
|
|
36
|
-
));
|
|
2
|
+
import { SelectField as r } from "../Fields/SelectField.js";
|
|
3
|
+
import { ButtonsGroupField as o } from "../Fields/ButtonsGroupField.js";
|
|
4
|
+
import { RadioField as t } from "../Fields/RadioField.js";
|
|
5
|
+
import { TextField as l } from "../Fields/TextField.js";
|
|
6
|
+
import { TextAreaField as m } from "../Fields/TextAreaField.js";
|
|
7
|
+
import { DateRangeField as d } from "../Fields/DateRangeField.js";
|
|
8
|
+
import { DateInputField as p } from "../Fields/DateInputField.js";
|
|
9
|
+
import { WeekRangeField as a } from "../Fields/WeekRangePicker.js";
|
|
10
|
+
import { MonthRangeField as f } from "../Fields/MonthRangeField.js";
|
|
11
|
+
import { MultiWeekPickerField as F } from "../Fields/MultiWeekPickerField.js";
|
|
12
|
+
import { MultiMonthPickerField as _ } from "../Fields/MultiMonthPickerField.js";
|
|
13
|
+
import { FileUploadField as n } from "../Fields/FileUploadField.js";
|
|
14
|
+
import { FillFormByPasteField as c } from "../Fields/FillFormByPasteField.js";
|
|
15
|
+
import { FillFormByFileUploadField as u } from "../Fields/FillFormByFileUploadField.js";
|
|
16
|
+
import { ChipsField as b } from "../Fields/ChipsField.js";
|
|
17
|
+
import { TextFieldWithBackendValidation as h } from "../Fields/TextFieldWithBackendValidation.js";
|
|
18
|
+
import { SwitchField as s } from "../Fields/SwitchField.js";
|
|
19
|
+
import { CheckboxField as g } from "../Fields/CheckboxField.js";
|
|
20
|
+
import { LabelField as k } from "../Fields/LabelField.js";
|
|
21
|
+
import { DividerField as x } from "../Fields/DividerField.js";
|
|
22
|
+
import { DividerWithLabelField as w } from "../Fields/DividerWithLabelField.js";
|
|
23
|
+
import { NumericComboboxField as y } from "../Fields/NumericComboboxField.js";
|
|
24
|
+
import { SliderRangeField as v } from "../Fields/SliderRangeField.js";
|
|
25
|
+
let i = !1;
|
|
26
|
+
function Q() {
|
|
27
|
+
i || (i = !0, e("divider", x), e("divider_with_label", w), e("label", k), e("select", r), e("button_group", o), e("radio", t), e("text", l), e("numeric_combobox", y), e("text_area", m), e("date", p), e("date_range", d), e("week_range", a), e("multi_week_picker", F), e("month_range", f), e("multi_month_picker", _), e("file_upload", n), e("fill_form_by_paste", c), e("fill_form_by_file_upload", u), e("chips", b), e("text_with_backend_validation", h), e("switch", s), e("checkbox", g), e("slider_range", v));
|
|
37
28
|
}
|
|
38
29
|
export {
|
|
39
|
-
|
|
30
|
+
Q as registerDefaultFieldTypes
|
|
40
31
|
};
|
|
@@ -2,8 +2,9 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { FieldType } from '../types/fields.types';
|
|
3
3
|
import { CustomFieldTypesMap, FormFieldProps } from '../types/reactHookForm.types';
|
|
4
4
|
/**
|
|
5
|
-
* Renders a
|
|
6
|
-
*
|
|
5
|
+
* Renders a registered field. Looks up from instance overrides first, then
|
|
6
|
+
* the global field registry populated by `registerDefaultFieldTypes()` or
|
|
7
|
+
* individual `registerFieldType()` calls.
|
|
7
8
|
*/
|
|
8
9
|
export declare function renderRegisteredField(fieldType: FieldType | string, commonProps: FormFieldProps, instanceOverrides?: CustomFieldTypesMap): ReactNode;
|
|
9
10
|
/** @deprecated Use {@link renderRegisteredField} — returns element, not component type. */
|
|
@@ -1,137 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { ChipsField as _ } from "../Fields/ChipsField.js";
|
|
7
|
-
import { DateInputField as s } from "../Fields/DateInputField.js";
|
|
8
|
-
import { DateRangeField as f } from "../Fields/DateRangeField.js";
|
|
9
|
-
import { DividerField as o } from "../Fields/DividerField.js";
|
|
10
|
-
import { DividerWithLabelField as F } from "../Fields/DividerWithLabelField.js";
|
|
11
|
-
import { FileUploadField as m } from "../Fields/FileUploadField.js";
|
|
12
|
-
import { FillFormByFileUploadField as b } from "../Fields/FillFormByFileUploadField.js";
|
|
13
|
-
import { FillFormByPasteField as h } from "../Fields/FillFormByPasteField.js";
|
|
14
|
-
import { LabelField as p } from "../Fields/LabelField.js";
|
|
15
|
-
import { MonthRangeField as k } from "../Fields/MonthRangeField.js";
|
|
16
|
-
import { MultiMonthPickerField as x } from "../Fields/MultiMonthPickerField.js";
|
|
17
|
-
import { MultiWeekPickerField as g } from "../Fields/MultiWeekPickerField.js";
|
|
18
|
-
import { NumericComboboxField as w } from "../Fields/NumericComboboxField.js";
|
|
19
|
-
import { RadioField as v } from "../Fields/RadioField.js";
|
|
20
|
-
import { SelectField as C } from "../Fields/SelectField.js";
|
|
21
|
-
import { SwitchField as R } from "../Fields/SwitchField.js";
|
|
22
|
-
import { TextAreaField as B } from "../Fields/TextAreaField.js";
|
|
23
|
-
import { TextField as D } from "../Fields/TextField.js";
|
|
24
|
-
import { TextFieldWithBackendValidation as M } from "../Fields/TextFieldWithBackendValidation.js";
|
|
25
|
-
import { WeekRangeField as W } from "../Fields/WeekRangePicker.js";
|
|
26
|
-
function re(t, e, i) {
|
|
27
|
-
const a = i?.[t];
|
|
28
|
-
if (a)
|
|
29
|
-
return u(a, e);
|
|
30
|
-
switch (t) {
|
|
31
|
-
case "divider":
|
|
32
|
-
return /* @__PURE__ */ r(o, { ...e });
|
|
33
|
-
case "divider_with_label":
|
|
34
|
-
return /* @__PURE__ */ r(F, { ...e });
|
|
35
|
-
case "label":
|
|
36
|
-
return /* @__PURE__ */ r(p, { ...e });
|
|
37
|
-
case "select":
|
|
38
|
-
return /* @__PURE__ */ r(C, { ...e });
|
|
39
|
-
case "button_group":
|
|
40
|
-
return /* @__PURE__ */ r(c, { ...e });
|
|
41
|
-
case "radio":
|
|
42
|
-
return /* @__PURE__ */ r(v, { ...e });
|
|
43
|
-
case "text":
|
|
44
|
-
return /* @__PURE__ */ r(D, { ...e });
|
|
45
|
-
case "numeric_combobox":
|
|
46
|
-
return /* @__PURE__ */ r(w, { ...e });
|
|
47
|
-
case "text_area":
|
|
48
|
-
return /* @__PURE__ */ r(B, { ...e });
|
|
49
|
-
case "date":
|
|
50
|
-
return /* @__PURE__ */ r(s, { ...e });
|
|
51
|
-
case "date_range":
|
|
52
|
-
return /* @__PURE__ */ r(f, { ...e });
|
|
53
|
-
case "week_range":
|
|
54
|
-
return /* @__PURE__ */ r(W, { ...e });
|
|
55
|
-
case "multi_week_picker":
|
|
56
|
-
return /* @__PURE__ */ r(g, { ...e });
|
|
57
|
-
case "month_range":
|
|
58
|
-
return /* @__PURE__ */ r(k, { ...e });
|
|
59
|
-
case "multi_month_picker":
|
|
60
|
-
return /* @__PURE__ */ r(x, { ...e });
|
|
61
|
-
case "file_upload":
|
|
62
|
-
return /* @__PURE__ */ r(m, { ...e });
|
|
63
|
-
case "fill_form_by_paste":
|
|
64
|
-
return /* @__PURE__ */ r(h, { ...e });
|
|
65
|
-
case "fill_form_by_file_upload":
|
|
66
|
-
return /* @__PURE__ */ r(b, { ...e });
|
|
67
|
-
case "chips":
|
|
68
|
-
return /* @__PURE__ */ r(_, { ...e });
|
|
69
|
-
case "text_with_backend_validation":
|
|
70
|
-
return /* @__PURE__ */ r(M, { ...e });
|
|
71
|
-
case "switch":
|
|
72
|
-
return /* @__PURE__ */ r(R, { ...e });
|
|
73
|
-
case "checkbox":
|
|
74
|
-
return /* @__PURE__ */ r(d, { ...e });
|
|
75
|
-
default: {
|
|
76
|
-
const l = n(t);
|
|
77
|
-
return l ? u(l, e) : null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
import { createElement as m } from "react";
|
|
2
|
+
import { getFieldComponent as t } from "./fieldRegistry.js";
|
|
3
|
+
function l(e, n, r) {
|
|
4
|
+
const o = r?.[e] ?? t(e);
|
|
5
|
+
return o ? m(o, n) : null;
|
|
80
6
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
if (i)
|
|
84
|
-
return i;
|
|
85
|
-
switch (t) {
|
|
86
|
-
case "divider":
|
|
87
|
-
return o;
|
|
88
|
-
case "divider_with_label":
|
|
89
|
-
return F;
|
|
90
|
-
case "label":
|
|
91
|
-
return p;
|
|
92
|
-
case "select":
|
|
93
|
-
return C;
|
|
94
|
-
case "button_group":
|
|
95
|
-
return c;
|
|
96
|
-
case "radio":
|
|
97
|
-
return v;
|
|
98
|
-
case "text":
|
|
99
|
-
return D;
|
|
100
|
-
case "numeric_combobox":
|
|
101
|
-
return w;
|
|
102
|
-
case "text_area":
|
|
103
|
-
return B;
|
|
104
|
-
case "date":
|
|
105
|
-
return s;
|
|
106
|
-
case "date_range":
|
|
107
|
-
return f;
|
|
108
|
-
case "week_range":
|
|
109
|
-
return W;
|
|
110
|
-
case "multi_week_picker":
|
|
111
|
-
return g;
|
|
112
|
-
case "month_range":
|
|
113
|
-
return k;
|
|
114
|
-
case "multi_month_picker":
|
|
115
|
-
return x;
|
|
116
|
-
case "file_upload":
|
|
117
|
-
return m;
|
|
118
|
-
case "fill_form_by_paste":
|
|
119
|
-
return h;
|
|
120
|
-
case "fill_form_by_file_upload":
|
|
121
|
-
return b;
|
|
122
|
-
case "chips":
|
|
123
|
-
return _;
|
|
124
|
-
case "text_with_backend_validation":
|
|
125
|
-
return M;
|
|
126
|
-
case "switch":
|
|
127
|
-
return R;
|
|
128
|
-
case "checkbox":
|
|
129
|
-
return d;
|
|
130
|
-
default:
|
|
131
|
-
return n(t);
|
|
132
|
-
}
|
|
7
|
+
function u(e, n) {
|
|
8
|
+
return n?.[e] ?? t(e);
|
|
133
9
|
}
|
|
134
10
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
11
|
+
l as renderRegisteredField,
|
|
12
|
+
u as resolveFieldComponent
|
|
137
13
|
};
|
|
@@ -157,6 +157,11 @@ export type DateInputField = BaseField & {
|
|
|
157
157
|
pastDateNotAllowed?: boolean;
|
|
158
158
|
dateValidationMessages?: DateInputValidationMessages;
|
|
159
159
|
showFooter?: boolean;
|
|
160
|
+
calendarKind?: "gregorian" | "fiscal";
|
|
161
|
+
fiscalMode?: "basic" | "advanced" | "custom";
|
|
162
|
+
fiscalYearStartMonth?: number;
|
|
163
|
+
fiscalMonthPattern?: number[];
|
|
164
|
+
showPresets?: boolean;
|
|
160
165
|
};
|
|
161
166
|
export type DateRangeField = BaseField & {
|
|
162
167
|
fieldType: "date_range";
|
|
@@ -182,6 +187,11 @@ export type DateRangeField = BaseField & {
|
|
|
182
187
|
startMonth?: string;
|
|
183
188
|
/** ISO date string — last month shown in picker navigation */
|
|
184
189
|
endMonth?: string;
|
|
190
|
+
calendarKind?: "gregorian" | "fiscal";
|
|
191
|
+
fiscalMode?: "basic" | "advanced" | "custom";
|
|
192
|
+
fiscalYearStartMonth?: number;
|
|
193
|
+
fiscalMonthPattern?: number[];
|
|
194
|
+
showPresets?: boolean;
|
|
185
195
|
};
|
|
186
196
|
export type WeekRangeField = BaseField & {
|
|
187
197
|
fieldType: "week_range";
|
|
@@ -199,10 +209,10 @@ export type WeekRangeField = BaseField & {
|
|
|
199
209
|
start: string;
|
|
200
210
|
end: string;
|
|
201
211
|
};
|
|
202
|
-
|
|
212
|
+
calendarKind?: "gregorian" | "fiscal";
|
|
203
213
|
fiscalMode?: "basic" | "advanced" | "custom";
|
|
204
214
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
205
|
-
|
|
215
|
+
granularity?: "day" | "week" | "period" | "quarter" | "year";
|
|
206
216
|
fiscalMonthPattern?: number[];
|
|
207
217
|
fiscalYearStartMonth?: number;
|
|
208
218
|
showFooter?: boolean;
|
|
@@ -217,10 +227,10 @@ export type MultiWeekRangeField = BaseField & {
|
|
|
217
227
|
fieldType: "multi_week_picker";
|
|
218
228
|
minDate?: string;
|
|
219
229
|
maxDate?: string;
|
|
220
|
-
|
|
230
|
+
calendarKind?: "gregorian" | "fiscal";
|
|
221
231
|
fiscalMode?: "basic" | "advanced" | "custom";
|
|
222
232
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
223
|
-
|
|
233
|
+
granularity?: "day" | "week" | "period" | "quarter" | "year";
|
|
224
234
|
fiscalMonthPattern?: number[];
|
|
225
235
|
};
|
|
226
236
|
export type MonthRangeField = BaseField & {
|
|
@@ -245,6 +255,11 @@ export type MonthRangeField = BaseField & {
|
|
|
245
255
|
value: string;
|
|
246
256
|
}>;
|
|
247
257
|
isOutsideRange?: (month: Date) => boolean;
|
|
258
|
+
calendarKind?: "gregorian" | "fiscal";
|
|
259
|
+
fiscalMode?: "basic" | "advanced" | "custom";
|
|
260
|
+
fiscalYearStartMonth?: number;
|
|
261
|
+
fiscalMonthPattern?: number[];
|
|
262
|
+
showPresets?: boolean;
|
|
248
263
|
};
|
|
249
264
|
export type MultiMonthPickerField = BaseField & {
|
|
250
265
|
fieldType: "multi_month_picker";
|
|
@@ -272,6 +287,12 @@ export type TextField = BaseField & {
|
|
|
272
287
|
defaultValue?: string | number;
|
|
273
288
|
nonNegative?: boolean;
|
|
274
289
|
allowDecimal?: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* When false (default), only letters, numbers, and spaces are kept.
|
|
292
|
+
* Set true to allow punctuation and symbols. `email` / `password` /
|
|
293
|
+
* `url` / `tel` types allow special characters unless this is false.
|
|
294
|
+
*/
|
|
295
|
+
allowSpecialCharacters?: boolean;
|
|
275
296
|
/**
|
|
276
297
|
* Reactively override `nonNegative` based on a flag on the currently
|
|
277
298
|
* selected option of another (select) field. Only meaningful when
|
|
@@ -19,7 +19,7 @@ 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" | "
|
|
22
|
+
type WeekRangeBoundsField = Pick<WeekRangeField, "minDate" | "maxDate" | "minStartOffsetDays" | "disablePastWeeks" | "minWeeksOffset" | "maxWeeksOffset" | "startMonth" | "endMonth" | "calendarKind" | "fiscalMode" | "granularity" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "weekStartsOn">;
|
|
23
23
|
export declare const handleMinMaxProp: (dateRangeField: DateRangeField) => {
|
|
24
24
|
minDate: Date | undefined;
|
|
25
25
|
maxDate: Date | undefined;
|