@ostack.tech/ui-kform 1.1.0 → 1.2.0-beta.1

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 (97) hide show
  1. package/dist/chunks/{en-D4xMcf6Q.js → en-BHlLXSzh.js} +4 -16
  2. package/dist/chunks/en-BHlLXSzh.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +5 -17
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +3 -15
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui-kform.js +15299 -4434
  10. package/dist/ostack-ui-kform.js.map +1 -1
  11. package/package.json +16 -14
  12. package/scss/components/Annexes/_Annexes-variables.scss +4 -9
  13. package/scss/components/Annexes/_Annexes.scss +9 -15
  14. package/scss/components/FormApp/_FormApp.scss +1 -4
  15. package/scss/components/FormPages/_FormPages-variables.scss +8 -27
  16. package/scss/components/FormPages/_FormPages.scss +11 -33
  17. package/scss/components/IssuesPanel/_IssuesPanel-variables.scss +3 -8
  18. package/scss/components/IssuesPanel/_IssuesPanel.scss +3 -8
  19. package/types/components/Annexes/Annex.d.ts +26 -37
  20. package/types/components/Annexes/Annexes.d.ts +8 -10
  21. package/types/components/Annexes/AnnexesContext.d.ts +1 -1
  22. package/types/components/Annexes/AnnexesManager.d.ts +8 -12
  23. package/types/components/CheckboxControl/CheckboxControl.d.ts +9 -19
  24. package/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +14 -31
  25. package/types/components/CheckboxGroupControl/CheckboxGroupControlItem.d.ts +1 -2
  26. package/types/components/ControlField/ControlField.d.ts +6 -6
  27. package/types/components/DateControl/DateControl.d.ts +13 -18
  28. package/types/components/DateRangeControl/DateRangeControl.d.ts +16 -22
  29. package/types/components/DebugInfo/DebugInfo.d.ts +3 -4
  30. package/types/components/DebugInfo/DebugInfoControlAddonTrigger.d.ts +1 -1
  31. package/types/components/FileControl/FileControl.d.ts +16 -22
  32. package/types/components/FileControl/FileControlDownloadAddon.d.ts +2 -2
  33. package/types/components/FileControl/FileControlViewAddon.d.ts +1 -1
  34. package/types/components/FormApp/FormApp.d.ts +25 -34
  35. package/types/components/FormApp/FormAppContext.d.ts +20 -44
  36. package/types/components/FormApp/FormAppIssueMessages.d.ts +6 -8
  37. package/types/components/FormApp/FormAppStatus.d.ts +1 -1
  38. package/types/components/FormPages/FormPage.d.ts +12 -20
  39. package/types/components/FormPages/FormPages.d.ts +8 -17
  40. package/types/components/FormPages/FormPagesContext.d.ts +1 -1
  41. package/types/components/FormPages/FormPagesNavigation.d.ts +3 -3
  42. package/types/components/FormStepper/FormStep.d.ts +8 -9
  43. package/types/components/FormStepper/FormStepper.d.ts +14 -18
  44. package/types/components/FormStepper/FormStepperContext.d.ts +1 -1
  45. package/types/components/IssueMessage/IssueMessage.d.ts +1 -1
  46. package/types/components/IssueMessages/IssueMessages.d.ts +17 -25
  47. package/types/components/IssuesPanel/IssuesPanel.d.ts +11 -15
  48. package/types/components/IssuesPanel/IssuesPanelControls.d.ts +1 -1
  49. package/types/components/IssuesPopover/IssuesPopover.d.ts +4 -4
  50. package/types/components/LoadAction/LoadAction.d.ts +7 -10
  51. package/types/components/NumericControl/NumericControl.d.ts +15 -21
  52. package/types/components/PathLink/PathLink.d.ts +4 -5
  53. package/types/components/PrintAction/PrintAction.d.ts +7 -11
  54. package/types/components/RadioGroupControl/RadioGroupControl.d.ts +12 -21
  55. package/types/components/RadioGroupControl/RadioGroupControlItem.d.ts +2 -2
  56. package/types/components/ResetOnChange/ResetOnChange.d.ts +6 -14
  57. package/types/components/ResetOnChange/index.d.ts +1 -1
  58. package/types/components/ResetOnChange/useResetOnChange.d.ts +22 -32
  59. package/types/components/SaveAction/SaveAction.d.ts +22 -30
  60. package/types/components/SelectControl/SelectControl.d.ts +11 -21
  61. package/types/components/SelectControl/SelectControlItem.d.ts +2 -2
  62. package/types/components/SelectControl/SelectControlItemGroup.d.ts +2 -3
  63. package/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +17 -35
  64. package/types/components/SelectMultipleControl/SelectMultipleControlItem.d.ts +1 -2
  65. package/types/components/SelectMultipleControl/SelectMultipleControlItemGroup.d.ts +2 -2
  66. package/types/components/SubmitAction/SubmitAction.d.ts +19 -33
  67. package/types/components/TableControl/TableControl.d.ts +27 -41
  68. package/types/components/TableControl/TableControlActionsColumn.d.ts +3 -5
  69. package/types/components/TableControl/TableControlAddRowTrigger.d.ts +7 -13
  70. package/types/components/TableControl/TableControlApi.d.ts +4 -4
  71. package/types/components/TableControl/TableControlColumn.d.ts +5 -8
  72. package/types/components/TableControl/TableControlColumnFns.d.ts +21 -31
  73. package/types/components/TableControl/TableControlColumnGroup.d.ts +3 -6
  74. package/types/components/TableControl/TableControlColumns.d.ts +4 -4
  75. package/types/components/TableControl/TableControlContent.d.ts +1 -1
  76. package/types/components/TableControl/TableControlIndexColumn.d.ts +2 -2
  77. package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -16
  78. package/types/components/TextControl/TextControl.d.ts +7 -13
  79. package/types/components/UnknownValue/UnknownValue.d.ts +1 -1
  80. package/types/components/ValidateAction/ValidateAction.d.ts +7 -10
  81. package/types/providers/ActivePathProvider/ActivePathProvider.d.ts +4 -7
  82. package/types/providers/LocalizationProvider/LocalizationProvider.d.ts +1 -4
  83. package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
  84. package/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +1 -1
  85. package/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +3 -3
  86. package/types/providers/PrefixSuffixProvider/usePrefix.d.ts +1 -4
  87. package/types/utils/mostSpecificPath.d.ts +4 -6
  88. package/types/utils/pathSpecificity.d.ts +7 -8
  89. package/types/utils/selectionTransformations.d.ts +2 -8
  90. package/types/utils/useControlAutofocus.d.ts +6 -8
  91. package/types/utils/useControlIssues.d.ts +4 -4
  92. package/types/utils/useFormLoader.d.ts +24 -31
  93. package/types/utils/useFormSaver.d.ts +29 -34
  94. package/types/utils/useFormValidator.d.ts +13 -20
  95. package/types/utils/useRegisterControl.d.ts +1 -1
  96. package/types/utils/useTemporalStringTransformer.d.ts +4 -10
  97. package/dist/chunks/en-D4xMcf6Q.js.map +0 -1
