@douyinfe/semi-ui 2.12.1-alpha.2 → 2.13.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/autoComplete/_story/autoComplete.stories.js +0 -1
- package/autoComplete/index.tsx +1 -1
- package/avatar/index.tsx +2 -2
- package/backtop/index.tsx +7 -11
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +5 -5
- package/breadcrumb/index.tsx +3 -5
- package/button/Button.tsx +8 -10
- package/card/index.tsx +41 -43
- package/carousel/CarouselArrow.tsx +0 -2
- package/carousel/index.tsx +0 -1
- package/cascader/index.tsx +123 -101
- package/cascader/item.tsx +1 -1
- package/checkbox/checkbox.tsx +28 -20
- package/checkbox/checkboxInner.tsx +11 -1
- package/collapsible/index.tsx +1 -8
- package/datePicker/dateInput.tsx +0 -1
- package/datePicker/datePicker.tsx +5 -13
- package/dist/css/semi.css +9 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5372 -3695
- 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/divider/index.tsx +4 -8
- package/dropdown/index.tsx +1 -1
- package/empty/index.tsx +5 -13
- package/form/hoc/withField.tsx +1 -1
- package/form/label.tsx +1 -1
- package/grid/col.tsx +1 -1
- package/grid/row.tsx +1 -1
- package/iconButton/index.tsx +1 -2
- package/input/index.tsx +11 -38
- package/inputNumber/__test__/inputNumber.test.js +2 -3
- package/inputNumber/_story/inputNumber.stories.js +53 -0
- package/inputNumber/index.tsx +0 -4
- package/lib/cjs/autoComplete/index.js +1 -1
- package/lib/cjs/avatar/index.js +2 -4
- package/lib/cjs/backtop/index.js +1 -2
- package/lib/cjs/badge/index.js +1 -2
- package/lib/cjs/banner/index.js +4 -9
- package/lib/cjs/breadcrumb/index.js +3 -4
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/Button.js +3 -13
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/card/index.js +5 -10
- package/lib/cjs/carousel/CarouselArrow.js +2 -6
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/carousel/index.js +1 -2
- package/lib/cjs/cascader/index.js +6 -9
- package/lib/cjs/cascader/item.js +1 -2
- package/lib/cjs/checkbox/checkbox.d.ts +3 -2
- package/lib/cjs/checkbox/checkbox.js +33 -15
- package/lib/cjs/checkbox/checkboxInner.d.ts +6 -0
- package/lib/cjs/checkbox/checkboxInner.js +14 -4
- package/lib/cjs/collapsible/index.js +1 -2
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.js +1 -2
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +2 -4
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/divider/index.js +1 -2
- package/lib/cjs/dropdown/index.js +1 -2
- package/lib/cjs/empty/index.js +4 -8
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/hoc/withField.js +1 -2
- package/lib/cjs/form/label.js +1 -2
- package/lib/cjs/grid/col.js +1 -2
- package/lib/cjs/grid/row.js +1 -2
- package/lib/cjs/iconButton/index.js +1 -3
- package/lib/cjs/input/index.js +5 -9
- package/lib/cjs/inputNumber/index.js +0 -4
- package/lib/cjs/list/index.js +3 -6
- package/lib/cjs/modal/ConfirmModal.js +1 -2
- package/lib/cjs/modal/Modal.js +2 -6
- package/lib/cjs/modal/ModalContent.js +6 -13
- package/lib/cjs/notification/notice.js +3 -6
- package/lib/cjs/pagination/index.js +2 -4
- package/lib/cjs/popconfirm/index.js +3 -6
- package/lib/cjs/popover/index.d.ts +1 -0
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radio.js +2 -4
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/item.js +1 -2
- package/lib/cjs/scrollList/index.js +3 -6
- package/lib/cjs/select/index.js +4 -8
- package/lib/cjs/select/option.js +1 -2
- package/lib/cjs/sideSheet/SideSheetContent.js +3 -6
- package/lib/cjs/skeleton/index.js +1 -3
- package/lib/cjs/space/index.js +1 -2
- package/lib/cjs/spin/index.js +3 -7
- package/lib/cjs/switch/index.js +4 -6
- package/lib/cjs/table/Table.js +3 -6
- package/lib/cjs/tabs/TabBar.js +1 -2
- package/lib/cjs/tabs/TabPane.js +2 -5
- package/lib/cjs/tagInput/index.d.ts +6 -1
- package/lib/cjs/tagInput/index.js +42 -10
- package/lib/cjs/timePicker/Combobox.js +1 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/toast/toast.js +3 -6
- package/lib/cjs/transfer/index.js +1 -2
- package/lib/cjs/tree/treeNode.js +1 -2
- package/lib/cjs/treeSelect/index.js +3 -6
- package/lib/cjs/typography/base.d.ts +1 -1
- package/lib/cjs/typography/base.js +1 -2
- package/lib/cjs/typography/paragraph.d.ts +1 -1
- package/lib/cjs/typography/text.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +2 -2
- package/lib/cjs/upload/index.d.ts +2 -2
- package/lib/cjs/upload/index.js +6 -13
- package/lib/es/autoComplete/index.js +1 -1
- package/lib/es/avatar/index.js +2 -4
- package/lib/es/backtop/index.js +1 -2
- package/lib/es/badge/index.js +1 -2
- package/lib/es/banner/index.js +4 -9
- package/lib/es/breadcrumb/index.js +3 -4
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/Button.js +3 -11
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/card/index.js +5 -10
- package/lib/es/carousel/CarouselArrow.js +2 -6
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/carousel/index.js +1 -2
- package/lib/es/cascader/index.js +6 -9
- package/lib/es/cascader/item.js +1 -2
- package/lib/es/checkbox/checkbox.d.ts +3 -2
- package/lib/es/checkbox/checkbox.js +33 -15
- package/lib/es/checkbox/checkboxInner.d.ts +6 -0
- package/lib/es/checkbox/checkboxInner.js +14 -4
- package/lib/es/collapsible/index.js +1 -2
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +1 -2
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +2 -4
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/divider/index.js +1 -2
- package/lib/es/dropdown/index.js +1 -2
- package/lib/es/empty/index.js +4 -8
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +1 -2
- package/lib/es/form/label.js +1 -2
- package/lib/es/grid/col.js +1 -2
- package/lib/es/grid/row.js +1 -2
- package/lib/es/iconButton/index.js +1 -3
- package/lib/es/input/index.js +5 -9
- package/lib/es/inputNumber/index.js +0 -4
- package/lib/es/list/index.js +3 -6
- package/lib/es/modal/ConfirmModal.js +1 -2
- package/lib/es/modal/Modal.js +2 -6
- package/lib/es/modal/ModalContent.js +6 -13
- package/lib/es/notification/notice.js +3 -6
- package/lib/es/pagination/index.js +2 -4
- package/lib/es/popconfirm/index.js +3 -6
- package/lib/es/popover/index.d.ts +1 -0
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radio.js +2 -4
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/item.js +1 -2
- package/lib/es/scrollList/index.js +3 -6
- package/lib/es/select/index.js +4 -8
- package/lib/es/select/option.js +1 -2
- package/lib/es/sideSheet/SideSheetContent.js +3 -6
- package/lib/es/skeleton/index.js +1 -3
- package/lib/es/space/index.js +1 -2
- package/lib/es/spin/index.js +3 -7
- package/lib/es/switch/index.js +4 -6
- package/lib/es/table/Table.js +3 -6
- package/lib/es/tabs/TabBar.js +1 -2
- package/lib/es/tabs/TabPane.js +2 -5
- package/lib/es/tagInput/index.d.ts +6 -1
- package/lib/es/tagInput/index.js +41 -10
- package/lib/es/timePicker/Combobox.js +1 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/toast/toast.js +3 -6
- package/lib/es/transfer/index.js +1 -2
- package/lib/es/tree/treeNode.js +1 -2
- package/lib/es/treeSelect/index.js +3 -6
- package/lib/es/typography/base.d.ts +1 -1
- package/lib/es/typography/base.js +1 -2
- package/lib/es/typography/paragraph.d.ts +1 -1
- package/lib/es/typography/text.d.ts +1 -1
- package/lib/es/typography/title.d.ts +2 -2
- package/lib/es/upload/index.d.ts +2 -2
- package/lib/es/upload/index.js +6 -13
- package/list/index.tsx +4 -16
- package/modal/ConfirmModal.tsx +1 -1
- package/modal/Modal.tsx +0 -2
- package/modal/ModalContent.tsx +14 -27
- package/notification/notice.tsx +4 -16
- package/package.json +9 -9
- package/pagination/index.tsx +2 -16
- package/popconfirm/index.tsx +3 -11
- package/popover/index.tsx +1 -1
- package/radio/radio.tsx +2 -10
- package/rating/item.tsx +1 -1
- package/scrollList/index.tsx +3 -19
- package/select/_story/select.stories.js +11 -0
- package/select/index.tsx +4 -12
- package/select/option.tsx +1 -5
- package/sideSheet/SideSheetContent.tsx +3 -3
- package/skeleton/index.tsx +1 -1
- package/space/index.tsx +1 -1
- package/spin/index.tsx +9 -15
- package/switch/index.tsx +14 -9
- package/table/Table.tsx +3 -5
- package/tabs/TabBar.tsx +1 -1
- package/tabs/TabPane.tsx +4 -9
- package/tagInput/index.tsx +38 -11
- package/timePicker/Combobox.tsx +1 -6
- package/toast/toast.tsx +3 -3
- package/transfer/index.tsx +0 -1
- package/tree/treeNode.tsx +1 -1
- package/treeSelect/index.tsx +3 -15
- package/typography/base.tsx +1 -1
- package/upload/index.tsx +38 -107
- package/yarn-error.log +0 -26235
package/lib/es/spin/index.js
CHANGED
|
@@ -67,11 +67,8 @@ class Spin extends BaseComponent {
|
|
|
67
67
|
return loading ? /*#__PURE__*/React.createElement("div", {
|
|
68
68
|
className: "".concat(prefixCls, "-wrapper")
|
|
69
69
|
}, indicator ? /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: spinIconCls
|
|
71
|
-
|
|
72
|
-
}, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
"x-semi-prop": "tip"
|
|
74
|
-
}, tip) : null) : null;
|
|
70
|
+
className: spinIconCls
|
|
71
|
+
}, indicator) : /*#__PURE__*/React.createElement(SpinIcon, null), tip ? /*#__PURE__*/React.createElement("div", null, tip) : null) : null;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
render() {
|
|
@@ -98,8 +95,7 @@ class Spin extends BaseComponent {
|
|
|
98
95
|
style: style
|
|
99
96
|
}, this.renderSpin(), /*#__PURE__*/React.createElement("div", {
|
|
100
97
|
className: "".concat(prefixCls, "-children"),
|
|
101
|
-
style: childStyle
|
|
102
|
-
"x-semi-prop": "children"
|
|
98
|
+
style: childStyle
|
|
103
99
|
}, children));
|
|
104
100
|
}
|
|
105
101
|
|
package/lib/es/switch/index.js
CHANGED
|
@@ -119,21 +119,19 @@ class Switch extends BaseComponent {
|
|
|
119
119
|
className: cssClasses.KNOB,
|
|
120
120
|
"aria-hidden": true
|
|
121
121
|
}), showCheckedText ? /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
className: cssClasses.CHECKED_TEXT
|
|
123
|
-
"x-semi-prop": "checkedText"
|
|
122
|
+
className: cssClasses.CHECKED_TEXT
|
|
124
123
|
}, checkedText) : null, showUncheckedText ? /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
className: cssClasses.UNCHECKED_TEXT
|
|
126
|
-
"x-semi-prop": "uncheckedText"
|
|
124
|
+
className: cssClasses.UNCHECKED_TEXT
|
|
127
125
|
}, uncheckedText) : null, /*#__PURE__*/React.createElement("input", _Object$assign({}, switchProps, {
|
|
128
126
|
ref: this.switchRef,
|
|
129
127
|
id: id,
|
|
130
|
-
role:
|
|
128
|
+
role: 'switch',
|
|
131
129
|
"aria-checked": nativeControlChecked,
|
|
132
130
|
"aria-invalid": this.props['aria-invalid'],
|
|
133
131
|
"aria-errormessage": this.props['aria-errormessage'],
|
|
134
132
|
"aria-label": this.props['aria-label'],
|
|
135
133
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
136
|
-
"aria-describedby": this.props[
|
|
134
|
+
"aria-describedby": this.props["aria-describedby"],
|
|
137
135
|
"aria-disabled": this.props['disabled'],
|
|
138
136
|
onChange: e => this.foundation.handleChange(e.target.checked, e),
|
|
139
137
|
onFocus: e => this.handleFocusVisible(e),
|
package/lib/es/table/Table.js
CHANGED
|
@@ -582,8 +582,7 @@ class Table extends BaseComponent {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
return /*#__PURE__*/isValidElement(title) || typeof title === 'string' ? /*#__PURE__*/React.createElement("div", {
|
|
585
|
-
className: "".concat(prefixCls, "-title")
|
|
586
|
-
"x-semi-prop": "title"
|
|
585
|
+
className: "".concat(prefixCls, "-title")
|
|
587
586
|
}, title) : null;
|
|
588
587
|
};
|
|
589
588
|
|
|
@@ -608,8 +607,7 @@ class Table extends BaseComponent {
|
|
|
608
607
|
}, (locale, localeCode) => /*#__PURE__*/React.createElement("div", {
|
|
609
608
|
className: wrapCls
|
|
610
609
|
}, /*#__PURE__*/React.createElement("div", {
|
|
611
|
-
className: "".concat(prefixCls, "-empty")
|
|
612
|
-
"x-semi-prop": "empty"
|
|
610
|
+
className: "".concat(prefixCls, "-empty")
|
|
613
611
|
}, empty || locale.emptyText)));
|
|
614
612
|
};
|
|
615
613
|
|
|
@@ -629,8 +627,7 @@ class Table extends BaseComponent {
|
|
|
629
627
|
|
|
630
628
|
return /*#__PURE__*/isValidElement(footer) || typeof footer === 'string' ? /*#__PURE__*/React.createElement("div", {
|
|
631
629
|
className: "".concat(prefixCls, "-footer"),
|
|
632
|
-
key: "footer"
|
|
633
|
-
"x-semi-prop": "footer"
|
|
630
|
+
key: "footer"
|
|
634
631
|
}, footer) : null;
|
|
635
632
|
};
|
|
636
633
|
|
package/lib/es/tabs/TabBar.js
CHANGED
package/lib/es/tabs/TabPane.js
CHANGED
|
@@ -116,17 +116,14 @@ class TabPane extends PureComponent {
|
|
|
116
116
|
style: style,
|
|
117
117
|
"aria-hidden": active ? 'false' : 'true',
|
|
118
118
|
tabIndex: 0
|
|
119
|
-
}, getDataAttr(restProps), {
|
|
120
|
-
"x-semi-prop": "children"
|
|
121
|
-
}), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
|
|
119
|
+
}, getDataAttr(restProps)), motion ? /*#__PURE__*/React.createElement(TabPaneTransition, {
|
|
122
120
|
direction: this.getDirection(this.context.activeKey, itemKey, this.context.panes),
|
|
123
121
|
motion: motion,
|
|
124
122
|
mode: tabPosition === 'top' ? 'horizontal' : 'vertical',
|
|
125
123
|
state: active ? 'enter' : 'leave'
|
|
126
124
|
}, transitionStyle => /*#__PURE__*/React.createElement("div", {
|
|
127
125
|
className: "".concat(cssClasses.TABS_PANE_MOTION_OVERLAY),
|
|
128
|
-
style: _Object$assign({}, transitionStyle)
|
|
129
|
-
"x-semi-prop": "children"
|
|
126
|
+
style: _Object$assign({}, transitionStyle)
|
|
130
127
|
}, shouldRender ? children : null)) : shouldRender ? children : null);
|
|
131
128
|
}
|
|
132
129
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { strings } from '@douyinfe/semi-foundation/lib/es/tagInput/constants';
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/tagInput/tagInput.css';
|
|
5
|
-
import { TagInputAdapter } from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
|
|
5
|
+
import TagInputFoundation, { TagInputAdapter } from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
|
|
6
6
|
import { ArrayElement } from '../_base/base';
|
|
7
7
|
import BaseComponent from '../_base/baseComponent';
|
|
8
8
|
import { PopoverProps } from '../popover';
|
|
@@ -32,6 +32,8 @@ export interface TagInputProps {
|
|
|
32
32
|
onKeyDown?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
33
33
|
onRemove?: (removedValue: string, idx: number) => void;
|
|
34
34
|
placeholder?: string;
|
|
35
|
+
insetLabel?: React.ReactNode;
|
|
36
|
+
insetLabelId?: string;
|
|
35
37
|
prefix?: React.ReactNode;
|
|
36
38
|
renderTagItem?: (value: string, index: number) => React.ReactNode;
|
|
37
39
|
separator?: string | string[] | null;
|
|
@@ -108,6 +110,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
108
110
|
onKeyDown: (...args: any[]) => void;
|
|
109
111
|
};
|
|
110
112
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
113
|
+
foundation: TagInputFoundation;
|
|
111
114
|
constructor(props: TagInputProps);
|
|
112
115
|
static getDerivedStateFromProps(nextProps: TagInputProps, prevState: TagInputState): {
|
|
113
116
|
tagsArray: string[];
|
|
@@ -124,6 +127,8 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
124
127
|
handleTagClose: (idx: number) => void;
|
|
125
128
|
handleInputMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
126
129
|
handleInputMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
130
|
+
handleClickPrefixOrSuffix: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
131
|
+
handlePreventMouseDown: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
127
132
|
renderClearBtn(): JSX.Element;
|
|
128
133
|
renderPrefix(): JSX.Element;
|
|
129
134
|
renderSuffix(): JSX.Element;
|
package/lib/es/tagInput/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import PropTypes from 'prop-types';
|
|
|
13
13
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tagInput/constants';
|
|
14
14
|
import '@douyinfe/semi-foundation/lib/es/tagInput/tagInput.css';
|
|
15
15
|
import TagInputFoundation from '@douyinfe/semi-foundation/lib/es/tagInput/foundation';
|
|
16
|
+
import { isSemiIcon } from '../_utils';
|
|
16
17
|
import BaseComponent from '../_base/baseComponent';
|
|
17
18
|
import Tag from '../tag';
|
|
18
19
|
import Input from '../input';
|
|
@@ -61,6 +62,14 @@ class TagInput extends BaseComponent {
|
|
|
61
62
|
this.foundation.handleInputMouseEnter();
|
|
62
63
|
};
|
|
63
64
|
|
|
65
|
+
this.handleClickPrefixOrSuffix = e => {
|
|
66
|
+
this.foundation.handleClickPrefixOrSuffix(e);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
this.handlePreventMouseDown = e => {
|
|
70
|
+
this.foundation.handlePreventMouseDown(e);
|
|
71
|
+
};
|
|
72
|
+
|
|
64
73
|
this.foundation = new TagInputFoundation(this.adapter);
|
|
65
74
|
this.state = {
|
|
66
75
|
tagsArray: props.defaultValue || [],
|
|
@@ -112,6 +121,19 @@ class TagInput extends BaseComponent {
|
|
|
112
121
|
focusing
|
|
113
122
|
});
|
|
114
123
|
},
|
|
124
|
+
toggleFocusing: isFocus => {
|
|
125
|
+
const input = this.inputRef && this.inputRef.current;
|
|
126
|
+
|
|
127
|
+
if (isFocus) {
|
|
128
|
+
input && input.focus();
|
|
129
|
+
} else {
|
|
130
|
+
input && input.blur();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this.setState({
|
|
134
|
+
focusing: isFocus
|
|
135
|
+
});
|
|
136
|
+
},
|
|
115
137
|
setHovering: hovering => {
|
|
116
138
|
this.setState({
|
|
117
139
|
hovering
|
|
@@ -182,22 +204,29 @@ class TagInput extends BaseComponent {
|
|
|
182
204
|
|
|
183
205
|
renderPrefix() {
|
|
184
206
|
const {
|
|
185
|
-
prefix
|
|
207
|
+
prefix,
|
|
208
|
+
insetLabel,
|
|
209
|
+
insetLabelId
|
|
186
210
|
} = this.props;
|
|
211
|
+
const labelNode = prefix || insetLabel;
|
|
187
212
|
|
|
188
|
-
if (_isNull(
|
|
213
|
+
if (_isNull(labelNode) || _isUndefined(labelNode)) {
|
|
189
214
|
return null;
|
|
190
215
|
}
|
|
191
216
|
|
|
192
217
|
const prefixWrapperCls = cls("".concat(prefixCls, "-prefix"), {
|
|
193
|
-
["".concat(prefixCls, "-
|
|
218
|
+
["".concat(prefixCls, "-inset-label")]: insetLabel,
|
|
219
|
+
["".concat(prefixCls, "-prefix-text")]: labelNode && _isString(labelNode),
|
|
194
220
|
// eslint-disable-next-line max-len
|
|
195
|
-
["".concat(prefixCls, "-prefix-icon")]:
|
|
196
|
-
});
|
|
221
|
+
["".concat(prefixCls, "-prefix-icon")]: isSemiIcon(labelNode)
|
|
222
|
+
}); // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events
|
|
223
|
+
|
|
197
224
|
return /*#__PURE__*/React.createElement("div", {
|
|
198
225
|
className: prefixWrapperCls,
|
|
199
|
-
|
|
200
|
-
|
|
226
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
227
|
+
onClick: this.handleClickPrefixOrSuffix,
|
|
228
|
+
id: insetLabelId
|
|
229
|
+
}, labelNode);
|
|
201
230
|
}
|
|
202
231
|
|
|
203
232
|
renderSuffix() {
|
|
@@ -212,11 +241,13 @@ class TagInput extends BaseComponent {
|
|
|
212
241
|
const suffixWrapperCls = cls("".concat(prefixCls, "-suffix"), {
|
|
213
242
|
["".concat(prefixCls, "-suffix-text")]: suffix && _isString(suffix),
|
|
214
243
|
// eslint-disable-next-line max-len
|
|
215
|
-
["".concat(prefixCls, "-suffix-icon")]:
|
|
216
|
-
});
|
|
244
|
+
["".concat(prefixCls, "-suffix-icon")]: isSemiIcon(suffix)
|
|
245
|
+
}); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
246
|
+
|
|
217
247
|
return /*#__PURE__*/React.createElement("div", {
|
|
218
248
|
className: suffixWrapperCls,
|
|
219
|
-
|
|
249
|
+
onMouseDown: this.handlePreventMouseDown,
|
|
250
|
+
onClick: this.handleClickPrefixOrSuffix
|
|
220
251
|
}, suffix);
|
|
221
252
|
}
|
|
222
253
|
|
|
@@ -278,9 +278,7 @@ class Combobox extends BaseComponent {
|
|
|
278
278
|
componentName: "TimePicker"
|
|
279
279
|
}, (locale, localeCode) => /*#__PURE__*/React.createElement(ScrollList, {
|
|
280
280
|
header: panelHeader,
|
|
281
|
-
footer: panelFooter
|
|
282
|
-
"x-semi-header-alias": "panelHeader",
|
|
283
|
-
"x-semi-footer-alias": "panelFooter"
|
|
281
|
+
footer: panelFooter
|
|
284
282
|
}, this.renderAMPMSelect(locale, localeCode), this.renderHourSelect(value.getHours(), locale), this.renderMinuteSelect(value.getMinutes(), locale), this.renderSecondSelect(value.getSeconds(), locale)));
|
|
285
283
|
}
|
|
286
284
|
|
|
@@ -97,11 +97,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
97
97
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
98
98
|
prefixCls: PropTypes.Requireable<string>;
|
|
99
99
|
clearText: PropTypes.Requireable<string>;
|
|
100
|
-
value: PropTypes.Requireable<string | number | string[] |
|
|
100
|
+
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
101
101
|
inputReadOnly: PropTypes.Requireable<boolean>;
|
|
102
102
|
disabled: PropTypes.Requireable<boolean>;
|
|
103
103
|
showClear: PropTypes.Requireable<boolean>;
|
|
104
|
-
defaultValue: PropTypes.Requireable<string | number | string[] |
|
|
104
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
105
105
|
open: PropTypes.Requireable<boolean>;
|
|
106
106
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
107
107
|
onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
* - \[12:00:12, 12:21:12]
|
|
7
7
|
* - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
|
|
8
8
|
*/
|
|
9
|
-
declare const TimeShape: PropTypes.Requireable<string | number | string[] |
|
|
9
|
+
declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
10
10
|
export { TimeShape };
|
|
@@ -18,11 +18,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
18
18
|
'aria-required': import("prop-types").Requireable<boolean>;
|
|
19
19
|
prefixCls: import("prop-types").Requireable<string>;
|
|
20
20
|
clearText: import("prop-types").Requireable<string>;
|
|
21
|
-
value: import("prop-types").Requireable<string | number | string[] |
|
|
21
|
+
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
22
22
|
inputReadOnly: import("prop-types").Requireable<boolean>;
|
|
23
23
|
disabled: import("prop-types").Requireable<boolean>;
|
|
24
24
|
showClear: import("prop-types").Requireable<boolean>;
|
|
25
|
-
defaultValue: import("prop-types").Requireable<string | number | string[] |
|
|
25
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
26
26
|
open: import("prop-types").Requireable<boolean>;
|
|
27
27
|
defaultOpen: import("prop-types").Requireable<boolean>;
|
|
28
28
|
onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
package/lib/es/toast/toast.js
CHANGED
|
@@ -111,7 +111,7 @@ class Toast extends BaseComponent {
|
|
|
111
111
|
const btnTheme = 'borderless';
|
|
112
112
|
const btnSize = 'small';
|
|
113
113
|
return /*#__PURE__*/React.createElement("div", {
|
|
114
|
-
role:
|
|
114
|
+
role: 'alert',
|
|
115
115
|
"aria-label": "".concat(type ? type : 'default', " type"),
|
|
116
116
|
className: toastCls,
|
|
117
117
|
style: style,
|
|
@@ -121,16 +121,13 @@ class Toast extends BaseComponent {
|
|
|
121
121
|
className: "".concat(prefixCls, "-content")
|
|
122
122
|
}, this.renderIcon(), /*#__PURE__*/React.createElement("span", {
|
|
123
123
|
className: "".concat(prefixCls, "-content-text"),
|
|
124
|
-
style: textStyle
|
|
125
|
-
"x-semi-prop": "content"
|
|
124
|
+
style: textStyle
|
|
126
125
|
}, content), showClose && /*#__PURE__*/React.createElement("div", {
|
|
127
126
|
className: "".concat(prefixCls, "-close-button")
|
|
128
127
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
129
128
|
onClick: e => this.close(e),
|
|
130
129
|
type: "tertiary",
|
|
131
|
-
icon: /*#__PURE__*/React.createElement(IconClose,
|
|
132
|
-
"x-semi-prop": "icon"
|
|
133
|
-
}),
|
|
130
|
+
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
134
131
|
theme: btnTheme,
|
|
135
132
|
size: btnSize
|
|
136
133
|
}))));
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -237,8 +237,7 @@ class Transfer extends BaseComponent {
|
|
|
237
237
|
className: leftItemCls,
|
|
238
238
|
checked: checked,
|
|
239
239
|
role: "listitem",
|
|
240
|
-
onChange: () => this.onSelectOrRemove(item)
|
|
241
|
-
"x-semi-children-alias": "dataSource[".concat(index, "].label")
|
|
240
|
+
onChange: () => this.onSelectOrRemove(item)
|
|
242
241
|
}, item.label);
|
|
243
242
|
}
|
|
244
243
|
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -373,8 +373,7 @@ export default class TreeNode extends PureComponent {
|
|
|
373
373
|
return /*#__PURE__*/React.createElement("ul", {
|
|
374
374
|
className: wrapperCls
|
|
375
375
|
}, /*#__PURE__*/React.createElement("li", {
|
|
376
|
-
className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty")
|
|
377
|
-
"x-semi-prop": "emptyContent"
|
|
376
|
+
className: _concatInstanceProperty(_context2 = "".concat(prefixcls, "-label ")).call(_context2, prefixcls, "-label-empty")
|
|
378
377
|
}, emptyContent));
|
|
379
378
|
} // eslint-disable-next-line max-lines-per-function
|
|
380
379
|
|
|
@@ -59,8 +59,7 @@ class TreeSelect extends BaseComponent {
|
|
|
59
59
|
["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
|
|
60
60
|
});
|
|
61
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: suffixWrapperCls
|
|
63
|
-
"x-semi-prop": "suffix"
|
|
62
|
+
className: suffixWrapperCls
|
|
64
63
|
}, suffix);
|
|
65
64
|
};
|
|
66
65
|
|
|
@@ -80,8 +79,7 @@ class TreeSelect extends BaseComponent {
|
|
|
80
79
|
});
|
|
81
80
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
81
|
className: prefixWrapperCls,
|
|
83
|
-
id: insetLabelId
|
|
84
|
-
"x-semi-prop": "prefix,insetLabel"
|
|
82
|
+
id: insetLabelId
|
|
85
83
|
}, labelNode);
|
|
86
84
|
};
|
|
87
85
|
|
|
@@ -338,8 +336,7 @@ class TreeSelect extends BaseComponent {
|
|
|
338
336
|
}
|
|
339
337
|
|
|
340
338
|
return arrowIcon ? /*#__PURE__*/React.createElement("div", {
|
|
341
|
-
className: cls("".concat(prefixcls, "-arrow"))
|
|
342
|
-
"x-semi-prop": "arrowIcon"
|
|
339
|
+
className: cls("".concat(prefixcls, "-arrow"))
|
|
343
340
|
}, arrowIcon) : null;
|
|
344
341
|
};
|
|
345
342
|
|
|
@@ -64,7 +64,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
66
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
67
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
70
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -536,8 +536,7 @@ export default class Base extends Component {
|
|
|
536
536
|
|
|
537
537
|
const iconSize = size === 'small' ? 'small' : 'default';
|
|
538
538
|
return /*#__PURE__*/React.createElement("span", {
|
|
539
|
-
className: "".concat(prefixCls, "-icon")
|
|
540
|
-
"x-semi-prop": "icon"
|
|
539
|
+
className: "".concat(prefixCls, "-icon")
|
|
541
540
|
}, isSemiIcon(icon) ? /*#__PURE__*/React.cloneElement(icon, {
|
|
542
541
|
size: iconSize
|
|
543
542
|
}) : icon);
|
|
@@ -29,7 +29,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
|
29
29
|
link: PropTypes.Requireable<boolean | object>;
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
32
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
33
33
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
34
34
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
35
35
|
style: PropTypes.Requireable<object>;
|
|
@@ -32,7 +32,7 @@ export default class Text extends PureComponent<TextProps> {
|
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
33
|
link: PropTypes.Requireable<boolean | object>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
35
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
37
37
|
style: PropTypes.Requireable<object>;
|
|
38
38
|
className: PropTypes.Requireable<string>;
|
|
@@ -36,8 +36,8 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
36
36
|
link: PropTypes.Requireable<boolean | object>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
|
-
type: PropTypes.Requireable<"warning" | "success" | "primary" | "
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
39
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
|
6
6
|
import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
|
|
7
7
|
import { Locale } from '../locale/interface';
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
|
|
9
|
-
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult
|
|
9
|
+
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
|
|
10
10
|
export interface UploadProps {
|
|
11
11
|
accept?: string;
|
|
12
12
|
action: string;
|
|
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
140
140
|
style: PropTypes.Requireable<object>;
|
|
141
141
|
timeout: PropTypes.Requireable<number>;
|
|
142
142
|
transformFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
143
|
-
uploadTrigger: PropTypes.Requireable<"
|
|
143
|
+
uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/lib/es/upload/index.js
CHANGED
|
@@ -230,9 +230,7 @@ class Upload extends BaseComponent {
|
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps,
|
|
234
|
-
"x-semi-prop": "children"
|
|
235
|
-
}), children);
|
|
233
|
+
const addContent = /*#__PURE__*/React.createElement("div", _Object$assign({}, addContentProps), children);
|
|
236
234
|
|
|
237
235
|
if (!showUploadList || !fileList.length) {
|
|
238
236
|
if (showAddTriggerInList) {
|
|
@@ -365,18 +363,15 @@ class Upload extends BaseComponent {
|
|
|
365
363
|
onDragEnter: this.onDragEnter,
|
|
366
364
|
onClick: this.onClick
|
|
367
365
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
368
|
-
className: "".concat(dragAreaBaseCls, "-icon")
|
|
369
|
-
"x-semi-prop": "dragIcon"
|
|
366
|
+
className: "".concat(dragAreaBaseCls, "-icon")
|
|
370
367
|
}, dragIcon || /*#__PURE__*/React.createElement(IconUpload, {
|
|
371
368
|
size: "extra-large"
|
|
372
369
|
})), /*#__PURE__*/React.createElement("div", {
|
|
373
370
|
className: "".concat(dragAreaBaseCls, "-text")
|
|
374
371
|
}, /*#__PURE__*/React.createElement("div", {
|
|
375
|
-
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
376
|
-
"x-semi-prop": "dragMainText"
|
|
372
|
+
className: "".concat(dragAreaBaseCls, "-main-text")
|
|
377
373
|
}, dragMainText || locale.mainText), /*#__PURE__*/React.createElement("div", {
|
|
378
|
-
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
379
|
-
"x-semi-prop": "dragSubText"
|
|
374
|
+
className: "".concat(dragAreaBaseCls, "-sub-text")
|
|
380
375
|
}, dragSubText), /*#__PURE__*/React.createElement("div", {
|
|
381
376
|
className: "".concat(dragAreaBaseCls, "-tips")
|
|
382
377
|
}, dragAreaStatus === strings.DRAG_AREA_LEGAL && /*#__PURE__*/React.createElement("span", {
|
|
@@ -562,11 +557,9 @@ class Upload extends BaseComponent {
|
|
|
562
557
|
className: inputReplaceCls,
|
|
563
558
|
ref: this.replaceInputRef
|
|
564
559
|
}), this.renderAddContent(), prompt ? /*#__PURE__*/React.createElement("div", {
|
|
565
|
-
className: promptCls
|
|
566
|
-
"x-semi-prop": "prompt"
|
|
560
|
+
className: promptCls
|
|
567
561
|
}, prompt) : null, validateMessage ? /*#__PURE__*/React.createElement("div", {
|
|
568
|
-
className: validateMsgCls
|
|
569
|
-
"x-semi-prop": "validateMessage"
|
|
562
|
+
className: validateMsgCls
|
|
570
563
|
}, validateMessage) : null, this.renderFileList());
|
|
571
564
|
}
|
|
572
565
|
|
package/list/index.tsx
CHANGED
|
@@ -71,11 +71,7 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
71
71
|
renderEmpty = () => {
|
|
72
72
|
const { emptyContent } = this.props;
|
|
73
73
|
if (emptyContent) {
|
|
74
|
-
return (
|
|
75
|
-
<div className={`${cssClasses.PREFIX}-empty`} x-semi-prop="emptyContent">
|
|
76
|
-
{emptyContent}
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
74
|
+
return (<div className={`${cssClasses.PREFIX}-empty`}>{emptyContent}</div>);
|
|
79
75
|
} else {
|
|
80
76
|
return (
|
|
81
77
|
<LocaleConsumer componentName="List">
|
|
@@ -156,27 +152,19 @@ class List<T = any> extends BaseComponent<ListProps<T>> {
|
|
|
156
152
|
}
|
|
157
153
|
return (
|
|
158
154
|
<div className={wrapperCls} style={style}>
|
|
159
|
-
{header ?
|
|
160
|
-
<div className={`${cssClasses.PREFIX}-header`} x-semi-prop="header">
|
|
161
|
-
{header}
|
|
162
|
-
</div>
|
|
163
|
-
) : null}
|
|
155
|
+
{header ? <div className={`${cssClasses.PREFIX}-header`}>{header}</div> : null}
|
|
164
156
|
<ListContext.Provider
|
|
165
157
|
value={{
|
|
166
158
|
grid,
|
|
167
159
|
onRightClick,
|
|
168
|
-
onClick
|
|
160
|
+
onClick
|
|
169
161
|
}}
|
|
170
162
|
>
|
|
171
163
|
<Spin spinning={loading} size="large">
|
|
172
164
|
{this.wrapChildren(childrenList, children)}
|
|
173
165
|
</Spin>
|
|
174
166
|
</ListContext.Provider>
|
|
175
|
-
{footer ?
|
|
176
|
-
<div className={`${cssClasses.PREFIX}-footer`} x-semi-prop="footer">
|
|
177
|
-
{footer}
|
|
178
|
-
</div>
|
|
179
|
-
) : null}
|
|
167
|
+
{footer ? <div className={`${cssClasses.PREFIX}-footer`}>{footer}</div> : null}
|
|
180
168
|
{loadMore ? loadMore : null}
|
|
181
169
|
</div>
|
|
182
170
|
);
|
package/modal/ConfirmModal.tsx
CHANGED
package/modal/Modal.tsx
CHANGED
|
@@ -292,7 +292,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
292
292
|
type="tertiary"
|
|
293
293
|
autoFocus={true}
|
|
294
294
|
{...this.props.cancelButtonProps}
|
|
295
|
-
x-semi-children-alias="cancelText"
|
|
296
295
|
>
|
|
297
296
|
{cancelText || locale.cancel}
|
|
298
297
|
</Button>
|
|
@@ -312,7 +311,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
312
311
|
loading={confirmLoading}
|
|
313
312
|
onClick={this.handleOk}
|
|
314
313
|
{...this.props.okButtonProps}
|
|
315
|
-
x-semi-children-alias="okText"
|
|
316
314
|
>
|
|
317
315
|
{okText || locale.confirm}
|
|
318
316
|
</Button>
|