@douyinfe/semi-foundation 2.96.1 → 2.98.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 (235) hide show
  1. package/cascader/foundation.ts +74 -19
  2. package/codeHighlight/codeHighlight.scss +1 -1
  3. package/datePicker/datePicker.scss +100 -5
  4. package/datePicker/foundation.ts +7 -0
  5. package/datePicker/inputFoundation.ts +5 -0
  6. package/form/foundation.ts +55 -7
  7. package/form/utils.ts +7 -2
  8. package/image/previewImageFoundation.ts +34 -3
  9. package/image/previewInnerFoundation.ts +15 -4
  10. package/input/textarea.scss +35 -0
  11. package/inputNumber/foundation.ts +119 -3
  12. package/jsonViewer/jsonViewer.scss +2 -2
  13. package/lib/cjs/aiChatInput/aiChatInput.css +7 -7
  14. package/lib/cjs/anchor/anchor.css +3 -3
  15. package/lib/cjs/autoComplete/autoComplete.css +1 -1
  16. package/lib/cjs/avatar/avatar.css +5 -5
  17. package/lib/cjs/badge/badge.css +1 -1
  18. package/lib/cjs/breadcrumb/breadcrumb.css +2 -2
  19. package/lib/cjs/calendar/calendar.css +9 -9
  20. package/lib/cjs/cascader/cascader.css +6 -6
  21. package/lib/cjs/cascader/foundation.d.ts +12 -0
  22. package/lib/cjs/cascader/foundation.js +68 -23
  23. package/lib/cjs/checkbox/checkbox.css +2 -2
  24. package/lib/cjs/codeHighlight/codeHighlight.css +1 -1
  25. package/lib/cjs/codeHighlight/codeHighlight.scss +1 -1
  26. package/lib/cjs/collapse/collapse.css +2 -2
  27. package/lib/cjs/datePicker/datePicker.css +75 -13
  28. package/lib/cjs/datePicker/datePicker.scss +100 -5
  29. package/lib/cjs/datePicker/foundation.d.ts +5 -0
  30. package/lib/cjs/datePicker/foundation.js +2 -0
  31. package/lib/cjs/datePicker/inputFoundation.d.ts +5 -0
  32. package/lib/cjs/descriptions/descriptions.css +6 -6
  33. package/lib/cjs/dropdown/dropdown.css +2 -2
  34. package/lib/cjs/form/form.css +4 -4
  35. package/lib/cjs/form/foundation.d.ts +1 -1
  36. package/lib/cjs/form/foundation.js +55 -9
  37. package/lib/cjs/form/utils.js +5 -2
  38. package/lib/cjs/hotKeys/hotKeys.css +2 -2
  39. package/lib/cjs/image/image.css +2 -2
  40. package/lib/cjs/image/previewImageFoundation.d.ts +4 -0
  41. package/lib/cjs/image/previewImageFoundation.js +33 -2
  42. package/lib/cjs/image/previewInnerFoundation.d.ts +1 -0
  43. package/lib/cjs/image/previewInnerFoundation.js +17 -4
  44. package/lib/cjs/input/input.css +8 -8
  45. package/lib/cjs/input/textarea.css +19 -2
  46. package/lib/cjs/input/textarea.scss +35 -0
  47. package/lib/cjs/inputNumber/foundation.d.ts +15 -0
  48. package/lib/cjs/inputNumber/foundation.js +113 -3
  49. package/lib/cjs/jsonViewer/jsonViewer.css +2 -2
  50. package/lib/cjs/jsonViewer/jsonViewer.scss +2 -2
  51. package/lib/cjs/list/list.css +1 -1
  52. package/lib/cjs/modal/modal.css +1 -1
  53. package/lib/cjs/navigation/navigation.css +4 -3
  54. package/lib/cjs/navigation/navigation.scss +1 -0
  55. package/lib/cjs/navigation/variables.scss +1 -1
  56. package/lib/cjs/notification/notification.css +4 -4
  57. package/lib/cjs/overflowList/foundation.d.ts +1 -0
  58. package/lib/cjs/overflowList/foundation.js +51 -1
  59. package/lib/cjs/pagination/pagination.css +5 -5
  60. package/lib/cjs/popconfirm/popconfirm.css +1 -1
  61. package/lib/cjs/popover/popover.css +1 -1
  62. package/lib/cjs/radio/radio.css +2 -2
  63. package/lib/cjs/scrollList/itemFoundation.js +12 -0
  64. package/lib/cjs/scrollList/scrollList.css +2 -2
  65. package/lib/cjs/select/foundation.d.ts +1 -1
  66. package/lib/cjs/select/foundation.js +28 -2
  67. package/lib/cjs/select/select.css +6 -6
  68. package/lib/cjs/sideSheet/sideSheet.css +2 -2
  69. package/lib/cjs/sidebar/sidebar.css +11 -11
  70. package/lib/cjs/slider/foundation.js +46 -12
  71. package/lib/cjs/slider/rtl.scss +62 -0
  72. package/lib/cjs/slider/slider.css +45 -0
  73. package/lib/cjs/slider/slider.scss +2 -0
  74. package/lib/cjs/steps/steps.css +11 -11
  75. package/lib/cjs/switch/switch.css +1 -0
  76. package/lib/cjs/switch/switch.scss +1 -0
  77. package/lib/cjs/switch/variables.scss +2 -1
  78. package/lib/cjs/table/foundation.d.ts +36 -0
  79. package/lib/cjs/table/foundation.js +164 -29
  80. package/lib/cjs/table/table.css +10 -2
  81. package/lib/cjs/table/table.scss +17 -0
  82. package/lib/cjs/tabs/tabs.css +2 -2
  83. package/lib/cjs/tag/tag.css +28 -2
  84. package/lib/cjs/tag/tag.scss +33 -0
  85. package/lib/cjs/tagInput/tagInput.css +19 -2
  86. package/lib/cjs/tagInput/tagInput.scss +18 -0
  87. package/lib/cjs/timePicker/constants.d.ts +1 -0
  88. package/lib/cjs/timePicker/foundation.d.ts +7 -1
  89. package/lib/cjs/timePicker/foundation.js +62 -11
  90. package/lib/cjs/timePicker/timePicker.css +1 -1
  91. package/lib/cjs/timeline/timeline.css +2 -2
  92. package/lib/cjs/toast/toast.css +1 -1
  93. package/lib/cjs/tooltip/foundation.js +8 -5
  94. package/lib/cjs/tooltip/tooltip.css +1 -1
  95. package/lib/cjs/transfer/constants.d.ts +3 -1
  96. package/lib/cjs/transfer/constants.js +3 -1
  97. package/lib/cjs/transfer/foundation.d.ts +3 -0
  98. package/lib/cjs/transfer/foundation.js +4 -0
  99. package/lib/cjs/transfer/transfer.css +14 -5
  100. package/lib/cjs/transfer/transfer.scss +10 -0
  101. package/lib/cjs/tree/foundation.d.ts +3 -0
  102. package/lib/cjs/tree/foundation.js +31 -4
  103. package/lib/cjs/tree/tree.css +1 -1
  104. package/lib/cjs/treeSelect/foundation.d.ts +1 -0
  105. package/lib/cjs/treeSelect/foundation.js +8 -1
  106. package/lib/cjs/treeSelect/treeSelect.css +36 -4
  107. package/lib/cjs/treeSelect/treeSelect.scss +49 -1
  108. package/lib/cjs/typography/typography.css +8 -8
  109. package/lib/cjs/upload/upload.css +8 -8
  110. package/lib/cjs/utils/Store.d.ts +1 -1
  111. package/lib/cjs/utils/Store.js +1 -0
  112. package/lib/es/aiChatInput/aiChatInput.css +7 -7
  113. package/lib/es/anchor/anchor.css +3 -3
  114. package/lib/es/autoComplete/autoComplete.css +1 -1
  115. package/lib/es/avatar/avatar.css +5 -5
  116. package/lib/es/badge/badge.css +1 -1
  117. package/lib/es/breadcrumb/breadcrumb.css +2 -2
  118. package/lib/es/calendar/calendar.css +9 -9
  119. package/lib/es/cascader/cascader.css +6 -6
  120. package/lib/es/cascader/foundation.d.ts +12 -0
  121. package/lib/es/cascader/foundation.js +68 -23
  122. package/lib/es/checkbox/checkbox.css +2 -2
  123. package/lib/es/codeHighlight/codeHighlight.css +1 -1
  124. package/lib/es/codeHighlight/codeHighlight.scss +1 -1
  125. package/lib/es/collapse/collapse.css +2 -2
  126. package/lib/es/datePicker/datePicker.css +75 -13
  127. package/lib/es/datePicker/datePicker.scss +100 -5
  128. package/lib/es/datePicker/foundation.d.ts +5 -0
  129. package/lib/es/datePicker/foundation.js +2 -0
  130. package/lib/es/datePicker/inputFoundation.d.ts +5 -0
  131. package/lib/es/descriptions/descriptions.css +6 -6
  132. package/lib/es/dropdown/dropdown.css +2 -2
  133. package/lib/es/form/form.css +4 -4
  134. package/lib/es/form/foundation.d.ts +1 -1
  135. package/lib/es/form/foundation.js +55 -9
  136. package/lib/es/form/utils.js +5 -2
  137. package/lib/es/hotKeys/hotKeys.css +2 -2
  138. package/lib/es/image/image.css +2 -2
  139. package/lib/es/image/previewImageFoundation.d.ts +4 -0
  140. package/lib/es/image/previewImageFoundation.js +33 -2
  141. package/lib/es/image/previewInnerFoundation.d.ts +1 -0
  142. package/lib/es/image/previewInnerFoundation.js +17 -4
  143. package/lib/es/input/input.css +8 -8
  144. package/lib/es/input/textarea.css +19 -2
  145. package/lib/es/input/textarea.scss +35 -0
  146. package/lib/es/inputNumber/foundation.d.ts +15 -0
  147. package/lib/es/inputNumber/foundation.js +113 -3
  148. package/lib/es/jsonViewer/jsonViewer.css +2 -2
  149. package/lib/es/jsonViewer/jsonViewer.scss +2 -2
  150. package/lib/es/list/list.css +1 -1
  151. package/lib/es/modal/modal.css +1 -1
  152. package/lib/es/navigation/navigation.css +4 -3
  153. package/lib/es/navigation/navigation.scss +1 -0
  154. package/lib/es/navigation/variables.scss +1 -1
  155. package/lib/es/notification/notification.css +4 -4
  156. package/lib/es/overflowList/foundation.d.ts +1 -0
  157. package/lib/es/overflowList/foundation.js +51 -1
  158. package/lib/es/pagination/pagination.css +5 -5
  159. package/lib/es/popconfirm/popconfirm.css +1 -1
  160. package/lib/es/popover/popover.css +1 -1
  161. package/lib/es/radio/radio.css +2 -2
  162. package/lib/es/scrollList/itemFoundation.js +12 -0
  163. package/lib/es/scrollList/scrollList.css +2 -2
  164. package/lib/es/select/foundation.d.ts +1 -1
  165. package/lib/es/select/foundation.js +28 -2
  166. package/lib/es/select/select.css +6 -6
  167. package/lib/es/sideSheet/sideSheet.css +2 -2
  168. package/lib/es/sidebar/sidebar.css +11 -11
  169. package/lib/es/slider/foundation.js +46 -12
  170. package/lib/es/slider/rtl.scss +62 -0
  171. package/lib/es/slider/slider.css +45 -0
  172. package/lib/es/slider/slider.scss +2 -0
  173. package/lib/es/steps/steps.css +11 -11
  174. package/lib/es/switch/switch.css +1 -0
  175. package/lib/es/switch/switch.scss +1 -0
  176. package/lib/es/switch/variables.scss +2 -1
  177. package/lib/es/table/foundation.d.ts +36 -0
  178. package/lib/es/table/foundation.js +164 -29
  179. package/lib/es/table/table.css +10 -2
  180. package/lib/es/table/table.scss +17 -0
  181. package/lib/es/tabs/tabs.css +2 -2
  182. package/lib/es/tag/tag.css +28 -2
  183. package/lib/es/tag/tag.scss +33 -0
  184. package/lib/es/tagInput/tagInput.css +19 -2
  185. package/lib/es/tagInput/tagInput.scss +18 -0
  186. package/lib/es/timePicker/constants.d.ts +1 -0
  187. package/lib/es/timePicker/foundation.d.ts +7 -1
  188. package/lib/es/timePicker/foundation.js +62 -11
  189. package/lib/es/timePicker/timePicker.css +1 -1
  190. package/lib/es/timeline/timeline.css +2 -2
  191. package/lib/es/toast/toast.css +1 -1
  192. package/lib/es/tooltip/foundation.js +8 -5
  193. package/lib/es/tooltip/tooltip.css +1 -1
  194. package/lib/es/transfer/constants.d.ts +3 -1
  195. package/lib/es/transfer/constants.js +3 -1
  196. package/lib/es/transfer/foundation.d.ts +3 -0
  197. package/lib/es/transfer/foundation.js +4 -0
  198. package/lib/es/transfer/transfer.css +14 -5
  199. package/lib/es/transfer/transfer.scss +10 -0
  200. package/lib/es/tree/foundation.d.ts +3 -0
  201. package/lib/es/tree/foundation.js +31 -4
  202. package/lib/es/tree/tree.css +1 -1
  203. package/lib/es/treeSelect/foundation.d.ts +1 -0
  204. package/lib/es/treeSelect/foundation.js +8 -1
  205. package/lib/es/treeSelect/treeSelect.css +36 -4
  206. package/lib/es/treeSelect/treeSelect.scss +49 -1
  207. package/lib/es/typography/typography.css +8 -8
  208. package/lib/es/upload/upload.css +8 -8
  209. package/lib/es/utils/Store.d.ts +1 -1
  210. package/lib/es/utils/Store.js +1 -0
  211. package/navigation/navigation.scss +1 -0
  212. package/navigation/variables.scss +1 -1
  213. package/overflowList/foundation.ts +48 -2
  214. package/package.json +19 -4
  215. package/scrollList/itemFoundation.ts +12 -0
  216. package/select/foundation.ts +27 -2
  217. package/slider/foundation.ts +55 -15
  218. package/slider/rtl.scss +62 -0
  219. package/slider/slider.scss +2 -0
  220. package/switch/switch.scss +1 -0
  221. package/switch/variables.scss +2 -1
  222. package/table/foundation.ts +199 -30
  223. package/table/table.scss +17 -0
  224. package/tag/tag.scss +33 -0
  225. package/tagInput/tagInput.scss +18 -0
  226. package/timePicker/constants.ts +2 -0
  227. package/timePicker/foundation.ts +62 -10
  228. package/tooltip/foundation.ts +8 -5
  229. package/transfer/constants.ts +3 -1
  230. package/transfer/foundation.ts +8 -1
  231. package/transfer/transfer.scss +10 -0
  232. package/tree/foundation.ts +34 -5
  233. package/treeSelect/foundation.ts +10 -1
  234. package/treeSelect/treeSelect.scss +49 -1
  235. package/utils/Store.ts +2 -1
