@douyinfe/semi-ui 2.58.0-beta.0 → 2.58.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.
Files changed (73) hide show
  1. package/dist/css/semi.css +85 -9
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +82 -16
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/_base/base.css +2 -2
  8. package/lib/cjs/button/Button.d.ts +1 -1
  9. package/lib/cjs/button/Button.js +1 -0
  10. package/lib/cjs/locale/interface.d.ts +3 -0
  11. package/lib/cjs/locale/source/ar.js +3 -0
  12. package/lib/cjs/locale/source/de.js +3 -0
  13. package/lib/cjs/locale/source/en_GB.js +3 -0
  14. package/lib/cjs/locale/source/en_US.js +3 -0
  15. package/lib/cjs/locale/source/es.js +3 -0
  16. package/lib/cjs/locale/source/fr.js +3 -0
  17. package/lib/cjs/locale/source/id_ID.js +3 -0
  18. package/lib/cjs/locale/source/it.js +3 -0
  19. package/lib/cjs/locale/source/ja_JP.js +3 -0
  20. package/lib/cjs/locale/source/ko_KR.js +3 -0
  21. package/lib/cjs/locale/source/ms_MY.js +3 -0
  22. package/lib/cjs/locale/source/nl_NL.js +3 -0
  23. package/lib/cjs/locale/source/pl_PL.js +3 -0
  24. package/lib/cjs/locale/source/pt_BR.js +3 -0
  25. package/lib/cjs/locale/source/ro.js +3 -0
  26. package/lib/cjs/locale/source/ru_RU.js +3 -0
  27. package/lib/cjs/locale/source/sv_SE.js +3 -0
  28. package/lib/cjs/locale/source/th_TH.js +3 -0
  29. package/lib/cjs/locale/source/tr_TR.js +3 -0
  30. package/lib/cjs/locale/source/vi_VN.js +3 -0
  31. package/lib/cjs/locale/source/zh_CN.js +3 -0
  32. package/lib/cjs/locale/source/zh_TW.js +3 -0
  33. package/lib/cjs/slider/index.js +13 -8
  34. package/lib/cjs/tabs/TabBar.d.ts +4 -0
  35. package/lib/cjs/tabs/TabBar.js +55 -3
  36. package/lib/cjs/tabs/TabItem.js +3 -1
  37. package/lib/cjs/tabs/index.d.ts +1 -0
  38. package/lib/cjs/tabs/index.js +7 -4
  39. package/lib/cjs/tabs/interface.d.ts +7 -0
  40. package/lib/es/_base/base.css +2 -2
  41. package/lib/es/button/Button.d.ts +1 -1
  42. package/lib/es/button/Button.js +1 -0
  43. package/lib/es/locale/interface.d.ts +3 -0
  44. package/lib/es/locale/source/ar.js +3 -0
  45. package/lib/es/locale/source/de.js +3 -0
  46. package/lib/es/locale/source/en_GB.js +3 -0
  47. package/lib/es/locale/source/en_US.js +3 -0
  48. package/lib/es/locale/source/es.js +3 -0
  49. package/lib/es/locale/source/fr.js +3 -0
  50. package/lib/es/locale/source/id_ID.js +3 -0
  51. package/lib/es/locale/source/it.js +3 -0
  52. package/lib/es/locale/source/ja_JP.js +3 -0
  53. package/lib/es/locale/source/ko_KR.js +3 -0
  54. package/lib/es/locale/source/ms_MY.js +3 -0
  55. package/lib/es/locale/source/nl_NL.js +3 -0
  56. package/lib/es/locale/source/pl_PL.js +3 -0
  57. package/lib/es/locale/source/pt_BR.js +3 -0
  58. package/lib/es/locale/source/ro.js +3 -0
  59. package/lib/es/locale/source/ru_RU.js +3 -0
  60. package/lib/es/locale/source/sv_SE.js +3 -0
  61. package/lib/es/locale/source/th_TH.js +3 -0
  62. package/lib/es/locale/source/tr_TR.js +3 -0
  63. package/lib/es/locale/source/vi_VN.js +3 -0
  64. package/lib/es/locale/source/zh_CN.js +3 -0
  65. package/lib/es/locale/source/zh_TW.js +3 -0
  66. package/lib/es/slider/index.js +13 -8
  67. package/lib/es/tabs/TabBar.d.ts +4 -0
  68. package/lib/es/tabs/TabBar.js +56 -4
  69. package/lib/es/tabs/TabItem.js +3 -1
  70. package/lib/es/tabs/index.d.ts +1 -0
  71. package/lib/es/tabs/index.js +7 -4
  72. package/lib/es/tabs/interface.d.ts +7 -0
  73. package/package.json +8 -8
