-
Notifications
You must be signed in to change notification settings - Fork 95
/
SIMPLIFY.ts
78 lines (74 loc) · 1.99 KB
/
SIMPLIFY.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*eslint no-bitwise:0*/
import type { ITableThemeDefine, StylePropertyFunctionArg } from '../ts-types';
function getFrozenRowsBorderColor(args: StylePropertyFunctionArg): string[] {
const {
row,
table: { frozenRowCount }
} = args;
if (frozenRowCount - 1 === row) {
return ['#f2f2f2', '#f2f2f2', '#ccc7c7', '#f2f2f2'];
}
return ['#f2f2f2'];
}
function getBorderColor(args: StylePropertyFunctionArg): (string | null)[] {
const { col, table } = args;
const { colCount, frozenColCount } = table;
const top: string | null = '#ccc7c7';
const bottom: string | null = '#ccc7c7';
// if (recordRowCount > 1) {
// const startRow = table.getRecordStartRowByRecordIndex(row);
// const endRow = startRow + recordRowCount - 1;
// if (startRow !== row) {
// top = null;
// }
// if (endRow !== row) {
// bottom = null;
// }
// }
if (frozenColCount - 1 === col) {
return [top, '#f2f2f2', bottom, null];
}
if (colCount - 1 === col) {
return [top, '#f2f2f2', bottom, null];
}
return [top, null, bottom, null];
}
/**
* material design theme
* @name SIMPLIFY
* @memberof VTable.themes.choices
*/
export default {
// selectionBgColor: '#CCE0FF',
underlayBackgroundColor: '#FFF',
defaultStyle: {
borderColor: getBorderColor,
// click: { cellBorderColor: '#FD5', cellBgColor: '#6FA8DC' },
hover: { cellBorderColor: '#0000FF', cellBgColor: '#D0E0E3' },
bgColor: '#FFF'
},
headerStyle: {
color: 'rgba(0, 0, 0, 0.87)',
borderColor: getFrozenRowsBorderColor
},
bodyStyle: {
// rowsBgColor:'#FFF',
color: 'rgba(0, 0, 0, 0.87)'
},
frameStyle: {
borderColor: '#f2f2f2',
borderLineWidth: 1
},
columnResize: {
lineWidth: 1,
lineColor: '#416EFF',
bgColor: '#D9E2FF'
},
selectionStyle: { cellBorderColor: '#FD5', cellBgColor: 'rgba(111, 168, 220, 0.1)' },
tooltipStyle: {
bgColor: '#FFF',
color: '#000',
fontSize: 12,
fontFamily: 'Arial,sans-serif'
}
} as ITableThemeDefine;