@linzjs/step-ag-grid 7.11.10 → 7.11.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/package.json
CHANGED
|
@@ -64,7 +64,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
64
64
|
|
|
65
65
|
// Save triggers during async action processing which triggers another selectItem(), this ref blocks that
|
|
66
66
|
const [filter, setFilter] = useState("");
|
|
67
|
-
const [filteredValues, setFilteredValues] = useState<any[]>(
|
|
67
|
+
const [filteredValues, setFilteredValues] = useState<any[]>();
|
|
68
68
|
const optionsInitialising = useRef(false);
|
|
69
69
|
const [options, setOptions] = useState<FinalSelectOption[] | null>(null);
|
|
70
70
|
const subComponentIsValid = useRef(false);
|
|
@@ -172,7 +172,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
172
172
|
await onSelectFilter({ selectedRows, value: filter });
|
|
173
173
|
return true;
|
|
174
174
|
} else {
|
|
175
|
-
if (filteredValues.length === 1) {
|
|
175
|
+
if (filteredValues && filteredValues.length === 1) {
|
|
176
176
|
if (filteredValues[0].subComponent) return false;
|
|
177
177
|
return await selectItemHandler(filteredValues[0].value, null);
|
|
178
178
|
}
|
|
@@ -214,7 +214,8 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
214
214
|
defaultValue={filter}
|
|
215
215
|
data-allowtabtosave={true}
|
|
216
216
|
data-disableenterautosave={
|
|
217
|
-
!props.onSelectFilter &&
|
|
217
|
+
!props.onSelectFilter &&
|
|
218
|
+
!(filteredValues && filteredValues.length === 1 && !filteredValues[0].subComponent)
|
|
218
219
|
}
|
|
219
220
|
onChange={(e) => setFilter(e.target.value)}
|
|
220
221
|
/>
|
|
@@ -229,7 +230,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
229
230
|
)}
|
|
230
231
|
<ComponentLoadingWrapper loading={!options} className={"GridFormDropDown-options"}>
|
|
231
232
|
<>
|
|
232
|
-
{options && isEmpty(filteredValues) && (
|
|
233
|
+
{options && filteredValues && isEmpty(filteredValues) && (
|
|
233
234
|
<MenuItem key={`${fieldToString(field)}-empty`} className={"GridPopoverEditDropDown-noOptions"}>
|
|
234
235
|
No Options
|
|
235
236
|
</MenuItem>
|
|
@@ -240,7 +241,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
240
241
|
) : item.value === MenuHeaderString ? (
|
|
241
242
|
<MenuHeader key={`$$header_${index}`}>{item.label}</MenuHeader>
|
|
242
243
|
) : (
|
|
243
|
-
filteredValues.includes(item) && (
|
|
244
|
+
(!filteredValues || filteredValues.includes(item)) && (
|
|
244
245
|
<div key={`menu-wrapper-${index}`}>
|
|
245
246
|
<MenuItem
|
|
246
247
|
key={`${fieldToString(field)}-${index}`}
|
|
@@ -264,21 +265,6 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
|
|
|
264
265
|
}
|
|
265
266
|
}}
|
|
266
267
|
>
|
|
267
|
-
{/*onClick={(e: ClickEvent) => {
|
|
268
|
-
if (item.subComponent) {
|
|
269
|
-
e.keepOpen = true;
|
|
270
|
-
} else {
|
|
271
|
-
clickItemHandler(
|
|
272
|
-
item.value,
|
|
273
|
-
undefined,
|
|
274
|
-
e.key === "Tab"
|
|
275
|
-
? e.shiftKey
|
|
276
|
-
? CloseReason.TAB_BACKWARD
|
|
277
|
-
: CloseReason.TAB_FORWARD
|
|
278
|
-
: CloseReason.CLICK,
|
|
279
|
-
).then();
|
|
280
|
-
}
|
|
281
|
-
}*/}
|
|
282
268
|
{item.label ?? (item.value == null ? `<${item.value}>` : `${item.value}`)}
|
|
283
269
|
{item.subComponent ? "..." : ""}
|
|
284
270
|
</MenuItem>
|