@douyinfe/semi-foundation 2.20.7 → 2.20.9-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 (39) hide show
  1. package/autoComplete/foundation.ts +2 -0
  2. package/datePicker/foundation.ts +6 -1
  3. package/lib/cjs/autoComplete/foundation.d.ts +1 -0
  4. package/lib/cjs/autoComplete/foundation.js +2 -0
  5. package/lib/cjs/datePicker/foundation.d.ts +4 -0
  6. package/lib/cjs/datePicker/foundation.js +5 -1
  7. package/lib/cjs/modal/modalContentFoundation.d.ts +1 -1
  8. package/lib/cjs/modal/modalContentFoundation.js +12 -12
  9. package/lib/cjs/select/constants.js +1 -1
  10. package/lib/cjs/select/option.scss +6 -6
  11. package/lib/cjs/select/select.css +7 -7
  12. package/lib/cjs/select/select.scss +9 -4
  13. package/lib/cjs/select/variables.scss +9 -4
  14. package/lib/cjs/table/table.css +7 -0
  15. package/lib/cjs/table/table.scss +9 -0
  16. package/lib/cjs/tree/treeUtil.d.ts +1 -1
  17. package/lib/cjs/upload/constants.d.ts +1 -1
  18. package/lib/es/autoComplete/foundation.d.ts +1 -0
  19. package/lib/es/autoComplete/foundation.js +2 -0
  20. package/lib/es/datePicker/foundation.d.ts +4 -0
  21. package/lib/es/datePicker/foundation.js +5 -1
  22. package/lib/es/modal/modalContentFoundation.d.ts +1 -1
  23. package/lib/es/modal/modalContentFoundation.js +12 -12
  24. package/lib/es/select/constants.js +1 -1
  25. package/lib/es/select/option.scss +6 -6
  26. package/lib/es/select/select.css +7 -7
  27. package/lib/es/select/select.scss +9 -4
  28. package/lib/es/select/variables.scss +9 -4
  29. package/lib/es/table/table.css +7 -0
  30. package/lib/es/table/table.scss +9 -0
  31. package/lib/es/tree/treeUtil.d.ts +1 -1
  32. package/lib/es/upload/constants.d.ts +1 -1
  33. package/modal/modalContentFoundation.ts +1 -1
  34. package/package.json +2 -2
  35. package/select/constants.ts +1 -1
  36. package/select/option.scss +6 -6
  37. package/select/select.scss +9 -4
  38. package/select/variables.scss +9 -4
  39. package/table/table.scss +9 -0
@@ -8,6 +8,7 @@ interface KeyboardAdapter<P = Record<string, any>, S = Record<string, any>> exte
8
8
  registerKeyDown: (callback: (event: any) => void) => void;
9
9
  unregisterKeyDown: (callback: (event: any) => void) => void;
10
10
  updateFocusIndex: (focusIndex: number) => void;
11
+ notifyKeyDown: (e: any) => void;
11
12
  }
12
13
 
13
14
  export interface DataItem {
@@ -336,6 +337,7 @@ class AutoCompleteFoundation<P = Record<string, any>, S = Record<string, any>> e
336
337
  default:
337
338
  break;
338
339
  }
340
+ this._adapter.notifyKeyDown(event);
339
341
  }
340
342
 
