@astral/ui 0.20.0 → 0.22.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/ButtonBase/styled.js +5 -5
- package/DataGrid/DataGrid.d.ts +3 -0
- package/DataGrid/DataGrid.js +64 -0
- package/DataGrid/DataGridBody/DataGridBody.d.ts +3 -0
- package/DataGrid/DataGridBody/DataGridBody.js +39 -0
- package/DataGrid/DataGridBody/index.d.ts +1 -0
- package/DataGrid/DataGridBody/index.js +13 -0
- package/DataGrid/DataGridBody/styled.d.ts +13 -0
- package/DataGrid/DataGridBody/styled.js +17 -0
- package/DataGrid/DataGridBody/types.d.ts +11 -0
- package/DataGrid/DataGridBody/types.js +2 -0
- package/DataGrid/DataGridCell/DataGridCell.d.ts +3 -0
- package/DataGrid/DataGridCell/DataGridCell.js +29 -0
- package/DataGrid/DataGridCell/index.d.ts +1 -0
- package/DataGrid/DataGridCell/index.js +13 -0
- package/DataGrid/DataGridCell/types.d.ts +5 -0
- package/DataGrid/DataGridCell/types.js +2 -0
- package/DataGrid/DataGridHead/DataGridHead.d.ts +3 -0
- package/DataGrid/DataGridHead/DataGridHead.js +71 -0
- package/DataGrid/DataGridHead/index.d.ts +2 -0
- package/DataGrid/DataGridHead/index.js +14 -0
- package/DataGrid/DataGridHead/types.d.ts +11 -0
- package/DataGrid/DataGridHead/types.js +2 -0
- package/DataGrid/DataGridHeadColumn/DataGridHeadColumn.d.ts +3 -0
- package/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +30 -0
- package/DataGrid/DataGridHeadColumn/index.d.ts +2 -0
- package/DataGrid/DataGridHeadColumn/index.js +14 -0
- package/DataGrid/DataGridHeadColumn/styled.d.ts +38 -0
- package/DataGrid/DataGridHeadColumn/styled.js +20 -0
- package/DataGrid/DataGridHeadColumn/types.d.ts +11 -0
- package/DataGrid/DataGridHeadColumn/types.js +2 -0
- package/DataGrid/DataGridLoader/DataGridLoader.d.ts +4 -0
- package/DataGrid/DataGridLoader/DataGridLoader.js +9 -0
- package/DataGrid/DataGridLoader/index.d.ts +2 -0
- package/DataGrid/DataGridLoader/index.js +14 -0
- package/DataGrid/DataGridLoader/styled.d.ts +27 -0
- package/DataGrid/DataGridLoader/styled.js +18 -0
- package/DataGrid/DataGridLoader/types.d.ts +3 -0
- package/DataGrid/DataGridLoader/types.js +2 -0
- package/DataGrid/constants.d.ts +4 -0
- package/DataGrid/constants.js +8 -0
- package/DataGrid/index.d.ts +2 -0
- package/DataGrid/index.js +14 -0
- package/DataGrid/styled.d.ts +16 -0
- package/DataGrid/styled.js +17 -0
- package/DataGrid/types.d.ts +32 -0
- package/DataGrid/types.js +2 -0
- package/DataGridPagination/DataGridPagination.d.ts +3 -0
- package/DataGridPagination/DataGridPagination.js +38 -0
- package/DataGridPagination/index.d.ts +2 -0
- package/DataGridPagination/index.js +14 -0
- package/DataGridPagination/styled.d.ts +10 -0
- package/DataGridPagination/styled.js +18 -0
- package/DataGridPagination/types.d.ts +6 -0
- package/DataGridPagination/types.js +2 -0
- package/Dialog/types.d.ts +1 -3
- package/DialogTitle/DialogTitle.js +4 -1
- package/DialogTitle/types.d.ts +2 -2
- package/Pagination/Pagination.d.ts +3 -0
- package/Pagination/Pagination.js +32 -0
- package/Pagination/index.d.ts +2 -0
- package/Pagination/index.js +14 -0
- package/Pagination/types.d.ts +2 -0
- package/Pagination/types.js +2 -0
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +6 -3
- package/Select/types.d.ts +1 -0
- package/SideDialog/SideDialog.d.ts +3 -0
- package/SideDialog/SideDialog.js +33 -0
- package/SideDialog/index.d.ts +2 -0
- package/SideDialog/index.js +14 -0
- package/SideDialog/styled.d.ts +4 -0
- package/SideDialog/styled.js +11 -0
- package/SideDialog/types.d.ts +4 -0
- package/SideDialog/types.js +2 -0
- package/SideDialogActions/SideDialogActions.d.ts +1 -0
- package/SideDialogActions/SideDialogActions.js +5 -0
- package/SideDialogActions/index.d.ts +1 -0
- package/SideDialogActions/index.js +13 -0
- package/SideDialogActions/types.d.ts +1 -0
- package/SideDialogActions/types.js +2 -0
- package/SideDialogContent/SideDialogContent.d.ts +1 -0
- package/SideDialogContent/SideDialogContent.js +5 -0
- package/SideDialogContent/index.d.ts +1 -0
- package/SideDialogContent/index.js +13 -0
- package/SideDialogContent/types.d.ts +1 -0
- package/SideDialogContent/types.js +2 -0
- package/SideDialogContentText/SideDialogContentText.d.ts +1 -0
- package/SideDialogContentText/SideDialogContentText.js +5 -0
- package/SideDialogContentText/index.d.ts +1 -0
- package/SideDialogContentText/index.js +13 -0
- package/SideDialogContentText/types.d.ts +1 -0
- package/SideDialogContentText/types.js +2 -0
- package/SideDialogTitle/SideDialogTitle.d.ts +1 -0
- package/SideDialogTitle/SideDialogTitle.js +5 -0
- package/SideDialogTitle/index.d.ts +1 -0
- package/SideDialogTitle/index.js +13 -0
- package/SideDialogTitle/types.d.ts +1 -0
- package/SideDialogTitle/types.js +2 -0
- package/Table/Table.d.ts +3 -0
- package/Table/Table.js +32 -0
- package/Table/TableBody/TableBody.d.ts +3 -0
- package/Table/TableBody/TableBody.js +5 -0
- package/Table/TableBody/index.d.ts +1 -0
- package/Table/TableBody/index.js +13 -0
- package/Table/TableCell/TableCell.d.ts +3 -0
- package/Table/TableCell/TableCell.js +5 -0
- package/Table/TableCell/index.d.ts +1 -0
- package/Table/TableCell/index.js +13 -0
- package/Table/TableContainer/TableContainer.d.ts +3 -0
- package/Table/TableContainer/TableContainer.js +5 -0
- package/Table/TableContainer/index.d.ts +1 -0
- package/Table/TableContainer/index.js +13 -0
- package/Table/TableFooter/TableFooter.d.ts +3 -0
- package/Table/TableFooter/TableFooter.js +5 -0
- package/Table/TableFooter/index.d.ts +1 -0
- package/Table/TableFooter/index.js +13 -0
- package/Table/TableHead/TableHead.d.ts +3 -0
- package/Table/TableHead/TableHead.js +5 -0
- package/Table/TableHead/index.d.ts +1 -0
- package/Table/TableHead/index.js +13 -0
- package/Table/TableRow/TableRow.d.ts +3 -0
- package/Table/TableRow/TableRow.js +5 -0
- package/Table/TableRow/index.d.ts +1 -0
- package/Table/TableRow/index.js +13 -0
- package/Table/TableSortLabel/TableSortLabel.d.ts +3 -0
- package/Table/TableSortLabel/TableSortLabel.js +5 -0
- package/Table/TableSortLabel/index.d.ts +1 -0
- package/Table/TableSortLabel/index.js +13 -0
- package/Table/index.d.ts +7 -0
- package/Table/index.js +19 -0
- package/esm/ButtonBase/styled.js +5 -5
- package/esm/DataGrid/DataGrid.d.ts +3 -0
- package/esm/DataGrid/DataGrid.js +57 -0
- package/esm/DataGrid/DataGridBody/DataGridBody.d.ts +3 -0
- package/esm/DataGrid/DataGridBody/DataGridBody.js +35 -0
- package/esm/DataGrid/DataGridBody/index.d.ts +1 -0
- package/esm/DataGrid/DataGridBody/index.js +1 -0
- package/esm/DataGrid/DataGridBody/styled.d.ts +13 -0
- package/esm/DataGrid/DataGridBody/styled.js +14 -0
- package/esm/DataGrid/DataGridBody/types.d.ts +11 -0
- package/esm/DataGrid/DataGridBody/types.js +1 -0
- package/esm/DataGrid/DataGridCell/DataGridCell.d.ts +3 -0
- package/esm/DataGrid/DataGridCell/DataGridCell.js +25 -0
- package/esm/DataGrid/DataGridCell/index.d.ts +1 -0
- package/esm/DataGrid/DataGridCell/index.js +1 -0
- package/esm/DataGrid/DataGridCell/types.d.ts +5 -0
- package/esm/DataGrid/DataGridCell/types.js +1 -0
- package/esm/DataGrid/DataGridHead/DataGridHead.d.ts +3 -0
- package/esm/DataGrid/DataGridHead/DataGridHead.js +67 -0
- package/esm/DataGrid/DataGridHead/index.d.ts +2 -0
- package/esm/DataGrid/DataGridHead/index.js +2 -0
- package/esm/DataGrid/DataGridHead/types.d.ts +11 -0
- package/esm/DataGrid/DataGridHead/types.js +1 -0
- package/esm/DataGrid/DataGridHeadColumn/DataGridHeadColumn.d.ts +3 -0
- package/esm/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +26 -0
- package/esm/DataGrid/DataGridHeadColumn/index.d.ts +2 -0
- package/esm/DataGrid/DataGridHeadColumn/index.js +2 -0
- package/esm/DataGrid/DataGridHeadColumn/styled.d.ts +38 -0
- package/esm/DataGrid/DataGridHeadColumn/styled.js +17 -0
- package/esm/DataGrid/DataGridHeadColumn/types.d.ts +11 -0
- package/esm/DataGrid/DataGridHeadColumn/types.js +1 -0
- package/esm/DataGrid/DataGridLoader/DataGridLoader.d.ts +4 -0
- package/esm/DataGrid/DataGridLoader/DataGridLoader.js +7 -0
- package/esm/DataGrid/DataGridLoader/index.d.ts +2 -0
- package/esm/DataGrid/DataGridLoader/index.js +2 -0
- package/esm/DataGrid/DataGridLoader/styled.d.ts +27 -0
- package/esm/DataGrid/DataGridLoader/styled.js +15 -0
- package/esm/DataGrid/DataGridLoader/types.d.ts +3 -0
- package/esm/DataGrid/DataGridLoader/types.js +1 -0
- package/esm/DataGrid/constants.d.ts +4 -0
- package/esm/DataGrid/constants.js +5 -0
- package/esm/DataGrid/index.d.ts +2 -0
- package/esm/DataGrid/index.js +2 -0
- package/esm/DataGrid/styled.d.ts +16 -0
- package/esm/DataGrid/styled.js +14 -0
- package/esm/DataGrid/types.d.ts +32 -0
- package/esm/DataGrid/types.js +1 -0
- package/esm/DataGridPagination/DataGridPagination.d.ts +3 -0
- package/esm/DataGridPagination/DataGridPagination.js +34 -0
- package/esm/DataGridPagination/index.d.ts +2 -0
- package/esm/DataGridPagination/index.js +2 -0
- package/esm/DataGridPagination/styled.d.ts +10 -0
- package/esm/DataGridPagination/styled.js +15 -0
- package/esm/DataGridPagination/types.d.ts +6 -0
- package/esm/DataGridPagination/types.js +1 -0
- package/esm/Dialog/types.d.ts +1 -3
- package/esm/DialogTitle/DialogTitle.js +4 -1
- package/esm/DialogTitle/types.d.ts +2 -2
- package/esm/Pagination/Pagination.d.ts +3 -0
- package/esm/Pagination/Pagination.js +28 -0
- package/esm/Pagination/index.d.ts +2 -0
- package/esm/Pagination/index.js +2 -0
- package/esm/Pagination/types.d.ts +2 -0
- package/esm/Pagination/types.js +1 -0
- package/esm/Select/Select.d.ts +1 -1
- package/esm/Select/Select.js +6 -3
- package/esm/Select/types.d.ts +1 -0
- package/esm/SideDialog/SideDialog.d.ts +3 -0
- package/esm/SideDialog/SideDialog.js +29 -0
- package/esm/SideDialog/index.d.ts +2 -0
- package/esm/SideDialog/index.js +2 -0
- package/esm/SideDialog/styled.d.ts +4 -0
- package/esm/SideDialog/styled.js +8 -0
- package/esm/SideDialog/types.d.ts +4 -0
- package/esm/SideDialog/types.js +1 -0
- package/esm/SideDialogActions/SideDialogActions.d.ts +1 -0
- package/esm/SideDialogActions/SideDialogActions.js +1 -0
- package/esm/SideDialogActions/index.d.ts +1 -0
- package/esm/SideDialogActions/index.js +1 -0
- package/esm/SideDialogActions/types.d.ts +1 -0
- package/esm/SideDialogActions/types.js +1 -0
- package/esm/SideDialogContent/SideDialogContent.d.ts +1 -0
- package/esm/SideDialogContent/SideDialogContent.js +1 -0
- package/esm/SideDialogContent/index.d.ts +1 -0
- package/esm/SideDialogContent/index.js +1 -0
- package/esm/SideDialogContent/types.d.ts +1 -0
- package/esm/SideDialogContent/types.js +1 -0
- package/esm/SideDialogContentText/SideDialogContentText.d.ts +1 -0
- package/esm/SideDialogContentText/SideDialogContentText.js +1 -0
- package/esm/SideDialogContentText/index.d.ts +1 -0
- package/esm/SideDialogContentText/index.js +1 -0
- package/esm/SideDialogContentText/types.d.ts +1 -0
- package/esm/SideDialogContentText/types.js +1 -0
- package/esm/SideDialogTitle/SideDialogTitle.d.ts +1 -0
- package/esm/SideDialogTitle/SideDialogTitle.js +1 -0
- package/esm/SideDialogTitle/index.d.ts +1 -0
- package/esm/SideDialogTitle/index.js +1 -0
- package/esm/SideDialogTitle/types.d.ts +1 -0
- package/esm/SideDialogTitle/types.js +1 -0
- package/esm/Table/Table.d.ts +3 -0
- package/esm/Table/Table.js +28 -0
- package/esm/Table/TableBody/TableBody.d.ts +3 -0
- package/esm/Table/TableBody/TableBody.js +2 -0
- package/esm/Table/TableBody/index.d.ts +1 -0
- package/esm/Table/TableBody/index.js +1 -0
- package/esm/Table/TableCell/TableCell.d.ts +3 -0
- package/esm/Table/TableCell/TableCell.js +2 -0
- package/esm/Table/TableCell/index.d.ts +1 -0
- package/esm/Table/TableCell/index.js +1 -0
- package/esm/Table/TableContainer/TableContainer.d.ts +3 -0
- package/esm/Table/TableContainer/TableContainer.js +2 -0
- package/esm/Table/TableContainer/index.d.ts +1 -0
- package/esm/Table/TableContainer/index.js +1 -0
- package/esm/Table/TableFooter/TableFooter.d.ts +3 -0
- package/esm/Table/TableFooter/TableFooter.js +2 -0
- package/esm/Table/TableFooter/index.d.ts +1 -0
- package/esm/Table/TableFooter/index.js +1 -0
- package/esm/Table/TableHead/TableHead.d.ts +3 -0
- package/esm/Table/TableHead/TableHead.js +2 -0
- package/esm/Table/TableHead/index.d.ts +1 -0
- package/esm/Table/TableHead/index.js +1 -0
- package/esm/Table/TableRow/TableRow.d.ts +3 -0
- package/esm/Table/TableRow/TableRow.js +2 -0
- package/esm/Table/TableRow/index.d.ts +1 -0
- package/esm/Table/TableRow/index.js +1 -0
- package/esm/Table/TableSortLabel/TableSortLabel.d.ts +3 -0
- package/esm/Table/TableSortLabel/TableSortLabel.js +2 -0
- package/esm/Table/TableSortLabel/index.d.ts +1 -0
- package/esm/Table/TableSortLabel/index.js +1 -0
- package/esm/Table/index.d.ts +7 -0
- package/esm/Table/index.js +7 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +8 -0
- package/esm/theme/__tests__/BaseTheme.test.js +1 -1
- package/esm/theme/components/MuiPaginationItem.d.ts +3 -0
- package/esm/theme/components/MuiPaginationItem.js +14 -0
- package/esm/theme/components/MuiTableCell.d.ts +3 -0
- package/esm/theme/components/MuiTableCell.js +9 -0
- package/esm/theme/components/MuiTableHead.d.ts +3 -0
- package/esm/theme/components/MuiTableHead.js +12 -0
- package/esm/theme/components/components.js +7 -1
- package/esm/theme/elevation.js +5 -5
- package/index.d.ts +8 -0
- package/index.js +8 -0
- package/package.json +2 -2
- package/theme/__tests__/BaseTheme.test.js +1 -1
- package/theme/components/MuiPaginationItem.d.ts +3 -0
- package/theme/components/MuiPaginationItem.js +17 -0
- package/theme/components/MuiTableCell.d.ts +3 -0
- package/theme/components/MuiTableCell.js +12 -0
- package/theme/components/MuiTableHead.d.ts +3 -0
- package/theme/components/MuiTableHead.js +15 -0
- package/theme/components/components.js +7 -1
- package/theme/elevation.js +5 -5
package/ButtonBase/styled.js
CHANGED
|
@@ -194,7 +194,7 @@ exports.StyledButtonBase = (0, styles_1.styled)(ButtonUnstyled_1.default, {
|
|
|
194
194
|
shouldForwardProp: function (prop) {
|
|
195
195
|
return prop !== 'customColor' && prop !== 'customVariant';
|
|
196
196
|
},
|
|
197
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n padding: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-family: Ubuntu, serif;\n\n background-color: ", ";\n border: none;\n border-radius: ", ";\n cursor: pointer;\n\n &:hover {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:focus {\n color: ", ";\n\n background-color: ", ";\n
|
|
197
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n padding: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-family: Ubuntu, serif;\n\n background-color: ", ";\n border: none;\n border-radius: ", ";\n cursor: pointer;\n\n &:hover {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:focus {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n\n background-color: ", ";\n outline: none;\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n cursor: unset;\n }\n\n &.", " {\n outline: 2px solid ", ";\n }\n"], ["\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n padding: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-family: Ubuntu, serif;\n\n background-color: ", ";\n border: none;\n border-radius: ", ";\n cursor: pointer;\n\n &:hover {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:focus {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n\n background-color: ", ";\n outline: none;\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n cursor: unset;\n }\n\n &.", " {\n outline: 2px solid ", ";\n }\n"])), exports.getButtonHeight, exports.getButtonPadding, function (props) {
|
|
198
198
|
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.DEFAULT }));
|
|
199
199
|
}, function (_a) {
|
|
200
200
|
var theme = _a.theme;
|
|
@@ -215,9 +215,6 @@ exports.StyledButtonBase = (0, styles_1.styled)(ButtonUnstyled_1.default, {
|
|
|
215
215
|
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.FOCUS }));
|
|
216
216
|
}, function (props) {
|
|
217
217
|
return (0, exports.getBgColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.FOCUS }));
|
|
218
|
-
}, function (_a) {
|
|
219
|
-
var theme = _a.theme;
|
|
220
|
-
return theme.palette.primary['400'];
|
|
221
218
|
}, function (props) {
|
|
222
219
|
return (0, exports.getColor)(__assign(__assign({}, props), { buttonState: constants_1.ButtonStates.ACTIVE }));
|
|
223
220
|
}, function (props) {
|
|
@@ -225,5 +222,8 @@ exports.StyledButtonBase = (0, styles_1.styled)(ButtonUnstyled_1.default, {
|
|
|
225
222
|
}, ButtonUnstyled_1.buttonUnstyledClasses.disabled, function (_a) {
|
|
226
223
|
var theme = _a.theme;
|
|
227
224
|
return theme.palette.grey['500'];
|
|
228
|
-
}, exports.getDisabledBgColor)
|
|
225
|
+
}, exports.getDisabledBgColor, ButtonUnstyled_1.buttonUnstyledClasses.focusVisible, function (_a) {
|
|
226
|
+
var theme = _a.theme;
|
|
227
|
+
return theme.palette.primary['400'];
|
|
228
|
+
});
|
|
229
229
|
var templateObject_1;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DataGrid = void 0;
|
|
27
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
var react_1 = require("react");
|
|
29
|
+
var Table_1 = require("../Table");
|
|
30
|
+
var DataGridHead_1 = require("./DataGridHead");
|
|
31
|
+
var DataGridBody_1 = require("./DataGridBody");
|
|
32
|
+
var DataGridLoader_1 = __importDefault(require("./DataGridLoader/DataGridLoader"));
|
|
33
|
+
var styled_1 = require("./styled");
|
|
34
|
+
function DataGrid(_a) {
|
|
35
|
+
var columns = _a.columns, _b = _a.rows, rows = _b === void 0 ? [] : _b, _c = _a.selectedRows, selectedRows = _c === void 0 ? [] : _c, _d = _a.sorting, sorting = _d === void 0 ? [] : _d, maxHeight = _a.maxHeight, _e = _a.minDisplayRows, minDisplayRows = _e === void 0 ? 10 : _e, onSelectRow = _a.onSelectRow, Footer = _a.Footer, loading = _a.loading, onSort = _a.onSort, keyId = _a.keyId;
|
|
36
|
+
var selectable = Boolean(onSelectRow);
|
|
37
|
+
var handleSelectAllRows = function (event) {
|
|
38
|
+
if (!onSelectRow)
|
|
39
|
+
return;
|
|
40
|
+
if (event.target.checked) {
|
|
41
|
+
var mergedSelectedRows = __spreadArray(__spreadArray([], selectedRows, true), rows, true);
|
|
42
|
+
return onSelectRow(mergedSelectedRows);
|
|
43
|
+
}
|
|
44
|
+
var filteredRows = selectedRows.filter(function (selectedRow) { return !rows.find(function (row) { return row[keyId] === selectedRow[keyId]; }); });
|
|
45
|
+
onSelectRow(filteredRows);
|
|
46
|
+
};
|
|
47
|
+
var handleSelectRow = (0, react_1.useCallback)(function (row) {
|
|
48
|
+
return function (event) {
|
|
49
|
+
if (!onSelectRow)
|
|
50
|
+
return;
|
|
51
|
+
if (event.target.checked) {
|
|
52
|
+
return onSelectRow(__spreadArray(__spreadArray([], selectedRows, true), [row], false));
|
|
53
|
+
}
|
|
54
|
+
return onSelectRow(selectedRows.filter(function (selectedRow) { return selectedRow[keyId] !== row[keyId]; }));
|
|
55
|
+
};
|
|
56
|
+
}, [selectedRows, onSelectRow]);
|
|
57
|
+
var uncheckedRowsCount = (0, react_1.useMemo)(function () {
|
|
58
|
+
return rows.filter(function (row) {
|
|
59
|
+
return !selectedRows.find(function (selectedRow) { return selectedRow[keyId] === row[keyId]; });
|
|
60
|
+
}).length;
|
|
61
|
+
}, [rows, selectedRows, keyId]);
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.DataGridContainer, { children: [(0, jsx_runtime_1.jsxs)(styled_1.StyledTableContainer, __assign({ maxHeight: maxHeight }, { children: [(0, jsx_runtime_1.jsxs)(Table_1.Table, __assign({ stickyHeader: true }, { children: [(0, jsx_runtime_1.jsx)(DataGridHead_1.DataGridHead, { onSort: onSort, rowsCount: rows.length, uncheckedRowsCount: uncheckedRowsCount, onSelectAllRows: handleSelectAllRows, selectable: selectable, sorting: sorting, columns: columns }, void 0), (0, jsx_runtime_1.jsx)(DataGridBody_1.DataGridBody, { keyId: keyId, selectedRows: selectedRows, minDisplayRows: minDisplayRows, onSelectRow: handleSelectRow, selectable: selectable, rows: rows, columns: columns }, void 0)] }), void 0), (0, jsx_runtime_1.jsx)(DataGridLoader_1.default, { loading: loading }, void 0)] }), void 0), Footer] }, void 0));
|
|
63
|
+
}
|
|
64
|
+
exports.DataGrid = DataGrid;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DataGridBody = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var Table_1 = require("../../Table");
|
|
18
|
+
var DataGridCell_1 = require("../DataGridCell");
|
|
19
|
+
var Checkbox_1 = require("../../Checkbox");
|
|
20
|
+
var styled_1 = require("./styled");
|
|
21
|
+
function DataGridBody(_a) {
|
|
22
|
+
var rows = _a.rows, columns = _a.columns, selectable = _a.selectable, onSelectRow = _a.onSelectRow, _b = _a.selectedRows, selectedRows = _b === void 0 ? [] : _b, minDisplayRows = _a.minDisplayRows, keyId = _a.keyId;
|
|
23
|
+
var renderCells = (0, react_1.useCallback)(function (row, rowId) {
|
|
24
|
+
return columns.map(function (cell, index) {
|
|
25
|
+
var cellId = "".concat(rowId, "-").concat(index);
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(DataGridCell_1.DataGridCell, { row: row, cell: cell }, cellId);
|
|
27
|
+
});
|
|
28
|
+
}, [columns]);
|
|
29
|
+
var renderedRows = (0, react_1.useMemo)(function () {
|
|
30
|
+
return rows.map(function (row) {
|
|
31
|
+
var rowId = row[keyId];
|
|
32
|
+
var checked = selectable &&
|
|
33
|
+
Boolean(selectedRows.find(function (selectedRow) { return selectedRow[keyId] === rowId; }));
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.TableRow, { children: [selectable && ((0, jsx_runtime_1.jsx)(Table_1.TableCell, __assign({ padding: "checkbox" }, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: checked, onChange: onSelectRow(row) }, void 0) }), void 0)), renderCells(row, rowId)] }, rowId));
|
|
35
|
+
});
|
|
36
|
+
}, [rows, keyId, selectable, selectedRows, onSelectRow, columns]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.StyledTableBody, __assign({ empty: !rows.length, minDisplayRows: minDisplayRows }, { children: renderedRows }), void 0));
|
|
38
|
+
}
|
|
39
|
+
exports.DataGridBody = DataGridBody;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridBody';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./DataGridBody"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledTableBody: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
classes?: Partial<import("@mui/material").TableBodyClasses> | undefined;
|
|
5
|
+
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
6
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "key" | keyof import("react").HTMLAttributes<HTMLTableSectionElement>> & {
|
|
7
|
+
ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
|
|
8
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx"> & {
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
empty: boolean;
|
|
12
|
+
minDisplayRows: number;
|
|
13
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StyledTableBody = void 0;
|
|
8
|
+
var styles_1 = require("../../styles");
|
|
9
|
+
var Table_1 = require("../../Table");
|
|
10
|
+
var TABLE_ROW_HEIGHT = 44;
|
|
11
|
+
exports.StyledTableBody = (0, styles_1.styled)(Table_1.TableBody, {
|
|
12
|
+
shouldForwardProp: function (prop) { return prop !== 'empty' && prop !== 'minDisplayRows'; },
|
|
13
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n"], ["\n height: ", ";\n"])), function (_a) {
|
|
14
|
+
var empty = _a.empty, minDisplayRows = _a.minDisplayRows;
|
|
15
|
+
return empty ? "".concat(TABLE_ROW_HEIGHT * minDisplayRows, "px") : 'auto';
|
|
16
|
+
});
|
|
17
|
+
var templateObject_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { DataGridColumns, DataGridRow } from '../types';
|
|
3
|
+
export declare type DataGridBodyProps<T = DataGridRow> = {
|
|
4
|
+
columns: DataGridColumns<T>[];
|
|
5
|
+
keyId: keyof DataGridRow;
|
|
6
|
+
selectable?: boolean;
|
|
7
|
+
selectedRows?: Array<T>;
|
|
8
|
+
rows: T[];
|
|
9
|
+
onSelectRow: (row: T) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
minDisplayRows: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DataGridCell = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var Table_1 = require("../../Table");
|
|
18
|
+
var Typography_1 = require("../../Typography");
|
|
19
|
+
function DataGridCell(_a) {
|
|
20
|
+
var row = _a.row, _b = _a.cell, field = _b.field, renderCell = _b.renderCell, format = _b.format, _c = _b.align, align = _c === void 0 ? 'left' : _c;
|
|
21
|
+
var formattedValue = (0, react_1.useMemo)(function () {
|
|
22
|
+
if (format) {
|
|
23
|
+
return format(row);
|
|
24
|
+
}
|
|
25
|
+
return row[field];
|
|
26
|
+
}, [field, format, row]);
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.TableCell, __assign({ align: align }, { children: [renderCell && renderCell(row), !renderCell && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { children: formattedValue }, void 0)] }), void 0));
|
|
28
|
+
}
|
|
29
|
+
exports.DataGridCell = DataGridCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridCell';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./DataGridCell"), exports);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.DataGridHead = void 0;
|
|
24
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
25
|
+
var react_1 = require("react");
|
|
26
|
+
var TableHead_1 = require("../../Table/TableHead");
|
|
27
|
+
var Table_1 = require("../../Table");
|
|
28
|
+
var Checkbox_1 = require("../../Checkbox");
|
|
29
|
+
var constants_1 = require("../constants");
|
|
30
|
+
var DataGridHeadColumn_1 = require("../DataGridHeadColumn");
|
|
31
|
+
function DataGridHead(_a) {
|
|
32
|
+
var columns = _a.columns, selectable = _a.selectable, onSelectAllRows = _a.onSelectAllRows, rowsCount = _a.rowsCount, onSort = _a.onSort, _b = _a.sorting, sorting = _b === void 0 ? [] : _b, uncheckedRowsCount = _a.uncheckedRowsCount;
|
|
33
|
+
var checked = (0, react_1.useMemo)(function () { return !Boolean(uncheckedRowsCount) && rowsCount > 0; }, [uncheckedRowsCount, rowsCount]);
|
|
34
|
+
var indeterminate = (0, react_1.useMemo)(function () { return uncheckedRowsCount > 0 && uncheckedRowsCount < rowsCount; }, [uncheckedRowsCount, rowsCount]);
|
|
35
|
+
var handleSort = (0, react_1.useCallback)(function (field, sortable) { return function () {
|
|
36
|
+
if (sortable) {
|
|
37
|
+
var currentSort = sorting.find(function (_a) {
|
|
38
|
+
var fieldId = _a.fieldId;
|
|
39
|
+
return fieldId === field;
|
|
40
|
+
});
|
|
41
|
+
// если для выбранного столбца текущая сортировка ASC - меняем на DESC
|
|
42
|
+
if (currentSort && currentSort.sort === constants_1.SortStates.ASC) {
|
|
43
|
+
var newSorting = __spreadArray(__spreadArray([], sorting.filter(function (_a) {
|
|
44
|
+
var fieldId = _a.fieldId;
|
|
45
|
+
return fieldId !== field;
|
|
46
|
+
}), true), [
|
|
47
|
+
{ fieldId: field, sort: constants_1.SortStates.DESC },
|
|
48
|
+
], false);
|
|
49
|
+
return onSort(newSorting);
|
|
50
|
+
// если для выбранного столбца текущая сортировка DESC - убираем сортировку
|
|
51
|
+
}
|
|
52
|
+
else if (currentSort && currentSort.sort === constants_1.SortStates.DESC) {
|
|
53
|
+
var newSorting = sorting.filter(function (_a) {
|
|
54
|
+
var fieldId = _a.fieldId;
|
|
55
|
+
return fieldId !== field;
|
|
56
|
+
});
|
|
57
|
+
return onSort(newSorting);
|
|
58
|
+
}
|
|
59
|
+
// если для выбранного столбца нет сортировки - добавляем сортировку ASC
|
|
60
|
+
onSort(__spreadArray(__spreadArray([], sorting, true), [{ fieldId: field, sort: constants_1.SortStates.ASC }], false));
|
|
61
|
+
}
|
|
62
|
+
}; }, [sorting]);
|
|
63
|
+
var renderColumns = (0, react_1.useMemo)(function () {
|
|
64
|
+
return columns.map(function (_a) {
|
|
65
|
+
var field = _a.field, label = _a.label, sortable = _a.sortable, align = _a.align, renderCell = _a.renderCell;
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(DataGridHeadColumn_1.DataGridHeadColumn, { sorting: sorting, renderCell: renderCell, field: field, onSort: handleSort, label: label, sortable: sortable, align: align }, void 0));
|
|
67
|
+
});
|
|
68
|
+
}, [columns, handleSort, sorting]);
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(TableHead_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(Table_1.TableRow, { children: [selectable && ((0, jsx_runtime_1.jsx)(Table_1.TableCell, __assign({ padding: "checkbox" }, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: checked, indeterminate: indeterminate, onChange: onSelectAllRows }, void 0) }), void 0)), renderColumns] }, void 0) }, void 0));
|
|
70
|
+
}
|
|
71
|
+
exports.DataGridHead = DataGridHead;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./DataGridHead"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { DataGridColumns, DataGridRow, DataGridSort } from '../types';
|
|
3
|
+
export declare type DataGridHeadProps<T = DataGridRow> = {
|
|
4
|
+
columns: DataGridColumns<T>[];
|
|
5
|
+
selectable: boolean;
|
|
6
|
+
onSelectAllRows: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
sorting: DataGridSort<T>[];
|
|
8
|
+
onSort: (sorting: DataGridSort<T>[]) => void;
|
|
9
|
+
uncheckedRowsCount: number;
|
|
10
|
+
rowsCount: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DataGridHeadColumn = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var Typography_1 = require("../../Typography/Typography");
|
|
17
|
+
var constants_1 = require("../constants");
|
|
18
|
+
var styled_1 = require("./styled");
|
|
19
|
+
function DataGridHeadColumn(_a) {
|
|
20
|
+
var onSort = _a.onSort, field = _a.field, sortable = _a.sortable, align = _a.align, label = _a.label, sorting = _a.sorting, renderCell = _a.renderCell;
|
|
21
|
+
var sortParams = sorting.find(function (_a) {
|
|
22
|
+
var fieldId = _a.fieldId;
|
|
23
|
+
return field === fieldId;
|
|
24
|
+
});
|
|
25
|
+
var hideSortIcon = !Boolean(sortParams);
|
|
26
|
+
var sortDirection = sortParams ? sortParams.sort : constants_1.SortStates.ASC;
|
|
27
|
+
var fitContent = Boolean(renderCell);
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.StyledTableCell, __assign({ onClick: onSort(field, sortable), fitContent: fitContent, align: align }, { children: [(0, jsx_runtime_1.jsx)(Typography_1.Typography, __assign({ variant: "pointer" }, { children: label }), void 0), sortable && ((0, jsx_runtime_1.jsx)(styled_1.StyledTableSortLabel, { hideSortIcon: hideSortIcon, direction: sortDirection, active: true }, void 0))] }), void 0));
|
|
29
|
+
}
|
|
30
|
+
exports.DataGridHeadColumn = DataGridHeadColumn;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./DataGridHeadColumn"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
3
|
+
export declare const StyledTableSortLabel: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
active?: boolean | undefined;
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
classes?: Partial<import("@mui/material").TableSortLabelClasses> | undefined;
|
|
7
|
+
direction?: "desc" | "asc" | undefined;
|
|
8
|
+
hideSortIcon?: boolean | undefined;
|
|
9
|
+
IconComponent?: import("react").JSXElementConstructor<{
|
|
10
|
+
className: string;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
13
|
+
} & Omit<{
|
|
14
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
15
|
+
centerRipple?: boolean | undefined;
|
|
16
|
+
children?: import("react").ReactNode;
|
|
17
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
disableRipple?: boolean | undefined;
|
|
20
|
+
disableTouchRipple?: boolean | undefined;
|
|
21
|
+
focusRipple?: boolean | undefined;
|
|
22
|
+
focusVisibleClassName?: string | undefined;
|
|
23
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
24
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
25
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
27
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
28
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
29
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
30
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
31
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "disabled" | "sx" | "tabIndex" | "direction" | "action" | "active" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "hideSortIcon" | "IconComponent"> & {
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
export declare const StyledTableCell: import("@emotion/styled").StyledComponent<TableCellProps & {
|
|
35
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
fitContent?: boolean | undefined;
|
|
38
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StyledTableCell = exports.StyledTableSortLabel = void 0;
|
|
8
|
+
var styles_1 = require("../../styles");
|
|
9
|
+
var Table_1 = require("../../Table");
|
|
10
|
+
exports.StyledTableSortLabel = (0, styles_1.styled)(Table_1.TableSortLabel)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n visibility: ", ";\n"], ["\n visibility: ", ";\n"])), function (_a) {
|
|
11
|
+
var hideSortIcon = _a.hideSortIcon;
|
|
12
|
+
return hideSortIcon && 'hidden';
|
|
13
|
+
});
|
|
14
|
+
exports.StyledTableCell = (0, styles_1.styled)(Table_1.TableCell, {
|
|
15
|
+
shouldForwardProp: function (prop) { return prop !== 'fitContent'; },
|
|
16
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n\n cursor: pointer;\n\n user-select: none;\n"], ["\n width: ", ";\n\n cursor: pointer;\n\n user-select: none;\n"])), function (_a) {
|
|
17
|
+
var fitContent = _a.fitContent;
|
|
18
|
+
return (fitContent ? '1%' : 'auto');
|
|
19
|
+
});
|
|
20
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TableCellProps } from '@mui/material';
|
|
2
|
+
import { DataGridSort, RenderCell } from '../types';
|
|
3
|
+
export declare type DataGridHeadColumnProps<T> = {
|
|
4
|
+
onSort: (field: keyof T, sortable: boolean | undefined) => () => void;
|
|
5
|
+
sorting: DataGridSort<T>[];
|
|
6
|
+
renderCell?: RenderCell<T>;
|
|
7
|
+
label?: string;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
align?: TableCellProps['align'];
|
|
10
|
+
field: keyof T;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var styled_1 = require("./styled");
|
|
5
|
+
var DataGridLoader = function (_a) {
|
|
6
|
+
var _b = _a.loading, loading = _b === void 0 ? false : _b;
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.LoaderWrapper, { children: [loading && (0, jsx_runtime_1.jsx)(styled_1.Backdrop, {}, void 0), loading ? (0, jsx_runtime_1.jsx)(styled_1.StyledLinearProgress, {}, void 0) : (0, jsx_runtime_1.jsx)(styled_1.StyledDivider, {}, void 0)] }, void 0));
|
|
8
|
+
};
|
|
9
|
+
exports.default = DataGridLoader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./styled"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Backdrop: 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 declare const StyledDivider: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
absolute?: boolean | undefined;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
classes?: Partial<import("@mui/material").DividerClasses> | undefined;
|
|
10
|
+
flexItem?: boolean | undefined;
|
|
11
|
+
light?: boolean | undefined;
|
|
12
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
13
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
|
+
textAlign?: "left" | "center" | "right" | undefined;
|
|
15
|
+
variant?: "middle" | "inset" | "fullWidth" | undefined;
|
|
16
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "key" | keyof import("react").HTMLAttributes<HTMLHRElement>> & {
|
|
17
|
+
ref?: ((instance: HTMLHRElement | null) => void) | import("react").RefObject<HTMLHRElement> | null | undefined;
|
|
18
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "orientation" | "textAlign" | "light" | "absolute" | "flexItem"> & {
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
}, {}, {}>;
|
|
21
|
+
export declare const LoaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
+
as?: import("react").ElementType<any> | undefined;
|
|
24
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
25
|
+
export declare const StyledLinearProgress: import("@emotion/styled").StyledComponent<import("@mui/material").LinearProgressProps & {
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StyledLinearProgress = exports.LoaderWrapper = exports.StyledDivider = exports.Backdrop = void 0;
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
var Divider_1 = require("../../Divider");
|
|
10
|
+
var styles_1 = require("../../styles");
|
|
11
|
+
exports.Backdrop = styles_1.styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n\n width: 100%;\n height: 100%;\n\n background-color: ", ";\n opacity: 0.6;\n"], ["\n position: absolute;\n top: 0;\n\n width: 100%;\n height: 100%;\n\n background-color: ", ";\n opacity: 0.6;\n"])), function (_a) {
|
|
12
|
+
var theme = _a.theme;
|
|
13
|
+
return theme.palette.grey['100'];
|
|
14
|
+
});
|
|
15
|
+
exports.StyledDivider = (0, styles_1.styled)(Divider_1.Divider)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-width: 1px;\n"], ["\n border-width: 1px;\n"])));
|
|
16
|
+
exports.LoaderWrapper = styles_1.styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 2px;\n"], ["\n height: 2px;\n"])));
|
|
17
|
+
exports.StyledLinearProgress = (0, styles_1.styled)(material_1.LinearProgress)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 2px;\n"], ["\n height: 2px;\n"])));
|
|
18
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|