@cloudtower/eagle 0.31.28 → 0.32.1
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/UIKitProvider/index.js +16 -2
- package/dist/cjs/core/ConfigProvider/index.js +1 -37
- package/dist/cjs/core/Fields/FieldsEnum/index.js +1 -1
- package/dist/cjs/core/Select/index.js +117 -106
- package/dist/cjs/core/TableForm/TableFormBodyCell.js +3 -6
- package/dist/cjs/core/TableForm/TableFormBodyRows.js +2 -7
- package/dist/cjs/core/TableForm/index.js +1 -12
- package/dist/cjs/core/TimeZoneSelect/index.js +1 -1
- package/dist/cjs/core/Tooltip/index.js +1 -4
- package/dist/cjs/core/index.js +12 -15
- package/dist/cjs/coreX/ChartWithTooltip/index.js +12 -14
- package/dist/cjs/coreX/DateRangePicker/Calendar.js +3 -4
- package/dist/cjs/coreX/DateRangePicker/index.js +2 -2
- package/dist/cjs/coreX/SummaryTable/index.js +3 -6
- package/dist/cjs/coreX/UnitWithChart/index.js +12 -14
- package/dist/cjs/index.js +239 -245
- package/dist/cjs/legacy-antd.js +133 -137
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/tower.js +0 -17
- package/dist/components.css +3150 -3348
- package/dist/esm/UIKitProvider/index.js +12 -2
- package/dist/esm/core/ConfigProvider/index.js +2 -32
- package/dist/esm/core/Fields/FieldsEnum/index.js +4 -4
- package/dist/esm/core/Select/index.js +116 -104
- package/dist/esm/core/TableForm/TableFormBodyCell.js +3 -6
- package/dist/esm/core/TableForm/TableFormBodyRows.js +2 -7
- package/dist/esm/core/TableForm/index.js +2 -13
- package/dist/esm/core/TimeZoneSelect/index.js +2 -2
- package/dist/esm/core/Tooltip/index.js +1 -4
- package/dist/esm/core/index.js +1 -3
- package/dist/esm/coreX/ChartWithTooltip/index.js +0 -2
- package/dist/esm/coreX/DateRangePicker/Calendar.js +3 -4
- package/dist/esm/coreX/DateRangePicker/index.js +3 -3
- package/dist/esm/coreX/SummaryTable/index.js +3 -6
- package/dist/esm/coreX/UnitWithChart/index.js +0 -2
- package/dist/esm/index.js +3 -6
- package/dist/esm/legacy-antd.js +0 -4
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/tower.js +1 -17
- package/dist/src/UIKitProvider/UIKitProvider.stories.d.ts +2 -1
- package/dist/src/antd.d.ts +0 -1
- package/dist/src/core/ConfigProvider/index.d.ts +0 -2
- package/dist/src/core/Select/index.d.ts +0 -1
- package/dist/src/core/Select/select.type.d.ts +31 -6
- package/dist/src/core/TableForm/types.d.ts +0 -3
- package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +1 -1
- package/dist/src/core/Tooltip/index.d.ts +1 -7
- package/dist/src/core/Tooltip/tooltip.widget.d.ts +5 -0
- package/dist/src/core/index.d.ts +2 -7
- package/dist/src/coreX/SummaryTable/index.d.ts +0 -1
- package/dist/src/coreX/UnitWithChart/index.d.ts +0 -1
- package/dist/src/spec/base.d.ts +1 -3
- package/dist/src/utils/tower.d.ts +0 -1
- package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +1 -1
- package/dist/stories/docs/core/{LegacySelect.Simple.stories.d.ts → Select.Simple.stories.d.ts} +3 -3
- package/dist/stories/docs/core/Tooltip.stories.d.ts +1 -3
- package/dist/style.css +3146 -3312
- package/package.json +4 -6
- package/dist/cjs/core/BytePerSecond/index.js +0 -45
- package/dist/cjs/core/LegacySelect/index.js +0 -185
- package/dist/cjs/core/LegacySelect/select.style.js +0 -5
- package/dist/cjs/core/Select/select.style.js +0 -11
- package/dist/cjs/core/Select/select.widgets.js +0 -63
- package/dist/cjs/core/Tooltip/EllipsisTooltipContent.js +0 -55
- package/dist/esm/core/BytePerSecond/index.js +0 -39
- package/dist/esm/core/LegacySelect/index.js +0 -177
- package/dist/esm/core/LegacySelect/select.style.js +0 -3
- package/dist/esm/core/Select/select.style.js +0 -6
- package/dist/esm/core/Select/select.widgets.js +0 -57
- package/dist/esm/core/Tooltip/EllipsisTooltipContent.js +0 -49
- package/dist/src/core/BytePerSecond/index.d.ts +0 -3
- package/dist/src/core/LegacySelect/index.d.ts +0 -4
- package/dist/src/core/LegacySelect/select.style.d.ts +0 -1
- package/dist/src/core/LegacySelect/select.type.d.ts +0 -31
- package/dist/src/core/Select/select.style.d.ts +0 -4
- package/dist/src/core/Select/select.widgets.d.ts +0 -7
- package/dist/stories/docs/core/BytePerSecond.stories.d.ts +0 -17
- package/dist/stories/docs/core/LegacySelect.stories.d.ts +0 -16
- package/dist/stories/docs/coreX/Calendar.stories.d.ts +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudtower/eagle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"sync:color": "node tools/fetch-figma-color.js"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cloudtower/icons-react": "^0.
|
|
31
|
-
"@cloudtower/parrot": "^0.
|
|
30
|
+
"@cloudtower/icons-react": "^0.32.1",
|
|
31
|
+
"@cloudtower/parrot": "^0.32.1",
|
|
32
32
|
"@cloudtower/rc-notification": "^4.6.1",
|
|
33
33
|
"@linaria/core": "^4.2.2",
|
|
34
34
|
"@linaria/react": "^4.3.0",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"@rollup/plugin-alias": "^5.1.0",
|
|
57
57
|
"@rollup/plugin-image": "^3.0.2",
|
|
58
58
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
59
|
-
"@rollup/plugin-replace": "^6.0.1",
|
|
60
59
|
"@storybook/addon-actions": "^7.4.1",
|
|
61
60
|
"@storybook/addon-designs": "^7.0.5",
|
|
62
61
|
"@storybook/addon-essentials": "^7.4.1",
|
|
@@ -70,7 +69,6 @@
|
|
|
70
69
|
"@testing-library/react": "^12.1.5",
|
|
71
70
|
"@testing-library/react-hooks": "^8.0.1",
|
|
72
71
|
"@types/history": "4.7.3",
|
|
73
|
-
"@types/moment": "^2.13.0",
|
|
74
72
|
"@types/react": "^17.0.50",
|
|
75
73
|
"@types/react-beautiful-dnd": "^13.1.4",
|
|
76
74
|
"@types/react-highlight-words": "^0.16.7",
|
|
@@ -114,5 +112,5 @@
|
|
|
114
112
|
"vite": "^4.5.1",
|
|
115
113
|
"vitest": "^0.24.1"
|
|
116
114
|
},
|
|
117
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "76083171a7860e510bcd5bf7b70bf6cf27e73481"
|
|
118
116
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@linaria/core');
|
|
4
|
-
var index = require('../Empty/index.js');
|
|
5
|
-
var isEmpty = require('../../utils/isEmpty.js');
|
|
6
|
-
var tower = require('../../utils/tower.js');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var index$1 = require('../Styled/index.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
|
-
|
|
14
|
-
var __defProp = Object.defineProperty;
|
|
15
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
16
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
18
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
-
var __spreadValues = (a, b) => {
|
|
20
|
-
for (var prop in b || (b = {}))
|
|
21
|
-
if (__hasOwnProp.call(b, prop))
|
|
22
|
-
__defNormalProp(a, prop, b[prop]);
|
|
23
|
-
if (__getOwnPropSymbols)
|
|
24
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
25
|
-
if (__propIsEnum.call(b, prop))
|
|
26
|
-
__defNormalProp(a, prop, b[prop]);
|
|
27
|
-
}
|
|
28
|
-
return a;
|
|
29
|
-
};
|
|
30
|
-
const BytePerSecond = ({
|
|
31
|
-
rawValue,
|
|
32
|
-
decimals,
|
|
33
|
-
valueClassName,
|
|
34
|
-
unitClassName,
|
|
35
|
-
emptyProps
|
|
36
|
-
}) => {
|
|
37
|
-
if (isEmpty(rawValue)) {
|
|
38
|
-
return /* @__PURE__ */ React__default.default.createElement(index, __spreadValues({}, emptyProps));
|
|
39
|
-
}
|
|
40
|
-
const { value, unit } = tower.formatBytePerSecond(rawValue, decimals);
|
|
41
|
-
return /* @__PURE__ */ React__default.default.createElement("span", null, /* @__PURE__ */ React__default.default.createElement("span", { className: core.cx("value", valueClassName) }, value), /* @__PURE__ */ React__default.default.createElement("span", { className: core.cx("unit", index$1.UnitStyle, unitClassName) }, ` ${unit}`));
|
|
42
|
-
};
|
|
43
|
-
var BytePerSecond$1 = BytePerSecond;
|
|
44
|
-
|
|
45
|
-
module.exports = BytePerSecond$1;
|
|
@@ -1,185 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,63 +0,0 @@
|
|
|
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;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@linaria/core');
|
|
4
|
-
var react = require('@linaria/react');
|
|
5
|
-
var _ = require('lodash');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
-
|
|
12
|
-
const _exp = /*#__PURE__*/() => props => props.maxHeight ? `${props.maxHeight}px` : "unset";
|
|
13
|
-
const Wrapper = /*#__PURE__*/react.styled('div')({
|
|
14
|
-
name: "Wrapper",
|
|
15
|
-
class: "E_w1dxz879",
|
|
16
|
-
propsAsIs: false,
|
|
17
|
-
vars: {
|
|
18
|
-
"w1dxz879-0": [_exp()]
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const EllipsisTooltipContent = ({
|
|
22
|
-
tooltip,
|
|
23
|
-
maxHeight,
|
|
24
|
-
contentWrapperClassName,
|
|
25
|
-
ellipsisTips
|
|
26
|
-
}) => {
|
|
27
|
-
const overFlowWrapperRef = React.useRef(null);
|
|
28
|
-
const [showTips, setShowTips] = React.useState(null);
|
|
29
|
-
React.useEffect(() => {
|
|
30
|
-
const wrapperEle = overFlowWrapperRef.current;
|
|
31
|
-
let wrapperObserver;
|
|
32
|
-
if (wrapperEle) {
|
|
33
|
-
const handleVisibleTips = _.debounce(() => {
|
|
34
|
-
setShowTips(wrapperEle.scrollHeight > (maxHeight || Infinity));
|
|
35
|
-
}, 200);
|
|
36
|
-
wrapperObserver = new ResizeObserver(handleVisibleTips);
|
|
37
|
-
wrapperObserver.observe(wrapperEle);
|
|
38
|
-
}
|
|
39
|
-
return () => {
|
|
40
|
-
wrapperObserver == null ? void 0 : wrapperObserver.disconnect();
|
|
41
|
-
};
|
|
42
|
-
}, [maxHeight]);
|
|
43
|
-
return /* @__PURE__ */React__default.default.createElement(Wrapper, {
|
|
44
|
-
className: core.cx(contentWrapperClassName, _.isNull(showTips) && "eagle-ellipsis-content"),
|
|
45
|
-
maxHeight
|
|
46
|
-
}, /* @__PURE__ */React__default.default.createElement("div", {
|
|
47
|
-
className: "ellipsis-tooltip",
|
|
48
|
-
ref: overFlowWrapperRef
|
|
49
|
-
}, tooltip), !!showTips && /* @__PURE__ */React__default.default.createElement("span", {
|
|
50
|
-
className: "tips"
|
|
51
|
-
}, ellipsisTips));
|
|
52
|
-
};
|
|
53
|
-
var EllipsisTooltipContent$1 = EllipsisTooltipContent;
|
|
54
|
-
|
|
55
|
-
module.exports = EllipsisTooltipContent$1;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { cx } from '@linaria/core';
|
|
2
|
-
import Empty from '../Empty/index.js';
|
|
3
|
-
import isEmpty from '../../utils/isEmpty.js';
|
|
4
|
-
import { formatBytePerSecond } from '../../utils/tower.js';
|
|
5
|
-
import React__default from 'react';
|
|
6
|
-
import { UnitStyle } from '../Styled/index.js';
|
|
7
|
-
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
const BytePerSecond = ({
|
|
25
|
-
rawValue,
|
|
26
|
-
decimals,
|
|
27
|
-
valueClassName,
|
|
28
|
-
unitClassName,
|
|
29
|
-
emptyProps
|
|
30
|
-
}) => {
|
|
31
|
-
if (isEmpty(rawValue)) {
|
|
32
|
-
return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues({}, emptyProps));
|
|
33
|
-
}
|
|
34
|
-
const { value, unit } = formatBytePerSecond(rawValue, decimals);
|
|
35
|
-
return /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", { className: cx("value", valueClassName) }, value), /* @__PURE__ */ React__default.createElement("span", { className: cx("unit", UnitStyle, unitClassName) }, ` ${unit}`));
|
|
36
|
-
};
|
|
37
|
-
var BytePerSecond$1 = BytePerSecond;
|
|
38
|
-
|
|
39
|
-
export { BytePerSecond$1 as default };
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import Loading from '../Loading/index.js';
|
|
2
|
-
import { Typo } from '../Typo/index.js';
|
|
3
|
-
import { Select } from 'antd';
|
|
4
|
-
import cs from 'classnames';
|
|
5
|
-
import _ from 'lodash';
|
|
6
|
-
import React__default, { useMemo, useRef, useEffect } from 'react';
|
|
7
|
-
import { findDOMNode } from 'react-dom';
|
|
8
|
-
import { isElement } from 'react-is';
|
|
9
|
-
import { SelectStyle } from './select.style.js';
|
|
10
|
-
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __defProps = Object.defineProperties;
|
|
13
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
14
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
-
var __spreadValues = (a, b) => {
|
|
19
|
-
for (var prop in b || (b = {}))
|
|
20
|
-
if (__hasOwnProp.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
if (__getOwnPropSymbols)
|
|
23
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
-
if (__propIsEnum.call(b, prop))
|
|
25
|
-
__defNormalProp(a, prop, b[prop]);
|
|
26
|
-
}
|
|
27
|
-
return a;
|
|
28
|
-
};
|
|
29
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
30
|
-
var __objRest = (source, exclude) => {
|
|
31
|
-
var target = {};
|
|
32
|
-
for (var prop in source)
|
|
33
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
if (source != null && __getOwnPropSymbols)
|
|
36
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
37
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
38
|
-
target[prop] = source[prop];
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
};
|
|
42
|
-
const LegacySelect = (_a) => {
|
|
43
|
-
var _b = _a, {
|
|
44
|
-
input,
|
|
45
|
-
multiple,
|
|
46
|
-
className,
|
|
47
|
-
scrollBottomBuffer = 0,
|
|
48
|
-
onScrollBottom,
|
|
49
|
-
onPopupScroll,
|
|
50
|
-
onSearch,
|
|
51
|
-
showSearch,
|
|
52
|
-
filterOption,
|
|
53
|
-
loading,
|
|
54
|
-
notFoundContent,
|
|
55
|
-
children,
|
|
56
|
-
error,
|
|
57
|
-
selectLimit,
|
|
58
|
-
dropdownClassName,
|
|
59
|
-
danger,
|
|
60
|
-
size = "middle",
|
|
61
|
-
meta,
|
|
62
|
-
placeholder
|
|
63
|
-
} = _b, restProps = __objRest(_b, [
|
|
64
|
-
"input",
|
|
65
|
-
"multiple",
|
|
66
|
-
"className",
|
|
67
|
-
"scrollBottomBuffer",
|
|
68
|
-
"onScrollBottom",
|
|
69
|
-
"onPopupScroll",
|
|
70
|
-
"onSearch",
|
|
71
|
-
"showSearch",
|
|
72
|
-
"filterOption",
|
|
73
|
-
"loading",
|
|
74
|
-
"notFoundContent",
|
|
75
|
-
"children",
|
|
76
|
-
"error",
|
|
77
|
-
"selectLimit",
|
|
78
|
-
"dropdownClassName",
|
|
79
|
-
"danger",
|
|
80
|
-
"size",
|
|
81
|
-
"meta",
|
|
82
|
-
"placeholder"
|
|
83
|
-
]);
|
|
84
|
-
var _a2;
|
|
85
|
-
const limitExceeded = multiple && selectLimit && selectLimit <= (((_a2 = input.value) == null ? void 0 : _a2.length) || 0);
|
|
86
|
-
const typo = {
|
|
87
|
-
large: Typo.Label.l2_regular,
|
|
88
|
-
middle: Typo.Label.l3_regular,
|
|
89
|
-
small: Typo.Label.l4_regular
|
|
90
|
-
}[size];
|
|
91
|
-
const _danger = useMemo(() => {
|
|
92
|
-
if (danger !== void 0) {
|
|
93
|
-
return danger;
|
|
94
|
-
}
|
|
95
|
-
return (meta == null ? void 0 : meta.touched) && meta.invalid;
|
|
96
|
-
}, [danger, meta]);
|
|
97
|
-
const selectRef = useRef(null);
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (!selectRef.current) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const realDom = findDOMNode(selectRef.current);
|
|
103
|
-
if (realDom) {
|
|
104
|
-
const inputDom = realDom.getElementsByClassName(
|
|
105
|
-
"ant-select-selection-search-input"
|
|
106
|
-
)[0];
|
|
107
|
-
const item = realDom.getElementsByClassName(
|
|
108
|
-
"ant-select-selection-item"
|
|
109
|
-
)[0];
|
|
110
|
-
inputDom && (placeholder || item) && inputDom.setAttribute(
|
|
111
|
-
"data-test",
|
|
112
|
-
String(placeholder || item.textContent)
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
}, [selectRef, placeholder]);
|
|
116
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
117
|
-
Select,
|
|
118
|
-
__spreadValues(__spreadProps(__spreadValues({}, input), {
|
|
119
|
-
ref: selectRef,
|
|
120
|
-
size,
|
|
121
|
-
value: multiple ? input.value || [] : input.value || void 0,
|
|
122
|
-
onChange: (e, option) => {
|
|
123
|
-
var _a3, _b2;
|
|
124
|
-
if (Array.isArray(e) && e.some((v) => v === "")) {
|
|
125
|
-
(_a3 = input.onChange) == null ? void 0 : _a3.call(input, [], option);
|
|
126
|
-
} else {
|
|
127
|
-
(_b2 = input.onChange) == null ? void 0 : _b2.call(input, e, option);
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
onBlur: () => {
|
|
131
|
-
var _a3;
|
|
132
|
-
return (_a3 = input.onBlur) == null ? void 0 : _a3.call(input);
|
|
133
|
-
},
|
|
134
|
-
mode: multiple ? "multiple" : void 0,
|
|
135
|
-
className: cs(
|
|
136
|
-
SelectStyle,
|
|
137
|
-
"select",
|
|
138
|
-
className,
|
|
139
|
-
limitExceeded && "select-event-none",
|
|
140
|
-
_danger ? "select-error" : "",
|
|
141
|
-
typo
|
|
142
|
-
),
|
|
143
|
-
"data-size": size,
|
|
144
|
-
dropdownClassName: cs(dropdownClassName, limitExceeded && "display-none"),
|
|
145
|
-
showSearch: multiple ? void 0 : typeof showSearch === "undefined" ? Boolean(onSearch) : showSearch,
|
|
146
|
-
filterOption: onSearch === void 0 ? filterOption === void 0 ? (input2, option) => {
|
|
147
|
-
const label = option == null ? void 0 : option.label;
|
|
148
|
-
if (!label || typeof label !== "string") {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
return label.toLowerCase().includes(input2.toLowerCase());
|
|
152
|
-
} : filterOption : false,
|
|
153
|
-
onSearch: onSearch && _.debounce(onSearch, 100),
|
|
154
|
-
onPopupScroll: (e) => {
|
|
155
|
-
onPopupScroll == null ? void 0 : onPopupScroll(e);
|
|
156
|
-
const el = e.currentTarget;
|
|
157
|
-
if (el.scrollHeight - el.offsetHeight - el.scrollTop <= scrollBottomBuffer) {
|
|
158
|
-
onScrollBottom == null ? void 0 : onScrollBottom();
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
notFoundContent: loading ? /* @__PURE__ */ React__default.createElement(Loading, null) : notFoundContent,
|
|
162
|
-
dropdownRender: (menu) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, error || menu),
|
|
163
|
-
loading,
|
|
164
|
-
placeholder
|
|
165
|
-
}), restProps),
|
|
166
|
-
React__default.Children.map(children, (child) => {
|
|
167
|
-
return isElement(child) ? __spreadProps(__spreadValues({}, child), {
|
|
168
|
-
props: __spreadProps(__spreadValues({}, child.props), {
|
|
169
|
-
"data-test": child.props.value
|
|
170
|
-
})
|
|
171
|
-
}) : child;
|
|
172
|
-
})
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
var LegacySelect$1 = LegacySelect;
|
|
176
|
-
|
|
177
|
-
export { LegacySelect$1 as default };
|