@douyinfe/semi-ui 2.19.0-alpha.2 → 2.19.0-alpha.5

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.
@@ -39146,6 +39146,11 @@ button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.pr
39146
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,49 @@ 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
+ var _context2;
39183
+
39184
+ const isButtonType = includes_default()(_context2 = [get_default()(item, 'type.displayName'), get_default()(item, 'type.name')]).call(_context2, 'Button');
39185
+
39186
+ const buttonProps = get_default()(item, 'props');
39187
+
39188
+ if (buttonProps) {
39189
+ var _context3, _context4;
39190
+
39191
+ const {
39192
+ type,
39193
+ theme,
39194
+ disabled
39195
+ } = buttonProps;
39196
+ lineCls = classnames_default()("".concat(buttonGroup_prefixCls, "-group-line"), concat_default()(_context3 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context3, theme !== null && theme !== void 0 ? theme : 'light'), concat_default()(_context4 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context4, type !== null && type !== void 0 ? type : 'primary'), {
39197
+ ["".concat(buttonGroup_prefixCls, "-group-line-disabled")]: disabled
39198
+ });
39199
+ }
39200
+
39201
+ if (isButtonType) {
39202
+ innerWithLine.push(item, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
39203
+ className: lineCls
39204
+ }));
39205
+ } else {
39206
+ innerWithLine.push(item);
39207
+ }
39208
+ });
39209
+
39210
+ innerWithLine.push(slice_default()(inner).call(inner, -1));
39211
+ return innerWithLine;
39212
+ } else {
39213
+ return inner;
39214
+ }
39215
+ }
39216
+
39169
39217
  render() {
39170
39218
  const _a = this.props,
39171
39219
  {
@@ -39179,25 +39227,27 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
39179
39227
  rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
39180
39228
 
39181
39229
  let inner;
39230
+ let innerWithLine = [];
39182
39231
  const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
39183
39232
 
39184
39233
  if (children) {
39185
- var _context;
39234
+ var _context5;
39186
39235
 
39187
- inner = map_default()(_context = is_array_default()(children) ? children : [children]).call(_context, (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()({
39236
+ inner = map_default()(_context5 = is_array_default()(children) ? children : [children]).call(_context5, (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
39237
  disabled,
39189
39238
  size,
39190
39239
  type
39191
39240
  }, itm.props), rest), {
39192
39241
  key: index
39193
39242
  })) : itm);
39243
+ innerWithLine = this.getInnerWithLine(inner);
39194
39244
  }
39195
39245
 
39196
39246
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
39197
39247
  className: cls,
39198
39248
  role: "group",
39199
39249
  "aria-label": ariaLabel
39200
- }, inner);
39250
+ }, innerWithLine);
39201
39251
  }
39202
39252
 
39203
39253
  }
@@ -49240,9 +49290,6 @@ class checkboxGroupFoundation_CheckboxGroupFoundation extends foundation {
49240
49290
 
49241
49291
 
49242
49292
 
49243
-
49244
-
49245
-
49246
49293
  /* eslint-disable max-len */
49247
49294
 
49248
49295
 
@@ -49334,8 +49381,7 @@ class checkboxGroup_CheckboxGroup extends baseComponent_BaseComponent {
49334
49381
  key: index,
49335
49382
  disabled: this.props.disabled,
49336
49383
  value: option,
49337
- prefixCls: prefixCls,
49338
- type: type
49384
+ prefixCls: prefixCls
49339
49385
  }, option);
49340
49386
  } else {
49341
49387
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkbox_checkbox_0, {
@@ -49347,34 +49393,17 @@ class checkboxGroup_CheckboxGroup extends baseComponent_BaseComponent {
49347
49393
  extra: option.extra,
49348
49394
  className: option.className,
49349
49395
  style: option.style,
49350
- onChange: option.onChange,
49351
- type: type
49396
+ onChange: option.onChange
49352
49397
  }, option.label);
49353
49398
  }
