@douyinfe/semi-foundation 2.23.4 → 2.23.6

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 (45) hide show
  1. package/cascader/cascader.scss +32 -8
  2. package/cascader/variables.scss +3 -3
  3. package/form/foundation.ts +1 -1
  4. package/lib/cjs/cascader/cascader.css +14 -4
  5. package/lib/cjs/cascader/cascader.scss +32 -8
  6. package/lib/cjs/cascader/variables.scss +3 -3
  7. package/lib/cjs/form/foundation.d.ts +1 -1
  8. package/lib/cjs/select/foundation.d.ts +6 -1
  9. package/lib/cjs/select/foundation.js +31 -16
  10. package/lib/cjs/switch/rtl.scss +14 -14
  11. package/lib/cjs/switch/switch.scss +14 -14
  12. package/lib/cjs/switch/variables.scss +15 -15
  13. package/lib/cjs/tagInput/tagInput.css +0 -1
  14. package/lib/cjs/tagInput/tagInput.scss +1 -1
  15. package/lib/cjs/tooltip/foundation.js +9 -6
  16. package/lib/cjs/treeSelect/treeSelect.css +13 -5
  17. package/lib/cjs/treeSelect/treeSelect.scss +31 -9
  18. package/lib/cjs/treeSelect/variables.scss +3 -3
  19. package/lib/cjs/utils/Event.d.ts +1 -1
  20. package/lib/es/cascader/cascader.css +14 -4
  21. package/lib/es/cascader/cascader.scss +32 -8
  22. package/lib/es/cascader/variables.scss +3 -3
  23. package/lib/es/form/foundation.d.ts +1 -1
  24. package/lib/es/select/foundation.d.ts +6 -1
  25. package/lib/es/select/foundation.js +31 -16
  26. package/lib/es/switch/rtl.scss +14 -14
  27. package/lib/es/switch/switch.scss +14 -14
  28. package/lib/es/switch/variables.scss +15 -15
  29. package/lib/es/tagInput/tagInput.css +0 -1
  30. package/lib/es/tagInput/tagInput.scss +1 -1
  31. package/lib/es/tooltip/foundation.js +9 -6
  32. package/lib/es/treeSelect/treeSelect.css +13 -5
  33. package/lib/es/treeSelect/treeSelect.scss +31 -9
  34. package/lib/es/treeSelect/variables.scss +3 -3
  35. package/lib/es/utils/Event.d.ts +1 -1
  36. package/package.json +2 -2
  37. package/select/foundation.ts +34 -14
  38. package/switch/rtl.scss +14 -14
  39. package/switch/switch.scss +14 -14
  40. package/switch/variables.scss +15 -15
  41. package/tagInput/tagInput.scss +1 -1
  42. package/tooltip/foundation.ts +9 -4
  43. package/treeSelect/treeSelect.scss +31 -9
  44. package/treeSelect/variables.scss +3 -3
  45. package/utils/Event.ts +1 -1
@@ -159,23 +159,47 @@ $module: #{$prefix}-cascader;
159
159
  background: transparent;
160
160
  margin-left: $spacing-cascader_selection_tagInput-marginLeft;
161
161
  }
162
-
162
+
163
163
  .#{$prefix}-tagInput {
164
+ &-wrapper {
165
+ &-default {
166
+ min-height: $height-cascader_selection_tagInput_wrapper_default;
167
+ }
168
+
169
+ &-small {
170
+ min-height: $height-cascader_selection_tagInput_wrapper_small;
171
+ }
172
+
173
+ &-large {
174
+ min-height: $height-cascader_selection_tagInput_wrapper_large;
175
+ }
176
+ }
177
+
164
178
  .#{$prefix}-input-wrapper {
165
- height: $height-cascader_selection_tagInput_input_default;
179
+ // height: $height-cascader_selection_tagInput_input_default;
166
180
 
167
181
  margin-left: $spacing-cascader_selection_input-marginLeft;
168
182
  .#{$prefix}-input {
169
183
  padding-left: 0;
170
184
  }
171
- }
172
185
 
