@douyinfe/semi-ui 2.19.0-alpha.1 → 2.19.0-alpha.4
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/checkbox/_story/checkbox.stories.js +2 -0
- package/checkbox/checkbox.tsx +22 -19
- package/checkbox/checkboxGroup.tsx +0 -2
- package/dist/css/semi.css +16 -10
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +144 -78
- 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/form/baseForm.tsx +0 -1
- package/lib/cjs/checkbox/checkbox.js +18 -10
- package/lib/cjs/checkbox/checkboxGroup.js +2 -4
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +0 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popconfirm/index.js +49 -31
- package/lib/cjs/radio/radioGroup.js +2 -4
- package/lib/cjs/table/ColumnFilter.js +4 -2
- package/lib/cjs/table/ColumnSorter.d.ts +1 -0
- package/lib/cjs/table/ColumnSorter.js +9 -6
- package/lib/cjs/table/Table.js +11 -4
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/checkbox/checkbox.js +18 -10
- package/lib/es/checkbox/checkboxGroup.js +2 -4
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popconfirm/index.js +49 -31
- package/lib/es/radio/radioGroup.js +2 -4
- package/lib/es/table/ColumnFilter.js +4 -2
- package/lib/es/table/ColumnSorter.d.ts +1 -0
- package/lib/es/table/ColumnSorter.js +9 -6
- package/lib/es/table/Table.js +10 -4
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/transfer/index.js +7 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +37 -1
- package/popconfirm/index.tsx +14 -6
- package/radio/radioGroup.tsx +0 -2
- package/table/ColumnFilter.tsx +2 -1
- package/table/ColumnSorter.tsx +16 -10
- package/table/Table.tsx +7 -4
- package/tabs/TabBar.tsx +7 -1
- package/transfer/index.tsx +7 -2
- package/webpack.config.js +3 -1
package/form/baseForm.tsx
CHANGED
|
@@ -211,15 +211,23 @@ class Checkbox extends _baseComponent.default {
|
|
|
211
211
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
212
212
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
213
213
|
|
|
214
|
-
const renderContent = () =>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"
|
|
222
|
-
|
|
214
|
+
const renderContent = () => {
|
|
215
|
+
if (!children && !extra) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "".concat(prefix, "-content")
|
|
221
|
+
}, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
222
|
+
id: addonId,
|
|
223
|
+
className: "".concat(prefix, "-addon"),
|
|
224
|
+
"x-semi-prop": xSemiPropChildren
|
|
225
|
+
}, children) : null, extra ? /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
+
id: extraId,
|
|
227
|
+
className: extraCls,
|
|
228
|
+
"x-semi-prop": "extra"
|
|
229
|
+
}, extra) : null);
|
|
230
|
+
};
|
|
223
231
|
|
|
224
232
|
return (
|
|
225
233
|
/*#__PURE__*/
|
|
@@ -245,7 +253,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
245
253
|
focusInner: focusVisible && !focusOuter,
|
|
246
254
|
onInputFocus: this.handleFocusVisible,
|
|
247
255
|
onInputBlur: this.handleBlur
|
|
248
|
-
})),
|
|
256
|
+
})), renderContent())
|
|
249
257
|
);
|
|
250
258
|
}
|
|
251
259
|
|
|
@@ -118,8 +118,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
118
118
|
key: index,
|
|
119
119
|
disabled: this.props.disabled,
|
|
120
120
|
value: option,
|
|
121
|
-
prefixCls: prefixCls
|
|
122
|
-
type: type
|
|
121
|
+
prefixCls: prefixCls
|
|
123
122
|
}, option);
|
|
124
123
|
} else {
|
|
125
124
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -131,8 +130,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
131
130
|
extra: option.extra,
|
|
132
131
|
className: option.className,
|
|
133
132
|
style: option.style,
|
|
134
|
-
onChange: option.onChange
|
|
135
|
-
type: type
|
|
133
|
+
onChange: option.onChange
|
|
136
134
|
}, option.label);
|
|
137
135
|
}
|
|
138
136
|
});
|
|
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
preventScroll?: boolean;
|
|
129
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
130
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
131
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
132
132
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/baseForm.js
CHANGED
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
76
|
preventScroll?: boolean;
|
|
77
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
77
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
78
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
79
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
80
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -27,13 +27,15 @@ export interface PopconfirmProps extends PopoverProps {
|
|
|
27
27
|
zIndex?: number;
|
|
28
28
|
trigger?: Trigger;
|
|
29
29
|
position?: Position;
|
|
30
|
-
onCancel?: (e: React.MouseEvent) => void;
|
|
31
|
-
onConfirm?: (e: React.MouseEvent) => void;
|
|
30
|
+
onCancel?: (e: React.MouseEvent) => Promise<any> | void;
|
|
31
|
+
onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
|
|
32
32
|
onVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
onClickOutSide?: (e: React.MouseEvent) => void;
|
|
34
34
|
}
|
|
35
35
|
export interface PopconfirmState {
|
|
36
36
|
visible: boolean;
|
|
37
|
+
cancelLoading: boolean;
|
|
38
|
+
confirmLoading: boolean;
|
|
37
39
|
}
|
|
38
40
|
export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
|
|
39
41
|
static contextType: React.Context<ContextValue>;
|
|
@@ -72,6 +72,8 @@ class Popconfirm extends _baseComponent.default {
|
|
|
72
72
|
this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
|
|
73
73
|
|
|
74
74
|
this.state = {
|
|
75
|
+
cancelLoading: false,
|
|
76
|
+
confirmLoading: false,
|
|
75
77
|
visible: props.defaultVisible || false
|
|
76
78
|
};
|
|
77
79
|
this.foundation = new _popconfirmFoundation.default(this.adapter);
|
|
@@ -95,6 +97,12 @@ class Popconfirm extends _baseComponent.default {
|
|
|
95
97
|
setVisible: visible => this.setState({
|
|
96
98
|
visible
|
|
97
99
|
}),
|
|
100
|
+
updateConfirmLoading: loading => this.setState({
|
|
101
|
+
confirmLoading: loading
|
|
102
|
+
}),
|
|
103
|
+
updateCancelLoading: loading => this.setState({
|
|
104
|
+
cancelLoading: loading
|
|
105
|
+
}),
|
|
98
106
|
notifyConfirm: e => this.props.onConfirm(e),
|
|
99
107
|
notifyCancel: e => this.props.onCancel(e),
|
|
100
108
|
notifyVisibleChange: visible => this.props.onVisibleChange(visible),
|
|
@@ -111,15 +119,21 @@ class Popconfirm extends _baseComponent.default {
|
|
|
111
119
|
cancelButtonProps,
|
|
112
120
|
okButtonProps
|
|
113
121
|
} = this.props;
|
|
122
|
+
const {
|
|
123
|
+
cancelLoading,
|
|
124
|
+
confirmLoading
|
|
125
|
+
} = this.state;
|
|
114
126
|
return /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
|
|
115
127
|
componentName: "Popconfirm"
|
|
116
128
|
}, (locale, localeCode) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
|
|
117
129
|
type: cancelType,
|
|
118
|
-
onClick: this.handleCancel
|
|
130
|
+
onClick: this.handleCancel,
|
|
131
|
+
loading: cancelLoading
|
|
119
132
|
}, cancelButtonProps), cancelText || (0, _get2.default)(locale, 'cancel')), /*#__PURE__*/_react.default.createElement(_button.default, (0, _assign.default)({
|
|
120
133
|
type: okType,
|
|
121
134
|
theme: "solid",
|
|
122
|
-
onClick: this.handleConfirm
|
|
135
|
+
onClick: this.handleConfirm,
|
|
136
|
+
loading: confirmLoading
|
|
123
137
|
}, okButtonProps), okText || (0, _get2.default)(locale, 'confirm'))));
|
|
124
138
|
}
|
|
125
139
|
|
|
@@ -141,35 +155,39 @@ class Popconfirm extends _baseComponent.default {
|
|
|
141
155
|
});
|
|
142
156
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
143
157
|
const showContent = content !== null || typeof content !== 'undefined';
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
158
|
+
return (
|
|
159
|
+
/*#__PURE__*/
|
|
160
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
161
|
+
_react.default.createElement("div", {
|
|
162
|
+
className: popCardCls,
|
|
163
|
+
onClick: this.stopImmediatePropagation,
|
|
164
|
+
style: style
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: "".concat(prefixCls, "-inner")
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: "".concat(prefixCls, "-header")
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
170
|
+
className: "".concat(prefixCls, "-header-icon"),
|
|
171
|
+
"x-semi-prop": "icon"
|
|
172
|
+
}, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
className: "".concat(prefixCls, "-header-body")
|
|
174
|
+
}, showTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
className: "".concat(prefixCls, "-header-title"),
|
|
176
|
+
"x-semi-prop": "title"
|
|
177
|
+
}, title) : null, showContent ? /*#__PURE__*/_react.default.createElement("div", {
|
|
178
|
+
className: "".concat(prefixCls, "-header-content"),
|
|
179
|
+
"x-semi-prop": "content"
|
|
180
|
+
}, content) : null), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
181
|
+
className: "".concat(prefixCls, "-btn-close"),
|
|
182
|
+
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
|
183
|
+
size: "small",
|
|
184
|
+
theme: 'borderless',
|
|
185
|
+
type: cancelType,
|
|
186
|
+
onClick: this.handleCancel
|
|
187
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
+
className: "".concat(prefixCls, "-footer")
|
|
189
|
+
}, this.renderControls())))
|
|
190
|
+
);
|
|
173
191
|
}
|
|
174
192
|
|
|
175
193
|
render() {
|
|
@@ -124,8 +124,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
124
124
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
125
125
|
key: index,
|
|
126
126
|
disabled: this.props.disabled,
|
|
127
|
-
value: option
|
|
128
|
-
type: type
|
|
127
|
+
value: option
|
|
129
128
|
}, option);
|
|
130
129
|
} else {
|
|
131
130
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
@@ -134,8 +133,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
134
133
|
value: option.value,
|
|
135
134
|
extra: option.extra,
|
|
136
135
|
className: option.className,
|
|
137
|
-
style: option.style
|
|
138
|
-
type: type
|
|
136
|
+
style: option.style
|
|
139
137
|
}, option.label);
|
|
140
138
|
}
|
|
141
139
|
});
|
|
@@ -179,12 +179,14 @@ function ColumnFilter() {
|
|
|
179
179
|
} else {
|
|
180
180
|
iconElem = /*#__PURE__*/_react.default.createElement("div", {
|
|
181
181
|
className: finalCls
|
|
182
|
-
},
|
|
182
|
+
}, '\u200b'
|
|
183
|
+
/* ZWSP(zero-width space) */
|
|
184
|
+
, /*#__PURE__*/_react.default.createElement(_semiIcons.IconFilter, {
|
|
183
185
|
role: "button",
|
|
184
186
|
"aria-label": "Filter data with this column",
|
|
185
187
|
"aria-haspopup": "listbox",
|
|
186
188
|
tabIndex: -1,
|
|
187
|
-
size: "
|
|
189
|
+
size: "default"
|
|
188
190
|
}));
|
|
189
191
|
}
|
|
190
192
|
|
|
@@ -7,6 +7,7 @@ export interface ColumnSorterProps {
|
|
|
7
7
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
sortOrder?: SortOrder;
|
|
10
|
+
title?: React.ReactNode;
|
|
10
11
|
}
|
|
11
12
|
export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
12
13
|
static propTypes: {
|
|
@@ -40,9 +40,10 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
40
40
|
prefixCls,
|
|
41
41
|
onClick,
|
|
42
42
|
sortOrder,
|
|
43
|
-
style
|
|
43
|
+
style,
|
|
44
|
+
title
|
|
44
45
|
} = this.props;
|
|
45
|
-
const iconBtnSize = '
|
|
46
|
+
const iconBtnSize = 'default';
|
|
46
47
|
const upCls = (0, _classnames.default)("".concat(prefixCls, "-column-sorter-up"), {
|
|
47
48
|
on: sortOrder === _constants.strings.SORT_DIRECTIONS[0]
|
|
48
49
|
});
|
|
@@ -61,11 +62,13 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
61
62
|
role: 'button'
|
|
62
63
|
}, ariaProps, {
|
|
63
64
|
tabIndex: -1,
|
|
64
|
-
|
|
65
|
-
className: "".concat(prefixCls, "-column-sorter"),
|
|
65
|
+
className: "".concat(prefixCls, "-column-sorter-wrapper"),
|
|
66
66
|
onClick: onClick,
|
|
67
67
|
onKeyPress: e => (0, _isEnterPress.default)(e) && onClick(e)
|
|
68
|
-
}), /*#__PURE__*/_react.default.createElement("
|
|
68
|
+
}), title, /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
style: style,
|
|
70
|
+
className: "".concat(prefixCls, "-column-sorter")
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
69
72
|
className: "".concat(upCls)
|
|
70
73
|
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconCaretup, {
|
|
71
74
|
size: iconBtnSize
|
|
@@ -73,7 +76,7 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
73
76
|
className: "".concat(downCls)
|
|
74
77
|
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconCaretdown, {
|
|
75
78
|
size: iconBtnSize
|
|
76
|
-
})));
|
|
79
|
+
}))));
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
}
|
package/lib/cjs/table/Table.js
CHANGED
|
@@ -555,15 +555,24 @@ class Table extends _baseComponent.default {
|
|
|
555
555
|
const defaultSortOrder = (0, _get2.default)(curQuery, 'defaultSortOrder', false);
|
|
556
556
|
const sortOrder = _this.foundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
557
557
|
|
|
558
|
+
const TitleNode = typeof rawTitle !== 'function' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
559
|
+
key: _constants.strings.DEFAULT_KEY_COLUMN_TITLE
|
|
560
|
+
}, rawTitle);
|
|
561
|
+
|
|
558
562
|
if (typeof column.sorter === 'function' || column.sorter === true) {
|
|
563
|
+
// In order to increase the click hot area of sorting, when sorting is required & useFullRender is false,
|
|
564
|
+
// both the title and sorting areas are used as the click hot area for sorting。
|
|
559
565
|
const sorter = /*#__PURE__*/_react.default.createElement(_ColumnSorter.default, {
|
|
560
566
|
key: _constants.strings.DEFAULT_KEY_COLUMN_SORTER,
|
|
561
567
|
sortOrder: sortOrder,
|
|
562
|
-
onClick: e => _this.foundation.handleSort(column, e)
|
|
568
|
+
onClick: e => _this.foundation.handleSort(column, e),
|
|
569
|
+
title: TitleNode
|
|
563
570
|
});
|
|
564
571
|
|
|
565
572
|
useFullRender && (titleMap.sorter = sorter);
|
|
566
573
|
titleArr.push(sorter);
|
|
574
|
+
} else {
|
|
575
|
+
titleArr.push(TitleNode);
|
|
567
576
|
}
|
|
568
577
|
|
|
569
578
|
const stateFilteredValue = (0, _get2.default)(curQuery, 'filteredValue');
|
|
@@ -583,9 +592,7 @@ class Table extends _baseComponent.default {
|
|
|
583
592
|
titleArr.push(filter);
|
|
584
593
|
}
|
|
585
594
|
|
|
586
|
-
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr
|
|
587
|
-
key: _constants.strings.DEFAULT_KEY_COLUMN_TITLE
|
|
588
|
-
}, rawTitle)) && titleArr;
|
|
595
|
+
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr;
|
|
589
596
|
column = (0, _assign.default)((0, _assign.default)({}, column), {
|
|
590
597
|
title: newTitle
|
|
591
598
|
});
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -151,7 +151,11 @@ class TabBar extends _react.default.Component {
|
|
|
151
151
|
var _context5, _context6;
|
|
152
152
|
|
|
153
153
|
if ((0, _isEmpty2.default)(items)) {
|
|
154
|
-
return
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
155
|
+
disabled: true,
|
|
156
|
+
icon: icon,
|
|
157
|
+
theme: "borderless"
|
|
158
|
+
});
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
const {
|
|
@@ -322,7 +322,8 @@ class Transfer extends _baseComponent.default {
|
|
|
322
322
|
const noMatch = inSearchMode && searchResult.size === 0;
|
|
323
323
|
const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
|
|
324
324
|
const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
|
|
325
|
-
const
|
|
325
|
+
const emptyDataCom = this.renderEmpty('left', emptyLeft);
|
|
326
|
+
const emptySearchCom = this.renderEmpty('left', emptySearch);
|
|
326
327
|
|
|
327
328
|
const loadingCom = /*#__PURE__*/_react.default.createElement(_spin.default, null);
|
|
328
329
|
|
|
@@ -334,7 +335,11 @@ class Transfer extends _baseComponent.default {
|
|
|
334
335
|
break;
|
|
335
336
|
|
|
336
337
|
case noMatch:
|
|
337
|
-
content =
|
|
338
|
+
content = emptySearchCom;
|
|
339
|
+
break;
|
|
340
|
+
|
|
341
|
+
case data.length === 0:
|
|
342
|
+
content = emptyDataCom;
|
|
338
343
|
break;
|
|
339
344
|
|
|
340
345
|
case type === _constants.strings.TYPE_TREE_TO_LIST:
|
|
@@ -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<1 | 2 | 3 | 4 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -187,15 +187,23 @@ class Checkbox extends BaseComponent {
|
|
|
187
187
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
188
188
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
189
189
|
|
|
190
|
-
const renderContent = () =>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
190
|
+
const renderContent = () => {
|
|
191
|
+
if (!children && !extra) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "".concat(prefix, "-content")
|
|
197
|
+
}, children ? /*#__PURE__*/React.createElement("span", {
|
|
198
|
+
id: addonId,
|
|
199
|
+
className: "".concat(prefix, "-addon"),
|
|
200
|
+
"x-semi-prop": xSemiPropChildren
|
|
201
|
+
}, children) : null, extra ? /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
id: extraId,
|
|
203
|
+
className: extraCls,
|
|
204
|
+
"x-semi-prop": "extra"
|
|
205
|
+
}, extra) : null);
|
|
206
|
+
};
|
|
199
207
|
|
|
200
208
|
return (
|
|
201
209
|
/*#__PURE__*/
|
|
@@ -221,7 +229,7 @@ class Checkbox extends BaseComponent {
|
|
|
221
229
|
focusInner: focusVisible && !focusOuter,
|
|
222
230
|
onInputFocus: this.handleFocusVisible,
|
|
223
231
|
onInputBlur: this.handleBlur
|
|
224
|
-
})),
|
|
232
|
+
})), renderContent())
|
|
225
233
|
);
|
|
226
234
|
}
|
|
227
235
|
|
|
@@ -96,8 +96,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
96
96
|
key: index,
|
|
97
97
|
disabled: this.props.disabled,
|
|
98
98
|
value: option,
|
|
99
|
-
prefixCls: prefixCls
|
|
100
|
-
type: type
|
|
99
|
+
prefixCls: prefixCls
|
|
101
100
|
}, option);
|
|
102
101
|
} else {
|
|
103
102
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -109,8 +108,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
109
108
|
extra: option.extra,
|
|
110
109
|
className: option.className,
|
|
111
110
|
style: option.style,
|
|
112
|
-
onChange: option.onChange
|
|
113
|
-
type: type
|
|
111
|
+
onChange: option.onChange
|
|
114
112
|
}, option.label);
|
|
115
113
|
}
|
|
116
114
|
});
|
|
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
preventScroll?: boolean;
|
|
129
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
130
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
131
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
132
132
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/baseForm.js
CHANGED
package/lib/es/form/field.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
76
|
preventScroll?: boolean;
|
|
77
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
77
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
78
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
79
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
80
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -27,13 +27,15 @@ export interface PopconfirmProps extends PopoverProps {
|
|
|
27
27
|
zIndex?: number;
|
|
28
28
|
trigger?: Trigger;
|
|
29
29
|
position?: Position;
|
|
30
|
-
onCancel?: (e: React.MouseEvent) => void;
|
|
31
|
-
onConfirm?: (e: React.MouseEvent) => void;
|
|
30
|
+
onCancel?: (e: React.MouseEvent) => Promise<any> | void;
|
|
31
|
+
onConfirm?: (e: React.MouseEvent) => Promise<any> | void;
|
|
32
32
|
onVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
onClickOutSide?: (e: React.MouseEvent) => void;
|
|
34
34
|
}
|
|
35
35
|
export interface PopconfirmState {
|
|
36
36
|
visible: boolean;
|
|
37
|
+
cancelLoading: boolean;
|
|
38
|
+
confirmLoading: boolean;
|
|
37
39
|
}
|
|
38
40
|
export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
|
|
39
41
|
static contextType: React.Context<ContextValue>;
|