@douyinfe/semi-foundation 2.19.1-alpha.0 → 2.19.2-alpha.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 (78) hide show
  1. package/anchor/anchor.scss +1 -8
  2. package/anchor/rtl.scss +0 -1
  3. package/anchor/variables.scss +1 -0
  4. package/button/button.scss +42 -5
  5. package/button/variables.scss +1 -0
  6. package/calendar/eventUtil.ts +8 -7
  7. package/calendar/foundation.ts +14 -14
  8. package/checkbox/checkbox.scss +21 -21
  9. package/checkbox/rtl.scss +0 -36
  10. package/datePicker/monthsGridFoundation.ts +10 -3
  11. package/dropdown/foundation.ts +2 -1
  12. package/dropdown/menuFoundation.ts +2 -1
  13. package/lib/cjs/anchor/anchor.css +1 -10
  14. package/lib/cjs/anchor/anchor.scss +1 -8
  15. package/lib/cjs/anchor/rtl.scss +0 -1
  16. package/lib/cjs/anchor/variables.scss +1 -0
  17. package/lib/cjs/button/button.css +40 -3
  18. package/lib/cjs/button/button.scss +42 -5
  19. package/lib/cjs/button/variables.scss +1 -0
  20. package/lib/cjs/calendar/eventUtil.d.ts +3 -3
  21. package/lib/cjs/calendar/eventUtil.js +12 -6
  22. package/lib/cjs/calendar/foundation.js +34 -15
  23. package/lib/cjs/checkbox/checkbox.css +21 -52
  24. package/lib/cjs/checkbox/checkbox.scss +21 -21
  25. package/lib/cjs/checkbox/rtl.scss +0 -36
  26. package/lib/cjs/datePicker/monthsGridFoundation.js +13 -3
  27. package/lib/cjs/dropdown/foundation.js +3 -2
  28. package/lib/cjs/dropdown/menuFoundation.js +3 -2
  29. package/lib/cjs/popconfirm/popconfirmFoundation.d.ts +4 -2
  30. package/lib/cjs/popconfirm/popconfirmFoundation.js +30 -4
  31. package/lib/cjs/radio/radio.css +21 -83
  32. package/lib/cjs/radio/radio.scss +23 -40
  33. package/lib/cjs/radio/rtl.scss +0 -53
  34. package/lib/cjs/select/foundation.js +2 -2
  35. package/lib/cjs/sideSheet/sideSheet.css +1 -0
  36. package/lib/cjs/sideSheet/sideSheet.scss +1 -0
  37. package/lib/cjs/slider/foundation.js +19 -9
  38. package/lib/cjs/tree/tree.css +3 -0
  39. package/lib/cjs/tree/tree.scss +4 -0
  40. package/lib/cjs/tree/treeUtil.d.ts +1 -1
  41. package/lib/cjs/upload/constants.d.ts +1 -1
  42. package/lib/es/anchor/anchor.css +1 -10
  43. package/lib/es/anchor/anchor.scss +1 -8
  44. package/lib/es/anchor/rtl.scss +0 -1
  45. package/lib/es/anchor/variables.scss +1 -0
  46. package/lib/es/button/button.css +40 -3
  47. package/lib/es/button/button.scss +42 -5
  48. package/lib/es/button/variables.scss +1 -0
  49. package/lib/es/calendar/eventUtil.d.ts +3 -3
  50. package/lib/es/calendar/eventUtil.js +12 -6
  51. package/lib/es/calendar/foundation.js +34 -15
  52. package/lib/es/checkbox/checkbox.css +21 -52
  53. package/lib/es/checkbox/checkbox.scss +21 -21
  54. package/lib/es/checkbox/rtl.scss +0 -36
  55. package/lib/es/datePicker/monthsGridFoundation.js +13 -3
  56. package/lib/es/dropdown/foundation.js +3 -2
  57. package/lib/es/dropdown/menuFoundation.js +3 -2
  58. package/lib/es/popconfirm/popconfirmFoundation.d.ts +4 -2
  59. package/lib/es/popconfirm/popconfirmFoundation.js +29 -4
  60. package/lib/es/radio/radio.css +21 -83
  61. package/lib/es/radio/radio.scss +23 -40
  62. package/lib/es/radio/rtl.scss +0 -53
  63. package/lib/es/select/foundation.js +2 -2
  64. package/lib/es/sideSheet/sideSheet.css +1 -0
  65. package/lib/es/sideSheet/sideSheet.scss +1 -0
  66. package/lib/es/slider/foundation.js +19 -9
  67. package/lib/es/tree/tree.css +3 -0
  68. package/lib/es/tree/tree.scss +4 -0
  69. package/lib/es/tree/treeUtil.d.ts +1 -1
  70. package/lib/es/upload/constants.d.ts +1 -1
  71. package/package.json +2 -2
  72. package/popconfirm/popconfirmFoundation.ts +35 -6
  73. package/radio/radio.scss +23 -40
  74. package/radio/rtl.scss +0 -53
  75. package/select/foundation.ts +2 -2
  76. package/sideSheet/sideSheet.scss +1 -0
  77. package/slider/foundation.ts +15 -8
  78. package/tree/tree.scss +4 -0