@@ -18,8 +18,7 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
18
18
  */
19
19
  issueMessages?: IssueMessagesByCode;
20
20
  /**
21
- * Label to use in the issues panel when displaying issues associated with
22
- * this field.
21
+ * Label to use in the issues panel when displaying issues associated with this field.
23
22
  *
24
23
  * This label has priority over the field's `Label`.
25
24
  */
@@ -33,21 +32,18 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
33
32
  /** Label shown when a value of the control isn't one of the existing options. */
34
33
  unknownValueLabel?: ReactNode;
35
34
  /**
36
- * Whether to prevent the auto-focusing behaviour that causes this control to
37
- * be focused when the form app's `focus` is called with this control's path.
35
+ * Whether to prevent the auto-focusing behaviour that causes this control to be focused when the
36
+ * form app's `focus` is called with this control's path.
38
37
  *
39
- * Preventing this behaviour is useful when multiple controls for the same
40
- * path are rendered at once, and only one of them should be focused.
38
+ * Preventing this behaviour is useful when multiple controls for the same path are rendered at
39
+ * once, and only one of them should be focused.
41
40
  *
42
41
  * @default false
43
42
  */
44
43
  preventAutoFocus?: boolean;
45
44
  /** Select multiple control children. */
46
45
  children?: ReactNode;
47
- /**
48
- * Whether to show debug information. This property has no effect in
49
- * production builds.
50
- */
46
+ /** Whether to show debug information. This property has no effect in production builds. */
51
47
  debug?: boolean;
52
48
  /** Reference to the control's API. */
53
49
  apiRef?: Ref<ListableInputController<T, TListable, string[], ComponentRef<typeof Select>> | undefined>;
@@ -55,23 +51,20 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
55
51
  issueMessagesProps?: Omit<IssueMessagesProps, "path" | "issues" | "messages" | "unwrapped">;
56
52
  }
