@douyinfe/semi-foundation 2.30.2 → 2.31.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 (58) hide show
  1. package/carousel/foundation.ts +8 -2
  2. package/cascader/cascader.scss +8 -0
  3. package/cascader/foundation.ts +11 -3
  4. package/cascader/variables.scss +3 -1
  5. package/image/previewImageFoundation.ts +1 -2
  6. package/image/previewInnerFoundation.ts +0 -6
  7. package/lib/cjs/carousel/foundation.d.ts +2 -0
  8. package/lib/cjs/carousel/foundation.js +8 -3
  9. package/lib/cjs/cascader/cascader.css +6 -0
  10. package/lib/cjs/cascader/cascader.scss +8 -0
  11. package/lib/cjs/cascader/foundation.js +10 -2
  12. package/lib/cjs/cascader/variables.scss +3 -1
  13. package/lib/cjs/image/previewImageFoundation.js +1 -3
  14. package/lib/cjs/image/previewInnerFoundation.d.ts +0 -1
  15. package/lib/cjs/image/previewInnerFoundation.js +0 -6
  16. package/lib/cjs/select/foundation.d.ts +3 -3
  17. package/lib/cjs/select/foundation.js +14 -13
  18. package/lib/cjs/table/foundation.d.ts +4 -0
  19. package/lib/cjs/table/foundation.js +13 -2
  20. package/lib/cjs/table/rtl.scss +33 -2
  21. package/lib/cjs/table/table.css +50 -51
  22. package/lib/cjs/table/table.scss +8 -0
  23. package/lib/cjs/table/utils.d.ts +2 -0
  24. package/lib/cjs/table/utils.js +18 -0
  25. package/lib/cjs/tag/tag.css +10 -0
  26. package/lib/cjs/tag/tag.scss +13 -3
  27. package/lib/cjs/tooltip/foundation.d.ts +2 -0
  28. package/lib/cjs/tooltip/foundation.js +10 -1
  29. package/lib/es/carousel/foundation.d.ts +2 -0
  30. package/lib/es/carousel/foundation.js +8 -3
  31. package/lib/es/cascader/cascader.css +6 -0
  32. package/lib/es/cascader/cascader.scss +8 -0
  33. package/lib/es/cascader/foundation.js +10 -2
  34. package/lib/es/cascader/variables.scss +3 -1
  35. package/lib/es/image/previewImageFoundation.js +1 -3
  36. package/lib/es/image/previewInnerFoundation.d.ts +0 -1
  37. package/lib/es/image/previewInnerFoundation.js +0 -6
  38. package/lib/es/select/foundation.d.ts +3 -3
  39. package/lib/es/select/foundation.js +14 -13
  40. package/lib/es/table/foundation.d.ts +4 -0
  41. package/lib/es/table/foundation.js +13 -2
  42. package/lib/es/table/rtl.scss +33 -2
  43. package/lib/es/table/table.css +50 -51
  44. package/lib/es/table/table.scss +8 -0
  45. package/lib/es/table/utils.d.ts +2 -0
  46. package/lib/es/table/utils.js +16 -0
  47. package/lib/es/tag/tag.css +10 -0
  48. package/lib/es/tag/tag.scss +13 -3
  49. package/lib/es/tooltip/foundation.d.ts +2 -0
  50. package/lib/es/tooltip/foundation.js +10 -1
  51. package/package.json +2 -2
  52. package/select/foundation.ts +15 -13
  53. package/table/foundation.ts +13 -2
  54. package/table/rtl.scss +33 -2
  55. package/table/table.scss +8 -0
  56. package/table/utils.ts +14 -0
  57. package/tag/tag.scss +13 -3
  58. package/tooltip/foundation.ts +15 -7
@@ -141,12 +141,14 @@ class TableFoundation extends BaseFoundation {
141
141
  } = this._adapter.getStates();
142
142
 
143
143
  const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
144
+ const allDataDisabledRowKeys = this.getAllDisabledRowKeys(filteredSortedDataSource);
144
145
  const pageData = this.getCurrentPageData(filteredSortedDataSource);
