@douyinfe/semi-ui 2.55.4 → 2.55.5-hotfix-aria

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.
@@ -67,10 +67,10 @@ class Cascader extends _baseComponent.default {
67
67
  displayRender,
68
68
  disableStrictly
69
69
  } = this.props;
70
- const isDsiabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
71
70
  if (keyEntities[nodeKey]) {
71
+ const isDisabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
72
72
  const tagCls = (0, _classnames.default)(`${prefixcls}-selection-tag`, {
73
- [`${prefixcls}-selection-tag-disabled`]: isDsiabled
73
+ [`${prefixcls}-selection-tag-disabled`]: isDisabled
74
74
  });
75
75
  // custom render tags
76
76
  if ((0, _isFunction2.default)(displayRender)) {
@@ -733,7 +733,11 @@ class Cascader extends _baseComponent.default {
733
733
  formatItem.length > 0 && formatValuePath.push(formatItem);
734
734
  });
735
735
  // formatKeys is used to save key of value
736
- const formatKeys = formatValuePath.map(v => (0, _util.getKeyByValuePath)(v));
736
+ const formatKeys = formatValuePath.reduce((acc, cur) => {
737
+ const key = (0, _util.getKeyByValuePath)(cur);
738
+ keyEntities[key] && acc.push(key);
739
+ return acc;
740
+ }, []);
737
741
  return formatKeys;
738
742
  };
739
743
  const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
@@ -247,8 +247,8 @@ class ScrollItem extends _baseComponent.default {
247
247
  key: prefixKey + index
248
248
  }, events, {
249
249
  className: cls,
250
+ // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
250
251
  role: "option",
251
- "aria-selected": selected,
252
252
  "aria-disabled": item.disabled
253
253
  }), text)
254
254
  );
@@ -50,6 +50,7 @@ class TreeNode extends _react.PureComponent {
50
50
  onNodeExpand(e, this.props);
51
51
  };
52
52
  this.onCheck = e => {
53
+ var _a, _b;
53
54
  if (this.isDisabled()) {
54
55
  return;
55
56
  }
@@ -57,7 +58,7 @@ class TreeNode extends _react.PureComponent {
57
58
  onNodeCheck
58
59
  } = this.context;
59
60
  e.stopPropagation();
60
- e.nativeEvent.stopImmediatePropagation();
61
+ (_b = (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation) === null || _b === void 0 ? void 0 : _b.call(_a);
61
62
  onNodeCheck(e, this.props);
62
63
  };
63
64
  /**
@@ -58,10 +58,10 @@ class Cascader extends BaseComponent {
58
58
  displayRender,
59
59
  disableStrictly
60
60
  } = this.props;
61
- const isDsiabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
62
61
  if (keyEntities[nodeKey]) {
62
+ const isDisabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
63
63
  const tagCls = cls(`${prefixcls}-selection-tag`, {
64
- [`${prefixcls}-selection-tag-disabled`]: isDsiabled
64
+ [`${prefixcls}-selection-tag-disabled`]: isDisabled
65
65
  });
66
66
  // custom render tags
67
67
  if (_isFunction(displayRender)) {
@@ -724,7 +724,11 @@ class Cascader extends BaseComponent {
724
724
  formatItem.length > 0 && formatValuePath.push(formatItem);
725
725
  });
726
726
  // formatKeys is used to save key of value
727
- const formatKeys = formatValuePath.map(v => getKeyByValuePath(v));
727
+ const formatKeys = formatValuePath.reduce((acc, cur) => {
728
+ const key = getKeyByValuePath(cur);
729
+ keyEntities[key] && acc.push(key);
730
+ return acc;
731
+ }, []);
728
732
  return formatKeys;
729
733
  };
730
734
  const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
@@ -240,8 +240,8 @@ export default class ScrollItem extends BaseComponent {
240
240
  key: prefixKey + index
241
241
  }, events, {
242
242
  className: cls,
243
+ // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
243
244
  role: "option",
244
- "aria-selected": selected,
245
245
  "aria-disabled": item.disabled
246
246
  }), text)
247
247
  );
@@ -41,6 +41,7 @@ export default class TreeNode extends PureComponent {
41
41
  onNodeExpand(e, this.props);
42
42
  };
43
43
  this.onCheck = e => {
44
+ var _a, _b;
44
45
  if (this.isDisabled()) {
45
46
  return;
46
47
  }
@@ -48,7 +49,7 @@ export default class TreeNode extends PureComponent {
48
49
  onNodeCheck
49
50
  } = this.context;
50
51
  e.stopPropagation();
51
- e.nativeEvent.stopImmediatePropagation();
52
+ (_b = (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation) === null || _b === void 0 ? void 0 : _b.call(_a);
52
53
  onNodeCheck(e, this.props);
53
54
  };
54
55
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.55.4",
3
+ "version": "2.55.5-hotfix-aria",
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.55.4",
24
- "@douyinfe/semi-animation-react": "2.55.4",
25
- "@douyinfe/semi-foundation": "2.55.4",
26
- "@douyinfe/semi-icons": "2.55.4",
27
- "@douyinfe/semi-illustrations": "2.55.4",
28
- "@douyinfe/semi-theme-default": "2.55.4",
23
+ "@douyinfe/semi-animation": "2.55.5-hotfix-aria",
24
+ "@douyinfe/semi-animation-react": "2.55.5-hotfix-aria",
25
+ "@douyinfe/semi-foundation": "2.55.5-hotfix-aria",
26
+ "@douyinfe/semi-icons": "2.55.5-hotfix-aria",
27
+ "@douyinfe/semi-illustrations": "2.55.5-hotfix-aria",
28
+ "@douyinfe/semi-theme-default": "2.55.5-hotfix-aria",
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": "b164af409e92b8165e4355e9d53e011224986f62",
78
+ "gitHead": "63890ab9c12e908ed62cfb02b44b16e6e4dc558f",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",