57
53
  /**
58
- * The select multiple control component is a KForm form control for values with
59
- * (possibly
54
+ * The select multiple control component is a KForm form control for values with (possibly
60
55
  * [nullable](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-nullable-schema/index.html))
61
56
  * schemas of type
62
57
  * [`ListSchema`](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-list-schema/index.html)
63
58
  * or
64
59
  * [`TableSchema`](https://kform.ostack.tech/api/packages/kform/tech.ostack.kform.schemas/-table-schema/index.html)
65
- * and items of any type. It is built on top of the
66
- * [`Select`](/docs/ostack-ui-forms-select--docs) component with the `multiple`
67
- * property set.
60
+ * and items of any type. It is built on top of the [`Select`](/docs/ostack-ui-forms-select--docs)
61
+ * component with the `multiple` property set.
68
62
  *
69
63
  * It composes the following subcomponents:
70
64
  *
71
- * - `SelectMultipleControlItem`: Component used to define an item of the select
65
+ * - `SelectMultipleControlItem`: Component used to define an item of the select multiple control.
66
+ * - `SelectMultipleControlItemGroup`: Component used to define a group of items of the select
72
67
  * multiple control.
73
- * - `SelectMultipleControlItemGroup`: Component used to define a group of items
74
- * of the select multiple control.
75
68
  *
76
69
  * The following built-in KForm validations affect this control:
77
70
  *
@@ -83,10 +76,7 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
83
76
  * Example usage:
84
77
  *
85
78
  * ```tsx
86
- * import {
87
- * SelectMultipleControl,
88
- * SelectMultipleControlItem,
89
- * } from "@ostack.tech/ui-kform";
79
+ * import { SelectMultipleControl, SelectMultipleControlItem } from "@ostack.tech/ui-kform";
90
80
  *
91
81
  * function SpokenLanguagesControl() {
92
82
  * return (
@@ -94,21 +84,13 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
94
84
  * path="/spokenLanguages"
95
85
  * placeholder="Select your spoken languages…"
96
86
  * >
97
- * <SelectMultipleControlItem value="en">
98
- * English
99
- * </SelectMultipleControlItem>
100
- * <SelectMultipleControlItem value="fr">
101
- * French
102
- * </SelectMultipleControlItem>
103
- * <SelectMultipleControlItem value="pt">
104
- * Portuguese
105
- * </SelectMultipleControlItem>
106
- * <SelectMultipleControlItem value="es">
107
- * Spanish
108
- * </SelectMultipleControlItem>
87
+ * <SelectMultipleControlItem value="en">English</SelectMultipleControlItem>
88
+ * <SelectMultipleControlItem value="fr">French</SelectMultipleControlItem>
89
+ * <SelectMultipleControlItem value="pt">Portuguese</SelectMultipleControlItem>
90
+ * <SelectMultipleControlItem value="es">Spanish</SelectMultipleControlItem>
109
91
  * </SelectMultipleControl>
110
92
  * );
111
93
  * }
112
94
  * ```
113
95
  */
