@varlet/ui 1.22.0-alpha.4 → 1.22.0-alpha.65
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/es/counter/Counter.js +1 -1
- package/es/index.js +10 -0
- package/es/input/input.css +1 -1
- package/es/input/input.less +3 -1
- package/es/less.js +2 -0
- package/es/locale/en-US.js +5 -1
- package/es/locale/zh-CN.js +5 -1
- package/es/menu/Menu.js +1 -2
- package/es/pagination/Pagination.js +350 -0
- package/es/pagination/PaginationSfc.css +0 -0
- package/es/pagination/PaginationSfc.less +0 -0
- package/es/pagination/index.js +8 -0
- package/es/pagination/pagination.css +1 -0
- package/es/pagination/pagination.less +148 -0
- package/es/pagination/porps.js +43 -0
- package/es/pagination/style/index.js +8 -0
- package/es/pagination/style/less.js +8 -0
- package/es/ripple/ripple.css +1 -1
- package/es/ripple/ripple.less +7 -1
- package/es/skeleton/skeleton.css +1 -1
- package/es/skeleton/skeleton.less +3 -1
- package/es/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- package/es/style.js +2 -0
- package/es/table/Table.js +43 -0
- package/es/table/TableSfc.css +0 -0
- package/es/table/TableSfc.less +0 -0
- package/es/table/index.js +8 -0
- package/es/table/style/index.js +4 -0
- package/es/table/style/less.js +4 -0
- package/es/table/table.css +1 -0
- package/es/table/table.less +103 -0
- package/es/umdIndex.js +10 -0
- package/es/utils/elements.js +6 -6
- package/highlight/attributes.json +46 -2
- package/highlight/tags.json +19 -0
- package/highlight/web-types.json +138 -2
- package/package.json +4 -3
- package/types/index.d.ts +2 -0
- package/types/pagination.d.ts +23 -0
- package/types/table.d.ts +11 -0
- package/umd/varlet.js +3 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
@pagination-font-size: var(--font-size-md);
|
|
2
|
+
@pagination-active-color: #fff;
|
|
3
|
+
@pagination-active-bg-color: var(--color-primary);
|
|
4
|
+
@pagination-hover-bg-color: rgb(245, 245, 245);
|
|
5
|
+
@pagination-total-margin: 0 12px;
|
|
6
|
+
@pagination-item-width: 32px;
|
|
7
|
+
@pagination-item-height: 32px;
|
|
8
|
+
@pagination-item-margin: 0 6px;
|
|
9
|
+
@pagination-item-border-radius: 4px;
|
|
10
|
+
@pagination-list-bg-color: #fff;
|
|
11
|
+
@pagination-list-active-bg-color: #dbe4fd;
|
|
12
|
+
@pagination-list-active-color: var(--color-primary);
|
|
13
|
+
@pagination-input-width: 32px;
|
|
14
|
+
@pagination-simple-padding: 0 0 2px 0;
|
|
15
|
+
@pagination-disabled-color: var(--color-disabled);
|
|
16
|
+
|
|
17
|
+
:root {
|
|
18
|
+
--pagination-font-size: @pagination-font-size;
|
|
19
|
+
--pagination-active-color: @pagination-active-color;
|
|
20
|
+
--pagination-active-bg-color: @pagination-active-bg-color;
|
|
21
|
+
--pagination-hover-bg-color: @pagination-hover-bg-color;
|
|
22
|
+
--pagination-total-margin: @pagination-total-margin;
|
|
23
|
+
--pagination-item-width: @pagination-item-width;
|
|
24
|
+
--pagination-item-height: @pagination-item-height;
|
|
25
|
+
--pagination-item-margin: @pagination-item-margin;
|
|
26
|
+
--pagination-item-border-radius: @pagination-item-border-radius;
|
|
27
|
+
--pagination-list-bg-color: @pagination-list-bg-color;
|
|
28
|
+
--pagination-list-active-bg-color: @pagination-list-active-bg-color;
|
|
29
|
+
--pagination-list-active-color: @pagination-list-active-color;
|
|
30
|
+
--pagination-input-width: @pagination-input-width;
|
|
31
|
+
--pagination-simple-padding: @pagination-simple-padding;
|
|
32
|
+
--pagination-disabled-color: @pagination-disabled-color;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Mixins
|
|
36
|
+
.pagination-flex-nowrap {
|
|
37
|
+
display: flex;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.var-pagination {
|
|
43
|
+
display: flex;
|
|
44
|
+
list-style: none;
|
|
45
|
+
margin: 0;
|
|
46
|
+
font-size: var(--pagination-font-size);
|
|
47
|
+
padding: 0;
|
|
48
|
+
|
|
49
|
+
&__item {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
min-width: var(--pagination-item-width);
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
margin: var(--pagination-item-margin);
|
|
55
|
+
height: var(--pagination-item-height);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
border-radius: var(--pagination-item-border-radius);
|
|
58
|
+
outline: none;
|
|
59
|
+
transition: all 0.3s;
|
|
60
|
+
user-select: none;
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
background-color: var(--pagination-hover-bg-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&-active {
|
|
67
|
+
color: var(--pagination-active-color);
|
|
68
|
+
background-color: var(--pagination-active-bg-color) !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&-hide {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-disabled {
|
|
76
|
+
cursor: default !important;
|
|
77
|
+
color: var(--pagination-disabled-color);
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: unset;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__prev {
|
|
86
|
+
margin-left: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__total {
|
|
90
|
+
margin: var(--pagination-total-margin);
|
|
91
|
+
.pagination-flex-nowrap();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__size {
|
|
95
|
+
.pagination-flex-nowrap();
|
|
96
|
+
|
|
97
|
+
margin: var(--pagination-item-margin);
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__list {
|
|
102
|
+
background-color: var(--pagination-list-bg-color);
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
background-color: var(--pagination-hover-bg-color);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-active {
|
|
110
|
+
background-color: var(--pagination-list-active-bg-color) !important;
|
|
111
|
+
color: var(--pagination-list-active-color);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__quickly,
|
|
116
|
+
&__simple {
|
|
117
|
+
.pagination-flex-nowrap();
|
|
118
|
+
|
|
119
|
+
[var-pagination-cover] {
|
|
120
|
+
width: var(--pagination-input-width);
|
|
121
|
+
|
|
122
|
+
.var-input__wrap {
|
|
123
|
+
padding: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.var-input__input {
|
|
127
|
+
height: auto;
|
|
128
|
+
text-align: center;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__quickly {
|
|
134
|
+
margin: var(--pagination-item-margin);
|
|
135
|
+
|
|
136
|
+
[var-pagination-cover] {
|
|
137
|
+
margin-left: 6px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__size-open-icon {
|
|
142
|
+
font-size: inherit;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--simple-padding {
|
|
146
|
+
padding: var(--pagination-simple-padding);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export var props = {
|
|
2
|
+
current: {
|
|
3
|
+
type: [Number, String]
|
|
4
|
+
},
|
|
5
|
+
size: {
|
|
6
|
+
type: [Number, String],
|
|
7
|
+
default: 10
|
|
8
|
+
},
|
|
9
|
+
total: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: 0
|
|
12
|
+
},
|
|
13
|
+
maxPagerCount: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 3
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
simple: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
showSizeChanger: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
showQuickJumper: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
sizeOption: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => [10, 20, 50, 100]
|
|
36
|
+
},
|
|
37
|
+
showTotal: {
|
|
38
|
+
type: Function
|
|
39
|
+
},
|
|
40
|
+
onChange: {
|
|
41
|
+
type: Function
|
|
42
|
+
}
|
|
43
|
+
};
|
package/es/ripple/ripple.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
:root { --ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);}.var-ripple { position: absolute; transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear; top: 0; left: 0; border-radius: 50%; opacity: 0; will-change: transform, opacity; pointer-events: none; z-index: 100;}
|
package/es/ripple/ripple.less
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
@ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--ripple-cubic-bezier: @ripple-cubic-bezier;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.var-ripple {
|
|
2
8
|
position: absolute;
|
|
3
|
-
transition: transform 0.2s cubic-bezier
|
|
9
|
+
transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear;
|
|
4
10
|
top: 0;
|
|
5
11
|
left: 0;
|
|
6
12
|
border-radius: 50%;
|
package/es/skeleton/skeleton.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --skeleton-content-padding: 16px; --skeleton-card-height: 160px; --skeleton-card-border-radius: 4px; --skeleton-card-margin-bottom: 16px; --skeleton-card-background-color: rgba(0, 0, 0, 0.12); --skeleton-animation-background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.3), hsla(0, 0%, 100%, 0)); --skeleton-avatar-size: 34px; --skeleton-avatar-margin-right: 16px; --skeleton-avatar-background-color: rgba(0, 0, 0, 0.12); --skeleton-title-width: 50%; --skeleton-title-border-radius: 10px; --skeleton-title-background-color: rgba(0, 0, 0, 0.12); --skeleton-row-height: 12px; --skeleton-row-border-radius: 10px; --skeleton-row-margin-top: 10px;}@keyframes var-skeleton-animation { from { transform: translateX(-100%); } to { transform: translateX(100%); }}.var-skeleton { width: 100%;}.var-skeleton__content { padding: var(--skeleton-content-padding);}.var-skeleton__card { position: relative; overflow: hidden; width: 100%; height: var(--skeleton-card-height); background-color: var(--skeleton-card-background-color); margin-bottom: var(--skeleton-card-margin-bottom); border-radius: var(--skeleton-card-border-radius);}.var-skeleton__article { display: flex; width: 100%;}.var-skeleton__avatar { position: relative; overflow: hidden; flex-shrink: 0; width: var(--skeleton-avatar-size); height: var(--skeleton-avatar-size); border-radius:
|
|
1
|
+
:root { --skeleton-content-padding: 16px; --skeleton-card-height: 160px; --skeleton-card-border-radius: 4px; --skeleton-card-margin-bottom: 16px; --skeleton-card-background-color: rgba(0, 0, 0, 0.12); --skeleton-animation-background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.3), hsla(0, 0%, 100%, 0)); --skeleton-avatar-size: 34px; --skeleton-avatar-border-radius: 50%; --skeleton-avatar-margin-right: 16px; --skeleton-avatar-background-color: rgba(0, 0, 0, 0.12); --skeleton-title-width: 50%; --skeleton-title-border-radius: 10px; --skeleton-title-background-color: rgba(0, 0, 0, 0.12); --skeleton-row-height: 12px; --skeleton-row-border-radius: 10px; --skeleton-row-margin-top: 10px;}@keyframes var-skeleton-animation { from { transform: translateX(-100%); } to { transform: translateX(100%); }}.var-skeleton { width: 100%;}.var-skeleton__content { padding: var(--skeleton-content-padding);}.var-skeleton__card { position: relative; overflow: hidden; width: 100%; height: var(--skeleton-card-height); background-color: var(--skeleton-card-background-color); margin-bottom: var(--skeleton-card-margin-bottom); border-radius: var(--skeleton-card-border-radius);}.var-skeleton__article { display: flex; width: 100%;}.var-skeleton__avatar { position: relative; overflow: hidden; flex-shrink: 0; width: var(--skeleton-avatar-size); height: var(--skeleton-avatar-size); border-radius: var(--skeleton-avatar-border-radius); background-color: var(--skeleton-avatar-background-color); margin-right: var(--skeleton-avatar-margin-right);}.var-skeleton__section { width: 100%; padding-top: 8px;}.var-skeleton__title { position: relative; overflow: hidden; width: var(--skeleton-title-width); height: var(--skeleton-row-height); background-color: var(--skeleton-title-background-color); border-radius: var(--skeleton-title-border-radius);}.var-skeleton__row { position: relative; overflow: hidden; width: 100%; height: var(--skeleton-row-height); background-color: var(--skeleton-title-background-color); margin-top: var(--skeleton-row-margin-top); border-radius: var(--skeleton-row-border-radius);}.var-skeleton__fullscreen { position: fixed; overflow: hidden; top: 0; left: 0; bottom: 0; right: 0; background-color: var(--skeleton-title-background-color);}.var-skeleton--animation::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; animation: var-skeleton-animation 1s infinite; background: var(--skeleton-animation-background);}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
hsla(0, 0%, 100%, 0)
|
|
11
11
|
);
|
|
12
12
|
@skeleton-avatar-size: 34px;
|
|
13
|
+
@skeleton-avatar-border-radius: 50%;
|
|
13
14
|
@skeleton-avatar-margin-right: 16px;
|
|
14
15
|
@skeleton-avatar-background-color: rgba(0, 0, 0, 0.12);
|
|
15
16
|
@skeleton-title-width: 50%;
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
--skeleton-card-background-color: @skeleton-card-background-color;
|
|
28
29
|
--skeleton-animation-background: @skeleton-animation-background;
|
|
29
30
|
--skeleton-avatar-size: @skeleton-avatar-size;
|
|
31
|
+
--skeleton-avatar-border-radius: @skeleton-avatar-border-radius;
|
|
30
32
|
--skeleton-avatar-margin-right: @skeleton-avatar-margin-right;
|
|
31
33
|
--skeleton-avatar-background-color: @skeleton-avatar-background-color;
|
|
32
34
|
--skeleton-title-width: @skeleton-title-width;
|
|
@@ -75,7 +77,7 @@
|
|
|
75
77
|
flex-shrink: 0;
|
|
76
78
|
width: var(--skeleton-avatar-size);
|
|
77
79
|
height: var(--skeleton-avatar-size);
|
|
78
|
-
border-radius:
|
|
80
|
+
border-radius: var(--skeleton-avatar-border-radius);
|
|
79
81
|
background-color: var(--skeleton-avatar-background-color);
|
|
80
82
|
margin-right: var(--skeleton-avatar-margin-right);
|
|
81
83
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
|
+
import '../SnackbarSfc.css'
|
|
2
3
|
import '../../styles/elevation.css'
|
|
3
4
|
import '../../loading/loading.css'
|
|
4
5
|
import '../../button/button.css'
|
|
5
6
|
import '../../icon/icon.css'
|
|
6
7
|
import '../snackbar.css'
|
|
7
8
|
import '../coreSfc.css'
|
|
8
|
-
import '../SnackbarSfc.css'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.less'
|
|
2
|
+
import '../SnackbarSfc.less'
|
|
2
3
|
import '../../styles/elevation.less'
|
|
3
4
|
import '../../loading/loading.less'
|
|
4
5
|
import '../../button/button.less'
|
|
5
6
|
import '../../icon/icon.less'
|
|
6
7
|
import '../snackbar.less'
|
|
7
8
|
import '../coreSfc.less'
|
|
8
|
-
import '../SnackbarSfc.less'
|
package/es/style.js
CHANGED
|
@@ -31,6 +31,7 @@ import './loading/style'
|
|
|
31
31
|
import './locale/style'
|
|
32
32
|
import './menu/style'
|
|
33
33
|
import './option/style'
|
|
34
|
+
import './pagination/style'
|
|
34
35
|
import './picker/style'
|
|
35
36
|
import './popup/style'
|
|
36
37
|
import './progress/style'
|
|
@@ -53,6 +54,7 @@ import './swipe-item/style'
|
|
|
53
54
|
import './switch/style'
|
|
54
55
|
import './tab/style'
|
|
55
56
|
import './tab-item/style'
|
|
57
|
+
import './table/style'
|
|
56
58
|
import './tabs/style'
|
|
57
59
|
import './tabs-items/style'
|
|
58
60
|
import './time-picker/style'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
import { toSizeUnit } from '../utils/elements';
|
|
3
|
+
import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
4
|
+
|
|
5
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
6
|
+
|
|
7
|
+
var _hoisted_1 = {
|
|
8
|
+
class: "var-table var-elevation--1 var--box"
|
|
9
|
+
};
|
|
10
|
+
var _hoisted_2 = {
|
|
11
|
+
class: "var-table__main"
|
|
12
|
+
};
|
|
13
|
+
var _hoisted_3 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "var-table__footer"
|
|
16
|
+
};
|
|
17
|
+
export function render(_ctx, _cache) {
|
|
18
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [_createElementVNode("table", {
|
|
19
|
+
class: "var-table__table",
|
|
20
|
+
style: _normalizeStyle({
|
|
21
|
+
width: _ctx.toSizeUnit(_ctx.fullWidth)
|
|
22
|
+
})
|
|
23
|
+
}, [_renderSlot(_ctx.$slots, "default")], 4
|
|
24
|
+
/* STYLE */
|
|
25
|
+
)]), _ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_renderSlot(_ctx.$slots, "footer")])) : _createCommentVNode("v-if", true)]);
|
|
26
|
+
}
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
render,
|
|
29
|
+
name: 'VarTable',
|
|
30
|
+
props: {
|
|
31
|
+
fullWidth: {
|
|
32
|
+
type: [Number, String],
|
|
33
|
+
default: '100%'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
setup() {
|
|
38
|
+
return {
|
|
39
|
+
toSizeUnit
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --table-background: #fff; --table-border-radius: 2px; --table-thead-border-bottom: thin solid rgba(0, 0, 0, 0.12); --table-thead-th-text-color: rgba(0, 0, 0, 0.6); --table-thead-th-font-size: 14px; --table-thead-tr-border-bottom: thin solid rgba(0, 0, 0, 0.12); --table-tbody-tr-hover-background: #eee; --table-tbody-tr-border-bottom: thin solid rgba(0, 0, 0, 0.12); --table-row-height: 46px; --table-row-padding: 0 16px; --table-footer-border-top: thin solid rgba(0, 0, 0, 0.12);}.var-table { width: 100%; background: var(--table-background); border-radius: var(--table-border-radius);}.var-table * { box-sizing: border-box;}.var-table__main { width: 100%; overflow-x: auto;}.var-table__main > table { min-width: 100%; display: table; border-spacing: 0; border-collapse: collapse; line-height: normal;}.var-table__main > table thead { display: table-header-group; border-bottom: var(--table-thead-border-bottom);}.var-table__main > table thead tr th { color: var(--table-thead-th-text-color); font-size: var(--table-thead-th-font-size);}.var-table__main > table thead tr:not(:last-child) { border-bottom: var(--table-thead-tr-border-bottom);}.var-table__main > table tbody { display: table-row-group;}.var-table__main > table tbody tr { display: table-row; outline: 0; vertical-align: middle;}.var-table__main > table tbody tr:hover { background: var(--table-tbody-tr-hover-background);}.var-table__main > table tbody tr:not(:last-child) { border-bottom: var(--table-tbody-tr-border-bottom);}.var-table__main > table th { display: table-cell; height: var(--table-row-height); padding: var(--table-row-padding); font-weight: 500; text-align: left;}.var-table__main > table td { display: table-cell; padding: var(--table-row-padding); height: var(--table-row-height); text-align: left;}.var-table__footer { width: 100%; min-height: var(--table-row-height); border-top: var(--table-footer-border-top);}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@table-background: #fff;
|
|
2
|
+
@table-border-radius: 2px;
|
|
3
|
+
@table-thead-border-bottom: thin solid rgba(0, 0, 0, 0.12);
|
|
4
|
+
@table-thead-th-text-color: rgba(0, 0, 0, 0.6);
|
|
5
|
+
@table-thead-th-font-size: 14px;
|
|
6
|
+
@table-thead-tr-border-bottom: thin solid rgba(0, 0, 0, 0.12);
|
|
7
|
+
@table-tbody-tr-hover-background: #eee;
|
|
8
|
+
@table-tbody-tr-border-bottom: thin solid rgba(0, 0, 0, 0.12);
|
|
9
|
+
@table-row-height: 46px;
|
|
10
|
+
@table-row-padding: 0 16px;
|
|
11
|
+
@table-footer-border-top: thin solid rgba(0, 0, 0, 0.12);
|
|
12
|
+
|
|
13
|
+
:root {
|
|
14
|
+
--table-background: @table-background;
|
|
15
|
+
--table-border-radius: @table-border-radius;
|
|
16
|
+
--table-thead-border-bottom: @table-thead-border-bottom;
|
|
17
|
+
--table-thead-th-text-color: @table-thead-th-text-color;
|
|
18
|
+
--table-thead-th-font-size: @table-thead-th-font-size;
|
|
19
|
+
--table-thead-tr-border-bottom: @table-thead-tr-border-bottom;
|
|
20
|
+
--table-tbody-tr-hover-background: @table-tbody-tr-hover-background;
|
|
21
|
+
--table-tbody-tr-border-bottom: @table-tbody-tr-border-bottom;
|
|
22
|
+
--table-row-height: @table-row-height;
|
|
23
|
+
--table-row-padding: @table-row-padding;
|
|
24
|
+
--table-footer-border-top: @table-footer-border-top;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.var-table {
|
|
28
|
+
width: 100%;
|
|
29
|
+
background: var(--table-background);
|
|
30
|
+
border-radius: var(--table-border-radius);
|
|
31
|
+
|
|
32
|
+
* {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__main {
|
|
37
|
+
width: 100%;
|
|
38
|
+
overflow-x: auto;
|
|
39
|
+
|
|
40
|
+
> table {
|
|
41
|
+
min-width: 100%;
|
|
42
|
+
display: table;
|
|
43
|
+
border-spacing: 0;
|
|
44
|
+
border-collapse: collapse;
|
|
45
|
+
line-height: normal;
|
|
46
|
+
|
|
47
|
+
thead {
|
|
48
|
+
display: table-header-group;
|
|
49
|
+
border-bottom: var(--table-thead-border-bottom);
|
|
50
|
+
|
|
51
|
+
tr {
|
|
52
|
+
th {
|
|
53
|
+
color: var(--table-thead-th-text-color);
|
|
54
|
+
font-size: var(--table-thead-th-font-size);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:not(:last-child) {
|
|
58
|
+
border-bottom: var(--table-thead-tr-border-bottom);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
tbody {
|
|
64
|
+
display: table-row-group;
|
|
65
|
+
|
|
66
|
+
tr {
|
|
67
|
+
display: table-row;
|
|
68
|
+
outline: 0;
|
|
69
|
+
vertical-align: middle;
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
background: var(--table-tbody-tr-hover-background);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:not(:last-child) {
|
|
76
|
+
border-bottom: var(--table-tbody-tr-border-bottom);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
th {
|
|
82
|
+
display: table-cell;
|
|
83
|
+
height: var(--table-row-height);
|
|
84
|
+
padding: var(--table-row-padding);
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
text-align: left;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
td {
|
|
90
|
+
display: table-cell;
|
|
91
|
+
padding: var(--table-row-padding);
|
|
92
|
+
height: var(--table-row-height);
|
|
93
|
+
text-align: left;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__footer {
|
|
99
|
+
width: 100%;
|
|
100
|
+
min-height: var(--table-row-height);
|
|
101
|
+
border-top: var(--table-footer-border-top);
|
|
102
|
+
}
|
|
103
|
+
}
|
package/es/umdIndex.js
CHANGED
|
@@ -31,6 +31,7 @@ import Loading, * as LoadingModule from './loading'
|
|
|
31
31
|
import Locale, * as LocaleModule from './locale'
|
|
32
32
|
import Menu, * as MenuModule from './menu'
|
|
33
33
|
import Option, * as OptionModule from './option'
|
|
34
|
+
import Pagination, * as PaginationModule from './pagination'
|
|
34
35
|
import Picker, * as PickerModule from './picker'
|
|
35
36
|
import Popup, * as PopupModule from './popup'
|
|
36
37
|
import Progress, * as ProgressModule from './progress'
|
|
@@ -53,6 +54,7 @@ import SwipeItem, * as SwipeItemModule from './swipe-item'
|
|
|
53
54
|
import Switch, * as SwitchModule from './switch'
|
|
54
55
|
import Tab, * as TabModule from './tab'
|
|
55
56
|
import TabItem, * as TabItemModule from './tab-item'
|
|
57
|
+
import Table, * as TableModule from './table'
|
|
56
58
|
import Tabs, * as TabsModule from './tabs'
|
|
57
59
|
import TabsItems, * as TabsItemsModule from './tabs-items'
|
|
58
60
|
import TimePicker, * as TimePickerModule from './time-picker'
|
|
@@ -91,6 +93,7 @@ import './loading/style'
|
|
|
91
93
|
import './locale/style'
|
|
92
94
|
import './menu/style'
|
|
93
95
|
import './option/style'
|
|
96
|
+
import './pagination/style'
|
|
94
97
|
import './picker/style'
|
|
95
98
|
import './popup/style'
|
|
96
99
|
import './progress/style'
|
|
@@ -113,6 +116,7 @@ import './swipe-item/style'
|
|
|
113
116
|
import './switch/style'
|
|
114
117
|
import './tab/style'
|
|
115
118
|
import './tab-item/style'
|
|
119
|
+
import './table/style'
|
|
116
120
|
import './tabs/style'
|
|
117
121
|
import './tabs-items/style'
|
|
118
122
|
import './time-picker/style'
|
|
@@ -153,6 +157,7 @@ function install(app) {
|
|
|
153
157
|
Locale.install && app.use(Locale)
|
|
154
158
|
Menu.install && app.use(Menu)
|
|
155
159
|
Option.install && app.use(Option)
|
|
160
|
+
Pagination.install && app.use(Pagination)
|
|
156
161
|
Picker.install && app.use(Picker)
|
|
157
162
|
Popup.install && app.use(Popup)
|
|
158
163
|
Progress.install && app.use(Progress)
|
|
@@ -175,6 +180,7 @@ function install(app) {
|
|
|
175
180
|
Switch.install && app.use(Switch)
|
|
176
181
|
Tab.install && app.use(Tab)
|
|
177
182
|
TabItem.install && app.use(TabItem)
|
|
183
|
+
Table.install && app.use(Table)
|
|
178
184
|
Tabs.install && app.use(Tabs)
|
|
179
185
|
TabsItems.install && app.use(TabsItems)
|
|
180
186
|
TimePicker.install && app.use(TimePicker)
|
|
@@ -216,6 +222,7 @@ export {
|
|
|
216
222
|
Locale,
|
|
217
223
|
Menu,
|
|
218
224
|
Option,
|
|
225
|
+
Pagination,
|
|
219
226
|
Picker,
|
|
220
227
|
Popup,
|
|
221
228
|
Progress,
|
|
@@ -238,6 +245,7 @@ export {
|
|
|
238
245
|
Switch,
|
|
239
246
|
Tab,
|
|
240
247
|
TabItem,
|
|
248
|
+
Table,
|
|
241
249
|
Tabs,
|
|
242
250
|
TabsItems,
|
|
243
251
|
TimePicker,
|
|
@@ -279,6 +287,7 @@ export default {
|
|
|
279
287
|
Locale,
|
|
280
288
|
Menu,
|
|
281
289
|
Option,
|
|
290
|
+
Pagination,
|
|
282
291
|
Picker,
|
|
283
292
|
Popup,
|
|
284
293
|
Progress,
|
|
@@ -301,6 +310,7 @@ export default {
|
|
|
301
310
|
Switch,
|
|
302
311
|
Tab,
|
|
303
312
|
TabItem,
|
|
313
|
+
Table,
|
|
304
314
|
Tabs,
|
|
305
315
|
TabsItems,
|
|
306
316
|
TimePicker,
|
package/es/utils/elements.js
CHANGED
|
@@ -3,6 +3,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
3
3
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
4
|
|
|
5
5
|
import { isNumber, isString, kebabCase, toNumber } from './shared';
|
|
6
|
+
export function getLeft(element) {
|
|
7
|
+
var {
|
|
8
|
+
left
|
|
9
|
+
} = element.getBoundingClientRect();
|
|
10
|
+
return left + (document.body.scrollLeft || document.documentElement.scrollLeft);
|
|
11
|
+
}
|
|
6
12
|
export function getTop(element) {
|
|
7
13
|
var {
|
|
8
14
|
top
|
|
@@ -18,12 +24,6 @@ export function getScrollLeft(element) {
|
|
|
18
24
|
var left = 'scrollLeft' in element ? element.scrollLeft : element.pageXOffset;
|
|
19
25
|
return Math.max(left, 0);
|
|
20
26
|
}
|
|
21
|
-
export function getLeft(element) {
|
|
22
|
-
var {
|
|
23
|
-
left
|
|
24
|
-
} = element.getBoundingClientRect();
|
|
25
|
-
return left + (document.body.scrollLeft || document.documentElement.scrollLeft);
|
|
26
|
-
}
|
|
27
27
|
export function inViewport(_x) {
|
|
28
28
|
return _inViewport.apply(this, arguments);
|
|
29
29
|
}
|
|
@@ -867,6 +867,46 @@
|
|
|
867
867
|
"type": "any",
|
|
868
868
|
"description": "选项绑定的值 默认值:-"
|
|
869
869
|
},
|
|
870
|
+
"var-pagination/current": {
|
|
871
|
+
"type": "string | number",
|
|
872
|
+
"description": "当前页数 默认值:1"
|
|
873
|
+
},
|
|
874
|
+
"var-pagination/size": {
|
|
875
|
+
"type": "string | number",
|
|
876
|
+
"description": "每页条数 默认值:10"
|
|
877
|
+
},
|
|
878
|
+
"var-pagination/total": {
|
|
879
|
+
"type": "string | number",
|
|
880
|
+
"description": "总条数 默认值:0"
|
|
881
|
+
},
|
|
882
|
+
"var-pagination/simple": {
|
|
883
|
+
"type": "boolean",
|
|
884
|
+
"description": "是否为简单模式 默认值:true"
|
|
885
|
+
},
|
|
886
|
+
"var-pagination/disabled": {
|
|
887
|
+
"type": "boolean",
|
|
888
|
+
"description": "禁用分页 默认值:false"
|
|
889
|
+
},
|
|
890
|
+
"var-pagination/showSizeChanger": {
|
|
891
|
+
"type": "boolean",
|
|
892
|
+
"description": "是否显示 `size` 切换器 默认值:true"
|
|
893
|
+
},
|
|
894
|
+
"var-pagination/showQuickJumper": {
|
|
895
|
+
"type": "boolean",
|
|
896
|
+
"description": "是否可以快速跳转至某页 默认值:false"
|
|
897
|
+
},
|
|
898
|
+
"var-pagination/maxPagerCount": {
|
|
899
|
+
"type": "number",
|
|
900
|
+
"description": "省略号间显示的按钮数量 默认值:3"
|
|
901
|
+
},
|
|
902
|
+
"var-pagination/sizeOption": {
|
|
903
|
+
"type": "number[]",
|
|
904
|
+
"description": "指定每页可以显示多少条 默认值:[10, 20, 50, 100]"
|
|
905
|
+
},
|
|
906
|
+
"var-pagination/showTotal": {
|
|
907
|
+
"type": "function(total, range)",
|
|
908
|
+
"description": "用于显示数据总量和当前数据顺序 默认值:-"
|
|
909
|
+
},
|
|
870
910
|
"var-picker/columns": {
|
|
871
911
|
"type": "NormalColumn[] | CascadeColumn[] | Texts",
|
|
872
912
|
"description": "列内容 默认值:[]"
|
|
@@ -1196,8 +1236,8 @@
|
|
|
1196
1236
|
"description": "触发验证的时机, 可选值为 `onFocus` `onBlur` `onChange` `onClick` `onClear` `onClose` 默认值:['onChange', 'onClear', 'onClose']"
|
|
1197
1237
|
},
|
|
1198
1238
|
"var-select/rules": {
|
|
1199
|
-
"type": "Array<(v: any",
|
|
1200
|
-
"description": "验证规则,返回`true`表示验证通过,其余的值则转换为文本作为用户提示
|
|
1239
|
+
"type": "Array<(v: any | any[]) => any>",
|
|
1240
|
+
"description": "验证规则,返回`true`表示验证通过,其余的值则转换为文本作为用户提示 默认值:-"
|
|
1201
1241
|
},
|
|
1202
1242
|
"var-skeleton/loading": {
|
|
1203
1243
|
"type": "boolean",
|
|
@@ -1467,6 +1507,10 @@
|
|
|
1467
1507
|
"type": "string | number",
|
|
1468
1508
|
"description": "视图的名字 默认值:index"
|
|
1469
1509
|
},
|
|
1510
|
+
"var-table/fullWidth": {
|
|
1511
|
+
"type": "string | number",
|
|
1512
|
+
"description": "`table` 的宽度(包含可滚动部分) 默认值:100%"
|
|
1513
|
+
},
|
|
1470
1514
|
"var-tabs/v-model:active": {
|
|
1471
1515
|
"type": "string",
|
|
1472
1516
|
"description": "激活的选项卡标识, 优先匹配name,其次是index 默认值:default"
|