@@ -18,8 +18,6 @@ $module: #{$prefix}-anchor;
18
18
  left: $spacing-anchor_slide-left;
19
19
  top: $spacing-anchor_slide-top;
20
20
  height: 100%;
21
- box-sizing: border-box;
22
- padding: $width-anchor-outline 0;
23
21
 
24
22
  &-muted {
25
23
  display: none;
@@ -65,12 +63,6 @@ $module: #{$prefix}-anchor;
65
63
  }
66
64
 
67
65
  &-link {
68
- padding-left: $spacing-anchor_link-paddingLeft;
69
-
70
- &-wrapper {
71
- padding-right: $width-anchor-outline;
72
- margin: $width-anchor-outline 0;
73
- }
74
66
 
75
67
  &-title {
76
68
  cursor: pointer;
@@ -93,6 +85,7 @@ $module: #{$prefix}-anchor;
93
85
 
94
86
  &:focus-visible {
95
87
  outline: $width-anchor-outline solid $color-anchor_title-outline-focus;
88
+ outline-offset: $width-anchor-outlineOffset;
96
89
  }
97
90
 
98
91
  &-disabled {
package/anchor/rtl.scss CHANGED
@@ -11,7 +11,6 @@ $module: #{$prefix}-anchor;
11
11
  }
12
12
 
13
13
  &-link {
14
- padding-right: $spacing-anchor_link-paddingLeft;
15
14
  padding-left: auto;
16
15
  }
17
16
  }
@@ -30,4 +30,5 @@ $radius-anchor_slide: 1px; // 滑轨圆角
30
30
 
31
31
  // Witdh
32
32
  $width-anchor-outline: 2px; // anchor轮廓宽度
33
+ $width-anchor-outlineOffset: -2px; // anchor轮廓 outline-offset 宽度
33
34
  $width-anchor-outline_border_radius: 3px; // anchor轮廓圆角
@@ -202,6 +202,9 @@ $module: #{$prefix}-button;
202
202
  }
203
203
 
204
204
  &-group {
205
+ display: flex;
206
+ flex-wrap: wrap;
207
+
205
208
  & > .#{$module} {
206
209
  margin: 0;
207
210
  padding-left: 0;
@@ -257,16 +260,50 @@ $module: #{$prefix}-button;
257
260
  border-top-left-radius: $radius-button_group;
258
261
  border-bottom-left-radius: $radius-button_group;
259
262
  }
260
- &:not(:last-child) {
261
- .#{$prefix}-button-content {
262
- border-right: $width-button_group-border $color-button_group-border-default solid;
263
- }
264
- }
265
263
  &:last-child {
266
264
  border-top-right-radius: $radius-button_group;
267
265
  border-bottom-right-radius: $radius-button_group;
268
266
  }
269
267
  }
