@varlet/ui 3.2.3 → 3.2.5
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 +5 -3
- package/README.zh-CN.md +5 -3
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/avatar-group/AvatarGroup.mjs +1 -2
- package/es/breadcrumb/Breadcrumb.mjs +2 -1
- package/es/breadcrumbs/Breadcrumbs.mjs +3 -1
- package/es/collapse/Collapse.mjs +2 -0
- package/es/collapse-item/CollapseItem.mjs +53 -53
- package/es/collapse-item/collapseItem.css +1 -1
- package/es/date-picker/src/year-picker-panel.mjs +10 -18
- package/es/divider/Divider.mjs +2 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.mjs +0 -1
- package/es/menu/usePopover.mjs +2 -3
- package/es/popup/Popup.mjs +3 -1
- package/es/progress/Progress.mjs +187 -185
- package/es/slider/Slider.mjs +19 -23
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +1 -0
- package/es/swipe-item/SwipeItem.mjs +18 -18
- package/es/switch/Switch.mjs +77 -80
- package/es/time-picker/clock.mjs +3 -5
- package/es/tooltip/Tooltip.mjs +2 -1
- package/es/varlet.esm.js +4176 -4177
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +411 -421
- package/package.json +7 -7
- package/umd/varlet.js +6 -6
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -2,31 +2,29 @@ import { defineComponent, ref } from "vue";
|
|
|
2
2
|
import { useSwipe } from "./provide.mjs";
|
|
3
3
|
import { createNamespace } from "../utils/components.mjs";
|
|
4
4
|
const { name, n } = createNamespace("swipe-item");
|
|
5
|
-
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
5
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
6
|
+
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
7
|
+
const _hoisted_1 = ["aria-hidden"];
|
|
6
8
|
function __render__(_ctx, _cache) {
|
|
7
|
-
return _openBlock(), _createElementBlock(
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
],
|
|
20
|
-
6
|
|
21
|
-
/* CLASS, STYLE */
|
|
22
|
-
);
|
|
9
|
+
return _openBlock(), _createElementBlock("div", {
|
|
10
|
+
class: _normalizeClass(_ctx.n()),
|
|
11
|
+
style: _normalizeStyle({
|
|
12
|
+
width: !_ctx.vertical ? `${_ctx.size}px` : void 0,
|
|
13
|
+
height: _ctx.vertical ? `${_ctx.size}px` : void 0,
|
|
14
|
+
transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.translate}px)`
|
|
15
|
+
}),
|
|
16
|
+
tabindex: "-1",
|
|
17
|
+
"aria-hidden": _ctx.currentIndex === _ctx.index ? "false" : "true"
|
|
18
|
+
}, [
|
|
19
|
+
_renderSlot(_ctx.$slots, "default")
|
|
20
|
+
], 14, _hoisted_1);
|
|
23
21
|
}
|
|
24
22
|
const __sfc__ = defineComponent({
|
|
25
23
|
name,
|
|
26
24
|
setup() {
|
|
27
25
|
const translate = ref(0);
|
|
28
26
|
const { swipe, bindSwipe, index } = useSwipe();
|
|
29
|
-
const { size, vertical } = swipe;
|
|
27
|
+
const { size, currentIndex, vertical } = swipe;
|
|
30
28
|
const swipeItemProvider = {
|
|
31
29
|
index,
|
|
32
30
|
setTranslate
|
|
@@ -38,6 +36,8 @@ const __sfc__ = defineComponent({
|
|
|
38
36
|
return {
|
|
39
37
|
n,
|
|
40
38
|
size,
|
|
39
|
+
index,
|
|
40
|
+
currentIndex,
|
|
41
41
|
vertical,
|
|
42
42
|
translate
|
|
43
43
|
};
|
package/es/switch/Switch.mjs
CHANGED
|
@@ -12,8 +12,9 @@ import { useEventListener } from "@varlet/use";
|
|
|
12
12
|
const { name, n, classes } = createNamespace("switch");
|
|
13
13
|
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
14
14
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
15
|
-
const _hoisted_1 = ["
|
|
16
|
-
const _hoisted_2 =
|
|
15
|
+
const _hoisted_1 = ["aria-checked"];
|
|
16
|
+
const _hoisted_2 = ["tabindex"];
|
|
17
|
+
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ _createElementVNode(
|
|
17
18
|
"svg",
|
|
18
19
|
{ viewBox: "25 25 50 50" },
|
|
19
20
|
[
|
|
@@ -27,97 +28,93 @@ const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ _createEle
|
|
|
27
28
|
-1
|
|
28
29
|
/* HOISTED */
|
|
29
30
|
));
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const _hoisted_4 = [
|
|
32
|
+
_hoisted_3
|
|
32
33
|
];
|
|
33
34
|
function __render__(_ctx, _cache) {
|
|
34
35
|
const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
|
|
35
36
|
const _component_var_form_details = _resolveComponent("var-form-details");
|
|
36
37
|
const _directive_ripple = _resolveDirective("ripple");
|
|
37
38
|
const _directive_hover = _resolveDirective("hover");
|
|
38
|
-
return _withDirectives((_openBlock(), _createElementBlock(
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
40
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.variant, _ctx.n("--variant")])),
|
|
41
|
+
role: "switch",
|
|
42
|
+
"aria-checked": _ctx.modelValue
|
|
43
|
+
}, [
|
|
44
|
+
_createElementVNode(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
ref: "switchRef",
|
|
48
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("block"), [_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")], [_ctx.isActive, _ctx.n("block--active")])),
|
|
49
|
+
style: _normalizeStyle(_ctx.styleComputed.switch),
|
|
50
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.switchActive && _ctx.switchActive(...args))
|
|
51
|
+
},
|
|
52
|
+
[
|
|
53
|
+
_createElementVNode(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
style: _normalizeStyle(_ctx.styleComputed.track),
|
|
57
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.isActive, _ctx.n("track--active")], [_ctx.errorMessage && !_ctx.variant, _ctx.n("track--error")]))
|
|
58
|
+
},
|
|
59
|
+
null,
|
|
60
|
+
6
|
|
61
|
+
/* CLASS, STYLE */
|
|
62
|
+
),
|
|
63
|
+
_withDirectives((_openBlock(), _createElementBlock("div", {
|
|
64
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("ripple"), [_ctx.isActive, _ctx.n("ripple--active")])),
|
|
65
|
+
style: _normalizeStyle(_ctx.styleComputed.ripple),
|
|
66
|
+
tabindex: _ctx.disabled || _ctx.formDisabled ? void 0 : "0",
|
|
67
|
+
onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.isFocusing = true),
|
|
68
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => _ctx.isFocusing = false)
|
|
69
|
+
}, [
|
|
53
70
|
_createElementVNode(
|
|
54
71
|
"div",
|
|
55
72
|
{
|
|
56
|
-
style: _normalizeStyle(_ctx.styleComputed.
|
|
57
|
-
class: _normalizeClass(
|
|
73
|
+
style: _normalizeStyle(_ctx.styleComputed.handle),
|
|
74
|
+
class: _normalizeClass(
|
|
75
|
+
_ctx.classes(
|
|
76
|
+
_ctx.n("handle"),
|
|
77
|
+
_ctx.n("$-elevation--2"),
|
|
78
|
+
[_ctx.isActive, _ctx.n("handle--active")],
|
|
79
|
+
[_ctx.errorMessage && !_ctx.variant, _ctx.n("handle--error")],
|
|
80
|
+
[_ctx.hovering, _ctx.n("handle--hover")]
|
|
81
|
+
)
|
|
82
|
+
)
|
|
58
83
|
},
|
|
59
|
-
|
|
84
|
+
[
|
|
85
|
+
_ctx.loading ? (_openBlock(), _createElementBlock(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
key: 0,
|
|
89
|
+
class: _normalizeClass(_ctx.n("loading")),
|
|
90
|
+
style: _normalizeStyle({
|
|
91
|
+
width: _ctx.radius,
|
|
92
|
+
height: _ctx.radius
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
[..._hoisted_4],
|
|
96
|
+
6
|
|
97
|
+
/* CLASS, STYLE */
|
|
98
|
+
)) : _createCommentVNode("v-if", true)
|
|
99
|
+
],
|
|
60
100
|
6
|
|
61
101
|
/* CLASS, STYLE */
|
|
62
102
|
),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
[_ctx.isActive, _ctx.n("handle--active")],
|
|
79
|
-
[_ctx.errorMessage && !_ctx.variant, _ctx.n("handle--error")],
|
|
80
|
-
[_ctx.hovering, _ctx.n("handle--hover")]
|
|
81
|
-
)
|
|
82
|
-
)
|
|
83
|
-
},
|
|
84
|
-
[
|
|
85
|
-
_ctx.loading ? (_openBlock(), _createElementBlock(
|
|
86
|
-
"span",
|
|
87
|
-
{
|
|
88
|
-
key: 0,
|
|
89
|
-
class: _normalizeClass(_ctx.n("loading")),
|
|
90
|
-
style: _normalizeStyle({
|
|
91
|
-
width: _ctx.radius,
|
|
92
|
-
height: _ctx.radius
|
|
93
|
-
})
|
|
94
|
-
},
|
|
95
|
-
[..._hoisted_3],
|
|
96
|
-
6
|
|
97
|
-
/* CLASS, STYLE */
|
|
98
|
-
)) : _createCommentVNode("v-if", true)
|
|
99
|
-
],
|
|
100
|
-
6
|
|
101
|
-
/* CLASS, STYLE */
|
|
102
|
-
),
|
|
103
|
-
_createVNode(_component_var_hover_overlay, {
|
|
104
|
-
hovering: _ctx.hovering && !_ctx.disabled && !_ctx.formDisabled,
|
|
105
|
-
focusing: _ctx.isFocusing && !_ctx.disabled && !_ctx.formDisabled
|
|
106
|
-
}, null, 8, ["hovering", "focusing"])
|
|
107
|
-
], 46, _hoisted_1)), [
|
|
108
|
-
[_directive_ripple, {
|
|
109
|
-
disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly
|
|
110
|
-
}]
|
|
111
|
-
])
|
|
112
|
-
],
|
|
113
|
-
6
|
|
114
|
-
/* CLASS, STYLE */
|
|
115
|
-
),
|
|
116
|
-
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
117
|
-
],
|
|
118
|
-
2
|
|
119
|
-
/* CLASS */
|
|
120
|
-
)), [
|
|
103
|
+
_createVNode(_component_var_hover_overlay, {
|
|
104
|
+
hovering: _ctx.hovering && !_ctx.disabled && !_ctx.formDisabled,
|
|
105
|
+
focusing: _ctx.isFocusing && !_ctx.disabled && !_ctx.formDisabled
|
|
106
|
+
}, null, 8, ["hovering", "focusing"])
|
|
107
|
+
], 46, _hoisted_2)), [
|
|
108
|
+
[_directive_ripple, {
|
|
109
|
+
disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly
|
|
110
|
+
}]
|
|
111
|
+
])
|
|
112
|
+
],
|
|
113
|
+
6
|
|
114
|
+
/* CLASS, STYLE */
|
|
115
|
+
),
|
|
116
|
+
_createVNode(_component_var_form_details, { "error-message": _ctx.errorMessage }, null, 8, ["error-message"])
|
|
117
|
+
], 10, _hoisted_1)), [
|
|
121
118
|
[_directive_hover, _ctx.hover, "desktop"]
|
|
122
119
|
]);
|
|
123
120
|
}
|
package/es/time-picker/clock.mjs
CHANGED
|
@@ -113,12 +113,10 @@ const __sfc__ = defineComponent({
|
|
|
113
113
|
required: true
|
|
114
114
|
},
|
|
115
115
|
useSeconds: {
|
|
116
|
-
type: Boolean
|
|
117
|
-
default: false
|
|
116
|
+
type: Boolean
|
|
118
117
|
},
|
|
119
118
|
preventNextUpdate: {
|
|
120
|
-
type: Boolean
|
|
121
|
-
default: false
|
|
119
|
+
type: Boolean
|
|
122
120
|
},
|
|
123
121
|
type: {
|
|
124
122
|
type: String,
|
|
@@ -310,7 +308,7 @@ const __sfc__ = defineComponent({
|
|
|
310
308
|
}
|
|
311
309
|
disable24HourIndex.value = disableHour.value.map((hour) => hours24.findIndex((hour24) => hour === hour24)).filter((hour) => hour >= 0);
|
|
312
310
|
},
|
|
313
|
-
{ immediate: true }
|
|
311
|
+
{ immediate: true, deep: true }
|
|
314
312
|
);
|
|
315
313
|
return {
|
|
316
314
|
n,
|
package/es/tooltip/Tooltip.mjs
CHANGED
|
@@ -44,7 +44,8 @@ function __render__(_ctx, _cache) {
|
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
style: _normalizeStyle({ background: _ctx.color, width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : void 0 }),
|
|
47
|
-
class: _normalizeClass(_ctx.classes(_ctx.n("content-container"), _ctx.n(`--${_ctx.type}`)))
|
|
47
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("content-container"), _ctx.n(`--${_ctx.type}`))),
|
|
48
|
+
role: "tooltip"
|
|
48
49
|
},
|
|
49
50
|
[
|
|
50
51
|
_renderSlot(_ctx.$slots, "content", {}, () => [
|