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.
Files changed (159) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +2 -2
  2. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
  3. package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
  4. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
  5. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
  7. package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
  8. package/dist/components/data-display/calendar/calendar-config.js +31 -20
  9. package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
  10. package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
  11. package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
  12. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
  13. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
  14. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
  15. package/dist/components/data-display/calendar/calendar-day-picker-components.js +196 -102
  16. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
  17. package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
  18. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
  19. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
  20. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +16 -0
  21. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +41 -0
  22. package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
  23. package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
  24. package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
  25. package/dist/components/data-display/calendar/calendar-footer.js +88 -66
  26. package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
  27. package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
  28. package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
  29. package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
  30. package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
  31. package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
  32. package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
  33. package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
  34. package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
  35. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
  36. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
  37. package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
  38. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
  39. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
  40. package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
  41. package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
  42. package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
  43. package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
  44. package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
  45. package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
  46. package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
  47. package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
  48. package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
  49. package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
  50. package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
  51. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
  52. package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
  53. package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
  54. package/dist/components/data-display/calendar/calendar-selection.js +31 -0
  55. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
  56. package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
  57. package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
  58. package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
  59. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
  60. package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
  61. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
  62. package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
  63. package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
  64. package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
  65. package/dist/components/data-display/calendar/calendar.d.ts +1 -1
  66. package/dist/components/data-display/calendar/calendar.js +303 -181
  67. package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
  68. package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
  69. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
  70. package/dist/components/data-display/calendar/index.d.ts +1 -1
  71. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
  72. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
  73. package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
  74. package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
  75. package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
  76. package/dist/components/data-display/calendar/use-fiscal-calendar.js +25 -0
  77. package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
  78. package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
  79. package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
  80. package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
  81. package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
  82. package/dist/components/forms/date-picker/date-picker.js +187 -167
  83. package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
  84. package/dist/components/forms/date-picker/date-range-picker.js +273 -224
  85. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
  86. package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
  87. package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
  88. package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
  89. package/dist/components/forms/date-picker/index.d.ts +12 -0
  90. package/dist/components/forms/date-picker/index.js +19 -7
  91. package/dist/components/forms/date-picker/month-picker.js +225 -182
  92. package/dist/components/forms/date-picker/month-range-picker.js +134 -110
  93. package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
  94. package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
  95. package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
  96. package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
  97. package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
  98. package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
  99. package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
  100. package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
  101. package/dist/components/forms/date-picker/quarter-picker.js +176 -0
  102. package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
  103. package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
  104. package/dist/components/forms/date-picker/week-picker.js +148 -137
  105. package/dist/components/forms/date-picker/week-range-picker.js +216 -205
  106. package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
  107. package/dist/components/forms/date-picker/year-picker.js +176 -0
  108. package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
  109. package/dist/components/forms/date-picker/year-range-picker.js +179 -0
  110. package/dist/components/forms/smart-input/smart-input.js +106 -85
  111. package/dist/components/forms/smart-input/smart-input.types.d.ts +5 -0
  112. package/dist/components/forms/textarea/textarea.js +29 -28
  113. package/dist/components/forms/textarea/textarea.types.d.ts +1 -0
  114. package/dist/form-react/Fields/DateInputField.js +63 -58
  115. package/dist/form-react/Fields/DateRangeField.js +42 -37
  116. package/dist/form-react/Fields/MonthRangeField.js +50 -45
  117. package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
  118. package/dist/form-react/Fields/TextField.js +25 -24
  119. package/dist/form-react/Fields/WeekRangePicker.js +44 -45
  120. package/dist/form-react/components/FieldRenderer.js +21 -23
  121. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
  122. package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
  123. package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
  124. package/dist/form-react/registry/resolveFieldComponent.js +9 -133
  125. package/dist/form-react/types/fields.types.d.ts +25 -4
  126. package/dist/form-react/utils/date.utils.d.ts +1 -1
  127. package/dist/form-react/utils/date.utils.js +38 -38
  128. package/dist/i18n/defaultMessages.d.ts +19 -1
  129. package/dist/i18n/defaultMessages.js +37 -20
  130. package/dist/i18n/locales/de.js +18 -1
  131. package/dist/i18n/locales/es.js +18 -1
  132. package/dist/i18n/locales/hi.js +18 -1
  133. package/dist/i18n/locales/kn.js +18 -1
  134. package/dist/impact-nova-components.css +379 -3
  135. package/dist/impact-nova.css +1 -1
  136. package/dist/index.js +528 -516
  137. package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
  138. package/dist/lib/fiscal-calendar/build-year.js +173 -0
  139. package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
  140. package/dist/lib/fiscal-calendar/civil-date.js +94 -0
  141. package/dist/lib/fiscal-calendar/index.d.ts +10 -0
  142. package/dist/lib/fiscal-calendar/index.js +40 -0
  143. package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
  144. package/dist/lib/fiscal-calendar/lookup.js +70 -0
  145. package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
  146. package/dist/lib/fiscal-calendar/presets.js +99 -0
  147. package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
  148. package/dist/lib/fiscal-calendar/selection.js +32 -0
  149. package/dist/lib/fiscal-calendar/types.d.ts +145 -0
  150. package/dist/lib/fiscal-calendar/types.js +10 -0
  151. package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
  152. package/dist/lib/fiscal-calendar/week-selection.js +107 -0
  153. package/dist/llms/rules/best-practices.js +1 -1
  154. package/dist/llms/rules/installation.js +1 -1
  155. package/dist/llms/rules/real-world-patterns.js +1 -1
  156. package/dist/llms/rules/requirements.js +1 -1
  157. package/package.json +5 -1
  158. package/dist/lib/fiscal-calendar.d.ts +0 -62
  159. 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 y, useEffect as b } from "react";
