impact-nova 2.5.4 → 2.5.6

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 (39) hide show
  1. package/dist/components/data/ag-grid-react/index.js +64 -64
  2. package/dist/components/data/data-table/data-table-column-state.d.ts +7 -0
  3. package/dist/components/data/data-table/data-table-column-state.js +48 -23
  4. package/dist/form-engine/field-dependency-graph.d.ts +1 -4
  5. package/dist/form-engine/field-dependency-graph.js +53 -57
  6. package/dist/form-engine/field-groups.d.ts +15 -0
  7. package/dist/form-engine/field-groups.js +60 -0
  8. package/dist/form-engine/index.d.ts +3 -2
  9. package/dist/form-engine/index.js +17 -14
  10. package/dist/form-engine/types.d.ts +17 -0
  11. package/dist/form-react/Fields/RichTextField.d.ts +3 -0
  12. package/dist/form-react/Fields/RichTextField.js +214 -0
  13. package/dist/form-react/Fields/SelectField.js +27 -28
  14. package/dist/form-react/Fields/SliderRangeField.d.ts +3 -0
  15. package/dist/form-react/Fields/SliderRangeField.js +69 -0
  16. package/dist/form-react/ReactHooksForm.js +149 -87
  17. package/dist/form-react/fields.d.ts +2 -0
  18. package/dist/form-react/fields.js +22 -18
  19. package/dist/form-react/hooks/useCascadingForm.d.ts +1 -2
  20. package/dist/form-react/hooks/useCascadingForm.js +59 -67
  21. package/dist/form-react/hooks/useFieldVisibility.d.ts +1 -2
  22. package/dist/form-react/hooks/useFieldVisibility.js +36 -43
  23. package/dist/form-react/hooks/useFormSteps.d.ts +29 -0
  24. package/dist/form-react/hooks/useFormSteps.js +96 -0
  25. package/dist/form-react/hooks/useReactHookForm.js +17 -18
  26. package/dist/form-react/hooks/useSelectOptions.d.ts +1 -1
  27. package/dist/form-react/hooks/useSelectOptions.js +80 -83
  28. package/dist/form-react/index.d.ts +5 -3
  29. package/dist/form-react/index.js +93 -88
  30. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
  31. package/dist/form-react/registry/defaultFieldRegistrations.js +11 -9
  32. package/dist/form-react/types/fields.types.d.ts +31 -12
  33. package/dist/form-react/types/fieldsOutput.types.d.ts +5 -1
  34. package/dist/form-react/types/reactHookForm.types.d.ts +31 -2
  35. package/dist/form-react/utils/fieldDefaults.utils.js +28 -13
  36. package/dist/impact-nova.css +1 -1
  37. package/dist/llms/rules/installation.js +1 -1
  38. package/dist/llms/rules/requirements.js +1 -1
  39. package/package.json +17 -2
@@ -1,97 +1,102 @@
1
1
  import { ReactHooksForm as r, ReactHooksForm as t } from "./ReactHooksForm.js";
2
- import { useReactHookForm as l } from "./hooks/useReactHookForm.js";
2
+ import { useReactHookForm as i } from "./hooks/useReactHookForm.js";
3
3
  import { useFieldVisibility as d } from "./hooks/useFieldVisibility.js";
4
4
  import { useCascadingForm as m } from "./hooks/useCascadingForm.js";