49354
49399
  });
49355
49400
  } else if (children) {
49356
49401
  var _context6;
49357
49402
 
49358
- inner = map_default()(_context6 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.toArray(children)).call(_context6, (itm, index) => {
49359
- var _context7;
49360
-
49361
- const props = {
49362
- key: index,
49363
- role: 'listitem'
49364
- };
49365
-
49366
- const isCheckboxComp = some_default()(_context7 = ['Checkbox', 'CheckboxWithGroup']).call(_context7, comp => {
49367
- var _context8;
49368
-
49369
- return includes_default()(_context8 = [get_default()(itm, 'type.displayName'), get_default()(itm, 'type.name')]).call(_context8, comp);
49370
- });
49371
-
49372
- if (isCheckboxComp) {
49373
- props.type = type;
49374
- }
49375
-
49376
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(itm, props);
49377
- });
49403
+ inner = map_default()(_context6 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.toArray(children)).call(_context6, (itm, index) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(itm, {
49404
+ key: index,
49405
+ role: 'listitem'
49406
+ }));
49378
49407
  }
49379
49408
 
49380
49409
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
@@ -84265,9 +84294,6 @@ radio_Radio.defaultProps = {
84265
84294
 
84266
84295
 
84267
84296
 
84268
-
84269
-
84270
-
84271
84297
  class radioGroup_RadioGroup extends baseComponent_BaseComponent {
84272
84298
  constructor(props) {
84273
84299
  super(props);
@@ -84358,8 +84384,7 @@ class radioGroup_RadioGroup extends baseComponent_BaseComponent {
84358
84384
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(radio_radio_0, {
84359
84385
  key: index,
84360
84386
  disabled: this.props.disabled,
84361
- value: option,
84362
- type: type
84387
+ value: option
84363
84388
  }, option);
84364
84389
  } else {
84365
84390
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(radio_radio_0, {
@@ -84368,37 +84393,16 @@ class radioGroup_RadioGroup extends baseComponent_BaseComponent {
84368
84393
  value: option.value,
84369
84394
  extra: option.extra,
84370
84395
  className: option.className,
84371
- style: option.style,
84372
- type: type
84396
+ style: option.style
84373
84397
  }, option.label);
84374
84398
  }
84375
84399
  });
84376
84400
  } else if (children) {
84377
84401
  var _context5;
84378
84402
 
84379
- inner = map_default()(_context5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children).call(_context5, children, (itm, index) => {
84380
- if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(itm)) {
84381
- var _context6;
84382
-
84383
- const props = {
84384
- key: index
84385
- };
84386
-
84387
- const isRadioComp = some_default()(_context6 = ['Radio', 'RadioWithGroup']).call(_context6, comp => {
84388
- var _context7;
84389
-
84390
- return includes_default()(_context7 = [get_default()(itm, 'type.displayName'), get_default()(itm, 'type.name')]).call(_context7, comp);
84391
- });
84392
-
84393
- if (isRadioComp) {
84394
- props.type = type;
84395
- }
84396
-
84397
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(itm, props);
84398
- } else {
84399
- return null;
84400
- }
84401
- });
84403
+ inner = map_default()(_context5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children).call(_context5, children, (itm, index) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(itm) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(itm, {
84404
+ key: index
84405
+ }) : null);
84402
84406
  }
84403
84407
 
84404
84408
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
@@ -91324,12 +91328,14 @@ function ColumnFilter() {
91324
91328
  } else {
91325
91329
  iconElem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
91326
91330
  className: finalCls
91327
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconFilter, {
91331
+ }, '\u200b'
91332
+ /* ZWSP(zero-width space) */
91333
+ , /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconFilter, {
91328
91334
  role: "button",
91329
91335
  "aria-label": "Filter data with this column",
91330
91336
  "aria-haspopup": "listbox",
91331
91337
  tabIndex: -1,
91332
- size: "small"
91338
+ size: "default"
91333
91339
  }));
