@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/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/src/components/Grid.d.ts +1 -1
- package/dist/src/lui/ActionButton.d.ts +3 -3
- package/dist/step-ag-grid.esm.js +6 -7
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Grid.tsx +2 -2
- package/src/components/gridForm/GridFormDropDown.tsx +2 -2
- package/src/lui/ActionButton.scss +20 -8
- package/src/lui/ActionButton.tsx +6 -10
- package/src/stories/components/ActionButton.stories.tsx +9 -1
- package/src/stories/grid/GridPopoutBearing.stories.tsx +1 -0
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.
|
|
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": "
|
|
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",
|
package/src/components/Grid.tsx
CHANGED
|
@@ -17,7 +17,7 @@ export interface GridBaseRow {
|
|
|
17
17
|
|
|
18
18
|
export interface GridProps {
|
|
19
19
|
selectable?: boolean;
|
|
20
|
-
|
|
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
|
|
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
|
-
{
|
|
304
|
-
|
|
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
|
|
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
|
|
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
|
|
31
|
-
background-color: colors.$polar
|
|
42
|
+
color: #007198;
|
|
43
|
+
background-color: colors.$polar;
|
|
32
44
|
|
|
33
45
|
svg * {
|
|
34
|
-
fill: transparent
|
|
46
|
+
fill: transparent;
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
|
package/src/lui/ActionButton.tsx
CHANGED
|
@@ -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?:
|
|
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={
|
|
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={"
|
|
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"}
|