@redsift/table 9.5.0-muiv5 → 9.5.0
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/index.d.ts +6 -5
- package/index.js +104 -124
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
2
|
import { GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputMultipleValue, DataGridProProps, GridFilterModel, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
export
|
|
3
|
+
export * from '@mui/x-data-grid-pro';
|
|
4
|
+
export { GridAlignment, GridColDef, GridFilterItem, GridFilterModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
5
|
import { Comp, IconProps, NotificationsColorPalette, ProductColorPalette, ShieldVariant } from '@redsift/design-system';
|
|
5
6
|
import React, { ReactNode, ComponentProps, RefObject } from 'react';
|
|
6
7
|
import { TablePaginationProps } from '@mui/material';
|
|
@@ -10,7 +11,7 @@ declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any,
|
|
|
10
11
|
declare const IS_BETWEEN: {
|
|
11
12
|
label: string;
|
|
12
13
|
value: string;
|
|
13
|
-
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams) => boolean) | null;
|
|
14
|
+
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams<any, any>) => boolean) | null;
|
|
14
15
|
InputComponent: (props: any) => JSX.Element;
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -85,12 +86,12 @@ type StyledDataGridProps = {
|
|
|
85
86
|
declare const DataGrid: Comp<DataGridProps, HTMLDivElement>;
|
|
86
87
|
|
|
87
88
|
interface CompletionResponseItem {
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
field: string;
|
|
90
|
+
operator: string;
|
|
90
91
|
value?: string;
|
|
91
92
|
}
|
|
92
93
|
type CompletionResponse = {
|
|
93
|
-
|
|
94
|
+
logicOperator: 'and' | 'or';
|
|
94
95
|
items: CompletionResponseItem[];
|
|
95
96
|
};
|
|
96
97
|
interface LocaleText {
|
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport,
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, useGridApiRef, DataGridPro, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
2
|
+
export * from '@mui/x-data-grid-pro';
|
|
2
3
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import React__default, { Children, isValidElement, cloneElement, useLayoutEffect, useEffect, useRef, forwardRef, useState, useCallback, createElement } from 'react';
|
|
@@ -17466,7 +17467,7 @@ const isBetweenOperator = {
|
|
|
17466
17467
|
label: 'is between',
|
|
17467
17468
|
value: 'isBetween',
|
|
17468
17469
|
getApplyFilterFn: filterItem => {
|
|
17469
|
-
if (!filterItem.
|
|
17470
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17470
17471
|
return null;
|
|
17471
17472
|
}
|
|
17472
17473
|
if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
|
|
@@ -17479,7 +17480,7 @@ const isBetweenOperator = {
|
|
|
17479
17480
|
return null;
|
|
17480
17481
|
}
|
|
17481
17482
|
return params => {
|
|
17482
|
-
return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17483
|
+
return params.value !== null && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17483
17484
|
};
|
|
17484
17485
|
},
|
|
17485
17486
|
InputComponent: InputNumberInterval
|
|
@@ -17492,7 +17493,7 @@ const containsAnyOfOperator = {
|
|
|
17492
17493
|
label: 'contains any of',
|
|
17493
17494
|
value: 'containsAnyOf',
|
|
17494
17495
|
getApplyFilterFn: filterItem => {
|
|
17495
|
-
if (!filterItem.
|
|
17496
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17496
17497
|
return null;
|
|
17497
17498
|
}
|
|
17498
17499
|
return params => {
|
|
@@ -17515,7 +17516,7 @@ const containsAnyOfCIOperator = {
|
|
|
17515
17516
|
label: 'contains any of (case insensitive)',
|
|
17516
17517
|
value: 'containsAnyOf',
|
|
17517
17518
|
getApplyFilterFn: filterItem => {
|
|
17518
|
-
if (!filterItem.
|
|
17519
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17519
17520
|
return null;
|
|
17520
17521
|
}
|
|
17521
17522
|
return params => {
|
|
@@ -17542,7 +17543,7 @@ const endsWithAnyOfOperator = {
|
|
|
17542
17543
|
label: 'ends with any of',
|
|
17543
17544
|
value: 'endsWithAnyOf',
|
|
17544
17545
|
getApplyFilterFn: filterItem => {
|
|
17545
|
-
if (!filterItem.
|
|
17546
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17546
17547
|
return null;
|
|
17547
17548
|
}
|
|
17548
17549
|
return params => {
|
|
@@ -17569,7 +17570,7 @@ const isAnyOfOperator = {
|
|
|
17569
17570
|
label: 'is any of',
|
|
17570
17571
|
value: 'isAnyOf',
|
|
17571
17572
|
getApplyFilterFn: filterItem => {
|
|
17572
|
-
if (!filterItem.
|
|
17573
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17573
17574
|
return null;
|
|
17574
17575
|
}
|
|
17575
17576
|
return params => {
|
|
@@ -17593,7 +17594,7 @@ const isNotAnyOfOperator = {
|
|
|
17593
17594
|
label: 'is not any of',
|
|
17594
17595
|
value: 'isNotAnyOf',
|
|
17595
17596
|
getApplyFilterFn: filterItem => {
|
|
17596
|
-
if (!filterItem.
|
|
17597
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17597
17598
|
return null;
|
|
17598
17599
|
}
|
|
17599
17600
|
return params => {
|
|
@@ -17617,7 +17618,7 @@ const startsWithAnyOfOperator = {
|
|
|
17617
17618
|
label: 'starts with any of',
|
|
17618
17619
|
value: 'startsWithAnyOf',
|
|
17619
17620
|
getApplyFilterFn: filterItem => {
|
|
17620
|
-
if (!filterItem.
|
|
17621
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17621
17622
|
return null;
|
|
17622
17623
|
}
|
|
17623
17624
|
return params => {
|
|
@@ -17646,7 +17647,7 @@ const getGridStringOperators = () => [...getGridStringOperators$1(), ...getGridS
|
|
|
17646
17647
|
|
|
17647
17648
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17648
17649
|
async function getCompletion(text, role, openai_api_key) {
|
|
17649
|
-
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-
|
|
17650
|
+
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-1106';
|
|
17650
17651
|
try {
|
|
17651
17652
|
const messages = [{
|
|
17652
17653
|
role: 'system',
|
|
@@ -21693,10 +21694,10 @@ const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
|
|
|
21693
21694
|
const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
|
|
21694
21695
|
const DEFAULT_PROPS$1 = {
|
|
21695
21696
|
dateFormat: 'yyyy-mm-dd',
|
|
21696
|
-
defaultModel: 'gpt-4-
|
|
21697
|
+
defaultModel: 'gpt-4-1106-preview',
|
|
21697
21698
|
defaultFilter: {
|
|
21698
21699
|
items: [],
|
|
21699
|
-
|
|
21700
|
+
logicOperator: 'and'
|
|
21700
21701
|
},
|
|
21701
21702
|
disablePower: false,
|
|
21702
21703
|
localeText: {
|
|
@@ -21737,16 +21738,16 @@ const getRole = (config, dateFormat) => {
|
|
|
21737
21738
|
}).join('\n');
|
|
21738
21739
|
return `The AI assistant parses user input to generate a JSON object that will be used as a row filter for a data table MUI Data Grid.
|
|
21739
21740
|
The filter supports mulitple conditions using only two logical operator "and", "or". It only allows "and" between all conditions or "or" between all conditions. It can't mix the two types.
|
|
21740
|
-
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "
|
|
21741
|
-
- "
|
|
21742
|
-
- "items": a list of conditions, each is an object with exactly the three keys "
|
|
21743
|
-
- "
|
|
21741
|
+
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
|
|
21742
|
+
- "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
|
|
21743
|
+
- "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
|
|
21744
|
+
- "field": the column name, must be one of ${columns}
|
|
21744
21745
|
- "value":
|
|
21745
|
-
- this can be skipped if the "
|
|
21746
|
-
- a list of multiple values if the "
|
|
21746
|
+
- this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
|
|
21747
|
+
- a list of multiple values if the "operator" ends with "AnyOf"
|
|
21747
21748
|
- otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
|
|
21748
21749
|
For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
|
|
21749
|
-
- "
|
|
21750
|
+
- "operator": the comparison operator, accepted values depend on the data type of the column
|
|
21750
21751
|
${operators}
|
|
21751
21752
|
|
|
21752
21753
|
Below is the datatype in square bracket, constraints on the data range if any, followed by the description of each column used in the data table:
|
|
@@ -21858,8 +21859,8 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
21858
21859
|
isLoading: isLoading
|
|
21859
21860
|
}, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
|
|
21860
21861
|
width: "175px",
|
|
21861
|
-
isSelected: modelRef.current === 'gpt-4-
|
|
21862
|
-
onChange: value => modelRef.current = value ? 'gpt-4-
|
|
21862
|
+
isSelected: modelRef.current === 'gpt-4-1106-preview',
|
|
21863
|
+
onChange: value => modelRef.current = value ? 'gpt-4-1106-preview' : 'gpt-3.5-turbo-1106'
|
|
21863
21864
|
}, powerText)), /*#__PURE__*/React__default.createElement(Tooltip.Content, null, powerTooltipContent))), showErrorRef.current && /*#__PURE__*/React__default.createElement(Text, {
|
|
21864
21865
|
color: "error",
|
|
21865
21866
|
marginLeft: "8px"
|
|
@@ -21915,7 +21916,7 @@ const Toolbar$3 = props => {
|
|
|
21915
21916
|
let {
|
|
21916
21917
|
apiRef
|
|
21917
21918
|
} = _ref;
|
|
21918
|
-
return
|
|
21919
|
+
return gridExpandedSortedRowIdsSelector(apiRef);
|
|
21919
21920
|
}
|
|
21920
21921
|
},
|
|
21921
21922
|
printOptions: {
|
|
@@ -24367,8 +24368,8 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24367
24368
|
} : void 0;
|
|
24368
24369
|
var TablePagination$1 = TablePagination;
|
|
24369
24370
|
|
|
24370
|
-
const _excluded$1 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "ControlledPagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "
|
|
24371
|
-
_excluded2 = ["apiRef", "autoHeight", "className", "
|
|
24371
|
+
const _excluded$1 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "ControlledPagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps"],
|
|
24372
|
+
_excluded2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "pageSizeOptions", "sx"];
|
|
24372
24373
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
24373
24374
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
24374
24375
|
const DEFAULT_PROPS = {
|
|
@@ -24397,11 +24398,9 @@ const ControlledPagination = _ref3 => {
|
|
|
24397
24398
|
displayPagination = false,
|
|
24398
24399
|
selectionStatus,
|
|
24399
24400
|
apiRef,
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
onPageSizeChange,
|
|
24404
|
-
rowsPerPageOptions,
|
|
24401
|
+
paginationModel,
|
|
24402
|
+
onPaginationModelChange,
|
|
24403
|
+
pageSizeOptions,
|
|
24405
24404
|
isRowSelectable,
|
|
24406
24405
|
paginationProps
|
|
24407
24406
|
} = _ref3;
|
|
@@ -24431,13 +24430,17 @@ const ControlledPagination = _ref3 => {
|
|
|
24431
24430
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
24432
24431
|
component: "div",
|
|
24433
24432
|
count: numberOfFilteredRowsInTable,
|
|
24434
|
-
page: page,
|
|
24435
|
-
onPageChange: (event,
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24433
|
+
page: paginationModel.page,
|
|
24434
|
+
onPageChange: (event, page) => onPaginationModelChange({
|
|
24435
|
+
page,
|
|
24436
|
+
pageSize: paginationModel.pageSize
|
|
24437
|
+
}),
|
|
24438
|
+
rowsPerPage: paginationModel.pageSize,
|
|
24439
|
+
onRowsPerPageChange: event => onPaginationModelChange({
|
|
24440
|
+
page: paginationModel.page,
|
|
24441
|
+
pageSize: parseInt(event.target.value, 10)
|
|
24442
|
+
}),
|
|
24443
|
+
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24441
24444
|
}, paginationProps)) : null);
|
|
24442
24445
|
};
|
|
24443
24446
|
const Toolbar = _ref4 => {
|
|
@@ -24452,11 +24455,9 @@ const Toolbar = _ref4 => {
|
|
|
24452
24455
|
selectionStatus,
|
|
24453
24456
|
apiRef,
|
|
24454
24457
|
isRowSelectable,
|
|
24455
|
-
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
onPageSizeChange,
|
|
24459
|
-
rowsPerPageOptions,
|
|
24458
|
+
paginationModel,
|
|
24459
|
+
onPaginationModelChange,
|
|
24460
|
+
pageSizeOptions,
|
|
24460
24461
|
paginationProps
|
|
24461
24462
|
} = _ref4,
|
|
24462
24463
|
forwardedProps = _objectWithoutProperties(_ref4, _excluded$1);
|
|
@@ -24470,23 +24471,21 @@ const Toolbar = _ref4 => {
|
|
|
24470
24471
|
selectionStatus: selectionStatus.current,
|
|
24471
24472
|
apiRef: apiRef,
|
|
24472
24473
|
isRowSelectable: isRowSelectable,
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
24476
|
-
onPageSizeChange: onPageSizeChange,
|
|
24477
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
24474
|
+
paginationModel: paginationModel,
|
|
24475
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
24476
|
+
pageSizeOptions: pageSizeOptions,
|
|
24478
24477
|
paginationProps: paginationProps
|
|
24479
24478
|
}) : null);
|
|
24480
24479
|
};
|
|
24481
24480
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24482
|
-
var _initialState$paginat, _initialState$paginat2;
|
|
24481
|
+
var _ref5, _ref6, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref7, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
|
|
24483
24482
|
const datagridRef = ref || useRef();
|
|
24484
24483
|
const {
|
|
24485
24484
|
apiRef: propsApiRef,
|
|
24486
24485
|
autoHeight,
|
|
24487
24486
|
className,
|
|
24488
|
-
|
|
24489
|
-
|
|
24487
|
+
slots,
|
|
24488
|
+
slotProps,
|
|
24490
24489
|
filterModel: propsFilterModel,
|
|
24491
24490
|
height: propsHeight,
|
|
24492
24491
|
hideToolbar,
|
|
@@ -24494,22 +24493,20 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24494
24493
|
isRowSelectable,
|
|
24495
24494
|
license,
|
|
24496
24495
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
page: propsPage,
|
|
24501
|
-
pageSize: propsPageSize,
|
|
24496
|
+
paginationModel: propsPaginationModel,
|
|
24497
|
+
onPaginationModelChange: propsOnPaginationModelChange,
|
|
24498
|
+
onRowSelectionModelChange,
|
|
24502
24499
|
pagination,
|
|
24503
24500
|
paginationPlacement,
|
|
24504
24501
|
paginationProps,
|
|
24505
24502
|
rows,
|
|
24506
|
-
|
|
24503
|
+
pageSizeOptions,
|
|
24507
24504
|
sx
|
|
24508
24505
|
} = props,
|
|
24509
24506
|
forwardedProps = _objectWithoutProperties(props, _excluded2);
|
|
24510
24507
|
const _apiRef = useGridApiRef();
|
|
24511
24508
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24512
|
-
const RenderedToolbar =
|
|
24509
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$3;
|
|
24513
24510
|
LicenseInfo.setLicenseKey(license);
|
|
24514
24511
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24515
24512
|
const selectionStatus = useRef({
|
|
@@ -24527,33 +24524,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24527
24524
|
setFilterModel(model);
|
|
24528
24525
|
}
|
|
24529
24526
|
};
|
|
24530
|
-
const [
|
|
24531
|
-
|
|
24532
|
-
|
|
24533
|
-
|
|
24534
|
-
|
|
24535
|
-
|
|
24536
|
-
|
|
24537
|
-
}
|
|
24538
|
-
};
|
|
24539
|
-
useEffect(() => {
|
|
24540
|
-
if (propsPage || propsPage === 0) {
|
|
24541
|
-
setPage(propsPage);
|
|
24542
|
-
}
|
|
24543
|
-
}, [propsPage]);
|
|
24544
|
-
const onPageSizeChange = pageSize => {
|
|
24545
|
-
onPageChange(0);
|
|
24546
|
-
if (propsOnPageSizeChange) {
|
|
24547
|
-
propsOnPageSizeChange(pageSize, undefined);
|
|
24527
|
+
const [paginationModel, setPaginationModel] = useState({
|
|
24528
|
+
pageSize: (_ref5 = (_ref6 = (_initialState$paginat = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : (_initialState$paginat3 = _initialState$paginat2.paginationModel) === null || _initialState$paginat3 === void 0 ? void 0 : _initialState$paginat3.pageSize) !== null && _initialState$paginat !== void 0 ? _initialState$paginat : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _ref6 !== void 0 ? _ref6 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref5 !== void 0 ? _ref5 : 100,
|
|
24529
|
+
page: (_ref7 = (_initialState$paginat4 = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat5 = initialState.pagination) === null || _initialState$paginat5 === void 0 ? void 0 : (_initialState$paginat6 = _initialState$paginat5.paginationModel) === null || _initialState$paginat6 === void 0 ? void 0 : _initialState$paginat6.page) !== null && _initialState$paginat4 !== void 0 ? _initialState$paginat4 : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _ref7 !== void 0 ? _ref7 : 0
|
|
24530
|
+
});
|
|
24531
|
+
const onPaginationModelChange = model => {
|
|
24532
|
+
if (propsOnPaginationModelChange) {
|
|
24533
|
+
propsOnPaginationModelChange(model, undefined);
|
|
24548
24534
|
} else {
|
|
24549
|
-
|
|
24535
|
+
setPaginationModel(model);
|
|
24550
24536
|
}
|
|
24551
24537
|
};
|
|
24552
24538
|
useEffect(() => {
|
|
24553
|
-
if (
|
|
24554
|
-
|
|
24539
|
+
if (propsPaginationModel) {
|
|
24540
|
+
setPaginationModel(propsPaginationModel);
|
|
24555
24541
|
}
|
|
24556
|
-
}, [
|
|
24542
|
+
}, [propsPaginationModel]);
|
|
24557
24543
|
if (!Array.isArray(rows)) {
|
|
24558
24544
|
return null;
|
|
24559
24545
|
}
|
|
@@ -24565,62 +24551,60 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24565
24551
|
apiRef: apiRef,
|
|
24566
24552
|
autoHeight: autoHeight,
|
|
24567
24553
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
24568
|
-
|
|
24569
|
-
BaseButton,
|
|
24570
|
-
BaseCheckbox,
|
|
24571
|
-
//
|
|
24572
|
-
BasePopper,
|
|
24573
|
-
|
|
24554
|
+
slots: _objectSpread2(_objectSpread2({
|
|
24555
|
+
baseButton: BaseButton,
|
|
24556
|
+
baseCheckbox: BaseCheckbox,
|
|
24557
|
+
// baseTextField,
|
|
24558
|
+
basePopper: BasePopper,
|
|
24559
|
+
columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24574
24560
|
displayName: "ColumnFilteredIcon"
|
|
24575
24561
|
})),
|
|
24576
|
-
|
|
24562
|
+
columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24577
24563
|
displayName: "ColumnSelectorIcon"
|
|
24578
24564
|
})),
|
|
24579
|
-
|
|
24565
|
+
columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24580
24566
|
displayName: "ColumnSortedAscendingIcon"
|
|
24581
24567
|
})),
|
|
24582
|
-
|
|
24568
|
+
columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24583
24569
|
displayName: "ColumnSortedDescendingIcon"
|
|
24584
24570
|
})),
|
|
24585
|
-
|
|
24571
|
+
densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24586
24572
|
displayName: "DensityCompactIcon"
|
|
24587
24573
|
})),
|
|
24588
|
-
|
|
24574
|
+
densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24589
24575
|
displayName: "DensityStandardIcon"
|
|
24590
24576
|
})),
|
|
24591
|
-
|
|
24577
|
+
densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24592
24578
|
displayName: "DensityComfortableIcon"
|
|
24593
24579
|
})),
|
|
24594
|
-
|
|
24580
|
+
detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24595
24581
|
displayName: "DetailPanelCollapseIcon"
|
|
24596
24582
|
})),
|
|
24597
|
-
|
|
24583
|
+
detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24598
24584
|
displayName: "DetailPanelExpandIcon"
|
|
24599
24585
|
})),
|
|
24600
|
-
|
|
24586
|
+
exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24601
24587
|
displayName: "ExportIcon"
|
|
24602
24588
|
})),
|
|
24603
|
-
|
|
24589
|
+
openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
24604
24590
|
displayName: "OpenFilterButtonIcon"
|
|
24605
24591
|
}, props))
|
|
24606
|
-
},
|
|
24607
|
-
|
|
24608
|
-
|
|
24592
|
+
}, slots), {}, {
|
|
24593
|
+
toolbar: Toolbar,
|
|
24594
|
+
pagination: props => pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, _extends$2({}, props, {
|
|
24609
24595
|
displaySelection: false,
|
|
24610
24596
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
24611
24597
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
24612
24598
|
selectionStatus: selectionStatus.current,
|
|
24613
24599
|
apiRef: apiRef,
|
|
24614
24600
|
isRowSelectable: isRowSelectable,
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
onPageSizeChange: onPageSizeChange,
|
|
24619
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
24601
|
+
paginationModel: paginationModel,
|
|
24602
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
24603
|
+
pageSizeOptions: pageSizeOptions,
|
|
24620
24604
|
paginationProps: paginationProps
|
|
24621
24605
|
})) : null
|
|
24622
24606
|
}),
|
|
24623
|
-
|
|
24607
|
+
slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
|
|
24624
24608
|
toolbar: _objectSpread2({
|
|
24625
24609
|
hideToolbar,
|
|
24626
24610
|
RenderedToolbar,
|
|
@@ -24632,13 +24616,11 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24632
24616
|
selectionStatus,
|
|
24633
24617
|
apiRef,
|
|
24634
24618
|
isRowSelectable,
|
|
24635
|
-
|
|
24636
|
-
|
|
24637
|
-
|
|
24638
|
-
onPageSizeChange,
|
|
24639
|
-
rowsPerPageOptions,
|
|
24619
|
+
paginationModel,
|
|
24620
|
+
onPaginationModelChange,
|
|
24621
|
+
pageSizeOptions,
|
|
24640
24622
|
paginationProps
|
|
24641
|
-
},
|
|
24623
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
|
|
24642
24624
|
}),
|
|
24643
24625
|
filterModel: filterModel,
|
|
24644
24626
|
initialState: initialState,
|
|
@@ -24646,40 +24628,38 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24646
24628
|
onFilterModelChange: onFilterModelChange,
|
|
24647
24629
|
pagination: pagination,
|
|
24648
24630
|
rows: rows,
|
|
24649
|
-
|
|
24650
|
-
|
|
24651
|
-
|
|
24652
|
-
|
|
24653
|
-
onPageSizeChange: onPageSizeChange,
|
|
24654
|
-
onSelectionModelChange: (newSelectionModel, details) => {
|
|
24631
|
+
pageSizeOptions: pageSizeOptions,
|
|
24632
|
+
paginationModel: paginationModel,
|
|
24633
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
24634
|
+
onRowSelectionModelChange: (newSelectionModel, details) => {
|
|
24655
24635
|
if (pagination) {
|
|
24656
|
-
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
24636
|
+
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref8 => {
|
|
24657
24637
|
var _props$isRowSelectabl;
|
|
24658
24638
|
let {
|
|
24659
24639
|
model
|
|
24660
|
-
} =
|
|
24640
|
+
} = _ref8;
|
|
24661
24641
|
return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
|
|
24662
24642
|
row: model
|
|
24663
24643
|
});
|
|
24664
|
-
}).map(
|
|
24644
|
+
}).map(_ref9 => {
|
|
24665
24645
|
let {
|
|
24666
24646
|
id
|
|
24667
|
-
} =
|
|
24647
|
+
} = _ref9;
|
|
24668
24648
|
return id;
|
|
24669
24649
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24670
24650
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
24671
|
-
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
24651
|
+
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref10 => {
|
|
24672
24652
|
var _props$isRowSelectabl2;
|
|
24673
24653
|
let {
|
|
24674
24654
|
model
|
|
24675
|
-
} =
|
|
24655
|
+
} = _ref10;
|
|
24676
24656
|
return (_props$isRowSelectabl2 = props.isRowSelectable) === null || _props$isRowSelectabl2 === void 0 ? void 0 : _props$isRowSelectabl2.call(props, {
|
|
24677
24657
|
row: model
|
|
24678
24658
|
});
|
|
24679
|
-
}).map(
|
|
24659
|
+
}).map(_ref11 => {
|
|
24680
24660
|
let {
|
|
24681
24661
|
id
|
|
24682
|
-
} =
|
|
24662
|
+
} = _ref11;
|
|
24683
24663
|
return id;
|
|
24684
24664
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24685
24665
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -24711,7 +24691,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24711
24691
|
};
|
|
24712
24692
|
}
|
|
24713
24693
|
}
|
|
24714
|
-
|
|
24694
|
+
onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
|
|
24715
24695
|
},
|
|
24716
24696
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
24717
24697
|
'.MuiDataGrid-columnHeaders': {
|