@bbl-digital/snorre 2.2.108 → 2.2.109
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/dist/bundle.js
CHANGED
@@ -31466,6 +31466,7 @@
|
|
31466
31466
|
css,
|
31467
31467
|
...props
|
31468
31468
|
}, ref) => {
|
31469
|
+
const customInputReferance = React.useRef(null);
|
31469
31470
|
const {
|
31470
31471
|
optionsHeight,
|
31471
31472
|
optionsRef
|
@@ -31562,6 +31563,16 @@
|
|
31562
31563
|
setHighlightedIndex(newHighlightIndex);
|
31563
31564
|
};
|
31564
31565
|
|
31566
|
+
const handleCustomValueInputBlur = e => {
|
31567
|
+
if (props.onBlur) {
|
31568
|
+
props.onBlur(e);
|
31569
|
+
}
|
31570
|
+
|
31571
|
+
if (!customInputReferance.current?.contains(e.target || e.relatedTarget)) {
|
31572
|
+
setShowValues(false);
|
31573
|
+
}
|
31574
|
+
};
|
31575
|
+
|
31565
31576
|
const handleEscape = () => {
|
31566
31577
|
setShowValues(false);
|
31567
31578
|
setHighlightedIndex(null);
|
@@ -31697,6 +31708,8 @@
|
|
31697
31708
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
31698
31709
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
31699
31710
|
}), props.renderCustomValueInput && jsxRuntime$1.jsx("div", {
|
31711
|
+
ref: customInputReferance,
|
31712
|
+
onBlur: handleCustomValueInputBlur,
|
31700
31713
|
children: props.renderCustomValueInput
|
31701
31714
|
})]
|
31702
31715
|
})]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
|
-
import React, { createRef, useState } from 'react';
|
2
|
+
import React, { createRef, useRef, useState } from 'react';
|
3
3
|
import { styles, ErrorMessage } from './styles';
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useDebounce } from '../utils/debounce';
|
@@ -17,6 +17,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
css,
|
18
18
|
...props
|
19
19
|
}, ref) => {
|
20
|
+
const customInputReferance = useRef(null);
|
20
21
|
const {
|
21
22
|
optionsHeight,
|
22
23
|
optionsRef
|
@@ -113,6 +114,16 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
113
114
|
setHighlightedIndex(newHighlightIndex);
|
114
115
|
};
|
115
116
|
|
117
|
+
const handleCustomValueInputBlur = e => {
|
118
|
+
if (props.onBlur) {
|
119
|
+
props.onBlur(e);
|
120
|
+
}
|
121
|
+
|
122
|
+
if (!customInputReferance.current?.contains(e.target || e.relatedTarget)) {
|
123
|
+
setShowValues(false);
|
124
|
+
}
|
125
|
+
};
|
126
|
+
|
116
127
|
const handleEscape = () => {
|
117
128
|
setShowValues(false);
|
118
129
|
setHighlightedIndex(null);
|
@@ -251,6 +262,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
251
262
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
252
263
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
253
264
|
}), props.renderCustomValueInput && _jsx("div", {
|
265
|
+
ref: customInputReferance,
|
266
|
+
onBlur: handleCustomValueInputBlur,
|
254
267
|
children: props.renderCustomValueInput
|
255
268
|
})]
|
256
269
|
})]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAEZ,YAAY,EACZ,SAAS,EAGV,MAAM,OAAO,CAAA;AAKd,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAKjD,UAAU,MAAM;IACd,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM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AU,CAAC,EAAE,OAAO,CAAA;IACpB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAA;IAClB,wCAAwC;IACxC,aAAa,CAAC,EAAE,SAAS,EAAE,CAAA;IAC3B,kCAAkC;IAClC,sBAAsB,CAAC,EAAE,SAAS,CAAA;IAClC,yBAAyB;IACzB,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,CAAA;IAC9D,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oCAAoC;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,oBAAY,GAAG,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAA;AAEhD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAkTjC,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
|
-
import React, { createRef, useState } from 'react';
|
2
|
+
import React, { createRef, useRef, useState } from 'react';
|
3
3
|
import { styles, ErrorMessage } from './styles';
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useDebounce } from '../utils/debounce';
|
@@ -17,6 +17,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
css,
|
18
18
|
...props
|
19
19
|
}, ref) => {
|
20
|
+
const customInputReferance = useRef(null);
|
20
21
|
const {
|
21
22
|
optionsHeight,
|
22
23
|
optionsRef
|
@@ -113,6 +114,16 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
113
114
|
setHighlightedIndex(newHighlightIndex);
|
114
115
|
};
|
115
116
|
|
117
|
+
const handleCustomValueInputBlur = e => {
|
118
|
+
if (props.onBlur) {
|
119
|
+
props.onBlur(e);
|
120
|
+
}
|
121
|
+
|
122
|
+
if (!customInputReferance.current?.contains(e.target || e.relatedTarget)) {
|
123
|
+
setShowValues(false);
|
124
|
+
}
|
125
|
+
};
|
126
|
+
|
116
127
|
const handleEscape = () => {
|
117
128
|
setShowValues(false);
|
118
129
|
setHighlightedIndex(null);
|
@@ -251,6 +262,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
251
262
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
252
263
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
253
264
|
}), props.renderCustomValueInput && _jsx("div", {
|
265
|
+
ref: customInputReferance,
|
266
|
+
onBlur: handleCustomValueInputBlur,
|
254
267
|
children: props.renderCustomValueInput
|
255
268
|
})]
|
256
269
|
})]
|