268
+
269
+ &-line {
270
+ display: inline-flex;
271
+ align-items: center;
272
+ background-color: $color-button_group-border-default;
273
+
274
+ &-primary {
275
+ background-color: $color-button_primary-bg-default;
276
+ }
277
+ &-secondary {
278
+ background-color: $color-button_secondary-bg-default;
279
+ }
280
+ &-tertiary {
281
+ background-color: $color-button_tertiary-bg-default;
282
+ }
283
+ &-warning {
284
+ background-color: $color-button_warning-bg-default;
285
+ }
286
+ &-danger {
287
+ background-color: $color-button_danger-bg-default;
288
+ }
289
+ &-disabled {
290
+ background-color: $color-button_disabled-bg-default;
291
+ }
292
+ &-light {
293
+ background-color: $color-button_light-bg-default;
294
+ }
295
+ &-borderless {
296
+ background-color: transparent;
297
+ }
298
+
299
+ &::before {
300
+ display: block;
301
+ content: '';
302
+ width: $width-button_group-border;
303
+ height: $height-button_group_line_default;
304
+ background-color: $color-button_group-border-default;
305
+ }
306
+ }
270
307
  }
271
308
  }
272
309
 
@@ -141,6 +141,7 @@ $font-button-fontWeight: $font-weight-bold; // 按钮文字字重
141
141
  $height-button_large: $height-control-large; // 按钮高度 - 大尺寸
142
142
  $height-button_small: $height-control-small; // 按钮高度 - 小尺寸
143
143
  $height-button_default: $height-control-default; // 按钮高度 - 默认
144
+ $height-button_group_line_default: 20px; // 分割线高度 - 默认
144
145
 
145
146
  $width-button-border: $border-thickness; // 按钮描边宽度
146
147
  $radius-button: var(--semi-border-radius-small); // 按钮圆角大小
@@ -98,7 +98,7 @@ export interface DateObj {
98
98
 
99
99
  export type weeekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
100
100
 
101
- export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale) => {
101
+ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weeekStartsOnEnum) => {
102
102
  const today = getCurrDate();
103
103
  const arr: Array<DateObj> = [];
104
104
  [...Array(rangeLen).keys()].map(ind => {
@@ -106,8 +106,8 @@ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode:
106
106
  const date = addDays(start, ind);
107
107
  dateObj.ind = ind;
108
108
  dateObj.date = date;
109
- dateObj.dayString = format(date, 'd', { locale });
110
- dateObj.weekday = format(date, 'EEE', { locale });
109
+ dateObj.dayString = format(date, 'd', { locale, weekStartsOn });
110
+ dateObj.weekday = format(date, 'EEE', { locale, weekStartsOn });
111
111
  dateObj.isToday = isSameDay(date, today);
112
112
  dateObj.isWeekend = checkWeekend(date);
113
113
  if (mode === 'month') {
@@ -129,7 +129,7 @@ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode:
129
129
  */
130
130
  export const calcWeekData = (value: Date, mode = 'week', locale: Locale, weekStartsOn: weeekStartsOnEnum) => {
131
131
  const start = startOfWeek(value, { weekStartsOn });
132
- return calcRangeData(value, start, 7, mode, locale);
132
+ return calcRangeData(value, start, 7, mode, locale, weekStartsOn);
133
133
  };
134
134
 
135
135
  /**
@@ -250,7 +250,7 @@ export const filterEvents = (events: Map<string, EventObject[]>, start: Date, en
250
250
  * filter out event that is not in the week range
251
251
  */
252
252
  // eslint-disable-next-line max-len
253
- export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart), 1));
253
+ export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn: weeekStartsOnEnum ) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart, { weekStartsOn }), 1));
254
254
 
