@douyinfe/semi-ui 2.19.2-alpha.0 → 2.20.0-beta.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.
Files changed (139) hide show
  1. package/dist/css/semi.css +243 -968
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +3449 -452
  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/button/Button.d.ts +1 -1
  8. package/lib/cjs/button/index.d.ts +1 -1
  9. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  10. package/lib/cjs/carousel/index.d.ts +1 -1
  11. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  12. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  13. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  14. package/lib/cjs/image/image.d.ts +48 -0
  15. package/lib/cjs/image/image.js +248 -0
  16. package/lib/cjs/image/index.d.ts +6 -0
  17. package/lib/cjs/image/index.js +29 -0
  18. package/lib/cjs/image/interface.d.ts +178 -0
  19. package/lib/cjs/image/interface.js +5 -0
  20. package/lib/cjs/image/preview.d.ts +81 -0
  21. package/lib/cjs/image/preview.js +249 -0
  22. package/lib/cjs/image/previewContext.d.ts +12 -0
  23. package/lib/cjs/image/previewContext.js +11 -0
  24. package/lib/cjs/image/previewFooter.d.ts +62 -0
  25. package/lib/cjs/image/previewFooter.js +337 -0
  26. package/lib/cjs/image/previewHeader.d.ts +4 -0
  27. package/lib/cjs/image/previewHeader.js +57 -0
  28. package/lib/cjs/image/previewImage.d.ts +49 -0
  29. package/lib/cjs/image/previewImage.js +253 -0
  30. package/lib/cjs/image/previewInner.d.ts +87 -0
  31. package/lib/cjs/image/previewInner.js +443 -0
  32. package/lib/cjs/index.d.ts +2 -0
  33. package/lib/cjs/index.js +14 -0
  34. package/lib/cjs/locale/interface.d.ts +13 -0
  35. package/lib/cjs/locale/source/ar.js +13 -0
  36. package/lib/cjs/locale/source/de.js +13 -0
  37. package/lib/cjs/locale/source/en_GB.js +13 -0
  38. package/lib/cjs/locale/source/en_US.js +13 -0
  39. package/lib/cjs/locale/source/es.js +13 -0
  40. package/lib/cjs/locale/source/fr.js +13 -0
  41. package/lib/cjs/locale/source/id_ID.js +13 -0
  42. package/lib/cjs/locale/source/it.js +13 -0
  43. package/lib/cjs/locale/source/ja_JP.js +13 -0
  44. package/lib/cjs/locale/source/ko_KR.js +13 -0
  45. package/lib/cjs/locale/source/ms_MY.js +13 -0
  46. package/lib/cjs/locale/source/pt_BR.js +13 -0
  47. package/lib/cjs/locale/source/ru_RU.js +13 -0
  48. package/lib/cjs/locale/source/th_TH.js +13 -0
  49. package/lib/cjs/locale/source/tr_TR.js +13 -0
  50. package/lib/cjs/locale/source/vi_VN.js +13 -0
  51. package/lib/cjs/locale/source/zh_CN.js +13 -0
  52. package/lib/cjs/locale/source/zh_TW.js +13 -0
  53. package/lib/cjs/progress/index.d.ts +10 -2
  54. package/lib/cjs/progress/index.js +37 -8
  55. package/lib/cjs/radio/radio.d.ts +1 -1
  56. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  57. package/lib/cjs/skeleton/item.d.ts +1 -0
  58. package/lib/cjs/skeleton/item.js +10 -4
  59. package/lib/cjs/tag/index.js +5 -1
  60. package/lib/cjs/tag/interface.d.ts +2 -0
  61. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  62. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  63. package/lib/cjs/timePicker/index.d.ts +2 -2
  64. package/lib/cjs/toast/index.d.ts +9 -0
  65. package/lib/cjs/toast/index.js +50 -10
  66. package/lib/cjs/toast/toast.d.ts +1 -0
  67. package/lib/cjs/toast/toast.js +4 -0
  68. package/lib/cjs/typography/base.d.ts +1 -1
  69. package/lib/cjs/typography/paragraph.d.ts +1 -1
  70. package/lib/cjs/typography/text.d.ts +1 -1
  71. package/lib/cjs/typography/title.d.ts +2 -2
  72. package/lib/cjs/upload/index.d.ts +1 -1
  73. package/lib/es/button/Button.d.ts +1 -1
  74. package/lib/es/button/index.d.ts +1 -1
  75. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  76. package/lib/es/carousel/index.d.ts +1 -1
  77. package/lib/es/datePicker/dateInput.d.ts +1 -1
  78. package/lib/es/datePicker/datePicker.d.ts +1 -1
  79. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  80. package/lib/es/image/image.d.ts +48 -0
  81. package/lib/es/image/image.js +224 -0
  82. package/lib/es/image/index.d.ts +6 -0
  83. package/lib/es/image/index.js +5 -0
  84. package/lib/es/image/interface.d.ts +178 -0
  85. package/lib/es/image/interface.js +1 -0
  86. package/lib/es/image/preview.d.ts +81 -0
  87. package/lib/es/image/preview.js +229 -0
  88. package/lib/es/image/previewContext.d.ts +12 -0
  89. package/lib/es/image/previewContext.js +2 -0
  90. package/lib/es/image/previewFooter.d.ts +62 -0
  91. package/lib/es/image/previewFooter.js +301 -0
  92. package/lib/es/image/previewHeader.d.ts +4 -0
  93. package/lib/es/image/previewHeader.js +38 -0
  94. package/lib/es/image/previewImage.d.ts +49 -0
  95. package/lib/es/image/previewImage.js +235 -0
  96. package/lib/es/image/previewInner.d.ts +87 -0
  97. package/lib/es/image/previewInner.js +419 -0
  98. package/lib/es/index.d.ts +2 -0
  99. package/lib/es/index.js +3 -1
  100. package/lib/es/locale/interface.d.ts +13 -0
  101. package/lib/es/locale/source/ar.js +13 -0
  102. package/lib/es/locale/source/de.js +13 -0
  103. package/lib/es/locale/source/en_GB.js +13 -0
  104. package/lib/es/locale/source/en_US.js +13 -0
  105. package/lib/es/locale/source/es.js +13 -0
  106. package/lib/es/locale/source/fr.js +13 -0
  107. package/lib/es/locale/source/id_ID.js +13 -0
  108. package/lib/es/locale/source/it.js +13 -0
  109. package/lib/es/locale/source/ja_JP.js +13 -0
  110. package/lib/es/locale/source/ko_KR.js +13 -0
  111. package/lib/es/locale/source/ms_MY.js +13 -0
  112. package/lib/es/locale/source/pt_BR.js +13 -0
  113. package/lib/es/locale/source/ru_RU.js +13 -0
  114. package/lib/es/locale/source/th_TH.js +13 -0
  115. package/lib/es/locale/source/tr_TR.js +13 -0
  116. package/lib/es/locale/source/vi_VN.js +13 -0
  117. package/lib/es/locale/source/zh_CN.js +13 -0
  118. package/lib/es/locale/source/zh_TW.js +13 -0
  119. package/lib/es/progress/index.d.ts +10 -2
  120. package/lib/es/progress/index.js +36 -8
  121. package/lib/es/radio/radio.d.ts +1 -1
  122. package/lib/es/radio/radioGroup.d.ts +1 -1
  123. package/lib/es/skeleton/item.d.ts +1 -0
  124. package/lib/es/skeleton/item.js +10 -4
  125. package/lib/es/tag/index.js +5 -1
  126. package/lib/es/tag/interface.d.ts +2 -0
  127. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  128. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  129. package/lib/es/timePicker/index.d.ts +2 -2
  130. package/lib/es/toast/index.d.ts +9 -0
  131. package/lib/es/toast/index.js +50 -10
  132. package/lib/es/toast/toast.d.ts +1 -0
  133. package/lib/es/toast/toast.js +4 -0
  134. package/lib/es/typography/base.d.ts +1 -1
  135. package/lib/es/typography/paragraph.d.ts +1 -1
  136. package/lib/es/typography/text.d.ts +1 -1
  137. package/lib/es/typography/title.d.ts +2 -2
  138. package/lib/es/upload/index.d.ts +1 -1
  139. package/package.json +8 -8