@@ -18,7 +18,7 @@
18
18
  .semi-tag-default, .semi-tag-small {
19
19
  font-size: 12px;
20
20
  line-height: 16px;
21
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
21
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
22
22
  height: 20px;
23
23
  padding: 2px 8px;
24
24
  }
@@ -34,7 +34,7 @@
34
34
  .semi-tag-large {
35
35
  font-size: 12px;
36
36
  line-height: 16px;
37
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
37
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
38
38
  padding: 4px 8px;
39
39
  height: 24px;
40
40
  }
@@ -505,6 +505,32 @@
505
505
  color: var(--semi-color-text-0);
506
506
  }
507
507
 
508
+ .semi-tag-split {
509
+ display: inline-flex;
510
+ align-items: center;
511
+ }
512
+ .semi-tag-split .semi-tag {
513
+ border-radius: 0;
514
+ margin-right: 1px;
515
+ }
516
+ .semi-tag-split .semi-tag-first {
517
+ border-top-left-radius: var(--semi-border-radius-small);
518
+ border-bottom-left-radius: var(--semi-border-radius-small);
519
+ }
520
+ .semi-tag-split .semi-tag-last {
521
+ border-top-right-radius: var(--semi-border-radius-small);
522
+ border-bottom-right-radius: var(--semi-border-radius-small);
523
+ margin-right: unset;
524
+ }
525
+ .semi-tag-split .semi-tag-circle.semi-tag-first {
526
+ border-top-left-radius: var(--semi-border-radius-full);
527
+ border-bottom-left-radius: var(--semi-border-radius-full);
528
+ }
529
+ .semi-tag-split .semi-tag-circle.semi-tag-last {
530
+ border-top-right-radius: var(--semi-border-radius-full);
531
+ border-bottom-right-radius: var(--semi-border-radius-full);
532
+ }
533
+
508
534
  .semi-rtl .semi-tag,
