@linzjs/step-ag-grid 17.0.1 → 17.0.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/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  - Custom form
19
19
  - Context menu
20
20
 
21
- _Please note this requires React >=17, ag-grid-community >=27, and sass._
21
+ _Please note this requires React >=17, ag-grid-community >=28, and SASS._
22
22
 
23
23
  ## Install
24
24
 
@@ -81,7 +81,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
81
81
  }
82
82
 
83
83
  .ag-header .ag-header-cell[aria-colindex="1"] {
84
- padding-left: lui.$unit-rg;
84
+ padding-left: 17px;
85
85
  }
86
86
 
87
87
  .ag-cell[role="gridcell"] {
@@ -90,7 +90,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
90
90
  }
91
91
 
92
92
  .ag-cell[aria-colindex="1"] {
93
- border-left: none;
93
+ border-left: 1px solid transparent;
94
94
  padding-left: lui.$unit-rg;
95
95
  }
96
96
 
@@ -0,0 +1,3 @@
1
+ export declare const waitForGridReady: ({ canvasElement }: {
2
+ canvasElement: HTMLElement;
3
+ }) => Promise<void>;
@@ -35,3 +35,11 @@ export declare const closeMenu: () => Promise<void>;
35
35
  export declare const closePopover: () => Promise<void>;
36
36
  export declare const findActionButton: (text: string, container?: HTMLElement) => Promise<HTMLElement>;
37
37
  export declare const clickActionButton: (text: string, container?: HTMLElement) => Promise<void>;
38
+ export declare const waitForGridReady: ({ grid, timeout }: {
39
+ grid?: HTMLElement | undefined;
40
+ timeout: number;
41
+ }) => Promise<void>;
42
+ export declare const waitForGridRows: ({ grid, timeout }: {
43
+ grid?: HTMLElement | undefined;
44
+ timeout: number;
45
+ }) => Promise<void>;
@@ -2533,8 +2533,8 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2533
2533
  {
2534
2534
  colId: "selection",
2535
2535
  editable: false,
2536
- minWidth: 42,
2537
- maxWidth: 42,
2536
+ minWidth: 48,
2537
+ maxWidth: 48,
2538
2538
  pinned: selectColumnPinned,
2539
2539
  headerComponentParams: {
2540
2540
  exportable: false,
@@ -4389,6 +4389,7 @@ const GridPopoverMenu = (colDef, custom) => GridCell({
4389
4389
  minWidth: 48,
4390
4390
  maxWidth: 48,
4391
4391
  width: 40,
4392
+ sortable: false,
4392
4393
  editable: colDef.editable != null ? colDef.editable : true,
4393
4394
  exportable: false,
4394
4395
  cellStyle: { flex: 1, justifyContent: "center" },
@@ -4614,7 +4615,7 @@ const GridContextProvider = (props) => {
4614
4615
  /**
4615
4616
  * Get ColDefs, with flattened ColGroupDefs
4616
4617
  */
4617
- const getColumns = React.useCallback((filterDef = () => true) => lodashEs.filter(columnApi?.getAllColumns()?.map((col) => col.getColDef()) ?? [], filterDef), [columnApi]);
4618
+ const getColumns = React.useCallback((filterDef = () => true) => lodashEs.filter(columnApi?.getColumns()?.map((col) => col.getColDef()) ?? [], filterDef), [columnApi]);
4618
4619
  const getColumnIds = React.useCallback((filterDef = () => true) => lodashEs.compact(getColumns(filterDef).map(getColId)), [getColumns]);
4619
4620
  /**
4620
4621
  * Internal method for selecting and flashing rows.
@@ -4886,15 +4887,16 @@ const GridContextProvider = (props) => {
4886
4887
  return ok;
4887
4888
  });
4888
4889
  }, [gridApiOp, modifyUpdating, selectNextEditableCell]);
4889
- const redrawRows = React.useCallback((rowNodes) => {
4890
- // redraw rows can throw exceptions in jest, so we ignore them
4890
+ const redrawRows = React.useMemo(() => debounce((rowNodes) => {
4891
4891
  try {
4892
4892
  gridApi && gridApi.redrawRows(rowNodes ? { rowNodes } : undefined);
4893
4893
  }
4894
4894
  catch (ex) {
4895
- console.error(ex);
4895
+ // Hide errors in jest, but log them in browser
4896
+ if (typeof jest === "undefined")
4897
+ console.error(ex);
4896
4898
  }
4897
- }, [gridApi]);
4899
+ }, 50), [gridApi]);
4898
4900
  // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
4899
4901
  const externallySelectedItemsAreInSyncRef = React.useRef(false);
4900
4902
  React.useEffect(() => {
@@ -25661,7 +25663,13 @@ const findActionButton = (text, container) => findQuick({ tagName: "button", chi
25661
25663
  const clickActionButton = async (text, container) => {
25662
25664
  const button = await findActionButton(text, container);
25663
25665
  await user.click(button);
25664
- };
25666
+ };
25667
+ const waitForGridReady = async ({ grid, timeout = 5000 }) => waitForWrapper(() => expect(getAllQuick({ classes: ".Grid-ready" }, grid)).toBeInTheDocument(), {
25668
+ timeout,
25669
+ });
25670
+ const waitForGridRows = async ({ grid, timeout = 5000 }) => waitForWrapper(async () => expect(getAllQuick({ classes: ".ag-row" }, grid).length > 0).toBe(true), {
25671
+ timeout,
25672
+ });
25665
25673
 
25666
25674
  exports.ActionButton = ActionButton;
25667
25675
  exports.ComponentLoadingWrapper = ComponentLoadingWrapper;
@@ -25790,4 +25798,6 @@ exports.useMenuState = useMenuState;
25790
25798
  exports.usePostSortRowsHook = usePostSortRowsHook;
25791
25799
  exports.validateMenuOptions = validateMenuOptions;
25792
25800
  exports.wait = wait$1;
25801
+ exports.waitForGridReady = waitForGridReady;
25802
+ exports.waitForGridRows = waitForGridRows;
25793
25803
  //# sourceMappingURL=step-ag-grid.cjs.js.map