@douyinfe/semi-foundation 2.22.3 → 2.23.0-beta.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 (36) hide show
  1. package/form/interface.ts +8 -4
  2. package/image/imageFoundation.ts +1 -1
  3. package/image/previewFooterFoundation.ts +2 -2
  4. package/image/previewImageFoundation.ts +0 -1
  5. package/image/previewInnerFoundation.ts +2 -2
  6. package/lib/cjs/form/interface.d.ts +8 -6
  7. package/lib/cjs/image/imageFoundation.js +1 -1
  8. package/lib/cjs/image/previewFooterFoundation.js +2 -2
  9. package/lib/cjs/image/previewInnerFoundation.d.ts +1 -1
  10. package/lib/cjs/image/previewInnerFoundation.js +1 -1
  11. package/lib/cjs/navigation/navigation.css +6 -0
  12. package/lib/cjs/navigation/navigation.scss +9 -0
  13. package/lib/cjs/table/constants.d.ts +1 -0
  14. package/lib/cjs/table/constants.js +4 -2
  15. package/lib/cjs/table/table.css +2 -1
  16. package/lib/cjs/table/table.scss +2 -1
  17. package/lib/cjs/transfer/foundation.d.ts +1 -1
  18. package/lib/cjs/transfer/foundation.js +3 -4
  19. package/lib/es/form/interface.d.ts +8 -6
  20. package/lib/es/image/imageFoundation.js +1 -1
  21. package/lib/es/image/previewFooterFoundation.js +2 -2
  22. package/lib/es/image/previewInnerFoundation.d.ts +1 -1
  23. package/lib/es/image/previewInnerFoundation.js +1 -1
  24. package/lib/es/navigation/navigation.css +6 -0
  25. package/lib/es/navigation/navigation.scss +9 -0
  26. package/lib/es/table/constants.d.ts +1 -0
  27. package/lib/es/table/constants.js +4 -2
  28. package/lib/es/table/table.css +2 -1
  29. package/lib/es/table/table.scss +2 -1
  30. package/lib/es/transfer/foundation.d.ts +1 -1
  31. package/lib/es/transfer/foundation.js +3 -4
  32. package/navigation/navigation.scss +9 -0
  33. package/package.json +2 -2
  34. package/table/constants.ts +2 -0
  35. package/table/table.scss +2 -1
  36. package/transfer/foundation.ts +3 -3
package/form/interface.ts CHANGED
@@ -9,24 +9,28 @@ export type FieldValidateTriggerType = BasicTriggerType | Array<BasicTriggerType
9
9
 
10
10
  export type CommonFieldError = boolean | string | Array<any> | undefined | unknown;
11
11
 
12
- export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
12
+ export type BasicFieldError = Array<any>;
13
+
14
+ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>, Values extends object = any> extends DefaultAdapter<P, S> {
13
15
  cloneDeep: (val: any, ...rest: any[]) => any;
14
16
  notifySubmit: (values: any) => void;
15
- notifySubmitFail: (errors: Record<string, any>, values: any) => void;
17
+ notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>) => void;
16
18
  forceUpdate: (callback?: () => void) => void;
17
19
  notifyChange: (formState: FormState) => void;
18
20
  notifyValueChange: (values: any, changedValues: any) => void;
19
21
  notifyReset: () => void;
20
- getInitValues: () => Record<string, any>;
22
+ getInitValues: () => Partial<Values>;
21
23
  getFormProps: (keys: undefined | string | Array<string>) => any;
22
24
  getAllErrorDOM: () => NodeList;
23
25
  getFieldDOM: (field: string) => Node;
24
26
  initFormId: () => void
25
27
  }
26
28
 
29
+ export type AllErrors<T> = T extends Record<string, any> ? { [K in keyof T]?: string } : Record<string, any>;
30
+
27
31
  export interface FormState<T extends Record<string, any> = any> {
28
32
  values?: T extends Record<string, any> ? T : Record<string, any>;
29
- errors?: T extends Record<string, any> ? { [K in keyof T]?: string } : Record<string, any>;
33
+ errors?: AllErrors<T>;
30
34
  touched?: T extends Record<string, any> ? { [K in keyof T]?: boolean } : Record<string, any>
31
35
  }
