@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
|
@@ -1,68 +1,54 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
|
-
import { deepDefaults, sizes } from '../../styles/utils';
|
|
4
|
+
import { deepDefaults, sizes, palette } from '../../styles/utils';
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
var defaults = {
|
|
7
7
|
get transition() {
|
|
8
8
|
return theme.transition.middle;
|
|
9
9
|
},
|
|
10
10
|
|
|
11
|
-
bgColor
|
|
12
|
-
fontSize: "12px",
|
|
13
|
-
|
|
14
|
-
get color() {
|
|
15
|
-
return theme.color.text;
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
checkedBgColor: "#fff",
|
|
19
|
-
handleBorderRadius: "100%",
|
|
20
|
-
|
|
21
|
-
get handleBgColor() {
|
|
11
|
+
get bgColor() {
|
|
22
12
|
return theme.color.border;
|
|
23
13
|
},
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
fontSize: "12px",
|
|
16
|
+
color: '#fff',
|
|
17
|
+
handleBorderRadius: "100%",
|
|
18
|
+
handleBgColor: '#fff',
|
|
29
19
|
// checked
|
|
30
20
|
checked: {
|
|
31
|
-
get
|
|
32
|
-
return theme.color.primary;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
get color() {
|
|
21
|
+
get bgColor() {
|
|
36
22
|
return theme.color.primary;
|
|
37
23
|
},
|
|
38
24
|
|
|
39
|
-
get
|
|
40
|
-
return theme.color.primary;
|
|
25
|
+
get disabledBgColor() {
|
|
26
|
+
return palette(theme.color.primary, -3);
|
|
41
27
|
}
|
|
42
28
|
|
|
43
29
|
},
|
|
44
30
|
// default
|
|
45
31
|
default: {
|
|
46
|
-
width: "
|
|
47
|
-
height: "
|
|
48
|
-
padding: "
|
|
32
|
+
width: "45px",
|
|
33
|
+
height: "24px",
|
|
34
|
+
padding: "3px"
|
|
49
35
|
},
|
|
50
36
|
// large
|
|
51
37
|
large: {
|
|
52
|
-
width: "
|
|
53
|
-
height: "
|
|
54
|
-
padding: "
|
|
38
|
+
width: "58px",
|
|
39
|
+
height: "30px",
|
|
40
|
+
padding: "3px"
|
|
55
41
|
},
|
|
56
42
|
// small
|
|
57
43
|
small: {
|
|
58
|
-
width: "
|
|
44
|
+
width: "30px",
|
|
59
45
|
height: "16px",
|
|
60
46
|
padding: "2px"
|
|
61
47
|
},
|
|
62
48
|
// mini
|
|
63
49
|
mini: {
|
|
64
|
-
width: "
|
|
65
|
-
height: "
|
|
50
|
+
width: "18px",
|
|
51
|
+
height: "10px",
|
|
66
52
|
padding: "1px"
|
|
67
53
|
},
|
|
68
54
|
|
|
@@ -79,11 +65,11 @@ setDefault(function () {
|
|
|
79
65
|
}).switch;
|
|
80
66
|
});
|
|
81
67
|
export function makeStyles() {
|
|
82
|
-
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;
|
|
68
|
+
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;input{opacity:0;position:absolute;}.k-switch-bar,.k-switch-off{box-sizing:border-box;}.k-switch-bar{position:absolute;text-align:right;overflow:hidden;}.k-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.k-switch-bar,.k-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}.k-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.k-switch-on,.k-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.k-dragging{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
83
69
|
var _kswitch$size = kswitch[size],
|
|
84
70
|
width = _kswitch$size.width,
|
|
85
71
|
height = _kswitch$size.height,
|
|
86
72
|
padding = _kswitch$size.padding;
|
|
87
73
|
return /*#__PURE__*/css("&.k-", size, ",&.k-", size, " .k-switch-on,&.k-", size, " .k-switch-off{width:", width, ";height:", height, ";}&.k-", size, "{border-radius:", height, ";.k-switch-bar{width:", height, ";border-radius:", height, ";}.k-switch-wrapper{padding:", padding, ";}.k-switch-on,.k-switch-off{line-height:", height, ";left:0;}.k-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.k-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
|
|
88
|
-
}), "&.k-checked{
|
|
74
|
+
}), "&.k-checked{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";}.k-switch-bar{width:100%;}}&.k-disabled{&,.k-switch-handle{cursor:not-allowed;}&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.k-checked{&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
|
|
89
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js/instance/sort";
|
|
2
|
-
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn, map as _$ma } from 'intact-vue-next';
|
|
2
|
+
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact-vue-next';
|
|
3
3
|
import { getClassAndStyleForFixed } from './useFixedColumns';
|
|
4
4
|
import { Dropdown, DropdownMenu, DropdownItem } from '../dropdown';
|
|
5
5
|
import { Button } from '../button';
|
|
@@ -14,13 +14,18 @@ import { context as TableContext } from './useColumns';
|
|
|
14
14
|
import { context as ResizableContext } from './useResizable';
|
|
15
15
|
import { context as FixedColumnsContext } from './useFixedColumns';
|
|
16
16
|
import { stopPropagation } from '../utils';
|
|
17
|
+
import { Input } from '../input';
|
|
18
|
+
import { _$ } from '../../i18n';
|
|
17
19
|
var _$tmp0 = {
|
|
18
20
|
'className': 'ion-android-arrow-dropdown'
|
|
19
21
|
};
|
|
20
22
|
var _$tmp1 = {
|
|
21
|
-
'className': 'ion-
|
|
23
|
+
'className': 'ion-ios-search'
|
|
22
24
|
};
|
|
23
25
|
var _$tmp2 = {
|
|
26
|
+
'className': 'ion-android-arrow-dropup k-asc'
|
|
27
|
+
};
|
|
28
|
+
var _$tmp3 = {
|
|
24
29
|
'className': 'ion-android-arrow-dropdown k-desc'
|
|
25
30
|
};
|
|
26
31
|
export default function ($props, $blocks, $__proto__) {
|
|
@@ -45,7 +50,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
45
50
|
var _this$group = this.group,
|
|
46
51
|
onSelect = _this$group.onSelect,
|
|
47
52
|
isChecked = _this$group.isChecked,
|
|
48
|
-
getGroupText = _this$group.getGroupText
|
|
53
|
+
getGroupText = _this$group.getGroupText,
|
|
54
|
+
keywords = _this$group.keywords,
|
|
55
|
+
filteredGroup = _this$group.filteredGroup;
|
|
49
56
|
return _$cc(TableContext.Consumer, {
|
|
50
57
|
'children': function children(checkType) {
|
|
51
58
|
return _$cc(GroupContext.Consumer, {
|
|
@@ -98,17 +105,46 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
98
105
|
collision: 'flipfit'
|
|
99
106
|
},
|
|
100
107
|
'key': 'dropdown',
|
|
108
|
+
'trigger': 'click',
|
|
109
|
+
'ev-show': function evShow() {
|
|
110
|
+
return keywords.set('');
|
|
111
|
+
},
|
|
101
112
|
'children': [_$cc(Button, {
|
|
102
113
|
'icon': true,
|
|
103
114
|
'size': 'mini',
|
|
104
115
|
'className': 'k-table-group',
|
|
105
|
-
'ev-click':
|
|
116
|
+
'ev-click': function evClick(e) {
|
|
117
|
+
return e._ignoreSortable = true;
|
|
118
|
+
},
|
|
106
119
|
'children': _$cc(Icon, _$tmp0)
|
|
107
120
|
}), _$cc(DropdownMenu, {
|
|
108
121
|
'className': _$cn((_$cn2 = {
|
|
109
122
|
"k-table-group-dropdown": true
|
|
110
123
|
}, _$cn2[makeGroupMenuStyles()] = true, _$cn2)),
|
|
111
|
-
'children': _$
|
|
124
|
+
'children': [_$ce(2, 'div', _$cc(Input, {
|
|
125
|
+
'size': 'small',
|
|
126
|
+
'fluid': true,
|
|
127
|
+
'placeholder': _$('请输入关键字'),
|
|
128
|
+
'value': keywords.value,
|
|
129
|
+
'ev-$change:value': keywords.set,
|
|
130
|
+
'clearable': true,
|
|
131
|
+
'$blocks': function ($blocks) {
|
|
132
|
+
var _$blocks = {},
|
|
133
|
+
__$blocks = _$ex({}, $blocks);
|
|
134
|
+
|
|
135
|
+
return (_$blocks['suffix'] = function ($super) {
|
|
136
|
+
return _$cc(Icon, _$tmp1);
|
|
137
|
+
}, __$blocks['suffix'] = function ($super, data) {
|
|
138
|
+
var block = $blocks['suffix'];
|
|
139
|
+
|
|
140
|
+
var callBlock = function callBlock() {
|
|
141
|
+
return _$blocks['suffix'].call($this, $super, data);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
145
|
+
}), __$blocks;
|
|
146
|
+
}.call($this, _$em)
|
|
147
|
+
}), 2, 'k-table-group-header'), _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
|
|
112
148
|
return _$cc(DropdownItem, {
|
|
113
149
|
'ev-select': function evSelect() {
|
|
114
150
|
return onSelect($value.value, groupValue, onChange);
|
|
@@ -122,9 +158,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
122
158
|
'children': $value.label
|
|
123
159
|
}) : _$ce(2, 'span', $value.label, 0)
|
|
124
160
|
});
|
|
125
|
-
}, $this)
|
|
161
|
+
}, $this), 4, 'k-table-group-body')]
|
|
126
162
|
})]
|
|
127
|
-
}, 'dropdown') : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, _$
|
|
163
|
+
}, 'dropdown') : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, _$tmp2), _$cc(Icon, _$tmp3)], 4, _$cn((_$cn3 = {
|
|
128
164
|
'k-column-sort': true
|
|
129
165
|
}, _$cn3["k-" + type] = type, _$cn3))) : undefined], 0, 'k-table-title')], 0, _$cn(classNameObj), {
|
|
130
166
|
'style': style,
|
|
@@ -352,7 +352,7 @@ describe('Table', function () {
|
|
|
352
352
|
_instance$refs4 = instance.refs, __test1 = _instance$refs4.__test1, __test2 = _instance$refs4.__test2;
|
|
353
353
|
_element$querySelecto8 = element.querySelectorAll('.k-table'), table1 = _element$querySelecto8[0], table2 = _element$querySelecto8[1];
|
|
354
354
|
icon = table1.querySelector('.k-table-group');
|
|
355
|
-
dispatchEvent(icon, '
|
|
355
|
+
dispatchEvent(icon, 'click');
|
|
356
356
|
_context7.next = 7;
|
|
357
357
|
return wait();
|
|
358
358
|
|
|
@@ -370,7 +370,7 @@ describe('Table', function () {
|
|
|
370
370
|
});
|
|
371
371
|
expect(table1.innerHTML).to.matchSnapshot();
|
|
372
372
|
icon2 = table2.querySelector('.k-table-group');
|
|
373
|
-
dispatchEvent(icon2, '
|
|
373
|
+
dispatchEvent(icon2, 'click');
|
|
374
374
|
_context7.next = 19;
|
|
375
375
|
return wait();
|
|
376
376
|
|
|
@@ -10,7 +10,12 @@ var defaults = {
|
|
|
10
10
|
},
|
|
11
11
|
|
|
12
12
|
// transition: '15000s',
|
|
13
|
-
border: "1px solid #
|
|
13
|
+
border: "1px solid #e2e5e8",
|
|
14
|
+
|
|
15
|
+
get borderRadius() {
|
|
16
|
+
return theme.borderRadius;
|
|
17
|
+
},
|
|
18
|
+
|
|
14
19
|
fontSize: "12px",
|
|
15
20
|
bgColor: "#fff",
|
|
16
21
|
|
|
@@ -30,7 +35,7 @@ var defaults = {
|
|
|
30
35
|
fontSize: "12px",
|
|
31
36
|
fontWeight: "bold",
|
|
32
37
|
textAlign: 'left',
|
|
33
|
-
height: "
|
|
38
|
+
height: "40px",
|
|
34
39
|
delimiterHeight: '12px',
|
|
35
40
|
delimiterColor: '#bfbfbf'
|
|
36
41
|
},
|
|
@@ -53,6 +58,12 @@ var defaults = {
|
|
|
53
58
|
|
|
54
59
|
get activeColor() {
|
|
55
60
|
return theme.color.primary;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
headerPadding: "8px",
|
|
64
|
+
|
|
65
|
+
get headerBorder() {
|
|
66
|
+
return "1px solid " + theme.color.bg;
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
},
|
|
@@ -60,7 +71,7 @@ var defaults = {
|
|
|
60
71
|
sort: {
|
|
61
72
|
iconHeight: "7px",
|
|
62
73
|
gap: "10px",
|
|
63
|
-
color: "#
|
|
74
|
+
color: "#d0d5d9",
|
|
64
75
|
disabledColor: "#ddd"
|
|
65
76
|
},
|
|
66
77
|
expandBgColor: '#fdfcff',
|
|
@@ -84,10 +95,10 @@ setDefault(function () {
|
|
|
84
95
|
}).table;
|
|
85
96
|
});
|
|
86
97
|
export function makeStyles() {
|
|
87
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";
|
|
98
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.k-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;td,th{transition:all ", table.transition, ";}}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.k-table-title{display:inline-flex;align-items:center;max-width:100%;color:", theme.color.lightBlack, ";}.k-table-title-text{flex:1;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.k-fixed-left,.k-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.k-fixed-left:after{right:-11px;}.k-fixed-right:after{left:-11px;}&.k-scroll-left .k-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.k-scroll-right .k-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.k-scroll-middle{.k-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.k-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.k-fixed-right+.k-fixed-right:after{display:none;}.k-table-affix-header{position:sticky;top:0;left:0;.k-affix-wrapper{overflow:hidden;}&.k-fixed{position:relative;}}&.k-border,&.k-grid{.k-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.k-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.k-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.k-table-group{width:", table.group.width, "!important;height:", table.group.width, "!important;margin-left:", table.group.gap, ";position:relative;color:", table.group.color, ";&:hover{color:", theme.color.primary, ";}.k-icon{transition:transform ", table.transition, ";}&.k-dropdown-open .k-icon{transform:rotate(180deg);}}.k-table-check{.k-checkbox,.k-radio{position:relative;top:-1px;}}.k-column-sortable{cursor:pointer;}.k-column-sort{.k-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin-left:", _sortInstanceProperty(table).gap, ";color:", _sortInstanceProperty(table).color, ";}&.k-asc .k-icon.k-desc,&.k-desc .k-icon.k-asc{color:", _sortInstanceProperty(table).disabledColor, ";}}.k-table-spin.k-overlay{z-index:2;}.k-table-empty{text-align:center;}tr.k-expand{td{padding:0;background:#fdfcff;}}&.k-with-expand{tr:not(.k-expand){td{border-bottom:none;}}}.k-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.k-selected td{background:", table.selectedBgColor, ";}.k-table-arrow{margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.k-spreaded{.k-table-arrow{transform:rotate(90deg);}}.k-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.k-dragging{opacity:", table.draggingOpacity, ";}.k-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.k-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
88
99
|
return /*#__PURE__*/css(".k-align-", type, "{text-align:", type, ";}");
|
|
89
100
|
}), ";");
|
|
90
101
|
}
|
|
91
102
|
export function makeGroupMenuStyles() {
|
|
92
|
-
return /*#__PURE__*/css("max-height:", table.group.menuMaxHeight, ";overflow:auto;.k-dropdown-item.k-active{color:", table.group.activeColor, ";}");
|
|
103
|
+
return /*#__PURE__*/css("max-height:", table.group.menuMaxHeight, ";overflow:auto;.k-dropdown-item.k-active{color:", table.group.activeColor, ";}.k-table-group-header{padding:", table.group.headerPadding, ";border-bottom:", table.group.headerBorder, ";}");
|
|
93
104
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TableColumnGroupItem } from './column';
|
|
1
2
|
declare type ContextValue = {
|
|
2
3
|
groupValue: any;
|
|
3
4
|
onChange: (key: string, groupValue: any) => void;
|
|
@@ -10,5 +11,7 @@ export declare function useGroup(): {
|
|
|
10
11
|
onSelect: (value: any, groupValue: any, onChange: ContextValue['onChange']) => void;
|
|
11
12
|
isChecked: (value: any, groupValue: any) => any;
|
|
12
13
|
getGroupText: (groupValue: any) => string | null;
|
|
14
|
+
keywords: import("../../hooks/useState").State<string>;
|
|
15
|
+
filteredGroup: import("../../hooks/useState").State<TableColumnGroupItem[] | undefined>;
|
|
13
16
|
};
|
|
14
17
|
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
3
3
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
4
|
+
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
|
|
4
5
|
import { useInstance } from 'intact-vue-next';
|
|
5
6
|
import { isNullOrUndefined } from 'intact-shared';
|
|
6
7
|
import { toggleArray } from '../utils';
|
|
7
8
|
import { createContext } from '../context';
|
|
9
|
+
import { useState, watchState } from '../../hooks/useState';
|
|
8
10
|
export var context = createContext();
|
|
9
11
|
export function useGroup() {
|
|
10
12
|
var instance = useInstance();
|
|
13
|
+
var keywords = useState('');
|
|
14
|
+
var filteredGroup = useState(instance.get('group'));
|
|
11
15
|
|
|
12
16
|
function onSelect(value, groupValue, onChange) {
|
|
13
17
|
var _instance$get = instance.get(),
|
|
@@ -60,9 +64,28 @@ export function useGroup() {
|
|
|
60
64
|
return null;
|
|
61
65
|
}
|
|
62
66
|
|
|
67
|
+
watchState(keywords, function (v) {
|
|
68
|
+
var _instance$get4 = instance.get(),
|
|
69
|
+
_instance$get4$group = _instance$get4.group,
|
|
70
|
+
group = _instance$get4$group === void 0 ? [] : _instance$get4$group;
|
|
71
|
+
|
|
72
|
+
v = _trimInstanceProperty(v).call(v);
|
|
73
|
+
|
|
74
|
+
if (!v) {
|
|
75
|
+
filteredGroup.set(group);
|
|
76
|
+
} else {
|
|
77
|
+
filteredGroup.set(_filterInstanceProperty(group).call(group, function (item) {
|
|
78
|
+
var _context2, _context3;
|
|
79
|
+
|
|
80
|
+
return _includesInstanceProperty(_context2 = String(item.label)).call(_context2, v) || _includesInstanceProperty(_context3 = String(item.value)).call(_context3, v);
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
63
84
|
return {
|
|
64
85
|
onSelect: onSelect,
|
|
65
86
|
isChecked: isChecked,
|
|
66
|
-
getGroupText: getGroupText
|
|
87
|
+
getGroupText: getGroupText,
|
|
88
|
+
keywords: keywords,
|
|
89
|
+
filteredGroup: filteredGroup
|
|
67
90
|
};
|
|
68
91
|
}
|
|
@@ -3,5 +3,7 @@ export declare const context: {
|
|
|
3
3
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
4
|
};
|
|
5
5
|
export declare function useSortable(): {
|
|
6
|
-
onChange: (key: string
|
|
6
|
+
onChange: (key: string, event: Event & {
|
|
7
|
+
_ignoreSortable?: boolean;
|
|
8
|
+
}) => void;
|
|
7
9
|
};
|
|
@@ -8,7 +8,10 @@ export function useSortable() {
|
|
|
8
8
|
|
|
9
9
|
var count = 0;
|
|
10
10
|
|
|
11
|
-
function onChange(key) {
|
|
11
|
+
function onChange(key, event) {
|
|
12
|
+
// ignore when click group dropdown menu
|
|
13
|
+
if (event._ignoreSortable) return;
|
|
14
|
+
|
|
12
15
|
var sort = _extends({}, instance.get('sort'));
|
|
13
16
|
|
|
14
17
|
if (sort.key === key) {
|
|
@@ -7,7 +7,7 @@ export interface TabsProps<T = any> {
|
|
|
7
7
|
value?: T;
|
|
8
8
|
vertical?: boolean;
|
|
9
9
|
size?: Sizes;
|
|
10
|
-
type?: 'default' | 'card' | 'border-card' | 'no-border-card';
|
|
10
|
+
type?: 'default' | 'card' | 'border-card' | 'no-border-card' | 'flat-card';
|
|
11
11
|
closable?: boolean;
|
|
12
12
|
beforeChange?: (value: T) => boolean | Promise<boolean>;
|
|
13
13
|
}
|
package/components/tabs/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var typeDefs = {
|
|
|
13
13
|
value: null,
|
|
14
14
|
vertical: Boolean,
|
|
15
15
|
size: sizes,
|
|
16
|
-
type: ['default', 'card', 'border-card', 'no-border-card'],
|
|
16
|
+
type: ['default', 'card', 'border-card', 'no-border-card', 'flat-card'],
|
|
17
17
|
closable: Boolean,
|
|
18
18
|
beforeChange: Function
|
|
19
19
|
};
|
|
@@ -28,7 +28,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
28
28
|
wrapperRef = _this$scroll.wrapperRef;
|
|
29
29
|
var classNameObj = (_classNameObj = {
|
|
30
30
|
'k-tabs': true
|
|
31
|
-
}, _classNameObj["k-" + size] = size, _classNameObj['k-vertical'] = vertical, _classNameObj[
|
|
31
|
+
}, _classNameObj["k-size-" + size] = size, _classNameObj['k-vertical'] = vertical, _classNameObj["k-type-" + type] = true, _classNameObj["k-is-scroll"] = isScroll.value, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
32
32
|
return _$cv('div', _extends({
|
|
33
33
|
'className': _$cn(classNameObj)
|
|
34
34
|
}, getRestProps(this)), [isScroll.value ? _$cc(Button, {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
|
+
|
|
3
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
4
|
+
|
|
2
5
|
import { css } from '@emotion/css';
|
|
3
6
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
7
|
import { deepDefaults, sizes } from '../../styles/utils';
|
|
@@ -24,32 +27,28 @@ var defaults = deepDefaults({
|
|
|
24
27
|
return tabs.borderWidth + " solid " + tabs.borderColor;
|
|
25
28
|
},
|
|
26
29
|
|
|
27
|
-
margin: "0 10px",
|
|
28
|
-
|
|
29
30
|
get color() {
|
|
30
31
|
return theme.color.text;
|
|
31
32
|
},
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
closeGap: "8px",
|
|
35
|
+
// scroll
|
|
36
|
+
navigatorWidth: "20px",
|
|
37
37
|
//active
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
active: {
|
|
39
|
+
get color() {
|
|
40
|
+
return theme.color.primary;
|
|
41
|
+
},
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
bar: {
|
|
44
|
+
height: '2px',
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
46
|
+
get bgColor() {
|
|
47
|
+
return theme.color.primary;
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
+
}
|
|
50
51
|
},
|
|
51
|
-
// scroll
|
|
52
|
-
navigatorWidth: "20px",
|
|
53
52
|
// border-card
|
|
54
53
|
borderCard: {
|
|
55
54
|
get bgColor() {
|
|
@@ -61,9 +60,17 @@ var defaults = deepDefaults({
|
|
|
61
60
|
noBorderCard: {
|
|
62
61
|
get bgColor() {
|
|
63
62
|
return theme.color.bg;
|
|
64
|
-
}
|
|
63
|
+
}
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
},
|
|
66
|
+
// define size
|
|
67
|
+
size: {
|
|
68
|
+
large: {
|
|
69
|
+
padding: '24px'
|
|
70
|
+
},
|
|
71
|
+
default: {
|
|
72
|
+
padding: '16px'
|
|
73
|
+
}
|
|
67
74
|
}
|
|
68
75
|
}, sizes.reduce(function (memo, size) {
|
|
69
76
|
memo[size] = {
|
|
@@ -76,7 +83,9 @@ var defaults = deepDefaults({
|
|
|
76
83
|
},
|
|
77
84
|
|
|
78
85
|
get padding() {
|
|
79
|
-
|
|
86
|
+
var _tabs$size$size;
|
|
87
|
+
|
|
88
|
+
return "0 " + (((_tabs$size$size = tabs.size[size]) == null ? void 0 : _tabs$size$size.padding) || theme[size].padding);
|
|
80
89
|
},
|
|
81
90
|
|
|
82
91
|
get closeFontSize() {
|
|
@@ -93,8 +102,45 @@ setDefault(function () {
|
|
|
93
102
|
}).tabs;
|
|
94
103
|
});
|
|
95
104
|
export function makeStyles() {
|
|
96
|
-
return /*#__PURE__*/css(
|
|
105
|
+
return /*#__PURE__*/css(makeCommonStyles(), ";", makeScrollStyles(), ";&.k-type-default{", makeDefaultStyles(), ";}&.k-type-card{", makeDefaultStyles(), " ", makeCardStyles(), ";}&.k-type-border-card{", makeBorderCardStyles(), ";}&.k-type-no-border-card{", makeNoBorderCardStyles(), ";}");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function makeCommonStyles() {
|
|
109
|
+
var active = tabs.active;
|
|
110
|
+
var bar = active.bar;
|
|
111
|
+
return /*#__PURE__*/css("position:relative;.k-tab{cursor:pointer;display:inline-block;text-align:center;color:", tabs.color, ";position:relative;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&:hover,&.k-active{color:", active.color, ";}&.k-disabled{color:", theme.color.disabled, ";cursor:not-allowed;}}.k-tab-close{margin-right:-", tabs.closeGap, ";margin-left:", tabs.closeGap, ";position:relative;top:-1px;color:", theme.color.lightBlack, ";}.k-tabs-active-bar{transition:all ", tabs.transition, ";position:absolute;left:0;height:", bar.height, ";background:", bar.bgColor, ";bottom:calc(-", bar.height, " / 2);}&.k-vertical{display:inline-block;.k-tab{display:block;}.k-tabs-active-bar{left:auto;top:0;right:calc(-", bar.height, " / 2);width:", bar.height, ";height:auto;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
97
112
|
var styles = tabs[size];
|
|
98
|
-
return "\n &.k-" + size + " {\n .k-tab {\n font-size: " + styles.fontSize + ";\n height: " + styles.height + ";\n line-height: " + styles.height + ";\n padding: " + styles.padding + ";\n }\n .k-tab-close .k-icon {\n font-size: " + styles.closeFontSize + ";\n }\n }\n ";
|
|
113
|
+
return "\n &.k-size-" + size + " {\n .k-tab {\n font-size: " + styles.fontSize + ";\n height: " + styles.height + ";\n line-height: " + styles.height + ";\n padding: " + styles.padding + ";\n }\n .k-tab-close .k-icon {\n font-size: " + styles.closeFontSize + ";\n }\n }\n ";
|
|
99
114
|
}), ";");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function makeScrollStyles() {
|
|
118
|
+
return /*#__PURE__*/css("&:not(.k-vertical){.k-tabs-scroll{overflow:hidden;position:relative;padding-bottom:1px;margin-bottom:-1px;}&.k-tabs-border-card,&.k-tabs-no-border-card{.k-tabs-scroll{padding-bottom:0;margin-bottom:0;}}.k-tabs-wrapper{white-space:nowrap;float:left;transition:transform ", tabs.transition, ";}.k-tabs-prev,.k-tabs-next{position:absolute;top:0;width:", tabs.navigatorWidth, "!important;}.k-tabs-prev{left:0;}.k-tabs-next{right:0;}&.k-is-scroll{padding:0 ", tabs.navigatorWidth, ";}}");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function makeDefaultStyles() {
|
|
122
|
+
return /*#__PURE__*/css("border-bottom:", tabs.border, ";&.k-vertical{border-bottom:none;border-right:", tabs.border, ";}");
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function makeCardActiveBarCommonStyles() {
|
|
126
|
+
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
127
|
+
name: "1c3pzdg",
|
|
128
|
+
styles: "background:#fff;top:0;height:auto;z-index:-1"
|
|
129
|
+
} : {
|
|
130
|
+
name: "1c3pzdg",
|
|
131
|
+
styles: "background:#fff;top:0;height:auto;z-index:-1",
|
|
132
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function makeCardStyles() {
|
|
137
|
+
return /*#__PURE__*/css(".k-tab{margin:0;}.k-tabs-active-bar{", makeCardActiveBarCommonStyles(), ";border-left:", tabs.border, ";border-right:", tabs.border, ";&:before{content:'';display:block;position:absolute;height:", tabs.active.bar.height, ";background:", theme.color.primary, ";top:0;left:-", tabs.borderWidth, ";right:-", tabs.borderWidth, ";}}&.k-vertical{.k-tabs-active-bar{left:0;width:auto;border-left:none;border-right:none;border-top:", tabs.border, ";border-bottom:", tabs.border, ";&:before{width:", tabs.active.bar.height, ";left:0;right:auto;bottom:0;height:auto;}}}");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function makeBorderCardStyles() {
|
|
141
|
+
return /*#__PURE__*/css("border:", tabs.border, ";border-bottom:none;background:", tabs.borderCard.bgColor, ";.k-tab{margin:0;}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;}&.k-vertical{border-right:none;border-bottom:", tabs.border, ";.k-tabs-active-bar{width:auto;height:0;left:0;bottom:0;right:0;}}");
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function makeNoBorderCardStyles() {
|
|
145
|
+
return /*#__PURE__*/css("border-radius:", theme.borderRadius, ";.k-tab{&:before{content:'';display:block;position:absolute;background:", tabs.noBorderCard.bgColor, ";top:0;bottom:0;left:0;right:0;z-index:-1;}}.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;box-shadow:0px 0px 5px rgba(0, 0, 0, 0.08);border-radius:4px 4px 0px 0px;}&.k-vertical{border-right:none;.k-tabs-active-bar{width:auto;height:0;left:0;bottom:0;right:0;}}");
|
|
100
146
|
}
|
package/components/tag/base.js
CHANGED
package/components/tag/styles.js
CHANGED
|
@@ -5,8 +5,8 @@ import { theme, setDefault } from '../../styles/theme';
|
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
var types = ['primary', 'warning', 'danger', 'success', 'disabled'];
|
|
7
7
|
var defaults = deepDefaults({
|
|
8
|
-
get
|
|
9
|
-
return theme.color.border;
|
|
8
|
+
get border() {
|
|
9
|
+
return "1px solid " + theme.color.border;
|
|
10
10
|
},
|
|
11
11
|
|
|
12
12
|
get borderRadius() {
|
|
@@ -19,6 +19,11 @@ var defaults = deepDefaults({
|
|
|
19
19
|
|
|
20
20
|
padding: "0 8px",
|
|
21
21
|
height: '20px',
|
|
22
|
+
|
|
23
|
+
get bgColor() {
|
|
24
|
+
return theme.color.bg;
|
|
25
|
+
},
|
|
26
|
+
|
|
22
27
|
close: {
|
|
23
28
|
fontSize: '20px',
|
|
24
29
|
gap: '8px'
|
|
@@ -38,26 +43,26 @@ var defaults = deepDefaults({
|
|
|
38
43
|
|
|
39
44
|
},
|
|
40
45
|
large: {
|
|
41
|
-
padding: "0px
|
|
42
|
-
height: '
|
|
46
|
+
padding: "0px 8px",
|
|
47
|
+
height: '24px',
|
|
43
48
|
close: {
|
|
44
|
-
fontSize: '
|
|
49
|
+
fontSize: '20px',
|
|
45
50
|
gap: '12px'
|
|
46
51
|
}
|
|
47
52
|
},
|
|
48
53
|
small: {
|
|
49
54
|
padding: "0 4px",
|
|
50
|
-
height: '
|
|
55
|
+
height: '16px',
|
|
51
56
|
close: {
|
|
52
|
-
fontSize: '
|
|
57
|
+
fontSize: '12px',
|
|
53
58
|
gap: '4px'
|
|
54
59
|
}
|
|
55
60
|
},
|
|
56
61
|
mini: {
|
|
57
|
-
padding: "0
|
|
62
|
+
padding: "0 2px",
|
|
58
63
|
height: '14px',
|
|
59
64
|
close: {
|
|
60
|
-
fontSize: '
|
|
65
|
+
fontSize: '12px',
|
|
61
66
|
gap: '2px'
|
|
62
67
|
}
|
|
63
68
|
},
|
|
@@ -88,7 +93,7 @@ setDefault(function () {
|
|
|
88
93
|
}).tag;
|
|
89
94
|
});
|
|
90
95
|
export function makeStyles() {
|
|
91
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:
|
|
96
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:", tag.border, ";border-radius:", tag.borderRadius, ";font-size:", tag.fontSize, ";height:", tag.height, ";.k-tag-close{font-size:", tag.close.fontSize, ";margin-left:", tag.close.gap, ";}&.k-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
|
|
92
97
|
var styles = tag[t];
|
|
93
98
|
return /*#__PURE__*/css("&.k-", t, "{color:", styles.color, ";border-color:", styles.color, ";background:", styles.bgColor, ";}");
|
|
94
99
|
}), " ", _mapInstanceProperty(sizes).call(sizes, function (s) {
|
|
@@ -55,9 +55,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
55
55
|
'className': 'k-tip-close',
|
|
56
56
|
'children': (_$blocks['close'] = function ($super) {
|
|
57
57
|
return _$cc(Icon, {
|
|
58
|
-
'className': '
|
|
59
|
-
'size': 'large',
|
|
60
|
-
'color': type,
|
|
58
|
+
'className': 'k-icon-close',
|
|
61
59
|
'hoverable': !disabled
|
|
62
60
|
});
|
|
63
61
|
}, __$blocks['close'] = function ($super, data) {
|