@dreamcommerce/aurora 3.0.0-272 → 3.0.0-274
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/message_box/message_box.js +13 -1
- package/build/cjs/packages/aurora/src/components/message_box/message_box.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/components/select_content.js +3 -9
- package/build/cjs/packages/aurora/src/components/select/components/select_content.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/components/select_item.js +6 -12
- package/build/cjs/packages/aurora/src/components/select/components/select_item.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/select.js +4 -11
- package/build/cjs/packages/aurora/src/components/select/select.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/select/select_utils.js +2 -9
- package/build/cjs/packages/aurora/src/components/select/select_utils.js.map +1 -1
- package/build/esm/packages/aurora/src/components/message_box/message_box.js +14 -2
- package/build/esm/packages/aurora/src/components/message_box/message_box.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/components/select_content.js +3 -9
- package/build/esm/packages/aurora/src/components/select/components/select_content.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/components/select_item.js +7 -13
- package/build/esm/packages/aurora/src/components/select/components/select_item.js.map +1 -1
- package/build/esm/packages/aurora/src/components/select/select.js +4 -11
- 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 +0 -7
- package/build/esm/packages/aurora/src/components/select/select_utils.js +3 -10
- package/build/esm/packages/aurora/src/components/select/select_utils.js.map +1 -1
- package/build/index.css +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/aurora/src/components/select/components/select_original_values_guard.js +0 -33
- package/build/cjs/packages/aurora/src/components/select/components/select_original_values_guard.js.map +0 -1
- package/build/esm/packages/aurora/src/components/select/components/select_original_values_guard.d.ts +0 -3
- package/build/esm/packages/aurora/src/components/select/components/select_original_values_guard.js +0 -25
- package/build/esm/packages/aurora/src/components/select/components/select_original_values_guard.js.map +0 -1
|
@@ -29,8 +29,20 @@ var MessageBox = /*#__PURE__*/React__default['default'].forwardRef(function (_re
|
|
|
29
29
|
noRadius = _ref$noRadius === void 0 ? false : _ref$noRadius;
|
|
30
30
|
var Icon = message_box_constants.MESSAGE_BOX_ICONS[variant];
|
|
31
31
|
var iconColor = message_box_constants.MESSAGE_BOX_ICON_COLORS[variant];
|
|
32
|
+
var localRef = React.useRef(null);
|
|
33
|
+
React.useImperativeHandle(ref, function () {
|
|
34
|
+
return localRef.current;
|
|
35
|
+
});
|
|
36
|
+
React.useEffect(function () {
|
|
37
|
+
var element = localRef.current;
|
|
38
|
+
if (!element) return;
|
|
39
|
+
var links = element.querySelectorAll('a[target="_blank"]');
|
|
40
|
+
links.forEach(function (link) {
|
|
41
|
+
link.classList.add('message_box-link-icon');
|
|
42
|
+
});
|
|
43
|
+
}, []);
|
|
32
44
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33
|
-
ref:
|
|
45
|
+
ref: localRef,
|
|
34
46
|
className: cn.cn(message_box_variants.messageBoxVariants({
|
|
35
47
|
variant: variant
|
|
36
48
|
}), {
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -11,13 +11,12 @@ var select_group_label = require('./select_group_label.js');
|
|
|
11
11
|
var select_item = require('./select_item.js');
|
|
12
12
|
var select_search = require('./select_search.js');
|
|
13
13
|
var select_utils = require('../select_utils.js');
|
|
14
|
-
var select_original_values_guard = require('./select_original_values_guard.js');
|
|
15
14
|
|
|
16
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
16
|
|
|
18
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
18
|
|
|
20
|
-
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"];
|
|
21
20
|
var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, ref) {
|
|
22
21
|
var className = _ref.className,
|
|
23
22
|
options = _ref.options,
|
|
@@ -31,7 +30,6 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
|
|
|
31
30
|
onScroll = _ref.onScroll,
|
|
32
31
|
enableLocalSearch = _ref.enableLocalSearch,
|
|
33
32
|
localSearchNotFoundContent = _ref.localSearchNotFoundContent,
|
|
34
|
-
selectValue = _ref.selectValue,
|
|
35
33
|
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
36
34
|
var localSearchVisibleItems = 0;
|
|
37
35
|
return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Portal, null, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Content, _rollupPluginBabelHelpers.objectSpread2({
|
|
@@ -72,17 +70,13 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
|
|
|
72
70
|
key: "select-label-".concat(option.text, "-").concat(index),
|
|
73
71
|
className: cn.cn(!visible && 'aurora-hidden')
|
|
74
72
|
}, option.text)) : (/*#__PURE__*/React__default['default'].createElement(select_item.SelectItem, {
|
|
75
|
-
key: option.value,
|
|
73
|
+
key: "select-item-".concat(option.value, "-").concat(index),
|
|
76
74
|
value: option.value,
|
|
77
75
|
isDisabled: option.isDisabled,
|
|
78
76
|
isReadonly: option.isReadonly,
|
|
79
77
|
additionalInfo: option.additionalInfo,
|
|
80
|
-
className: cn.cn(!visible && 'aurora-hidden')
|
|
81
|
-
originalValue: option.originalValue,
|
|
82
|
-
selectValue: selectValue
|
|
78
|
+
className: cn.cn(!visible && 'aurora-hidden')
|
|
83
79
|
}, option.text));
|
|
84
|
-
}), /*#__PURE__*/React__default['default'].createElement(select_original_values_guard.SelectOriginalValuesGuard, {
|
|
85
|
-
options: options
|
|
86
80
|
})), enableLocalSearch && !!localSearchNotFoundContent && !!search && !localSearchVisibleItems && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
87
81
|
className: "aurora-p-2"
|
|
88
82
|
}, localSearchNotFoundContent)), innerAdditionalContent && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -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;"}
|
|
@@ -12,36 +12,30 @@ 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"];
|
|
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,
|
|
25
22
|
props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
var checked = value === selectValue || originalValue === selectValue;
|
|
27
23
|
return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Item, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
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
|
|
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
|
|
31
26
|
}, className),
|
|
32
27
|
style: {
|
|
33
28
|
wordBreak: 'break-word'
|
|
34
29
|
},
|
|
35
|
-
disabled: isDisabled || isReadonly
|
|
36
|
-
value: value
|
|
30
|
+
disabled: isDisabled || isReadonly
|
|
37
31
|
}, props), {}, {
|
|
38
32
|
ref: ref,
|
|
39
33
|
onPointerMove: function onPointerMove(e) {
|
|
40
34
|
e.preventDefault();
|
|
41
35
|
}
|
|
42
|
-
}),
|
|
36
|
+
}), /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.ItemIndicator, null, /*#__PURE__*/React__default['default'].createElement(check_icon.CheckLineIcon, {
|
|
43
37
|
className: "aurora-h-5 aurora-w-5 -aurora-ml-7 aurora-mr-2"
|
|
44
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
38
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
45
39
|
className: "aurora-flex aurora-flex-col"
|
|
46
40
|
}, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.ItemText, null, children), !!additionalInfo && /*#__PURE__*/React__default['default'].createElement("p", {
|
|
47
41
|
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;"}
|
|
@@ -52,26 +52,20 @@ 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
|
|
55
|
+
var _option$value;
|
|
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
|
-
}
|
|
64
59
|
setSelectedOption(option);
|
|
65
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value =
|
|
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 : '');
|
|
66
61
|
};
|
|
67
62
|
var handleOpenChange = function handleOpenChange(open) {
|
|
68
63
|
if (hasSearch && !open) setSearch('');
|
|
69
64
|
if (onClose && !open) onClose();
|
|
70
65
|
};
|
|
71
66
|
var showPlaceholder = !selectedOption;
|
|
72
|
-
var selectValue = (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '';
|
|
73
67
|
return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Root, _rollupPluginBabelHelpers.objectSpread2({
|
|
74
|
-
value:
|
|
68
|
+
value: (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
|
|
75
69
|
onValueChange: handleChange,
|
|
76
70
|
disabled: disabled,
|
|
77
71
|
onOpenChange: handleOpenChange
|
|
@@ -102,8 +96,7 @@ var Select = function Select(_ref) {
|
|
|
102
96
|
onSearch: handleSearch,
|
|
103
97
|
onScroll: onScroll,
|
|
104
98
|
enableLocalSearch: enableLocalSearch,
|
|
105
|
-
localSearchNotFoundContent: localSearchNotFoundContent
|
|
106
|
-
selectValue: selectValue
|
|
99
|
+
localSearchNotFoundContent: localSearchNotFoundContent
|
|
107
100
|
}));
|
|
108
101
|
};
|
|
109
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;"}
|
|
@@ -29,17 +29,10 @@ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "localSearchIsHeaderVisibl
|
|
|
29
29
|
return visible;
|
|
30
30
|
});
|
|
31
31
|
_rollupPluginBabelHelpers.defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
|
|
32
|
-
var _option;
|
|
33
32
|
if (!value) return undefined;
|
|
34
|
-
|
|
35
|
-
return opt.value === value
|
|
33
|
+
return options.find(function (opt) {
|
|
34
|
+
return opt.value === value;
|
|
36
35
|
});
|
|
37
|
-
if ((_option = option) !== null && _option !== void 0 && _option.originalValue) {
|
|
38
|
-
option = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, option), {}, {
|
|
39
|
-
value: option.originalValue
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return option;
|
|
43
36
|
});
|
|
44
37
|
|
|
45
38
|
exports.SelectUtils = SelectUtils;
|
|
@@ -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;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef, useImperativeHandle, useEffect } from 'react';
|
|
2
2
|
import { cn } from '../../utilities/cn.js';
|
|
3
3
|
import { Typography } from '../typography/typography.js';
|
|
4
4
|
import { MESSAGE_BOX_ICONS, MESSAGE_BOX_ICON_COLORS, MESSAGE_BOX_VARIANTS } from './message_box_constants.js';
|
|
@@ -21,8 +21,20 @@ var MessageBox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
21
21
|
noRadius = _ref$noRadius === void 0 ? false : _ref$noRadius;
|
|
22
22
|
var Icon = MESSAGE_BOX_ICONS[variant];
|
|
23
23
|
var iconColor = MESSAGE_BOX_ICON_COLORS[variant];
|
|
24
|
+
var localRef = useRef(null);
|
|
25
|
+
useImperativeHandle(ref, function () {
|
|
26
|
+
return localRef.current;
|
|
27
|
+
});
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
var element = localRef.current;
|
|
30
|
+
if (!element) return;
|
|
31
|
+
var links = element.querySelectorAll('a[target="_blank"]');
|
|
32
|
+
links.forEach(function (link) {
|
|
33
|
+
link.classList.add('message_box-link-icon');
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
24
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
ref:
|
|
37
|
+
ref: localRef,
|
|
26
38
|
className: cn(messageBoxVariants({
|
|
27
39
|
variant: variant
|
|
28
40
|
}), {
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -7,9 +7,8 @@ import { SelectGroupLabel } from './select_group_label.js';
|
|
|
7
7
|
import { SelectItem } from './select_item.js';
|
|
8
8
|
import { SelectSearch } from './select_search.js';
|
|
9
9
|
import { SelectUtils } from '../select_utils.js';
|
|
10
|
-
import { SelectOriginalValuesGuard } from './select_original_values_guard.js';
|
|
11
10
|
|
|
12
|
-
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"];
|
|
13
12
|
var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
14
13
|
var className = _ref.className,
|
|
15
14
|
options = _ref.options,
|
|
@@ -23,7 +22,6 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
23
22
|
onScroll = _ref.onScroll,
|
|
24
23
|
enableLocalSearch = _ref.enableLocalSearch,
|
|
25
24
|
localSearchNotFoundContent = _ref.localSearchNotFoundContent,
|
|
26
|
-
selectValue = _ref.selectValue,
|
|
27
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
26
|
var localSearchVisibleItems = 0;
|
|
29
27
|
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Content, _objectSpread2({
|
|
@@ -64,17 +62,13 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
64
62
|
key: "select-label-".concat(option.text, "-").concat(index),
|
|
65
63
|
className: cn(!visible && 'aurora-hidden')
|
|
66
64
|
}, option.text)) : (/*#__PURE__*/React.createElement(SelectItem, {
|
|
67
|
-
key: option.value,
|
|
65
|
+
key: "select-item-".concat(option.value, "-").concat(index),
|
|
68
66
|
value: option.value,
|
|
69
67
|
isDisabled: option.isDisabled,
|
|
70
68
|
isReadonly: option.isReadonly,
|
|
71
69
|
additionalInfo: option.additionalInfo,
|
|
72
|
-
className: cn(!visible && 'aurora-hidden')
|
|
73
|
-
originalValue: option.originalValue,
|
|
74
|
-
selectValue: selectValue
|
|
70
|
+
className: cn(!visible && 'aurora-hidden')
|
|
75
71
|
}, option.text));
|
|
76
|
-
}), /*#__PURE__*/React.createElement(SelectOriginalValuesGuard, {
|
|
77
|
-
options: options
|
|
78
72
|
})), enableLocalSearch && !!localSearchNotFoundContent && !!search && !localSearchVisibleItems && (/*#__PURE__*/React.createElement("div", {
|
|
79
73
|
className: "aurora-p-2"
|
|
80
74
|
}, localSearchNotFoundContent)), innerAdditionalContent && /*#__PURE__*/React.createElement("div", {
|
|
@@ -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;"}
|
|
@@ -2,38 +2,32 @@ 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, ItemText } from '@radix-ui/react-select';
|
|
5
|
+
import { Item, ItemIndicator, ItemText } from '@radix-ui/react-select';
|
|
6
6
|
|
|
7
|
-
var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo"
|
|
7
|
+
var _excluded = ["children", "className", "isDisabled", "isReadonly", "additionalInfo"];
|
|
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,
|
|
17
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
var checked = value === selectValue || originalValue === selectValue;
|
|
19
15
|
return /*#__PURE__*/React.createElement(Item, _objectSpread2(_objectSpread2({
|
|
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
|
|
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
|
|
23
18
|
}, className),
|
|
24
19
|
style: {
|
|
25
20
|
wordBreak: 'break-word'
|
|
26
21
|
},
|
|
27
|
-
disabled: isDisabled || isReadonly
|
|
28
|
-
value: value
|
|
22
|
+
disabled: isDisabled || isReadonly
|
|
29
23
|
}, props), {}, {
|
|
30
24
|
ref: ref,
|
|
31
25
|
onPointerMove: function onPointerMove(e) {
|
|
32
26
|
e.preventDefault();
|
|
33
27
|
}
|
|
34
|
-
}),
|
|
28
|
+
}), /*#__PURE__*/React.createElement(ItemIndicator, null, /*#__PURE__*/React.createElement(CheckLineIcon, {
|
|
35
29
|
className: "aurora-h-5 aurora-w-5 -aurora-ml-7 aurora-mr-2"
|
|
36
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
37
31
|
className: "aurora-flex aurora-flex-col"
|
|
38
32
|
}, /*#__PURE__*/React.createElement(ItemText, null, children), !!additionalInfo && /*#__PURE__*/React.createElement("p", {
|
|
39
33
|
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;"}
|
|
@@ -44,26 +44,20 @@ 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
|
|
47
|
+
var _option$value;
|
|
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
|
-
}
|
|
56
51
|
setSelectedOption(option);
|
|
57
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_option$value =
|
|
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 : '');
|
|
58
53
|
};
|
|
59
54
|
var handleOpenChange = function handleOpenChange(open) {
|
|
60
55
|
if (hasSearch && !open) setSearch('');
|
|
61
56
|
if (onClose && !open) onClose();
|
|
62
57
|
};
|
|
63
58
|
var showPlaceholder = !selectedOption;
|
|
64
|
-
var selectValue = (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '';
|
|
65
59
|
return /*#__PURE__*/React.createElement(Root, _objectSpread2({
|
|
66
|
-
value:
|
|
60
|
+
value: (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
|
|
67
61
|
onValueChange: handleChange,
|
|
68
62
|
disabled: disabled,
|
|
69
63
|
onOpenChange: handleOpenChange
|
|
@@ -94,8 +88,7 @@ var Select = function Select(_ref) {
|
|
|
94
88
|
onSearch: handleSearch,
|
|
95
89
|
onScroll: onScroll,
|
|
96
90
|
enableLocalSearch: enableLocalSearch,
|
|
97
|
-
localSearchNotFoundContent: localSearchNotFoundContent
|
|
98
|
-
selectValue: selectValue
|
|
91
|
+
localSearchNotFoundContent: localSearchNotFoundContent
|
|
99
92
|
}));
|
|
100
93
|
};
|
|
101
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;"}
|
|
@@ -8,7 +8,6 @@ export interface TSelectTriggerProps extends React.ComponentPropsWithoutRef<type
|
|
|
8
8
|
export declare type TSelectOption = {
|
|
9
9
|
text: string;
|
|
10
10
|
value: string;
|
|
11
|
-
originalValue?: string;
|
|
12
11
|
additionalInfo?: string;
|
|
13
12
|
isHeader?: boolean;
|
|
14
13
|
isDisabled?: boolean;
|
|
@@ -26,14 +25,11 @@ export interface TSelectContentProps extends React.ComponentPropsWithoutRef<type
|
|
|
26
25
|
onSearch?: (str: string) => void;
|
|
27
26
|
enableLocalSearch?: boolean;
|
|
28
27
|
localSearchNotFoundContent?: ReactNode;
|
|
29
|
-
selectValue: string;
|
|
30
28
|
}
|
|
31
29
|
export interface TSelectItemProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
32
30
|
isDisabled?: boolean;
|
|
33
31
|
isReadonly?: boolean;
|
|
34
32
|
additionalInfo?: string;
|
|
35
|
-
originalValue?: string;
|
|
36
|
-
selectValue: string;
|
|
37
33
|
}
|
|
38
34
|
export interface TSelectProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, 'defaultValue'> {
|
|
39
35
|
id: string;
|
|
@@ -59,6 +55,3 @@ export interface TUsePreventSearchBlurProps {
|
|
|
59
55
|
inputRef: RefObject<HTMLInputElement | null>;
|
|
60
56
|
options: TSelectOption[];
|
|
61
57
|
}
|
|
62
|
-
export interface TSelectOriginalValuesGuard {
|
|
63
|
-
options: TSelectOption[];
|
|
64
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty
|
|
1
|
+
import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
|
|
3
3
|
var _SelectUtils;
|
|
4
4
|
var SelectUtils = /*#__PURE__*/_createClass(function SelectUtils() {
|
|
@@ -25,17 +25,10 @@ _defineProperty(SelectUtils, "localSearchIsHeaderVisible", function (search, opt
|
|
|
25
25
|
return visible;
|
|
26
26
|
});
|
|
27
27
|
_defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
|
|
28
|
-
var _option;
|
|
29
28
|
if (!value) return undefined;
|
|
30
|
-
|
|
31
|
-
return opt.value === value
|
|
29
|
+
return options.find(function (opt) {
|
|
30
|
+
return opt.value === value;
|
|
32
31
|
});
|
|
33
|
-
if ((_option = option) !== null && _option !== void 0 && _option.originalValue) {
|
|
34
|
-
option = _objectSpread2(_objectSpread2({}, option), {}, {
|
|
35
|
-
value: option.originalValue
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return option;
|
|
39
32
|
});
|
|
40
33
|
|
|
41
34
|
export { SelectUtils };
|
|
@@ -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;
|
|
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;"}
|