173
- .#{$prefix}-input-wrapper-small {
174
- height: $height-cascader_selection_tagInput_input_small;
175
- }
176
- .#{$prefix}-input-wrapper-large {
177
- height: $height-cascader_selection_tagInput_input_large;
186
+ &-default {
187
+ margin-top: $spacing-cascader_selection_tag-marginY;
188
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
189
+ }
190
+
191
+ &-large {
192
+ margin-top: $spacing-cascader_selection_tag-marginY;
193
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
194
+ }
178
195
  }
196
+
197
+ // .#{$prefix}-input-wrapper-small {
198
+ // height: $height-cascader_selection_tagInput_input_small;
199
+ // }
200
+ // .#{$prefix}-input-wrapper-large {
201
+ // height: $height-cascader_selection_tagInput_input_large;
202
+ // }
179
203
  }
180
204
 
181
205
  &-text {
@@ -93,9 +93,9 @@ $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
93
93
  $width-cascader-icon: 16px; // 级联选择图标尺寸
94
94
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
95
95
  $height-cascader_option_list: 180px; // 级联选择菜单高度
96
- $height-cascader_selection_tagInput_input_small: 22px;
97
- $height-cascader_selection_tagInput_input_default: 30px;
98
- $height-cascader_selection_tagInput_input_large: 38px;
96
+ $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
97
+ $height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
98
+ $height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
99
99
  $height-cascader_selection_wrapper: 30px;
100
100
 
101
101
  $spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
@@ -8,7 +8,7 @@ import scrollIntoView, { Options as scrollIntoViewOptions } from 'scroll-into-vi
8
8
 
9
9
  import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
10
10
 
11
- export { BaseFormAdapter };
11
+ export type { BaseFormAdapter };
12
12
 
13
13
  export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
14
14
 
@@ -136,18 +136,28 @@
136
136
  background: transparent;
137
137
  margin-left: -4px;
138
138
  }
139
+ .semi-cascader-selection .semi-tagInput-wrapper-default {
140
+ min-height: 30px;
141
+ }
142
+ .semi-cascader-selection .semi-tagInput-wrapper-small {
143
+ min-height: 22px;
144
+ }
145
+ .semi-cascader-selection .semi-tagInput-wrapper-large {
146
+ min-height: 38px;
147
+ }
139
148
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper {
140
- height: 30px;
141
149
  margin-left: 4px;
142
150
  }
143
151
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper .semi-input {
144
152
  padding-left: 0;
145
153
  }
146
- .semi-cascader-selection .semi-tagInput .semi-input-wrapper-small {
147
- height: 22px;
154
+ .semi-cascader-selection .semi-tagInput .semi-input-wrapper-default {
155
+ margin-top: 1px;
156
+ margin-bottom: 1px;
148
157
  }
149
158
  .semi-cascader-selection .semi-tagInput .semi-input-wrapper-large {
150
- height: 38px;
159
+ margin-top: 1px;
160
+ margin-bottom: 1px;
151
161
  }
152
162
  .semi-cascader-selection-text-inactive {
153
163
  color: var(--semi-color-text-2);
@@ -159,23 +159,47 @@ $module: #{$prefix}-cascader;
159
159
  background: transparent;
160
160
  margin-left: $spacing-cascader_selection_tagInput-marginLeft;
161
161
  }
162
-
162
+
163
163
  .#{$prefix}-tagInput {
164
+ &-wrapper {
165
+ &-default {
166
+ min-height: $height-cascader_selection_tagInput_wrapper_default;
167
+ }
168
+
169
+ &-small {
170
+ min-height: $height-cascader_selection_tagInput_wrapper_small;
171
+ }
172
+
173
+ &-large {
174
+ min-height: $height-cascader_selection_tagInput_wrapper_large;
175
+ }
176
+ }
177
+
164
178
  .#{$prefix}-input-wrapper {
165
- height: $height-cascader_selection_tagInput_input_default;
179
+ // height: $height-cascader_selection_tagInput_input_default;
166
180
 
167
181
  margin-left: $spacing-cascader_selection_input-marginLeft;
168
182
  .#{$prefix}-input {
169
183
  padding-left: 0;
170
184
  }
171
- }
172
185
 