91334
91340
  }
91335
91341
 
@@ -91355,9 +91361,10 @@ class ColumnSorter_ColumnSorter extends external_root_React_commonjs2_react_comm
91355
91361
  prefixCls,
91356
91362
  onClick,
91357
91363
  sortOrder,
91358
- style
91364
+ style,
91365
+ title
91359
91366
  } = this.props;
91360
- const iconBtnSize = 'small';
91367
+ const iconBtnSize = 'default';
91361
91368
  const upCls = classnames_default()("".concat(prefixCls, "-column-sorter-up"), {
91362
91369
  on: sortOrder === table_constants_strings.SORT_DIRECTIONS[0]
91363
91370
  });
@@ -91376,11 +91383,13 @@ class ColumnSorter_ColumnSorter extends external_root_React_commonjs2_react_comm
91376
91383
  role: 'button'
91377
91384
  }, ariaProps, {
91378
91385
  tabIndex: -1,
91379
- style: style,
91380
- className: "".concat(prefixCls, "-column-sorter"),
91386
+ className: "".concat(prefixCls, "-column-sorter-wrapper"),
91381
91387
  onClick: onClick,
91382
91388
  onKeyPress: e => utils_isEnterPress(e) && onClick(e)
91383
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
91389
+ }), title, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
91390
+ style: style,
91391
+ className: "".concat(prefixCls, "-column-sorter")
91392
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
91384
91393
  className: "".concat(upCls)
91385
91394
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCaretup, {
91386
91395
  size: iconBtnSize
@@ -91388,7 +91397,7 @@ class ColumnSorter_ColumnSorter extends external_root_React_commonjs2_react_comm
91388
91397
  className: "".concat(downCls)
91389
91398
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCaretdown, {
91390
91399
  size: iconBtnSize
91391
- })));
91400
+ }))));
91392
91401
  }
91393
91402
 
91394
91403
  }
@@ -94919,15 +94928,23 @@ class Table_Table extends baseComponent_BaseComponent {
94919
94928
  const defaultSortOrder = get_default()(curQuery, 'defaultSortOrder', false);
94920
94929
 
94921
94930
  const sortOrder = _this.foundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
94931
+ const TitleNode = typeof rawTitle !== 'function' && /*#__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, {
94932
+ key: table_constants_strings.DEFAULT_KEY_COLUMN_TITLE
94933
+ }, rawTitle);
94922
94934
 
94923
94935
  if (typeof column.sorter === 'function' || column.sorter === true) {
94936
+ // In order to increase the click hot area of ​​sorting, when sorting is required & useFullRender is false,
94937
+ // both the title and sorting areas are used as the click hot area for sorting。
94924
94938
  const sorter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ColumnSorter_ColumnSorter, {
94925
94939
  key: table_constants_strings.DEFAULT_KEY_COLUMN_SORTER,
94926
94940
  sortOrder: sortOrder,
94927
- onClick: e => _this.foundation.handleSort(column, e)
94941
+ onClick: e => _this.foundation.handleSort(column, e),
94942
+ title: TitleNode
94928
94943
  });
94929
94944
  useFullRender && (titleMap.sorter = sorter);
94930
94945
  titleArr.push(sorter);
94946
+ } else {
94947
+ titleArr.push(TitleNode);
94931
94948
  }
94932
94949
 
94933
94950
  const stateFilteredValue = get_default()(curQuery, 'filteredValue');
@@ -94948,9 +94965,7 @@ class Table_Table extends baseComponent_BaseComponent {
94948
94965
  titleArr.push(filter);
94949
94966
  }
94950
94967
 
94951
- const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr.unshift( /*#__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, {
94952
- key: table_constants_strings.DEFAULT_KEY_COLUMN_TITLE
94953
- }, rawTitle)) && titleArr;
94968
+ const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr;
94954
94969
  column = assign_default()(assign_default()({}, column), {
94955
94970
  title: newTitle
94956
94971
  });