@douyinfe/semi-ui 2.47.0-beta.0 → 2.47.1

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.
@@ -62664,7 +62664,12 @@ class DropdownItem extends BaseComponent {
62664
62664
  if (!disabled) {
62665
62665
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
62666
62666
  if (eventName === "onClick") {
62667
- events["onMouseDown"] = this.props[eventName];
62667
+ events["onMouseDown"] = e => {
62668
+ var _a, _b;
62669
+ if (e.button === 0) {
62670
+ (_b = (_a = this.props)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
62671
+ }
62672
+ };
62668
62673
  } else {
62669
62674
  events[eventName] = this.props[eventName];
62670
62675
  }
@@ -70311,7 +70316,7 @@ var utils_rest = undefined && undefined.__rest || function (s, e) {
70311
70316
  };
70312
70317
 
70313
70318
 
70314
- const generateOption = (child, parent, index) => {
70319
+ const generateOption = (child, parent, index, newKey) => {
70315
70320
  const childProps = child.props;
70316
70321
  if (!child || !childProps) {
70317
70322
  return null;
@@ -70329,7 +70334,7 @@ const generateOption = (child, parent, index) => {
70329
70334
  // Props are collected from ReactNode, after React.Children.toArray
70330
70335
  // no need to determine whether the key exists in child
70331
70336
  // Even if the user does not explicitly declare it, React will always generate a key.
70332
- option._keyInJsx = child.key;
70337
+ option._keyInJsx = newKey || child.key;
70333
70338
  return option;
70334
70339
  };
70335
70340
  const getOptionsFromGroup = selectChildren => {
@@ -70360,10 +70365,22 @@ const getOptionsFromGroup = selectChildren => {
70360
70365
  children
70361
70366
  } = _a,
70362
70367
  restGroupProps = utils_rest(_a, ["children"]);
70368
+ let originKeys = [];
70369
+ if (Array.isArray(children)) {
70370
+ // if group has children > 1
70371
+ originKeys = children.map(item => item.key);
70372
+ } else {
70373
+ originKeys.push(children.key);
70374
+ }
70363
70375
  children = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(children);
70364
- const childrenOption = children.map(option => {
70376
+ const childrenOption = children.map((option, index) => {
70377
+ let newKey = option.key;
70378
+ if (originKeys[index] === null) {
70379
+ newKey = child.key + '' + option.key; // if option in group and didn't set key, concat parent key to avoid conflict (default generate key just like .0, .1)
70380
+ }
70381
+
70365
70382
  optionIndex++;
70366
- return generateOption(option, restGroupProps, optionIndex);
70383
+ return generateOption(option, restGroupProps, optionIndex, newKey);
70367
70384
  });
70368
70385
  const group = Object.assign(Object.assign({}, child.props), {
70369
70386
  children: childrenOption,
@@ -78888,9 +78905,9 @@ class TableFoundation extends foundation {
78888
78905
  }, pagination);
78889
78906
  if (!this._pagerIsControlled()) {
78890
78907
  const total = get_default()(propPagination, 'total', dataSource.length);
78891
- const pageSize = get_default()(propPagination, 'pageSize', pagination.pageSize);
78892
78908
  const {
78893
- currentPage
78909
+ currentPage,
78910
+ pageSize
78894
78911
  } = pagination;
78895
78912
  const realTotalPage = Math.ceil(total / pageSize);
78896
78913
  pagination.total = total;
@@ -80500,9 +80517,6 @@ class HeadTable extends (external_root_React_commonjs2_react_commonjs_react_amd_
80500
80517
  bodyHasScrollBar,
80501
80518
  sticky
80502
80519
  } = this.props;
80503
- if (!showHeader) {
80504
- return null;
80505
- }
80506
80520
  const Table = get_default()(components, 'header.outer', 'table');
80507
80521
  const x = get_default()(scroll, 'x');
80508
80522
  const headStyle = {};
@@ -80523,7 +80537,8 @@ class HeadTable extends (external_root_React_commonjs2_react_commonjs_react_amd_
80523
80537
  onDidUpdate: onDidUpdate
80524
80538
  }));
80525
80539
  const headTableCls = classnames_default()(`${prefixCls}-header`, {
80526
- [`${prefixCls}-header-sticky`]: sticky
80540
+ [`${prefixCls}-header-sticky`]: sticky,
80541
+ [`${prefixCls}-header-hidden`]: !showHeader
80527
80542
  });
80528
80543
  const stickyTop = get_default()(sticky, 'top', 0);
80529
80544
  if (typeof stickyTop === 'number') {
@@ -98431,7 +98446,7 @@ class Form extends BaseComponent {
98431
98446
  [baseForm_prefix + '-vertical']: layout === 'vertical',
98432
98447
  [baseForm_prefix + '-horizontal']: layout === 'horizontal'
98433
98448
  });
98434
- const showldAppendRow = wrapperCol && labelCol;
98449
+ const shouldAppendRow = wrapperCol && labelCol;
98435
98450
  const formContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("form", Object.assign({
98436
98451
  style: style
98437
98452
  }, rest, {
@@ -98447,7 +98462,7 @@ class Form extends BaseComponent {
98447
98462
  value: this.formApi
98448
98463
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(FormStateContext.Provider, {
98449
98464
  value: formState
98450
- }, showldAppendRow ? withRowForm : formContent)));
98465
+ }, shouldAppendRow ? withRowForm : formContent)));
98451
98466
  }
98452
98467
  }
98453
98468
  Form.propTypes = {