@douyinfe/semi-ui 2.46.0-beta.0 → 2.46.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.
@@ -356,7 +356,7 @@ class monthCalendar extends _baseComponent.default {
356
356
  }
357
357
  }
358
358
  if (!(0, _isEqual2.default)(prevEventKeys, nowEventKeys) || itemLimitUpdate || !(0, _isEqual2.default)(prevProps.displayValue, this.props.displayValue)) {
359
- this.foundation.parseMonthlyEvents(itemLimit || this.props.events);
359
+ this.foundation.parseMonthlyEvents(itemLimit);
360
360
  }
361
361
  }
362
362
  closeCard(e, key) {
@@ -530,7 +530,7 @@ class Select extends _baseComponent.default {
530
530
  focused: isFocused,
531
531
  onMouseEnter: () => this.onOptionHover(optionIndex),
532
532
  style: optionStyle,
533
- key: option.key || option.label + option.value + optionIndex,
533
+ key: option._keyInOptionList || option._keyInJsx || option.label + option.value + optionIndex,
534
534
  renderOptionItem: renderOptionItem,
535
535
  inputValue: inputValue,
536
536
  semiOptionId: `${this.selectID}-option-${optionIndex}`
@@ -22,7 +22,7 @@ const generateOption = (child, parent, index) => {
22
22
  }
23
23
  const option = Object.assign(Object.assign({
24
24
  value: childProps.value,
25
- // Drop-down menu rendering priority label value, children, value in turn downgrade
25
+ // Dropdown menu rendering priority label value, children, value in turn downgrade
26
26
  label: childProps.label || childProps.children || childProps.value,
27
27
  _show: true,
28
28
  _selected: false,
@@ -30,6 +30,10 @@ const generateOption = (child, parent, index) => {
30
30
  }, childProps), {
31
31
  _parentGroup: parent
32
32
  });
33
+ // Props are collected from ReactNode, after React.Children.toArray
34
+ // no need to determine whether the key exists in child
35
+ // Even if the user does not explicitly declare it, React will always generate a key.
36
+ option._keyInJsx = child.key;
33
37
  return option;
34
38
  };
35
39
  exports.generateOption = generateOption;
@@ -348,7 +348,7 @@ export default class monthCalendar extends BaseComponent {
348
348
  }
349
349
  }
350
350
  if (!_isEqual(prevEventKeys, nowEventKeys) || itemLimitUpdate || !_isEqual(prevProps.displayValue, this.props.displayValue)) {
351
- this.foundation.parseMonthlyEvents(itemLimit || this.props.events);
351
+ this.foundation.parseMonthlyEvents(itemLimit);
352
352
  }
353
353
  }
354
354
  closeCard(e, key) {
@@ -521,7 +521,7 @@ class Select extends BaseComponent {
521
521
  focused: isFocused,
522
522
  onMouseEnter: () => this.onOptionHover(optionIndex),
523
523
  style: optionStyle,
524
- key: option.key || option.label + option.value + optionIndex,
524
+ key: option._keyInOptionList || option._keyInJsx || option.label + option.value + optionIndex,
525
525
  renderOptionItem: renderOptionItem,
526
526
  inputValue: inputValue,
527
527
  semiOptionId: `${this.selectID}-option-${optionIndex}`
@@ -15,7 +15,7 @@ const generateOption = (child, parent, index) => {
15
15
  }
16
16
  const option = Object.assign(Object.assign({
17
17
  value: childProps.value,
18
- // Drop-down menu rendering priority label value, children, value in turn downgrade
18
+ // Dropdown menu rendering priority label value, children, value in turn downgrade
19
19
  label: childProps.label || childProps.children || childProps.value,
20
20
  _show: true,
21
21
  _selected: false,
@@ -23,6 +23,10 @@ const generateOption = (child, parent, index) => {
23
23
  }, childProps), {
24
24
  _parentGroup: parent
25
25
  });
26
+ // Props are collected from ReactNode, after React.Children.toArray
27
+ // no need to determine whether the key exists in child
28
+ // Even if the user does not explicitly declare it, React will always generate a key.
29
+ option._keyInJsx = child.key;
26
30
  return option;
27
31
  };
28
32
  const getOptionsFromGroup = selectChildren => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.46.0-beta.0",
3
+ "version": "2.46.0",
4
4
  "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -20,12 +20,12 @@
20
20
  "@dnd-kit/core": "^6.0.8",
21
21
  "@dnd-kit/sortable": "^7.0.2",
22
22
  "@dnd-kit/utilities": "^3.2.1",
23
- "@douyinfe/semi-animation": "2.46.0-beta.0",
24
- "@douyinfe/semi-animation-react": "2.46.0-beta.0",
25
- "@douyinfe/semi-foundation": "2.46.0-beta.0",
26
- "@douyinfe/semi-icons": "2.46.0-beta.0",
27
- "@douyinfe/semi-illustrations": "2.46.0-beta.0",
28
- "@douyinfe/semi-theme-default": "2.46.0-beta.0",
23
+ "@douyinfe/semi-animation": "2.46.0",
24
+ "@douyinfe/semi-animation-react": "2.46.0",
25
+ "@douyinfe/semi-foundation": "2.46.0",
26
+ "@douyinfe/semi-icons": "2.46.0",
27
+ "@douyinfe/semi-illustrations": "2.46.0",
28
+ "@douyinfe/semi-theme-default": "2.46.0",
29
29
  "async-validator": "^3.5.0",
30
30
  "classnames": "^2.2.6",
31
31
  "copy-text-to-clipboard": "^2.1.1",
@@ -75,7 +75,7 @@
75
75
  ],
76
76
  "author": "",
77
77
  "license": "MIT",
78
- "gitHead": "ecce44f71f5c592685055bb2ec9c0ccb3519538d",
78
+ "gitHead": "0de820bf1a275d5c759091247326bbd7fc0d873c",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",