@mackin.com/styleguide 8.11.0 → 8.11.1
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/index.js +6 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -891,17 +891,17 @@ const TabLocker = (props) => {
|
|
|
891
891
|
const defaultMaxShownValues = 7;
|
|
892
892
|
const buttonMarkerClass = 'ListItem__button';
|
|
893
893
|
const Autocomplete = (p) => {
|
|
894
|
-
var _a;
|
|
894
|
+
var _a, _b;
|
|
895
895
|
const theme = useThemeSafely();
|
|
896
896
|
const element = React__namespace.useRef(null);
|
|
897
897
|
const input = React__namespace.useRef(null);
|
|
898
898
|
const list = React__namespace.useRef(null);
|
|
899
899
|
const [values, setValues] = React__namespace.useState([]);
|
|
900
900
|
const showValues = React__namespace.useMemo(() => values.length > 0, [values]);
|
|
901
|
+
const maxShowValues = (_a = p.maxShownValues) !== null && _a !== void 0 ? _a : defaultMaxShownValues;
|
|
901
902
|
const shownValues = React__namespace.useMemo(() => {
|
|
902
|
-
var _a;
|
|
903
903
|
if (!p.allowScroll) {
|
|
904
|
-
return values.slice(0,
|
|
904
|
+
return values.slice(0, maxShowValues);
|
|
905
905
|
}
|
|
906
906
|
return values.slice();
|
|
907
907
|
}, [values]);
|
|
@@ -917,7 +917,7 @@ const Autocomplete = (p) => {
|
|
|
917
917
|
else {
|
|
918
918
|
setValues([]);
|
|
919
919
|
}
|
|
920
|
-
}, (
|
|
920
|
+
}, (_b = p.getOptionsDebounceMs) !== null && _b !== void 0 ? _b : 0, { leading: false, trailing: true }));
|
|
921
921
|
const getNextTabElement = (fromIndex, direction) => {
|
|
922
922
|
var _a, _b, _c;
|
|
923
923
|
if (fromIndex === -1) {
|
|
@@ -1003,9 +1003,9 @@ const Autocomplete = (p) => {
|
|
|
1003
1003
|
borderBottomRightRadius: listBorderRadius,
|
|
1004
1004
|
borderBottomLeftRadius: listBorderRadius,
|
|
1005
1005
|
}
|
|
1006
|
-
}), p.allowScroll && css.css({
|
|
1006
|
+
}), p.allowScroll && shownValues.length > maxShowValues && css.css({
|
|
1007
1007
|
overflowY: 'scroll',
|
|
1008
|
-
maxHeight: `calc(${theme.controls.height} * ${
|
|
1008
|
+
maxHeight: `calc(${theme.controls.height} * ${maxShowValues})`
|
|
1009
1009
|
})) },
|
|
1010
1010
|
shownValues.map((value, listItemIndex) => {
|
|
1011
1011
|
return (React__namespace.createElement(ListItem, { key: getAutocompleteValueId(value), variant: "full" },
|