@dreamcommerce/aurora 3.0.0-259 → 3.0.0-260
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/build/cjs/packages/aurora/src/components/select/components/select_content.js +1 -1
- package/build/cjs/packages/aurora/src/components/select/components/select_item.js +1 -1
- package/build/cjs/packages/aurora/src/components/select/components/select_search.js +6 -31
- package/build/cjs/packages/aurora/src/components/select/components/select_search.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js +49 -0
- package/build/cjs/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/select/hooks/use_select_value.js +39 -0
- package/build/cjs/packages/aurora/src/components/select/hooks/use_select_value.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/select/select.js +14 -16
- package/build/cjs/packages/aurora/src/components/select/select.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/select_utils.js +6 -0
- package/build/cjs/packages/aurora/src/components/select/select_utils.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/components/select_content.js +2 -2
- package/build/esm/packages/aurora/src/components/select/components/select_item.js +1 -1
- package/build/esm/packages/aurora/src/components/select/components/select_search.js +7 -32
- package/build/esm/packages/aurora/src/components/select/components/select_search.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.d.ts +4 -0
- package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js +45 -0
- package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js.map +1 -0
- package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.d.ts +5 -0
- package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.js +35 -0
- package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.js.map +1 -0
- package/build/esm/packages/aurora/src/components/select/select.d.ts +1 -1
- package/build/esm/packages/aurora/src/components/select/select.js +14 -16
- package/build/esm/packages/aurora/src/components/select/select.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/select_types.d.ts +9 -1
- package/build/esm/packages/aurora/src/components/select/select_types.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/select_utils.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/select/select_utils.js +6 -0
- package/build/esm/packages/aurora/src/components/select/select_utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -83,7 +83,7 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
|
|
|
83
83
|
className: "aurora-p-2"
|
|
84
84
|
}, innerAdditionalContent)), /*#__PURE__*/React__default['default'].createElement(index.Scrollbar, {
|
|
85
85
|
orientation: "vertical",
|
|
86
|
-
className: cn.cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200 aurora-opacity-0 group-hover:aurora-opacity-75'
|
|
86
|
+
className: cn.cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200 aurora-opacity-0 group-hover:aurora-opacity-75')
|
|
87
87
|
}, /*#__PURE__*/React__default['default'].createElement(index.Thumb, {
|
|
88
88
|
className: "aurora-bg-neutral-700 aurora-rounded-full"
|
|
89
89
|
})))));
|
|
@@ -21,7 +21,7 @@ var SelectItem = /*#__PURE__*/React__default['default'].forwardRef(function (_re
|
|
|
21
21
|
additionalInfo = _ref.additionalInfo,
|
|
22
22
|
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
23
23
|
return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Item, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
24
|
-
className: cn.cn('aurora-relative aurora-flex aurora-w-full aurora-rounded-6 aurora-cursor-default aurora-select-none aurora-items-center aurora-rounded-sm aurora-py-1.5 aurora-pl-9 aurora-pr-8 aurora-text-
|
|
24
|
+
className: cn.cn('aurora-relative aurora-flex aurora-w-full aurora-rounded-6 aurora-cursor-default aurora-select-none aurora-items-center aurora-rounded-sm aurora-py-1.5 aurora-pl-9 aurora-pr-8 aurora-text-s aurora-outline-none aurora-break-words aurora-text-wrap focus:aurora-bg-hover focus:aurora-text-accent-foreground data-[disabled]:aurora-pointer-events-none data-[disabled]:aurora-opacity-50 hover:aurora-bg-hover data-[state=checked]:aurora-bg-hover data-[state=checked]:aurora-font-semibold', {
|
|
25
25
|
'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly
|
|
26
26
|
}, className),
|
|
27
27
|
style: {
|
|
@@ -6,47 +6,22 @@ var React = require('react');
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
7
|
var input = require('../../input/input.js');
|
|
8
8
|
var search_icon = require('../../../assets/icons/search_icon.js');
|
|
9
|
-
var
|
|
9
|
+
var use_prevent_search_blur = require('../hooks/use_prevent_search_blur.js');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
|
|
15
15
|
var _excluded = ["options"];
|
|
16
|
-
var BLUR_GUARD_TIMEOUT = 100;
|
|
17
16
|
var SelectSearch = function SelectSearch(_ref) {
|
|
18
17
|
var options = _ref.options,
|
|
19
18
|
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
var inputRef = React.useRef(null);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!blurGuardRef.current) return;
|
|
27
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
28
|
-
};
|
|
29
|
-
var optionsRef = React.useRef();
|
|
30
|
-
var timeoutRef = React.useRef();
|
|
31
|
-
// Uzycie useLayoutEffect ze wzgledu na to ze itemy na liscie moga sie zmienic po dluzszym czasie po wpisaniu w search
|
|
32
|
-
// np. moga byc wczytane z serwera
|
|
33
|
-
// Wiec nie mozemy sie podpiac pod onKeyDown i wtedy ustawiac timeout
|
|
34
|
-
React.useLayoutEffect(function () {
|
|
35
|
-
if (optionsRef.current === undefined) {
|
|
36
|
-
optionsRef.current = options;
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (!index.deepEqual(optionsRef.current, options)) {
|
|
40
|
-
optionsRef.current = options;
|
|
41
|
-
blurGuardRef.current = true;
|
|
42
|
-
timeoutRef.current = setTimeout(function () {
|
|
43
|
-
blurGuardRef.current = false;
|
|
44
|
-
}, BLUR_GUARD_TIMEOUT);
|
|
45
|
-
}
|
|
46
|
-
return function () {
|
|
47
|
-
return timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
48
|
-
};
|
|
49
|
-
}, [options]);
|
|
20
|
+
var _usePreventSearchBlur = use_prevent_search_blur.usePreventSearchBlur({
|
|
21
|
+
options: options,
|
|
22
|
+
inputRef: inputRef
|
|
23
|
+
}),
|
|
24
|
+
handleBlur = _usePreventSearchBlur.handleBlur;
|
|
50
25
|
return /*#__PURE__*/React__default['default'].createElement(input.Input, _rollupPluginBabelHelpers.objectSpread2({
|
|
51
26
|
ref: inputRef,
|
|
52
27
|
type: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../../../../../external/fast-equals/dist/esm/index.mjs.js');
|
|
7
|
+
|
|
8
|
+
var BLUR_GUARD_TIMEOUT = 100;
|
|
9
|
+
var usePreventSearchBlur = function usePreventSearchBlur(_ref) {
|
|
10
|
+
var options = _ref.options,
|
|
11
|
+
inputRef = _ref.inputRef;
|
|
12
|
+
// SHOPSVE-1360 (bardzo slaby hack)
|
|
13
|
+
// Radix w momencie usuniecia z dom aktualnie wybranego itemu przenosi focus na body
|
|
14
|
+
var blurGuardRef = React.useRef(false);
|
|
15
|
+
var handleBlur = React.useCallback(function () {
|
|
16
|
+
var _inputRef$current;
|
|
17
|
+
if (!blurGuardRef.current) return;
|
|
18
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
19
|
+
}, [inputRef]);
|
|
20
|
+
var optionsRef = React.useRef();
|
|
21
|
+
var timeoutRef = React.useRef();
|
|
22
|
+
// Uzycie useLayoutEffect ze wzgledu na to ze itemy na liscie moga sie zmienic po dluzszym czasie po wpisaniu w search
|
|
23
|
+
// np. moga byc wczytane z serwera
|
|
24
|
+
// Wiec nie mozemy sie podpiac pod onKeyDown i wtedy ustawiac timeout
|
|
25
|
+
React.useLayoutEffect(function () {
|
|
26
|
+
if (optionsRef.current === undefined) {
|
|
27
|
+
optionsRef.current = options;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!index.deepEqual(optionsRef.current, options)) {
|
|
31
|
+
optionsRef.current = options;
|
|
32
|
+
blurGuardRef.current = true;
|
|
33
|
+
timeoutRef.current = setTimeout(function () {
|
|
34
|
+
blurGuardRef.current = false;
|
|
35
|
+
}, BLUR_GUARD_TIMEOUT);
|
|
36
|
+
}
|
|
37
|
+
return function () {
|
|
38
|
+
return timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
39
|
+
};
|
|
40
|
+
}, [options]);
|
|
41
|
+
return React.useMemo(function () {
|
|
42
|
+
return {
|
|
43
|
+
handleBlur: handleBlur
|
|
44
|
+
};
|
|
45
|
+
}, [handleBlur]);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.usePreventSearchBlur = usePreventSearchBlur;
|
|
49
|
+
//# sourceMappingURL=use_prevent_search_blur.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,oBAAoB,8DAAkE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var select_utils = require('../select_utils.js');
|
|
8
|
+
|
|
9
|
+
var useSelectValue = function useSelectValue(_ref) {
|
|
10
|
+
var value = _ref.value,
|
|
11
|
+
options = _ref.options;
|
|
12
|
+
// Przechowanie aktualnie wybranej opcji w razie jakby przy wyszukiwaniu aktualna opcja zniknela z listy options
|
|
13
|
+
var _useState = React.useState(function () {
|
|
14
|
+
return select_utils.SelectUtils.findValueInOptions(value, options);
|
|
15
|
+
}),
|
|
16
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
17
|
+
selectedOption = _useState2[0],
|
|
18
|
+
_setSelectedOption = _useState2[1];
|
|
19
|
+
var selectedOptionRef = React.useRef(selectedOption);
|
|
20
|
+
var setSelectedOption = React.useCallback(function (option) {
|
|
21
|
+
selectedOptionRef.current = option;
|
|
22
|
+
_setSelectedOption(option);
|
|
23
|
+
}, []);
|
|
24
|
+
React.useEffect(function () {
|
|
25
|
+
var _selectedOptionRef$cu;
|
|
26
|
+
if (value === ((_selectedOptionRef$cu = selectedOptionRef.current) === null || _selectedOptionRef$cu === void 0 ? void 0 : _selectedOptionRef$cu.value)) return;
|
|
27
|
+
var option = select_utils.SelectUtils.findValueInOptions(value, options);
|
|
28
|
+
setSelectedOption(option);
|
|
29
|
+
}, [options, setSelectedOption, value]);
|
|
30
|
+
return React.useMemo(function () {
|
|
31
|
+
return {
|
|
32
|
+
selectedOption: selectedOption,
|
|
33
|
+
setSelectedOption: setSelectedOption
|
|
34
|
+
};
|
|
35
|
+
}, [selectedOption, setSelectedOption]);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.useSelectValue = useSelectValue;
|
|
39
|
+
//# sourceMappingURL=use_select_value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -9,12 +9,13 @@ var SelectPrimitive = require('@radix-ui/react-select');
|
|
|
9
9
|
var close_circle_fill_icon = require('../../assets/icons/close_circle_fill_icon.js');
|
|
10
10
|
var select_content = require('./components/select_content.js');
|
|
11
11
|
var select_trigger = require('./components/select_trigger.js');
|
|
12
|
+
var use_select_value = require('./hooks/use_select_value.js');
|
|
12
13
|
|
|
13
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
15
|
|
|
15
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
17
|
|
|
17
|
-
var _excluded = ["children", "id", "value", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "enableLocalSearch", "localSearchNotFoundContent", "errors", "onValueChange", "onScroll", "onSearch", "onClose"];
|
|
18
|
+
var _excluded = ["children", "id", "value", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "enableLocalSearch", "localSearchNotFoundContent", "errors", "onValueChange", "onScroll", "onSearch", "onClose", "hasError"];
|
|
18
19
|
var Select = function Select(_ref) {
|
|
19
20
|
var _selectedOption$value;
|
|
20
21
|
var children = _ref.children,
|
|
@@ -34,18 +35,18 @@ var Select = function Select(_ref) {
|
|
|
34
35
|
onScroll = _ref.onScroll,
|
|
35
36
|
onSearch = _ref.onSearch,
|
|
36
37
|
onClose = _ref.onClose,
|
|
38
|
+
hasError = _ref.hasError,
|
|
37
39
|
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
40
|
+
var _useSelectValue = use_select_value.useSelectValue({
|
|
41
|
+
value: value,
|
|
42
|
+
options: options
|
|
43
|
+
}),
|
|
44
|
+
selectedOption = _useSelectValue.selectedOption,
|
|
45
|
+
setSelectedOption = _useSelectValue.setSelectedOption;
|
|
46
|
+
var _useState = React.useState(''),
|
|
42
47
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _useState3 = React.useState(''),
|
|
46
|
-
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
47
|
-
search = _useState4[0],
|
|
48
|
-
setSearch = _useState4[1];
|
|
48
|
+
search = _useState2[0],
|
|
49
|
+
setSearch = _useState2[1];
|
|
49
50
|
var handleSearch = function handleSearch(str) {
|
|
50
51
|
setSearch(str);
|
|
51
52
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(str);
|
|
@@ -72,7 +73,7 @@ var Select = function Select(_ref) {
|
|
|
72
73
|
className: "aurora-relative aurora-flex aurora-items-center aurora-flex-col"
|
|
73
74
|
}, /*#__PURE__*/React__default['default'].createElement(select_trigger.SelectTrigger, {
|
|
74
75
|
id: id,
|
|
75
|
-
hasError: !!(errors !== null && errors !== void 0 && errors.length),
|
|
76
|
+
hasError: hasError || !!(errors !== null && errors !== void 0 && errors.length),
|
|
76
77
|
clearValueButton: value && hasClearValueButton && onValueChange && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
77
78
|
onPointerDown: function onPointerDown(e) {
|
|
78
79
|
return e.stopPropagation();
|
|
@@ -95,10 +96,7 @@ var Select = function Select(_ref) {
|
|
|
95
96
|
onSearch: handleSearch,
|
|
96
97
|
onScroll: onScroll,
|
|
97
98
|
enableLocalSearch: enableLocalSearch,
|
|
98
|
-
localSearchNotFoundContent: localSearchNotFoundContent
|
|
99
|
-
onCloseAutoFocus: function onCloseAutoFocus(e) {
|
|
100
|
-
return e.preventDefault();
|
|
101
|
-
}
|
|
99
|
+
localSearchNotFoundContent: localSearchNotFoundContent
|
|
102
100
|
}));
|
|
103
101
|
};
|
|
104
102
|
Select.displayName = SelectPrimitive.Root.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -28,6 +28,12 @@ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "localSearchIsHeaderVisibl
|
|
|
28
28
|
}
|
|
29
29
|
return visible;
|
|
30
30
|
});
|
|
31
|
+
_rollupPluginBabelHelpers.defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
|
|
32
|
+
if (!value) return undefined;
|
|
33
|
+
return options.find(function (opt) {
|
|
34
|
+
return opt.value === value;
|
|
35
|
+
});
|
|
36
|
+
});
|
|
31
37
|
|
|
32
38
|
exports.SelectUtils = SelectUtils;
|
|
33
39
|
//# sourceMappingURL=select_utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
3
|
import { cn } from '../../../utilities/cn.js';
|
|
4
4
|
import { Portal, Content, Viewport as Viewport$1 } from '@radix-ui/react-select';
|
|
5
5
|
import { Root, Viewport, Scrollbar, Thumb } from '../../../../../../external/@radix-ui/react-scroll-area/dist/index.mjs.js';
|
|
@@ -75,7 +75,7 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
75
75
|
className: "aurora-p-2"
|
|
76
76
|
}, innerAdditionalContent)), /*#__PURE__*/React.createElement(Scrollbar, {
|
|
77
77
|
orientation: "vertical",
|
|
78
|
-
className: cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200 aurora-opacity-0 group-hover:aurora-opacity-75'
|
|
78
|
+
className: cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200 aurora-opacity-0 group-hover:aurora-opacity-75')
|
|
79
79
|
}, /*#__PURE__*/React.createElement(Thumb, {
|
|
80
80
|
className: "aurora-bg-neutral-700 aurora-rounded-full"
|
|
81
81
|
})))));
|
|
@@ -13,7 +13,7 @@ var SelectItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13
13
|
additionalInfo = _ref.additionalInfo,
|
|
14
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
15
|
return /*#__PURE__*/React.createElement(Item, _objectSpread2(_objectSpread2({
|
|
16
|
-
className: cn('aurora-relative aurora-flex aurora-w-full aurora-rounded-6 aurora-cursor-default aurora-select-none aurora-items-center aurora-rounded-sm aurora-py-1.5 aurora-pl-9 aurora-pr-8 aurora-text-
|
|
16
|
+
className: cn('aurora-relative aurora-flex aurora-w-full aurora-rounded-6 aurora-cursor-default aurora-select-none aurora-items-center aurora-rounded-sm aurora-py-1.5 aurora-pl-9 aurora-pr-8 aurora-text-s aurora-outline-none aurora-break-words aurora-text-wrap focus:aurora-bg-hover focus:aurora-text-accent-foreground data-[disabled]:aurora-pointer-events-none data-[disabled]:aurora-opacity-50 hover:aurora-bg-hover data-[state=checked]:aurora-bg-hover data-[state=checked]:aurora-font-semibold', {
|
|
17
17
|
'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly
|
|
18
18
|
}, className),
|
|
19
19
|
style: {
|
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
import React, { useRef
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
3
|
import { Input } from '../../input/input.js';
|
|
4
4
|
import { SearchLineIcon } from '../../../assets/icons/search_icon.js';
|
|
5
|
-
import {
|
|
5
|
+
import { usePreventSearchBlur } from '../hooks/use_prevent_search_blur.js';
|
|
6
6
|
|
|
7
7
|
var _excluded = ["options"];
|
|
8
|
-
var BLUR_GUARD_TIMEOUT = 100;
|
|
9
8
|
var SelectSearch = function SelectSearch(_ref) {
|
|
10
9
|
var options = _ref.options,
|
|
11
10
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
11
|
var inputRef = useRef(null);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!blurGuardRef.current) return;
|
|
19
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
20
|
-
};
|
|
21
|
-
var optionsRef = useRef();
|
|
22
|
-
var timeoutRef = useRef();
|
|
23
|
-
// Uzycie useLayoutEffect ze wzgledu na to ze itemy na liscie moga sie zmienic po dluzszym czasie po wpisaniu w search
|
|
24
|
-
// np. moga byc wczytane z serwera
|
|
25
|
-
// Wiec nie mozemy sie podpiac pod onKeyDown i wtedy ustawiac timeout
|
|
26
|
-
useLayoutEffect(function () {
|
|
27
|
-
if (optionsRef.current === undefined) {
|
|
28
|
-
optionsRef.current = options;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (!deepEqual(optionsRef.current, options)) {
|
|
32
|
-
optionsRef.current = options;
|
|
33
|
-
blurGuardRef.current = true;
|
|
34
|
-
timeoutRef.current = setTimeout(function () {
|
|
35
|
-
blurGuardRef.current = false;
|
|
36
|
-
}, BLUR_GUARD_TIMEOUT);
|
|
37
|
-
}
|
|
38
|
-
return function () {
|
|
39
|
-
return timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
40
|
-
};
|
|
41
|
-
}, [options]);
|
|
12
|
+
var _usePreventSearchBlur = usePreventSearchBlur({
|
|
13
|
+
options: options,
|
|
14
|
+
inputRef: inputRef
|
|
15
|
+
}),
|
|
16
|
+
handleBlur = _usePreventSearchBlur.handleBlur;
|
|
42
17
|
return /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
43
18
|
ref: inputRef,
|
|
44
19
|
type: "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useMemo, useRef, useCallback, useLayoutEffect } from 'react';
|
|
2
|
+
import { deepEqual } from '../../../../../../external/fast-equals/dist/esm/index.mjs.js';
|
|
3
|
+
|
|
4
|
+
var BLUR_GUARD_TIMEOUT = 100;
|
|
5
|
+
var usePreventSearchBlur = function usePreventSearchBlur(_ref) {
|
|
6
|
+
var options = _ref.options,
|
|
7
|
+
inputRef = _ref.inputRef;
|
|
8
|
+
// SHOPSVE-1360 (bardzo slaby hack)
|
|
9
|
+
// Radix w momencie usuniecia z dom aktualnie wybranego itemu przenosi focus na body
|
|
10
|
+
var blurGuardRef = useRef(false);
|
|
11
|
+
var handleBlur = useCallback(function () {
|
|
12
|
+
var _inputRef$current;
|
|
13
|
+
if (!blurGuardRef.current) return;
|
|
14
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
15
|
+
}, [inputRef]);
|
|
16
|
+
var optionsRef = useRef();
|
|
17
|
+
var timeoutRef = useRef();
|
|
18
|
+
// Uzycie useLayoutEffect ze wzgledu na to ze itemy na liscie moga sie zmienic po dluzszym czasie po wpisaniu w search
|
|
19
|
+
// np. moga byc wczytane z serwera
|
|
20
|
+
// Wiec nie mozemy sie podpiac pod onKeyDown i wtedy ustawiac timeout
|
|
21
|
+
useLayoutEffect(function () {
|
|
22
|
+
if (optionsRef.current === undefined) {
|
|
23
|
+
optionsRef.current = options;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!deepEqual(optionsRef.current, options)) {
|
|
27
|
+
optionsRef.current = options;
|
|
28
|
+
blurGuardRef.current = true;
|
|
29
|
+
timeoutRef.current = setTimeout(function () {
|
|
30
|
+
blurGuardRef.current = false;
|
|
31
|
+
}, BLUR_GUARD_TIMEOUT);
|
|
32
|
+
}
|
|
33
|
+
return function () {
|
|
34
|
+
return timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
35
|
+
};
|
|
36
|
+
}, [options]);
|
|
37
|
+
return useMemo(function () {
|
|
38
|
+
return {
|
|
39
|
+
handleBlur: handleBlur
|
|
40
|
+
};
|
|
41
|
+
}, [handleBlur]);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { usePreventSearchBlur };
|
|
45
|
+
//# sourceMappingURL=use_prevent_search_blur.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,0BAA0B,8DAAkE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TSelectOption, TUseSelectValueProps } from "../select_types";
|
|
2
|
+
export declare const useSelectValue: ({ value, options }: TUseSelectValueProps) => {
|
|
3
|
+
selectedOption: TSelectOption | undefined;
|
|
4
|
+
setSelectedOption: (option: TSelectOption | undefined) => void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { slicedToArray as _slicedToArray } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { SelectUtils } from '../select_utils.js';
|
|
4
|
+
|
|
5
|
+
var useSelectValue = function useSelectValue(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
options = _ref.options;
|
|
8
|
+
// Przechowanie aktualnie wybranej opcji w razie jakby przy wyszukiwaniu aktualna opcja zniknela z listy options
|
|
9
|
+
var _useState = useState(function () {
|
|
10
|
+
return SelectUtils.findValueInOptions(value, options);
|
|
11
|
+
}),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
selectedOption = _useState2[0],
|
|
14
|
+
_setSelectedOption = _useState2[1];
|
|
15
|
+
var selectedOptionRef = useRef(selectedOption);
|
|
16
|
+
var setSelectedOption = useCallback(function (option) {
|
|
17
|
+
selectedOptionRef.current = option;
|
|
18
|
+
_setSelectedOption(option);
|
|
19
|
+
}, []);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
var _selectedOptionRef$cu;
|
|
22
|
+
if (value === ((_selectedOptionRef$cu = selectedOptionRef.current) === null || _selectedOptionRef$cu === void 0 ? void 0 : _selectedOptionRef$cu.value)) return;
|
|
23
|
+
var option = SelectUtils.findValueInOptions(value, options);
|
|
24
|
+
setSelectedOption(option);
|
|
25
|
+
}, [options, setSelectedOption, value]);
|
|
26
|
+
return useMemo(function () {
|
|
27
|
+
return {
|
|
28
|
+
selectedOption: selectedOption,
|
|
29
|
+
setSelectedOption: setSelectedOption
|
|
30
|
+
};
|
|
31
|
+
}, [selectedOption, setSelectedOption]);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { useSelectValue };
|
|
35
|
+
//# sourceMappingURL=use_select_value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { TSelectProps } from './select_types';
|
|
3
3
|
export declare const Select: {
|
|
4
|
-
({ children, id, value, options, disabled, placeholder, hasSearch, searchPlaceholder, hasClearValueButton, innerAdditionalContent, enableLocalSearch, localSearchNotFoundContent, errors, onValueChange, onScroll, onSearch, onClose, ...props }: PropsWithChildren<TSelectProps>): React.JSX.Element;
|
|
4
|
+
({ children, id, value, options, disabled, placeholder, hasSearch, searchPlaceholder, hasClearValueButton, innerAdditionalContent, enableLocalSearch, localSearchNotFoundContent, errors, onValueChange, onScroll, onSearch, onClose, hasError, ...props }: PropsWithChildren<TSelectProps>): React.JSX.Element;
|
|
5
5
|
displayName: string | undefined;
|
|
6
6
|
};
|
|
@@ -5,8 +5,9 @@ import { Root } from '@radix-ui/react-select';
|
|
|
5
5
|
import { CloseCircleFillIcon } from '../../assets/icons/close_circle_fill_icon.js';
|
|
6
6
|
import { SelectContent } from './components/select_content.js';
|
|
7
7
|
import { SelectTrigger } from './components/select_trigger.js';
|
|
8
|
+
import { useSelectValue } from './hooks/use_select_value.js';
|
|
8
9
|
|
|
9
|
-
var _excluded = ["children", "id", "value", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "enableLocalSearch", "localSearchNotFoundContent", "errors", "onValueChange", "onScroll", "onSearch", "onClose"];
|
|
10
|
+
var _excluded = ["children", "id", "value", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "enableLocalSearch", "localSearchNotFoundContent", "errors", "onValueChange", "onScroll", "onSearch", "onClose", "hasError"];
|
|
10
11
|
var Select = function Select(_ref) {
|
|
11
12
|
var _selectedOption$value;
|
|
12
13
|
var children = _ref.children,
|
|
@@ -26,18 +27,18 @@ var Select = function Select(_ref) {
|
|
|
26
27
|
onScroll = _ref.onScroll,
|
|
27
28
|
onSearch = _ref.onSearch,
|
|
28
29
|
onClose = _ref.onClose,
|
|
30
|
+
hasError = _ref.hasError,
|
|
29
31
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
32
|
+
var _useSelectValue = useSelectValue({
|
|
33
|
+
value: value,
|
|
34
|
+
options: options
|
|
35
|
+
}),
|
|
36
|
+
selectedOption = _useSelectValue.selectedOption,
|
|
37
|
+
setSelectedOption = _useSelectValue.setSelectedOption;
|
|
38
|
+
var _useState = useState(''),
|
|
34
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var _useState3 = useState(''),
|
|
38
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
-
search = _useState4[0],
|
|
40
|
-
setSearch = _useState4[1];
|
|
40
|
+
search = _useState2[0],
|
|
41
|
+
setSearch = _useState2[1];
|
|
41
42
|
var handleSearch = function handleSearch(str) {
|
|
42
43
|
setSearch(str);
|
|
43
44
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(str);
|
|
@@ -64,7 +65,7 @@ var Select = function Select(_ref) {
|
|
|
64
65
|
className: "aurora-relative aurora-flex aurora-items-center aurora-flex-col"
|
|
65
66
|
}, /*#__PURE__*/React.createElement(SelectTrigger, {
|
|
66
67
|
id: id,
|
|
67
|
-
hasError: !!(errors !== null && errors !== void 0 && errors.length),
|
|
68
|
+
hasError: hasError || !!(errors !== null && errors !== void 0 && errors.length),
|
|
68
69
|
clearValueButton: value && hasClearValueButton && onValueChange && (/*#__PURE__*/React.createElement("div", {
|
|
69
70
|
onPointerDown: function onPointerDown(e) {
|
|
70
71
|
return e.stopPropagation();
|
|
@@ -87,10 +88,7 @@ var Select = function Select(_ref) {
|
|
|
87
88
|
onSearch: handleSearch,
|
|
88
89
|
onScroll: onScroll,
|
|
89
90
|
enableLocalSearch: enableLocalSearch,
|
|
90
|
-
localSearchNotFoundContent: localSearchNotFoundContent
|
|
91
|
-
onCloseAutoFocus: function onCloseAutoFocus(e) {
|
|
92
|
-
return e.preventDefault();
|
|
93
|
-
}
|
|
91
|
+
localSearchNotFoundContent: localSearchNotFoundContent
|
|
94
92
|
}));
|
|
95
93
|
};
|
|
96
94
|
Select.displayName = Root.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, RefObject } from 'react';
|
|
3
3
|
import { TInputProps } from "../input/input_types";
|
|
4
4
|
export interface TSelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
5
5
|
hasError?: boolean;
|
|
@@ -47,3 +47,11 @@ export interface TSelectProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
|
|
47
47
|
onSearch?: (str: string) => void;
|
|
48
48
|
onClose?: () => void;
|
|
49
49
|
}
|
|
50
|
+
export interface TUseSelectValueProps {
|
|
51
|
+
value: string | undefined;
|
|
52
|
+
options: TSelectOption[];
|
|
53
|
+
}
|
|
54
|
+
export interface TUsePreventSearchBlurProps {
|
|
55
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
56
|
+
options: TSelectOption[];
|
|
57
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select_types.js","sourceRoot":"","sources":["../../../../../../../src/components/select/select_types.ts"],"names":[],"mappings":"AAAA,OAAiC,wBAAwB,CAAC;AAE1D,
|
|
1
|
+
{"version":3,"file":"select_types.js","sourceRoot":"","sources":["../../../../../../../src/components/select/select_types.ts"],"names":[],"mappings":"AAAA,OAAiC,wBAAwB,CAAC;AAE1D,OAAqC,OAAO,CAAC;AAC7C,OAA4B,qCAAqC,CAAC"}
|
|
@@ -2,4 +2,5 @@ import { TSelectOption } from "./select_types";
|
|
|
2
2
|
export declare class SelectUtils {
|
|
3
3
|
static localSearchIsOptionVisible: (option: TSelectOption, search: string) => boolean;
|
|
4
4
|
static localSearchIsHeaderVisible: (search: string, options: TSelectOption[], index: number) => boolean;
|
|
5
|
+
static findValueInOptions: (value: string | undefined, options: TSelectOption[]) => TSelectOption | undefined;
|
|
5
6
|
}
|
|
@@ -24,6 +24,12 @@ _defineProperty(SelectUtils, "localSearchIsHeaderVisible", function (search, opt
|
|
|
24
24
|
}
|
|
25
25
|
return visible;
|
|
26
26
|
});
|
|
27
|
+
_defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
|
|
28
|
+
if (!value) return undefined;
|
|
29
|
+
return options.find(function (opt) {
|
|
30
|
+
return opt.value === value;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
27
33
|
|
|
28
34
|
export { SelectUtils };
|
|
29
35
|
//# sourceMappingURL=select_utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|