@douyinfe/semi-ui 2.60.0-beta.0 → 2.60.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.
@@ -224,7 +224,7 @@ class AutoComplete extends _baseComponent.default {
224
224
  const innerProps = {
225
225
  disabled,
226
226
  placeholder,
227
- autofocus: autoFocus,
227
+ autoFocus: autoFocus,
228
228
  onChange: this.onSearch,
229
229
  onClear: this.onInputClear,
230
230
  'aria-label': this.props['aria-label'],
@@ -311,6 +311,14 @@ class Avatar extends _baseComponent.default {
311
311
  hoverContent,
312
312
  focusVisible
313
313
  } = this.state;
314
+ let customStyle = {};
315
+ if (!_constants.strings.SIZE.includes(size)) {
316
+ customStyle = {
317
+ width: size,
318
+ height: size
319
+ };
320
+ }
321
+ customStyle = Object.assign(Object.assign({}, customStyle), style);
314
322
  const shouldWrap = bottomSlot || topSlot || border;
315
323
  const mouseEvent = {
316
324
  onClick: onClick,
@@ -331,7 +339,7 @@ class Avatar extends _baseComponent.default {
331
339
  "x-semi-prop": "hoverContent"
332
340
  }, hoverContent) : null;
333
341
  let avatar = /*#__PURE__*/_react.default.createElement("span", Object.assign({}, others, {
334
- style: shouldWrap ? {} : style,
342
+ style: shouldWrap ? {} : customStyle,
335
343
  className: avatarCls
336
344
  }, shouldWrap ? {} : mouseEvent, {
337
345
  role: 'listitem',
@@ -345,7 +353,7 @@ class Avatar extends _baseComponent.default {
345
353
  avatar = /*#__PURE__*/_react.default.createElement("div", {
346
354
  style: Object.assign({
347
355
  position: "relative"
348
- }, style)
356
+ }, customStyle)
349
357
  }, avatar, /*#__PURE__*/_react.default.createElement("span", {
350
358
  style: borderStyle,
351
359
  className: (0, _classnames.default)([`${prefixCls}-additionalBorder`, `${prefixCls}-additionalBorder-${size}`, {
@@ -362,7 +370,7 @@ class Avatar extends _baseComponent.default {
362
370
  if (shouldWrap) {
363
371
  return /*#__PURE__*/_react.default.createElement("span", Object.assign({
364
372
  className: (0, _classnames.default)([`${prefixCls}-wrapper`]),
365
- style: style
373
+ style: customStyle
366
374
  }, mouseEvent), avatar, topSlot && ["extra-small", "small", "default", "medium", "large", "extra-large"].includes(size) && shape === "circle" && this.renderTopSlot(), bottomSlot && ["extra-small", "small", "default", "medium", "large", "extra-large"].includes(size) && this.renderBottomSlot());
367
375
  } else {
368
376
  return avatar;
@@ -242,7 +242,8 @@ class TreeSelect extends _baseComponent.default {
242
242
  [`${prefixcls}-selection-TriggerSearchItem-disabled`]: disabled
243
243
  });
244
244
  return /*#__PURE__*/_react.default.createElement("span", {
245
- className: spanCls
245
+ className: spanCls,
246
+ onClick: this.foundation.onClickSingleTriggerSearchItem
246
247
  }, renderText ? renderText : placeholder);
247
248
  };
248
249
  /**
@@ -252,7 +253,7 @@ class TreeSelect extends _baseComponent.default {
252
253
  const {
253
254
  inputValue
254
255
  } = this.state;
255
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !inputValue && this.renderSingleTriggerSearchItem(), this.renderInput());
256
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderInput(), !inputValue && this.renderSingleTriggerSearchItem());
256
257
  };
257
258
  this.renderSelectContent = () => {
258
259
  const {
@@ -555,7 +555,7 @@ class Base extends _react.Component {
555
555
  className: `${prefixCls}-icon`,
556
556
  "x-semi-prop": "icon"
557
557
  }, (0, _utils.isSemiIcon)(icon) ? /*#__PURE__*/_react.default.cloneElement(icon, {
558
- realSize: iconSize
558
+ size: iconSize
559
559
  }) : icon);
560
560
  }
561
561
  renderContent() {
@@ -41,6 +41,7 @@ export interface TextProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, O
41
41
  style?: React.CSSProperties;
42
42
  type?: TypographyBaseType;
43
43
  underline?: boolean;
44
+ weight?: number;
44
45
  }
45
46
  export default class Text extends PureComponent<TextProps> {
46
47
  static propTypes: {
@@ -59,6 +60,7 @@ export default class Text extends PureComponent<TextProps> {
59
60
  className: PropTypes.Requireable<string>;
60
61
  code: PropTypes.Requireable<boolean>;
61
62
  component: PropTypes.Requireable<string>;
63
+ weight: PropTypes.Requireable<number>;
62
64
  };
63
65
  static defaultProps: {
64
66
  copyable: boolean;
@@ -34,7 +34,8 @@ Text.propTypes = {
34
34
  style: _propTypes.default.object,
35
35
  className: _propTypes.default.string,
36
36
  code: _propTypes.default.bool,
37
- component: _propTypes.default.string
37
+ component: _propTypes.default.string,
38
+ weight: _propTypes.default.number
38
39
  };
39
40
  Text.defaultProps = {
40
41
  copyable: false,
@@ -217,7 +217,7 @@ class AutoComplete extends BaseComponent {
217
217
  const innerProps = {
218
218
  disabled,
219
219
  placeholder,
220
- autofocus: autoFocus,
220
+ autoFocus: autoFocus,
221
221
  onChange: this.onSearch,
222
222
  onClear: this.onInputClear,
223
223
  'aria-label': this.props['aria-label'],
@@ -292,6 +292,14 @@ export default class Avatar extends BaseComponent {
292
292
  hoverContent,
293
293
  focusVisible
294
294
  } = this.state;
295
+ let customStyle = {};
296
+ if (!strings.SIZE.includes(size)) {
297
+ customStyle = {
298
+ width: size,
299
+ height: size
300
+ };
301
+ }
302
+ customStyle = Object.assign(Object.assign({}, customStyle), style);
295
303
  const shouldWrap = bottomSlot || topSlot || border;
296
304
  const mouseEvent = {
297
305
  onClick: onClick,
@@ -312,7 +320,7 @@ export default class Avatar extends BaseComponent {
312
320
  "x-semi-prop": "hoverContent"
313
321
  }, hoverContent) : null;
314
322
  let avatar = /*#__PURE__*/React.createElement("span", Object.assign({}, others, {
315
- style: shouldWrap ? {} : style,
323
+ style: shouldWrap ? {} : customStyle,
316
324
  className: avatarCls
317
325
  }, shouldWrap ? {} : mouseEvent, {
318
326
  role: 'listitem',
@@ -326,7 +334,7 @@ export default class Avatar extends BaseComponent {
326
334
  avatar = /*#__PURE__*/React.createElement("div", {
327
335
  style: Object.assign({
328
336
  position: "relative"
329
- }, style)
337
+ }, customStyle)
330
338
  }, avatar, /*#__PURE__*/React.createElement("span", {
331
339
  style: borderStyle,
332
340
  className: cls([`${prefixCls}-additionalBorder`, `${prefixCls}-additionalBorder-${size}`, {
@@ -343,7 +351,7 @@ export default class Avatar extends BaseComponent {
343
351
  if (shouldWrap) {
344
352
  return /*#__PURE__*/React.createElement("span", Object.assign({
345
353
  className: cls([`${prefixCls}-wrapper`]),
346
- style: style
354
+ style: customStyle
347
355
  }, mouseEvent), avatar, topSlot && ["extra-small", "small", "default", "medium", "large", "extra-large"].includes(size) && shape === "circle" && this.renderTopSlot(), bottomSlot && ["extra-small", "small", "default", "medium", "large", "extra-large"].includes(size) && this.renderBottomSlot());
348
356
  } else {
349
357
  return avatar;
@@ -233,7 +233,8 @@ class TreeSelect extends BaseComponent {
233
233
  [`${prefixcls}-selection-TriggerSearchItem-disabled`]: disabled
234
234
  });
235
235
  return /*#__PURE__*/React.createElement("span", {
236
- className: spanCls
236
+ className: spanCls,
237
+ onClick: this.foundation.onClickSingleTriggerSearchItem
237
238
  }, renderText ? renderText : placeholder);
238
239
  };
239
240
  /**
@@ -243,7 +244,7 @@ class TreeSelect extends BaseComponent {
243
244
  const {
244
245
  inputValue
245
246
  } = this.state;
246
- return /*#__PURE__*/React.createElement(React.Fragment, null, !inputValue && this.renderSingleTriggerSearchItem(), this.renderInput());
247
+ return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderInput(), !inputValue && this.renderSingleTriggerSearchItem());
247
248
  };
248
249
  this.renderSelectContent = () => {
249
250
  const {
@@ -546,7 +546,7 @@ export default class Base extends Component {
546
546
  className: `${prefixCls}-icon`,
547
547
  "x-semi-prop": "icon"
548
548
  }, isSemiIcon(icon) ? /*#__PURE__*/React.cloneElement(icon, {
549
- realSize: iconSize
549
+ size: iconSize
550
550
  }) : icon);
551
551
  }
552
552
  renderContent() {
@@ -41,6 +41,7 @@ export interface TextProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, O
41
41
  style?: React.CSSProperties;
42
42
  type?: TypographyBaseType;
43
43
  underline?: boolean;
44
+ weight?: number;
44
45
  }
45
46
  export default class Text extends PureComponent<TextProps> {
46
47
  static propTypes: {
@@ -59,6 +60,7 @@ export default class Text extends PureComponent<TextProps> {
59
60
  className: PropTypes.Requireable<string>;
60
61
  code: PropTypes.Requireable<boolean>;
61
62
  component: PropTypes.Requireable<string>;
63
+ weight: PropTypes.Requireable<number>;
62
64
  };
63
65
  static defaultProps: {
64
66
  copyable: boolean;
@@ -24,7 +24,8 @@ Text.propTypes = {
24
24
  style: PropTypes.object,
25
25
  className: PropTypes.string,
26
26
  code: PropTypes.bool,
27
- component: PropTypes.string
27
+ component: PropTypes.string,
28
+ weight: PropTypes.number
28
29
  };
29
30
  Text.defaultProps = {
30
31
  copyable: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.60.0-beta.0",
3
+ "version": "2.60.1",
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.60.0-beta.0",
24
- "@douyinfe/semi-animation-react": "2.60.0-beta.0",
25
- "@douyinfe/semi-foundation": "2.60.0-beta.0",
26
- "@douyinfe/semi-icons": "2.60.0-beta.0",
27
- "@douyinfe/semi-illustrations": "2.60.0-beta.0",
28
- "@douyinfe/semi-theme-default": "2.60.0-beta.0",
23
+ "@douyinfe/semi-animation": "2.60.1",
24
+ "@douyinfe/semi-animation-react": "2.60.1",
25
+ "@douyinfe/semi-foundation": "2.60.1",
26
+ "@douyinfe/semi-icons": "2.60.1",
27
+ "@douyinfe/semi-illustrations": "2.60.1",
28
+ "@douyinfe/semi-theme-default": "2.60.1",
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": "4091f5bc7f66ef4668aeb0c95ae64ef6bea70393",
78
+ "gitHead": "9339ff83a2e2c141f7152b56dd544fe7576d667d",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",