@dreamcommerce/aurora 3.0.0-267 → 3.0.0-269

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.
@@ -16,7 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
16
16
 
17
17
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
18
 
19
- var _excluded = ["className", "options", "hasSearch", "searchPlaceholder", "search", "onSearch", "innerAdditionalContent", "position", "onScroll", "enableLocalSearch", "localSearchNotFoundContent"];
19
+ var _excluded = ["className", "options", "hasSearch", "searchPlaceholder", "search", "onSearch", "innerAdditionalContent", "position", "onScroll", "enableLocalSearch", "localSearchNotFoundContent", "selectValue"];
20
20
  var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, ref) {
21
21
  var className = _ref.className,
22
22
  options = _ref.options,
@@ -30,6 +30,7 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
30
30
  onScroll = _ref.onScroll,
31
31
  enableLocalSearch = _ref.enableLocalSearch,
32
32
  localSearchNotFoundContent = _ref.localSearchNotFoundContent,
33
+ selectValue = _ref.selectValue,
33
34
  props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
34
35
  var localSearchVisibleItems = 0;
35
36
  return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Portal, null, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Content, _rollupPluginBabelHelpers.objectSpread2({
@@ -70,12 +71,14 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
70
71
  key: "select-label-".concat(option.text, "-").concat(index),
71
72
  className: cn.cn(!visible && 'aurora-hidden')
72
73
  }, option.text)) : (/*#__PURE__*/React__default['default'].createElement(select_item.SelectItem, {
73
- key: "select-item-".concat(option.value, "-").concat(index),
74
+ key: option.value,
74
75
  value: option.value,
75
76
  isDisabled: option.isDisabled,
76
77
  isReadonly: option.isReadonly,
77
78
  additionalInfo: option.additionalInfo,
78
- className: cn.cn(!visible && 'aurora-hidden')
79
+ className: cn.cn(!visible && 'aurora-hidden'),
80
+ originalValue: option.originalValue,
81
+ selectValue: selectValue
79
82
  }, option.text));
80
83
  })), enableLocalSearch && !!localSearchNotFoundContent && !!search && !localSearchVisibleItems && (/*#__PURE__*/React__default['default'].createElement("div", {
81
84
  className: "aurora-p-2"
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -12,30 +12,36 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
 
13
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
- var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo"];
15
+ var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo", "value", "originalValue", "selectValue"];
16
16
  var SelectItem = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, ref) {
17
17
  var children = _ref.children,
18
18
  className = _ref.className,
19
19
  isDisabled = _ref.isDisabled,
20
20
  isReadonly = _ref.isReadonly,
21
21
  additionalInfo = _ref.additionalInfo,
22
+ value = _ref.value,
23
+ originalValue = _ref.originalValue,
24
+ selectValue = _ref.selectValue,
22
25
  props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
26
+ var checked = value === selectValue || originalValue === selectValue;
23
27
  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-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
- 'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly
28
+ 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', {
29
+ 'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly,
30
+ 'aurora-bg-hover aurora-font-semibold': checked
26
31
  }, className),
27
32
  style: {
28
33
  wordBreak: 'break-word'
29
34
  },
30
- disabled: isDisabled || isReadonly
35
+ disabled: isDisabled || isReadonly,
36
+ value: value
31
37
  }, props), {}, {
32
38
  ref: ref,
33
39
  onPointerMove: function onPointerMove(e) {
34
40
  e.preventDefault();
35
41
  }
36
- }), /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.ItemIndicator, null, /*#__PURE__*/React__default['default'].createElement(check_icon.CheckLineIcon, {
42
+ }), checked && /*#__PURE__*/React__default['default'].createElement(check_icon.CheckLineIcon, {
37
43
  className: "aurora-h-5 aurora-w-5 -aurora-ml-7 aurora-mr-2"
38
- })), /*#__PURE__*/React__default['default'].createElement("div", {
44
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
39
45
  className: "aurora-flex aurora-flex-col"
40
46
  }, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.ItemText, null, children), !!additionalInfo && /*#__PURE__*/React__default['default'].createElement("p", {
41
47
  className: "aurora-text-xs aurora-text-subtle-light"
@@ -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;"}
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;"}
@@ -52,20 +52,26 @@ var Select = function Select(_ref) {
52
52
  onSearch === null || onSearch === void 0 ? void 0 : onSearch(str);
53
53
  };
54
54
  var handleChange = function handleChange(val) {
55
- var _option$value;
55
+ var _option, _option$value, _option2;
56
56
  var option = val ? options.find(function (opt) {
57
57
  return opt.value === val;
58
58
  }) : undefined;
59
+ if ((_option = option) !== null && _option !== void 0 && _option.originalValue) {
60
+ option = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, option), {}, {
61
+ value: option.originalValue
62
+ });
63
+ }
59
64
  setSelectedOption(option);
60
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value = option === null || option === void 0 ? void 0 : option.value) !== null && _option$value !== void 0 ? _option$value : '');
65
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value = (_option2 = option) === null || _option2 === void 0 ? void 0 : _option2.value) !== null && _option$value !== void 0 ? _option$value : '');
61
66
  };
