@linzjs/step-ag-grid 7.5.0 → 7.5.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.5.0",
5
+ "version": "7.5.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -34,7 +34,7 @@
34
34
  "react-dom": ">=17"
35
35
  },
36
36
  "dependencies": {
37
- "@linzjs/lui": ">=17",
37
+ "@linzjs/lui": "^17.23.2",
38
38
  "ag-grid-community": ">=27",
39
39
  "ag-grid-react": ">=27",
40
40
  "debounce-promise": "^3.1.2",
@@ -17,7 +17,7 @@ export interface GridBaseRow {
17
17
 
18
18
  export interface GridProps {
19
19
  selectable?: boolean;
20
- dataTestId?: string;
20
+ ["data-testid"]?: string;
21
21
  quickFilter?: boolean;
22
22
  quickFilterPlaceholder?: string;
23
23
  quickFilterValue?: string;
@@ -230,7 +230,7 @@ export const Grid = (params: GridProps): JSX.Element => {
230
230
 
231
231
  return (
232
232
  <div
233
- data-testid={params.dataTestId}
233
+ data-testid={params["data-testid"]}
234
234
  className={clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale")}
235
235
  >
236
236
  {params.quickFilter && (
@@ -300,8 +300,8 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
300
300
  }
301
301
  }}
302
302
  >
303
- {(item.label ?? (item.value == null ? `<${item.value}>` : `${item.value}`)) +
304
- (item.subComponent ? "..." : "")}
303
+ {item.label ?? (item.value == null ? `<${item.value}>` : `${item.value}`)}
304
+ {item.subComponent ? "..." : ""}
305
305
  </MenuItem>
306
306
 
307
307
  {item.subComponent && selectedSubComponent === item && (
@@ -5,12 +5,24 @@
5
5
  align-items: center;
6
6
  }
7
7
 
8
- .ActionButton-minimal {
9
- padding-right: 38px !important;
8
+ .ActionButton-minimal.lui-button-lg.lui-button-icon-right {
9
+ padding-right: 38px;
10
10
  }
11
11
 
12
- .ActionButton .LuiIcon {
13
- margin: 0 4px !important;
12
+ .ActionButton.lui-button-lg.lui-button-icon-right:not(.ActionButton-tight) .LuiIcon {
13
+ margin: 0 4px;
14
+ }
15
+
16
+ .ActionButton.ActionButton-tight.lui-button-lg.lui-button-icon-right .LuiIcon {
17
+ margin: 0;
18
+ }
19
+
20
+ .ActionButton-iconOnly.lui-button-lg.lui-button-icon-right:not(.ActionButton-tight) {
21
+ padding: 8px 5px;
22
+ }
23
+
24
+ .ActionButton-iconOnly.lui-button-lg.lui-button-icon-right.ActionButton-tight {
25
+ padding: 0;
14
26
  }
15
27
 
16
28
  .ActionButton-minimalArea {
@@ -25,13 +37,13 @@
25
37
  visibility: hidden;
26
38
  }
27
39
 
28
- .ActionButton-inProgress {
40
+ .ActionButton-inProgress.lui-button-lg.lui-button-icon-right {
29
41
  cursor: progress;
30
- color: #007198 !important;
31
- background-color: colors.$polar !important;
42
+ color: #007198;
43
+ background-color: colors.$polar;
32
44
 
33
45
  svg * {
34
- fill: transparent !important;
46
+ fill: transparent;
35
47
  }
36
48
  }
37
49
 
@@ -1,7 +1,7 @@
1
1
  import "./ActionButton.scss";
2
2
 
3
3
  import clsx from "clsx";
4
- import { useEffect, useState } from "react";
4
+ import { useEffect, useState, CSSProperties } from "react";
5
5
  import { LuiButton, LuiIcon, LuiMiniSpinner } from "@linzjs/lui";
6
6
  import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
7
7
  import { usePrevious } from "./reactUtils";
@@ -17,10 +17,10 @@ export interface ActionButtonProps {
17
17
  dataTestId?: string;
18
18
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
19
19
  iconPosition?: "left" | "right";
20
- className?: "ActionButton-fill" | string;
20
+ className?: "ActionButton-fill" | "ActionButton-tight" | string;
21
21
  onClick: () => Promise<void> | void;
22
22
  level?: LuiButtonProps["level"];
23
- style?: React.CSSProperties;
23
+ style?: CSSProperties;
24
24
  }
25
25
 
26
26
  // Kept this less than one second, so I don't have issues with waitFor as it defaults to 1s
@@ -70,9 +70,10 @@ export const ActionButton = ({
70
70
  className,
71
71
  localInProgress && "ActionButton-inProgress",
72
72
  name != null && !className?.includes("ActionButton-fill") && "ActionButton-minimal",
73
+ name == null && "ActionButton-iconOnly",
73
74
  )}
74
75
  size={"lg"}
75
- style={{ ...(name == null && { padding: "8px 5px" }), ...style }}
76
+ style={style}
76
77
  onClick={async () => {
77
78
  const promise = onClick();
78
79
  const isPromise = typeof promise !== "undefined";
@@ -102,12 +103,7 @@ export const ActionButton = ({
102
103
  }}
103
104
  />
104
105
  ) : (
105
- <LuiIcon
106
- name={icon}
107
- alt={ariaLabel ?? name ?? ""}
108
- size={size}
109
- spanProps={{ style: iconPosition === "right" ? { transform: "scaleX(-1)" } : {} }}
110
- />
106
+ <LuiIcon name={icon} alt={ariaLabel ?? name ?? ""} size={size} />
111
107
  )}
112
108
  {iconPosition === "left" && buttonText}
113
109
  </LuiButton>
@@ -23,7 +23,15 @@ const ActionButtonTemplate: ComponentStory<typeof ActionButton> = () => {
23
23
  <ActionButton icon={"ic_add"} aria-label={"Add new row"} onClick={performAction} level={"primary"} />
24
24
  <br />
25
25
  <ActionButton
26
- icon={"ic_arrow_back"}
26
+ icon={"ic_add"}
27
+ aria-label={"Add new row"}
28
+ onClick={performAction}
29
+ level={"primary"}
30
+ className={"ActionButton-tight"}
31
+ />
32
+ <br />
33
+ <ActionButton
34
+ icon={"ic_arrow_forward_right"}
27
35
  name={"Continue"}
28
36
  onClick={performAction}
29
37
  iconPosition={"right"}
@@ -92,6 +92,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
92
92
 
93
93
  return (
94
94
  <Grid
95
+ data-testid={"bearingsTestTable"}
95
96
  {...props}
96
97
  externalSelectedItems={externalSelectedItems}
97
98
  setExternalSelectedItems={setExternalSelectedItems}