@king-design/intact 2.0.16 → 3.0.0-beta.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.
- package/components/button/styles.ts +4 -1
- package/components/card/styles.ts +3 -2
- package/components/checkbox/styles.ts +31 -6
- package/components/collapse/styles.ts +4 -1
- package/components/datepicker/styles.ts +3 -1
- package/components/dialog/base.vdt +4 -5
- package/components/dialog/styles.ts +18 -13
- package/components/drawer/styles.ts +20 -10
- package/components/dropdown/styles.ts +1 -1
- package/components/form/styles.ts +1 -1
- package/components/icon/demos/disabled.md +21 -0
- package/components/icon/demos/icons.md +87 -116
- package/components/icon/index.md +1 -0
- package/components/icon/index.ts +2 -0
- package/components/icon/index.vdt +6 -2
- package/components/icon/styles.ts +8 -1
- package/components/input/styles.ts +14 -20
- package/components/message/demos/basic.md +1 -1
- package/components/message/demos/duration.md +3 -3
- package/components/message/index.md +1 -1
- package/components/message/message.ts +2 -2
- package/components/message/message.vdt +6 -6
- package/components/message/styles.ts +10 -19
- package/components/pagination/index.vdt +9 -9
- package/components/pagination/styles.ts +11 -7
- package/components/radio/styles.ts +28 -9
- package/components/select/base.vdt +4 -5
- package/components/select/index.md +1 -1
- package/components/select/styles.ts +4 -27
- package/components/spinner/index.vdt +6 -4
- package/components/spinner/styles.ts +36 -36
- package/components/steps/demos/basic.md +2 -1
- package/components/steps/demos/clickable.md +6 -0
- package/components/steps/demos/error.md +25 -5
- package/components/steps/demos/line.md +7 -6
- package/components/steps/demos/simple.md +0 -6
- package/components/steps/index.md +1 -1
- package/components/steps/index.ts +4 -4
- package/components/steps/index.vdt +1 -0
- package/components/steps/step.vdt +16 -13
- package/components/steps/styles.ts +297 -259
- package/components/switch/demos/basic.md +1 -2
- package/components/switch/demos/disabled.md +20 -0
- package/components/switch/demos/onOff.md +5 -0
- package/components/switch/styles.ts +29 -37
- package/components/table/styles.ts +11 -6
- package/components/tabs/demos/basic.md +0 -1
- package/components/tabs/index.ts +2 -2
- package/components/tabs/index.vdt +3 -3
- package/components/tabs/styles.ts +202 -152
- package/components/tag/base.ts +1 -1
- package/components/tag/demos/border.md +2 -2
- package/components/tag/index.md +1 -1
- package/components/tag/styles.ts +12 -11
- package/components/tip/index.vdt +1 -3
- package/components/tip/styles.ts +8 -2
- package/components/tooltip/content.vdt +1 -1
- package/components/tooltip/styles.ts +8 -6
- package/components/transfer/index.vdt +3 -2
- package/components/transfer/styles.ts +1 -0
- package/components/transfer/useCheck.ts +9 -2
- package/components/upload/demos/manually.md +12 -13
- package/components/upload/index.vdt +40 -34
- package/components/upload/styles.ts +60 -64
- package/es/components/button/styles.js +2 -2
- package/es/components/card/styles.js +10 -2
- package/es/components/checkbox/styles.js +21 -10
- package/es/components/collapse/styles.js +6 -1
- package/es/components/datepicker/styles.d.ts +1 -1
- package/es/components/datepicker/styles.js +4 -1
- package/es/components/dialog/base.vdt.js +5 -6
- package/es/components/dialog/styles.js +16 -14
- package/es/components/drawer/styles.js +20 -5
- package/es/components/dropdown/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/index.d.ts +1 -0
- package/es/components/icon/index.js +2 -1
- package/es/components/icon/index.vdt.js +4 -2
- package/es/components/icon/styles.js +10 -2
- package/es/components/input/styles.js +1 -11
- package/es/components/message/message.js +1 -1
- package/es/components/message/message.vdt.js +7 -6
- package/es/components/message/styles.js +8 -8
- package/es/components/pagination/index.vdt.js +8 -8
- package/es/components/pagination/styles.js +11 -2
- package/es/components/radio/styles.js +16 -6
- package/es/components/select/base.vdt.js +5 -6
- package/es/components/select/styles.js +4 -24
- package/es/components/spinner/index.vdt.js +6 -4
- package/es/components/spinner/styles.js +33 -5
- package/es/components/steps/index.d.ts +2 -2
- package/es/components/steps/index.js +2 -2
- package/es/components/steps/index.vdt.js +1 -0
- package/es/components/steps/step.vdt.js +17 -8
- package/es/components/steps/styles.d.ts +1 -1
- package/es/components/steps/styles.js +80 -75
- package/es/components/switch/styles.js +20 -34
- package/es/components/table/styles.js +9 -4
- package/es/components/tabs/index.d.ts +1 -1
- package/es/components/tabs/index.js +1 -1
- package/es/components/tabs/index.vdt.js +1 -1
- package/es/components/tabs/styles.js +68 -22
- package/es/components/tag/base.js +1 -1
- package/es/components/tag/styles.js +15 -10
- package/es/components/tip/index.vdt.js +1 -3
- package/es/components/tip/styles.js +4 -3
- package/es/components/tooltip/content.vdt.js +4 -4
- package/es/components/tooltip/styles.js +12 -7
- package/es/components/transfer/index.vdt.js +3 -1
- package/es/components/transfer/styles.js +1 -1
- package/es/components/transfer/useCheck.d.ts +1 -0
- package/es/components/transfer/useCheck.js +8 -1
- package/es/components/upload/index.vdt.js +21 -20
- package/es/components/upload/styles.js +22 -30
- package/es/i18n/en-US.d.ts +2 -1
- package/es/i18n/en-US.js +2 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/icon/demos/disabled/index.js +18 -0
- package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/icon/demos/disabled/react.js +33 -0
- package/es/site/data/components/icon/demos/icons/index.js +1 -1
- package/es/site/data/components/icon/demos/icons/react.js +1 -1
- package/es/site/data/components/message/demos/duration/index.js +2 -2
- package/es/site/data/components/message/demos/duration/react.js +2 -2
- package/es/site/data/components/steps/demos/basic/react.js +1 -1
- package/es/site/data/components/steps/demos/clickable/react.js +15 -0
- package/es/site/data/components/steps/demos/error/react.js +22 -2
- package/es/site/data/components/steps/demos/line/react.js +15 -11
- package/es/site/data/components/steps/demos/simple/react.js +1 -11
- package/es/site/data/components/switch/demos/basic/react.js +0 -2
- package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/switch/demos/disabled/index.js +18 -0
- package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/switch/demos/disabled/react.js +27 -0
- package/es/site/data/components/switch/demos/onOff/react.js +13 -0
- package/es/site/data/components/tag/demos/border/index.js +1 -1
- package/es/site/data/components/tag/demos/border/react.js +1 -1
- package/es/site/data/components/upload/demos/manually/react.js +5 -7
- package/es/site/src/pages/document/index.js +3 -2
- package/es/site/src/pages/document/styles.js +1 -1
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +189 -369
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/theme.d.ts +10 -2
- package/es/styles/theme.js +23 -21
- package/i18n/en-US.ts +2 -1
- package/index.ts +2 -2
- package/package.json +2 -1
- package/styles/fonts/iconfont.css +172 -289
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ts +255 -369
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/theme.ts +23 -19
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
import {css} from '@emotion/css';
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
|
-
import {deepDefaults, sizes} from '../../styles/utils';
|
|
3
|
+
import {deepDefaults, sizes, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
|
|
6
6
|
const defaults = {
|
|
7
7
|
get transition() { return theme.transition.middle },
|
|
8
|
-
bgColor
|
|
8
|
+
get bgColor() { return theme.color.border },
|
|
9
9
|
fontSize: `12px`,
|
|
10
|
-
|
|
11
|
-
checkedBgColor: `#fff`,
|
|
10
|
+
color: '#fff',
|
|
12
11
|
handleBorderRadius: `100%`,
|
|
13
|
-
|
|
14
|
-
get border() { return `1px solid ${theme.color.border}` },
|
|
12
|
+
handleBgColor: '#fff',
|
|
15
13
|
|
|
16
14
|
// checked
|
|
17
15
|
checked: {
|
|
18
|
-
get borderColor() { return theme.color.primary },
|
|
19
|
-
get color() { return theme.color.primary },
|
|
20
16
|
get bgColor() { return theme.color.primary },
|
|
17
|
+
get disabledBgColor() {
|
|
18
|
+
return palette(theme.color.primary, -3);
|
|
19
|
+
}
|
|
21
20
|
},
|
|
22
21
|
|
|
23
22
|
// default
|
|
24
23
|
default: {
|
|
25
|
-
width: `
|
|
26
|
-
height: `
|
|
27
|
-
padding: `
|
|
24
|
+
width: `45px`,
|
|
25
|
+
height: `24px`,
|
|
26
|
+
padding: `3px`,
|
|
28
27
|
},
|
|
29
28
|
|
|
30
29
|
// large
|
|
31
30
|
large: {
|
|
32
|
-
width: `
|
|
33
|
-
height: `
|
|
34
|
-
padding: `
|
|
31
|
+
width: `58px`,
|
|
32
|
+
height: `30px`,
|
|
33
|
+
padding: `3px`,
|
|
35
34
|
},
|
|
36
35
|
|
|
37
36
|
// small
|
|
38
37
|
small: {
|
|
39
|
-
width: `
|
|
38
|
+
width: `30px`,
|
|
40
39
|
height: `16px`,
|
|
41
40
|
padding: `2px`,
|
|
42
41
|
},
|
|
43
42
|
|
|
44
43
|
// mini
|
|
45
44
|
mini: {
|
|
46
|
-
width: `
|
|
47
|
-
height: `
|
|
45
|
+
width: `18px`,
|
|
46
|
+
height: `10px`,
|
|
48
47
|
padding: `1px`,
|
|
49
48
|
},
|
|
50
49
|
|
|
@@ -66,7 +65,6 @@ export function makeStyles() {
|
|
|
66
65
|
cursor: pointer;
|
|
67
66
|
user-select: none;
|
|
68
67
|
overflow: hidden;
|
|
69
|
-
border: ${kswitch.border};
|
|
70
68
|
box-sizing: content-box;
|
|
71
69
|
input {
|
|
72
70
|
opacity: 0;
|
|
@@ -119,13 +117,12 @@ export function makeStyles() {
|
|
|
119
117
|
&.k-dragging {
|
|
120
118
|
.k-switch-bar,
|
|
121
119
|
.k-switch-wrapper {
|
|
122
|
-
background: ${kswitch.
|
|
120
|
+
background: ${kswitch.checked.bgColor};
|
|
123
121
|
transition: background ${kswitch.transition};
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
&:focus {
|
|
127
125
|
outline: none;
|
|
128
|
-
border-color: ${kswitch.checked.borderColor};
|
|
129
126
|
}
|
|
130
127
|
|
|
131
128
|
// size
|
|
@@ -164,16 +161,9 @@ export function makeStyles() {
|
|
|
164
161
|
|
|
165
162
|
// checked
|
|
166
163
|
&.k-checked {
|
|
167
|
-
border-color: ${kswitch.checked.borderColor};
|
|
168
|
-
.k-switch-on {
|
|
169
|
-
color: ${kswitch.checked.color};
|
|
170
|
-
}
|
|
171
|
-
.k-switch-handle {
|
|
172
|
-
background: ${kswitch.checked.bgColor};
|
|
173
|
-
}
|
|
174
164
|
.k-switch-bar,
|
|
175
165
|
.k-switch-wrapper {
|
|
176
|
-
background: ${kswitch.
|
|
166
|
+
background: ${kswitch.checked.bgColor};
|
|
177
167
|
}
|
|
178
168
|
.k-switch-bar {
|
|
179
169
|
width: 100%;
|
|
@@ -182,19 +172,21 @@ export function makeStyles() {
|
|
|
182
172
|
|
|
183
173
|
// disabled
|
|
184
174
|
&.k-disabled {
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
&,
|
|
176
|
+
.k-switch-handle {
|
|
177
|
+
cursor: not-allowed;
|
|
178
|
+
}
|
|
179
|
+
&,
|
|
187
180
|
.k-switch-bar,
|
|
188
181
|
.k-switch-wrapper {
|
|
189
182
|
background: ${kswitch.disabledBgColor};
|
|
190
183
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
border-bottom-right-radius: 0;
|
|
184
|
+
&.k-checked {
|
|
185
|
+
&,
|
|
186
|
+
.k-switch-bar,
|
|
187
|
+
.k-switch-wrapper {
|
|
188
|
+
background: ${kswitch.checked.disabledBgColor};
|
|
189
|
+
}
|
|
198
190
|
}
|
|
199
191
|
}
|
|
200
192
|
`;
|
|
@@ -6,7 +6,8 @@ import '../../styles/global';
|
|
|
6
6
|
const defaults = {
|
|
7
7
|
get transition() { return theme.transition.large },
|
|
8
8
|
// transition: '15000s',
|
|
9
|
-
border: `1px solid #
|
|
9
|
+
border: `1px solid #e2e5e8`,
|
|
10
|
+
get borderRadius() { return theme.borderRadius },
|
|
10
11
|
fontSize: `12px`,
|
|
11
12
|
bgColor: `#fff`,
|
|
12
13
|
get color() { return theme.color.text },
|
|
@@ -20,7 +21,7 @@ const defaults = {
|
|
|
20
21
|
fontSize: `12px`,
|
|
21
22
|
fontWeight: `bold`,
|
|
22
23
|
textAlign: 'left',
|
|
23
|
-
height: `
|
|
24
|
+
height: `40px`,
|
|
24
25
|
delimiterHeight: '12px',
|
|
25
26
|
delimiterColor: '#bfbfbf',
|
|
26
27
|
},
|
|
@@ -49,7 +50,7 @@ const defaults = {
|
|
|
49
50
|
sort: {
|
|
50
51
|
iconHeight: `7px`,
|
|
51
52
|
gap: `10px`,
|
|
52
|
-
color: `#
|
|
53
|
+
color: `#d0d5d9`,
|
|
53
54
|
disabledColor: `#ddd`,
|
|
54
55
|
},
|
|
55
56
|
|
|
@@ -76,19 +77,18 @@ export function makeStyles() {
|
|
|
76
77
|
return css`
|
|
77
78
|
font-size: ${table.fontSize};
|
|
78
79
|
color: ${table.color};
|
|
79
|
-
border-top: ${table.border};
|
|
80
80
|
position: relative;
|
|
81
81
|
z-index: 0;
|
|
82
82
|
.k-table-wrapper {
|
|
83
83
|
border-bottom: ${table.border};
|
|
84
84
|
overflow: auto;
|
|
85
|
+
border-radius: ${table.borderRadius};
|
|
85
86
|
}
|
|
86
87
|
table {
|
|
87
88
|
width: 100%;
|
|
88
89
|
// border-collapse: collapse;
|
|
89
90
|
border-spacing: 0;
|
|
90
91
|
table-layout: fixed;
|
|
91
|
-
|
|
92
92
|
td,
|
|
93
93
|
th{
|
|
94
94
|
transition: all ${table.transition};
|
|
@@ -105,12 +105,16 @@ export function makeStyles() {
|
|
|
105
105
|
z-index: 2;
|
|
106
106
|
tr {
|
|
107
107
|
height: ${table.thead.height};
|
|
108
|
+
&:not(:last-of-type) th {
|
|
109
|
+
border-bottom: ${table.border};
|
|
110
|
+
}
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
th {
|
|
111
114
|
padding: ${table.thead.padding};
|
|
112
115
|
position: relative;
|
|
113
116
|
background: ${table.thead.bgColor};
|
|
117
|
+
line-height: normal;
|
|
114
118
|
&:before {
|
|
115
119
|
content: '';
|
|
116
120
|
height: ${table.thead.delimiterHeight};
|
|
@@ -124,12 +128,12 @@ export function makeStyles() {
|
|
|
124
128
|
&:first-of-type:before {
|
|
125
129
|
display: none;
|
|
126
130
|
}
|
|
127
|
-
border-bottom: ${table.border};
|
|
128
131
|
}
|
|
129
132
|
.k-table-title {
|
|
130
133
|
display: inline-flex;
|
|
131
134
|
align-items: center;
|
|
132
135
|
max-width: 100%;
|
|
136
|
+
color: ${theme.color.lightBlack};
|
|
133
137
|
}
|
|
134
138
|
.k-table-title-text {
|
|
135
139
|
flex: 1;
|
|
@@ -213,6 +217,7 @@ export function makeStyles() {
|
|
|
213
217
|
&.k-border,
|
|
214
218
|
&.k-grid {
|
|
215
219
|
.k-table-wrapper {
|
|
220
|
+
border-top: ${table.border};
|
|
216
221
|
border-left: ${table.border};
|
|
217
222
|
border-right: ${table.border};
|
|
218
223
|
}
|
package/components/tabs/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface TabsProps<T = any> {
|
|
|
12
12
|
value?: T
|
|
13
13
|
vertical?: boolean
|
|
14
14
|
size?: Sizes
|
|
15
|
-
type?: 'default' | 'card' | 'border-card' | 'no-border-card'
|
|
15
|
+
type?: 'default' | 'card' | 'border-card' | 'no-border-card' | 'flat-card'
|
|
16
16
|
closable?: boolean
|
|
17
17
|
beforeChange?: (value: T) => boolean | Promise<boolean>
|
|
18
18
|
}
|
|
@@ -25,7 +25,7 @@ const typeDefs: Required<TypeDefs<TabsProps>> = {
|
|
|
25
25
|
value: null,
|
|
26
26
|
vertical: Boolean,
|
|
27
27
|
size: sizes,
|
|
28
|
-
type: ['default', 'card', 'border-card', 'no-border-card'],
|
|
28
|
+
type: ['default', 'card', 'border-card', 'no-border-card','flat-card'],
|
|
29
29
|
closable: Boolean,
|
|
30
30
|
beforeChange: Function,
|
|
31
31
|
};
|
|
@@ -9,10 +9,10 @@ const {
|
|
|
9
9
|
} = this.scroll;
|
|
10
10
|
const classNameObj = {
|
|
11
11
|
'k-tabs': true,
|
|
12
|
-
[`k-${size}`]: size,
|
|
12
|
+
[`k-size-${size}`]: size,
|
|
13
13
|
'k-vertical': vertical,
|
|
14
|
-
'k-tabs-card': type === 'no-border-card',
|
|
15
|
-
[`k-
|
|
14
|
+
/* 'k-tabs-card': type === 'no-border-card', */
|
|
15
|
+
[`k-type-${type}`]: true,
|
|
16
16
|
[`k-is-scroll`]: isScroll.value,
|
|
17
17
|
[className]: className,
|
|
18
18
|
[makeStyles()]: true,
|
|
@@ -23,24 +23,21 @@ const defaults = deepDefaults(
|
|
|
23
23
|
get borderColor() { return theme.color.border },
|
|
24
24
|
borderWidth: '1px',
|
|
25
25
|
get border() { return `${tabs.borderWidth} solid ${tabs.borderColor}` },
|
|
26
|
-
margin: `0 10px`,
|
|
27
26
|
get color() { return theme.color.text },
|
|
28
|
-
|
|
27
|
+
closeGap: `8px`,
|
|
29
28
|
|
|
30
|
-
//
|
|
31
|
-
|
|
29
|
+
// scroll
|
|
30
|
+
navigatorWidth: `20px`,
|
|
32
31
|
|
|
33
32
|
//active
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
active: {
|
|
34
|
+
get color() { return theme.color.primary },
|
|
35
|
+
bar: {
|
|
36
|
+
height: '2px',
|
|
37
|
+
get bgColor() { return theme.color.primary },
|
|
38
|
+
}
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
-
// scroll
|
|
42
|
-
navigatorWidth: `20px`,
|
|
43
|
-
|
|
44
41
|
// border-card
|
|
45
42
|
borderCard: {
|
|
46
43
|
get bgColor() { return theme.color.bg },
|
|
@@ -49,14 +46,23 @@ const defaults = deepDefaults(
|
|
|
49
46
|
// no-border-card
|
|
50
47
|
noBorderCard: {
|
|
51
48
|
get bgColor() { return theme.color.bg },
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// define size
|
|
52
|
+
size: {
|
|
53
|
+
large: {
|
|
54
|
+
padding: '24px',
|
|
55
|
+
},
|
|
56
|
+
default: {
|
|
57
|
+
padding: '16px',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
54
60
|
},
|
|
55
61
|
sizes.reduce((memo, size) => {
|
|
56
62
|
memo[size] = {
|
|
57
63
|
get fontSize() { return theme[size].fontSize },
|
|
58
64
|
get height() { return theme[size].height },
|
|
59
|
-
get padding() { return `0 ${theme[size].padding}` },
|
|
65
|
+
get padding() { return `0 ${tabs.size[size as keyof typeof tabs.size]?.padding || theme[size].padding}` },
|
|
60
66
|
get closeFontSize() { return closeFontSizeMap[size] },
|
|
61
67
|
};
|
|
62
68
|
|
|
@@ -71,11 +77,35 @@ setDefault(() => {
|
|
|
71
77
|
|
|
72
78
|
export function makeStyles() {
|
|
73
79
|
return css`
|
|
74
|
-
|
|
80
|
+
${makeCommonStyles()};
|
|
81
|
+
${makeScrollStyles()};
|
|
82
|
+
|
|
83
|
+
&.k-type-default {
|
|
84
|
+
${makeDefaultStyles()}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.k-type-card {
|
|
88
|
+
${makeDefaultStyles()}
|
|
89
|
+
${makeCardStyles()};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.k-type-border-card {
|
|
93
|
+
${makeBorderCardStyles()};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.k-type-no-border-card {
|
|
97
|
+
${makeNoBorderCardStyles()};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function makeCommonStyles() {
|
|
104
|
+
const active = tabs.active;
|
|
105
|
+
const bar = active.bar;
|
|
106
|
+
return css`
|
|
75
107
|
position: relative;
|
|
76
|
-
line-height: 1;
|
|
77
108
|
.k-tab {
|
|
78
|
-
margin: ${tabs.margin};
|
|
79
109
|
cursor: pointer;
|
|
80
110
|
display: inline-block;
|
|
81
111
|
text-align: center;
|
|
@@ -87,7 +117,7 @@ export function makeStyles() {
|
|
|
87
117
|
text-overflow: ellipsis;
|
|
88
118
|
&:hover,
|
|
89
119
|
&.k-active {
|
|
90
|
-
color: ${
|
|
120
|
+
color: ${active.color};
|
|
91
121
|
}
|
|
92
122
|
&.k-disabled {
|
|
93
123
|
color: ${theme.color.disabled};
|
|
@@ -95,10 +125,11 @@ export function makeStyles() {
|
|
|
95
125
|
}
|
|
96
126
|
}
|
|
97
127
|
.k-tab-close {
|
|
98
|
-
margin-right: -${tabs.
|
|
99
|
-
margin-left: ${tabs.
|
|
128
|
+
margin-right: -${tabs.closeGap};
|
|
129
|
+
margin-left: ${tabs.closeGap};
|
|
100
130
|
position: relative;
|
|
101
131
|
top: -1px;
|
|
132
|
+
color:${theme.color.lightBlack};
|
|
102
133
|
}
|
|
103
134
|
|
|
104
135
|
// active-bar
|
|
@@ -106,138 +137,48 @@ export function makeStyles() {
|
|
|
106
137
|
transition: all ${tabs.transition};
|
|
107
138
|
position: absolute;
|
|
108
139
|
left: 0;
|
|
109
|
-
height: ${
|
|
110
|
-
background: ${
|
|
111
|
-
bottom: calc(-${
|
|
140
|
+
height: ${bar.height};
|
|
141
|
+
background: ${bar.bgColor};
|
|
142
|
+
bottom: calc(-${bar.height} / 2);
|
|
112
143
|
}
|
|
113
144
|
|
|
114
145
|
// vertical
|
|
115
146
|
&.k-vertical {
|
|
116
147
|
display: inline-block;
|
|
117
|
-
border-bottom: none;
|
|
118
|
-
border-right: ${tabs.border};
|
|
119
148
|
.k-tab {
|
|
120
149
|
display: block;
|
|
121
|
-
margin: 0;
|
|
122
|
-
padding: ${tabs.verticalPadding};
|
|
123
150
|
}
|
|
124
151
|
.k-tabs-active-bar {
|
|
125
152
|
left: auto;
|
|
126
153
|
top: 0;
|
|
127
|
-
right: calc(-${
|
|
128
|
-
width: ${
|
|
154
|
+
right: calc(-${bar.height} / 2);
|
|
155
|
+
width: ${bar.height};
|
|
129
156
|
height: auto;
|
|
130
157
|
}
|
|
131
158
|
}
|
|
132
159
|
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
content: '';
|
|
147
|
-
display: block;
|
|
148
|
-
position: absolute;
|
|
149
|
-
height: ${tabs.highlight.height};
|
|
150
|
-
background: ${theme.color.primary};
|
|
151
|
-
top: 0;
|
|
152
|
-
left: -${tabs.borderWidth};
|
|
153
|
-
right: -${tabs.borderWidth};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// vertical card
|
|
158
|
-
&.k-vertical {
|
|
159
|
-
.k-tabs-active-bar {
|
|
160
|
-
left: 0;
|
|
161
|
-
width: auto;
|
|
162
|
-
border-left: none;
|
|
163
|
-
border-right: none;
|
|
164
|
-
border-top: ${tabs.border};
|
|
165
|
-
border-bottom: ${tabs.border};
|
|
166
|
-
&:before {
|
|
167
|
-
width: ${tabs.highlight.height};
|
|
168
|
-
left: 0;
|
|
169
|
-
right: auto;
|
|
170
|
-
bottom: 0;
|
|
171
|
-
height: auto;
|
|
160
|
+
// size
|
|
161
|
+
${sizes.map(size => {
|
|
162
|
+
const styles = tabs[size];
|
|
163
|
+
return `
|
|
164
|
+
&.k-size-${size} {
|
|
165
|
+
.k-tab {
|
|
166
|
+
font-size: ${styles.fontSize};
|
|
167
|
+
height: ${styles.height};
|
|
168
|
+
line-height: ${styles.height};
|
|
169
|
+
padding: ${styles.padding};
|
|
170
|
+
}
|
|
171
|
+
.k-tab-close .k-icon {
|
|
172
|
+
font-size: ${styles.closeFontSize};
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
&.k-tabs-border-card {
|
|
179
|
-
border: ${tabs.border};
|
|
180
|
-
border-bottom: none;
|
|
181
|
-
background: ${tabs.borderCard.bgColor};
|
|
182
|
-
.k-tab {
|
|
183
|
-
margin: 0;
|
|
184
|
-
}
|
|
185
|
-
.k-tabs-active-bar {
|
|
186
|
-
background: #fff;
|
|
187
|
-
top: 0;
|
|
188
|
-
height: auto;
|
|
189
|
-
z-index: -1;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
&.k-vertical {
|
|
193
|
-
border-right: none;
|
|
194
|
-
border-bottom: ${tabs.border};
|
|
195
|
-
.k-tabs-active-bar {
|
|
196
|
-
width: auto;
|
|
197
|
-
height: 0;
|
|
198
|
-
left: 0;
|
|
199
|
-
bottom: 0;
|
|
200
|
-
right: 0;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// no-border-card
|
|
206
|
-
&.k-tabs-no-border-card {
|
|
207
|
-
border-bottom: none;
|
|
208
|
-
.k-tab {
|
|
209
|
-
margin-right: ${tabs.noBorderCard.gutter};
|
|
210
|
-
&:before {
|
|
211
|
-
content: '';
|
|
212
|
-
display: block;
|
|
213
|
-
position: absolute;
|
|
214
|
-
background: ${tabs.noBorderCard.bgColor};
|
|
215
|
-
top: 0;
|
|
216
|
-
bottom: 0;
|
|
217
|
-
left: 0;
|
|
218
|
-
right: 0;
|
|
219
|
-
z-index: -1;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
.k-tabs-acitve-bar {
|
|
223
|
-
border: none;
|
|
224
|
-
&:before {
|
|
225
|
-
left: 0;
|
|
226
|
-
right: 0;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
&.k-vertical {
|
|
230
|
-
border-right: none;
|
|
231
|
-
.k-tab:not(:first-of-type) {
|
|
232
|
-
margin: ${tabs.noBorderCard.gutter} 0 0;
|
|
233
|
-
}
|
|
234
|
-
.k-tabs-active-bar {
|
|
235
|
-
border: none;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
175
|
+
`
|
|
176
|
+
})}
|
|
177
|
+
`
|
|
178
|
+
}
|
|
239
179
|
|
|
240
|
-
|
|
180
|
+
function makeScrollStyles() {
|
|
181
|
+
return css`
|
|
241
182
|
&:not(.k-vertical) {
|
|
242
183
|
.k-tabs-scroll {
|
|
243
184
|
overflow: hidden;
|
|
@@ -274,23 +215,132 @@ export function makeStyles() {
|
|
|
274
215
|
padding: 0 ${tabs.navigatorWidth};
|
|
275
216
|
}
|
|
276
217
|
}
|
|
218
|
+
`
|
|
219
|
+
}
|
|
277
220
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
221
|
+
function makeDefaultStyles() {
|
|
222
|
+
return css`
|
|
223
|
+
border-bottom: ${tabs.border};
|
|
224
|
+
&.k-vertical {
|
|
225
|
+
border-bottom: none;
|
|
226
|
+
border-right: ${tabs.border};
|
|
227
|
+
}
|
|
228
|
+
`
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function makeCardActiveBarCommonStyles() {
|
|
232
|
+
return css`
|
|
233
|
+
background: #fff;
|
|
234
|
+
top: 0;
|
|
235
|
+
height: auto;
|
|
236
|
+
z-index: -1;
|
|
237
|
+
`
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function makeCardStyles() {
|
|
241
|
+
return css`
|
|
242
|
+
.k-tab {
|
|
243
|
+
margin: 0;
|
|
244
|
+
}
|
|
245
|
+
.k-tabs-active-bar {
|
|
246
|
+
${makeCardActiveBarCommonStyles()};
|
|
247
|
+
border-left: ${tabs.border};
|
|
248
|
+
border-right: ${tabs.border};
|
|
249
|
+
&:before {
|
|
250
|
+
content: '';
|
|
251
|
+
display: block;
|
|
252
|
+
position: absolute;
|
|
253
|
+
height: ${tabs.active.bar.height};
|
|
254
|
+
background: ${theme.color.primary};
|
|
255
|
+
top: 0;
|
|
256
|
+
left: -${tabs.borderWidth};
|
|
257
|
+
right: -${tabs.borderWidth};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// vertical card
|
|
262
|
+
&.k-vertical {
|
|
263
|
+
.k-tabs-active-bar {
|
|
264
|
+
left: 0;
|
|
265
|
+
width: auto;
|
|
266
|
+
border-left: none;
|
|
267
|
+
border-right: none;
|
|
268
|
+
border-top: ${tabs.border};
|
|
269
|
+
border-bottom: ${tabs.border};
|
|
270
|
+
&:before {
|
|
271
|
+
width: ${tabs.active.bar.height};
|
|
272
|
+
left: 0;
|
|
273
|
+
right: auto;
|
|
274
|
+
bottom: 0;
|
|
275
|
+
height: auto;
|
|
292
276
|
}
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
`
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function makeBorderCardStyles() {
|
|
283
|
+
return css`
|
|
284
|
+
border: ${tabs.border};
|
|
285
|
+
border-bottom: none;
|
|
286
|
+
background: ${tabs.borderCard.bgColor};
|
|
287
|
+
.k-tab {
|
|
288
|
+
margin: 0;
|
|
289
|
+
}
|
|
290
|
+
.k-tabs-active-bar {
|
|
291
|
+
background: #fff;
|
|
292
|
+
top: 0;
|
|
293
|
+
height: auto;
|
|
294
|
+
z-index: -1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
&.k-vertical {
|
|
298
|
+
border-right: none;
|
|
299
|
+
border-bottom: ${tabs.border};
|
|
300
|
+
.k-tabs-active-bar {
|
|
301
|
+
width: auto;
|
|
302
|
+
height: 0;
|
|
303
|
+
left: 0;
|
|
304
|
+
bottom: 0;
|
|
305
|
+
right: 0;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
`
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function makeNoBorderCardStyles() {
|
|
312
|
+
return css`
|
|
313
|
+
border-radius: ${theme.borderRadius};
|
|
314
|
+
.k-tab {
|
|
315
|
+
&:before {
|
|
316
|
+
content: '';
|
|
317
|
+
display: block;
|
|
318
|
+
position: absolute;
|
|
319
|
+
background: ${tabs.noBorderCard.bgColor};
|
|
320
|
+
top: 0;
|
|
321
|
+
bottom: 0;
|
|
322
|
+
left: 0;
|
|
323
|
+
right: 0;
|
|
324
|
+
z-index: -1;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
.k-tabs-active-bar {
|
|
328
|
+
background: #fff;
|
|
329
|
+
top: 0;
|
|
330
|
+
height: auto;
|
|
331
|
+
z-index: -1;
|
|
332
|
+
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.08);
|
|
333
|
+
border-radius: 4px 4px 0px 0px;
|
|
334
|
+
}
|
|
335
|
+
&.k-vertical {
|
|
336
|
+
border-right: none;
|
|
337
|
+
.k-tabs-active-bar {
|
|
338
|
+
width: auto;
|
|
339
|
+
height: 0;
|
|
340
|
+
left: 0;
|
|
341
|
+
bottom: 0;
|
|
342
|
+
right: 0;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`
|
|
296
346
|
}
|