173
- .#{$prefix}-input-wrapper-small {
174
- height: $height-cascader_selection_tagInput_input_small;
175
- }
176
- .#{$prefix}-input-wrapper-large {
177
- height: $height-cascader_selection_tagInput_input_large;
186
+ &-default {
187
+ margin-top: $spacing-cascader_selection_tag-marginY;
188
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
189
+ }
190
+
191
+ &-large {
192
+ margin-top: $spacing-cascader_selection_tag-marginY;
193
+ margin-bottom: $spacing-cascader_selection_tag-marginY;
194
+ }
178
195
  }
196
+
197
+ // .#{$prefix}-input-wrapper-small {
198
+ // height: $height-cascader_selection_tagInput_input_small;
199
+ // }
200
+ // .#{$prefix}-input-wrapper-large {
201
+ // height: $height-cascader_selection_tagInput_input_large;
202
+ // }
179
203
  }
180
204
 
181
205
  &-text {
@@ -93,9 +93,9 @@ $width-cascader_search-border: 1px; // 级联选择触搜索描边宽度
93
93
  $width-cascader-icon: 16px; // 级联选择图标尺寸
94
94
  $width-cascader_option: 150px; // 级联选择各级菜单宽度
95
95
  $height-cascader_option_list: 180px; // 级联选择菜单高度
96
- $height-cascader_selection_tagInput_input_small: 22px;
97
- $height-cascader_selection_tagInput_input_default: 30px;
98
- $height-cascader_selection_tagInput_input_large: 38px;
96
+ $height-cascader_selection_tagInput_wrapper_small: 22px; //级联选择多选搜索时搜索框最小高度 - 小尺寸
97
+ $height-cascader_selection_tagInput_wrapper_default: 30px; //级联选择多选搜索时搜索框最小高度 - 默认尺寸
98
+ $height-cascader_selection_tagInput_wrapper_large: 38px; //级联选择多选搜索时搜索框最小高度 - 大尺寸
99
99
  $height-cascader_selection_wrapper: 30px;
100
100
 
101
101
  $spacing-cascader_text-marginX: $spacing-base-tight; // 级联选择 prefix/suffix 文字水平内间距
@@ -1,7 +1,7 @@
1
1
  import BaseFoundation from '../base/foundation';
2
2
  import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
4
- export { BaseFormAdapter };
4
+ export type { BaseFormAdapter };
5
5
  export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
6
6
  data: FormState;
7
7
  fields: Map<string, FieldStaff>;
@@ -42,6 +42,10 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
42
42
  getActiveElement(): any;
43
43
  setIsFocusInContainer(isFocusInContainer: boolean): void;
44
44
  getIsFocusInContainer(): boolean;
45
+ on(eventName: string, eventCallback: () => void): void;
46
+ off(eventName: string): void;
47
+ emit(eventName: string): void;
48
+ once(eventName: string, eventCallback: () => void): void;
45
49
  }
46
50
  declare type LabelValue = string | number;
47
51
  declare type PropValue = LabelValue | Record<string, any>;
@@ -67,7 +71,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
67
71
  handleClick(e: any): void;
68
72
  open(acInput?: string, originalOptions?: BasicOptionProps[]): void;
69
73
  toggle2SearchInput(isShow: boolean): void;
70
- close(e?: any): void;
74
+ close(e?: any, closeCb?: () => void): void;
71
75
  onSelect(option: BasicOptionProps, optionIndex: number, event: MouseEvent | KeyboardEvent): void;
72
76
  _handleSingleSelect({ value, label, ...rest }: BasicOptionProps, event: any): void;
73
77
  _handleMultipleSelect({ value, label, ...rest }: BasicOptionProps, event: MouseEvent | KeyboardEvent): void;
@@ -126,5 +130,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
126
130
  checkMultipleProps(props?: Record<string, any>): void;
127
131
  updateScrollTop(): void;
128
132
  updateIsFullTags(): void;
133
+ handlePopoverClose(): void;
129
134
  }
130
135
  export {};
@@ -430,16 +430,8 @@ class SelectFoundation extends _foundation.default {
430
430
  }
431
431
  }
432
432
 