@@ -159,6 +159,19 @@ const local = {
159
159
  },
160
160
  Form: {
161
161
  optional: '(선택 과목)'
162
+ },
163
+ Image: {
164
+ preview: '시사',
165
+ loading: '로딩 중',
166
+ loadError: '불러 오지 못했습니다',
167
+ prevTip: '이전',
168
+ nextTip: '다음',
169
+ zoomInTip: '확대',
170
+ zoomOutTip: '축소',
171
+ rotateTip: '회전',
172
+ downloadTip: '다운로드',
173
+ adaptiveTip: '페이지에 맞게 조정',
174
+ originTip: '원래 크기'
162
175
  }
163
176
  }; // [i18n-Korea]
164
177
 
@@ -158,6 +158,19 @@ const local = {
158
158
  },
159
159
  Form: {
160
160
  optional: '(pilihan)'
161
+ },
162
+ Image: {
163
+ preview: 'Pratonton',
164
+ loading: 'Memuatkan',
165
+ loadError: 'Gagal memuatkan',
166
+ prevTip: 'Sebelumnya',
167
+ nextTip: 'Seterusnya',
168
+ zoomInTip: 'Zum masuk',
169
+ zoomOutTip: 'zum keluar',
170
+ rotateTip: 'Putar',
171
+ downloadTip: 'muat turun',
172
+ adaptiveTip: 'Menyesuaikan diri dengan halaman',
173
+ originTip: 'Saiz asal'
161
174
  }
