@douyinfe/semi-ui 2.19.0-alpha.0 → 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.
@@ -49066,7 +49066,13 @@ class checkbox_Checkbox extends baseComponent_BaseComponent {
49066
49066
  const name = inGroup && this.context.checkboxGroup.name;
49067
49067
  const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
49068
49068
 
49069
- const renderContent = () => /*#__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, children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
49069
+ if (!children && !extra) {
49070
+ return null;
49071
+ }
49072
+
49073
+ const renderContent = () => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
49074
+ className: "".concat(prefix, "-content")
49075
+ }, children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
49070
49076
  id: addonId,
49071
49077
  className: "".concat(prefix, "-addon"),
49072
49078
  "x-semi-prop": xSemiPropChildren
@@ -49100,7 +49106,7 @@ class checkbox_Checkbox extends baseComponent_BaseComponent {
49100
49106
  focusInner: focusVisible && !focusOuter,
49101
49107
  onInputFocus: this.handleFocusVisible,
49102
49108
  onInputBlur: this.handleBlur
49103
- })), props.isCardType ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", null, renderContent()) : renderContent())
49109
+ })), renderContent())
49104
49110
  );
49105
49111
  }
49106
49112
 
@@ -82984,24 +82990,58 @@ const popconfirm_constants_numbers = {
82984
82990
  DEFAULT_Z_INDEX: 1030
82985
82991
  };
82986
82992
 
82993
+ // CONCATENATED MODULE: ../semi-foundation/utils/isObject.ts
82994
+ function isObject_isObject(obj) {
82995
+ return obj !== null && typeof obj === 'object';
82996
+ }
82997
+ // CONCATENATED MODULE: ../semi-foundation/utils/isPromise.ts
82998
+
82999
+ function isPromise(value) {
83000
+ return isObject_isObject(value) && typeof value.then === 'function';
83001
+ }
82987
83002
  // CONCATENATED MODULE: ../semi-foundation/popconfirm/popconfirmFoundation.ts
82988
83003
  /* eslint-disable @typescript-eslint/no-empty-function */
82989
83004
 
83005
+
82990
83006
  class popconfirmFoundation_PopConfirmFoundation extends foundation {
82991
83007
  init() {}
82992
83008
 
82993
83009
  destroy() {}
82994
83010
 
82995
83011
  handleCancel(e) {
82996
- this._adapter.notifyCancel(e);
83012
+ const maybePromise = this._adapter.notifyCancel(e);
82997
83013
 
82998
- this.handleVisibleChange(false);
83014
+ if (isPromise(maybePromise)) {
83015
+ this._adapter.updateCancelLoading(true);
83016
+
83017
+ maybePromise.then(result => {
83018
+ this.handleVisibleChange(false);
83019
+
83020
+ this._adapter.updateCancelLoading(false);
83021
+ }, errors => {
83022
+ this._adapter.updateCancelLoading(false);
83023
+ });
83024
+ } else {
83025
+ this.handleVisibleChange(false);
83026
+ }
82999
83027
  }
83000
83028
 
83001
83029
  handleConfirm(e) {
83002
- this._adapter.notifyConfirm(e);
83030
+ const maybePromise = this._adapter.notifyConfirm(e);
83031
+
83032
+ if (isPromise(maybePromise)) {
83033
+ this._adapter.updateConfirmLoading(true);
83034
+
83035
+ maybePromise.then(result => {
83036
+ this._adapter.updateConfirmLoading(false);
83003
83037
 
83004
- this.handleVisibleChange(false);
83038
+ this.handleVisibleChange(false);
83039
+ }, errors => {
83040
+ this._adapter.updateConfirmLoading(false);
83041
+ });
83042
+ } else {
83043
+ this.handleVisibleChange(false);
83044
+ }
83005
83045
  }
83006
83046
 
83007
83047
  handleClickOutSide(e) {
@@ -83067,6 +83107,8 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
83067
83107
  this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
83068
83108
 
83069
83109
  this.state = {
83110
+ cancelLoading: false,
83111
+ confirmLoading: false,
83070
83112
  visible: props.defaultVisible || false
83071
83113
  };
83072
83114
  this.foundation = new popconfirmFoundation_PopConfirmFoundation(this.adapter);
@@ -83090,6 +83132,12 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
83090
83132
  setVisible: visible => this.setState({
83091
83133
  visible
83092
83134
  }),
83135
+ updateConfirmLoading: loading => this.setState({
83136
+ confirmLoading: loading
83137
+ }),
83138
+ updateCancelLoading: loading => this.setState({
83139
+ cancelLoading: loading
83140
+ }),
83093
83141
  notifyConfirm: e => this.props.onConfirm(e),
83094
83142
  notifyCancel: e => this.props.onCancel(e),
83095
83143
  notifyVisibleChange: visible => this.props.onVisibleChange(visible),
@@ -83106,15 +83154,21 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
83106
83154
  cancelButtonProps,
83107
83155
  okButtonProps
83108
83156
  } = this.props;
83157
+ const {
83158
+ cancelLoading,
83159
+ confirmLoading
83160
+ } = this.state;
83109
83161
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
83110
83162
  componentName: "Popconfirm"
83111
83163
  }, (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
83164
  type: cancelType,
83113
- onClick: this.handleCancel
83165
+ onClick: this.handleCancel,
83166
+ loading: cancelLoading
83114
83167
  }, cancelButtonProps), cancelText || get_default()(locale, 'cancel')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, assign_default()({
83115
83168
  type: okType,
83116
83169
  theme: "solid",
83117
- onClick: this.handleConfirm
83170
+ onClick: this.handleConfirm,
83171
+ loading: confirmLoading
83118
83172
  }, okButtonProps), okText || get_default()(locale, 'confirm'))));
