@douyinfe/semi-ui 2.19.0-alpha.2 → 2.19.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/checkbox/checkbox.tsx +7 -7
- package/checkbox/checkboxGroup.tsx +2 -11
- package/dist/css/semi.css +16 -10
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +141 -119
- 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 +8 -2
- package/lib/cjs/checkbox/checkboxGroup.js +8 -31
- 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 +7 -34
- 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 +8 -2
- package/lib/es/checkbox/checkboxGroup.js +6 -27
- 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 +5 -30
- 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 +4 -15
- 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,7 +211,13 @@ 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
|
-
|
|
214
|
+
if (!children && !extra) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const renderContent = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: "".concat(prefix, "-content")
|
|
220
|
+
}, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
215
221
|
id: addonId,
|
|
216
222
|
className: "".concat(prefix, "-addon"),
|
|
217
223
|
"x-semi-prop": xSemiPropChildren
|
|
@@ -245,7 +251,7 @@ class Checkbox extends _baseComponent.default {
|
|
|
245
251
|
focusInner: focusVisible && !focusOuter,
|
|
246
252
|
onInputFocus: this.handleFocusVisible,
|
|
247
253
|
onInputBlur: this.handleBlur
|
|
248
|
-
})),
|
|
254
|
+
})), renderContent())
|
|
249
255
|
);
|
|
250
256
|
}
|
|
251
257
|
|
|
@@ -20,14 +20,8 @@ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stab
|
|
|
20
20
|
|
|
21
21
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
22
|
|
|
23
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
24
|
-
|
|
25
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
26
|
-
|
|
27
23
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
28
24
|
|
|
29
|
-
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
30
|
-
|
|
31
25
|
var _react = _interopRequireDefault(require("react"));
|
|
32
26
|
|
|
33
27
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -40,7 +34,7 @@ var _checkboxGroupFoundation = _interopRequireDefault(require("@douyinfe/semi-fo
|
|
|
40
34
|
|
|
41
35
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
42
36
|
|
|
43
|
-
var
|
|
37
|
+
var _context7 = require("./context");
|
|
44
38
|
|
|
45
39
|
var _checkbox = _interopRequireDefault(require("./checkbox"));
|
|
46
40
|
|
|
@@ -124,8 +118,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
124
118
|
key: index,
|
|
125
119
|
disabled: this.props.disabled,
|
|
126
120
|
value: option,
|
|
127
|
-
prefixCls: prefixCls
|
|
128
|
-
type: type
|
|
121
|
+
prefixCls: prefixCls
|
|
129
122
|
}, option);
|
|
130
123
|
} else {
|
|
131
124
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -137,33 +130,17 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
137
130
|
extra: option.extra,
|
|
138
131
|
className: option.className,
|
|
139
132
|
style: option.style,
|
|
140
|
-
onChange: option.onChange
|
|
141
|
-
type: type
|
|
133
|
+
onChange: option.onChange
|
|
142
134
|
}, option.label);
|
|
143
135
|
}
|
|
144
136
|
});
|
|
145
137
|
} else if (children) {
|
|
146
138
|
var _context6;
|
|
147
139
|
|
|
148
|
-
inner = (0, _map.default)(_context6 = _react.default.Children.toArray(children)).call(_context6, (itm, index) => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
key: index,
|
|
153
|
-
role: 'listitem'
|
|
154
|
-
};
|
|
155
|
-
const isCheckboxComp = (0, _some.default)(_context7 = ['Checkbox', 'CheckboxWithGroup']).call(_context7, comp => {
|
|
156
|
-
var _context8;
|
|
157
|
-
|
|
158
|
-
return (0, _includes.default)(_context8 = [(0, _get2.default)(itm, 'type.displayName'), (0, _get2.default)(itm, 'type.name')]).call(_context8, comp);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
if (isCheckboxComp) {
|
|
162
|
-
props.type = type;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return /*#__PURE__*/_react.default.cloneElement(itm, props);
|
|
166
|
-
});
|
|
140
|
+
inner = (0, _map.default)(_context6 = _react.default.Children.toArray(children)).call(_context6, (itm, index) => /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
141
|
+
key: index,
|
|
142
|
+
role: 'listitem'
|
|
143
|
+
}));
|
|
167
144
|
}
|
|
168
145
|
|
|
169
146
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -174,7 +151,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
174
151
|
style: style,
|
|
175
152
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
176
153
|
"aria-describedby": this.props['aria-describedby']
|
|
177
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(_context7.Context.Provider, {
|
|
178
155
|
value: {
|
|
179
156
|
checkboxGroup: {
|
|
180
157
|
onChange: this.onChange,
|
|
@@ -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, "getPopupContainer" | "stopPropagation" | "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, "getPopupContainer" | "stopPropagation" | "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() {
|
|
@@ -16,14 +16,8 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
16
16
|
|
|
17
17
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
18
18
|
|
|
19
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
20
|
-
|
|
21
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
22
|
-
|
|
23
19
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
24
20
|
|
|
25
|
-
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
26
|
-
|
|
27
21
|
var _react = _interopRequireDefault(require("react"));
|
|
28
22
|
|
|
29
23
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -38,7 +32,7 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
38
32
|
|
|
39
33
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
40
34
|
|
|
41
|
-
var
|
|
35
|
+
var _context6 = _interopRequireDefault(require("./context"));
|
|
42
36
|
|
|
43
37
|
class RadioGroup extends _baseComponent.default {
|
|
44
38
|
constructor(props) {
|
|
@@ -130,8 +124,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
130
124
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
131
125
|
key: index,
|
|
132
126
|
disabled: this.props.disabled,
|
|
133
|
-
value: option
|
|
134
|
-
type: type
|
|
127
|
+
value: option
|
|
135
128
|
}, option);
|
|
136
129
|
} else {
|
|
137
130
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
@@ -140,36 +133,16 @@ class RadioGroup extends _baseComponent.default {
|
|
|
140
133
|
value: option.value,
|
|
141
134
|
extra: option.extra,
|
|
142
135
|
className: option.className,
|
|
143
|
-
style: option.style
|
|
144
|
-
type: type
|
|
136
|
+
style: option.style
|
|
145
137
|
}, option.label);
|
|
146
138
|
}
|
|
147
139
|
});
|
|
148
140
|
} else if (children) {
|
|
149
141
|
var _context5;
|
|
150
142
|
|
|
151
|
-
inner = (0, _map.default)(_context5 = _react.default.Children).call(_context5, children, (itm, index) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const props = {
|
|
156
|
-
key: index
|
|
157
|
-
};
|
|
158
|
-
const isRadioComp = (0, _some.default)(_context6 = ['Radio', 'RadioWithGroup']).call(_context6, comp => {
|
|
159
|
-
var _context7;
|
|
160
|
-
|
|
161
|
-
return (0, _includes.default)(_context7 = [(0, _get2.default)(itm, 'type.displayName'), (0, _get2.default)(itm, 'type.name')]).call(_context7, comp);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
if (isRadioComp) {
|
|
165
|
-
props.type = type;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return /*#__PURE__*/_react.default.cloneElement(itm, props);
|
|
169
|
-
} else {
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
143
|
+
inner = (0, _map.default)(_context5 = _react.default.Children).call(_context5, children, (itm, index) => /*#__PURE__*/_react.default.isValidElement(itm) ? /*#__PURE__*/_react.default.cloneElement(itm, {
|
|
144
|
+
key: index
|
|
145
|
+
}) : null);
|
|
173
146
|
}
|
|
174
147
|
|
|
175
148
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -182,7 +155,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
182
155
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
183
156
|
"aria-describedby": this.props['aria-describedby'],
|
|
184
157
|
"aria-required": this.props['aria-required']
|
|
185
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_context6.default.Provider, {
|
|
186
159
|
value: {
|
|
187
160
|
radioGroup: {
|
|
188
161
|
onChange: this.onChange,
|
|
@@ -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<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -187,7 +187,13 @@ 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
|
-
|
|
190
|
+
if (!children && !extra) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const renderContent = () => /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: "".concat(prefix, "-content")
|
|
196
|
+
}, children ? /*#__PURE__*/React.createElement("span", {
|
|
191
197
|
id: addonId,
|
|
192
198
|
className: "".concat(prefix, "-addon"),
|
|
193
199
|
"x-semi-prop": xSemiPropChildren
|
|
@@ -221,7 +227,7 @@ class Checkbox extends BaseComponent {
|
|
|
221
227
|
focusInner: focusVisible && !focusOuter,
|
|
222
228
|
onInputFocus: this.handleFocusVisible,
|
|
223
229
|
onInputBlur: this.handleBlur
|
|
224
|
-
})),
|
|
230
|
+
})), renderContent())
|
|
225
231
|
);
|
|
226
232
|
}
|
|
227
233
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
|
-
import _get from "lodash/get";
|
|
3
2
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
4
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
5
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
5
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
7
6
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
8
|
-
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
9
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
10
7
|
|
|
11
8
|
/* eslint-disable max-len */
|
|
12
9
|
import React from 'react';
|
|
@@ -99,8 +96,7 @@ class CheckboxGroup extends BaseComponent {
|
|
|
99
96
|
key: index,
|
|
100
97
|
disabled: this.props.disabled,
|
|
101
98
|
value: option,
|
|
102
|
-
prefixCls: prefixCls
|
|
103
|
-
type: type
|
|
99
|
+
prefixCls: prefixCls
|
|
104
100
|
}, option);
|
|
105
101
|
} else {
|
|
106
102
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -112,34 +108,17 @@ class CheckboxGroup extends BaseComponent {
|
|
|
112
108
|
extra: option.extra,
|
|
113
109
|
className: option.className,
|
|
114
110
|
style: option.style,
|
|
115
|
-
onChange: option.onChange
|
|
116
|
-
type: type
|
|
111
|
+
onChange: option.onChange
|
|
117
112
|
}, option.label);
|
|
118
113
|
}
|
|
119
114
|
});
|
|
120
115
|
} else if (children) {
|
|
121
116
|
var _context6;
|
|
122
117
|
|
|
123
|
-
inner = _mapInstanceProperty(_context6 = React.Children.toArray(children)).call(_context6, (itm, index) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
key: index,
|
|
128
|
-
role: 'listitem'
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const isCheckboxComp = _someInstanceProperty(_context7 = ['Checkbox', 'CheckboxWithGroup']).call(_context7, comp => {
|
|
132
|
-
var _context8;
|
|
133
|
-
|
|
134
|
-
return _includesInstanceProperty(_context8 = [_get(itm, 'type.displayName'), _get(itm, 'type.name')]).call(_context8, comp);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
if (isCheckboxComp) {
|
|
138
|
-
props.type = type;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return /*#__PURE__*/React.cloneElement(itm, props);
|
|
142
|
-
});
|
|
118
|
+
inner = _mapInstanceProperty(_context6 = React.Children.toArray(children)).call(_context6, (itm, index) => /*#__PURE__*/React.cloneElement(itm, {
|
|
119
|
+
key: index,
|
|
120
|
+
role: 'listitem'
|
|
121
|
+
}));
|
|
143
122
|
}
|
|
144
123
|
|
|
145
124
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -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, "getPopupContainer" | "stopPropagation" | "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, "getPopupContainer" | "stopPropagation" | "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>>;
|