@linzjs/step-ag-grid 7.0.0 → 7.0.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.0.0",
5
+ "version": "7.0.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -71,7 +71,7 @@ export const GridCell = <RowType extends GridBaseRow, Props extends CellEditorCo
71
71
  suppressKeyboardEvent: (e) => {
72
72
  // It's important that aggrid doesn't trigger edit on enter
73
73
  // as the incorrect selected rows will be returned
74
- return e.event.key === "Enter";
74
+ return !["ArrowLeft", "ArrowRight", "ArrowDown", "ArrowUp", "Tab", " "].includes(e.event.key);
75
75
  },
76
76
  ...(custom?.editorParams && {
77
77
  cellEditorParams: { ...custom.editorParams, multiEdit: custom.multiEdit },
@@ -224,8 +224,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
224
224
  <div style={{ display: "flex", width: "100%" }}>
225
225
  <input
226
226
  autoFocus
227
- className={"free-text-input"}
228
- style={{ border: "0px" }}
227
+ className={"LuiTextInput-input"}
229
228
  ref={ref}
230
229
  type="text"
231
230
  placeholder={props.filterPlaceholder ?? "Placeholder"}
@@ -242,7 +241,9 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
242
241
  <ComponentLoadingWrapper loading={!options} className={"GridFormDropDown-options"}>
243
242
  <>
244
243
  {options && options.length == filteredValues?.length && (
245
- <MenuItem key={`${fieldToString(field)}-empty`}>[Empty]</MenuItem>
244
+ <MenuItem key={`${fieldToString(field)}-empty`} className={"GridPopoverEditDropDown-noOptions"}>
245
+ No Options
246
+ </MenuItem>
246
247
  )}
247
248
  {options?.map((item: FinalSelectOption, index) =>
248
249
  item.value === MenuSeparatorString ? (
@@ -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)}
@@ -16,3 +16,7 @@
16
16
  .GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options {
17
17
  overflow-y: auto;
18
18
  }
19
+
20
+ .GridPopoverEditDropDown-noOptions {
21
+ justify-content: center;
22
+ }