@varlet/ui 3.2.2 → 3.2.4
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/README.md +1 -2
- package/README.zh-CN.md +1 -2
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/avatar-group/AvatarGroup.mjs +1 -2
- package/es/date-picker/src/year-picker-panel.mjs +10 -18
- package/es/divider/Divider.mjs +2 -1
- package/es/image/Image.mjs +2 -2
- package/es/image/props.mjs +4 -0
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/menu/usePopover.mjs +10 -4
- package/es/result/Result.mjs +8 -14
- package/es/result/Success.mjs +4 -6
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/switch/Switch.mjs +21 -20
- package/es/switch/props.mjs +1 -0
- package/es/switch/switch.css +1 -1
- package/es/themes/dark/switch.mjs +13 -2
- package/es/themes/index.mjs +1 -10
- package/es/themes/md3-dark/switch.mjs +13 -2
- package/es/themes/md3-light/switch.mjs +13 -2
- package/es/themes/toViewport.d.ts +3 -0
- package/es/themes/toViewport.mjs +13 -0
- package/es/time-picker/clock.mjs +3 -5
- package/es/varlet.esm.js +1892 -1860
- package/highlight/web-types.en-US.json +22 -4
- package/highlight/web-types.zh-CN.json +23 -5
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +113 -76
- package/package.json +7 -7
- package/types/image.d.ts +1 -0
- package/types/styleVars.d.ts +22 -0
- package/types/switch.d.ts +1 -0
- package/umd/varlet.js +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
|
|
4
4
|
</a>
|
|
5
5
|
<h1>VARLET</h1>
|
|
6
|
-
<p>
|
|
6
|
+
<p>A mobile component library based on Vue3, Material Design 2, Material Design 3, and supports desktop development.</p>
|
|
7
7
|
<p>
|
|
8
8
|
<a href="https://varlet-varletjs.vercel.app/#/en-US/index">Documentation(Vercel)</a> |
|
|
9
9
|
<a href="https://varlet.gitee.io/varlet-ui/#/en-US/index">Documentation(Gitee)</a> |
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
16
16
|
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
17
17
|
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
18
|
-
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
19
18
|
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
20
19
|
</p>
|
|
21
20
|
</div>
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
|
|
5
5
|
</a>
|
|
6
6
|
<h1>VARLET</h1>
|
|
7
|
-
<p
|
|
7
|
+
<p>一个移动端组件库,基于 Vue3, Material Design 2, Material Design 3,并支持桌面端开发。</p>
|
|
8
8
|
<p>
|
|
9
9
|
<a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
|
|
10
10
|
<a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
17
17
|
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
18
18
|
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
19
|
-
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
20
19
|
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
21
20
|
</p>
|
|
22
21
|
</div>
|
|
@@ -138,16 +138,11 @@ const __sfc__ = defineComponent({
|
|
|
138
138
|
right: false
|
|
139
139
|
});
|
|
140
140
|
const yearList = computed(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return list;
|
|
144
|
-
let startYear = Math.floor(toNumber(props.preview) / 100 + page.value) * 100;
|
|
145
|
-
startYear = startYear < 0 ? 0 : startYear;
|
|
146
|
-
const yearRange = [startYear, startYear + 100];
|
|
147
|
-
for (let i = yearRange[0]; i < yearRange[1]; i++) {
|
|
148
|
-
list.push(i);
|
|
141
|
+
if (!props.preview) {
|
|
142
|
+
return [];
|
|
149
143
|
}
|
|
150
|
-
|
|
144
|
+
const startYear = Math.floor(toNumber(props.preview) / 100 + page.value) * 100;
|
|
145
|
+
return Array.from(Array(100), (_v, k) => Math.max(0, startYear) + k);
|
|
151
146
|
});
|
|
152
147
|
const shouldChoose = (val) => {
|
|
153
148
|
const {
|
|
@@ -171,12 +166,8 @@ const __sfc__ = defineComponent({
|
|
|
171
166
|
const {
|
|
172
167
|
componentProps: { min, max }
|
|
173
168
|
} = props;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (max)
|
|
177
|
-
isBeforeMax = dayjs(year).isSameOrBefore(dayjs(max), "year");
|
|
178
|
-
if (min)
|
|
179
|
-
isAfterMin = dayjs(year).isSameOrAfter(dayjs(min), "year");
|
|
169
|
+
const isBeforeMax = max ? dayjs(year).isSameOrBefore(dayjs(max), "year") : true;
|
|
170
|
+
const isAfterMin = min ? dayjs(year).isSameOrAfter(dayjs(min), "year") : true;
|
|
180
171
|
return isBeforeMax && isAfterMin;
|
|
181
172
|
};
|
|
182
173
|
const buttonProps = (year) => {
|
|
@@ -247,9 +238,10 @@ const __sfc__ = defineComponent({
|
|
|
247
238
|
});
|
|
248
239
|
};
|
|
249
240
|
const checkDate = (checkType) => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
241
|
+
const isPrevType = checkType === "prev";
|
|
242
|
+
reverse.value = isPrevType;
|
|
243
|
+
panelKey.value += isPrevType ? -1 : 1;
|
|
244
|
+
page.value += isPrevType ? -1 : 1;
|
|
253
245
|
};
|
|
254
246
|
const forwardRef = (checkType) => {
|
|
255
247
|
headerEl.value.checkDate(checkType);
|
package/es/divider/Divider.mjs
CHANGED
|
@@ -21,7 +21,8 @@ function __render__(_ctx, _cache) {
|
|
|
21
21
|
[_ctx.hairline, _ctx.n("--hairline")]
|
|
22
22
|
)
|
|
23
23
|
),
|
|
24
|
-
style: _normalizeStyle(_ctx.style)
|
|
24
|
+
style: _normalizeStyle(_ctx.style),
|
|
25
|
+
role: "separator"
|
|
25
26
|
},
|
|
26
27
|
[
|
|
27
28
|
!_ctx.vertical ? _renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
package/es/image/Image.mjs
CHANGED
|
@@ -34,7 +34,7 @@ function __render__(_ctx, _cache) {
|
|
|
34
34
|
referrerpolicy: _ctx.referrerpolicy,
|
|
35
35
|
"lazy-loading": _ctx.loading,
|
|
36
36
|
"lazy-error": _ctx.error,
|
|
37
|
-
style: _normalizeStyle({ objectFit: _ctx.fit }),
|
|
37
|
+
style: _normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
|
|
38
38
|
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
39
39
|
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
40
40
|
}, null, 46, _hoisted_1)), [
|
|
@@ -47,7 +47,7 @@ function __render__(_ctx, _cache) {
|
|
|
47
47
|
alt: _ctx.alt,
|
|
48
48
|
title: _ctx.title,
|
|
49
49
|
referrerpolicy: _ctx.referrerpolicy,
|
|
50
|
-
style: _normalizeStyle({ objectFit: _ctx.fit }),
|
|
50
|
+
style: _normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
|
|
51
51
|
src: _ctx.src,
|
|
52
52
|
onLoad: _cache[2] || (_cache[2] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
53
53
|
onError: _cache[3] || (_cache[3] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
|
package/es/image/props.mjs
CHANGED
package/es/index.bundle.mjs
CHANGED
|
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
|
|
|
262
262
|
import './uploader/style/index.mjs'
|
|
263
263
|
import './watermark/style/index.mjs'
|
|
264
264
|
|
|
265
|
-
const version = '3.2.
|
|
265
|
+
const version = '3.2.4'
|
|
266
266
|
|
|
267
267
|
function install(app) {
|
|
268
268
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
|
|
|
174
174
|
export * from './uploader/index.mjs'
|
|
175
175
|
export * from './watermark/index.mjs'
|
|
176
176
|
|
|
177
|
-
const version = '3.2.
|
|
177
|
+
const version = '3.2.4'
|
|
178
178
|
|
|
179
179
|
function install(app) {
|
|
180
180
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/menu/usePopover.mjs
CHANGED
|
@@ -54,9 +54,8 @@ function usePopover(options) {
|
|
|
54
54
|
const show = useVModel(options, "show", {
|
|
55
55
|
passive: true,
|
|
56
56
|
defaultValue: false,
|
|
57
|
-
emit(
|
|
57
|
+
emit(_event, value) {
|
|
58
58
|
if (value) {
|
|
59
|
-
resize();
|
|
60
59
|
call(options.onOpen);
|
|
61
60
|
} else {
|
|
62
61
|
call(options.onClose);
|
|
@@ -301,8 +300,7 @@ function usePopover(options) {
|
|
|
301
300
|
popoverInstance.setOptions(getPopperOptions());
|
|
302
301
|
};
|
|
303
302
|
const open = () => {
|
|
304
|
-
|
|
305
|
-
if (disabled) {
|
|
303
|
+
if (options.disabled) {
|
|
306
304
|
return;
|
|
307
305
|
}
|
|
308
306
|
show.value = true;
|
|
@@ -317,6 +315,14 @@ function usePopover(options) {
|
|
|
317
315
|
onWindowResize(resize);
|
|
318
316
|
watch(() => [options.offsetX, options.offsetY, options.placement, options.strategy], resize);
|
|
319
317
|
watch(() => options.disabled, close);
|
|
318
|
+
watch(
|
|
319
|
+
() => show.value,
|
|
320
|
+
(newValue) => {
|
|
321
|
+
if (newValue) {
|
|
322
|
+
resize();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
);
|
|
320
326
|
onMounted(() => {
|
|
321
327
|
var _a;
|
|
322
328
|
popoverInstance = createPopper((_a = getReference()) != null ? _a : host.value, popover.value, getPopperOptions());
|
package/es/result/Result.mjs
CHANGED
|
@@ -5,10 +5,9 @@ import Success from "./Success.mjs";
|
|
|
5
5
|
import Question from "./Question.mjs";
|
|
6
6
|
import Empty from "./Empty.mjs";
|
|
7
7
|
import { computed, defineComponent } from "vue";
|
|
8
|
-
import { toNumber } from "@varlet/shared";
|
|
9
8
|
import { props } from "./props.mjs";
|
|
10
9
|
import { createNamespace } from "../utils/components.mjs";
|
|
11
|
-
import {
|
|
10
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
12
11
|
const { name, n, classes } = createNamespace("result");
|
|
13
12
|
import { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString } from "vue";
|
|
14
13
|
function __render__(_ctx, _cache) {
|
|
@@ -103,22 +102,17 @@ const __sfc__ = defineComponent({
|
|
|
103
102
|
},
|
|
104
103
|
props,
|
|
105
104
|
setup(props2) {
|
|
106
|
-
const circleSize = computed(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return `calc(${imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`;
|
|
113
|
-
});
|
|
105
|
+
const circleSize = computed(
|
|
106
|
+
() => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.9)`
|
|
107
|
+
);
|
|
108
|
+
const borderSize = computed(
|
|
109
|
+
() => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`
|
|
110
|
+
);
|
|
114
111
|
return {
|
|
115
112
|
circleSize,
|
|
116
113
|
borderSize,
|
|
117
|
-
toSizeUnit,
|
|
118
114
|
n,
|
|
119
|
-
classes
|
|
120
|
-
toNumber,
|
|
121
|
-
toPxNum
|
|
115
|
+
classes
|
|
122
116
|
};
|
|
123
117
|
}
|
|
124
118
|
});
|
package/es/result/Success.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineComponent } from "vue";
|
|
2
2
|
import { createNamespace } from "../utils/components.mjs";
|
|
3
|
-
import { toNumber } from "@varlet/shared";
|
|
4
3
|
const { n, classes } = createNamespace("result");
|
|
5
4
|
import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
6
5
|
function __render__(_ctx, _cache) {
|
|
@@ -22,7 +21,7 @@ function __render__(_ctx, _cache) {
|
|
|
22
21
|
{
|
|
23
22
|
class: _normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-tip"))),
|
|
24
23
|
style: _normalizeStyle({
|
|
25
|
-
animationDuration: _ctx.animation ?
|
|
24
|
+
animationDuration: _ctx.animation ? "760ms" : "0ms",
|
|
26
25
|
borderRadius: `calc(${_ctx.borderSize} * 0.625)`
|
|
27
26
|
})
|
|
28
27
|
},
|
|
@@ -35,7 +34,7 @@ function __render__(_ctx, _cache) {
|
|
|
35
34
|
{
|
|
36
35
|
class: _normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-long"))),
|
|
37
36
|
style: _normalizeStyle({
|
|
38
|
-
animationDuration: _ctx.animation ?
|
|
37
|
+
animationDuration: _ctx.animation ? "770ms" : "0ms",
|
|
39
38
|
borderRadius: `calc(${_ctx.borderSize} * 0.625)`
|
|
40
39
|
})
|
|
41
40
|
},
|
|
@@ -68,7 +67,7 @@ function __render__(_ctx, _cache) {
|
|
|
68
67
|
{
|
|
69
68
|
class: _normalizeClass(_ctx.n("success-cover-right")),
|
|
70
69
|
style: _normalizeStyle({
|
|
71
|
-
animationDuration: _ctx.animation ?
|
|
70
|
+
animationDuration: _ctx.animation ? "4250ms" : "0ms"
|
|
72
71
|
})
|
|
73
72
|
},
|
|
74
73
|
null,
|
|
@@ -92,8 +91,7 @@ const __sfc__ = defineComponent({
|
|
|
92
91
|
setup() {
|
|
93
92
|
return {
|
|
94
93
|
n,
|
|
95
|
-
classes
|
|
96
|
-
toNumber
|
|
94
|
+
classes
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
97
|
});
|