5
- import { useSelectOptions as p } from "./hooks/useSelectOptions.js";
6
- import { useFillFormByPaste as n } from "./hooks/useFillFormByPaste.js";
7
- import { useFillFormByFileUpload as c } from "./hooks/useFillFormByFileUpload.js";
8
- import { FieldRenderer as b } from "./components/FieldRenderer.js";
9
- import { FormFieldRow as y } from "./components/FormFieldRow.js";
10
- import { ObjectFieldRenderer as g } from "./components/ObjectFieldRenderer.js";
11
- import { ArrayFieldRenderer as h } from "./components/ArrayFieldRenderer.js";
12
- import { SetToEmptyWrapper as S } from "./components/SetToEmptyWrapper.js";
13
- import { FormFileUploadWrapper as v } from "./components/FormFileUploadWrapper.js";
14
- import { getFieldComponent as E, hasRegisteredFieldType as P, listRegisteredFieldTypes as W, registerFieldType as k } from "./registry/fieldRegistry.js";
15
- import { registerDefaultFieldTypes as B } from "./registry/defaultFieldRegistrations.js";
16
- import { renderRegisteredField as K, resolveFieldComponent as M } from "./registry/resolveFieldComponent.js";
17
- import { isEmptyValue as w } from "../form-engine/is-empty-value.js";
18
- import { buildCascadeParentFormState as U, collectFieldDependencyIds as j, collectFilterSidebarWatchFieldIds as A, collectFormWatchFieldIds as L, collectSectionWatchFieldIds as N, collectVisibleFieldIds as Q, computeIsCascadingDisabled as Y, computeIsFieldDisabled as G, computeIsFieldVisible as J, getDependentFieldIds as X, hasVisibleFieldErrors as Z } from "../form-engine/field-dependency-graph.js";
19
- import { getFieldDefaultValue as $ } from "./utils/fieldDefaults.utils.js";
20
- import { batchSetFormFieldValues as oe } from "./utils/batchFormFieldUpdates.js";
21
- import { serializeFormStateForQueryKey as te } from "./utils/serializeFormStateForQueryKey.js";
22
- import { buildFormValidationToastMessage as le, focusFirstFormValidationError as ae, showFormValidationFailureFeedback as de } from "./utils/formValidationFeedback.utils.js";
23
- import { buildFieldValidationRules as me, isFieldValueValid as Fe } from "./utils/buildFieldValidationRules.js";
24
- import { buildEvaluateFieldValidationOptions as fe, evaluateFieldValidation as ne, fieldNeedsValidationRules as ue } from "./utils/evaluateFieldValidation.js";
25
- import { evaluateVisibleRequiredFormFields as xe, validateVisibleRequiredFormFields as be } from "./utils/validateVisibleRequiredFormFields.js";
26
- import { resolveFormSubmittable as ye } from "./utils/resolveFormSubmittable.js";
27
- import { buildParentCascadeKey as ge, buildSelectRemountKey as Ie } from "./utils/buildSelectRemountKey.js";
28
- import { runFieldValidation as De } from "./utils/validationUtils.js";
29
- import { buildFieldPath as Ce, findFieldByPath as ve, flattenFieldIds as Te } from "./utils/fieldPath.utils.js";
30
- import { stableSerialize as Pe } from "./utils/stableSerialize.js";
31
- import { toCascadedFilterValues as ke } from "./utils/select-option-filter-values.js";
32
- import { formatYmd as Be, toLocalDate as He } from "./utils/calendar-boundary.js";
33
- import { handleDateFnsFormat as Me, startOfDayDate as qe } from "./utils/date.utils.js";
34
- import { buildRangeIncompleteMessage as ze, isRangeIncompleteValidationMessage as Ue } from "./utils/fieldRangeValidation.utils.js";
5
+ import { useFormSteps as p } from "./hooks/useFormSteps.js";
6
+ import { useSelectOptions as u } from "./hooks/useSelectOptions.js";
7
+ import { useFillFormByPaste as x } from "./hooks/useFillFormByPaste.js";
8
+ import { useFillFormByFileUpload as b } from "./hooks/useFillFormByFileUpload.js";
9
+ import { FieldRenderer as y } from "./components/FieldRenderer.js";
10
+ import { FormFieldRow as g } from "./components/FormFieldRow.js";
11
+ import { ObjectFieldRenderer as I } from "./components/ObjectFieldRenderer.js";
12
+ import { ArrayFieldRenderer as D } from "./components/ArrayFieldRenderer.js";
13
+ import { SetToEmptyWrapper as v } from "./components/SetToEmptyWrapper.js";
14
+ import { FormFileUploadWrapper as E } from "./components/FormFileUploadWrapper.js";
15
+ import { getFieldComponent as W, hasRegisteredFieldType as k, listRegisteredFieldTypes as O, registerFieldType as B } from "./registry/fieldRegistry.js";
16
+ import { registerDefaultFieldTypes as K } from "./registry/defaultFieldRegistrations.js";
17
+ import { renderRegisteredField as q, resolveFieldComponent as w } from "./registry/resolveFieldComponent.js";
18
+ import { isEmptyValue as U } from "../form-engine/is-empty-value.js";
19
+ import { buildCascadeParentFormState as A, collectFieldDependencyIds as G, collectFilterSidebarWatchFieldIds as L, collectFormWatchFieldIds as N, collectSectionWatchFieldIds as Q, collectVisibleFieldIds as Y, computeIsFieldDisabled as J, computeIsFieldVisible as X, getDependentFieldIds as Z, hasVisibleFieldErrors as _ } from "../form-engine/field-dependency-graph.js";
20
+ import { buildFieldGroups as ee, getFirstIncompleteStep as oe, isStepComplete as re } from "../form-engine/field-groups.js";
21
+ import { getFieldDefaultValue as le } from "./utils/fieldDefaults.utils.js";
22
+ import { batchSetFormFieldValues as ae } from "./utils/batchFormFieldUpdates.js";
23
+ import { serializeFormStateForQueryKey as se } from "./utils/serializeFormStateForQueryKey.js";
24
+ import { buildFormValidationToastMessage as Fe, focusFirstFormValidationError as pe, showFormValidationFailureFeedback as fe } from "./utils/formValidationFeedback.utils.js";
25
+ import { buildFieldValidationRules as ne, isFieldValueValid as xe } from "./utils/buildFieldValidationRules.js";
26
+ import { buildEvaluateFieldValidationOptions as be, evaluateFieldValidation as Ve, fieldNeedsValidationRules as ye } from "./utils/evaluateFieldValidation.js";
27
+ import { evaluateVisibleRequiredFormFields as ge, validateVisibleRequiredFormFields as Se } from "./utils/validateVisibleRequiredFormFields.js";
28
+ import { resolveFormSubmittable as he } from "./utils/resolveFormSubmittable.js";
29
+ import { buildParentCascadeKey as Ce, buildSelectRemountKey as ve } from "./utils/buildSelectRemountKey.js";
30
+ import { runFieldValidation as Ee } from "./utils/validationUtils.js";
31
+ import { buildFieldPath as We, findFieldByPath as ke, flattenFieldIds as Oe } from "./utils/fieldPath.utils.js";
32
+ import { stableSerialize as He } from "./utils/stableSerialize.js";
33
+ import { toCascadedFilterValues as Me } from "./utils/select-option-filter-values.js";
34
+ import { formatYmd as we, toLocalDate as ze } from "./utils/calendar-boundary.js";
35
+ import { handleDateFnsFormat as je, startOfDayDate as Ae } from "./utils/date.utils.js";
36
+ import { buildRangeIncompleteMessage as Le, isRangeIncompleteValidationMessage as Ne } from "./utils/fieldRangeValidation.utils.js";
35
37
  export {
36
- h as ArrayFieldRenderer,
37
- b as FieldRenderer,
38
- y as FormFieldRow,
39
- v as FormFileUploadWrapper,
40
- g as ObjectFieldRenderer,
38
+ D as ArrayFieldRenderer,
39
+ y as FieldRenderer,
40
+ g as FormFieldRow,
41
+ E as FormFileUploadWrapper,
42
+ I as ObjectFieldRenderer,
41
43
  r as ReactHooksForm,
42
- S as SetToEmptyWrapper,
43
- oe as batchSetFormFieldValues,
44
- U as buildCascadeParentFormState,
45
- fe as buildEvaluateFieldValidationOptions,
46
- Ce as buildFieldPath,
47
- me as buildFieldValidationRules,
48
- le as buildFormValidationToastMessage,
49
- ge as buildParentCascadeKey,
50
- ze as buildRangeIncompleteMessage,
51
- Ie as buildSelectRemountKey,
52
- j as collectFieldDependencyIds,
53
- A as collectFilterSidebarWatchFieldIds,
54
- L as collectFormWatchFieldIds,
55
- N as collectSectionWatchFieldIds,
56
- Q as collectVisibleFieldIds,
57
- Y as computeIsCascadingDisabled,
58
- G as computeIsFieldDisabled,
59
- J as computeIsFieldVisible,
44
+ v as SetToEmptyWrapper,
45
+ ae as batchSetFormFieldValues,
46
+ A as buildCascadeParentFormState,
47
+ be as buildEvaluateFieldValidationOptions,
48
+ ee as buildFieldGroups,
49
+ We as buildFieldPath,
50
+ ne as buildFieldValidationRules,
51
+ Fe as buildFormValidationToastMessage,
52
+ Ce as buildParentCascadeKey,
53
+ Le as buildRangeIncompleteMessage,
54
+ ve as buildSelectRemountKey,
55
+ G as collectFieldDependencyIds,
56
+ L as collectFilterSidebarWatchFieldIds,
57
+ N as collectFormWatchFieldIds,
58
+ Q as collectSectionWatchFieldIds,
59
+ Y as collectVisibleFieldIds,
60
+ J as computeIsFieldDisabled,
61
+ X as computeIsFieldVisible,
60
62
  t as default,
61
- ne as evaluateFieldValidation,
62
- xe as evaluateVisibleRequiredFormFields,
63
- ue as fieldNeedsValidationRules,
64
- ve as findFieldByPath,
65
- Te as flattenFieldIds,
66
- ae as focusFirstFormValidationError,
67
- Be as formatYmd,
68
- X as getDependentFieldIds,
69
- E as getFieldComponent,
70
- $ as getFieldDefaultValue,
71
- Me as handleDateFnsFormat,
72
- P as hasRegisteredFieldType,
73
- Z as hasVisibleFieldErrors,
74
- w as isEmptyValue,
75
- Fe as isFieldValueValid,
76
- Ue as isRangeIncompleteValidationMessage,
77
- W as listRegisteredFieldTypes,
78
- B as registerDefaultFieldTypes,
79
- k as registerFieldType,
80
- K as renderRegisteredField,
81
- M as resolveFieldComponent,
82
- ye as resolveFormSubmittable,
83
- De as runFieldValidation,
84
- te as serializeFormStateForQueryKey,
85
- de as showFormValidationFailureFeedback,
86
- Pe as stableSerialize,
87
- qe as startOfDayDate,
88
- ke as toCascadedFilterValues,
89
- He as toLocalDate,
63
+ Ve as evaluateFieldValidation,
64
+ ge as evaluateVisibleRequiredFormFields,
65
+ ye as fieldNeedsValidationRules,
66
+ ke as findFieldByPath,
67
+ Oe as flattenFieldIds,
68
+ pe as focusFirstFormValidationError,
69
+ we as formatYmd,
70
+ Z as getDependentFieldIds,
71
+ W as getFieldComponent,
72
+ le as getFieldDefaultValue,
73
+ oe as getFirstIncompleteStep,
74
+ je as handleDateFnsFormat,
75
+ k as hasRegisteredFieldType,
76
+ _ as hasVisibleFieldErrors,
77
+ U as isEmptyValue,
78
+ xe as isFieldValueValid,
79
+ Ne as isRangeIncompleteValidationMessage,
80
+ re as isStepComplete,
81
+ O as listRegisteredFieldTypes,
82
+ K as registerDefaultFieldTypes,
83
+ B as registerFieldType,
84
+ q as renderRegisteredField,
85
+ w as resolveFieldComponent,
86
+ he as resolveFormSubmittable,
87
+ Ee as runFieldValidation,
88
+ se as serializeFormStateForQueryKey,
89
+ fe as showFormValidationFailureFeedback,
90
+ He as stableSerialize,
91
+ Ae as startOfDayDate,
92
+ Me as toCascadedFilterValues,
93
+ ze as toLocalDate,
90
94
  m as useCascadingForm,
91
95
  d as useFieldVisibility,
92
- c as useFillFormByFileUpload,
93
- n as useFillFormByPaste,
94
- l as useReactHookForm,
95
- p as useSelectOptions,
96
- be as validateVisibleRequiredFormFields
96
+ b as useFillFormByFileUpload,
97
+ x as useFillFormByPaste,
98
+ p as useFormSteps,
99
+ i as useReactHookForm,
100
+ u as useSelectOptions,
101
+ Se as validateVisibleRequiredFormFields
97
102
  };