255
255
  /**
256
256
  * @returns {arr}
@@ -308,8 +308,9 @@ export const parseWeeklyAllDayEvent = (
308
308
  event: EventObject[],
309
309
  startDate: Date,
310
310
  weekStart: Date,
311
- parsed: Array<Array<ParsedRangeEvent>>
312
- ) => parseRangeAllDayEvent(event, startDate, weekStart, addDays(endOfWeek(startDate), 1), parsed);
311
+ parsed: Array<Array<ParsedRangeEvent>>,
312
+ weekStartsOn: weeekStartsOnEnum
313
+ ) => parseRangeAllDayEvent(event, startDate, weekStart, addDays(endOfWeek(startDate, { weekStartsOn }), 1), parsed);
313
314
 
314
315
 
315
316
  export const collectDailyEvents = (events: ParsedRangeEvent[][]) => {
@@ -190,8 +190,8 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
190
190
 
191
191
  getWeeklyData(value: Date, dateFnsLocale: Locale) {
192
192
  const data = {} as WeeklyData;
193
- data.month = format(value, 'LLL', { locale: dateFnsLocale });
194
193
  const { weekStartsOn } = this.getProps();
194
+ data.month = format(value, 'LLL', { locale: dateFnsLocale, weekStartsOn });
195
195
  data.week = calcWeekData(value, 'week', dateFnsLocale, weekStartsOn);
196
196
  this._adapter.setWeeklyData(data);
197
197
  return data;
@@ -199,10 +199,10 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
199
199
 
200
200
  getRangeData(value: Date, dateFnsLocale: Locale) {
201
201
  const data = {} as { month: string; week: Array<DateObj> };
202
- const { range } = this.getProps();
202
+ const { range, weekStartsOn } = this.getProps();
203
203
  const len = differenceInCalendarDays(range[1], range[0]);
204
- data.month = format(value, 'LLL', { locale: dateFnsLocale });
205
- data.week = calcRangeData(value, range[0], len, 'week', dateFnsLocale);
204
+ data.month = format(value, 'LLL', { locale: dateFnsLocale, weekStartsOn });
205
+ data.week = calcRangeData(value, range[0], len, 'week', dateFnsLocale, weekStartsOn);
206
206
  this._adapter.setRangeData(data);
207
207
  return data;
208
208
  }
@@ -211,7 +211,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
211
211
  const monthStart = startOfMonth(value);
212
212
  const data = {} as MonthData;
213
213
  const { weekStartsOn } = this.getProps();
214
- const numberOfWeek = getWeeksInMonth(value);
214
+ const numberOfWeek = getWeeksInMonth(value, { weekStartsOn });
215
215
  [...Array(numberOfWeek).keys()].map(ind => {
216
216
  data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
217
217
  });
@@ -263,12 +263,13 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
263
263
  // ================== Weekly Event ==================
264
264
 
265
265
  _parseWeeklyEvents(events: ParsedEvents['allDay'], weekStart: Date) {
266
+ const { weekStartsOn } = this.getProps();
266
267
  let parsed = [[]] as ParsedRangeEvent[][];
267
- const filtered = filterWeeklyEvents(events, weekStart);
268
+ const filtered = filterWeeklyEvents(events, weekStart, weekStartsOn);
268
269
  [...filtered.keys()].sort((a, b) => sortDate(a, b)).forEach(item => {
269
270
  const startDate = new Date(item);
270
271
  const curr = filtered.get(item).filter(event => isSameDay(event.date, startDate));
271
- parsed = parseWeeklyAllDayEvent(curr, startDate, weekStart, parsed);
272
+ parsed = parseWeeklyAllDayEvent(curr, startDate, weekStart, parsed, weekStartsOn);
272
273
  });
273
274
  return parsed;
274
275
  }
@@ -332,7 +333,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
332
333
 
333
334
  getParseMonthlyEvents(itemLimit: number) {
334
335
  const parsed: any = {};
335
- const { displayValue, events } = this.getProps();
336
+ const { displayValue, events, weekStartsOn } = this.getProps();
336
337
  const currDate = this._getDate();
337
338
  const firstDayOfMonth = startOfMonth(displayValue);
338
339
  const lastDayOfMonth = endOfMonth(displayValue);
@@ -354,31 +355,30 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
354
355
  // WeekInd calculation error, need to consider the boundary situation at the beginning/end of the month
355
356
  // When the date falls within the month
356
357
  if (isSameMonth(item.date, displayValue)) {
357
- const weekInd = getWeekOfMonth(item.date) - 1;
358
+ const weekInd = getWeekOfMonth(item.date, { weekStartsOn }) - 1;
358
359
  this.pushDayEventIntoWeekMap(item, weekInd, parsed);
359
360
  return;
360
361
  }
361
362
  // When the date is within the previous month
362
363
  if (isBefore(item.date, firstDayOfMonth)) {
363
- if (isSameWeek(item.date, firstDayOfMonth)) {
364
+ if (isSameWeek(item.date, firstDayOfMonth, { weekStartsOn })) {
364
365
  this.pushDayEventIntoWeekMap(item, 0, parsed);
365
366
  }
366
367
  return;
367
368
  }
368
369
  // When the date is within the next month
369
370
  if (isAfter(item.date, lastDayOfMonth)) {
370
- if (isSameWeek(item.date, lastDayOfMonth)) {
371
- const weekInd = getWeekOfMonth(lastDayOfMonth) - 1;
371
+ if (isSameWeek(item.date, lastDayOfMonth, { weekStartsOn })) {
372
+ const weekInd = getWeekOfMonth(lastDayOfMonth, { weekStartsOn }) - 1;
372
373
  this.pushDayEventIntoWeekMap(item, weekInd, parsed);
373
374
  }
374
375
  return;
375
376
  }
376
377
  });
377
-
378
378
  Object.keys(parsed).forEach(key => {
379
379
  const week = parsed[key];
380
380
  parsed[key] = {};
381
- const weekStart = startOfWeek(week[0].date);
381
+ const weekStart = startOfWeek(week[0].date, { weekStartsOn });
382
382
  const weekMap = convertEventsArrToMap(week, 'start', startOfDay);
383
383
  // When there are multiple events in a week, multiple events should be parsed
384
384
  // const oldParsedWeeklyEvent = this._parseWeeklyEvents(weekMap, weekStart);
@@ -11,13 +11,14 @@ $module: #{$prefix}-checkbox;
11
11
  // box-sizing: border-box;
12
12
  position: relative;
13
13
  display: flex;
14
- align-items: center;
14
+ align-items: flex-start;
15
15
  flex-wrap: wrap;
16
16
  @include font-size-regular;
17
17
  cursor: pointer;
18
18
  transition: background-color $transition_duration-checkbox-bg $transition_function-checkbox-bg $transition_delay-checkbox-bg,
19
19
  border $transition_duration-checkbox-border $transition_function-checkbox-border $transition_delay-checkbox-border;
20
20
  transform: scale($transform_scale-checkbox);
21
+ column-gap: $spacing-checkbox_label-paddingLeft;
21
22
 
22
23
  input[type="checkbox"] {
23
24
  position: absolute;
@@ -29,11 +30,17 @@ $module: #{$prefix}-checkbox;
29
30
  opacity: 0;
30
31
  }
31
32
 
33
+ &-content {
34
+ flex: 1;
35
+ display: flex;
36
+ flex-direction: column;
37
+ row-gap: $spacing-checkbox_extra-marginTop;
38
+ }
39
+
32
40
  &-addon {
33
41
  display: flex;
34
42
  flex: 1;
35
43
  align-items: center;
36
- padding-left: $spacing-checkbox_label-paddingLeft;
37
44
  color: $color-checkbox_label-text-default;
38
45
  line-height: $font-checkbox_label-lineHeight;
39
46
  user-select: none;
@@ -192,7 +199,6 @@ $module: #{$prefix}-checkbox;
192
199
  background: $color-checkbox_cardType_inner-bg-default;
193
200
  }
194
201
 
195
- margin-right: $spacing-checkbox_cardType_inner-marginRight;
196
202
  flex-shrink: 0;
197
203
  }
198
204
 
@@ -202,7 +208,6 @@ $module: #{$prefix}-checkbox;
202
208
  // input focus/blur cannot take effect when display: none
203
209
  opacity: 0;
204
210
  width: 0;
205
- margin-right: 0;
206
211
  }
207
212
 
208
213
  .#{$module}-addon {
@@ -210,8 +215,6 @@ $module: #{$prefix}-checkbox;
210
215
  font-size: $font-checkbox_cardType_addon-size;
211
216
  line-height: $font-checkbox_cardType_addon-lineHeight;
212
217
  color: $color-checkbox_cardType_addon-text-default;
213
- margin-left: 0;
214
- padding-left: 0;
215
218
  }
216
219
 
217
220
  .#{$module}-extra {
@@ -219,7 +222,6 @@ $module: #{$prefix}-checkbox;
219
222
  font-size: $font-checkbox_cardType_extra-size;
220
223
  line-height: $font-checkbox_cardType_extra-lineHeight;
221
224
  color: $color-checkbox_cardType_extra-text-default;
222
- padding-left: 0;
223
225
 
224
226
  &.#{$module}-cardType_extra_noChildren {
225
227
  margin-top: 0;
@@ -359,9 +361,7 @@ $module: #{$prefix}-checkbox;
359
361
  flex-grow: 1;
360
362
  flex-basis: 100%;
361
363
  box-sizing: border-box;
362
- padding-left: $spacing-checkbox_extra-paddingLeft;
363
364
  color: $color-checkbox_extra-text-default;
364
- margin-top: $spacing-checkbox_extra-marginTop;
365
365
  }
366
366
 
367
367
  &-focus {
@@ -385,28 +385,28 @@ $module: #{$prefix}-checkbox;
385
385
  }
386
386
 
387
387
  &-horizontal {
388
+ display: flex;
389
+ flex-wrap: wrap;
390
+ gap: $spacing-checkbox_group_horizontal-marginRight;
391
+
388
392
  .#{$module} {
389
- margin-right: $spacing-checkbox_group_horizontal-marginRight;
390
393
  display: inline-flex;
391
-
392
- &:last-of-type {
393
- margin-right: 0;
394
- }
395
394
  }
396
395
  }
397
396
 
398
397
  &-vertical {
399
- .#{$module} {
400
- margin-bottom: $spacing-checkbox_group_vertical_item-marginBottom;
398
+ display: flex;
399
+ flex-direction: column;
400
+ row-gap: $spacing-checkbox_group_vertical_item-marginBottom;
401
401
 
402
- &:last-of-type {
403
- margin-bottom: 0;
404
- }
402
+ &-cardType {
403
+ row-gap: $spacing-checkbox_card_group_vertical-marginBottom;
405
404
  }
406
405
 
407
- &-cardType {
406
+
407
+ &-pureCardType {
408
408
  .#{$module} {
409
- margin-bottom: $spacing-checkbox_card_group_vertical-marginBottom;
409
+ column-gap: 0;
410
410
  }
411
411
  }
412
412
  }
package/checkbox/rtl.scss CHANGED
@@ -10,45 +10,9 @@ $inner-width: $width-icon-medium;
10
10
  left: auto;
11
11
  right: 0;
12
12
  }
13
-
14
- &-addon {
15
- padding-left: 0;
16
- padding-right: $spacing-checkbox_label-paddingLeft;
17
- }
18
-
19
- &-extra {
20
- padding-left: 0;
21
- padding-right: $spacing-checkbox_extra-paddingLeft;
22
- }
23
-
24
- &-cardType {
25
- .#{$module}-inner {
26
- margin-right: 0;
27
- margin-left: $spacing-checkbox_cardType_inner-marginRight;
28
- }
29
-
30
- .#{$module}-addon {
31
- margin-right: 0;
32
- padding-right: 0;
33
- }
34
-
35
- .#{$module}-extra {
36
- padding-right: 0;
37
- }
38
- }
39
13
  }
40
14
 
41
15
  .#{$module}Group {
42
16
  direction: rtl;
43
-
44
- &-horizontal {
45
- .#{$module} {
46
- margin-right: 0;
47
- margin-left: $spacing-checkbox_group_horizontal-marginRight;
48
- &:last-of-type {
49
- margin-left: 0;
50
- }
51
- }
52
- }
53
17
  }
54
18
  }
@@ -542,8 +542,8 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
542
542
  type: YearMonthChangeType,
543
543
  targetDate: Date
544
544
  ) {
545
- const { multiple, disabledDate } = this.getProps();
546
- const { selected: selectedSet, rangeStart, rangeEnd } = this.getStates();
545
+ const { multiple, disabledDate, type: dateType } = this.getProps();
546
+ const { selected: selectedSet, rangeStart, rangeEnd, monthLeft } = this.getStates();
547
547
  // FIXME:
548
548
  const includeRange = ['dateRange', 'dateTimeRange'].includes(type);
549
549
  const options = { closePanel: false };
@@ -552,7 +552,14 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
552
552
  const selectedDate = new Date(selectedStr);
553
553
  const year = targetDate.getFullYear();
554
554
  const month = targetDate.getMonth();
555
- const fullDate = set(selectedDate, { year, month });
555
+ let fullDate = set(selectedDate, { year, month });
556
+ if (dateType === 'dateTime') {
557
+ /**
558
+ * 如果是 type dateTime 切换月份要读取只取的time
559
+ * 无论 monthLeft 还是 monthRight 他们的 time 是不变的,所以只取 monthLeft 即可
560
+ */
561
+ fullDate = this._mergeDateAndTime(fullDate, monthLeft.pickerDate);
562
+ }
556
563
  if (disabledDate(fullDate, { rangeStart, rangeEnd })) {
557
564
  return;
558
565
  }
