@douyinfe/semi-ui 2.0.9-alpha.4 → 2.1.0-alpha.3
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 +14 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1625 -2525
- 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/es/_base/baseComponent.js +1 -5
- package/lib/es/_portal/index.js +7 -17
- package/lib/es/_utils/index.js +13 -16
- package/lib/es/breadcrumb/index.js +2 -4
- package/lib/es/breadcrumb/item.js +4 -6
- package/lib/es/button/index.d.ts +0 -1
- package/lib/es/button/index.js +2 -4
- package/lib/es/calendar/monthCalendar.js +9 -11
- package/lib/es/cascader/index.d.ts +1 -0
- package/lib/es/cascader/index.js +23 -14
- package/lib/es/cascader/item.js +1 -2
- package/lib/es/collapse/item.js +1 -2
- package/lib/es/collapsible/index.js +9 -9
- package/lib/es/datePicker/dateInput.js +9 -29
- package/lib/es/datePicker/datePicker.js +12 -49
- package/lib/es/datePicker/footer.js +1 -2
- package/lib/es/datePicker/index.js +12 -15
- package/lib/es/datePicker/yearAndMonth.js +17 -23
- package/lib/es/dropdown/dropdownDivider.js +1 -2
- package/lib/es/form/baseForm.d.ts +4 -10
- package/lib/es/form/field.d.ts +4 -22
- package/lib/es/form/field.js +2 -18
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +3 -14
- package/lib/es/iconButton/index.d.ts +0 -1
- package/lib/es/iconButton/index.js +0 -1
- package/lib/es/inputNumber/index.js +4 -12
- package/lib/es/locale/localeConsumer.js +3 -6
- package/lib/es/modal/ConfirmModal.js +2 -2
- package/lib/es/modal/confirm.js +2 -2
- package/lib/es/modal/useModal/HookModal.js +2 -2
- package/lib/es/motions/Rotate.js +4 -6
- package/lib/es/navigation/CollapseButton.js +7 -9
- package/lib/es/navigation/Item.js +7 -33
- package/lib/es/navigation/OpenIconTransition.js +4 -6
- package/lib/es/navigation/SubNav.js +6 -33
- package/lib/es/navigation/SubNavTransition.js +5 -7
- package/lib/es/navigation/index.js +6 -24
- package/lib/es/notification/NoticeTransition.js +5 -7
- package/lib/es/notification/index.js +8 -16
- package/lib/es/notification/useNotification/index.js +7 -11
- package/lib/es/overflowList/index.js +4 -9
- package/lib/es/overflowList/intersectionObserver.js +1 -2
- package/lib/es/popconfirm/index.d.ts +5 -1
- package/lib/es/popconfirm/index.js +10 -4
- package/lib/es/popover/Arrow.js +1 -3
- package/lib/es/popover/index.d.ts +3 -1
- package/lib/es/popover/index.js +4 -8
- package/lib/es/radio/context.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +2 -2
- package/lib/es/radio/radioGroup.d.ts +4 -4
- package/lib/es/resizeObserver/index.js +1 -2
- package/lib/es/scrollList/scrollItem.js +24 -40
- package/lib/es/select/index.js +19 -16
- package/lib/es/select/option.js +8 -10
- package/lib/es/select/utils.d.ts +1 -1
- package/lib/es/select/utils.js +10 -4
- package/lib/es/select/virtualRow.js +5 -6
- package/lib/es/sideSheet/SideSheetTransition.js +1 -3
- package/lib/es/slider/index.js +11 -23
- package/lib/es/spin/icon.js +1 -3
- package/lib/es/table/Body/BaseRow.js +8 -16
- package/lib/es/table/Body/SectionRow.js +3 -6
- package/lib/es/table/Body/index.js +32 -49
- package/lib/es/table/Column.js +1 -2
- package/lib/es/table/ColumnFilter.js +2 -6
- package/lib/es/table/ColumnSelection.js +1 -5
- package/lib/es/table/HeadTable.js +3 -4
- package/lib/es/table/ResizableTable.js +20 -31
- package/lib/es/table/Table.js +63 -160
- package/lib/es/table/TableCell.js +3 -5
- package/lib/es/table/TableContextProvider.js +15 -16
- package/lib/es/table/TableHeader.js +1 -4
- package/lib/es/table/utils.js +1 -3
- package/lib/es/tabs/TabBar.d.ts +4 -2
- package/lib/es/tabs/TabBar.js +12 -4
- package/lib/es/tabs/TabPane.d.ts +2 -1
- package/lib/es/tabs/TabPane.js +3 -2
- package/lib/es/tabs/TabPaneTransition.js +9 -12
- package/lib/es/tabs/index.d.ts +3 -1
- package/lib/es/tabs/index.js +83 -14
- package/lib/es/tabs/interface.d.ts +6 -1
- package/lib/es/tagInput/index.d.ts +3 -0
- package/lib/es/tagInput/index.js +6 -1
- package/lib/es/timePicker/Combobox.js +5 -6
- package/lib/es/timePicker/TimeInput.js +3 -11
- package/lib/es/timePicker/TimePicker.js +7 -21
- package/lib/es/timePicker/index.js +12 -15
- package/lib/es/toast/ToastTransition.js +8 -12
- package/lib/es/toast/useToast/index.js +3 -6
- package/lib/es/tooltip/TooltipStyledTransition.js +10 -14
- package/lib/es/tooltip/index.d.ts +3 -0
- package/lib/es/tooltip/index.js +22 -28
- package/lib/es/transfer/index.js +15 -18
- package/lib/es/tree/index.js +28 -38
- package/lib/es/tree/interface.d.ts +2 -2
- package/lib/es/treeSelect/index.d.ts +2 -11
- package/lib/es/treeSelect/index.js +32 -44
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/util.js +3 -12
- package/lib/es/upload/fileCard.js +53 -62
- package/lib/es/upload/index.d.ts +1 -1
- package/lib/es/upload/index.js +23 -32
- package/package.json +8 -8
|
@@ -110,23 +110,17 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
110
110
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
111
111
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
112
112
|
children?: React.ReactNode;
|
|
113
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
113
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
114
114
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
115
115
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
116
116
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
|
117
117
|
static RadioGroup: React.ComponentType<import("utility-types").Subtract<import("../radio").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
118
118
|
static DatePicker: React.ComponentType<import("utility-types").Subtract<import("../datePicker").DatePickerProps & React.RefAttributes<import("../datePicker/datePicker").default>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
119
|
-
static TimePicker: React.ComponentType<import("utility-types").Subtract<import("../timePicker").TimePickerProps
|
|
120
|
-
children?: React.ReactNode;
|
|
121
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
119
|
+
static TimePicker: React.ComponentType<import("utility-types").Subtract<import("../timePicker").TimePickerProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
122
120
|
static Switch: React.ComponentType<import("utility-types").Subtract<import("../switch").SwitchProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
123
121
|
static Slider: React.ComponentType<import("utility-types").Subtract<import("../slider").SliderProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
124
|
-
static TreeSelect: React.ComponentType<import("utility-types").Subtract<import("../treeSelect").TreeSelectProps
|
|
125
|
-
|
|
126
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
127
|
-
static Cascader: React.ComponentType<import("utility-types").Subtract<import("../cascader").CascaderProps | (import("../cascader").CascaderProps & {
|
|
128
|
-
children?: React.ReactNode;
|
|
129
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
122
|
+
static TreeSelect: React.ComponentType<import("utility-types").Subtract<import("../treeSelect").TreeSelectProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
123
|
+
static Cascader: React.ComponentType<import("utility-types").Subtract<import("../cascader").CascaderProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
130
124
|
static Rating: React.ComponentType<import("utility-types").Subtract<import("../rating").RatingProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
125
|
static AutoComplete: React.ComponentType<import("utility-types").Subtract<import("../autoComplete").AutoCompleteProps<import("../autoComplete").AutoCompleteItems>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
132
126
|
static Upload: React.ComponentType<import("utility-types").Subtract<import("../upload").UploadProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
60
60
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
61
61
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
62
62
|
children?: import("react").ReactNode;
|
|
63
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
63
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
64
64
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
65
65
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
66
66
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
@@ -68,27 +68,9 @@ declare const FormRadio: import("react").ComponentType<import("utility-types").S
|
|
|
68
68
|
declare const FormDatePicker: import("react").ComponentType<import("utility-types").Subtract<import("../datePicker/datePicker").DatePickerProps & import("react").RefAttributes<import("../datePicker/datePicker").default>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
69
69
|
declare const FormSwitch: import("react").ComponentType<import("utility-types").Subtract<import("../switch/index").SwitchProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
70
70
|
declare const FormSlider: import("react").ComponentType<import("utility-types").Subtract<import("../slider/index").SliderProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* 1. TimePicker: The propTypes of the locale is defined as object (it is not necessary and too troublesome to write a complete shapeOf),
|
|
75
|
-
* but the interface defines a complete type, the two cannot match, and ts will report an error, so skip it here.
|
|
76
|
-
*
|
|
77
|
-
* 2. Cascader: treeData { label, value } define in PropTypes.shapeOf alreaady declare isRequired, ts still throw error
|
|
78
|
-
* 【Property is optional in type “InferProps<{ value: Validator<string | number>; label: Validator<any>; }>” but required in type CascaderData】
|
|
79
|
-
* skip it here.
|
|
80
|
-
* 3. TreeSelect: value same as cascader, skip it here
|
|
81
|
-
*
|
|
82
|
-
*/
|
|
83
|
-
declare const FormTimePicker: import("react").ComponentType<import("utility-types").Subtract<import("../timePicker/TimePicker").TimePickerProps | (import("../timePicker/TimePicker").TimePickerProps & {
|
|
84
|
-
children?: import("react").ReactNode;
|
|
85
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
86
|
-
declare const FormTreeSelect: import("react").ComponentType<import("utility-types").Subtract<import("../treeSelect/index").TreeSelectProps | (import("../treeSelect/index").TreeSelectProps & {
|
|
87
|
-
children?: import("react").ReactNode;
|
|
88
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
89
|
-
declare const FormCascader: import("react").ComponentType<import("utility-types").Subtract<import("../cascader/index").CascaderProps | (import("../cascader/index").CascaderProps & {
|
|
90
|
-
children?: import("react").ReactNode;
|
|
91
|
-
}), import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
71
|
+
declare const FormTimePicker: import("react").ComponentType<import("utility-types").Subtract<import("../timePicker/TimePicker").TimePickerProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
72
|
+
declare const FormTreeSelect: import("react").ComponentType<import("utility-types").Subtract<import("../treeSelect/index").TreeSelectProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
73
|
+
declare const FormCascader: import("react").ComponentType<import("utility-types").Subtract<import("../cascader/index").CascaderProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
92
74
|
declare const FormRating: import("react").ComponentType<import("utility-types").Subtract<import("../rating/index").RatingProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
93
75
|
declare const FormAutoComplete: import("react").ComponentType<import("utility-types").Subtract<import("../autoComplete/index").AutoCompleteProps<import("../autoComplete/index").AutoCompleteItems>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
94
76
|
declare const FormUpload: import("react").ComponentType<import("utility-types").Subtract<import("../upload/index").UploadProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
package/lib/es/form/field.js
CHANGED
|
@@ -51,24 +51,8 @@ const FormSwitch = withField(Switch, {
|
|
|
51
51
|
valueKey: 'checked'
|
|
52
52
|
});
|
|
53
53
|
const FormSlider = withField(Slider);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
* 1. TimePicker: The propTypes of the locale is defined as object (it is not necessary and too troublesome to write a complete shapeOf),
|
|
58
|
-
* but the interface defines a complete type, the two cannot match, and ts will report an error, so skip it here.
|
|
59
|
-
*
|
|
60
|
-
* 2. Cascader: treeData { label, value } define in PropTypes.shapeOf alreaady declare isRequired, ts still throw error
|
|
61
|
-
* 【Property is optional in type “InferProps<{ value: Validator<string | number>; label: Validator<any>; }>” but required in type CascaderData】
|
|
62
|
-
* skip it here.
|
|
63
|
-
* 3. TreeSelect: value same as cascader, skip it here
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
// @ts-ignore-next-line
|
|
67
|
-
|
|
68
|
-
const FormTimePicker = withField(TimePicker); // @ts-ignore-next-line
|
|
69
|
-
|
|
70
|
-
const FormTreeSelect = withField(TreeSelect); // @ts-ignore-next-line
|
|
71
|
-
|
|
54
|
+
const FormTimePicker = withField(TimePicker);
|
|
55
|
+
const FormTreeSelect = withField(TreeSelect);
|
|
72
56
|
const FormCascader = withField(Cascader);
|
|
73
57
|
const FormRating = withField(Rating);
|
|
74
58
|
const FormAutoComplete = withField(AutoComplete, {
|
|
@@ -8,5 +8,5 @@ import { Subtract } from 'utility-types';
|
|
|
8
8
|
* 2. Insert <Label>
|
|
9
9
|
* 3. Insert <ErrorMessage>
|
|
10
10
|
*/
|
|
11
|
-
declare function withField<C extends React.
|
|
11
|
+
declare function withField<C extends React.ElementType, T extends Subtract<React.ComponentProps<C>, CommonexcludeType> & CommonFieldProps, R extends React.ComponentType<T>>(Component: C, opts?: WithFieldOption): R;
|
|
12
12
|
export default withField;
|
|
@@ -5,8 +5,6 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
|
5
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
6
|
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
|
7
7
|
|
|
8
|
-
/* argus-disable unPkgSensitiveInfo */
|
|
9
|
-
|
|
10
8
|
/* eslint-disable max-lines-per-function, react-hooks/rules-of-hooks, prefer-const, max-len */
|
|
11
9
|
import React, { useState, useLayoutEffect, useMemo, useRef, forwardRef } from 'react';
|
|
12
10
|
import classNames from 'classnames';
|
|
@@ -267,14 +265,10 @@ function withField(Component, opts) {
|
|
|
267
265
|
*/
|
|
268
266
|
|
|
269
267
|
|
|
270
|
-
const handleChange =
|
|
268
|
+
const handleChange = (newValue, e, ...other) => {
|
|
271
269
|
let fnKey = options.onKeyChangeFnName;
|
|
272
270
|
|
|
273
271
|
if (fnKey in props && typeof props[options.onKeyChangeFnName] === 'function') {
|
|
274
|
-
for (var _len = arguments.length, other = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
275
|
-
other[_key - 2] = arguments[_key];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
272
|
props[options.onKeyChangeFnName](newValue, e, ...other);
|
|
279
273
|
} // support various type component
|
|
280
274
|
|
|
@@ -327,9 +321,9 @@ function withField(Component, opts) {
|
|
|
327
321
|
}
|
|
328
322
|
};
|
|
329
323
|
|
|
330
|
-
const handleBlur =
|
|
324
|
+
const handleBlur = (...e) => {
|
|
331
325
|
if (props.onBlur) {
|
|
332
|
-
props.onBlur(...
|
|
326
|
+
props.onBlur(...e);
|
|
333
327
|
}
|
|
334
328
|
|
|
335
329
|
if (!touched) {
|
|
@@ -510,11 +504,6 @@ function withField(Component, opts) {
|
|
|
510
504
|
return FieldComponent;
|
|
511
505
|
}
|
|
512
506
|
};
|
|
513
|
-
/**
|
|
514
|
-
* Reasons for using ts-igonre: skip strict check of ref
|
|
515
|
-
*/
|
|
516
|
-
// @ts-ignore-next-line
|
|
517
|
-
|
|
518
507
|
|
|
519
508
|
SemiField = /*#__PURE__*/forwardRef(SemiField);
|
|
520
509
|
SemiField.displayName = getDisplayName(Component);
|
|
@@ -32,7 +32,6 @@ declare class IconButton extends PureComponent<IconButtonProps> {
|
|
|
32
32
|
loading: PropTypes.Requireable<boolean>;
|
|
33
33
|
prefixCls: PropTypes.Requireable<string>;
|
|
34
34
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
35
|
-
iconType: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
36
35
|
iconSize: PropTypes.Requireable<string>;
|
|
37
36
|
noHorizontalPadding: PropTypes.Requireable<string | boolean | any[]>;
|
|
38
37
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -108,7 +108,6 @@ IconButton.propTypes = {
|
|
|
108
108
|
loading: PropTypes.bool,
|
|
109
109
|
prefixCls: PropTypes.string,
|
|
110
110
|
icon: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.node]),
|
|
111
|
-
iconType: PropTypes.element,
|
|
112
111
|
iconSize: PropTypes.oneOf(iconSizes),
|
|
113
112
|
noHorizontalPadding: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.array]),
|
|
114
113
|
children: PropTypes.node,
|
|
@@ -155,8 +155,6 @@ class InputNumber extends BaseComponent {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
get adapter() {
|
|
158
|
-
var _this = this;
|
|
159
|
-
|
|
160
158
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
161
159
|
setValue: (value, cb) => this.setState({
|
|
162
160
|
value
|
|
@@ -170,12 +168,8 @@ class InputNumber extends BaseComponent {
|
|
|
170
168
|
setHovering: hovering => this.setState({
|
|
171
169
|
hovering
|
|
172
170
|
}),
|
|
173
|
-
notifyChange:
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
notifyNumberChange: function () {
|
|
177
|
-
return _this.props.onNumberChange(...arguments);
|
|
178
|
-
},
|
|
171
|
+
notifyChange: (...args) => this.props.onChange(...args),
|
|
172
|
+
notifyNumberChange: (...args) => this.props.onNumberChange(...args),
|
|
179
173
|
notifyBlur: e => this.props.onBlur(e),
|
|
180
174
|
notifyFocus: e => this.props.onFocus(e),
|
|
181
175
|
notifyUpClick: (value, e) => this.props.onUpClick(value, e),
|
|
@@ -231,9 +225,7 @@ class InputNumber extends BaseComponent {
|
|
|
231
225
|
|
|
232
226
|
return false;
|
|
233
227
|
},
|
|
234
|
-
restoreCursor:
|
|
235
|
-
let str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.cursorAfter;
|
|
236
|
-
|
|
228
|
+
restoreCursor: (str = this.cursorAfter) => {
|
|
237
229
|
if (isNullOrUndefined(str)) {
|
|
238
230
|
return false;
|
|
239
231
|
} // For loop from full str to the str with last char to map. e.g. 123
|
|
@@ -244,7 +236,7 @@ class InputNumber extends BaseComponent {
|
|
|
244
236
|
|
|
245
237
|
return _someInstanceProperty(Array.prototype).call(str, (_, start) => {
|
|
246
238
|
const partStr = str.substring(start);
|
|
247
|
-
return
|
|
239
|
+
return this.adapter.restoreByAfter(partStr);
|
|
248
240
|
});
|
|
249
241
|
},
|
|
250
242
|
fixCaret: (start, end) => {
|
|
@@ -34,12 +34,9 @@ export default class LocaleConsumer extends Component {
|
|
|
34
34
|
const {
|
|
35
35
|
children
|
|
36
36
|
} = this.props;
|
|
37
|
-
return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = _ref;
|
|
41
|
-
return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, localeData => this.renderChildren(locale || localeData, children));
|
|
42
|
-
});
|
|
37
|
+
return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null, ({
|
|
38
|
+
locale
|
|
39
|
+
}) => /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, localeData => this.renderChildren(locale || localeData, children)));
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
}
|
|
@@ -51,7 +51,7 @@ const ConfirmModal = props => {
|
|
|
51
51
|
|
|
52
52
|
if (res && res.then) {
|
|
53
53
|
setConfirmLoading(true);
|
|
54
|
-
res.then(
|
|
54
|
+
res.then((...args) => {
|
|
55
55
|
setVisible(false);
|
|
56
56
|
setConfirmLoading(false);
|
|
57
57
|
}, err => {
|
|
@@ -66,7 +66,7 @@ const ConfirmModal = props => {
|
|
|
66
66
|
|
|
67
67
|
if (res && res.then) {
|
|
68
68
|
setCancelLoading(true);
|
|
69
|
-
res.then(
|
|
69
|
+
res.then((...args) => {
|
|
70
70
|
setVisible(false);
|
|
71
71
|
setCancelLoading(false);
|
|
72
72
|
}, err => {
|
package/lib/es/modal/confirm.js
CHANGED
|
@@ -33,11 +33,11 @@ export default function confirm(props) {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const mergedMotion = typeof props.motion === 'undefined' || props.motion ? _Object$assign(_Object$assign({}, props.motion), {
|
|
36
|
-
didLeave:
|
|
36
|
+
didLeave: (...args) => {
|
|
37
37
|
const didLeave = get(props.motion, 'didLeave');
|
|
38
38
|
|
|
39
39
|
if (typeof didLeave === 'function') {
|
|
40
|
-
didLeave(...
|
|
40
|
+
didLeave(...args);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
destroy();
|
|
@@ -39,11 +39,11 @@ const HookModal = (_a, ref) => {
|
|
|
39
39
|
motion
|
|
40
40
|
} = props;
|
|
41
41
|
const mergedMotion = typeof motion === 'undefined' || motion ? _Object$assign(_Object$assign({}, motion), {
|
|
42
|
-
didLeave:
|
|
42
|
+
didLeave: (...args) => {
|
|
43
43
|
const didLeave = get(props.motion, 'didLeave');
|
|
44
44
|
|
|
45
45
|
if (typeof didLeave === 'function') {
|
|
46
|
-
didLeave(...
|
|
46
|
+
didLeave(...args);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
afterClose();
|
package/lib/es/motions/Rotate.js
CHANGED
|
@@ -4,17 +4,15 @@ import React, { useEffect, useState, Children, cloneElement, isValidElement } fr
|
|
|
4
4
|
import { Transition } from '@douyinfe/semi-animation-react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
|
|
7
|
-
const formatStyle = function formatStyle(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
7
|
+
const formatStyle = function formatStyle({
|
|
8
|
+
rotate = 0
|
|
9
|
+
}) {
|
|
11
10
|
return {
|
|
12
11
|
transform: "rotate(".concat(rotate, "deg)")
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
14
|
|
|
16
|
-
function OpenIconTransition() {
|
|
17
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
function OpenIconTransition(props = {}) {
|
|
18
16
|
const {
|
|
19
17
|
children,
|
|
20
18
|
isOpen,
|
|
@@ -4,15 +4,13 @@ import { noop } from 'lodash-es';
|
|
|
4
4
|
import { IconSidebar } from '@douyinfe/semi-icons';
|
|
5
5
|
import Button from '../button';
|
|
6
6
|
import Tooltip from '../tooltip';
|
|
7
|
-
export default function CollapseButton(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
15
|
-
|
|
7
|
+
export default function CollapseButton({
|
|
8
|
+
prefixCls,
|
|
9
|
+
locale,
|
|
10
|
+
collapseText,
|
|
11
|
+
isCollapsed,
|
|
12
|
+
onClick = noop
|
|
13
|
+
}) {
|
|
16
14
|
const handleClick = () => {
|
|
17
15
|
if (typeof onClick === 'function') {
|
|
18
16
|
onClick(!isCollapsed);
|
|
@@ -50,12 +50,8 @@ export default class NavItem extends BaseComponent {
|
|
|
50
50
|
this.foundation = new ItemFoundation(this.adapter);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
_invokeContextFunc(funcName) {
|
|
53
|
+
_invokeContextFunc(funcName, ...args) {
|
|
54
54
|
if (funcName && this.context && typeof this.context[funcName] === 'function') {
|
|
55
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
56
|
-
args[_key - 1] = arguments[_key];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
return this.context[funcName](...args);
|
|
60
56
|
}
|
|
61
57
|
|
|
@@ -63,8 +59,6 @@ export default class NavItem extends BaseComponent {
|
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
get adapter() {
|
|
66
|
-
var _this = this;
|
|
67
|
-
|
|
68
62
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
69
63
|
cloneDeep,
|
|
70
64
|
updateTooltipShow: tooltipShow => this.setState({
|
|
@@ -74,29 +68,11 @@ export default class NavItem extends BaseComponent {
|
|
|
74
68
|
updateGlobalSelectedKeys: keys => this._invokeContextFunc('updateSelectedKeys', [...keys]),
|
|
75
69
|
getSelectedKeys: () => this.context && this.context.selectedKeys,
|
|
76
70
|
getSelectedKeysIsControlled: () => this.context && this.context.selectedKeysIsControlled,
|
|
77
|
-
notifyGlobalOnSelect:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return _this._invokeContextFunc('onSelect', ...args);
|
|
83
|
-
},
|
|
84
|
-
notifyGlobalOnClick: function () {
|
|
85
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
86
|
-
args[_key3] = arguments[_key3];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return _this._invokeContextFunc('onClick', ...args);
|
|
90
|
-
},
|
|
91
|
-
notifyClick: function () {
|
|
92
|
-
return _this.props.onClick(...arguments);
|
|
93
|
-
},
|
|
94
|
-
notifyMouseEnter: function () {
|
|
95
|
-
return _this.props.onMouseEnter(...arguments);
|
|
96
|
-
},
|
|
97
|
-
notifyMouseLeave: function () {
|
|
98
|
-
return _this.props.onMouseLeave(...arguments);
|
|
99
|
-
},
|
|
71
|
+
notifyGlobalOnSelect: (...args) => this._invokeContextFunc('onSelect', ...args),
|
|
72
|
+
notifyGlobalOnClick: (...args) => this._invokeContextFunc('onClick', ...args),
|
|
73
|
+
notifyClick: (...args) => this.props.onClick(...args),
|
|
74
|
+
notifyMouseEnter: (...args) => this.props.onMouseEnter(...args),
|
|
75
|
+
notifyMouseLeave: (...args) => this.props.onMouseLeave(...args),
|
|
100
76
|
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed) || false,
|
|
101
77
|
getSelected: () => {
|
|
102
78
|
var _context;
|
|
@@ -106,11 +82,9 @@ export default class NavItem extends BaseComponent {
|
|
|
106
82
|
});
|
|
107
83
|
}
|
|
108
84
|
|
|
109
|
-
renderIcon(icon, pos) {
|
|
85
|
+
renderIcon(icon, pos, isToggleIcon = false) {
|
|
110
86
|
var _context2;
|
|
111
87
|
|
|
112
|
-
let isToggleIcon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
113
|
-
|
|
114
88
|
if (this.props.isSubNav) {
|
|
115
89
|
return null;
|
|
116
90
|
}
|
|
@@ -3,17 +3,15 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import { Transition } from '@douyinfe/semi-animation-react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
|
|
6
|
-
const formatStyle = function formatStyle(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
6
|
+
const formatStyle = function formatStyle({
|
|
7
|
+
rotate = 0
|
|
8
|
+
}) {
|
|
10
9
|
return {
|
|
11
10
|
transform: "rotate(".concat(Math.ceil(rotate), "deg)")
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
function OpenIconTransition() {
|
|
16
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
|
+
function OpenIconTransition(props = {}) {
|
|
17
15
|
const {
|
|
18
16
|
children,
|
|
19
17
|
isOpen
|
|
@@ -59,12 +59,8 @@ export default class SubNav extends BaseComponent {
|
|
|
59
59
|
this.foundation = new SubNavFoundation(this.adapter);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
_invokeContextFunc(funcName) {
|
|
62
|
+
_invokeContextFunc(funcName, ...args) {
|
|
63
63
|
if (funcName && this.context && typeof this.context[funcName] === 'function') {
|
|
64
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
65
|
-
args[_key - 1] = arguments[_key];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
64
|
return this.context[funcName](...args);
|
|
69
65
|
}
|
|
70
66
|
|
|
@@ -72,8 +68,6 @@ export default class SubNav extends BaseComponent {
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
get adapter() {
|
|
75
|
-
var _this = this;
|
|
76
|
-
|
|
77
71
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
78
72
|
updateIsHovered: isHovered => this.setState({
|
|
79
73
|
isHovered
|
|
@@ -82,27 +76,9 @@ export default class SubNav extends BaseComponent {
|
|
|
82
76
|
getOpenKeysIsControlled: () => this.context && this.context.openKeysIsControlled,
|
|
83
77
|
getCanUpdateOpenKeys: () => this.context && this.context.canUpdateOpenKeys,
|
|
84
78
|
updateOpen: isOpen => this._invokeContextFunc(isOpen ? 'addOpenKeys' : 'removeOpenKeys', this.props.itemKey),
|
|
85
|
-
notifyGlobalOpenChange:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return _this._invokeContextFunc('onOpenChange', ...args);
|
|
91
|
-
},
|
|
92
|
-
notifyGlobalOnSelect: function () {
|
|
93
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
94
|
-
args[_key3] = arguments[_key3];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return _this._invokeContextFunc('onSelect', ...args);
|
|
98
|
-
},
|
|
99
|
-
notifyGlobalOnClick: function () {
|
|
100
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
101
|
-
args[_key4] = arguments[_key4];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return _this._invokeContextFunc('onClick', ...args);
|
|
105
|
-
},
|
|
79
|
+
notifyGlobalOpenChange: (...args) => this._invokeContextFunc('onOpenChange', ...args),
|
|
80
|
+
notifyGlobalOnSelect: (...args) => this._invokeContextFunc('onSelect', ...args),
|
|
81
|
+
notifyGlobalOnClick: (...args) => this._invokeContextFunc('onClick', ...args),
|
|
106
82
|
getIsSelected: itemKey => {
|
|
107
83
|
var _context;
|
|
108
84
|
|
|
@@ -116,11 +92,9 @@ export default class SubNav extends BaseComponent {
|
|
|
116
92
|
});
|
|
117
93
|
}
|
|
118
94
|
|
|
119
|
-
renderIcon(icon, pos, withTransition) {
|
|
95
|
+
renderIcon(icon, pos, withTransition, isToggleIcon = false, key = 0) {
|
|
120
96
|
var _context3;
|
|
121
97
|
|
|
122
|
-
let isToggleIcon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
123
|
-
let key = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
124
98
|
const {
|
|
125
99
|
prefixCls
|
|
126
100
|
} = this.context;
|
|
@@ -246,8 +220,7 @@ export default class SubNav extends BaseComponent {
|
|
|
246
220
|
return finalDom;
|
|
247
221
|
}
|
|
248
222
|
|
|
249
|
-
wrapDropdown() {
|
|
250
|
-
let elem = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
223
|
+
wrapDropdown(elem = '') {
|
|
251
224
|
let _elem = elem;
|
|
252
225
|
const {
|
|
253
226
|
children,
|
|
@@ -3,19 +3,17 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
const ease = 'cubicBezier(.25,.1,.25,1)';
|
|
5
5
|
|
|
6
|
-
const formatStyle = function formatStyle(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
6
|
+
const formatStyle = function formatStyle({
|
|
7
|
+
maxHeight,
|
|
8
|
+
opacity
|
|
9
|
+
}) {
|
|
11
10
|
return {
|
|
12
11
|
maxHeight,
|
|
13
12
|
opacity
|
|
14
13
|
};
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
function SubNavTransition() {
|
|
18
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
+
function SubNavTransition(props = {}) {
|
|
19
17
|
const {
|
|
20
18
|
children,
|
|
21
19
|
isCollapsed,
|
|
@@ -23,13 +23,9 @@ import LocaleConsumer from '../locale/localeConsumer';
|
|
|
23
23
|
import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
|
|
24
24
|
|
|
25
25
|
function createAddKeysFn(context, keyName) {
|
|
26
|
-
return function addKeys() {
|
|
26
|
+
return function addKeys(...keys) {
|
|
27
27
|
const handleKeys = new _Set(context.state[keyName]);
|
|
28
28
|
|
|
29
|
-
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
-
keys[_key] = arguments[_key];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
29
|
_forEachInstanceProperty(keys).call(keys, key => key && handleKeys.add(key));
|
|
34
30
|
|
|
35
31
|
context.setState({
|
|
@@ -39,13 +35,9 @@ function createAddKeysFn(context, keyName) {
|
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
function createRemoveKeysFn(context, keyName) {
|
|
42
|
-
return function removeKeys() {
|
|
38
|
+
return function removeKeys(...keys) {
|
|
43
39
|
const handleKeys = new _Set(context.state[keyName]);
|
|
44
40
|
|
|
45
|
-
for (var _len2 = arguments.length, keys = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
46
|
-
keys[_key2] = arguments[_key2];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
41
|
_forEachInstanceProperty(keys).call(keys, key => key && handleKeys.delete(key));
|
|
50
42
|
|
|
51
43
|
context.setState({
|
|
@@ -128,21 +120,13 @@ class Nav extends BaseComponent {
|
|
|
128
120
|
}
|
|
129
121
|
|
|
130
122
|
get adapter() {
|
|
131
|
-
var _this = this;
|
|
132
|
-
|
|
133
123
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
134
|
-
notifySelect:
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
notifyOpenChange: function () {
|
|
138
|
-
return _this.props.onOpenChange(...arguments);
|
|
139
|
-
},
|
|
124
|
+
notifySelect: (...args) => this.props.onSelect(...args),
|
|
125
|
+
notifyOpenChange: (...args) => this.props.onOpenChange(...args),
|
|
140
126
|
setIsCollapsed: isCollapsed => this.setState({
|
|
141
127
|
isCollapsed
|
|
142
128
|
}),
|
|
143
|
-
notifyCollapseChange:
|
|
144
|
-
return _this.props.onCollapseChange(...arguments);
|
|
145
|
-
},
|
|
129
|
+
notifyCollapseChange: (...args) => this.props.onCollapseChange(...args),
|
|
146
130
|
updateItems: items => this.setState({
|
|
147
131
|
items: [...items]
|
|
148
132
|
}),
|
|
@@ -172,9 +156,7 @@ class Nav extends BaseComponent {
|
|
|
172
156
|
*/
|
|
173
157
|
|
|
174
158
|
|
|
175
|
-
renderItems() {
|
|
176
|
-
let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
177
|
-
let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
159
|
+
renderItems(items = [], level = 0) {
|
|
178
160
|
const finalDom = /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(items).call(items, (item, idx) => {
|
|
179
161
|
if (_Array$isArray(item.items) && item.items.length) {
|
|
180
162
|
return /*#__PURE__*/React.createElement(SubNav, _Object$assign({
|
|
@@ -2,8 +2,7 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"
|
|
|
2
2
|
// @ts-ignore Currently there is no types for semi-animation-react
|
|
3
3
|
import { Transition } from '@douyinfe/semi-animation-react';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export default function NoticeTransition() {
|
|
6
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5
|
+
export default function NoticeTransition(props = {}) {
|
|
7
6
|
let {
|
|
8
7
|
motion = {}
|
|
9
8
|
} = props;
|
|
@@ -11,11 +10,10 @@ export default function NoticeTransition() {
|
|
|
11
10
|
position = 'topRight'
|
|
12
11
|
} = props;
|
|
13
12
|
|
|
14
|
-
const formatStyle = function formatStyle(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
13
|
+
const formatStyle = function formatStyle({
|
|
14
|
+
translate,
|
|
15
|
+
opacity
|
|
16
|
+
}) {
|
|
19
17
|
let transform = "translateX(".concat(translate, "%)");
|
|
20
18
|
|
|
21
19
|
if (position && typeof position === 'string') {
|