114
- export declare function SelectMultipleControl<T = unknown, TListable extends Listable<T> | null = Listable<T> | null>({ path, options: groupedOptions, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, maxSelected, loading, showSpinner, disabled, readOnly, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: SelectMultipleControlProps<T, TListable>): import("react").JSX.Element;
96
+ export declare function SelectMultipleControl<T = unknown, TListable extends Listable<T> | null = Listable<T> | null>({ path, options: optionsProp, issueMessages, issuesPanelLabel, displayIssues, unknownValueLabel: unknownValueLabelProp, preventAutoFocus, apiRef, issueMessagesProps, formManager, onInitialized, onFormManagerEvent, onValueChange, onValidationStatusChange, onDisplayStatusChange, onDirtyStatusChange, onTouchedStatusChange, required, maxSelected, loading, showSpinner, disabled, readOnly, endAdornment, onFocus, onBlurToOutside, children, debug, ref, ...otherProps }: SelectMultipleControlProps<T, TListable>): import("react").JSX.Element;
@@ -7,7 +7,6 @@ export type SelectMultipleControlItemProps<T = unknown> = SelectControlItemProps
7
7
  * Definition of a select multiple control item.
8
8
  *
9
9
  * This component doesn't actually render anything by itself; it is used by the
10
- * `SelectMultipleControl` component to automatically create the `options`
11
- * array.
10
+ * `SelectMultipleControl` component to automatically create the `options` array.
12
11
  */
13
12
  export declare function SelectMultipleControlItem(_props: SelectMultipleControlItemProps): null;
@@ -7,7 +7,7 @@ export type SelectMultipleControlItemGroupProps<T = unknown> = SelectControlItem
7
7
  * Definition of a select multiple control item group.
8
8
  *
9
9
  * This component doesn't actually render anything by itself; it is used by the
10
- * `SelectMultipleControl` component to automatically create groups of items in
11
- * the `options` array.
10
+ * `SelectMultipleControl` component to automatically create groups of items in the `options`
11
+ * array.
12
12
  */
13
13
  export declare function SelectMultipleControlItemGroup(_props: SelectMultipleControlItemGroupProps): null;
@@ -7,16 +7,13 @@ export declare const DEFAULT_SUBMIT_KEYBINDS = "$mod+Enter";
7
7
  /** Properties of the submit action. */
8
8
  export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends Omit<Partial<ActionButtonProps>, "onSubmit">, Pick<Required<SubmitOptions<T, TSubmitResult>>, "onSubmit">, Omit<SubmitOptions<T, TSubmitResult>, "onSubmit"> {
9
9
  /**
10
- * Keybinds for triggering the action. Set to `null` to disable the keyboard
11
- * shortcut.
10
+ * Keybinds for triggering the action. Set to `null` to disable the keyboard shortcut.
12
11
  *
13
- * Keyboard handling is built on top of the
14
- * [`tinykeys`](https://jamiebuilds.github.io/tinykeys) library. For
15
- * information on keybinding syntax, read the [`tinykeys`
12
+ * Keyboard handling is built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
13
+ * library. For information on keybinding syntax, read the [`tinykeys`
16
14
  * documentation](https://github.com/jamiebuilds/tinykeys).
17
15
  *
18
- * Defaults to the keybinds defined by the current locale or to
19
- * `DEFAULT_SUBMIT_KEYBINDS`.
16
+ * Defaults to the keybinds defined by the current locale or to `DEFAULT_SUBMIT_KEYBINDS`.
20
17
  */
21
18
  keybinds?: string | string[] | null;
22
19
  /**
@@ -26,53 +23,43 @@ export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends
26
23
  */
27
24
  showWhenReadOnly?: boolean;
28
25
  /**
29
- * Whether users should confirm (by ticking a checkbox) that the submission
30
- * should proceed whenever the form contains warnings.
26
+ * Whether users should confirm (by ticking a checkbox) that the submission should proceed
27
+ * whenever the form contains warnings.
31
28
  *
32
29
  * @default true
33
30
  */
34
31
  confirmWarnings?: boolean;
35
32
  /** Title of the confirmation dialog which appears when submitting the form. */
36
33
  dialogTitle?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
37
- /**
38
- * Description of the confirmation dialog which appears when submitting the
39
- * form.
40
- */
34
+ /** Description of the confirmation dialog which appears when submitting the form. */
41
35
  dialogDescription?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
42
36
  /**
43
37
  * Body of the confirmation dialog which appears when submitting the form.
44
38
  *
45
- * This property can be used to display a summary of the data being submitted
46
- * and will be displayed between the description and the “confirm warnings
47
- * alert”, when it exists.
39
+ * This property can be used to display a summary of the data being submitted and will be
40
+ * displayed between the description and the “confirm warnings alert”, when it exists.
48
41
  */
49
42
  dialogBody?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
50
43
  /**
51
- * Label of the checkbox which prompts users to confirm that they intend to
52
- * proceed with submission in the event of warnings in the form.
44
+ * Label of the checkbox which prompts users to confirm that they intend to proceed with
45
+ * submission in the event of warnings in the form.
53
46
  */
54
47
  confirmWarningsCheckboxLabel?: ReactNode;
55
- /**
56
- * Text of the OK button in the confirmation dialog which appears when
57
- * submitting the form.
58
- */
48
+ /** Text of the OK button in the confirmation dialog which appears when submitting the form. */
59
49
  dialogOkText?: ReactNode;
60
- /**
61
- * Text of the cancel button in the confirmation dialog which appears when
62
- * submitting the form.
63
- */
50
+ /** Text of the cancel button in the confirmation dialog which appears when submitting the form. */
64
51
  dialogCancelText?: ReactNode;
65
52
  /**
66
- * Message to show in a toast after a successful submission. Can be set to
67
- * `null` to not show any message.
53
+ * Message to show in a toast after a successful submission. Can be set to `null` to not show any
54
+ * message.
68
55
  *
69
56
  * @param submitResult Result of `onSubmit`.
70
57
  * @returns Message to show in a toast.
71
58
  */
72
59
  successMessage?: ReactNode | ((submitResult: TSubmitResult) => ReactNode);
73
60
  /**
74
- * Message to show in a toast when an error occurs while submitting the form.
75
- * Can be set to `null` to not show any message.
61
+ * Message to show in a toast when an error occurs while submitting the form. Can be set to `null`
62
+ * to not show any message.
76
63
  *
77
64
  * @param error Error that occurred.
78
65
  * @returns Message to show in a toast.
@@ -100,8 +87,7 @@ export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends
100
87
  confirmWarningsCheckboxProps?: Omit<CheckboxProps, "checked" | "onCheckedChange" | "children">;
101
88
  }
102
89
  /**
103
- * Form action used to submit a form, supporting all submission-related
104
- * properties available in a
90
+ * Form action used to submit a form, supporting all submission-related properties available in a
105
91
  * [`FormApp`](/docs/ostack-ui-kform-layout-form-app--docs). Built on top of the
106
92
  * [Button](/docs/ostack-ui-forms-button--docs) and
107
93
  * [AlertDialog](/docs/ostack-ui-overlay-alert-dialog--docs) components.
@@ -130,4 +116,4 @@ export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends
130
116
  * }
131
117
  * ```
132
118
  */
133
- export declare function SubmitAction<T = unknown, TSubmitResult = unknown>({ onBeforeSubmit, onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedSubmit, onAfterSubmit, setTouchedOnSubmit, validateOnSubmit, setPristineOnSuccessfulSubmit, convertExternalIssuesTableRowIndicesToIds, label, keybinds, showWhenReadOnly, confirmWarnings, loading, disabled, onClick, dialogTitle, dialogDescription, dialogBody, confirmWarningsCheckboxLabel, dialogOkText, dialogCancelText, successMessage: successMessageProp, errorMessage: errorMessageProp, dialogContentProps, dialogHeaderProps, dialogTitleProps, dialogBodyProps, dialogDescriptionProps, dialogFooterProps, dialogOkButtonProps, dialogCancelButtonProps, confirmWarningsAlertProps, confirmWarningsCheckboxProps, ...otherProps }: SubmitActionProps<T, TSubmitResult>): false | import("react").JSX.Element | undefined;
119
+ export declare function SubmitAction<T = unknown, TSubmitResult = unknown>({ onBeforeSubmit, onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedSubmit, onAfterSubmit, setTouchedOnSubmit, validateOnSubmit, setPristineOnSuccessfulSubmit, convertExternalIssuesTableRowIndicesToIds, label: labelProp, keybinds: keybindsProp, showWhenReadOnly, confirmWarnings, loading, disabled, onClick, dialogTitle: dialogTitleProp, dialogDescription: dialogDescriptionProp, dialogBody: dialogBodyProp, confirmWarningsCheckboxLabel: confirmWarningsCheckboxLabelProp, dialogOkText: dialogOkTextProp, dialogCancelText: dialogCancelTextProp, successMessage: successMessageProp, errorMessage: errorMessageProp, dialogContentProps, dialogHeaderProps, dialogTitleProps, dialogBodyProps, dialogDescriptionProps, dialogFooterProps, dialogOkButtonProps, dialogCancelButtonProps, confirmWarningsAlertProps, confirmWarningsCheckboxProps, ...otherProps }: SubmitActionProps<T, TSubmitResult>): false | import("react").JSX.Element | undefined;
@@ -22,8 +22,7 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
22
22
  */
23
23
  issueMessages?: IssueMessagesByCode;
24
24
  /**
25
- * Label to use in the issues panel when displaying issues associated with
26
- * this table.
25
+ * Label to use in the issues panel when displaying issues associated with this table.
27
26
  *
28
27
  * This label has priority over the table's `Label`.
29
28
  */
@@ -35,27 +34,23 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
35
34
  */
36
35
  displayIssues?: boolean;
37
36
  /**
38
- * Sets the maximum number of rows that the table can have. By default, if the
39
- * table's schema has a `Size` or `MaxSize` validation, then its value is
40
- * used.
37
+ * Sets the maximum number of rows that the table can have. By default, if the table's schema has
38
+ * a `Size` or `MaxSize` validation, then its value is used.
41
39
  */
42
40
  maxRows?: number;
43
41
  /**
44
- * Function called when a row is being added to choose the value that should
45
- * be added.
42
+ * Function called when a row is being added to choose the value that should be added.
46
43
  *
47
- * The default value being added is provided as an argument and may be edited
48
- * if required.
44
+ * The default value being added is provided as an argument and may be edited if required.
49
45
  *
50
- * The value to be added should be returned, or a promise that resolves with
51
- * said value.
46
+ * The value to be added should be returned, or a promise that resolves with said value.
52
47
  *
53
- * To prevent a row from being added, return `undefined`/`null` (or a promise
54
- * which resolves with `undefined`/`null`).
48
+ * To prevent a row from being added, return `undefined`/`null` (or a promise which resolves with
49
+ * `undefined`/`null`).
55
50
  *
56
51
  * @param value - Value being added, can be edited.
57
- * @returns Value to be added, `undefined`/`null` if the row shouldn't be
58
- * added (or a promise that resolves with said values).
52
+ * @returns Value to be added, `undefined`/`null` if the row shouldn't be added (or a promise that
53
+ * resolves with said values).
59
54
  */
60
55
  getRowValue?: (value: T) => T | null | undefined | PromiseLike<T | null | undefined>;
61
56
  /** Sets the table control as disabled. */
@@ -63,19 +58,16 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
63
58
  /** Sets the table control as read-only. */
64
59
  readOnly?: boolean;
65
60
  /**
66
- * Whether to prevent the auto-focusing behaviour that causes this control to
67
- * be focused when the form app's `focus` is called with this control's path.
61
+ * Whether to prevent the auto-focusing behaviour that causes this control to be focused when the
62
+ * form app's `focus` is called with this control's path.
68
63
  *
69
- * Preventing this behaviour is useful when multiple controls for the same
70
- * path are rendered at once, and only one of them should be focused.
64
+ * Preventing this behaviour is useful when multiple controls for the same path are rendered at
65
+ * once, and only one of them should be focused.
71
66
  *
72
67
  * @default false
73
68
  */
74
69
  preventAutoFocus?: boolean;
75
- /**
76
- * Whether to show debug information. This property has no effect in
77
- * production builds.
78
- */
70
+ /** Whether to show debug information. This property has no effect in production builds. */
79
71
  debug?: boolean;
80
72
  /** Reference to the control's API. */
81
73
  apiRef?: Ref<TableControlApi<T, TTable> | undefined>;
@@ -92,24 +84,21 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
92
84
  *
93
85
  * It composes the following subcomponents:
94
86
  *
95
- * - `TableControlColumns`: Container for the definition of all table control
96
- * columns and their groups.
87
+ * - `TableControlColumns`: Container for the definition of all table control columns and their
88
+ * groups.
97
89
  * - `TableControlColumn`: Component used to define a column of the table control.
98
- * - `TableControlColumnGroup`: Component used to define a column group of the
99
- * table control.
100
- * - `TableControlContent`: Main content of the table control, containing the
101
- * table itself.
90
+ * - `TableControlColumnGroup`: Component used to define a column group of the table control.
91
+ * - `TableControlContent`: Main content of the table control, containing the table itself.
102
92
  * - `TableControlAddRowTrigger`: Trigger used to add a new row to the table.
103
93
  * - `TableControlRemoveRowTrigger`: Trigger used to remove a row from the table.
104
- * - `DataTablePagination`: Optional pagination component of the table control,
105
- * showing the current scroll progress in the default `scrolled` mode and
106
- * allowing the selection of the current page in `paged` mode.
107
- * - `TableControlRowsPerPage`: Optional component allowing the selection of the
108
- * number of rows to display per page.
94
+ * - `DataTablePagination`: Optional pagination component of the table control, showing the current
95
+ * scroll progress in the default `scrolled` mode and allowing the selection of the current page
96
+ * in `paged` mode.
97
+ * - `TableControlRowsPerPage`: Optional component allowing the selection of the number of rows to
98
+ * display per page.
109
99
  * - `TableControlIndexColumn`: Built-in column displaying the number of each row.
110
- * - `TableControlActionsColumn`: Built-in column displaying actions that can be
111
- * performed on each row; displays a `TableControlRemoveRowTrigger` by
112
- * default.
100
+ * - `TableControlActionsColumn`: Built-in column displaying actions that can be performed on each
101
+ * row; displays a `TableControlRemoveRowTrigger` by default.
113
102
  *
114
103
  * The following built-in KForm validations affect this control:
115
104
  *
@@ -144,10 +133,7 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
144
133
  * <TableControlActionsColumn removeRowLabel="Remove item" />
145
134
  * </TableControlColumns>
146
135
  * <TableControlAddRowTrigger label="Add item" />
147
- * <TableControlContent
148
- * caption="Inventory"
149
- * emptyMessage="No items added."
150
- * />
136
+ * <TableControlContent caption="Inventory" emptyMessage="No items added." />
151
137
  * </TableControl>
152
138
  * );
153
139
  * }