32
36
  export interface setValuesConfig {
@@ -50,7 +50,7 @@ export default class ImageFoundation<P = Record<string, any>, S = Record<string,
50
50
  if (isObject(preview)) {
51
51
  const { onVisibleChange } = preview as any;
52
52
  onVisibleChange && onVisibleChange(newVisible);
53
- if (!("visible" in this.getProps())) {
53
+ if (!("visible" in preview)) {
54
54
  this.setState({
55
55
  previewVisible: newVisible,
56
56
  } as any);
@@ -20,9 +20,9 @@ export default class PreviewFooterFoundation<P = Record<string, any>, S = Record
20
20
  handleValueChange = (value: number): void => {
21
21
  const { onZoomIn, onZoomOut, zoom } = this.getProps();
22
22
  if (value > zoom) {
23
- onZoomIn(value / 100);
23
+ onZoomIn(Number((value / 100).toFixed(2)));
24
24
  } else {
25
- onZoomOut(value / 100);
25
+ onZoomOut(Number((value / 100).toFixed(2)));
26
26
  }
27
27
  this._adapter.setStartMouseOffset(value);
28
28
  };
@@ -257,7 +257,6 @@ export default class PreviewImageFoundation<P = Record<string, any>, S = Record<
257
257
  }
258
258
  if (canDragVertical) {
259
259
  newY = newY > 0 ? 0 : newY < extremeTop ? extremeTop : newY;
260
-
261
260
  }
262
261
  const _offset = {
263
262
  x: newX,
@@ -4,7 +4,7 @@ import { getPreloadImagArr, downloadImage, isTargetEmit } from "./utils";
4
4
 
5
5
  export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
6
6
  getIsInGroup: () => boolean;
7
- notifyChange: (index: number) => void;
7
+ notifyChange: (index: number, direction: string) => void;
8
8
  notifyZoom: (zoom: number, increase: boolean) => void;
9
9
  notifyClose: () => void;
10
10
  notifyVisibleChange: (visible: boolean) => void;
@@ -119,7 +119,7 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
119
119
  currentIndex: newIndex,
120
120
  } as any);
121
121
  }
122
- this._adapter.notifyChange(newIndex);
122
+ this._adapter.notifyChange(newIndex, direction);
123
123
  this.setState({
124
124
  direction,
125
125
  rotation: 0,
@@ -3,25 +3,27 @@ import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  export declare type BasicTriggerType = 'blur' | 'change' | 'custom' | 'mount';
4
4
  export declare type FieldValidateTriggerType = BasicTriggerType | Array<BasicTriggerType>;
5
5
  export declare type CommonFieldError = boolean | string | Array<any> | undefined | unknown;
6
- export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
6
+ export declare type BasicFieldError = Array<any>;
7
+ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>, Values extends object = any> extends DefaultAdapter<P, S> {
7
8
  cloneDeep: (val: any, ...rest: any[]) => any;
8
9
  notifySubmit: (values: any) => void;
9
- notifySubmitFail: (errors: Record<string, any>, values: any) => void;
10
+ notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>) => void;
10
11
  forceUpdate: (callback?: () => void) => void;
11
12
  notifyChange: (formState: FormState) => void;
12
13
  notifyValueChange: (values: any, changedValues: any) => void;
13
14
  notifyReset: () => void;
14
- getInitValues: () => Record<string, any>;
15
+ getInitValues: () => Partial<Values>;
15
16
  getFormProps: (keys: undefined | string | Array<string>) => any;
16
17
  getAllErrorDOM: () => NodeList;
17
18
  getFieldDOM: (field: string) => Node;
18
19
  initFormId: () => void;
19
20
  }
21
+ export declare type AllErrors<T> = T extends Record<string, any> ? {
22
+ [K in keyof T]?: string;
23
+ } : Record<string, any>;
20
24
  export interface FormState<T extends Record<string, any> = any> {
21
25
  values?: T extends Record<string, any> ? T : Record<string, any>;
22
- errors?: T extends Record<string, any> ? {
23
- [K in keyof T]?: string;
24
- } : Record<string, any>;
26
+ errors?: AllErrors<T>;
25
27
  touched?: T extends Record<string, any> ? {
26
28
  [K in keyof T]?: boolean;
27
29
  } : Record<string, any>;
@@ -71,7 +71,7 @@ class ImageFoundation extends _foundation.default {
71
71
  } = preview;
72
72
  onVisibleChange && onVisibleChange(newVisible);
73
73
 
74
- if (!("visible" in this.getProps())) {
74
+ if (!("visible" in preview)) {
75
75
  this.setState({
76
76
  previewVisible: newVisible
77
77
  });
@@ -39,9 +39,9 @@ class PreviewFooterFoundation extends _foundation.default {
39
39
  } = this.getProps();
40
40
 
41
41
  if (value > zoom) {
42
- onZoomIn(value / 100);
42
+ onZoomIn(Number((value / 100).toFixed(2)));
43
43
  } else {
44
- onZoomOut(value / 100);
44
+ onZoomOut(Number((value / 100).toFixed(2)));
45
45
  }
46
46
 
47
47
  this._adapter.setStartMouseOffset(value);
@@ -1,7 +1,7 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../base/foundation";
2
2
  export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
3
3
  getIsInGroup: () => boolean;
4
- notifyChange: (index: number) => void;
4
+ notifyChange: (index: number, direction: string) => void;
5
5
  notifyZoom: (zoom: number, increase: boolean) => void;
6
6
  notifyClose: () => void;
7
7
  notifyVisibleChange: (visible: boolean) => void;
@@ -133,7 +133,7 @@ class PreviewInnerFoundation extends _foundation.default {
133
133
  });
134
134
  }
135
135
 
136
- this._adapter.notifyChange(newIndex);
136
+ this._adapter.notifyChange(newIndex, direction);
137
137
 
138
138
  this.setState({
139
139
  direction,
@@ -87,6 +87,12 @@
87
87
  align-items: center;
88
88
  justify-content: flex-start;
89
89
  }
90
+ .semi-navigation-item-has-link {
91
+ padding: 0;
92
+ }
93
+ .semi-navigation-item-has-link .semi-navigation-item-link {
94
+ padding: 8px 12px;
95
+ }
90
96
  .semi-navigation-item-sub {
91
97
  padding: 0;
92
98
  }
@@ -113,6 +113,15 @@ $module: #{$prefix}-navigation;
113
113
  justify-content: flex-start;
114
114
  }
115
115
 
116
+ // when item has link, add the padding to link instead of item
117
+ &-item-has-link {
118
+ padding: 0;
119
+
120
+ .#{$module}-item-link {
121
+ padding: $spacing-navigation_item-paddingY $spacing-navigation_item-paddingX;
122
+ }
123
+ }
124
+
116
125
  &-item-sub {
117
126
  padding: $spacing-navigation_item_sub-padding;
118
127
  }
@@ -73,5 +73,6 @@ declare const numbers: {
73
73
  readonly DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: number;
74
74
  readonly DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT: number;
75
75
  readonly DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT: number;
76
+ readonly DEFAULT_EMPTYSLOT_HEIGHT: 52;
76
77
  };
77
78
  export { cssClasses, strings, numbers };
@@ -66,7 +66,8 @@ const DEFAULT_CELL_MIDDLE_PADDING_TOP = 12;
66
66
  const DEFAULT_CELL_MIDDLE_PADDING_BOTTOM = 12;
67
67
  const DEFAULT_CELL_SMALL_PADDING_TOP = 8;
68
68
  const DEFAULT_CELL_SMALL_PADDING_BOTTOM = 8;
69
- const DEFAULT_CELL_LINE_HEIGHT = 20; // normal size
69
+ const DEFAULT_CELL_LINE_HEIGHT = 20;
70
+ const DEFAULT_EMPTYSLOT_HEIGHT = 52; // normal size
70
71
 
71
72
  const DEFAULT_VIRTUALIZED_ROW_HEIGHT = DEFAULT_CELL_LINE_HEIGHT + DEFAULT_CELL_BORDER_WITH_BOTTOM + DEFAULT_CELL_BORDER_WITH_TOP + DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM;
72
73
  const DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT = DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM + DEFAULT_CELL_BORDER_WITH_BOTTOM; // middle size
@@ -102,6 +103,7 @@ const numbers = {
102
103
  DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT,
103
104
  DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
104
105
  DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
105
- DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT
106
+ DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT,
107
+ DEFAULT_EMPTYSLOT_HEIGHT
106
108
  };
107
109
  exports.numbers = numbers;
@@ -394,7 +394,8 @@
394
394
  border-right: 1px solid var(--semi-color-border);
395
395
  }
396
396
  .semi-table-placeholder {
397
- position: relative;
397
+ position: sticky;
398
+ left: 0px;
398
399
  z-index: 1;
399
400
  padding: 16px 12px;
400
401
  color: var(--semi-color-text-2);
@@ -481,7 +481,8 @@ $module: #{$prefix}-table;
481
481
  }
482
482
 
483
483
  &-placeholder {
484
- position: relative;
484
+ position: sticky;
485
+ left: 0px;
485
486
  z-index: 1;
486
487
  padding: #{$spacing-table-paddingY} #{$spacing-table-paddingX};
487
488
  color: $color-table_placeholder-text-default;
@@ -36,7 +36,7 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
36
36
  _generateGroupedData(dataSource: any[]): any[];
37
37
  _generateTreeData(dataSource: any[]): any[];
38
38
  _generatePath(item: BasicResolvedDataItem): any;
39
- handleInputChange(inputVal: string): void;
39
+ handleInputChange(inputVal: string, notify: boolean): void;
40
40
  handleAll(wantAllChecked: boolean): void;
41
41
  handleClear(): void;
42
42
  handleSelectOrRemove(item: BasicResolvedDataItem): void;
@@ -38,7 +38,7 @@ class TransferFoundation extends _foundation.default {
38
38
  return path.map(p => p.label).join(' > ');
39
39
  }
40
40
 
41
- handleInputChange(inputVal) {
41
+ handleInputChange(inputVal, notify) {
42
42
  const {
43
43
  data
44
44
  } = this.getStates();
@@ -52,7 +52,7 @@ class TransferFoundation extends _foundation.default {
52
52
 
53
53
  this._adapter.searchTree(inputVal);
54
54
 
55
- this._adapter.notifySearch(inputVal);
55
+ notify && this._adapter.notifySearch(inputVal);
56
56
 
57
57
  this._adapter.updateInput(inputVal);
58
58
 
@@ -64,8 +64,7 @@ class TransferFoundation extends _foundation.default {
64
64
  const filterFunc = typeof filter === 'function' ? item => filter(inputVal, item) : item => typeof item.label === 'string' && item.label.includes(inputVal);
65
65
  const searchData = data.filter(filterFunc);
66
66
  const searchResult = new Set(searchData.map(item => item.key));
67
-
68
- this._adapter.notifySearch(inputVal);
67
+ notify && this._adapter.notifySearch(inputVal);
69
68
 
70
69
  this._adapter.updateInput(inputVal);
71
70
 
@@ -3,25 +3,27 @@ import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  export declare type BasicTriggerType = 'blur' | 'change' | 'custom' | 'mount';
4
4
  export declare type FieldValidateTriggerType = BasicTriggerType | Array<BasicTriggerType>;
5
5
  export declare type CommonFieldError = boolean | string | Array<any> | undefined | unknown;
6
- export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
6
+ export declare type BasicFieldError = Array<any>;
7
+ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>, Values extends object = any> extends DefaultAdapter<P, S> {
7
8
  cloneDeep: (val: any, ...rest: any[]) => any;
8
9
  notifySubmit: (values: any) => void;
9
- notifySubmitFail: (errors: Record<string, any>, values: any) => void;
10
+ notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>) => void;
10
11
  forceUpdate: (callback?: () => void) => void;
11
12
  notifyChange: (formState: FormState) => void;
12
13
  notifyValueChange: (values: any, changedValues: any) => void;
13
14
  notifyReset: () => void;
14
- getInitValues: () => Record<string, any>;
15
+ getInitValues: () => Partial<Values>;
15
16
  getFormProps: (keys: undefined | string | Array<string>) => any;
16
17
  getAllErrorDOM: () => NodeList;
17
18
  getFieldDOM: (field: string) => Node;
18
19
  initFormId: () => void;
19
20
  }
21
+ export declare type AllErrors<T> = T extends Record<string, any> ? {
22
+ [K in keyof T]?: string;
23
+ } : Record<string, any>;
20
24
  export interface FormState<T extends Record<string, any> = any> {
21
25
  values?: T extends Record<string, any> ? T : Record<string, any>;
22
- errors?: T extends Record<string, any> ? {
23
- [K in keyof T]?: string;
24
- } : Record<string, any>;
26
+ errors?: AllErrors<T>;
25
27
  touched?: T extends Record<string, any> ? {
26
28
  [K in keyof T]?: boolean;
27
29
  } : Record<string, any>;
@@ -60,7 +60,7 @@ export default class ImageFoundation extends BaseFoundation {
60
60
  } = preview;
61
61
  onVisibleChange && onVisibleChange(newVisible);
62
62
 
63
- if (!("visible" in this.getProps())) {
63
+ if (!("visible" in preview)) {
64
64
  this.setState({
65
65
  previewVisible: newVisible
66
66
  });
@@ -29,9 +29,9 @@ export default class PreviewFooterFoundation extends BaseFoundation {
29
29
  } = this.getProps();
30
30
 
31
31
  if (value > zoom) {
32
- onZoomIn(value / 100);
32
+ onZoomIn(Number((value / 100).toFixed(2)));
33
33
  } else {
34
- onZoomOut(value / 100);
34
+ onZoomOut(Number((value / 100).toFixed(2)));
35
35
  }
36
36
 
37
37
  this._adapter.setStartMouseOffset(value);
@@ -1,7 +1,7 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../base/foundation";
2
2
  export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
3
3
  getIsInGroup: () => boolean;
4
- notifyChange: (index: number) => void;
4
+ notifyChange: (index: number, direction: string) => void;
5
5
  notifyZoom: (zoom: number, increase: boolean) => void;
6
6
  notifyClose: () => void;
7
7
  notifyVisibleChange: (visible: boolean) => void;
@@ -120,7 +120,7 @@ export default class PreviewInnerFoundation extends BaseFoundation {
120
120
  });
121
121
  }
122
122
 
123
- this._adapter.notifyChange(newIndex);
123
+ this._adapter.notifyChange(newIndex, direction);
124
124
 
125
125
  this.setState({
126
126
  direction,
@@ -87,6 +87,12 @@
87
87
  align-items: center;
88
88
  justify-content: flex-start;
89
89
  }
90
+ .semi-navigation-item-has-link {
91
+ padding: 0;
92
+ }
93
+ .semi-navigation-item-has-link .semi-navigation-item-link {
94
+ padding: 8px 12px;
95
+ }
90
96
  .semi-navigation-item-sub {
91
97
  padding: 0;
92
98
  }
@@ -113,6 +113,15 @@ $module: #{$prefix}-navigation;
113
113
  justify-content: flex-start;
114
114
  }
115
115
 
116
+ // when item has link, add the padding to link instead of item
117
+ &-item-has-link {
118
+ padding: 0;
119
+
120
+ .#{$module}-item-link {
121
+ padding: $spacing-navigation_item-paddingY $spacing-navigation_item-paddingX;
122
+ }
123
+ }
124
+
116
125
  &-item-sub {
117
126
  padding: $spacing-navigation_item_sub-padding;
118
127
  }
@@ -73,5 +73,6 @@ declare const numbers: {
73
73
  readonly DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: number;
74
74
  readonly DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT: number;
75
75
  readonly DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT: number;
76
+ readonly DEFAULT_EMPTYSLOT_HEIGHT: 52;
76
77
  };
77
78
  export { cssClasses, strings, numbers };
@@ -56,7 +56,8 @@ const DEFAULT_CELL_MIDDLE_PADDING_TOP = 12;
56
56
  const DEFAULT_CELL_MIDDLE_PADDING_BOTTOM = 12;
57
57
  const DEFAULT_CELL_SMALL_PADDING_TOP = 8;
58
58
  const DEFAULT_CELL_SMALL_PADDING_BOTTOM = 8;
59
- const DEFAULT_CELL_LINE_HEIGHT = 20; // normal size
59
+ const DEFAULT_CELL_LINE_HEIGHT = 20;
60
+ const DEFAULT_EMPTYSLOT_HEIGHT = 52; // normal size
60
61
 
61
62
  const DEFAULT_VIRTUALIZED_ROW_HEIGHT = DEFAULT_CELL_LINE_HEIGHT + DEFAULT_CELL_BORDER_WITH_BOTTOM + DEFAULT_CELL_BORDER_WITH_TOP + DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM;
62
63
  const DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT = DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM + DEFAULT_CELL_BORDER_WITH_BOTTOM; // middle size
@@ -92,6 +93,7 @@ const numbers = {
92
93
  DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT,
93
94
  DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
94
95
  DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
95
- DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT
96
+ DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT,
97
+ DEFAULT_EMPTYSLOT_HEIGHT
96
98
  };
97
99
  export { cssClasses, strings, numbers };
@@ -394,7 +394,8 @@
394
394
  border-right: 1px solid var(--semi-color-border);
395
395
  }
396
396
  .semi-table-placeholder {
397
- position: relative;
397
+ position: sticky;
398
+ left: 0px;
398
399
  z-index: 1;
399
400
  padding: 16px 12px;
400
401
  color: var(--semi-color-text-2);
@@ -481,7 +481,8 @@ $module: #{$prefix}-table;
481
481
  }
482
482
 
483
483
  &-placeholder {
484
- position: relative;
484
+ position: sticky;
485
+ left: 0px;
485
486
  z-index: 1;
486
487
  padding: #{$spacing-table-paddingY} #{$spacing-table-paddingX};
487
488
  color: $color-table_placeholder-text-default;
@@ -36,7 +36,7 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
36
36
  _generateGroupedData(dataSource: any[]): any[];
37
37
  _generateTreeData(dataSource: any[]): any[];
38
38
  _generatePath(item: BasicResolvedDataItem): any;
39
- handleInputChange(inputVal: string): void;
39
+ handleInputChange(inputVal: string, notify: boolean): void;
40
40
  handleAll(wantAllChecked: boolean): void;
41
41
  handleClear(): void;
42
42
  handleSelectOrRemove(item: BasicResolvedDataItem): void;
@@ -24,7 +24,7 @@ export default class TransferFoundation extends BaseFoundation {
24
24
  return path.map(p => p.label).join(' > ');
25
25
  }
26
26
 
27
- handleInputChange(inputVal) {
27
+ handleInputChange(inputVal, notify) {
28
28
  const {
29
29
  data
30
30
  } = this.getStates();
@@ -38,7 +38,7 @@ export default class TransferFoundation extends BaseFoundation {
38
38
 
39
39
  this._adapter.searchTree(inputVal);
40
40
 
41
- this._adapter.notifySearch(inputVal);
41
+ notify && this._adapter.notifySearch(inputVal);
42
42
 
43
43
  this._adapter.updateInput(inputVal);
44
44
 
@@ -50,8 +50,7 @@ export default class TransferFoundation extends BaseFoundation {
50
50
  const filterFunc = typeof filter === 'function' ? item => filter(inputVal, item) : item => typeof item.label === 'string' && item.label.includes(inputVal);
51
51
  const searchData = data.filter(filterFunc);
52
52
  const searchResult = new Set(searchData.map(item => item.key));
53
-
54
- this._adapter.notifySearch(inputVal);
53
+ notify && this._adapter.notifySearch(inputVal);
55
54
 
56
55
  this._adapter.updateInput(inputVal);
57
56
 
@@ -113,6 +113,15 @@ $module: #{$prefix}-navigation;
113
113
  justify-content: flex-start;
114
114
  }
115
115
 
116
+ // when item has link, add the padding to link instead of item
117
+ &-item-has-link {
118
+ padding: 0;
119
+
120
+ .#{$module}-item-link {
121
+ padding: $spacing-navigation_item-paddingY $spacing-navigation_item-paddingX;
122
+ }
123
+ }
124
+
116
125
  &-item-sub {
117
126
  padding: $spacing-navigation_item_sub-padding;
118
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.22.3",
3
+ "version": "2.23.0-beta.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": "8cff064f240ea2a919c3527ae9b84e66c5b7a419",
26
+ "gitHead": "043a62790406e9ee86cd77e91190be8245baa9f6",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -60,6 +60,7 @@ const DEFAULT_CELL_MIDDLE_PADDING_BOTTOM = 12;
60
60
  const DEFAULT_CELL_SMALL_PADDING_TOP = 8;
61
61
  const DEFAULT_CELL_SMALL_PADDING_BOTTOM = 8;
62
62
  const DEFAULT_CELL_LINE_HEIGHT = 20;
63
+ const DEFAULT_EMPTYSLOT_HEIGHT = 52;
63
64
 
64
65
  // normal size
65
66
  const DEFAULT_VIRTUALIZED_ROW_HEIGHT =
@@ -118,6 +119,7 @@ const numbers = {
118
119
  DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
119
120
  DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
120
121
  DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT,
122
+ DEFAULT_EMPTYSLOT_HEIGHT
121
123
  } as const;
122
124
 
123
125
  export { cssClasses, strings, numbers };
package/table/table.scss CHANGED
@@ -481,7 +481,8 @@ $module: #{$prefix}-table;
481
481
  }
482
482
 
483
483
  &-placeholder {
484
- position: relative;
484
+ position: sticky;
485
+ left: 0px;
485
486
  z-index: 1;
486
487
  padding: #{$spacing-table-paddingY} #{$spacing-table-paddingX};
487
488
  color: $color-table_placeholder-text-default;
@@ -61,13 +61,13 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
61
61
  return path.map((p: any) => p.label).join(' > ');
62
62
  }
63
63
 
64
- handleInputChange(inputVal: string) {
64
+ handleInputChange(inputVal: string, notify: boolean) {
65
65
  const { data } = this.getStates();
66
66
  const { filter, type } = this.getProps();
67
67
  if (type === strings.TYPE_TREE_TO_LIST) {
68
68
  const searchResult = new Set(data.map((item: BasicResolvedDataItem) => item.key)) as Set<number | string>;
69
69
  this._adapter.searchTree(inputVal);
70
- this._adapter.notifySearch(inputVal);
70
+ notify && this._adapter.notifySearch(inputVal);
71
71
  this._adapter.updateInput(inputVal);
72
72
  this._adapter.updateSearchResult(searchResult);
73
73
  return;
@@ -77,7 +77,7 @@ export default class TransferFoundation<P = Record<string, any>, S = Record<stri
77
77
  (item: BasicResolvedDataItem) => typeof item.label === 'string' && item.label.includes(inputVal);
78
78
  const searchData = data.filter(filterFunc);
79
79
  const searchResult = new Set(searchData.map((item: BasicResolvedDataItem) => item.key)) as Set<number | string>;
80
- this._adapter.notifySearch(inputVal);
80
+ notify && this._adapter.notifySearch(inputVal);
81
81
  this._adapter.updateInput(inputVal);
82
82
  this._adapter.updateSearchResult(searchResult);
83
83
  }