145
146
  this.setAdapterPageData(pageData);
146
147
  this.initExpandedRowKeys(pageData);
147
148
  this.initSelectedRowKeys(pageData); // cache dataSource after mount, and then calculate it on demand
148
149
 
149
150
  this.setCachedFilteredSortedDataSource(filteredSortedDataSource);
151
+ this.setAllDisabledRowKeys(allDataDisabledRowKeys);
150
152
  }
151
153
 
152
154
  initExpandedRowKeys() {
@@ -508,6 +510,10 @@ class TableFoundation extends BaseFoundation {
508
510
 
509
511
  destroy() {}
510
512
 
513
+ setAllDisabledRowKeys(disabledRowKeys) {
514
+ this._adapter.setAllDisabledRowKeys(disabledRowKeys);
515
+ }
516
+
511
517
  handleClick(e) {}
512
518
 
513
519
  handleMouseEnter(e) {}
@@ -766,8 +772,11 @@ class TableFoundation extends BaseFoundation {
766
772
  const selectedRowKeysSet = this._getSelectedRowKeysSet();
767
773
 
768
774
  let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
769
- const disabledRowKeys = this.getAllDisabledRowKeys();
770
- const disabledRowKeysSet = new Set(disabledRowKeys);
775
+
776
+ const disabledRowKeys = this._adapter.getAllDisabledRowKeys();
777
+
778
+ const disabledRowKeysSet = this._adapter.getAllDisabledRowKeysSet();
779
+
771
780
  let changedRowKeys; // Select all, if not disabled && not in selectedRowKeys
772
781
 
773
782
  if (selected) {
@@ -1141,7 +1150,9 @@ class TableFoundation extends BaseFoundation {
1141
1150
  handleClickFilterOrSorter(queries) {
1142
1151
  const dataSource = [...this.getProp('dataSource')];
1143
1152
  const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
1153
+ const allDataDisabledRowKeys = this.getAllDisabledRowKeys(sortedDataSource);
1144
1154
  this.setCachedFilteredSortedDataSource(sortedDataSource);
1155
+ this.setAllDisabledRowKeys(allDataDisabledRowKeys);
1145
1156
  const pageData = this.getCurrentPageData(sortedDataSource);
1146
1157
  this.setAdapterPageData(pageData);
1147
1158
  }
@@ -1,7 +1,6 @@
1
1
  $module: #{$prefix}-table;
2
2
 
3
- .#{$prefix}-rtl,
4
- .#{$prefix}-portal-rtl {
3
+ .#{$module}-wrapper-rtl {
5
4
  .#{$module} {
6
5
  direction: rtl;
7
6
  text-align: right;
@@ -148,6 +147,34 @@ $module: #{$prefix}-table;
148
147
  }
149
148
  }
150
149
  }
150
+
151
+ &-scroll {
152
+ &-position {
153
+ &-left {
154
+ .#{$module}-tbody,
155
+ .#{$module}-thead {
156
+ & > .#{$module}-row > .#{$module}-cell-fixed-left-last {
157
+ box-shadow: $shadow-table_right;
158
+ }
159
+ & > .#{$module}-row > .#{$module}-cell-fixed-right-first {
160
+ box-shadow: none;
161
+ }
162
+ }
163
+ }
164
+
165
+ &-right {
166
+ .#{$module}-tbody,
167
+ .#{$module}-thead {
168
+ & > .#{$module}-row > .#{$module}-cell-fixed-left-last {
169
+ box-shadow: none;
170
+ }
171
+ & > .#{$module}-row > .#{$module}-cell-fixed-right-first {
172
+ box-shadow: $shadow-table_left;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
151
178
  }
152
179
 
153
180
  .#{$module}-expand-icon {
@@ -155,4 +182,8 @@ $module: #{$prefix}-table;
155
182
  margin-left: $spacing-table_expand_icon-marginRight;
156
183
  transform: scaleX(-1) translateY(2px);
157
184
  }
185
+
186
+ .#{$prefix}-spin {
187
+ direction: rtl;
188
+ }
158
189
  }
