@geotab/zenith 1.26.1-beta.2 → 1.26.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/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
48
48
|
* Fix point hover size in `Chart`
|
|
49
49
|
* Update the logic of selecting rows in `Table`
|
|
50
50
|
* Allow custom icon in `PillExpandable`
|
|
51
|
-
* Header toolbar updates (
|
|
51
|
+
* Header toolbar updates (make "More" button to be an icon button, support icon buttons in Header)
|
|
52
52
|
|
|
53
53
|
### 1.26.0
|
|
54
54
|
|
|
@@ -10,6 +10,7 @@ interface ICheckboxSettings<T> {
|
|
|
10
10
|
condition?: (entity: T) => boolean;
|
|
11
11
|
checkboxDisabled?: (entity: T) => boolean;
|
|
12
12
|
checkboxVisible?: (entity: T) => boolean;
|
|
13
|
+
turnOffSelectAll?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface ISelectableRowsListOptions<T> extends ICheckboxSettings<T> {
|
|
15
16
|
firstColumnId: string;
|
|
@@ -139,12 +139,16 @@ function InnerList(props, ref) {
|
|
|
139
139
|
});
|
|
140
140
|
}, [entities, selections, allSelected, options, onSelect, selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll]);
|
|
141
141
|
const onSelectAll = (0, react_1.useCallback)(([checked]) => {
|
|
142
|
+
if (checked && ((selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll) || options.turnOffSelectAll)) {
|
|
143
|
+
selectAll(true);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
142
146
|
onSelect({
|
|
143
147
|
selected: [],
|
|
144
148
|
allSelected: checked,
|
|
145
149
|
turnOffSelectAll: selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll
|
|
146
150
|
});
|
|
147
|
-
}, [onSelect, selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll]);
|
|
151
|
+
}, [onSelect, selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll, options.turnOffSelectAll, selectAll]);
|
|
148
152
|
const onTriggerClick = (0, react_1.useCallback)(() => {
|
|
149
153
|
setIsOpen(!isOpen);
|
|
150
154
|
}, [isOpen]);
|
|
@@ -202,7 +206,7 @@ function InnerList(props, ref) {
|
|
|
202
206
|
return newColumns;
|
|
203
207
|
}, [columns, options.firstColumnId, wrapper]);
|
|
204
208
|
const listItems = (0, react_1.useMemo)(() => selectionOptions
|
|
205
|
-
.filter(option => !(selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll) || option.value !== checkboxColumnWrapper_1.SelectionState.All)
|
|
209
|
+
.filter(option => (!(selection === null || selection === void 0 ? void 0 : selection.turnOffSelectAll) && !options.turnOffSelectAll) || option.value !== checkboxColumnWrapper_1.SelectionState.All)
|
|
206
210
|
.map(option => ({
|
|
207
211
|
id: option.id,
|
|
208
212
|
value: option.value,
|
|
@@ -85,5 +85,5 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
85
85
|
footer: footer,
|
|
86
86
|
other: other
|
|
87
87
|
};
|
|
88
|
-
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll]);
|
|
88
|
+
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll, turnOffSelectAll]);
|
|
89
89
|
exports.useTableChildren = useTableChildren;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotab/zenith",
|
|
3
|
-
"version": "1.26.1
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "Zenith components library on React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
"**/*.less",
|
|
10
10
|
"**/react-chartjs/dateAdapter.ts"
|
|
11
11
|
],
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
15
12
|
"module": "dist/index.js",
|
|
16
13
|
"scripts": {
|
|
17
14
|
"test": "npm run clean && npm run test-build && jest",
|
|
@@ -101,5 +98,8 @@
|
|
|
101
98
|
"last 1 firefox version",
|
|
102
99
|
"last 1 safari version"
|
|
103
100
|
]
|
|
101
|
+
},
|
|
102
|
+
"publishConfig": {
|
|
103
|
+
"access": "public"
|
|
104
104
|
}
|
|
105
105
|
}
|