@ostack.tech/ui-kform 0.16.4 → 1.0.0-rc.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-CKrk2smU.js → en-D4xMcf6Q.js} +3 -2
- package/dist/chunks/{en-CKrk2smU.js.map → en-D4xMcf6Q.js.map} +1 -1
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +2 -1
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/index.js +5 -0
- package/dist/locales/pt-PT.js +2 -1
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui-kform.css +17 -1
- package/dist/ostack-ui-kform.js +163 -107
- package/dist/ostack-ui-kform.js.map +1 -1
- package/package.json +6 -2
- package/scss/components/Annexes/_Annexes.scss +6 -0
- package/scss/components/TopBar/_TopBar.scss +13 -1
- package/types/components/FileControl/FileControl.d.ts +1 -1
- package/types/components/LoadAction/LoadAction.d.ts +2 -5
- package/types/components/PrintAction/PrintAction.d.ts +2 -5
- package/types/components/SaveAction/SaveAction.d.ts +8 -10
- package/types/components/SubmitAction/SubmitAction.d.ts +2 -4
- package/types/components/TableControl/TableControl.d.ts +4 -1
- package/types/components/TableControl/TableControlAddRowTrigger.d.ts +2 -4
- package/types/components/TableControl/TableControlColumnFns.d.ts +4 -1
- package/types/components/TableControl/TableControlContent.d.ts +1 -1
- package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +2 -2
- package/types/components/TopBar/TopBarActions.d.ts +4 -4
- package/types/components/TopBar/TopBarActionsSecondary.d.ts +6 -0
- package/types/components/TopBar/index.d.ts +1 -0
- package/types/components/ValidateAction/ValidateAction.d.ts +2 -5
- package/types/index.d.ts +0 -1
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ostack.tech/ui-kform",
|
|
3
3
|
"description": "Integration of ostack/UI with ostack/KForm.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0-rc.1",
|
|
5
5
|
"homepage": "https://ui.ostack.tech/",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Opensoft",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./types/index.d.ts",
|
|
23
23
|
"import": "./dist/ostack-ui-kform.js"
|
|
24
24
|
},
|
|
25
|
+
"./locales": {
|
|
26
|
+
"types": "./types/locales/index.d.ts",
|
|
27
|
+
"import": "./dist/locales/index.js"
|
|
28
|
+
},
|
|
25
29
|
"./locales/*": {
|
|
26
30
|
"types": "./types/locales/*.d.ts",
|
|
27
31
|
"import": "./dist/locales/*.js"
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
"@fortawesome/free-solid-svg-icons": "^6.2.0 || ^7.0.0",
|
|
52
56
|
"@ostack.tech/kform": "~1.0.0-rc.1",
|
|
53
57
|
"@ostack.tech/kform-react": "~1.0.0-rc.1",
|
|
54
|
-
"@ostack.tech/ui": "~0.
|
|
58
|
+
"@ostack.tech/ui": "~1.0.0-rc.1",
|
|
55
59
|
"@types/react": "^19.0.0",
|
|
56
60
|
"@types/react-dom": "^19.0.0",
|
|
57
61
|
"date-fns": "^4.1.0",
|
|
@@ -42,7 +42,19 @@
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
&__actions {
|
|
45
|
+
&__actions-container {
|
|
46
|
+
align-self: stretch;
|
|
46
47
|
margin: $top-bar-actions-margin;
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
&__actions {
|
|
51
|
+
height: 100%;
|
|
52
|
+
margin-left: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include o-ui.media-breakpoint-up(sm) {
|
|
56
|
+
&__actions-container {
|
|
57
|
+
flex: 1 0 auto;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
48
60
|
}
|
|
@@ -57,7 +57,7 @@ export interface FileControlProps<T extends KFormFile | null = KFormFile | null>
|
|
|
57
57
|
/**
|
|
58
58
|
* Type of interaction with the selected file.
|
|
59
59
|
*
|
|
60
|
-
* @default view
|
|
60
|
+
* @default "view"
|
|
61
61
|
*/
|
|
62
62
|
fileInteraction?: FileControlFileInteraction;
|
|
63
63
|
/** Label of the button used to open the file viewer. */
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import { type ActionButtonProps } from "@ostack.tech/ui";
|
|
3
2
|
import { type FormLoaderOptions } from "../../utils/useFormLoader.tsx";
|
|
4
3
|
/** Default “load” keybinds. */
|
|
5
4
|
export declare const DEFAULT_LOAD_KEYBINDS = "$mod+O";
|
|
6
5
|
/** Properties of the load action. */
|
|
7
|
-
export interface LoadActionProps<T = unknown> extends
|
|
8
|
-
/** Action's label. */
|
|
9
|
-
label?: ReactNode;
|
|
6
|
+
export interface LoadActionProps<T = unknown> extends Partial<ActionButtonProps>, Omit<FormLoaderOptions<T>, "id"> {
|
|
10
7
|
/**
|
|
11
8
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
12
9
|
* shortcut.
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import { type ActionButtonProps } from "@ostack.tech/ui";
|
|
3
2
|
/** Default “print” keybinds. */
|
|
4
3
|
export declare const DEFAULT_PRINT_KEYBINDS = "$mod+P";
|
|
5
4
|
/** Properties of the print action. */
|
|
6
|
-
export interface PrintActionProps extends
|
|
7
|
-
/** Action's label. */
|
|
8
|
-
label?: ReactNode;
|
|
5
|
+
export interface PrintActionProps extends Partial<ActionButtonProps> {
|
|
9
6
|
/**
|
|
10
7
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
11
8
|
* shortcut.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ActionButtonProps, type ActionSplitProps } from "@ostack.tech/ui";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { type FormSaverOptions } from "../../utils/useFormSaver.tsx";
|
|
4
4
|
/** Default “save” keybinds. */
|
|
@@ -6,9 +6,7 @@ export declare const DEFAULT_SAVE_KEYBINDS = "$mod+S";
|
|
|
6
6
|
/** Default “save as” keybinds. */
|
|
7
7
|
export declare const DEFAULT_SAVE_AS_KEYBINDS = "$mod+Shift+S";
|
|
8
8
|
/** Properties of the save action. */
|
|
9
|
-
export interface SaveActionProps<T = unknown> extends
|
|
10
|
-
/** Action's label. */
|
|
11
|
-
label?: ReactNode;
|
|
9
|
+
export interface SaveActionProps<T = unknown> extends Partial<ActionButtonProps>, Pick<ActionSplitProps, "groupCollapsed" | "buttonGroupProps" | "dropdownMenuGroupProps" | "defaultOpen" | "open" | "onOpenChange" | "modal" | "dropdownMenuContentProps" | "groupLabel">, Omit<FormSaverOptions<T>, "id" | "overwrite"> {
|
|
12
10
|
/**
|
|
13
11
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
14
12
|
* shortcut.
|
|
@@ -44,10 +42,12 @@ export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "childre
|
|
|
44
42
|
* Defaults to `true` when the form is read-only and `false` otherwise.
|
|
45
43
|
*/
|
|
46
44
|
disableOverwrite?: boolean;
|
|
47
|
-
/** Label of the save options button. */
|
|
48
|
-
saveOptionsLabel?: ReactNode;
|
|
49
45
|
/** Label of the action's "save as" sub-action. */
|
|
50
46
|
saveAsLabel?: ReactNode;
|
|
47
|
+
/** Label of the save options button. */
|
|
48
|
+
saveOptionsLabel?: ReactNode;
|
|
49
|
+
/** Placement of the save options button. */
|
|
50
|
+
saveOptionsPlacement?: ActionSplitProps["splitPlacement"];
|
|
51
51
|
/**
|
|
52
52
|
* Keybinds for triggering the "save as" sub-action. Set to `null` to disable
|
|
53
53
|
* the keyboard shortcut.
|
|
@@ -62,9 +62,7 @@ export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "childre
|
|
|
62
62
|
*/
|
|
63
63
|
saveAsKeybinds?: string | string[] | null;
|
|
64
64
|
/** Properties to pass to the save options button component. */
|
|
65
|
-
saveOptionsProps?: Omit<
|
|
66
|
-
/** Properties to pass to the save options dropdown menu component. */
|
|
67
|
-
dropdownMenuProps?: DropdownMenuContentProps;
|
|
65
|
+
saveOptionsProps?: Omit<ActionButtonProps, "label">;
|
|
68
66
|
}
|
|
69
67
|
/**
|
|
70
68
|
* Form action used to save the form to a file, supporting both overwriting and
|
|
@@ -92,4 +90,4 @@ export interface SaveActionProps<T = unknown> extends Omit<ButtonProps, "childre
|
|
|
92
90
|
* }
|
|
93
91
|
* ```
|
|
94
92
|
*/
|
|
95
|
-
export declare function SaveAction<T = unknown>({ label, keybinds, showWhenReadOnly, fileSystemId, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant, color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, successMessage, errorMessage, saveOptionsProps,
|
|
93
|
+
export declare function SaveAction<T = unknown>({ label, keybinds, showWhenReadOnly, fileSystemId, disableOverwrite, saveOptionsLabel, saveAsLabel, saveAsKeybinds, loading, disabled, onClick, variant, color, path, encode, fileName, extensions, description, mimeTypes, startIn, excludeAcceptAllOption, successMessage, errorMessage, groupCollapsed, defaultOpen, open, onOpenChange, modal, groupLabel, saveOptionsPlacement, buttonGroupProps, saveOptionsProps, dropdownMenuGroupProps, dropdownMenuContentProps, ...otherProps }: SaveActionProps<T>): false | import("react").JSX.Element;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type LocatedValidationWarning } from "@ostack.tech/kform";
|
|
2
2
|
import { type SubmitOptions } from "@ostack.tech/kform-react";
|
|
3
|
-
import { type AlertDialogBodyProps, type AlertDialogContentProps, type AlertDialogDescriptionProps, type AlertDialogFooterProps, type AlertDialogHeaderProps, type AlertDialogTitleProps, type AlertProps, type ButtonProps, type CheckboxProps } from "@ostack.tech/ui";
|
|
3
|
+
import { type ActionButtonProps, type AlertDialogBodyProps, type AlertDialogContentProps, type AlertDialogDescriptionProps, type AlertDialogFooterProps, type AlertDialogHeaderProps, type AlertDialogTitleProps, type AlertProps, type ButtonProps, type CheckboxProps } from "@ostack.tech/ui";
|
|
4
4
|
import { type ReactNode } from "react";
|
|
5
5
|
/** Default “submit” keybinds. */
|
|
6
6
|
export declare const DEFAULT_SUBMIT_KEYBINDS = "$mod+Enter";
|
|
7
7
|
/** Properties of the submit action. */
|
|
8
|
-
export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends Omit<
|
|
9
|
-
/** Action's label. */
|
|
10
|
-
label?: ReactNode;
|
|
8
|
+
export interface SubmitActionProps<T = unknown, TSubmitResult = unknown> extends Omit<Partial<ActionButtonProps>, "onSubmit">, Pick<Required<SubmitOptions<T, TSubmitResult>>, "onSubmit">, Omit<SubmitOptions<T, TSubmitResult>, "onSubmit"> {
|
|
11
9
|
/**
|
|
12
10
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
13
11
|
* shortcut.
|
|
@@ -144,7 +144,10 @@ export interface TableControlProps<T = unknown, TTable extends Table<T> | null =
|
|
|
144
144
|
* <TableControlActionsColumn removeRowLabel="Remove item" />
|
|
145
145
|
* </TableControlColumns>
|
|
146
146
|
* <TableControlAddRowTrigger label="Add item" />
|
|
147
|
-
* <TableControlContent
|
|
147
|
+
* <TableControlContent
|
|
148
|
+
* caption="Inventory"
|
|
149
|
+
* emptyMessage="No items added."
|
|
150
|
+
* />
|
|
148
151
|
* </TableControl>
|
|
149
152
|
* );
|
|
150
153
|
* }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ActionButtonProps } from "@ostack.tech/ui";
|
|
2
2
|
import { type ComponentProps, type ReactNode } from "react";
|
|
3
3
|
/** Properties of the table control add row trigger component. */
|
|
4
4
|
export type TableControlAddRowTriggerProps = TableControlAddRowTriggerChildlessProps | TableControlAddRowTriggerChildrenProps;
|
|
@@ -37,9 +37,7 @@ export interface TableControlAddRowTriggerPropsBase {
|
|
|
37
37
|
* Properties of the table control add row trigger component when rendered
|
|
38
38
|
* without children.
|
|
39
39
|
*/
|
|
40
|
-
export interface TableControlAddRowTriggerChildlessProps extends TableControlAddRowTriggerPropsBase, Omit<
|
|
41
|
-
/** Label displayed on the button. */
|
|
42
|
-
label?: ReactNode;
|
|
40
|
+
export interface TableControlAddRowTriggerChildlessProps extends TableControlAddRowTriggerPropsBase, Omit<Partial<ActionButtonProps>, "asChild" | "children"> {
|
|
43
41
|
/**
|
|
44
42
|
* Label displayed on the button.
|
|
45
43
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ActionsProps } from "@ostack.tech/ui";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import { type PrefixedConfirmDialogOptions } from "../../utils/extractConfirmDialogOptions.ts";
|
|
3
4
|
import type { TableControlColumnObject } from "./TableControlColumn.tsx";
|
|
@@ -63,6 +64,8 @@ export interface TableControlActionsColumnFnProps<T = unknown, TValue = any> ext
|
|
|
63
64
|
* overridden.
|
|
64
65
|
*/
|
|
65
66
|
removeRowProps?: TableControlRemoveRowTriggerProps;
|
|
67
|
+
/** Properties to pass to the `Actions` component. */
|
|
68
|
+
actionsProps?: ActionsProps;
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
68
71
|
* Pre-configured column used to display row actions. By default, it sticks to
|
|
@@ -87,4 +90,4 @@ export interface TableControlActionsColumnFnProps<T = unknown, TValue = any> ext
|
|
|
87
90
|
* @param overrides Column properties used to display the actions of each row.
|
|
88
91
|
* @returns Table control column used to display the actions of each row.
|
|
89
92
|
*/
|
|
90
|
-
export declare function tableControlActionsColumn<T = unknown, TValue = any>({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, ...otherProps }?: TableControlActionsColumnFnProps<T, TValue>): TableControlColumnObject<T, TValue>;
|
|
93
|
+
export declare function tableControlActionsColumn<T = unknown, TValue = any>({ removeRowLabel, showRowRemovalConfirmation, onConfirmRowRemoval, onRowRemoved, confirmRowRemovalDialogMessage, removeRowProps, render, actionsProps, ...otherProps }?: TableControlActionsColumnFnProps<T, TValue>): TableControlColumnObject<T, TValue>;
|
|
@@ -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({ scrollableProps, ...otherProps }: TableControlContentProps): import("react").JSX.Element;
|
|
6
|
+
export declare function TableControlContent({ emptyMessage, scrollableProps, ...otherProps }: TableControlContentProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ActionButtonProps } from "@ostack.tech/ui";
|
|
2
2
|
import { type ComponentProps, type ReactNode } from "react";
|
|
3
3
|
import { type PrefixedConfirmDialogOptions } from "../../utils/extractConfirmDialogOptions.ts";
|
|
4
4
|
/** Properties of the table control remove row trigger component. */
|
|
@@ -36,7 +36,7 @@ export interface TableControlRemoveRowTriggerPropsBase extends Omit<PrefixedConf
|
|
|
36
36
|
* Base properties of the table control remove row trigger component when
|
|
37
37
|
* rendered without children.
|
|
38
38
|
*/
|
|
39
|
-
export interface TableControlRemoveRowTriggerChildlessProps extends TableControlRemoveRowTriggerPropsBase, Omit<Partial<
|
|
39
|
+
export interface TableControlRemoveRowTriggerChildlessProps extends TableControlRemoveRowTriggerPropsBase, Omit<Partial<ActionButtonProps>, "asChild" | "children"> {
|
|
40
40
|
/**
|
|
41
41
|
* Label of the icon button.
|
|
42
42
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ActionsProps } from "@ostack.tech/ui";
|
|
2
2
|
/** Properties of the top bar actions component. */
|
|
3
|
-
export interface TopBarActionsProps extends
|
|
3
|
+
export interface TopBarActionsProps extends ActionsProps {
|
|
4
4
|
}
|
|
5
|
-
/** Container
|
|
6
|
-
export declare function TopBarActions({ className, children, ...otherProps }: TopBarActionsProps): import("react").JSX.Element;
|
|
5
|
+
/** Container of the top bar actions. */
|
|
6
|
+
export declare function TopBarActions({ className, containerProps, children, ...otherProps }: TopBarActionsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ActionsSecondaryProps } from "@ostack.tech/ui";
|
|
2
|
+
/** Properties of the top bar secondary actions component. */
|
|
3
|
+
export interface TopBarActionsSecondaryProps extends ActionsSecondaryProps {
|
|
4
|
+
}
|
|
5
|
+
/** Container of the secondary top bar actions. */
|
|
6
|
+
export declare function TopBarActionsSecondary(props: TopBarActionsSecondaryProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ActionButtonProps } from "@ostack.tech/ui";
|
|
3
2
|
/** Default “validate” keybinds. */
|
|
4
3
|
export declare const DEFAULT_VALIDATE_KEYBINDS = "Alt+Shift+V";
|
|
5
4
|
/** Properties of the validate action. */
|
|
6
|
-
export interface ValidateActionProps extends
|
|
7
|
-
/** Action's label. */
|
|
8
|
-
label?: ReactNode;
|
|
5
|
+
export interface ValidateActionProps extends Partial<ActionButtonProps> {
|
|
9
6
|
/**
|
|
10
7
|
* Keybinds for triggering the action. Set to `null` to disable the keyboard
|
|
11
8
|
* shortcut.
|
package/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type { SaveActionProps } from "../../components/SaveAction";
|
|
|
16
16
|
import type { SelectControlProps } from "../../components/SelectControl";
|
|
17
17
|
import type { SelectMultipleControlProps } from "../../components/SelectMultipleControl";
|
|
18
18
|
import type { SubmitActionProps } from "../../components/SubmitAction";
|
|
19
|
-
import type { TableControlAddRowTriggerChildlessProps, TableControlIndexColumnProps, TableControlRemoveRowTriggerChildlessProps } from "../../components/TableControl";
|
|
19
|
+
import type { TableControlActionsColumnProps, TableControlAddRowTriggerChildlessProps, TableControlContentProps, TableControlIndexColumnProps, TableControlRemoveRowTriggerChildlessProps } from "../../components/TableControl";
|
|
20
20
|
import type { UnknownValueProps } from "../../components/UnknownValue";
|
|
21
21
|
import type { ValidateActionProps } from "../../components/ValidateAction";
|
|
22
22
|
/** Localization object representation. */
|
|
@@ -40,8 +40,9 @@ export interface LocalizationObject {
|
|
|
40
40
|
SelectMultipleControl: Pick<SelectMultipleControlProps, "unknownValueLabel">;
|
|
41
41
|
PrintAction: Pick<PrintActionProps, "label" | "keybinds">;
|
|
42
42
|
SubmitAction: Pick<SubmitActionProps, "label" | "keybinds" | "dialogTitle" | "dialogDescription" | "dialogBody" | "dialogOkText" | "dialogCancelText" | "confirmWarningsCheckboxLabel" | "successMessage" | "errorMessage">;
|
|
43
|
-
TableControlActionsColumn: Pick<
|
|
43
|
+
TableControlActionsColumn: Pick<TableControlActionsColumnProps, "label">;
|
|
44
44
|
TableControlAddRowTrigger: Pick<TableControlAddRowTriggerChildlessProps, "label">;
|
|
45
|
+
TableControlContent: Pick<TableControlContentProps, "emptyMessage">;
|
|
45
46
|
TableControlIndexColumn: Pick<TableControlIndexColumnProps, "label">;
|
|
46
47
|
TableControlRemoveRowTrigger: Pick<TableControlRemoveRowTriggerChildlessProps, "label" | "confirmDialogTitle" | "confirmDialogMessage" | "confirmDialogOkText" | "confirmDialogCancelText">;
|
|
47
48
|
UnknownValue: Pick<UnknownValueProps, "label">;
|