162
175
  }; // [i18n-Malaysia(MY)]
163
176
 
@@ -166,6 +166,19 @@ const local = {
166
166
  },
167
167
  Form: {
168
168
  optional: '(opcional)'
169
+ },
170
+ Image: {
171
+ preview: 'Visualizar',
172
+ loading: 'Carregando',
173
+ loadError: 'Falha ao carregar',
174
+ prevTip: 'Anterior',
175
+ nextTip: 'Próximo',
176
+ zoomInTip: 'Ampliar',
177
+ zoomOutTip: 'reduzir',
178
+ rotateTip: 'Girar',
179
+ downloadTip: 'baixar',
180
+ adaptiveTip: 'Adaptar à página',
181
+ originTip: 'Tamanho original'
169
182
  }
170
183
  }; // 葡萄牙语
171
184
 
@@ -161,6 +161,19 @@ const local = {
161
161
  },
162
162
  Form: {
163
163
  optional: '(по желанию)'
164
+ },
165
+ Image: {
166
+ preview: 'предварительный просмотр',
167
+ loading: 'Загрузка',
168
+ loadError: 'Ошибка загрузки',
169
+ prevTip: 'Предыдущий',
170
+ nextTip: 'Далее',
171
+ zoomInTip: 'Увеличить',
172
+ zoomOutTip: 'уменьшить масштаб',
173
+ rotateTip: 'Повернуть',
174
+ downloadTip: 'скачать',
175
+ adaptiveTip: 'Адаптировать к странице',
176
+ originTip: 'Исходный размер'
164
177
  }
165
178
  }; // [i18n-Russia] 俄罗斯语
166
179
 
@@ -162,6 +162,19 @@ const local = {
162
162
  },
163
163
  Form: {
164
164
  optional: '(ไม่จำเป็น)'
165
+ },
166
+ Image: {
167
+ preview: 'ดูตัวอย่าง',
168
+ loading: 'กำลังโหลด',
169
+ loadError: 'โหลดไม่สำเร็จ',
170
+ prevTip: 'ก่อนหน้า',
171
+ nextTip: 'ถัดไป',
172
+ zoomInTip: 'ซูมเข้า',
173
+ zoomOutTip: 'ซูมออก',
174
+ rotateTip: 'หมุน',
175
+ downloadTip: 'ดาวน์โหลด',
176
+ adaptiveTip: 'ปรับให้เข้ากับหน้า',
177
+ originTip: 'ขนาดเดิม'
165
178
  }
166
179
  }; // [i18n-Thai]
167
180
 
@@ -161,6 +161,19 @@ const local = {
161
161
  },
162
162
  Form: {
163
163
  optional: '(isteğe bağlı)'
164
+ },
165
+ Image: {
166
+ preview: 'Ön izleme',
167
+ loading: 'Yükleniyor',
168
+ loadError: 'Yükleme başarısız',
169
+ prevTip: 'Önceki',
170
+ nextTip: 'Sonraki',
171
+ zoomInTip: 'Yakınlaştır',
172
+ zoomOutTip: 'uzaklaştır',
173
+ rotateTip: 'Döndür',
174
+ downloadTip: 'indir',
175
+ adaptiveTip: 'Sayfaya uyarla',
176
+ originTip: 'Orijinal boyut'
164
177
  }
165
178
  }; // [i18n-Turkish]
166
179
 
@@ -161,6 +161,19 @@ const local = {
161
161
  },
162
162
  Form: {
163
163
  optional: '(không bắt buộc)'
164
+ },
165
+ Image: {
166
+ preview: 'xem trước',
167
+ loading: 'Đang tải',
168
+ loadError: 'Không tải được',
169
+ prevTip: 'Trước đó',
170
+ nextTip: 'Next',
171
+ zoomInTip: 'Phóng to',
172
+ zoomOutTip: 'thu nhỏ',
173
+ rotateTip: 'Xoay',
174
+ downloadTip: 'download',
175
+ adaptiveTip: 'Thích ứng với trang',
176
+ originTip: 'Kích thước ban đầu'
164
177
  }
