@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/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.0.0",
5
+ "version": "7.0.1",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -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
+
@@ -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("lui-button-icon-right", "ActionButton", className, localInProgress && "ActionButton-inProgress")}
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 ? { padding: "8px 5px" } : {}}
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-disableenterautoSave") || isTextArea;
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;
@@ -28,6 +28,8 @@ const ActionButtonTemplate: ComponentStory<typeof ActionButton> = () => {
28
28
  onAction={performAction}
29
29
  iconPosition={"right"}
30
30
  level={"secondary"}
31
+ className={"ActionButton-fill"}
32
+ style={{ maxWidth: 160 }}
31
33
  />
32
34
  </>
33
35
  );
@@ -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-disableEnterAutoSave
102
+ data-disableenterautosave
103
103
  type="button"
104
104
  style={{ height: 48 }}
105
105
  onClick={() => setShowModal(true)}