509
535
  .semi-portal-rtl .semi-tag {
510
536
  direction: rtl;
@@ -329,4 +329,37 @@ $types: "ghost", "solid", "light";
329
329
  color: $color-tag_avatar-text-default;
330
330
  }
331
331
 
332
+ .#{$module}-split {
333
+ display: inline-flex;
334
+ align-items: center;
335
+
336
+ .#{$module} {
337
+ border-radius: 0;
338
+ margin-right: 1px;
339
+
340
+ &-first {
341
+ border-top-left-radius: $radius-tag;
342
+ border-bottom-left-radius: $radius-tag;
343
+ }
344
+
345
+ &-last {
346
+ border-top-right-radius: $radius-tag;
347
+ border-bottom-right-radius: $radius-tag;
348
+ margin-right: unset;
349
+ }
350
+
351
+ &-circle {
352
+ &.#{$module}-first {
353
+ border-top-left-radius: $radius-tag_circle;
354
+ border-bottom-left-radius: $radius-tag_circle;
355
+ }
356
+
357
+ &.#{$module}-last {
358
+ border-top-right-radius: $radius-tag_circle;
359
+ border-bottom-right-radius: $radius-tag_circle;
360
+ }
361
+ }
362
+ }
363
+ }
364
+
332
365
  @import './rtl.scss';