@@ -34,7 +34,8 @@ export default class DropdownFoundation extends BaseFoundation<DropdownAdapter>
34
34
  case ' ':
35
35
  case 'Enter':
36
36
  event.target.click();
37
- handlePrevent(event);
37
+ // user may use input to be the trigger and bind some key event on it, so do not stoppropagation
38
+ // handlePrevent(event);
38
39
  break;
39
40
  case 'ArrowDown':
40
41
  this.setFocusToFirstMenuItem(event.target);
@@ -54,7 +54,8 @@ export default class DropdownMenuFoundation extends BaseFoundation<Partial<Defau
54
54
  case ' ':
55
55
  case 'Enter':
56
56
  event.target.click();
57
- handlePrevent(event);
57
+ // user may use input to be the trigger and bind some key event on it, so do not stoppropagation
58
+ // handlePrevent(event);
58
59
  break;
59
60
  case 'Escape':
60
61
  this.handleEscape(menu);
@@ -19,8 +19,6 @@
19
19
  left: 0;
20
20
  top: 0;
21
21
  height: 100%;
22
- box-sizing: border-box;
23
- padding: 2px 0;
24
22
  }
25
23
  .semi-anchor-slide-muted {
26
24
  display: none;
@@ -56,13 +54,6 @@
56
54
  border-radius: 1px;
57
55
  content: " ";
58
56
  }
