@douyinfe/semi-foundation 2.18.1 → 2.18.3
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/lib/cjs/table/mixin.scss +2 -2
- package/lib/cjs/table/rtl.scss +8 -8
- package/lib/cjs/table/table.scss +16 -16
- package/lib/cjs/table/utils.d.ts +1 -3
- package/lib/cjs/table/utils.js +3 -44
- package/lib/cjs/table/variables.scss +0 -3
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/es/table/mixin.scss +2 -2
- package/lib/es/table/rtl.scss +8 -8
- package/lib/es/table/table.scss +16 -16
- package/lib/es/table/utils.d.ts +1 -3
- package/lib/es/table/utils.js +2 -39
- package/lib/es/table/variables.scss +0 -3
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/upload/constants.d.ts +1 -1
- package/package.json +2 -2
- package/table/mixin.scss +2 -2
- package/table/rtl.scss +8 -8
- package/table/table.scss +16 -16
- package/table/utils.ts +1 -38
- package/table/variables.scss +0 -3
package/lib/cjs/table/mixin.scss
CHANGED
package/lib/cjs/table/rtl.scss
CHANGED
|
@@ -19,7 +19,7 @@ $module: #{$prefix}-table;
|
|
|
19
19
|
|
|
20
20
|
&.resizing {
|
|
21
21
|
// rtl override mixin
|
|
22
|
-
border-left: $
|
|
22
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ $module: #{$prefix}-table;
|
|
|
28
28
|
border-right: 1px solid $color-table_shadow-border-default;
|
|
29
29
|
|
|
30
30
|
&.resizing {
|
|
31
|
-
border-left: $
|
|
31
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&[x-type="column-scrollbar"] {
|
|
@@ -40,7 +40,7 @@ $module: #{$prefix}-table;
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.resizing {
|
|
43
|
-
border-left: $
|
|
43
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.react-resizable-handle {
|
|
@@ -57,7 +57,7 @@ $module: #{$prefix}-table;
|
|
|
57
57
|
|
|
58
58
|
&.resizing {
|
|
59
59
|
border-right: 0;
|
|
60
|
-
border-left: $
|
|
60
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -112,17 +112,17 @@ $module: #{$prefix}-table;
|
|
|
112
112
|
&-bordered {
|
|
113
113
|
.#{$module}-container {
|
|
114
114
|
border-left: 0;
|
|
115
|
-
border-right: $border-table;
|
|
115
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
119
119
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
120
120
|
border-right: 0;
|
|
121
|
-
border-left: $border-table;
|
|
121
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.#{$module}-placeholder {
|
|
125
|
-
border-left: $border-table;
|
|
125
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
126
126
|
border-right: 0;
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ $module: #{$prefix}-table;
|
|
|
130
130
|
|
|
131
131
|
&::-webkit-scrollbar {
|
|
132
132
|
border-right: 0;
|
|
133
|
-
border-left: $border-table;
|
|
133
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -60,7 +60,7 @@ $module: #{$prefix}-table;
|
|
|
60
60
|
|
|
61
61
|
&::-webkit-scrollbar {
|
|
62
62
|
background-color: transparent;
|
|
63
|
-
border-bottom: $border-
|
|
63
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
64
64
|
}
|
|
65
65
|
scrollbar-base-color: transparent;
|
|
66
66
|
}
|
|
@@ -91,7 +91,7 @@ $module: #{$prefix}-table;
|
|
|
91
91
|
color: $color-table_th-text-default;
|
|
92
92
|
font-weight: $font-weight-bold;
|
|
93
93
|
text-align: left;
|
|
94
|
-
border-bottom: $border-
|
|
94
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
95
95
|
padding-left: $spacing-table_row_head-paddingX;
|
|
96
96
|
padding-right: $spacing-table_row_head-paddingX;
|
|
97
97
|
padding-top: $spacing-table_row_head-paddingY;
|
|
@@ -223,14 +223,14 @@ $module: #{$prefix}-table;
|
|
|
223
223
|
word-break: break-all;
|
|
224
224
|
border-left: none;
|
|
225
225
|
border-right: none;
|
|
226
|
-
border-bottom: $border-table;
|
|
226
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
227
227
|
padding: $spacing-table_tbody_rowCell-padding;
|
|
228
228
|
box-sizing: border-box;
|
|
229
229
|
position: relative;
|
|
230
230
|
vertical-align: middle;
|
|
231
231
|
|
|
232
232
|
&.resizing {
|
|
233
|
-
border-right: $
|
|
233
|
+
border-right: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
&.#{$module}-row {
|
|
@@ -276,7 +276,7 @@ $module: #{$prefix}-table;
|
|
|
276
276
|
|
|
277
277
|
& > .#{$module}-row-cell {
|
|
278
278
|
background-color: $color-table_selection-bg-default;
|
|
279
|
-
border-bottom: $border-table;
|
|
279
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
& > .#{$module}-row-cell:not(.#{$module}-column-selection) {
|
|
@@ -431,27 +431,27 @@ $module: #{$prefix}-table;
|
|
|
431
431
|
.#{$module}-title {
|
|
432
432
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
433
433
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
434
|
-
border-top: $border-table;
|
|
435
|
-
border-right: $border-table;
|
|
436
|
-
border-left: $border-table;
|
|
434
|
+
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
435
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
436
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
.#{$module}-container {
|
|
440
|
-
border: $border-table;
|
|
440
|
+
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
441
441
|
border-right: 0;
|
|
442
442
|
border-bottom: 0;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.#{$module}-header {
|
|
446
446
|
&::-webkit-scrollbar {
|
|
447
|
-
border-right: $border-table;
|
|
447
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
.#{$module}-footer {
|
|
452
|
-
border-left: $border-table;
|
|
453
|
-
border-right: $border-table;
|
|
454
|
-
border-bottom: $border-table;
|
|
452
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
453
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
454
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
@@ -462,11 +462,11 @@ $module: #{$prefix}-table;
|
|
|
462
462
|
|
|
463
463
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
464
464
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
465
|
-
border-right: $border-table;
|
|
465
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
.#{$module}-placeholder {
|
|
469
|
-
border-right: $border-table;
|
|
469
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -478,7 +478,7 @@ $module: #{$prefix}-table;
|
|
|
478
478
|
font-size: #{$font-table_base-fontSize};
|
|
479
479
|
text-align: center;
|
|
480
480
|
background: $color-table_pl-bg-default;
|
|
481
|
-
border-bottom: $border-table;
|
|
481
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
482
482
|
border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
|
|
483
483
|
}
|
|
484
484
|
|
package/lib/cjs/table/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare function cloneDeep(value: any, customizer?: (v: any) => any): any;
|
|
2
1
|
export declare function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean): boolean;
|
|
3
2
|
export declare function getColumnKey(column: any, keyPropNames: any[]): any;
|
|
4
|
-
export declare function mergeColumns(oldColumns?: any[], newColumns?: any[], keyPropNames?: any[], deep?: boolean): any[];
|
|
5
3
|
/**
|
|
6
4
|
*
|
|
7
5
|
* @param {Array<number>} arr
|
|
@@ -80,7 +78,7 @@ export declare function mergeQueries(query: Record<string, any>, queries?: Recor
|
|
|
80
78
|
* @param {Object[]} columns columns retain the column width after resize
|
|
81
79
|
* @param {Object[]} newColumns
|
|
82
80
|
*/
|
|
83
|
-
export declare function withResizeWidth(columns: Record<string, any>[], newColumns: Record<string, any>[]): any;
|
|
81
|
+
export declare function withResizeWidth(columns: Record<string, any>[], newColumns: Record<string, any>[]): Record<string, any>[];
|
|
84
82
|
/**
|
|
85
83
|
* Pure function version of the same function in table foundation
|
|
86
84
|
* This is not accessible in getDerivedStateFromProps, so fork one out
|
package/lib/cjs/table/utils.js
CHANGED
|
@@ -10,7 +10,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
10
10
|
|
|
11
11
|
exports.arrayAdd = arrayAdd;
|
|
12
12
|
exports.assignColumnKeys = assignColumnKeys;
|
|
13
|
-
exports.cloneDeep = cloneDeep;
|
|
14
13
|
exports.equalWith = equalWith;
|
|
15
14
|
exports.expandBtnShouldInRow = expandBtnShouldInRow;
|
|
16
15
|
exports.filterColumns = filterColumns;
|
|
@@ -42,7 +41,6 @@ exports.isScrollbarColumn = isScrollbarColumn;
|
|
|
42
41
|
exports.isSelected = isSelected;
|
|
43
42
|
exports.isSelectionColumn = isSelectionColumn;
|
|
44
43
|
exports.isTreeTable = isTreeTable;
|
|
45
|
-
exports.mergeColumns = mergeColumns;
|
|
46
44
|
exports.mergeQueries = mergeQueries;
|
|
47
45
|
exports.sliceColumnsByLevel = sliceColumnsByLevel;
|
|
48
46
|
exports.warnIfNoDataIndex = warnIfNoDataIndex;
|
|
@@ -50,8 +48,6 @@ exports.withResizeWidth = withResizeWidth;
|
|
|
50
48
|
|
|
51
49
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
52
50
|
|
|
53
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
54
|
-
|
|
55
51
|
var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
|
|
56
52
|
|
|
57
53
|
var _includes2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
@@ -64,6 +60,8 @@ var _some2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stab
|
|
|
64
60
|
|
|
65
61
|
var _findIndex2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
66
62
|
|
|
63
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
64
|
+
|
|
67
65
|
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
68
66
|
|
|
69
67
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
@@ -78,10 +76,6 @@ var _findIndex3 = _interopRequireDefault(require("lodash/findIndex"));
|
|
|
78
76
|
|
|
79
77
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
80
78
|
|
|
81
|
-
var _clone2 = _interopRequireDefault(require("lodash/clone"));
|
|
82
|
-
|
|
83
|
-
var _map2 = _interopRequireDefault(require("lodash/map"));
|
|
84
|
-
|
|
85
79
|
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
86
80
|
|
|
87
81
|
var _filter2 = _interopRequireDefault(require("lodash/filter"));
|
|
@@ -90,26 +84,12 @@ var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
|
90
84
|
|
|
91
85
|
var _isEqualWith2 = _interopRequireDefault(require("lodash/isEqualWith"));
|
|
92
86
|
|
|
93
|
-
var _cloneDeepWith2 = _interopRequireDefault(require("lodash/cloneDeepWith"));
|
|
94
|
-
|
|
95
87
|
var _constants = require("./constants");
|
|
96
88
|
|
|
97
89
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
98
90
|
|
|
99
91
|
var _Logger = _interopRequireDefault(require("../utils/Logger"));
|
|
100
92
|
|
|
101
|
-
function cloneDeep(value, customizer) {
|
|
102
|
-
return (0, _cloneDeepWith2.default)(value, v => {
|
|
103
|
-
if (typeof v === 'function') {
|
|
104
|
-
return v;
|
|
105
|
-
} else if (typeof customizer === 'function') {
|
|
106
|
-
return customizer(v);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return undefined;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
93
|
function equalWith(value, other, customizer) {
|
|
114
94
|
return (0, _isEqualWith2.default)(value, other, function (objVal, othVal) {
|
|
115
95
|
if (typeof objVal === 'function' && typeof othVal === 'function') {
|
|
@@ -143,27 +123,6 @@ function getColumnKey(column, keyPropNames) {
|
|
|
143
123
|
});
|
|
144
124
|
return key;
|
|
145
125
|
}
|
|
146
|
-
|
|
147
|
-
function mergeColumns() {
|
|
148
|
-
let oldColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
149
|
-
let newColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
150
|
-
let keyPropNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
151
|
-
let deep = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
152
|
-
const finalColumns = [];
|
|
153
|
-
const clone = deep ? cloneDeep : _clone2.default;
|
|
154
|
-
(0, _map2.default)(newColumns, newColumn => {
|
|
155
|
-
newColumn = (0, _assign.default)({}, newColumn);
|
|
156
|
-
const key = getColumnKey(newColumn, keyPropNames);
|
|
157
|
-
const oldColumn = key != null && (0, _find2.default)(oldColumns, item => getColumnKey(item, keyPropNames) === key);
|
|
158
|
-
|
|
159
|
-
if (oldColumn) {
|
|
160
|
-
finalColumns.push(clone((0, _assign.default)((0, _assign.default)({}, oldColumn), newColumn)));
|
|
161
|
-
} else {
|
|
162
|
-
finalColumns.push(clone(newColumn));
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
return finalColumns;
|
|
166
|
-
}
|
|
167
126
|
/**
|
|
168
127
|
*
|
|
169
128
|
* @param {Array<number>} arr
|
|
@@ -551,7 +510,7 @@ function mergeQueries(query) {
|
|
|
551
510
|
|
|
552
511
|
|
|
553
512
|
function withResizeWidth(columns, newColumns) {
|
|
554
|
-
const _newColumns =
|
|
513
|
+
const _newColumns = [...newColumns];
|
|
555
514
|
|
|
556
515
|
for (const column of columns) {
|
|
557
516
|
if (!(0, _isNullOrUndefined.default)(column.width)) {
|
|
@@ -80,9 +80,6 @@ $font-table_base-fontSize: 14px; // 表格默认文本字号
|
|
|
80
80
|
$border-table_base-borderStyle: solid; // 表格描边样式
|
|
81
81
|
$shadow-table_left: -3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 左侧
|
|
82
82
|
$shadow-table_right: 3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 右侧
|
|
83
|
-
$border-table: $width-table_base_border $border-table_base-borderStyle $color-table-border-default; // 表格默认描边
|
|
84
|
-
$border-table_head-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default; // 表头单元格描边 - 底部
|
|
85
|
-
$border-table_resizer: $width-table_resizer_border solid $color-table_resizer-bg-default; // 表格拉伸标识描边
|
|
86
83
|
|
|
87
84
|
$z-table-fixed: 101!default; // fixed列的zIndex值
|
|
88
85
|
$z-table_fixed_column: $z-table-fixed; // fixed列的zIndex值
|
|
@@ -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):
|
|
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: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("custom" | "auto")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/lib/es/table/mixin.scss
CHANGED
package/lib/es/table/rtl.scss
CHANGED
|
@@ -19,7 +19,7 @@ $module: #{$prefix}-table;
|
|
|
19
19
|
|
|
20
20
|
&.resizing {
|
|
21
21
|
// rtl override mixin
|
|
22
|
-
border-left: $
|
|
22
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ $module: #{$prefix}-table;
|
|
|
28
28
|
border-right: 1px solid $color-table_shadow-border-default;
|
|
29
29
|
|
|
30
30
|
&.resizing {
|
|
31
|
-
border-left: $
|
|
31
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&[x-type="column-scrollbar"] {
|
|
@@ -40,7 +40,7 @@ $module: #{$prefix}-table;
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.resizing {
|
|
43
|
-
border-left: $
|
|
43
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.react-resizable-handle {
|
|
@@ -57,7 +57,7 @@ $module: #{$prefix}-table;
|
|
|
57
57
|
|
|
58
58
|
&.resizing {
|
|
59
59
|
border-right: 0;
|
|
60
|
-
border-left: $
|
|
60
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -112,17 +112,17 @@ $module: #{$prefix}-table;
|
|
|
112
112
|
&-bordered {
|
|
113
113
|
.#{$module}-container {
|
|
114
114
|
border-left: 0;
|
|
115
|
-
border-right: $border-table;
|
|
115
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
119
119
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
120
120
|
border-right: 0;
|
|
121
|
-
border-left: $border-table;
|
|
121
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.#{$module}-placeholder {
|
|
125
|
-
border-left: $border-table;
|
|
125
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
126
126
|
border-right: 0;
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ $module: #{$prefix}-table;
|
|
|
130
130
|
|
|
131
131
|
&::-webkit-scrollbar {
|
|
132
132
|
border-right: 0;
|
|
133
|
-
border-left: $border-table;
|
|
133
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
package/lib/es/table/table.scss
CHANGED
|
@@ -60,7 +60,7 @@ $module: #{$prefix}-table;
|
|
|
60
60
|
|
|
61
61
|
&::-webkit-scrollbar {
|
|
62
62
|
background-color: transparent;
|
|
63
|
-
border-bottom: $border-
|
|
63
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
64
64
|
}
|
|
65
65
|
scrollbar-base-color: transparent;
|
|
66
66
|
}
|
|
@@ -91,7 +91,7 @@ $module: #{$prefix}-table;
|
|
|
91
91
|
color: $color-table_th-text-default;
|
|
92
92
|
font-weight: $font-weight-bold;
|
|
93
93
|
text-align: left;
|
|
94
|
-
border-bottom: $border-
|
|
94
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
95
95
|
padding-left: $spacing-table_row_head-paddingX;
|
|
96
96
|
padding-right: $spacing-table_row_head-paddingX;
|
|
97
97
|
padding-top: $spacing-table_row_head-paddingY;
|
|
@@ -223,14 +223,14 @@ $module: #{$prefix}-table;
|
|
|
223
223
|
word-break: break-all;
|
|
224
224
|
border-left: none;
|
|
225
225
|
border-right: none;
|
|
226
|
-
border-bottom: $border-table;
|
|
226
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
227
227
|
padding: $spacing-table_tbody_rowCell-padding;
|
|
228
228
|
box-sizing: border-box;
|
|
229
229
|
position: relative;
|
|
230
230
|
vertical-align: middle;
|
|
231
231
|
|
|
232
232
|
&.resizing {
|
|
233
|
-
border-right: $
|
|
233
|
+
border-right: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
&.#{$module}-row {
|
|
@@ -276,7 +276,7 @@ $module: #{$prefix}-table;
|
|
|
276
276
|
|
|
277
277
|
& > .#{$module}-row-cell {
|
|
278
278
|
background-color: $color-table_selection-bg-default;
|
|
279
|
-
border-bottom: $border-table;
|
|
279
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
& > .#{$module}-row-cell:not(.#{$module}-column-selection) {
|
|
@@ -431,27 +431,27 @@ $module: #{$prefix}-table;
|
|
|
431
431
|
.#{$module}-title {
|
|
432
432
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
433
433
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
434
|
-
border-top: $border-table;
|
|
435
|
-
border-right: $border-table;
|
|
436
|
-
border-left: $border-table;
|
|
434
|
+
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
435
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
436
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
.#{$module}-container {
|
|
440
|
-
border: $border-table;
|
|
440
|
+
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
441
441
|
border-right: 0;
|
|
442
442
|
border-bottom: 0;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.#{$module}-header {
|
|
446
446
|
&::-webkit-scrollbar {
|
|
447
|
-
border-right: $border-table;
|
|
447
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
.#{$module}-footer {
|
|
452
|
-
border-left: $border-table;
|
|
453
|
-
border-right: $border-table;
|
|
454
|
-
border-bottom: $border-table;
|
|
452
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
453
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
454
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
@@ -462,11 +462,11 @@ $module: #{$prefix}-table;
|
|
|
462
462
|
|
|
463
463
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
464
464
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
465
|
-
border-right: $border-table;
|
|
465
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
.#{$module}-placeholder {
|
|
469
|
-
border-right: $border-table;
|
|
469
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -478,7 +478,7 @@ $module: #{$prefix}-table;
|
|
|
478
478
|
font-size: #{$font-table_base-fontSize};
|
|
479
479
|
text-align: center;
|
|
480
480
|
background: $color-table_pl-bg-default;
|
|
481
|
-
border-bottom: $border-table;
|
|
481
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
482
482
|
border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
|
|
483
483
|
}
|
|
484
484
|
|
package/lib/es/table/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare function cloneDeep(value: any, customizer?: (v: any) => any): any;
|
|
2
1
|
export declare function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean): boolean;
|
|
3
2
|
export declare function getColumnKey(column: any, keyPropNames: any[]): any;
|
|
4
|
-
export declare function mergeColumns(oldColumns?: any[], newColumns?: any[], keyPropNames?: any[], deep?: boolean): any[];
|
|
5
3
|
/**
|
|
6
4
|
*
|
|
7
5
|
* @param {Array<number>} arr
|
|
@@ -80,7 +78,7 @@ export declare function mergeQueries(query: Record<string, any>, queries?: Recor
|
|
|
80
78
|
* @param {Object[]} columns columns retain the column width after resize
|
|
81
79
|
* @param {Object[]} newColumns
|
|
82
80
|
*/
|
|
83
|
-
export declare function withResizeWidth(columns: Record<string, any>[], newColumns: Record<string, any>[]): any;
|
|
81
|
+
export declare function withResizeWidth(columns: Record<string, any>[], newColumns: Record<string, any>[]): Record<string, any>[];
|
|
84
82
|
/**
|
|
85
83
|
* Pure function version of the same function in table foundation
|
|
86
84
|
* This is not accessible in getDerivedStateFromProps, so fork one out
|
package/lib/es/table/utils.js
CHANGED
|
@@ -4,36 +4,22 @@ import _includes from "lodash/includes";
|
|
|
4
4
|
import _some from "lodash/some";
|
|
5
5
|
import _findIndex from "lodash/findIndex";
|
|
6
6
|
import _each from "lodash/each";
|
|
7
|
-
import _clone from "lodash/clone";
|
|
8
|
-
import _map from "lodash/map";
|
|
9
7
|
import _find from "lodash/find";
|
|
10
8
|
import _filter from "lodash/filter";
|
|
11
9
|
import _get from "lodash/get";
|
|
12
10
|
import _isEqualWith from "lodash/isEqualWith";
|
|
13
|
-
import _cloneDeepWith from "lodash/cloneDeepWith";
|
|
14
11
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
15
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
16
12
|
import _everyInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/every";
|
|
17
13
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
18
14
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
19
15
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
20
16
|
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
21
17
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
18
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
22
19
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
|
|
23
20
|
import { strings, numbers } from './constants';
|
|
24
21
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
25
22
|
import Logger from '../utils/Logger';
|
|
26
|
-
export function cloneDeep(value, customizer) {
|
|
27
|
-
return _cloneDeepWith(value, v => {
|
|
28
|
-
if (typeof v === 'function') {
|
|
29
|
-
return v;
|
|
30
|
-
} else if (typeof customizer === 'function') {
|
|
31
|
-
return customizer(v);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return undefined;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
23
|
export function equalWith(value, other, customizer) {
|
|
38
24
|
return _isEqualWith(value, other, function (objVal, othVal) {
|
|
39
25
|
if (typeof objVal === 'function' && typeof othVal === 'function') {
|
|
@@ -68,29 +54,6 @@ export function getColumnKey(column, keyPropNames) {
|
|
|
68
54
|
|
|
69
55
|
return key;
|
|
70
56
|
}
|
|
71
|
-
export function mergeColumns() {
|
|
72
|
-
let oldColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
73
|
-
let newColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
74
|
-
let keyPropNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
75
|
-
let deep = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
76
|
-
const finalColumns = [];
|
|
77
|
-
const clone = deep ? cloneDeep : _clone;
|
|
78
|
-
|
|
79
|
-
_map(newColumns, newColumn => {
|
|
80
|
-
newColumn = _Object$assign({}, newColumn);
|
|
81
|
-
const key = getColumnKey(newColumn, keyPropNames);
|
|
82
|
-
|
|
83
|
-
const oldColumn = key != null && _find(oldColumns, item => getColumnKey(item, keyPropNames) === key);
|
|
84
|
-
|
|
85
|
-
if (oldColumn) {
|
|
86
|
-
finalColumns.push(clone(_Object$assign(_Object$assign({}, oldColumn), newColumn)));
|
|
87
|
-
} else {
|
|
88
|
-
finalColumns.push(clone(newColumn));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return finalColumns;
|
|
93
|
-
}
|
|
94
57
|
/**
|
|
95
58
|
*
|
|
96
59
|
* @param {Array<number>} arr
|
|
@@ -458,7 +421,7 @@ export function mergeQueries(query) {
|
|
|
458
421
|
*/
|
|
459
422
|
|
|
460
423
|
export function withResizeWidth(columns, newColumns) {
|
|
461
|
-
const _newColumns =
|
|
424
|
+
const _newColumns = [...newColumns];
|
|
462
425
|
|
|
463
426
|
for (const column of columns) {
|
|
464
427
|
if (!isNullOrUndefined(column.width)) {
|
|
@@ -80,9 +80,6 @@ $font-table_base-fontSize: 14px; // 表格默认文本字号
|
|
|
80
80
|
$border-table_base-borderStyle: solid; // 表格描边样式
|
|
81
81
|
$shadow-table_left: -3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 左侧
|
|
82
82
|
$shadow-table_right: 3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 右侧
|
|
83
|
-
$border-table: $width-table_base_border $border-table_base-borderStyle $color-table-border-default; // 表格默认描边
|
|
84
|
-
$border-table_head-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default; // 表头单元格描边 - 底部
|
|
85
|
-
$border-table_resizer: $width-table_resizer_border solid $color-table_resizer-bg-default; // 表格拉伸标识描边
|
|
86
83
|
|
|
87
84
|
$z-table-fixed: 101!default; // fixed列的zIndex值
|
|
88
85
|
$z-table_fixed_column: $z-table-fixed; // fixed列的zIndex值
|
|
@@ -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):
|
|
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: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("custom" | "auto")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"*.scss",
|
|
25
25
|
"*.css"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "680b7e5bb7e5c52474df556db3a72f65c0be28c0",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
30
30
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
package/table/mixin.scss
CHANGED
package/table/rtl.scss
CHANGED
|
@@ -19,7 +19,7 @@ $module: #{$prefix}-table;
|
|
|
19
19
|
|
|
20
20
|
&.resizing {
|
|
21
21
|
// rtl override mixin
|
|
22
|
-
border-left: $
|
|
22
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ $module: #{$prefix}-table;
|
|
|
28
28
|
border-right: 1px solid $color-table_shadow-border-default;
|
|
29
29
|
|
|
30
30
|
&.resizing {
|
|
31
|
-
border-left: $
|
|
31
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&[x-type="column-scrollbar"] {
|
|
@@ -40,7 +40,7 @@ $module: #{$prefix}-table;
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.resizing {
|
|
43
|
-
border-left: $
|
|
43
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.react-resizable-handle {
|
|
@@ -57,7 +57,7 @@ $module: #{$prefix}-table;
|
|
|
57
57
|
|
|
58
58
|
&.resizing {
|
|
59
59
|
border-right: 0;
|
|
60
|
-
border-left: $
|
|
60
|
+
border-left: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -112,17 +112,17 @@ $module: #{$prefix}-table;
|
|
|
112
112
|
&-bordered {
|
|
113
113
|
.#{$module}-container {
|
|
114
114
|
border-left: 0;
|
|
115
|
-
border-right: $border-table;
|
|
115
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
119
119
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
120
120
|
border-right: 0;
|
|
121
|
-
border-left: $border-table;
|
|
121
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.#{$module}-placeholder {
|
|
125
|
-
border-left: $border-table;
|
|
125
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
126
126
|
border-right: 0;
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ $module: #{$prefix}-table;
|
|
|
130
130
|
|
|
131
131
|
&::-webkit-scrollbar {
|
|
132
132
|
border-right: 0;
|
|
133
|
-
border-left: $border-table;
|
|
133
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
package/table/table.scss
CHANGED
|
@@ -60,7 +60,7 @@ $module: #{$prefix}-table;
|
|
|
60
60
|
|
|
61
61
|
&::-webkit-scrollbar {
|
|
62
62
|
background-color: transparent;
|
|
63
|
-
border-bottom: $border-
|
|
63
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
64
64
|
}
|
|
65
65
|
scrollbar-base-color: transparent;
|
|
66
66
|
}
|
|
@@ -91,7 +91,7 @@ $module: #{$prefix}-table;
|
|
|
91
91
|
color: $color-table_th-text-default;
|
|
92
92
|
font-weight: $font-weight-bold;
|
|
93
93
|
text-align: left;
|
|
94
|
-
border-bottom: $border-
|
|
94
|
+
border-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default;
|
|
95
95
|
padding-left: $spacing-table_row_head-paddingX;
|
|
96
96
|
padding-right: $spacing-table_row_head-paddingX;
|
|
97
97
|
padding-top: $spacing-table_row_head-paddingY;
|
|
@@ -223,14 +223,14 @@ $module: #{$prefix}-table;
|
|
|
223
223
|
word-break: break-all;
|
|
224
224
|
border-left: none;
|
|
225
225
|
border-right: none;
|
|
226
|
-
border-bottom: $border-table;
|
|
226
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
227
227
|
padding: $spacing-table_tbody_rowCell-padding;
|
|
228
228
|
box-sizing: border-box;
|
|
229
229
|
position: relative;
|
|
230
230
|
vertical-align: middle;
|
|
231
231
|
|
|
232
232
|
&.resizing {
|
|
233
|
-
border-right: $
|
|
233
|
+
border-right: $width-table_resizer_border solid $color-table_resizer-bg-default;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
&.#{$module}-row {
|
|
@@ -276,7 +276,7 @@ $module: #{$prefix}-table;
|
|
|
276
276
|
|
|
277
277
|
& > .#{$module}-row-cell {
|
|
278
278
|
background-color: $color-table_selection-bg-default;
|
|
279
|
-
border-bottom: $border-table;
|
|
279
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
& > .#{$module}-row-cell:not(.#{$module}-column-selection) {
|
|
@@ -431,27 +431,27 @@ $module: #{$prefix}-table;
|
|
|
431
431
|
.#{$module}-title {
|
|
432
432
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
433
433
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
434
|
-
border-top: $border-table;
|
|
435
|
-
border-right: $border-table;
|
|
436
|
-
border-left: $border-table;
|
|
434
|
+
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
435
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
436
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
.#{$module}-container {
|
|
440
|
-
border: $border-table;
|
|
440
|
+
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
441
441
|
border-right: 0;
|
|
442
442
|
border-bottom: 0;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.#{$module}-header {
|
|
446
446
|
&::-webkit-scrollbar {
|
|
447
|
-
border-right: $border-table;
|
|
447
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
.#{$module}-footer {
|
|
452
|
-
border-left: $border-table;
|
|
453
|
-
border-right: $border-table;
|
|
454
|
-
border-bottom: $border-table;
|
|
452
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
453
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
454
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
@@ -462,11 +462,11 @@ $module: #{$prefix}-table;
|
|
|
462
462
|
|
|
463
463
|
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
464
464
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
465
|
-
border-right: $border-table;
|
|
465
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
.#{$module}-placeholder {
|
|
469
|
-
border-right: $border-table;
|
|
469
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -478,7 +478,7 @@ $module: #{$prefix}-table;
|
|
|
478
478
|
font-size: #{$font-table_base-fontSize};
|
|
479
479
|
text-align: center;
|
|
480
480
|
background: $color-table_pl-bg-default;
|
|
481
|
-
border-bottom: $border-table;
|
|
481
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
482
482
|
border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
|
|
483
483
|
}
|
|
484
484
|
|
package/table/utils.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* eslint-disable no-param-reassign */
|
|
3
3
|
/* eslint-disable eqeqeq */
|
|
4
4
|
import {
|
|
5
|
-
cloneDeepWith,
|
|
6
5
|
isEqualWith,
|
|
7
6
|
get,
|
|
8
7
|
filter,
|
|
@@ -21,17 +20,6 @@ import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
|
21
20
|
import Logger from '../utils/Logger';
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
export function cloneDeep(value: any, customizer?: (v: any) => any) {
|
|
25
|
-
return cloneDeepWith(value, v => {
|
|
26
|
-
if (typeof v === 'function') {
|
|
27
|
-
return v;
|
|
28
|
-
} else if (typeof customizer === 'function') {
|
|
29
|
-
return customizer(v);
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
23
|
export function equalWith(value: any, other: any, customizer?: (...args: any[]) => boolean) {
|
|
36
24
|
return isEqualWith(value, other, (objVal, othVal, ...rest) => {
|
|
37
25
|
if (typeof objVal === 'function' && typeof othVal === 'function') {
|
|
@@ -61,31 +49,6 @@ export function getColumnKey(column: any, keyPropNames: any[]): any {
|
|
|
61
49
|
return key;
|
|
62
50
|
}
|
|
63
51
|
|
|
64
|
-
export function mergeColumns(oldColumns: any[] = [], newColumns: any[] = [], keyPropNames: any[] = null, deep = true) {
|
|
65
|
-
const finalColumns: any[] = [];
|
|
66
|
-
const clone = deep ? cloneDeep : lodashClone;
|
|
67
|
-
|
|
68
|
-
map(newColumns, newColumn => {
|
|
69
|
-
newColumn = { ...newColumn };
|
|
70
|
-
const key = getColumnKey(newColumn, keyPropNames);
|
|
71
|
-
|
|
72
|
-
const oldColumn = key != null && find(oldColumns, item => getColumnKey(item, keyPropNames) === key);
|
|
73
|
-
|
|
74
|
-
if (oldColumn) {
|
|
75
|
-
finalColumns.push(
|
|
76
|
-
clone({
|
|
77
|
-
...oldColumn,
|
|
78
|
-
...newColumn,
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
} else {
|
|
82
|
-
finalColumns.push(clone(newColumn));
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
return finalColumns;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
52
|
/**
|
|
90
53
|
*
|
|
91
54
|
* @param {Array<number>} arr
|
|
@@ -432,7 +395,7 @@ export function mergeQueries(query: Record<string, any>, queries: Record<string,
|
|
|
432
395
|
* @param {Object[]} newColumns
|
|
433
396
|
*/
|
|
434
397
|
export function withResizeWidth(columns: Record<string, any>[], newColumns: Record<string, any>[]) {
|
|
435
|
-
const _newColumns =
|
|
398
|
+
const _newColumns = [ ...newColumns ];
|
|
436
399
|
for (const column of columns) {
|
|
437
400
|
if (!isNullOrUndefined(column.width)) {
|
|
438
401
|
const currentColumn = column.key;
|
package/table/variables.scss
CHANGED
|
@@ -80,9 +80,6 @@ $font-table_base-fontSize: 14px; // 表格默认文本字号
|
|
|
80
80
|
$border-table_base-borderStyle: solid; // 表格描边样式
|
|
81
81
|
$shadow-table_left: -3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 左侧
|
|
82
82
|
$shadow-table_right: 3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动阴影 - 右侧
|
|
83
|
-
$border-table: $width-table_base_border $border-table_base-borderStyle $color-table-border-default; // 表格默认描边
|
|
84
|
-
$border-table_head-bottom: $width-table_header_border $border-table_base-borderStyle $color-table_th-border-default; // 表头单元格描边 - 底部
|
|
85
|
-
$border-table_resizer: $width-table_resizer_border solid $color-table_resizer-bg-default; // 表格拉伸标识描边
|
|
86
83
|
|
|
87
84
|
$z-table-fixed: 101!default; // fixed列的zIndex值
|
|
88
85
|
$z-table_fixed_column: $z-table-fixed; // fixed列的zIndex值
|