sera-components 1.7.0 → 1.8.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/index.js +969 -884
- package/dist/index.umd.cjs +7 -7
- package/dist/misc/index.d.ts +1 -0
- package/dist/misc/pop-confirm.d.ts +29 -0
- package/dist/table/make-columns.d.ts +3 -1
- package/dist/table/table-action.d.ts +1 -1
- package/package.json +1 -1
package/dist/misc/index.d.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MultiLingualString as MLS } from 'sera-db';
|
|
2
|
+
import { ButtonProps, PopoverProps } from '@mantine/core';
|
|
3
|
+
export interface PopConfirmProps {
|
|
4
|
+
/** The element that triggers the popconfirm */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Title/message shown in the popconfirm */
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/** Callback when confirm button is clicked */
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
/** Callback when cancel button is clicked */
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
/** Label for confirm button. Defaults to "Confirm" / "Xác nhận" */
|
|
13
|
+
confirmLabel?: MLS;
|
|
14
|
+
/** Label for cancel button. Defaults to "Cancel" / "Hủy" */
|
|
15
|
+
cancelLabel?: MLS;
|
|
16
|
+
/** Props for the confirm button */
|
|
17
|
+
confirmProps?: Omit<ButtonProps, "onClick">;
|
|
18
|
+
/** Props for the cancel button */
|
|
19
|
+
cancelProps?: Omit<ButtonProps, "onClick">;
|
|
20
|
+
/** Props for the Popover component */
|
|
21
|
+
popoverProps?: Omit<PopoverProps, "opened" | "onClose" | "children">;
|
|
22
|
+
/** Whether the popconfirm is disabled */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A popover-based confirmation component similar to AntDesign's Popconfirm.
|
|
27
|
+
* Wraps a trigger element and shows a confirmation popover when clicked.
|
|
28
|
+
*/
|
|
29
|
+
export declare const PopConfirm: ({ children, title, onConfirm, onCancel, confirmLabel, cancelLabel, confirmProps, cancelProps, popoverProps, disabled, }: PopConfirmProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -53,10 +53,12 @@ export interface SeraColumn<R> {
|
|
|
53
53
|
* - Object properties with other cardinalities use SingleForeignKeyDisplay
|
|
54
54
|
* - Non-object properties use components from DataType2DisplayComponent mapping
|
|
55
55
|
*/
|
|
56
|
-
export declare function makeTableColumn<R>(db: DB, property: DOP, { title, nestedKey, component, }?: {
|
|
56
|
+
export declare function makeTableColumn<R>(db: DB, property: DOP, { title, nestedKey, component, rowSpan, colSpan, }?: {
|
|
57
57
|
title?: React.ReactNode;
|
|
58
58
|
nestedKey?: string;
|
|
59
59
|
component?: React.ComponentType<DisplayInterface<any>>;
|
|
60
|
+
rowSpan?: (record: R, rowIndex: number) => number | undefined;
|
|
61
|
+
colSpan?: (record: R, rowIndex: number) => number | undefined;
|
|
60
62
|
}): SeraColumn<R>;
|
|
61
63
|
export declare function makeTableColumnFromNestedProperty<R>(db: DB, property: DOP, nestedProperty: DOP, { title, nestedKey, component, }?: {
|
|
62
64
|
title?: React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import { MantineSize } from '@mantine/core';
|
|
|
2
2
|
export interface SeraActionConfig<ID extends string | number> {
|
|
3
3
|
add?: () => void;
|
|
4
4
|
edit?: (id: ID) => void;
|
|
5
|
-
delete?: () => void;
|
|
5
|
+
delete?: (ids: ID[]) => void;
|
|
6
6
|
export?: () => void;
|
|
7
7
|
reload?: boolean;
|
|
8
8
|
import?: () => void;
|