@douyinfe/semi-ui 2.48.0-beta.0 → 2.48.0

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.
@@ -62706,8 +62706,9 @@ class DropdownItem extends BaseComponent {
62706
62706
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
62707
62707
  if (eventName === "onClick") {
62708
62708
  events["onMouseDown"] = e => {
62709
+ var _a, _b;
62709
62710
  if (e.button === 0) {
62710
- this.props[eventName](e);
62711
+ (_b = (_a = this.props)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
62711
62712
  }
62712
62713
  };
62713
62714
  } else {
@@ -70356,7 +70357,7 @@ var utils_rest = undefined && undefined.__rest || function (s, e) {
70356
70357
  };
70357
70358
 
70358
70359
 
70359
- const generateOption = (child, parent, index) => {
70360
+ const generateOption = (child, parent, index, newKey) => {
70360
70361
  const childProps = child.props;
70361
70362
  if (!child || !childProps) {
70362
70363
  return null;
@@ -70374,7 +70375,7 @@ const generateOption = (child, parent, index) => {
70374
70375
  // Props are collected from ReactNode, after React.Children.toArray
70375
70376
  // no need to determine whether the key exists in child
70376
70377
  // Even if the user does not explicitly declare it, React will always generate a key.
70377
- option._keyInJsx = child.key;
70378
+ option._keyInJsx = newKey || child.key;
70378
70379
  return option;
70379
70380
  };
70380
70381
  const getOptionsFromGroup = selectChildren => {
@@ -70405,10 +70406,22 @@ const getOptionsFromGroup = selectChildren => {
70405
70406
  children
70406
70407
  } = _a,
70407
70408
  restGroupProps = utils_rest(_a, ["children"]);
70409
+ let originKeys = [];
70410
+ if (Array.isArray(children)) {
70411
+ // if group has children > 1
70412
+ originKeys = children.map(item => item.key);
70413
+ } else {
70414
+ originKeys.push(children.key);
70415
+ }
70408
70416
  children = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(children);
70409
- const childrenOption = children.map(option => {
70417
+ const childrenOption = children.map((option, index) => {
70418
+ let newKey = option.key;
70419
+ if (originKeys[index] === null) {
70420
+ 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)
70421
+ }
70422
+
70410
70423
  optionIndex++;
70411
- return generateOption(option, restGroupProps, optionIndex);
70424
+ return generateOption(option, restGroupProps, optionIndex, newKey);
70412
70425
  });
70413
70426
  const group = Object.assign(Object.assign({}, child.props), {
70414
70427
  children: childrenOption,
@@ -85511,7 +85524,7 @@ const parseToDate = function (input) {
85511
85524
  let dateFnsLocale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : zh_CN;
85512
85525
  if (input instanceof Date) {
85513
85526
  return input;
85514
- } else if (typeof input === 'number' || !isNaN(Number(input))) {
85527
+ } else if (typeof input === 'number') {
85515
85528
  return new Date(toNumber_default()(input));
85516
85529
  } else if (typeof input === 'string') {
85517
85530
  let curDate = new Date();
@@ -87413,7 +87426,6 @@ class ToastFactory {
87413
87426
  */
87414
87427
 
87415
87428
 
87416
-
87417
87429
  class TreeFoundation extends foundation {
87418
87430
  constructor(adapter) {
87419
87431
  super(Object.assign({}, adapter));
@@ -98487,7 +98499,7 @@ class Form extends BaseComponent {
98487
98499
  [baseForm_prefix + '-vertical']: layout === 'vertical',
98488
98500
  [baseForm_prefix + '-horizontal']: layout === 'horizontal'
98489
98501
  });
98490
- const showldAppendRow = wrapperCol && labelCol;
98502
+ const shouldAppendRow = wrapperCol && labelCol;
98491
98503
  const formContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("form", Object.assign({
98492
98504
  style: style
98493
98505
  }, rest, {
@@ -98503,7 +98515,7 @@ class Form extends BaseComponent {
98503
98515
  value: this.formApi
98504
98516
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(FormStateContext.Provider, {
98505
98517
  value: formState
98506
- }, showldAppendRow ? withRowForm : formContent)));
98518
+ }, shouldAppendRow ? withRowForm : formContent)));
98507
98519
  }
98508
98520
  }
98509
98521
  Form.propTypes = {