@linzjs/step-ag-grid 7.3.1 → 7.4.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.
@@ -14,7 +14,7 @@ export interface GridContextType {
14
14
  selectRowsByIdWithFlash: (rowIds?: number[]) => void;
15
15
  flashRows: (rowIds?: number[]) => void;
16
16
  flashRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
17
- ensureRowVisible: (id: number) => void;
17
+ ensureRowVisible: (id: number | string) => boolean;
18
18
  ensureSelectedRowIsVisible: () => void;
19
19
  sizeColumnsToFit: () => void;
20
20
  stopEditing: () => void;
@@ -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>;
@@ -1991,6 +1991,7 @@ var GridContext = createContext({
1991
1991
  }); },
1992
1992
  ensureRowVisible: function () {
1993
1993
  console.error("no context provider for ensureRowVisible");
1994
+ return true;
1994
1995
  },
1995
1996
  ensureSelectedRowIsVisible: function () {
1996
1997
  console.error("no context provider for ensureSelectedRowIsVisible");
@@ -2206,9 +2207,12 @@ var GridContextProvider = function (props) {
2206
2207
  return gridApiOp(function (gridApi) { return isNotEmpty(gridApi.getEditingCells()); }, function () { return false; });
2207
2208
  };
2208
2209
  var ensureRowVisible = function (id) {
2209
- gridApiOp(function (gridApi) {
2210
+ return gridApiOp(function (gridApi) {
2210
2211
  var node = gridApi.getRowNode("".concat(id));
2211
- node && gridApi.ensureNodeVisible(node);
2212
+ if (!node)
2213
+ return false;
2214
+ gridApi.ensureNodeVisible(node);
2215
+ return true;
2212
2216
  });
2213
2217
  };
2214
2218
  /**
@@ -4246,7 +4250,7 @@ var GridFormTextArea = function (props) {
4246
4250
  invalid: invalid,
4247
4251
  save: save
4248
4252
  }).popoverWrapper;
4249
- return popoverWrapper(jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 } }, { children: jsx(TextAreaInput, { value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), placeholder: props.placeholder, helpText: helpText }) })));
4253
+ return popoverWrapper(jsx("div", __assign({ className: "subComponent", style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 } }, { children: jsx(TextAreaInput, { value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), placeholder: props.placeholder, helpText: helpText }) })));
4250
4254
  };
4251
4255
 
4252
4256
  var GridPopoverTextArea = function (colDef, params) { return GridCell(colDef, __assign({ editor: GridFormTextArea }, params)); };
@@ -4283,7 +4287,7 @@ var GridFormTextInput = function (props) {
4283
4287
  invalid: invalid,
4284
4288
  save: save
4285
4289
  }).popoverWrapper;
4286
- return popoverWrapper(jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 }, className: "FormTest" }, { children: jsx(TextInputFormatted, { value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), formatted: props.units, style: { width: "100%" }, placeholder: props.placeholder, helpText: helpText }) })));
4290
+ return popoverWrapper(jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 }, className: "FormTest subComponent" }, { children: jsx(TextInputFormatted, { value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), formatted: props.units, style: { width: "100%" }, placeholder: props.placeholder, helpText: helpText }) })));
4287
4291
  };
4288
4292
 
4289
4293
  var GridPopoverTextInput = function (colDef, params) {
@@ -24350,6 +24354,11 @@ var findQuick = function (filter, container) { return __awaiter(void 0, void 0,
24350
24354
  });
24351
24355
  }); };
24352
24356
 
24357
+ var countRows = function (within) { return __awaiter(void 0, void 0, void 0, function () {
24358
+ return __generator(this, function (_a) {
24359
+ return [2 /*return*/, getAllQuick({ tagName: "div[row-id]:not(:empty)" }, within).length];
24360
+ });
24361
+ }); };
24353
24362
  var findRow = function (rowId, within) { return __awaiter(void 0, void 0, void 0, function () {
24354
24363
  return __generator(this, function (_a) {
24355
24364
  return [2 /*return*/, findQuick({ tagName: "div[row-id='".concat(rowId, "']:not(:empty)") }, within)];
@@ -24402,7 +24411,7 @@ var findCell = function (rowId, colId, within) { return __awaiter(void 0, void 0
24402
24411
  }
24403
24412
  });
24404
24413
  }); };
24405
- var cellContains = function (rowId, colId, text, within) { return __awaiter(void 0, void 0, void 0, function () {
24414
+ var findCellContains = function (rowId, colId, text, within) { return __awaiter(void 0, void 0, void 0, function () {
24406
24415
  return __generator(this, function (_a) {
24407
24416
  switch (_a.label) {
24408
24417
  case 0: return [4 /*yield*/, waitForWrapper(function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -24416,7 +24425,7 @@ var cellContains = function (rowId, colId, text, within) { return __awaiter(void
24416
24425
  case 2: return [2 /*return*/, _a.sent()];
24417
24426
  }
24418
24427
  });
24419
- }); })];
24428
+ }); }, { timeout: 10000 })];
24420
24429
  case 1: return [2 /*return*/, _a.sent()];
24421
24430
  }
24422
24431
  });
@@ -24593,6 +24602,7 @@ var typeOtherInput = function (value) { return __awaiter(void 0, void 0, void 0,
24593
24602
  return [4 /*yield*/, findQuick({ classes: ".subComponent", child: { tagName: "input[type='text']" } }, openMenu)];
24594
24603
  case 2:
24595
24604
  otherInput = _a.sent();
24605
+ userEvent.clear(otherInput);
24596
24606
  userEvent.type(otherInput, value);
24597
24607
  return [2 /*return*/];
24598
24608
  }
@@ -24608,6 +24618,7 @@ var typeOtherTextArea = function (value) { return __awaiter(void 0, void 0, void
24608
24618
  return [4 /*yield*/, findQuick({ classes: ".subComponent", child: { tagName: "textarea" } }, openMenu)];
24609
24619
  case 2:
24610
24620
  otherTextArea = _a.sent();
24621
+ userEvent.clear(otherTextArea);
24611
24622
  userEvent.type(otherTextArea, value);
24612
24623
  return [2 /*return*/];
24613
24624
  }
@@ -24641,5 +24652,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
24641
24652
  });
24642
24653
  }); };
24643
24654
 
24644
- 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 };
24655
+ 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, findRow, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24645
24656
  //# sourceMappingURL=step-ag-grid.esm.js.map