@douyinfe/semi-ui 2.38.2 → 2.38.3-alpha.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.
@@ -44,7 +44,16 @@ class DropdownItem extends _baseComponent.default {
44
44
  const events = {};
45
45
  if (!disabled) {
46
46
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
47
- events[eventName] = this.props[eventName];
47
+ if (eventName === "onClick") {
48
+ events["onMouseDown"] = e => {
49
+ var _a, _b;
50
+ if (e.button === 0) {
51
+ (_b = (_a = this.props)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
52
+ }
53
+ };
54
+ } else {
55
+ events[eventName] = this.props[eventName];
56
+ }
48
57
  });
49
58
  }
50
59
  let tick = null;
@@ -228,7 +228,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
228
228
  renderArrow: () => JSX.Element;
229
229
  renderClearBtn: () => JSX.Element;
230
230
  renderSelection: () => JSX.Element;
231
- renderTagItem: (key: string, idx: number) => string | number | boolean | React.ReactFragment | JSX.Element;
231
+ renderTagItem: (key: string, idx: number) => any;
232
232
  renderTagInput: () => JSX.Element;
233
233
  renderInput: () => JSX.Element;
234
234
  renderEmpty: () => JSX.Element;
@@ -201,7 +201,7 @@ class TreeSelect extends _baseComponent.default {
201
201
  } = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
202
202
  index,
203
203
  onClose
204
- }) : null;
204
+ }) : {};
205
205
  if ((0, _isNull2.default)(content) || (0, _isUndefined2.default)(content)) {
206
206
  return;
207
207
  }
@@ -499,7 +499,7 @@ class TreeSelect extends _baseComponent.default {
499
499
  } = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
500
500
  index: idx,
501
501
  onClose
502
- }) : null;
502
+ }) : {};
503
503
  if (isRenderInTag) {
504
504
  return /*#__PURE__*/_react.default.createElement(_index.default, Object.assign({}, tagProps), content);
505
505
  } else {
@@ -37,7 +37,16 @@ class DropdownItem extends BaseComponent {
37
37
  const events = {};
38
38
  if (!disabled) {
39
39
  ['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
40
- events[eventName] = this.props[eventName];
40
+ if (eventName === "onClick") {
41
+ events["onMouseDown"] = e => {
42
+ var _a, _b;
43
+ if (e.button === 0) {
44
+ (_b = (_a = this.props)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
45
+ }
46
+ };
47
+ } else {
48
+ events[eventName] = this.props[eventName];
49
+ }
41
50
  });
42
51
  }
43
52
  let tick = null;
@@ -228,7 +228,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
228
228
  renderArrow: () => JSX.Element;
229
229
  renderClearBtn: () => JSX.Element;
230
230
  renderSelection: () => JSX.Element;
231
- renderTagItem: (key: string, idx: number) => string | number | boolean | React.ReactFragment | JSX.Element;
231
+ renderTagItem: (key: string, idx: number) => any;
232
232
  renderTagInput: () => JSX.Element;
233
233
  renderInput: () => JSX.Element;
234
234
  renderEmpty: () => JSX.Element;
@@ -192,7 +192,7 @@ class TreeSelect extends BaseComponent {
192
192
  } = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
193
193
  index,
194
194
  onClose
195
- }) : null;
195
+ }) : {};
196
196
  if (_isNull(content) || _isUndefined(content)) {
197
197
  return;
198
198
  }
@@ -490,7 +490,7 @@ class TreeSelect extends BaseComponent {
490
490
  } = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
491
491
  index: idx,
492
492
  onClose
493
- }) : null;
493
+ }) : {};
494
494
  if (isRenderInTag) {
495
495
  return /*#__PURE__*/React.createElement(Tag, Object.assign({}, tagProps), content);
496
496
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.38.2",
3
+ "version": "2.38.3-alpha.1",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.38.2",
21
- "@douyinfe/semi-animation-react": "2.38.2",
22
- "@douyinfe/semi-foundation": "2.38.2",
23
- "@douyinfe/semi-icons": "2.38.2",
24
- "@douyinfe/semi-illustrations": "2.38.2",
25
- "@douyinfe/semi-theme-default": "2.38.2",
20
+ "@douyinfe/semi-animation": "2.38.3-alpha.1",
21
+ "@douyinfe/semi-animation-react": "2.38.3-alpha.1",
22
+ "@douyinfe/semi-foundation": "2.38.3-alpha.1",
23
+ "@douyinfe/semi-icons": "2.38.3-alpha.1",
24
+ "@douyinfe/semi-illustrations": "2.38.3-alpha.1",
25
+ "@douyinfe/semi-theme-default": "2.38.3-alpha.1",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "e761d8bc2ba54e3b69ac77f5e6425c62ed6b02f1",
72
+ "gitHead": "df3535fcd23f7b6108a1e58106f7618e68ab3160",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",