@linzjs/step-ag-grid 4.0.2 → 5.0.0
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 +325 -265
- package/dist/index.js.map +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +2 -13
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +0 -1
- package/dist/src/contexts/GridContext.d.ts +1 -0
- package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
- package/dist/src/contexts/GridUpdatingContext.d.ts +3 -2
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
- package/dist/src/lui/FormError.d.ts +6 -0
- package/dist/src/react-menu3/components/MenuItem.d.ts +1 -1
- package/dist/src/react-menu3/components/SubMenu.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
- package/dist/src/react-menu3/types.d.ts +18 -17
- package/dist/src/react-menu3/utils/constants.d.ts +4 -0
- package/dist/src/react-menu3/utils/utils.d.ts +1 -1
- package/dist/step-ag-grid.esm.js +326 -266
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridPopoverHook.tsx +30 -79
- package/src/components/gridForm/GridFormDropDown.tsx +62 -46
- package/src/components/gridForm/GridFormEditBearing.tsx +16 -8
- package/src/components/gridForm/GridFormMultiSelect.tsx +12 -4
- package/src/components/gridForm/GridFormPopoverMenu.tsx +25 -22
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +1 -14
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +1 -18
- package/src/components/gridForm/GridFormTextArea.tsx +8 -5
- package/src/components/gridForm/GridFormTextInput.tsx +8 -4
- package/src/contexts/GridContext.tsx +4 -0
- package/src/contexts/GridContextProvider.tsx +8 -0
- package/src/contexts/GridPopoverContext.tsx +1 -1
- package/src/contexts/GridPopoverContextProvider.tsx +7 -4
- package/src/contexts/GridUpdatingContext.tsx +7 -1
- package/src/contexts/GridUpdatingContextProvider.tsx +17 -6
- package/src/lui/FormError.tsx +29 -0
- package/src/lui/TextAreaInput.tsx +2 -18
- package/src/lui/TextInputFormatted.tsx +2 -17
- package/src/react-menu3/components/ControlledMenu.tsx +114 -12
- package/src/react-menu3/components/MenuItem.tsx +19 -2
- package/src/react-menu3/types.ts +2 -0
- package/src/react-menu3/utils/constants.ts +4 -0
- package/src/stories/grid/FormTest.tsx +24 -21
- package/src/stories/grid/GridPopoutBearing.stories.tsx +3 -2
- package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +10 -0
- package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +1 -1
- package/src/stories/grid/GridReadOnly.stories.tsx +11 -11
- package/src/styles/GridFormDropDown.scss +1 -1
- package/src/utils/bearing.ts +1 -1
|
@@ -81,7 +81,7 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
|
|
|
81
81
|
{
|
|
82
82
|
value: "other",
|
|
83
83
|
label: "Other",
|
|
84
|
-
subComponent: () => <GridFormSubComponentTextArea maxLength={5} defaultValue={""} />,
|
|
84
|
+
subComponent: () => <GridFormSubComponentTextArea required={true} maxLength={5} defaultValue={""} />,
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
87
|
initialSelectedValues: () => ({
|
|
@@ -109,7 +109,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
109
109
|
alert(`Single-edit: ${selectedRows.length} rows`);
|
|
110
110
|
await wait(1500);
|
|
111
111
|
},
|
|
112
|
-
|
|
112
|
+
disabled: selectedItems.length > 1,
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
label: "Multi-edit",
|
|
@@ -117,36 +117,36 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
117
117
|
alert(`Multi-edit: ${selectedRows.length} rows`);
|
|
118
118
|
await wait(1500);
|
|
119
119
|
},
|
|
120
|
-
supportsMultiEdit: true,
|
|
121
120
|
},
|
|
122
121
|
{
|
|
123
122
|
label: "Disabled item",
|
|
124
123
|
disabled: "Disabled for test",
|
|
125
|
-
supportsMultiEdit: true,
|
|
126
124
|
},
|
|
127
125
|
{
|
|
128
126
|
label: "Developer Only",
|
|
129
127
|
hidden: selectedItems.some((x) => x.position != "Developer"),
|
|
130
|
-
supportsMultiEdit: true,
|
|
131
128
|
},
|
|
132
129
|
{
|
|
133
130
|
label: "Other (TextInput)",
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
action: async (_, menuOptionResult) => {
|
|
132
|
+
// eslint-disable-next-line no-console
|
|
133
|
+
console.log(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
|
|
134
|
+
await wait(500);
|
|
137
135
|
},
|
|
138
136
|
subComponent: () => (
|
|
139
|
-
<GridFormSubComponentTextInput placeholder={"Other"} maxLength={
|
|
137
|
+
<GridFormSubComponentTextInput placeholder={"Other"} maxLength={5} required defaultValue={""} />
|
|
140
138
|
),
|
|
141
139
|
},
|
|
142
140
|
{
|
|
143
141
|
label: "Other (TextArea)",
|
|
144
142
|
supportsMultiEdit: true,
|
|
145
|
-
action: (_, menuOptionResult) => {
|
|
146
|
-
|
|
143
|
+
action: async (_, menuOptionResult) => {
|
|
144
|
+
// eslint-disable-next-line no-console
|
|
145
|
+
console.log(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
|
|
146
|
+
await wait(500);
|
|
147
147
|
},
|
|
148
148
|
subComponent: () => (
|
|
149
|
-
<GridFormSubComponentTextArea placeholder={"Other"} maxLength={
|
|
149
|
+
<GridFormSubComponentTextArea placeholder={"Other"} maxLength={5} required defaultValue={""} />
|
|
150
150
|
),
|
|
151
151
|
},
|
|
152
152
|
] as MenuOption<ITestRow>[];
|
package/src/utils/bearing.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
|
|
2
2
|
|
|
3
3
|
export const bearingValueFormatter = (params: ValueFormatterParams): string => {
|
|
4
|
-
const value = params.value;
|
|
4
|
+
const value = typeof params.value == "string" ? parseFloat(params.value) : params.value;
|
|
5
5
|
if (value == null) {
|
|
6
6
|
return "-";
|
|
7
7
|
}
|