@bbl-digital/snorre 2.2.109 → 2.2.110
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,7 +31466,6 @@
|
|
31466
31466
|
css,
|
31467
31467
|
...props
|
31468
31468
|
}, ref) => {
|
31469
|
-
const customInputReferance = React.useRef(null);
|
31470
31469
|
const {
|
31471
31470
|
optionsHeight,
|
31472
31471
|
optionsRef
|
@@ -31481,15 +31480,8 @@
|
|
31481
31480
|
const onInputChange = e => {
|
31482
31481
|
setInputDirty(true);
|
31483
31482
|
setValueChanged(e.target.value);
|
31484
|
-
|
31485
|
-
if (props.
|
31486
|
-
// Maybe?
|
31487
|
-
setHighlightedIndex(0);
|
31488
|
-
}
|
31489
|
-
|
31490
|
-
if (props.onChange) {
|
31491
|
-
props.onChange(e);
|
31492
|
-
}
|
31483
|
+
if (props.values) setHighlightedIndex(0);
|
31484
|
+
if (props.onChange) props.onChange(e);
|
31493
31485
|
};
|
31494
31486
|
|
31495
31487
|
const handleOnInputClick = () => {
|
@@ -31563,16 +31555,6 @@
|
|
31563
31555
|
setHighlightedIndex(newHighlightIndex);
|
31564
31556
|
};
|
31565
31557
|
|
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
|
-
|
31576
31558
|
const handleEscape = () => {
|
31577
31559
|
setShowValues(false);
|
31578
31560
|
setHighlightedIndex(null);
|
@@ -31708,8 +31690,6 @@
|
|
31708
31690
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
31709
31691
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
31710
31692
|
}), props.renderCustomValueInput && jsxRuntime$1.jsx("div", {
|
31711
|
-
ref: customInputReferance,
|
31712
|
-
onBlur: handleCustomValueInputBlur,
|
31713
31693
|
children: props.renderCustomValueInput
|
31714
31694
|
})]
|
31715
31695
|
})]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
|
-
import React, { createRef,
|
2
|
+
import React, { createRef, useState } from 'react';
|
3
3
|
import { styles, ErrorMessage } from './styles';
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useDebounce } from '../utils/debounce';
|
@@ -17,7 +17,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
css,
|
18
18
|
...props
|
19
19
|
}, ref) => {
|
20
|
-
const customInputReferance = useRef(null);
|
21
20
|
const {
|
22
21
|
optionsHeight,
|
23
22
|
optionsRef
|
@@ -32,15 +31,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
32
31
|
const onInputChange = e => {
|
33
32
|
setInputDirty(true);
|
34
33
|
setValueChanged(e.target.value);
|
35
|
-
|
36
|
-
if (props.
|
37
|
-
// Maybe?
|
38
|
-
setHighlightedIndex(0);
|
39
|
-
}
|
40
|
-
|
41
|
-
if (props.onChange) {
|
42
|
-
props.onChange(e);
|
43
|
-
}
|
34
|
+
if (props.values) setHighlightedIndex(0);
|
35
|
+
if (props.onChange) props.onChange(e);
|
44
36
|
};
|
45
37
|
|
46
38
|
const handleOnInputClick = () => {
|
@@ -114,16 +106,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
114
106
|
setHighlightedIndex(newHighlightIndex);
|
115
107
|
};
|
116
108
|
|
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
|
-
|
127
109
|
const handleEscape = () => {
|
128
110
|
setShowValues(false);
|
129
111
|
setHighlightedIndex(null);
|
@@ -262,8 +244,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
262
244
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
263
245
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
264
246
|
}), props.renderCustomValueInput && _jsx("div", {
|
265
|
-
ref: customInputReferance,
|
266
|
-
onBlur: handleCustomValueInputBlur,
|
267
247
|
children: props.renderCustomValueInput
|
268
248
|
})]
|
269
249
|
})]
|
@@ -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,EAAa,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAK3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAKjD,UAAU,MAAM;IACd,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gCAAgC;IAChC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACxD,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACzD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,CA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;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,CAsRjC,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
|
-
import React, { createRef,
|
2
|
+
import React, { createRef, useState } from 'react';
|
3
3
|
import { styles, ErrorMessage } from './styles';
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useDebounce } from '../utils/debounce';
|
@@ -17,7 +17,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
css,
|
18
18
|
...props
|
19
19
|
}, ref) => {
|
20
|
-
const customInputReferance = useRef(null);
|
21
20
|
const {
|
22
21
|
optionsHeight,
|
23
22
|
optionsRef
|
@@ -32,15 +31,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
32
31
|
const onInputChange = e => {
|
33
32
|
setInputDirty(true);
|
34
33
|
setValueChanged(e.target.value);
|
35
|
-
|
36
|
-
if (props.
|
37
|
-
// Maybe?
|
38
|
-
setHighlightedIndex(0);
|
39
|
-
}
|
40
|
-
|
41
|
-
if (props.onChange) {
|
42
|
-
props.onChange(e);
|
43
|
-
}
|
34
|
+
if (props.values) setHighlightedIndex(0);
|
35
|
+
if (props.onChange) props.onChange(e);
|
44
36
|
};
|
45
37
|
|
46
38
|
const handleOnInputClick = () => {
|
@@ -114,16 +106,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
114
106
|
setHighlightedIndex(newHighlightIndex);
|
115
107
|
};
|
116
108
|
|
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
|
-
|
127
109
|
const handleEscape = () => {
|
128
110
|
setShowValues(false);
|
129
111
|
setHighlightedIndex(null);
|
@@ -262,8 +244,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
|
|
262
244
|
children: props.labelFromValues ? item[props.labelFromValues] : item.label
|
263
245
|
}, props.keyFromValues ? item[props.keyFromValues] : item.key))
|
264
246
|
}), props.renderCustomValueInput && _jsx("div", {
|
265
|
-
ref: customInputReferance,
|
266
|
-
onBlur: handleCustomValueInputBlur,
|
267
247
|
children: props.renderCustomValueInput
|
268
248
|
})]
|
269
249
|
})]
|