@commercetools-uikit/data-table-manager 13.0.3 → 13.0.4
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/commercetools-uikit-data-table-manager.cjs.d.ts +2 -0
- package/dist/commercetools-uikit-data-table-manager.cjs.dev.js +169 -347
- package/dist/commercetools-uikit-data-table-manager.cjs.prod.js +67 -38
- package/dist/commercetools-uikit-data-table-manager.esm.js +165 -344
- package/dist/declarations/src/column-settings-manager/column-settings-manager.d.ts +25 -0
- package/dist/declarations/src/column-settings-manager/constants.d.ts +2 -0
- package/dist/declarations/src/column-settings-manager/index.d.ts +1 -0
- package/dist/declarations/src/column-settings-manager/messages.d.ts +33 -0
- package/dist/declarations/src/constants.d.ts +7 -0
- package/dist/declarations/src/data-table-manager.d.ts +32 -0
- package/dist/declarations/src/data-table-settings/data-table-settings.d.ts +46 -0
- package/dist/declarations/src/data-table-settings/index.d.ts +1 -0
- package/dist/declarations/src/data-table-settings/messages.d.ts +18 -0
- package/dist/declarations/src/display-settings-manager/constants.d.ts +4 -0
- package/dist/declarations/src/display-settings-manager/display-settings-manager.d.ts +17 -0
- package/dist/declarations/src/display-settings-manager/index.d.ts +2 -0
- package/dist/declarations/src/display-settings-manager/messages.d.ts +43 -0
- package/dist/declarations/src/draggable-tag/draggable-tag.d.ts +16 -0
- package/dist/declarations/src/draggable-tag/draggable-tag.styles.d.ts +6 -0
- package/dist/declarations/src/draggable-tag/index.d.ts +1 -0
- package/dist/declarations/src/droppable-panel/droppable-panel.d.ts +18 -0
- package/dist/declarations/src/droppable-panel/index.d.ts +1 -0
- package/dist/declarations/src/droppable-panel/messages.d.ts +8 -0
- package/dist/declarations/src/droppable-panel/tag-container-editable.d.ts +6 -0
- package/dist/declarations/src/index.d.ts +4 -0
- package/dist/declarations/src/settings-container/index.d.ts +1 -0
- package/dist/declarations/src/settings-container/settings-container.d.ts +21 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/package.json +15 -14
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode, type MouseEvent, type KeyboardEvent, type Dispatch } from 'react';
|
|
2
|
+
import { type DropResult } from 'react-beautiful-dnd';
|
|
3
|
+
declare type TColumnData = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare type TColumnSettingsManagerProps = {
|
|
8
|
+
availableColumns: TColumnData[];
|
|
9
|
+
selectedColumns: TColumnData[];
|
|
10
|
+
onUpdateColumns: (updatedColums: TColumnData[]) => void;
|
|
11
|
+
areHiddenColumnsSearchable?: boolean;
|
|
12
|
+
searchHiddenColumns?: (searchTerm: string) => Promise<unknown>;
|
|
13
|
+
searchHiddenColumnsPlaceholder?: string;
|
|
14
|
+
onClose: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
15
|
+
primaryButton?: ReactElement;
|
|
16
|
+
secondaryButton?: ReactElement;
|
|
17
|
+
managerTheme?: 'light' | 'dark';
|
|
18
|
+
};
|
|
19
|
+
export declare const handleColumnsUpdate: (dragResult: DropResult, onUpdateColumns: TColumnSettingsManagerProps['onUpdateColumns'], selectedColumns: TColumnSettingsManagerProps['selectedColumns'], availableColumns: TColumnSettingsManagerProps['availableColumns'], setIsDragging: Dispatch<boolean>) => void;
|
|
20
|
+
export declare const ColumnSettingsManager: {
|
|
21
|
+
(props: TColumnSettingsManagerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
defaultProps: Pick<TColumnSettingsManagerProps, "availableColumns">;
|
|
24
|
+
};
|
|
25
|
+
export default ColumnSettingsManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './column-settings-manager';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
visibleColumns: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
hiddenColumns: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
noSelectedColumnsToShow: {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
};
|
|
22
|
+
noHiddenColumnsToShow: {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
};
|
|
27
|
+
closeButtonLabel: {
|
|
28
|
+
id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode, type MouseEventHandler } from 'react';
|
|
2
|
+
import { type TDataTableSettingsProps } from './data-table-settings';
|
|
3
|
+
interface TRow {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
declare type TColumProps = {
|
|
7
|
+
key: string;
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
width?: string;
|
|
10
|
+
align?: 'left' | 'center' | 'right';
|
|
11
|
+
onClick?: (event: MouseEventHandler) => void;
|
|
12
|
+
renderItem?: <T extends TRow>(row: T, isRowCollapsed: boolean) => ReactNode;
|
|
13
|
+
headerIcon?: ReactNode;
|
|
14
|
+
isTruncated?: boolean;
|
|
15
|
+
isSortable?: boolean;
|
|
16
|
+
disableResizing?: boolean;
|
|
17
|
+
shouldIgnoreRowClick?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare type TDataTableManagerProps = {
|
|
20
|
+
columns: TColumProps[];
|
|
21
|
+
children: ReactElement;
|
|
22
|
+
displaySettings?: TDataTableSettingsProps['displaySettings'];
|
|
23
|
+
columnManager?: TDataTableSettingsProps['columnManager'];
|
|
24
|
+
onSettingsChange?: (settingName: string, settingValue: boolean | string[]) => void;
|
|
25
|
+
topBar?: ReactNode;
|
|
26
|
+
managerTheme?: 'light' | 'dark';
|
|
27
|
+
};
|
|
28
|
+
declare const DataTableManager: {
|
|
29
|
+
(props: TDataTableManagerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
export default DataTableManager;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type MessageDescriptor } from 'react-intl';
|
|
3
|
+
declare type TColumnData = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare type MappedColumns = Record<string, TColumnData>;
|
|
8
|
+
export declare type TDisplaySettingsProps = {
|
|
9
|
+
disableDisplaySettings?: boolean;
|
|
10
|
+
isCondensed?: boolean;
|
|
11
|
+
isWrappingText?: boolean;
|
|
12
|
+
primaryButton?: ReactElement;
|
|
13
|
+
secondaryButton?: ReactElement;
|
|
14
|
+
};
|
|
15
|
+
export declare type TColumnManagerProps = {
|
|
16
|
+
areHiddenColumnsSearchable?: boolean;
|
|
17
|
+
disableColumnManager?: boolean;
|
|
18
|
+
visibleColumnKeys: string[];
|
|
19
|
+
hideableColumns?: TColumnData[];
|
|
20
|
+
searchHiddenColumns?: (searchTerm: string) => Promise<unknown>;
|
|
21
|
+
searchHiddenColumnsPlaceholder?: string;
|
|
22
|
+
primaryButton?: ReactElement;
|
|
23
|
+
secondaryButton?: ReactElement;
|
|
24
|
+
};
|
|
25
|
+
export declare type TDataTableSettingsProps = {
|
|
26
|
+
topBar?: ReactNode;
|
|
27
|
+
onSettingsChange?: (settingName: string, settingValue: boolean | string[]) => void;
|
|
28
|
+
displaySettings?: TDisplaySettingsProps;
|
|
29
|
+
columnManager?: TColumnManagerProps;
|
|
30
|
+
managerTheme?: 'light' | 'dark';
|
|
31
|
+
};
|
|
32
|
+
export declare const getDropdownOptions: ({ areColumnSettingsEnabled, areDisplaySettingsEnabled, formatMessage, }: {
|
|
33
|
+
areColumnSettingsEnabled: boolean;
|
|
34
|
+
areDisplaySettingsEnabled: boolean;
|
|
35
|
+
formatMessage: (message: MessageDescriptor) => string;
|
|
36
|
+
}) => {
|
|
37
|
+
value: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}[];
|
|
40
|
+
export declare const getMappedColumns: (columns?: TColumnData[]) => MappedColumns;
|
|
41
|
+
export declare const getSelectedColumns: (mappedColumns: MappedColumns, visibleColumnsKeys?: string[]) => TColumnData[];
|
|
42
|
+
declare const DataTableSettings: {
|
|
43
|
+
(props: TDataTableSettingsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
export default DataTableSettings;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type TDataTableSettingsProps } from './data-table-settings';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
placeholder: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
displaySettingsOption: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
columnManagerOption: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChangeEventHandler, MouseEvent, KeyboardEvent, ReactElement } from 'react';
|
|
2
|
+
export declare type TDensityManagerProps = {
|
|
3
|
+
isCondensed?: boolean;
|
|
4
|
+
isWrappingText?: boolean;
|
|
5
|
+
primaryButton?: ReactElement;
|
|
6
|
+
secondaryButton?: ReactElement;
|
|
7
|
+
onDensityDisplayChange: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
onTextWrappingChange: ChangeEventHandler<HTMLInputElement>;
|
|
9
|
+
onClose: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
10
|
+
managerTheme?: 'light' | 'dark';
|
|
11
|
+
};
|
|
12
|
+
declare const DensityManager: {
|
|
13
|
+
(props: TDensityManagerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
defaultProps: Pick<TDensityManagerProps, "isCondensed" | "isWrappingText">;
|
|
16
|
+
};
|
|
17
|
+
export default DensityManager;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
textWrappingSubtitle: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
densityDisplaySubtitle: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
textWrappingAllWrapVisibleOption: {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
};
|
|
22
|
+
textWrappingShowHideOnDemandOption: {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
};
|
|
27
|
+
densityDisplayDefaultOption: {
|
|
28
|
+
id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
};
|
|
32
|
+
densityDisplayCompactOption: {
|
|
33
|
+
id: string;
|
|
34
|
+
description: string;
|
|
35
|
+
defaultMessage: string;
|
|
36
|
+
};
|
|
37
|
+
closeButtonLabel: {
|
|
38
|
+
id: string;
|
|
39
|
+
description: string;
|
|
40
|
+
defaultMessage: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
declare type TColumnData = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare type TDraggableTagProps = {
|
|
7
|
+
column: TColumnData;
|
|
8
|
+
index: number;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
onRemove?: (index: number) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const DraggableTag: {
|
|
13
|
+
(props: TDraggableTagProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export default DraggableTag;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const DraggingContainer: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export default DraggingContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './draggable-tag';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
declare type TColumnData = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare type TDroppablePanelProps = {
|
|
7
|
+
droppableId: string;
|
|
8
|
+
noColumnsText: ReactNode;
|
|
9
|
+
columns: TColumnData[];
|
|
10
|
+
isSearchable?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
onRemove?: (columns: TColumnData[]) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const DroppablePanel: {
|
|
15
|
+
(props: TDroppablePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export default DroppablePanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './droppable-panel';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const TagContainerEditable: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export default TagContainerEditable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './settings-container';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KeyboardEvent, MouseEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type MessageDescriptor } from 'react-intl';
|
|
3
|
+
declare type TSettingsContainerProps = {
|
|
4
|
+
title: MessageDescriptor & {
|
|
5
|
+
values?: Record<string, React.ReactNode>;
|
|
6
|
+
};
|
|
7
|
+
closeButtonLabel: MessageDescriptor & {
|
|
8
|
+
values?: Record<string, React.ReactNode>;
|
|
9
|
+
};
|
|
10
|
+
onClose: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
|
+
primaryButton?: ReactElement;
|
|
12
|
+
secondaryButton?: ReactElement;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
containerTheme?: 'light' | 'dark';
|
|
15
|
+
};
|
|
16
|
+
declare const SettingsContainer: {
|
|
17
|
+
(props: TSettingsContainerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
defaultProps: Pick<TSettingsContainerProps, "containerTheme">;
|
|
20
|
+
};
|
|
21
|
+
export default SettingsContainer;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/data-table-manager",
|
|
3
3
|
"description": "This component enhances the DataTable component and additionally provides a UI and state management to handle configuration of the table such as column manager.",
|
|
4
|
-
"version": "13.0.
|
|
4
|
+
"version": "13.0.4",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,38 +21,39 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "7.17.2",
|
|
23
23
|
"@babel/runtime-corejs3": "7.17.2",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "13.0.
|
|
24
|
+
"@commercetools-uikit/accessible-button": "13.0.4",
|
|
25
25
|
"@commercetools-uikit/accessible-hidden": "13.0.0",
|
|
26
|
-
"@commercetools-uikit/async-select-input": "13.0.
|
|
26
|
+
"@commercetools-uikit/async-select-input": "13.0.4",
|
|
27
27
|
"@commercetools-uikit/card": "13.0.2",
|
|
28
28
|
"@commercetools-uikit/collapsible-motion": "13.0.2",
|
|
29
29
|
"@commercetools-uikit/design-system": "13.0.0",
|
|
30
|
-
"@commercetools-uikit/field-label": "13.0.
|
|
30
|
+
"@commercetools-uikit/field-label": "13.0.4",
|
|
31
31
|
"@commercetools-uikit/grid": "12.2.9",
|
|
32
32
|
"@commercetools-uikit/hooks": "13.0.2",
|
|
33
33
|
"@commercetools-uikit/icons": "13.0.2",
|
|
34
|
-
"@commercetools-uikit/primary-button": "13.0.
|
|
35
|
-
"@commercetools-uikit/radio-input": "13.0.
|
|
36
|
-
"@commercetools-uikit/secondary-button": "13.0.
|
|
37
|
-
"@commercetools-uikit/secondary-icon-button": "13.0.
|
|
38
|
-
"@commercetools-uikit/select-input": "13.0.
|
|
34
|
+
"@commercetools-uikit/primary-button": "13.0.4",
|
|
35
|
+
"@commercetools-uikit/radio-input": "13.0.4",
|
|
36
|
+
"@commercetools-uikit/secondary-button": "13.0.4",
|
|
37
|
+
"@commercetools-uikit/secondary-icon-button": "13.0.4",
|
|
38
|
+
"@commercetools-uikit/select-input": "13.0.4",
|
|
39
39
|
"@commercetools-uikit/spacings": "13.0.2",
|
|
40
|
-
"@commercetools-uikit/tag": "13.0.
|
|
41
|
-
"@commercetools-uikit/text": "13.0.
|
|
40
|
+
"@commercetools-uikit/tag": "13.0.4",
|
|
41
|
+
"@commercetools-uikit/text": "13.0.4",
|
|
42
42
|
"@commercetools-uikit/utils": "13.0.2",
|
|
43
43
|
"@emotion/react": "^11.4.0",
|
|
44
44
|
"@emotion/styled": "^11.3.0",
|
|
45
45
|
"debounce-promise": "^3.1.2",
|
|
46
46
|
"lodash": "4.17.21",
|
|
47
47
|
"prop-types": "15.8.1",
|
|
48
|
-
"react-beautiful-dnd": "13.1.0"
|
|
49
|
-
"react-required-if": "1.0.3"
|
|
48
|
+
"react-beautiful-dnd": "13.1.0"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
51
|
+
"@types/debounce-promise": "^3.1.4",
|
|
52
|
+
"@types/react-beautiful-dnd": "^13.1.2",
|
|
52
53
|
"formik": "^2.2.9",
|
|
53
54
|
"react": "17.0.2",
|
|
54
55
|
"react-dom": "17.0.2",
|
|
55
|
-
"react-intl": "5.24.6"
|
|
56
|
+
"react-intl": "^5.24.6"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"react": "17.x",
|