@datacrest/dcuikit 1.0.0 → 1.0.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/build/components/Molecule/Dropdown/index.d.ts +1 -0
- package/build/components/Molecule/Message/Message.d.ts +1 -1
- package/build/components/Molecule/Message/Message.stories.d.ts +1 -1
- package/build/components/Molecule/Message/index.d.ts +4 -2
- package/build/components/Molecule/Table/Table.d.ts +1 -1
- package/build/components/Molecule/Table/Table.stories.d.ts +3 -0
- package/build/components/Molecule/Table/Table.types.d.ts +7 -0
- package/build/components/Molecule/Table/TableCell.d.ts +1 -1
- package/build/components/Molecule/Table/TableColumn.d.ts +5 -3
- package/build/components/Molecule/Table/const.d.ts +2 -0
- package/build/components/Molecule/Table/index.d.ts +3 -2
- package/build/components/Molecule/Table/utils.d.ts +1 -0
- package/build/index.css +2 -2
- package/build/index.esm.css +2 -2
- package/build/index.esm.js +7 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +6 -6
- package/build/index.js.map +1 -1
- package/build/tsconfig.prod.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MessageProps } from './Message.types';
|
|
3
|
-
declare const MessageComponent: ({ id, destroy, title, description, variant, duration, animationDuration, icon, dataTestId, }: MessageProps) => React.JSX.Element;
|
|
3
|
+
declare const MessageComponent: ({ id, destroy, title, description, variant, position, duration, animationDuration, icon, dataTestId, }: MessageProps) => React.JSX.Element;
|
|
4
4
|
export default MessageComponent;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MessageProps, MessageVariants, MessagePosition } from './Message.types';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ id, destroy, title, description, variant, duration, animationDuration, icon, dataTestId, }: MessageProps) => React.JSX.Element;
|
|
5
|
+
component: ({ id, destroy, title, description, variant, position, duration, animationDuration, icon, dataTestId, }: MessageProps) => React.JSX.Element;
|
|
6
6
|
argTypes: {
|
|
7
7
|
variant: {
|
|
8
8
|
control: "select";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MessageComponent from './Message';
|
|
2
|
+
import { MessageProps } from './Message.types';
|
|
2
3
|
import { message, MessageOptions } from './MessageManager';
|
|
3
|
-
export
|
|
4
|
+
export * from './Message.types';
|
|
4
5
|
export type { MessageProps, MessageOptions };
|
|
6
|
+
export { MessageComponent, message };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { TableProps } from './Table.types';
|
|
3
|
-
declare const Table: <T extends Record<string, unknown>>({ columns, data, sortable, pagination, searchable, currentPage, pageSize, onSort, onPageChange, actions, showCustomCells, useBuiltInStatus, swapPaginationLayout, }: TableProps<T>) => JSX.Element;
|
|
3
|
+
declare const Table: <T extends Record<string, unknown>>({ columns, data, sortable, pagination, searchable, currentPage, pageSize, onSort, onPageChange, actions, showCustomCells, useBuiltInStatus, swapPaginationLayout, selectable, onSelectionChange, }: TableProps<T>) => JSX.Element;
|
|
4
4
|
export default Table;
|
|
@@ -12,5 +12,8 @@ interface TableStoryProps {
|
|
|
12
12
|
showActions: boolean;
|
|
13
13
|
useBuiltInStatus: boolean;
|
|
14
14
|
swapPaginationLayout: boolean;
|
|
15
|
+
selectable: boolean;
|
|
16
|
+
enableTextTruncation: boolean;
|
|
17
|
+
maxWords: number;
|
|
15
18
|
}
|
|
16
19
|
export declare const Table: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, TableStoryProps>;
|
|
@@ -21,6 +21,10 @@ export interface DateFormat {
|
|
|
21
21
|
input?: string;
|
|
22
22
|
output: string;
|
|
23
23
|
}
|
|
24
|
+
export interface TruncationOptions {
|
|
25
|
+
enableTruncation?: boolean;
|
|
26
|
+
maxWords?: number;
|
|
27
|
+
}
|
|
24
28
|
export interface TableColumn<T extends Record<string, unknown>> {
|
|
25
29
|
key: string;
|
|
26
30
|
title: string;
|
|
@@ -32,6 +36,7 @@ export interface TableColumn<T extends Record<string, unknown>> {
|
|
|
32
36
|
filterFn?: FilterFn<T>;
|
|
33
37
|
customCell?: (value: unknown, row: T) => ReactNode;
|
|
34
38
|
customHeader?: (column: ColumnInfo<T>) => ReactNode;
|
|
39
|
+
maxWords?: number;
|
|
35
40
|
}
|
|
36
41
|
export interface ColumnInfo<T> {
|
|
37
42
|
toggleSorting: (desc?: boolean) => void;
|
|
@@ -53,4 +58,6 @@ export interface TableProps<T extends Record<string, unknown>> {
|
|
|
53
58
|
showCustomCells?: boolean;
|
|
54
59
|
useBuiltInStatus?: boolean;
|
|
55
60
|
swapPaginationLayout?: boolean;
|
|
61
|
+
selectable?: boolean;
|
|
62
|
+
onSelectionChange?: (selectedRows: T[]) => void;
|
|
56
63
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableColumn } from './Table.types';
|
|
3
|
-
declare const TableCell: <T extends Record<string, unknown>>(column: TableColumn<T>, row: T, showCustomCells: boolean, useBuiltInStatus: boolean) => React.JSX.Element
|
|
3
|
+
declare const TableCell: <T extends Record<string, unknown>>(column: TableColumn<T>, row: T, showCustomCells: boolean, useBuiltInStatus: boolean) => React.JSX.Element;
|
|
4
4
|
export default TableCell;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TableColumn as TableColumnType, TableColumnAlign } from './Table.types';
|
|
2
|
+
import { TableColumn as TableColumnType, TableColumnAlign, TruncationOptions } from './Table.types';
|
|
3
3
|
import { PersonData } from './const';
|
|
4
4
|
export declare const createTextColumn: <T extends Record<string, unknown>>(key: string, title: string, options?: {
|
|
5
5
|
width?: string;
|
|
6
6
|
sortable?: boolean;
|
|
7
7
|
align?: TableColumnAlign;
|
|
8
8
|
customCell?: (value: unknown, row: T) => React.ReactNode;
|
|
9
|
+
maxWords?: number;
|
|
9
10
|
}) => TableColumnType<T>;
|
|
10
11
|
export declare const createDateColumn: <T extends Record<string, unknown>>(key: string, title: string, options?: {
|
|
11
12
|
width?: string;
|
|
@@ -21,13 +22,14 @@ export declare const createStatusColumn: <T extends Record<string, unknown>>(key
|
|
|
21
22
|
align?: TableColumnAlign;
|
|
22
23
|
customCell?: (value: unknown, row: T) => React.ReactNode;
|
|
23
24
|
}) => TableColumnType<T>;
|
|
24
|
-
export declare const createPersonDataColumns: (showCustomCells: boolean) => TableColumnType<PersonData>[];
|
|
25
|
+
export declare const createPersonDataColumns: (showCustomCells: boolean, truncationOptions?: TruncationOptions) => TableColumnType<PersonData>[];
|
|
25
26
|
declare const TableColumn: {
|
|
26
27
|
createTextColumn: <T extends Record<string, unknown>>(key: string, title: string, options?: {
|
|
27
28
|
width?: string;
|
|
28
29
|
sortable?: boolean;
|
|
29
30
|
align?: TableColumnAlign;
|
|
30
31
|
customCell?: (value: unknown, row: T) => React.ReactNode;
|
|
32
|
+
maxWords?: number;
|
|
31
33
|
}) => TableColumnType<T>;
|
|
32
34
|
createDateColumn: <T extends Record<string, unknown>>(key: string, title: string, options?: {
|
|
33
35
|
width?: string;
|
|
@@ -43,6 +45,6 @@ declare const TableColumn: {
|
|
|
43
45
|
align?: TableColumnAlign;
|
|
44
46
|
customCell?: (value: unknown, row: T) => React.ReactNode;
|
|
45
47
|
}) => TableColumnType<T>;
|
|
46
|
-
createPersonDataColumns: (showCustomCells: boolean) => TableColumnType<PersonData>[];
|
|
48
|
+
createPersonDataColumns: (showCustomCells: boolean, truncationOptions?: TruncationOptions) => TableColumnType<PersonData>[];
|
|
47
49
|
};
|
|
48
50
|
export default TableColumn;
|
|
@@ -3,6 +3,7 @@ export interface PersonData extends Record<string, unknown> {
|
|
|
3
3
|
email?: string;
|
|
4
4
|
joinDate?: string;
|
|
5
5
|
status?: string;
|
|
6
|
+
description?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const SAMPLE_DATA: PersonData[];
|
|
8
9
|
export declare const PAGE_SIZES: readonly [5, 10, 20, 50];
|
|
@@ -13,4 +14,5 @@ export declare const DEFAULT_COLUMN_CONFIG: {
|
|
|
13
14
|
EMAIL_KEY: string;
|
|
14
15
|
JOIN_DATE_KEY: string;
|
|
15
16
|
STATUS_KEY: string;
|
|
17
|
+
DESCRIPTION_KEY: string;
|
|
16
18
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Table from './Table';
|
|
2
2
|
import TableCell from './TableCell';
|
|
3
|
-
import TableColumn, { createTextColumn, createDateColumn, createStatusColumn } from './TableColumn';
|
|
4
3
|
import TableHeader, { renderSortIcon, renderHeader, renderTableHeader } from './TableHeader';
|
|
5
|
-
export { Table, TableCell,
|
|
4
|
+
export { Table, TableCell, TableHeader, renderSortIcon, renderHeader, renderTableHeader, };
|
|
6
5
|
export * from './Table.types';
|
|
6
|
+
export * from './TableColumn';
|
|
7
|
+
export * from './utils';
|