433
- close(e) {
433
+ close(e, closeCb) {
434
434
  // to support A11y, closing the panel trigger does not necessarily lose focus
435
- const isFilterable = this._isFilterable();
436
-
437
- if (isFilterable) {
438
- // this.unBindKeyBoardEvent();
439
- this.clearInput();
440
- this.toggle2SearchInput(false);
441
- }
442
-
443
435
  this._adapter.closeMenu();
444
436
 
445
437
  this._adapter.notifyDropdownVisibleChange(false);
@@ -450,6 +442,22 @@ class SelectFoundation extends _foundation.default {
450
442
 
451
443
  this._adapter.unregisterClickOutsideHandler(); // this._adapter.updateFocusState(false);
452
444
 
445
+
446
+ const isFilterable = this._isFilterable();
447
+
448
+ if (isFilterable) {
449
+ this.toggle2SearchInput(false);
450
+ }
451
+
452
+ this._adapter.once('popoverClose', () => {
453
+ if (isFilterable) {
454
+ this.clearInput();
455
+ }
456
+
457
+ if (closeCb) {
458
+ closeCb();
459
+ }
460
+ });
453
461
  }
454
462
 
455
463
  onSelect(option, optionIndex, event) {
@@ -493,21 +501,24 @@ class SelectFoundation extends _foundation.default {
493
501
  value,
494
502
  label
495
503
  }, rest)); // If it is a controlled component, directly notify
504
+ // Make sure that the operations of updating updateOptions are done after the animation ends
505
+ // otherwise the content will be updated when the popup layer is not collapsed, and it looks like it will flash once when it is closed
496
506
 
497
507
 
498
508
  if (this._isControlledComponent()) {
499
- this._notifyChange(selections);
500
-
501
- this.close(event);
509
+ this.close(event, () => {
510
+ this._notifyChange(selections);
511
+ });
502
512
  } else {
503
513
  this._adapter.updateSelection(selections); // notify user
504
514
 
505
515
 
506
- this._notifyChange(selections); // Update the selected item in the drop-down box
507
-
516
+ this._notifyChange(selections);
508
517
 
509
- this.close(event);
510
- this.updateOptionsActiveStatus(selections);
518
+ this.close(event, () => {
519
+ // Update the selected item in the drop-down box
520
+ this.updateOptionsActiveStatus(selections);
521
+ });
511
522
  }
512
523
  }
513
524
 
@@ -1398,6 +1409,10 @@ class SelectFoundation extends _foundation.default {
1398
1409
  }
1399
1410
  }
1400
1411
 
1412
+ handlePopoverClose() {
1413
+ this._adapter.emit('popoverClose');
1414
+ }
1415
+
1401
1416
  }
1402
1417
 
1403
1418
  exports.default = SelectFoundation;
@@ -7,12 +7,12 @@ $module: #{$prefix}-switch;
7
7
 
8
8
  &-checked {
9
9
  .#{$module}-knob {
10
- transform: translateX(-$motion-switch_checked-translateX);
10
+ transform: translateX(-$spacing-switch_checked-translateX);
11
11
  }
12
12
 
13
13
  &:active {
14
14
  .#{$module}-knob {
15
- transform: translateX($width-switch_knob_expand - $motion-switch_checked-translateX);
15
+ transform: translateX($width-switch_knob_expand - $spacing-switch_checked-translateX);
16
16
  }
17
17
  }
18
18
  }
@@ -34,51 +34,51 @@ $module: #{$prefix}-switch;
34
34
 
35
35
  .#{$module}-loading {
36
36
  .#{$module}-loading-spin {
37
- transform: translateX(-$motion-switch_spin_unchecked-translateX);
37
+ transform: translateX(-$spacing-switch_spin_unchecked-translateX);
38
38
  }
39
39
 
40
40
  &.#{$module}-checked {
41
41
  .#{$module}-loading-spin {
42
- transform: translateX(-$motion-switch_spin_checked-translateX);
42
+ transform: translateX(-$spacing-switch_spin_checked-translateX);
43
43
  }
44
44
  }
45
45
  }
46
46
 
47
47
  .#{$module}-loading.#{$module}-small {
48
48
  .#{$module}-loading-spin {
