@linzjs/step-ag-grid 29.1.1 → 29.1.3
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/dist/src/components/Grid.d.ts +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +2 -1
- package/dist/src/contexts/GridContext.d.ts +2 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/utils/waitForCondition.d.ts +1 -0
- package/dist/step-ag-grid.cjs +89 -65
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +88 -66
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +1 -1
- package/src/components/GridCell.tsx +34 -14
- package/src/components/GridPopoverHook.tsx +16 -17
- package/src/components/gridForm/GridFormDropDown.tsx +10 -3
- package/src/components/gridForm/GridFormMultiSelect.tsx +12 -4
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +1 -0
- package/src/contexts/GridContext.tsx +2 -2
- package/src/contexts/GridContextProvider.tsx +41 -37
- package/src/index.ts +1 -0
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +1 -1
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +1 -1
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +1 -1
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +4 -12
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +5 -11
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +4 -11
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +8 -10
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +5 -11
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +5 -12
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +4 -11
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +4 -11
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +56 -13
- package/src/utils/waitForCondition.tsx +17 -0
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -3398,20 +3398,25 @@ const GridCell = (props, custom) => {
|
|
|
3398
3398
|
sortable: true,
|
|
3399
3399
|
resizable: true,
|
|
3400
3400
|
valueSetter: custom?.editor ? blockValueSetter : undefined,
|
|
3401
|
-
editable: props.editable ??
|
|
3402
|
-
...(custom?.editor
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3401
|
+
editable: props.editable ?? !!custom?.editor,
|
|
3402
|
+
...(custom?.editor
|
|
3403
|
+
? {
|
|
3404
|
+
cellClassRules: GridCellMultiSelectClassRules,
|
|
3405
|
+
cellEditor: GenericCellEditorComponentWrapper(custom?.editor),
|
|
3406
|
+
}
|
|
3407
|
+
: {
|
|
3408
|
+
cellEditor: CellEditorToBlockEditing,
|
|
3409
|
+
}),
|
|
3407
3410
|
suppressKeyboardEvent: suppressCellKeyboardEvents,
|
|
3408
|
-
...(custom?.editorParams
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3411
|
+
...(custom?.editorParams
|
|
3412
|
+
? {
|
|
3413
|
+
cellEditorParams: {
|
|
3414
|
+
...custom.editorParams,
|
|
3415
|
+
multiEdit: custom.multiEdit,
|
|
3416
|
+
preventAutoEdit: custom.preventAutoEdit ?? !custom?.editor,
|
|
3417
|
+
},
|
|
3418
|
+
}
|
|
3419
|
+
: { cellEditorParams: { preventAutoEdit: !custom?.editor } }),
|
|
3415
3420
|
// If there's a valueFormatter and no filterValueGetter then create a filterValueGetter
|
|
3416
3421
|
getQuickFilterText: filterValueGetter,
|
|
3417
3422
|
// Default value formatter, otherwise react freaks out on objects
|
|
@@ -3428,6 +3433,19 @@ const GridCell = (props, custom) => {
|
|
|
3428
3433
|
},
|
|
3429
3434
|
};
|
|
3430
3435
|
};
|
|
3436
|
+
/**
|
|
3437
|
+
* Ag-grid will start its own editor if editable is true and there is no cell editor
|
|
3438
|
+
* like in the case of a cell that is editable because it triggers a modal.
|
|
3439
|
+
* This will block that editor.
|
|
3440
|
+
*/
|
|
3441
|
+
const CellEditorToBlockEditing = ({ stopEditing }) => {
|
|
3442
|
+
useEffect(() => {
|
|
3443
|
+
defer(() => {
|
|
3444
|
+
stopEditing();
|
|
3445
|
+
});
|
|
3446
|
+
}, [stopEditing]);
|
|
3447
|
+
return jsx(Fragment, {});
|
|
3448
|
+
};
|
|
3431
3449
|
const GenericCellEditorComponentWrapper = (editor) => {
|
|
3432
3450
|
const obj = { editor };
|
|
3433
3451
|
return forwardRef(function GenericCellEditorComponentFr(cellEditorParams, _) {
|
|
@@ -3936,8 +3954,8 @@ const textMatch = (text, filter) => {
|
|
|
3936
3954
|
negativeFilters.every((superFilter) => values.every((value) => isMatch(value, superFilter)))));
|
|
3937
3955
|
};
|
|
3938
3956
|
|
|
3939
|
-
const
|
|
3940
|
-
|
|
3957
|
+
const CancelPromise = () => Promise.resolve(true);
|
|
3958
|
+
const useGridPopoverHook = ({ className, save, invalid, dontSaveOnExternalClick, }) => {
|
|
3941
3959
|
const { anchorRef, saving, updateValue, stopEditing } = useGridPopoverContext();
|
|
3942
3960
|
const saveButtonRef = useRef(null);
|
|
3943
3961
|
const [isOpen, setOpen] = useState(false);
|
|
@@ -3946,24 +3964,18 @@ const useGridPopoverHook = (props) => {
|
|
|
3946
3964
|
}, []);
|
|
3947
3965
|
const triggerSave = useCallback(async (reason) => {
|
|
3948
3966
|
if (reason == CloseReason.CANCEL) {
|
|
3967
|
+
await updateValue(CancelPromise, 0);
|
|
3949
3968
|
stopEditing();
|
|
3950
|
-
onBulkEditingComplete();
|
|
3951
3969
|
return;
|
|
3952
3970
|
}
|
|
3953
|
-
if (
|
|
3971
|
+
if (invalid?.()) {
|
|
3954
3972
|
// Don't close, don't do anything it's invalid
|
|
3955
3973
|
return;
|
|
3956
3974
|
}
|
|
3957
|
-
if (
|
|
3958
|
-
// No save method so just close
|
|
3959
|
-
stopEditing();
|
|
3960
|
-
onBulkEditingComplete();
|
|
3961
|
-
return;
|
|
3962
|
-
}
|
|
3963
|
-
if (await updateValue(props.save, reason === CloseReason.TAB_FORWARD ? 1 : reason === CloseReason.TAB_BACKWARD ? -1 : 0)) {
|
|
3975
|
+
if (await updateValue(save ?? (() => Promise.resolve(true)), reason === CloseReason.TAB_FORWARD ? 1 : reason === CloseReason.TAB_BACKWARD ? -1 : 0)) {
|
|
3964
3976
|
stopEditing();
|
|
3965
3977
|
}
|
|
3966
|
-
}, [
|
|
3978
|
+
}, [invalid, save, stopEditing, updateValue]);
|
|
3967
3979
|
const popoverWrapper = useCallback((children) => {
|
|
3968
3980
|
return (jsx(Fragment, { children: anchorRef.current && (jsxs(ControlledMenu, { state: isOpen ? 'open' : 'closed', portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: 'step-ag-grid-react-menu', onClose: (event) => {
|
|
3969
3981
|
// Prevent menu from closing when modals are invoked
|
|
@@ -3971,15 +3983,15 @@ const useGridPopoverHook = (props) => {
|
|
|
3971
3983
|
return;
|
|
3972
3984
|
}
|
|
3973
3985
|
void triggerSave(event.reason);
|
|
3974
|
-
}, viewScroll: 'auto', dontShrinkIfDirectionIsTop: true, className:
|
|
3986
|
+
}, viewScroll: 'auto', dontShrinkIfDirectionIsTop: true, className: className, children: [saving && ( // This is the overlay that prevents editing when the editor is saving
|
|
3975
3987
|
jsx("div", { className: 'ComponentLoadingWrapper-saveOverlay' })), children, jsx("button", { ref: saveButtonRef, "data-reason": '', onClick: (e) => {
|
|
3976
3988
|
let reason = e.currentTarget.getAttribute('data-reason') ?? undefined;
|
|
3977
|
-
if (
|
|
3989
|
+
if (dontSaveOnExternalClick && reason === CloseReason.BLUR) {
|
|
3978
3990
|
reason = CloseReason.CANCEL;
|
|
3979
3991
|
}
|
|
3980
3992
|
void triggerSave(reason);
|
|
3981
3993
|
}, style: { display: 'none' } })] })) }));
|
|
3982
|
-
}, [anchorRef, isOpen,
|
|
3994
|
+
}, [anchorRef, isOpen, className, dontSaveOnExternalClick, saving, triggerSave]);
|
|
3983
3995
|
return {
|
|
3984
3996
|
popoverWrapper,
|
|
3985
3997
|
triggerSave,
|
|
@@ -3989,7 +4001,7 @@ const useGridPopoverHook = (props) => {
|
|
|
3989
4001
|
const primitiveToSelectOption = (value) => {
|
|
3990
4002
|
return {
|
|
3991
4003
|
value: value,
|
|
3992
|
-
label: value ? String(value) : '',
|
|
4004
|
+
label: value ? String(value) : '-',
|
|
3993
4005
|
};
|
|
3994
4006
|
};
|
|
3995
4007
|
const MenuSeparatorString = '_____MENU_SEPARATOR_____';
|
|
@@ -4081,7 +4093,13 @@ const GridFormDropDown = (props) => {
|
|
|
4081
4093
|
if (selectedItem === null) {
|
|
4082
4094
|
if (props.onSelectFilter) {
|
|
4083
4095
|
const { onSelectFilter } = props;
|
|
4084
|
-
|
|
4096
|
+
if (!isEmpty(filter)) {
|
|
4097
|
+
await onSelectFilter({
|
|
4098
|
+
selectedRows,
|
|
4099
|
+
selectedRowIds: selectedRows.map((row) => row.id),
|
|
4100
|
+
value: filter,
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4085
4103
|
return true;
|
|
4086
4104
|
}
|
|
4087
4105
|
else {
|
|
@@ -4111,7 +4129,7 @@ const GridFormDropDown = (props) => {
|
|
|
4111
4129
|
setSubSelectedValue(null);
|
|
4112
4130
|
subComponentIsValid.current = true;
|
|
4113
4131
|
}, children: ({ ref }) => (jsxs("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [jsx("input", { className: 'LuiTextInput-input', ref: ref, type: "text", placeholder: props.filterPlaceholder ?? 'Filter...', "data-testid": 'filteredMenu-free-text-input', defaultValue: filter, "data-allowtabtosave": true, "data-disableenterautosave": !props.onSelectFilter &&
|
|
4114
|
-
!(filteredValues && filteredValues.length === 1 && !filteredValues[0].subComponent), onChange: (e) => setFilter(e.target.value) }), props.filterHelpText && isNotEmpty(filter) && (jsx(FormError, { error: null, helpText: props.filterHelpText }))] })) }), jsx(MenuDivider, {}, `$$divider_filter`)] })), jsx(ComponentLoadingWrapper, { loading: !options, className: 'GridFormDropDown-options', children: jsxs(Fragment, { children: [options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (jsx(MenuItem, { className: 'GridPopoverEditDropDown-noOptions', disabled: true, children: props.noOptionsMessage ?? 'No Options' }, `${fieldToString(field)}-empty`)), options?.map((item, index) => {
|
|
4132
|
+
!(filteredValues && filteredValues.length === 1 && !filteredValues[0].subComponent), onChange: (e) => setFilter(e.target.value.trim()) }), props.filterHelpText && isNotEmpty(filter) && (jsx(FormError, { error: null, helpText: props.filterHelpText }))] })) }), jsx(MenuDivider, {}, `$$divider_filter`)] })), jsx(ComponentLoadingWrapper, { loading: !options, className: 'GridFormDropDown-options', children: jsxs(Fragment, { children: [options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (jsx(MenuItem, { className: 'GridPopoverEditDropDown-noOptions', disabled: true, children: props.noOptionsMessage ?? 'No Options' }, `${fieldToString(field)}-empty`)), options?.map((item, index) => {
|
|
4115
4133
|
showHeader = null;
|
|
4116
4134
|
if (item.value === MenuSeparatorString) {
|
|
4117
4135
|
return jsx(MenuDivider, {}, `$$divider_${index}`);
|
|
@@ -4341,11 +4359,13 @@ const GridFormMultiSelect = (props) => {
|
|
|
4341
4359
|
props.invalid(selectedRows, options.filter((o) => o.checked)));
|
|
4342
4360
|
}, [options, props, selectedRows]);
|
|
4343
4361
|
const save = useCallback(async (selectedRows) => {
|
|
4344
|
-
if (!options || !props.onSave)
|
|
4362
|
+
if (!options || !props.onSave) {
|
|
4345
4363
|
return true;
|
|
4364
|
+
}
|
|
4346
4365
|
// Any changes to save?
|
|
4347
|
-
if (initialValues === JSON.stringify(options))
|
|
4366
|
+
if (initialValues === JSON.stringify(options)) {
|
|
4348
4367
|
return true;
|
|
4368
|
+
}
|
|
4349
4369
|
return props.onSave({
|
|
4350
4370
|
selectedRows,
|
|
4351
4371
|
selectedOptions: options.filter((o) => o.checked),
|
|
@@ -4438,8 +4458,9 @@ const FilterInput = (props) => {
|
|
|
4438
4458
|
setOptions([...options]);
|
|
4439
4459
|
}, [filter, headerGroups, options, setOptions]);
|
|
4440
4460
|
const addCustomFilterValue = useCallback(() => {
|
|
4441
|
-
if (!options || !onSelectFilter)
|
|
4461
|
+
if (!options || !onSelectFilter) {
|
|
4442
4462
|
return;
|
|
4463
|
+
}
|
|
4443
4464
|
const filterTrimmed = filter.trim();
|
|
4444
4465
|
if (isEmpty(filterTrimmed)) {
|
|
4445
4466
|
void triggerSave();
|
|
@@ -4448,8 +4469,9 @@ const FilterInput = (props) => {
|
|
|
4448
4469
|
const preFilterOptions = JSON.stringify(options);
|
|
4449
4470
|
onSelectFilter({ filter: filterTrimmed, options });
|
|
4450
4471
|
// Detect if options list changed and update
|
|
4451
|
-
if (preFilterOptions === JSON.stringify(options))
|
|
4472
|
+
if (preFilterOptions === JSON.stringify(options)) {
|
|
4452
4473
|
return;
|
|
4474
|
+
}
|
|
4453
4475
|
setOptions([...options]);
|
|
4454
4476
|
setFilter('');
|
|
4455
4477
|
}, [filter, onSelectFilter, options, setFilter, setOptions, triggerSave]);
|
|
@@ -5044,6 +5066,7 @@ const GridPopoverMessage = (colDef, props) => GridCell({
|
|
|
5044
5066
|
singleClickEdit: true,
|
|
5045
5067
|
}, {
|
|
5046
5068
|
editor: GridFormMessage,
|
|
5069
|
+
preventAutoEdit: true,
|
|
5047
5070
|
...props,
|
|
5048
5071
|
});
|
|
5049
5072
|
|
|
@@ -5059,6 +5082,18 @@ const GridWrapper = ({ children, maxHeight }) => (jsx("div", { className: 'Grid-
|
|
|
5059
5082
|
const getColId = (colDef) => colDef.colId ?? '';
|
|
5060
5083
|
const isFlexColumn = (colDef) => !!colDef.flex && !isGridCellFiller(colDef);
|
|
5061
5084
|
|
|
5085
|
+
const waitForCondition = async (error, condition, timeoutMs) => {
|
|
5086
|
+
const endTime = Date.now() + timeoutMs;
|
|
5087
|
+
while (Date.now() < endTime) {
|
|
5088
|
+
if (condition()) {
|
|
5089
|
+
return true;
|
|
5090
|
+
}
|
|
5091
|
+
await wait(100);
|
|
5092
|
+
}
|
|
5093
|
+
console.warn(error);
|
|
5094
|
+
return false;
|
|
5095
|
+
};
|
|
5096
|
+
|
|
5062
5097
|
/**
|
|
5063
5098
|
* Context for AgGrid operations.
|
|
5064
5099
|
* Make sure you wrap AgGrid in this.
|
|
@@ -5404,8 +5439,7 @@ const GridContextProvider = (props) => {
|
|
|
5404
5439
|
startCellEditingInProgressRef.current = true;
|
|
5405
5440
|
try {
|
|
5406
5441
|
// Edit in progress so don't edit until finished, timeout waiting after 5s
|
|
5407
|
-
if (!(await waitForCondition(() => !anyUpdating(),
|
|
5408
|
-
console.error("Could not start edit because previous edit hasn't finished after 5 seconds");
|
|
5442
|
+
if (!(await waitForCondition('startCellEditing failed as update still in progress, waited for 15 seconds', () => !anyUpdating(), 15000))) {
|
|
5409
5443
|
return;
|
|
5410
5444
|
}
|
|
5411
5445
|
const colDef = gridApi.getColumnDef(colId);
|
|
@@ -5427,11 +5461,12 @@ const GridContextProvider = (props) => {
|
|
|
5427
5461
|
const rowIndex = rowNode.rowIndex;
|
|
5428
5462
|
if (rowIndex != null) {
|
|
5429
5463
|
defer(() => {
|
|
5430
|
-
!gridApi.isDestroyed()
|
|
5464
|
+
if (!gridApi.isDestroyed()) {
|
|
5431
5465
|
gridApi.startEditingCell({
|
|
5432
5466
|
rowIndex,
|
|
5433
5467
|
colKey: colId,
|
|
5434
5468
|
});
|
|
5469
|
+
}
|
|
5435
5470
|
});
|
|
5436
5471
|
}
|
|
5437
5472
|
}
|
|
@@ -5440,9 +5475,9 @@ const GridContextProvider = (props) => {
|
|
|
5440
5475
|
}
|
|
5441
5476
|
}, [anyUpdating, gridApi, prePopupOps, waitForExternallySelectedItemsToBeInSync]);
|
|
5442
5477
|
const bulkEditingCompleteCallbackRef = useRef();
|
|
5443
|
-
const onBulkEditingComplete = useCallback(() => {
|
|
5478
|
+
const onBulkEditingComplete = useCallback(async () => {
|
|
5444
5479
|
resetFocusedCellAfterCellEditing();
|
|
5445
|
-
bulkEditingCompleteCallbackRef.current?.();
|
|
5480
|
+
await bulkEditingCompleteCallbackRef.current?.();
|
|
5446
5481
|
}, [resetFocusedCellAfterCellEditing]);
|
|
5447
5482
|
const setOnBulkEditingComplete = useCallback((cellEditingCompleteCallback) => {
|
|
5448
5483
|
bulkEditingCompleteCallbackRef.current = cellEditingCompleteCallback;
|
|
@@ -5473,8 +5508,10 @@ const GridContextProvider = (props) => {
|
|
|
5473
5508
|
// Prevent resetting focus to original editing cell
|
|
5474
5509
|
prePopupFocusedCell.current = undefined;
|
|
5475
5510
|
const preRow = gridApi.getFocusedCell();
|
|
5511
|
+
// If we don't do this ag-grid will do its own continuation of an edit on tab, we don't want that as
|
|
5512
|
+
// we are managing it ourselves
|
|
5513
|
+
gridApi.stopEditing();
|
|
5476
5514
|
if (tabDirection === 1) {
|
|
5477
|
-
gridApi.stopEditing();
|
|
5478
5515
|
gridApi.tabToNextCell();
|
|
5479
5516
|
}
|
|
5480
5517
|
else {
|
|
@@ -5511,29 +5548,25 @@ const GridContextProvider = (props) => {
|
|
|
5511
5548
|
const selectedRows = props.selectedRows;
|
|
5512
5549
|
let ok = false;
|
|
5513
5550
|
await modifyUpdating(props.field ?? '', selectedRows.map((data) => data.id), async () => {
|
|
5514
|
-
// MATT Disabled I don't believe these are needed anymore
|
|
5515
|
-
// I've left them here just in case they are
|
|
5516
5551
|
// Need to refresh to get spinners to work on all rows
|
|
5517
|
-
|
|
5552
|
+
gridApi.refreshCells({ rowNodes: props.selectedRows, force: true });
|
|
5518
5553
|
ok = await fnUpdate(selectedRows).catch((ex) => {
|
|
5519
5554
|
console.error('Exception during modifyUpdating', ex);
|
|
5520
5555
|
return false;
|
|
5521
5556
|
});
|
|
5522
5557
|
});
|
|
5523
|
-
// MATT Disabled I don't believe these are needed anymore
|
|
5524
|
-
// I've left them here just in case they are
|
|
5525
5558
|
// async processes need to refresh their own rows
|
|
5526
|
-
|
|
5559
|
+
gridApi.refreshCells({ rowNodes: selectedRows, force: true });
|
|
5527
5560
|
if (gridApi.isDestroyed()) {
|
|
5528
5561
|
return ok;
|
|
5529
5562
|
}
|
|
5530
5563
|
if (ok) {
|
|
5531
|
-
const cell = gridApi.getFocusedCell();
|
|
5532
|
-
if (cell && gridApi.getFocusedCell() == null) {
|
|
5533
|
-
|
|
5534
|
-
}
|
|
5564
|
+
//const cell = gridApi.getFocusedCell();
|
|
5565
|
+
//if (cell && gridApi.getFocusedCell() == null) {
|
|
5566
|
+
// !gridApi.isDestroyed && gridApi.setFocusedCell(cell.rowIndex, cell.column);
|
|
5567
|
+
// }
|
|
5535
5568
|
// This is needed to trigger postSortRowsHook
|
|
5536
|
-
gridApi.refreshClientSideRowModel();
|
|
5569
|
+
!gridApi.isDestroyed && gridApi.refreshClientSideRowModel();
|
|
5537
5570
|
}
|
|
5538
5571
|
void (async () => {
|
|
5539
5572
|
// Only focus next cell if user hasn't already manually changed focus
|
|
@@ -5543,11 +5576,11 @@ const GridContextProvider = (props) => {
|
|
|
5543
5576
|
prePopupFocusedCell.current.rowIndex == postPopupFocusedCell.rowIndex &&
|
|
5544
5577
|
prePopupFocusedCell.current.column.getColId() == postPopupFocusedCell.column.getColId()) {
|
|
5545
5578
|
if (!tabDirection || !(await selectNextEditableCell(tabDirection))) {
|
|
5546
|
-
onBulkEditingComplete();
|
|
5579
|
+
await onBulkEditingComplete();
|
|
5547
5580
|
}
|
|
5548
5581
|
}
|
|
5549
5582
|
else {
|
|
5550
|
-
onBulkEditingComplete();
|
|
5583
|
+
await onBulkEditingComplete();
|
|
5551
5584
|
}
|
|
5552
5585
|
})();
|
|
5553
5586
|
return ok;
|
|
@@ -5731,17 +5764,6 @@ const downloadCsvUseValueFormattersProcessCellCallback = (params) => {
|
|
|
5731
5764
|
// We add an extra encodeToString here just in case valueFormatter is returning non string values
|
|
5732
5765
|
return encodeToString(result);
|
|
5733
5766
|
};
|
|
5734
|
-
const waitForCondition = async (condition, timeoutMs) => {
|
|
5735
|
-
const endTime = Date.now() + timeoutMs;
|
|
5736
|
-
while (Date.now() < endTime) {
|
|
5737
|
-
if (condition()) {
|
|
5738
|
-
return true;
|
|
5739
|
-
}
|
|
5740
|
-
await wait(100);
|
|
5741
|
-
}
|
|
5742
|
-
console.warn('waitForCondition failed');
|
|
5743
|
-
return false;
|
|
5744
|
-
};
|
|
5745
5767
|
|
|
5746
5768
|
const GridUpdatingContextProvider = (props) => {
|
|
5747
5769
|
const updatingBlocks = useRef({});
|
|
@@ -5869,5 +5891,5 @@ const useDeferredPromise = () => {
|
|
|
5869
5891
|
};
|
|
5870
5892
|
};
|
|
5871
5893
|
|
|
5872
|
-
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, convertDDToDMS, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
|
|
5894
|
+
export { ActionButton, CancelPromise, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, convertDDToDMS, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait, waitForCondition };
|
|
5873
5895
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|