341
343
  _getEnableFocusIndex(offset: number) {
@@ -41,6 +41,10 @@ export type DayStatusType = {
41
41
  export type DisabledDateOptions = {
42
42
  rangeStart?: string;
43
43
  rangeEnd?: string;
44
+ /**
45
+ * current select of range type
46
+ */
47
+ rangeInputFocus?: 'rangeStart' | 'rangeEnd' | false;
44
48
  };
45
49
  export type PresetType = {
46
50
  start?: string | Date | number;
@@ -1187,7 +1191,8 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
1187
1191
  */
1188
1192
  _someDateDisabled(value: Date[]) {
1189
1193
  const stateValue = this.getState('value');
1190
- const disabledOptions = { rangeStart: '', rangeEnd: '' };
1194
+ const { rangeInputFocus } = this.getStates();
1195
+ const disabledOptions = { rangeStart: '', rangeEnd: '', rangeInputFocus };
1191
1196
 
1192
1197
  // DisabledDate needs to pass the second parameter
1193
1198
  if (this._isRangeType() && Array.isArray(stateValue)) {
@@ -3,6 +3,7 @@ interface KeyboardAdapter<P = Record<string, any>, S = Record<string, any>> exte
3
3
  registerKeyDown: (callback: (event: any) => void) => void;
4
4
  unregisterKeyDown: (callback: (event: any) => void) => void;
5
5
  updateFocusIndex: (focusIndex: number) => void;
6
+ notifyKeyDown: (e: any) => void;
6
7
  }
7
8
  export interface DataItem {
8
9
  [x: string]: any;
@@ -395,6 +395,8 @@ class AutoCompleteFoundation extends _foundation.default {
395
395
  default:
396
396
  break;
397
397
  }
398
+
399
+ this._adapter.notifyKeyDown(event);
398
400
  }
399
401
 
400
402
  _getEnableFocusIndex(offset) {
@@ -24,6 +24,10 @@ export declare type DayStatusType = {
24
24
  export declare type DisabledDateOptions = {
25
25
  rangeStart?: string;
26
26
  rangeEnd?: string;
27
+ /**
28
+ * current select of range type
29
+ */
30
+ rangeInputFocus?: 'rangeStart' | 'rangeEnd' | false;
27
31
  };
28
32
  export declare type PresetType = {
29
33
  start?: string | Date | number;
@@ -1279,9 +1279,13 @@ class DatePickerFoundation extends _foundation.default {
1279
1279
 
1280
1280
  _someDateDisabled(value) {
1281
1281
  const stateValue = this.getState('value');
1282
+ const {
1283
+ rangeInputFocus
1284
+ } = this.getStates();
1282
1285
  const disabledOptions = {
1283
1286
  rangeStart: '',
1284
- rangeEnd: ''
1287
+ rangeEnd: '',
1288
+ rangeInputFocus
1285
1289
  }; // DisabledDate needs to pass the second parameter
1286
1290
 
1287
1291
  if (this._isRangeType() && Array.isArray(stateValue)) {
@@ -28,7 +28,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
28
28
  destroy(): void;
29
29
  handleDialogMouseDown(): void;
30
30
  handleMaskMouseUp(): void;
31
- handleKeyDown(e: any): void;
31
+ handleKeyDown: (e: any) => void;
32
32
  handleKeyDownEventListenerMount(): void;
33
33
  handleKeyDownEventListenerUnmount(): void;
34
34
  getMouseState(): void;
@@ -14,6 +14,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
14
  class ModalContentFoundation extends _foundation.default {
15
15
  constructor(adapter) {
16
16
  super(Object.assign(Object.assign({}, ModalContentFoundation.defaultAdapter), adapter));
17
+
18
+ this.handleKeyDown = e => {
19
+ const {
20
+ closeOnEsc
21
+ } = this.getProps();
22
+
23
+ if (closeOnEsc && e.keyCode === _keyCode.default.ESC) {
24
+ e.stopPropagation();
25
+ this.close(e);
26
+ return;
27
+ }
28
+ };
17
29
  }
18
30
 
19
31
  destroy() {
@@ -30,18 +42,6 @@ class ModalContentFoundation extends _foundation.default {
30
42
  this._adapter.notifyDialogMouseUp();
31
43
  }
32
44
 
33
- handleKeyDown(e) {
34
- const {
35
- closeOnEsc
36
- } = this.getProps();
37
-
38
- if (closeOnEsc && e.keyCode === _keyCode.default.ESC) {
39
- e.stopPropagation();
40
- this.close(e);
41
- return;
42
- }
43
- }
44
-
45
45
  handleKeyDownEventListenerMount() {
46
46
  this._adapter.addKeyDownEventListener();
47
47
  }
@@ -25,6 +25,6 @@ const strings = {
25
25
  };
26
26
  exports.strings = strings;
27
27
  const numbers = {
28
- LIST_HEIGHT: 300
28
+ LIST_HEIGHT: 270
29
29
  };
30
30
  exports.numbers = numbers;
@@ -85,11 +85,11 @@ $multiple: #{$module}-multiple;
85
85
  background-color: $color-select_option-bg-hover;
86
86
  }
87
87
 
88
- &:first-of-type {
89
- margin-top: $spacing-select_option_first-marginTop;
90
- }
88
+ // &:first-of-type {
89
+ // margin-top: $spacing-select_option_first-marginTop;
90
+ // }
91
91
 
92
- &:last-of-type {
93
- margin-bottom: $spacing-select_option_last-marginBottom;
94
- }
92
+ // &:last-of-type {
93
+ // margin-bottom: $spacing-select_option_last-marginBottom;
94
+ // }
95
95
  }
@@ -68,12 +68,6 @@
68
68
  .semi-select-option-focused {
69
69
  background-color: var(--semi-color-fill-0);
70
70
  }
71
- .semi-select-option:first-of-type {
72
- margin-top: 4px;
73
- }
74
- .semi-select-option:last-of-type {
75
- margin-bottom: 4px;
76
- }
77
71
 
78
72
  .semi-select {
79
73
  box-sizing: border-box;
@@ -380,10 +374,16 @@
380
374
  padding-right: 0;
381
375
  }
382
376
 
377
+ .semi-select-option-list-wrapper {
378
+ padding-top: 4px;
379
+ padding-bottom: 4px;
380
+ padding-left: 0px;
381
+ padding-right: 0px;
382
+ }
383
+
383
384
  .semi-select-option-list {
384
385
  overflow-x: hidden;
385
386
  overflow-y: auto;
386
- padding: 0px 0px 0px 0px;
387
387
  }
388
388
  .semi-select-option-list-chosen .semi-select-option-icon {
389
389
  display: flex;
@@ -22,9 +22,8 @@ $multiple: #{$module}-multiple;
22
22
  position: relative;
23
23
  outline: none;
24
24
  cursor: pointer;
25
- transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg,
26
- border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
27
- transform:scale($transform_scale-select);
25
+ transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg, border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
26
+ transform: scale($transform_scale-select);
28
27
  &:hover {
29
28
  background-color: $color-select-bg-hover;
30
29
  border: $width-select-border-hover solid $color-select-border-hover;
@@ -394,10 +393,16 @@ $multiple: #{$module}-multiple;
394
393
  }
395
394
  }
396
395
 
396
+ .#{$module}-option-list-wrapper {
397
+ padding-top: $spacing-select_option_list-paddingTop;
398
+ padding-bottom: $spacing-select_option_list-paddingBottom;
399
+ padding-left: $spacing-select_option_list-paddingLeft;
400
+ padding-right: $spacing-select_option_list-paddingRight;
401
+ }
402
+
397
403
  .#{$module}-option-list {
398
404
  overflow-x: hidden;
399
405
  overflow-y: auto;
400
- padding: $spacing-select_option_list-paddingTop $spacing-select_option_list-paddingRight $spacing-select_option_list-paddingBottom $spacing-select_option_list-paddingLeft;
401
406
  &-chosen {
402
407
  .#{$module}-option-icon {
403
408
  display: flex;
@@ -84,16 +84,21 @@ $spacing-select_option-paddingLeft: $spacing-base-tight; // 选择器菜单项
84
84
  $spacing-select_option-paddingRight: $spacing-base-tight; // 选择器菜单项右侧内边距
85
85
  $spacing-select_option-paddingTop: $spacing-tight; // 选择器菜单项顶部内边距
86
86
  $spacing-select_option-paddingBottom: $spacing-tight; // 选择器菜单项底部内边距
87
- $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
88
- $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
87
+
88
+
89
+ // $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
90
+ // $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
91
+
92
+
89
93
  $spacing-select_tag-marginTop: $spacing-super-tight - 1px; // 多项选择器标签顶部外边距
90
94
  $spacing-select_tag-marginRight: $spacing-extra-tight; // 多项选择器标签右侧外边距
91
95
  $spacing-select_tag-marginBottom: $spacing-super-tight - 1px; // 多项选择器标签底部外边距
92
96
  $spacing-select_selection-marginLeft: $spacing-base-tight; // 选择器内容区左侧外边距
93
97
  $spacing-select_insetLabel-marginRight: $spacing-base-tight; // 选择器内嵌标签右侧外边距
94
- $spacing-select_option_list-paddingTop: 0px; // 选择器内容区顶部内边距
98
+
99
+ $spacing-select_option_list-paddingTop: $spacing-extra-tight; // 选择器内容区顶部内边距
95
100
  $spacing-select_option_list-paddingRight: 0px; // 选择器内容区右侧内边距
96
- $spacing-select_option_list-paddingBottom: 0px; // 选择器内容区底部内边距
101
+ $spacing-select_option_list-paddingBottom: $spacing-extra-tight; // 选择器内容区底部内边距
97
102
  $spacing-select_option_list-paddingLeft: 0px; // 选择器内容区左侧内边距
98
103
 
99
104
  // Radius
@@ -81,6 +81,13 @@
81
81
  background-color: transparent;
82
82
  border-bottom: 2px solid var(--semi-color-border);
83
83
  }
84
+ .semi-table-header-sticky {
85
+ position: sticky;
86
+ z-index: 102;
87
+ }
88
+ .semi-table-header-sticky .semi-table-thead > .semi-table-row > .semi-table-row-head {
89
+ background-color: var(--semi-color-bg-2);
90
+ }
84
91
  .semi-table-body {
85
92
  overflow: auto;
86
93
  width: 100%;
@@ -64,6 +64,15 @@ $module: #{$prefix}-table;
64
64
  border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
65
65
  }
66
66
  scrollbar-base-color: transparent;
67
+
68
+ &-sticky {
69
+ position: sticky;
70
+ z-index: $z-table_fixed_column + 1;
71
+
72
+ .semi-table-thead > .semi-table-row > .semi-table-row-head {
73
+ background-color: $color-table-bg-default;
74
+ }
75
+ }
67
76
  }
68
77
 
69
78
  &-body {
@@ -74,6 +74,6 @@ export declare function getValueOrKey(data: any): any;
74
74
  export declare function normalizeValue(value: any, withObject: boolean): any;
75
75
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
76
76
  export declare function calcDisabledKeys(keyEntities: KeyEntities): Set<string>;
77
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
77
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
78
78
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
79
79
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -3,6 +3,7 @@ interface KeyboardAdapter<P = Record<string, any>, S = Record<string, any>> exte
3
3
  registerKeyDown: (callback: (event: any) => void) => void;
4
4
  unregisterKeyDown: (callback: (event: any) => void) => void;
5
5
  updateFocusIndex: (focusIndex: number) => void;
6
+ notifyKeyDown: (e: any) => void;
6
7
  }
7
8
  export interface DataItem {
8
9
  [x: string]: any;
@@ -381,6 +381,8 @@ class AutoCompleteFoundation extends BaseFoundation {
381
381
  default:
382
382
  break;
383
383
  }
384
+
385
+ this._adapter.notifyKeyDown(event);
384
386
  }
385
387
 
386
388
  _getEnableFocusIndex(offset) {
@@ -24,6 +24,10 @@ export declare type DayStatusType = {
24
24
  export declare type DisabledDateOptions = {
25
25
  rangeStart?: string;
26
26
  rangeEnd?: string;
27
+ /**
28
+ * current select of range type
29
+ */
30
+ rangeInputFocus?: 'rangeStart' | 'rangeEnd' | false;
27
31
  };
28
32
  export declare type PresetType = {
29
33
  start?: string | Date | number;
@@ -1258,9 +1258,13 @@ export default class DatePickerFoundation extends BaseFoundation {
1258
1258
 
1259
1259
  _someDateDisabled(value) {
1260
1260
  const stateValue = this.getState('value');
1261
+ const {
1262
+ rangeInputFocus
1263
+ } = this.getStates();
1261
1264
  const disabledOptions = {
1262
1265
  rangeStart: '',
1263
- rangeEnd: ''
1266
+ rangeEnd: '',
1267
+ rangeInputFocus
1264
1268
  }; // DisabledDate needs to pass the second parameter
1265
1269
 
1266
1270
  if (this._isRangeType() && Array.isArray(stateValue)) {
@@ -28,7 +28,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
28
28
  destroy(): void;
29
29
  handleDialogMouseDown(): void;
30
30
  handleMaskMouseUp(): void;
31
- handleKeyDown(e: any): void;
31
+ handleKeyDown: (e: any) => void;
32
32
  handleKeyDownEventListenerMount(): void;
33
33
  handleKeyDownEventListenerUnmount(): void;
34
34
  getMouseState(): void;
@@ -3,6 +3,18 @@ import KeyCode from '../utils/keyCode';
3
3
  export default class ModalContentFoundation extends BaseFoundation {
4
4
  constructor(adapter) {
5
5
  super(Object.assign(Object.assign({}, ModalContentFoundation.defaultAdapter), adapter));
6
+
7
+ this.handleKeyDown = e => {
8
+ const {
9
+ closeOnEsc
10
+ } = this.getProps();
11
+
12
+ if (closeOnEsc && e.keyCode === KeyCode.ESC) {
13
+ e.stopPropagation();
14
+ this.close(e);
15
+ return;
16
+ }
17
+ };
6
18
  }
7
19
 
8
20
  destroy() {
@@ -19,18 +31,6 @@ export default class ModalContentFoundation extends BaseFoundation {
19
31
  this._adapter.notifyDialogMouseUp();
20
32
  }
21
33
 
22
- handleKeyDown(e) {
23
- const {
24
- closeOnEsc
25
- } = this.getProps();
26
-
27
- if (closeOnEsc && e.keyCode === KeyCode.ESC) {
28
- e.stopPropagation();
29
- this.close(e);
30
- return;
31
- }
32
- }
33
-
34
34
  handleKeyDownEventListenerMount() {
35
35
  this._adapter.addKeyDownEventListener();
36
36
  }
@@ -14,6 +14,6 @@ const strings = {
14
14
  STATUS: VALIDATE_STATUS
15
15
  };
16
16
  const numbers = {
17
- LIST_HEIGHT: 300
17
+ LIST_HEIGHT: 270
18
18
  };
19
19
  export { cssClasses, strings, numbers };
@@ -85,11 +85,11 @@ $multiple: #{$module}-multiple;
85
85
  background-color: $color-select_option-bg-hover;
86
86
  }
87
87
 
88
- &:first-of-type {
89
- margin-top: $spacing-select_option_first-marginTop;
90
- }
88
+ // &:first-of-type {
89
+ // margin-top: $spacing-select_option_first-marginTop;
90
+ // }
91
91
 
92
- &:last-of-type {
93
- margin-bottom: $spacing-select_option_last-marginBottom;
94
- }
92
+ // &:last-of-type {
93
+ // margin-bottom: $spacing-select_option_last-marginBottom;
94
+ // }
95
95
  }
@@ -68,12 +68,6 @@
68
68
  .semi-select-option-focused {
69
69
  background-color: var(--semi-color-fill-0);
70
70
  }
71
- .semi-select-option:first-of-type {
72
- margin-top: 4px;
73
- }
74
- .semi-select-option:last-of-type {
75
- margin-bottom: 4px;
76
- }
77
71
 
78
72
  .semi-select {
79
73
  box-sizing: border-box;
@@ -380,10 +374,16 @@
380
374
  padding-right: 0;
381
375
  }
382
376
 
377
+ .semi-select-option-list-wrapper {
378
+ padding-top: 4px;
379
+ padding-bottom: 4px;
380
+ padding-left: 0px;
381
+ padding-right: 0px;
382
+ }
383
+
383
384
  .semi-select-option-list {
384
385
  overflow-x: hidden;
385
386
  overflow-y: auto;
386
- padding: 0px 0px 0px 0px;
387
387
  }
388
388
  .semi-select-option-list-chosen .semi-select-option-icon {
389
389
  display: flex;
@@ -22,9 +22,8 @@ $multiple: #{$module}-multiple;
22
22
  position: relative;
23
23
  outline: none;
24
24
  cursor: pointer;
25
- transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg,
26
- border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
27
- transform:scale($transform_scale-select);
25
+ transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg, border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
26
+ transform: scale($transform_scale-select);
28
27
  &:hover {
29
28
  background-color: $color-select-bg-hover;
30
29
  border: $width-select-border-hover solid $color-select-border-hover;
@@ -394,10 +393,16 @@ $multiple: #{$module}-multiple;
394
393
  }
395
394
  }
396
395
 
396
+ .#{$module}-option-list-wrapper {
397
+ padding-top: $spacing-select_option_list-paddingTop;
398
+ padding-bottom: $spacing-select_option_list-paddingBottom;
399
+ padding-left: $spacing-select_option_list-paddingLeft;
400
+ padding-right: $spacing-select_option_list-paddingRight;
401
+ }
402
+
397
403
  .#{$module}-option-list {
398
404
  overflow-x: hidden;
399
405
  overflow-y: auto;
400
- padding: $spacing-select_option_list-paddingTop $spacing-select_option_list-paddingRight $spacing-select_option_list-paddingBottom $spacing-select_option_list-paddingLeft;
401
406
  &-chosen {
402
407
  .#{$module}-option-icon {
403
408
  display: flex;
@@ -84,16 +84,21 @@ $spacing-select_option-paddingLeft: $spacing-base-tight; // 选择器菜单项
84
84
  $spacing-select_option-paddingRight: $spacing-base-tight; // 选择器菜单项右侧内边距
85
85
  $spacing-select_option-paddingTop: $spacing-tight; // 选择器菜单项顶部内边距
86
86
  $spacing-select_option-paddingBottom: $spacing-tight; // 选择器菜单项底部内边距
87
- $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
88
- $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
87
+
88
+
89
+ // $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
90
+ // $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
91
+
92
+
89
93
  $spacing-select_tag-marginTop: $spacing-super-tight - 1px; // 多项选择器标签顶部外边距
90
94
  $spacing-select_tag-marginRight: $spacing-extra-tight; // 多项选择器标签右侧外边距
91
95
  $spacing-select_tag-marginBottom: $spacing-super-tight - 1px; // 多项选择器标签底部外边距
92
96
  $spacing-select_selection-marginLeft: $spacing-base-tight; // 选择器内容区左侧外边距
93
97
  $spacing-select_insetLabel-marginRight: $spacing-base-tight; // 选择器内嵌标签右侧外边距
94
- $spacing-select_option_list-paddingTop: 0px; // 选择器内容区顶部内边距
98
+
99
+ $spacing-select_option_list-paddingTop: $spacing-extra-tight; // 选择器内容区顶部内边距
95
100
  $spacing-select_option_list-paddingRight: 0px; // 选择器内容区右侧内边距
96
- $spacing-select_option_list-paddingBottom: 0px; // 选择器内容区底部内边距
101
+ $spacing-select_option_list-paddingBottom: $spacing-extra-tight; // 选择器内容区底部内边距
97
102
  $spacing-select_option_list-paddingLeft: 0px; // 选择器内容区左侧内边距
98
103
 
99
104
  // Radius
@@ -81,6 +81,13 @@
81
81
  background-color: transparent;
82
82
  border-bottom: 2px solid var(--semi-color-border);
83
83
  }
84
+ .semi-table-header-sticky {
85
+ position: sticky;
86
+ z-index: 102;
87
+ }
88
+ .semi-table-header-sticky .semi-table-thead > .semi-table-row > .semi-table-row-head {
89
+ background-color: var(--semi-color-bg-2);
90
+ }
84
91
  .semi-table-body {
85
92
  overflow: auto;
86
93
  width: 100%;
@@ -64,6 +64,15 @@ $module: #{$prefix}-table;
64
64
  border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
65
65
  }
66
66
  scrollbar-base-color: transparent;
67
+
68
+ &-sticky {
69
+ position: sticky;
70
+ z-index: $z-table_fixed_column + 1;
71
+
72
+ .semi-table-thead > .semi-table-row > .semi-table-row-head {
73
+ background-color: $color-table-bg-default;
74
+ }
75
+ }
67
76
  }
68
77
 
69
78
  &-body {
@@ -74,6 +74,6 @@ export declare function getValueOrKey(data: any): any;
74
74
  export declare function normalizeValue(value: any, withObject: boolean): any;
75
75
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
76
76
  export declare function calcDisabledKeys(keyEntities: KeyEntities): Set<string>;
77
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
77
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
78
78
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
79
79
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -48,7 +48,7 @@ export default class ModalContentFoundation extends BaseFoundation<ModalContentA
48
48
  this._adapter.notifyDialogMouseUp();
49
49
  }
50
50
 
51
- handleKeyDown(e: any) {
51
+ handleKeyDown = (e: any) => {
52
52
  const { closeOnEsc } = this.getProps();
53
53
  if (closeOnEsc && e.keyCode === KeyCode.ESC) {
54
54
  e.stopPropagation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.20.7",
3
+ "version": "2.20.9-alpha.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
@@ -23,7 +23,7 @@
23
23
  "*.scss",
24
24
  "*.css"
25
25
  ],
26
- "gitHead": "c0d0df27f122e6e57483172169baf1c23745a29a",
26
+ "gitHead": "023bcb9e58c4d547ac53ca44c6d093eeb9ada6e2",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -16,6 +16,6 @@ const strings = {
16
16
  STATUS: VALIDATE_STATUS,
17
17
  } as const;
18
18
 
19
- const numbers = { LIST_HEIGHT: 300 };
19
+ const numbers = { LIST_HEIGHT: 270 };
20
20
 
21
21
  export { cssClasses, strings, numbers };
@@ -85,11 +85,11 @@ $multiple: #{$module}-multiple;
85
85
  background-color: $color-select_option-bg-hover;
86
86
  }
87
87
 
88
- &:first-of-type {
89
- margin-top: $spacing-select_option_first-marginTop;
90
- }
88
+ // &:first-of-type {
89
+ // margin-top: $spacing-select_option_first-marginTop;
90
+ // }
91
91
 
92
- &:last-of-type {
93
- margin-bottom: $spacing-select_option_last-marginBottom;
94
- }
92
+ // &:last-of-type {
93
+ // margin-bottom: $spacing-select_option_last-marginBottom;
94
+ // }
95
95
  }
@@ -22,9 +22,8 @@ $multiple: #{$module}-multiple;
22
22
  position: relative;
23
23
  outline: none;
24
24
  cursor: pointer;
25
- transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg,
26
- border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
27
- transform:scale($transform_scale-select);
25
+ transition: background-color $transition_duration-select-bg $transition_function-select-bg $transition_delay-select-bg, border $transition_duration-select-border $transition_function-select-border $transition_delay-select-border;
26
+ transform: scale($transform_scale-select);
28
27
  &:hover {
29
28
  background-color: $color-select-bg-hover;
30
29
  border: $width-select-border-hover solid $color-select-border-hover;
@@ -394,10 +393,16 @@ $multiple: #{$module}-multiple;
394
393
  }
395
394
  }
396
395
 
396
+ .#{$module}-option-list-wrapper {
397
+ padding-top: $spacing-select_option_list-paddingTop;
398
+ padding-bottom: $spacing-select_option_list-paddingBottom;
399
+ padding-left: $spacing-select_option_list-paddingLeft;
400
+ padding-right: $spacing-select_option_list-paddingRight;
401
+ }
402
+
397
403
  .#{$module}-option-list {
398
404
  overflow-x: hidden;
399
405
  overflow-y: auto;
400
- padding: $spacing-select_option_list-paddingTop $spacing-select_option_list-paddingRight $spacing-select_option_list-paddingBottom $spacing-select_option_list-paddingLeft;
401
406
  &-chosen {
402
407
  .#{$module}-option-icon {
403
408
  display: flex;
@@ -84,16 +84,21 @@ $spacing-select_option-paddingLeft: $spacing-base-tight; // 选择器菜单项
84
84
  $spacing-select_option-paddingRight: $spacing-base-tight; // 选择器菜单项右侧内边距
85
85
  $spacing-select_option-paddingTop: $spacing-tight; // 选择器菜单项顶部内边距
86
86
  $spacing-select_option-paddingBottom: $spacing-tight; // 选择器菜单项底部内边距
87
- $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
88
- $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
87
+
88
+
89
+ // $spacing-select_option_first-marginTop: $spacing-extra-tight; // 选择器第一个菜单项顶部外边距
90
+ // $spacing-select_option_last-marginBottom: $spacing-extra-tight; // 选择器最后一个菜单项顶部外边距
91
+
92
+
89
93
  $spacing-select_tag-marginTop: $spacing-super-tight - 1px; // 多项选择器标签顶部外边距
90
94
  $spacing-select_tag-marginRight: $spacing-extra-tight; // 多项选择器标签右侧外边距
91
95
  $spacing-select_tag-marginBottom: $spacing-super-tight - 1px; // 多项选择器标签底部外边距
92
96
  $spacing-select_selection-marginLeft: $spacing-base-tight; // 选择器内容区左侧外边距
93
97
  $spacing-select_insetLabel-marginRight: $spacing-base-tight; // 选择器内嵌标签右侧外边距
94
- $spacing-select_option_list-paddingTop: 0px; // 选择器内容区顶部内边距
98
+
99
+ $spacing-select_option_list-paddingTop: $spacing-extra-tight; // 选择器内容区顶部内边距
95
100
  $spacing-select_option_list-paddingRight: 0px; // 选择器内容区右侧内边距
96
- $spacing-select_option_list-paddingBottom: 0px; // 选择器内容区底部内边距
101
+ $spacing-select_option_list-paddingBottom: $spacing-extra-tight; // 选择器内容区底部内边距
97
102
  $spacing-select_option_list-paddingLeft: 0px; // 选择器内容区左侧内边距
98
103
 
99
104
  // Radius
package/table/table.scss CHANGED
@@ -64,6 +64,15 @@ $module: #{$prefix}-table;
64
64
  border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
65
65
  }
66
66
  scrollbar-base-color: transparent;
67
+
68
+ &-sticky {
69
+ position: sticky;
70
+ z-index: $z-table_fixed_column + 1;
71
+
72
+ .semi-table-thead > .semi-table-row > .semi-table-row-head {
73
+ background-color: $color-table-bg-default;
74
+ }
75
+ }
67
76
  }
68
77
 
69
78
  &-body {