@@ -112,6 +112,8 @@
112
112
  padding-left: 4px;
113
113
  padding-right: 4px;
114
114
  overflow: hidden;
115
+ position: relative;
116
+ /* hidden mirror used to measure input text width */
115
117
  }
116
118
  .semi-tagInput-wrapper-tag {
117
119
  margin-right: 4px;
@@ -154,6 +156,8 @@
154
156
  .semi-tagInput-wrapper .semi-tagInput-wrapper-input {
155
157
  flex-grow: 1;
156
158
  width: min-content;
159
+ min-width: 2px;
160
+ max-width: 100%;
157
161
  border: none;
158
162
  outline: none;
159
163
  background-color: transparent;
@@ -195,6 +199,19 @@
195
199
  height: 24px;
196
200
  line-height: 24px;
197
201
  }
202
+ .semi-tagInput-wrapper-inputMirror {
203
+ position: absolute;
204
+ top: 0;
205
+ left: 0;
206
+ visibility: hidden;
207
+ pointer-events: none;
208
+ height: 0;
209
+ overflow: hidden;
210
+ white-space: pre;
211
+ font-size: 14px;
212
+ font-weight: 400;
213
+ font-family: inherit;
214
+ }
198
215
  .semi-tagInput-clearBtn {
199
216
  display: flex;
200
217
  justify-content: center;
@@ -215,7 +232,7 @@
215
232
  font-weight: 600;
216
233
  font-size: 14px;
217
234
  line-height: 20px;
218
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
235
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
219
236
  color: var(--semi-color-text-2);
220
237
  flex-shrink: 0;
221
238
  white-space: nowrap;
@@ -231,7 +248,7 @@
231
248
  white-space: nowrap;
232
249
  font-size: 14px;
233
250
  line-height: 20px;
234
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
251
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
235
252
  }
236
253
  .semi-tagInput-prefix-icon, .semi-tagInput-suffix-icon {
237
254
  color: var(--semi-color-text-2);
@@ -137,6 +137,7 @@ $module: #{$prefix}-tagInput;
137
137
  padding-left: $spacing-extra-tight;
138
138
  padding-right: $spacing-extra-tight;
139
139
  overflow: hidden;
140
+ position: relative;
140
141
 
141
142
  &-tag {
142
143
  margin-right: $spacing-extra-tight;
@@ -190,6 +191,8 @@ $module: #{$prefix}-tagInput;
190
191
  & &-input {
191
192
  flex-grow: 1;
192
193
  width: min-content;
194
+ min-width: 2px;
195
+ max-width: 100%;
193
196
  // min-width: 38px;
194
197
  border: none;
195
198
  outline: none;
@@ -240,6 +243,21 @@ $module: #{$prefix}-tagInput;
240
243
  }
241
244
  }
242
245
  }
246
+
247
+ /* hidden mirror used to measure input text width */
248
+ &-inputMirror {
249
+ position: absolute;
250
+ top: 0;
251
+ left: 0;
252
+ visibility: hidden;
253
+ pointer-events: none;
254
+ height: 0;
255
+ overflow: hidden;
256
+ white-space: pre;
257
+ font-size: $font-size-regular;
258
+ font-weight: $font-weight-regular;
259
+ font-family: inherit;
260
+ }
243
261
  }
