@douyinfe/semi-ui 2.47.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.
@@ -62665,8 +62665,9 @@ class DropdownItem extends BaseComponent {
62665
62665
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
62666
62666
  if (eventName === "onClick") {
62667
62667
  events["onMouseDown"] = e => {
62668
+ var _a, _b;
62668
62669
  if (e.button === 0) {
62669
- this.props[eventName](e);
62670
+ (_b = (_a = this.props)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
62670
62671
  }
62671
62672
  };
62672
62673
  } else {
@@ -70315,7 +70316,7 @@ var utils_rest = undefined && undefined.__rest || function (s, e) {
70315
70316
  };
70316
70317
 
70317
70318
 
70318
- const generateOption = (child, parent, index) => {
70319
+ const generateOption = (child, parent, index, newKey) => {
70319
70320
  const childProps = child.props;
70320
70321
  if (!child || !childProps) {
70321
70322
  return null;
@@ -70333,7 +70334,7 @@ const generateOption = (child, parent, index) => {
70333
70334
  // Props are collected from ReactNode, after React.Children.toArray
70334
70335
  // no need to determine whether the key exists in child
70335
70336
  // Even if the user does not explicitly declare it, React will always generate a key.
70336
- option._keyInJsx = child.key;
70337
+ option._keyInJsx = newKey || child.key;
70337
70338
  return option;
70338
70339
  };
70339
70340
  const getOptionsFromGroup = selectChildren => {
@@ -70364,10 +70365,22 @@ const getOptionsFromGroup = selectChildren => {
70364
70365
  children
70365
70366
  } = _a,
70366
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
+ }
70367
70375
  children = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(children);
70368
- 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
+
70369
70382
  optionIndex++;
70370
- return generateOption(option, restGroupProps, optionIndex);
70383
+ return generateOption(option, restGroupProps, optionIndex, newKey);
70371
70384
  });
70372
70385
  const group = Object.assign(Object.assign({}, child.props), {
70373
70386
  children: childrenOption,
@@ -80504,9 +80517,6 @@ class HeadTable extends (external_root_React_commonjs2_react_commonjs_react_amd_
80504
80517
  bodyHasScrollBar,
80505
80518
  sticky
80506
80519
  } = this.props;
80507
- if (!showHeader) {
80508
- return null;
80509
- }
80510
80520
  const Table = get_default()(components, 'header.outer', 'table');
80511
80521
  const x = get_default()(scroll, 'x');
80512
80522
  const headStyle = {};
@@ -80527,7 +80537,8 @@ class HeadTable extends (external_root_React_commonjs2_react_commonjs_react_amd_
80527
80537
  onDidUpdate: onDidUpdate
80528
80538
  }));
80529
80539
  const headTableCls = classnames_default()(`${prefixCls}-header`, {
80530
- [`${prefixCls}-header-sticky`]: sticky
80540
+ [`${prefixCls}-header-sticky`]: sticky,
80541
+ [`${prefixCls}-header-hidden`]: !showHeader
80531
80542
  });
80532
80543
  const stickyTop = get_default()(sticky, 'top', 0);
80533
80544
  if (typeof stickyTop === 'number') {
@@ -98435,7 +98446,7 @@ class Form extends BaseComponent {
98435
98446
  [baseForm_prefix + '-vertical']: layout === 'vertical',
98436
98447
  [baseForm_prefix + '-horizontal']: layout === 'horizontal'
98437
98448
  });
98438
- const showldAppendRow = wrapperCol && labelCol;
98449
+ const shouldAppendRow = wrapperCol && labelCol;
98439
98450
  const formContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("form", Object.assign({
98440
98451
  style: style
98441
98452
  }, rest, {
@@ -98451,7 +98462,7 @@ class Form extends BaseComponent {
98451
98462
  value: this.formApi
98452
98463
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(FormStateContext.Provider, {
98453
98464
  value: formState
98454
- }, showldAppendRow ? withRowForm : formContent)));
98465
+ }, shouldAppendRow ? withRowForm : formContent)));
98455
98466
  }
98456
98467
  }
98457
98468
  Form.propTypes = {