@ostack.tech/ui-kform 1.2.0-beta.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.
- package/dist/chunks/{en-D4xMcf6Q.js → en-BHlLXSzh.js} +4 -16
- package/dist/chunks/en-BHlLXSzh.js.map +1 -0
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +5 -17
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +3 -15
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui-kform.js +15299 -4434
- package/dist/ostack-ui-kform.js.map +1 -1
- package/package.json +16 -14
- package/scss/components/Annexes/_Annexes-variables.scss +4 -9
- package/scss/components/Annexes/_Annexes.scss +9 -15
- package/scss/components/FormApp/_FormApp.scss +1 -4
- package/scss/components/FormPages/_FormPages-variables.scss +8 -27
- package/scss/components/FormPages/_FormPages.scss +11 -33
- package/scss/components/IssuesPanel/_IssuesPanel-variables.scss +3 -8
- package/scss/components/IssuesPanel/_IssuesPanel.scss +3 -8
- package/types/components/Annexes/Annex.d.ts +26 -37
- package/types/components/Annexes/Annexes.d.ts +8 -10
- package/types/components/Annexes/AnnexesContext.d.ts +1 -1
- package/types/components/Annexes/AnnexesManager.d.ts +8 -12
- package/types/components/CheckboxControl/CheckboxControl.d.ts +9 -19
- package/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +14 -31
- package/types/components/CheckboxGroupControl/CheckboxGroupControlItem.d.ts +1 -2
- package/types/components/ControlField/ControlField.d.ts +6 -6
- package/types/components/DateControl/DateControl.d.ts +13 -18
- package/types/components/DateRangeControl/DateRangeControl.d.ts +16 -22
- package/types/components/DebugInfo/DebugInfo.d.ts +3 -4
- package/types/components/DebugInfo/DebugInfoControlAddonTrigger.d.ts +1 -1
- package/types/components/FileControl/FileControl.d.ts +16 -22
- package/types/components/FileControl/FileControlDownloadAddon.d.ts +2 -2
- package/types/components/FileControl/FileControlViewAddon.d.ts +1 -1
- package/types/components/FormApp/FormApp.d.ts +25 -34
- package/types/components/FormApp/FormAppContext.d.ts +20 -44
- package/types/components/FormApp/FormAppIssueMessages.d.ts +6 -8
- package/types/components/FormApp/FormAppStatus.d.ts +1 -1
- package/types/components/FormPages/FormPage.d.ts +12 -20
- package/types/components/FormPages/FormPages.d.ts +8 -17
- package/types/components/FormPages/FormPagesContext.d.ts +1 -1
- package/types/components/FormPages/FormPagesNavigation.d.ts +3 -3
- package/types/components/FormStepper/FormStep.d.ts +8 -9
- package/types/components/FormStepper/FormStepper.d.ts +14 -18
- package/types/components/FormStepper/FormStepperContext.d.ts +1 -1
- package/types/components/IssueMessage/IssueMessage.d.ts +1 -1
- package/types/components/IssueMessages/IssueMessages.d.ts +17 -25
- package/types/components/IssuesPanel/IssuesPanel.d.ts +11 -15
- package/types/components/IssuesPanel/IssuesPanelControls.d.ts +1 -1
- package/types/components/IssuesPopover/IssuesPopover.d.ts +4 -4
- package/types/components/LoadAction/LoadAction.d.ts +7 -10
- package/types/components/NumericControl/NumericControl.d.ts +15 -21
- package/types/components/PathLink/PathLink.d.ts +4 -5
- package/types/components/PrintAction/PrintAction.d.ts +7 -11
- package/types/components/RadioGroupControl/RadioGroupControl.d.ts +12 -21
- package/types/components/RadioGroupControl/RadioGroupControlItem.d.ts +2 -2
- package/types/components/ResetOnChange/ResetOnChange.d.ts +6 -14
- package/types/components/ResetOnChange/index.d.ts +1 -1
- package/types/components/ResetOnChange/useResetOnChange.d.ts +22 -32
- package/types/components/SaveAction/SaveAction.d.ts +22 -30
- package/types/components/SelectControl/SelectControl.d.ts +11 -21
- package/types/components/SelectControl/SelectControlItem.d.ts +2 -2
- package/types/components/SelectControl/SelectControlItemGroup.d.ts +2 -3
- package/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +17 -35
- package/types/components/SelectMultipleControl/SelectMultipleControlItem.d.ts +1 -2
- package/types/components/SelectMultipleControl/SelectMultipleControlItemGroup.d.ts +2 -2
- package/types/components/SubmitAction/SubmitAction.d.ts +19 -33
- package/types/components/TableControl/TableControl.d.ts +27 -41
- package/types/components/TableControl/TableControlActionsColumn.d.ts +3 -5
- package/types/components/TableControl/TableControlAddRowTrigger.d.ts +7 -13
- package/types/components/TableControl/TableControlApi.d.ts +4 -4
- package/types/components/TableControl/TableControlColumn.d.ts +5 -8
- package/types/components/TableControl/TableControlColumnFns.d.ts +21 -31
- package/types/components/TableControl/TableControlColumnGroup.d.ts +3 -6
- package/types/components/TableControl/TableControlColumns.d.ts +4 -4
- package/types/components/TableControl/TableControlContent.d.ts +1 -1
- package/types/components/TableControl/TableControlIndexColumn.d.ts +2 -2
- package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -16
- package/types/components/TextControl/TextControl.d.ts +7 -13
- package/types/components/UnknownValue/UnknownValue.d.ts +1 -1
- package/types/components/ValidateAction/ValidateAction.d.ts +7 -10
- package/types/providers/ActivePathProvider/ActivePathProvider.d.ts +4 -7
- package/types/providers/LocalizationProvider/LocalizationProvider.d.ts +1 -4
- package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
- package/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +1 -1
- package/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +3 -3
- package/types/providers/PrefixSuffixProvider/usePrefix.d.ts +1 -4
- package/types/utils/mostSpecificPath.d.ts +4 -6
- package/types/utils/pathSpecificity.d.ts +7 -8
- package/types/utils/selectionTransformations.d.ts +2 -8
- package/types/utils/useControlAutofocus.d.ts +6 -8
- package/types/utils/useControlIssues.d.ts +4 -4
- package/types/utils/useFormLoader.d.ts +24 -31
- package/types/utils/useFormSaver.d.ts +29 -34
- package/types/utils/useFormValidator.d.ts +13 -20
- package/types/utils/useRegisterControl.d.ts +1 -1
- package/types/utils/useTemporalStringTransformer.d.ts +4 -10
- 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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
99
|
-
* </SelectMultipleControlItem>
|
|
100
|
-
* <SelectMultipleControlItem value="
|
|
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:
|
|
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
|
-
*
|
|
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`
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* - `TableControlRowsPerPage`: Optional component allowing the selection of the
|
|
108
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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;
|