244
262
 
245
263
  &-clearBtn {
@@ -1,3 +1,4 @@
1
+ export type PanelType = 'left' | 'right';
1
2
  declare const cssClasses: {
2
3
  PREFIX: string;
3
4
  RANGE_PICKER: string;
@@ -1,3 +1,4 @@
1
+ import type { PanelType } from './constants';
1
2
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
3
  export type Position = 'top' | 'topLeft' | 'topRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'leftTopOver' | 'rightTopOver';
3
4
  export interface TimePickerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
@@ -16,11 +17,16 @@ declare class TimePickerFoundation<P = Record<string, any>, S = Record<string, a
16
17
  constructor(adapter: TimePickerAdapter<P, S>);
17
18
  init(): void;
18
19
  getPosition(): Position;
20
+ getDisabledTimeFns(panelType: PanelType, dates: Date[]): {
21
+ disabledHours: any;
22
+ disabledMinutes: any;
23
+ disabledSeconds: any;
24
+ };
19
25
  isDisabledHMS({ hours, minutes, seconds }: {
20
26
  hours: number;
21
27
  minutes: number;
22
28
  seconds: number;
23
- }): boolean;
29
+ }, panelType?: PanelType, dates?: Date[]): boolean;
24
30
  isValidTimeZone(timeZone: string | number): boolean;
25
31
  getDefaultFormatIfNeed(): string;
