@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/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/src/lui/ActionButton.d.ts +3 -2
- package/dist/step-ag-grid.esm.js +8 -8
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridCell.tsx +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +4 -3
- 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/src/styles/GridFormDropDown.scss +4 -0
package/package.json
CHANGED
|
@@ -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
|
|
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={"
|
|
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`}>
|
|
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
|
+
|
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)}
|