@redsift/table 11.0.1 → 11.0.2-muiv5
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 +41 -25
- package/index.js +331 -253
- package/index.js.map +1 -1
- package/package.json +6 -6
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, GRID_CHECKBOX_SELECTION_COL_DEF } 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,17 +18136,17 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18133
18136
|
if (!searchString) {
|
|
18134
18137
|
return {
|
|
18135
18138
|
items: [],
|
|
18136
|
-
|
|
18139
|
+
linkOperator: GridLinkOperator.And
|
|
18137
18140
|
};
|
|
18138
18141
|
}
|
|
18139
|
-
let
|
|
18142
|
+
let linkOperator = GridLinkOperator.And;
|
|
18140
18143
|
const searchParams = new URLSearchParams();
|
|
18141
18144
|
for (const [key, value] of new URLSearchParams(searchString)) {
|
|
18142
18145
|
if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility', '_pagination'].includes(key)) {
|
|
18143
18146
|
searchParams.set(key, value);
|
|
18144
18147
|
}
|
|
18145
18148
|
if (key === '_logicOperator') {
|
|
18146
|
-
|
|
18149
|
+
linkOperator = value;
|
|
18147
18150
|
}
|
|
18148
18151
|
}
|
|
18149
18152
|
let id = 5000;
|
|
@@ -18184,8 +18187,8 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18184
18187
|
return;
|
|
18185
18188
|
}
|
|
18186
18189
|
items.push({
|
|
18187
|
-
field,
|
|
18188
|
-
|
|
18190
|
+
columnField: field,
|
|
18191
|
+
operatorValue: ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
|
|
18189
18192
|
id,
|
|
18190
18193
|
value: listOperators.includes(operator) && decodedValue === '' ? [] : decodedValue,
|
|
18191
18194
|
type
|
|
@@ -18198,28 +18201,28 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18198
18201
|
if (isInvalid) {
|
|
18199
18202
|
return {
|
|
18200
18203
|
items: [],
|
|
18201
|
-
|
|
18204
|
+
linkOperator: GridLinkOperator.And
|
|
18202
18205
|
};
|
|
18203
18206
|
}
|
|
18204
18207
|
return {
|
|
18205
18208
|
items,
|
|
18206
|
-
|
|
18209
|
+
linkOperator
|
|
18207
18210
|
};
|
|
18208
18211
|
};
|
|
18209
18212
|
const getSearchParamsFromFilterModel = filterModel => {
|
|
18210
18213
|
const searchParams = new URLSearchParams();
|
|
18211
|
-
searchParams.set('_logicOperator', filterModel['
|
|
18214
|
+
searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
|
|
18212
18215
|
filterModel['items'].forEach(item => {
|
|
18213
18216
|
const {
|
|
18214
|
-
|
|
18215
|
-
|
|
18217
|
+
columnField,
|
|
18218
|
+
operatorValue,
|
|
18216
18219
|
value,
|
|
18217
18220
|
type
|
|
18218
18221
|
} = item;
|
|
18219
|
-
if (Object.keys(numberOperatorEncoder).includes(
|
|
18220
|
-
searchParams.set(`_${
|
|
18222
|
+
if (Object.keys(numberOperatorEncoder).includes(operatorValue)) {
|
|
18223
|
+
searchParams.set(`_${columnField}[${numberOperatorEncoder[operatorValue]},${encodeValue(type)}]`, encodeValue(value));
|
|
18221
18224
|
} else {
|
|
18222
|
-
searchParams.set(`_${
|
|
18225
|
+
searchParams.set(`_${columnField}[${encodeValue(operatorValue)},${encodeValue(type)}]`, encodeValue(value));
|
|
18223
18226
|
}
|
|
18224
18227
|
});
|
|
18225
18228
|
return searchParams;
|
|
@@ -18245,7 +18248,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18245
18248
|
}
|
|
18246
18249
|
return {
|
|
18247
18250
|
items: [],
|
|
18248
|
-
|
|
18251
|
+
linkOperator: GridLinkOperator.And
|
|
18249
18252
|
};
|
|
18250
18253
|
};
|
|
18251
18254
|
|
|
@@ -18368,11 +18371,11 @@ const getPaginationModel = (search, localStoragePagination, setLocalStoragePagin
|
|
|
18368
18371
|
|
|
18369
18372
|
const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
18370
18373
|
const searchParams = new URLSearchParams();
|
|
18371
|
-
const
|
|
18374
|
+
const columnFields = columns.map(column => column.field);
|
|
18372
18375
|
|
|
18373
18376
|
// if column visibility model is empty, show all columns
|
|
18374
18377
|
if (Object.keys(columnVisibility).length == 0) {
|
|
18375
|
-
searchParams.set('_columnVisibility', `[${
|
|
18378
|
+
searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
|
|
18376
18379
|
return searchParams;
|
|
18377
18380
|
}
|
|
18378
18381
|
const finalColumnVisibility = columns.filter(c => {
|
|
@@ -18422,12 +18425,12 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
|
18422
18425
|
continue;
|
|
18423
18426
|
}
|
|
18424
18427
|
exist = true;
|
|
18425
|
-
const
|
|
18428
|
+
const columnFields = tableColumns.map(column => column.field);
|
|
18426
18429
|
// TODO: Add validation that , is present
|
|
18427
18430
|
const columns = encodedValues.split(',').map(value => decodeValue(value));
|
|
18428
18431
|
|
|
18429
18432
|
// for each column, check if it's visible and add it to visibility model
|
|
18430
|
-
for (const column of
|
|
18433
|
+
for (const column of columnFields) {
|
|
18431
18434
|
const isColumnVisible = columns.includes(column);
|
|
18432
18435
|
visibility[column] = isColumnVisible;
|
|
18433
18436
|
if (isColumnVisible) {
|
|
@@ -18490,8 +18493,8 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
|
18490
18493
|
if (typeof encodedValues !== 'string') {
|
|
18491
18494
|
continue;
|
|
18492
18495
|
}
|
|
18493
|
-
const
|
|
18494
|
-
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' &&
|
|
18496
|
+
const columnFields = [...tableColumns.map(column => column.field), '__check__'];
|
|
18497
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && columnFields.includes(val));
|
|
18495
18498
|
if (fieldURL === '_pinnedColumnsLeft') {
|
|
18496
18499
|
pinnedColumns['left'] = columns;
|
|
18497
18500
|
}
|
|
@@ -18641,17 +18644,17 @@ const updateUrl = (_ref4, search, historyReplace, columns) => {
|
|
|
18641
18644
|
// do not use it for equivalence (e.g. with value `3` and undefined we
|
|
18642
18645
|
// will get 0).
|
|
18643
18646
|
const compareFilters = (firstFilter, secondFilter) => {
|
|
18644
|
-
if (firstFilter.
|
|
18647
|
+
if (firstFilter.columnField < secondFilter.columnField) {
|
|
18645
18648
|
return -1;
|
|
18646
|
-
} else if (firstFilter.
|
|
18649
|
+
} else if (firstFilter.columnField > secondFilter.columnField) {
|
|
18647
18650
|
return 1;
|
|
18648
18651
|
}
|
|
18649
|
-
if (firstFilter.
|
|
18652
|
+
if (firstFilter.operatorValue === undefined || secondFilter.operatorValue === undefined) {
|
|
18650
18653
|
return 0;
|
|
18651
18654
|
}
|
|
18652
|
-
if (firstFilter.
|
|
18655
|
+
if (firstFilter.operatorValue < secondFilter.operatorValue) {
|
|
18653
18656
|
return -1;
|
|
18654
|
-
} else if (firstFilter.
|
|
18657
|
+
} else if (firstFilter.operatorValue > secondFilter.operatorValue) {
|
|
18655
18658
|
return 1;
|
|
18656
18659
|
}
|
|
18657
18660
|
if (firstFilter.value < secondFilter.value) {
|
|
@@ -18662,18 +18665,18 @@ const compareFilters = (firstFilter, secondFilter) => {
|
|
|
18662
18665
|
return 0;
|
|
18663
18666
|
};
|
|
18664
18667
|
const areFiltersEquivalent = (firstFilter, secondFilter) => {
|
|
18665
|
-
return firstFilter.
|
|
18668
|
+
return firstFilter.columnField === secondFilter.columnField && firstFilter.operatorValue === secondFilter.operatorValue && firstFilter.value === secondFilter.value;
|
|
18666
18669
|
};
|
|
18667
18670
|
const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
18668
18671
|
const {
|
|
18669
18672
|
items,
|
|
18670
|
-
|
|
18673
|
+
linkOperator
|
|
18671
18674
|
} = filterModel;
|
|
18672
18675
|
const {
|
|
18673
18676
|
items: itemsToMatch,
|
|
18674
|
-
|
|
18677
|
+
linkOperator: linkOperatorToMatch
|
|
18675
18678
|
} = filterModelToMatch;
|
|
18676
|
-
if (
|
|
18679
|
+
if (linkOperator !== linkOperatorToMatch) {
|
|
18677
18680
|
return false;
|
|
18678
18681
|
}
|
|
18679
18682
|
if (items.length !== itemsToMatch.length) {
|
|
@@ -18686,7 +18689,7 @@ const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
|
18686
18689
|
const filterToCompare = itemsToMatch[i];
|
|
18687
18690
|
|
|
18688
18691
|
// compareFilters return 0 if and only if the filters have the same
|
|
18689
|
-
//
|
|
18692
|
+
// columnField, operatorValue, and value
|
|
18690
18693
|
if (!areFiltersEquivalent(filter, filterToCompare)) {
|
|
18691
18694
|
return false;
|
|
18692
18695
|
}
|
|
@@ -23098,16 +23101,16 @@ const getRole = (config, dateFormat) => {
|
|
|
23098
23101
|
}).join('\n');
|
|
23099
23102
|
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.
|
|
23100
23103
|
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.
|
|
23101
|
-
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "
|
|
23102
|
-
- "
|
|
23103
|
-
- "items": a list of conditions, each is an object with exactly the three keys "
|
|
23104
|
-
- "
|
|
23104
|
+
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
|
|
23105
|
+
- "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
|
|
23106
|
+
- "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
|
|
23107
|
+
- "columnField": the column name, must be one of ${columns}
|
|
23105
23108
|
- "value":
|
|
23106
|
-
- this can be skipped if the "
|
|
23107
|
-
- a list of multiple values if the "
|
|
23109
|
+
- this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
|
|
23110
|
+
- a list of multiple values if the "operatorValue" ends with "AnyOf"
|
|
23108
23111
|
- otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
|
|
23109
23112
|
For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
|
|
23110
|
-
- "
|
|
23113
|
+
- "operatorValue": the comparison operator, accepted values depend on the data type of the column
|
|
23111
23114
|
${operators}
|
|
23112
23115
|
|
|
23113
23116
|
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:
|
|
@@ -23144,10 +23147,10 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23144
23147
|
nlpFilterConfig,
|
|
23145
23148
|
onFilterModelChange,
|
|
23146
23149
|
dateFormat = 'yyyy-mm-dd',
|
|
23147
|
-
defaultModel = 'gpt-4-
|
|
23150
|
+
defaultModel = 'gpt-4-0613',
|
|
23148
23151
|
defaultFilter = {
|
|
23149
23152
|
items: [],
|
|
23150
|
-
|
|
23153
|
+
linkOperator: 'and'
|
|
23151
23154
|
},
|
|
23152
23155
|
disablePower = false,
|
|
23153
23156
|
localeText
|
|
@@ -23225,7 +23228,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23225
23228
|
value: prompt
|
|
23226
23229
|
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
23227
23230
|
variant: "primary",
|
|
23228
|
-
"
|
|
23231
|
+
"aira-label": buttonAriaLabel,
|
|
23229
23232
|
type: "submit",
|
|
23230
23233
|
isLoading: isLoading
|
|
23231
23234
|
}, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
|
|
@@ -23286,7 +23289,7 @@ const Toolbar$2 = props => {
|
|
|
23286
23289
|
let {
|
|
23287
23290
|
apiRef
|
|
23288
23291
|
} = _ref;
|
|
23289
|
-
return
|
|
23292
|
+
return gridVisibleSortedRowIdsSelector(apiRef);
|
|
23290
23293
|
}
|
|
23291
23294
|
},
|
|
23292
23295
|
printOptions: {
|
|
@@ -25518,10 +25521,12 @@ const ServerSideControlledPagination = _ref3 => {
|
|
|
25518
25521
|
selectionStatus,
|
|
25519
25522
|
displaySelection,
|
|
25520
25523
|
displayPagination,
|
|
25521
|
-
|
|
25522
|
-
|
|
25523
|
-
|
|
25524
|
+
page,
|
|
25525
|
+
onPageChange,
|
|
25526
|
+
pageSize,
|
|
25527
|
+
onPageSizeChange,
|
|
25524
25528
|
displayRowsPerPage,
|
|
25529
|
+
rowsPerPageOptions,
|
|
25525
25530
|
paginationProps,
|
|
25526
25531
|
rowCount
|
|
25527
25532
|
} = _ref3;
|
|
@@ -25540,17 +25545,13 @@ const ServerSideControlledPagination = _ref3 => {
|
|
|
25540
25545
|
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
25541
25546
|
component: "div",
|
|
25542
25547
|
count: totalNumberOfRowsInTable,
|
|
25543
|
-
page:
|
|
25544
|
-
onPageChange: (event,
|
|
25545
|
-
|
|
25546
|
-
|
|
25547
|
-
|
|
25548
|
-
|
|
25549
|
-
|
|
25550
|
-
page: paginationModel.page,
|
|
25551
|
-
pageSize: parseInt(event.target.value, 10)
|
|
25552
|
-
}),
|
|
25553
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
25548
|
+
page: page,
|
|
25549
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
25550
|
+
rowsPerPage: pageSize,
|
|
25551
|
+
onRowsPerPageChange: event => {
|
|
25552
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
25553
|
+
},
|
|
25554
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
25554
25555
|
}, paginationProps)) : null);
|
|
25555
25556
|
};
|
|
25556
25557
|
|
|
@@ -25576,9 +25577,11 @@ const ControlledPagination = _ref3 => {
|
|
|
25576
25577
|
displayPagination = false,
|
|
25577
25578
|
selectionStatus,
|
|
25578
25579
|
apiRef,
|
|
25579
|
-
|
|
25580
|
-
|
|
25581
|
-
|
|
25580
|
+
page,
|
|
25581
|
+
onPageChange,
|
|
25582
|
+
pageSize,
|
|
25583
|
+
onPageSizeChange,
|
|
25584
|
+
rowsPerPageOptions,
|
|
25582
25585
|
isRowSelectable,
|
|
25583
25586
|
paginationProps
|
|
25584
25587
|
} = _ref3;
|
|
@@ -25608,25 +25611,17 @@ const ControlledPagination = _ref3 => {
|
|
|
25608
25611
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
25609
25612
|
component: "div",
|
|
25610
25613
|
count: numberOfFilteredRowsInTable,
|
|
25611
|
-
page:
|
|
25612
|
-
onPageChange: (event,
|
|
25613
|
-
|
|
25614
|
-
page,
|
|
25615
|
-
pageSize: paginationModel.pageSize
|
|
25616
|
-
});
|
|
25617
|
-
},
|
|
25618
|
-
rowsPerPage: paginationModel.pageSize,
|
|
25614
|
+
page: page,
|
|
25615
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
25616
|
+
rowsPerPage: pageSize,
|
|
25619
25617
|
onRowsPerPageChange: event => {
|
|
25620
|
-
|
|
25621
|
-
page: paginationModel.page,
|
|
25622
|
-
pageSize: parseInt(event.target.value, 10)
|
|
25623
|
-
});
|
|
25618
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
25624
25619
|
},
|
|
25625
|
-
rowsPerPageOptions: displayRowsPerPage ?
|
|
25620
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
25626
25621
|
}, paginationProps)) : null);
|
|
25627
25622
|
};
|
|
25628
25623
|
|
|
25629
|
-
const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "
|
|
25624
|
+
const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
25630
25625
|
const ToolbarWrapper = _ref => {
|
|
25631
25626
|
let {
|
|
25632
25627
|
hideToolbar,
|
|
@@ -25638,9 +25633,11 @@ const ToolbarWrapper = _ref => {
|
|
|
25638
25633
|
selectionStatus,
|
|
25639
25634
|
apiRef,
|
|
25640
25635
|
isRowSelectable,
|
|
25641
|
-
|
|
25642
|
-
|
|
25643
|
-
|
|
25636
|
+
page,
|
|
25637
|
+
onPageChange,
|
|
25638
|
+
pageSize,
|
|
25639
|
+
onPageSizeChange,
|
|
25640
|
+
rowsPerPageOptions,
|
|
25644
25641
|
paginationProps,
|
|
25645
25642
|
paginationMode = 'client',
|
|
25646
25643
|
rowCount
|
|
@@ -25654,9 +25651,11 @@ const ToolbarWrapper = _ref => {
|
|
|
25654
25651
|
displayRowsPerPage: false,
|
|
25655
25652
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
25656
25653
|
selectionStatus: selectionStatus.current,
|
|
25657
|
-
|
|
25658
|
-
|
|
25659
|
-
|
|
25654
|
+
page: page,
|
|
25655
|
+
onPageChange: onPageChange,
|
|
25656
|
+
pageSize: pageSize,
|
|
25657
|
+
onPageSizeChange: onPageSizeChange,
|
|
25658
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25660
25659
|
paginationProps: paginationProps,
|
|
25661
25660
|
rowCount: rowCount
|
|
25662
25661
|
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
@@ -25666,26 +25665,30 @@ const ToolbarWrapper = _ref => {
|
|
|
25666
25665
|
selectionStatus: selectionStatus.current,
|
|
25667
25666
|
apiRef: apiRef,
|
|
25668
25667
|
isRowSelectable: isRowSelectable,
|
|
25669
|
-
|
|
25670
|
-
|
|
25671
|
-
|
|
25668
|
+
page: page,
|
|
25669
|
+
onPageChange: onPageChange,
|
|
25670
|
+
pageSize: pageSize,
|
|
25671
|
+
onPageSizeChange: onPageSizeChange,
|
|
25672
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25672
25673
|
paginationProps: paginationProps
|
|
25673
25674
|
}) : null);
|
|
25674
25675
|
};
|
|
25675
25676
|
|
|
25676
25677
|
const useControlledDatagridState = _ref => {
|
|
25677
|
-
var
|
|
25678
|
+
var _initialState$paginat, _initialState$paginat2;
|
|
25678
25679
|
let {
|
|
25679
25680
|
initialState,
|
|
25680
|
-
|
|
25681
|
+
rowsPerPageOptions,
|
|
25681
25682
|
propsColumnVisibilityModel,
|
|
25682
25683
|
propsFilterModel,
|
|
25683
25684
|
propsOnColumnVisibilityModelChange,
|
|
25684
25685
|
propsOnFilterModelChange,
|
|
25685
|
-
|
|
25686
|
+
propsOnPageChange,
|
|
25687
|
+
propsOnPageSizeChange,
|
|
25686
25688
|
propsOnPinnedColumnsChange,
|
|
25687
25689
|
propsOnSortModelChange,
|
|
25688
|
-
|
|
25690
|
+
propsPage,
|
|
25691
|
+
propsPageSize,
|
|
25689
25692
|
propsPinnedColumns,
|
|
25690
25693
|
propsSortModel
|
|
25691
25694
|
} = _ref;
|
|
@@ -25733,22 +25736,33 @@ const useControlledDatagridState = _ref => {
|
|
|
25733
25736
|
setSortModel(model);
|
|
25734
25737
|
}
|
|
25735
25738
|
};
|
|
25736
|
-
const [
|
|
25737
|
-
|
|
25738
|
-
|
|
25739
|
-
|
|
25740
|
-
|
|
25741
|
-
|
|
25742
|
-
|
|
25739
|
+
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);
|
|
25740
|
+
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);
|
|
25741
|
+
const onPageChange = page => {
|
|
25742
|
+
if (propsOnPageChange) {
|
|
25743
|
+
propsOnPageChange(page, undefined);
|
|
25744
|
+
} else {
|
|
25745
|
+
setPage(page);
|
|
25746
|
+
}
|
|
25747
|
+
};
|
|
25748
|
+
useEffect(() => {
|
|
25749
|
+
if (propsPage || propsPage === 0) {
|
|
25750
|
+
setPage(propsPage);
|
|
25751
|
+
}
|
|
25752
|
+
}, [propsPage]);
|
|
25753
|
+
const onPageSizeChange = pageSize => {
|
|
25754
|
+
onPageChange(0);
|
|
25755
|
+
if (propsOnPageSizeChange) {
|
|
25756
|
+
propsOnPageSizeChange(pageSize, undefined);
|
|
25743
25757
|
} else {
|
|
25744
|
-
|
|
25758
|
+
setPageSize(pageSize);
|
|
25745
25759
|
}
|
|
25746
25760
|
};
|
|
25747
25761
|
useEffect(() => {
|
|
25748
|
-
if (
|
|
25749
|
-
|
|
25762
|
+
if (propsPageSize) {
|
|
25763
|
+
setPageSize(propsPageSize);
|
|
25750
25764
|
}
|
|
25751
|
-
}, [
|
|
25765
|
+
}, [propsPageSize]);
|
|
25752
25766
|
return {
|
|
25753
25767
|
filterModel,
|
|
25754
25768
|
onFilterModelChange,
|
|
@@ -25758,12 +25772,14 @@ const useControlledDatagridState = _ref => {
|
|
|
25758
25772
|
onPinnedColumnsChange,
|
|
25759
25773
|
sortModel,
|
|
25760
25774
|
onSortModelChange,
|
|
25761
|
-
|
|
25762
|
-
|
|
25775
|
+
page,
|
|
25776
|
+
pageSize,
|
|
25777
|
+
onPageChange,
|
|
25778
|
+
onPageSizeChange
|
|
25763
25779
|
};
|
|
25764
25780
|
};
|
|
25765
25781
|
|
|
25766
|
-
const _excluded$2 = ["apiRef", "autoHeight", "className", "
|
|
25782
|
+
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"];
|
|
25767
25783
|
const COMPONENT_NAME$2 = 'DataGrid';
|
|
25768
25784
|
const CLASSNAME$2 = 'redsift-datagrid';
|
|
25769
25785
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -25772,30 +25788,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25772
25788
|
apiRef: propsApiRef,
|
|
25773
25789
|
autoHeight,
|
|
25774
25790
|
className,
|
|
25775
|
-
|
|
25776
|
-
|
|
25791
|
+
columnTypes: propsColumnTypes,
|
|
25792
|
+
components,
|
|
25793
|
+
componentsProps,
|
|
25777
25794
|
filterModel: propsFilterModel,
|
|
25778
25795
|
columnVisibilityModel: propsColumnVisibilityModel,
|
|
25779
25796
|
pinnedColumns: propsPinnedColumns,
|
|
25780
25797
|
sortModel: propsSortModel,
|
|
25781
|
-
paginationModel: propsPaginationModel,
|
|
25782
25798
|
height: propsHeight,
|
|
25783
25799
|
hideToolbar,
|
|
25784
25800
|
initialState,
|
|
25785
25801
|
isRowSelectable,
|
|
25786
25802
|
license = process.env.MUI_LICENSE_KEY,
|
|
25787
25803
|
onFilterModelChange: propsOnFilterModelChange,
|
|
25788
|
-
|
|
25789
|
-
|
|
25790
|
-
onRowSelectionModelChange: propsOnRowSelectionModelChange,
|
|
25804
|
+
onPageChange: propsOnPageChange,
|
|
25805
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
25791
25806
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25792
25807
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25793
25808
|
onSortModelChange: propsOnSortModelChange,
|
|
25809
|
+
selectionModel: propsSelectionModel,
|
|
25810
|
+
onSelectionModelChange: propsOnSelectionModelChange,
|
|
25811
|
+
page: propsPage,
|
|
25812
|
+
pageSize: propsPageSize,
|
|
25794
25813
|
pagination,
|
|
25795
25814
|
paginationPlacement = 'both',
|
|
25796
25815
|
paginationProps,
|
|
25797
25816
|
rows,
|
|
25798
|
-
|
|
25817
|
+
rowsPerPageOptions,
|
|
25799
25818
|
sx,
|
|
25800
25819
|
theme: propsTheme,
|
|
25801
25820
|
paginationMode = 'client',
|
|
@@ -25805,7 +25824,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25805
25824
|
const theme = useTheme$4(propsTheme);
|
|
25806
25825
|
const _apiRef = useGridApiRef();
|
|
25807
25826
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
25808
|
-
const RenderedToolbar =
|
|
25827
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
25809
25828
|
LicenseInfo.setLicenseKey(license);
|
|
25810
25829
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
25811
25830
|
const {
|
|
@@ -25813,52 +25832,56 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25813
25832
|
filterModel,
|
|
25814
25833
|
onColumnVisibilityModelChange,
|
|
25815
25834
|
onFilterModelChange,
|
|
25816
|
-
|
|
25835
|
+
onPageChange,
|
|
25836
|
+
onPageSizeChange,
|
|
25817
25837
|
onPinnedColumnsChange,
|
|
25818
25838
|
onSortModelChange,
|
|
25819
|
-
|
|
25839
|
+
page,
|
|
25840
|
+
pageSize,
|
|
25820
25841
|
pinnedColumns,
|
|
25821
25842
|
sortModel
|
|
25822
25843
|
} = useControlledDatagridState({
|
|
25823
25844
|
initialState,
|
|
25824
|
-
|
|
25845
|
+
rowsPerPageOptions,
|
|
25825
25846
|
propsColumnVisibilityModel,
|
|
25826
25847
|
propsFilterModel,
|
|
25827
25848
|
propsOnColumnVisibilityModelChange,
|
|
25828
25849
|
propsOnFilterModelChange,
|
|
25829
25850
|
propsOnPinnedColumnsChange,
|
|
25830
25851
|
propsOnSortModelChange,
|
|
25831
|
-
|
|
25852
|
+
propsPage,
|
|
25853
|
+
propsPageSize,
|
|
25832
25854
|
propsPinnedColumns,
|
|
25833
25855
|
propsSortModel,
|
|
25834
|
-
|
|
25856
|
+
propsOnPageChange,
|
|
25857
|
+
propsOnPageSizeChange
|
|
25835
25858
|
});
|
|
25836
|
-
const [
|
|
25859
|
+
const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25837
25860
|
useEffect(() => {
|
|
25838
|
-
|
|
25839
|
-
}, [
|
|
25840
|
-
const
|
|
25841
|
-
if (
|
|
25842
|
-
|
|
25861
|
+
setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25862
|
+
}, [propsSelectionModel]);
|
|
25863
|
+
const onSelectionModelChange = (selectionModel, details) => {
|
|
25864
|
+
if (propsOnSelectionModelChange) {
|
|
25865
|
+
propsOnSelectionModelChange(selectionModel, details);
|
|
25843
25866
|
} else {
|
|
25844
|
-
|
|
25867
|
+
setSelectionModel(selectionModel);
|
|
25845
25868
|
}
|
|
25846
25869
|
};
|
|
25847
25870
|
const selectionStatus = useRef({
|
|
25848
25871
|
type: 'none',
|
|
25849
25872
|
numberOfSelectedRows: 0,
|
|
25850
25873
|
numberOfSelectedRowsInPage: 0,
|
|
25851
|
-
page
|
|
25852
|
-
pageSize
|
|
25874
|
+
page,
|
|
25875
|
+
pageSize
|
|
25853
25876
|
});
|
|
25854
25877
|
|
|
25855
25878
|
// in server-side pagination we want to update the selection status
|
|
25856
25879
|
// every time we navigate between pages, resize our page or select something
|
|
25857
25880
|
useEffect(() => {
|
|
25858
25881
|
if (paginationMode == 'server') {
|
|
25859
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
25882
|
+
onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
|
|
25860
25883
|
}
|
|
25861
|
-
}, [
|
|
25884
|
+
}, [selectionModel, page, pageSize]);
|
|
25862
25885
|
if (!Array.isArray(rows)) {
|
|
25863
25886
|
return null;
|
|
25864
25887
|
}
|
|
@@ -25889,54 +25912,57 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25889
25912
|
apiRef: apiRef,
|
|
25890
25913
|
autoHeight: autoHeight,
|
|
25891
25914
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
25892
|
-
|
|
25893
|
-
|
|
25894
|
-
|
|
25895
|
-
|
|
25896
|
-
|
|
25897
|
-
|
|
25915
|
+
columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
|
|
25916
|
+
components: _objectSpread2(_objectSpread2({
|
|
25917
|
+
BaseButton,
|
|
25918
|
+
BaseCheckbox,
|
|
25919
|
+
// BaseTextField,
|
|
25920
|
+
BasePopper,
|
|
25921
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25898
25922
|
displayName: "ColumnFilteredIcon"
|
|
25899
25923
|
})),
|
|
25900
|
-
|
|
25924
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25901
25925
|
displayName: "ColumnSelectorIcon"
|
|
25902
25926
|
})),
|
|
25903
|
-
|
|
25927
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25904
25928
|
displayName: "ColumnSortedAscendingIcon"
|
|
25905
25929
|
})),
|
|
25906
|
-
|
|
25930
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25907
25931
|
displayName: "ColumnSortedDescendingIcon"
|
|
25908
25932
|
})),
|
|
25909
|
-
|
|
25933
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25910
25934
|
displayName: "DensityCompactIcon"
|
|
25911
25935
|
})),
|
|
25912
|
-
|
|
25936
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25913
25937
|
displayName: "DensityStandardIcon"
|
|
25914
25938
|
})),
|
|
25915
|
-
|
|
25939
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25916
25940
|
displayName: "DensityComfortableIcon"
|
|
25917
25941
|
})),
|
|
25918
|
-
|
|
25942
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25919
25943
|
displayName: "DetailPanelCollapseIcon"
|
|
25920
25944
|
})),
|
|
25921
|
-
|
|
25945
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25922
25946
|
displayName: "DetailPanelExpandIcon"
|
|
25923
25947
|
})),
|
|
25924
|
-
|
|
25948
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
25925
25949
|
displayName: "ExportIcon"
|
|
25926
25950
|
})),
|
|
25927
|
-
|
|
25951
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
25928
25952
|
displayName: "OpenFilterButtonIcon"
|
|
25929
25953
|
}, props))
|
|
25930
|
-
},
|
|
25931
|
-
|
|
25932
|
-
|
|
25954
|
+
}, components), {}, {
|
|
25955
|
+
Toolbar: ToolbarWrapper,
|
|
25956
|
+
Pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
25933
25957
|
displaySelection: false,
|
|
25934
25958
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
25935
25959
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
25936
25960
|
selectionStatus: selectionStatus.current,
|
|
25937
|
-
|
|
25938
|
-
|
|
25939
|
-
|
|
25961
|
+
page: page,
|
|
25962
|
+
onPageChange: onPageChange,
|
|
25963
|
+
pageSize: pageSize,
|
|
25964
|
+
onPageSizeChange: onPageSizeChange,
|
|
25965
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25940
25966
|
paginationProps: paginationProps,
|
|
25941
25967
|
paginationMode: paginationMode,
|
|
25942
25968
|
rowCount: rowCount
|
|
@@ -25947,14 +25973,16 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25947
25973
|
selectionStatus: selectionStatus.current,
|
|
25948
25974
|
apiRef: apiRef,
|
|
25949
25975
|
isRowSelectable: isRowSelectable,
|
|
25950
|
-
|
|
25951
|
-
|
|
25952
|
-
|
|
25976
|
+
page: page,
|
|
25977
|
+
onPageChange: onPageChange,
|
|
25978
|
+
pageSize: pageSize,
|
|
25979
|
+
onPageSizeChange: onPageSizeChange,
|
|
25980
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25953
25981
|
paginationProps: paginationProps,
|
|
25954
25982
|
paginationMode: paginationMode
|
|
25955
25983
|
})) : null
|
|
25956
25984
|
}),
|
|
25957
|
-
|
|
25985
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
25958
25986
|
toolbar: _objectSpread2({
|
|
25959
25987
|
hideToolbar,
|
|
25960
25988
|
RenderedToolbar,
|
|
@@ -25965,13 +25993,15 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25965
25993
|
selectionStatus,
|
|
25966
25994
|
apiRef,
|
|
25967
25995
|
isRowSelectable,
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25996
|
+
page,
|
|
25997
|
+
onPageChange,
|
|
25998
|
+
pageSize,
|
|
25999
|
+
onPageSizeChange,
|
|
26000
|
+
rowsPerPageOptions,
|
|
25971
26001
|
paginationProps,
|
|
25972
26002
|
paginationMode,
|
|
25973
26003
|
rowCount
|
|
25974
|
-
},
|
|
26004
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
25975
26005
|
}),
|
|
25976
26006
|
filterModel: filterModel,
|
|
25977
26007
|
columnVisibilityModel: columnVisibilityModel,
|
|
@@ -25987,11 +26017,13 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25987
26017
|
paginationMode: paginationMode,
|
|
25988
26018
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
25989
26019
|
rows: rows,
|
|
25990
|
-
|
|
25991
|
-
|
|
25992
|
-
|
|
25993
|
-
|
|
25994
|
-
|
|
26020
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26021
|
+
page: page,
|
|
26022
|
+
onPageChange: onPageChange,
|
|
26023
|
+
pageSize: pageSize,
|
|
26024
|
+
onPageSizeChange: onPageSizeChange,
|
|
26025
|
+
selectionModel: selectionModel,
|
|
26026
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
25995
26027
|
if (pagination && paginationMode != 'server') {
|
|
25996
26028
|
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
25997
26029
|
let {
|
|
@@ -26049,7 +26081,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26049
26081
|
};
|
|
26050
26082
|
}
|
|
26051
26083
|
}
|
|
26052
|
-
|
|
26084
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
26053
26085
|
},
|
|
26054
26086
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
26055
26087
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -26066,6 +26098,8 @@ DataGrid.className = CLASSNAME$2;
|
|
|
26066
26098
|
DataGrid.displayName = COMPONENT_NAME$2;
|
|
26067
26099
|
|
|
26068
26100
|
// Get and Set data from LocalStorage WITHOUT useState
|
|
26101
|
+
|
|
26102
|
+
// triggering a state update and consecutive re-render
|
|
26069
26103
|
const useFetchState = (defaultValue, key) => {
|
|
26070
26104
|
let stickyValue = null;
|
|
26071
26105
|
try {
|
|
@@ -26073,7 +26107,16 @@ const useFetchState = (defaultValue, key) => {
|
|
|
26073
26107
|
} catch (e) {
|
|
26074
26108
|
console.error('StatefulDataGrid: error getting item from local storage: ', e);
|
|
26075
26109
|
}
|
|
26076
|
-
|
|
26110
|
+
let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
|
|
26111
|
+
|
|
26112
|
+
// TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
|
|
26113
|
+
// 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
|
|
26114
|
+
if (parsedValue instanceof Array) {
|
|
26115
|
+
const fields = (parsedValue || []).map(item => item.field);
|
|
26116
|
+
if (fields.includes('screenshot') || fields.includes('diffs')) {
|
|
26117
|
+
parsedValue = defaultValue;
|
|
26118
|
+
}
|
|
26119
|
+
}
|
|
26077
26120
|
const updateValue = useCallback(value => {
|
|
26078
26121
|
try {
|
|
26079
26122
|
window.localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -26084,8 +26127,6 @@ const useFetchState = (defaultValue, key) => {
|
|
|
26084
26127
|
return [parsedValue, updateValue];
|
|
26085
26128
|
};
|
|
26086
26129
|
|
|
26087
|
-
// import useLocalStorage from './useLocalStorage';
|
|
26088
|
-
|
|
26089
26130
|
const useTableStates = (id, version, customDefaults) => {
|
|
26090
26131
|
const [paginationModel, setPaginationModel] = useFetchState('', buildStorageKey({
|
|
26091
26132
|
id,
|
|
@@ -26141,7 +26182,8 @@ const useStatefulTable = props => {
|
|
|
26141
26182
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
26142
26183
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
26143
26184
|
onFilterModelChange: propsOnFilterModelChange,
|
|
26144
|
-
|
|
26185
|
+
onPageChange: propsOnPageChange,
|
|
26186
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
26145
26187
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
26146
26188
|
onSortModelChange: propsOnSortModelChange,
|
|
26147
26189
|
pinnedCustomColumns = {
|
|
@@ -26212,6 +26254,7 @@ const useStatefulTable = props => {
|
|
|
26212
26254
|
column.width = dimensionModel[column.field] || column.width || 100;
|
|
26213
26255
|
return column;
|
|
26214
26256
|
}), [propsColumns, dimensionModel]);
|
|
26257
|
+
|
|
26215
26258
|
/** Add resetPage method to apiRef. */
|
|
26216
26259
|
apiRef.current.resetPage = () => {
|
|
26217
26260
|
apiRef.current.setPage(0);
|
|
@@ -26222,7 +26265,7 @@ const useStatefulTable = props => {
|
|
|
26222
26265
|
onFilterModelChange: (model, details) => {
|
|
26223
26266
|
const filterModel = _objectSpread2(_objectSpread2({}, model), {}, {
|
|
26224
26267
|
items: model.items.map(item => {
|
|
26225
|
-
const column = apiRef.current.getColumn(item.
|
|
26268
|
+
const column = apiRef.current.getColumn(item.columnField);
|
|
26226
26269
|
item.type = column.type || 'string';
|
|
26227
26270
|
return item;
|
|
26228
26271
|
})
|
|
@@ -26259,16 +26302,33 @@ const useStatefulTable = props => {
|
|
|
26259
26302
|
}, search, historyReplace, columns);
|
|
26260
26303
|
},
|
|
26261
26304
|
pinnedColumns: pinnedColumnsModel,
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
|
|
26265
|
-
|
|
26266
|
-
|
|
26267
|
-
propsOnPaginationModelChange === null || propsOnPaginationModelChange === void 0 ? void 0 : propsOnPaginationModelChange(paginationModel, details);
|
|
26305
|
+
page: paginationModelParsed.page,
|
|
26306
|
+
pageSize: paginationModelParsed.pageSize,
|
|
26307
|
+
onPageChange: (page, details) => {
|
|
26308
|
+
const direction = paginationModelParsed.page < page ? 'next' : 'back';
|
|
26309
|
+
propsOnPageChange === null || propsOnPageChange === void 0 ? void 0 : propsOnPageChange(page, details);
|
|
26268
26310
|
updateUrl({
|
|
26269
26311
|
filterModel: filterParsed,
|
|
26270
26312
|
sortModel: sortModelParsed,
|
|
26271
|
-
paginationModel:
|
|
26313
|
+
paginationModel: {
|
|
26314
|
+
page,
|
|
26315
|
+
pageSize: paginationModelParsed.pageSize,
|
|
26316
|
+
direction
|
|
26317
|
+
},
|
|
26318
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
26319
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
26320
|
+
}, search, historyReplace, columns);
|
|
26321
|
+
},
|
|
26322
|
+
onPageSizeChange: (pageSize, details) => {
|
|
26323
|
+
propsOnPageSizeChange === null || propsOnPageSizeChange === void 0 ? void 0 : propsOnPageSizeChange(pageSize, details);
|
|
26324
|
+
updateUrl({
|
|
26325
|
+
filterModel: filterParsed,
|
|
26326
|
+
sortModel: sortModelParsed,
|
|
26327
|
+
paginationModel: {
|
|
26328
|
+
page: paginationModelParsed.page,
|
|
26329
|
+
pageSize,
|
|
26330
|
+
direction: paginationModelParsed.direction
|
|
26331
|
+
},
|
|
26272
26332
|
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
26273
26333
|
pinnedColumnsModel: pinnedColumnsModel
|
|
26274
26334
|
}, search, historyReplace, columns);
|
|
@@ -26294,7 +26354,7 @@ const useStatefulTable = props => {
|
|
|
26294
26354
|
};
|
|
26295
26355
|
};
|
|
26296
26356
|
|
|
26297
|
-
const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "
|
|
26357
|
+
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", "pinnedCustomColumns", "rows", "rowsPerPageOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
26298
26358
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
26299
26359
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
26300
26360
|
const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -26304,13 +26364,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26304
26364
|
autoHeight,
|
|
26305
26365
|
className,
|
|
26306
26366
|
columns,
|
|
26307
|
-
|
|
26308
|
-
|
|
26367
|
+
columnTypes: propsColumnTypes,
|
|
26368
|
+
components,
|
|
26369
|
+
componentsProps,
|
|
26309
26370
|
filterModel: propsFilterModel,
|
|
26310
26371
|
columnVisibilityModel: propsColumnVisibilityModel,
|
|
26311
26372
|
pinnedColumns: propsPinnedColumns,
|
|
26312
26373
|
sortModel: propsSortModel,
|
|
26313
|
-
|
|
26374
|
+
page: propsPage,
|
|
26375
|
+
pageSize: propsPageSize,
|
|
26314
26376
|
height: propsHeight,
|
|
26315
26377
|
hideToolbar,
|
|
26316
26378
|
initialState,
|
|
@@ -26318,10 +26380,11 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26318
26380
|
license = process.env.MUI_LICENSE_KEY,
|
|
26319
26381
|
localStorageVersion,
|
|
26320
26382
|
onFilterModelChange: propsOnFilterModelChange,
|
|
26321
|
-
|
|
26383
|
+
selectionModel: propsSelectionModel,
|
|
26322
26384
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
26323
|
-
|
|
26324
|
-
|
|
26385
|
+
onPageChange: propsOnPageChange,
|
|
26386
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
26387
|
+
onSelectionModelChange,
|
|
26325
26388
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
26326
26389
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
26327
26390
|
onSortModelChange: propsOnSortModelChange,
|
|
@@ -26330,7 +26393,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26330
26393
|
paginationProps,
|
|
26331
26394
|
pinnedCustomColumns,
|
|
26332
26395
|
rows,
|
|
26333
|
-
|
|
26396
|
+
rowsPerPageOptions,
|
|
26334
26397
|
sx,
|
|
26335
26398
|
theme: propsTheme,
|
|
26336
26399
|
useRouter,
|
|
@@ -26341,38 +26404,43 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26341
26404
|
const theme = useTheme$4(propsTheme);
|
|
26342
26405
|
const _apiRef = useGridApiRef();
|
|
26343
26406
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
26344
|
-
const RenderedToolbar =
|
|
26407
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
26345
26408
|
LicenseInfo.setLicenseKey(license);
|
|
26346
26409
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
26347
26410
|
const {
|
|
26348
26411
|
onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
|
|
26349
26412
|
onFilterModelChange: controlledOnFilterModelChange,
|
|
26350
|
-
|
|
26413
|
+
onPageChange: controlledOnPageChange,
|
|
26414
|
+
onPageSizeChange: controlledOnPageSizeChange,
|
|
26351
26415
|
onPinnedColumnsChange: controlledOnPinnedColumnsChange,
|
|
26352
26416
|
onSortModelChange: controlledOnSortModelChange
|
|
26353
26417
|
} = useControlledDatagridState({
|
|
26354
26418
|
initialState,
|
|
26355
|
-
|
|
26419
|
+
rowsPerPageOptions,
|
|
26356
26420
|
propsColumnVisibilityModel,
|
|
26357
26421
|
propsFilterModel,
|
|
26358
26422
|
propsOnColumnVisibilityModelChange,
|
|
26359
26423
|
propsOnFilterModelChange,
|
|
26360
26424
|
propsOnPinnedColumnsChange,
|
|
26361
26425
|
propsOnSortModelChange,
|
|
26362
|
-
|
|
26426
|
+
propsPage,
|
|
26427
|
+
propsPageSize,
|
|
26363
26428
|
propsPinnedColumns,
|
|
26364
26429
|
propsSortModel,
|
|
26365
|
-
|
|
26430
|
+
propsOnPageChange,
|
|
26431
|
+
propsOnPageSizeChange
|
|
26366
26432
|
});
|
|
26367
26433
|
const {
|
|
26368
26434
|
columnVisibilityModel,
|
|
26369
26435
|
filterModel,
|
|
26370
26436
|
onColumnVisibilityModelChange,
|
|
26371
26437
|
onFilterModelChange,
|
|
26372
|
-
|
|
26438
|
+
onPageChange,
|
|
26439
|
+
onPageSizeChange,
|
|
26373
26440
|
onPinnedColumnsChange,
|
|
26374
26441
|
onSortModelChange,
|
|
26375
|
-
|
|
26442
|
+
page,
|
|
26443
|
+
pageSize,
|
|
26376
26444
|
pinnedColumns,
|
|
26377
26445
|
sortModel,
|
|
26378
26446
|
onColumnWidthChange
|
|
@@ -26382,32 +26450,33 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26382
26450
|
onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
|
|
26383
26451
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
26384
26452
|
onFilterModelChange: controlledOnFilterModelChange,
|
|
26385
|
-
|
|
26453
|
+
onPageChange: controlledOnPageChange,
|
|
26454
|
+
onPageSizeChange: controlledOnPageSizeChange,
|
|
26386
26455
|
onPinnedColumnsChange: controlledOnPinnedColumnsChange,
|
|
26387
26456
|
onSortModelChange: controlledOnSortModelChange,
|
|
26388
26457
|
pinnedCustomColumns,
|
|
26389
26458
|
useRouter: useRouter,
|
|
26390
26459
|
localStorageVersion
|
|
26391
26460
|
});
|
|
26392
|
-
const [
|
|
26461
|
+
const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
26393
26462
|
useEffect(() => {
|
|
26394
|
-
|
|
26463
|
+
setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
26395
26464
|
}, [propsSelectionModel]);
|
|
26396
26465
|
const selectionStatus = useRef({
|
|
26397
26466
|
type: 'none',
|
|
26398
26467
|
numberOfSelectedRows: 0,
|
|
26399
26468
|
numberOfSelectedRowsInPage: 0,
|
|
26400
|
-
page
|
|
26401
|
-
pageSize:
|
|
26469
|
+
page,
|
|
26470
|
+
pageSize: pageSize
|
|
26402
26471
|
});
|
|
26403
26472
|
|
|
26404
26473
|
// in server-side pagination we want to update the selection status
|
|
26405
26474
|
// every time we navigate between pages, resize our page or select something
|
|
26406
26475
|
useEffect(() => {
|
|
26407
26476
|
if (paginationMode == 'server') {
|
|
26408
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
26477
|
+
onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
|
|
26409
26478
|
}
|
|
26410
|
-
}, [
|
|
26479
|
+
}, [selectionModel, page, pageSize]);
|
|
26411
26480
|
if (!Array.isArray(rows)) {
|
|
26412
26481
|
return null;
|
|
26413
26482
|
}
|
|
@@ -26440,13 +26509,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26440
26509
|
filterModel: filterModel,
|
|
26441
26510
|
onColumnVisibilityModelChange: onColumnVisibilityModelChange,
|
|
26442
26511
|
onFilterModelChange: onFilterModelChange,
|
|
26443
|
-
|
|
26512
|
+
onPageChange: onPageChange,
|
|
26513
|
+
onPageSizeChange: onPageSizeChange,
|
|
26444
26514
|
onPinnedColumnsChange: onPinnedColumnsChange,
|
|
26445
26515
|
onSortModelChange: onSortModelChange,
|
|
26446
|
-
|
|
26516
|
+
page: page,
|
|
26517
|
+
pageSize: pageSize,
|
|
26447
26518
|
pinnedColumns: pinnedColumns,
|
|
26448
26519
|
sortModel: sortModel,
|
|
26449
|
-
|
|
26520
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26450
26521
|
onColumnWidthChange: onColumnWidthChange,
|
|
26451
26522
|
initialState: initialState,
|
|
26452
26523
|
isRowSelectable: isRowSelectable,
|
|
@@ -26457,55 +26528,58 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26457
26528
|
rowCount: rowCount,
|
|
26458
26529
|
autoHeight: autoHeight,
|
|
26459
26530
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
26460
|
-
|
|
26461
|
-
|
|
26462
|
-
|
|
26463
|
-
|
|
26464
|
-
|
|
26465
|
-
|
|
26531
|
+
columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
|
|
26532
|
+
components: _objectSpread2(_objectSpread2({
|
|
26533
|
+
BaseButton,
|
|
26534
|
+
BaseCheckbox,
|
|
26535
|
+
// BaseTextField,
|
|
26536
|
+
BasePopper,
|
|
26537
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26466
26538
|
displayName: "ColumnFilteredIcon"
|
|
26467
26539
|
})),
|
|
26468
|
-
|
|
26540
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26469
26541
|
displayName: "ColumnSelectorIcon"
|
|
26470
26542
|
})),
|
|
26471
|
-
|
|
26543
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26472
26544
|
displayName: "ColumnSortedAscendingIcon"
|
|
26473
26545
|
})),
|
|
26474
|
-
|
|
26546
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26475
26547
|
displayName: "ColumnSortedDescendingIcon"
|
|
26476
26548
|
})),
|
|
26477
|
-
|
|
26549
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26478
26550
|
displayName: "DensityCompactIcon"
|
|
26479
26551
|
})),
|
|
26480
|
-
|
|
26552
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26481
26553
|
displayName: "DensityStandardIcon"
|
|
26482
26554
|
})),
|
|
26483
|
-
|
|
26555
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26484
26556
|
displayName: "DensityComfortableIcon"
|
|
26485
26557
|
})),
|
|
26486
|
-
|
|
26558
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26487
26559
|
displayName: "DetailPanelCollapseIcon"
|
|
26488
26560
|
})),
|
|
26489
|
-
|
|
26561
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26490
26562
|
displayName: "DetailPanelExpandIcon"
|
|
26491
26563
|
})),
|
|
26492
|
-
|
|
26564
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26493
26565
|
displayName: "ExportIcon"
|
|
26494
26566
|
})),
|
|
26495
|
-
|
|
26567
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
26496
26568
|
displayName: "OpenFilterButtonIcon"
|
|
26497
26569
|
}, props))
|
|
26498
|
-
},
|
|
26499
|
-
|
|
26500
|
-
|
|
26570
|
+
}, components), {}, {
|
|
26571
|
+
Toolbar: ToolbarWrapper,
|
|
26572
|
+
Pagination: props => {
|
|
26501
26573
|
return pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
26502
26574
|
displaySelection: false,
|
|
26503
26575
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
26504
26576
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
26505
26577
|
selectionStatus: selectionStatus.current,
|
|
26506
|
-
|
|
26507
|
-
|
|
26508
|
-
|
|
26578
|
+
page: page,
|
|
26579
|
+
pageSize: pageSize,
|
|
26580
|
+
onPageChange: onPageChange,
|
|
26581
|
+
onPageSizeChange: onPageSizeChange,
|
|
26582
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26509
26583
|
paginationProps: paginationProps,
|
|
26510
26584
|
paginationMode: paginationMode,
|
|
26511
26585
|
rowCount: rowCount
|
|
@@ -26516,15 +26590,17 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26516
26590
|
selectionStatus: selectionStatus.current,
|
|
26517
26591
|
apiRef: apiRef,
|
|
26518
26592
|
isRowSelectable: isRowSelectable,
|
|
26519
|
-
|
|
26520
|
-
|
|
26521
|
-
|
|
26593
|
+
page: page,
|
|
26594
|
+
pageSize: pageSize,
|
|
26595
|
+
onPageChange: onPageChange,
|
|
26596
|
+
onPageSizeChange: onPageSizeChange,
|
|
26597
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26522
26598
|
paginationProps: paginationProps,
|
|
26523
26599
|
paginationMode: paginationMode
|
|
26524
26600
|
})) : null;
|
|
26525
26601
|
}
|
|
26526
26602
|
}),
|
|
26527
|
-
|
|
26603
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
26528
26604
|
toolbar: _objectSpread2({
|
|
26529
26605
|
hideToolbar,
|
|
26530
26606
|
RenderedToolbar,
|
|
@@ -26535,16 +26611,18 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26535
26611
|
selectionStatus,
|
|
26536
26612
|
apiRef,
|
|
26537
26613
|
isRowSelectable,
|
|
26538
|
-
|
|
26539
|
-
|
|
26540
|
-
|
|
26614
|
+
page,
|
|
26615
|
+
pageSize,
|
|
26616
|
+
onPageChange,
|
|
26617
|
+
onPageSizeChange,
|
|
26618
|
+
rowsPerPageOptions,
|
|
26541
26619
|
paginationProps,
|
|
26542
26620
|
paginationMode,
|
|
26543
26621
|
rowCount
|
|
26544
|
-
},
|
|
26622
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
26545
26623
|
}),
|
|
26546
|
-
|
|
26547
|
-
|
|
26624
|
+
selectionModel: selectionModel,
|
|
26625
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
26548
26626
|
if (pagination && paginationMode != 'server') {
|
|
26549
26627
|
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
26550
26628
|
let {
|
|
@@ -26602,7 +26680,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26602
26680
|
};
|
|
26603
26681
|
}
|
|
26604
26682
|
}
|
|
26605
|
-
|
|
26683
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
26606
26684
|
},
|
|
26607
26685
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
26608
26686
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -26676,5 +26754,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26676
26754
|
TextCell.className = CLASSNAME;
|
|
26677
26755
|
TextCell.displayName = COMPONENT_NAME;
|
|
26678
26756
|
|
|
26679
|
-
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,
|
|
26757
|
+
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 };
|
|
26680
26758
|
//# sourceMappingURL=index.js.map
|