@@ -1,2 +1,2 @@
1
- /** Register all 22 built-in field types. Safe to call multiple times — runs once. */
1
+ /** Register all 23 built-in field types. Safe to call multiple times — runs once. */
2
2
  export declare function registerDefaultFieldTypes(): void;
@@ -13,18 +13,20 @@ import { MultiMonthPickerField as _ } from "../Fields/MultiMonthPickerField.js";
13
13
  import { FileUploadField as n } from "../Fields/FileUploadField.js";
14
14
  import { FillFormByPasteField as c } from "../Fields/FillFormByPasteField.js";
15
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 k } from "../Fields/SwitchField.js";
19
- import { CheckboxField as s } from "../Fields/CheckboxField.js";
20
- import { LabelField as x } from "../Fields/LabelField.js";
21
- import { DividerField as g } from "../Fields/DividerField.js";
16
+ import { ChipsField as h } from "../Fields/ChipsField.js";
17
+ import { TextFieldWithBackendValidation as b } from "../Fields/TextFieldWithBackendValidation.js";
18
+ import { SwitchField as s } from "../Fields/SwitchField.js";
19
+ import { CheckboxField as x } from "../Fields/CheckboxField.js";
20
+ import { LabelField as g } from "../Fields/LabelField.js";
21
+ import { DividerField as k } from "../Fields/DividerField.js";
22
22
  import { DividerWithLabelField as w } from "../Fields/DividerWithLabelField.js";