49
- transform: translateX(-$motion-switch_spin_unchecked_small-translateX);
49
+ transform: translateX(-$spacing-switch_spin_unchecked_small-translateX);
50
50
  }
51
51
  &.#{$module}-checked{
52
52
  .#{$module}-loading-spin {
53
- transform: translateX(-$motion-switch_spin_checked_small-translateX);
53
+ transform: translateX(-$spacing-switch_spin_checked_small-translateX);
54
54
  }
55
55
  }
56
56
  }
57
57
 
58
58
  .#{$module}-loading.#{$module}-large {
59
59
  .#{$module}-loading-spin {
60
- transform: translateX(-$motion-switch_spin_unchecked_large-translateX);
60
+ transform: translateX(-$spacing-switch_spin_unchecked_large-translateX);
61
61
  }
62
62
 
63
63
  &.#{$module}-checked {
64
64
  .#{$module}-loading-spin {
65
- transform: translateX(-$motion-switch_spin_checked_large-translateX);
65
+ transform: translateX(-$spacing-switch_spin_checked_large-translateX);
66
66
  }
67
67
  }
68
68
  }
69
69
 
70
70
  .#{$module}-large {
71
71
  .#{$module}-knob {
72
- transform: translateX(-$motion-switch_unchecked_large-translateX);
72
+ transform: translateX(-$spacing-switch_unchecked_large-translateX);
73
73
  }
74
74
  &.#{$module}-checked {
75
75
  .#{$module}-knob {
76
- transform: translateX(-$motion-switch_checked_large-translateX);
76
+ transform: translateX(-$spacing-switch_checked_large-translateX);
77
77
  }
78
78
 
79
79
  &:active {
80
80
  .#{$module}-knob {
81
- transform: translateX($motion-switch_expand_large-translateX - $motion-switch_checked_large-translateX);
81
+ transform: translateX($spacing-switch_expand_large-translateX - $spacing-switch_checked_large-translateX);
82
82
  }
83
83
  }
84
84
  }
@@ -86,16 +86,16 @@ $module: #{$prefix}-switch;
86
86
 
87
87
  .#{$module}-small {
88
88
  .#{$module}-knob {
89
- transform: translateX(-$motion-switch_unchecked_small-translateX);
89
+ transform: translateX(-$spacing-switch_unchecked_small-translateX);
90
90
  }
91
91
  &.#{$module}-checked {
92
92
  .#{$module}-knob {
93
- transform: translateX(-$motion-switch_checked_small-translateX);
93
+ transform: translateX(-$spacing-switch_checked_small-translateX);
94
94
  }
95
95
 
96
96
  &:active {
97
97
  .#{$module}-knob {
98
- transform: translateX($motion-switch_expand_small-translateX - $motion-switch_checked_small-translateX);
98
+ transform: translateX($spacing-switch_expand_small-translateX - $spacing-switch_checked_small-translateX);
99
99
  }
100
100
  }
101
101
  }
@@ -44,12 +44,12 @@ $module: #{$prefix}-switch;
44
44
  }
45
45
 
46
46
  .#{$module}-knob {
47
- transform: translateX($motion-switch_checked-translateX);
47
+ transform: translateX($spacing-switch_checked-translateX);
48
48
  }
49
49
 
50
50
  &:active {
51
51
  .#{$module}-knob {
52
- transform: translateX($motion-switch_checked-translateX - $width-switch_knob_expand);
52
+ transform: translateX($spacing-switch_checked-translateX - $width-switch_knob_expand);
53
53
  }
54
54
  }
55
55
  }
@@ -157,7 +157,7 @@ $module: #{$prefix}-switch;
157
157
  .#{$module}-loading {
158
158
 
159
159
  .#{$module}-loading-spin {
160
- transform: translateX($motion-switch_spin_unchecked-translateX);
160
+ transform: translateX($spacing-switch_spin_unchecked-translateX);
161
161
 
162
162
  &>.#{$prefix}-spin-wrapper>svg{
163
163
  width: $width-switch_spin-default;
@@ -169,7 +169,7 @@ $module: #{$prefix}-switch;
169
169
  background-color: $color-switch_spin_checked-bg-default;
170
170
 
171
171
  .#{$module}-loading-spin {