59
- .semi-anchor-link {
60
- padding-left: 8px;
61
- }
62
- .semi-anchor-link-wrapper {
63
- padding-right: 2px;
64
- margin: 2px 0;
65
- }
66
57
  .semi-anchor-link-title {
67
58
  cursor: pointer;
68
59
  color: var(--semi-color-text-2);
@@ -83,6 +74,7 @@
83
74
  }
84
75
  .semi-anchor-link-title:focus-visible {
85
76
  outline: 2px solid var(--semi-color-primary-light-active);
77
+ outline-offset: -2px;
86
78
  }
87
79
  .semi-anchor-link-title-disabled {
88
80
  color: var(--semi-color-disabled-text);
@@ -125,6 +117,5 @@
125
117
  }
126
118
  .semi-rtl .semi-anchor-link,
127
119
  .semi-portal-rtl .semi-anchor-link {
128
- padding-right: 8px;
129
120
  padding-left: auto;
130
121
  }
@@ -18,8 +18,6 @@ $module: #{$prefix}-anchor;
18
18
  left: $spacing-anchor_slide-left;
19
19
  top: $spacing-anchor_slide-top;
20
20
  height: 100%;
21
- box-sizing: border-box;
22
- padding: $width-anchor-outline 0;
23
21
 
24
22
  &-muted {
25
23
  display: none;
@@ -65,12 +63,6 @@ $module: #{$prefix}-anchor;
65
63
  }
