@linzjs/step-ag-grid 7.14.0 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ export declare const selectCell: (rowId: string | number, colId: string, within?
9
9
  export declare const editCell: (rowId: number | string, colId: string, within?: HTMLElement) => Promise<void>;
10
10
  export declare const queryMenuOption: (menuOptionText: string | RegExp) => Promise<HTMLElement | null>;
11
11
  export declare const findMenuOption: (menuOptionText: string | RegExp) => Promise<HTMLElement>;
12
+ export declare const validateMenuOptions: (rowId: number | string, colId: string, expectedMenuOptions: Array<string>) => Promise<boolean>;
12
13
  export declare const clickMenuOption: (menuOptionText: string | RegExp) => Promise<void>;
13
14
  export declare const openAndClickMenuOption: (rowId: number | string, colId: string, menuOptionText: string | RegExp, within?: HTMLElement) => Promise<void>;
14
15
  export declare const getMultiSelectOptions: () => Promise<{
@@ -17,6 +18,7 @@ export declare const getMultiSelectOptions: () => Promise<{
17
18
  }[]>;
18
19
  export declare const findMultiSelectOption: (value: string) => Promise<HTMLElement>;
19
20
  export declare const clickMultiSelectOption: (value: string) => Promise<void>;
21
+ export declare const typeInput: (value: string) => Promise<void>;
20
22
  export declare const typeOtherInput: (value: string) => Promise<void>;
21
23
  export declare const typeOtherTextArea: (value: string) => Promise<void>;
22
24
  export declare const closeMenu: () => void;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useMemo, useLayoutEffect, useEffect, createContext, memo, forwardRef, useRef, useContext, useState, useCallback, useReducer, cloneElement, useImperativeHandle, Fragment } from 'react';
3
3
  import ReactDOM, { unstable_batchedUpdates, flushSync, createPortal } from 'react-dom';
4
- import { findIndex, debounce, negate, isEmpty, difference, delay, sortBy, defer as defer$1, last, castArray, remove, flatten, xorBy, partition, pick, groupBy, fromPairs, toPairs, omit } from 'lodash-es';
4
+ import { findIndex, debounce, negate, isEmpty, difference, delay, sortBy, defer as defer$1, last, castArray, remove, flatten, xorBy, partition, pick, groupBy, fromPairs, toPairs, omit, isEqual } from 'lodash-es';
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
6
6
  import { AgGridReact } from 'ag-grid-react';
7
7
  import { LuiMiniSpinner, LuiIcon, LuiCheckboxInput, LuiButton } from '@linzjs/lui';
@@ -24663,6 +24663,23 @@ var findMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0
24663
24663
  }
24664
24664
  });
24665
24665
  }); };
24666
+ var validateMenuOptions = function (rowId, colId, expectedMenuOptions) { return __awaiter(void 0, void 0, void 0, function () {
24667
+ var openMenu, actualOptions;
24668
+ return __generator(this, function (_a) {
24669
+ switch (_a.label) {
24670
+ case 0: return [4 /*yield*/, editCell(rowId, colId)];
24671
+ case 1:
24672
+ _a.sent();
24673
+ return [4 /*yield*/, findOpenMenu()];
24674
+ case 2:
24675
+ openMenu = _a.sent();
24676
+ return [4 /*yield*/, getQueriesForElement(openMenu).findAllByRole("menuitem")];
24677
+ case 3:
24678
+ actualOptions = (_a.sent()).map(function (menuItem) { return menuItem.textContent; });
24679
+ return [2 /*return*/, isEqual(actualOptions, expectedMenuOptions)];
24680
+ }
24681
+ });
24682
+ }); };
24666
24683
  var clickMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0, void 0, function () {
24667
24684
  var menuOption;
24668
24685
  return __generator(this, function (_a) {
@@ -24735,6 +24752,22 @@ var clickMultiSelectOption = function (value) { return __awaiter(void 0, void 0,
24735
24752
  }
24736
24753
  });
24737
24754
  }); };
24755
+ var typeInput = function (value) { return __awaiter(void 0, void 0, void 0, function () {
24756
+ var openMenu, input;
24757
+ return __generator(this, function (_a) {
24758
+ switch (_a.label) {
24759
+ case 0: return [4 /*yield*/, findOpenMenu()];
24760
+ case 1:
24761
+ openMenu = _a.sent();
24762
+ return [4 /*yield*/, findQuick({ child: { tagName: "input[type='text']" } }, openMenu)];
24763
+ case 2:
24764
+ input = _a.sent();
24765
+ userEvent.clear(input);
24766
+ userEvent.type(input, value);
24767
+ return [2 /*return*/];
24768
+ }
24769
+ });
24770
+ }); };
24738
24771
  var typeOtherInput = function (value) { return __awaiter(void 0, void 0, void 0, function () {
24739
24772
  var openMenu, otherInput;
24740
24773
  return __generator(this, function (_a) {
@@ -24795,5 +24828,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
24795
24828
  });
24796
24829
  }); };
24797
24830
 
24798
- export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, suppressCellKeyboardEvents, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24831
+ export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, suppressCellKeyboardEvents, typeInput, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, validateMenuOptions, wait$2 as wait };
24799
24832
  //# sourceMappingURL=step-ag-grid.esm.js.map