26
32
  /**
@@ -33,17 +33,44 @@ class TimePickerFoundation extends _foundation.default {
33
33
  const rtlDirection = direction === 'rtl' ? 'bottomRight' : '';
34
34
  return position || rtlDirection || _constants.strings.DEFAULT_POSITION[type];
35
35
  }
36
+ getDisabledTimeFns(panelType, dates) {
37
+ const {
38
+ disabledHours,
39
+ disabledMinutes,
40
+ disabledSeconds,
41
+ disabledTime
42
+ } = this.getProps();
43
+ // disabledTime is range-only: only invoke it when the picker is
44
+ // actually a range picker. In single mode panelType has no meaning, so
45
+ // we fall back to the top-level disabledHours / disabledMinutes /
46
+ // disabledSeconds without invoking disabledTime.
47
+ if (typeof disabledTime === 'function' && this._adapter.isRangePicker()) {
48
+ const disabledObj = disabledTime(dates, panelType) || {};
49
+ return {
50
+ disabledHours: disabledObj.disabledHours || disabledHours,
51
+ disabledMinutes: disabledObj.disabledMinutes || disabledMinutes,
52
+ disabledSeconds: disabledObj.disabledSeconds || disabledSeconds
53
+ };
54
+ }
55
+ return {
56
+ disabledHours,
57
+ disabledMinutes,
58
+ disabledSeconds
59
+ };
60
+ }
36
61
  isDisabledHMS(_ref) {
37
62
  let {
38
63
  hours,
39
64
  minutes,
40
65
  seconds
41
66
  } = _ref;
67
+ let panelType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left';
68
+ let dates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
42
69
  const {
43
70
  disabledHours,
44
71
  disabledMinutes,
45
72
  disabledSeconds
46
- } = this.getProps();
73
+ } = this.getDisabledTimeFns(panelType, dates);
47
74
  const hDis = !(0, _isNullOrUndefined.default)(hours) && (0, _utils.hourIsDisabled)(disabledHours, hours);
48
75
  const mDis = !(0, _isNullOrUndefined.default)(hours) && !(0, _isNullOrUndefined.default)(minutes) && (0, _utils.minuteIsDisabled)(disabledMinutes, hours, minutes);
49
76
  const sDis = !(0, _isNullOrUndefined.default)(hours) && !(0, _isNullOrUndefined.default)(minutes) && !(0, _isNullOrUndefined.default)(seconds) && (0, _utils.secondIsDisabled)(disabledSeconds, hours, minutes, seconds);
@@ -165,11 +192,23 @@ class TimePickerFoundation extends _foundation.default {
165
192
  if (this.isValidTimeZone(timeZone)) {
166
193
  dates = dates.map(date => (0, _dateFnsExtra.utcToZonedTime)(this.isValidTimeZone(__prevTimeZone) ? (0, _dateFnsExtra.zonedTimeToUtc)(date, __prevTimeZone) : date, timeZone));
167
194
  }
168
- invalid = dates.some(d => this.isDisabledHMS({
169
- hours: d.getHours(),
170
- minutes: d.getMinutes(),
171
- seconds: d.getSeconds()
172
- }));
195
+ if (this._adapter.isRangePicker()) {
196
+ invalid = dates.some((d, idx) => {
197
+ const panelType = idx === 1 ? 'right' : 'left';
198
+ return this.isDisabledHMS({
199
+ hours: d.getHours(),
200
+ minutes: d.getMinutes(),
201
+ seconds: d.getSeconds()
202
+ }, panelType, dates);
203
+ });
204
+ } else {
205
+ const d = dates[0];
206
+ invalid = d ? this.isDisabledHMS({
207
+ hours: d.getHours(),
208
+ minutes: d.getMinutes(),
209
+ seconds: d.getSeconds()
210
+ }, 'left', dates) : false;
211
+ }
173
212
  }
174
213
  const inputValue = this.formatValue(dates);
175
214
  this.setState({
@@ -265,11 +304,23 @@ class TimePickerFoundation extends _foundation.default {
265
304
  let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
266
305
  let invalid = dates.some(d => isNaN(Number(d)));
267
306
  if (!invalid) {
268
- invalid = dates.some(d => this.isDisabledHMS({
269
- hours: d.getHours(),
270
- minutes: d.getMinutes(),
271
- seconds: d.getSeconds()
272
- }));
307
+ if (this._adapter.isRangePicker()) {
308
+ invalid = dates.some((d, idx) => {
309
+ const panelType = idx === 1 ? 'right' : 'left';
310
+ return this.isDisabledHMS({
311
+ hours: d.getHours(),
312
+ minutes: d.getMinutes(),
313
+ seconds: d.getSeconds()
314
+ }, panelType, dates);
315
+ });
316
+ } else {
317
+ const d = dates[0];
318
+ invalid = d ? this.isDisabledHMS({
319
+ hours: d.getHours(),
320
+ minutes: d.getMinutes(),
321
+ seconds: d.getSeconds()
322
+ }, 'left', dates) : false;
323
+ }
273
324
  }
274
325
  return invalid;
275
326
  }
@@ -79,7 +79,7 @@
79
79
  .semi-timepicker .semi-timepicker-input {
80
80
  font-size: 14px;
81
81
  line-height: 20px;
82
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
82
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
83
83
  border-radius: var(--semi-border-radius-small);
84
84
  align-items: center;
85
85
  }
@@ -77,7 +77,7 @@
77
77
  .semi-timeline-item-content {
78
78
  font-size: 14px;
79
79
  line-height: 20px;
80
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
80
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
81
81
  position: relative;
82
82
  margin: 0 0 0 25px;
83
83
  word-break: break-word;
@@ -86,7 +86,7 @@
86
86
  .semi-timeline-item-content-extra, .semi-timeline-item-content-time {
87
87
  font-size: 12px;
88
88
  line-height: 16px;
89
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
89
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
90
90
  color: var(--semi-color-text-2);
91
91
  margin-top: 4px;
92
92
  }
@@ -34,7 +34,7 @@
34
34
  box-shadow: var(--semi-shadow-elevated);
35
35
  font-size: 14px;
36
36
  line-height: 20px;
37
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
37
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
38
38
  background-color: var(--semi-color-bg-3);
39
39
  border-radius: var(--semi-border-radius-medium);
40
40
  padding: 12px 8px 12px 8px;
@@ -333,7 +333,7 @@ class Tooltip extends _foundation.default {
333
333
  switch (types) {
334
334
  case 'focus':
335
335
  triggerEventSet[eventNames.focus] = () => {
336
- this.delayShow();
336
+ this.getProp('condition') !== false && this.delayShow();
337
337
  };
338
338
  triggerEventSet[eventNames.blur] = () => {
339
339
  this.delayHide();
@@ -343,7 +343,7 @@ class Tooltip extends _foundation.default {
343
343
  case 'click':
344
344
  triggerEventSet[eventNames.click] = () => {
345
345
  // this.delayShow();
346
- this.show();
346
+ this.getProp('condition') !== false && this.show();
347
347
  };
348
348
  portalEventSet = {};
349
349
  // Click outside needs special treatment, can not be directly tied to the trigger Element, need to be bound to the document
@@ -352,7 +352,7 @@ class Tooltip extends _foundation.default {
352
352
  triggerEventSet[eventNames.mouseEnter] = () => {
353
353
  // console.log(e);
354
354
  this.setCache('isClickToHide', false);
355
- this.delayShow();
355
+ this.getProp('condition') !== false && this.delayShow();
356
356
  // this.show('trigger');
357
357
  };
358
358
  triggerEventSet[eventNames.mouseLeave] = () => {
@@ -365,7 +365,7 @@ class Tooltip extends _foundation.default {
365
365
  const {
366
366
  disableFocusListener
367
367
  } = this.getProps();
368
- !disableFocusListener && this.delayShow();
368
+ this.getProp('condition') !== false && !disableFocusListener && this.delayShow();
369
369
  };
370
370
  triggerEventSet[eventNames.blur] = () => {
371
371
  const {
@@ -383,7 +383,7 @@ class Tooltip extends _foundation.default {
383
383
  if (this.getCache('isClickToHide')) {
384
384
  return;
385
385
  }
386
- this.delayShow();
386
+ this.getProp('condition') !== false && this.delayShow();
387
387
  };
388
388
  }
389
389
  break;
@@ -393,6 +393,9 @@ class Tooltip extends _foundation.default {
393
393
  break;
394
394
  case 'contextMenu':
395
395
  triggerEventSet[eventNames.contextMenu] = e => {
396
+ if (this.getProp('condition') === false) {
397
+ return;
398
+ }
396
399
  e.preventDefault();
397
400
  this.show();
398
401
  };
@@ -54,7 +54,7 @@
54
54
  overflow-wrap: break-word;
55
55
  font-size: 14px;
56
56
  line-height: 20px;
57
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
57
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
58
58
  opacity: 0;
59
59
  max-width: 240px;
60
60
  }
@@ -6,5 +6,7 @@ declare const strings: {
6
6
  TYPE_LIST: string;
7
7
  TYPE_TREE_TO_LIST: string;
8
8
  };
9
- declare const numbers: {};
9
+ declare const numbers: {
10
+ DEFAULT_PAGE_SIZE: number;
11
+ };
10
12
  export { cssClasses, strings, numbers };
@@ -13,4 +13,6 @@ const strings = exports.strings = {
13
13
  TYPE_LIST: 'list',
14
14
  TYPE_TREE_TO_LIST: 'treeList'
15
15
  };
16
- const numbers = exports.numbers = {};
16
+ const numbers = exports.numbers = {
17
+ DEFAULT_PAGE_SIZE: 10
18
+ };
@@ -31,6 +31,8 @@ export interface TransferAdapter<P = Record<string, any>, S = Record<string, any
31
31
  updateInput: (input: string) => void;
32
32
  updateSearchResult: (searchResult: Set<number | string>) => void;
33
33
  searchTree: (keyword: string) => void;
34
+ updateCurrentPage: (currentPage: number) => void;
35
+ notifyPageChange: (currentPage: number) => void;
34
36
  }
35
37
  export default class TransferFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TransferAdapter<P, S>> {
36
38
  constructor(adapter: TransferAdapter<P, S>);
@@ -59,4 +61,5 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
59
61
  };
60
62
  _notifyChange(selectedItems: DataItemMap): void;
61
63
  handleSortEnd(callbackProps: OnSortEndProps): void;
64
+ handlePageChange(currentPage: number): void;
62
65
  }
@@ -234,5 +234,9 @@ class TransferFoundation extends _foundation.default {
234
234
  this._adapter.updateSelected(newSelectedItems);
235
235
  this._notifyChange(newSelectedItems);
236
236
  }
237
+ handlePageChange(currentPage) {
238
+ this._adapter.updateCurrentPage(currentPage);
239
+ this._adapter.notifyPageChange(currentPage);
240
+ }
237
241
  }
238
242
  exports.default = TransferFoundation;
@@ -35,7 +35,7 @@
35
35
  .semi-transfer-header {
36
36
  font-size: 12px;
37
37
  line-height: 16px;
38
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
38
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
39
39
  display: flex;
40
40
  align-items: center;
41
41
  height: 24px;
@@ -53,7 +53,7 @@
53
53
  .semi-transfer-header .semi-button {
54
54
  font-size: 12px;
55
55
  line-height: 16px;
56
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
56
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
57
57
  }
58
58
  .semi-transfer-item {
59
59
  min-height: 36px;
@@ -65,7 +65,7 @@
65
65
  user-select: none;
66
66
  font-size: 14px;
67
67
  line-height: 20px;
68
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
68
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
69
69
  display: flex;
70
70
  align-items: center;
71
71
  justify-content: space-between;
@@ -102,6 +102,15 @@
102
102
  overflow: auto;
103
103
  flex-grow: 1;
104
104
  }
105
+ .semi-transfer-left-pagination {
106
+ padding-top: 12px;
107
+ padding-bottom: 12px;
108
+ padding-left: 12px;
109
+ padding-right: 12px;
110
+ flex-shrink: 0;
111
+ display: flex;
112
+ justify-content: center;
113
+ }
105
114
  .semi-transfer-left-empty {
106
115
  height: 36px;
107
116
  }
@@ -163,7 +172,7 @@
163
172
  align-items: center;
164
173
  font-size: 12px;
165
174
  line-height: 16px;
166
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
175
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
167
176
  color: var(--semi-color-text-2);
168
177
  }
169
178
  .semi-transfer-filter {
@@ -177,7 +186,7 @@
177
186
  padding-left: 12px;
178
187
  font-size: 12px;
179
188
  line-height: 16px;
180
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
189
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
181
190
  height: 28px;
182
191
  display: flex;
183
192
  align-items: center;
@@ -118,6 +118,16 @@ $module: #{$prefix}-transfer;
118
118
  flex-grow: 1;
119
119
  }
120
120
 
121
+ &-pagination {
122
+ padding-top: $spacing-base-tight;
123
+ padding-bottom: $spacing-base-tight;
124
+ padding-left: $spacing-base-tight;
125
+ padding-right: $spacing-base-tight;
126
+ flex-shrink: 0;
127
+ display: flex;
128
+ justify-content: center;
129
+ }
130
+
121
131
  &-empty {
122
132
  height: $height-transfer_left_empty;
123
133
  }
@@ -2,6 +2,7 @@
2
2
  * The drag and drop handler implementation is referenced from rc-tree
3
3
  * https://github.com/react-component/tree
4
4
  */