83119
83173
  }
83120
83174
 
@@ -83136,35 +83190,39 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
83136
83190
  });
83137
83191
  const showTitle = title !== null && typeof title !== 'undefined';
83138
83192
  const showContent = content !== null || typeof content !== 'undefined';
83139
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83140
- className: popCardCls,
83141
- onClick: this.stopImmediatePropagation,
83142
- style: style
83143
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83144
- className: "".concat(prefixCls, "-inner")
83145
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83146
- className: "".concat(prefixCls, "-header")
83147
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
83148
- className: "".concat(prefixCls, "-header-icon"),
83149
- "x-semi-prop": "icon"
83150
- }, /*#__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", {
83151
- className: "".concat(prefixCls, "-header-body")
83152
- }, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83153
- className: "".concat(prefixCls, "-header-title"),
83154
- "x-semi-prop": "title"
83155
- }, title) : null, showContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83156
- className: "".concat(prefixCls, "-header-content"),
83157
- "x-semi-prop": "content"
83158
- }, content) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
83159
- className: "".concat(prefixCls, "-btn-close"),
83160
- icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
83161
- size: "small",
83162
- theme: 'borderless',
83163
- type: cancelType,
83164
- onClick: this.handleCancel
83165
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83166
- className: "".concat(prefixCls, "-footer")
83167
- }, this.renderControls())));
83193
+ return (
83194
+ /*#__PURE__*/
83195
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
83196
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83197
+ className: popCardCls,
83198
+ onClick: this.stopImmediatePropagation,
83199
+ style: style
83200
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83201
+ className: "".concat(prefixCls, "-inner")
83202
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83203
+ className: "".concat(prefixCls, "-header")
83204
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
83205
+ className: "".concat(prefixCls, "-header-icon"),
83206
+ "x-semi-prop": "icon"
83207
+ }, /*#__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", {
83208
+ className: "".concat(prefixCls, "-header-body")
83209
+ }, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83210
+ className: "".concat(prefixCls, "-header-title"),
83211
+ "x-semi-prop": "title"
83212
+ }, title) : null, showContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83213
+ className: "".concat(prefixCls, "-header-content"),
83214
+ "x-semi-prop": "content"
83215
+ }, content) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
83216
+ className: "".concat(prefixCls, "-btn-close"),
83217
+ icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
83218
+ size: "small",
83219
+ theme: 'borderless',
83220
+ type: cancelType,
83221
+ onClick: this.handleCancel
83222
+ })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83223
+ className: "".concat(prefixCls, "-footer")
83224
+ }, this.renderControls())))
83225
+ );
83168
83226
  }
83169
83227
 
83170
83228
  render() {
@@ -96669,7 +96727,11 @@ class TabBar_TabBar extends external_root_React_commonjs2_react_commonjs_react_a
96669
96727
  var _context5, _context6;
96670
96728
 
96671
96729
  if (isEmpty_default()(items)) {
96672
- return null;
96730
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
96731
+ disabled: true,
96732
+ icon: icon,
96733
+ theme: "borderless"
96734
+ });
96673
96735
  }
96674
96736
 
96675
96737
  const {
@@ -101021,11 +101083,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
101021
101083
  });
101022
101084
  }
101023
101085
 
101024
- renderCheckbox(options) {
101025
- const {
101026
- label,
101027
- icon
101028
- } = options;
101086
+ renderCheckbox() {
101029
101087
  const {
101030
101088
  checked,
101031
101089
  halfChecked,
@@ -101042,7 +101100,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
101042
101100
  indeterminate: halfChecked,
101043
101101
  checked: checked,
101044
101102
  disabled: Boolean(disabled)
101045
- }, icon, label));
101103
+ }));
101046
101104
  }
101047
101105
 
101048
101106
  renderIcon() {
@@ -101212,8 +101270,6 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
101212
101270
  const setsize = get_default()(rest, ['data', 'children', 'length']);
101213
101271
 
101214
101272
  const posinset = isString_default()(rest.pos) ? Number(rest.pos.split('-')[level + 1]) + 1 : 1;
101215
- const label = this.renderRealLabel();
101216
- const icon = this.renderIcon();
101217
101273
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", assign_default()({
101218
101274
  className: nodeCls,
101219
101275
  role: "treeitem",
@@ -101233,12 +101289,9 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
101233
101289
  style: style
101234
101290
  }, dragProps), this.renderArrow(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
101235
101291
  className: labelCls
101236
- }, multiple ? this.renderCheckbox({
101237
- label,
101238
- icon
101239
- }) : null, !multiple && icon, !multiple && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
101292
+ }, multiple ? this.renderCheckbox() : null, this.renderIcon(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
101240
101293
  className: "".concat(treeNode_prefixcls, "-label-text")
101241
- }, label)));
101294
+ }, this.renderRealLabel())));
101242
101295
  }
101243
101296
 
101244
101297
  }
@@ -104583,15 +104636,6 @@ treeSelect_TreeSelect.defaultProps = {
104583
104636
  var core_js_stable_url = __webpack_require__("QjT4");
104584
104637
  var url_default = /*#__PURE__*/__webpack_require__.n(core_js_stable_url);
