@ostack.tech/ui-kform 0.1.1 → 0.2.0
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-C1hDoCmB.js +135 -0
- package/dist/chunks/en-C1hDoCmB.js.map +1 -0
- package/dist/locales/en-GB.js +10 -0
- package/dist/locales/en-GB.js.map +1 -0
- package/dist/locales/en-US.js +10 -0
- package/dist/locales/en-US.js.map +1 -0
- package/dist/locales/fr.js +137 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/pt.js +137 -0
- package/dist/locales/pt.js.map +1 -0
- package/dist/ostack-ui-kform.css +309 -309
- package/dist/ostack-ui-kform.js +1129 -1472
- package/dist/ostack-ui-kform.js.map +1 -1
- package/dist/types/components/Annexes/Annex.d.ts +5 -5
- package/dist/types/components/Annexes/Annexes.d.ts +10 -10
- package/dist/types/components/Annexes/AnnexesContext.d.ts +5 -5
- package/dist/types/components/Annexes/AnnexesManager.d.ts +15 -15
- package/dist/types/components/Annexes/AnnexesMenu.d.ts +4 -4
- package/dist/types/components/Annexes/AnnexesTabList.d.ts +3 -3
- package/dist/types/components/CheckboxControl/CheckboxControl.d.ts +6 -6
- package/dist/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +9 -9
- package/dist/types/components/ControlField/ControlField.d.ts +3 -3
- package/dist/types/components/ControlField/ControlFieldContext.d.ts +1 -2
- package/dist/types/components/DateControl/DateControl.d.ts +6 -6
- package/dist/types/components/DateRangeControl/DateRangeControl.d.ts +9 -9
- package/dist/types/components/FileControl/FileControl.d.ts +9 -9
- package/dist/types/components/FormApp/FormApp.d.ts +23 -15
- package/dist/types/components/FormApp/FormAppAutoFocus.d.ts +2 -0
- package/dist/types/components/FormApp/FormAppContext.d.ts +11 -13
- package/dist/types/components/FormApp/FormAppElement.d.ts +9 -0
- package/dist/types/components/FormApp/FormAppIssueMessages.d.ts +3 -3
- package/dist/types/components/FormApp/FormAppStatus.d.ts +2 -2
- package/dist/types/components/FormPages/FormPage.d.ts +17 -17
- package/dist/types/components/FormPages/FormPageHeader.d.ts +3 -3
- package/dist/types/components/FormPages/FormPages.d.ts +7 -7
- package/dist/types/components/FormPages/FormPagesContext.d.ts +4 -4
- package/dist/types/components/FormPages/FormPagesNavigation.d.ts +5 -5
- package/dist/types/components/FormPages/FormPagesSelect.d.ts +3 -3
- package/dist/types/components/FormPages/FormPagesSidebar.d.ts +3 -3
- package/dist/types/components/FormStepper/FormStepContent.d.ts +5 -5
- package/dist/types/components/FormStepper/FormStepList.d.ts +3 -3
- package/dist/types/components/FormStepper/FormStepper.d.ts +5 -5
- package/dist/types/components/FormStepper/FormStepperContext.d.ts +3 -3
- package/dist/types/components/IssueAlert/IssueAlert.d.ts +4 -4
- package/dist/types/components/IssueMessage/IssueMessage.d.ts +4 -4
- package/dist/types/components/IssueMessages/IssueMessages.d.ts +6 -6
- package/dist/types/components/IssuesPanel/IssuesPanel.d.ts +25 -25
- package/dist/types/components/IssuesPanel/IssuesPanelMessagesCard.d.ts +4 -4
- package/dist/types/components/IssuesPanel/IssuesPanelSummaryCard.d.ts +4 -4
- package/dist/types/components/IssuesPopover/IssuesPopover.d.ts +3 -3
- package/dist/types/components/LoadAction/LoadAction.d.ts +2 -2
- package/dist/types/components/NumericControl/NumericControl.d.ts +6 -6
- package/dist/types/components/PathLink/PathLink.d.ts +2 -2
- package/dist/types/components/RadioGroupControl/RadioGroupControl.d.ts +9 -9
- package/dist/types/components/SaveAction/SaveAction.d.ts +6 -6
- package/dist/types/components/SelectControl/SelectControl.d.ts +6 -6
- package/dist/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +6 -6
- package/dist/types/components/SubmitAction/SubmitAction.d.ts +20 -20
- package/dist/types/components/TableControl/TableControl.d.ts +7 -7
- package/dist/types/components/TableControl/TableControlAddRowTrigger.d.ts +4 -4
- package/dist/types/components/TableControl/TableControlApi.d.ts +2 -2
- package/dist/types/components/TableControl/TableControlCell.d.ts +3 -3
- package/dist/types/components/TableControl/TableControlColumn.d.ts +3 -3
- package/dist/types/components/TableControl/TableControlContent.d.ts +3 -3
- package/dist/types/components/TableControl/TableControlContext.d.ts +4 -4
- package/dist/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -9
- package/dist/types/components/TableControl/TableControlRow.d.ts +3 -3
- package/dist/types/components/TextControl/TextControl.d.ts +8 -8
- package/dist/types/components/TopBar/TopBar.d.ts +3 -3
- package/dist/types/components/TopBar/TopBarActions.d.ts +3 -3
- package/dist/types/components/ValidateAction/ValidateAction.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/locales/en-GB.d.ts +3 -0
- package/dist/types/locales/en-US.d.ts +3 -0
- package/dist/types/{locale → locales}/en.d.ts +2 -2
- package/dist/types/locales/fr.d.ts +3 -0
- package/dist/types/locales/index.d.ts +4 -0
- package/dist/types/locales/pt.d.ts +3 -0
- package/dist/types/providers/LocalizationProvider/LocalizationContext.d.ts +6 -4
- package/dist/types/{locale → providers/LocalizationProvider}/LocalizationObject.d.ts +14 -15
- package/dist/types/providers/LocalizationProvider/LocalizationProvider.d.ts +17 -6
- package/dist/types/providers/LocalizationProvider/index.d.ts +1 -0
- package/dist/types/providers/LocalizationProvider/useLocale.d.ts +6 -3
- package/dist/types/providers/PrefixSuffixProvider/PrefixSuffixContext.d.ts +1 -4
- package/dist/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +3 -3
- package/dist/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +12 -0
- package/dist/types/providers/PrefixSuffixProvider/index.d.ts +1 -0
- package/dist/types/utils/options.d.ts +4 -4
- package/dist/types/utils/selectionTransformations.d.ts +2 -1
- package/dist/types/utils/useControlAutofocus.d.ts +2 -2
- package/dist/types/utils/useControlIssues.d.ts +3 -3
- package/dist/types/utils/useFormLoader.d.ts +3 -3
- package/dist/types/utils/useFormSaver.d.ts +3 -3
- package/dist/types/utils/useRegisterControl.d.ts +6 -6
- package/package.json +26 -10
- package/dist/ostack-ui-kform.cjs +0 -7534
- package/dist/ostack-ui-kform.cjs.map +0 -1
- package/dist/types/locale/defaultLocale.d.ts +0 -3
- package/dist/types/locale/en-GB.d.ts +0 -3
- package/dist/types/locale/en-US.d.ts +0 -3
- package/dist/types/locale/fr-FR.d.ts +0 -3
- package/dist/types/locale/index.d.ts +0 -6
- package/dist/types/locale/pt-PT.d.ts +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type IssuesTrackerResult } from "@ostack.tech/kform-react";
|
|
2
2
|
import { Card, type IconButtonColor } from "@ostack.tech/ui";
|
|
3
|
-
import
|
|
3
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
4
4
|
import { type IssuesPanelProps } from "./IssuesPanel.tsx";
|
|
5
|
-
export interface IssuesPanelSummaryCardProps extends
|
|
5
|
+
export interface IssuesPanelSummaryCardProps extends ComponentPropsWithoutRef<typeof Card>, Pick<IssuesPanelProps, "errorsLabel" | "warningsLabel" | "noIssuesMessage" | "headerProps" | "loadingSpinnerProps" | "titleProps" | "iconProps"> {
|
|
6
6
|
issuesTrackerResult: IssuesTrackerResult;
|
|
7
|
-
renderControls: (buttonsColor?: IconButtonColor) =>
|
|
7
|
+
renderControls: (buttonsColor?: IconButtonColor) => ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const IssuesPanelSummaryCard:
|
|
9
|
+
export declare const IssuesPanelSummaryCard: import("react").ForwardRefExoticComponent<IssuesPanelSummaryCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { FeedbackPopover } from "@ostack.tech/ui";
|
|
3
|
-
import
|
|
3
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
4
4
|
/** Properties of the issues popover component. */
|
|
5
|
-
export interface IssuesPopoverProps extends
|
|
5
|
+
export interface IssuesPopoverProps extends ComponentPropsWithoutRef<typeof FeedbackPopover> {
|
|
6
6
|
path?: string | Path;
|
|
7
7
|
/**
|
|
8
8
|
* Paths relevant to this issues popover. When one of the relevant paths
|
|
@@ -12,4 +12,4 @@ export interface IssuesPopoverProps extends React.ComponentPropsWithoutRef<typeo
|
|
|
12
12
|
relevantPaths?: (string | Path)[];
|
|
13
13
|
}
|
|
14
14
|
/** Component used to display issues within a popover. */
|
|
15
|
-
export declare const IssuesPopover:
|
|
15
|
+
export declare const IssuesPopover: import("react").ForwardRefExoticComponent<IssuesPopoverProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ButtonProps } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
3
|
import { type FormLoaderOptions } from "../../utils/useFormLoader.tsx";
|
|
4
4
|
/** Properties of the load action. */
|
|
5
5
|
export interface LoadActionProps<T = unknown> extends Omit<ButtonProps, "children">, FormLoaderOptions<T> {
|
|
6
6
|
/** Action's label. */
|
|
7
|
-
label?:
|
|
7
|
+
label?: ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
10
10
|
* shortcut.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { type Numeric, type NumericInputController, type NumericInputOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { NumericInput } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentRef, type ReactNode, type Ref } from "react";
|
|
5
5
|
import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
|
|
6
6
|
/** Properties of the numeric control component. */
|
|
7
|
-
export interface NumericControlProps<T extends Numeric | null = Numeric | null> extends Omit<NumericInputOptions<T, string,
|
|
7
|
+
export interface NumericControlProps<T extends Numeric | null = Numeric | null> extends Omit<NumericInputOptions<T, string, ComponentRef<typeof NumericInput>>, "enabled" | "formatFromString" | "parseToString">, Omit<ComponentPropsWithoutRef<typeof NumericInput>, "defaultValue" | "value" | "onValueChange" | "valueIsUnformattedString" | "status"> {
|
|
8
8
|
/** Path to the value. */
|
|
9
9
|
path?: string | Path;
|
|
10
10
|
/**
|
|
@@ -19,7 +19,7 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
|
|
|
19
19
|
*
|
|
20
20
|
* This label has priority over the field's `ControlLabel`.
|
|
21
21
|
*/
|
|
22
|
-
issuesPanelLabel?:
|
|
22
|
+
issuesPanelLabel?: ReactNode;
|
|
23
23
|
/**
|
|
24
24
|
* Whether to display the issues associated with this control.
|
|
25
25
|
*
|
|
@@ -37,9 +37,9 @@ export interface NumericControlProps<T extends Numeric | null = Numeric | null>
|
|
|
37
37
|
*/
|
|
38
38
|
preventAutoFocus?: boolean;
|
|
39
39
|
/** Reference to the control's API. */
|
|
40
|
-
apiRef?:
|
|
40
|
+
apiRef?: Ref<NumericInputController<T, string, ComponentRef<typeof NumericInput>> | undefined>;
|
|
41
41
|
/** Properties to pass to the `IssueMessages` component. */
|
|
42
|
-
issueMessagesProps?: Omit<
|
|
42
|
+
issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "path" | "issues" | "messages" | "unwrapped">;
|
|
43
43
|
}
|
|
44
44
|
/** Numeric control component supporting (possibly nullable) numeric schemas. */
|
|
45
|
-
export declare const NumericControl:
|
|
45
|
+
export declare const NumericControl: import("react").ForwardRefExoticComponent<NumericControlProps<Numeric | null> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type AbsolutePath, type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { Link } from "@ostack.tech/ui";
|
|
3
|
-
import
|
|
3
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
4
4
|
/** Properties of the path link component. */
|
|
5
|
-
export interface PathLinkProps extends Omit<
|
|
5
|
+
export interface PathLinkProps extends Omit<ComponentPropsWithoutRef<typeof Link>, "href"> {
|
|
6
6
|
/** KForm path to link to. */
|
|
7
7
|
to: string | Path;
|
|
8
8
|
/**
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { type InputController, type InputOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { Radio, RadioGroup } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentRef, type Key, type ReactNode, type Ref } from "react";
|
|
5
5
|
import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
|
|
6
6
|
/** Radio in object notation. */
|
|
7
|
-
export type RadioObject<T = unknown> = Omit<
|
|
7
|
+
export type RadioObject<T = unknown> = Omit<ComponentPropsWithRef<typeof Radio>, "value" | "children"> & {
|
|
8
8
|
/** Option value. */
|
|
9
9
|
value: T;
|
|
10
10
|
/** Option's rendered text. */
|
|
11
|
-
text?:
|
|
11
|
+
text?: ReactNode;
|
|
12
12
|
/** Option's unique key. */
|
|
13
|
-
key?:
|
|
13
|
+
key?: Key;
|
|
14
14
|
};
|
|
15
15
|
/** Properties of the radio group control component. */
|
|
16
|
-
export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T, string,
|
|
16
|
+
export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T, string, ComponentRef<typeof RadioGroup>>, "enabled" | "format" | "parse">, Omit<ComponentPropsWithoutRef<typeof RadioGroup>, "defaultValue" | "value" | "onValueChange" | "children" | "status"> {
|
|
17
17
|
/** Path to the value. */
|
|
18
18
|
path?: string | Path;
|
|
19
19
|
/** RadioGroup control options. */
|
|
@@ -30,7 +30,7 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
|
|
|
30
30
|
*
|
|
31
31
|
* This label has priority over the field's `ControlLabel`.
|
|
32
32
|
*/
|
|
33
|
-
issuesPanelLabel?:
|
|
33
|
+
issuesPanelLabel?: ReactNode;
|
|
34
34
|
/**
|
|
35
35
|
* Whether to display the issues associated with this control.
|
|
36
36
|
*
|
|
@@ -48,9 +48,9 @@ export interface RadioGroupControlProps<T = unknown> extends Omit<InputOptions<T
|
|
|
48
48
|
*/
|
|
49
49
|
preventAutoFocus?: boolean;
|
|
50
50
|
/** Reference to the control's API. */
|
|
51
|
-
apiRef?:
|
|
51
|
+
apiRef?: Ref<InputController<T, string, ComponentRef<typeof RadioGroup>> | undefined>;
|
|
52
52
|
/** Properties to pass to the `IssueMessages` component. */
|
|
53
|
-
issueMessagesProps?: Omit<
|
|
53
|
+
issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "path" | "issues" | "messages" | "unwrapped">;
|
|
54
54
|
}
|
|
55
55
|
/** Radio group control component supporting schemas of any type. */
|
|
56
|
-
export declare const RadioGroupControl:
|
|
56
|
+
export declare const RadioGroupControl: import("react").ForwardRefExoticComponent<RadioGroupControlProps<unknown> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ButtonProps, DropdownMenuContent, IconButton } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
3
3
|
import { type FormSaverOptions } from "../../utils/useFormSaver.tsx";
|
|
4
4
|
/** Properties of the save action. */
|
|
5
5
|
export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "children">, Omit<FormSaverOptions<T>, "overwrite"> {
|
|
6
6
|
/** Action's label. */
|
|
7
|
-
label?:
|
|
7
|
+
label?: ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
10
10
|
* shortcut.
|
|
@@ -27,9 +27,9 @@ export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "childre
|
|
|
27
27
|
*/
|
|
28
28
|
disableOverwrite?: boolean;
|
|
29
29
|
/** Label of the save options button. */
|
|
30
|
-
saveOptionsLabel?:
|
|
30
|
+
saveOptionsLabel?: ReactNode;
|
|
31
31
|
/** Label of the action's "save as" sub-action. */
|
|
32
|
-
saveAsLabel?:
|
|
32
|
+
saveAsLabel?: ReactNode;
|
|
33
33
|
/**
|
|
34
34
|
* Keybinds for triggering the "save as" sub-action. Set to `null` to disable
|
|
35
35
|
* the keyboard shortcut.
|
|
@@ -43,9 +43,9 @@ export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "childre
|
|
|
43
43
|
*/
|
|
44
44
|
saveAsKeybinds?: string | string[] | null;
|
|
45
45
|
/** Properties to pass to the save options button component. */
|
|
46
|
-
saveOptionsProps?: Omit<Partial<
|
|
46
|
+
saveOptionsProps?: Omit<Partial<ComponentPropsWithRef<typeof IconButton>>, "label">;
|
|
47
47
|
/** Properties to pass to the save options dropdown menu component. */
|
|
48
|
-
dropdownMenuProps?:
|
|
48
|
+
dropdownMenuProps?: ComponentPropsWithRef<typeof DropdownMenuContent>;
|
|
49
49
|
}
|
|
50
50
|
/** Action used to save the form to a file. */
|
|
51
51
|
export declare function SaveAction<T = unknown>({ label, keybinds, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant, color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, id, successMessage, errorMessage, saveOptionsProps, dropdownMenuProps, ...otherProps }: SaveActionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { type InputController, type InputOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { Select } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentRef, type ReactNode, type Ref } from "react";
|
|
5
5
|
import { type OptionObject, type OptionsGroupObject } from "../../utils/options.ts";
|
|
6
6
|
import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
|
|
7
7
|
/** Properties of the select control component. */
|
|
8
|
-
export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, string,
|
|
8
|
+
export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, string, ComponentRef<typeof Select>>, "enabled" | "format" | "parse">, Omit<ComponentPropsWithoutRef<typeof Select>, "multiple" | "defaultValue" | "value" | "onValueChange" | "children" | "status"> {
|
|
9
9
|
/** Path to the value. */
|
|
10
10
|
path?: string | Path;
|
|
11
11
|
/** Select control options. */
|
|
@@ -22,7 +22,7 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, st
|
|
|
22
22
|
*
|
|
23
23
|
* This label has priority over the field's `ControlLabel`.
|
|
24
24
|
*/
|
|
25
|
-
issuesPanelLabel?:
|
|
25
|
+
issuesPanelLabel?: ReactNode;
|
|
26
26
|
/**
|
|
27
27
|
* Whether to display the issues associated with this control.
|
|
28
28
|
*
|
|
@@ -40,9 +40,9 @@ export interface SelectControlProps<T = unknown> extends Omit<InputOptions<T, st
|
|
|
40
40
|
*/
|
|
41
41
|
preventAutoFocus?: boolean;
|
|
42
42
|
/** Reference to the control's API. */
|
|
43
|
-
apiRef?:
|
|
43
|
+
apiRef?: Ref<InputController<T, string, ComponentRef<typeof Select>> | undefined>;
|
|
44
44
|
/** Properties to pass to the `IssueMessages` component. */
|
|
45
|
-
issueMessagesProps?: Omit<
|
|
45
|
+
issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "path" | "issues" | "messages" | "unwrapped">;
|
|
46
46
|
}
|
|
47
47
|
/** Select control component supporting schemas of any type. */
|
|
48
|
-
export declare const SelectControl:
|
|
48
|
+
export declare const SelectControl: import("react").ForwardRefExoticComponent<SelectControlProps<unknown> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Path } from "@ostack.tech/kform";
|
|
2
2
|
import { type Listable, type ListableInputController, type ListableInputOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { Select } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentRef, type ReactNode, type Ref } from "react";
|
|
5
5
|
import { type OptionObject, type OptionsGroupObject } from "../../utils/options.ts";
|
|
6
6
|
import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
|
|
7
7
|
/** Properties of the select multiple control component. */
|
|
8
|
-
export interface SelectMultipleControlProps<T = unknown, TListable extends Listable<T> | null = Listable<T> | null> extends Omit<ListableInputOptions<T, TListable, string[],
|
|
8
|
+
export interface SelectMultipleControlProps<T = unknown, TListable extends Listable<T> | null = Listable<T> | null> extends Omit<ListableInputOptions<T, TListable, string[], ComponentRef<typeof Select>>, "enabled" | "formatFromArray" | "parseToArray">, Omit<ComponentPropsWithoutRef<typeof Select>, "multiple" | "defaultValue" | "value" | "onValueChange" | "children" | "status"> {
|
|
9
9
|
/** Path to the value. */
|
|
10
10
|
path?: string | Path;
|
|
11
11
|
/**
|
|
@@ -20,7 +20,7 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
|
|
|
20
20
|
*
|
|
21
21
|
* This label has priority over the field's `ControlLabel`.
|
|
22
22
|
*/
|
|
23
|
-
issuesPanelLabel?:
|
|
23
|
+
issuesPanelLabel?: ReactNode;
|
|
24
24
|
/**
|
|
25
25
|
* Whether to display the issues associated with this control.
|
|
26
26
|
*
|
|
@@ -40,9 +40,9 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
|
|
|
40
40
|
*/
|
|
41
41
|
preventAutoFocus?: boolean;
|
|
42
42
|
/** Reference to the control's API. */
|
|
43
|
-
apiRef?:
|
|
43
|
+
apiRef?: Ref<ListableInputController<T, TListable, string[], ComponentRef<typeof Select>> | undefined>;
|
|
44
44
|
/** Properties to pass to the `IssueMessages` component. */
|
|
45
|
-
issueMessagesProps?: Omit<
|
|
45
|
+
issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "path" | "issues" | "messages" | "unwrapped">;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Select multiple control component supporting (possibly nullable) listable
|
|
@@ -52,4 +52,4 @@ export interface SelectMultipleControlProps<T = unknown, TListable extends Lista
|
|
|
52
52
|
* the control contains no elements. Note, however, that the form may still hold
|
|
53
53
|
* an empty listable as value if set programmatically.
|
|
54
54
|
*/
|
|
55
|
-
export declare const SelectMultipleControl:
|
|
55
|
+
export declare const SelectMultipleControl: import("react").ForwardRefExoticComponent<SelectMultipleControlProps<unknown, Listable<unknown> | null> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type LocatedValidationWarning } from "@ostack.tech/kform";
|
|
2
2
|
import { type SubmitOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { Alert, AlertDialogBody, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Button, type ButtonProps, Checkbox } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
5
5
|
/** Properties of the submit action. */
|
|
6
6
|
export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends Omit<ButtonProps, "children" | "onSubmit">, Pick<Required<SubmitOptions<T, TSubmitResult>>, "onSubmit">, Omit<SubmitOptions<T, TSubmitResult>, "onSubmit"> {
|
|
7
7
|
/** Action's label. */
|
|
8
|
-
label?:
|
|
8
|
+
label?: ReactNode;
|
|
9
9
|
/**
|
|
10
10
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
11
11
|
* shortcut.
|
|
@@ -26,12 +26,12 @@ export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends
|
|
|
26
26
|
*/
|
|
27
27
|
confirmWarnings?: boolean;
|
|
28
28
|
/** Title of the confirmation dialog which appears when submitting the form. */
|
|
29
|
-
dialogTitle?:
|
|
29
|
+
dialogTitle?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
|
|
30
30
|
/**
|
|
31
31
|
* Description of the confirmation dialog which appears when submitting the
|
|
32
32
|
* form.
|
|
33
33
|
*/
|
|
34
|
-
dialogDescription?:
|
|
34
|
+
dialogDescription?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
|
|
35
35
|
/**
|
|
36
36
|
* Body of the confirmation dialog which appears when submitting the form.
|
|
37
37
|
*
|
|
@@ -39,56 +39,56 @@ export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends
|
|
|
39
39
|
* and will be displayed between the description and the “confirm warnings
|
|
40
40
|
* alert”, when it exists.
|
|
41
41
|
*/
|
|
42
|
-
dialogBody?:
|
|
42
|
+
dialogBody?: ReactNode | ((formValue: T, warnings?: LocatedValidationWarning[]) => ReactNode);
|
|
43
43
|
/**
|
|
44
44
|
* Label of the checkbox which prompts users to confirm that they intend to
|
|
45
45
|
* proceed with submission in the event of warnings in the form.
|
|
46
46
|
*/
|
|
47
|
-
confirmWarningsCheckboxLabel?:
|
|
47
|
+
confirmWarningsCheckboxLabel?: ReactNode;
|
|
48
48
|
/**
|
|
49
49
|
* Text of the OK button in the confirmation dialog which appears when
|
|
50
50
|
* submitting the form.
|
|
51
51
|
*/
|
|
52
|
-
dialogOkText?:
|
|
52
|
+
dialogOkText?: ReactNode;
|
|
53
53
|
/**
|
|
54
54
|
* Text of the cancel button in the confirmation dialog which appears when
|
|
55
55
|
* submitting the form.
|
|
56
56
|
*/
|
|
57
|
-
dialogCancelText?:
|
|
57
|
+
dialogCancelText?: ReactNode;
|
|
58
58
|
/**
|
|
59
59
|
* Message to show in a toast after a successful submission.
|
|
60
60
|
*
|
|
61
61
|
* @param submitResult Result of `onSubmit`.
|
|
62
62
|
* @returns Message to show in a toast.
|
|
63
63
|
*/
|
|
64
|
-
successMessage?: (submitResult: TSubmitResult) =>
|
|
64
|
+
successMessage?: (submitResult: TSubmitResult) => ReactNode;
|
|
65
65
|
/**
|
|
66
66
|
* Message to show in a toast when an error occurs while submitting the form.
|
|
67
67
|
*
|
|
68
68
|
* @param error Error that occurred.
|
|
69
69
|
* @returns Message to show in a toast.
|
|
70
70
|
*/
|
|
71
|
-
errorMessage?: (error: unknown) =>
|
|
71
|
+
errorMessage?: (error: unknown) => ReactNode;
|
|
72
72
|
/** Properties to pass to the confirmation dialog content component. */
|
|
73
|
-
dialogContentProps?: Omit<
|
|
73
|
+
dialogContentProps?: Omit<ComponentPropsWithRef<typeof AlertDialogContent>, "children">;
|
|
74
74
|
/** Properties to pass to the confirmation dialog header component. */
|
|
75
|
-
dialogHeaderProps?: Omit<
|
|
75
|
+
dialogHeaderProps?: Omit<ComponentPropsWithRef<typeof AlertDialogHeader>, "children">;
|
|
76
76
|
/** Properties to pass to the confirmation dialog title component. */
|
|
77
|
-
dialogTitleProps?: Omit<
|
|
77
|
+
dialogTitleProps?: Omit<ComponentPropsWithRef<typeof AlertDialogTitle>, "children">;
|
|
78
78
|
/** Properties to pass to the confirmation dialog body component. */
|
|
79
|
-
dialogBodyProps?: Omit<
|
|
79
|
+
dialogBodyProps?: Omit<ComponentPropsWithRef<typeof AlertDialogBody>, "children">;
|
|
80
80
|
/** Properties to pass to the confirmation dialog description component. */
|
|
81
|
-
dialogDescriptionProps?: Omit<
|
|
81
|
+
dialogDescriptionProps?: Omit<ComponentPropsWithRef<typeof AlertDialogDescription>, "children">;
|
|
82
82
|
/** Properties to pass to the confirmation dialog footer component. */
|
|
83
|
-
dialogFooterProps?: Omit<
|
|
83
|
+
dialogFooterProps?: Omit<ComponentPropsWithRef<typeof AlertDialogFooter>, "children">;
|
|
84
84
|
/** Properties to pass to the confirmation dialog OK button component. */
|
|
85
|
-
dialogOkButtonProps?: Omit<
|
|
85
|
+
dialogOkButtonProps?: Omit<ComponentPropsWithRef<typeof Button>, "children">;
|
|
86
86
|
/** Properties to pass to the confirmation dialog cancel button component. */
|
|
87
|
-
dialogCancelButtonProps?: Omit<
|
|
87
|
+
dialogCancelButtonProps?: Omit<ComponentPropsWithRef<typeof Button>, "children">;
|
|
88
88
|
/** Properties to pass to the alert used to confirm warnings. */
|
|
89
|
-
confirmWarningsAlertProps?: Omit<
|
|
89
|
+
confirmWarningsAlertProps?: Omit<ComponentPropsWithRef<typeof Alert>, "children">;
|
|
90
90
|
/** Properties to pass to the checkbox used to confirm warnings. */
|
|
91
|
-
confirmWarningsCheckboxProps?: Omit<
|
|
91
|
+
confirmWarningsCheckboxProps?: Omit<ComponentPropsWithRef<typeof Checkbox>, "checked" | "onCheckedChange" | "children">;
|
|
92
92
|
}
|
|
93
93
|
/** Action used to submit the form. */
|
|
94
94
|
export declare function SubmitAction<T = unknown, TSubmitResult = unknown>({ onSubmit, onInvalidSubmit, onSuccessfulSubmit, onFailedSubmit, setTouchedOnSubmit, validateOnSubmit, setPristineOnSuccessfulSubmit, convertExternalIssuesTableRowIndicesToIds, label, keybinds, confirmWarnings, loading, disabled, onClick, dialogTitle, dialogDescription, dialogBody, confirmWarningsCheckboxLabel, dialogOkText, dialogCancelText, successMessage, errorMessage, dialogContentProps, dialogHeaderProps, dialogTitleProps, dialogBodyProps, dialogDescriptionProps, dialogFooterProps, dialogOkButtonProps, dialogCancelButtonProps, confirmWarningsAlertProps, confirmWarningsCheckboxProps, ...otherProps }: SubmitActionProps<T, TSubmitResult>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Path, type Table } from "@ostack.tech/kform";
|
|
2
2
|
import { type ControllerOptions } from "@ostack.tech/kform-react";
|
|
3
3
|
import { DataTable } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode, type Ref } from "react";
|
|
5
5
|
import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
|
|
6
6
|
import { type TableControlApi } from "./TableControlApi.ts";
|
|
7
7
|
import { type TableControlColumn, type TableControlColumns } from "./TableControlColumn.tsx";
|
|
8
8
|
/** Properties of the table control component. */
|
|
9
|
-
export interface TableControlProps<T = unknown, TTable extends Table<T> | null = Table<T> | null> extends Omit<
|
|
9
|
+
export interface TableControlProps<T = unknown, TTable extends Table<T> | null = Table<T> | null> extends Omit<ComponentPropsWithoutRef<typeof DataTable>, "columns" | "rows" | "getRows" | "rowKey" | "loading" | "defaultFilter" | "filter" | "onFilterChange" | "defaultSortBy" | "sortBy" | "defaultSortDirection" | "sortDirection" | "onSort" | "showSelectionColumn" | "defaultSelectedRows" | "selectedRows" | "onSelectedRowsChange" | "apiRef">, Omit<ControllerOptions<TTable>, "enabled"> {
|
|
10
10
|
/** Control's path. */
|
|
11
11
|
path?: string | Path;
|
|
12
12
|
/**
|
|
@@ -21,7 +21,7 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
|
|
|
21
21
|
*
|
|
22
22
|
* This label has priority over the table's `ControlLabel`.
|
|
23
23
|
*/
|
|
24
|
-
issuesPanelLabel?:
|
|
24
|
+
issuesPanelLabel?: ReactNode;
|
|
25
25
|
/**
|
|
26
26
|
* Whether to display the issues associated with this control.
|
|
27
27
|
*
|
|
@@ -50,15 +50,15 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
|
|
|
50
50
|
*/
|
|
51
51
|
preventAutoFocus?: boolean;
|
|
52
52
|
/** Reference to the control's API. */
|
|
53
|
-
apiRef?:
|
|
53
|
+
apiRef?: Ref<TableControlApi<T, TTable> | undefined>;
|
|
54
54
|
/** Properties to pass to the `IssueMessages` component. */
|
|
55
|
-
issueMessagesProps?: Omit<
|
|
55
|
+
issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "path" | "issues" | "messages" | "unwrapped">;
|
|
56
56
|
}
|
|
57
57
|
/** Table control component supporting (possibly nullable) collection schemas. */
|
|
58
|
-
export declare const TableControl:
|
|
58
|
+
export declare const TableControl: import("react").ForwardRefExoticComponent<TableControlProps<unknown, Table<unknown> | null> & import("react").RefAttributes<HTMLTableElement>>;
|
|
59
59
|
/** Properties of the table control cell renderer. */
|
|
60
60
|
export interface TableControlCellRendererProps<T = unknown> {
|
|
61
61
|
render: NonNullable<TableControlColumn<T>["render"]>;
|
|
62
62
|
}
|
|
63
63
|
/** Renderer of a table control cell. */
|
|
64
|
-
export declare function TableControlCellRenderer<T = unknown>({ render, }: TableControlCellRendererProps<T>):
|
|
64
|
+
export declare function TableControlCellRenderer<T = unknown>({ render, }: TableControlCellRendererProps<T>): ReactNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Button } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
3
3
|
/** Properties of the table control add row trigger component. */
|
|
4
|
-
export interface TableControlAddRowTriggerProps extends
|
|
4
|
+
export interface TableControlAddRowTriggerProps extends ComponentPropsWithoutRef<typeof Button> {
|
|
5
5
|
/**
|
|
6
6
|
* Text displayed on the button rendered by default when no `children` are
|
|
7
7
|
* provided. If `children` are provided, this property has no effect.
|
|
8
8
|
*/
|
|
9
|
-
defaultButtonText?:
|
|
9
|
+
defaultButtonText?: ReactNode;
|
|
10
10
|
/** Function called after the row has been added. */
|
|
11
11
|
onRowAdded?: () => void;
|
|
12
12
|
/**
|
|
@@ -22,4 +22,4 @@ export interface TableControlAddRowTriggerProps extends React.ComponentPropsWith
|
|
|
22
22
|
* By default, it renders a button with text `defaultButtonText`, however, this
|
|
23
23
|
* can be overriden by providing `children`.
|
|
24
24
|
*/
|
|
25
|
-
export declare const TableControlAddRowTrigger:
|
|
25
|
+
export declare const TableControlAddRowTrigger: import("react").ForwardRefExoticComponent<TableControlAddRowTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Table, type TableRowId } from "@ostack.tech/kform";
|
|
2
2
|
import { type Controller } from "@ostack.tech/kform-react";
|
|
3
3
|
import { type DataTableScrollToOptions } from "@ostack.tech/ui";
|
|
4
|
-
import
|
|
4
|
+
import { type RefObject } from "react";
|
|
5
5
|
/** Imperative table control API. */
|
|
6
6
|
export type TableControlApi<T = unknown, TTable extends Table<T> | null = Table<T> | null> = Controller<TTable> & {
|
|
7
7
|
/**
|
|
@@ -22,4 +22,4 @@ export type TableControlApi<T = unknown, TTable extends Table<T> | null = Table<
|
|
|
22
22
|
goToId: (id: TableRowId, scrollOptions?: DataTableScrollToOptions) => void;
|
|
23
23
|
};
|
|
24
24
|
/** Hook used to access the table control API. */
|
|
25
|
-
export declare function useTableControlApiRef<T = unknown, TTable extends Table<T> | null = Table<T> | null>():
|
|
25
|
+
export declare function useTableControlApiRef<T = unknown, TTable extends Table<T> | null = Table<T> | null>(): RefObject<TableControlApi<T, TTable> | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTableCell } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the table control cell. */
|
|
4
|
-
export interface TableControlCellProps extends
|
|
4
|
+
export interface TableControlCellProps extends ComponentPropsWithoutRef<typeof DataTableCell> {
|
|
5
5
|
}
|
|
6
6
|
/** Cell of the table control. */
|
|
7
|
-
export declare const TableControlCell:
|
|
7
|
+
export declare const TableControlCell: import("react").ForwardRefExoticComponent<TableControlCellProps & import("react").RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Controller } from "@ostack.tech/kform-react";
|
|
2
2
|
import { type DataTableColumn } from "@ostack.tech/ui";
|
|
3
|
-
import
|
|
3
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
4
4
|
import { TableControlRemoveRowTrigger } from "./TableControlRemoveRowTrigger.tsx";
|
|
5
5
|
/** Array of table control columns. */
|
|
6
6
|
export type TableControlColumns<T = unknown> = (TableControlColumn<T> | ((tableControlStatus: TableControlStatus) => TableControlColumn<T> | false | null | undefined) | false | null | undefined)[];
|
|
@@ -21,7 +21,7 @@ export interface TableControlColumn<T = unknown, TValue = any> extends Omit<Data
|
|
|
21
21
|
/** Sub columns of this column. */
|
|
22
22
|
subColumns?: TableControlColumns<T>;
|
|
23
23
|
/** Function used to render the cell's content. */
|
|
24
|
-
render?: (rowController: TableControlRowController<T>) =>
|
|
24
|
+
render?: (rowController: TableControlRowController<T>) => ReactNode;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Pre-configured column used to display the index of each row. By default, it
|
|
@@ -54,5 +54,5 @@ export declare function tableControlIndexColumn<T = unknown, TValue = any>(overr
|
|
|
54
54
|
* @returns Table control column used to display the actions of each row.
|
|
55
55
|
*/
|
|
56
56
|
export declare function tableControlActionsColumn<T = unknown, TValue = any>({ removeRowProps, ...columnOverrides }?: TableControlColumn<T, TValue> & {
|
|
57
|
-
removeRowProps?:
|
|
57
|
+
removeRowProps?: ComponentPropsWithRef<typeof TableControlRemoveRowTrigger>;
|
|
58
58
|
}): (tableControlStatus: TableControlStatus) => TableControlColumn<T, TValue> | false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTableContent } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the table control content component. */
|
|
4
|
-
export interface TableControlContentProps extends Omit<
|
|
4
|
+
export interface TableControlContentProps extends Omit<ComponentPropsWithoutRef<typeof DataTableContent>, "status"> {
|
|
5
5
|
}
|
|
6
6
|
/** Component containing the content of the table control. */
|
|
7
|
-
export declare const TableControlContent:
|
|
7
|
+
export declare const TableControlContent: import("react").ForwardRefExoticComponent<TableControlContentProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type AbsolutePath, type Table, type TableRowId } from "@ostack.tech/kform";
|
|
2
2
|
import { type FormatterController } from "@ostack.tech/kform-react";
|
|
3
|
-
import
|
|
3
|
+
import { type Ref } from "react";
|
|
4
4
|
import { type UseRegisterControlResult } from "../../utils/useRegisterControl.tsx";
|
|
5
5
|
import { type TableControlRowController } from "./TableControlColumn.tsx";
|
|
6
6
|
/** Value of the table control context. */
|
|
7
7
|
export interface TableControlContextValue<T = any, TTable extends Table<T> | null = Table<T> | null> {
|
|
8
8
|
controller: TableControlController<T, TTable>;
|
|
9
|
-
autofocusRef:
|
|
9
|
+
autofocusRef: Ref<HTMLDivElement>;
|
|
10
10
|
handleFocus: UseRegisterControlResult<HTMLDivElement>["handleFocus"];
|
|
11
11
|
size?: number;
|
|
12
12
|
maxRows?: number;
|
|
@@ -17,10 +17,10 @@ export type TableControlController<T = any, TTable extends Table<T> | null = Tab
|
|
|
17
17
|
removeRow: (path: AbsolutePath) => PromiseLike<void> | void;
|
|
18
18
|
};
|
|
19
19
|
/** Table control context. */
|
|
20
|
-
export declare const TableControlContext:
|
|
20
|
+
export declare const TableControlContext: import("react").Context<TableControlContextValue<any, Table<any> | null> | null>;
|
|
21
21
|
/** Hook providing access to the table control context. */
|
|
22
22
|
export declare function useTableControlContext<T = unknown, TTable extends Table<T> | null = Table<T> | null>(): TableControlContextValue<T, TTable>;
|
|
23
23
|
/** Table control row context. */
|
|
24
|
-
export declare const TableControlRowContext:
|
|
24
|
+
export declare const TableControlRowContext: import("react").Context<TableControlRowController | null>;
|
|
25
25
|
/** Hook providing access to the table control row context. */
|
|
26
26
|
export declare function useTableControlRowContext<T>(): TableControlRowController<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IconButton } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
3
3
|
/** Properties of the table control remove row trigger component. */
|
|
4
|
-
export interface TableControlRemoveRowTriggerProps extends Omit<Partial<
|
|
4
|
+
export interface TableControlRemoveRowTriggerProps extends Omit<Partial<ComponentPropsWithoutRef<typeof IconButton>>, "children"> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to show a confirmation message when removing a row.
|
|
7
7
|
*
|
|
@@ -19,25 +19,25 @@ export interface TableControlRemoveRowTriggerProps extends Omit<Partial<React.Co
|
|
|
19
19
|
* Label displayed on the icon button rendered by default when no `children`
|
|
20
20
|
* are provided. If `children` are provided, this property has no effect.
|
|
21
21
|
*/
|
|
22
|
-
defaultButtonLabel?:
|
|
22
|
+
defaultButtonLabel?: ReactNode;
|
|
23
23
|
/** Title of the confirmation dialog when `showConfirmation` is `true`. */
|
|
24
|
-
confirmDialogTitle?:
|
|
24
|
+
confirmDialogTitle?: ReactNode;
|
|
25
25
|
/**
|
|
26
26
|
* Message of the confirmation dialog when `showConfirmation` is `true`.
|
|
27
27
|
*
|
|
28
28
|
* @param index Index of the row being removed.
|
|
29
29
|
*/
|
|
30
|
-
confirmDialogMessage?: (index: number) =>
|
|
30
|
+
confirmDialogMessage?: (index: number) => ReactNode;
|
|
31
31
|
/**
|
|
32
32
|
* Ok button text of the confirmation dialog when `showConfirmation` is
|
|
33
33
|
* `true`.
|
|
34
34
|
*/
|
|
35
|
-
confirmDialogOkText?:
|
|
35
|
+
confirmDialogOkText?: ReactNode;
|
|
36
36
|
/**
|
|
37
37
|
* Cancel button text of the confirmation dialog when `showConfirmation` is
|
|
38
38
|
* `true`.
|
|
39
39
|
*/
|
|
40
|
-
confirmDialogCancelText?:
|
|
40
|
+
confirmDialogCancelText?: ReactNode;
|
|
41
41
|
/**
|
|
42
42
|
* Whether to show the trigger when the table is read-only.
|
|
43
43
|
*
|
|
@@ -50,7 +50,7 @@ export interface TableControlRemoveRowTriggerProps extends Omit<Partial<React.Co
|
|
|
50
50
|
* passed as children which will receive an argument with whether the row is
|
|
51
51
|
* currently being removed.
|
|
52
52
|
*/
|
|
53
|
-
children?:
|
|
53
|
+
children?: ReactNode;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Trigger used to remove a row of a table controlled by a table control.
|
|
@@ -58,4 +58,4 @@ export interface TableControlRemoveRowTriggerProps extends Omit<Partial<React.Co
|
|
|
58
58
|
* By default, it renders an icon button with label `defaultButtonLabel`,
|
|
59
59
|
* however, this can be overriden by providing `children`.
|
|
60
60
|
*/
|
|
61
|
-
export declare const TableControlRemoveRowTrigger:
|
|
61
|
+
export declare const TableControlRemoveRowTrigger: import("react").ForwardRefExoticComponent<TableControlRemoveRowTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTableRow } from "@ostack.tech/ui";
|
|
2
|
-
import
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
3
|
/** Properties of the table control row. */
|
|
4
|
-
export interface TableControlRowProps extends
|
|
4
|
+
export interface TableControlRowProps extends ComponentPropsWithoutRef<typeof DataTableRow> {
|
|
5
5
|
}
|
|
6
6
|
/** Row of a table control. */
|
|
7
|
-
export declare const TableControlRow:
|
|
7
|
+
export declare const TableControlRow: import("react").NamedExoticComponent<TableControlRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|