greenole-design-system 1.1.53 → 1.1.54
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/base-components/CollapsibleMenu/CollapsibleMenu.styles.d.ts +2 -1
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +4 -0
- package/dist/components/Table/Table.styles.d.ts +20 -1
- package/dist/components/Table/Table.types.d.ts +25 -6
- package/dist/components/Table/TableColumnManager.d.ts +4 -0
- package/dist/greenole-design-system.cjs.js +570 -513
- package/dist/greenole-design-system.es.js +7815 -4229
- package/dist/greenole.css +14 -0
- package/dist/index.css +1 -1
- package/package.json +4 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare const Button: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components
|
|
1
|
+
export declare const Button: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
2
|
+
export declare const Icon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
3
|
$isOpen: boolean;
|
|
3
4
|
}>> & string;
|
|
4
5
|
export declare const Content: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TableProps } from './Table.types';
|
|
3
|
-
declare const Table: <T extends Record<string, any>>({ columns, data, currentPage, totalItems, headerExtra, actions, isMobile, itemsPerPage, loading, striped, showSearch, fetchData, onPageChange, onItemsPerPageChange, t: tProp, }: Readonly<TableProps<T>>) => React.JSX.Element;
|
|
3
|
+
declare const Table: <T extends Record<string, any>>({ columns, data, currentPage, totalItems, headerExtra, actions, isMobile, itemsPerPage, loading, striped, showSearch, showManageColumns, tableKey, fetchData, onPageChange, onItemsPerPageChange, t: tProp, }: Readonly<TableProps<T>>) => React.JSX.Element;
|
|
4
4
|
export default Table;
|
|
@@ -4,7 +4,11 @@ declare const meta: Meta<typeof Table>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Table>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const ManageColumns: Story;
|
|
8
|
+
export declare const SortableWithRenderContent: Story;
|
|
7
9
|
export declare const FetchData: Story;
|
|
8
10
|
export declare const WithActions: Story;
|
|
9
11
|
export declare const WithHeaderExtra: Story;
|
|
10
12
|
export declare const WithActionsAndHeaderExtra: Story;
|
|
13
|
+
export declare const ColumnFiltersLocalData: Story;
|
|
14
|
+
export declare const ColumnFiltersFetchData: Story;
|
|
@@ -12,7 +12,12 @@ export declare const TableHeaderSearchInputWrapper: import('styled-components/di
|
|
|
12
12
|
export declare const TableHeaderButtons: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
13
13
|
$isMobile?: boolean;
|
|
14
14
|
}>> & string;
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const TableHeaderManageColumns: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
16
|
+
export declare const TableHead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
17
|
+
export declare const TableHeadDropdown: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
export declare const TableContentWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
19
|
+
$hasOpenFilter?: boolean;
|
|
20
|
+
}>> & string;
|
|
16
21
|
export declare const TableContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {
|
|
17
22
|
$striped?: boolean;
|
|
18
23
|
}>> & string;
|
|
@@ -21,3 +26,17 @@ export declare const LoadingWrapper: import('styled-components/dist/types').ISty
|
|
|
21
26
|
export declare const DropdownMenuContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
22
27
|
$showDropdownMenu?: boolean;
|
|
23
28
|
}>> & string;
|
|
29
|
+
export declare const TableColumnManagerWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
|
+
export declare const TableColumnManagerItems: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
31
|
+
export declare const TableColumnManagerItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
32
|
+
$isDisabled?: boolean;
|
|
33
|
+
}>> & string;
|
|
34
|
+
export declare const TableColumnManagerItemCheckbox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
35
|
+
$isChecked?: boolean;
|
|
36
|
+
$isDisabled?: boolean;
|
|
37
|
+
}>> & string;
|
|
38
|
+
export declare const TableColumnManagerItemLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
39
|
+
export declare const TableColumnManagerItemDrag: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
40
|
+
$isLocked?: boolean;
|
|
41
|
+
}>> & string;
|
|
42
|
+
export declare const TableColumnManagerButtons: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -3,19 +3,21 @@ import { THookTypes } from '../../utils/i18n/types';
|
|
|
3
3
|
export interface TableColumn<T = any> {
|
|
4
4
|
label: string;
|
|
5
5
|
key: keyof T | string;
|
|
6
|
+
isLocked?: boolean;
|
|
6
7
|
render?: (value: any, row: T) => ReactNode;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
sortAccessor?: (row: T) => any;
|
|
10
|
+
filterable?: boolean;
|
|
11
|
+
filterValueAccessor?: (row: T) => string | string[] | undefined | null;
|
|
7
12
|
}
|
|
8
|
-
|
|
9
|
-
columns:
|
|
10
|
-
label: string;
|
|
11
|
-
key: keyof T | string;
|
|
12
|
-
render?: (value: any, row: T) => ReactNode;
|
|
13
|
-
}>;
|
|
13
|
+
interface BaseTableProps<T = any> {
|
|
14
|
+
columns: TableColumn[];
|
|
14
15
|
data?: T[];
|
|
15
16
|
fetchData?: (params: {
|
|
16
17
|
page: number;
|
|
17
18
|
itemsPerPage: number;
|
|
18
19
|
search?: string;
|
|
20
|
+
filters?: Record<string, string[]>;
|
|
19
21
|
}) => Promise<{
|
|
20
22
|
data: T[];
|
|
21
23
|
count: number;
|
|
@@ -33,3 +35,20 @@ export interface TableProps<T = any> {
|
|
|
33
35
|
actions?: ReactNode;
|
|
34
36
|
t?: THookTypes;
|
|
35
37
|
}
|
|
38
|
+
interface TableWithoutColumnManagement<T = any> extends BaseTableProps<T> {
|
|
39
|
+
showManageColumns?: false;
|
|
40
|
+
tableKey?: string;
|
|
41
|
+
}
|
|
42
|
+
interface TableWithColumnManagement<T = any> extends BaseTableProps<T> {
|
|
43
|
+
showManageColumns: true;
|
|
44
|
+
tableKey: string;
|
|
45
|
+
}
|
|
46
|
+
export type TableProps<T = any> = TableWithoutColumnManagement<T> | TableWithColumnManagement<T>;
|
|
47
|
+
export interface TableColumnManagerProps {
|
|
48
|
+
allColumns: TableColumn[];
|
|
49
|
+
visibleColumnsKeys: string[];
|
|
50
|
+
initialLockedKeys: string[];
|
|
51
|
+
onSave: (newVisibleKeys: string[], newLockedKeys: string[]) => void;
|
|
52
|
+
t?: THookTypes;
|
|
53
|
+
}
|
|
54
|
+
export {};
|