@redsift/table 11.2.1 → 11.2.2-muiv5-patch.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 +31 -25
- package/index.js +337 -259
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators,
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLinkOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, useGridApiRef, DataGridPro } from '@mui/x-data-grid-pro';
|
|
2
2
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { Children, isValidElement, cloneElement, forwardRef, useLayoutEffect, useEffect, useRef, useContext, useState, useCallback, createElement, useMemo } from 'react';
|
|
@@ -17639,7 +17639,7 @@ const isBetweenOperator = {
|
|
|
17639
17639
|
label: 'is between',
|
|
17640
17640
|
value: 'isBetween',
|
|
17641
17641
|
getApplyFilterFn: filterItem => {
|
|
17642
|
-
if (!filterItem.
|
|
17642
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17643
17643
|
return null;
|
|
17644
17644
|
}
|
|
17645
17645
|
if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
|
|
@@ -17652,7 +17652,7 @@ const isBetweenOperator = {
|
|
|
17652
17652
|
return null;
|
|
17653
17653
|
}
|
|
17654
17654
|
return params => {
|
|
17655
|
-
return params.value !== null &&
|
|
17655
|
+
return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17656
17656
|
};
|
|
17657
17657
|
},
|
|
17658
17658
|
InputComponent: InputNumberInterval
|
|
@@ -17665,7 +17665,7 @@ const doesNotEqual = {
|
|
|
17665
17665
|
label: 'does not equal',
|
|
17666
17666
|
value: 'doesNotEqual',
|
|
17667
17667
|
getApplyFilterFn: filterItem => {
|
|
17668
|
-
if (!filterItem.
|
|
17668
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17669
17669
|
return null;
|
|
17670
17670
|
}
|
|
17671
17671
|
return params => {
|
|
@@ -17686,7 +17686,7 @@ const doesNotContain = {
|
|
|
17686
17686
|
label: 'does not contain',
|
|
17687
17687
|
value: 'doesNotContain',
|
|
17688
17688
|
getApplyFilterFn: filterItem => {
|
|
17689
|
-
if (!filterItem.
|
|
17689
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17690
17690
|
return null;
|
|
17691
17691
|
}
|
|
17692
17692
|
return params => {
|
|
@@ -17707,7 +17707,7 @@ const containsAnyOfOperator = {
|
|
|
17707
17707
|
label: 'contains any of',
|
|
17708
17708
|
value: 'containsAnyOf',
|
|
17709
17709
|
getApplyFilterFn: filterItem => {
|
|
17710
|
-
if (!filterItem.
|
|
17710
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17711
17711
|
return null;
|
|
17712
17712
|
}
|
|
17713
17713
|
return params => {
|
|
@@ -17730,7 +17730,7 @@ const containsAnyOfCIOperator = {
|
|
|
17730
17730
|
label: 'contains any of (case insensitive)',
|
|
17731
17731
|
value: 'containsAnyOf',
|
|
17732
17732
|
getApplyFilterFn: filterItem => {
|
|
17733
|
-
if (!filterItem.
|
|
17733
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17734
17734
|
return null;
|
|
17735
17735
|
}
|
|
17736
17736
|
return params => {
|
|
@@ -17757,7 +17757,7 @@ const endsWithAnyOfOperator = {
|
|
|
17757
17757
|
label: 'ends with any of',
|
|
17758
17758
|
value: 'endsWithAnyOf',
|
|
17759
17759
|
getApplyFilterFn: filterItem => {
|
|
17760
|
-
if (!filterItem.
|
|
17760
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17761
17761
|
return null;
|
|
17762
17762
|
}
|
|
17763
17763
|
return params => {
|
|
@@ -17784,7 +17784,7 @@ const isAnyOfOperator = {
|
|
|
17784
17784
|
label: 'is any of',
|
|
17785
17785
|
value: 'isAnyOf',
|
|
17786
17786
|
getApplyFilterFn: filterItem => {
|
|
17787
|
-
if (!filterItem.
|
|
17787
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17788
17788
|
return null;
|
|
17789
17789
|
}
|
|
17790
17790
|
return params => {
|
|
@@ -17808,7 +17808,7 @@ const isNotAnyOfOperator = {
|
|
|
17808
17808
|
label: 'is not any of',
|
|
17809
17809
|
value: 'isNotAnyOf',
|
|
17810
17810
|
getApplyFilterFn: filterItem => {
|
|
17811
|
-
if (!filterItem.
|
|
17811
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17812
17812
|
return null;
|
|
17813
17813
|
}
|
|
17814
17814
|
return params => {
|
|
@@ -17832,7 +17832,7 @@ const startsWithAnyOfOperator = {
|
|
|
17832
17832
|
label: 'starts with any of',
|
|
17833
17833
|
value: 'startsWithAnyOf',
|
|
17834
17834
|
getApplyFilterFn: filterItem => {
|
|
17835
|
-
if (!filterItem.
|
|
17835
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17836
17836
|
return null;
|
|
17837
17837
|
}
|
|
17838
17838
|
return params => {
|
|
@@ -17877,13 +17877,13 @@ const operatorList = {
|
|
|
17877
17877
|
|
|
17878
17878
|
const getRsStringColumnType = () => {
|
|
17879
17879
|
return {
|
|
17880
|
-
|
|
17880
|
+
extendType: 'string',
|
|
17881
17881
|
filterOperators: operatorList.rsString
|
|
17882
17882
|
};
|
|
17883
17883
|
};
|
|
17884
17884
|
const getRsNumberColumnType = () => {
|
|
17885
17885
|
return {
|
|
17886
|
-
|
|
17886
|
+
extendType: 'number',
|
|
17887
17887
|
filterOperators: operatorList.rsNumber
|
|
17888
17888
|
};
|
|
17889
17889
|
};
|
|
@@ -17894,7 +17894,7 @@ const customColumnTypes = {
|
|
|
17894
17894
|
|
|
17895
17895
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17896
17896
|
async function getCompletion(text, role, openai_api_key) {
|
|
17897
|
-
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-
|
|
17897
|
+
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-0613';
|
|
17898
17898
|
try {
|
|
17899
17899
|
const messages = [{
|
|
17900
17900
|
role: 'system',
|
|
@@ -18063,39 +18063,42 @@ const numberOperatorDecoder = {
|
|
|
18063
18063
|
lt: '<',
|
|
18064
18064
|
lte: '<='
|
|
18065
18065
|
};
|
|
18066
|
-
const isOperatorValueValid = (
|
|
18067
|
-
const column = columns.find(column => column.field ===
|
|
18066
|
+
const isOperatorValueValid = (columnField, operatorValue, columns) => {
|
|
18067
|
+
const column = columns.find(column => column.field === columnField);
|
|
18068
18068
|
if (!column) {
|
|
18069
18069
|
return false;
|
|
18070
18070
|
}
|
|
18071
18071
|
const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
|
|
18072
|
-
const operators =
|
|
18072
|
+
const operators = operatorList[columnType];
|
|
18073
18073
|
if (!operators) {
|
|
18074
18074
|
return false;
|
|
18075
18075
|
}
|
|
18076
|
-
|
|
18076
|
+
if ('filterOperators' in operators) {
|
|
18077
|
+
return !!operators.filterOperators.find(op => columnType === 'number' && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operatorValue : op['value'] === operatorValue);
|
|
18078
|
+
}
|
|
18079
|
+
return !!operators.find(op => ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operatorValue : op['value'] === operatorValue);
|
|
18077
18080
|
};
|
|
18078
18081
|
const listOperators = ['containsAnyOf', 'endsWithAnyOf', 'isAnyOf', 'isNotAnyOf', 'startsWithAnyOf'];
|
|
18079
18082
|
|
|
18080
18083
|
// Check if the value doesn't break
|
|
18081
|
-
const isValueValid = (value,
|
|
18084
|
+
const isValueValid = (value, columnField, columns, operatorValue) => {
|
|
18082
18085
|
var _column$type;
|
|
18083
18086
|
// every field accepts undefined as value for default
|
|
18084
18087
|
if (value === undefined || value === '') {
|
|
18085
18088
|
return true;
|
|
18086
18089
|
}
|
|
18087
18090
|
|
|
18088
|
-
// xxxAnyOf accepts as value only lists, and we are
|
|
18091
|
+
// xxxAnyOf accepts as value only lists, and we are declearing them in the
|
|
18089
18092
|
// URL as `list=[...]`
|
|
18090
|
-
if (listOperators.includes(
|
|
18093
|
+
if (listOperators.includes(operatorValue)) {
|
|
18091
18094
|
return Array.isArray(value) || value === '';
|
|
18092
18095
|
}
|
|
18093
18096
|
|
|
18094
18097
|
// We are accepting arrays only if they are of the 'xxxAnyOf' type
|
|
18095
|
-
if (Array.isArray(value) && !listOperators.includes(
|
|
18098
|
+
if (Array.isArray(value) && !listOperators.includes(operatorValue)) {
|
|
18096
18099
|
return false;
|
|
18097
18100
|
}
|
|
18098
|
-
const column = columns.find(column => column.field ===
|
|
18101
|
+
const column = columns.find(column => column.field === columnField);
|
|
18099
18102
|
if (!column) {
|
|
18100
18103
|
return false;
|
|
18101
18104
|
}
|
|
@@ -18133,14 +18136,14 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18133
18136
|
if (!searchString) {
|
|
18134
18137
|
return 'invalid';
|
|
18135
18138
|
}
|
|
18136
|
-
let
|
|
18139
|
+
let linkOperator = GridLinkOperator.And;
|
|
18137
18140
|
const searchParams = new URLSearchParams();
|
|
18138
18141
|
for (const [key, value] of new URLSearchParams(searchString)) {
|
|
18139
18142
|
if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility', '_pagination'].includes(key)) {
|
|
18140
18143
|
searchParams.set(key, value);
|
|
18141
18144
|
}
|
|
18142
18145
|
if (key === '_logicOperator') {
|
|
18143
|
-
|
|
18146
|
+
linkOperator = value === GridLinkOperator.And || value === GridLinkOperator.Or ? value : GridLinkOperator.And;
|
|
18144
18147
|
}
|
|
18145
18148
|
}
|
|
18146
18149
|
let id = 5000;
|
|
@@ -18181,8 +18184,8 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18181
18184
|
return;
|
|
18182
18185
|
}
|
|
18183
18186
|
items.push({
|
|
18184
|
-
field,
|
|
18185
|
-
|
|
18187
|
+
columnField: field,
|
|
18188
|
+
operatorValue: ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
|
|
18186
18189
|
id,
|
|
18187
18190
|
value: listOperators.includes(operator) && decodedValue === '' ? [] : decodedValue,
|
|
18188
18191
|
type
|
|
@@ -18197,23 +18200,23 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18197
18200
|
}
|
|
18198
18201
|
return {
|
|
18199
18202
|
items,
|
|
18200
|
-
|
|
18203
|
+
linkOperator
|
|
18201
18204
|
};
|
|
18202
18205
|
};
|
|
18203
18206
|
const getSearchParamsFromFilterModel = filterModel => {
|
|
18204
18207
|
const searchParams = new URLSearchParams();
|
|
18205
|
-
searchParams.set('_logicOperator', filterModel['
|
|
18208
|
+
searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
|
|
18206
18209
|
filterModel['items'].forEach(item => {
|
|
18207
18210
|
const {
|
|
18208
|
-
|
|
18209
|
-
|
|
18211
|
+
columnField,
|
|
18212
|
+
operatorValue,
|
|
18210
18213
|
value,
|
|
18211
18214
|
type
|
|
18212
18215
|
} = item;
|
|
18213
|
-
if (Object.keys(numberOperatorEncoder).includes(
|
|
18214
|
-
searchParams.set(`_${
|
|
18216
|
+
if (Object.keys(numberOperatorEncoder).includes(operatorValue)) {
|
|
18217
|
+
searchParams.set(`_${columnField}[${numberOperatorEncoder[operatorValue]},${encodeValue(type)}]`, encodeValue(value));
|
|
18215
18218
|
} else {
|
|
18216
|
-
searchParams.set(`_${
|
|
18219
|
+
searchParams.set(`_${columnField}[${encodeValue(operatorValue)},${encodeValue(type)}]`, encodeValue(value));
|
|
18217
18220
|
}
|
|
18218
18221
|
});
|
|
18219
18222
|
return searchParams;
|
|
@@ -18239,7 +18242,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18239
18242
|
}
|
|
18240
18243
|
return initialState && initialState.filter && initialState.filter.filterModel ? initialState.filter.filterModel : {
|
|
18241
18244
|
items: [],
|
|
18242
|
-
|
|
18245
|
+
linkOperator: GridLinkOperator.And
|
|
18243
18246
|
};
|
|
18244
18247
|
};
|
|
18245
18248
|
|
|
@@ -18355,11 +18358,11 @@ const getPaginationModel = (search, localStoragePagination, setLocalStoragePagin
|
|
|
18355
18358
|
|
|
18356
18359
|
const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
18357
18360
|
const searchParams = new URLSearchParams();
|
|
18358
|
-
const
|
|
18361
|
+
const columnFields = columns.map(column => column.field);
|
|
18359
18362
|
|
|
18360
18363
|
// if column visibility model is empty, show all columns
|
|
18361
18364
|
if (Object.keys(columnVisibility).length == 0) {
|
|
18362
|
-
searchParams.set('_columnVisibility', `[${
|
|
18365
|
+
searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
|
|
18363
18366
|
return searchParams;
|
|
18364
18367
|
}
|
|
18365
18368
|
const finalColumnVisibility = columns.filter(c => {
|
|
@@ -18409,12 +18412,12 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
|
18409
18412
|
continue;
|
|
18410
18413
|
}
|
|
18411
18414
|
exist = true;
|
|
18412
|
-
const
|
|
18415
|
+
const columnFields = tableColumns.map(column => column.field);
|
|
18413
18416
|
// TODO: Add validation that , is present
|
|
18414
18417
|
const columns = encodedValues.split(',').map(value => decodeValue(value));
|
|
18415
18418
|
|
|
18416
18419
|
// for each column, check if it's visible and add it to visibility model
|
|
18417
|
-
for (const column of
|
|
18420
|
+
for (const column of columnFields) {
|
|
18418
18421
|
const isColumnVisible = columns.includes(column);
|
|
18419
18422
|
visibility[column] = isColumnVisible;
|
|
18420
18423
|
if (isColumnVisible) {
|
|
@@ -18481,8 +18484,8 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
|
18481
18484
|
if (typeof encodedValues !== 'string') {
|
|
18482
18485
|
continue;
|
|
18483
18486
|
}
|
|
18484
|
-
const
|
|
18485
|
-
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' &&
|
|
18487
|
+
const columnFields = [...tableColumns.map(column => column.field), '__check__'];
|
|
18488
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && columnFields.includes(val));
|
|
18486
18489
|
if (fieldURL === '_pinnedColumnsLeft') {
|
|
18487
18490
|
pinnedColumns['left'] = columns;
|
|
18488
18491
|
}
|
|
@@ -18490,9 +18493,9 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
|
18490
18493
|
pinnedColumns['right'] = columns;
|
|
18491
18494
|
}
|
|
18492
18495
|
}
|
|
18493
|
-
return pinnedColumns
|
|
18494
|
-
left: pinnedColumns
|
|
18495
|
-
right: pinnedColumns
|
|
18496
|
+
return pinnedColumns.left && pinnedColumns.left.length > 0 || pinnedColumns.right && pinnedColumns.right.length > 0 ? {
|
|
18497
|
+
left: pinnedColumns.left || [],
|
|
18498
|
+
right: pinnedColumns.right || []
|
|
18496
18499
|
} : 'invalid';
|
|
18497
18500
|
};
|
|
18498
18501
|
const getSearchParamsFromPinnedColumns = pinnedColumns => {
|
|
@@ -18635,17 +18638,17 @@ const updateUrl = (_ref4, search, historyReplace, columns) => {
|
|
|
18635
18638
|
// do not use it for equivalence (e.g. with value `3` and undefined we
|
|
18636
18639
|
// will get 0).
|
|
18637
18640
|
const compareFilters = (firstFilter, secondFilter) => {
|
|
18638
|
-
if (firstFilter.
|
|
18641
|
+
if (firstFilter.columnField < secondFilter.columnField) {
|
|
18639
18642
|
return -1;
|
|
18640
|
-
} else if (firstFilter.
|
|
18643
|
+
} else if (firstFilter.columnField > secondFilter.columnField) {
|
|
18641
18644
|
return 1;
|
|
18642
18645
|
}
|
|
18643
|
-
if (firstFilter.
|
|
18646
|
+
if (firstFilter.operatorValue === undefined || secondFilter.operatorValue === undefined) {
|
|
18644
18647
|
return 0;
|
|
18645
18648
|
}
|
|
18646
|
-
if (firstFilter.
|
|
18649
|
+
if (firstFilter.operatorValue < secondFilter.operatorValue) {
|
|
18647
18650
|
return -1;
|
|
18648
|
-
} else if (firstFilter.
|
|
18651
|
+
} else if (firstFilter.operatorValue > secondFilter.operatorValue) {
|
|
18649
18652
|
return 1;
|
|
18650
18653
|
}
|
|
18651
18654
|
if (firstFilter.value < secondFilter.value) {
|
|
@@ -18656,18 +18659,18 @@ const compareFilters = (firstFilter, secondFilter) => {
|
|
|
18656
18659
|
return 0;
|
|
18657
18660
|
};
|
|
18658
18661
|
const areFiltersEquivalent = (firstFilter, secondFilter) => {
|
|
18659
|
-
return firstFilter.
|
|
18662
|
+
return firstFilter.columnField === secondFilter.columnField && firstFilter.operatorValue === secondFilter.operatorValue && firstFilter.value === secondFilter.value;
|
|
18660
18663
|
};
|
|
18661
18664
|
const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
18662
18665
|
const {
|
|
18663
18666
|
items,
|
|
18664
|
-
|
|
18667
|
+
linkOperator
|
|
18665
18668
|
} = filterModel;
|
|
18666
18669
|
const {
|
|
18667
18670
|
items: itemsToMatch,
|
|
18668
|
-
|
|
18671
|
+
linkOperator: linkOperatorToMatch
|
|
18669
18672
|
} = filterModelToMatch;
|
|
18670
|
-
if (
|
|
18673
|
+
if (linkOperator !== linkOperatorToMatch) {
|
|
18671
18674
|
return false;
|
|
18672
18675
|
}
|
|
18673
18676
|
if (items.length !== itemsToMatch.length) {
|
|
@@ -18680,7 +18683,7 @@ const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
|
18680
18683
|
const filterToCompare = itemsToMatch[i];
|
|
18681
18684
|
|
|
18682
18685
|
// compareFilters return 0 if and only if the filters have the same
|
|
18683
|
-
//
|
|
18686
|
+
// columnField, operatorValue, and value
|
|
18684
18687
|
if (!areFiltersEquivalent(filter, filterToCompare)) {
|
|
18685
18688
|
return false;
|
|
18686
18689
|
}
|
|
@@ -24491,16 +24494,16 @@ const getRole = (config, dateFormat) => {
|
|
|
24491
24494
|
}).join('\n');
|
|
24492
24495
|
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.
|
|
24493
24496
|
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.
|
|
24494
|
-
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "
|
|
24495
|
-
- "
|
|
24496
|
-
- "items": a list of conditions, each is an object with exactly the three keys "
|
|
24497
|
-
- "
|
|
24497
|
+
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
|
|
24498
|
+
- "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
|
|
24499
|
+
- "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
|
|
24500
|
+
- "columnField": the column name, must be one of ${columns}
|
|
24498
24501
|
- "value":
|
|
24499
|
-
- this can be skipped if the "
|
|
24500
|
-
- a list of multiple values if the "
|
|
24502
|
+
- this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
|
|
24503
|
+
- a list of multiple values if the "operatorValue" ends with "AnyOf"
|
|
24501
24504
|
- otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
|
|
24502
24505
|
For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
|
|
24503
|
-
- "
|
|
24506
|
+
- "operatorValue": the comparison operator, accepted values depend on the data type of the column
|
|
24504
24507
|
${operators}
|
|
24505
24508
|
|
|
24506
24509
|
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:
|
|
@@ -24537,10 +24540,10 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24537
24540
|
nlpFilterConfig,
|
|
24538
24541
|
onFilterModelChange,
|
|
24539
24542
|
dateFormat = 'yyyy-mm-dd',
|
|
24540
|
-
defaultModel = 'gpt-4-
|
|
24543
|
+
defaultModel = 'gpt-4-0613',
|
|
24541
24544
|
defaultFilter = {
|
|
24542
24545
|
items: [],
|
|
24543
|
-
|
|
24546
|
+
linkOperator: 'and'
|
|
24544
24547
|
},
|
|
24545
24548
|
disablePower = false,
|
|
24546
24549
|
localeText
|
|
@@ -24618,7 +24621,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24618
24621
|
value: prompt
|
|
24619
24622
|
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
24620
24623
|
variant: "primary",
|
|
24621
|
-
"
|
|
24624
|
+
"aira-label": buttonAriaLabel,
|
|
24622
24625
|
type: "submit",
|
|
24623
24626
|
isLoading: isLoading
|
|
24624
24627
|
}, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
|
|
@@ -24679,7 +24682,7 @@ const Toolbar$2 = props => {
|
|
|
24679
24682
|
let {
|
|
24680
24683
|
apiRef
|
|
24681
24684
|
} = _ref;
|
|
24682
|
-
return
|
|
24685
|
+
return gridVisibleSortedRowIdsSelector(apiRef);
|
|
24683
24686
|
}
|
|
24684
24687
|
},
|
|
24685
24688
|
printOptions: {
|
|
@@ -26911,10 +26914,12 @@ const ServerSideControlledPagination = _ref3 => {
|
|
|
26911
26914
|
selectionStatus,
|
|
26912
26915
|
displaySelection,
|
|
26913
26916
|
displayPagination,
|
|
26914
|
-
|
|
26915
|
-
|
|
26916
|
-
|
|
26917
|
+
page,
|
|
26918
|
+
onPageChange,
|
|
26919
|
+
pageSize,
|
|
26920
|
+
onPageSizeChange,
|
|
26917
26921
|
displayRowsPerPage,
|
|
26922
|
+
rowsPerPageOptions,
|
|
26918
26923
|
paginationProps,
|
|
26919
26924
|
rowCount
|
|
26920
26925
|
} = _ref3;
|
|
@@ -26933,17 +26938,13 @@ const ServerSideControlledPagination = _ref3 => {
|
|
|
26933
26938
|
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$1({
|
|
26934
26939
|
component: "div",
|
|
26935
26940
|
count: totalNumberOfRowsInTable,
|
|
26936
|
-
page:
|
|
26937
|
-
onPageChange: (event,
|
|
26938
|
-
|
|
26939
|
-
|
|
26940
|
-
|
|
26941
|
-
|
|
26942
|
-
|
|
26943
|
-
page: paginationModel.page,
|
|
26944
|
-
pageSize: parseInt(event.target.value, 10)
|
|
26945
|
-
}),
|
|
26946
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
26941
|
+
page: page,
|
|
26942
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
26943
|
+
rowsPerPage: pageSize,
|
|
26944
|
+
onRowsPerPageChange: event => {
|
|
26945
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
26946
|
+
},
|
|
26947
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
26947
26948
|
}, paginationProps)) : null);
|
|
26948
26949
|
};
|
|
26949
26950
|
|
|
@@ -26969,9 +26970,11 @@ const ControlledPagination = _ref3 => {
|
|
|
26969
26970
|
displayPagination = false,
|
|
26970
26971
|
selectionStatus,
|
|
26971
26972
|
apiRef,
|
|
26972
|
-
|
|
26973
|
-
|
|
26974
|
-
|
|
26973
|
+
page,
|
|
26974
|
+
onPageChange,
|
|
26975
|
+
pageSize,
|
|
26976
|
+
onPageSizeChange,
|
|
26977
|
+
rowsPerPageOptions,
|
|
26975
26978
|
isRowSelectable,
|
|
26976
26979
|
paginationProps
|
|
26977
26980
|
} = _ref3;
|
|
@@ -27001,25 +27004,17 @@ const ControlledPagination = _ref3 => {
|
|
|
27001
27004
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$1({
|
|
27002
27005
|
component: "div",
|
|
27003
27006
|
count: numberOfFilteredRowsInTable,
|
|
27004
|
-
page:
|
|
27005
|
-
onPageChange: (event,
|
|
27006
|
-
|
|
27007
|
-
page,
|
|
27008
|
-
pageSize: paginationModel.pageSize
|
|
27009
|
-
});
|
|
27010
|
-
},
|
|
27011
|
-
rowsPerPage: paginationModel.pageSize,
|
|
27007
|
+
page: page,
|
|
27008
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
27009
|
+
rowsPerPage: pageSize,
|
|
27012
27010
|
onRowsPerPageChange: event => {
|
|
27013
|
-
|
|
27014
|
-
page: paginationModel.page,
|
|
27015
|
-
pageSize: parseInt(event.target.value, 10)
|
|
27016
|
-
});
|
|
27011
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
27017
27012
|
},
|
|
27018
|
-
rowsPerPageOptions: displayRowsPerPage ?
|
|
27013
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
27019
27014
|
}, paginationProps)) : null);
|
|
27020
27015
|
};
|
|
27021
27016
|
|
|
27022
|
-
const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "
|
|
27017
|
+
const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
27023
27018
|
const ToolbarWrapper = _ref => {
|
|
27024
27019
|
let {
|
|
27025
27020
|
hideToolbar,
|
|
@@ -27031,9 +27026,11 @@ const ToolbarWrapper = _ref => {
|
|
|
27031
27026
|
selectionStatus,
|
|
27032
27027
|
apiRef,
|
|
27033
27028
|
isRowSelectable,
|
|
27034
|
-
|
|
27035
|
-
|
|
27036
|
-
|
|
27029
|
+
page,
|
|
27030
|
+
onPageChange,
|
|
27031
|
+
pageSize,
|
|
27032
|
+
onPageSizeChange,
|
|
27033
|
+
rowsPerPageOptions,
|
|
27037
27034
|
paginationProps,
|
|
27038
27035
|
paginationMode = 'client',
|
|
27039
27036
|
rowCount
|
|
@@ -27047,9 +27044,11 @@ const ToolbarWrapper = _ref => {
|
|
|
27047
27044
|
displayRowsPerPage: false,
|
|
27048
27045
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
27049
27046
|
selectionStatus: selectionStatus.current,
|
|
27050
|
-
|
|
27051
|
-
|
|
27052
|
-
|
|
27047
|
+
page: page,
|
|
27048
|
+
onPageChange: onPageChange,
|
|
27049
|
+
pageSize: pageSize,
|
|
27050
|
+
onPageSizeChange: onPageSizeChange,
|
|
27051
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27053
27052
|
paginationProps: paginationProps,
|
|
27054
27053
|
rowCount: rowCount
|
|
27055
27054
|
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
@@ -27059,26 +27058,30 @@ const ToolbarWrapper = _ref => {
|
|
|
27059
27058
|
selectionStatus: selectionStatus.current,
|
|
27060
27059
|
apiRef: apiRef,
|
|
27061
27060
|
isRowSelectable: isRowSelectable,
|
|
27062
|
-
|
|
27063
|
-
|
|
27064
|
-
|
|
27061
|
+
page: page,
|
|
27062
|
+
onPageChange: onPageChange,
|
|
27063
|
+
pageSize: pageSize,
|
|
27064
|
+
onPageSizeChange: onPageSizeChange,
|
|
27065
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27065
27066
|
paginationProps: paginationProps
|
|
27066
27067
|
}) : null);
|
|
27067
27068
|
};
|
|
27068
27069
|
|
|
27069
27070
|
const useControlledDatagridState = _ref => {
|
|
27070
|
-
var
|
|
27071
|
+
var _initialState$paginat, _initialState$paginat2;
|
|
27071
27072
|
let {
|
|
27072
27073
|
initialState,
|
|
27073
|
-
|
|
27074
|
+
rowsPerPageOptions,
|
|
27074
27075
|
propsColumnVisibilityModel,
|
|
27075
27076
|
propsFilterModel,
|
|
27076
27077
|
propsOnColumnVisibilityModelChange,
|
|
27077
27078
|
propsOnFilterModelChange,
|
|
27078
|
-
|
|
27079
|
+
propsOnPageChange,
|
|
27080
|
+
propsOnPageSizeChange,
|
|
27079
27081
|
propsOnPinnedColumnsChange,
|
|
27080
27082
|
propsOnSortModelChange,
|
|
27081
|
-
|
|
27083
|
+
propsPage,
|
|
27084
|
+
propsPageSize,
|
|
27082
27085
|
propsPinnedColumns,
|
|
27083
27086
|
propsSortModel
|
|
27084
27087
|
} = _ref;
|
|
@@ -27126,22 +27129,33 @@ const useControlledDatagridState = _ref => {
|
|
|
27126
27129
|
setSortModel(model);
|
|
27127
27130
|
}
|
|
27128
27131
|
};
|
|
27129
|
-
const [
|
|
27130
|
-
|
|
27131
|
-
|
|
27132
|
-
|
|
27133
|
-
|
|
27134
|
-
|
|
27135
|
-
|
|
27132
|
+
const [page, setPage] = useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : _initialState$paginat.page) || propsPage || 0);
|
|
27133
|
+
const [pageSize, setPageSize] = useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : _initialState$paginat2.pageSize) || propsPageSize || (rowsPerPageOptions === null || rowsPerPageOptions === void 0 ? void 0 : rowsPerPageOptions[0]) || 25);
|
|
27134
|
+
const onPageChange = page => {
|
|
27135
|
+
if (propsOnPageChange) {
|
|
27136
|
+
propsOnPageChange(page, undefined);
|
|
27137
|
+
} else {
|
|
27138
|
+
setPage(page);
|
|
27139
|
+
}
|
|
27140
|
+
};
|
|
27141
|
+
useEffect(() => {
|
|
27142
|
+
if (propsPage || propsPage === 0) {
|
|
27143
|
+
setPage(propsPage);
|
|
27144
|
+
}
|
|
27145
|
+
}, [propsPage]);
|
|
27146
|
+
const onPageSizeChange = pageSize => {
|
|
27147
|
+
onPageChange(0);
|
|
27148
|
+
if (propsOnPageSizeChange) {
|
|
27149
|
+
propsOnPageSizeChange(pageSize, undefined);
|
|
27136
27150
|
} else {
|
|
27137
|
-
|
|
27151
|
+
setPageSize(pageSize);
|
|
27138
27152
|
}
|
|
27139
27153
|
};
|
|
27140
27154
|
useEffect(() => {
|
|
27141
|
-
if (
|
|
27142
|
-
|
|
27155
|
+
if (propsPageSize) {
|
|
27156
|
+
setPageSize(propsPageSize);
|
|
27143
27157
|
}
|
|
27144
|
-
}, [
|
|
27158
|
+
}, [propsPageSize]);
|
|
27145
27159
|
return {
|
|
27146
27160
|
filterModel,
|
|
27147
27161
|
onFilterModelChange,
|
|
@@ -27151,12 +27165,14 @@ const useControlledDatagridState = _ref => {
|
|
|
27151
27165
|
onPinnedColumnsChange,
|
|
27152
27166
|
sortModel,
|
|
27153
27167
|
onSortModelChange,
|
|
27154
|
-
|
|
27155
|
-
|
|
27168
|
+
page,
|
|
27169
|
+
pageSize,
|
|
27170
|
+
onPageChange,
|
|
27171
|
+
onPageSizeChange
|
|
27156
27172
|
};
|
|
27157
27173
|
};
|
|
27158
27174
|
|
|
27159
|
-
const _excluded$2 = ["apiRef", "autoHeight", "className", "
|
|
27175
|
+
const _excluded$2 = ["apiRef", "autoHeight", "className", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "selectionModel", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "rows", "rowsPerPageOptions", "sx", "theme", "paginationMode", "rowCount"];
|
|
27160
27176
|
const COMPONENT_NAME$2 = 'DataGrid';
|
|
27161
27177
|
const CLASSNAME$2 = 'redsift-datagrid';
|
|
27162
27178
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -27165,30 +27181,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27165
27181
|
apiRef: propsApiRef,
|
|
27166
27182
|
autoHeight,
|
|
27167
27183
|
className,
|
|
27168
|
-
|
|
27169
|
-
|
|
27184
|
+
columnTypes: propsColumnTypes,
|
|
27185
|
+
components,
|
|
27186
|
+
componentsProps,
|
|
27170
27187
|
filterModel: propsFilterModel,
|
|
27171
27188
|
columnVisibilityModel: propsColumnVisibilityModel,
|
|
27172
27189
|
pinnedColumns: propsPinnedColumns,
|
|
27173
27190
|
sortModel: propsSortModel,
|
|
27174
|
-
paginationModel: propsPaginationModel,
|
|
27175
27191
|
height: propsHeight,
|
|
27176
27192
|
hideToolbar,
|
|
27177
27193
|
initialState,
|
|
27178
27194
|
isRowSelectable,
|
|
27179
27195
|
license = process.env.MUI_LICENSE_KEY,
|
|
27180
27196
|
onFilterModelChange: propsOnFilterModelChange,
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
onRowSelectionModelChange: propsOnRowSelectionModelChange,
|
|
27197
|
+
onPageChange: propsOnPageChange,
|
|
27198
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
27184
27199
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
27185
27200
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
27186
27201
|
onSortModelChange: propsOnSortModelChange,
|
|
27202
|
+
selectionModel: propsSelectionModel,
|
|
27203
|
+
onSelectionModelChange: propsOnSelectionModelChange,
|
|
27204
|
+
page: propsPage,
|
|
27205
|
+
pageSize: propsPageSize,
|
|
27187
27206
|
pagination,
|
|
27188
27207
|
paginationPlacement = 'both',
|
|
27189
27208
|
paginationProps,
|
|
27190
27209
|
rows,
|
|
27191
|
-
|
|
27210
|
+
rowsPerPageOptions,
|
|
27192
27211
|
sx,
|
|
27193
27212
|
theme: propsTheme,
|
|
27194
27213
|
paginationMode = 'client',
|
|
@@ -27198,7 +27217,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27198
27217
|
const theme = useTheme$4(propsTheme);
|
|
27199
27218
|
const _apiRef = useGridApiRef();
|
|
27200
27219
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
27201
|
-
const RenderedToolbar =
|
|
27220
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
27202
27221
|
LicenseInfo.setLicenseKey(license);
|
|
27203
27222
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
27204
27223
|
const {
|
|
@@ -27206,52 +27225,56 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27206
27225
|
filterModel,
|
|
27207
27226
|
onColumnVisibilityModelChange,
|
|
27208
27227
|
onFilterModelChange,
|
|
27209
|
-
|
|
27228
|
+
onPageChange,
|
|
27229
|
+
onPageSizeChange,
|
|
27210
27230
|
onPinnedColumnsChange,
|
|
27211
27231
|
onSortModelChange,
|
|
27212
|
-
|
|
27232
|
+
page,
|
|
27233
|
+
pageSize,
|
|
27213
27234
|
pinnedColumns,
|
|
27214
27235
|
sortModel
|
|
27215
27236
|
} = useControlledDatagridState({
|
|
27216
27237
|
initialState,
|
|
27217
|
-
|
|
27238
|
+
rowsPerPageOptions,
|
|
27218
27239
|
propsColumnVisibilityModel,
|
|
27219
27240
|
propsFilterModel,
|
|
27220
27241
|
propsOnColumnVisibilityModelChange,
|
|
27221
27242
|
propsOnFilterModelChange,
|
|
27222
27243
|
propsOnPinnedColumnsChange,
|
|
27223
27244
|
propsOnSortModelChange,
|
|
27224
|
-
|
|
27245
|
+
propsPage,
|
|
27246
|
+
propsPageSize,
|
|
27225
27247
|
propsPinnedColumns,
|
|
27226
27248
|
propsSortModel,
|
|
27227
|
-
|
|
27249
|
+
propsOnPageChange,
|
|
27250
|
+
propsOnPageSizeChange
|
|
27228
27251
|
});
|
|
27229
|
-
const [
|
|
27252
|
+
const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
27230
27253
|
useEffect(() => {
|
|
27231
|
-
|
|
27232
|
-
}, [
|
|
27233
|
-
const
|
|
27234
|
-
if (
|
|
27235
|
-
|
|
27254
|
+
setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
27255
|
+
}, [propsSelectionModel]);
|
|
27256
|
+
const onSelectionModelChange = (selectionModel, details) => {
|
|
27257
|
+
if (propsOnSelectionModelChange) {
|
|
27258
|
+
propsOnSelectionModelChange(selectionModel, details);
|
|
27236
27259
|
} else {
|
|
27237
|
-
|
|
27260
|
+
setSelectionModel(selectionModel);
|
|
27238
27261
|
}
|
|
27239
27262
|
};
|
|
27240
27263
|
const selectionStatus = useRef({
|
|
27241
27264
|
type: 'none',
|
|
27242
27265
|
numberOfSelectedRows: 0,
|
|
27243
27266
|
numberOfSelectedRowsInPage: 0,
|
|
27244
|
-
page
|
|
27245
|
-
pageSize
|
|
27267
|
+
page,
|
|
27268
|
+
pageSize
|
|
27246
27269
|
});
|
|
27247
27270
|
|
|
27248
27271
|
// in server-side pagination we want to update the selection status
|
|
27249
27272
|
// every time we navigate between pages, resize our page or select something
|
|
27250
27273
|
useEffect(() => {
|
|
27251
27274
|
if (paginationMode == 'server') {
|
|
27252
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
27275
|
+
onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
|
|
27253
27276
|
}
|
|
27254
|
-
}, [
|
|
27277
|
+
}, [selectionModel, page, pageSize]);
|
|
27255
27278
|
if (!Array.isArray(rows)) {
|
|
27256
27279
|
return null;
|
|
27257
27280
|
}
|
|
@@ -27282,54 +27305,57 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27282
27305
|
apiRef: apiRef,
|
|
27283
27306
|
autoHeight: autoHeight,
|
|
27284
27307
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
27285
|
-
|
|
27286
|
-
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
|
|
27308
|
+
columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
|
|
27309
|
+
components: _objectSpread2(_objectSpread2({
|
|
27310
|
+
BaseButton,
|
|
27311
|
+
BaseCheckbox,
|
|
27312
|
+
// BaseTextField,
|
|
27313
|
+
BasePopper,
|
|
27314
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27291
27315
|
displayName: "ColumnFilteredIcon"
|
|
27292
27316
|
})),
|
|
27293
|
-
|
|
27317
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27294
27318
|
displayName: "ColumnSelectorIcon"
|
|
27295
27319
|
})),
|
|
27296
|
-
|
|
27320
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27297
27321
|
displayName: "ColumnSortedAscendingIcon"
|
|
27298
27322
|
})),
|
|
27299
|
-
|
|
27323
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27300
27324
|
displayName: "ColumnSortedDescendingIcon"
|
|
27301
27325
|
})),
|
|
27302
|
-
|
|
27326
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27303
27327
|
displayName: "DensityCompactIcon"
|
|
27304
27328
|
})),
|
|
27305
|
-
|
|
27329
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27306
27330
|
displayName: "DensityStandardIcon"
|
|
27307
27331
|
})),
|
|
27308
|
-
|
|
27332
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27309
27333
|
displayName: "DensityComfortableIcon"
|
|
27310
27334
|
})),
|
|
27311
|
-
|
|
27335
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27312
27336
|
displayName: "DetailPanelCollapseIcon"
|
|
27313
27337
|
})),
|
|
27314
|
-
|
|
27338
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27315
27339
|
displayName: "DetailPanelExpandIcon"
|
|
27316
27340
|
})),
|
|
27317
|
-
|
|
27341
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27318
27342
|
displayName: "ExportIcon"
|
|
27319
27343
|
})),
|
|
27320
|
-
|
|
27344
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({
|
|
27321
27345
|
displayName: "OpenFilterButtonIcon"
|
|
27322
27346
|
}, props))
|
|
27323
|
-
},
|
|
27324
|
-
|
|
27325
|
-
|
|
27347
|
+
}, components), {}, {
|
|
27348
|
+
Toolbar: ToolbarWrapper,
|
|
27349
|
+
Pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$1({}, props, {
|
|
27326
27350
|
displaySelection: false,
|
|
27327
27351
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
27328
27352
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
27329
27353
|
selectionStatus: selectionStatus.current,
|
|
27330
|
-
|
|
27331
|
-
|
|
27332
|
-
|
|
27354
|
+
page: page,
|
|
27355
|
+
onPageChange: onPageChange,
|
|
27356
|
+
pageSize: pageSize,
|
|
27357
|
+
onPageSizeChange: onPageSizeChange,
|
|
27358
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27333
27359
|
paginationProps: paginationProps,
|
|
27334
27360
|
paginationMode: paginationMode,
|
|
27335
27361
|
rowCount: rowCount
|
|
@@ -27340,14 +27366,16 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27340
27366
|
selectionStatus: selectionStatus.current,
|
|
27341
27367
|
apiRef: apiRef,
|
|
27342
27368
|
isRowSelectable: isRowSelectable,
|
|
27343
|
-
|
|
27344
|
-
|
|
27345
|
-
|
|
27369
|
+
page: page,
|
|
27370
|
+
onPageChange: onPageChange,
|
|
27371
|
+
pageSize: pageSize,
|
|
27372
|
+
onPageSizeChange: onPageSizeChange,
|
|
27373
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27346
27374
|
paginationProps: paginationProps,
|
|
27347
27375
|
paginationMode: paginationMode
|
|
27348
27376
|
})) : null
|
|
27349
27377
|
}),
|
|
27350
|
-
|
|
27378
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
27351
27379
|
toolbar: _objectSpread2({
|
|
27352
27380
|
hideToolbar,
|
|
27353
27381
|
RenderedToolbar,
|
|
@@ -27358,13 +27386,15 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27358
27386
|
selectionStatus,
|
|
27359
27387
|
apiRef,
|
|
27360
27388
|
isRowSelectable,
|
|
27361
|
-
|
|
27362
|
-
|
|
27363
|
-
|
|
27389
|
+
page,
|
|
27390
|
+
onPageChange,
|
|
27391
|
+
pageSize,
|
|
27392
|
+
onPageSizeChange,
|
|
27393
|
+
rowsPerPageOptions,
|
|
27364
27394
|
paginationProps,
|
|
27365
27395
|
paginationMode,
|
|
27366
27396
|
rowCount
|
|
27367
|
-
},
|
|
27397
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
27368
27398
|
}),
|
|
27369
27399
|
filterModel: filterModel,
|
|
27370
27400
|
columnVisibilityModel: columnVisibilityModel,
|
|
@@ -27380,11 +27410,13 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27380
27410
|
paginationMode: paginationMode,
|
|
27381
27411
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
27382
27412
|
rows: rows,
|
|
27383
|
-
|
|
27384
|
-
|
|
27385
|
-
|
|
27386
|
-
|
|
27387
|
-
|
|
27413
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27414
|
+
page: page,
|
|
27415
|
+
onPageChange: onPageChange,
|
|
27416
|
+
pageSize: pageSize,
|
|
27417
|
+
onPageSizeChange: onPageSizeChange,
|
|
27418
|
+
selectionModel: selectionModel,
|
|
27419
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
27388
27420
|
if (pagination && paginationMode != 'server') {
|
|
27389
27421
|
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
27390
27422
|
let {
|
|
@@ -27442,7 +27474,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27442
27474
|
};
|
|
27443
27475
|
}
|
|
27444
27476
|
}
|
|
27445
|
-
|
|
27477
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
27446
27478
|
},
|
|
27447
27479
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
27448
27480
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -27459,6 +27491,8 @@ DataGrid.className = CLASSNAME$2;
|
|
|
27459
27491
|
DataGrid.displayName = COMPONENT_NAME$2;
|
|
27460
27492
|
|
|
27461
27493
|
// Get and Set data from LocalStorage WITHOUT useState
|
|
27494
|
+
|
|
27495
|
+
// triggering a state update and consecutive re-render
|
|
27462
27496
|
const useFetchState = (defaultValue, key) => {
|
|
27463
27497
|
let stickyValue = null;
|
|
27464
27498
|
try {
|
|
@@ -27466,7 +27500,16 @@ const useFetchState = (defaultValue, key) => {
|
|
|
27466
27500
|
} catch (e) {
|
|
27467
27501
|
console.error('StatefulDataGrid: error getting item from local storage: ', e);
|
|
27468
27502
|
}
|
|
27469
|
-
|
|
27503
|
+
let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
|
|
27504
|
+
|
|
27505
|
+
// TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
|
|
27506
|
+
// Consider upgrading the Datagrid component library as the exception handling was added in this PR: https://github.com/mui-org/material-ui-x/pull/3224
|
|
27507
|
+
if (parsedValue instanceof Array) {
|
|
27508
|
+
const fields = (parsedValue || []).map(item => item.field);
|
|
27509
|
+
if (fields.includes('screenshot') || fields.includes('diffs')) {
|
|
27510
|
+
parsedValue = defaultValue;
|
|
27511
|
+
}
|
|
27512
|
+
}
|
|
27470
27513
|
const updateValue = useCallback(value => {
|
|
27471
27514
|
try {
|
|
27472
27515
|
window.localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -27477,8 +27520,6 @@ const useFetchState = (defaultValue, key) => {
|
|
|
27477
27520
|
return [parsedValue, updateValue];
|
|
27478
27521
|
};
|
|
27479
27522
|
|
|
27480
|
-
// import useLocalStorage from './useLocalStorage';
|
|
27481
|
-
|
|
27482
27523
|
const useTableStates = (id, version) => {
|
|
27483
27524
|
const [paginationModel, setPaginationModel] = useFetchState('', buildStorageKey({
|
|
27484
27525
|
id,
|
|
@@ -27535,7 +27576,8 @@ const useStatefulTable = props => {
|
|
|
27535
27576
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
27536
27577
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
27537
27578
|
onFilterModelChange: propsOnFilterModelChange,
|
|
27538
|
-
|
|
27579
|
+
onPageChange: propsOnPageChange,
|
|
27580
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
27539
27581
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
27540
27582
|
onSortModelChange: propsOnSortModelChange,
|
|
27541
27583
|
useRouter,
|
|
@@ -27597,6 +27639,7 @@ const useStatefulTable = props => {
|
|
|
27597
27639
|
column.width = dimensionModel[column.field] || column.width || 100;
|
|
27598
27640
|
return column;
|
|
27599
27641
|
}), [propsColumns, dimensionModel]);
|
|
27642
|
+
|
|
27600
27643
|
/** Add resetPage method to apiRef. */
|
|
27601
27644
|
apiRef.current.resetPage = () => {
|
|
27602
27645
|
apiRef.current.setPage(0);
|
|
@@ -27607,7 +27650,7 @@ const useStatefulTable = props => {
|
|
|
27607
27650
|
onFilterModelChange: (model, details) => {
|
|
27608
27651
|
const filterModel = _objectSpread2(_objectSpread2({}, model), {}, {
|
|
27609
27652
|
items: model.items.map(item => {
|
|
27610
|
-
const column = apiRef.current.getColumn(item.
|
|
27653
|
+
const column = apiRef.current.getColumn(item.columnField);
|
|
27611
27654
|
item.type = column.type || 'string';
|
|
27612
27655
|
return item;
|
|
27613
27656
|
})
|
|
@@ -27644,16 +27687,33 @@ const useStatefulTable = props => {
|
|
|
27644
27687
|
}, search, historyReplace, columns);
|
|
27645
27688
|
},
|
|
27646
27689
|
pinnedColumns: pinnedColumnsModel,
|
|
27647
|
-
|
|
27648
|
-
|
|
27649
|
-
|
|
27650
|
-
|
|
27651
|
-
|
|
27652
|
-
|
|
27690
|
+
page: paginationModelParsed.page,
|
|
27691
|
+
pageSize: paginationModelParsed.pageSize,
|
|
27692
|
+
onPageChange: (page, details) => {
|
|
27693
|
+
const direction = paginationModelParsed.page < page ? 'next' : 'back';
|
|
27694
|
+
propsOnPageChange === null || propsOnPageChange === void 0 ? void 0 : propsOnPageChange(page, details);
|
|
27695
|
+
updateUrl({
|
|
27696
|
+
filterModel: filterParsed,
|
|
27697
|
+
sortModel: sortModelParsed,
|
|
27698
|
+
paginationModel: {
|
|
27699
|
+
page,
|
|
27700
|
+
pageSize: paginationModelParsed.pageSize,
|
|
27701
|
+
direction
|
|
27702
|
+
},
|
|
27703
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
27704
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
27705
|
+
}, search, historyReplace, columns);
|
|
27706
|
+
},
|
|
27707
|
+
onPageSizeChange: (pageSize, details) => {
|
|
27708
|
+
propsOnPageSizeChange === null || propsOnPageSizeChange === void 0 ? void 0 : propsOnPageSizeChange(pageSize, details);
|
|
27653
27709
|
updateUrl({
|
|
27654
27710
|
filterModel: filterParsed,
|
|
27655
27711
|
sortModel: sortModelParsed,
|
|
27656
|
-
paginationModel:
|
|
27712
|
+
paginationModel: {
|
|
27713
|
+
page: paginationModelParsed.page,
|
|
27714
|
+
pageSize,
|
|
27715
|
+
direction: paginationModelParsed.direction
|
|
27716
|
+
},
|
|
27657
27717
|
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
27658
27718
|
pinnedColumnsModel: pinnedColumnsModel
|
|
27659
27719
|
}, search, historyReplace, columns);
|
|
@@ -27679,7 +27739,7 @@ const useStatefulTable = props => {
|
|
|
27679
27739
|
};
|
|
27680
27740
|
};
|
|
27681
27741
|
|
|
27682
|
-
const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "
|
|
27742
|
+
const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "page", "pageSize", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "localStorageVersion", "onFilterModelChange", "selectionModel", "onColumnWidthChange", "onPageChange", "onPageSizeChange", "onSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "rowsPerPageOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
27683
27743
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
27684
27744
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
27685
27745
|
const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -27689,13 +27749,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27689
27749
|
autoHeight,
|
|
27690
27750
|
className,
|
|
27691
27751
|
columns,
|
|
27692
|
-
|
|
27693
|
-
|
|
27752
|
+
columnTypes: propsColumnTypes,
|
|
27753
|
+
components,
|
|
27754
|
+
componentsProps,
|
|
27694
27755
|
filterModel: propsFilterModel,
|
|
27695
27756
|
columnVisibilityModel: propsColumnVisibilityModel,
|
|
27696
27757
|
pinnedColumns: propsPinnedColumns,
|
|
27697
27758
|
sortModel: propsSortModel,
|
|
27698
|
-
|
|
27759
|
+
page: propsPage,
|
|
27760
|
+
pageSize: propsPageSize,
|
|
27699
27761
|
height: propsHeight,
|
|
27700
27762
|
hideToolbar,
|
|
27701
27763
|
initialState,
|
|
@@ -27703,10 +27765,11 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27703
27765
|
license = process.env.MUI_LICENSE_KEY,
|
|
27704
27766
|
localStorageVersion,
|
|
27705
27767
|
onFilterModelChange: propsOnFilterModelChange,
|
|
27706
|
-
|
|
27768
|
+
selectionModel: propsSelectionModel,
|
|
27707
27769
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
27708
|
-
|
|
27709
|
-
|
|
27770
|
+
onPageChange: propsOnPageChange,
|
|
27771
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
27772
|
+
onSelectionModelChange: propsOnSelectionModelChange,
|
|
27710
27773
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
27711
27774
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
27712
27775
|
onSortModelChange: propsOnSortModelChange,
|
|
@@ -27714,7 +27777,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27714
27777
|
paginationPlacement = 'both',
|
|
27715
27778
|
paginationProps,
|
|
27716
27779
|
rows,
|
|
27717
|
-
|
|
27780
|
+
rowsPerPageOptions,
|
|
27718
27781
|
sx,
|
|
27719
27782
|
theme: propsTheme,
|
|
27720
27783
|
useRouter,
|
|
@@ -27725,38 +27788,43 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27725
27788
|
const theme = useTheme$4(propsTheme);
|
|
27726
27789
|
const _apiRef = useGridApiRef();
|
|
27727
27790
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
27728
|
-
const RenderedToolbar =
|
|
27791
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
27729
27792
|
LicenseInfo.setLicenseKey(license);
|
|
27730
27793
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
27731
27794
|
const {
|
|
27732
27795
|
onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
|
|
27733
27796
|
onFilterModelChange: controlledOnFilterModelChange,
|
|
27734
|
-
|
|
27797
|
+
onPageChange: controlledOnPageChange,
|
|
27798
|
+
onPageSizeChange: controlledOnPageSizeChange,
|
|
27735
27799
|
onPinnedColumnsChange: controlledOnPinnedColumnsChange,
|
|
27736
27800
|
onSortModelChange: controlledOnSortModelChange
|
|
27737
27801
|
} = useControlledDatagridState({
|
|
27738
27802
|
initialState,
|
|
27739
|
-
|
|
27803
|
+
rowsPerPageOptions,
|
|
27740
27804
|
propsColumnVisibilityModel,
|
|
27741
27805
|
propsFilterModel,
|
|
27742
27806
|
propsOnColumnVisibilityModelChange,
|
|
27743
27807
|
propsOnFilterModelChange,
|
|
27744
27808
|
propsOnPinnedColumnsChange,
|
|
27745
27809
|
propsOnSortModelChange,
|
|
27746
|
-
|
|
27810
|
+
propsPage,
|
|
27811
|
+
propsPageSize,
|
|
27747
27812
|
propsPinnedColumns,
|
|
27748
27813
|
propsSortModel,
|
|
27749
|
-
|
|
27814
|
+
propsOnPageChange,
|
|
27815
|
+
propsOnPageSizeChange
|
|
27750
27816
|
});
|
|
27751
27817
|
const {
|
|
27752
27818
|
columnVisibilityModel,
|
|
27753
27819
|
filterModel,
|
|
27754
27820
|
onColumnVisibilityModelChange,
|
|
27755
27821
|
onFilterModelChange,
|
|
27756
|
-
|
|
27822
|
+
onPageChange,
|
|
27823
|
+
onPageSizeChange,
|
|
27757
27824
|
onPinnedColumnsChange,
|
|
27758
27825
|
onSortModelChange,
|
|
27759
|
-
|
|
27826
|
+
page,
|
|
27827
|
+
pageSize,
|
|
27760
27828
|
pinnedColumns,
|
|
27761
27829
|
sortModel,
|
|
27762
27830
|
onColumnWidthChange
|
|
@@ -27767,38 +27835,39 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27767
27835
|
onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
|
|
27768
27836
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
27769
27837
|
onFilterModelChange: controlledOnFilterModelChange,
|
|
27770
|
-
|
|
27838
|
+
onPageChange: controlledOnPageChange,
|
|
27839
|
+
onPageSizeChange: controlledOnPageSizeChange,
|
|
27771
27840
|
onPinnedColumnsChange: controlledOnPinnedColumnsChange,
|
|
27772
27841
|
onSortModelChange: controlledOnSortModelChange,
|
|
27773
27842
|
useRouter: useRouter,
|
|
27774
27843
|
localStorageVersion
|
|
27775
27844
|
});
|
|
27776
|
-
const [
|
|
27845
|
+
const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
27777
27846
|
useEffect(() => {
|
|
27778
|
-
|
|
27779
|
-
}, [
|
|
27780
|
-
const
|
|
27781
|
-
if (
|
|
27782
|
-
|
|
27847
|
+
setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
27848
|
+
}, [propsSelectionModel]);
|
|
27849
|
+
const onSelectionModelChange = (selectionModel, details) => {
|
|
27850
|
+
if (propsOnSelectionModelChange) {
|
|
27851
|
+
propsOnSelectionModelChange(selectionModel, details);
|
|
27783
27852
|
} else {
|
|
27784
|
-
|
|
27853
|
+
setSelectionModel(selectionModel);
|
|
27785
27854
|
}
|
|
27786
27855
|
};
|
|
27787
27856
|
const selectionStatus = useRef({
|
|
27788
27857
|
type: 'none',
|
|
27789
27858
|
numberOfSelectedRows: 0,
|
|
27790
27859
|
numberOfSelectedRowsInPage: 0,
|
|
27791
|
-
page
|
|
27792
|
-
pageSize:
|
|
27860
|
+
page,
|
|
27861
|
+
pageSize: pageSize
|
|
27793
27862
|
});
|
|
27794
27863
|
|
|
27795
27864
|
// in server-side pagination we want to update the selection status
|
|
27796
27865
|
// every time we navigate between pages, resize our page or select something
|
|
27797
27866
|
useEffect(() => {
|
|
27798
27867
|
if (paginationMode == 'server') {
|
|
27799
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
27868
|
+
onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
|
|
27800
27869
|
}
|
|
27801
|
-
}, [
|
|
27870
|
+
}, [selectionModel, page, pageSize]);
|
|
27802
27871
|
if (!Array.isArray(rows)) {
|
|
27803
27872
|
return null;
|
|
27804
27873
|
}
|
|
@@ -27831,13 +27900,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27831
27900
|
filterModel: filterModel,
|
|
27832
27901
|
onColumnVisibilityModelChange: onColumnVisibilityModelChange,
|
|
27833
27902
|
onFilterModelChange: onFilterModelChange,
|
|
27834
|
-
|
|
27903
|
+
onPageChange: onPageChange,
|
|
27904
|
+
onPageSizeChange: onPageSizeChange,
|
|
27835
27905
|
onPinnedColumnsChange: onPinnedColumnsChange,
|
|
27836
27906
|
onSortModelChange: onSortModelChange,
|
|
27837
|
-
|
|
27907
|
+
page: page,
|
|
27908
|
+
pageSize: pageSize,
|
|
27838
27909
|
pinnedColumns: pinnedColumns,
|
|
27839
27910
|
sortModel: sortModel,
|
|
27840
|
-
|
|
27911
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27841
27912
|
onColumnWidthChange: onColumnWidthChange,
|
|
27842
27913
|
initialState: initialState,
|
|
27843
27914
|
isRowSelectable: isRowSelectable,
|
|
@@ -27848,55 +27919,58 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27848
27919
|
rowCount: rowCount,
|
|
27849
27920
|
autoHeight: autoHeight,
|
|
27850
27921
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
27851
|
-
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
|
|
27922
|
+
columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
|
|
27923
|
+
components: _objectSpread2(_objectSpread2({
|
|
27924
|
+
BaseButton,
|
|
27925
|
+
BaseCheckbox,
|
|
27926
|
+
// BaseTextField,
|
|
27927
|
+
BasePopper,
|
|
27928
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27857
27929
|
displayName: "ColumnFilteredIcon"
|
|
27858
27930
|
})),
|
|
27859
|
-
|
|
27931
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27860
27932
|
displayName: "ColumnSelectorIcon"
|
|
27861
27933
|
})),
|
|
27862
|
-
|
|
27934
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27863
27935
|
displayName: "ColumnSortedAscendingIcon"
|
|
27864
27936
|
})),
|
|
27865
|
-
|
|
27937
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27866
27938
|
displayName: "ColumnSortedDescendingIcon"
|
|
27867
27939
|
})),
|
|
27868
|
-
|
|
27940
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27869
27941
|
displayName: "DensityCompactIcon"
|
|
27870
27942
|
})),
|
|
27871
|
-
|
|
27943
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27872
27944
|
displayName: "DensityStandardIcon"
|
|
27873
27945
|
})),
|
|
27874
|
-
|
|
27946
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27875
27947
|
displayName: "DensityComfortableIcon"
|
|
27876
27948
|
})),
|
|
27877
|
-
|
|
27949
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27878
27950
|
displayName: "DetailPanelCollapseIcon"
|
|
27879
27951
|
})),
|
|
27880
|
-
|
|
27952
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27881
27953
|
displayName: "DetailPanelExpandIcon"
|
|
27882
27954
|
})),
|
|
27883
|
-
|
|
27955
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
27884
27956
|
displayName: "ExportIcon"
|
|
27885
27957
|
})),
|
|
27886
|
-
|
|
27958
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({
|
|
27887
27959
|
displayName: "OpenFilterButtonIcon"
|
|
27888
27960
|
}, props))
|
|
27889
|
-
},
|
|
27890
|
-
|
|
27891
|
-
|
|
27961
|
+
}, components), {}, {
|
|
27962
|
+
Toolbar: ToolbarWrapper,
|
|
27963
|
+
Pagination: props => {
|
|
27892
27964
|
return pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$1({}, props, {
|
|
27893
27965
|
displaySelection: false,
|
|
27894
27966
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
27895
27967
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
27896
27968
|
selectionStatus: selectionStatus.current,
|
|
27897
|
-
|
|
27898
|
-
|
|
27899
|
-
|
|
27969
|
+
page: page,
|
|
27970
|
+
pageSize: pageSize,
|
|
27971
|
+
onPageChange: onPageChange,
|
|
27972
|
+
onPageSizeChange: onPageSizeChange,
|
|
27973
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27900
27974
|
paginationProps: paginationProps,
|
|
27901
27975
|
paginationMode: paginationMode,
|
|
27902
27976
|
rowCount: rowCount
|
|
@@ -27907,15 +27981,17 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27907
27981
|
selectionStatus: selectionStatus.current,
|
|
27908
27982
|
apiRef: apiRef,
|
|
27909
27983
|
isRowSelectable: isRowSelectable,
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27984
|
+
page: page,
|
|
27985
|
+
pageSize: pageSize,
|
|
27986
|
+
onPageChange: onPageChange,
|
|
27987
|
+
onPageSizeChange: onPageSizeChange,
|
|
27988
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
27913
27989
|
paginationProps: paginationProps,
|
|
27914
27990
|
paginationMode: paginationMode
|
|
27915
27991
|
})) : null;
|
|
27916
27992
|
}
|
|
27917
27993
|
}),
|
|
27918
|
-
|
|
27994
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
27919
27995
|
toolbar: _objectSpread2({
|
|
27920
27996
|
hideToolbar,
|
|
27921
27997
|
RenderedToolbar,
|
|
@@ -27926,16 +28002,18 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27926
28002
|
selectionStatus,
|
|
27927
28003
|
apiRef,
|
|
27928
28004
|
isRowSelectable,
|
|
27929
|
-
|
|
27930
|
-
|
|
27931
|
-
|
|
28005
|
+
page,
|
|
28006
|
+
pageSize,
|
|
28007
|
+
onPageChange,
|
|
28008
|
+
onPageSizeChange,
|
|
28009
|
+
rowsPerPageOptions,
|
|
27932
28010
|
paginationProps,
|
|
27933
28011
|
paginationMode,
|
|
27934
28012
|
rowCount
|
|
27935
|
-
},
|
|
28013
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
27936
28014
|
}),
|
|
27937
|
-
|
|
27938
|
-
|
|
28015
|
+
selectionModel: selectionModel,
|
|
28016
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
27939
28017
|
if (pagination && paginationMode != 'server') {
|
|
27940
28018
|
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
27941
28019
|
let {
|
|
@@ -27993,7 +28071,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27993
28071
|
};
|
|
27994
28072
|
}
|
|
27995
28073
|
}
|
|
27996
|
-
|
|
28074
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
27997
28075
|
},
|
|
27998
28076
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
27999
28077
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -28067,5 +28145,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
28067
28145
|
TextCell.className = CLASSNAME;
|
|
28068
28146
|
TextCell.displayName = COMPONENT_NAME;
|
|
28069
28147
|
|
|
28070
|
-
export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, ControlledPagination, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, ServerSideControlledPagination, StatefulDataGrid, TextCell, Toolbar$2 as Toolbar, ToolbarWrapper, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString,
|
|
28148
|
+
export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, ControlledPagination, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, ServerSideControlledPagination, StatefulDataGrid, TextCell, Toolbar$2 as Toolbar, ToolbarWrapper, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, muiIconToDSIcon, numberOperatorDecoder, numberOperatorEncoder, onServerSideSelectionStatusChange, operatorList, updateUrl, urlSearchParamsToString };
|
|
28071
28149
|
//# sourceMappingURL=index.js.map
|