simple-table-core 3.9.6 → 3.9.7
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/cjs/index.js +1 -1
- package/dist/cjs/src/hooks/handleOutsideClick.d.ts +1 -1
- package/dist/cjs/src/managers/SelectionManager/types.d.ts +6 -1
- package/dist/cjs/src/managers/TableManager.d.ts +1 -0
- package/dist/cjs/src/types/SimpleTableConfig.d.ts +1 -0
- package/dist/cjs/src/types/SimpleTableProps.d.ts +1 -0
- package/dist/cjs/src/utils/headerCell/types.d.ts +1 -1
- package/dist/cjs/stories/docs/storyArgs.d.ts +7 -0
- package/dist/cjs/stories/examples/AlignmentExample.d.ts +1 -0
- package/dist/cjs/stories/examples/CellHighlighting.d.ts +1 -0
- package/dist/cjs/stories/examples/Pagination.d.ts +1 -0
- package/dist/cjs/stories/examples/SelectableCells.d.ts +1 -0
- package/dist/cjs/stories/examples/Theming.d.ts +1 -0
- package/dist/cjs/stories/examples/pinned-columns/PinnedColumns.d.ts +1 -0
- package/dist/cjs/stories/tests/12-CellSelectionTests.stories.d.ts +1 -1
- package/dist/cjs/stories/tests/21-ColumnSelectionTests.stories.d.ts +1 -1
- package/dist/cjs/stories/vanillaStoryConfig.d.ts +7 -0
- package/dist/index.es.js +1 -1
- package/dist/src/hooks/handleOutsideClick.d.ts +1 -1
- package/dist/src/managers/SelectionManager/types.d.ts +6 -1
- package/dist/src/managers/TableManager.d.ts +1 -0
- package/dist/src/types/SimpleTableConfig.d.ts +1 -0
- package/dist/src/types/SimpleTableProps.d.ts +1 -0
- package/dist/src/utils/headerCell/types.d.ts +1 -1
- package/dist/stories/docs/storyArgs.d.ts +7 -0
- package/dist/stories/examples/AlignmentExample.d.ts +1 -0
- package/dist/stories/examples/CellHighlighting.d.ts +1 -0
- package/dist/stories/examples/Pagination.d.ts +1 -0
- package/dist/stories/examples/SelectableCells.d.ts +1 -0
- package/dist/stories/examples/Theming.d.ts +1 -0
- package/dist/stories/examples/pinned-columns/PinnedColumns.d.ts +1 -0
- package/dist/stories/tests/12-CellSelectionTests.stories.d.ts +1 -1
- package/dist/stories/tests/21-ColumnSelectionTests.stories.d.ts +1 -1
- package/dist/stories/vanillaStoryConfig.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import HeaderObject from "../types/HeaderObject";
|
|
2
2
|
import Cell from "../types/Cell";
|
|
3
3
|
export interface HandleOutsideClickConfig {
|
|
4
|
-
|
|
4
|
+
selectableColumns: boolean;
|
|
5
5
|
selectedCells: Set<string>;
|
|
6
6
|
selectedColumns: Set<number>;
|
|
7
7
|
setSelectedCells: (cells: Set<string>) => void;
|
|
@@ -5,8 +5,13 @@ import type Cell from "../../types/Cell";
|
|
|
5
5
|
import type { CustomTheme } from "../../types/CustomTheme";
|
|
6
6
|
export declare const createSetString: ({ rowIndex, colIndex, rowId }: Cell) => string;
|
|
7
7
|
export interface SelectionManagerConfig {
|
|
8
|
-
/** When true, enables cell selection and column header selection. */
|
|
9
8
|
selectableCells: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* When true, column header click selects columns (`st-header-selected` on headers).
|
|
11
|
+
* Cell-in-column header tint (`st-header-has-highlighted-cell`) also applies when `selectableCells` is true
|
|
12
|
+
* even if this is false.
|
|
13
|
+
*/
|
|
14
|
+
selectableColumns?: boolean;
|
|
10
15
|
headers: HeaderObject[];
|
|
11
16
|
tableRows: TableRowType[];
|
|
12
17
|
onCellEdit?: (props: any) => void;
|
|
@@ -105,6 +105,7 @@ export interface SimpleTableConfig {
|
|
|
105
105
|
rowsPerPage?: number;
|
|
106
106
|
scrollParent?: HTMLElement | "window" | (() => HTMLElement | null);
|
|
107
107
|
selectableCells?: boolean;
|
|
108
|
+
selectableColumns?: boolean;
|
|
108
109
|
serverSidePagination?: boolean;
|
|
109
110
|
shouldPaginate?: boolean;
|
|
110
111
|
tableEmptyStateRenderer?: HTMLElement | string | null;
|
|
@@ -98,6 +98,7 @@ export interface SimpleTableProps {
|
|
|
98
98
|
rowsPerPage?: number;
|
|
99
99
|
scrollParent?: HTMLElement | "window" | (() => HTMLElement | null);
|
|
100
100
|
selectableCells?: boolean;
|
|
101
|
+
selectableColumns?: boolean;
|
|
101
102
|
serverSidePagination?: boolean;
|
|
102
103
|
shouldPaginate?: boolean;
|
|
103
104
|
tableEmptyStateRenderer?: HTMLElement | string | null;
|
|
@@ -74,7 +74,7 @@ export interface HeaderRenderContext {
|
|
|
74
74
|
reverse: boolean;
|
|
75
75
|
rows: Row[];
|
|
76
76
|
selectColumns?: (columnIndices: number[]) => void;
|
|
77
|
-
|
|
77
|
+
selectableColumns?: boolean;
|
|
78
78
|
selectedColumns: Set<number>;
|
|
79
79
|
selectedRowCount?: number; /** Used for context cache invalidation when row selection changes */
|
|
80
80
|
setCollapsedHeaders: Dispatch<SetStateAction<Set<Accessor>>>;
|
|
@@ -18,6 +18,7 @@ export declare const storyArgs: (exampleDefaults?: Partial<UniversalVanillaArgs>
|
|
|
18
18
|
hideFooter?: boolean | undefined;
|
|
19
19
|
rowsPerPage?: number | undefined;
|
|
20
20
|
selectableCells?: boolean | undefined;
|
|
21
|
+
selectableColumns?: boolean | undefined;
|
|
21
22
|
shouldPaginate?: boolean | undefined;
|
|
22
23
|
theme?: import("../../src/types/Theme").default | undefined;
|
|
23
24
|
useHoverRowBackground?: boolean | undefined;
|
|
@@ -110,6 +111,12 @@ export declare const storyArgs: (exampleDefaults?: Partial<UniversalVanillaArgs>
|
|
|
110
111
|
};
|
|
111
112
|
description: string;
|
|
112
113
|
};
|
|
114
|
+
selectableColumns: {
|
|
115
|
+
control: {
|
|
116
|
+
type: "boolean";
|
|
117
|
+
};
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
113
120
|
shouldPaginate: {
|
|
114
121
|
control: {
|
|
115
122
|
type: "boolean";
|
|
@@ -2,5 +2,6 @@ import { type UniversalVanillaArgs } from "../vanillaStoryConfig";
|
|
|
2
2
|
export declare const cellHighlightingExampleDefaults: {
|
|
3
3
|
height: string;
|
|
4
4
|
selectableCells: boolean;
|
|
5
|
+
selectableColumns: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare function renderCellHighlightingExample(args?: Partial<UniversalVanillaArgs>): HTMLElement;
|
|
@@ -2,6 +2,7 @@ import { type UniversalVanillaArgs } from "../vanillaStoryConfig";
|
|
|
2
2
|
export declare const selectableCellsExampleDefaults: {
|
|
3
3
|
rowGrouping: readonly ["stores"];
|
|
4
4
|
selectableCells: boolean;
|
|
5
|
+
selectableColumns: boolean;
|
|
5
6
|
columnResizing: boolean;
|
|
6
7
|
columnReordering: boolean;
|
|
7
8
|
height: string;
|
|
@@ -74,7 +74,7 @@ export declare const OutsideClickClearsSelection: {
|
|
|
74
74
|
}) => Promise<void>;
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
|
-
* Edge case: when
|
|
77
|
+
* Edge case: when selectableColumns is true, clicking a column header should clear
|
|
78
78
|
* any existing cell selection (and initial focused cell) so that column selection takes over.
|
|
79
79
|
*/
|
|
80
80
|
export declare const ColumnHeaderClickClearsCellSelection: {
|
|
@@ -18,6 +18,7 @@ export interface UniversalVanillaArgs {
|
|
|
18
18
|
hideFooter?: boolean;
|
|
19
19
|
rowsPerPage?: number;
|
|
20
20
|
selectableCells?: boolean;
|
|
21
|
+
selectableColumns?: boolean;
|
|
21
22
|
shouldPaginate?: boolean;
|
|
22
23
|
theme?: Theme;
|
|
23
24
|
useHoverRowBackground?: boolean;
|
|
@@ -111,6 +112,12 @@ export declare const vanillaArgTypes: {
|
|
|
111
112
|
};
|
|
112
113
|
description: string;
|
|
113
114
|
};
|
|
115
|
+
selectableColumns: {
|
|
116
|
+
control: {
|
|
117
|
+
type: "boolean";
|
|
118
|
+
};
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
114
121
|
shouldPaginate: {
|
|
115
122
|
control: {
|
|
116
123
|
type: "boolean";
|