@redsift/table 11.0.0-alpha.1 → 11.0.0-muiv5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +12 -15
- package/index.js +230 -189
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators,
|
|
2
|
-
export * from '@mui/x-data-grid-pro';
|
|
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, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
|
|
3
2
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import React__default, { Children, isValidElement, cloneElement, useLayoutEffect, useEffect, useRef, forwardRef, useContext, useState, useCallback, createElement, useMemo } from 'react';
|
|
@@ -17640,7 +17639,7 @@ const isBetweenOperator = {
|
|
|
17640
17639
|
label: 'is between',
|
|
17641
17640
|
value: 'isBetween',
|
|
17642
17641
|
getApplyFilterFn: filterItem => {
|
|
17643
|
-
if (!filterItem.
|
|
17642
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17644
17643
|
return null;
|
|
17645
17644
|
}
|
|
17646
17645
|
if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
|
|
@@ -17653,7 +17652,7 @@ const isBetweenOperator = {
|
|
|
17653
17652
|
return null;
|
|
17654
17653
|
}
|
|
17655
17654
|
return params => {
|
|
17656
|
-
return params.value !== null &&
|
|
17655
|
+
return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17657
17656
|
};
|
|
17658
17657
|
},
|
|
17659
17658
|
InputComponent: InputNumberInterval
|
|
@@ -17666,7 +17665,7 @@ const doesNotEqual = {
|
|
|
17666
17665
|
label: 'does not equal',
|
|
17667
17666
|
value: 'doesNotEqual',
|
|
17668
17667
|
getApplyFilterFn: filterItem => {
|
|
17669
|
-
if (!filterItem.
|
|
17668
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17670
17669
|
return null;
|
|
17671
17670
|
}
|
|
17672
17671
|
return params => {
|
|
@@ -17687,7 +17686,7 @@ const doesNotContain = {
|
|
|
17687
17686
|
label: 'does not contain',
|
|
17688
17687
|
value: 'doesNotContain',
|
|
17689
17688
|
getApplyFilterFn: filterItem => {
|
|
17690
|
-
if (!filterItem.
|
|
17689
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17691
17690
|
return null;
|
|
17692
17691
|
}
|
|
17693
17692
|
return params => {
|
|
@@ -17708,7 +17707,7 @@ const containsAnyOfOperator = {
|
|
|
17708
17707
|
label: 'contains any of',
|
|
17709
17708
|
value: 'containsAnyOf',
|
|
17710
17709
|
getApplyFilterFn: filterItem => {
|
|
17711
|
-
if (!filterItem.
|
|
17710
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17712
17711
|
return null;
|
|
17713
17712
|
}
|
|
17714
17713
|
return params => {
|
|
@@ -17731,7 +17730,7 @@ const containsAnyOfCIOperator = {
|
|
|
17731
17730
|
label: 'contains any of (case insensitive)',
|
|
17732
17731
|
value: 'containsAnyOf',
|
|
17733
17732
|
getApplyFilterFn: filterItem => {
|
|
17734
|
-
if (!filterItem.
|
|
17733
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17735
17734
|
return null;
|
|
17736
17735
|
}
|
|
17737
17736
|
return params => {
|
|
@@ -17758,7 +17757,7 @@ const endsWithAnyOfOperator = {
|
|
|
17758
17757
|
label: 'ends with any of',
|
|
17759
17758
|
value: 'endsWithAnyOf',
|
|
17760
17759
|
getApplyFilterFn: filterItem => {
|
|
17761
|
-
if (!filterItem.
|
|
17760
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17762
17761
|
return null;
|
|
17763
17762
|
}
|
|
17764
17763
|
return params => {
|
|
@@ -17785,7 +17784,7 @@ const isAnyOfOperator = {
|
|
|
17785
17784
|
label: 'is any of',
|
|
17786
17785
|
value: 'isAnyOf',
|
|
17787
17786
|
getApplyFilterFn: filterItem => {
|
|
17788
|
-
if (!filterItem.
|
|
17787
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17789
17788
|
return null;
|
|
17790
17789
|
}
|
|
17791
17790
|
return params => {
|
|
@@ -17809,7 +17808,7 @@ const isNotAnyOfOperator = {
|
|
|
17809
17808
|
label: 'is not any of',
|
|
17810
17809
|
value: 'isNotAnyOf',
|
|
17811
17810
|
getApplyFilterFn: filterItem => {
|
|
17812
|
-
if (!filterItem.
|
|
17811
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17813
17812
|
return null;
|
|
17814
17813
|
}
|
|
17815
17814
|
return params => {
|
|
@@ -17833,7 +17832,7 @@ const startsWithAnyOfOperator = {
|
|
|
17833
17832
|
label: 'starts with any of',
|
|
17834
17833
|
value: 'startsWithAnyOf',
|
|
17835
17834
|
getApplyFilterFn: filterItem => {
|
|
17836
|
-
if (!filterItem.
|
|
17835
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17837
17836
|
return null;
|
|
17838
17837
|
}
|
|
17839
17838
|
return params => {
|
|
@@ -17878,13 +17877,13 @@ const operatorList = {
|
|
|
17878
17877
|
|
|
17879
17878
|
const getRsStringColumnType = () => {
|
|
17880
17879
|
return {
|
|
17881
|
-
|
|
17880
|
+
extendType: 'string',
|
|
17882
17881
|
filterOperators: operatorList.rsString
|
|
17883
17882
|
};
|
|
17884
17883
|
};
|
|
17885
17884
|
const getRsNumberColumnType = () => {
|
|
17886
17885
|
return {
|
|
17887
|
-
|
|
17886
|
+
extendType: 'number',
|
|
17888
17887
|
filterOperators: operatorList.rsNumber
|
|
17889
17888
|
};
|
|
17890
17889
|
};
|
|
@@ -17895,7 +17894,7 @@ const customColumnTypes = {
|
|
|
17895
17894
|
|
|
17896
17895
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17897
17896
|
async function getCompletion(text, role, openai_api_key) {
|
|
17898
|
-
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';
|
|
17899
17898
|
try {
|
|
17900
17899
|
const messages = [{
|
|
17901
17900
|
role: 'system',
|
|
@@ -18064,39 +18063,42 @@ const numberOperatorDecoder = {
|
|
|
18064
18063
|
lt: '<',
|
|
18065
18064
|
lte: '<='
|
|
18066
18065
|
};
|
|
18067
|
-
const isOperatorValueValid = (
|
|
18068
|
-
const column = columns.find(column => column.field ===
|
|
18066
|
+
const isOperatorValueValid = (columnField, operatorValue, columns) => {
|
|
18067
|
+
const column = columns.find(column => column.field === columnField);
|
|
18069
18068
|
if (!column) {
|
|
18070
18069
|
return false;
|
|
18071
18070
|
}
|
|
18072
18071
|
const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
|
|
18073
|
-
const operators =
|
|
18072
|
+
const operators = operatorList[columnType];
|
|
18074
18073
|
if (!operators) {
|
|
18075
18074
|
return false;
|
|
18076
18075
|
}
|
|
18077
|
-
|
|
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);
|
|
18078
18080
|
};
|
|
18079
18081
|
const listOperators = ['containsAnyOf', 'endsWithAnyOf', 'isAnyOf', 'isNotAnyOf', 'startsWithAnyOf'];
|
|
18080
18082
|
|
|
18081
18083
|
// Check if the value doesn't break
|
|
18082
|
-
const isValueValid = (value,
|
|
18084
|
+
const isValueValid = (value, columnField, columns, operatorValue) => {
|
|
18083
18085
|
var _column$type;
|
|
18084
18086
|
// every field accepts undefined as value for default
|
|
18085
18087
|
if (value === undefined) {
|
|
18086
18088
|
return true;
|
|
18087
18089
|
}
|
|
18088
18090
|
|
|
18089
|
-
// xxxAnyOf accepts as value only lists, and we are
|
|
18091
|
+
// xxxAnyOf accepts as value only lists, and we are declearing them in the
|
|
18090
18092
|
// URL as `list=[...]`
|
|
18091
|
-
if (listOperators.includes(
|
|
18093
|
+
if (listOperators.includes(operatorValue)) {
|
|
18092
18094
|
return Array.isArray(value) || value === '';
|
|
18093
18095
|
}
|
|
18094
18096
|
|
|
18095
18097
|
// We are accepting arrays only if they are of the 'xxxAnyOf' type
|
|
18096
|
-
if (Array.isArray(value) && !listOperators.includes(
|
|
18098
|
+
if (Array.isArray(value) && !listOperators.includes(operatorValue)) {
|
|
18097
18099
|
return false;
|
|
18098
18100
|
}
|
|
18099
|
-
const column = columns.find(column => column.field ===
|
|
18101
|
+
const column = columns.find(column => column.field === columnField);
|
|
18100
18102
|
if (!column) {
|
|
18101
18103
|
return false;
|
|
18102
18104
|
}
|
|
@@ -18132,17 +18134,17 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18132
18134
|
if (!searchString) {
|
|
18133
18135
|
return {
|
|
18134
18136
|
items: [],
|
|
18135
|
-
|
|
18137
|
+
linkOperator: GridLinkOperator.And
|
|
18136
18138
|
};
|
|
18137
18139
|
}
|
|
18138
|
-
let
|
|
18140
|
+
let linkOperator = GridLinkOperator.And;
|
|
18139
18141
|
const searchParams = new URLSearchParams();
|
|
18140
18142
|
for (const [key, value] of new URLSearchParams(searchString)) {
|
|
18141
18143
|
if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility'].includes(key)) {
|
|
18142
18144
|
searchParams.set(key, value);
|
|
18143
18145
|
}
|
|
18144
18146
|
if (key === '_logicOperator') {
|
|
18145
|
-
|
|
18147
|
+
linkOperator = value;
|
|
18146
18148
|
}
|
|
18147
18149
|
}
|
|
18148
18150
|
let id = 5000;
|
|
@@ -18177,8 +18179,8 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18177
18179
|
return;
|
|
18178
18180
|
}
|
|
18179
18181
|
items.push({
|
|
18180
|
-
field,
|
|
18181
|
-
|
|
18182
|
+
columnField: field,
|
|
18183
|
+
operatorValue: ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
|
|
18182
18184
|
id,
|
|
18183
18185
|
value: listOperators.includes(operator) && decodedValue === '' ? [] : decodedValue
|
|
18184
18186
|
});
|
|
@@ -18190,27 +18192,27 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18190
18192
|
if (isInvalid) {
|
|
18191
18193
|
return {
|
|
18192
18194
|
items: [],
|
|
18193
|
-
|
|
18195
|
+
linkOperator: GridLinkOperator.And
|
|
18194
18196
|
};
|
|
18195
18197
|
}
|
|
18196
18198
|
return {
|
|
18197
18199
|
items,
|
|
18198
|
-
|
|
18200
|
+
linkOperator
|
|
18199
18201
|
};
|
|
18200
18202
|
};
|
|
18201
18203
|
const getSearchParamsFromFilterModel = filterModel => {
|
|
18202
18204
|
const searchParams = new URLSearchParams();
|
|
18203
|
-
searchParams.set('_logicOperator', filterModel['
|
|
18205
|
+
searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
|
|
18204
18206
|
filterModel['items'].forEach(item => {
|
|
18205
18207
|
const {
|
|
18206
|
-
|
|
18207
|
-
|
|
18208
|
+
columnField,
|
|
18209
|
+
operatorValue,
|
|
18208
18210
|
value
|
|
18209
18211
|
} = item;
|
|
18210
|
-
if (Object.keys(numberOperatorEncoder).includes(
|
|
18211
|
-
searchParams.set(`_${
|
|
18212
|
+
if (Object.keys(numberOperatorEncoder).includes(operatorValue)) {
|
|
18213
|
+
searchParams.set(`_${columnField}[${numberOperatorEncoder[operatorValue]}]`, encodeValue(value));
|
|
18212
18214
|
} else {
|
|
18213
|
-
searchParams.set(`_${
|
|
18215
|
+
searchParams.set(`_${columnField}[${encodeValue(operatorValue)}]`, encodeValue(value));
|
|
18214
18216
|
}
|
|
18215
18217
|
});
|
|
18216
18218
|
return searchParams;
|
|
@@ -18236,7 +18238,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18236
18238
|
}
|
|
18237
18239
|
return {
|
|
18238
18240
|
items: [],
|
|
18239
|
-
|
|
18241
|
+
linkOperator: GridLinkOperator.And
|
|
18240
18242
|
};
|
|
18241
18243
|
};
|
|
18242
18244
|
const getSortingFromString = (notParsed, columns) => {
|
|
@@ -18259,9 +18261,9 @@ const getSortingFromString = (notParsed, columns) => {
|
|
|
18259
18261
|
if (value === '') {
|
|
18260
18262
|
return [];
|
|
18261
18263
|
}
|
|
18262
|
-
const
|
|
18264
|
+
const columnFields = columns.map(column => column.field);
|
|
18263
18265
|
const [column, order] = value.split(',');
|
|
18264
|
-
if (
|
|
18266
|
+
if (columnFields.includes(column) && (order === 'asc' || order === 'desc')) {
|
|
18265
18267
|
return [{
|
|
18266
18268
|
field: column,
|
|
18267
18269
|
sort: order
|
|
@@ -18300,11 +18302,11 @@ const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorti
|
|
|
18300
18302
|
};
|
|
18301
18303
|
const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
18302
18304
|
const searchParams = new URLSearchParams();
|
|
18303
|
-
const
|
|
18305
|
+
const columnFields = columns.map(column => column.field);
|
|
18304
18306
|
|
|
18305
18307
|
// if column visibility model is empty, show all columns
|
|
18306
18308
|
if (Object.keys(columnVisibility).length == 0) {
|
|
18307
|
-
searchParams.set('_columnVisibility', `[${
|
|
18309
|
+
searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
|
|
18308
18310
|
return searchParams;
|
|
18309
18311
|
}
|
|
18310
18312
|
const finalColumnVisibility = columns.filter(c => {
|
|
@@ -18354,12 +18356,12 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
|
18354
18356
|
continue;
|
|
18355
18357
|
}
|
|
18356
18358
|
exist = true;
|
|
18357
|
-
const
|
|
18359
|
+
const columnFields = tableColumns.map(column => column.field);
|
|
18358
18360
|
// TODO: Add validation that , is present
|
|
18359
18361
|
const columns = encodedValues.split(',').map(value => decodeValue(value));
|
|
18360
18362
|
|
|
18361
18363
|
// for each column, check if it's visible and add it to visibility model
|
|
18362
|
-
for (const column of
|
|
18364
|
+
for (const column of columnFields) {
|
|
18363
18365
|
const isColumnVisible = columns.includes(column);
|
|
18364
18366
|
visibility[column] = isColumnVisible;
|
|
18365
18367
|
if (isColumnVisible) {
|
|
@@ -18422,8 +18424,8 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
|
18422
18424
|
if (typeof encodedValues !== 'string') {
|
|
18423
18425
|
continue;
|
|
18424
18426
|
}
|
|
18425
|
-
const
|
|
18426
|
-
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' &&
|
|
18427
|
+
const columnFields = [...tableColumns.map(column => column.field), '__check__'];
|
|
18428
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && columnFields.includes(val));
|
|
18427
18429
|
if (fieldURL === '_pinnedColumnsLeft') {
|
|
18428
18430
|
pinnedColumns['left'] = columns;
|
|
18429
18431
|
}
|
|
@@ -18564,17 +18566,17 @@ const updateUrl = (_ref4, search, historyReplace, columns) => {
|
|
|
18564
18566
|
// do not use it for equivalence (e.g. with value `3` and undefined we
|
|
18565
18567
|
// will get 0).
|
|
18566
18568
|
const compareFilters = (firstFilter, secondFilter) => {
|
|
18567
|
-
if (firstFilter.
|
|
18569
|
+
if (firstFilter.columnField < secondFilter.columnField) {
|
|
18568
18570
|
return -1;
|
|
18569
|
-
} else if (firstFilter.
|
|
18571
|
+
} else if (firstFilter.columnField > secondFilter.columnField) {
|
|
18570
18572
|
return 1;
|
|
18571
18573
|
}
|
|
18572
|
-
if (firstFilter.
|
|
18574
|
+
if (firstFilter.operatorValue === undefined || secondFilter.operatorValue === undefined) {
|
|
18573
18575
|
return 0;
|
|
18574
18576
|
}
|
|
18575
|
-
if (firstFilter.
|
|
18577
|
+
if (firstFilter.operatorValue < secondFilter.operatorValue) {
|
|
18576
18578
|
return -1;
|
|
18577
|
-
} else if (firstFilter.
|
|
18579
|
+
} else if (firstFilter.operatorValue > secondFilter.operatorValue) {
|
|
18578
18580
|
return 1;
|
|
18579
18581
|
}
|
|
18580
18582
|
if (firstFilter.value < secondFilter.value) {
|
|
@@ -18585,18 +18587,18 @@ const compareFilters = (firstFilter, secondFilter) => {
|
|
|
18585
18587
|
return 0;
|
|
18586
18588
|
};
|
|
18587
18589
|
const areFiltersEquivalent = (firstFilter, secondFilter) => {
|
|
18588
|
-
return firstFilter.
|
|
18590
|
+
return firstFilter.columnField === secondFilter.columnField && firstFilter.operatorValue === secondFilter.operatorValue && firstFilter.value === secondFilter.value;
|
|
18589
18591
|
};
|
|
18590
18592
|
const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
18591
18593
|
const {
|
|
18592
18594
|
items,
|
|
18593
|
-
|
|
18595
|
+
linkOperator
|
|
18594
18596
|
} = filterModel;
|
|
18595
18597
|
const {
|
|
18596
18598
|
items: itemsToMatch,
|
|
18597
|
-
|
|
18599
|
+
linkOperator: linkOperatorToMatch
|
|
18598
18600
|
} = filterModelToMatch;
|
|
18599
|
-
if (
|
|
18601
|
+
if (linkOperator !== linkOperatorToMatch) {
|
|
18600
18602
|
return false;
|
|
18601
18603
|
}
|
|
18602
18604
|
if (items.length !== itemsToMatch.length) {
|
|
@@ -18609,7 +18611,7 @@ const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
|
18609
18611
|
const filterToCompare = itemsToMatch[i];
|
|
18610
18612
|
|
|
18611
18613
|
// compareFilters return 0 if and only if the filters have the same
|
|
18612
|
-
//
|
|
18614
|
+
// columnField, operatorValue, and value
|
|
18613
18615
|
if (!areFiltersEquivalent(filter, filterToCompare)) {
|
|
18614
18616
|
return false;
|
|
18615
18617
|
}
|
|
@@ -22720,16 +22722,16 @@ const getRole = (config, dateFormat) => {
|
|
|
22720
22722
|
}).join('\n');
|
|
22721
22723
|
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.
|
|
22722
22724
|
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.
|
|
22723
|
-
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "
|
|
22724
|
-
- "
|
|
22725
|
-
- "items": a list of conditions, each is an object with exactly the three keys "
|
|
22726
|
-
- "
|
|
22725
|
+
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
|
|
22726
|
+
- "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
|
|
22727
|
+
- "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
|
|
22728
|
+
- "columnField": the column name, must be one of ${columns}
|
|
22727
22729
|
- "value":
|
|
22728
|
-
- this can be skipped if the "
|
|
22729
|
-
- a list of multiple values if the "
|
|
22730
|
+
- this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
|
|
22731
|
+
- a list of multiple values if the "operatorValue" ends with "AnyOf"
|
|
22730
22732
|
- otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
|
|
22731
22733
|
For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
|
|
22732
|
-
- "
|
|
22734
|
+
- "operatorValue": the comparison operator, accepted values depend on the data type of the column
|
|
22733
22735
|
${operators}
|
|
22734
22736
|
|
|
22735
22737
|
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:
|
|
@@ -22766,10 +22768,10 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22766
22768
|
nlpFilterConfig,
|
|
22767
22769
|
onFilterModelChange,
|
|
22768
22770
|
dateFormat = 'yyyy-mm-dd',
|
|
22769
|
-
defaultModel = 'gpt-4-
|
|
22771
|
+
defaultModel = 'gpt-4-0613',
|
|
22770
22772
|
defaultFilter = {
|
|
22771
22773
|
items: [],
|
|
22772
|
-
|
|
22774
|
+
linkOperator: 'and'
|
|
22773
22775
|
},
|
|
22774
22776
|
disablePower = false,
|
|
22775
22777
|
localeText
|
|
@@ -22847,7 +22849,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22847
22849
|
value: prompt
|
|
22848
22850
|
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
22849
22851
|
variant: "primary",
|
|
22850
|
-
"
|
|
22852
|
+
"aira-label": buttonAriaLabel,
|
|
22851
22853
|
type: "submit",
|
|
22852
22854
|
isLoading: isLoading
|
|
22853
22855
|
}, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
|
|
@@ -22908,7 +22910,7 @@ const Toolbar$2 = props => {
|
|
|
22908
22910
|
let {
|
|
22909
22911
|
apiRef
|
|
22910
22912
|
} = _ref;
|
|
22911
|
-
return
|
|
22913
|
+
return gridVisibleSortedRowIdsSelector(apiRef);
|
|
22912
22914
|
}
|
|
22913
22915
|
},
|
|
22914
22916
|
printOptions: {
|
|
@@ -25365,10 +25367,12 @@ const ServerSideControlledPagination = _ref => {
|
|
|
25365
25367
|
selectionStatus,
|
|
25366
25368
|
displaySelection,
|
|
25367
25369
|
displayPagination,
|
|
25368
|
-
|
|
25369
|
-
|
|
25370
|
-
|
|
25370
|
+
page,
|
|
25371
|
+
onPageChange,
|
|
25372
|
+
pageSize,
|
|
25373
|
+
onPageSizeChange,
|
|
25371
25374
|
displayRowsPerPage,
|
|
25375
|
+
rowsPerPageOptions,
|
|
25372
25376
|
paginationProps,
|
|
25373
25377
|
rowCount
|
|
25374
25378
|
} = _ref;
|
|
@@ -25387,17 +25391,13 @@ const ServerSideControlledPagination = _ref => {
|
|
|
25387
25391
|
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
25388
25392
|
component: "div",
|
|
25389
25393
|
count: totalNumberOfRowsInTable,
|
|
25390
|
-
page:
|
|
25391
|
-
onPageChange: (event,
|
|
25392
|
-
|
|
25393
|
-
|
|
25394
|
-
|
|
25395
|
-
|
|
25396
|
-
|
|
25397
|
-
page: paginationModel.page,
|
|
25398
|
-
pageSize: parseInt(event.target.value, 10)
|
|
25399
|
-
}),
|
|
25400
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
25394
|
+
page: page,
|
|
25395
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
25396
|
+
rowsPerPage: pageSize,
|
|
25397
|
+
onRowsPerPageChange: event => {
|
|
25398
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
25399
|
+
},
|
|
25400
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
25401
25401
|
}, paginationProps)) : null);
|
|
25402
25402
|
};
|
|
25403
25403
|
|
|
@@ -25423,9 +25423,11 @@ const ControlledPagination = _ref3 => {
|
|
|
25423
25423
|
displayPagination = false,
|
|
25424
25424
|
selectionStatus,
|
|
25425
25425
|
apiRef,
|
|
25426
|
-
|
|
25427
|
-
|
|
25428
|
-
|
|
25426
|
+
page,
|
|
25427
|
+
onPageChange,
|
|
25428
|
+
pageSize,
|
|
25429
|
+
onPageSizeChange,
|
|
25430
|
+
rowsPerPageOptions,
|
|
25429
25431
|
isRowSelectable,
|
|
25430
25432
|
paginationProps
|
|
25431
25433
|
} = _ref3;
|
|
@@ -25455,21 +25457,17 @@ const ControlledPagination = _ref3 => {
|
|
|
25455
25457
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
25456
25458
|
component: "div",
|
|
25457
25459
|
count: numberOfFilteredRowsInTable,
|
|
25458
|
-
page:
|
|
25459
|
-
onPageChange: (event,
|
|
25460
|
-
|
|
25461
|
-
|
|
25462
|
-
|
|
25463
|
-
|
|
25464
|
-
|
|
25465
|
-
page: paginationModel.page,
|
|
25466
|
-
pageSize: parseInt(event.target.value, 10)
|
|
25467
|
-
}),
|
|
25468
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
25460
|
+
page: page,
|
|
25461
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
25462
|
+
rowsPerPage: pageSize,
|
|
25463
|
+
onRowsPerPageChange: event => {
|
|
25464
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
25465
|
+
},
|
|
25466
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
25469
25467
|
}, paginationProps)) : null);
|
|
25470
25468
|
};
|
|
25471
25469
|
|
|
25472
|
-
const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "
|
|
25470
|
+
const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
25473
25471
|
const ToolbarWrapper = _ref => {
|
|
25474
25472
|
let {
|
|
25475
25473
|
hideToolbar,
|
|
@@ -25481,9 +25479,11 @@ const ToolbarWrapper = _ref => {
|
|
|
25481
25479
|
selectionStatus,
|
|
25482
25480
|
apiRef,
|
|
25483
25481
|
isRowSelectable,
|
|
25484
|
-
|
|
25485
|
-
|
|
25486
|
-
|
|
25482
|
+
page,
|
|
25483
|
+
onPageChange,
|
|
25484
|
+
pageSize,
|
|
25485
|
+
onPageSizeChange,
|
|
25486
|
+
rowsPerPageOptions,
|
|
25487
25487
|
paginationProps,
|
|
25488
25488
|
paginationMode = 'client',
|
|
25489
25489
|
rowCount
|
|
@@ -25497,9 +25497,11 @@ const ToolbarWrapper = _ref => {
|
|
|
25497
25497
|
displayRowsPerPage: false,
|
|
25498
25498
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
25499
25499
|
selectionStatus: selectionStatus.current,
|
|
25500
|
-
|
|
25501
|
-
|
|
25502
|
-
|
|
25500
|
+
page: page,
|
|
25501
|
+
onPageChange: onPageChange,
|
|
25502
|
+
pageSize: pageSize,
|
|
25503
|
+
onPageSizeChange: onPageSizeChange,
|
|
25504
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25503
25505
|
paginationProps: paginationProps,
|
|
25504
25506
|
rowCount: rowCount
|
|
25505
25507
|
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
@@ -25509,9 +25511,11 @@ const ToolbarWrapper = _ref => {
|
|
|
25509
25511
|
selectionStatus: selectionStatus.current,
|
|
25510
25512
|
apiRef: apiRef,
|
|
25511
25513
|
isRowSelectable: isRowSelectable,
|
|
25512
|
-
|
|
25513
|
-
|
|
25514
|
-
|
|
25514
|
+
page: page,
|
|
25515
|
+
onPageChange: onPageChange,
|
|
25516
|
+
pageSize: pageSize,
|
|
25517
|
+
onPageSizeChange: onPageSizeChange,
|
|
25518
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
25515
25519
|
paginationProps: paginationProps
|
|
25516
25520
|
}) : null);
|
|
25517
25521
|
};
|
|
@@ -25625,7 +25629,8 @@ const useStatefulTable = props => {
|
|
|
25625
25629
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25626
25630
|
onColumnWidthChange: propsOnColumnWidthChange,
|
|
25627
25631
|
onFilterModelChange: propsOnFilterModelChange,
|
|
25628
|
-
|
|
25632
|
+
onPageChange: propsOnPageChange,
|
|
25633
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
25629
25634
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25630
25635
|
onSortModelChange: propsOnSortModelChange,
|
|
25631
25636
|
pinnedCustomColumns = {
|
|
@@ -25726,10 +25731,21 @@ const useStatefulTable = props => {
|
|
|
25726
25731
|
}, search, historyReplace, columns);
|
|
25727
25732
|
},
|
|
25728
25733
|
pinnedColumns: pinnedColumnsModel,
|
|
25729
|
-
paginationModel,
|
|
25730
|
-
|
|
25731
|
-
|
|
25732
|
-
|
|
25734
|
+
page: paginationModel.page,
|
|
25735
|
+
pageSize: paginationModel.pageSize,
|
|
25736
|
+
onPageChange: (page, details) => {
|
|
25737
|
+
propsOnPageChange === null || propsOnPageChange === void 0 ? void 0 : propsOnPageChange(page, details);
|
|
25738
|
+
setPaginationModel({
|
|
25739
|
+
page,
|
|
25740
|
+
pageSize: paginationModel.pageSize
|
|
25741
|
+
});
|
|
25742
|
+
},
|
|
25743
|
+
onPageSizeChange: (pageSize, details) => {
|
|
25744
|
+
propsOnPageSizeChange === null || propsOnPageSizeChange === void 0 ? void 0 : propsOnPageSizeChange(pageSize, details);
|
|
25745
|
+
setPaginationModel({
|
|
25746
|
+
page: paginationModel.page,
|
|
25747
|
+
pageSize
|
|
25748
|
+
});
|
|
25733
25749
|
},
|
|
25734
25750
|
columnVisibilityModel: visibilityModel,
|
|
25735
25751
|
onColumnVisibilityModelChange: (columnsVisibilityModel, details) => {
|
|
@@ -25751,8 +25767,8 @@ const useStatefulTable = props => {
|
|
|
25751
25767
|
};
|
|
25752
25768
|
};
|
|
25753
25769
|
|
|
25754
|
-
const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "
|
|
25755
|
-
_excluded2 = ["apiRef", "autoHeight", "className", "
|
|
25770
|
+
const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onPinnedColumnsChange", "onSortModelChange", "pinnedCustomColumns", "rows", "useRouter"],
|
|
25771
|
+
_excluded2 = ["apiRef", "autoHeight", "className", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "isStateful", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "selectionModel", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "rowsPerPageOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
25756
25772
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
25757
25773
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
25758
25774
|
const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
|
|
@@ -25818,7 +25834,8 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25818
25834
|
onColumnVisibilityModelChange,
|
|
25819
25835
|
onColumnWidthChange,
|
|
25820
25836
|
onFilterModelChange,
|
|
25821
|
-
|
|
25837
|
+
onPageChange,
|
|
25838
|
+
onPageSizeChange,
|
|
25822
25839
|
onPinnedColumnsChange,
|
|
25823
25840
|
onSortModelChange,
|
|
25824
25841
|
pinnedCustomColumns,
|
|
@@ -25832,7 +25849,8 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25832
25849
|
onFilterModelChange,
|
|
25833
25850
|
onPinnedColumnsChange,
|
|
25834
25851
|
onSortModelChange,
|
|
25835
|
-
|
|
25852
|
+
onPageChange,
|
|
25853
|
+
onPageSizeChange,
|
|
25836
25854
|
onColumnVisibilityModelChange,
|
|
25837
25855
|
onColumnWidthChange,
|
|
25838
25856
|
pinnedCustomColumns,
|
|
@@ -25844,14 +25862,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25844
25862
|
}, forwardedProps, statefulTableProps));
|
|
25845
25863
|
});
|
|
25846
25864
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25847
|
-
var
|
|
25865
|
+
var _initialState$paginat, _initialState$paginat2;
|
|
25848
25866
|
const datagridRef = ref || useRef();
|
|
25849
25867
|
const {
|
|
25850
25868
|
apiRef: propsApiRef,
|
|
25851
25869
|
autoHeight,
|
|
25852
25870
|
className,
|
|
25853
|
-
|
|
25854
|
-
|
|
25871
|
+
columnTypes: propsColumnTypes,
|
|
25872
|
+
components,
|
|
25873
|
+
componentsProps,
|
|
25855
25874
|
filterModel: propsFilterModel,
|
|
25856
25875
|
columnVisibilityModel: propsColumnVisibilityModel,
|
|
25857
25876
|
pinnedColumns: propsPinnedColumns,
|
|
@@ -25863,19 +25882,21 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25863
25882
|
isStateful: propsIsStateful,
|
|
25864
25883
|
license = process.env.MUI_LICENSE_KEY,
|
|
25865
25884
|
onFilterModelChange: propsOnFilterModelChange,
|
|
25866
|
-
|
|
25867
|
-
|
|
25868
|
-
onPaginationModelChange: propsOnPaginationModelChange,
|
|
25869
|
-
onRowSelectionModelChange,
|
|
25885
|
+
onPageChange: propsOnPageChange,
|
|
25886
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
25870
25887
|
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25871
25888
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25872
25889
|
onSortModelChange: propsOnSortModelChange,
|
|
25890
|
+
selectionModel: propsSelectionModel,
|
|
25891
|
+
onSelectionModelChange,
|
|
25892
|
+
page: propsPage,
|
|
25893
|
+
pageSize: propsPageSize,
|
|
25873
25894
|
pagination,
|
|
25874
25895
|
paginationPlacement = 'both',
|
|
25875
25896
|
paginationProps,
|
|
25876
25897
|
pinnedCustomColumns,
|
|
25877
25898
|
rows,
|
|
25878
|
-
|
|
25899
|
+
rowsPerPageOptions,
|
|
25879
25900
|
sx,
|
|
25880
25901
|
theme: propsTheme,
|
|
25881
25902
|
useRouter,
|
|
@@ -25886,7 +25907,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25886
25907
|
const theme = useTheme$4(propsTheme);
|
|
25887
25908
|
const _apiRef = useGridApiRef();
|
|
25888
25909
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
25889
|
-
const RenderedToolbar =
|
|
25910
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
25890
25911
|
LicenseInfo.setLicenseKey(license);
|
|
25891
25912
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
25892
25913
|
const [filterModel, setFilterModel] = useState(propsFilterModel);
|
|
@@ -25933,41 +25954,52 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25933
25954
|
setSortModel(model);
|
|
25934
25955
|
}
|
|
25935
25956
|
};
|
|
25936
|
-
const [
|
|
25957
|
+
const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25937
25958
|
useEffect(() => {
|
|
25938
|
-
|
|
25959
|
+
setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25939
25960
|
}, [propsSelectionModel]);
|
|
25940
|
-
const [
|
|
25941
|
-
|
|
25942
|
-
|
|
25961
|
+
const [page, setPage] = React__default.useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : _initialState$paginat.page) || propsPage || 0);
|
|
25962
|
+
const [pageSize, setPageSize] = React__default.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]) || 100);
|
|
25963
|
+
const selectionStatus = useRef({
|
|
25964
|
+
type: 'none',
|
|
25965
|
+
numberOfSelectedRows: 0,
|
|
25966
|
+
numberOfSelectedRowsInPage: 0,
|
|
25967
|
+
page,
|
|
25968
|
+
pageSize
|
|
25943
25969
|
});
|
|
25944
|
-
const
|
|
25945
|
-
if (
|
|
25946
|
-
|
|
25970
|
+
const onPageChange = page => {
|
|
25971
|
+
if (propsOnPageChange) {
|
|
25972
|
+
propsOnPageChange(page, undefined);
|
|
25947
25973
|
} else {
|
|
25948
|
-
|
|
25974
|
+
setPage(page);
|
|
25949
25975
|
}
|
|
25950
25976
|
};
|
|
25951
25977
|
useEffect(() => {
|
|
25952
|
-
if (
|
|
25953
|
-
|
|
25978
|
+
if (propsPage || propsPage === 0) {
|
|
25979
|
+
setPage(propsPage);
|
|
25980
|
+
}
|
|
25981
|
+
}, [propsPage]);
|
|
25982
|
+
const onPageSizeChange = pageSize => {
|
|
25983
|
+
onPageChange(0);
|
|
25984
|
+
if (propsOnPageSizeChange) {
|
|
25985
|
+
propsOnPageSizeChange(pageSize, undefined);
|
|
25986
|
+
} else {
|
|
25987
|
+
setPageSize(pageSize);
|
|
25954
25988
|
}
|
|
25955
|
-
}
|
|
25956
|
-
|
|
25957
|
-
|
|
25958
|
-
|
|
25959
|
-
|
|
25960
|
-
|
|
25961
|
-
pageSize: paginationModel.pageSize
|
|
25962
|
-
});
|
|
25989
|
+
};
|
|
25990
|
+
useEffect(() => {
|
|
25991
|
+
if (propsPageSize) {
|
|
25992
|
+
setPageSize(propsPageSize);
|
|
25993
|
+
}
|
|
25994
|
+
}, [propsPageSize]);
|
|
25963
25995
|
|
|
25964
25996
|
// in server-side pagination we want to update the selection status
|
|
25965
25997
|
// every time we navigate between pages, resize our page or select something
|
|
25966
25998
|
useEffect(() => {
|
|
25967
25999
|
if (paginationMode == 'server') {
|
|
25968
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
26000
|
+
onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
|
|
25969
26001
|
}
|
|
25970
|
-
}, [
|
|
26002
|
+
}, [selectionModel, page, pageSize]);
|
|
25971
26003
|
if (!Array.isArray(rows)) {
|
|
25972
26004
|
return null;
|
|
25973
26005
|
}
|
|
@@ -26003,54 +26035,57 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26003
26035
|
apiRef: apiRef,
|
|
26004
26036
|
autoHeight: autoHeight,
|
|
26005
26037
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
26006
|
-
|
|
26007
|
-
|
|
26008
|
-
|
|
26009
|
-
|
|
26010
|
-
|
|
26011
|
-
|
|
26038
|
+
columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
|
|
26039
|
+
components: _objectSpread2(_objectSpread2({
|
|
26040
|
+
BaseButton,
|
|
26041
|
+
BaseCheckbox,
|
|
26042
|
+
// BaseTextField,
|
|
26043
|
+
BasePopper,
|
|
26044
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26012
26045
|
displayName: "ColumnFilteredIcon"
|
|
26013
26046
|
})),
|
|
26014
|
-
|
|
26047
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26015
26048
|
displayName: "ColumnSelectorIcon"
|
|
26016
26049
|
})),
|
|
26017
|
-
|
|
26050
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26018
26051
|
displayName: "ColumnSortedAscendingIcon"
|
|
26019
26052
|
})),
|
|
26020
|
-
|
|
26053
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26021
26054
|
displayName: "ColumnSortedDescendingIcon"
|
|
26022
26055
|
})),
|
|
26023
|
-
|
|
26056
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26024
26057
|
displayName: "DensityCompactIcon"
|
|
26025
26058
|
})),
|
|
26026
|
-
|
|
26059
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26027
26060
|
displayName: "DensityStandardIcon"
|
|
26028
26061
|
})),
|
|
26029
|
-
|
|
26062
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26030
26063
|
displayName: "DensityComfortableIcon"
|
|
26031
26064
|
})),
|
|
26032
|
-
|
|
26065
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26033
26066
|
displayName: "DetailPanelCollapseIcon"
|
|
26034
26067
|
})),
|
|
26035
|
-
|
|
26068
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26036
26069
|
displayName: "DetailPanelExpandIcon"
|
|
26037
26070
|
})),
|
|
26038
|
-
|
|
26071
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
26039
26072
|
displayName: "ExportIcon"
|
|
26040
26073
|
})),
|
|
26041
|
-
|
|
26074
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
26042
26075
|
displayName: "OpenFilterButtonIcon"
|
|
26043
26076
|
}, props))
|
|
26044
|
-
},
|
|
26045
|
-
|
|
26046
|
-
|
|
26077
|
+
}, components), {}, {
|
|
26078
|
+
Toolbar: ToolbarWrapper,
|
|
26079
|
+
Pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
26047
26080
|
displaySelection: false,
|
|
26048
26081
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
26049
26082
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
26050
26083
|
selectionStatus: selectionStatus.current,
|
|
26051
|
-
|
|
26052
|
-
|
|
26053
|
-
|
|
26084
|
+
page: page,
|
|
26085
|
+
onPageChange: onPageChange,
|
|
26086
|
+
pageSize: pageSize,
|
|
26087
|
+
onPageSizeChange: onPageSizeChange,
|
|
26088
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26054
26089
|
paginationProps: paginationProps,
|
|
26055
26090
|
paginationMode: paginationMode,
|
|
26056
26091
|
rowCount: rowCount
|
|
@@ -26061,14 +26096,16 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26061
26096
|
selectionStatus: selectionStatus.current,
|
|
26062
26097
|
apiRef: apiRef,
|
|
26063
26098
|
isRowSelectable: isRowSelectable,
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
|
|
26099
|
+
page: page,
|
|
26100
|
+
onPageChange: onPageChange,
|
|
26101
|
+
pageSize: pageSize,
|
|
26102
|
+
onPageSizeChange: onPageSizeChange,
|
|
26103
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26067
26104
|
paginationProps: paginationProps,
|
|
26068
26105
|
paginationMode: paginationMode
|
|
26069
26106
|
})) : null
|
|
26070
26107
|
}),
|
|
26071
|
-
|
|
26108
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
26072
26109
|
toolbar: _objectSpread2({
|
|
26073
26110
|
hideToolbar,
|
|
26074
26111
|
RenderedToolbar,
|
|
@@ -26079,13 +26116,15 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26079
26116
|
selectionStatus,
|
|
26080
26117
|
apiRef,
|
|
26081
26118
|
isRowSelectable,
|
|
26082
|
-
|
|
26083
|
-
|
|
26084
|
-
|
|
26119
|
+
page,
|
|
26120
|
+
onPageChange,
|
|
26121
|
+
pageSize,
|
|
26122
|
+
onPageSizeChange,
|
|
26123
|
+
rowsPerPageOptions,
|
|
26085
26124
|
paginationProps,
|
|
26086
26125
|
paginationMode,
|
|
26087
26126
|
rowCount
|
|
26088
|
-
},
|
|
26127
|
+
}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
26089
26128
|
}),
|
|
26090
26129
|
filterModel: filterModel,
|
|
26091
26130
|
columnVisibilityModel: columnVisibilityModel,
|
|
@@ -26103,37 +26142,39 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26103
26142
|
paginationMode: paginationMode,
|
|
26104
26143
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
26105
26144
|
rows: rows,
|
|
26106
|
-
|
|
26107
|
-
|
|
26108
|
-
|
|
26109
|
-
|
|
26110
|
-
|
|
26145
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
26146
|
+
page: page,
|
|
26147
|
+
onPageChange: onPageChange,
|
|
26148
|
+
pageSize: pageSize,
|
|
26149
|
+
onPageSizeChange: onPageSizeChange,
|
|
26150
|
+
selectionModel: selectionModel,
|
|
26151
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
26111
26152
|
if (pagination && paginationMode != 'server') {
|
|
26112
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
26153
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref3 => {
|
|
26113
26154
|
let {
|
|
26114
26155
|
model
|
|
26115
|
-
} =
|
|
26156
|
+
} = _ref3;
|
|
26116
26157
|
return isRowSelectable({
|
|
26117
26158
|
row: model
|
|
26118
26159
|
});
|
|
26119
|
-
}).map(
|
|
26160
|
+
}).map(_ref4 => {
|
|
26120
26161
|
let {
|
|
26121
26162
|
id
|
|
26122
|
-
} =
|
|
26163
|
+
} = _ref4;
|
|
26123
26164
|
return id;
|
|
26124
26165
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
26125
26166
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
26126
|
-
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
26167
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref5 => {
|
|
26127
26168
|
let {
|
|
26128
26169
|
model
|
|
26129
|
-
} =
|
|
26170
|
+
} = _ref5;
|
|
26130
26171
|
return isRowSelectable({
|
|
26131
26172
|
row: model
|
|
26132
26173
|
});
|
|
26133
|
-
}).map(
|
|
26174
|
+
}).map(_ref6 => {
|
|
26134
26175
|
let {
|
|
26135
26176
|
id
|
|
26136
|
-
} =
|
|
26177
|
+
} = _ref6;
|
|
26137
26178
|
return id;
|
|
26138
26179
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
26139
26180
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -26165,7 +26206,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26165
26206
|
};
|
|
26166
26207
|
}
|
|
26167
26208
|
}
|
|
26168
|
-
|
|
26209
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
26169
26210
|
},
|
|
26170
26211
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
26171
26212
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -26239,5 +26280,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26239
26280
|
TextCell.className = CLASSNAME;
|
|
26240
26281
|
TextCell.displayName = COMPONENT_NAME;
|
|
26241
26282
|
|
|
26242
|
-
export { CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, 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, TextCell, Toolbar$2 as Toolbar, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString,
|
|
26283
|
+
export { CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, 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, TextCell, Toolbar$2 as Toolbar, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, numberOperatorDecoder, numberOperatorEncoder, operatorList, updateUrl, urlSearchParamsToString };
|
|
26243
26284
|
//# sourceMappingURL=index.js.map
|