62
67
  var handleOpenChange = function handleOpenChange(open) {
63
68
  if (hasSearch && !open) setSearch('');
64
69
  if (onClose && !open) onClose();
65
70
  };
66
71
  var showPlaceholder = !selectedOption;
72
+ var selectValue = (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '';
67
73
  return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Root, _rollupPluginBabelHelpers.objectSpread2({
68
- value: (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
74
+ value: selectValue,
69
75
  onValueChange: handleChange,
70
76
  disabled: disabled,
71
77
  onOpenChange: handleOpenChange
@@ -96,7 +102,8 @@ var Select = function Select(_ref) {
96
102
  onSearch: handleSearch,
97
103
  onScroll: onScroll,
98
104
  enableLocalSearch: enableLocalSearch,
99
- localSearchNotFoundContent: localSearchNotFoundContent
105
+ localSearchNotFoundContent: localSearchNotFoundContent,
106
+ selectValue: selectValue
100
107
  }));
101
108
  };
102
109
  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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -31,7 +31,7 @@ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "localSearchIsHeaderVisibl
31
31
  _rollupPluginBabelHelpers.defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
32
32
  if (!value) return undefined;
33
33
  return options.find(function (opt) {
34
- return opt.value === value;
34
+ return opt.value === value || opt.originalValue === value;
35
35
  });
36
36
  });
37
37
 
@@ -8,7 +8,7 @@ import { SelectItem } from './select_item.js';
8
8
  import { SelectSearch } from './select_search.js';
9
9
  import { SelectUtils } from '../select_utils.js';
10
10
 
11
- var _excluded = ["className", "options", "hasSearch", "searchPlaceholder", "search", "onSearch", "innerAdditionalContent", "position", "onScroll", "enableLocalSearch", "localSearchNotFoundContent"];
11
+ var _excluded = ["className", "options", "hasSearch", "searchPlaceholder", "search", "onSearch", "innerAdditionalContent", "position", "onScroll", "enableLocalSearch", "localSearchNotFoundContent", "selectValue"];
12
12
  var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
13
13
  var className = _ref.className,
14
14
  options = _ref.options,
@@ -22,6 +22,7 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22
22
  onScroll = _ref.onScroll,
23
23
  enableLocalSearch = _ref.enableLocalSearch,
24
24
  localSearchNotFoundContent = _ref.localSearchNotFoundContent,
25
+ selectValue = _ref.selectValue,
25
26
  props = _objectWithoutProperties(_ref, _excluded);
26
27
  var localSearchVisibleItems = 0;
27
28
  return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Content, _objectSpread2({
@@ -62,12 +63,14 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
62
63
  key: "select-label-".concat(option.text, "-").concat(index),
63
64
  className: cn(!visible && 'aurora-hidden')
64
65
  }, option.text)) : (/*#__PURE__*/React.createElement(SelectItem, {
65
- key: "select-item-".concat(option.value, "-").concat(index),
66
+ key: option.value,
66
67
  value: option.value,
67
68
  isDisabled: option.isDisabled,
68
69
  isReadonly: option.isReadonly,
69
70
  additionalInfo: option.additionalInfo,
70
- className: cn(!visible && 'aurora-hidden')
71
+ className: cn(!visible && 'aurora-hidden'),
72
+ originalValue: option.originalValue,
73
+ selectValue: selectValue
71
74
  }, option.text));
