@linzjs/step-ag-grid 2.4.9 → 2.4.11
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 +15 -6
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +2 -2
- package/dist/step-ag-grid.esm.js +15 -6
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +11 -3
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +8 -4
package/package.json
CHANGED
|
@@ -256,14 +256,22 @@ export const GridFormDropDown = <RowType extends GridBaseRow, ValueType>(
|
|
|
256
256
|
}
|
|
257
257
|
setSubComponentValues(localSubComponentValues);
|
|
258
258
|
},
|
|
259
|
-
keyDown: (key: string) => {
|
|
259
|
+
keyDown: (key: string, event: KeyboardEvent<HTMLInputElement>) => {
|
|
260
260
|
const subComponentItem = subComponentValues.find(
|
|
261
261
|
({ optionValue }) => optionValue === item.value,
|
|
262
262
|
);
|
|
263
263
|
if ((key === "Enter" || key === "Tab") && subComponentItem) {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
event.stopPropagation();
|
|
266
|
+
return selectItemHandler(
|
|
267
|
+
item.value as ValueType,
|
|
268
|
+
subComponentItem.subComponentValue,
|
|
269
|
+
).then(() => {
|
|
270
|
+
ref.closeMenu();
|
|
271
|
+
return true;
|
|
272
|
+
});
|
|
266
273
|
}
|
|
274
|
+
return false;
|
|
267
275
|
},
|
|
268
276
|
key: `${props.field}-${index}_subcomponent_inner`,
|
|
269
277
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import { useState, KeyboardEvent } from "react";
|
|
2
2
|
import { TextInputFormatted } from "../../lui/TextInputFormatted";
|
|
3
3
|
import "../../styles/GridFormSubComponentTextInput.scss";
|
|
4
4
|
|
|
5
5
|
export interface GridFormSubComponentTextInput {
|
|
6
6
|
setValue: (value: string) => void;
|
|
7
|
-
keyDown: (key: string) => void;
|
|
7
|
+
keyDown: (key: string, event: KeyboardEvent<HTMLInputElement>) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
className?: string;
|
|
10
10
|
customHelpText?: string;
|
|
@@ -27,6 +27,8 @@ export const GridFormSubComponentTextInput = ({
|
|
|
27
27
|
style={{
|
|
28
28
|
display: "flex",
|
|
29
29
|
flexDirection: "column",
|
|
30
|
+
width: "100%",
|
|
31
|
+
padding: 0,
|
|
30
32
|
}}
|
|
31
33
|
>
|
|
32
34
|
<TextInputFormatted
|
|
@@ -38,7 +40,9 @@ export const GridFormSubComponentTextInput = ({
|
|
|
38
40
|
setInputValue(value);
|
|
39
41
|
}}
|
|
40
42
|
inputProps={{
|
|
41
|
-
onKeyDown: (
|
|
43
|
+
onKeyDown: (e) => {
|
|
44
|
+
return keyDown(e.key, e);
|
|
45
|
+
},
|
|
42
46
|
placeholder: placeholderText,
|
|
43
47
|
onMouseEnter: (e) => {
|
|
44
48
|
if (document.activeElement != e.currentTarget) {
|
|
@@ -52,7 +56,7 @@ export const GridFormSubComponentTextInput = ({
|
|
|
52
56
|
/>
|
|
53
57
|
<span
|
|
54
58
|
style={{
|
|
55
|
-
fontSize: "0.
|
|
59
|
+
fontSize: "0.7rem",
|
|
56
60
|
}}
|
|
57
61
|
>
|
|
58
62
|
{helpText}
|