@douyinfe/semi-ui 2.19.0-alpha.6 → 2.19.0-alpha.7
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/button/buttonGroup.tsx +38 -4
- package/button/index.tsx +2 -0
- package/dist/css/semi.css +40 -3
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +150 -51
- 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/button/buttonGroup.d.ts +1 -0
- package/lib/cjs/button/buttonGroup.js +52 -3
- package/lib/cjs/button/index.d.ts +1 -0
- package/lib/cjs/button/index.js +1 -0
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +0 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popconfirm/index.js +49 -31
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -0
- package/lib/es/button/buttonGroup.js +50 -3
- package/lib/es/button/index.d.ts +1 -0
- package/lib/es/button/index.js +1 -0
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popconfirm/index.js +49 -31
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/transfer/index.js +7 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +37 -1
- package/popconfirm/index.tsx +14 -6
- package/tabs/TabBar.tsx +7 -1
- package/transfer/index.tsx +7 -2
package/dist/umd/semi-ui.js
CHANGED
|
@@ -39138,6 +39138,7 @@ class button_Button extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
39138
39138
|
}
|
|
39139
39139
|
|
|
39140
39140
|
button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.propTypes), iconButton_0.propTypes);
|
|
39141
|
+
button_Button.elementType = 'Button';
|
|
39141
39142
|
/* harmony default export */ var button_0 = (button_Button);
|
|
39142
39143
|
// CONCATENATED MODULE: ./button/buttonGroup.tsx
|
|
39143
39144
|
|
|
@@ -39146,6 +39147,10 @@ button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.pr
|
|
|
39146
39147
|
|
|
39147
39148
|
|
|
39148
39149
|
|
|
39150
|
+
|
|
39151
|
+
|
|
39152
|
+
|
|
39153
|
+
|
|
39149
39154
|
var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
39150
39155
|
var t = {};
|
|
39151
39156
|
|
|
@@ -39166,6 +39171,47 @@ var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
39166
39171
|
const buttonGroup_prefixCls = button_constants_cssClasses.PREFIX;
|
|
39167
39172
|
const buttonGroup_btnSizes = button_constants_strings.sizes;
|
|
39168
39173
|
class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
39174
|
+
getInnerWithLine(inner) {
|
|
39175
|
+
const innerWithLine = [];
|
|
39176
|
+
let lineCls = "".concat(buttonGroup_prefixCls, "-group-line");
|
|
39177
|
+
|
|
39178
|
+
if (inner.length > 1) {
|
|
39179
|
+
var _context;
|
|
39180
|
+
|
|
39181
|
+
for_each_default()(_context = slice_default()(inner).call(inner, 0, -1)).call(_context, item => {
|
|
39182
|
+
const isButtonType = get_default()(item, 'type.elementType') === 'Button';
|
|
39183
|
+
|
|
39184
|
+
const buttonProps = get_default()(item, 'props');
|
|
39185
|
+
|
|
39186
|
+
if (buttonProps) {
|
|
39187
|
+
var _context2, _context3;
|
|
39188
|
+
|
|
39189
|
+
const {
|
|
39190
|
+
type,
|
|
39191
|
+
theme,
|
|
39192
|
+
disabled
|
|
39193
|
+
} = buttonProps;
|
|
39194
|
+
lineCls = classnames_default()("".concat(buttonGroup_prefixCls, "-group-line"), concat_default()(_context2 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context2, theme !== null && theme !== void 0 ? theme : 'light'), concat_default()(_context3 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context3, type !== null && type !== void 0 ? type : 'primary'), {
|
|
39195
|
+
["".concat(buttonGroup_prefixCls, "-group-line-disabled")]: disabled
|
|
39196
|
+
});
|
|
39197
|
+
}
|
|
39198
|
+
|
|
39199
|
+
if (isButtonType) {
|
|
39200
|
+
innerWithLine.push(item, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
39201
|
+
className: lineCls
|
|
39202
|
+
}));
|
|
39203
|
+
} else {
|
|
39204
|
+
innerWithLine.push(item);
|
|
39205
|
+
}
|
|
39206
|
+
});
|
|
39207
|
+
|
|
39208
|
+
innerWithLine.push(slice_default()(inner).call(inner, -1));
|
|
39209
|
+
return innerWithLine;
|
|
39210
|
+
} else {
|
|
39211
|
+
return inner;
|
|
39212
|
+
}
|
|
39213
|
+
}
|
|
39214
|
+
|
|
39169
39215
|
render() {
|
|
39170
39216
|
const _a = this.props,
|
|
39171
39217
|
{
|
|
@@ -39179,25 +39225,27 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
39179
39225
|
rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
39180
39226
|
|
|
39181
39227
|
let inner;
|
|
39228
|
+
let innerWithLine = [];
|
|
39182
39229
|
const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
|
|
39183
39230
|
|
|
39184
39231
|
if (children) {
|
|
39185
|
-
var
|
|
39232
|
+
var _context4;
|
|
39186
39233
|
|
|
39187
|
-
inner = map_default()(
|
|
39234
|
+
inner = map_default()(_context4 = is_array_default()(children) ? children : [children]).call(_context4, (itm, index) => /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(itm) ? /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["cloneElement"])(itm, assign_default()(assign_default()(assign_default()({
|
|
39188
39235
|
disabled,
|
|
39189
39236
|
size,
|
|
39190
39237
|
type
|
|
39191
39238
|
}, itm.props), rest), {
|
|
39192
39239
|
key: index
|
|
39193
39240
|
})) : itm);
|
|
39241
|
+
innerWithLine = this.getInnerWithLine(inner);
|
|
39194
39242
|
}
|
|
39195
39243
|
|
|
39196
39244
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
39197
39245
|
className: cls,
|
|
39198
39246
|
role: "group",
|
|
39199
39247
|
"aria-label": ariaLabel
|
|
39200
|
-
},
|
|
39248
|
+
}, innerWithLine);
|
|
39201
39249
|
}
|
|
39202
39250
|
|
|
39203
39251
|
}
|
|
@@ -82984,24 +83032,58 @@ const popconfirm_constants_numbers = {
|
|
|
82984
83032
|
DEFAULT_Z_INDEX: 1030
|
|
82985
83033
|
};
|
|
82986
83034
|
|
|
83035
|
+
// CONCATENATED MODULE: ../semi-foundation/utils/isObject.ts
|
|
83036
|
+
function isObject_isObject(obj) {
|
|
83037
|
+
return obj !== null && typeof obj === 'object';
|
|
83038
|
+
}
|
|
83039
|
+
// CONCATENATED MODULE: ../semi-foundation/utils/isPromise.ts
|
|
83040
|
+
|
|
83041
|
+
function isPromise(value) {
|
|
83042
|
+
return isObject_isObject(value) && typeof value.then === 'function';
|
|
83043
|
+
}
|
|
82987
83044
|
// CONCATENATED MODULE: ../semi-foundation/popconfirm/popconfirmFoundation.ts
|
|
82988
83045
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
82989
83046
|
|
|
83047
|
+
|
|
82990
83048
|
class popconfirmFoundation_PopConfirmFoundation extends foundation {
|
|
82991
83049
|
init() {}
|
|
82992
83050
|
|
|
82993
83051
|
destroy() {}
|
|
82994
83052
|
|
|
82995
83053
|
handleCancel(e) {
|
|
82996
|
-
this._adapter.notifyCancel(e);
|
|
83054
|
+
const maybePromise = this._adapter.notifyCancel(e);
|
|
83055
|
+
|
|
83056
|
+
if (isPromise(maybePromise)) {
|
|
83057
|
+
this._adapter.updateCancelLoading(true);
|
|
83058
|
+
|
|
83059
|
+
maybePromise.then(result => {
|
|
83060
|
+
this.handleVisibleChange(false);
|
|
82997
83061
|
|
|
82998
|
-
|
|
83062
|
+
this._adapter.updateCancelLoading(false);
|
|
83063
|
+
}, errors => {
|
|
83064
|
+
this._adapter.updateCancelLoading(false);
|
|
83065
|
+
});
|
|
83066
|
+
} else {
|
|
83067
|
+
this.handleVisibleChange(false);
|
|
83068
|
+
}
|
|
82999
83069
|
}
|
|
83000
83070
|
|
|
83001
83071
|
handleConfirm(e) {
|
|
83002
|
-
this._adapter.notifyConfirm(e);
|
|
83072
|
+
const maybePromise = this._adapter.notifyConfirm(e);
|
|
83073
|
+
|
|
83074
|
+
if (isPromise(maybePromise)) {
|
|
83075
|
+
this._adapter.updateConfirmLoading(true);
|
|
83076
|
+
|
|
83077
|
+
maybePromise.then(result => {
|
|
83078
|
+
this._adapter.updateConfirmLoading(false);
|
|
83003
83079
|
|
|
83004
|
-
|
|
83080
|
+
this.handleVisibleChange(false);
|
|
83081
|
+
}, errors => {
|
|
83082
|
+
this._adapter.updateConfirmLoading(false);
|
|
83083
|
+
});
|
|
83084
|
+
} else {
|
|
83085
|
+
this.handleVisibleChange(false);
|
|
83086
|
+
}
|
|
83005
83087
|
}
|
|
83006
83088
|
|
|
83007
83089
|
handleClickOutSide(e) {
|
|
@@ -83067,6 +83149,8 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
83067
83149
|
this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
|
|
83068
83150
|
|
|
83069
83151
|
this.state = {
|
|
83152
|
+
cancelLoading: false,
|
|
83153
|
+
confirmLoading: false,
|
|
83070
83154
|
visible: props.defaultVisible || false
|
|
83071
83155
|
};
|
|
83072
83156
|
this.foundation = new popconfirmFoundation_PopConfirmFoundation(this.adapter);
|
|
@@ -83090,6 +83174,12 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
83090
83174
|
setVisible: visible => this.setState({
|
|
83091
83175
|
visible
|
|
83092
83176
|
}),
|
|
83177
|
+
updateConfirmLoading: loading => this.setState({
|
|
83178
|
+
confirmLoading: loading
|
|
83179
|
+
}),
|
|
83180
|
+
updateCancelLoading: loading => this.setState({
|
|
83181
|
+
cancelLoading: loading
|
|
83182
|
+
}),
|
|
83093
83183
|
notifyConfirm: e => this.props.onConfirm(e),
|
|
83094
83184
|
notifyCancel: e => this.props.onCancel(e),
|
|
83095
83185
|
notifyVisibleChange: visible => this.props.onVisibleChange(visible),
|
|
@@ -83106,15 +83196,21 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
83106
83196
|
cancelButtonProps,
|
|
83107
83197
|
okButtonProps
|
|
83108
83198
|
} = this.props;
|
|
83199
|
+
const {
|
|
83200
|
+
cancelLoading,
|
|
83201
|
+
confirmLoading
|
|
83202
|
+
} = this.state;
|
|
83109
83203
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
83110
83204
|
componentName: "Popconfirm"
|
|
83111
83205
|
}, (locale, localeCode) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, assign_default()({
|
|
83112
83206
|
type: cancelType,
|
|
83113
|
-
onClick: this.handleCancel
|
|
83207
|
+
onClick: this.handleCancel,
|
|
83208
|
+
loading: cancelLoading
|
|
83114
83209
|
}, cancelButtonProps), cancelText || get_default()(locale, 'cancel')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, assign_default()({
|
|
83115
83210
|
type: okType,
|
|
83116
83211
|
theme: "solid",
|
|
83117
|
-
onClick: this.handleConfirm
|
|
83212
|
+
onClick: this.handleConfirm,
|
|
83213
|
+
loading: confirmLoading
|
|
83118
83214
|
}, okButtonProps), okText || get_default()(locale, 'confirm'))));
|
|
83119
83215
|
}
|
|
83120
83216
|
|
|
@@ -83136,35 +83232,39 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
83136
83232
|
});
|
|
83137
83233
|
const showTitle = title !== null && typeof title !== 'undefined';
|
|
83138
83234
|
const showContent = content !== null || typeof content !== 'undefined';
|
|
83139
|
-
return
|
|
83140
|
-
|
|
83141
|
-
|
|
83142
|
-
|
|
83143
|
-
|
|
83144
|
-
|
|
83145
|
-
|
|
83146
|
-
|
|
83147
|
-
|
|
83148
|
-
|
|
83149
|
-
|
|
83150
|
-
|
|
83151
|
-
|
|
83152
|
-
|
|
83153
|
-
|
|
83154
|
-
|
|
83155
|
-
|
|
83156
|
-
|
|
83157
|
-
|
|
83158
|
-
|
|
83159
|
-
|
|
83160
|
-
|
|
83161
|
-
|
|
83162
|
-
|
|
83163
|
-
|
|
83164
|
-
|
|
83165
|
-
|
|
83166
|
-
|
|
83167
|
-
|
|
83235
|
+
return (
|
|
83236
|
+
/*#__PURE__*/
|
|
83237
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
83238
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83239
|
+
className: popCardCls,
|
|
83240
|
+
onClick: this.stopImmediatePropagation,
|
|
83241
|
+
style: style
|
|
83242
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83243
|
+
className: "".concat(prefixCls, "-inner")
|
|
83244
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83245
|
+
className: "".concat(prefixCls, "-header")
|
|
83246
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
83247
|
+
className: "".concat(prefixCls, "-header-icon"),
|
|
83248
|
+
"x-semi-prop": "icon"
|
|
83249
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? icon : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83250
|
+
className: "".concat(prefixCls, "-header-body")
|
|
83251
|
+
}, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83252
|
+
className: "".concat(prefixCls, "-header-title"),
|
|
83253
|
+
"x-semi-prop": "title"
|
|
83254
|
+
}, title) : null, showContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83255
|
+
className: "".concat(prefixCls, "-header-content"),
|
|
83256
|
+
"x-semi-prop": "content"
|
|
83257
|
+
}, content) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
83258
|
+
className: "".concat(prefixCls, "-btn-close"),
|
|
83259
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
83260
|
+
size: "small",
|
|
83261
|
+
theme: 'borderless',
|
|
83262
|
+
type: cancelType,
|
|
83263
|
+
onClick: this.handleCancel
|
|
83264
|
+
})), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83265
|
+
className: "".concat(prefixCls, "-footer")
|
|
83266
|
+
}, this.renderControls())))
|
|
83267
|
+
);
|
|
83168
83268
|
}
|
|
83169
83269
|
|
|
83170
83270
|
render() {
|
|
@@ -96677,7 +96777,11 @@ class TabBar_TabBar extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
96677
96777
|
var _context5, _context6;
|
|
96678
96778
|
|
|
96679
96779
|
if (isEmpty_default()(items)) {
|
|
96680
|
-
return
|
|
96780
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
96781
|
+
disabled: true,
|
|
96782
|
+
icon: icon,
|
|
96783
|
+
theme: "borderless"
|
|
96784
|
+
});
|
|
96681
96785
|
}
|
|
96682
96786
|
|
|
96683
96787
|
const {
|
|
@@ -104582,15 +104686,6 @@ treeSelect_TreeSelect.defaultProps = {
|
|
|
104582
104686
|
var core_js_stable_url = __webpack_require__("QjT4");
|
|
104583
104687
|
var url_default = /*#__PURE__*/__webpack_require__.n(core_js_stable_url);
|
|
104584
104688
|
|
|
104585
|
-
// CONCATENATED MODULE: ../semi-foundation/utils/isObject.ts
|
|
104586
|
-
function isObject_isObject(obj) {
|
|
104587
|
-
return obj !== null && typeof obj === 'object';
|
|
104588
|
-
}
|
|
104589
|
-
// CONCATENATED MODULE: ../semi-foundation/utils/isPromise.ts
|
|
104590
|
-
|
|
104591
|
-
function isPromise(value) {
|
|
104592
|
-
return isObject_isObject(value) && typeof value.then === 'function';
|
|
104593
|
-
}
|
|
104594
104689
|
// CONCATENATED MODULE: ../semi-foundation/upload/constants.ts
|
|
104595
104690
|
|
|
104596
104691
|
const upload_constants_PREFIX = "".concat(BASE_CLASS_PREFIX, "-upload");
|
|
@@ -107752,7 +107847,8 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
107752
107847
|
const noMatch = inSearchMode && searchResult.size === 0;
|
|
107753
107848
|
const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
|
|
107754
107849
|
const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
|
|
107755
|
-
const
|
|
107850
|
+
const emptyDataCom = this.renderEmpty('left', emptyLeft);
|
|
107851
|
+
const emptySearchCom = this.renderEmpty('left', emptySearch);
|
|
107756
107852
|
const loadingCom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(spin_0, null);
|
|
107757
107853
|
let content = null;
|
|
107758
107854
|
|
|
@@ -107762,7 +107858,11 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
107762
107858
|
break;
|
|
107763
107859
|
|
|
107764
107860
|
case noMatch:
|
|
107765
|
-
content =
|
|
107861
|
+
content = emptySearchCom;
|
|
107862
|
+
break;
|
|
107863
|
+
|
|
107864
|
+
case data.length === 0:
|
|
107865
|
+
content = emptyDataCom;
|
|
107766
107866
|
break;
|
|
107767
107867
|
|
|
107768
107868
|
case type === transfer_constants_strings.TYPE_TREE_TO_LIST:
|
|
@@ -110394,7 +110494,6 @@ class baseForm_Form extends baseComponent_BaseComponent {
|
|
|
110394
110494
|
|
|
110395
110495
|
componentWillUnmount() {
|
|
110396
110496
|
this.foundation.destroy();
|
|
110397
|
-
this.formApi = null;
|
|
110398
110497
|
}
|
|
110399
110498
|
|
|
110400
110499
|
get adapter() {
|