@douyinfe/semi-foundation 2.20.5-alpha.0 → 2.20.5
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.
- package/autoComplete/foundation.ts +5 -1
- package/lib/cjs/autoComplete/foundation.d.ts +2 -1
- package/lib/cjs/autoComplete/foundation.js +5 -1
- package/lib/cjs/table/table.css +7 -0
- package/lib/cjs/table/table.scss +9 -0
- package/lib/es/autoComplete/foundation.d.ts +2 -1
- package/lib/es/autoComplete/foundation.js +5 -1
- package/lib/es/table/table.css +7 -0
- package/lib/es/table/table.scss +9 -0
- package/package.json +2 -2
- 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) {
|
|
@@ -413,7 +415,9 @@ class AutoCompleteFoundation<P = Record<string, any>, S = Record<string, any>> e
|
|
|
413
415
|
this._adapter.notifyFocus(e);
|
|
414
416
|
}
|
|
415
417
|
|
|
416
|
-
handleBlur(e:
|
|
418
|
+
handleBlur(e: any) {
|
|
419
|
+
// https://reactjs.org/docs/legacy-event-pooling.html
|
|
420
|
+
e.persist();
|
|
417
421
|
// In order to handle the problem of losing onClick binding when clicking on the padding area, the onBlur event is triggered first to cause the react view to be updated
|
|
418
422
|
// internal-issues:1231
|
|
419
423
|
setTimeout(() => {
|
|
@@ -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;
|
|
@@ -59,6 +60,6 @@ declare class AutoCompleteFoundation<P = Record<string, any>, S = Record<string,
|
|
|
59
60
|
_handleEnterKeyDown(): void;
|
|
60
61
|
handleOptionMouseEnter(optionIndex: number): void;
|
|
61
62
|
handleFocus(e: FocusEvent): void;
|
|
62
|
-
handleBlur(e:
|
|
63
|
+
handleBlur(e: any): void;
|
|
63
64
|
}
|
|
64
65
|
export default AutoCompleteFoundation;
|
|
@@ -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) {
|
|
@@ -497,8 +499,10 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
497
499
|
}
|
|
498
500
|
|
|
499
501
|
handleBlur(e) {
|
|
500
|
-
//
|
|
502
|
+
// https://reactjs.org/docs/legacy-event-pooling.html
|
|
503
|
+
e.persist(); // In order to handle the problem of losing onClick binding when clicking on the padding area, the onBlur event is triggered first to cause the react view to be updated
|
|
501
504
|
// internal-issues:1231
|
|
505
|
+
|
|
502
506
|
setTimeout(() => {
|
|
503
507
|
this._adapter.notifyBlur(e);
|
|
504
508
|
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -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%;
|
package/lib/cjs/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 {
|
|
@@ -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;
|
|
@@ -59,6 +60,6 @@ declare class AutoCompleteFoundation<P = Record<string, any>, S = Record<string,
|
|
|
59
60
|
_handleEnterKeyDown(): void;
|
|
60
61
|
handleOptionMouseEnter(optionIndex: number): void;
|
|
61
62
|
handleFocus(e: FocusEvent): void;
|
|
62
|
-
handleBlur(e:
|
|
63
|
+
handleBlur(e: any): void;
|
|
63
64
|
}
|
|
64
65
|
export default AutoCompleteFoundation;
|
|
@@ -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) {
|
|
@@ -483,8 +485,10 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
483
485
|
}
|
|
484
486
|
|
|
485
487
|
handleBlur(e) {
|
|
486
|
-
//
|
|
488
|
+
// https://reactjs.org/docs/legacy-event-pooling.html
|
|
489
|
+
e.persist(); // In order to handle the problem of losing onClick binding when clicking on the padding area, the onBlur event is triggered first to cause the react view to be updated
|
|
487
490
|
// internal-issues:1231
|
|
491
|
+
|
|
488
492
|
setTimeout(() => {
|
|
489
493
|
this._adapter.notifyBlur(e);
|
|
490
494
|
|
package/lib/es/table/table.css
CHANGED
|
@@ -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%;
|
package/lib/es/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 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.20.5
|
|
3
|
+
"version": "2.20.5",
|
|
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": "
|
|
26
|
+
"gitHead": "d3bebd51a3287d8e57d9460f658102bfb9712af4",
|
|
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 {
|