@douyinfe/semi-ui 2.9.0-beta.1 → 2.10.0-alpha.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/anchor/__test__/anchor.test.js +1 -0
- package/anchor/_story/anchor.stories.js +23 -1
- package/cascader/_story/cascader.stories.js +17 -2
- package/cascader/index.tsx +1 -1
- package/checkbox/_story/checkbox.stories.js +1 -1
- package/checkbox/checkbox.tsx +18 -8
- package/collapse/item.tsx +2 -0
- package/datePicker/_story/datePicker.stories.js +37 -0
- package/dist/css/semi.css +1 -2
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +23386 -23414
- 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/input/__test__/input.test.js +12 -3
- package/input/__test__/textArea.test.js +53 -0
- package/lib/cjs/_portal/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +1 -1
- package/lib/cjs/checkbox/checkbox.d.ts +4 -0
- package/lib/cjs/checkbox/checkbox.js +25 -13
- package/lib/cjs/collapse/item.js +4 -2
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/insetInput.d.ts +0 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownMenu.d.ts +0 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/modal/Modal.js +3 -0
- package/lib/cjs/modal/useModal/index.d.ts +0 -1
- package/lib/cjs/notification/useNotification/index.d.ts +0 -1
- package/lib/cjs/radio/radio.d.ts +5 -1
- package/lib/cjs/radio/radio.js +26 -12
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/scrollList/scrollItem.js +4 -0
- package/lib/cjs/tabs/TabPane.js +4 -0
- package/lib/cjs/tabs/index.js +2 -0
- package/lib/cjs/timePicker/Combobox.d.ts +0 -1
- 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.d.ts +1 -1
- package/lib/cjs/toast/useToast/index.d.ts +0 -1
- package/lib/cjs/tooltip/index.d.ts +1 -0
- package/lib/cjs/tooltip/index.js +6 -1
- package/lib/cjs/transfer/index.d.ts +1 -0
- package/lib/cjs/transfer/index.js +3 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/_portal/index.d.ts +1 -1
- package/lib/es/cascader/index.js +1 -1
- package/lib/es/checkbox/checkbox.d.ts +4 -0
- package/lib/es/checkbox/checkbox.js +25 -13
- package/lib/es/collapse/item.js +4 -2
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/insetInput.d.ts +0 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/dropdown/dropdownMenu.d.ts +0 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/modal/Modal.js +3 -0
- package/lib/es/modal/useModal/index.d.ts +0 -1
- package/lib/es/notification/useNotification/index.d.ts +0 -1
- package/lib/es/radio/radio.d.ts +5 -1
- package/lib/es/radio/radio.js +26 -12
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/scrollList/scrollItem.js +4 -0
- package/lib/es/tabs/TabPane.js +4 -0
- package/lib/es/tabs/index.js +2 -0
- package/lib/es/timePicker/Combobox.d.ts +0 -1
- 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.d.ts +1 -1
- package/lib/es/toast/useToast/index.d.ts +0 -1
- package/lib/es/tooltip/index.d.ts +1 -0
- package/lib/es/tooltip/index.js +6 -1
- package/lib/es/transfer/index.d.ts +1 -0
- package/lib/es/transfer/index.js +3 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/modal/Modal.tsx +2 -0
- package/modal/confirm.tsx +1 -1
- package/overflowList/_story/overflowList.stories.js +44 -0
- package/package.json +9 -9
- package/radio/radio.tsx +17 -7
- package/scrollList/_story/SingleWheelList/index.js +72 -0
- package/scrollList/_story/scrolllist.stories.js +7 -0
- package/scrollList/scrollItem.tsx +3 -0
- package/table/__test__/table.test.js +1 -0
- package/tabs/TabPane.tsx +2 -0
- package/tabs/_story/tabs.stories.js +72 -0
- package/tabs/index.tsx +1 -0
- package/tagInput/_story/tagInput.stories.js +14 -1
- package/tooltip/_story/tooltip.stories.js +127 -15
- package/tooltip/index.tsx +5 -1
- package/transfer/index.tsx +4 -1
- package/typography/__test__/typography.test.js +1 -0
- package/upload/__test__/upload.test.js +2 -0
- package/upload/_story/upload.stories.js +2 -2
|
@@ -26,15 +26,11 @@ class Checkbox extends BaseComponent {
|
|
|
26
26
|
|
|
27
27
|
const checked = false;
|
|
28
28
|
this.state = {
|
|
29
|
-
checked: props.checked || props.defaultChecked || checked
|
|
29
|
+
checked: props.checked || props.defaultChecked || checked,
|
|
30
|
+
addonId: props.addonId,
|
|
31
|
+
extraId: props.extraId
|
|
30
32
|
};
|
|
31
33
|
this.checkboxEntity = null;
|
|
32
|
-
this.addonId = getUuidShort({
|
|
33
|
-
prefix: 'addon'
|
|
34
|
-
});
|
|
35
|
-
this.extraId = getUuidShort({
|
|
36
|
-
prefix: 'extra'
|
|
37
|
-
});
|
|
38
34
|
this.foundation = new CheckboxFoundation(this.adapter);
|
|
39
35
|
}
|
|
40
36
|
|
|
@@ -56,7 +52,21 @@ class Checkbox extends BaseComponent {
|
|
|
56
52
|
notifyGroupChange: cbContent => {
|
|
57
53
|
this.context.checkboxGroup.onChange(cbContent);
|
|
58
54
|
},
|
|
59
|
-
getGroupDisabled: () => this.context && this.context.checkboxGroup.disabled
|
|
55
|
+
getGroupDisabled: () => this.context && this.context.checkboxGroup.disabled,
|
|
56
|
+
setAddonId: () => {
|
|
57
|
+
this.setState({
|
|
58
|
+
addonId: getUuidShort({
|
|
59
|
+
prefix: 'addon'
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
setExtraId: () => {
|
|
64
|
+
this.setState({
|
|
65
|
+
extraId: getUuidShort({
|
|
66
|
+
prefix: 'extra'
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
60
70
|
});
|
|
61
71
|
}
|
|
62
72
|
|
|
@@ -99,7 +109,9 @@ class Checkbox extends BaseComponent {
|
|
|
99
109
|
id
|
|
100
110
|
} = this.props;
|
|
101
111
|
const {
|
|
102
|
-
checked
|
|
112
|
+
checked,
|
|
113
|
+
addonId,
|
|
114
|
+
extraId
|
|
103
115
|
} = this.state;
|
|
104
116
|
const props = {
|
|
105
117
|
checked,
|
|
@@ -147,10 +159,10 @@ class Checkbox extends BaseComponent {
|
|
|
147
159
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
148
160
|
|
|
149
161
|
const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
|
|
150
|
-
id:
|
|
162
|
+
id: addonId,
|
|
151
163
|
className: "".concat(prefix, "-addon")
|
|
152
164
|
}, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
|
|
153
|
-
id:
|
|
165
|
+
id: extraId,
|
|
154
166
|
className: extraCls
|
|
155
167
|
}, extra) : null);
|
|
156
168
|
|
|
@@ -170,8 +182,8 @@ class Checkbox extends BaseComponent {
|
|
|
170
182
|
onKeyPress: this.handleEnterPress,
|
|
171
183
|
"aria-labelledby": this.props['aria-labelledby']
|
|
172
184
|
}, /*#__PURE__*/React.createElement(CheckboxInner, _Object$assign({}, this.props, props, {
|
|
173
|
-
addonId: children &&
|
|
174
|
-
extraId: extra &&
|
|
185
|
+
addonId: children && addonId,
|
|
186
|
+
extraId: extra && extraId,
|
|
175
187
|
name: name,
|
|
176
188
|
isPureCardType: props.isPureCardType,
|
|
177
189
|
ref: ref => {
|
package/lib/es/collapse/item.js
CHANGED
|
@@ -72,9 +72,11 @@ export default class CollapsePanel extends PureComponent {
|
|
|
72
72
|
className,
|
|
73
73
|
children,
|
|
74
74
|
itemKey,
|
|
75
|
-
reCalcKey
|
|
75
|
+
reCalcKey,
|
|
76
|
+
header,
|
|
77
|
+
extra
|
|
76
78
|
} = _a,
|
|
77
|
-
restProps = __rest(_a, ["className", "children", "itemKey", "reCalcKey"]);
|
|
79
|
+
restProps = __rest(_a, ["className", "children", "itemKey", "reCalcKey", "header", "extra"]);
|
|
78
80
|
|
|
79
81
|
const {
|
|
80
82
|
keepDOM,
|
|
@@ -26,7 +26,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
26
26
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
value: PropTypes.Requireable<any[]>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
type: PropTypes.Requireable<"
|
|
29
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
30
30
|
showClear: PropTypes.Requireable<boolean>;
|
|
31
31
|
format: PropTypes.Requireable<string>;
|
|
32
32
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -41,7 +41,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
41
41
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
42
42
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
43
43
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
44
|
-
type: PropTypes.Requireable<"
|
|
44
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
45
45
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
46
46
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
47
47
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"
|
|
20
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -125,7 +125,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
125
125
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
128
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
129
129
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
130
130
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
131
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
73
73
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
76
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
77
77
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
78
78
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
79
79
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -214,6 +214,9 @@ class Modal extends BaseComponent {
|
|
|
214
214
|
this.props.onOk(e);
|
|
215
215
|
},
|
|
216
216
|
notifyClose: () => {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
|
|
219
|
+
(_b = (_a = this.props.motion) === null || _a === void 0 ? void 0 : _a.didLeave) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
217
220
|
this.props.afterClose();
|
|
218
221
|
},
|
|
219
222
|
toggleHidden: (hidden, callback) => {
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -29,9 +29,13 @@ export declare type RadioProps = {
|
|
|
29
29
|
addonClassName?: string;
|
|
30
30
|
type?: RadioType;
|
|
31
31
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
32
|
+
addonId?: string;
|
|
33
|
+
extraId?: string;
|
|
32
34
|
};
|
|
33
35
|
export interface RadioState {
|
|
34
36
|
hover?: boolean;
|
|
37
|
+
addonId?: string;
|
|
38
|
+
extraId?: string;
|
|
35
39
|
}
|
|
36
40
|
export { RadioChangeEvent };
|
|
37
41
|
declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
@@ -71,7 +75,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
|
71
75
|
prefixCls?: string;
|
|
72
76
|
name?: string;
|
|
73
77
|
onChange?: (e: RadioChangeEvent) => void;
|
|
74
|
-
buttonSize?: "small" | "
|
|
78
|
+
buttonSize?: "small" | "large" | "middle";
|
|
75
79
|
isCardRadio?: boolean;
|
|
76
80
|
isPureCardRadio?: boolean;
|
|
77
81
|
};
|
package/lib/es/radio/radio.js
CHANGED
|
@@ -44,16 +44,12 @@ class Radio extends BaseComponent {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
this.state = {
|
|
47
|
-
hover: false
|
|
47
|
+
hover: false,
|
|
48
|
+
addonId: props.addonId,
|
|
49
|
+
extraId: props.extraId
|
|
48
50
|
};
|
|
49
51
|
this.foundation = new RadioFoundation(this.adapter);
|
|
50
52
|
this.radioEntity = null;
|
|
51
|
-
this.addonId = getUuidShort({
|
|
52
|
-
prefix: 'addon'
|
|
53
|
-
});
|
|
54
|
-
this.extraId = getUuidShort({
|
|
55
|
-
prefix: 'extra'
|
|
56
|
-
});
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
get adapter() {
|
|
@@ -62,6 +58,20 @@ class Radio extends BaseComponent {
|
|
|
62
58
|
this.setState({
|
|
63
59
|
hover
|
|
64
60
|
});
|
|
61
|
+
},
|
|
62
|
+
setAddonId: () => {
|
|
63
|
+
this.setState({
|
|
64
|
+
addonId: getUuidShort({
|
|
65
|
+
prefix: 'addon'
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
setExtraId: () => {
|
|
70
|
+
this.setState({
|
|
71
|
+
extraId: getUuidShort({
|
|
72
|
+
prefix: 'extra'
|
|
73
|
+
})
|
|
74
|
+
});
|
|
65
75
|
}
|
|
66
76
|
});
|
|
67
77
|
}
|
|
@@ -98,7 +108,11 @@ class Radio extends BaseComponent {
|
|
|
98
108
|
value: propValue
|
|
99
109
|
} = this.props;
|
|
100
110
|
let realChecked, isDisabled, realMode, isButtonRadioGroup, isCardRadioGroup, isPureCardRadioGroup, isButtonRadioComponent, buttonSize, realPrefixCls;
|
|
101
|
-
const
|
|
111
|
+
const {
|
|
112
|
+
hover: isHover,
|
|
113
|
+
addonId,
|
|
114
|
+
extraId
|
|
115
|
+
} = this.state;
|
|
102
116
|
let props = {};
|
|
103
117
|
|
|
104
118
|
if (this.isInGroup()) {
|
|
@@ -151,10 +165,10 @@ class Radio extends BaseComponent {
|
|
|
151
165
|
const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
|
|
152
166
|
className: addonCls,
|
|
153
167
|
style: addonStyle,
|
|
154
|
-
id:
|
|
168
|
+
id: addonId
|
|
155
169
|
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/React.createElement("div", {
|
|
156
170
|
className: "".concat(prefix, "-extra"),
|
|
157
|
-
id:
|
|
171
|
+
id: extraId
|
|
158
172
|
}, extra) : null);
|
|
159
173
|
|
|
160
174
|
return /*#__PURE__*/React.createElement("label", {
|
|
@@ -171,8 +185,8 @@ class Radio extends BaseComponent {
|
|
|
171
185
|
ref: ref => {
|
|
172
186
|
this.radioEntity = ref;
|
|
173
187
|
},
|
|
174
|
-
addonId: children &&
|
|
175
|
-
extraId: extra &&
|
|
188
|
+
addonId: children && addonId,
|
|
189
|
+
extraId: extra && extraId
|
|
176
190
|
})), isCardRadioGroup ? /*#__PURE__*/React.createElement("div", {
|
|
177
191
|
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
178
192
|
}, renderContent()) : renderContent());
|
|
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
|
|
|
48
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
49
|
name: PropTypes.Requireable<string>;
|
|
50
50
|
options: PropTypes.Requireable<any[]>;
|
|
51
|
-
buttonSize: PropTypes.Requireable<"small" | "
|
|
51
|
+
buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
|
|
52
52
|
type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
|
|
53
53
|
value: PropTypes.Requireable<any>;
|
|
54
54
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -39,6 +39,8 @@ export default class ScrollItem extends BaseComponent {
|
|
|
39
39
|
this._cacheSelectorNode = selector => this._cacheNode('selector', selector);
|
|
40
40
|
|
|
41
41
|
this._cacheWrapperNode = wrapper => this._cacheNode('wrapper', wrapper);
|
|
42
|
+
/* istanbul ignore next */
|
|
43
|
+
|
|
42
44
|
|
|
43
45
|
this._isFirst = node => {
|
|
44
46
|
const {
|
|
@@ -55,6 +57,8 @@ export default class ScrollItem extends BaseComponent {
|
|
|
55
57
|
|
|
56
58
|
return false;
|
|
57
59
|
};
|
|
60
|
+
/* istanbul ignore next */
|
|
61
|
+
|
|
58
62
|
|
|
59
63
|
this._isLast = node => {
|
|
60
64
|
const {
|
package/lib/es/tabs/TabPane.js
CHANGED
|
@@ -48,6 +48,8 @@ class TabPane extends PureComponent {
|
|
|
48
48
|
|
|
49
49
|
return false;
|
|
50
50
|
};
|
|
51
|
+
/* istanbul ignore next */
|
|
52
|
+
|
|
51
53
|
|
|
52
54
|
this.hideScroll = () => {
|
|
53
55
|
if (this.ref && this.ref.current) {
|
|
@@ -55,6 +57,8 @@ class TabPane extends PureComponent {
|
|
|
55
57
|
this.isAnimating = true;
|
|
56
58
|
}
|
|
57
59
|
};
|
|
60
|
+
/* istanbul ignore next */
|
|
61
|
+
|
|
58
62
|
|
|
59
63
|
this.autoScroll = () => {
|
|
60
64
|
if (this.ref && this.ref.current) {
|
package/lib/es/tabs/index.js
CHANGED
|
@@ -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[] | number[] | Date
|
|
100
|
+
value: PropTypes.Requireable<string | number | string[] | Date | number[] | 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[] | number[] | Date
|
|
104
|
+
defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | 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[] | number[] | Date
|
|
9
|
+
declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | 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[] | number[] | Date
|
|
21
|
+
value: import("prop-types").Requireable<string | number | string[] | Date | number[] | 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[] | number[] | Date
|
|
25
|
+
defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | 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.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare class Toast extends BaseComponent<ToastReactProps, ToastState> {
|
|
|
41
41
|
close(e: React.MouseEvent): void;
|
|
42
42
|
clearCloseTimer: () => void;
|
|
43
43
|
startCloseTimer: () => void;
|
|
44
|
-
renderIcon(): true | React.
|
|
44
|
+
renderIcon(): string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment;
|
|
45
45
|
render(): JSX.Element;
|
|
46
46
|
}
|
|
47
47
|
export default Toast;
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -286,7 +286,7 @@ export default class Tooltip extends BaseComponent {
|
|
|
286
286
|
placement: props.position || 'top',
|
|
287
287
|
transitionStyle: {},
|
|
288
288
|
isPositionUpdated: false,
|
|
289
|
-
id:
|
|
289
|
+
id: props.wrapperId // auto generate id, will be used by children.aria-describedby & content.id, improve a11y
|
|
290
290
|
|
|
291
291
|
};
|
|
292
292
|
this.foundation = new TooltipFoundation(this.adapter);
|
|
@@ -559,6 +559,11 @@ export default class Tooltip extends BaseComponent {
|
|
|
559
559
|
},
|
|
560
560
|
notifyEscKeydown: event => {
|
|
561
561
|
this.props.onEscKeyDown(event);
|
|
562
|
+
},
|
|
563
|
+
setId: () => {
|
|
564
|
+
this.setState({
|
|
565
|
+
id: getUuidShort()
|
|
566
|
+
});
|
|
562
567
|
}
|
|
563
568
|
});
|
|
564
569
|
}
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -254,7 +254,8 @@ class Transfer extends BaseComponent {
|
|
|
254
254
|
loading,
|
|
255
255
|
type,
|
|
256
256
|
emptyContent,
|
|
257
|
-
renderSourcePanel
|
|
257
|
+
renderSourcePanel,
|
|
258
|
+
dataSource
|
|
258
259
|
} = this.props;
|
|
259
260
|
const totalToken = locale.total;
|
|
260
261
|
const inSearchMode = inputValue !== '';
|
|
@@ -312,6 +313,7 @@ class Transfer extends BaseComponent {
|
|
|
312
313
|
noMatch,
|
|
313
314
|
filterData,
|
|
314
315
|
sourceData: data,
|
|
316
|
+
propsDataSource: dataSource,
|
|
315
317
|
allChecked: !leftContainesNotInSelected,
|
|
316
318
|
showNumber,
|
|
317
319
|
inputValue,
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 6 | 5>;
|
|
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
|
@@ -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<"custom" | "auto">;
|
|
144
144
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
145
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
146
146
|
withCredentials: PropTypes.Requireable<boolean>;
|
package/modal/Modal.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } f
|
|
|
15
15
|
import { Locale } from '../locale/interface';
|
|
16
16
|
import useModal from './useModal';
|
|
17
17
|
import { ButtonProps } from '../button/Button';
|
|
18
|
+
import { MotionObject } from "@douyinfe/semi-foundation/utils/type";
|
|
18
19
|
|
|
19
20
|
export const destroyFns: any[] = [];
|
|
20
21
|
export type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
@@ -156,6 +157,7 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
156
157
|
this.props.onOk(e);
|
|
157
158
|
},
|
|
158
159
|
notifyClose: () => {
|
|
160
|
+
(this.props.motion as MotionObject)?.didLeave?.();
|
|
159
161
|
this.props.afterClose();
|
|
160
162
|
},
|
|
161
163
|
toggleHidden: (hidden: boolean, callback?: (hidden: boolean) => void) => {
|
package/modal/confirm.tsx
CHANGED
|
@@ -352,5 +352,49 @@ const LargeData = () => {
|
|
|
352
352
|
);
|
|
353
353
|
};
|
|
354
354
|
|
|
355
|
+
export const OverflowListWithSlide = () =>{
|
|
356
|
+
const [width, setWidth] = useState(100);
|
|
357
|
+
const renderOverflow = items => {
|
|
358
|
+
return items.length ? <Tag style={{ flex: '0 0 auto' }}>+{items.length}</Tag> : null;
|
|
359
|
+
};
|
|
360
|
+
const renderItem = (item, ind) => {
|
|
361
|
+
return (
|
|
362
|
+
<Tag color="blue" key={item.key} style={{ marginRight: 8, flex: '0 0 auto' }}>
|
|
363
|
+
{item.icon}
|
|
364
|
+
{item.key}
|
|
365
|
+
</Tag>
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const items = [
|
|
370
|
+
{ icon: <IconAlarm style={{ marginRight: 4 }} />, key: 'alarm' },
|
|
371
|
+
{ icon: <IconBookmark style={{ marginRight: 4 }} />, key: 'bookmark' },
|
|
372
|
+
{ icon: <IconCamera style={{ marginRight: 4 }} />, key: 'camera' },
|
|
373
|
+
{ icon: <IconDuration style={{ marginRight: 4 }} />, key: 'duration' },
|
|
374
|
+
{ icon: <IconEdit style={{ marginRight: 4 }} />, key: 'edit' },
|
|
375
|
+
{ icon: <IconFolder style={{ marginRight: 4 }} />, key: 'folder' },
|
|
376
|
+
];
|
|
377
|
+
|
|
378
|
+
return (
|
|
379
|
+
<div>
|
|
380
|
+
<Slider step={1} value={width} onChange={value => setWidth(value)} />
|
|
381
|
+
<br />
|
|
382
|
+
<br />
|
|
383
|
+
<div style={{ width: `${width}%` }}>
|
|
384
|
+
<OverflowList
|
|
385
|
+
items={items}
|
|
386
|
+
// minVisibleItems={3}
|
|
387
|
+
overflowRenderer={renderOverflow}
|
|
388
|
+
visibleItemRenderer={renderItem}
|
|
389
|
+
/>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
OverflowListWithSlide.story = {
|
|
396
|
+
name: 'overflowList with slide',
|
|
397
|
+
};
|
|
398
|
+
|
|
355
399
|
// TODO large data will cause memory heap
|
|
356
400
|
// stories.add('large amount of data', () => <LargeData />);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
|
-
"@douyinfe/semi-animation": "2.9.0
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.9.0
|
|
19
|
-
"@douyinfe/semi-foundation": "2.
|
|
20
|
-
"@douyinfe/semi-icons": "2.9.0
|
|
21
|
-
"@douyinfe/semi-illustrations": "2.9.0
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.9.0
|
|
17
|
+
"@douyinfe/semi-animation": "2.9.0",
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.9.0",
|
|
19
|
+
"@douyinfe/semi-foundation": "^2.10.0-alpha.0",
|
|
20
|
+
"@douyinfe/semi-icons": "2.9.0",
|
|
21
|
+
"@douyinfe/semi-illustrations": "2.9.0",
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.9.0",
|
|
23
23
|
"@types/react-window": "^1.8.2",
|
|
24
24
|
"async-validator": "^3.5.0",
|
|
25
25
|
"classnames": "^2.2.6",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "5d1bb1d031052d7584ecd5d1bc444cd13f861337",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.9.0
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.9.0",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"babel-loader": "^8.2.2",
|