@linzjs/step-ag-grid 7.3.1 → 7.3.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "7.3.1",
5
+ "version": "7.3.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -50,7 +50,7 @@ export const GridFormTextArea = <RowType extends GridBaseRow>(props: GridFormTex
50
50
  });
51
51
 
52
52
  return popoverWrapper(
53
- <div style={{ display: "flex", flexDirection: "row", width: props.width ?? 240 }}>
53
+ <div className={"subComponent"} style={{ display: "flex", flexDirection: "row", width: props.width ?? 240 }}>
54
54
  <TextAreaInput
55
55
  value={value}
56
56
  onChange={(e) => setValue(e.target.value)}
@@ -50,7 +50,10 @@ export const GridFormTextInput = <RowType extends GridBaseRow>(props: GridFormTe
50
50
  });
51
51
 
52
52
  return popoverWrapper(
53
- <div style={{ display: "flex", flexDirection: "row", width: props.width ?? 240 }} className={"FormTest"}>
53
+ <div
54
+ style={{ display: "flex", flexDirection: "row", width: props.width ?? 240 }}
55
+ className={"FormTest subComponent"}
56
+ >
54
57
  <TextInputFormatted
55
58
  value={value}
56
59
  onChange={(e) => setValue(e.target.value)}
@@ -15,7 +15,7 @@ export interface GridContextType {
15
15
  selectRowsByIdWithFlash: (rowIds?: number[]) => void;
16
16
  flashRows: (rowIds?: number[]) => void;
17
17
  flashRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
18
- ensureRowVisible: (id: number) => void;
18
+ ensureRowVisible: (id: number | string) => boolean;
19
19
  ensureSelectedRowIsVisible: () => void;
20
20
  sizeColumnsToFit: () => void;
21
21
  stopEditing: () => void;
@@ -67,6 +67,7 @@ export const GridContext = createContext<GridContextType>({
67
67
  },
68
68
  ensureRowVisible: () => {
69
69
  console.error("no context provider for ensureRowVisible");
70
+ return true;
70
71
  },
71
72
  ensureSelectedRowIsVisible: () => {
72
73
  console.error("no context provider for ensureSelectedRowIsVisible");
@@ -200,10 +200,12 @@ export const GridContextProvider = (props: GridContextProps): ReactElement => {
200
200
  );
201
201
  };
202
202
 
203
- const ensureRowVisible = (id: number): void => {
204
- gridApiOp((gridApi) => {
203
+ const ensureRowVisible = (id: number | string): boolean => {
204
+ return gridApiOp((gridApi) => {
205
205
  const node = gridApi.getRowNode(`${id}`);
206
- node && gridApi.ensureNodeVisible(node);
206
+ if (!node) return false;
207
+ gridApi.ensureNodeVisible(node);
208
+ return true;
207
209
  });
208
210
  };
209
211
 
@@ -42,10 +42,13 @@ export const cellContains = async (
42
42
  text: string | RegExp,
43
43
  within?: HTMLElement,
44
44
  ) => {
45
- return await waitFor(async () => {
46
- const row = await findRow(rowId, within);
47
- return await findQuick({ tagName: `[col-id='${colId}']`, text }, row);
48
- });
45
+ return await waitFor(
46
+ async () => {
47
+ const row = await findRow(rowId, within);
48
+ return await findQuick({ tagName: `[col-id='${colId}']`, text }, row);
49
+ },
50
+ { timeout: 10000 },
51
+ );
49
52
  };
50
53
 
51
54
  export const selectCell = async (rowId: string | number, colId: string, within?: HTMLElement): Promise<void> => {
@@ -129,12 +132,14 @@ export const clickMultiSelectOption = async (value: string): Promise<void> => {
129
132
  export const typeOtherInput = async (value: string): Promise<void> => {
130
133
  const openMenu = await findOpenMenu();
131
134
  const otherInput = await findQuick({ classes: ".subComponent", child: { tagName: "input[type='text']" } }, openMenu);
135
+ userEvent.clear(otherInput);
132
136
  userEvent.type(otherInput, value);
133
137
  };
134
138
 
135
139
  export const typeOtherTextArea = async (value: string): Promise<void> => {
136
140
  const openMenu = await findOpenMenu();
137
141
  const otherTextArea = await findQuick({ classes: ".subComponent", child: { tagName: "textarea" } }, openMenu);
142
+ userEvent.clear(otherTextArea);
138
143
  userEvent.type(otherTextArea, value);
139
144
  };
140
145