@king-design/react 2.1.1 → 3.0.0-beta.1
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/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +410 -374
- package/__tests__/components/drawer.spec.tsx +67 -5
- package/components/button/index.d.ts +1 -1
- package/components/button/index.js +1 -1
- package/components/button/styles.js +3 -3
- package/components/card/styles.js +10 -2
- package/components/checkbox/styles.js +21 -10
- package/components/collapse/styles.js +6 -1
- package/components/copy/index.d.ts +17 -0
- package/components/copy/index.js +43 -0
- package/components/copy/index.spec.d.ts +1 -0
- package/components/copy/index.spec.js +52 -0
- package/components/copy/index.vdt.js +45 -0
- package/components/copy/styles.d.ts +2 -0
- package/components/copy/styles.js +14 -0
- package/components/copy/useCopy.d.ts +4 -0
- package/components/copy/useCopy.js +90 -0
- package/components/datepicker/index.spec.js +1 -1
- package/components/datepicker/index.vdt.js +1 -1
- package/components/datepicker/styles.d.ts +1 -1
- package/components/datepicker/styles.js +5 -2
- package/components/diagram/shapes/callout.d.ts +1 -1
- package/components/diagram/shapes/circle.d.ts +1 -1
- package/components/diagram/shapes/document.d.ts +1 -1
- package/components/diagram/shapes/ellipse.d.ts +1 -1
- package/components/diagram/shapes/hexagon.d.ts +1 -1
- package/components/diagram/shapes/image.d.ts +1 -1
- package/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/components/diagram/shapes/rectangle.d.ts +1 -1
- package/components/diagram/shapes/square.d.ts +1 -1
- package/components/diagram/shapes/text.d.ts +1 -1
- package/components/dialog/alert.vdt.js +6 -5
- package/components/dialog/base.vdt.js +5 -6
- package/components/dialog/index.spec.js +4 -4
- package/components/dialog/styles.js +16 -14
- package/components/drawer/styles.js +20 -5
- package/components/dropdown/styles.js +1 -1
- package/components/form/index.spec.js +4 -2
- package/components/form/item.vdt.js +2 -1
- package/components/form/styles.js +5 -5
- package/components/grid/useGutter.js +8 -8
- package/components/icon/index.d.ts +1 -0
- package/components/icon/index.js +2 -1
- package/components/icon/index.vdt.js +4 -2
- package/components/icon/styles.js +10 -2
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +4 -11
- package/components/input/index.vdt.js +4 -2
- package/components/input/styles.js +13 -11
- package/components/message/message.js +1 -1
- package/components/message/message.vdt.js +7 -6
- package/components/message/styles.js +8 -8
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +1 -1
- package/components/pagination/index.spec.js +4 -2
- package/components/pagination/index.vdt.js +16 -18
- package/components/pagination/styles.js +12 -3
- package/components/popover/content.d.ts +19 -0
- package/components/popover/content.js +31 -0
- package/components/popover/content.vdt.js +68 -0
- package/components/popover/index.d.ts +16 -0
- package/components/popover/index.js +44 -0
- package/components/popover/index.spec.d.ts +1 -0
- package/components/popover/index.spec.js +195 -0
- package/components/popover/styles.d.ts +1 -0
- package/components/popover/styles.js +22 -0
- package/components/progress/index.js +1 -1
- package/components/progress/index.vdt.js +46 -8
- package/components/progress/styles.js +19 -13
- package/components/radio/styles.js +16 -6
- package/components/rate/styles.js +1 -1
- package/components/select/base.d.ts +5 -2
- package/components/select/base.js +7 -3
- package/components/select/base.vdt.js +46 -38
- package/components/select/index.spec.js +2 -2
- package/components/select/menu.vdt.js +1 -1
- package/components/select/styles.js +14 -28
- package/components/select/useDraggble.d.ts +2 -0
- package/components/select/useDraggble.js +11 -0
- package/components/select/useNowrap.d.ts +3 -0
- package/components/select/useNowrap.js +19 -0
- package/components/slider/index.spec.js +48 -9
- package/components/slider/index.vdt.js +23 -12
- package/components/slider/styles.js +23 -14
- package/components/slider/useValue.d.ts +3 -1
- package/components/slider/useValue.js +12 -0
- package/components/spinner/index.d.ts +0 -1
- package/components/spinner/index.js +1 -19
- package/components/spinner/index.vdt.js +15 -8
- package/components/spinner/styles.js +33 -5
- package/components/spinner/useChange.d.ts +1 -1
- package/components/spinner/useChange.js +2 -2
- package/components/spinner/useValue.d.ts +1 -0
- package/components/spinner/useValue.js +16 -1
- package/components/split/index.vdt.js +32 -20
- package/components/split/memo.d.ts +9 -0
- package/components/split/memo.js +26 -0
- package/components/steps/index.d.ts +3 -2
- package/components/steps/index.js +4 -3
- package/components/steps/index.spec.js +1 -1
- package/components/steps/index.vdt.js +8 -4
- package/components/steps/step.vdt.js +17 -9
- package/components/steps/styles.d.ts +2 -1
- package/components/steps/styles.js +106 -72
- package/components/switch/index.spec.js +82 -65
- package/components/switch/styles.js +20 -34
- package/components/table/styles.js +9 -4
- package/components/table/useDraggable.js +3 -10
- package/components/table/useStickyScrollbar.js +2 -2
- package/components/table/useWidth.js +2 -2
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/index.js +1 -1
- package/components/tabs/index.spec.js +67 -0
- package/components/tabs/index.vdt.js +5 -5
- package/components/tabs/styles.js +73 -29
- package/components/tabs/useScroll.d.ts +1 -1
- package/components/tabs/useScroll.js +75 -48
- package/components/tag/base.d.ts +1 -0
- package/components/tag/base.js +2 -2
- package/components/tag/index.d.ts +1 -0
- package/components/tag/index.js +2 -1
- package/components/tag/index.spec.js +147 -4
- package/components/tag/styles.d.ts +67 -0
- package/components/tag/styles.js +42 -12
- package/components/tag/tags.d.ts +27 -0
- package/components/tag/tags.js +51 -0
- package/components/tag/tags.vdt.js +79 -0
- package/components/tag/useChildren.d.ts +2 -0
- package/components/tag/useChildren.js +39 -0
- package/components/tag/useDraggable.d.ts +3 -0
- package/components/tag/useDraggable.js +89 -0
- package/components/tag/useNowrap.d.ts +7 -0
- package/components/tag/useNowrap.js +115 -0
- package/components/timepicker/index.spec.js +1 -1
- package/components/tip/index.vdt.js +1 -3
- package/components/tip/styles.js +4 -3
- package/components/tooltip/content.d.ts +2 -2
- package/components/tooltip/content.vdt.js +23 -13
- package/components/tooltip/index.spec.js +56 -108
- package/components/tooltip/styles.d.ts +1 -0
- package/components/tooltip/styles.js +13 -8
- package/components/transfer/index.vdt.js +3 -1
- package/components/transfer/styles.js +1 -1
- package/components/transfer/useCheck.d.ts +1 -0
- package/components/transfer/useCheck.js +8 -1
- package/components/upload/index.spec.js +5 -6
- package/components/upload/index.vdt.js +24 -21
- package/components/upload/styles.js +22 -30
- package/components/utils.d.ts +2 -0
- package/components/utils.js +24 -3
- package/hooks/useResizeObserver.d.ts +1 -1
- package/hooks/useResizeObserver.js +19 -6
- package/i18n/en-US.d.ts +6 -2
- package/i18n/en-US.js +8 -3
- package/index.d.ts +4 -2
- package/index.js +4 -2
- package/package.json +1 -1
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +2 -2
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/ionicons.js +2 -2
- package/styles/global.js +1 -1
- package/styles/theme.d.ts +10 -2
- package/styles/theme.js +23 -21
- package/components/table/useResizeObserver.d.ts +0 -2
- package/components/table/useResizeObserver.js +0 -20
|
@@ -6,9 +6,10 @@ import { bind } from '../utils';
|
|
|
6
6
|
export * from './step';
|
|
7
7
|
var typeDefs = {
|
|
8
8
|
value: Number,
|
|
9
|
-
status: ['normal', 'error'],
|
|
10
|
-
type: ['default', 'line', 'simple'],
|
|
11
|
-
clickable: Boolean
|
|
9
|
+
status: ['normal', 'error', 'done'],
|
|
10
|
+
type: ['default', 'line', 'simple', 'line-compact', 'dot'],
|
|
11
|
+
clickable: Boolean,
|
|
12
|
+
vertical: Boolean
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
var defaults = function defaults() {
|
|
@@ -21,7 +21,7 @@ describe('Steps', function () {
|
|
|
21
21
|
|
|
22
22
|
case 5:
|
|
23
23
|
expect(element.innerHTML).to.matchSnapshot();
|
|
24
|
-
_element$querySelecto2 = element.querySelectorAll('.k-step'), step1 = _element$querySelecto2[0], step2 = _element$querySelecto2[1];
|
|
24
|
+
_element$querySelecto2 = element.querySelectorAll('.k-step-wrapper'), step1 = _element$querySelecto2[0], step2 = _element$querySelecto2[1];
|
|
25
25
|
step1.click();
|
|
26
26
|
_context.next = 10;
|
|
27
27
|
return wait();
|
|
@@ -17,11 +17,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
17
17
|
value = _this$get.value,
|
|
18
18
|
status = _this$get.status,
|
|
19
19
|
type = _this$get.type,
|
|
20
|
-
clickable = _this$get.clickable
|
|
20
|
+
clickable = _this$get.clickable,
|
|
21
|
+
vertical = _this$get.vertical;
|
|
21
22
|
|
|
22
23
|
var classNameObj = (_classNameObj = {
|
|
23
24
|
'k-steps': true
|
|
24
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + type] = true, _classNameObj['k-clickable'] = clickable, _classNameObj[makeStepsStyles()] = true, _classNameObj);
|
|
25
|
+
}, _classNameObj[className] = className, _classNameObj["k-" + type] = true, _classNameObj['k-clickable'] = clickable, _classNameObj['k-vertical'] = vertical, _classNameObj[makeStepsStyles()] = true, _classNameObj);
|
|
25
26
|
var stepIndex = 0;
|
|
26
27
|
var steps = [];
|
|
27
28
|
eachChildren(children, function (vNode) {
|
|
@@ -34,12 +35,15 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
34
35
|
}
|
|
35
36
|
}); // add width
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
/* const width = (100 / stepIndex) + '%'; */
|
|
39
|
+
|
|
38
40
|
return _$cc(StepsContext.Provider, {
|
|
39
41
|
'value': {
|
|
40
42
|
value: value,
|
|
41
43
|
status: status,
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
/* width, */
|
|
46
|
+
type: type,
|
|
43
47
|
onChange: this.changeIndex
|
|
44
48
|
},
|
|
45
49
|
'children': _$cv('div', _extends({
|
|
@@ -2,8 +2,16 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
2
2
|
import { createUnknownComponentVNode as _$cc, createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact-react';
|
|
3
3
|
import { linkEvent } from 'intact';
|
|
4
4
|
import { getRestProps, addStyle } from '../utils';
|
|
5
|
-
import { makeStepStyles } from './styles';
|
|
6
5
|
import { context as StepsContext } from './context';
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
|
+
var _$tmp0 = {
|
|
8
|
+
'className': 'k-icon-close-big',
|
|
9
|
+
'color': 'danger'
|
|
10
|
+
};
|
|
11
|
+
var _$tmp1 = {
|
|
12
|
+
'className': 'k-icon-check',
|
|
13
|
+
'color': 'primary'
|
|
14
|
+
};
|
|
7
15
|
export default function ($props, $blocks, $__proto__) {
|
|
8
16
|
var _this = this;
|
|
9
17
|
|
|
@@ -24,23 +32,23 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
24
32
|
|
|
25
33
|
var value = _ref.value,
|
|
26
34
|
status = _ref.status,
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
onChange = _ref.onChange,
|
|
36
|
+
type = _ref.type;
|
|
29
37
|
var selected = value === index;
|
|
30
38
|
var error = selected && status === 'error';
|
|
39
|
+
var done = value > index;
|
|
31
40
|
var classNameObj = (_classNameObj = {
|
|
32
41
|
'k-step': true,
|
|
33
42
|
'k-active': selected,
|
|
34
|
-
'k-done':
|
|
43
|
+
'k-done': done,
|
|
35
44
|
'k-error': error
|
|
36
|
-
}, _classNameObj[className] = className, _classNameObj
|
|
45
|
+
}, _classNameObj[className] = className, _classNameObj);
|
|
37
46
|
return _$cv('div', _extends({}, getRestProps(_this), {
|
|
38
47
|
'className': _$cn(classNameObj),
|
|
39
|
-
'style':
|
|
40
|
-
|
|
41
|
-
}),
|
|
48
|
+
'style': style
|
|
49
|
+
}), [_$ce(2, 'div', [_$ce(2, 'div', error && type !== 'simple' ? _$cc(Icon, _$tmp0) : done && (type === 'line' || type === 'line-compact') ? _$cc(Icon, _$tmp1) : type !== 'simple' ? _$ce(2, 'span', index + 1, 0) : undefined, 0, 'k-step-mark'), _$ce(2, 'div', [_$ce(2, 'div', title, 0, 'k-step-title'), _$ce(2, 'div', _children, 0, 'k-step-content')], 4, 'k-step-main')], 4, 'k-step-wrapper', {
|
|
42
50
|
'ev-click': linkEvent(index, onChange)
|
|
43
|
-
}),
|
|
51
|
+
}), _$ce(2, 'div', null, 1, 'k-step-tail')]);
|
|
44
52
|
}
|
|
45
53
|
});
|
|
46
54
|
}
|
|
@@ -4,137 +4,132 @@ import { theme, setDefault } from '../../styles/theme';
|
|
|
4
4
|
import { deepDefaults } from '../../styles/utils';
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
var defaults = {
|
|
7
|
-
|
|
8
|
-
return theme.transition.middle;
|
|
9
|
-
},
|
|
7
|
+
gap: '10px',
|
|
10
8
|
|
|
11
|
-
get
|
|
12
|
-
return theme.
|
|
9
|
+
get titleColor() {
|
|
10
|
+
return theme.color.title;
|
|
13
11
|
},
|
|
14
12
|
|
|
15
|
-
get
|
|
16
|
-
return theme.color.
|
|
13
|
+
get desColor() {
|
|
14
|
+
return theme.color.lightBlack;
|
|
17
15
|
},
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
head: {
|
|
23
|
-
innerWidth: '16px',
|
|
17
|
+
get markColor() {
|
|
18
|
+
return theme.color.placeholder;
|
|
19
|
+
},
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
markBgColor: '#fff',
|
|
22
|
+
default: {
|
|
23
|
+
get height() {
|
|
24
|
+
return theme.default.height;
|
|
27
25
|
},
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
main: {
|
|
33
|
-
get color() {
|
|
34
|
-
return theme.color.text;
|
|
27
|
+
get bgColor() {
|
|
28
|
+
return theme.color.bg;
|
|
35
29
|
},
|
|
36
30
|
|
|
37
|
-
get
|
|
38
|
-
return
|
|
31
|
+
get markborder() {
|
|
32
|
+
return "1px solid " + theme.color.placeholder;
|
|
39
33
|
},
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
markWidth: '16px',
|
|
36
|
+
padding: '16px'
|
|
42
37
|
},
|
|
43
38
|
// done
|
|
44
39
|
done: {
|
|
45
|
-
get
|
|
40
|
+
get markColor() {
|
|
46
41
|
return theme.color.primary;
|
|
47
42
|
},
|
|
48
43
|
|
|
49
|
-
get
|
|
44
|
+
get markBorderColor() {
|
|
50
45
|
return theme.color.primary;
|
|
51
46
|
},
|
|
52
47
|
|
|
53
|
-
|
|
48
|
+
markBgColor: '#fff',
|
|
54
49
|
|
|
55
50
|
get mainColor() {
|
|
56
51
|
return theme.color.primary;
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
get simpleColor() {
|
|
60
|
-
return theme.color.text;
|
|
61
52
|
}
|
|
62
53
|
|
|
63
54
|
},
|
|
64
55
|
// active
|
|
65
56
|
active: {
|
|
66
|
-
|
|
57
|
+
markColor: '#fff',
|
|
67
58
|
|
|
68
|
-
get
|
|
59
|
+
get markBorderColor() {
|
|
69
60
|
return theme.color.primary;
|
|
70
61
|
},
|
|
71
62
|
|
|
72
|
-
get
|
|
63
|
+
get markBgColor() {
|
|
73
64
|
return theme.color.primary;
|
|
74
65
|
},
|
|
75
66
|
|
|
76
67
|
get mainColor() {
|
|
77
68
|
return theme.color.primary;
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
get simpleColor() {
|
|
81
|
-
return theme.color.primary;
|
|
82
69
|
}
|
|
83
70
|
|
|
84
71
|
},
|
|
85
72
|
// error
|
|
86
73
|
error: {
|
|
87
|
-
get
|
|
74
|
+
get markColor() {
|
|
88
75
|
return theme.color.danger;
|
|
89
76
|
},
|
|
90
77
|
|
|
91
|
-
get
|
|
78
|
+
get markBorderColor() {
|
|
92
79
|
return theme.color.danger;
|
|
93
80
|
},
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
markBgColor: '#fff',
|
|
96
83
|
|
|
97
84
|
get mainColor() {
|
|
98
85
|
return theme.color.danger;
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
get simpleColor() {
|
|
102
|
-
return theme.color.danger;
|
|
103
86
|
}
|
|
104
87
|
|
|
105
88
|
},
|
|
106
89
|
// line
|
|
107
90
|
line: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
get tailBgColor() {
|
|
112
|
-
return theme.color.placeholder;
|
|
91
|
+
get markborder() {
|
|
92
|
+
return "2px solid " + theme.color.placeholder;
|
|
113
93
|
},
|
|
114
94
|
|
|
115
|
-
|
|
116
|
-
|
|
95
|
+
markWidth: '32px',
|
|
96
|
+
markFontSize: '18px',
|
|
97
|
+
|
|
98
|
+
get lineColor() {
|
|
99
|
+
return theme.color.border;
|
|
117
100
|
},
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
titleFontSize: '14px',
|
|
124
|
-
titleGopTop: '16px',
|
|
125
|
-
iconLineHeight: '30px',
|
|
126
|
-
tailTop: '16px',
|
|
127
|
-
width: '160px'
|
|
102
|
+
lineWidth: '2px',
|
|
103
|
+
titleGap: '16px',
|
|
104
|
+
descGap: '4px',
|
|
105
|
+
contentWidth: '200px'
|
|
128
106
|
},
|
|
129
107
|
// simple
|
|
130
108
|
simple: {
|
|
131
|
-
|
|
109
|
+
markWidth: '12px',
|
|
132
110
|
|
|
133
|
-
get
|
|
134
|
-
return theme.color.
|
|
111
|
+
get markBgColor() {
|
|
112
|
+
return theme.color.placeholder;
|
|
135
113
|
},
|
|
136
114
|
|
|
137
|
-
|
|
115
|
+
get doneMarkBgColor() {
|
|
116
|
+
return theme.color.primary;
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
get errorMarkBgColor() {
|
|
120
|
+
return theme.color.danger;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
},
|
|
124
|
+
// vertical
|
|
125
|
+
vertical: {
|
|
126
|
+
line: {
|
|
127
|
+
minHeight: '100px',
|
|
128
|
+
padding: '16px'
|
|
129
|
+
},
|
|
130
|
+
simple: {
|
|
131
|
+
titleGap: '8px'
|
|
132
|
+
}
|
|
138
133
|
}
|
|
139
134
|
};
|
|
140
135
|
var steps;
|
|
@@ -145,14 +140,53 @@ setDefault(function () {
|
|
|
145
140
|
});
|
|
146
141
|
var stepStatus = ['done', 'active', 'error'];
|
|
147
142
|
export function makeStepsStyles() {
|
|
148
|
-
return /*#__PURE__*/css("display:flex;&.k-default,&.k-line{",
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
return /*#__PURE__*/css("display:flex;", makeCommonStyles(), ";&.k-default{", makeDefaultStyles(), ";}&.k-line,&.k-line-compact,&.k-simple{", makeLineStyles(), ";}&.k-line-compact{", makeLineCompactStyles(), ";}&.k-simple{", makeSimpleStyles(), ";}&.k-clickable{.k-done{cursor:pointer;}}", makeVerticalStyles(), ";");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function makeDefaultStyles() {
|
|
147
|
+
var defaults = steps.default;
|
|
148
|
+
return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.k-step-wrapper{", center(), ";height:100%;padding:0 ", defaults.padding, ";}.k-step-mark{width:", defaults.markWidth, ";height:", defaults.markWidth, ";margin-right:", steps.gap, ";}.k-step-main{display:flex;overflow:hidden;white-space:nowrap;}.k-step-title{padding-right:", steps.gap, ";}.k-step:last-of-type{.k-step-tail{display:none;}}&:not(.k-vertical){", makeArrow(false), ";}");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function makeArrow(isVertical) {
|
|
152
|
+
var defaults = steps.default;
|
|
153
|
+
var offset = "calc(-1 * (" + defaults.height + " / 2 + " + steps.gap + "))";
|
|
154
|
+
var size = "calc(" + defaults.height + " / 2 + " + steps.gap + ")";
|
|
155
|
+
return /*#__PURE__*/css(".k-step-tail{position:absolute;", !isVertical ? "\n top: 0;\n right: " + offset + ";\n width: " + size + ";\n height: " + defaults.height + ";\n " : "\n left: 0;\n bottom: " + offset + ";\n height: " + size + ";\n width: " + defaults.height + ";\n ", " overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;", isVertical ? 'left' : 'top', ":calc(-1 * ", steps.gap, ");}&:after{border-", isVertical ? 'top' : 'left', "-color:", defaults.bgColor, ";", isVertical ? 'top' : 'left', ":calc(-1 * ", steps.gap, ");}&:before{border-", isVertical ? 'top' : 'left', "-color:#fff;", isVertical ? 'top' : 'left', ":0;}}.k-step:not(:first-of-type){padding-", isVertical ? 'top' : 'left', ":calc(", defaults.height, " / 2 + ", steps.gap, ");}");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function makeLineStyles() {
|
|
159
|
+
var line = steps.line;
|
|
160
|
+
var top = "calc(" + line.markWidth + " / 2 - " + line.lineWidth + " / 2)";
|
|
161
|
+
return /*#__PURE__*/css(".k-step{display:flex;}.k-step-wrapper{display:inline-block;text-align:center;position:relative;width:", line.contentWidth, ";}.k-step:last-of-type{flex:0 0 auto;}.k-step-mark{border:", line.markborder, ";width:", line.markWidth, ";height:", line.markWidth, ";position:relative;z-index:1;&,.k-icon{font-size:", line.markFontSize, ";}}.k-step-main{padding-top:", line.titleGap, ";}.k-step-title{font-size:14px;color:", theme.color.text, ";}.k-step-content{margin-top:", line.descGap, ";color:", theme.color.placeholder, ";}.k-step-wrapper{&:before,&:after{content:'';display:block;height:", line.lineWidth, ";background:", line.lineColor, ";width:50%;position:absolute;top:", top, ";}&:after{right:0;}}.k-step{&:first-of-type .k-step-wrapper:before,&:last-of-type .k-step-wrapper:after{background:transparent;}}.k-step-tail{flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-top:", top, ";}.k-step{&.k-done{.k-step-tail,&:not(:last-of-type) .k-step-wrapper:after,&:not(:first-of-type) .k-step-wrapper:before{background:", theme.color.primary, ";}}&:not(:first-of-type).k-active{.k-step-wrapper:before{background:", theme.color.primary, ";}}&.k-active .k-step-title{color:", theme.color.primary, ";}&.k-error .k-step-title{color:", theme.color.danger, ";}}");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function makeLineCompactStyles() {
|
|
165
|
+
var line = steps.line;
|
|
166
|
+
return /*#__PURE__*/css(".k-step-wrapper{display:inline-flex;text-align:left;width:auto;&:before,&:after{display:none;}}.k-step-main{flex:1;padding:0 0 0 ", line.titleGap, ";}.k-step-content{margin:0;}.k-step-tail{margin-right:", line.titleGap, ";}.k-step-title{display:flex;align-items:center;height:", line.markWidth, ";&:after{content:'';display:block;flex:1;height:", line.lineWidth, ";background:", line.lineColor, ";margin-left:", line.titleGap, ";}}.k-step:last-of-type .k-step-title:after{display:none;}.k-step{&.k-done{.k-step-title:after{background:", theme.color.primary, ";}}}");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function makeSimpleStyles() {
|
|
170
|
+
var simple = steps.simple;
|
|
171
|
+
var top = "calc(" + simple.markWidth + " / 2 - " + steps.line.lineWidth + " / 2)";
|
|
172
|
+
return /*#__PURE__*/css(".k-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.k-step-wrapper{font-size:0;&:before,&:after{top:", top, ";}}.k-step-main{font-size:", theme.default.fontSize, ";}.k-step-tail{margin-top:", top, ";}.k-step{&.k-done{.k-step-mark{background:", simple.doneMarkBgColor, ";}}&.k-error{.k-step-mark{background:", simple.errorMarkBgColor, ";}}}");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function center(flex) {
|
|
176
|
+
if (flex === void 0) {
|
|
177
|
+
flex = 'flex';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return /*#__PURE__*/css("display:", flex, ";align-items:center;justify-content:center;");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function makeCommonStyles() {
|
|
184
|
+
return /*#__PURE__*/css(".k-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
|
|
152
185
|
var styles = steps[status];
|
|
153
|
-
return /*#__PURE__*/css("
|
|
154
|
-
}), "
|
|
186
|
+
return /*#__PURE__*/css("&.k-", status, "{.k-step-mark{color:", styles.markColor, ";border-color:", styles.markBorderColor, ";background:", styles.markBgColor, ";}.k-step-main{color:", styles.mainColor, ";}}");
|
|
187
|
+
}), ";}.k-step-mark{", center('inline-flex'), ";border:", steps.default.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
|
|
155
188
|
}
|
|
156
|
-
export function
|
|
157
|
-
|
|
189
|
+
export function makeVerticalStyles() {
|
|
190
|
+
var verticalLine = steps.vertical.line;
|
|
191
|
+
return /*#__PURE__*/css("&.k-vertical{&.k-default{height:auto;width:", steps.default.height, ";writing-mode:vertical-rl;letter-spacing:1px;", makeArrow(true), ";.k-step-wrapper{width:100%;padding:", steps.default.padding, " 0;}.k-step-mark{margin-right:0;margin-bottom:", steps.gap, ";}.k-step-title{padding-right:0;padding-bottom:", steps.gap, ";}}&.k-line,&.k-line-compact,&.k-simple{flex-direction:column;.k-step{flex:none;min-height:", verticalLine.minHeight, ";}.k-step-wrapper{display:flex;width:auto;text-align:left;}.k-step-main{flex:1;padding:0 0 ", verticalLine.padding, " ", verticalLine.padding, ";}.k-step-title{display:flex;align-items:center;height:", steps.line.markWidth, ";&:after{display:none;}}.k-step-wrapper{&:before,&:after{display:none;}}.k-step-tail{position:absolute;left:calc(", steps.line.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);height:100%;width:", steps.line.lineWidth, ";background:", steps.line.lineColor, ";}.k-step:last-of-type{.k-step-tail{display:none;}}}&.k-simple{.k-step-tail{left:calc(", steps.simple.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);}.k-step-title{height:", steps.simple.markWidth, ";margin-bottom:", steps.vertical.simple.titleGap, ";}}}");
|
|
158
192
|
}
|