172
- transform: translateX($motion-switch_spin_checked-translateX);
172
+ transform: translateX($spacing-switch_spin_checked-translateX);
173
173
  }
174
174
  }
175
175
  }
@@ -177,7 +177,7 @@ $module: #{$prefix}-switch;
177
177
  .#{$module}-loading.#{$module}-small {
178
178
 
179
179
  .#{$module}-loading-spin {
180
- transform: translateX($motion-switch_spin_unchecked_small-translateX);
180
+ transform: translateX($spacing-switch_spin_unchecked_small-translateX);
181
181
 
182
182
  &>.#{$prefix}-spin-wrapper>svg{
183
183
  width: $width-switch_spin-small;
@@ -187,7 +187,7 @@ $module: #{$prefix}-switch;
187
187
  &.#{$module}-checked{
188
188
 
189
189
  .#{$module}-loading-spin {
190
- transform: translateX($motion-switch_spin_checked_small-translateX);
190
+ transform: translateX($spacing-switch_spin_checked_small-translateX);
191
191
  }
192
192
  }
193
193
  }
@@ -195,7 +195,7 @@ $module: #{$prefix}-switch;
195
195
  .#{$module}-loading.#{$module}-large {
196
196
 
197
197
  .#{$module}-loading-spin {
198
- transform: translateX($motion-switch_spin_unchecked_large-translateX);
198
+ transform: translateX($spacing-switch_spin_unchecked_large-translateX);
199
199
 
200
200
  &>.#{$prefix}-spin-wrapper>svg{
201
201
  width: $width-switch_spin-large;
@@ -206,7 +206,7 @@ $module: #{$prefix}-switch;
206
206
  &.#{$module}-checked {
207
207
 
208
208
  .#{$module}-loading-spin {
209
- transform: translateX($motion-switch_spin_checked_large-translateX);
209
+ transform: translateX($spacing-switch_spin_checked_large-translateX);
210
210
  }
211
211
  }
212
212
  }
@@ -224,16 +224,16 @@ $module: #{$prefix}-switch;
224
224
  height: $width-switch_knob_large;
225
225
  top: $spacing-switch_knob_large-padding;
226
226
  border-radius: $width-switch_knob_large * 0.5;
227
- transform: translateX($motion-switch_unchecked_large-translateX);
227
+ transform: translateX($spacing-switch_unchecked_large-translateX);
228
228
  }
229
229
  &.#{$module}-checked {
230
230
  .#{$module}-knob {
231
- transform: translateX($motion-switch_checked_large-translateX);
231
+ transform: translateX($spacing-switch_checked_large-translateX);
232
232
  }
233
233
 
234
234
  &:active {
235
235
  .#{$module}-knob {
236
- transform: translateX($motion-switch_checked_large-translateX - $motion-switch_expand_large-translateX);
236
+ transform: translateX($spacing-switch_checked_large-translateX - $spacing-switch_expand_large-translateX);
237
237
  }
238
238
  }
239
239
  }
@@ -259,16 +259,16 @@ $module: #{$prefix}-switch;
259
259
  height: $width-switch_knob_large_small;
260
260
  top: $spacing-switch_knob_small-padding;
261
261
  border-radius: $width-switch_knob_large_small * 0.5;
262
- transform: translateX($motion-switch_unchecked_small-translateX);
262
+ transform: translateX($spacing-switch_unchecked_small-translateX);
263
263
  }
264
264
  &.#{$module}-checked {
265
265
  .#{$module}-knob {
266
- transform: translateX($motion-switch_checked_small-translateX);
266
+ transform: translateX($spacing-switch_checked_small-translateX);
267
267
  }
268
268
 
269
269
  &:active {
270
270
  .#{$module}-knob {
271
- transform: translateX($motion-switch_checked_small-translateX - $motion-switch_expand_small-translateX);
271
+ transform: translateX($spacing-switch_checked_small-translateX - $spacing-switch_expand_small-translateX);
272
272
  }
273
273
  }
274
274
  }
@@ -1,18 +1,18 @@
1
1
  // Other
2
2
  $spacing-switch_unchecked-translateX: 2px; // 未选中开关右侧偏移量