5
+ import { throttle } from 'lodash';
5
6
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
6
7
  import type { KeyMapProps } from './treeUtil';
7
8
  export type { KeyMapProps };
@@ -241,7 +242,9 @@ export interface TreeAdapter extends DefaultAdapter<BasicTreeProps, BasicTreeInn
241
242
  }
242
243
  export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTreeProps, BasicTreeInnerData> {
243
244
  delayedDragEnterLogic: any;
245
+ throttledDragOverUpdate: ReturnType<typeof throttle>;
244
246
  constructor(adapter: TreeAdapter);
247
+ destroy(): void;
245
248
  _isMultiple(): any;
246
249
  _isAnimated(): any;
247
250
  _isDisabled(treeNode?: BasicTreeNodeProps): any;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _throttle2 = _interopRequireDefault(require("lodash/throttle"));
7
8
  var _get2 = _interopRequireDefault(require("lodash/get"));
8
9
  var _pick2 = _interopRequireDefault(require("lodash/pick"));
9
10
  var _difference2 = _interopRequireDefault(require("lodash/difference"));
@@ -26,6 +27,27 @@ class TreeFoundation extends _foundation.default {
26
27
  dragging: false
27
28
  });
28
29
  };
30
+ // Throttle drag over state updates to improve performance during fast dragging
31
+ // 16ms ≈ 60fps, ensuring smooth updates without excessive re-renders
32
+ this.throttledDragOverUpdate = (0, _throttle2.default)(dropPosition => {
33
+ this._adapter.updateState({
34
+ dropPosition
35
+ });
36
+ }, 16);
37
+ }
38
+ destroy() {
39
+ super.destroy();
40
+ // Cancel any pending throttled updates
41
+ if (this.throttledDragOverUpdate) {
42
+ this.throttledDragOverUpdate.cancel();
43
+ }
44
+ // Clear pending delayed drag enter timers to avoid updates after unmount
45
+ if (this.delayedDragEnterLogic) {
46
+ Object.keys(this.delayedDragEnterLogic).forEach(key => {
47
+ clearTimeout(this.delayedDragEnterLogic[key]);
48
+ });
49
+ this.delayedDragEnterLogic = null;
50
+ }
29
51
  }