@@ -203,7 +203,7 @@ body, body .semi-always-light, :host, :host .semi-always-light {
203
203
  --semi-yellow-9: 83,72,0;
204
204
  }
205
205
 
206
- body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
206
+ body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
207
207
  --semi-red-0: 108,9,11;
208
208
  --semi-red-1: 144,17,16;
209
209
  --semi-red-2: 180,32,25;
@@ -478,7 +478,7 @@ body, body[theme-mode=dark] .semi-always-light, :host, :host .semi-always-light
478
478
  --semi-color-data-19: rgba(188, 198, 255, 1);
479
479
  }
480
480
 
481
- body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
481
+ body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
482
482
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
483
483
  -webkit-font-smoothing: antialiased;
484
484
  --semi-color-white: rgba(228, 231, 245, 1);
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/cjs/button/button.css';
4
4
  import { noop } from '@douyinfe/semi-foundation/lib/cjs/utils/function';
5
5
  export type HtmlType = 'button' | 'reset' | 'submit';
6
6
  export type Size = 'default' | 'small' | 'large';
7
- export type Theme = 'solid' | 'borderless' | 'light';
7
+ export type Theme = 'solid' | 'borderless' | 'light' | 'outline';
8
8
  export type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
9
9
  export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
10
10
  id?: string;
@@ -60,6 +60,7 @@ class Button extends _react.PureComponent {
60
60
  [`${prefixCls}-block`]: block,
61
61
  [`${prefixCls}-circle`]: circle,
62
62
  [`${prefixCls}-borderless`]: theme === 'borderless',
63
+ [`${prefixCls}-outline`]: theme === "outline",
63
64
  [`${prefixCls}-${type}-disabled`]: disabled && type
64
65
  }, className),
65
66
  type: htmlType,
@@ -12,6 +12,9 @@ export interface Locale {
12
12
  confirm: string;
13
13
  cancel: string;
14
14
  };
15
+ Tabs: {
16
+ more: string;
17
+ };
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: string;
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'تؤكد',
19
19
  cancel: 'إلغاء'
20
20
  },
21
+ Tabs: {
22
+ more: "أكثر"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'حدد الوقت',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Bestätigen',
19
19
  cancel: 'Abbrechen'
20
20
  },
21
+ Tabs: {
22
+ more: "Mehr"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Zeit auswählen',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Confirm',
19
19
  cancel: 'Cancel'
20
20
  },
21
+ Tabs: {
22
+ more: "More"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Select time',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Confirm',
19
19
  cancel: 'Cancel'
20
20
  },