165
178
  }; // [i18n-Vietnam] 越南语
166
179
 
@@ -159,6 +159,19 @@ const local = {
159
159
  },
160
160
  Form: {
161
161
  optional: '(可选)'
162
+ },
163
+ Image: {
164
+ preview: '预览',
165
+ loading: '加载中',
166
+ loadError: '加载失败',
167
+ prevTip: '上一张',
168
+ nextTip: '下一张',
169
+ zoomInTip: '放大',
170
+ zoomOutTip: '缩小',
171
+ rotateTip: '旋转',
172
+ downloadTip: '下载',
173
+ adaptiveTip: '适应页面',
174
+ originTip: '原始尺寸'
162
175
  }
163
176
  }; // 中文
164
177
 
@@ -159,6 +159,19 @@ const local = {
159
159
  },
160
160
  Form: {
161
161
  optional: '(可選)'
162
+ },
163
+ Image: {
164
+ preview: '預覽',
165
+ loading: '加載中',
166
+ loadError: '加載失敗',
167
+ prevTip: '上一張',
168
+ nextTip: '下一張',
169
+ zoomInTip: '放大',
170
+ zoomOutTip: '縮小',
171
+ rotateTip: '旋轉',
172
+ downloadTip: '下載',
173
+ adaptiveTip: '適應頁面',
174
+ originTip: '原始尺寸'
162
175
  }
163
176
  }; // 中文
164
177
 
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import '@douyinfe/semi-foundation/lib/cjs/progress/progress.css';
4
4
  import { Animation } from '@douyinfe/semi-animation';
5
5
  import { Motion } from '../_base/base';