30
52
  _isMultiple() {
31
53
  return this.getProp('multiple');
@@ -595,30 +617,35 @@ class TreeFoundation extends _foundation.default {
595
617
  if (dragNodesKeys.has(eventKey)) {
596
618
  return;
597
619
  }
598
- // Update the drag position
620
+ // Update the drag position with throttle to improve performance
599
621
  if (dragNode && eventKey === dragOverNodeKey) {
600
622
  const newPos = (0, _treeUtil.calcDropRelativePosition)(e, treeNode);
601
623
  if (dropPosition === newPos) {
602
624
  return;
603
625
  }
604
- this._adapter.updateState({
605
- dropPosition: newPos
606
- });
626
+ // Use throttled update to reduce re-renders during fast dragging
627
+ this.throttledDragOverUpdate(newPos);
607
628
  }
608
629
  this.triggerDragEvent('onDragOver', e, treeNode);
609
630
  }
610
631
  handleNodeDragLeave(e, treeNode) {
632
+ // Cancel pending throttled updates when leaving a node
633
+ this.throttledDragOverUpdate.cancel();
611
634
  this._adapter.updateState({
612
635
  dragOverNodeKey: ''
613
636
  });
614
637
  this.triggerDragEvent('onDragLeave', e, treeNode);
615
638
  }
616
639
  handleNodeDragEnd(e, treeNode) {
640
+ // Flush any pending throttled updates before clearing drag state
641
+ this.throttledDragOverUpdate.flush();
617
642
  this.clearDragState();
618
643
  this.triggerDragEvent('onDragEnd', e, treeNode);
619
644
  this._adapter.setDragNode(null);
620
645
  }
621
646
  handleNodeDrop(e, treeNode, dragNode) {
647
+ // Flush any pending throttled updates to ensure accurate drop position
648
+ this.throttledDragOverUpdate.flush();
622
649
  const {
623
650
  dropPosition,
624
651
  dragNodesKeys
@@ -50,7 +50,7 @@
50
50
  transform: scale(var(--semi-transform_scale-none));
51
51
  font-size: 14px;
52
52
  line-height: 20px;
53
- font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
53
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
54
54
  word-break: break-word;
55
55
  color: var(--semi-color-text-0);
56
56
  position: relative;
@@ -49,6 +49,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
49
49
  outerTopSlot?: any;
50
50
  placeholder?: string;
51
51
  prefix?: any;
52
+ remote?: boolean;
52
53
  searchAutoFocus?: boolean;
53
54
  searchPlaceholder?: string;
54
55
  showSearchClear?: boolean;