@varlet/ui 1.22.0-alpha.7 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/es/action-sheet/actionSheet.css +1 -1
- package/es/action-sheet/actionSheet.less +1 -1
- package/es/back-top/BackTop.js +1 -1
- package/es/back-top/backTop.css +1 -1
- package/es/back-top/backTop.less +1 -1
- package/es/button/button.css +1 -1
- package/es/button/button.less +1 -2
- package/es/checkbox/checkbox.css +1 -1
- package/es/checkbox/checkbox.less +1 -1
- package/es/counter/Counter.js +1 -1
- package/es/counter/counter.css +1 -1
- package/es/counter/counter.less +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 +353 -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 +163 -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/radio/radio.css +1 -1
- package/es/radio/radio.less +1 -1
- package/es/rate/rate.css +1 -1
- package/es/rate/rate.less +1 -1
- package/es/ripple/ripple.css +1 -1
- package/es/ripple/ripple.less +7 -1
- package/es/select/select.css +1 -1
- package/es/select/select.less +1 -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/styles/common.css +1 -1
- package/es/styles/common.less +1 -0
- package/es/styles/var.less +1 -0
- package/es/tab/tab.css +1 -1
- package/es/tab/tab.less +1 -1
- 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 +109 -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,353 @@
|
|
|
1
|
+
import Menu from '../menu';
|
|
2
|
+
import Ripple from '../ripple';
|
|
3
|
+
import Icon from '../icon';
|
|
4
|
+
import Cell from '../cell';
|
|
5
|
+
import Input from '../input';
|
|
6
|
+
import { defineComponent, ref, computed, watch } from 'vue';
|
|
7
|
+
import { props } from './porps';
|
|
8
|
+
import { isNumber, toNumber } from '../utils/shared';
|
|
9
|
+
import { pack } from '../locale';
|
|
10
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, createElementVNode as _createElementVNode, withDirectives as _withDirectives, withKeys as _withKeys, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, withCtx as _withCtx, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
|
+
|
|
12
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
|
+
|
|
14
|
+
var _hoisted_1 = {
|
|
15
|
+
class: "var-pagination"
|
|
16
|
+
};
|
|
17
|
+
var _hoisted_2 = ["item-mode", "onClick"];
|
|
18
|
+
var _hoisted_3 = {
|
|
19
|
+
key: 4,
|
|
20
|
+
class: "var-pagination__total"
|
|
21
|
+
};
|
|
22
|
+
export function render(_ctx, _cache) {
|
|
23
|
+
var _component_var_icon = _resolveComponent("var-icon");
|
|
24
|
+
|
|
25
|
+
var _component_var_input = _resolveComponent("var-input");
|
|
26
|
+
|
|
27
|
+
var _component_var_cell = _resolveComponent("var-cell");
|
|
28
|
+
|
|
29
|
+
var _component_var_menu = _resolveComponent("var-menu");
|
|
30
|
+
|
|
31
|
+
var _directive_ripple = _resolveDirective("ripple");
|
|
32
|
+
|
|
33
|
+
return _openBlock(), _createElementBlock("ul", _hoisted_1, [_withDirectives(_createElementVNode("li", {
|
|
34
|
+
class: _normalizeClass(["var-pagination__item var-pagination__prev", {
|
|
35
|
+
'var-pagination__item-disabled': _ctx.current <= 1 || _ctx.disabled,
|
|
36
|
+
'var-pagination__item-hover': _ctx.simple,
|
|
37
|
+
'var-elevation--2': !_ctx.simple
|
|
38
|
+
}]),
|
|
39
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.clickItem('prev'))
|
|
40
|
+
}, [_renderSlot(_ctx.$slots, "prev", {}, () => [_createVNode(_component_var_icon, {
|
|
41
|
+
name: "chevron-left"
|
|
42
|
+
})])], 2
|
|
43
|
+
/* CLASS */
|
|
44
|
+
), [[_directive_ripple, {
|
|
45
|
+
disabled: _ctx.current <= 1 || _ctx.disabled
|
|
46
|
+
}]]), _ctx.simple ? (_openBlock(), _createElementBlock("li", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: _normalizeClass(["var-pagination__simple", {
|
|
49
|
+
'var-pagination__item-disabled': _ctx.disabled
|
|
50
|
+
}])
|
|
51
|
+
}, [_createVNode(_component_var_input, {
|
|
52
|
+
modelValue: _ctx.simpleValue,
|
|
53
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.simpleValue = $event),
|
|
54
|
+
disabled: _ctx.disabled,
|
|
55
|
+
"var-pagination-cover": "",
|
|
56
|
+
onBlur: _cache[2] || (_cache[2] = $event => _ctx.setPage('simple', _ctx.simpleValue, $event)),
|
|
57
|
+
onKeydown: _cache[3] || (_cache[3] = _withKeys($event => _ctx.setPage('simple', _ctx.simpleValue, $event), ["enter"]))
|
|
58
|
+
}, null, 8
|
|
59
|
+
/* PROPS */
|
|
60
|
+
, ["modelValue", "disabled"]), _createTextVNode(" / " + _toDisplayString(_ctx.pageCount), 1
|
|
61
|
+
/* TEXT */
|
|
62
|
+
)], 2
|
|
63
|
+
/* CLASS */
|
|
64
|
+
)) : (_openBlock(true), _createElementBlock(_Fragment, {
|
|
65
|
+
key: 1
|
|
66
|
+
}, _renderList(_ctx.pageList, (item, index) => {
|
|
67
|
+
return _withDirectives((_openBlock(), _createElementBlock("li", {
|
|
68
|
+
key: item + index,
|
|
69
|
+
"item-mode": _ctx.getMode(item, index),
|
|
70
|
+
class: _normalizeClass(["var-pagination__item var-elevation--2", {
|
|
71
|
+
'var-pagination__item-active': item === _ctx.current && !_ctx.disabled,
|
|
72
|
+
'var-pagination__item-hide': _ctx.isHideEllipsis(item, index),
|
|
73
|
+
'var-pagination__item-disabled': _ctx.disabled,
|
|
74
|
+
'var-pagination__item-disabled-active': item === _ctx.current && _ctx.disabled
|
|
75
|
+
}]),
|
|
76
|
+
onClick: $event => _ctx.clickItem(item, index)
|
|
77
|
+
}, [_createTextVNode(_toDisplayString(item), 1
|
|
78
|
+
/* TEXT */
|
|
79
|
+
)], 10
|
|
80
|
+
/* CLASS, PROPS */
|
|
81
|
+
, _hoisted_2)), [[_directive_ripple, {
|
|
82
|
+
disabled: _ctx.disabled
|
|
83
|
+
}]]);
|
|
84
|
+
}), 128
|
|
85
|
+
/* KEYED_FRAGMENT */
|
|
86
|
+
)), _withDirectives(_createElementVNode("li", {
|
|
87
|
+
class: _normalizeClass(["var-pagination__item var-pagination__next", {
|
|
88
|
+
'var-pagination__item-disabled': _ctx.current >= _ctx.pageCount || _ctx.disabled,
|
|
89
|
+
'var-pagination__item-hover': _ctx.simple,
|
|
90
|
+
'var-elevation--2': !_ctx.simple
|
|
91
|
+
}]),
|
|
92
|
+
onClick: _cache[4] || (_cache[4] = $event => _ctx.clickItem('next'))
|
|
93
|
+
}, [_renderSlot(_ctx.$slots, "next", {}, () => [_createVNode(_component_var_icon, {
|
|
94
|
+
name: "chevron-right"
|
|
95
|
+
})])], 2
|
|
96
|
+
/* CLASS */
|
|
97
|
+
), [[_directive_ripple, {
|
|
98
|
+
disabled: _ctx.current >= _ctx.pageCount || _ctx.disabled
|
|
99
|
+
}]]), _ctx.showSizeChanger ? (_openBlock(), _createElementBlock("li", {
|
|
100
|
+
key: 2,
|
|
101
|
+
class: _normalizeClass(["var-pagination__size", {
|
|
102
|
+
'var-pagination__item-disabled': _ctx.disabled
|
|
103
|
+
}])
|
|
104
|
+
}, [_createVNode(_component_var_menu, {
|
|
105
|
+
show: _ctx.menuVisible,
|
|
106
|
+
"onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event),
|
|
107
|
+
"offset-x": -4
|
|
108
|
+
}, {
|
|
109
|
+
menu: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sizeOption, (option, index) => {
|
|
110
|
+
return _withDirectives((_openBlock(), _createBlock(_component_var_cell, {
|
|
111
|
+
class: _normalizeClass(["var-pagination__list", {
|
|
112
|
+
'var-pagination__list-active': _ctx.size === option
|
|
113
|
+
}]),
|
|
114
|
+
key: index,
|
|
115
|
+
onClick: $event => _ctx.clickSize(option)
|
|
116
|
+
}, {
|
|
117
|
+
default: _withCtx(() => [_createTextVNode(_toDisplayString(option) + _toDisplayString(_ctx.pack.paginationItem) + " / " + _toDisplayString(_ctx.pack.paginationPage), 1
|
|
118
|
+
/* TEXT */
|
|
119
|
+
)]),
|
|
120
|
+
_: 2
|
|
121
|
+
/* DYNAMIC */
|
|
122
|
+
|
|
123
|
+
}, 1032
|
|
124
|
+
/* PROPS, DYNAMIC_SLOTS */
|
|
125
|
+
, ["class", "onClick"])), [[_directive_ripple]]);
|
|
126
|
+
}), 128
|
|
127
|
+
/* KEYED_FRAGMENT */
|
|
128
|
+
))]),
|
|
129
|
+
default: _withCtx(() => [_createElementVNode("div", {
|
|
130
|
+
class: "var-pagination__size-open",
|
|
131
|
+
style: {
|
|
132
|
+
"display": "flex"
|
|
133
|
+
},
|
|
134
|
+
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.showMenu && _ctx.showMenu(...args))
|
|
135
|
+
}, [_createElementVNode("span", null, _toDisplayString(_ctx.size) + _toDisplayString(_ctx.pack.paginationItem) + " / " + _toDisplayString(_ctx.pack.paginationPage), 1
|
|
136
|
+
/* TEXT */
|
|
137
|
+
), _createVNode(_component_var_icon, {
|
|
138
|
+
class: "var-pagination__size-open-icon",
|
|
139
|
+
"var-pagination-cover": "",
|
|
140
|
+
name: "menu-down"
|
|
141
|
+
})])]),
|
|
142
|
+
_: 1
|
|
143
|
+
/* STABLE */
|
|
144
|
+
|
|
145
|
+
}, 8
|
|
146
|
+
/* PROPS */
|
|
147
|
+
, ["show"])], 2
|
|
148
|
+
/* CLASS */
|
|
149
|
+
)) : _createCommentVNode("v-if", true), _ctx.showQuickJumper && !_ctx.simple ? (_openBlock(), _createElementBlock("li", {
|
|
150
|
+
key: 3,
|
|
151
|
+
class: _normalizeClass(["var-pagination__quickly", {
|
|
152
|
+
'var-pagination__item-disabled': _ctx.disabled
|
|
153
|
+
}])
|
|
154
|
+
}, [_createTextVNode(_toDisplayString(_ctx.pack.paginationJump) + " ", 1
|
|
155
|
+
/* TEXT */
|
|
156
|
+
), _createVNode(_component_var_input, {
|
|
157
|
+
modelValue: _ctx.inputValue,
|
|
158
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => _ctx.inputValue = $event),
|
|
159
|
+
disabled: _ctx.disabled,
|
|
160
|
+
"var-pagination-cover": "",
|
|
161
|
+
onBlur: _cache[8] || (_cache[8] = $event => _ctx.setPage('quick', _ctx.inputValue, $event)),
|
|
162
|
+
onKeydown: _cache[9] || (_cache[9] = _withKeys($event => _ctx.setPage('quick', _ctx.inputValue, $event), ["enter"]))
|
|
163
|
+
}, null, 8
|
|
164
|
+
/* PROPS */
|
|
165
|
+
, ["modelValue", "disabled"])], 2
|
|
166
|
+
/* CLASS */
|
|
167
|
+
)) : _createCommentVNode("v-if", true), _ctx.totalText ? (_openBlock(), _createElementBlock("li", _hoisted_3, _toDisplayString(_ctx.totalText), 1
|
|
168
|
+
/* TEXT */
|
|
169
|
+
)) : _createCommentVNode("v-if", true)]);
|
|
170
|
+
}
|
|
171
|
+
export default defineComponent({
|
|
172
|
+
render,
|
|
173
|
+
name: 'VarPagination',
|
|
174
|
+
components: {
|
|
175
|
+
[Menu.name]: Menu,
|
|
176
|
+
[Icon.name]: Icon,
|
|
177
|
+
[Cell.name]: Cell,
|
|
178
|
+
[Input.name]: Input
|
|
179
|
+
},
|
|
180
|
+
directives: {
|
|
181
|
+
Ripple
|
|
182
|
+
},
|
|
183
|
+
props,
|
|
184
|
+
|
|
185
|
+
setup(props) {
|
|
186
|
+
var menuVisible = ref(false);
|
|
187
|
+
var inputValue = ref('');
|
|
188
|
+
var simpleValue = ref('1');
|
|
189
|
+
var isHideEllipsisHead = ref(false);
|
|
190
|
+
var isHideEllipsisTail = ref(false);
|
|
191
|
+
var current = ref(toNumber(props.current) || 1);
|
|
192
|
+
var size = ref(toNumber(props.size) || 10);
|
|
193
|
+
var pageList = ref([]);
|
|
194
|
+
var activePosition = computed(() => Math.ceil(props.maxPagerCount / 2));
|
|
195
|
+
var pageCount = computed(() => Math.ceil(toNumber(props.total) / toNumber(size.value)));
|
|
196
|
+
var range = computed(() => {
|
|
197
|
+
var start = size.value * (current.value - 1) + 1;
|
|
198
|
+
var end = Math.min(size.value * current.value, toNumber(props.total));
|
|
199
|
+
return [start, end];
|
|
200
|
+
});
|
|
201
|
+
var totalText = computed(() => {
|
|
202
|
+
if (!props.showTotal) return '';
|
|
203
|
+
return props.showTotal(toNumber(props.total), range.value);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
var isHideEllipsis = (item, index) => {
|
|
207
|
+
if (isNumber(item)) return false;
|
|
208
|
+
return index === 1 ? isHideEllipsisHead.value : isHideEllipsisTail.value;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
var getMode = (item, index) => {
|
|
212
|
+
if (isNumber(item)) return 'basic';
|
|
213
|
+
return index === 1 ? 'head' : 'tail';
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
var clickItem = (item, index) => {
|
|
217
|
+
if (item === current.value || props.disabled) return;
|
|
218
|
+
if (isNumber(item)) current.value = item;else if (item === 'prev') current.value > 1 && (current.value -= 1);else if (item === 'next') current.value < pageCount.value && (current.value += 1);else if (item === '...') {
|
|
219
|
+
if (index === 1) {
|
|
220
|
+
current.value = Math.max(current.value - props.maxPagerCount, 1);
|
|
221
|
+
} else {
|
|
222
|
+
current.value = Math.min(current.value + props.maxPagerCount, pageCount.value);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
var showMenu = () => {
|
|
228
|
+
if (props.disabled) return;
|
|
229
|
+
menuVisible.value = true;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
var clickSize = option => {
|
|
233
|
+
size.value = option;
|
|
234
|
+
menuVisible.value = false;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
var isValidatePage = value => {
|
|
238
|
+
var pattern = /^[1-9][0-9]*$/;
|
|
239
|
+
return pattern.test(value);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
var setPage = (type, value, event) => {
|
|
243
|
+
;
|
|
244
|
+
event.target.blur();
|
|
245
|
+
|
|
246
|
+
if (isValidatePage(value)) {
|
|
247
|
+
var valueNum = toNumber(value);
|
|
248
|
+
|
|
249
|
+
if (valueNum > pageCount.value) {
|
|
250
|
+
valueNum = pageCount.value;
|
|
251
|
+
simpleValue.value = "" + valueNum;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (valueNum !== current.value) current.value = valueNum;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (type === 'quick') inputValue.value = '';
|
|
258
|
+
if (type === 'simple' && !isValidatePage(value)) simpleValue.value = "" + current.value;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
watch([() => props.current, () => props.size], ([newCurrent, newSize]) => {
|
|
262
|
+
current.value = toNumber(newCurrent) || 1;
|
|
263
|
+
size.value = toNumber(newSize || 10);
|
|
264
|
+
});
|
|
265
|
+
watch([current, pageCount], ([newCurrent, newCount], [oldCurrent, oldCount]) => {
|
|
266
|
+
if (newCurrent > newCount) {
|
|
267
|
+
current.value = newCount;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
var list = [];
|
|
272
|
+
var {
|
|
273
|
+
maxPagerCount
|
|
274
|
+
} = props;
|
|
275
|
+
var rEllipseSign = newCount - (maxPagerCount - activePosition.value) - 1;
|
|
276
|
+
simpleValue.value = "" + newCurrent;
|
|
277
|
+
|
|
278
|
+
if (newCount - 2 > maxPagerCount) {
|
|
279
|
+
if (oldCurrent === undefined || newCount !== oldCount) {
|
|
280
|
+
for (var i = 2; i < maxPagerCount + 2; i++) {
|
|
281
|
+
list.push(i);
|
|
282
|
+
}
|
|
283
|
+
} // 左边不需要出现省略符号占位
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
if (newCurrent <= maxPagerCount && newCurrent < rEllipseSign) {
|
|
287
|
+
list = [];
|
|
288
|
+
|
|
289
|
+
for (var _i = 1; _i < maxPagerCount + 1; _i++) {
|
|
290
|
+
list.push(_i + 1);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
isHideEllipsisHead.value = true;
|
|
294
|
+
isHideEllipsisTail.value = false;
|
|
295
|
+
} // 两边都需要出现省略符号占位
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
if (newCurrent > maxPagerCount && newCurrent < rEllipseSign) {
|
|
299
|
+
list = [];
|
|
300
|
+
|
|
301
|
+
for (var _i2 = 1; _i2 < maxPagerCount + 1; _i2++) {
|
|
302
|
+
list.push(newCurrent + _i2 - activePosition.value);
|
|
303
|
+
} // 针对 maxPagerCount===1 的特殊处理
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
isHideEllipsisHead.value = newCurrent === 2 && maxPagerCount === 1;
|
|
307
|
+
isHideEllipsisTail.value = false;
|
|
308
|
+
} // 右边不需要出现省略符号占位
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
if (newCurrent >= rEllipseSign) {
|
|
312
|
+
list = [];
|
|
313
|
+
|
|
314
|
+
for (var _i3 = 1; _i3 < maxPagerCount + 1; _i3++) {
|
|
315
|
+
list.push(newCount - (maxPagerCount - _i3) - 1);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
isHideEllipsisHead.value = false;
|
|
319
|
+
isHideEllipsisTail.value = true;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
list = [1, '...', ...list, '...', newCount];
|
|
323
|
+
} else {
|
|
324
|
+
for (var _i4 = 1; _i4 <= newCount; _i4++) {
|
|
325
|
+
list.push(_i4);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
pageList.value = list;
|
|
330
|
+
if (oldCurrent !== undefined) props.onChange == null ? void 0 : props.onChange(newCurrent, size.value);
|
|
331
|
+
}, {
|
|
332
|
+
immediate: true
|
|
333
|
+
});
|
|
334
|
+
return {
|
|
335
|
+
pack,
|
|
336
|
+
current,
|
|
337
|
+
menuVisible,
|
|
338
|
+
size,
|
|
339
|
+
pageCount,
|
|
340
|
+
pageList,
|
|
341
|
+
inputValue,
|
|
342
|
+
simpleValue,
|
|
343
|
+
totalText,
|
|
344
|
+
getMode,
|
|
345
|
+
isHideEllipsis,
|
|
346
|
+
clickItem,
|
|
347
|
+
showMenu,
|
|
348
|
+
clickSize,
|
|
349
|
+
setPage
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --pagination-font-size: var(--font-size-md); --pagination-active-color: #fff; --pagination-active-bg-color: var(--color-primary); --pagination-hover-bg-color: #f5f5f5; --pagination-total-margin: 0 12px; --pagination-item-width: 32px; --pagination-item-height: 32px; --pagination-item-margin: 0 6px; --pagination-item-border-radius: 4px; --pagination-list-bg-color: #fff; --pagination-list-active-bg-color: #dbe4fd; --pagination-list-active-color: var(--color-primary); --pagination-input-width: 32px; --pagination-simple-padding: 0 0 2px 0; --pagination-disabled-color: var(--color-text-disabled); --pagination-bg-disabled-color: var(--color-disabled);}.pagination-flex-nowrap { display: flex; white-space: nowrap; align-items: center;}.var-pagination { display: flex; list-style: none; margin: 0; font-size: var(--pagination-font-size); padding: 0;}.var-pagination__item { display: inline-flex; min-width: var(--pagination-item-width); align-items: center; justify-content: center; margin: var(--pagination-item-margin); height: var(--pagination-item-height); cursor: pointer; border-radius: var(--pagination-item-border-radius); outline: none; transition: all 0.3s; user-select: none;}.var-pagination__item:hover { background-color: var(--pagination-hover-bg-color);}.var-pagination__item-active { color: var(--pagination-active-color); background-color: var(--pagination-active-bg-color) !important;}.var-pagination__item-disabled-active { background: var(--pagination-bg-disabled-color);}.var-pagination__item-hide { display: none;}.var-pagination__item-disabled { cursor: default !important; color: var(--pagination-disabled-color);}.var-pagination__item-disabled:hover { background-color: unset;}.var-pagination__item-hover:hover { background: inherit;}.var-pagination__prev { margin-left: 0;}.var-pagination__total { margin: var(--pagination-total-margin); display: flex; white-space: nowrap; align-items: center;}.var-pagination__size { display: flex; white-space: nowrap; align-items: center; margin: var(--pagination-item-margin);}.var-pagination__size-open { cursor: pointer;}.var-pagination__list { background-color: var(--pagination-list-bg-color); cursor: pointer;}.var-pagination__list:hover { background-color: var(--pagination-hover-bg-color);}.var-pagination__list-active { background-color: var(--pagination-list-active-bg-color) !important; color: var(--pagination-list-active-color);}.var-pagination__quickly,.var-pagination__simple { display: flex; white-space: nowrap; align-items: center;}.var-pagination__quickly [var-pagination-cover],.var-pagination__simple [var-pagination-cover] { width: var(--pagination-input-width);}.var-pagination__quickly [var-pagination-cover] .var-input__wrap,.var-pagination__simple [var-pagination-cover] .var-input__wrap { padding: 0;}.var-pagination__quickly [var-pagination-cover] .var-input__input,.var-pagination__simple [var-pagination-cover] .var-input__input { height: auto; text-align: center;}.var-pagination__quickly { margin: var(--pagination-item-margin);}.var-pagination__quickly [var-pagination-cover] { margin-left: 6px;}.var-pagination__size-open-icon { font-size: inherit;}.var-pagination--simple-padding { padding: var(--pagination-simple-padding);}
|
|
@@ -0,0 +1,163 @@
|
|
|
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-text-disabled);
|
|
16
|
+
@pagination-bg-disabled-color: var(--color-disabled);
|
|
17
|
+
|
|
18
|
+
:root {
|
|
19
|
+
--pagination-font-size: @pagination-font-size;
|
|
20
|
+
--pagination-active-color: @pagination-active-color;
|
|
21
|
+
--pagination-active-bg-color: @pagination-active-bg-color;
|
|
22
|
+
--pagination-hover-bg-color: @pagination-hover-bg-color;
|
|
23
|
+
--pagination-total-margin: @pagination-total-margin;
|
|
24
|
+
--pagination-item-width: @pagination-item-width;
|
|
25
|
+
--pagination-item-height: @pagination-item-height;
|
|
26
|
+
--pagination-item-margin: @pagination-item-margin;
|
|
27
|
+
--pagination-item-border-radius: @pagination-item-border-radius;
|
|
28
|
+
--pagination-list-bg-color: @pagination-list-bg-color;
|
|
29
|
+
--pagination-list-active-bg-color: @pagination-list-active-bg-color;
|
|
30
|
+
--pagination-list-active-color: @pagination-list-active-color;
|
|
31
|
+
--pagination-input-width: @pagination-input-width;
|
|
32
|
+
--pagination-simple-padding: @pagination-simple-padding;
|
|
33
|
+
--pagination-disabled-color: @pagination-disabled-color;
|
|
34
|
+
--pagination-bg-disabled-color: @pagination-bg-disabled-color;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Mixins
|
|
38
|
+
.pagination-flex-nowrap {
|
|
39
|
+
display: flex;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.var-pagination {
|
|
45
|
+
display: flex;
|
|
46
|
+
list-style: none;
|
|
47
|
+
margin: 0;
|
|
48
|
+
font-size: var(--pagination-font-size);
|
|
49
|
+
padding: 0;
|
|
50
|
+
|
|
51
|
+
&__item {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
min-width: var(--pagination-item-width);
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
margin: var(--pagination-item-margin);
|
|
57
|
+
height: var(--pagination-item-height);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
border-radius: var(--pagination-item-border-radius);
|
|
60
|
+
outline: none;
|
|
61
|
+
transition: all 0.3s;
|
|
62
|
+
user-select: none;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
background-color: var(--pagination-hover-bg-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-active {
|
|
69
|
+
color: var(--pagination-active-color);
|
|
70
|
+
background-color: var(--pagination-active-bg-color) !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-disabled-active {
|
|
74
|
+
background: var(--pagination-bg-disabled-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-hide {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-disabled {
|
|
82
|
+
cursor: default !important;
|
|
83
|
+
color: var(--pagination-disabled-color);
|
|
84
|
+
|
|
85
|
+
&:hover {
|
|
86
|
+
background-color: unset;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-hover {
|
|
91
|
+
&:hover {
|
|
92
|
+
background: inherit;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__prev {
|
|
98
|
+
margin-left: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__total {
|
|
102
|
+
margin: var(--pagination-total-margin);
|
|
103
|
+
.pagination-flex-nowrap();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__size {
|
|
107
|
+
.pagination-flex-nowrap();
|
|
108
|
+
|
|
109
|
+
margin: var(--pagination-item-margin);
|
|
110
|
+
|
|
111
|
+
&-open {
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&__list {
|
|
117
|
+
background-color: var(--pagination-list-bg-color);
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
background-color: var(--pagination-hover-bg-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&-active {
|
|
125
|
+
background-color: var(--pagination-list-active-bg-color) !important;
|
|
126
|
+
color: var(--pagination-list-active-color);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&__quickly,
|
|
131
|
+
&__simple {
|
|
132
|
+
.pagination-flex-nowrap();
|
|
133
|
+
|
|
134
|
+
[var-pagination-cover] {
|
|
135
|
+
width: var(--pagination-input-width);
|
|
136
|
+
|
|
137
|
+
.var-input__wrap {
|
|
138
|
+
padding: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.var-input__input {
|
|
142
|
+
height: auto;
|
|
143
|
+
text-align: center;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__quickly {
|
|
149
|
+
margin: var(--pagination-item-margin);
|
|
150
|
+
|
|
151
|
+
[var-pagination-cover] {
|
|
152
|
+
margin-left: 6px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&__size-open-icon {
|
|
157
|
+
font-size: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&--simple-padding {
|
|
161
|
+
padding: var(--pagination-simple-padding);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -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/radio/radio.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color:
|
|
1
|
+
:root { --radio-checked-color: var(--color-primary); --radio-unchecked-color: #555; --radio-disabled-color: var(--color-text-disabled); --radio-error-color: var(--color-danger); --radio-icon-size: 24px; --radio-action-padding: 6px;}@keyframes var-vibrate-animation { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); }}.var-radio { display: flex; align-items: center; transform: translateX(calc(-1 * var(--radio-action-padding))); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-radio__wrap { display: inline-flex; flex-direction: column;}.var-radio__action { display: flex; justify-content: center; align-items: center; padding: var(--radio-action-padding); border-radius: 50%;}.var-radio__icon[var-radio-cover] { display: block; font-size: var(--radio-icon-size);}.var-radio--with-animation[var-radio-cover] { animation: var-vibrate-animation 0.25s;}.var-radio--checked { color: var(--radio-checked-color);}.var-radio--unchecked { color: var(--radio-unchecked-color);}.var-radio--disabled { color: var(--radio-disabled-color);}.var-radio--error { color: var(--radio-error-color);}
|
package/es/radio/radio.less
CHANGED
package/es/rate/rate.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --rate-disabled-color:
|
|
1
|
+
:root { --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__content { padding: var(--rate-action-padding); box-sizing: unset; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate--disabled { color: var(--rate-disabled-color) !important;}.var-rate--error { color: var(--rate-error-color) !important;}.var-rate--primary { color: var(--rate-primary-color);}
|
package/es/rate/rate.less
CHANGED
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/select/select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color:
|
|
1
|
+
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color: var(--color-text-disabled);}.var-select-footer-margin-enter-from,.var-select-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-select-footer-margin-enter-active,.var-select-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-select { width: 100%; color: var(--select-select-text-color);}.var-select__controller { width: 100%; display: flex; position: relative;}.var-select__menu[var-select-cover] { flex-grow: 1; background: transparent;}.var-select__chip[var-select-cover] { margin: var(--select-chip-margin);}.var-select__scroller { max-height: var(--select-scroller-max-height); background: var(--select-scroller-background); padding: var(--select-scroller-padding); overflow-y: auto;}.var-select__wrap { position: relative; display: flex; flex-direction: column; padding-top: var(--select-placeholder-size);}.var-select__icon { display: flex; align-items: center; padding: var(--select-icon-padding); font-size: 20px;}.var-select__placeholder { position: absolute; top: 50%; left: 0; transform-origin: left; transition-property: top, transform; transition-duration: 0.3s; transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1); font-size: var(--select-placeholder-size);}.var-select__select { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 32px; padding: var(--select-select-padding); outline: none; border: none; font-size: inherit; color: var(--select-select-text-color); overflow-x: auto;}.var-select__arrow[var-select-cover] { flex-shrink: 0; font-size: var(--select-arrow-size);}.var-select__line { width: 100%; height: var(--select-line-size); background: var(--select-blur-color);}.var-select__dot { width: 100%; height: var(--select-line-spread-size); background: var(--select-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier);}.var-select--placeholder-hint { top: 0; transform: translate(0, 0) scale(0.75);}.var-select--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-select--non-hint { padding-top: 0;}.var-select--placeholder-hidden { visibility: hidden;}.var-select--focus { color: var(--select-focus-color);}.var-select--spread { transform: scaleX(1);}.var-select--disabled { color: var(--select-disabled-color);}.var-select--error { color: var(--select-error-color);}.var-select--line-disabled { background: var(--select-disabled-color);}.var-select--line-error { background: var(--select-error-color);}.var-select--arrow-rotate { transform: rotate(180deg);}
|
package/es/select/select.less
CHANGED