6
+ import { StrokeArr } from '@douyinfe/semi-foundation/lib/cjs/progress/generates';
6
7
  export interface ProgressProps {
7
8
  'aria-label'?: string | undefined;
8
9
  'aria-labelledby'?: string | undefined;
@@ -16,7 +17,8 @@ export interface ProgressProps {
16
17
  percent?: number;
17
18
  showInfo?: boolean;
18
19
  size?: 'default' | 'small' | 'large';
19
- stroke?: string;
20
+ stroke?: string | StrokeArr;
21
+ strokeGradient?: boolean;
20
22
  strokeLinecap?: 'round' | 'square';
21
23
  strokeWidth?: number;
22
24
  style?: React.CSSProperties;
@@ -41,7 +43,11 @@ declare class Progress extends Component<ProgressProps, ProgressState> {
41
43
  scale: PropTypes.Requireable<number>;
42
44
  showInfo: PropTypes.Requireable<boolean>;
43
45
  size: PropTypes.Requireable<string>;
44
- stroke: PropTypes.Requireable<string>;
46
+ stroke: PropTypes.Requireable<string | PropTypes.InferProps<{
47
+ percent: PropTypes.Requireable<number>;
48
+ color: PropTypes.Requireable<string>;
49
+ }>[]>;
50
+ strokeGradient: PropTypes.Requireable<boolean>;
45
51
  strokeLinecap: PropTypes.Requireable<string>;
46
52
  strokeWidth: PropTypes.Requireable<number>;
47
53
  style: PropTypes.Requireable<object>;
@@ -58,6 +64,7 @@ declare class Progress extends Component<ProgressProps, ProgressState> {
58
64
  showInfo: boolean;
59
65
  size: string;
60
66
  stroke: string;
67
+ strokeGradient: boolean;
61
68
  strokeLinecap: string;
62
69
  strokeWidth: number;
63
70
  style: {};
@@ -70,6 +77,7 @@ declare class Progress extends Component<ProgressProps, ProgressState> {
70
77
  componentWillUnmount(): void;
71
78
  renderCircleProgress(): ReactNode;
72
79
  calcPercent(percent: number): number;
80
+ selectStroke(stroke: string | StrokeArr, percent: number, strokeGradient: any): string;
73
81
  renderLineProgress(): ReactNode;
74
82
  render(): ReactNode;
75
83
  }
@@ -17,6 +17,8 @@ require("@douyinfe/semi-foundation/lib/cjs/progress/progress.css");
17
17
 
18
18
  var _semiAnimation = require("@douyinfe/semi-animation");
19
19
 
20
+ var _generates = require("@douyinfe/semi-foundation/lib/cjs/progress/generates");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -107,6 +109,7 @@ class Progress extends _react.Component {
107
109
  format,
108
110
  size,
109
111
  stroke,
112
+ strokeGradient,
110
113
  showInfo,
111
114
  percent,
112
115
  orbitStroke,
@@ -131,7 +134,10 @@ class Progress extends _react.Component {
131
134
  width = this.props.width;
132
135
  } else {
133
136
  size === _constants.strings.DEFAULT_SIZE ? width = 72 : width = 24;
134
- } // cx, cy is circle center
137
+ } // parse stroke & generate gradients
138
+
139
+
140
+ const _stroke = this.selectStroke(stroke, percent, strokeGradient); // cx, cy is circle center
135
141
 
136
142
 
137
143
  const cy = width / 2;
@@ -147,7 +153,7 @@ class Progress extends _react.Component {
147
153
  id: id,
148
154
  className: classNames.wrapper,
149
155
  style: style,
150
- role: 'progressbar',
156
+ role: "progressbar",
151
157
  "aria-valuemin": 0,
152
158
  "aria-valuemax": 100,
153
159
  "aria-valuenow": percNumber,
@@ -178,7 +184,7 @@ class Progress extends _react.Component {
178
184
  strokeDasharray: strokeDasharray,
179
185
  strokeLinecap: strokeLinecap,
180
186
  fill: "transparent",
181
- stroke: stroke,
187
+ stroke: _stroke,
182
188
  r: radius,
183
189
  cx: cx,
184
190
  cy: cy,
@@ -202,11 +208,26 @@ class Progress extends _react.Component {
202
208
  return perc;
203
209
  }
204
210
 
211
+ selectStroke(stroke, percent, strokeGradient) {
212
+ if (typeof stroke === 'string') {
213
+ return stroke;
214
+ }
215
+
216
+ const color = (0, _generates.generateColor)(stroke, percent, strokeGradient);
217
+
218
+ if (typeof color !== 'undefined') {
219
+ return color;
220
+ }
221
+
222
+ return _constants.strings.STROKE_DEFAULT;
223
+ }
224
+
205
225
  renderLineProgress() {
206
226
  const {
207
227
  className,
208
228
  style,
209
229
  stroke,
230
+ strokeGradient,
210
231
  direction,
211
232
  format,
212
233
  showInfo,
@@ -231,9 +252,12 @@ class Progress extends _react.Component {
231
252
  });
232
253
  const innerCls = (0, _classnames.default)("".concat(prefixCls, "-track-inner"));
233
254
  const perc = this.calcPercent(percent);
234
- const percNumber = this.calcPercent(percentNumber);
255
+ const percNumber = this.calcPercent(percentNumber); // parse stroke & generate gradients
256
+
257
+ const _stroke = this.selectStroke(stroke, percent, strokeGradient);
258
+
235
259
  const innerStyle = {
236
- background: stroke
260
+ background: _stroke
237
261
  };
238
262
 
239
263
  if (direction === _constants.strings.DEFAULT_DIRECTION) {
@@ -247,7 +271,7 @@ class Progress extends _react.Component {
247
271
  id: id,
248
272
  className: progressWrapperCls,
249
273
  style: style,
250
- role: 'progressbar',
274
+ role: "progressbar",
251
275
  "aria-valuemin": 0,
252
276
  "aria-valuemax": 100,
253
277
  "aria-valuenow": perc,
@@ -297,7 +321,11 @@ Progress.propTypes = {
297
321
  scale: _propTypes.default.number,
298
322
  showInfo: _propTypes.default.bool,
299
323
  size: _propTypes.default.oneOf(_constants.strings.sizes),
300
- stroke: _propTypes.default.string,
324
+ stroke: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.shape({
325
+ percent: _propTypes.default.number,
326
+ color: _propTypes.default.string
327
+ }))]),
328
+ strokeGradient: _propTypes.default.bool,
301
329
  strokeLinecap: _propTypes.default.oneOf(_constants.strings.strokeLineCap),
302
330
  strokeWidth: _propTypes.default.number,
303
331
  style: _propTypes.default.object,
@@ -313,7 +341,8 @@ Progress.defaultProps = {
313
341
  percent: 0,
314
342
  showInfo: false,
315
343
  size: _constants.strings.DEFAULT_SIZE,
316
- stroke: 'var(--semi-color-success)',
344
+ stroke: _constants.strings.STROKE_DEFAULT,
345
+ strokeGradient: false,
317
346
  strokeLinecap: _constants.strings.DEFAULT_LINECAP,
318
347
  strokeWidth: 4,
319
348
  style: {},
@@ -82,7 +82,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
82
82
  prefixCls?: string;
83
83
  name?: string;
84
84
  onChange?: (e: RadioChangeEvent) => void;
85
- buttonSize?: "small" | "large" | "middle";
85
+ buttonSize?: "small" | "middle" | "large";
86
86
  isCardRadio?: boolean;
87
87
  isPureCardRadio?: boolean;
88
88
  };
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
48
48
  disabled: PropTypes.Requireable<boolean>;
49
49
  name: PropTypes.Requireable<string>;
50
50
  options: PropTypes.Requireable<any[]>;
51
- buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
51
+ buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
52
52
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
53
53
  value: PropTypes.Requireable<any>;
54
54
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -13,6 +13,7 @@ export interface ParagraphProps extends BasicProps {
13
13
  }
14
14
  export interface AvatarProps extends BasicProps {
15
15
  size?: typeof strings.SIZE[number];
16
+ shape?: string;
16
17
  }
17
18
  export declare type GenericProps = BasicProps & AvatarProps;
18
19
  export declare const Avatar: React.FC<AvatarProps>;
@@ -35,6 +35,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
35
35
  };
36
36
 
37
37
  const sizeSet = _constants2.strings.SIZE;
38
+ const shapeSet = _constants2.strings.SHAPE;
38
39
 
39
40
  const generator = type => BasicComponent => props => /*#__PURE__*/_react.default.createElement(BasicComponent, Object.assign({
40
41
  type: type
@@ -47,12 +48,15 @@ class Generic extends _react.PureComponent {
47
48
  prefixCls,
48
49
  className,
49
50
  type,
50
- size
51
+ size,
52
+ shape
51
53
  } = _a,
52
- others = __rest(_a, ["prefixCls", "className", "type", "size"]);
54
+ others = __rest(_a, ["prefixCls", "className", "type", "size", "shape"]);
53
55
 
54
56
  const classString = (0, _classnames.default)(className, "".concat(prefixCls, "-").concat(type), {
55
57
  ["".concat(prefixCls, "-").concat(type, "-").concat(size)]: type.toUpperCase() === 'AVATAR'
58
+ }, {
59
+ ["".concat(prefixCls, "-").concat(type, "-").concat(shape)]: type.toUpperCase() === 'AVATAR'
56
60
  });
57
61
  return /*#__PURE__*/_react.default.createElement('div', Object.assign({
58
62
  className: classString
@@ -66,11 +70,13 @@ Generic.propTypes = {
66
70
  prefixCls: _propTypes.default.string,
67
71
  style: _propTypes.default.object,
68
72
  className: _propTypes.default.string,
69
- size: _propTypes.default.oneOf(sizeSet)
73
+ size: _propTypes.default.oneOf(sizeSet),
74
+ shape: _propTypes.default.oneOf(shapeSet)
70
75
  };
71
76
  Generic.defaultProps = {
72
77
  prefixCls: _constants.cssClasses.PREFIX,
73
- size: 'medium'
78
+ size: 'medium',
79
+ shape: 'circle'
74
80
  };
75
81
  const Avatar = generator('avatar')(Generic);
76
82
  exports.Avatar = Avatar;
@@ -164,11 +164,12 @@ class Tag extends _react.Component {
164
164
  onClick,
165
165
  className,
166
166
  type,
167
+ shape,
167
168
  avatarSrc,
168
169
  avatarShape,
169
170
  tabIndex
170
171
  } = _a,
171
- attr = __rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "avatarSrc", "avatarShape", "tabIndex"]);
172
+ attr = __rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "shape", "avatarSrc", "avatarShape", "tabIndex"]);
172
173
 
173
174
  const {
174
175
  visible: isVisible
@@ -186,6 +187,8 @@ class Tag extends _react.Component {
186
187
  ["".concat(prefixCls, "-default")]: size === 'default',
187
188
  ["".concat(prefixCls, "-small")]: size === 'small',
188
189
  ["".concat(prefixCls, "-large")]: size === 'large',
190
+ ["".concat(prefixCls, "-square")]: shape === 'square',
191
+ ["".concat(prefixCls, "-circle")]: shape === 'circle',
189
192
  ["".concat(prefixCls, "-").concat(type)]: type,
190
193
  ["".concat(prefixCls, "-").concat(color, "-").concat(type)]: color && type,
191
194
  ["".concat(prefixCls, "-closable")]: closable,
@@ -223,6 +226,7 @@ Tag.defaultProps = {
223
226
  onClick: () => undefined,
224
227
  style: {},
225
228
  className: '',
229
+ shape: 'square',
226
230
  avatarShape: 'square'
227
231
  };
228
232
  Tag.propTypes = {
@@ -4,6 +4,7 @@ export declare type TagColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'i
4
4
  export declare type TagType = 'ghost' | 'solid' | 'light';
5
5
  export declare type TagSize = 'default' | 'small' | 'large';
6
6
  export declare type AvatarShape = 'circle' | 'square';
7
+ export declare type TagShape = 'circle' | 'square';
7
8
  export interface TagProps {
8
9
  children?: React.ReactNode;
9
10
  tagKey?: string | number;
@@ -18,6 +19,7 @@ export interface TagProps {
18
19
  className?: string;
19
20
  avatarSrc?: string;
20
21
  avatarShape?: AvatarShape;
22
+ shape?: TagShape;
21
23
  onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
22
24
  'aria-label'?: React.AriaAttributes['aria-label'];
23
25
  tabIndex?: number;
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
99
99
  'aria-required': PropTypes.Requireable<boolean>;
100
100
  prefixCls: PropTypes.Requireable<string>;
101
101
  clearText: PropTypes.Requireable<string>;
102
- value: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
102
+ value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
103
103
  inputReadOnly: PropTypes.Requireable<boolean>;
104
104
  disabled: PropTypes.Requireable<boolean>;
105
105
  showClear: PropTypes.Requireable<boolean>;
106
- defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
106
+ defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
107
107
  open: PropTypes.Requireable<boolean>;
108
108
  defaultOpen: PropTypes.Requireable<boolean>;
109
109
  onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
6
6
  * - \[12:00:12, 12:21:12]
7
7
  * - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
8
8
  */
9
- declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
9
+ declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
10
10
  export { TimeShape };
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
19
19
  'aria-required': import("prop-types").Requireable<boolean>;
20
20
  prefixCls: import("prop-types").Requireable<string>;
21
21
  clearText: import("prop-types").Requireable<string>;
22
- value: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
22
+ value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
23
23
  inputReadOnly: import("prop-types").Requireable<boolean>;
24
24
  disabled: import("prop-types").Requireable<boolean>;
25
25
  showClear: import("prop-types").Requireable<boolean>;
26
- defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
26
+ defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
27
27
  open: import("prop-types").Requireable<boolean>;
28
28
  defaultOpen: import("prop-types").Requireable<boolean>;
29
29
  onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
@@ -7,6 +7,7 @@ import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/se
7
7
  import { Motion } from '../_base/base';
8
8
  export { ToastTransitionProps } from './ToastTransition';
9
9
  export interface ToastReactProps extends ToastProps {
10
+ id?: string;
10
11
  style?: CSSProperties;
11
12
  icon?: React.ReactNode;
12
13
  content: React.ReactNode;
@@ -15,7 +16,9 @@ export { ConfigProps, ToastListProps, ToastListState, ToastState };
15
16
  declare const createBaseToast: () => {
16
17
  new (props: ToastListProps): {
17
18
  readonly adapter: ToastListAdapter;
19
+ has(id: string): any;
18
20
  add(opts: ToastInstance): any;
21
+ update(id: string, opts: ToastInstance): any;
19
22
  remove(id: string): any;
20
23
  destroyAll(): any;
21
24
  render(): JSX.Element;
@@ -46,7 +49,9 @@ declare const createBaseToast: () => {
46
49
  };
47
50
  ref: {
48
51
  readonly adapter: ToastListAdapter;
52
+ has(id: string): any;
49
53
  add(opts: ToastInstance): any;
54
+ update(id: string, opts: ToastInstance): any;
50
55
  remove(id: string): any;
51
56
  destroyAll(): any;
52
57
  render(): JSX.Element;
@@ -105,7 +110,9 @@ export declare class ToastFactory {
105
110
  declare const _default: {
106
111
  new (props: ToastListProps): {
107
112
  readonly adapter: ToastListAdapter;
113
+ has(id: string): any;
108
114
  add(opts: ToastInstance): any;
115
+ update(id: string, opts: ToastInstance): any;
109
116
  remove(id: string): any;
110
117
  destroyAll(): any;
111
118
  render(): JSX.Element;
@@ -136,7 +143,9 @@ declare const _default: {
136
143
  };
137
144
  ref: {
138
145
  readonly adapter: ToastListAdapter;
146
+ has(id: string): any;
139
147
  add(opts: ToastInstance): any;
148
+ update(id: string, opts: ToastInstance): any;
140
149
  remove(id: string): any;
141
150
  destroyAll(): any;
142
151
  render(): JSX.Element;
@@ -38,24 +38,28 @@ const createBaseToast = () => {
38
38
  super(props);
39
39
  this.state = {
40
40
  list: [],
41
- removedItems: []
41
+ removedItems: [],
42
+ updatedItems: []
42
43
  };
43
44
  this.foundation = new _toastListFoundation.default(this.adapter);
44
45
  }
45
46
 
46
47
  get adapter() {
47
48
  return Object.assign(Object.assign({}, super.adapter), {
48
- updateToast: (list, removedItems) => {
49
+ updateToast: (list, removedItems, updatedItems) => {
49
50
  this.setState({
50
51
  list,
51
- removedItems
52
+ removedItems,
53
+ updatedItems
52
54
  });
53
55
  }
54
56
  });
55
57
  }
56
58
 
57
59
  static create(opts) {
58
- const id = (0, _uuid.default)('toast'); // this.id = id;
60
+ var _a;
61
+
62
+ const id = (_a = opts.id) !== null && _a !== void 0 ? _a : (0, _uuid.default)('toast'); // this.id = id;
59
63
 
60
64
  if (!ToastList.ref) {
61
65
  const div = document.createElement('div');
@@ -95,9 +99,16 @@ const createBaseToast = () => {
95
99
  node.style[pos] = typeof opts[pos] === 'number' ? "".concat(opts[pos], "px") : opts[pos];
96
100
  }
97
101
  });
98
- ToastList.ref.add(Object.assign(Object.assign({}, opts), {
99
- id
100
- }));
102
+
103
+ if (ToastList.ref.has(id)) {
104
+ ToastList.ref.update(id, Object.assign(Object.assign({}, opts), {
105
+ id
106
+ }));
107
+ } else {
108
+ ToastList.ref.add(Object.assign(Object.assign({}, opts), {
109
+ id
110
+ }));
111
+ }
101
112
  }
102
113
 
103
114
  return id;
@@ -194,10 +205,18 @@ const createBaseToast = () => {
194
205
  }
195
206
  }
196
207
 
208
+ has(id) {
209
+ return this.foundation.hasToast(id);
210
+ }
211
+
197
212
  add(opts) {
198
213
  return this.foundation.addToast(opts);
199
214
  }
200
215
 
216
+ update(id, opts) {
217
+ return this.foundation.updateToast(id, opts);
218
+ }
219
+
201
220
  remove(id) {
202
221
  return this.foundation.removeToast(id);
203
222
  }
@@ -211,18 +230,39 @@ const createBaseToast = () => {
211
230
  list
212
231
  } = this.state;
213
232
  const {
214
- removedItems
233
+ removedItems,
234
+ updatedItems
215
235
  } = this.state;
216
236
  list = Array.from(new Set([...list, ...removedItems]));
237
+ const updatedIds = updatedItems.map(_ref => {
238
+ let {
239
+ id
240
+ } = _ref;
241
+ return id;
242
+ });
243
+
244
+ const refFn = toast => {
245
+ var _a;
246
+
247
+ if (((_a = toast === null || toast === void 0 ? void 0 : toast.foundation) === null || _a === void 0 ? void 0 : _a._id) && updatedIds.includes(toast.foundation._id)) {
248
+ toast.foundation.setState({
249
+ duration: toast.props.duration
250
+ });
251
+ toast.foundation.restartCloseTimer();
252
+ }
253
+ };
254
+
217
255
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, list.map((item, index) => item.motion ? /*#__PURE__*/_react.default.createElement(_ToastTransition.default, {
218
256
  key: item.id || index,
219
257
  motion: item.motion
220
258
  }, removedItems.find(removedItem => removedItem.id === item.id) ? null : transitionStyle => /*#__PURE__*/_react.default.createElement(_toast.default, Object.assign({}, item, {
221
259
  style: Object.assign(Object.assign({}, transitionStyle), item.style),
222
- close: id => this.remove(id)
260
+ close: id => this.remove(id),
261
+ ref: refFn
223
262
  }))) : /*#__PURE__*/_react.default.createElement(_toast.default, Object.assign({}, item, {
224
263
  style: Object.assign({}, item.style),
225
- close: id => this.remove(id)
264
+ close: id => this.remove(id),
265
+ ref: refFn
226
266
  }))));
227
267
  }
228
268