@balena/ui-shared-components 11.2.21 → 11.2.22
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.
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { visuallyHidden } from '@mui/utils';
|
|
3
|
-
import { Box, Checkbox, TableCell, TableHead, TableSortLabel, } from '@mui/material';
|
|
3
|
+
import { Box, Checkbox, TableCell, TableHead, TableRow, TableSortLabel, } from '@mui/material';
|
|
4
4
|
export const TableHeader = ({ data, isServerSide, columns, onSelectAllClick, order, orderBy, numSelected, checkedState, rowCount, onRequestSort, }) => {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
? 'none'
|
|
9
|
-
: checkedState === 'all'
|
|
5
|
+
return (_jsx(TableHead, { sx: { borderCollapse: 'collapse' }, children: _jsxs(TableRow, { children: [onSelectAllClick && (_jsx(TableCell, { "data-table": "table_cell__sticky_header", padding: "checkbox", children: _jsx(Checkbox, { color: "primary", indeterminate: checkedState === 'some', checked: (rowCount > 0 && numSelected === rowCount) ||
|
|
6
|
+
checkedState === 'all', onChange: () => {
|
|
7
|
+
const state = checkedState === 'some'
|
|
10
8
|
? 'none'
|
|
11
|
-
: 'all'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
: checkedState === 'all'
|
|
10
|
+
? 'none'
|
|
11
|
+
: 'all';
|
|
12
|
+
const clientData = state === 'all' ? data : undefined;
|
|
13
|
+
onSelectAllClick === null || onSelectAllClick === void 0 ? void 0 : onSelectAllClick(isServerSide ? undefined : clientData, state);
|
|
14
|
+
}, inputProps: {
|
|
15
|
+
'aria-label': 'select all rows',
|
|
16
|
+
} }) })), columns.map((column, index) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
return column.selected && (_jsx(TableCell, { align: "left", sortDirection: orderBy === column.key ? order : false, sx: { whiteSpace: 'nowrap', border: 'none' }, children: column.sortable ? (_jsxs(TableSortLabel, { active: orderBy === column.key, direction: orderBy === column.key ? order : 'asc', onClick: (event) => {
|
|
19
|
+
onRequestSort(event, column);
|
|
20
|
+
}, children: [(_a = column.label) !== null && _a !== void 0 ? _a : column.title, orderBy === column.key ? (_jsx(Box, { component: "span", sx: visuallyHidden, children: order === 'desc'
|
|
21
|
+
? 'sorted descending'
|
|
22
|
+
: 'sorted ascending' })) : null] })) : (((_b = column.label) !== null && _b !== void 0 ? _b : column.title)) }, `${column.label}_${index}`));
|
|
23
|
+
})] }) }));
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.22",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -137,6 +137,6 @@
|
|
|
137
137
|
},
|
|
138
138
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
139
139
|
"versionist": {
|
|
140
|
-
"publishedAt": "2025-03-18T14:
|
|
140
|
+
"publishedAt": "2025-03-18T14:36:23.453Z"
|
|
141
141
|
}
|
|
142
142
|
}
|