3
- $motion-switch_spin_unchecked-translateX: 2px; // 未选中开关加载图标右侧偏移量 - 动画用
4
- $motion-switch_checked-translateX: 18px; // 选中开关右侧偏移量
5
- $motion-switch_spin_checked-translateX: 16px; // 选中开关加载图标右侧偏移量
6
- $motion-switch_expand_large-translateX: 10px;
7
- $motion-switch_unchecked_large-translateX: 3px;
8
- $motion-switch_spin_unchecked_large-translateX: 2px;
9
- $motion-switch_checked_large-translateX: 26px; // 大尺寸选中开关右侧偏移量
10
- $motion-switch_spin_checked_large-translateX: 22px; // 大尺寸选中开关加载图标右侧偏移量
11
- $motion-switch_expand_small-translateX: 2px;
12
- $motion-switch_unchecked_small-translateX: 1px;
13
- $motion-switch_spin_unchecked_small-translateX: 2px;
14
- $motion-switch_checked_small-translateX: 11px; // 小尺寸选中开关右侧偏移量
15
- $motion-switch_spin_checked_small-translateX: 10px; // 小尺寸选中开关加载图标右侧偏移量
3
+ $spacing-switch_spin_unchecked-translateX: 2px; // 未选中开关加载图标右侧偏移量
4
+ $spacing-switch_checked-translateX: 18px; // 选中开关右侧偏移量
5
+ $spacing-switch_spin_checked-translateX: 16px; // 选中开关加载图标右侧偏移量
6
+ $spacing-switch_expand_large-translateX: 10px;
7
+ $spacing-switch_unchecked_large-translateX: 3px; // 大尺寸未选中开关右侧偏移量
8
+ $spacing-switch_spin_unchecked_large-translateX: 2px; // 大尺寸未选中开关加载图标右侧偏移量
9
+ $spacing-switch_checked_large-translateX: 26px; // 大尺寸选中开关右侧偏移量
10
+ $spacing-switch_spin_checked_large-translateX: 22px; // 大尺寸选中开关加载图标右侧偏移量
11
+ $spacing-switch_expand_small-translateX: 2px;
12
+ $spacing-switch_unchecked_small-translateX: 1px; // 小尺寸未选中开关右侧偏移量
13
+ $spacing-switch_spin_unchecked_small-translateX: 2px; // 小尺寸未选中开关加载图标右侧偏移量
14
+ $spacing-switch_checked_small-translateX: 11px; // 小尺寸选中开关右侧偏移量
15
+ $spacing-switch_spin_checked_small-translateX: 10px; // 小尺寸选中开关加载图标右侧偏移量
16
16
  $motion-switch-transitionDuration: 200ms; // 开关动画时长
17
17
 
18
18
  // Color
@@ -48,11 +48,11 @@ $width-switch_knob_active: $width-switch_knob_default + $width-switch_knob_expan
48
48
  $height-switch_large: 32px; // 大尺寸开关高度
49
49
  $width-switch_large: 54px; // 大尺寸开关宽度
50
50
  $width-switch_knob_large: 24px; // 大尺寸开关按钮宽度
51
- $width-switch_knob_large_active: $width-switch_knob_large + $motion-switch_expand_large-translateX; // 大尺寸开关按钮按下态宽度
51
+ $width-switch_knob_large_active: $width-switch_knob_large + $spacing-switch_expand_large-translateX; // 大尺寸开关按钮按下态宽度
52
52
  $height-switch_small: 16px; // 小尺寸开关高度
53
53
  $width-switch_small: 26px; // 小尺寸开关宽度
54
54
  $width-switch_knob_large_small: 12px; // 小尺寸开关按钮宽度
55
- $width-switch_knob_small_active: $width-switch_knob_large_small + $motion-switch_expand_small-translateX; // 小尺寸开关按钮按下态宽度
55
+ $width-switch_knob_small_active: $width-switch_knob_large_small + $spacing-switch_expand_small-translateX; // 小尺寸开关按钮按下态宽度
56
56
  $width-switch_knob_disabled-border: 1px; // 小尺寸开关按钮宽度
