@linzjs/step-ag-grid 7.3.2 → 7.5.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.
@@ -12,9 +12,8 @@ export interface ActionButtonProps {
12
12
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
13
13
  iconPosition?: "left" | "right";
14
14
  className?: "ActionButton-fill" | string;
15
- onAction: () => Promise<void> | void;
16
- externalSetInProgress?: () => void;
15
+ onClick: () => Promise<void> | void;
17
16
  level?: LuiButtonProps["level"];
18
17
  style?: React.CSSProperties;
19
18
  }
20
- export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title, onAction, externalSetInProgress, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
19
+ export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title, onClick, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
@@ -1,9 +1,10 @@
1
+ export declare const countRows: (within?: HTMLElement) => Promise<number>;
1
2
  export declare const findRow: (rowId: number | string, within?: HTMLElement) => Promise<HTMLDivElement>;
2
3
  export declare const queryRow: (rowId: number | string, within?: HTMLElement) => Promise<HTMLDivElement | null>;
3
4
  export declare const selectRow: (rowId: string | number, within?: HTMLElement) => Promise<void>;
4
5
  export declare const deselectRow: (rowId: string | number, within?: HTMLElement) => Promise<void>;
5
6
  export declare const findCell: (rowId: number | string, colId: string, within?: HTMLElement) => Promise<HTMLElement>;
6
- export declare const cellContains: (rowId: number | string, colId: string, text: string | RegExp, within?: HTMLElement) => Promise<HTMLElement>;
7
+ export declare const findCellContains: (rowId: number | string, colId: string, text: string | RegExp, within?: HTMLElement) => Promise<HTMLElement>;
7
8
  export declare const selectCell: (rowId: string | number, colId: string, within?: HTMLElement) => Promise<void>;
8
9
  export declare const editCell: (rowId: number | string, colId: string, within?: HTMLElement) => Promise<void>;
9
10
  export declare const queryMenuOption: (menuOptionText: string | RegExp) => Promise<HTMLElement | null>;
@@ -1,5 +1,6 @@
1
1
  export declare const isNotEmpty: (value?: any) => boolean;
2
2
  export declare const wait: (timeoutMs: number) => Promise<(string | null)[]>;
3
3
  export declare const isFloat: (value: string) => boolean;
4
+ export declare const findParentWithClass: (className: string, child: Node) => HTMLElement | null;
4
5
  export declare const hasParentClass: (className: string, child: Node) => boolean;
5
6
  export declare const stringByteLengthIsInvalid: (str: string, maxBytes: number) => boolean;
@@ -1309,6 +1309,15 @@ var isFloat = function (value) {
1309
1309
  var regexp = /^-?\d+(\.\d+)?$/;
1310
1310
  return regexp.test(value);
1311
1311
  };
1312
+ var findParentWithClass = function (className, child) {
1313
+ for (var node = child; node; node = node.parentNode) {
1314
+ // When nodes are in portals they aren't type node anymore hence treating it as any here
1315
+ if (node.classList && node.classList.contains(className)) {
1316
+ return node;
1317
+ }
1318
+ }
1319
+ return null;
1320
+ };
1312
1321
  var hasParentClass = function (className, child) {
1313
1322
  for (var node = child; node; node = node.parentNode) {
1314
1323
  // When nodes are in portals they aren't type node anymore hence treating it as any here
@@ -4399,7 +4408,7 @@ var useStateDeferred = function (initialValue) {
4399
4408
  var minimumInProgressTimeMs = 950;
4400
4409
  var ActionButton = function (_a) {
4401
4410
  var _b, _c, _d;
4402
- var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, style = _a.style, className = _a.className, title = _a.title, onAction = _a.onAction, externalSetInProgress = _a.externalSetInProgress, _e = _a.size, size = _e === void 0 ? "sm" : _e, _f = _a.iconPosition, iconPosition = _f === void 0 ? "left" : _f, _g = _a.level, level = _g === void 0 ? "tertiary" : _g, ariaLabel = _a["aria-label"];
4411
+ var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, style = _a.style, className = _a.className, title = _a.title, onClick = _a.onClick, _e = _a.size, size = _e === void 0 ? "sm" : _e, _f = _a.iconPosition, iconPosition = _f === void 0 ? "left" : _f, _g = _a.level, level = _g === void 0 ? "tertiary" : _g, ariaLabel = _a["aria-label"];
4403
4412
  var _h = useState(false), inProgress = _h[0], setInProgress = _h[1];
4404
4413
  var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
4405
4414
  var _j = useStateDeferred(inProgress), localInProgress = _j[0], setLocalInProgress = _j[1], setLocalInProgressDeferred = _j[2];
@@ -4414,18 +4423,16 @@ var ActionButton = function (_a) {
4414
4423
  return __generator(this, function (_a) {
4415
4424
  switch (_a.label) {
4416
4425
  case 0:
4417
- promise = onAction();
4426
+ promise = onClick();
4418
4427
  isPromise = typeof promise !== "undefined";
4419
4428
  if (!isPromise) return [3 /*break*/, 3];
4420
4429
  setInProgress(true);
4421
- externalSetInProgress && setInProgress(true);
4422
4430
  if (!isPromise) return [3 /*break*/, 2];
4423
4431
  return [4 /*yield*/, promise];
4424
4432
  case 1:
4425
4433
  _a.sent();
4426
4434
  _a.label = 2;
4427
4435
  case 2:
4428
- externalSetInProgress && setInProgress(false);
4429
4436
  setInProgress(false);
4430
4437
  _a.label = 3;
4431
4438
  case 3: return [2 /*return*/];
@@ -24354,6 +24361,11 @@ var findQuick = function (filter, container) { return __awaiter(void 0, void 0,
24354
24361
  });
24355
24362
  }); };
24356
24363
 
24364
+ var countRows = function (within) { return __awaiter(void 0, void 0, void 0, function () {
24365
+ return __generator(this, function (_a) {
24366
+ return [2 /*return*/, getAllQuick({ tagName: "div[row-id]:not(:empty)" }, within).length];
24367
+ });
24368
+ }); };
24357
24369
  var findRow = function (rowId, within) { return __awaiter(void 0, void 0, void 0, function () {
24358
24370
  return __generator(this, function (_a) {
24359
24371
  return [2 /*return*/, findQuick({ tagName: "div[row-id='".concat(rowId, "']:not(:empty)") }, within)];
@@ -24406,7 +24418,7 @@ var findCell = function (rowId, colId, within) { return __awaiter(void 0, void 0
24406
24418
  }
24407
24419
  });
24408
24420
  }); };
24409
- var cellContains = function (rowId, colId, text, within) { return __awaiter(void 0, void 0, void 0, function () {
24421
+ var findCellContains = function (rowId, colId, text, within) { return __awaiter(void 0, void 0, void 0, function () {
24410
24422
  return __generator(this, function (_a) {
24411
24423
  switch (_a.label) {
24412
24424
  case 0: return [4 /*yield*/, waitForWrapper(function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -24647,5 +24659,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
24647
24659
  });
24648
24660
  }); };
24649
24661
 
24650
- export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, cellContains, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, deselectRow, editCell, findActionButton, findCell, findMenuOption, findMultiSelectOption, findRow, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24662
+ export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, 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, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24651
24663
  //# sourceMappingURL=step-ag-grid.esm.js.map