21
+ Tabs: {
22
+ more: "More"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Select time',
@@ -22,6 +22,9 @@ const locale = {
22
22
  confirm: 'Aceptar',
23
23
  cancel: 'Cancelar'
24
24
  },
25
+ Tabs: {
26
+ more: "Más"
27
+ },
25
28
  TimePicker: {
26
29
  placeholder: {
27
30
  time: 'Seleccionar hora',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Confirmer',
19
19
  cancel: 'Annuler'
20
20
  },
21
+ Tabs: {
22
+ more: "Plus"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Sélectionner temps',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Konfirmasi',
19
19
  cancel: 'Batalkan'
20
20
  },
21
+ Tabs: {
22
+ more: "Lagi"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Pilih waktu',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Conferma',
19
19
  cancel: 'Cancella'
20
20
  },
21
+ Tabs: {
22
+ more: "Di più"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Seleziona ora',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: '確認する',
19
19
  cancel: 'キャンセル'
20
20
  },
21
+ Tabs: {
22
+ more: "もっと"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: '時間を選択してください',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: '확인',
19
19
  cancel: '취소'
20
20
  },
21
+ Tabs: {
22
+ more: "더"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: '시간 선택',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Sahkan',
19
19
  cancel: 'Batal'
20
20
  },
21
+ Tabs: {
22
+ more: "Lagi"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Pilih masa',
@@ -23,6 +23,9 @@ const local = {
23
23
  confirm: 'Bevestigen',
24
24
  cancel: 'Annuleren'
25
25
  },
26
+ Tabs: {
27
+ more: "Meer"
28
+ },
26
29
  TimePicker: {
27
30
  placeholder: {
28
31
  time: 'Tijd selecteren',
@@ -23,6 +23,9 @@ const local = {
23
23
  confirm: 'Potwierdź',
24
24
  cancel: 'Anuluj'
25
25
  },
26
+ Tabs: {
27
+ more: "Więcej"
28
+ },
26
29
  TimePicker: {
27
30
  placeholder: {
28
31
  time: 'Wybierz czas',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'OK',
19
19
  cancel: 'Cancelar'
20
20
  },
21
+ Tabs: {
22
+ more: "Mais"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Por favor escolha a hora',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Confirmă',
19
19
  cancel: 'Anulează'
20
20
  },
21
+ Tabs: {
22
+ more: "Mai mult"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Selectează timpul',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'подтвердить',
19
19
  cancel: 'отмена'
20
20
  },
21
+ Tabs: {
22
+ more: "Более"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Выбрать время',
@@ -22,6 +22,9 @@ const local = {
22
22
  confirm: 'Bekräfta',
23
23
  cancel: 'Avbryt'
24
24
  },
25
+ Tabs: {
26
+ more: "Mer"
27
+ },
25
28
  TimePicker: {
26
29
  placeholder: {
27
30
  time: 'Välj tid',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'ตกลง',
19
19
  cancel: 'ยกเลิก'
20
20
  },
21
+ Tabs: {
22
+ more: "มากกว่า"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'โปรดเลือกเวลา',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Tamam',
19
19
  cancel: 'İptal'
20
20
  },
21
+ Tabs: {
22
+ more: "Daha"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Lütfen bir zaman seçin',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: 'Xác nhận',
19
19
  cancel: 'Huỷ bỏ'
20
20
  },
21
+ Tabs: {
22
+ more: "Hơn"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: 'Chọn thời gian',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: '确定',
19
19
  cancel: '取消'
20
20
  },
21
+ Tabs: {
22
+ more: "更多"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: '请选择时间',
@@ -18,6 +18,9 @@ const local = {
18
18
  confirm: '確定',
19
19
  cancel: '取消'
20
20
  },
21
+ Tabs: {
22
+ more: "更多"
23
+ },
21
24
  TimePicker: {
22
25
  placeholder: {
23
26
  time: '請選擇時間',
@@ -273,11 +273,11 @@ class Slider extends _baseComponent.default {
273
273
  const minPercent = percentInfo.min;
274
274
  const maxPercent = percentInfo.max;
275
275
  let trackStyle = !vertical ? {
276
- width: range ? `${(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
277
- left: range ? `${minPercent * 100}%` : 0
276
+ width: range ? `${Math.abs(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
277
+ left: range ? `${Math.min(minPercent, maxPercent) * 100}%` : 0
278
278
  } : {
279
- height: range ? `${(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
280
- top: range ? `${minPercent * 100}%` : 0
279
+ height: range ? `${Math.abs(maxPercent - minPercent) * 100}%` : `${minPercent * 100}%`,
280
+ top: range ? `${Math.min(minPercent, maxPercent) * 100}%` : 0
281
281
  };
282
282
  trackStyle = included ? trackStyle : {};
283
283
  return (
@@ -392,11 +392,13 @@ class Slider extends _baseComponent.default {
392
392
  var _this = this;
393
393
  return Object.assign(Object.assign({}, super.adapter), {
394
394
  getSliderLengths: () => {
395
+ var _a;
395
396
  if (this.sliderEl && this.sliderEl.current) {
396
397
  const rect = this.sliderEl.current.getBoundingClientRect();
398
+ const offsetParentRect = (_a = this.sliderEl.current.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
397
399
  const offset = {
398
- x: this.sliderEl.current.offsetLeft,
399
- y: this.sliderEl.current.offsetTop
400
+ x: offsetParentRect ? rect.left - offsetParentRect.left : this.sliderEl.current.offsetLeft,
401
+ y: offsetParentRect ? rect.top - offsetParentRect.top : this.sliderEl.current.offsetTop
400
402
  };
401
403
  return {
402
404
  sliderX: offset.x,
@@ -453,7 +455,9 @@ class Slider extends _baseComponent.default {
453
455
  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _noop2.default;
454
456
  this.setState(stateObj, callback);
455
457
  },
456
- notifyChange: cbValue => this.props.onChange(cbValue),
458
+ notifyChange: cbValue => {
459
+ this.props.onChange(Array.isArray(cbValue) ? [...cbValue].sort() : cbValue);
460
+ },
457
461
  setDragging: value => {
458
462
  this.dragging = value;
459
463
  },
@@ -606,7 +610,8 @@ class Slider extends _baseComponent.default {
606
610
  [`${prefixCls}`]: !vertical,
607
611
  [_constants.cssClasses.VERTICAL]: vertical
608
612
  });
609
- const ariaLabel = range ? `Range: ${this._getAriaValueText(currentValue[0], 0)} to ${this._getAriaValueText(currentValue[1], 1)}` : undefined;
613
+ const fixedCurrentValue = Array.isArray(currentValue) ? [...currentValue].sort() : currentValue;
614
+ const ariaLabel = range ? `Range: ${this._getAriaValueText(fixedCurrentValue[0], 0)} to ${this._getAriaValueText(fixedCurrentValue[1], 1)}` : undefined;
610
615
  const slider = /*#__PURE__*/_react.default.createElement("div", Object.assign({
611
616
  className: wrapperClass,
612
617
  style: style,
@@ -1,5 +1,6 @@
1
1
  import React, { MouseEvent, ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { DropdownProps } from '../dropdown';
3
4
  import { TabBarProps, PlainTab } from './interface';
4
5
  export interface TabBarState {
5
6
  endInd: number;
@@ -25,6 +26,7 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
25
26
  type: PropTypes.Requireable<string>;
26
27
  closable: PropTypes.Requireable<boolean>;
27
28
  deleteTabItem: PropTypes.Requireable<(...args: any[]) => any>;
29
+ more: PropTypes.Requireable<NonNullable<number | object>>;
28
30
  };
29
31
  constructor(props: TabBarProps);
30
32
  componentDidMount(): void;
@@ -38,6 +40,8 @@ declare class TabBar extends React.Component<TabBarProps, TabBarState> {
38
40
  renderCollapse: (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end') => ReactNode;
39
41
  renderOverflow: (items: any[]) => Array<ReactNode>;
40
42
  renderCollapsedTab: () => ReactNode;
43
+ renderWithMoreTrigger: () => ReactNode;
44
+ renderMoreDropdown: (panels: PlainTab[], dropDownProps: DropdownProps, trigger: ReactNode) => ReactNode;
41
45
  render(): ReactNode;
42
46
  private _isActive;
43
47
  private _getItemKey;
@@ -17,6 +17,7 @@ var _button = _interopRequireDefault(require("../button"));
17
17
  var _semiIcons = require("@douyinfe/semi-icons");
18
18
  var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
19
19
  var _TabItem = _interopRequireDefault(require("./TabItem"));
20
+ var _localeConsumer = _interopRequireDefault(require("../locale/localeConsumer"));
20
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
22
  var __rest = void 0 && (void 0).__rest || function (s, e) {
22
23
  var t = {};
@@ -163,6 +164,55 @@ class TabBar extends _react.default.Component {
163
164
  visibleItemRenderer: this.renderTabItem
164
165
  });
165
166
  };
167
+ this.renderWithMoreTrigger = () => {
168
+ const {
169
+ list,
170
+ more
171
+ } = this.props;
172
+ let tabElements = [];
173
+ let moreTrigger = /*#__PURE__*/_react.default.createElement("div", {
174
+ className: (0, _classnames.default)({
175
+ [`${_constants.cssClasses.TABS_BAR}-more-trigger`]: true,
176
+ [`${_constants.cssClasses.TABS_BAR}-more-trigger-${this.props.type}`]: true
177
+ })
178
+ }, /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
179
+ componentName: "Tabs"
180
+ }, (locale, localeCode) => /*#__PURE__*/_react.default.createElement("div", {
181
+ className: `${_constants.cssClasses.TABS_BAR}-more-trigger-content`
182
+ }, /*#__PURE__*/_react.default.createElement("div", null, locale.more), /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronDown, {
183
+ className: `${_constants.cssClasses.TABS_BAR}-more-trigger-content-icon`
184
+ }))));
185
+ let keepCount;
186
+ if (typeof more === "number") {
187
+ keepCount = list.length - Math.min(more, list.length);
188
+ tabElements = list.slice(0, keepCount).map(panel => this.renderTabItem(panel));
189
+ } else if (typeof more === 'object') {
190
+ keepCount = list.length - Math.min(more.count, list.length);
191
+ tabElements = list.slice(0, keepCount).map(panel => this.renderTabItem(panel));
192
+ if (more.render) {
193
+ moreTrigger = more.render();
194
+ }
195
+ } else if (more !== undefined) {
196
+ throw new Error("[Semi Tabs]: invalid tab props format: more");
197
+ }
198
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, tabElements, this.renderMoreDropdown(list.slice(keepCount), more === null || more === void 0 ? void 0 : more['dropdownProps'], moreTrigger));
199
+ };
200
+ this.renderMoreDropdown = (panels, dropDownProps, trigger) => {
201
+ return /*#__PURE__*/_react.default.createElement(_dropdown.default, Object.assign({
202
+ trigger: 'hover',
203
+ showTick: true,
204
+ position: 'bottomLeft',
205
+ className: `${_constants.cssClasses.TABS_BAR}-more-dropdown-${this.props.type}`,
206
+ clickToHide: true,
207
+ menu: panels.map(panel => ({
208
+ node: 'item',
209
+ name: panel.tab,
210
+ icon: panel.icon,
211
+ onClick: e => this.props.onTabClick(panel.itemKey, e),
212
+ active: this.props.activeKey === panel.itemKey
213
+ }))
214
+ }, dropDownProps), trigger);
215
+ };
166
216
  this._isActive = key => key === this.props.activeKey;
167
217
  this._getItemKey = key => `${key}-bar`;
168
218
  this.state = {
@@ -212,9 +262,10 @@ class TabBar extends _react.default.Component {
212
262
  className,
213
263
  list,
214
264
  tabPosition,
265
+ more,
215
266
  collapsible
216
267
  } = _a,
217
- restProps = __rest(_a, ["type", "style", "className", "list", "tabPosition", "collapsible"]);
268
+ restProps = __rest(_a, ["type", "style", "className", "list", "tabPosition", "more", "collapsible"]);
218
269
  const classNames = (0, _classnames.default)(className, {
219
270
  [_constants.cssClasses.TABS_BAR]: true,
220
271
  [_constants.cssClasses.TABS_BAR_LINE]: type === 'line',
@@ -224,7 +275,7 @@ class TabBar extends _react.default.Component {
224
275
  [`${_constants.cssClasses.TABS_BAR}-collapse`]: collapsible
225
276
  });
226
277
  const extra = this.renderExtra();
227
- const contents = collapsible ? this.renderCollapsedTab() : this.renderTabComponents(list);
278
+ const contents = collapsible ? this.renderCollapsedTab() : more ? this.renderWithMoreTrigger() : this.renderTabComponents(list);
228
279
  return /*#__PURE__*/_react.default.createElement("div", Object.assign({
229
280
  role: "tablist",
230
281
  "aria-orientation": tabPosition === "left" ? "vertical" : "horizontal",
@@ -247,7 +298,8 @@ TabBar.propTypes = {
247
298
  tabPosition: _propTypes.default.oneOf(_constants.strings.POSITION_MAP),
248
299
  type: _propTypes.default.oneOf(_constants.strings.TYPE_MAP),
249
300
  closable: _propTypes.default.bool,
250
- deleteTabItem: _propTypes.default.func
301
+ deleteTabItem: _propTypes.default.func,
302
+ more: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object])
251
303
  };
252
304
  var _default = TabBar;
253
305
  exports.default = _default;
@@ -43,7 +43,9 @@ const TabItem = (props, ref) => {
43
43
  onClick: e => deleteTabItem(itemKey, e)
44
44
  }) : null;
45
45
  }, [type, closable, deleteTabItem, itemKey]);
46
- const renderIcon = (0, _react.useCallback)(icon => /*#__PURE__*/_react.default.createElement("span", null, icon), []);
46
+ const renderIcon = (0, _react.useCallback)(icon => /*#__PURE__*/_react.default.createElement("span", {
47
+ className: `${_constants.cssClasses.TABS_BAR}-icon`
48
+ }, icon), []);
47
49
  const handleKeyDownInItem = (0, _react.useCallback)(event => {
48
50
  handleKeyDown && handleKeyDown(event, itemKey, closable);
49
51
  }, [handleKeyDown, itemKey, closable]);
@@ -37,6 +37,7 @@ declare class Tabs extends BaseComponent<TabsProps, TabsState> {
37
37
  type: PropTypes.Requireable<string>;
38
38
  onTabClose: PropTypes.Requireable<(...args: any[]) => any>;
39
39
  preventScroll: PropTypes.Requireable<boolean>;
40
+ more: PropTypes.Requireable<NonNullable<number | object>>;
40
41
  };
41
42
  static __SemiComponentName__: string;
42
43
  static defaultProps: TabsProps;
@@ -243,9 +243,10 @@ class Tabs extends _baseComponent.default {
243
243
  tabBarStyle,
244
244
  tabPaneMotion,
245
245
  tabPosition,
246
- type
246
+ type,
247
+ more
247
248
  } = _a,
248
- restProps = __rest(_a, ["children", "className", "collapsible", "contentStyle", "keepDOM", "lazyRender", "renderTabBar", "size", "style", "tabBarClassName", "tabBarExtraContent", "tabBarStyle", "tabPaneMotion", "tabPosition", "type"]);
249
+ restProps = __rest(_a, ["children", "className", "collapsible", "contentStyle", "keepDOM", "lazyRender", "renderTabBar", "size", "style", "tabBarClassName", "tabBarExtraContent", "tabBarStyle", "tabPaneMotion", "tabPosition", "type", "more"]);
249
250
  const {
250
251
  panes,
251
252
  activeKey
@@ -270,7 +271,8 @@ class Tabs extends _baseComponent.default {
270
271
  tabPosition,
271
272
  type,
272
273
  deleteTabItem: this.deleteTabItem,
273
- handleKeyDown: this.foundation.handleKeyDown
274
+ handleKeyDown: this.foundation.handleKeyDown,
275
+ more
274
276
  };
275
277
  const tabBar = renderTabBar ? renderTabBar(tabBarProps, _TabBar.default) : /*#__PURE__*/_react.default.createElement(_TabBar.default, Object.assign({}, tabBarProps));
276
278
  const content = keepDOM ? children : this.getActiveItem();
@@ -317,7 +319,8 @@ Tabs.propTypes = {
317
319
  tabPosition: _propTypes.default.oneOf(_constants.strings.POSITION_MAP),
318
320
  type: _propTypes.default.oneOf(_constants.strings.TYPE_MAP),
319
321
  onTabClose: _propTypes.default.func,
320
- preventScroll: _propTypes.default.bool
322
+ preventScroll: _propTypes.default.bool,
323
+ more: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object])
321
324
  };
322
325
  Tabs.__SemiComponentName__ = "Tabs";
323
326
  Tabs.defaultProps = (0, _utils.getDefaultPropsFromGlobalConfig)(Tabs.__SemiComponentName__, {
@@ -1,6 +1,7 @@
1
1
  import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
2
2
  import { Motion } from '../_base/base';
3
3
  import TabBar from './TabBar';
4
+ import { DropdownProps } from "../dropdown";
4
5
  export type TabType = 'line' | 'card' | 'button';
5
6
  export type TabSize = 'small' | 'medium' | 'large';
6
7
  export type TabPosition = 'top' | 'left';
@@ -34,6 +35,11 @@ export interface TabsProps {
34
35
  type?: TabType;
35
36
  onTabClose?: (tabKey: string) => void;
36
37
  preventScroll?: boolean;
38
+ more?: number | {
39
+ count: number;
40
+ render?: () => ReactNode;
41
+ dropdownProps?: DropdownProps;
42
+ };
37
43
  }
38
44
  export interface TabBarProps {
39
45
  activeKey?: string;
@@ -51,6 +57,7 @@ export interface TabBarProps {
51
57
  closable?: boolean;
52
58
  deleteTabItem?: (tabKey: string, event: MouseEvent<Element>) => void;
53
59
  handleKeyDown?: (event: React.KeyboardEvent, itemKey: string, closable: boolean) => void;
60
+ more?: TabsProps['more'];
54
61
  }
55
62
  export interface TabPaneProps {
56
63
  className?: string;
@@ -203,7 +203,7 @@ body, body .semi-always-light, :host, :host .semi-always-light {
203
203
  --semi-yellow-9: 83,72,0;
204
204
  }
205
205
 
206
- body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
206
+ body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
207
207
  --semi-red-0: 108,9,11;
208
208
  --semi-red-1: 144,17,16;
209
209
  --semi-red-2: 180,32,25;
@@ -478,7 +478,7 @@ body, body[theme-mode=dark] .semi-always-light, :host, :host .semi-always-light
478
478
  --semi-color-data-19: rgba(188, 198, 255, 1);
479
479
  }
480
480
 
481
- body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
481
+ body[theme-mode=dark], body .semi-always-dark, :host([theme-mode=dark]), :host .semi-always-dark {
482
482
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
483
483
  -webkit-font-smoothing: antialiased;
484
484
  --semi-color-white: rgba(228, 231, 245, 1);
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/es/button/button.css';
4
4
  import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
5
5
  export type HtmlType = 'button' | 'reset' | 'submit';
6
6
  export type Size = 'default' | 'small' | 'large';
7
- export type Theme = 'solid' | 'borderless' | 'light';
7
+ export type Theme = 'solid' | 'borderless' | 'light' | 'outline';
8
8
  export type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
9
9
  export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
10
10
  id?: string;
@@ -51,6 +51,7 @@ export default class Button extends PureComponent {
51
51
  [`${prefixCls}-block`]: block,
52
52
  [`${prefixCls}-circle`]: circle,
53
53
  [`${prefixCls}-borderless`]: theme === 'borderless',
54
+ [`${prefixCls}-outline`]: theme === "outline",
54
55
  [`${prefixCls}-${type}-disabled`]: disabled && type
55
56
  }, className),
56
57
  type: htmlType,
@@ -12,6 +12,9 @@ export interface Locale {
12
12
  confirm: string;
13
13
  cancel: string;
14
14
  };
15
+ Tabs: {
16
+ more: string;
17
+ };
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: string;
@@ -12,6 +12,9 @@ const local = {
12
12
  confirm: 'تؤكد',
13
13
  cancel: 'إلغاء'
14
14
  },
15
+ Tabs: {
16
+ more: "أكثر"
17
+ },
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: 'حدد الوقت',
@@ -12,6 +12,9 @@ const local = {
12
12
  confirm: 'Bestätigen',
13
13
  cancel: 'Abbrechen'
14
14
  },
15
+ Tabs: {
16
+ more: "Mehr"
17
+ },
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: 'Zeit auswählen',
@@ -12,6 +12,9 @@ const local = {
12
12
  confirm: 'Confirm',
13
13
  cancel: 'Cancel'
14
14
  },
15
+ Tabs: {
16
+ more: "More"
17
+ },
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: 'Select time',
@@ -12,6 +12,9 @@ const local = {
12
12
  confirm: 'Confirm',
13
13
  cancel: 'Cancel'
14
14
  },
15
+ Tabs: {
16
+ more: "More"
17
+ },
15
18
  TimePicker: {
16
19
  placeholder: {
17
20
  time: 'Select time',
@@ -16,6 +16,9 @@ const locale = {
16
16
  confirm: 'Aceptar',
17
17
  cancel: 'Cancelar'
18
18
  },
19
+ Tabs: {
20
+ more: "Más"
21
+ },
19
22
  TimePicker: {
20
23
  placeholder: {
21
24
  time: 'Seleccionar hora',