@linzjs/step-ag-grid 7.0.0 → 7.0.1
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 +4 -4
- package/dist/index.js.map +1 -1
- package/dist/src/lui/ActionButton.d.ts +3 -2
- package/dist/step-ag-grid.esm.js +4 -4
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/lui/ActionButton.scss +10 -0
- package/src/lui/ActionButton.tsx +11 -3
- package/src/react-menu3/components/ControlledMenu.tsx +1 -1
- package/src/stories/components/ActionButton.stories.tsx +2 -0
- package/src/stories/grid/FormTest.tsx +1 -1
package/package.json
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
.ActionButton-minimal {
|
|
9
|
+
padding-right: 38px !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
.ActionButton .LuiIcon {
|
|
9
13
|
margin: 0 4px !important;
|
|
10
14
|
}
|
|
@@ -30,3 +34,9 @@
|
|
|
30
34
|
fill: transparent !important;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
37
|
+
|
|
38
|
+
.ActionButton-fill {
|
|
39
|
+
width: 100%;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
}
|
|
42
|
+
|
package/src/lui/ActionButton.tsx
CHANGED
|
@@ -17,11 +17,12 @@ export interface ActionButtonProps {
|
|
|
17
17
|
dataTestId?: string;
|
|
18
18
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
|
|
19
19
|
iconPosition?: "left" | "right";
|
|
20
|
-
className?: string;
|
|
20
|
+
className?: "ActionButton-fill" | string;
|
|
21
21
|
onAction: () => Promise<void> | void;
|
|
22
22
|
// Used for external code to get access to whether action is in progress
|
|
23
23
|
externalSetInProgress?: () => void;
|
|
24
24
|
level?: LuiButtonProps["level"];
|
|
25
|
+
style?: React.CSSProperties;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
// Kept this less than one second, so I don't have issues with waitFor as it defaults to 1s
|
|
@@ -32,6 +33,7 @@ export const ActionButton = ({
|
|
|
32
33
|
name,
|
|
33
34
|
inProgressName,
|
|
34
35
|
dataTestId,
|
|
36
|
+
style,
|
|
35
37
|
className,
|
|
36
38
|
title,
|
|
37
39
|
onAction,
|
|
@@ -65,9 +67,15 @@ export const ActionButton = ({
|
|
|
65
67
|
level={level}
|
|
66
68
|
title={title ?? ariaLabel ?? name}
|
|
67
69
|
aria-label={ariaLabel ?? name}
|
|
68
|
-
className={clsx(
|
|
70
|
+
className={clsx(
|
|
71
|
+
"lui-button-icon-right",
|
|
72
|
+
"ActionButton",
|
|
73
|
+
className,
|
|
74
|
+
localInProgress && "ActionButton-inProgress",
|
|
75
|
+
name != null && !className?.includes("ActionButton-fill") && "ActionButton-minimal",
|
|
76
|
+
)}
|
|
69
77
|
size={"lg"}
|
|
70
|
-
style={name == null
|
|
78
|
+
style={{ ...(name == null && { padding: "8px 5px" }), ...style }}
|
|
71
79
|
onClick={async () => {
|
|
72
80
|
const promise = onAction();
|
|
73
81
|
const isPromise = typeof promise !== "undefined";
|
|
@@ -137,7 +137,7 @@ export const ControlledMenuFr = (
|
|
|
137
137
|
if (activeElement !== firstInputEl && activeElement !== lastInputEl) return;
|
|
138
138
|
|
|
139
139
|
const isTextArea = activeElement.nodeName === "TEXTAREA";
|
|
140
|
-
const suppressEnterAutoSave = activeElement.getAttribute("data-
|
|
140
|
+
const suppressEnterAutoSave = activeElement.getAttribute("data-disableenterautosave") || isTextArea;
|
|
141
141
|
const allowTabToSave = activeElement.getAttribute("data-allowtabtoSave");
|
|
142
142
|
const invokeSave = (reason: string) => {
|
|
143
143
|
if (!saveButtonRef?.current) return;
|
|
@@ -99,7 +99,7 @@ export const FormTest = (props: CellEditorCommon): JSX.Element => {
|
|
|
99
99
|
</div>
|
|
100
100
|
<div style={{ marginTop: 25 }}>
|
|
101
101
|
<input
|
|
102
|
-
data-
|
|
102
|
+
data-disableenterautosave
|
|
103
103
|
type="button"
|
|
104
104
|
style={{ height: 48 }}
|
|
105
105
|
onClick={() => setShowModal(true)}
|