104585
104638
 
104586
- // CONCATENATED MODULE: ../semi-foundation/utils/isObject.ts
104587
- function isObject_isObject(obj) {
104588
- return obj !== null && typeof obj === 'object';
104589
- }
104590
- // CONCATENATED MODULE: ../semi-foundation/utils/isPromise.ts
104591
-
104592
- function isPromise(value) {
104593
- return isObject_isObject(value) && typeof value.then === 'function';
104594
- }
104595
104639
  // CONCATENATED MODULE: ../semi-foundation/upload/constants.ts
104596
104640
 
104597
104641
  const upload_constants_PREFIX = "".concat(BASE_CLASS_PREFIX, "-upload");
@@ -107753,7 +107797,8 @@ class transfer_Transfer extends baseComponent_BaseComponent {
107753
107797
  const noMatch = inSearchMode && searchResult.size === 0;
107754
107798
  const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
107755
107799
  const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
107756
- const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
107800
+ const emptyDataCom = this.renderEmpty('left', emptyLeft);
107801
+ const emptySearchCom = this.renderEmpty('left', emptySearch);
107757
107802
  const loadingCom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(spin_0, null);
107758
107803
  let content = null;
107759
107804
 
@@ -107763,7 +107808,11 @@ class transfer_Transfer extends baseComponent_BaseComponent {
107763
107808
  break;
107764
107809
 
107765
107810
  case noMatch:
107766
- content = emptyCom;
107811
+ content = emptySearchCom;
107812
+ break;
107813
+
107814
+ case data.length === 0:
107815
+ content = emptyDataCom;
107767
107816
  break;
107768
107817
 
107769
107818
  case type === transfer_constants_strings.TYPE_TREE_TO_LIST:
@@ -110395,7 +110444,6 @@ class baseForm_Form extends baseComponent_BaseComponent {
110395
110444
 
110396
110445
  componentWillUnmount() {
110397
110446
  this.foundation.destroy();
110398
- this.formApi = null;
110399
110447
  }
110400
110448
 
110401
110449
  get adapter() {