3
- import { useWatch as V, Controller as w } from "react-hook-form";
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 d } from "../utils/optionFlag.js";
6
- const T = ({
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 a = e.fieldType === "text" ? e : null, n = a?.allowNegativeDependency, l = !!n, c = !!a?.nonNegative, p = V({
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: n?.fieldId ?? "",
14
+ name: o?.fieldId ?? "",
15
15
  disabled: !l
16
- }), f = !c || l && d(
17
- r.form.getValues(n.fieldId),
18
- n.optionFlag
19
- ), s = y(!0);
20
- return b(() => {
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, p, e.id, r.form]), a ? /* @__PURE__ */ m(
29
- w,
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 o = u.validate(
37
+ const a = u.validate(
38
38
  t,
39
39
  r.form.getValues()
40
40
  );
41
- if (o !== !0) return o;
41
+ if (a !== !0) return a;
42
42
  }
43
- return c && l && !d(
44
- r.form.getValues(n.fieldId),
45
- n.optionFlag
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: o }) => {
50
- const g = !!o.error, h = t.value;
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: a.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 ? o?.error?.message : e?.helpText,
64
+ helperText: g ? a?.error?.message : e?.helpText,
65
65
  allowNegative: f,
66
- allowDecimal: a.allowDecimal ?? !0
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
- T as TextField
75
+ I as TextField
75
76
  };
@@ -1,61 +1,60 @@
1
- import { jsx as D } from "react/jsx-runtime";
2
- import { Controller as F } from "react-hook-form";
3
- import { WeekRangePicker as O } from "../../components/forms/date-picker/week-range-picker.js";
4
- import { toLocalDate as M } from "../utils/calendar-boundary.js";
5
- import { resolveWeekRangeMinMax as x } from "../utils/date.utils.js";
6
- const p = (e) => {
7
- const r = e.getFullYear(), n = e.getMonth(), t = new Date(r, n, 1).getDay(), a = e.getDate(), l = Math.ceil((a + t) / 7), s = new Date(e), h = new Date(s);
8
- return {
9
- year: r,
10
- month: n,
11
- weekOfMonth: l,
12
- startDate: s,
13
- endDate: h
14
- };
15
- }, b = ({
16
- field: e,
17
- validationRules: r,
18
- isDisabled: n,
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 = e.fieldType === "week_range" ? e : null;
20
+ const t = r.fieldType === "week_range" ? r : null;
22
21
  if (!t) return null;
23
- const { minDate: a, maxDate: l, startMonth: s, endMonth: h } = x(t), g = i.form.control;
24
- return /* @__PURE__ */ D(
25
- F,
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: e.id,
26
+ name: r.id,
28
27
  control: g,
29
- rules: r,
30
- render: ({ field: S, fieldState: m }) => {
31
- const d = !!m.error, c = S.value, f = c?.start ? M(c.start) ?? null : null, u = c?.end ? M(c.end) ?? null : null, k = f && u;
32
- return /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(
33
- O,
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: e.label,
34
+ label: r.label,
36
35
  ...k && {
37
36
  value: {
38
- from: p(f),
39
- to: p(u)
37
+ from: M(h, t),
38
+ to: M(m, t)
40
39
  }
41
40
  },
42
- onChange: (o) => {
43
- const w = o?.from?.startDate ? `${o.from.startDate.getFullYear()}-${String(o.from.startDate.getMonth() + 1).padStart(2, "0")}-${String(o.from.startDate.getDate()).padStart(2, "0")}` : null, y = o?.to?.endDate ? `${o.to.endDate.getFullYear()}-${String(o.to.endDate.getMonth() + 1).padStart(2, "0")}-${String(o.to.endDate.getDate()).padStart(2, "0")}` : null;
44
- i.setValue(e.id, { start: w, end: y });
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: a ?? s,
48
- endMonth: l ?? h,
49
- required: e.isRequired,
50
- disabled: n,
46
+ startMonth: s ?? S,
47
+ endMonth: c ?? f,
48
+ required: r.isRequired,
49
+ disabled: D,
51
50
  error: d,
52
- helperText: d ? m.error?.message : e.helpText,
53
- calendarType: t.calendarType,
51
+ helperText: d ? i.error?.message : r.helpText,
52
+ calendarKind: t.calendarKind,
54
53
  fiscalMode: t.fiscalMode,
55
54
  weekStartsOn: t.weekStartsOn,
56
- minDate: a,
57
- maxDate: l,
58
- selectionMode: t.selectionMode,
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
- b as WeekRangeField
69
+ T as WeekRangeField
71
70
  };
@@ -1,68 +1,66 @@
1
- import { jsx as r } from "react/jsx-runtime";
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 { registerDefaultFieldTypes as R } from "../registry/defaultFieldRegistrations.js";
9
- import { buildFieldValidationRules as S } from "../utils/buildFieldValidationRules.js";
10
- import { buildEvaluateFieldValidationOptions as j } from "../utils/evaluateFieldValidation.js";
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: p,
17
- formConfig: d,
18
- supportedValues: n,
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
- ), a = c(() => S(
22
+ ), p = c(() => R(
25
23
  t,
26
- j(o, t.id)
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__ */ r(
29
+ return /* @__PURE__ */ d(
32
30
  T,
33
31
  {
34
32
  field: e,
35
33
  fieldPathPrefix: i,
36
34
  formHelpers: o,
37
- formConfig: d,
38
- supportedValues: n
35
+ formConfig: n,
36
+ supportedValues: r
39
37
  }
40
38
  );
41
39
  if (e.fieldType === "array")
42
- return /* @__PURE__ */ r(
40
+ return /* @__PURE__ */ d(
43
41
  b,
44
42
  {
45
43
  field: e,
46
44
  fieldPathPrefix: i,
47
45
  formHelpers: o,
48
- formConfig: d,
49
- supportedValues: n
46
+ formConfig: n,
47
+ supportedValues: r
50
48
  }
51
49
  );
52
- const l = !!t.allowSetToEmpty && o.setToEmptyFields.has(t.id), y = p || l, F = {
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: a,
53
+ validationRules: p,
56
54
  isDisabled: y,
57
- formConfig: d,
58
- supportedValues: n
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__ */ r("div", { className: `col-span-${t.colSpan || 1}`, children: t.allowSetToEmpty ? /* @__PURE__ */ r(u, { fieldId: t.id, formHelpers: o, children: m }) : m });
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
- g as FieldRenderer
65
+ $ as FieldRenderer
68
66
  };
@@ -1,2 +1,10 @@
1
- /** Register all 23 built-in field types. Safe to call multiple times — runs once. */
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 m } from "../Fields/SelectField.js";
4
- import { ButtonsGroupField as d } from "../Fields/ButtonsGroupField.js";
5
- import { RadioField as p } from "../Fields/RadioField.js";
6
- import { TextField as a } from "../Fields/TextField.js";
7
- import { TextAreaField as f } from "../Fields/TextAreaField.js";
8
- import { DateRangeField as F } from "../Fields/DateRangeField.js";
9
- import { DateInputField as n } from "../Fields/DateInputField.js";
10
- import { WeekRangeField as _ } from "../Fields/WeekRangePicker.js";
11
- import { MonthRangeField as c } from "../Fields/MonthRangeField.js";
12
- import { MultiWeekPickerField as u } from "../Fields/MultiWeekPickerField.js";
13
- import { MultiMonthPickerField as h } from "../Fields/MultiMonthPickerField.js";
14
- import { FileUploadField as s } from "../Fields/FileUploadField.js";
15
- import { FillFormByPasteField as b } from "../Fields/FillFormByPasteField.js";
16
- import { FillFormByFileUploadField as x } from "../Fields/FillFormByFileUploadField.js";
17
- import { ChipsField as k } from "../Fields/ChipsField.js";
18
- import { TextFieldWithBackendValidation as g } from "../Fields/TextFieldWithBackendValidation.js";
19
- import { SwitchField as y } from "../Fields/SwitchField.js";
20
- import { CheckboxField as R } from "../Fields/CheckboxField.js";
21
- import { LabelField as T } from "../Fields/LabelField.js";
22
- import { DividerField as w } from "../Fields/DividerField.js";
23
- import { DividerWithLabelField as v } from "../Fields/DividerWithLabelField.js";
24
- import { NumericComboboxField as D } from "../Fields/NumericComboboxField.js";
25
- import { SliderRangeField as B } from "../Fields/SliderRangeField.js";
26
- const M = t(
27
- () => import("../Fields/RichTextField.js").then((i) => ({
28
- default: i.RichTextField
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
- ie as registerDefaultFieldTypes
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 built-in or registered field. Module-level switch keeps static analysis happy.
6
- * Custom instance overrides and late-registered types use createElement.
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 { jsx as r } from "react/jsx-runtime";
2
- import { createElement as u } from "react";
3
- import { getFieldComponent as n } from "./fieldRegistry.js";
4
- import { ButtonsGroupField as c } from "../Fields/ButtonsGroupField.js";
5
- import { CheckboxField as d } from "../Fields/CheckboxField.js";
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 te(t, e) {
82
- const i = e?.[t];
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
- re as renderRegisteredField,
136
- te as resolveFieldComponent
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
- calendarType?: "fiscal" | "calendar";
212
+ calendarKind?: "gregorian" | "fiscal";
203
213
  fiscalMode?: "basic" | "advanced" | "custom";
204
214
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
205
- selectionMode?: "week" | "fiscalMonth";
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
- calendarType?: "fiscal" | "calendar";
230
+ calendarKind?: "gregorian" | "fiscal";
221
231
  fiscalMode?: "basic" | "advanced" | "custom";
222
232
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
223
- selectionMode?: "week" | "fiscalMonth";
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" | "calendarType" | "fiscalMode" | "selectionMode" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "weekStartsOn">;
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;