@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
|
@@ -4,75 +4,59 @@ import {deepDefaults} from '../../styles/utils';
|
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
|
|
6
6
|
const defaults = {
|
|
7
|
-
|
|
8
|
-
get
|
|
9
|
-
get
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
gap: '10px',
|
|
8
|
+
get titleColor() { return theme.color.title },
|
|
9
|
+
get desColor() { return theme.color.lightBlack },
|
|
10
|
+
get markColor() { return theme.color.placeholder },
|
|
11
|
+
get markborder() { return `1px solid ${theme.color.placeholder}` },
|
|
12
|
+
markBgColor: '#fff',
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
iconFontSize: '24px',
|
|
18
|
-
paddingRight: '10px',
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
main: {
|
|
22
|
-
get color() { return theme.color.text },
|
|
23
|
-
get titlePaddingRight() { return steps.head.paddingRight },
|
|
24
|
-
contentFontSize: '12px',
|
|
14
|
+
default: {
|
|
15
|
+
get height() { return theme.default.height },
|
|
16
|
+
get bgColor() { return theme.color.bg },
|
|
17
|
+
markWidth: '16px',
|
|
25
18
|
},
|
|
26
19
|
|
|
27
20
|
// done
|
|
28
21
|
done: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
get simpleColor() { return theme.color.text },
|
|
22
|
+
get markColor() { return theme.color.primary },
|
|
23
|
+
get markBorderColor() { return theme.color.primary },
|
|
24
|
+
markBgColor: '#fff',
|
|
25
|
+
get mainColor() { return theme.color.primary },
|
|
34
26
|
},
|
|
35
27
|
|
|
36
28
|
// active
|
|
37
29
|
active: {
|
|
38
|
-
|
|
39
|
-
get
|
|
40
|
-
get
|
|
30
|
+
markColor: '#fff',
|
|
31
|
+
get markBorderColor() { return theme.color.primary },
|
|
32
|
+
get markBgColor() { return theme.color.primary },
|
|
41
33
|
get mainColor() { return theme.color.primary },
|
|
42
|
-
get simpleColor() { return theme.color.primary },
|
|
43
34
|
},
|
|
44
35
|
|
|
45
36
|
// error
|
|
46
37
|
error: {
|
|
47
|
-
get
|
|
48
|
-
get
|
|
49
|
-
|
|
38
|
+
get markColor() { return theme.color.danger },
|
|
39
|
+
get markBorderColor() { return theme.color.danger },
|
|
40
|
+
markBgColor: '#fff',
|
|
50
41
|
get mainColor() { return theme.color.danger },
|
|
51
|
-
get simpleColor() { return theme.color.danger },
|
|
52
42
|
},
|
|
53
43
|
|
|
54
44
|
// line
|
|
55
45
|
line: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
get
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
innerFontSize: '18px',
|
|
63
|
-
headTop: '16px',
|
|
64
|
-
titleFontSize: '14px',
|
|
65
|
-
titleGopTop: '16px',
|
|
66
|
-
iconLineHeight: '30px',
|
|
67
|
-
tailTop: '16px',
|
|
68
|
-
width: '160px',
|
|
46
|
+
markWidth: '32px',
|
|
47
|
+
markFontSize: '24px',
|
|
48
|
+
get lineColor() { return theme.color.border},
|
|
49
|
+
titleGap: '16px',
|
|
50
|
+
descGap: '4px',
|
|
51
|
+
contentMaxWidth: '200px',
|
|
69
52
|
},
|
|
70
53
|
|
|
71
54
|
// simple
|
|
72
55
|
simple: {
|
|
73
|
-
|
|
74
|
-
get
|
|
75
|
-
|
|
56
|
+
markWidth: '12px',
|
|
57
|
+
get markBgColor() { return theme.color.placeholder },
|
|
58
|
+
get doneMarkBgColor() { return theme.color.primary },
|
|
59
|
+
get errorMarkBgColor() { return theme.color.danger },
|
|
76
60
|
}
|
|
77
61
|
};
|
|
78
62
|
|
|
@@ -86,256 +70,310 @@ const stepStatus = ['done', 'active', 'error'] as const;
|
|
|
86
70
|
export function makeStepsStyles() {
|
|
87
71
|
return css`
|
|
88
72
|
display: flex;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
|
|
74
|
+
${makeCommonStyles()};
|
|
75
|
+
|
|
76
|
+
&.k-default {
|
|
77
|
+
${makeDefaultStyles()};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.k-line,
|
|
81
|
+
&.k-line-compact,
|
|
82
|
+
&.k-simple {
|
|
83
|
+
${makeLineStyles()};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.k-line-compact {
|
|
87
|
+
${makeLineCompactStyles()};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.k-simple {
|
|
91
|
+
${makeSimpleStyles()};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// clickable
|
|
95
|
+
&.k-clickable {
|
|
96
|
+
.k-done {
|
|
97
|
+
cursor: pointer;
|
|
94
98
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function makeDefaultStyles() {
|
|
104
|
+
const defaults = steps.default;
|
|
105
|
+
|
|
106
|
+
return css`
|
|
107
|
+
text-align: center;
|
|
108
|
+
height: ${defaults.height};
|
|
109
|
+
background: ${defaults.bgColor};
|
|
110
|
+
|
|
111
|
+
.k-step-wrapper {
|
|
112
|
+
${center()};
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
115
|
+
.k-step-mark {
|
|
116
|
+
width: ${defaults.markWidth};
|
|
117
|
+
height: ${defaults.markWidth};
|
|
118
|
+
margin-right: ${steps.gap};
|
|
119
|
+
}
|
|
120
|
+
.k-step-main {
|
|
121
|
+
display: flex;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
}
|
|
125
|
+
.k-step-title {
|
|
126
|
+
padding-right: ${steps.gap};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// tail
|
|
130
|
+
.k-step:last-of-type {
|
|
131
|
+
.k-step-tail {
|
|
132
|
+
display: none;
|
|
102
133
|
}
|
|
103
|
-
|
|
104
|
-
|
|
134
|
+
}
|
|
135
|
+
.k-step-tail {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 0;
|
|
138
|
+
right: calc(-1 * (${defaults.height} / 2 + ${steps.gap}));
|
|
139
|
+
width: calc(${defaults.height} / 2 + ${steps.gap});
|
|
140
|
+
height: ${defaults.height};
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
z-index: 1;
|
|
143
|
+
&:after, &:before {
|
|
144
|
+
content: '';
|
|
145
|
+
border-width: calc(${defaults.height} / 2 + ${steps.gap});
|
|
146
|
+
border-style: solid;
|
|
147
|
+
border-color: transparent;
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: calc(-1 * ${steps.gap});
|
|
105
150
|
}
|
|
106
|
-
|
|
107
|
-
color: ${
|
|
151
|
+
&:after {
|
|
152
|
+
border-left-color: ${defaults.bgColor};
|
|
153
|
+
left: calc(-1 * ${steps.gap});
|
|
108
154
|
}
|
|
109
|
-
|
|
110
|
-
|
|
155
|
+
&:before {
|
|
156
|
+
border-left-color: #fff;
|
|
157
|
+
left: 0;
|
|
111
158
|
}
|
|
112
|
-
.k-step:last-of-type {
|
|
113
|
-
.k-step-tail {
|
|
114
|
-
display: none;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// step
|
|
118
|
-
${stepStatus.map(status => {
|
|
119
|
-
const styles = steps[status];
|
|
120
|
-
return css`
|
|
121
|
-
.k-${status} {
|
|
122
|
-
.k-step-inner {
|
|
123
|
-
color: ${styles.headColor};
|
|
124
|
-
border-color: ${styles.headInnerBorderColor} !important;
|
|
125
|
-
background: ${styles.headInnerBgColor};
|
|
126
|
-
}
|
|
127
|
-
.k-step-main {
|
|
128
|
-
color: ${styles.mainColor};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
`
|
|
132
|
-
})}
|
|
133
159
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
160
|
+
.k-step:not(:first-of-type) {
|
|
161
|
+
padding-left: calc(${defaults.height} / 2 + ${steps.gap});
|
|
162
|
+
}
|
|
163
|
+
`
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function makeLineStyles() {
|
|
167
|
+
const line = defaults.line;
|
|
168
|
+
return css`
|
|
169
|
+
.k-step {
|
|
170
|
+
display: flex;
|
|
171
|
+
}
|
|
172
|
+
.k-step-wrapper {
|
|
173
|
+
display: inline-block;
|
|
138
174
|
text-align: center;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.k-step-wrapper {
|
|
152
|
-
overflow: hidden;
|
|
175
|
+
position: relative;
|
|
176
|
+
}
|
|
177
|
+
.k-step:last-of-type {
|
|
178
|
+
flex: 0 0 auto;
|
|
179
|
+
}
|
|
180
|
+
.k-step-mark {
|
|
181
|
+
width: ${line.markWidth};
|
|
182
|
+
height: ${line.markWidth};
|
|
183
|
+
position: relative;
|
|
184
|
+
z-index: 1;
|
|
185
|
+
&, .k-icon {
|
|
186
|
+
font-size: ${line.markFontSize};
|
|
153
187
|
}
|
|
154
188
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
border-left-color: ${steps.line.bgColor};
|
|
180
|
-
left: 0;
|
|
181
|
-
}
|
|
189
|
+
.k-step-main {
|
|
190
|
+
padding-top: ${line.titleGap};
|
|
191
|
+
}
|
|
192
|
+
.k-step-title {
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
color: ${theme.color.text};
|
|
195
|
+
}
|
|
196
|
+
.k-step-content {
|
|
197
|
+
margin-top: ${line.descGap};
|
|
198
|
+
color: ${theme.color.placeholder};
|
|
199
|
+
max-width: ${line.contentMaxWidth};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// draw connected line
|
|
203
|
+
.k-step-wrapper {
|
|
204
|
+
&:before,
|
|
205
|
+
&:after {
|
|
206
|
+
content: '';
|
|
207
|
+
display: block;
|
|
208
|
+
height: 1px;
|
|
209
|
+
background: ${line.lineColor};
|
|
210
|
+
width: 50%;
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: calc(${line.markWidth} / 2);
|
|
182
213
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
vertical-align: middle;
|
|
186
|
-
margin-top: ${steps.gapTop};
|
|
214
|
+
&:after {
|
|
215
|
+
right: 0;
|
|
187
216
|
}
|
|
188
|
-
|
|
189
|
-
|
|
217
|
+
}
|
|
218
|
+
.k-step {
|
|
219
|
+
&:first-of-type .k-step-wrapper:before,
|
|
220
|
+
&:last-of-type .k-step-wrapper:after {
|
|
221
|
+
background: transparent;
|
|
190
222
|
}
|
|
191
223
|
}
|
|
224
|
+
.k-step-tail {
|
|
225
|
+
flex: 1;
|
|
226
|
+
height: 1px;
|
|
227
|
+
background: ${line.lineColor};
|
|
228
|
+
margin-top: calc(${line.markWidth} / 2);
|
|
229
|
+
}
|
|
192
230
|
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
&:last-of-type
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
display: flex;
|
|
201
|
-
}
|
|
202
|
-
.k-step-title {
|
|
203
|
-
padding-right: 0;
|
|
204
|
-
}
|
|
231
|
+
// status
|
|
232
|
+
.k-step {
|
|
233
|
+
&.k-done {
|
|
234
|
+
.k-step-tail,
|
|
235
|
+
&:not(:last-of-type) .k-step-wrapper:after,
|
|
236
|
+
&:not(:first-of-type) .k-step-wrapper:before {
|
|
237
|
+
background: ${theme.color.primary};
|
|
205
238
|
}
|
|
206
239
|
}
|
|
207
|
-
.k-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
display: flex;
|
|
211
|
-
padding: 0;
|
|
212
|
-
&:before,
|
|
213
|
-
&:after {
|
|
214
|
-
content: '';
|
|
215
|
-
display: block;
|
|
216
|
-
flex: 1;
|
|
217
|
-
height: 1px;
|
|
218
|
-
background: ${theme.color.placeholder};
|
|
219
|
-
top: ${steps.line.headTop};
|
|
220
|
-
position: relative;
|
|
240
|
+
&:not(:first-of-type).k-active {
|
|
241
|
+
.k-step-wrapper:before {
|
|
242
|
+
background: ${theme.color.primary};
|
|
221
243
|
}
|
|
222
244
|
}
|
|
223
|
-
.k-step-
|
|
224
|
-
|
|
225
|
-
height: ${steps.line.innerWidth};
|
|
226
|
-
line-height: ${steps.line.innerLineHeight};
|
|
227
|
-
font-size: ${steps.line.innerFontSize};
|
|
245
|
+
&.k-active .k-step-title {
|
|
246
|
+
color: ${theme.color.primary};
|
|
228
247
|
}
|
|
229
|
-
.k-step-
|
|
230
|
-
|
|
231
|
-
width: ${steps.line.width};
|
|
248
|
+
&.k-error .k-step-title {
|
|
249
|
+
color: ${theme.color.danger};
|
|
232
250
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
251
|
+
}
|
|
252
|
+
`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function makeLineCompactStyles() {
|
|
256
|
+
const line = defaults.line;
|
|
257
|
+
|
|
258
|
+
return css`
|
|
259
|
+
.k-step-wrapper {
|
|
260
|
+
display: inline-flex;
|
|
261
|
+
text-align: left;
|
|
262
|
+
&:before, &:after {
|
|
263
|
+
display: none;
|
|
242
264
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
265
|
+
}
|
|
266
|
+
.k-step-main {
|
|
267
|
+
flex: 1;
|
|
268
|
+
padding: 0 0 0 ${line.titleGap};
|
|
269
|
+
}
|
|
270
|
+
.k-step-content {
|
|
271
|
+
margin: 0;
|
|
272
|
+
}
|
|
273
|
+
.k-step-tail {
|
|
274
|
+
margin-right: ${line.titleGap};
|
|
275
|
+
}
|
|
276
|
+
.k-step-title {
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
height: ${line.markWidth};
|
|
280
|
+
&:after {
|
|
281
|
+
content: '';
|
|
282
|
+
display: block;
|
|
283
|
+
flex: 1;
|
|
247
284
|
height: 1px;
|
|
248
|
-
background: ${
|
|
249
|
-
|
|
250
|
-
.k-step:first-of-type .k-step-head:before,
|
|
251
|
-
.k-step:last-of-type .k-step-head:after {
|
|
252
|
-
background: transparent;
|
|
253
|
-
}
|
|
254
|
-
// done
|
|
255
|
-
.k-done {
|
|
256
|
-
.k-step-tail {
|
|
257
|
-
background: ${steps.line.doneTailBgColor};
|
|
258
|
-
}
|
|
259
|
-
.k-step-head {
|
|
260
|
-
&:before,
|
|
261
|
-
&:after {
|
|
262
|
-
background: ${theme.color.primary};
|
|
263
|
-
}
|
|
264
|
-
}
|
|
285
|
+
background: ${line.lineColor};
|
|
286
|
+
margin-left: ${line.titleGap};
|
|
265
287
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
288
|
+
}
|
|
289
|
+
.k-step:last-of-type .k-step-title:after {
|
|
290
|
+
display: none;
|
|
291
|
+
}
|
|
292
|
+
// status
|
|
293
|
+
.k-step {
|
|
294
|
+
&.k-done {
|
|
295
|
+
.k-step-title:after {
|
|
296
|
+
background: ${theme.color.primary};
|
|
271
297
|
}
|
|
272
298
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
299
|
+
}
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function makeSimpleStyles() {
|
|
304
|
+
const simple = defaults.simple;
|
|
305
|
+
return css`
|
|
306
|
+
.k-step-mark {
|
|
307
|
+
width: ${simple.markWidth};
|
|
308
|
+
height: ${simple.markWidth};
|
|
309
|
+
background: ${simple.markBgColor};
|
|
310
|
+
}
|
|
311
|
+
.k-step-wrapper {
|
|
312
|
+
font-size: 0; // eliminate the gap
|
|
313
|
+
&:before,
|
|
314
|
+
&:after {
|
|
315
|
+
top: calc(${simple.markWidth} / 2);
|
|
283
316
|
}
|
|
284
317
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
.
|
|
290
|
-
|
|
291
|
-
|
|
318
|
+
.k-step-main {
|
|
319
|
+
font-size: ${theme.default.fontSize};
|
|
320
|
+
}
|
|
321
|
+
.k-step-tail {
|
|
322
|
+
margin-top: calc(${simple.markWidth} / 2);
|
|
323
|
+
}
|
|
324
|
+
.k-step {
|
|
325
|
+
&.k-done {
|
|
326
|
+
.k-step-mark {
|
|
327
|
+
background: ${simple.doneMarkBgColor};
|
|
328
|
+
}
|
|
292
329
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
330
|
+
&.k-error {
|
|
331
|
+
.k-step-mark {
|
|
332
|
+
background: ${simple.errorMarkBgColor};
|
|
333
|
+
}
|
|
296
334
|
}
|
|
335
|
+
}
|
|
336
|
+
`;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function center(flex: 'flex' | 'inline-flex' = 'flex') {
|
|
340
|
+
return css`
|
|
341
|
+
display: ${flex};
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
`;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export function makeCommonStyles() {
|
|
348
|
+
return css`
|
|
349
|
+
.k-step {
|
|
350
|
+
position: relative;
|
|
351
|
+
flex: 1;
|
|
352
|
+
|
|
353
|
+
// status
|
|
297
354
|
${stepStatus.map(status => {
|
|
298
355
|
const styles = steps[status];
|
|
299
356
|
return css`
|
|
300
|
-
|
|
301
|
-
.k-step-
|
|
302
|
-
|
|
303
|
-
color: ${styles.
|
|
357
|
+
&.k-${status} {
|
|
358
|
+
.k-step-mark {
|
|
359
|
+
color: ${styles.markColor};
|
|
360
|
+
border-color: ${styles.markBorderColor};
|
|
361
|
+
background: ${styles.markBgColor};
|
|
362
|
+
}
|
|
363
|
+
.k-step-main {
|
|
364
|
+
color: ${styles.mainColor};
|
|
304
365
|
}
|
|
305
366
|
}
|
|
306
367
|
`
|
|
307
368
|
})}
|
|
308
369
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
370
|
+
.k-step-mark {
|
|
371
|
+
${center('inline-flex')};
|
|
372
|
+
border: ${steps.markborder};
|
|
373
|
+
border-radius: 50%;
|
|
374
|
+
vertical-align: top;
|
|
375
|
+
color: ${steps.markColor};
|
|
376
|
+
background: ${steps.markBgColor};
|
|
315
377
|
}
|
|
316
378
|
`;
|
|
317
379
|
}
|
|
318
|
-
|
|
319
|
-
export function makeStepStyles() {
|
|
320
|
-
return css`
|
|
321
|
-
position: relative;
|
|
322
|
-
flex: 1;
|
|
323
|
-
.k-step-icon:before {
|
|
324
|
-
font-size: ${steps.head.iconFontSize};
|
|
325
|
-
}
|
|
326
|
-
.k-step-title {
|
|
327
|
-
display: inline-block;
|
|
328
|
-
padding-right: ${steps.main.titlePaddingRight};
|
|
329
|
-
white-space: nowrap;
|
|
330
|
-
}
|
|
331
|
-
.k-step-content {
|
|
332
|
-
font-size: ${steps.main.contentFontSize};
|
|
333
|
-
}
|
|
334
|
-
.k-step-inner,
|
|
335
|
-
.k-step-main {
|
|
336
|
-
transition: all ${steps.transition};
|
|
337
|
-
}
|
|
338
|
-
`;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
@@ -16,6 +16,11 @@ import {Switch} from 'kpc';
|
|
|
16
16
|
<b:on><i class="ion-ios-checkmark-empty"></i></b:on>
|
|
17
17
|
<b:off><i class="ion-ios-close-empty"></i></b:off>
|
|
18
18
|
</Switch>
|
|
19
|
+
<Switch on="开" off="关" flat/>
|
|
20
|
+
<Switch value={true} flat>
|
|
21
|
+
<b:on><i class="ion-ios-checkmark-empty"></i></b:on>
|
|
22
|
+
<b:off><i class="ion-ios-close-empty"></i></b:off>
|
|
23
|
+
</Switch>
|
|
19
24
|
</div>
|
|
20
25
|
```
|
|
21
26
|
|