@m4l/components 9.4.27 → 9.4.28
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/components/extended/mui/Autocomplete/Autocomplete.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/constants.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/dictionary.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/hooks/useMultipleChips.js +13 -10
- package/components/extended/mui/Autocomplete/hooks/useMultipleChips.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.js +0 -5
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/icons.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/subcomponents/LoadingText/LoadingText.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/subcomponents/NoOptionsText/NoOptionsText.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/subcomponents/PopperComponent/PopperComponent.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.js +2 -1
- package/components/extended/mui/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.test.d.ts +1 -0
- package/components/extended/mui/Autocomplete/subcomponents/renderOptions/renderOptions.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,7 +15,7 @@ function useMultipleChips(props) {
|
|
|
15
15
|
getOptionStartAdornment,
|
|
16
16
|
getOptionEndAdornment
|
|
17
17
|
} = props;
|
|
18
|
-
const
|
|
18
|
+
const externalStartAdornment = useMemo(() => {
|
|
19
19
|
if (!startAdornment) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
@@ -53,7 +53,7 @@ function useMultipleChips(props) {
|
|
|
53
53
|
getOptionEndAdornment,
|
|
54
54
|
adjustedSize
|
|
55
55
|
]);
|
|
56
|
-
const
|
|
56
|
+
const selectedOptionStartAdornment = useMemo(() => {
|
|
57
57
|
if (multiple || !selectedValue || Array.isArray(selectedValue) && selectedValue.length === 0) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
@@ -69,7 +69,7 @@ function useMultipleChips(props) {
|
|
|
69
69
|
getOptionStartAdornment,
|
|
70
70
|
adjustedSize
|
|
71
71
|
]);
|
|
72
|
-
const
|
|
72
|
+
const multipleSelectionChips = useMemo(() => {
|
|
73
73
|
if (!(Array.isArray(selectedValue) && multiple && selectedValue.length > 0)) {
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
@@ -100,18 +100,21 @@ function useMultipleChips(props) {
|
|
|
100
100
|
ownerState,
|
|
101
101
|
memoizedIcons
|
|
102
102
|
]);
|
|
103
|
-
if (
|
|
103
|
+
if (externalStartAdornment && multipleSelectionChips) {
|
|
104
104
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
-
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children:
|
|
106
|
-
|
|
105
|
+
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children: externalStartAdornment }),
|
|
106
|
+
multipleSelectionChips
|
|
107
107
|
] });
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
109
|
+
if (externalStartAdornment) {
|
|
110
110
|
return /* @__PURE__ */ jsxs(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children: [
|
|
111
|
-
|
|
112
|
-
!multiple &&
|
|
111
|
+
externalStartAdornment,
|
|
112
|
+
!multiple && selectedOptionStartAdornment
|
|
113
113
|
] });
|
|
114
114
|
}
|
|
115
|
+
if (!multiple && selectedOptionStartAdornment && !externalStartAdornment) {
|
|
116
|
+
return /* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", ownerState, children: selectedOptionStartAdornment });
|
|
117
|
+
}
|
|
115
118
|
if (!getOptionLabelLocal) {
|
|
116
119
|
console.error("useStartAdornments: getOptionLabelLocal is required");
|
|
117
120
|
return null;
|
|
@@ -120,7 +123,7 @@ function useMultipleChips(props) {
|
|
|
120
123
|
console.error("useStartAdornments: handleDelete is required");
|
|
121
124
|
return null;
|
|
122
125
|
}
|
|
123
|
-
return
|
|
126
|
+
return multipleSelectionChips;
|
|
124
127
|
}
|
|
125
128
|
export {
|
|
126
129
|
useMultipleChips as u
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -126,11 +126,6 @@ function useValuesAndHandlers(props) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}, [readOnly, value, getOptionLabelLocal, multiple, inputValue]);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
if (open === false && value === null && inputValue !== "") {
|
|
131
|
-
setInputValue("");
|
|
132
|
-
}
|
|
133
|
-
}, [value, open, inputValue]);
|
|
134
129
|
const checkKeyDown = (e) => {
|
|
135
130
|
if (e.code === "Enter") {
|
|
136
131
|
e.preventDefault();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/extended/mui/Autocomplete/subcomponents/NoOptionsText/NoOptionsText.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/extended/mui/Autocomplete/subcomponents/PopperComponent/PopperComponent.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/extended/mui/Autocomplete/subcomponents/RenderAdornment/RenderAdornment.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/extended/mui/Autocomplete/subcomponents/renderOptions/renderOptions.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|