@algolia/satellite 2.0.0-rc.1 → 2.0.0-rc.2
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.
@@ -330,15 +330,16 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
330
330
|
oldHideMenu.current = hideMenu;
|
331
331
|
void ((_menuPopper$update2 = menuPopper.update) === null || _menuPopper$update2 === void 0 ? void 0 : _menuPopper$update2.call(menuPopper));
|
332
332
|
}
|
333
|
+
var setContainerEl = (0, _react.useCallback)(function (el) {
|
334
|
+
setContainerElement(el);
|
335
|
+
// @ts-expect-error - setContainerMeasureRef does accept HTMLDivElement | null
|
336
|
+
setContainerMeasureRef(el);
|
337
|
+
}, [setContainerMeasureRef]);
|
333
338
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteContext.AutoCompleteProvider, {
|
334
339
|
locale: locale,
|
335
340
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
336
341
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["flex"]))), className),
|
337
|
-
ref:
|
338
|
-
setContainerElement(el);
|
339
|
-
// @ts-expect-error - setContainerMeasureRef does accept HTMLDivElement | null
|
340
|
-
setContainerMeasureRef(el);
|
341
|
-
},
|
342
|
+
ref: setContainerEl,
|
342
343
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
343
344
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["autocomplete-container"]))), inputFocused && (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["focusable-show"]))), variant === "large" && (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["autocomplete-large py-1"]))), disabled && (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["autocomplete-disabled"]))), isInvalid && (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["autocomplete-invalid"]))), noWrap && (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["autocomplete-nowrap"])))),
|
344
345
|
onClick: function onClick() {
|
@@ -7,6 +7,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
8
8
|
import cx from "clsx";
|
9
9
|
import { useCombobox, useMultipleSelection } from "downshift";
|
10
|
+
import { useCallback } from "react";
|
10
11
|
import { forwardRef } from "react";
|
11
12
|
import { Fragment } from "react";
|
12
13
|
import { useEffect, useMemo, useRef, useState } from "react";
|
@@ -325,15 +326,16 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
325
326
|
oldHideMenu.current = hideMenu;
|
326
327
|
void ((_menuPopper$update2 = menuPopper.update) === null || _menuPopper$update2 === void 0 ? void 0 : _menuPopper$update2.call(menuPopper));
|
327
328
|
}
|
329
|
+
var setContainerEl = useCallback(function (el) {
|
330
|
+
setContainerElement(el);
|
331
|
+
// @ts-expect-error - setContainerMeasureRef does accept HTMLDivElement | null
|
332
|
+
setContainerMeasureRef(el);
|
333
|
+
}, [setContainerMeasureRef]);
|
328
334
|
return /*#__PURE__*/_jsx(AutoCompleteProvider, {
|
329
335
|
locale: locale,
|
330
336
|
children: /*#__PURE__*/_jsxs("div", {
|
331
337
|
className: cx(stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["flex"]))), className),
|
332
|
-
ref:
|
333
|
-
setContainerElement(el);
|
334
|
-
// @ts-expect-error - setContainerMeasureRef does accept HTMLDivElement | null
|
335
|
-
setContainerMeasureRef(el);
|
336
|
-
},
|
338
|
+
ref: setContainerEl,
|
337
339
|
children: [/*#__PURE__*/_jsxs("div", {
|
338
340
|
className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["autocomplete-container"]))), inputFocused && stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["focusable-show"]))), variant === "large" && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["autocomplete-large py-1"]))), disabled && stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["autocomplete-disabled"]))), isInvalid && stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["autocomplete-invalid"]))), noWrap && stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["autocomplete-nowrap"])))),
|
339
341
|
onClick: function onClick() {
|