72
75
  })), enableLocalSearch && !!localSearchNotFoundContent && !!search && !localSearchVisibleItems && (/*#__PURE__*/React.createElement("div", {
73
76
  className: "aurora-p-2"
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,iDAAiD,0EAA8E;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,iDAAiD,0EAA8E;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -2,32 +2,38 @@ import React from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
3
  import { cn } from '../../../utilities/cn.js';
4
4
  import { CheckLineIcon } from '../../../assets/icons/check_icon.js';
5
- import { Item, ItemIndicator, ItemText } from '@radix-ui/react-select';
5
+ import { Item, ItemText } from '@radix-ui/react-select';
6
6
 
7
- var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo"];
7
+ var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo", "value", "originalValue", "selectValue"];
8
8
  var SelectItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
9
9
  var children = _ref.children,
10
10
  className = _ref.className,
11
11
  isDisabled = _ref.isDisabled,
12
12
  isReadonly = _ref.isReadonly,
13
13
  additionalInfo = _ref.additionalInfo,
14
+ value = _ref.value,
15
+ originalValue = _ref.originalValue,
16
+ selectValue = _ref.selectValue,
14
17
  props = _objectWithoutProperties(_ref, _excluded);
18
+ var checked = value === selectValue || originalValue === selectValue;
15
19
  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-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
- 'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly
20
+ 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', {
21
+ 'aurora-cursor-pointer active:aurora-bg-active': !isDisabled && !isReadonly,
22
+ 'aurora-bg-hover aurora-font-semibold': checked
18
23
  }, className),
19
24
  style: {
20
25
  wordBreak: 'break-word'
21
26
  },
22
- disabled: isDisabled || isReadonly
27
+ disabled: isDisabled || isReadonly,
28
+ value: value
23
29
  }, props), {}, {
24
30
  ref: ref,
25
31
  onPointerMove: function onPointerMove(e) {
26
32
  e.preventDefault();
27
33
  }
28
- }), /*#__PURE__*/React.createElement(ItemIndicator, null, /*#__PURE__*/React.createElement(CheckLineIcon, {
34
+ }), checked && /*#__PURE__*/React.createElement(CheckLineIcon, {
29
35
  className: "aurora-h-5 aurora-w-5 -aurora-ml-7 aurora-mr-2"
30
- })), /*#__PURE__*/React.createElement("div", {
36
+ }), /*#__PURE__*/React.createElement("div", {
31
37
  className: "aurora-flex aurora-flex-col"
32
38
  }, /*#__PURE__*/React.createElement(ItemText, null, children), !!additionalInfo && /*#__PURE__*/React.createElement("p", {
33
39
  className: "aurora-text-xs aurora-text-subtle-light"
@@ -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;"}
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;"}
@@ -44,20 +44,26 @@ var Select = function Select(_ref) {
44
44
  onSearch === null || onSearch === void 0 ? void 0 : onSearch(str);
45
45
  };
46
46
  var handleChange = function handleChange(val) {
47
- var _option$value;
47
+ var _option, _option$value, _option2;
48
48
  var option = val ? options.find(function (opt) {
49
49
  return opt.value === val;
50
50
  }) : undefined;
51
+ if ((_option = option) !== null && _option !== void 0 && _option.originalValue) {
52
+ option = _objectSpread2(_objectSpread2({}, option), {}, {
53
+ value: option.originalValue
54
+ });
55
+ }
51
56
  setSelectedOption(option);
52
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value = option === null || option === void 0 ? void 0 : option.value) !== null && _option$value !== void 0 ? _option$value : '');
57
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value = (_option2 = option) === null || _option2 === void 0 ? void 0 : _option2.value) !== null && _option$value !== void 0 ? _option$value : '');
53
58
  };
54
59
  var handleOpenChange = function handleOpenChange(open) {
55
60
  if (hasSearch && !open) setSearch('');
56
61
  if (onClose && !open) onClose();
57
62
  };
58
63
  var showPlaceholder = !selectedOption;
64
+ var selectValue = (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '';
59
65
  return /*#__PURE__*/React.createElement(Root, _objectSpread2({
60
- value: (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
66
+ value: selectValue,
61
67
  onValueChange: handleChange,
62
68
  disabled: disabled,
63
69
  onOpenChange: handleOpenChange
@@ -88,7 +94,8 @@ var Select = function Select(_ref) {
88
94
  onSearch: handleSearch,
89
95
  onScroll: onScroll,
90
96
  enableLocalSearch: enableLocalSearch,
91
- localSearchNotFoundContent: localSearchNotFoundContent
97
+ localSearchNotFoundContent: localSearchNotFoundContent,
98
+ selectValue: selectValue
92
99
  }));
93
100
  };
94
101
  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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -8,6 +8,7 @@ export interface TSelectTriggerProps extends React.ComponentPropsWithoutRef<type
8
8
  export declare type TSelectOption = {
9
9
  text: string;
10
10
  value: string;
11
+ originalValue?: string;
11
12
  additionalInfo?: string;
12
13
  isHeader?: boolean;
13
14
  isDisabled?: boolean;
@@ -25,11 +26,14 @@ export interface TSelectContentProps extends React.ComponentPropsWithoutRef<type
25
26
  onSearch?: (str: string) => void;
26
27
  enableLocalSearch?: boolean;
27
28
  localSearchNotFoundContent?: ReactNode;
29
+ selectValue: string;
28
30
  }
29
31
  export interface TSelectItemProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
30
32
  isDisabled?: boolean;
31
33
  isReadonly?: boolean;
32
34
  additionalInfo?: string;
35
+ originalValue?: string;
36
+ selectValue: string;
33
37
  }
34
38
  export interface TSelectProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, 'defaultValue'> {
35
39
  id: string;
@@ -27,7 +27,7 @@ _defineProperty(SelectUtils, "localSearchIsHeaderVisible", function (search, opt
27
27
  _defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
28
28
  if (!value) return undefined;
29
29
  return options.find(function (opt) {
30
- return opt.value === value;
30
+ return opt.value === value || opt.originalValue === value;
31
31
  });
32
32
  });
33
33