23
23
  import { NumericComboboxField as y } from "../Fields/NumericComboboxField.js";
24
+ import { SliderRangeField as R } from "../Fields/SliderRangeField.js";
25
+ import { RichTextField as T } from "../Fields/RichTextField.js";
24
26
  let i = !1;
25
- function K() {
26
- i || (i = !0, e("divider", g), e("divider_with_label", w), e("label", x), e("select", r), e("button_group", o), e("radio", t), e("text", m), e("numeric_combobox", y), e("text_area", l), 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", k), e("checkbox", s));
27
+ function Y() {
28
+ i || (i = !0, e("divider", k), e("divider_with_label", w), e("label", g), e("select", r), e("button_group", o), e("radio", t), e("text", m), e("numeric_combobox", y), e("text_area", l), 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", h), e("text_with_backend_validation", b), e("switch", s), e("checkbox", x), e("slider_range", R), e("rich_text", T));
27
29
  }
28
30
  export {
29
- K as registerDefaultFieldTypes
31
+ Y as registerDefaultFieldTypes
30
32
  };
@@ -119,19 +119,19 @@ export type SelectField = BaseField & {
119
119
  apiConfig?: {
120
120
  apiEndpoint: string;
121
121
  method: "GET" | "POST";
122
- /** When true, cascaded POSTs send `filters: []` (no parent field values). Use for independent selects (e.g. optional attributes). */
123
- doNotIncludeSectionFormStateInApiRequest?: boolean;
124
- includeOnlyMandatoryFieldsInPayload?: boolean;
125
- /** When true, enables cascade behaviour even when `formConfig.isCascading` is false. */
126
- isCascading?: boolean;
127
122
  /**
128
- * Explicit list of field IDs whose values should be sent as cascade filters.
129
- * When set, overrides the default positional behaviour (`getEarlierFieldsIds`) entirely
130
- * only these specific IDs are included, regardless of their array position.
131
- * Use when you need precise control over which parent fields cascade into this field's options.
132
- * Example: `["division_name", "l0_name"]` — only send Division and Department as filters.
123
+ * Explicit list of field IDs whose current values should be included in the API request payload.
124
+ * Combined with `cascadingDependency` field IDs when `passCascadingDependencyFields` is true (default).
125
+ * When `passCascadingDependencyFields` is false, only this list is sent.
126
+ * Example: `["division_name", "l0_name"]`.
133
127
  */
134
- cascadeFromFields?: string[];
128
+ fieldsToPassInApi?: string[];
129
+ /**
130
+ * Controls which field values are sent with select-option API requests.
131
+ * - `true` (default): send `cascadingDependency` field IDs plus any `fieldsToPassInApi`
132
+ * - `false`: send only `fieldsToPassInApi` (ignore cascadingDependency for the payload)
133
+ */
134
+ passCascadingDependencyFields?: boolean;
135
135
  };
136
136
  };
137
137
  export type DateInputField = BaseField & {
@@ -378,6 +378,17 @@ export type ObjectFieldConfig = BaseField & {
378
378
  collapsible?: boolean;
379
379
  defaultCollapsed?: boolean;
380
380
  };
381
+ export type SliderRangeField = BaseField & {
382
+ fieldType: "slider_range";
383
+ min?: number;
384
+ max?: number;
385
+ step?: number;
386
+ defaultValue?: number[];
387
+ /** When true, renders two thumbs (range mode). Default: single thumb. */
388
+ range?: boolean;
389
+ /** Show current value(s) next to the slider. Default: true. */
390
+ showValue?: boolean;
391
+ };
381
392
  export type ArrayFieldConfig = BaseField & {
382
393
  fieldType: "array";
383
394
  /** Template fields cloned for each array item */
@@ -397,6 +408,14 @@ export type ArrayFieldConfig = BaseField & {
397
408
  /** Default values for a new item (keys match itemFields[].id) */
398
409
  defaultItemValue?: Record<string, unknown>;
399
410
  };
400
- export type IField = FileUploadField | ButtonsGroupField | SelectField | DateInputField | DateRangeField | WeekRangeField | MonthRangeField | MultiMonthPickerField | TextAreaField | RadioField | TextField | NumericComboboxField | CopyPasteField | FillFormByFileUploadField | TextFieldWithBackendValidation | ChipsField | DividerField | DividerWithLabelField | LabelField | SwitchField | CheckboxField | MultiWeekRangeField | ObjectFieldConfig | ArrayFieldConfig;
411
+ export type RichTextField = BaseField & {
412
+ fieldType: "rich_text";
413
+ /** Toolbar items to show. Default: ['undo','redo','bold','italic','underline','strikethrough','heading','quote','link','bulletedList','numberedList'] */
414
+ toolbar?: string[];
415
+ defaultValue?: string;
416
+ /** Minimum editor height in px. Default: 150 */
417
+ minHeight?: number;
418
+ };
419
+ export type IField = FileUploadField | ButtonsGroupField | SelectField | DateInputField | DateRangeField | WeekRangeField | MonthRangeField | MultiMonthPickerField | TextAreaField | RadioField | TextField | NumericComboboxField | CopyPasteField | FillFormByFileUploadField | TextFieldWithBackendValidation | ChipsField | DividerField | DividerWithLabelField | LabelField | SwitchField | CheckboxField | MultiWeekRangeField | SliderRangeField | RichTextField | ObjectFieldConfig | ArrayFieldConfig;
401
420
  /** Discriminant string union for every built-in field type */
402
421
  export type FieldType = IField["fieldType"];
@@ -25,13 +25,15 @@ export type NumericComboboxFieldOutput = number | "" | null | undefined;
25
25
  export type ChipsFieldOutput = string | string[] | null | undefined;
26
26
  export type SwitchFieldOutput = boolean | null | undefined;
27
27
  export type CheckboxFieldOutput = boolean | null | undefined;
28
+ export type SliderRangeFieldOutput = number[] | null | undefined;
29
+ export type RichTextFieldOutput = string | null | undefined;
28
30
  /** Presentational fields do not store a value */
29
31
  export type PresentationalFieldOutput = null | undefined;
30
32
  /**
31
33
  * Union of all field output values (recursive for object / array nesting).
32
34
  * Defined independently of FieldTypeToOutputMap to avoid circular map lookups.
33
35
  */
34
- export type FieldOutputValue = FileUploadFieldOutput | ButtonsGroupFieldOutput | SelectFieldOutput | DateInputFieldOutput | DateRangeFieldOutput | WeekRangeFieldOutput | MultiWeekPickerFieldOutput | MonthRangeFieldOutput | MultiMonthPickerFieldOutput | TextAreaFieldOutput | RadioFieldOutput | TextFieldOutput | NumericComboboxFieldOutput | CopyPasteFieldOutput | FillFormByFileUploadFieldOutput | TextFieldWithBackendValidationOutput | ChipsFieldOutput | SwitchFieldOutput | CheckboxFieldOutput | PresentationalFieldOutput | {
36
+ export type FieldOutputValue = FileUploadFieldOutput | ButtonsGroupFieldOutput | SelectFieldOutput | DateInputFieldOutput | DateRangeFieldOutput | WeekRangeFieldOutput | MultiWeekPickerFieldOutput | MonthRangeFieldOutput | MultiMonthPickerFieldOutput | TextAreaFieldOutput | RadioFieldOutput | TextFieldOutput | NumericComboboxFieldOutput | CopyPasteFieldOutput | FillFormByFileUploadFieldOutput | TextFieldWithBackendValidationOutput | ChipsFieldOutput | SwitchFieldOutput | CheckboxFieldOutput | SliderRangeFieldOutput | RichTextFieldOutput | PresentationalFieldOutput | {
35
37
  [key: string]: FieldOutputValue;
36
38
  } | Array<{
37
39
  [key: string]: FieldOutputValue;
@@ -59,6 +61,8 @@ export type FieldTypeToOutputMap = {
59
61
  chips: ChipsFieldOutput;
60
62
  switch: SwitchFieldOutput;
61
63
  checkbox: CheckboxFieldOutput;
64
+ slider_range: SliderRangeFieldOutput;
65
+ rich_text: RichTextFieldOutput;
62
66
  object: {
63
67
  [key: string]: FieldOutputValue;
64
68
  } | null | undefined;
@@ -1,9 +1,11 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { FieldErrors, FormState, RegisterOptions, UseFormReturn } from 'react-hook-form';
3
3
  import { Option } from '../../components/forms/select';
4
- import { FieldVisibilityBase } from '../../form-engine';
4
+ import { FieldVisibilityBase, FormStepConfig } from '../../form-engine';
5
5
  import { FieldType, IField, SelectField } from './fields.types';
6
6
  export type { FieldVisibilityBase } from '../../form-engine';
7
+ export type { FormStepConfig } from '../../form-engine';
8
+ export type FormType = 'default' | 'stepped' | 'grouped';
7
9
  export type IFormConfig = {
8
10
  formId: string;
9
11
  fields: Array<IField>;
@@ -13,6 +15,10 @@ export type IFormConfig = {
13
15
  isCascading?: boolean;
14
16
  includeOnlyVisibleFieldsInSubmit?: boolean;
15
17
  enableFieldOrdering?: boolean;
18
+ /** Layout mode. `'stepped'` shows one step at a time; `'grouped'` shows all groups with section headers. */
19
+ formType?: FormType;
20
+ /** Step metadata — order, titles, validation gating. When omitted, derived from field `fieldGroup` order. */
21
+ steps?: FormStepConfig[];
16
22
  };
17
23
  export interface FormFieldProps {
18
24
  field: IField;
@@ -105,8 +111,17 @@ export interface FormTransport {
105
111
  }
106
112
  /** Built-in fieldType keys plus arbitrary custom string keys */
107
113
  export type CustomFieldTypesMap = Partial<Record<FieldType, ComponentType<FormFieldProps>>> & Record<string, ComponentType<FormFieldProps>>;
114
+ export interface FormStepStateMeta {
115
+ currentStep: number;
116
+ totalSteps: number;
117
+ isFirstStep: boolean;
118
+ isLastStep: boolean;
119
+ canProceed: boolean;
120
+ completedSteps: number[];
121
+ }
108
122
  export interface FormValidationMeta {
109
123
  isSubmittable: boolean;
124
+ stepState?: FormStepStateMeta;
110
125
  }
111
126
  export interface FormContextValidateFormParams {
112
127
  formValues: ReactHookFormState;
@@ -176,16 +191,28 @@ export interface ReactHooksFormProps {
176
191
  /** Consumer-injected context — validators, custom field types, lifecycle hooks */
177
192
  formContext?: FormContext;
178
193
  }
194
+ export interface ReactHooksFormStepActions {
195
+ currentStep: number;
196
+ totalSteps: number;
197
+ isFirstStep: boolean;
198
+ isLastStep: boolean;
199
+ canProceed: boolean;
200
+ goNext: () => boolean;
201
+ goPrev: () => void;
202
+ goToStep: (index: number) => void;
203
+ isStepComplete: (stepIndex: number) => boolean;
204
+ isStepVisited: (stepIndex: number) => boolean;
205
+ }
179
206
  export interface ReactHooksFormRef {
180
207
  submitForm: () => Promise<boolean>;
181
208
  hasErrors: boolean;
182
209
  errors: FieldErrors<ReactHookFormState>;
183
210
  isValid: boolean;
211
+ stepActions?: ReactHooksFormStepActions;
184
212
  }
185
213
  export interface UseSelectOptionsProps {
186
214
  apiConfig?: SelectField["apiConfig"];
187
215
  formHelpers?: UseReactHookFormReturn;
188
- formConfig?: IFormConfig;
189
216
  initialOptions?: Option[];
190
217
  id: string;
191
218
  isEnabled: boolean;
@@ -193,4 +220,6 @@ export interface UseSelectOptionsProps {
193
220
  getSelectOptionsName?: string;
194
221
  /** Field-specific values to inject into API payload (e.g., viewSettings, globalFilters) */
195
222
  fieldSupportedValues?: Record<string, unknown>;
223
+ /** Field's cascading dependency config — used to auto-derive which parent field values to pass in API requests. */
224
+ cascadingDependency?: IField["cascadingDependency"];
196
225
  }
@@ -1,21 +1,36 @@
1
1
  function u(e) {
2
2
  if (e.fieldType === "object") {
3
- const a = {};
4
- return e.fields.forEach((t) => {
5
- a[t.id] = u(t);
6
- }), a;
3
+ const t = {};
4
+ return e.fields.forEach((a) => {
5
+ t[a.id] = u(a);
6
+ }), t;
7
7
  }
8
8
  if (e.fieldType === "array") {
9
- const a = e.defaultItemValue ?? {}, t = e.minItems ?? 0;
10
- return t > 0 ? Array.from({ length: t }, () => ({ ...a })) : [];
9
+ const t = e.defaultItemValue ?? {}, a = e.minItems ?? 0;
10
+ return a > 0 ? Array.from({ length: a }, () => ({ ...t })) : [];
11
11
  }
12
- return e.fieldType === "button_group" && e.defaultSelectedValue || e.fieldType === "radio" && e.defaultSelectedValue ? e.defaultSelectedValue || null : e.fieldType === "date_range" && e.defaultRange ? {
13
- start: e.defaultRange.start || null,
14
- end: e.defaultRange.end || null
15
- } : e.fieldType === "month_range" && e.defaultRange ? {
16
- start: e.defaultRange.start || null,
17
- end: e.defaultRange.end || null
18
- } : e.fieldType === "switch" || e.fieldType === "checkbox" ? e.defaultSelectedValue ?? !1 : e.fieldType === "text" || e.fieldType === "text_area" || e.fieldType === "numeric_combobox" ? e.defaultValue ?? "" : e.fieldType === "date" ? "" : e.fieldType === "select" ? [] : e.fieldType === "week_range" && e.defaultRange ? {
12
+ if (e.fieldType === "button_group" && e.defaultSelectedValue || e.fieldType === "radio" && e.defaultSelectedValue)
13
+ return e.defaultSelectedValue || null;
14
+ if (e.fieldType === "date_range" && e.defaultRange)
15
+ return {
16
+ start: e.defaultRange.start || null,
17
+ end: e.defaultRange.end || null
18
+ };
19
+ if (e.fieldType === "month_range" && e.defaultRange)
20
+ return {
21
+ start: e.defaultRange.start || null,
22
+ end: e.defaultRange.end || null
23
+ };
24
+ if (e.fieldType === "switch" || e.fieldType === "checkbox")
25
+ return e.defaultSelectedValue ?? !1;
26
+ if (e.fieldType === "text" || e.fieldType === "text_area" || e.fieldType === "numeric_combobox" || e.fieldType === "rich_text")
27
+ return e.defaultValue ?? "";
28
+ if (e.fieldType === "slider_range") {
29
+ if (e.defaultValue) return e.defaultValue;
30
+ const t = e.min ?? 0;
31
+ return e.range ? [t, e.max ?? 100] : [t];
32
+ }
33
+ return e.fieldType === "date" ? "" : e.fieldType === "select" ? [] : e.fieldType === "week_range" && e.defaultRange ? {
19
34
  start: e.defaultRange.start || null,
20
35
  end: e.defaultRange.end || null
21
36
  } : null;