66
64
 
67
65
  &-link {
68
- padding-left: $spacing-anchor_link-paddingLeft;
69
-
70
- &-wrapper {
71
- padding-right: $width-anchor-outline;
72
- margin: $width-anchor-outline 0;
73
- }
74
66
 
75
67
  &-title {
76
68
  cursor: pointer;
@@ -93,6 +85,7 @@ $module: #{$prefix}-anchor;
93
85
 
94
86
  &:focus-visible {
95
87
  outline: $width-anchor-outline solid $color-anchor_title-outline-focus;
88
+ outline-offset: $width-anchor-outlineOffset;
96
89
  }
97
90
 
98
91
  &-disabled {
@@ -11,7 +11,6 @@ $module: #{$prefix}-anchor;
11
11
  }
12
12
 
13
13
  &-link {
14
- padding-right: $spacing-anchor_link-paddingLeft;
15
14
  padding-left: auto;
16
15
  }
17
16
  }
@@ -30,4 +30,5 @@ $radius-anchor_slide: 1px; // 滑轨圆角
30
30
 
31
31
  // Witdh
32
32
  $width-anchor-outline: 2px; // anchor轮廓宽度
33
+ $width-anchor-outlineOffset: -2px; // anchor轮廓 outline-offset 宽度
33
34
  $width-anchor-outline_border_radius: 3px; // anchor轮廓圆角
@@ -186,6 +186,10 @@
186
186
  .semi-button-block {
187
187
  width: 100%;
188
188
  }
189
+ .semi-button-group {
190
+ display: flex;
191
+ flex-wrap: wrap;
192
+ }
189
193
  .semi-button-group > .semi-button {
190
194
  margin: 0;
191
195
  padding-left: 0;
@@ -224,13 +228,46 @@
224
228
  border-top-left-radius: var(--semi-border-radius-small);
225
229
  border-bottom-left-radius: var(--semi-border-radius-small);
226
230
  }
227
- .semi-button-group > .semi-button:not(:last-child) .semi-button-content {
228
- border-right: 1px var(--semi-color-border) solid;
229
- }
230
231
  .semi-button-group > .semi-button:last-child {
231
232
  border-top-right-radius: var(--semi-border-radius-small);
232
233
  border-bottom-right-radius: var(--semi-border-radius-small);
233
234
  }
235
+ .semi-button-group-line {
236
+ display: inline-flex;
237
+ align-items: center;
238
+ background-color: var(--semi-color-border);
239
+ }
240
+ .semi-button-group-line-primary {
241
+ background-color: var(--semi-color-primary);
242
+ }
243
+ .semi-button-group-line-secondary {
244
+ background-color: var(--semi-color-secondary);
245
+ }
246
+ .semi-button-group-line-tertiary {
247
+ background-color: var(--semi-color-tertiary);
248
+ }
249
+ .semi-button-group-line-warning {
250
+ background-color: var(--semi-color-warning);
251
+ }
252
+ .semi-button-group-line-danger {
253
+ background-color: var(--semi-color-danger);
254
+ }
255
+ .semi-button-group-line-disabled {
256
+ background-color: var(--semi-color-disabled-bg);
257
+ }
258
+ .semi-button-group-line-light {
259
+ background-color: var(--semi-color-fill-0);
260
+ }
261
+ .semi-button-group-line-borderless {
262
+ background-color: transparent;
263
+ }
264
+ .semi-button-group-line::before {
265
+ display: block;
266
+ content: "";
267
+ width: 1px;
268
+ height: 20px;
269
+ background-color: var(--semi-color-border);
270
+ }
234
271
 
235
272
  .semi-rtl .semi-button,
236
273
  .semi-portal-rtl .semi-button {