@king-design/vue 2.0.15 → 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/__tests__/__snapshots__/Vue Next Demos.md +1 -1
- package/components/button/styles.js +2 -2
- package/components/card/styles.js +10 -2
- package/components/checkbox/styles.js +21 -10
- package/components/collapse/styles.js +6 -1
- package/components/datepicker/styles.d.ts +1 -1
- package/components/datepicker/styles.js +4 -1
- package/components/dialog/base.vdt.js +5 -6
- package/components/dialog/styles.js +16 -14
- package/components/drawer/styles.js +20 -5
- package/components/dropdown/styles.js +1 -1
- package/components/form/styles.js +1 -1
- 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/styles.js +1 -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.vdt.js +8 -8
- package/components/pagination/styles.js +11 -2
- package/components/radio/styles.js +16 -6
- package/components/select/base.vdt.js +5 -6
- package/components/select/styles.js +4 -24
- package/components/spinner/index.vdt.js +6 -4
- package/components/spinner/styles.js +33 -5
- package/components/steps/index.d.ts +2 -2
- package/components/steps/index.js +2 -2
- package/components/steps/index.vdt.js +1 -0
- package/components/steps/step.vdt.js +17 -8
- package/components/steps/styles.d.ts +1 -1
- package/components/steps/styles.js +80 -75
- package/components/switch/styles.js +20 -34
- package/components/table/column.vdt.js +43 -7
- package/components/table/index.spec.js +2 -2
- package/components/table/styles.js +16 -5
- package/components/table/useGroup.d.ts +3 -0
- package/components/table/useGroup.js +24 -1
- package/components/table/useSortable.d.ts +3 -1
- package/components/table/useSortable.js +4 -1
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/index.js +1 -1
- package/components/tabs/index.vdt.js +1 -1
- package/components/tabs/styles.js +68 -22
- package/components/tag/base.js +1 -1
- package/components/tag/styles.js +15 -10
- package/components/tip/index.vdt.js +1 -3
- package/components/tip/styles.js +4 -3
- package/components/tooltip/content.vdt.js +4 -4
- package/components/tooltip/styles.js +12 -7
- 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.vdt.js +21 -20
- package/components/upload/styles.js +22 -30
- package/i18n/en-US.d.ts +2 -1
- package/i18n/en-US.js +2 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/theme.d.ts +10 -2
- package/styles/theme.js +23 -21
- package/yarn-error.log +899 -0
|
@@ -23,7 +23,16 @@ var defaults = deepDefaults({
|
|
|
23
23
|
gap: '16px',
|
|
24
24
|
btn: {
|
|
25
25
|
gap: '6px',
|
|
26
|
-
padding: '0 3px'
|
|
26
|
+
padding: '0 3px',
|
|
27
|
+
|
|
28
|
+
get borderRadius() {
|
|
29
|
+
return theme.borderRadius;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
get hoverBgColor() {
|
|
33
|
+
return theme.color.hoverBg;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
},
|
|
28
37
|
// goto
|
|
29
38
|
goto: {
|
|
@@ -55,7 +64,7 @@ setDefault(function () {
|
|
|
55
64
|
}).pagination;
|
|
56
65
|
});
|
|
57
66
|
export function makeStyles() {
|
|
58
|
-
return /*#__PURE__*/css("font-size:", pagination.fontSize, "
|
|
67
|
+
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.k-pagination-ellipsis{background-color:transparent;border-color:transparent;}.k-btns{.k-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}&:hover{background:", pagination.btn.hoverBgColor, ";}}.k-icon{font-size:18px;}}.k-pagination-goto{.k-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.k-input-inner{text-align:center;}}.k-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
59
68
|
var styles = pagination[size];
|
|
60
69
|
var btnStyles = button[size];
|
|
61
70
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";.k-btn{margin-right:", styles.btnGap, ";min-width:", btnStyles.height, ";.k-icon{font-size:", styles.iconFontSize, ";}}}");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css } from '@emotion/css';
|
|
2
|
-
import { deepDefaults } from '../../styles/utils';
|
|
2
|
+
import { deepDefaults, palette } from '../../styles/utils';
|
|
3
3
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
var defaults = {
|
|
6
|
-
width: '
|
|
6
|
+
width: '16px',
|
|
7
7
|
|
|
8
8
|
get transition() {
|
|
9
9
|
return theme.transition.small;
|
|
@@ -38,10 +38,20 @@ var defaults = {
|
|
|
38
38
|
return theme.color.disabledBg;
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
checked: {
|
|
42
|
+
get borderColor() {
|
|
43
|
+
return palette(theme.color.primary, -2);
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
get bgColor() {
|
|
47
|
+
return palette(theme.color.primary, -4);
|
|
48
|
+
},
|
|
44
49
|
|
|
50
|
+
get innerColor() {
|
|
51
|
+
return palette(theme.color.primary, -3);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
45
55
|
}
|
|
46
56
|
};
|
|
47
57
|
var radio;
|
|
@@ -51,5 +61,5 @@ setDefault(function () {
|
|
|
51
61
|
}).radio;
|
|
52
62
|
});
|
|
53
63
|
export function makeStyles() {
|
|
54
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.k-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.k-checked{.k-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.k-radio-wrapper{border-color:", radio.checkedColor, ";}}&.k-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.k-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";&:before{background:", radio.disabled.innerColor, ";}}
|
|
64
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}&:hover{border:1px solid ", radio.hoverBorderColor, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.k-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.k-checked{.k-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.k-radio-wrapper{border-color:", radio.checkedColor, ";}}&.k-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.k-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";}input{cursor:not-allowed;}&.k-checked{.k-radio-wrapper{border-color:", radio.disabled.checked.borderColor, ";background:", radio.disabled.checked.bgColor, ";&:before{background:", radio.disabled.checked.innerColor, ";}}}}");
|
|
55
65
|
}
|
|
@@ -130,9 +130,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
130
130
|
|
|
131
131
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
132
132
|
}, __$blocks['value'](_$no, [value[$key], $label])), 0, 'k-select-text'), _$cc(Icon, {
|
|
133
|
-
'className': '
|
|
133
|
+
'className': 'k-icon-close k-select-close',
|
|
134
134
|
'ev-click': this.delete.bind(this, $key),
|
|
135
|
-
'hoverable': !disabled
|
|
135
|
+
'hoverable': !disabled,
|
|
136
|
+
'disabled': disabled
|
|
136
137
|
})], 4, 'k-select-tag', null, isStringOrNumber($label) ? $label : isStringOrNumber(value[$key]) ? value[$key] : undefined);
|
|
137
138
|
}, $this);
|
|
138
139
|
}, __$blocks['values'] = function ($super, data) {
|
|
@@ -170,10 +171,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
170
171
|
'hoverable': true
|
|
171
172
|
}) : undefined, _$ce(2, 'span', (_$blocks['suffix'] = function ($super) {
|
|
172
173
|
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? _$cc(Icon, {
|
|
173
|
-
'className':
|
|
174
|
-
|
|
175
|
-
'k-disabled': $props.isDisableArrow
|
|
176
|
-
})
|
|
174
|
+
'className': 'k-select-arrow ion-ios-arrow-down',
|
|
175
|
+
'disabled': $props.isDisableArrow
|
|
177
176
|
}) : undefined;
|
|
178
177
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
179
178
|
var block = $blocks['suffix'];
|
|
@@ -33,10 +33,6 @@ var defaults = deepDefaults({
|
|
|
33
33
|
return "1px solid " + theme.color.primary;
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
-
get iconColor() {
|
|
37
|
-
return theme.color.placeholder;
|
|
38
|
-
},
|
|
39
|
-
|
|
40
36
|
get activeColor() {
|
|
41
37
|
return theme.color.primary;
|
|
42
38
|
},
|
|
@@ -46,7 +42,6 @@ var defaults = deepDefaults({
|
|
|
46
42
|
},
|
|
47
43
|
|
|
48
44
|
suffixGap: '10px',
|
|
49
|
-
disabledArrowColor: '#e5e5e5',
|
|
50
45
|
clearGap: "8px",
|
|
51
46
|
|
|
52
47
|
get placeholderColor() {
|
|
@@ -94,7 +89,7 @@ var defaults = deepDefaults({
|
|
|
94
89
|
},
|
|
95
90
|
tag: {
|
|
96
91
|
margin: "3px 8px 3px 0",
|
|
97
|
-
padding: "
|
|
92
|
+
padding: "1px 8px",
|
|
98
93
|
|
|
99
94
|
get borderRadius() {
|
|
100
95
|
return theme.borderRadius;
|
|
@@ -104,13 +99,13 @@ var defaults = deepDefaults({
|
|
|
104
99
|
return theme.color.bg;
|
|
105
100
|
},
|
|
106
101
|
|
|
107
|
-
disabledBgColor: '#
|
|
102
|
+
disabledBgColor: '#f8f9fa',
|
|
108
103
|
delete: {
|
|
109
104
|
gap: "8px",
|
|
110
105
|
fontSize: '14px',
|
|
111
106
|
|
|
112
107
|
get color() {
|
|
113
|
-
return theme.color.
|
|
108
|
+
return theme.color.lightBlack;
|
|
114
109
|
}
|
|
115
110
|
|
|
116
111
|
}
|
|
@@ -164,21 +159,6 @@ var defaults = deepDefaults({
|
|
|
164
159
|
multipleGap: "1px",
|
|
165
160
|
multipleMargin: "0 2px 1px 0"
|
|
166
161
|
};
|
|
167
|
-
|
|
168
|
-
if (size === 'large') {
|
|
169
|
-
// use default padding for large size
|
|
170
|
-
Object.defineProperty(memo.large, 'padding', {
|
|
171
|
-
get: function get() {
|
|
172
|
-
return "0 " + theme.default.padding;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
Object.defineProperty(memo.large, 'fontSize', {
|
|
176
|
-
get: function get() {
|
|
177
|
-
return theme.default.fontSize;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
162
|
return memo;
|
|
183
163
|
}, {}));
|
|
184
164
|
var select;
|
|
@@ -188,7 +168,7 @@ setDefault(function () {
|
|
|
188
168
|
}).select;
|
|
189
169
|
});
|
|
190
170
|
export default function makeStyles() {
|
|
191
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;vertical-align:middle;position:relative;width:", select.width, ";cursor:pointer;outline:none;border:", select.border, ";background:", select.bgColor, ";transition:border ", select.transition, ",background ", select.transition, ",box-shadow ", select.transition, ";border-radius:", select.borderRadius, ";.k-select-main{flex:1;min-width:0;}.k-select-prefix,.k-select-suffix{
|
|
171
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;vertical-align:middle;position:relative;width:", select.width, ";cursor:pointer;outline:none;border:", select.border, ";background:", select.bgColor, ";transition:border ", select.transition, ",background ", select.transition, ",box-shadow ", select.transition, ";border-radius:", select.borderRadius, ";.k-select-main{flex:1;min-width:0;}.k-select-prefix,.k-select-suffix{position:relative;}.k-select-suffix{margin-left:", select.suffixGap, ";margin-top:2px;}.k-select-placeholder{color:", select.placeholderColor, ";user-select:none;}&.k-fluid{width:100%;}.k-select-clear{opacity:0;transition:opacity ", select.transition, ",color ", select.transition, "!important;pointer-events:none;position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%, -50%);}&:hover{border:", select.hoverBorder, ";.k-select-clear.k-show{opacity:1;pointer-events:all;+.k-select-suffix-icon{opacity:0;}}}.k-select-suffix-icon{display:inline-block;transition:opacity ", select.transition, ";}.k-select-arrow{display:inline-block;transition:transform ", select.transition, ";}&.k-dropdown-open{border:", select.focusBorder, ";.k-select-arrow{transform:rotateX(180deg);}}&:focus{outline:none;border:", select.focusBorder, ";}&.k-disabled{color:", select.disabled.color, ";cursor:not-allowed;background:", select.disabled.bgColor, ";border-color:", select.disabled.borderColor, ";.k-select-tag{background:", select.tag.disabledBgColor, ";}}.k-select-values{display:inline-block;margin-right:-", getRight(select.tag.margin), ";width:100%;&.k-with-values{margin:0;}}.k-select-tag{display:inline-flex;align-items:center;padding:", select.tag.padding, ";background:", select.tag.bgColor, ";border-radius:", select.tag.borderRadius, ";margin:", select.tag.margin, ";max-width:calc(100% - ", getRight(select.tag.margin), " - 1px);}.k-select-text{max-width:calc(100% - 18px);word-break:break-word;}.k-select-close{margin-left:", select.tag.delete.gap, ";font-size:", select.tag.delete.fontSize, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
192
172
|
var styles = select[size];
|
|
193
173
|
var className = /*#__PURE__*/css("font-size:", styles.fontSize, ";min-height:", styles.height, ";padding:", styles.padding, ";");
|
|
194
174
|
if (size === 'default') return className;
|
|
@@ -6,16 +6,16 @@ import { Input } from '../input';
|
|
|
6
6
|
import { getRestProps } from '../utils';
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
8
|
var _$tmp0 = {
|
|
9
|
-
'className': 'k-spinner-icon
|
|
9
|
+
'className': 'k-spinner-icon k-icon-minus-small'
|
|
10
10
|
};
|
|
11
11
|
var _$tmp1 = {
|
|
12
|
-
'className': 'k-spinner-icon
|
|
12
|
+
'className': 'k-spinner-icon k-icon-arrow-down'
|
|
13
13
|
};
|
|
14
14
|
var _$tmp2 = {
|
|
15
|
-
'className': 'k-spinner-icon
|
|
15
|
+
'className': 'k-spinner-icon k-icon-add-small'
|
|
16
16
|
};
|
|
17
17
|
var _$tmp3 = {
|
|
18
|
-
'className': 'k-spinner-icon
|
|
18
|
+
'className': 'k-spinner-icon k-icon-arrow-up'
|
|
19
19
|
};
|
|
20
20
|
export default function ($props, $blocks, $__proto__) {
|
|
21
21
|
var _classNameObj;
|
|
@@ -49,6 +49,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
49
49
|
'disabled': this.isDisabledDecrease(),
|
|
50
50
|
'className': 'k-spinner-btn k-left',
|
|
51
51
|
'size': size,
|
|
52
|
+
'type': 'none',
|
|
52
53
|
'children': !vertical ? _$cc(Icon, _$tmp0) : _$cc(Icon, _$tmp1)
|
|
53
54
|
}), _$cc(Input, {
|
|
54
55
|
'className': 'k-spinner-input',
|
|
@@ -65,6 +66,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
65
66
|
'disabled': this.isDisabledIncrease(),
|
|
66
67
|
'className': 'k-spinner-btn k-right',
|
|
67
68
|
'size': size,
|
|
69
|
+
'type': 'none',
|
|
68
70
|
'children': !vertical ? _$cc(Icon, _$tmp2) : _$cc(Icon, _$tmp3)
|
|
69
71
|
})]);
|
|
70
72
|
}
|
|
@@ -4,13 +4,41 @@ import { deepDefaults, sizes } from '../../styles/utils';
|
|
|
4
4
|
import { theme, setDefault } from '../../styles/theme';
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
var defaults = {
|
|
7
|
+
get borderRadius() {
|
|
8
|
+
return theme.borderRadius;
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
get border() {
|
|
12
|
+
return "1px solid " + theme.color.border;
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
get hoverBorderColor() {
|
|
16
|
+
return theme.color.primary;
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
get hoverBtnBg() {
|
|
20
|
+
return theme.color.bg;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
get disabledBorderColor() {
|
|
24
|
+
return theme.color.disabledBorder;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
get disabledBg() {
|
|
28
|
+
return theme.color.disabledBg;
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
get disabledColor() {
|
|
32
|
+
return theme.color.disabled;
|
|
33
|
+
},
|
|
34
|
+
|
|
7
35
|
default: {
|
|
8
36
|
inputWidth: '46px',
|
|
9
|
-
iconFontSize: '
|
|
37
|
+
iconFontSize: '16px'
|
|
10
38
|
},
|
|
11
39
|
large: {
|
|
12
40
|
inputWidth: '60px',
|
|
13
|
-
iconFontSize: '
|
|
41
|
+
iconFontSize: '24px'
|
|
14
42
|
},
|
|
15
43
|
small: {
|
|
16
44
|
inputWidth: '32px',
|
|
@@ -42,9 +70,9 @@ setDefault(function () {
|
|
|
42
70
|
}).spinner;
|
|
43
71
|
});
|
|
44
72
|
export function makeStyles() {
|
|
45
|
-
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;
|
|
73
|
+
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;border:", spinner.border, ";border-radius:", spinner.borderRadius, ";&:hover{border-color:", spinner.hoverBorderColor, ";.k-spinner-btn{background:", spinner.hoverBtnBg, ";}.k-left{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}.k-right{border-radius:0 ", spinner.borderRadius, " ", spinner.borderRadius, " 0;}}.k-spinner-input{width:", spinner.default.inputWidth, ";.k-input-inner{text-align:center;border:none;border-radius:0;&:hover,&:focus{border:none;}}}.k-spinner-icon{font-size:", spinner.default.iconFontSize, ";}&.k-vertical{position:relative;font-size:0;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
46
74
|
var generate = function generate() {
|
|
47
|
-
return "\n .k-spinner-input {\n padding-right:
|
|
75
|
+
return "\n .k-spinner-input {\n padding-right: " + theme[size].height + ";\n width: " + spinner.vertical[size].width + ";\n }\n ";
|
|
48
76
|
};
|
|
49
77
|
|
|
50
78
|
if (size === 'default') {
|
|
@@ -52,7 +80,7 @@ export function makeStyles() {
|
|
|
52
80
|
} else {
|
|
53
81
|
return "\n &.k-" + size + " {\n " + generate() + "\n }\n ";
|
|
54
82
|
}
|
|
55
|
-
}), ";.k-spinner-btn{position:absolute;right:0;margin:0;height:calc(50%
|
|
83
|
+
}), ";.k-spinner-btn{position:absolute;right:0;margin:0;height:calc(50% - 2px);line-height:50%;}.k-spinner-icon{font-size:inherit!important;}.k-spinner-btn.k-left{bottom:1px;border-radius:0 0 ", spinner.borderRadius, " 0;}.k-spinner-btn.k-right{top:1px;border-radius:0 ", spinner.borderRadius, " 0 0;}.k-spinner-input{font-size:0;.k-input-inner{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}}}&.k-disabled{border-color:", spinner.disabledBorderColor, ";background:", spinner.disabledBg, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
56
84
|
var styles = spinner[size];
|
|
57
85
|
|
|
58
86
|
var generate = function generate() {
|
|
@@ -2,8 +2,8 @@ import { Component, TypeDefs } from 'intact-vue-next';
|
|
|
2
2
|
export * from './step';
|
|
3
3
|
export interface StepsProps {
|
|
4
4
|
value?: number;
|
|
5
|
-
status?: 'normal' | 'error';
|
|
6
|
-
type?: 'default' | 'line' | 'simple';
|
|
5
|
+
status?: 'normal' | 'error' | 'done';
|
|
6
|
+
type?: 'default' | 'line' | 'simple' | 'line-compact' | 'dot';
|
|
7
7
|
clickable?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare class Steps extends Component<StepsProps> {
|
|
@@ -6,8 +6,8 @@ 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'],
|
|
9
|
+
status: ['normal', 'error', 'done'],
|
|
10
|
+
type: ['default', 'line', 'simple', 'line-compact', 'dot'],
|
|
11
11
|
clickable: Boolean
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -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-vue-next';
|
|
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
|
|
|
@@ -25,22 +33,23 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
33
|
var value = _ref.value,
|
|
26
34
|
status = _ref.status,
|
|
27
35
|
width = _ref.width,
|
|
28
|
-
onChange = _ref.onChange
|
|
36
|
+
onChange = _ref.onChange,
|
|
37
|
+
type = _ref.type;
|
|
29
38
|
var selected = value === index;
|
|
30
39
|
var error = selected && status === 'error';
|
|
40
|
+
var done = value > index;
|
|
31
41
|
var classNameObj = (_classNameObj = {
|
|
32
42
|
'k-step': true,
|
|
33
43
|
'k-active': selected,
|
|
34
|
-
'k-done':
|
|
44
|
+
'k-done': done,
|
|
35
45
|
'k-error': error
|
|
36
|
-
}, _classNameObj[className] = className, _classNameObj
|
|
46
|
+
}, _classNameObj[className] = className, _classNameObj);
|
|
37
47
|
return _$cv('div', _extends({}, getRestProps(_this), {
|
|
38
48
|
'className': _$cn(classNameObj),
|
|
39
|
-
'style':
|
|
40
|
-
|
|
41
|
-
}),
|
|
49
|
+
'style': style
|
|
50
|
+
}), [_$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
51
|
'ev-click': linkEvent(index, onChange)
|
|
43
|
-
}),
|
|
52
|
+
}), _$ce(2, 'div', null, 1, 'k-step-tail')]);
|
|
44
53
|
}
|
|
45
54
|
});
|
|
46
55
|
}
|
|
@@ -4,137 +4,116 @@ 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',
|
|
24
|
-
|
|
25
|
-
get innerBorder() {
|
|
26
|
-
return "1px solid " + theme.color.placeholder;
|
|
27
|
-
},
|
|
17
|
+
get markColor() {
|
|
18
|
+
return theme.color.placeholder;
|
|
19
|
+
},
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
get markborder() {
|
|
22
|
+
return "1px solid " + theme.color.placeholder;
|
|
31
23
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
|
|
25
|
+
markBgColor: '#fff',
|
|
26
|
+
default: {
|
|
27
|
+
get height() {
|
|
28
|
+
return theme.default.height;
|
|
35
29
|
},
|
|
36
30
|
|
|
37
|
-
get
|
|
38
|
-
return
|
|
31
|
+
get bgColor() {
|
|
32
|
+
return theme.color.bg;
|
|
39
33
|
},
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
markWidth: '16px'
|
|
42
36
|
},
|
|
43
37
|
// done
|
|
44
38
|
done: {
|
|
45
|
-
get
|
|
39
|
+
get markColor() {
|
|
46
40
|
return theme.color.primary;
|
|
47
41
|
},
|
|
48
42
|
|
|
49
|
-
get
|
|
43
|
+
get markBorderColor() {
|
|
50
44
|
return theme.color.primary;
|
|
51
45
|
},
|
|
52
46
|
|
|
53
|
-
|
|
47
|
+
markBgColor: '#fff',
|
|
54
48
|
|
|
55
49
|
get mainColor() {
|
|
56
50
|
return theme.color.primary;
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
get simpleColor() {
|
|
60
|
-
return theme.color.text;
|
|
61
51
|
}
|
|
62
52
|
|
|
63
53
|
},
|
|
64
54
|
// active
|
|
65
55
|
active: {
|
|
66
|
-
|
|
56
|
+
markColor: '#fff',
|
|
67
57
|
|
|
68
|
-
get
|
|
58
|
+
get markBorderColor() {
|
|
69
59
|
return theme.color.primary;
|
|
70
60
|
},
|
|
71
61
|
|
|
72
|
-
get
|
|
62
|
+
get markBgColor() {
|
|
73
63
|
return theme.color.primary;
|
|
74
64
|
},
|
|
75
65
|
|
|
76
66
|
get mainColor() {
|
|
77
67
|
return theme.color.primary;
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
get simpleColor() {
|
|
81
|
-
return theme.color.primary;
|
|
82
68
|
}
|
|
83
69
|
|
|
84
70
|
},
|
|
85
71
|
// error
|
|
86
72
|
error: {
|
|
87
|
-
get
|
|
73
|
+
get markColor() {
|
|
88
74
|
return theme.color.danger;
|
|
89
75
|
},
|
|
90
76
|
|
|
91
|
-
get
|
|
77
|
+
get markBorderColor() {
|
|
92
78
|
return theme.color.danger;
|
|
93
79
|
},
|
|
94
80
|
|
|
95
|
-
|
|
81
|
+
markBgColor: '#fff',
|
|
96
82
|
|
|
97
83
|
get mainColor() {
|
|
98
84
|
return theme.color.danger;
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
get simpleColor() {
|
|
102
|
-
return theme.color.danger;
|
|
103
85
|
}
|
|
104
86
|
|
|
105
87
|
},
|
|
106
88
|
// line
|
|
107
89
|
line: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
get tailBgColor() {
|
|
112
|
-
return theme.color.placeholder;
|
|
113
|
-
},
|
|
90
|
+
markWidth: '32px',
|
|
91
|
+
markFontSize: '24px',
|
|
114
92
|
|
|
115
|
-
get
|
|
116
|
-
return theme.color.
|
|
93
|
+
get lineColor() {
|
|
94
|
+
return theme.color.border;
|
|
117
95
|
},
|
|
118
96
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
headTop: '16px',
|
|
123
|
-
titleFontSize: '14px',
|
|
124
|
-
titleGopTop: '16px',
|
|
125
|
-
iconLineHeight: '30px',
|
|
126
|
-
tailTop: '16px',
|
|
127
|
-
width: '160px'
|
|
97
|
+
titleGap: '16px',
|
|
98
|
+
descGap: '4px',
|
|
99
|
+
contentMaxWidth: '200px'
|
|
128
100
|
},
|
|
129
101
|
// simple
|
|
130
102
|
simple: {
|
|
131
|
-
|
|
103
|
+
markWidth: '12px',
|
|
104
|
+
|
|
105
|
+
get markBgColor() {
|
|
106
|
+
return theme.color.placeholder;
|
|
107
|
+
},
|
|
132
108
|
|
|
133
|
-
get
|
|
134
|
-
return theme.color.
|
|
109
|
+
get doneMarkBgColor() {
|
|
110
|
+
return theme.color.primary;
|
|
135
111
|
},
|
|
136
112
|
|
|
137
|
-
|
|
113
|
+
get errorMarkBgColor() {
|
|
114
|
+
return theme.color.danger;
|
|
115
|
+
}
|
|
116
|
+
|
|
138
117
|
}
|
|
139
118
|
};
|
|
140
119
|
var steps;
|
|
@@ -145,14 +124,40 @@ setDefault(function () {
|
|
|
145
124
|
});
|
|
146
125
|
var stepStatus = ['done', 'active', 'error'];
|
|
147
126
|
export function makeStepsStyles() {
|
|
148
|
-
return /*#__PURE__*/css("display:flex;&.k-default,&.k-line{",
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
127
|
+
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;}}");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function makeDefaultStyles() {
|
|
131
|
+
var defaults = steps.default;
|
|
132
|
+
return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.k-step-wrapper{", center(), ";height:100%;}.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;}}.k-step-tail{position:absolute;top:0;right:calc(-1 * (", defaults.height, " / 2 + ", steps.gap, "));width:calc(", defaults.height, " / 2 + ", steps.gap, ");height:", defaults.height, ";overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;top:calc(-1 * ", steps.gap, ");}&:after{border-left-color:", defaults.bgColor, ";left:calc(-1 * ", steps.gap, ");}&:before{border-left-color:#fff;left:0;}}.k-step:not(:first-of-type){padding-left:calc(", defaults.height, " / 2 + ", steps.gap, ");}");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function makeLineStyles() {
|
|
136
|
+
var line = defaults.line;
|
|
137
|
+
return /*#__PURE__*/css(".k-step{display:flex;}.k-step-wrapper{display:inline-block;text-align:center;position:relative;}.k-step:last-of-type{flex:0 0 auto;}.k-step-mark{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, ";max-width:", line.contentMaxWidth, ";}.k-step-wrapper{&:before,&:after{content:'';display:block;height:1px;background:", line.lineColor, ";width:50%;position:absolute;top:calc(", line.markWidth, " / 2);}&: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:1px;background:", line.lineColor, ";margin-top:calc(", line.markWidth, " / 2);}.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, ";}}");
|
|
155
138
|
}
|
|
156
|
-
|
|
157
|
-
|
|
139
|
+
|
|
140
|
+
function makeLineCompactStyles() {
|
|
141
|
+
var line = defaults.line;
|
|
142
|
+
return /*#__PURE__*/css(".k-step-wrapper{display:inline-flex;text-align:left;&: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:1px;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, ";}}}");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function makeSimpleStyles() {
|
|
146
|
+
var simple = defaults.simple;
|
|
147
|
+
return /*#__PURE__*/css(".k-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.k-step-wrapper{font-size:0;&:before,&:after{top:calc(", simple.markWidth, " / 2);}}.k-step-main{font-size:", theme.default.fontSize, ";}.k-step-tail{margin-top:calc(", simple.markWidth, " / 2);}.k-step{&.k-done{.k-step-mark{background:", simple.doneMarkBgColor, ";}}&.k-error{.k-step-mark{background:", simple.errorMarkBgColor, ";}}}");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function center(flex) {
|
|
151
|
+
if (flex === void 0) {
|
|
152
|
+
flex = 'flex';
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return /*#__PURE__*/css("display:", flex, ";align-items:center;justify-content:center;");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function makeCommonStyles() {
|
|
159
|
+
return /*#__PURE__*/css(".k-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
|
|
160
|
+
var styles = steps[status];
|
|
161
|
+
return /*#__PURE__*/css("&.k-", status, "{.k-step-mark{color:", styles.markColor, ";border-color:", styles.markBorderColor, ";background:", styles.markBgColor, ";}.k-step-main{color:", styles.mainColor, ";}}");
|
|
162
|
+
}), ";}.k-step-mark{", center('inline-flex'), ";border:", steps.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
|
|
158
163
|
}
|