@cloudtower/eagle 0.31.15 → 0.31.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/Fields/FieldsEnum/index.js +1 -1
- package/dist/cjs/core/LegacySelect/index.js +185 -0
- package/dist/cjs/core/LegacySelect/select.style.js +5 -0
- package/dist/cjs/core/Select/index.js +106 -117
- package/dist/cjs/core/Select/select.style.js +11 -0
- package/dist/cjs/core/Select/select.widgets.js +63 -0
- package/dist/cjs/core/TimeZoneSelect/index.js +1 -1
- package/dist/cjs/core/index.js +9 -9
- package/dist/cjs/index.js +185 -181
- package/dist/cjs/legacy-antd.js +137 -135
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +2601 -2418
- package/dist/esm/core/Fields/FieldsEnum/index.js +4 -4
- package/dist/esm/core/LegacySelect/index.js +177 -0
- package/dist/esm/core/LegacySelect/select.style.js +3 -0
- package/dist/esm/core/Select/index.js +104 -116
- package/dist/esm/core/Select/select.style.js +6 -0
- package/dist/esm/core/Select/select.widgets.js +57 -0
- package/dist/esm/core/TimeZoneSelect/index.js +2 -2
- package/dist/esm/index.js +5 -3
- package/dist/esm/legacy-antd.js +2 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/src/core/LegacySelect/index.d.ts +4 -0
- package/dist/src/core/LegacySelect/select.style.d.ts +1 -0
- package/dist/src/core/LegacySelect/select.type.d.ts +31 -0
- package/dist/src/core/Select/index.d.ts +1 -0
- package/dist/src/core/Select/select.style.d.ts +4 -0
- package/dist/src/core/Select/select.type.d.ts +6 -30
- package/dist/src/core/Select/select.widgets.d.ts +7 -0
- package/dist/src/core/index.d.ts +4 -2
- package/dist/src/spec/base.d.ts +2 -1
- package/dist/stories/docs/core/{Select.Simple.stories.d.ts → LegacySelect.Simple.stories.d.ts} +3 -3
- package/dist/stories/docs/core/LegacySelect.stories.d.ts +16 -0
- package/dist/style.css +2573 -2421
- package/package.json +4 -4
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index$1 = require('../Loading/index.js');
|
|
4
|
+
var index = require('../Typo/index.js');
|
|
5
|
+
var antd = require('antd');
|
|
6
|
+
var cs = require('classnames');
|
|
7
|
+
var _ = require('lodash');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var reactDom = require('react-dom');
|
|
10
|
+
var reactIs = require('react-is');
|
|
11
|
+
var select_style = require('./select.style.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var cs__default = /*#__PURE__*/_interopDefault(cs);
|
|
16
|
+
var ___default = /*#__PURE__*/_interopDefault(_);
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
18
|
+
|
|
19
|
+
var __defProp = Object.defineProperty;
|
|
20
|
+
var __defProps = Object.defineProperties;
|
|
21
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
22
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
23
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
25
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
26
|
+
var __spreadValues = (a, b) => {
|
|
27
|
+
for (var prop in b || (b = {}))
|
|
28
|
+
if (__hasOwnProp.call(b, prop))
|
|
29
|
+
__defNormalProp(a, prop, b[prop]);
|
|
30
|
+
if (__getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
32
|
+
if (__propIsEnum.call(b, prop))
|
|
33
|
+
__defNormalProp(a, prop, b[prop]);
|
|
34
|
+
}
|
|
35
|
+
return a;
|
|
36
|
+
};
|
|
37
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
38
|
+
var __objRest = (source, exclude) => {
|
|
39
|
+
var target = {};
|
|
40
|
+
for (var prop in source)
|
|
41
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
42
|
+
target[prop] = source[prop];
|
|
43
|
+
if (source != null && __getOwnPropSymbols)
|
|
44
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
45
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
46
|
+
target[prop] = source[prop];
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
};
|
|
50
|
+
const LegacySelect = (_a) => {
|
|
51
|
+
var _b = _a, {
|
|
52
|
+
input,
|
|
53
|
+
multiple,
|
|
54
|
+
className,
|
|
55
|
+
scrollBottomBuffer = 0,
|
|
56
|
+
onScrollBottom,
|
|
57
|
+
onPopupScroll,
|
|
58
|
+
onSearch,
|
|
59
|
+
showSearch,
|
|
60
|
+
filterOption,
|
|
61
|
+
loading,
|
|
62
|
+
notFoundContent,
|
|
63
|
+
children,
|
|
64
|
+
error,
|
|
65
|
+
selectLimit,
|
|
66
|
+
dropdownClassName,
|
|
67
|
+
danger,
|
|
68
|
+
size = "middle",
|
|
69
|
+
meta,
|
|
70
|
+
placeholder
|
|
71
|
+
} = _b, restProps = __objRest(_b, [
|
|
72
|
+
"input",
|
|
73
|
+
"multiple",
|
|
74
|
+
"className",
|
|
75
|
+
"scrollBottomBuffer",
|
|
76
|
+
"onScrollBottom",
|
|
77
|
+
"onPopupScroll",
|
|
78
|
+
"onSearch",
|
|
79
|
+
"showSearch",
|
|
80
|
+
"filterOption",
|
|
81
|
+
"loading",
|
|
82
|
+
"notFoundContent",
|
|
83
|
+
"children",
|
|
84
|
+
"error",
|
|
85
|
+
"selectLimit",
|
|
86
|
+
"dropdownClassName",
|
|
87
|
+
"danger",
|
|
88
|
+
"size",
|
|
89
|
+
"meta",
|
|
90
|
+
"placeholder"
|
|
91
|
+
]);
|
|
92
|
+
var _a2;
|
|
93
|
+
const limitExceeded = multiple && selectLimit && selectLimit <= (((_a2 = input.value) == null ? void 0 : _a2.length) || 0);
|
|
94
|
+
const typo = {
|
|
95
|
+
large: index.Typo.Label.l2_regular,
|
|
96
|
+
middle: index.Typo.Label.l3_regular,
|
|
97
|
+
small: index.Typo.Label.l4_regular
|
|
98
|
+
}[size];
|
|
99
|
+
const _danger = React.useMemo(() => {
|
|
100
|
+
if (danger !== void 0) {
|
|
101
|
+
return danger;
|
|
102
|
+
}
|
|
103
|
+
return (meta == null ? void 0 : meta.touched) && meta.invalid;
|
|
104
|
+
}, [danger, meta]);
|
|
105
|
+
const selectRef = React.useRef(null);
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
if (!selectRef.current) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const realDom = reactDom.findDOMNode(selectRef.current);
|
|
111
|
+
if (realDom) {
|
|
112
|
+
const inputDom = realDom.getElementsByClassName(
|
|
113
|
+
"ant-select-selection-search-input"
|
|
114
|
+
)[0];
|
|
115
|
+
const item = realDom.getElementsByClassName(
|
|
116
|
+
"ant-select-selection-item"
|
|
117
|
+
)[0];
|
|
118
|
+
inputDom && (placeholder || item) && inputDom.setAttribute(
|
|
119
|
+
"data-test",
|
|
120
|
+
String(placeholder || item.textContent)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}, [selectRef, placeholder]);
|
|
124
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
125
|
+
antd.Select,
|
|
126
|
+
__spreadValues(__spreadProps(__spreadValues({}, input), {
|
|
127
|
+
ref: selectRef,
|
|
128
|
+
size,
|
|
129
|
+
value: multiple ? input.value || [] : input.value || void 0,
|
|
130
|
+
onChange: (e, option) => {
|
|
131
|
+
var _a3, _b2;
|
|
132
|
+
if (Array.isArray(e) && e.some((v) => v === "")) {
|
|
133
|
+
(_a3 = input.onChange) == null ? void 0 : _a3.call(input, [], option);
|
|
134
|
+
} else {
|
|
135
|
+
(_b2 = input.onChange) == null ? void 0 : _b2.call(input, e, option);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
onBlur: () => {
|
|
139
|
+
var _a3;
|
|
140
|
+
return (_a3 = input.onBlur) == null ? void 0 : _a3.call(input);
|
|
141
|
+
},
|
|
142
|
+
mode: multiple ? "multiple" : void 0,
|
|
143
|
+
className: cs__default.default(
|
|
144
|
+
select_style.SelectStyle,
|
|
145
|
+
"select",
|
|
146
|
+
className,
|
|
147
|
+
limitExceeded && "select-event-none",
|
|
148
|
+
_danger ? "select-error" : "",
|
|
149
|
+
typo
|
|
150
|
+
),
|
|
151
|
+
"data-size": size,
|
|
152
|
+
dropdownClassName: cs__default.default(dropdownClassName, limitExceeded && "display-none"),
|
|
153
|
+
showSearch: multiple ? void 0 : typeof showSearch === "undefined" ? Boolean(onSearch) : showSearch,
|
|
154
|
+
filterOption: onSearch === void 0 ? filterOption === void 0 ? (input2, option) => {
|
|
155
|
+
const label = option == null ? void 0 : option.label;
|
|
156
|
+
if (!label || typeof label !== "string") {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return label.toLowerCase().includes(input2.toLowerCase());
|
|
160
|
+
} : filterOption : false,
|
|
161
|
+
onSearch: onSearch && ___default.default.debounce(onSearch, 100),
|
|
162
|
+
onPopupScroll: (e) => {
|
|
163
|
+
onPopupScroll == null ? void 0 : onPopupScroll(e);
|
|
164
|
+
const el = e.currentTarget;
|
|
165
|
+
if (el.scrollHeight - el.offsetHeight - el.scrollTop <= scrollBottomBuffer) {
|
|
166
|
+
onScrollBottom == null ? void 0 : onScrollBottom();
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
notFoundContent: loading ? /* @__PURE__ */ React__default.default.createElement(index$1, null) : notFoundContent,
|
|
170
|
+
dropdownRender: (menu) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, error || menu),
|
|
171
|
+
loading,
|
|
172
|
+
placeholder
|
|
173
|
+
}), restProps),
|
|
174
|
+
React__default.default.Children.map(children, (child) => {
|
|
175
|
+
return reactIs.isElement(child) ? __spreadProps(__spreadValues({}, child), {
|
|
176
|
+
props: __spreadProps(__spreadValues({}, child.props), {
|
|
177
|
+
"data-test": child.props.value
|
|
178
|
+
})
|
|
179
|
+
}) : child;
|
|
180
|
+
})
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
var LegacySelect$1 = LegacySelect;
|
|
184
|
+
|
|
185
|
+
module.exports = LegacySelect$1;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var iconsReact = require('@cloudtower/icons-react');
|
|
6
|
+
var index$2 = require('../Icon/index.js');
|
|
7
|
+
var index$1 = require('../LegacySelect/index.js');
|
|
4
8
|
var index = require('../Typo/index.js');
|
|
5
|
-
var
|
|
9
|
+
var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
|
|
6
10
|
var cs = require('classnames');
|
|
7
|
-
var _ = require('lodash');
|
|
8
11
|
var React = require('react');
|
|
9
|
-
var
|
|
10
|
-
var reactIs = require('react-is');
|
|
12
|
+
var select_style = require('./select.style.js');
|
|
11
13
|
|
|
12
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
15
|
|
|
14
16
|
var cs__default = /*#__PURE__*/_interopDefault(cs);
|
|
15
|
-
var ___default = /*#__PURE__*/_interopDefault(_);
|
|
16
17
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
17
18
|
|
|
18
19
|
var __defProp = Object.defineProperty;
|
|
@@ -21,126 +22,114 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
21
22
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
22
23
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
23
24
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
24
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value
|
|
29
|
-
}) : obj[key] = value;
|
|
25
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
30
26
|
var __spreadValues = (a, b) => {
|
|
31
|
-
for (var prop in b || (b = {}))
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
for (var prop in b || (b = {}))
|
|
28
|
+
if (__hasOwnProp.call(b, prop))
|
|
29
|
+
__defNormalProp(a, prop, b[prop]);
|
|
30
|
+
if (__getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
32
|
+
if (__propIsEnum.call(b, prop))
|
|
33
|
+
__defNormalProp(a, prop, b[prop]);
|
|
34
|
+
}
|
|
35
35
|
return a;
|
|
36
36
|
};
|
|
37
37
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) {
|
|
42
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
|
|
43
|
-
}
|
|
44
|
-
return target;
|
|
45
|
-
};
|
|
46
|
-
const SelectStyle = "E_s177mls5";
|
|
47
|
-
const Select = _a => {
|
|
48
|
-
var _b = _a,
|
|
49
|
-
{
|
|
50
|
-
input,
|
|
51
|
-
multiple,
|
|
52
|
-
className,
|
|
53
|
-
scrollBottomBuffer = 0,
|
|
54
|
-
onScrollBottom,
|
|
55
|
-
onPopupScroll,
|
|
56
|
-
onSearch,
|
|
57
|
-
showSearch,
|
|
58
|
-
filterOption,
|
|
59
|
-
loading,
|
|
60
|
-
notFoundContent,
|
|
61
|
-
children,
|
|
62
|
-
error,
|
|
63
|
-
selectLimit,
|
|
64
|
-
dropdownClassName,
|
|
65
|
-
danger,
|
|
66
|
-
size = "middle",
|
|
67
|
-
meta,
|
|
68
|
-
placeholder
|
|
69
|
-
} = _b,
|
|
70
|
-
restProps = __objRest(_b, ["input", "multiple", "className", "scrollBottomBuffer", "onScrollBottom", "onPopupScroll", "onSearch", "showSearch", "filterOption", "loading", "notFoundContent", "children", "error", "selectLimit", "dropdownClassName", "danger", "size", "meta", "placeholder"]);
|
|
71
|
-
var _a2;
|
|
72
|
-
const limitExceeded = multiple && selectLimit && selectLimit <= (((_a2 = input.value) == null ? void 0 : _a2.length) || 0);
|
|
38
|
+
const Select = (props) => {
|
|
39
|
+
const { size = "middle", isLoadingValue } = props;
|
|
40
|
+
const { t } = useParrotTranslation();
|
|
73
41
|
const typo = {
|
|
74
42
|
large: index.Typo.Label.l2_regular,
|
|
75
43
|
middle: index.Typo.Label.l3_regular,
|
|
76
44
|
small: index.Typo.Label.l4_regular
|
|
77
45
|
}[size];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
46
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
47
|
+
index$1,
|
|
48
|
+
__spreadProps(__spreadValues({}, props), {
|
|
49
|
+
className: cs__default.default(
|
|
50
|
+
select_style.SelectStyle,
|
|
51
|
+
select_style.SelectIconStyle,
|
|
52
|
+
select_style.SelectSizeStyle,
|
|
53
|
+
isLoadingValue ? "select-loading-value" : "",
|
|
54
|
+
props.className
|
|
55
|
+
),
|
|
56
|
+
placeholder: /* @__PURE__ */ React__default.default.createElement("span", { className: cs__default.default(typo, select_style.PlaceholderTextStyle) }, isLoadingValue ? t("components.loading") : props.placeholder),
|
|
57
|
+
suffixIcon: props.suffixIcon || (props.loading ? void 0 : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
58
|
+
index$2,
|
|
59
|
+
{
|
|
60
|
+
className: "select-suffix",
|
|
61
|
+
src: iconsReact.ArrowChevronDown16BoldTertiaryIcon
|
|
62
|
+
}
|
|
63
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
64
|
+
index$2,
|
|
65
|
+
{
|
|
66
|
+
className: "select-hover-suffix",
|
|
67
|
+
src: iconsReact.ArrowChevronDown16BoldBlueIcon
|
|
68
|
+
}
|
|
69
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
70
|
+
index$2,
|
|
71
|
+
{
|
|
72
|
+
className: "select-active-suffix",
|
|
73
|
+
src: iconsReact.ArrowChevronDown16BoldBlueIcon
|
|
74
|
+
}
|
|
75
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
76
|
+
index$2,
|
|
77
|
+
{
|
|
78
|
+
className: "select-expanded-suffix",
|
|
79
|
+
src: iconsReact.ArrowChevronUp16BoldBlueIcon
|
|
80
|
+
}
|
|
81
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
82
|
+
index$2,
|
|
83
|
+
{
|
|
84
|
+
className: "select-expanded-search-suffix",
|
|
85
|
+
src: iconsReact.Search16BlueIcon
|
|
86
|
+
}
|
|
87
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
88
|
+
index$2,
|
|
89
|
+
{
|
|
90
|
+
className: "select-focus-suffix",
|
|
91
|
+
src: iconsReact.ArrowChevronDown16BoldTertiaryIcon
|
|
92
|
+
}
|
|
93
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
94
|
+
index$2,
|
|
95
|
+
{
|
|
96
|
+
className: "select-error-suffix",
|
|
97
|
+
src: iconsReact.ArrowChevronDown16BoldTertiaryIcon
|
|
98
|
+
}
|
|
99
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
100
|
+
index$2,
|
|
101
|
+
{
|
|
102
|
+
className: "select-error-hover-suffix",
|
|
103
|
+
src: iconsReact.ArrowChevronDown16BoldSecondaryIcon
|
|
104
|
+
}
|
|
105
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
106
|
+
index$2,
|
|
107
|
+
{
|
|
108
|
+
className: "select-error-active-suffix",
|
|
109
|
+
src: iconsReact.ArrowChevronDown16BoldSecondaryIcon
|
|
110
|
+
}
|
|
111
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
112
|
+
index$2,
|
|
113
|
+
{
|
|
114
|
+
className: "select-error-expanded-suffix",
|
|
115
|
+
src: iconsReact.ArrowChevronUp16BoldSecondaryIcon
|
|
116
|
+
}
|
|
117
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
118
|
+
index$2,
|
|
119
|
+
{
|
|
120
|
+
className: "select-error-expanded-search-suffix",
|
|
121
|
+
src: iconsReact.Search16SecondaryIcon
|
|
122
|
+
}
|
|
123
|
+
), /* @__PURE__ */ React__default.default.createElement(
|
|
124
|
+
index$2,
|
|
125
|
+
{
|
|
126
|
+
className: "select-error-focus-suffix",
|
|
127
|
+
src: iconsReact.ArrowChevronDown16BoldTertiaryIcon
|
|
128
|
+
}
|
|
129
|
+
)))
|
|
130
|
+
})
|
|
131
|
+
);
|
|
143
132
|
};
|
|
144
133
|
var Select$1 = Select;
|
|
145
134
|
|
|
146
|
-
|
|
135
|
+
exports.default = Select$1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SelectStyle = "E_s4ivdfu";
|
|
4
|
+
const SelectIconStyle = "E_sks9xr8";
|
|
5
|
+
const SelectSizeStyle = "E_swwhohx";
|
|
6
|
+
const PlaceholderTextStyle = "E_p2sxmsl";
|
|
7
|
+
|
|
8
|
+
exports.PlaceholderTextStyle = PlaceholderTextStyle;
|
|
9
|
+
exports.SelectIconStyle = SelectIconStyle;
|
|
10
|
+
exports.SelectSizeStyle = SelectSizeStyle;
|
|
11
|
+
exports.SelectStyle = SelectStyle;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('../../coreX/OverflowTooltip/index.js');
|
|
4
|
+
var antd = require('antd');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value
|
|
20
|
+
}) : obj[key] = value;
|
|
21
|
+
var __spreadValues = (a, b) => {
|
|
22
|
+
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
23
|
+
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
25
|
+
}
|
|
26
|
+
return a;
|
|
27
|
+
};
|
|
28
|
+
var __objRest = (source, exclude) => {
|
|
29
|
+
var target = {};
|
|
30
|
+
for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
|
|
31
|
+
if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
const OptionStyle = "E_oa99sl3";
|
|
37
|
+
const LeftStyle = "E_lvp5pj7";
|
|
38
|
+
const SlotStyle = "E_s1io1lws";
|
|
39
|
+
const AntdOption = antd.Select.Option;
|
|
40
|
+
function getOptions(options) {
|
|
41
|
+
return options.map(option => {
|
|
42
|
+
const _a = option,
|
|
43
|
+
{
|
|
44
|
+
prefix,
|
|
45
|
+
suffix,
|
|
46
|
+
children
|
|
47
|
+
} = _a,
|
|
48
|
+
restProps = __objRest(_a, ["prefix", "suffix", "children"]);
|
|
49
|
+
return /* @__PURE__ */React__default.default.createElement(AntdOption, __spreadValues({}, restProps), /* @__PURE__ */React__default.default.createElement("div", {
|
|
50
|
+
className: OptionStyle
|
|
51
|
+
}, /* @__PURE__ */React__default.default.createElement("span", {
|
|
52
|
+
className: LeftStyle
|
|
53
|
+
}, prefix ? /* @__PURE__ */React__default.default.createElement("span", {
|
|
54
|
+
className: SlotStyle
|
|
55
|
+
}, prefix) : null, /* @__PURE__ */React__default.default.createElement(index, {
|
|
56
|
+
content: children
|
|
57
|
+
})), suffix ? /* @__PURE__ */React__default.default.createElement("span", {
|
|
58
|
+
className: SlotStyle
|
|
59
|
+
}, suffix) : null));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.getOptions = getOptions;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var iconsReact = require('@cloudtower/icons-react');
|
|
4
4
|
var core = require('@linaria/core');
|
|
5
5
|
var index$2 = require('../Icon/index.js');
|
|
6
|
-
var index$1 = require('../
|
|
6
|
+
var index$1 = require('../LegacySelect/index.js');
|
|
7
7
|
var index = require('../Typo/index.js');
|
|
8
8
|
var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
|
|
9
9
|
var antd = require('antd');
|
package/dist/cjs/core/index.js
CHANGED
|
@@ -6,20 +6,20 @@ var index$9 = require('./Bps/index.js');
|
|
|
6
6
|
var index$d = require('./Byte/index.js');
|
|
7
7
|
var index$e = require('./BytePerSecond/index.js');
|
|
8
8
|
var index$t = require('./Frequency/index.js');
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
11
|
-
var index$
|
|
9
|
+
var index$M = require('./Percent/index.js');
|
|
10
|
+
var index$P = require('./Second/index.js');
|
|
11
|
+
var index$T = require('./Speed/index.js');
|
|
12
12
|
|
|
13
13
|
const units = {
|
|
14
|
-
Percent: index$
|
|
14
|
+
Percent: index$M,
|
|
15
15
|
Byte: index$d,
|
|
16
16
|
BytePerSecond: index$e,
|
|
17
17
|
Frequency: index$t,
|
|
18
|
-
Speed: index$
|
|
18
|
+
Speed: index$T,
|
|
19
19
|
Bps: index$9,
|
|
20
20
|
BitPerSecond: index$8,
|
|
21
21
|
Bit: index$7,
|
|
22
|
-
Second: index$
|
|
22
|
+
Second: index$P
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
exports.Bit = index$7;
|
|
@@ -28,8 +28,8 @@ exports.Bps = index$9;
|
|
|
28
28
|
exports.Byte = index$d;
|
|
29
29
|
exports.BytePerSecond = index$e;
|
|
30
30
|
exports.Frequency = index$t;
|
|
31
|
-
exports.Percent = index$
|
|
32
|
-
exports.Second = index$
|
|
33
|
-
exports.Speed = index$
|
|
31
|
+
exports.Percent = index$M;
|
|
32
|
+
exports.Second = index$P;
|
|
33
|
+
exports.Speed = index$T;
|
|
34
34
|
exports.Units = units;
|
|
35
35
|
exports.units = units;
|