57
57
  $width-switch_checked_unchecked_text: 26px; // 开关按钮文字宽度
58
58
  $width-switch_spin-small: 10px; // 小尺寸开关加载 spin 宽度
@@ -134,7 +134,6 @@
134
134
  .semi-tagInput-wrapper .semi-tagInput-wrapper-input {
135
135
  flex-grow: 1;
136
136
  width: min-content;
137
- min-width: 38px;
138
137
  border: none;
139
138
  outline: none;
140
139
  background-color: transparent;
@@ -169,7 +169,7 @@ $module: #{$prefix}-tagInput;
169
169
  & &-input {
170
170
  flex-grow: 1;
171
171
  width: min-content;
172
- min-width: 38px;
172
+ // min-width: 38px;
173
173
  border: none;
174
174
  outline: none;
175
175
  background-color: transparent;
@@ -1142,23 +1142,26 @@ class Tooltip extends _foundation.default {
1142
1142
 
1143
1143
 
1144
1144
  if (this.isTB(position)) {
1145
- isHeightOverFlow = isViewYOverFlow && isContainerYOverFlow;
1145
+ isHeightOverFlow = isViewYOverFlow && isContainerYOverFlow; // Related PR: https://github.com/DouyinFE/semi-design/pull/1297
1146
+ // If clientRight or restClientRight less than 0, means that the left and right parts of the trigger are blocked
1147
+ // Then the display of the wrapper will also be affected, make width overflow to offset the wrapper
1146
1148
 
1147
1149
  if (position === 'top' || position === 'bottom') {
1148
- isWidthOverFlow = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf;
1150
+ isWidthOverFlow = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf || clientRight < 0 || restClientRight < 0;
1149
1151
  } else {
1150
- isWidthOverFlow = isViewXOverFlowSide && isContainerXOverFlowSide;
1152
+ isWidthOverFlow = isViewXOverFlowSide && isContainerXOverFlowSide || clientRight < 0 || restClientRight < 0;
1151
1153
  }
1152
1154
  } // 左右方向 left and right
1153
1155
 
1154
1156
 
1155
1157
  if (this.isLR(position)) {
1156
- isWidthOverFlow = isViewXOverFlow && isContainerXOverFlow;
1158
+ isWidthOverFlow = isViewXOverFlow && isContainerXOverFlow; // If clientTop or restClientTop less than 0, means that the top and bottom parts of the trigger are blocked
1159
+ // Then the display of the wrapper will also be affected, make height overflow to offset the wrapper
1157
1160
 
1158
1161
  if (position === 'left' || position === 'right') {
1159
- isHeightOverFlow = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf;
1162
+ isHeightOverFlow = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf || clientTop < 0 || restClientTop < 0;
1160
1163
  } else {
1161
- isHeightOverFlow = isViewYOverFlowSide && isContainerYOverFlowSide;
1164
+ isHeightOverFlow = isViewYOverFlowSide && isContainerYOverFlowSide || clientTop < 0 || restClientTop < 0;
1162
1165
  }
1163
1166
  }
1164
1167
  }
@@ -144,17 +144,25 @@
144
144
  padding-left: 4px;
145
145
  padding-right: 4px;
146
146
  }
147
- .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper .semi-input-wrapper {
148
- height: 30px;
147
+ .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper-default {
148
+ min-height: 30px;
149
+ }
150
+ .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper-small {
151
+ min-height: 22px;
152
+ }
153
+ .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper-large {
154
+ min-height: 38px;
149
155
  }
150
156
  .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper .semi-input-wrapper .semi-input {
151
157
  padding-left: 0;
152
158
  }
153
- .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper .semi-input-wrapper-small {
154
- height: 22px;
159
+ .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper .semi-input-wrapper-default {
160
+ margin-top: 1px;
161
+ margin-bottom: 1px;
155
162
  }
156
163
  .semi-tree-select-selection .semi-tagInput .semi-tagInput-wrapper .semi-input-wrapper-large {
157
- height: 38px;
164
+ margin-top: 1px;
165
+ margin-bottom: 1px;
158
166
  }
159
167
  .semi-tree-select-multiple-tagInput-notEmpty .semi-tagInput {
160
168
  margin-left: -4px;