@equinor/eds-core-react 0.29.1 → 0.29.2-dev09022023
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.
|
@@ -8308,7 +8308,6 @@ function AutocompleteInner(props, ref) {
|
|
|
8308
8308
|
_props$multiline = props.multiline,
|
|
8309
8309
|
multiline = _props$multiline === void 0 ? false : _props$multiline,
|
|
8310
8310
|
other = _objectWithoutProperties__default["default"](props, _excluded$5);
|
|
8311
|
-
var anchorRef = react.useRef(null);
|
|
8312
8311
|
var isControlled = Boolean(selectedOptions);
|
|
8313
8312
|
var _useState = react.useState(options),
|
|
8314
8313
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
@@ -8586,14 +8585,9 @@ function AutocompleteInner(props, ref) {
|
|
|
8586
8585
|
y = _useFloating.y,
|
|
8587
8586
|
refs = _useFloating.refs,
|
|
8588
8587
|
update = _useFloating.update,
|
|
8589
|
-
reference = _useFloating.reference,
|
|
8590
|
-
floating = _useFloating.floating,
|
|
8591
8588
|
strategy = _useFloating.strategy;
|
|
8592
8589
|
var _useInteractions = react$1.useInteractions([]),
|
|
8593
8590
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
8594
|
-
react.useEffect(function () {
|
|
8595
|
-
reference(anchorRef.current);
|
|
8596
|
-
}, [anchorRef, reference]);
|
|
8597
8591
|
react.useEffect(function () {
|
|
8598
8592
|
if (refs.reference.current && refs.floating.current && isOpen) {
|
|
8599
8593
|
return react$1.autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
@@ -8609,7 +8603,7 @@ function AutocompleteInner(props, ref) {
|
|
|
8609
8603
|
return selectedItems.map(getLabel);
|
|
8610
8604
|
}, [selectedItems, getLabel]);
|
|
8611
8605
|
var optionsList = /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread__default["default"](_objectSpread__default["default"]({}, getFloatingProps({
|
|
8612
|
-
ref:
|
|
8606
|
+
ref: refs.setFloating,
|
|
8613
8607
|
style: {
|
|
8614
8608
|
position: strategy,
|
|
8615
8609
|
top: y || 0,
|
|
@@ -8677,7 +8671,7 @@ function AutocompleteInner(props, ref) {
|
|
|
8677
8671
|
getDropdownProps({
|
|
8678
8672
|
preventKeyAction: multiple ? isOpen : undefined,
|
|
8679
8673
|
disabled: disabled,
|
|
8680
|
-
ref: refs.
|
|
8674
|
+
ref: refs.setReference,
|
|
8681
8675
|
onChange: function onChange(e) {
|
|
8682
8676
|
var _e$currentTarget;
|
|
8683
8677
|
return setTypedInputValue(e === null || e === void 0 ? void 0 : (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.value);
|
|
@@ -2,7 +2,7 @@ import _typeof from '@babel/runtime/helpers/typeof';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
|
-
import { forwardRef,
|
|
5
|
+
import { forwardRef, useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
6
6
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
7
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
8
8
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
@@ -129,7 +129,6 @@ function AutocompleteInner(props, ref) {
|
|
|
129
129
|
_props$multiline = props.multiline,
|
|
130
130
|
multiline = _props$multiline === void 0 ? false : _props$multiline,
|
|
131
131
|
other = _objectWithoutProperties(props, _excluded);
|
|
132
|
-
var anchorRef = useRef(null);
|
|
133
132
|
var isControlled = Boolean(selectedOptions);
|
|
134
133
|
var _useState = useState(options),
|
|
135
134
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -407,14 +406,9 @@ function AutocompleteInner(props, ref) {
|
|
|
407
406
|
y = _useFloating.y,
|
|
408
407
|
refs = _useFloating.refs,
|
|
409
408
|
update = _useFloating.update,
|
|
410
|
-
reference = _useFloating.reference,
|
|
411
|
-
floating = _useFloating.floating,
|
|
412
409
|
strategy = _useFloating.strategy;
|
|
413
410
|
var _useInteractions = useInteractions([]),
|
|
414
411
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
415
|
-
useEffect(function () {
|
|
416
|
-
reference(anchorRef.current);
|
|
417
|
-
}, [anchorRef, reference]);
|
|
418
412
|
useEffect(function () {
|
|
419
413
|
if (refs.reference.current && refs.floating.current && isOpen) {
|
|
420
414
|
return autoUpdate(refs.reference.current, refs.floating.current, update);
|
|
@@ -430,7 +424,7 @@ function AutocompleteInner(props, ref) {
|
|
|
430
424
|
return selectedItems.map(getLabel);
|
|
431
425
|
}, [selectedItems, getLabel]);
|
|
432
426
|
var optionsList = /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, getFloatingProps({
|
|
433
|
-
ref:
|
|
427
|
+
ref: refs.setFloating,
|
|
434
428
|
style: {
|
|
435
429
|
position: strategy,
|
|
436
430
|
top: y || 0,
|
|
@@ -498,7 +492,7 @@ function AutocompleteInner(props, ref) {
|
|
|
498
492
|
getDropdownProps({
|
|
499
493
|
preventKeyAction: multiple ? isOpen : undefined,
|
|
500
494
|
disabled: disabled,
|
|
501
|
-
ref: refs.
|
|
495
|
+
ref: refs.setReference,
|
|
502
496
|
onChange: function onChange(e) {
|
|
503
497
|
var _e$currentTarget;
|
|
504
498
|
return setTypedInputValue(e === null || e === void 0 ? void 0 : (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2-dev09022023",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@babel/runtime": "^7.20.7",
|
|
82
|
-
"@floating-ui/react": "^0.
|
|
83
|
-
"@tanstack/react-virtual": "3.0.0-beta.
|
|
84
|
-
"downshift": "^7.
|
|
82
|
+
"@floating-ui/react": "^0.19.1",
|
|
83
|
+
"@tanstack/react-virtual": "3.0.0-beta.45",
|
|
84
|
+
"downshift": "^7.2.0",
|
|
85
85
|
"@equinor/eds-icons": "0.18.0",
|
|
86
86
|
"@equinor/eds-tokens": "0.9.0",
|
|
87
87
|
"@equinor/eds-utils": "0.7.0"
|