@@ -55,6 +55,12 @@
55
55
  .semi-table-wrapper[data-column-fixed=true] {
56
56
  z-index: 1;
57
57
  }
58
+ .semi-table-wrapper-ltr {
59
+ direction: ltr;
60
+ }
61
+ .semi-table-wrapper-ltr .semi-spin {
62
+ direction: ltr;
63
+ }
58
64
  .semi-table-middle .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
59
65
  padding-top: 12px;
60
66
  padding-bottom: 12px;
@@ -462,115 +468,90 @@
462
468
  transform: rotate(0deg);
463
469
  }
464
470
 
465
- .semi-rtl .semi-table,
466
- .semi-portal-rtl .semi-table {
471
+ .semi-table-wrapper-rtl .semi-table {
467
472
  direction: rtl;
468
473
  text-align: right;
469
474
  }
470
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head,
471
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head {
475
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head {
472
476
  text-align: right;
473
477
  }
474
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last,
475
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last {
478
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last {
476
479
  border-right: 0;
477
480
  border-left: 1px solid var(--semi-color-border);
478
481
  }
479
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last.resizing,
480
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last.resizing {
482
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left-last.resizing {
481
483
  border-left: 2px solid var(--semi-color-primary);
482
484
  }
483
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first,
484
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first {
485
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first {
485
486
  border-left: 0;
486
487
  border-right: 1px solid var(--semi-color-border);
487
488
  }
488
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first.resizing,
489
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first.resizing {
489
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first.resizing {
490
490
  border-left: 2px solid var(--semi-color-primary);
491
491
  }
492
- .semi-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first[x-type=column-scrollbar],
493
- .semi-portal-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first[x-type=column-scrollbar] {
492
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right-first[x-type=column-scrollbar] {
494
493
  box-shadow: none;
495
494
  border-right: transparent;
496
495
  }
497
- .semi-rtl .semi-table-thead > .semi-table-row .resizing,
498
- .semi-portal-rtl .semi-table-thead > .semi-table-row .resizing {
496
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row .resizing {
499
497
  border-left: 2px solid var(--semi-color-primary);
500
498
  }
501
- .semi-rtl .semi-table-thead > .semi-table-row .react-resizable-handle,
502
- .semi-portal-rtl .semi-table-thead > .semi-table-row .react-resizable-handle {
499
+ .semi-table-wrapper-rtl .semi-table-thead > .semi-table-row .react-resizable-handle {
503
500
  right: auto;
504
501
  left: -1px;
505
502
  }
506
- .semi-rtl .semi-table-tbody,
507
- .semi-portal-rtl .semi-table-tbody {
503
+ .semi-table-wrapper-rtl .semi-table-tbody {
508
504
  display: table-row-group;
509
505
  }
510
- .semi-rtl .semi-table-tbody > .semi-table-row > .semi-table-row-cell.resizing,
511
- .semi-portal-rtl .semi-table-tbody > .semi-table-row > .semi-table-row-cell.resizing {
506
+ .semi-table-wrapper-rtl .semi-table-tbody > .semi-table-row > .semi-table-row-cell.resizing {
512
507
  border-right: 0;
513
508
  border-left: 2px solid var(--semi-color-primary);
514
509
  }
515
- .semi-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
516
- .semi-portal-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last {
510
+ .semi-table-wrapper-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last {
517
511
  border-right: 0;
518
512
  border-left: 1px solid var(--semi-color-border);
519
513
  }
520
- .semi-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
521
- .semi-portal-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first {
514
+ .semi-table-wrapper-rtl .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first {
522
515
  border-left: 0;
523
516
  border-right: 1px solid var(--semi-color-border);
524
517
  }
525
- .semi-rtl .semi-table .semi-table-column-selection .semi-checkbox-inner-display .semi-icon,
526
- .semi-portal-rtl .semi-table .semi-table-column-selection .semi-checkbox-inner-display .semi-icon {
518
+ .semi-table-wrapper-rtl .semi-table .semi-table-column-selection .semi-checkbox-inner-display .semi-icon {
527
519
  left: auto;
528
520
  right: 0;
529
521
  }
530
- .semi-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon,
531
- .semi-portal-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon {
522
+ .semi-table-wrapper-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon {
532
523
  transform: scaleX(-1) translateY(2px);
533
524
  }
534
- .semi-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon:last-child,
535
- .semi-portal-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon:last-child {
525
+ .semi-table-wrapper-rtl .semi-table .semi-table-column-expand .semi-table-expand-icon:last-child {
536
526
  margin-right: auto;
537
527
  margin-left: 0;
538
528
  }
539
- .semi-rtl .semi-table .semi-table-column-sorter,
540
- .semi-portal-rtl .semi-table .semi-table-column-sorter {
529
+ .semi-table-wrapper-rtl .semi-table .semi-table-column-sorter {
541
530
  margin-left: auto;
542
531
  margin-right: 4px;
543
532
  }
544
- .semi-rtl .semi-table .semi-table-column-filter,
545
- .semi-portal-rtl .semi-table .semi-table-column-filter {
533
+ .semi-table-wrapper-rtl .semi-table .semi-table-column-filter {
546
534
  margin-left: auto;
547
535
  margin-right: 4px;
548
536
  }
549
- .semi-rtl .semi-table-bordered .semi-table-container,
550
- .semi-portal-rtl .semi-table-bordered .semi-table-container {
537
+ .semi-table-wrapper-rtl .semi-table-bordered .semi-table-container {
551
538
  border-left: 0;
552
539
  border-right: 1px solid var(--semi-color-border);
553
540
  }
554
- .semi-rtl .semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head,
555
- .semi-rtl .semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell,
556
- .semi-portal-rtl .semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head,
557
- .semi-portal-rtl .semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
541
+ .semi-table-wrapper-rtl .semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head,
542
+ .semi-table-wrapper-rtl .semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
558
543
  border-right: 0;
559
544
  border-left: 1px solid var(--semi-color-border);
560
545
  }
561
- .semi-rtl .semi-table-bordered .semi-table-placeholder,
562
- .semi-portal-rtl .semi-table-bordered .semi-table-placeholder {
546
+ .semi-table-wrapper-rtl .semi-table-bordered .semi-table-placeholder {
563
547
  border-left: 1px solid var(--semi-color-border);
564
548
  border-right: 0;
565
549
  }
566
- .semi-rtl .semi-table-bordered .semi-table-header::-webkit-scrollbar,
567
- .semi-portal-rtl .semi-table-bordered .semi-table-header::-webkit-scrollbar {
550
+ .semi-table-wrapper-rtl .semi-table-bordered .semi-table-header::-webkit-scrollbar {
568
551
  border-right: 0;
569
552
  border-left: 1px solid var(--semi-color-border);
570
553
  }
571
- .semi-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-expand > .semi-table-row-cell > .semi-table-expand-inner, .semi-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-section > .semi-table-row-cell > .semi-table-section-inner,
572
- .semi-portal-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-expand > .semi-table-row-cell > .semi-table-expand-inner,
573
- .semi-portal-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-section > .semi-table-row-cell > .semi-table-section-inner {
554
+ .semi-table-wrapper-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-expand > .semi-table-row-cell > .semi-table-expand-inner, .semi-table-wrapper-rtl .semi-table-fixed > .semi-table-tbody > .semi-table-row-section > .semi-table-row-cell > .semi-table-section-inner {
574
555
  left: auto;
575
556
  right: 0;
576
557
  margin-right: -16px;
@@ -578,9 +559,27 @@
578
559
  padding-right: 16px;
579
560
  padding-left: 16px;
580
561
  }
581
- .semi-rtl .semi-table-expand-icon,
582
- .semi-portal-rtl .semi-table-expand-icon {
562
+ .semi-table-wrapper-rtl .semi-table-scroll-position-left .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
563
+ .semi-table-wrapper-rtl .semi-table-scroll-position-left .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-left-last {
564
+ box-shadow: 3px 0 0 0 var(--semi-color-shadow);
565
+ }
566
+ .semi-table-wrapper-rtl .semi-table-scroll-position-left .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
567
+ .semi-table-wrapper-rtl .semi-table-scroll-position-left .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-right-first {
568
+ box-shadow: none;
569
+ }
570
+ .semi-table-wrapper-rtl .semi-table-scroll-position-right .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
571
+ .semi-table-wrapper-rtl .semi-table-scroll-position-right .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-left-last {
572
+ box-shadow: none;
573
+ }
574
+ .semi-table-wrapper-rtl .semi-table-scroll-position-right .semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
575
+ .semi-table-wrapper-rtl .semi-table-scroll-position-right .semi-table-thead > .semi-table-row > .semi-table-cell-fixed-right-first {
576
+ box-shadow: -3px 0 0 0 var(--semi-color-shadow);
577
+ }
578
+ .semi-table-wrapper-rtl .semi-table-expand-icon {
583
579
  margin-right: auto;
584
580
  margin-left: 8px;
585
581
  transform: scaleX(-1) translateY(2px);
582
+ }
583
+ .semi-table-wrapper-rtl .semi-spin {
584
+ direction: rtl;
586
585
  }
@@ -28,6 +28,14 @@ $module: #{$prefix}-table;
28
28
  &[data-column-fixed='true'] {
29
29
  z-index: 1;
30
30
  }
31
+
32
+ &-ltr {
33
+ direction: ltr;
34
+
35
+ .#{$prefix}-spin {
36
+ direction: ltr;
37
+ }
38
+ }
31
39
  }
32
40
 
33
41
  &-middle {
@@ -1,3 +1,4 @@
1
+ import { strings } from './constants';
1
2
  export declare function cloneDeep(value: any, customizer?: (v: any) => any): any;
2
3
  export declare function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean): boolean;
3
4
  export declare function getColumnKey(column: any, keyPropNames: any[]): any;
@@ -100,3 +101,4 @@ export declare function isTreeTable({ dataSource, childrenRecordName }: {
100
101
  dataSource: Record<string, any>;
101
102
  childrenRecordName?: string;
102
103
  }): boolean;
104
+ export declare function getRTLAlign(align: typeof strings.ALIGNS[number], direction?: 'ltr' | 'rtl'): typeof strings.ALIGNS[number];
@@ -531,4 +531,20 @@ export function isTreeTable(_ref2) {
531
531
  }
532
532
 
533
533
  return flag;
534
+ }
535
+ export function getRTLAlign(align, direction) {
536
+ if (direction === 'rtl') {
537
+ switch (align) {
538
+ case 'left':
539
+ return 'right';
540
+
541
+ case 'right':
542
+ return 'left';
543
+
544
+ default:
545
+ return align;
546
+ }
547
+ }
548
+
549
+ return align;
534
550
  }
@@ -46,10 +46,20 @@
46
46
  }
47
47
  .semi-tag-content {
48
48
  flex: 1;
49
+ }
50
+ .semi-tag-content-ellipsis {
49
51
  overflow: hidden;
50
52
  white-space: nowrap;
51
53
  text-overflow: ellipsis;
52
54
  }
55
+ .semi-tag-content-center {
56
+ display: flex;
57
+ display: flex;
58
+ justify-content: center;
59
+ align-items: center;
60
+ height: 100%;
61
+ min-width: 0;
62
+ }
53
63
  .semi-tag-close {
54
64
  display: flex;
55
65
  justify-content: center;
@@ -53,9 +53,19 @@ $types: "ghost", "solid", "light";
53
53
 
54
54
  &-content {
55
55
  flex: 1;
56
- overflow: hidden;
57
- white-space: nowrap;
58
- text-overflow: ellipsis;
56
+
57
+ &-ellipsis {
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ text-overflow: ellipsis;
61
+ }
62
+
63
+ &-center {
64
+ display: flex;
65
+ @include all-center;
66
+ height: 100%;
67
+ min-width: 0;
68
+ }
59
69
  }
60
70
 
61
71
  &-close {
@@ -16,6 +16,7 @@ export interface TooltipAdapter<P = Record<string, any>, S = Record<string, any>
16
16
  unregisterScrollHandler(): void;
17
17
  insertPortal(...args: any[]): void;
18
18
  removePortal(...args: any[]): void;
19
+ setDisplayNone: (displayNone: boolean, cb?: () => void) => void;
19
20
  getEventName(): {
20
21
  mouseEnter: string;
21
22
  mouseLeave: string;
@@ -65,6 +66,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
65
66
  _bindResizeEvent(): void;
66
67
  unBindResizeEvent(): void;
67
68
  removePortal: () => void;
69
+ setDisplayNone: (displayNone: boolean, cb?: () => void) => void;
68
70
  _adjustPos(position?: string, isVertical?: boolean, adjustType?: string, concatPos?: any): string;
69
71
  _reversePos(position?: string, isVertical?: boolean): string;
70
72
  _expandPos(position: string, concatPos: string): string;
@@ -27,6 +27,10 @@ export default class Tooltip extends BaseFoundation {
27
27
  this._adapter.removePortal();
28
28
  };
29
29
 
30
+ this.setDisplayNone = (displayNone, cb) => {
31
+ this._adapter.setDisplayNone(displayNone, cb);
32
+ };
33
+
30
34
  this.onResize = () => {
31
35
  // this.log('resize');
32
36
  // rePosition when window resize
@@ -52,9 +56,14 @@ export default class Tooltip extends BaseFoundation {
52
56
  const trigger = this.getProp('trigger');
53
57
  const clickTriggerToHide = this.getProp('clickTriggerToHide');
54
58
  const {
55
- visible
59
+ visible,
60
+ displayNone
56
61
  } = this.getStates();
57
62
 
63
+ if (displayNone) {
64
+ this.setDisplayNone(false);
65
+ }
66
+
58
67
  if (visible) {
59
68
  return;
60
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.30.2",
3
+ "version": "2.31.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": "1cd39aa790995b2770f09a95ef89f1e9948b845b",
26
+ "gitHead": "28b48a92313bbd889681618ca0898c931e6ee721",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -32,7 +32,7 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
32
32
  notifyClear(): void;
33
33
  updateInputValue(inputValue: string): void;
34
34
  focusInput(): void;
35
- notifySearch(inputValue: string): void;
35
+ notifySearch(inputValue: string, event?: any): void;
36
36
  registerKeyDown(handler: () => void): void;
37
37
  unregisterKeyDown(): void;
38
38
  notifyChange(value: string | BasicOptionProps | (string | BasicOptionProps)[]): void;
@@ -396,7 +396,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
396
396
 
397
397
  this._adapter.once('popoverClose', () => {
398
398
  if (isFilterable) {
399
- this.clearInput();
399
+ this.clearInput(e);
400
400
  }
401
401
  if (closeCb) {
402
402
  closeCb();
@@ -467,7 +467,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
467
467
  this._notifyChange(selections);
468
468
  if (this._isFilterable()) {
469
469
  if (autoClearSearchValue) {
470
- this.clearInput();
470
+ this.clearInput(event);
471
471
  }
472
472
  this.focusInput();
473
473
  }
@@ -482,7 +482,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
482
482
  if (this._isFilterable()) {
483
483
  // When filter active,if autoClearSearchValue is true,reset input after select
484
484
  if (autoClearSearchValue) {
485
- this.clearInput();
485
+ this.clearInput(event);
486
486
  // At the same time, the filtering of options is also cleared, in order to show all candidates
487
487
  const sugInput = '';
488
488
  options = this._filterOption(options, sugInput);
@@ -550,12 +550,14 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
550
550
  }
551
551
  }
552
552
 
553
- clearInput() {
553
+
554
+ // The reason why event input is optional is that clearInput may be manually called by the user through ref
555
+ clearInput(event?: any) {
554
556
  const { inputValue } = this.getStates();
555
557
  // only when input is not null, select should notifySearch and updateOptions
556
558
  if (inputValue !== ''){
557
559
  this._adapter.updateInputValue('');
558
- this._adapter.notifySearch('');
560
+ this._adapter.notifySearch('', event);
559
561
  // reset options filter
560
562
  const { options } = this.getStates();
561
563
  const { remote } = this.getProps();
@@ -573,7 +575,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
573
575
  this._adapter.setIsFocusInContainer(false);
574
576
  }
575
577
 
576
- handleInputChange(sugInput: string) {
578
+ handleInputChange(sugInput: string, event: any) {
577
579
  // Input is a controlled component, so the value needs to be updated
578
580
  this._adapter.updateInputValue(sugInput);
579
581
  const { options, isOpen } = this.getStates();
@@ -589,7 +591,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
589
591
  optionsAfterFilter = this._createOptionByInput(allowCreate, optionsAfterFilter, sugInput);
590
592
 
591
593
  this._adapter.updateOptions(optionsAfterFilter);
592
- this._adapter.notifySearch(sugInput);
594
+ this._adapter.notifySearch(sugInput, event);
593
595
  // In multi-select mode, the drop-down box is repositioned each time you enter, because it may cause a line break as the input changes
594
596
  if (this._isMultiple()) {
595
597
  this._adapter.rePositionDropdown();
@@ -809,7 +811,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
809
811
  }
810
812
  } else {
811
813
  // there are no focusable elements inside the container, tab to next element and trigger blur
812
- this.close();
814
+ this.close(event);
813
815
  this._notifyBlur(event);
814
816
  }
815
817
  } else {
@@ -829,7 +831,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
829
831
  } else if (activeElement === focusableElements[focusableElements.length - 1]) {
830
832
  // focus in the last element in container, focus back to trigger and close panel
831
833
  this._focusTrigger();
832
- this.close();
834
+ this.close(event);
833
835
  handlePrevent(event);
834
836
  }
835
837
  }
@@ -840,7 +842,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
840
842
 
841
843
  if (!isFocusInContainer) {
842
844
  // focus in trigger, close the panel, shift tab to previe element and trigger blur
843
- this.close();
845
+ this.close(event);
844
846
  this._notifyBlur(event);
845
847
  } else if (activeElement === focusableElements[0]) {
846
848
  // focus in the first element in container, focus back to trigger
@@ -870,7 +872,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
870
872
  this.onSelect(selectedOption, focusIndex, event);
871
873
  }
872
874
  } else {
873
- this.close();
875
+ this.close(event);
874
876
  }
875
877
  }
876
878
  }
@@ -1018,7 +1020,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
1018
1020
  handleClearClick(e: MouseEvent) {
1019
1021
  const { filter } = this.getProps();
1020
1022
  if (filter) {
1021
- this.clearInput();
1023
+ this.clearInput(e);
1022
1024
  }
1023
1025
  this.clearSelected();
1024
1026
  // prevent this click open dropdown
@@ -82,6 +82,9 @@ export interface TableAdapter<RecordType> extends DefaultAdapter {
82
82
  getCachedFilteredSortedDataSource: () => RecordType[];
83
83
  getCachedFilteredSortedRowKeys: () => BaseRowKeyType[];
84
84
  getCachedFilteredSortedRowKeysSet: () => Set<BaseRowKeyType>;
85
+ setAllDisabledRowKeys: (allDisabledRowKeys: BaseRowKeyType[]) => void;
86
+ getAllDisabledRowKeys: () => BaseRowKeyType[];
87
+ getAllDisabledRowKeysSet: () => Set<BaseRowKeyType>;
85
88
  notifyFilterDropdownVisibleChange: (visible: boolean, dataIndex: string) => void;
86
89
  notifyChange: (changeInfo: { pagination: BasePagination; filters: BaseChangeInfoFilter<RecordType>[]; sorter: BaseChangeInfoSorter<RecordType>; extra: any }) => void;
87
90
  notifyExpand: (expanded?: boolean, record?: BaseIncludeGroupRecord<RecordType>, mouseEvent?: any) => void;
@@ -174,12 +177,14 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
174
177
  const dataSource = [...this.getProp('dataSource')];
175
178
  const { queries } = this._adapter.getStates();
176
179
  const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
180
+ const allDataDisabledRowKeys = this.getAllDisabledRowKeys(filteredSortedDataSource);
177
181
  const pageData = this.getCurrentPageData(filteredSortedDataSource);
178
182
  this.setAdapterPageData(pageData);
179
183
  this.initExpandedRowKeys(pageData);
180
184
  this.initSelectedRowKeys(pageData);
181
185
  // cache dataSource after mount, and then calculate it on demand
182
186
  this.setCachedFilteredSortedDataSource(filteredSortedDataSource);
187
+ this.setAllDisabledRowKeys(allDataDisabledRowKeys);
183
188
  }
184
189
 
185
190
  initExpandedRowKeys({ groups }: { groups?: Map<string, RecordType[]> } = {}) {
@@ -553,6 +558,10 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
553
558
 
554
559
  destroy() { }
555
560
 
561
+ setAllDisabledRowKeys(disabledRowKeys) {
562
+ this._adapter.setAllDisabledRowKeys(disabledRowKeys);
563
+ }
564
+
556
565
  handleClick(e: any) { }
557
566
 
558
567
  handleMouseEnter(e: any) { }
@@ -784,8 +793,8 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
784
793
  let selectedRowKeys = [...curSelectedRowKeys];
785
794
  const selectedRowKeysSet = this._getSelectedRowKeysSet();
786
795
  let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
787
- const disabledRowKeys = this.getAllDisabledRowKeys();
788
- const disabledRowKeysSet = new Set(disabledRowKeys);
796
+ const disabledRowKeys = this._adapter.getAllDisabledRowKeys();
797
+ const disabledRowKeysSet = this._adapter.getAllDisabledRowKeysSet();
789
798
  let changedRowKeys;
790
799
 
791
800
  // Select all, if not disabled && not in selectedRowKeys
@@ -1130,7 +1139,9 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
1130
1139
  handleClickFilterOrSorter(queries: BaseColumnProps<RecordType>[]) {
1131
1140
  const dataSource = [...this.getProp('dataSource')];
1132
1141
  const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
1142
+ const allDataDisabledRowKeys = this.getAllDisabledRowKeys(sortedDataSource);
1133
1143
  this.setCachedFilteredSortedDataSource(sortedDataSource);
1144
+ this.setAllDisabledRowKeys(allDataDisabledRowKeys);
1134
1145
  const pageData = this.getCurrentPageData(sortedDataSource);
1135
1146
  this.setAdapterPageData(pageData);
1136
1147
  }
package/table/rtl.scss CHANGED
@@ -1,7 +1,6 @@
1
1
  $module: #{$prefix}-table;
2
2
 
3
- .#{$prefix}-rtl,
4
- .#{$prefix}-portal-rtl {
3
+ .#{$module}-wrapper-rtl {
5
4
  .#{$module} {
6
5
  direction: rtl;
7
6
  text-align: right;
@@ -148,6 +147,34 @@ $module: #{$prefix}-table;
148
147
  }
149
148
  }
150
149
  }
150
+
151
+ &-scroll {
152
+ &-position {
153
+ &-left {
154
+ .#{$module}-tbody,
155
+ .#{$module}-thead {
156
+ & > .#{$module}-row > .#{$module}-cell-fixed-left-last {
157
+ box-shadow: $shadow-table_right;
158
+ }
159
+ & > .#{$module}-row > .#{$module}-cell-fixed-right-first {
160
+ box-shadow: none;
161
+ }
162
+ }
163
+ }
164
+
165
+ &-right {
166
+ .#{$module}-tbody,
167
+ .#{$module}-thead {
168
+ & > .#{$module}-row > .#{$module}-cell-fixed-left-last {
169
+ box-shadow: none;
170
+ }
171
+ & > .#{$module}-row > .#{$module}-cell-fixed-right-first {
172
+ box-shadow: $shadow-table_left;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
151
178
  }
152
179
 
153
180
  .#{$module}-expand-icon {
@@ -155,4 +182,8 @@ $module: #{$prefix}-table;
155
182
  margin-left: $spacing-table_expand_icon-marginRight;
156
183
  transform: scaleX(-1) translateY(2px);
157
184
  }
185
+
186
+ .#{$prefix}-spin {
187
+ direction: rtl;
188
+ }
158
189
  }