@douyinfe/semi-foundation 2.20.8 → 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.
@@ -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
  }
@@ -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
  }
@@ -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.8",
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": "9e94c35ebc88ffd1ed06cc5057ed90f94132a8f2",
26
+ "gitHead": "023bcb9e58c4d547ac53ca44c6d093eeb9ada6e2",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
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 {