@douyinfe/semi-ui 2.36.0 → 2.37.0-beta.0
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/css/semi.css +39 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +831 -501
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/_base/baseComponent.d.ts +1 -0
- package/lib/cjs/_base/baseComponent.js +4 -0
- package/lib/cjs/anchor/index.js +2 -2
- package/lib/cjs/autoComplete/index.js +2 -2
- package/lib/cjs/banner/index.js +2 -2
- package/lib/cjs/breadcrumb/index.js +2 -2
- package/lib/cjs/breadcrumb/item.js +1 -1
- package/lib/cjs/calendar/dayCalendar.js +2 -2
- package/lib/cjs/calendar/monthCalendar.js +2 -2
- package/lib/cjs/calendar/rangeCalendar.js +2 -2
- package/lib/cjs/calendar/weekCalendar.d.ts +1 -1
- package/lib/cjs/calendar/weekCalendar.js +2 -2
- package/lib/cjs/carousel/index.js +2 -2
- package/lib/cjs/cascader/index.js +1 -1
- package/lib/cjs/checkbox/checkbox.js +2 -2
- package/lib/cjs/checkbox/checkboxGroup.js +2 -2
- package/lib/cjs/collapse/index.js +2 -2
- package/lib/cjs/collapsible/index.js +2 -2
- package/lib/cjs/datePicker/dateInput.d.ts +1 -0
- package/lib/cjs/datePicker/dateInput.js +10 -6
- package/lib/cjs/datePicker/datePicker.js +23 -11
- package/lib/cjs/datePicker/quickControl.d.ts +2 -0
- package/lib/cjs/datePicker/quickControl.js +5 -3
- package/lib/cjs/descriptions/index.js +22 -11
- package/lib/cjs/descriptions/item.js +22 -11
- package/lib/cjs/empty/index.js +23 -13
- package/lib/cjs/input/index.d.ts +2 -1
- package/lib/cjs/input/index.js +4 -15
- package/lib/cjs/list/index.js +30 -20
- package/lib/cjs/list/item.js +18 -15
- package/lib/cjs/locale/interface.d.ts +1 -0
- package/lib/cjs/locale/source/ar.js +1 -0
- package/lib/cjs/locale/source/de.js +1 -0
- package/lib/cjs/locale/source/en_GB.js +1 -0
- package/lib/cjs/locale/source/en_US.js +1 -0
- package/lib/cjs/locale/source/es.js +1 -0
- package/lib/cjs/locale/source/fr.js +1 -0
- package/lib/cjs/locale/source/id_ID.js +1 -0
- package/lib/cjs/locale/source/it.js +1 -0
- package/lib/cjs/locale/source/ja_JP.js +1 -0
- package/lib/cjs/locale/source/ko_KR.js +1 -0
- package/lib/cjs/locale/source/ms_MY.js +1 -0
- package/lib/cjs/locale/source/nl_NL.js +1 -0
- package/lib/cjs/locale/source/pl_PL.js +1 -0
- package/lib/cjs/locale/source/pt_BR.js +1 -0
- package/lib/cjs/locale/source/ro.d.ts +1 -0
- package/lib/cjs/locale/source/ro.js +1 -0
- package/lib/cjs/locale/source/ru_RU.js +1 -0
- package/lib/cjs/locale/source/sv_SE.js +1 -0
- package/lib/cjs/locale/source/th_TH.js +1 -0
- package/lib/cjs/locale/source/tr_TR.js +1 -0
- package/lib/cjs/locale/source/vi_VN.js +1 -0
- package/lib/cjs/locale/source/zh_CN.js +1 -0
- package/lib/cjs/locale/source/zh_TW.js +1 -0
- package/lib/cjs/modal/ModalContent.js +12 -9
- package/lib/cjs/navigation/index.js +34 -24
- package/lib/cjs/pagination/index.d.ts +3 -0
- package/lib/cjs/pagination/index.js +73 -39
- package/lib/cjs/progress/index.js +44 -31
- package/lib/cjs/radio/radio.js +27 -17
- package/lib/cjs/radio/radioGroup.js +24 -14
- package/lib/cjs/rating/index.js +21 -11
- package/lib/cjs/scrollList/index.js +21 -11
- package/lib/cjs/select/index.js +30 -21
- package/lib/cjs/sideSheet/SideSheetContent.js +27 -7
- package/lib/cjs/slider/index.js +20 -11
- package/lib/cjs/spin/index.js +19 -9
- package/lib/cjs/steps/basicSteps.js +24 -14
- package/lib/cjs/steps/fillSteps.js +22 -12
- package/lib/cjs/steps/navSteps.js +21 -11
- package/lib/cjs/switch/index.js +23 -13
- package/lib/cjs/table/Table.d.ts +1 -0
- package/lib/cjs/table/Table.js +3 -2
- package/lib/cjs/tabs/index.js +1 -2
- package/lib/cjs/tagInput/index.js +20 -10
- package/lib/cjs/timeline/index.js +20 -9
- package/lib/cjs/timeline/item.js +24 -13
- package/lib/cjs/toast/index.d.ts +4 -0
- package/lib/cjs/tooltip/index.js +3 -1
- package/lib/cjs/transfer/index.js +19 -9
- package/lib/cjs/tree/index.js +32 -22
- package/lib/cjs/treeSelect/index.js +29 -19
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.js +28 -18
- package/lib/es/_base/baseComponent.d.ts +1 -0
- package/lib/es/_base/baseComponent.js +4 -0
- package/lib/es/anchor/index.js +2 -2
- package/lib/es/autoComplete/index.js +2 -2
- package/lib/es/banner/index.js +2 -2
- package/lib/es/breadcrumb/index.js +2 -2
- package/lib/es/breadcrumb/item.js +1 -1
- package/lib/es/calendar/dayCalendar.js +2 -2
- package/lib/es/calendar/monthCalendar.js +2 -2
- package/lib/es/calendar/rangeCalendar.js +2 -2
- package/lib/es/calendar/weekCalendar.d.ts +1 -1
- package/lib/es/calendar/weekCalendar.js +2 -2
- package/lib/es/carousel/index.js +2 -2
- package/lib/es/cascader/index.js +1 -1
- package/lib/es/checkbox/checkbox.js +2 -2
- package/lib/es/checkbox/checkboxGroup.js +2 -2
- package/lib/es/collapse/index.js +2 -2
- package/lib/es/collapsible/index.js +2 -2
- package/lib/es/datePicker/dateInput.d.ts +1 -0
- package/lib/es/datePicker/dateInput.js +10 -6
- package/lib/es/datePicker/datePicker.js +23 -10
- package/lib/es/datePicker/quickControl.d.ts +2 -0
- package/lib/es/datePicker/quickControl.js +5 -3
- package/lib/es/descriptions/index.js +22 -11
- package/lib/es/descriptions/item.js +22 -11
- package/lib/es/empty/index.js +23 -13
- package/lib/es/input/index.d.ts +2 -1
- package/lib/es/input/index.js +4 -15
- package/lib/es/list/index.js +30 -20
- package/lib/es/list/item.js +18 -15
- package/lib/es/locale/interface.d.ts +1 -0
- package/lib/es/locale/source/ar.js +1 -0
- package/lib/es/locale/source/de.js +1 -0
- package/lib/es/locale/source/en_GB.js +1 -0
- package/lib/es/locale/source/en_US.js +1 -0
- package/lib/es/locale/source/es.js +1 -0
- package/lib/es/locale/source/fr.js +1 -0
- package/lib/es/locale/source/id_ID.js +1 -0
- package/lib/es/locale/source/it.js +1 -0
- package/lib/es/locale/source/ja_JP.js +1 -0
- package/lib/es/locale/source/ko_KR.js +1 -0
- package/lib/es/locale/source/ms_MY.js +1 -0
- package/lib/es/locale/source/nl_NL.js +1 -0
- package/lib/es/locale/source/pl_PL.js +1 -0
- package/lib/es/locale/source/pt_BR.js +1 -0
- package/lib/es/locale/source/ro.d.ts +1 -0
- package/lib/es/locale/source/ro.js +1 -0
- package/lib/es/locale/source/ru_RU.js +1 -0
- package/lib/es/locale/source/sv_SE.js +1 -0
- package/lib/es/locale/source/th_TH.js +1 -0
- package/lib/es/locale/source/tr_TR.js +1 -0
- package/lib/es/locale/source/vi_VN.js +1 -0
- package/lib/es/locale/source/zh_CN.js +1 -0
- package/lib/es/locale/source/zh_TW.js +1 -0
- package/lib/es/modal/ModalContent.js +12 -9
- package/lib/es/navigation/index.js +34 -24
- package/lib/es/pagination/index.d.ts +3 -0
- package/lib/es/pagination/index.js +73 -38
- package/lib/es/progress/index.js +44 -31
- package/lib/es/radio/radio.js +27 -17
- package/lib/es/radio/radioGroup.js +24 -14
- package/lib/es/rating/index.js +21 -11
- package/lib/es/scrollList/index.js +21 -11
- package/lib/es/select/index.js +30 -20
- package/lib/es/sideSheet/SideSheetContent.js +27 -7
- package/lib/es/slider/index.js +20 -10
- package/lib/es/spin/index.js +19 -9
- package/lib/es/steps/basicSteps.js +24 -14
- package/lib/es/steps/fillSteps.js +22 -12
- package/lib/es/steps/navSteps.js +21 -11
- package/lib/es/switch/index.js +23 -13
- package/lib/es/table/Table.d.ts +1 -0
- package/lib/es/table/Table.js +3 -2
- package/lib/es/tabs/index.js +1 -2
- package/lib/es/tagInput/index.js +20 -10
- package/lib/es/timeline/index.js +20 -9
- package/lib/es/timeline/item.js +24 -13
- package/lib/es/toast/index.d.ts +4 -0
- package/lib/es/tooltip/index.js +3 -1
- package/lib/es/transfer/index.js +19 -9
- package/lib/es/tree/index.js +32 -22
- package/lib/es/treeSelect/index.js +29 -19
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.js +28 -18
- package/package.json +8 -8
package/lib/es/radio/radio.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import _isBoolean from "lodash/isBoolean";
|
|
2
2
|
import _isUndefined from "lodash/isUndefined";
|
|
3
3
|
import _noop from "lodash/noop";
|
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
5
|
+
var t = {};
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
4
12
|
/* eslint-disable prefer-destructuring */
|
|
5
13
|
import React from 'react';
|
|
6
14
|
import PropTypes from 'prop-types';
|
|
@@ -104,21 +112,23 @@ class Radio extends BaseComponent {
|
|
|
104
112
|
this.radioEntity.blur();
|
|
105
113
|
}
|
|
106
114
|
render() {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
const _a = this.props,
|
|
116
|
+
{
|
|
117
|
+
addonClassName,
|
|
118
|
+
addonStyle,
|
|
119
|
+
disabled,
|
|
120
|
+
style,
|
|
121
|
+
className,
|
|
122
|
+
prefixCls,
|
|
123
|
+
displayMode,
|
|
124
|
+
children,
|
|
125
|
+
extra,
|
|
126
|
+
mode,
|
|
127
|
+
type,
|
|
128
|
+
value: propValue,
|
|
129
|
+
name
|
|
130
|
+
} = _a,
|
|
131
|
+
rest = __rest(_a, ["addonClassName", "addonStyle", "disabled", "style", "className", "prefixCls", "displayMode", "children", "extra", "mode", "type", "value", "name"]);
|
|
122
132
|
let realChecked, isDisabled, realMode, isButtonRadioGroup, isCardRadioGroup, isPureCardRadioGroup, isButtonRadioComponent, buttonSize, realPrefixCls;
|
|
123
133
|
const {
|
|
124
134
|
hover: isHover,
|
|
@@ -199,12 +209,12 @@ class Radio extends BaseComponent {
|
|
|
199
209
|
"x-semi-prop": "extra"
|
|
200
210
|
}, extra) : null);
|
|
201
211
|
};
|
|
202
|
-
return /*#__PURE__*/React.createElement("label", {
|
|
212
|
+
return /*#__PURE__*/React.createElement("label", Object.assign({
|
|
203
213
|
style: style,
|
|
204
214
|
className: wrapper,
|
|
205
215
|
onMouseEnter: this.handleMouseEnter,
|
|
206
216
|
onMouseLeave: this.handleMouseLeave
|
|
207
|
-
}, /*#__PURE__*/React.createElement(RadioInner, Object.assign({}, this.props, props, {
|
|
217
|
+
}, this.getDataAttr(rest)), /*#__PURE__*/React.createElement(RadioInner, Object.assign({}, this.props, props, {
|
|
208
218
|
mode: realMode,
|
|
209
219
|
name: name !== null && name !== void 0 ? name : groupName,
|
|
210
220
|
isButtonRadio: isButtonRadio,
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import _noop from "lodash/noop";
|
|
2
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
6
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
2
10
|
import React from 'react';
|
|
3
11
|
import PropTypes from 'prop-types';
|
|
4
12
|
import classnames from 'classnames';
|
|
@@ -50,18 +58,20 @@ class RadioGroup extends BaseComponent {
|
|
|
50
58
|
});
|
|
51
59
|
}
|
|
52
60
|
render() {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
const _a = this.props,
|
|
62
|
+
{
|
|
63
|
+
children,
|
|
64
|
+
options,
|
|
65
|
+
mode,
|
|
66
|
+
prefixCls,
|
|
67
|
+
className,
|
|
68
|
+
style,
|
|
69
|
+
direction,
|
|
70
|
+
type,
|
|
71
|
+
buttonSize,
|
|
72
|
+
id
|
|
73
|
+
} = _a,
|
|
74
|
+
rest = __rest(_a, ["children", "options", "mode", "prefixCls", "className", "style", "direction", "type", "buttonSize", "id"]);
|
|
65
75
|
const isButtonRadio = type === strings.TYPE_BUTTON;
|
|
66
76
|
const isPureCardRadio = type === strings.TYPE_PURECARD;
|
|
67
77
|
const isCardRadio = type === strings.TYPE_CARD || isPureCardRadio;
|
|
@@ -101,7 +111,7 @@ class RadioGroup extends BaseComponent {
|
|
|
101
111
|
key: index
|
|
102
112
|
}) : null);
|
|
103
113
|
}
|
|
104
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
105
115
|
className: prefixClsDisplay,
|
|
106
116
|
style: style,
|
|
107
117
|
id: id,
|
|
@@ -111,7 +121,7 @@ class RadioGroup extends BaseComponent {
|
|
|
111
121
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
112
122
|
"aria-describedby": this.props['aria-describedby'],
|
|
113
123
|
"aria-required": this.props['aria-required']
|
|
114
|
-
}, /*#__PURE__*/React.createElement(Context.Provider, {
|
|
124
|
+
}, this.getDataAttr(rest)), /*#__PURE__*/React.createElement(Context.Provider, {
|
|
115
125
|
value: {
|
|
116
126
|
radioGroup: {
|
|
117
127
|
onChange: this.onChange,
|
package/lib/es/rating/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React from 'react';
|
|
2
10
|
import ReactDOM from 'react-dom';
|
|
3
11
|
import BaseComponent from '../_base/baseComponent';
|
|
@@ -234,15 +242,17 @@ export default class Rating extends BaseComponent {
|
|
|
234
242
|
this.foundation.destroy();
|
|
235
243
|
}
|
|
236
244
|
render() {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
const _a = this.props,
|
|
246
|
+
{
|
|
247
|
+
style,
|
|
248
|
+
prefixCls,
|
|
249
|
+
disabled,
|
|
250
|
+
className,
|
|
251
|
+
id,
|
|
252
|
+
count,
|
|
253
|
+
tabIndex
|
|
254
|
+
} = _a,
|
|
255
|
+
rest = __rest(_a, ["style", "prefixCls", "disabled", "className", "id", "count", "tabIndex"]);
|
|
246
256
|
const {
|
|
247
257
|
value,
|
|
248
258
|
emptyStarFocusVisible
|
|
@@ -257,7 +267,7 @@ export default class Rating extends BaseComponent {
|
|
|
257
267
|
return (
|
|
258
268
|
/*#__PURE__*/
|
|
259
269
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
260
|
-
React.createElement("ul", {
|
|
270
|
+
React.createElement("ul", Object.assign({
|
|
261
271
|
"aria-label": ariaLabel,
|
|
262
272
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
263
273
|
"aria-describedby": this.props['aria-describedby'],
|
|
@@ -270,7 +280,7 @@ export default class Rating extends BaseComponent {
|
|
|
270
280
|
onKeyDown: disabled ? noop : this.onKeyDown,
|
|
271
281
|
ref: this.saveRate,
|
|
272
282
|
id: id
|
|
273
|
-
}, itemList)
|
|
283
|
+
}, this.getDataAttr(rest)), itemList)
|
|
274
284
|
);
|
|
275
285
|
}
|
|
276
286
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React from 'react';
|
|
2
10
|
import BaseComponent from '../_base/baseComponent';
|
|
3
11
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/scrollList/constants';
|
|
@@ -13,25 +21,27 @@ class ScrollList extends BaseComponent {
|
|
|
13
21
|
this.foundation = new Foundation(this.adapter);
|
|
14
22
|
}
|
|
15
23
|
render() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const _a = this.props,
|
|
25
|
+
{
|
|
26
|
+
children,
|
|
27
|
+
header,
|
|
28
|
+
footer,
|
|
29
|
+
prefixCls,
|
|
30
|
+
bodyHeight,
|
|
31
|
+
className,
|
|
32
|
+
style
|
|
33
|
+
} = _a,
|
|
34
|
+
rest = __rest(_a, ["children", "header", "footer", "prefixCls", "bodyHeight", "className", "style"]);
|
|
25
35
|
const clsWrapper = classnames(className, {
|
|
26
36
|
[prefixCls || cssClasses.PREFIX]: true
|
|
27
37
|
});
|
|
28
38
|
const clsHeader = classnames({
|
|
29
39
|
[`${prefixCls || cssClasses.PREFIX}-header`]: true
|
|
30
40
|
});
|
|
31
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
32
42
|
className: clsWrapper,
|
|
33
43
|
style: style
|
|
34
|
-
}, header ? /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
}, this.getDataAttr(rest)), header ? /*#__PURE__*/React.createElement("div", {
|
|
35
45
|
className: clsHeader
|
|
36
46
|
}, /*#__PURE__*/React.createElement("div", {
|
|
37
47
|
className: `${clsHeader}-title`,
|
package/lib/es/select/index.js
CHANGED
|
@@ -4,6 +4,14 @@ import _get from "lodash/get";
|
|
|
4
4
|
import _noop from "lodash/noop";
|
|
5
5
|
import _isString from "lodash/isString";
|
|
6
6
|
import _isEqual from "lodash/isEqual";
|
|
7
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
8
|
+
var t = {};
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
7
15
|
/* eslint-disable max-len */
|
|
8
16
|
/* eslint-disable max-lines-per-function */
|
|
9
17
|
import React, { Fragment } from 'react';
|
|
@@ -1021,25 +1029,27 @@ class Select extends BaseComponent {
|
|
|
1021
1029
|
}, labelNode);
|
|
1022
1030
|
}
|
|
1023
1031
|
renderSelection() {
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1032
|
+
const _a = this.props,
|
|
1033
|
+
{
|
|
1034
|
+
disabled,
|
|
1035
|
+
multiple,
|
|
1036
|
+
filter,
|
|
1037
|
+
style,
|
|
1038
|
+
id,
|
|
1039
|
+
size,
|
|
1040
|
+
className,
|
|
1041
|
+
validateStatus,
|
|
1042
|
+
showArrow,
|
|
1043
|
+
suffix,
|
|
1044
|
+
prefix,
|
|
1045
|
+
insetLabel,
|
|
1046
|
+
placeholder,
|
|
1047
|
+
triggerRender,
|
|
1048
|
+
arrowIcon,
|
|
1049
|
+
clearIcon,
|
|
1050
|
+
borderless
|
|
1051
|
+
} = _a,
|
|
1052
|
+
rest = __rest(_a, ["disabled", "multiple", "filter", "style", "id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix", "insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon", "borderless"]);
|
|
1043
1053
|
const {
|
|
1044
1054
|
selections,
|
|
1045
1055
|
isOpen,
|
|
@@ -1139,7 +1149,7 @@ class Select extends BaseComponent {
|
|
|
1139
1149
|
onFocus: e => this.foundation.handleTriggerFocus(e),
|
|
1140
1150
|
onBlur: e => this.foundation.handleTriggerBlur(e),
|
|
1141
1151
|
onKeyPress: this.onKeyPress
|
|
1142
|
-
}, keyboardEventSet), inner)
|
|
1152
|
+
}, keyboardEventSet, this.getDataAttr(rest)), inner)
|
|
1143
1153
|
);
|
|
1144
1154
|
}
|
|
1145
1155
|
render() {
|
|
@@ -13,6 +13,7 @@ import cls from 'classnames';
|
|
|
13
13
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/sideSheet/constants';
|
|
14
14
|
import Button from '../iconButton';
|
|
15
15
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
16
|
+
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
16
17
|
let uuid = 0;
|
|
17
18
|
const prefixCls = cssClasses.PREFIX;
|
|
18
19
|
export default class SideSheetContent extends React.PureComponent {
|
|
@@ -120,11 +121,29 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
120
121
|
return dialogElement;
|
|
121
122
|
}
|
|
122
123
|
render() {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const _a = this.props,
|
|
125
|
+
{
|
|
126
|
+
mask,
|
|
127
|
+
className,
|
|
128
|
+
width,
|
|
129
|
+
onClose,
|
|
130
|
+
maskStyle,
|
|
131
|
+
maskClosable,
|
|
132
|
+
maskClassName,
|
|
133
|
+
title,
|
|
134
|
+
closable,
|
|
135
|
+
headerStyle,
|
|
136
|
+
height,
|
|
137
|
+
style,
|
|
138
|
+
size,
|
|
139
|
+
bodyStyle,
|
|
140
|
+
dialogClassName,
|
|
141
|
+
children,
|
|
142
|
+
footer,
|
|
143
|
+
maskExtraProps,
|
|
144
|
+
wrapperExtraProps
|
|
145
|
+
} = _a,
|
|
146
|
+
rest = __rest(_a, ["mask", "className", "width", "onClose", "maskStyle", "maskClosable", "maskClassName", "title", "closable", "headerStyle", "height", "style", "size", "bodyStyle", "dialogClassName", "children", "footer", "maskExtraProps", "wrapperExtraProps"]);
|
|
128
147
|
const wrapperCls = cls(className, {
|
|
129
148
|
[`${prefixCls}-fixed`]: !mask,
|
|
130
149
|
[`${prefixCls}-size-${this.props.size}`]: !mask
|
|
@@ -133,10 +152,11 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
133
152
|
if (!mask && width) {
|
|
134
153
|
wrapperStyle.width = width;
|
|
135
154
|
}
|
|
136
|
-
|
|
155
|
+
const dataAttr = getDataAttr(rest);
|
|
156
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
137
157
|
className: wrapperCls,
|
|
138
158
|
style: wrapperStyle
|
|
139
|
-
}, this.getMaskElement(), this.getDialogElement());
|
|
159
|
+
}, dataAttr), this.getMaskElement(), this.getDialogElement());
|
|
140
160
|
}
|
|
141
161
|
}
|
|
142
162
|
SideSheetContent.propTypes = {
|
package/lib/es/slider/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import _noop from "lodash/noop";
|
|
2
2
|
import _isEqual from "lodash/isEqual";
|
|
3
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
3
11
|
/* eslint-disable max-lines-per-function */
|
|
4
12
|
/* eslint-disable react/no-find-dom-node */
|
|
5
13
|
import React from 'react';
|
|
@@ -538,14 +546,16 @@ export default class Slider extends BaseComponent {
|
|
|
538
546
|
min,
|
|
539
547
|
max
|
|
540
548
|
} = this.state;
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
+
const _a = this.props,
|
|
550
|
+
{
|
|
551
|
+
vertical,
|
|
552
|
+
verticalReverse,
|
|
553
|
+
style,
|
|
554
|
+
railStyle,
|
|
555
|
+
range,
|
|
556
|
+
className
|
|
557
|
+
} = _a,
|
|
558
|
+
rest = __rest(_a, ["vertical", "verticalReverse", "style", "railStyle", "range", "className"]);
|
|
549
559
|
const wrapperClass = cls(`${prefixCls}-wrapper`, {
|
|
550
560
|
[`${prefixCls}-disabled`]: disabled,
|
|
551
561
|
[`${cssClasses.VERTICAL}-wrapper`]: vertical,
|
|
@@ -559,14 +569,14 @@ export default class Slider extends BaseComponent {
|
|
|
559
569
|
[cssClasses.VERTICAL]: vertical
|
|
560
570
|
});
|
|
561
571
|
const ariaLabel = range ? `Range: ${this._getAriaValueText(currentValue[0], 0)} to ${this._getAriaValueText(currentValue[1], 1)}` : undefined;
|
|
562
|
-
const slider = /*#__PURE__*/React.createElement("div", {
|
|
572
|
+
const slider = /*#__PURE__*/React.createElement("div", Object.assign({
|
|
563
573
|
className: wrapperClass,
|
|
564
574
|
style: style,
|
|
565
575
|
ref: this.sliderEl,
|
|
566
576
|
"aria-label": ariaLabel,
|
|
567
577
|
onMouseEnter: () => this.foundation.handleWrapperEnter(),
|
|
568
578
|
onMouseLeave: () => this.foundation.handleWrapperLeave()
|
|
569
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
579
|
+
}, this.getDataAttr(rest)), /*#__PURE__*/React.createElement("div", {
|
|
570
580
|
className: `${prefixCls}-rail`,
|
|
571
581
|
onClick: this.foundation.handleWrapClick,
|
|
572
582
|
style: railStyle
|
package/lib/es/spin/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React from 'react';
|
|
2
10
|
import PropTypes from 'prop-types';
|
|
3
11
|
import cls from 'classnames';
|
|
@@ -63,13 +71,15 @@ class Spin extends BaseComponent {
|
|
|
63
71
|
}
|
|
64
72
|
render() {
|
|
65
73
|
this.foundation.updateLoadingIfNeedDelay();
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
const _a = this.props,
|
|
75
|
+
{
|
|
76
|
+
children,
|
|
77
|
+
style,
|
|
78
|
+
wrapperClassName,
|
|
79
|
+
childStyle,
|
|
80
|
+
size
|
|
81
|
+
} = _a,
|
|
82
|
+
rest = __rest(_a, ["children", "style", "wrapperClassName", "childStyle", "size"]);
|
|
73
83
|
const {
|
|
74
84
|
loading
|
|
75
85
|
} = this.state;
|
|
@@ -78,10 +88,10 @@ class Spin extends BaseComponent {
|
|
|
78
88
|
[`${prefixCls}-block`]: children,
|
|
79
89
|
[`${prefixCls}-hidden`]: !loading
|
|
80
90
|
});
|
|
81
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
82
92
|
className: spinCls,
|
|
83
93
|
style: style
|
|
84
|
-
}, this.renderSpin(), /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
}, this.getDataAttr(rest)), this.renderSpin(), /*#__PURE__*/React.createElement("div", {
|
|
85
95
|
className: `${prefixCls}-children`,
|
|
86
96
|
style: childStyle,
|
|
87
97
|
"x-semi-prop": "children"
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
2
10
|
import PropTypes from 'prop-types';
|
|
3
11
|
import cls from 'classnames';
|
|
4
12
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
13
|
+
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
5
14
|
const Steps = props => {
|
|
6
15
|
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
size,
|
|
17
|
+
current,
|
|
18
|
+
status,
|
|
19
|
+
children,
|
|
20
|
+
prefixCls,
|
|
21
|
+
initial,
|
|
22
|
+
direction,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
hasLine,
|
|
26
|
+
onChange
|
|
27
|
+
} = props,
|
|
28
|
+
rest = __rest(props, ["size", "current", "status", "children", "prefixCls", "initial", "direction", "className", "style", "hasLine", "onChange"]);
|
|
19
29
|
const inner = useMemo(() => {
|
|
20
30
|
const filteredChildren = Children.toArray(children).filter(c => /*#__PURE__*/isValidElement(c));
|
|
21
31
|
const content = Children.map(filteredChildren, (child, index) => {
|
|
@@ -56,11 +66,11 @@ const Steps = props => {
|
|
|
56
66
|
[`${prefixCls}-${size}`]: size !== 'default',
|
|
57
67
|
[`${prefixCls}-hasline`]: hasLine
|
|
58
68
|
});
|
|
59
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
60
70
|
"aria-label": props["aria-label"],
|
|
61
71
|
className: wrapperCls,
|
|
62
72
|
style: style
|
|
63
|
-
}, inner);
|
|
73
|
+
}, getDataAttr(rest)), inner);
|
|
64
74
|
};
|
|
65
75
|
Steps.propTypes = {
|
|
66
76
|
prefixCls: PropTypes.string,
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
2
10
|
import PropTypes from 'prop-types';
|
|
3
11
|
import cls from 'classnames';
|
|
4
12
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
13
|
+
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
5
14
|
import { Row, Col } from '../grid';
|
|
6
15
|
const Steps = props => {
|
|
7
16
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
current,
|
|
18
|
+
status,
|
|
19
|
+
children,
|
|
20
|
+
prefixCls,
|
|
21
|
+
initial,
|
|
22
|
+
direction,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
onChange
|
|
26
|
+
} = props,
|
|
27
|
+
rest = __rest(props, ["current", "status", "children", "prefixCls", "initial", "direction", "className", "style", "onChange"]);
|
|
18
28
|
const inner = useMemo(() => {
|
|
19
29
|
const filteredChildren = Children.toArray(children).filter(c => /*#__PURE__*/isValidElement(c));
|
|
20
30
|
const colStyle = direction === 'vertical' ? null : {
|
|
@@ -56,11 +66,11 @@ const Steps = props => {
|
|
|
56
66
|
[prefixCls]: true,
|
|
57
67
|
[`${prefixCls}-${direction}`]: true
|
|
58
68
|
});
|
|
59
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
60
70
|
className: wrapperCls,
|
|
61
71
|
style: style,
|
|
62
72
|
"aria-label": props["aria-label"]
|
|
63
|
-
}, /*#__PURE__*/React.createElement(Row, {
|
|
73
|
+
}, getDataAttr(rest)), /*#__PURE__*/React.createElement(Row, {
|
|
64
74
|
type: "flex",
|
|
65
75
|
justify: "start"
|
|
66
76
|
}, inner));
|
package/lib/es/steps/navSteps.js
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
1
9
|
import React, { cloneElement, Children, useMemo, isValidElement } from 'react';
|
|
2
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
3
12
|
import cls from 'classnames';
|
|
4
13
|
import { stepsClasses as css } from '@douyinfe/semi-foundation/lib/es/steps/constants';
|
|
5
14
|
const Steps = props => {
|
|
6
15
|
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
size,
|
|
17
|
+
current,
|
|
18
|
+
initial,
|
|
19
|
+
children,
|
|
20
|
+
prefixCls,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
onChange
|
|
24
|
+
} = props,
|
|
25
|
+
rest = __rest(props, ["size", "current", "initial", "children", "prefixCls", "className", "style", "onChange"]);
|
|
16
26
|
const inner = useMemo(() => {
|
|
17
27
|
const filteredChildren = Children.toArray(children).filter(c => /*#__PURE__*/isValidElement(c));
|
|
18
28
|
const total = filteredChildren.length;
|
|
@@ -38,11 +48,11 @@ const Steps = props => {
|
|
|
38
48
|
[`${prefixCls}-nav`]: true,
|
|
39
49
|
[`${prefixCls}-${size}`]: size !== 'default'
|
|
40
50
|
});
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
42
52
|
"aria-label": props["aria-label"],
|
|
43
53
|
className: wrapperCls,
|
|
44
54
|
style: style
|
|
45
|
-
}, inner);
|
|
55
|
+
}, getDataAttr(rest)), inner);
|
|
46
56
|
};
|
|
47
57
|
Steps.propTypes = {
|
|
48
58
|
prefixCls: PropTypes.string,
|