@@ -4,12 +4,10 @@ import { type TableControlActionsColumnFnProps } from "./TableControlColumnFns.t
4
4
  export interface TableControlActionsColumnProps extends TableControlColumnProps, Omit<TableControlActionsColumnFnProps, keyof TableControlColumnObject> {
5
5
  }
6
6
  /**
7
- * Pre-configured column used to display row actions. By default, it sticks to
8
- * the right of the table and renders the `TableControlRemoveRowTrigger`
9
- * component.
7
+ * Pre-configured column used to display row actions. By default, it sticks to the right of the
8
+ * table and renders the `TableControlRemoveRowTrigger` component.
10
9
  *
11
- * Its configuration can be overridden to show other actions, e.g. an edit
12
- * button:
10
+ * Its configuration can be overridden to show other actions, e.g. an edit button:
13
11
  *
14
12
  * ```tsx
15
13
  * <TableControlActionsColumn width={100}>
@@ -5,8 +5,8 @@ export type TableControlAddRowTriggerProps = TableControlAddRowTriggerChildlessP
5
5
  /** Base properties of the table control add row trigger component. */
6
6
  export interface TableControlAddRowTriggerPropsBase {
7
7
  /**
8
- * Whether to disable the trigger (and show a loading button by default) while
9
- * a row is being added.
8
+ * Whether to disable the trigger (and show a loading button by default) while a row is being
9
+ * added.
10
10
  *
11
11
  * @default false
12
12
  */
@@ -14,8 +14,8 @@ export interface TableControlAddRowTriggerPropsBase {
14
14
  /** Function called after the row has been added. */
15
15
  onRowAdded?: () => void;
16
16
  /**
17
- * Whether the component should preferably be aligned to the right. This only
18
- * has an effect when the component is nested directly under the `DataTable`.
17
+ * Whether the component should preferably be aligned to the right. This only has an effect when
18
+ * the component is nested directly under the `DataTable`.
19
19
  *
20
20
  * @default true
21
21
  */
@@ -33,11 +33,8 @@ export interface TableControlAddRowTriggerPropsBase {
33
33
  */
34
34
  showWhilePrinting?: boolean;
35
35
  }
36
- /**
37
- * Properties of the table control add row trigger component when rendered
38
- * without children.
39
- */
40
- export interface TableControlAddRowTriggerChildlessProps extends TableControlAddRowTriggerPropsBase, Omit<Partial<ActionButtonProps>, "asChild" | "children"> {
36
+ /** Properties of the table control add row trigger component when rendered without children. */
37
+ export interface TableControlAddRowTriggerChildlessProps extends TableControlAddRowTriggerPropsBase, Omit<Partial<ActionButtonProps>, "asLink" | "asChild" | "children"> {
41
38
  /**
42
39
  * Label displayed on the button.
43
40
  *
@@ -46,10 +43,7 @@ export interface TableControlAddRowTriggerChildlessProps extends TableControlAdd
46
43
  defaultButtonText?: ReactNode;
47
44
  children?: never;
48
45
  }
49
- /**
50
- * Properties of the table control add row trigger component when rendered with
51
- * children.
52
- */
46
+ /** Properties of the table control add row trigger component when rendered with children. */
53
47
  export interface TableControlAddRowTriggerChildrenProps extends TableControlAddRowTriggerPropsBase, ComponentProps<"button"> {
54
48
  children: ReactNode;
55
49
  }
@@ -8,16 +8,16 @@ export type TableControlApi<T = unknown, TTable extends Table<T> | null = Table<
8
8
  * Navigates to the row with the provided index.
9
9
  *
10
10
  * @param index Index of row to navigate to.
11
- * @param scrollOptions Options used to configure to scrolling to the row
12
- * (only relevant in scrolled display mode).
11
+ * @param scrollOptions Options used to configure to scrolling to the row (only relevant in
12
+ * scrolled display mode).
13
13
  */
14
14
  goToIndex: (index: number, scrollOptions?: DataTableScrollToOptions) => void;
15
15
  /**
16
16
  * Navigates to the row with the provided id.
17
17
  *
18
18
  * @param id Id of row to navigate to.
19
- * @param scrollOptions Options used to configure to scrolling to the row
20
- * (only relevant in scrolled display mode).
19
+ * @param scrollOptions Options used to configure to scrolling to the row (only relevant in
20
+ * scrolled display mode).
21
21
  */
22
22
  goToId: (id: TableRowId, scrollOptions?: DataTableScrollToOptions) => void;
23
23
  };
@@ -7,24 +7,21 @@ export interface TableControlColumnObject<T = unknown, TValue = any> extends Omi
7
7
  render?: ReactNode | ((rowController: TableControlRowController<T>) => ReactNode);
8
8
  /** Optional footer content to be rendered in the column footer. */
9
9
  footer?: ReactNode;
10
- /**
11
- * Whether this column should be shown when the table control is in read-only
12
- * mode.
13
- */
10
+ /** Whether this column should be shown when the table control is in read-only mode. */
14
11
  showWhenReadOnly?: boolean;
15
12
  }
16
13
  /** Properties of the table control column component. */
17
14
  export interface TableControlColumnProps<T = any, TValue = any> extends Omit<TableControlColumnObject<T, TValue>, "subColumns"> {
18
15
  /**
19
- * Rendering of the cell content. If both `render` and `children` are
20
- * provided, `render` takes priority.
16
+ * Rendering of the cell content. If both `render` and `children` are provided, `render` takes
17
+ * priority.
21
18
  */
22
19
  children?: ReactNode | ((rowController: TableControlRowController<T>) => ReactNode);
23
20
  }
24
21
  /**
25
22
  * Definition of a table control column.
26
23
  *
27
- * This component doesn't actually render anything by itself; it is used by the
28
- * `TableControl` component to automatically create the `columns` object.
24
+ * This component doesn't actually render anything by itself; it is used by the `TableControl`
25
+ * component to automatically create the `columns` object.
29
26
  */
30
27
  export declare function TableControlColumn<T = any, TValue = any>(_props: TableControlColumnProps<T, TValue>): null;
@@ -7,8 +7,8 @@ import { type TableControlRemoveRowTriggerProps, type TableControlRemoveRowTrigg
7
7
  export interface TableControlIndexColumnFnProps<T = unknown, TValue = any> extends TableControlColumnObject<T, TValue> {
8
8
  }
9
9
  /**
10
- * Pre-configured column used to display the index of each row. By default, it
11
- * sticks to left of the table.
10
+ * Pre-configured column used to display the index of each row. By default, it sticks to left of the
11
+ * table.
12
12
  *
13
13
  * @param props Column properties to override the defaults.
14
14
  * @returns Table control column used to display the index of each row.
@@ -17,63 +17,53 @@ export declare function tableControlIndexColumn<T = unknown, TValue = any>({ ren
17
17
  /** Properties used to configure the `tableControlActionsColumn` function. */
18
18
  export interface TableControlActionsColumnFnProps<T = unknown, TValue = any> extends TableControlColumnObject<T, TValue>, Omit<PrefixedConfirmDialogOptions<"confirmRowRemovalDialog">, "confirmRowRemovalDialogMessage"> {
19
19
  /**
20
- * Set the `label` property of the `TableControlRemoveRowTrigger` component
21
- * rendered by default.
20
+ * Set the `label` property of the `TableControlRemoveRowTrigger` component rendered by default.
22
21
  *
23
- * **Note:** This property has no effect if the column's `render` function is
24
- * overridden.
22
+ * **Note:** This property has no effect if the column's `render` function is overridden.
25
23
  */
26
24
  removeRowLabel?: ReactNode;
27
25
  /**
28
- * Sets the `showConfirmation` property of the `TableControlRemoveRowTrigger`
29
- * component rendered by default.
26
+ * Sets the `showConfirmation` property of the `TableControlRemoveRowTrigger` component rendered
27
+ * by default.
30
28
  *
31
- * **Note:** This property has no effect if the column's `render` function is
32
- * overridden.
29
+ * **Note:** This property has no effect if the column's `render` function is overridden.
33
30
  */
34
31
  showRowRemovalConfirmation?: boolean;
35
32
  /**
36
- * Sets the `onConfirmRowRemoval` property of the
37
- * `TableControlRemoveRowTrigger` component rendered by default.
33
+ * Sets the `onConfirmRowRemoval` property of the `TableControlRemoveRowTrigger` component
34
+ * rendered by default.
38
35
  *
39
- * **Note:** This property has no effect if the column's `render` function is
40
- * overridden.
36
+ * **Note:** This property has no effect if the column's `render` function is overridden.
41
37
  */
42
38
  onConfirmRowRemoval?: () => void;
43
39
  /**
44
- * Sets the `onRowRemoved` property of the `TableControlRemoveRowTrigger`
45
- * component rendered by default.
40
+ * Sets the `onRowRemoved` property of the `TableControlRemoveRowTrigger` component rendered by
41
+ * default.
46
42
  *
47
- * **Note:** This property has no effect if the column's `render` function is
48
- * overridden.
43
+ * **Note:** This property has no effect if the column's `render` function is overridden.
49
44
  */
50
45
  onRowRemoved?: () => void;
51
46
  /**
52
- * Sets the `confirmDialogMessage` property of the
53
- * `TableControlRemoveRowTrigger` component rendered by default.
47
+ * Sets the `confirmDialogMessage` property of the `TableControlRemoveRowTrigger` component
48
+ * rendered by default.
54
49
  *
55
- * **Note:** This property has no effect if the column's `render` function is
56
- * overridden.
50
+ * **Note:** This property has no effect if the column's `render` function is overridden.
57
51
  */
58
52
  confirmRowRemovalDialogMessage?: TableControlRemoveRowTriggerPropsBase["confirmDialogMessage"];
59
53
  /**
60
- * Properties to pass to the `TableControlRemoveRowTrigger` component rendered
61
- * by default.
54
+ * Properties to pass to the `TableControlRemoveRowTrigger` component rendered by default.
62
55
  *
63
- * **Note:** This property has no effect if the column's `render` function is
64
- * overridden.
56
+ * **Note:** This property has no effect if the column's `render` function is overridden.
65
57
  */
66
58
  removeRowProps?: TableControlRemoveRowTriggerProps;
67
59
  /** Properties to pass to the `Actions` component. */
68
60
  actionsProps?: ActionsProps;
69
61
  }
70
62
  /**
71
- * Pre-configured column used to display row actions. By default, it sticks to
72
- * the right of the table and renders the `TableControlRemoveRowTrigger`
73
- * component.
63
+ * Pre-configured column used to display row actions. By default, it sticks to the right of the
64
+ * table and renders the `TableControlRemoveRowTrigger` component.
74
65
  *
75
- * Its configuration can be overridden to show other actions, for example, an
76
- * edit button:
66
+ * Its configuration can be overridden to show other actions, for example, an edit button:
77
67
  *
78
68
  * ```tsx
79
69
  * tableControlActionsColumn({
@@ -5,10 +5,7 @@ import type { TableControlColumnObjects } from "./TableControl.tsx";
5
5
  export interface TableControlColumnGroupObject<T = unknown> extends Omit<DataTableColumnGroupObject, "subColumns"> {
6
6
  /** Sub columns of this column group. */
7
7
  subColumns?: TableControlColumnObjects<T>;
8
- /**
9
- * Whether this column group should be shown when the table control is in
10
- * read-only mode.
11
- */
8
+ /** Whether this column group should be shown when the table control is in read-only mode. */
12
9
  showWhenReadOnly?: boolean;
13
10
  }
14
11
  /** Properties of the table control column component. */
@@ -19,7 +16,7 @@ export interface TableControlColumnGroupProps extends Omit<TableControlColumnGro
19
16
  /**
20
17
  * Definition of a table control column group.
21
18
  *
22
- * This component doesn't actually render anything by itself; it is used by the
23
- * `TableControl` component to automatically create the `columns` object.
19
+ * This component doesn't actually render anything by itself; it is used by the `TableControl`
20
+ * component to automatically create the `columns` object.
24
21
  */
25
22
  export declare function TableControlColumnGroup(_props: TableControlColumnGroupProps): null;
@@ -5,10 +5,10 @@ export interface TableControlColumnsProps {
5
5
  children: ReactNode;
6
6
  }
7
7
  /**
8
- * Container for the definition of all table control columns. This component
9
- * must be a direct child of the `TableControl` component.
8
+ * Container for the definition of all table control columns. This component must be a direct child
9
+ * of the `TableControl` component.
10
10
  *
11
- * This component doesn't actually render anything by itself; it is used by the
12
- * `TableControl` component to automatically create the `columns` object.
11
+ * This component doesn't actually render anything by itself; it is used by the `TableControl`
12
+ * component to automatically create the `columns` object.
13
13
  */
14
14
  export declare function TableControlColumns(_props: TableControlColumnsProps): null;
@@ -3,4 +3,4 @@ import { type DataTableContentProps } from "@ostack.tech/ui";
3
3
  export interface TableControlContentProps extends Omit<DataTableContentProps, "status"> {
4
4
  }
5
5
  /** Component containing the content of the table control. */
6
- export declare function TableControlContent({ emptyMessage, scrollableProps, ...otherProps }: TableControlContentProps): import("react").JSX.Element;
6
+ export declare function TableControlContent({ emptyMessage: emptyMessageProp, scrollableProps, ...otherProps }: TableControlContentProps): import("react").JSX.Element;
@@ -4,7 +4,7 @@ import { type TableControlIndexColumnFnProps } from "./TableControlColumnFns.tsx
4
4
  export interface TableControlIndexColumnProps extends TableControlColumnProps, Omit<TableControlIndexColumnFnProps, keyof TableControlColumnObject> {
5
5
  }
6
6
  /**
7
- * Pre-configured column used to display the index of each row. By default, it
8
- * sticks to left of the table.
7
+ * Pre-configured column used to display the index of each row. By default, it sticks to left of the
8
+ * table.
9
9
  */
10
10
  export declare function TableControlIndexColumn({ render, children, ...otherProps }: TableControlIndexColumnProps): import("react").JSX.Element;