@varlet/ui 3.2.12 → 3.2.14-alpha.1717685185218
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 +4 -0
- package/README.zh-CN.md +4 -0
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/app-bar/AppBar.mjs +111 -77
- package/es/app-bar/props.mjs +2 -1
- package/es/avatar/avatar.css +1 -1
- package/es/bottom-navigation/BottomNavigation.mjs +2 -1
- package/es/cell/cell.css +1 -1
- package/es/checkbox/Checkbox.mjs +3 -3
- package/es/checkbox-group/style/index.mjs +3 -0
- package/es/collapse-item/collapseItem.css +1 -1
- package/es/ellipsis/ellipsis.css +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/link/link.css +1 -1
- package/es/paper/paper.css +1 -1
- package/es/radio/Radio.mjs +1 -1
- package/es/radio-group/RadioGroup.mjs +22 -4
- package/es/radio-group/RadioGroupOption.mjs +45 -0
- package/es/radio-group/props.mjs +9 -0
- package/es/radio-group/style/index.mjs +4 -0
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style-provider/index.mjs +25 -7
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +6 -4
- package/es/swipe-item/SwipeItem.mjs +8 -6
- package/es/varlet.esm.js +4512 -4411
- package/highlight/web-types.en-US.json +37 -1
- package/highlight/web-types.zh-CN.json +37 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +993 -875
- package/package.json +7 -7
- package/types/appBar.d.ts +1 -0
- package/types/radio.d.ts +5 -1
- package/types/radioGroup.d.ts +14 -1
- package/types/styleVars.d.ts +4 -6
- package/umd/varlet.js +8 -6
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -28,6 +28,7 @@ import { clamp, isNumber, toNumber, doubleRaf, preventDefault, call } from "@var
|
|
|
28
28
|
import { createNamespace } from "../utils/components.mjs";
|
|
29
29
|
import { onSmartUnmounted, onWindowResize, useTouch } from "@varlet/use";
|
|
30
30
|
import { usePopup } from "../popup/provide.mjs";
|
|
31
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
31
32
|
const SWIPE_DELAY = 250;
|
|
32
33
|
const SWIPE_OFFSET = 20;
|
|
33
34
|
const { name, n, classes } = createNamespace("swipe");
|
|
@@ -50,10 +51,10 @@ function __render__(_ctx, _cache) {
|
|
|
50
51
|
{
|
|
51
52
|
class: _normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.vertical, _ctx.n("--vertical")])),
|
|
52
53
|
style: _normalizeStyle({
|
|
53
|
-
width: !_ctx.vertical ?
|
|
54
|
-
height: _ctx.vertical ?
|
|
55
|
-
transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.trackTranslate}
|
|
56
|
-
transitionDuration: _ctx.lockDuration ?
|
|
54
|
+
width: !_ctx.vertical ? _ctx.toSizeUnit(_ctx.trackSize) : void 0,
|
|
55
|
+
height: _ctx.vertical ? _ctx.toSizeUnit(_ctx.trackSize) : void 0,
|
|
56
|
+
transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.toSizeUnit(_ctx.trackTranslate)})`,
|
|
57
|
+
transitionDuration: _ctx.lockDuration ? "0ms" : `${_ctx.toNumber(_ctx.duration)}ms`
|
|
57
58
|
}),
|
|
58
59
|
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
|
|
59
60
|
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
|
|
@@ -489,6 +490,7 @@ const __sfc__ = defineComponent({
|
|
|
489
490
|
lockDuration,
|
|
490
491
|
hovering,
|
|
491
492
|
n,
|
|
493
|
+
toSizeUnit,
|
|
492
494
|
classes,
|
|
493
495
|
handleTouchstart,
|
|
494
496
|
handleTouchmove,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref } from "vue";
|
|
2
2
|
import { useSwipe } from "./provide.mjs";
|
|
3
3
|
import { createNamespace } from "../utils/components.mjs";
|
|
4
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
4
5
|
const { name, n } = createNamespace("swipe-item");
|
|
5
6
|
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
7
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
@@ -9,12 +10,12 @@ function __render__(_ctx, _cache) {
|
|
|
9
10
|
return _openBlock(), _createElementBlock("div", {
|
|
10
11
|
class: _normalizeClass(_ctx.n()),
|
|
11
12
|
style: _normalizeStyle({
|
|
12
|
-
width: !_ctx.vertical ?
|
|
13
|
-
height: _ctx.vertical ?
|
|
14
|
-
transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.translate}
|
|
13
|
+
width: !_ctx.vertical ? _ctx.toSizeUnit(_ctx.size) : void 0,
|
|
14
|
+
height: _ctx.vertical ? _ctx.toSizeUnit(_ctx.size) : void 0,
|
|
15
|
+
transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.toSizeUnit(_ctx.translate)})`
|
|
15
16
|
}),
|
|
16
17
|
tabindex: "-1",
|
|
17
|
-
"aria-hidden": _ctx.currentIndex
|
|
18
|
+
"aria-hidden": _ctx.currentIndex !== _ctx.index
|
|
18
19
|
}, [
|
|
19
20
|
_renderSlot(_ctx.$slots, "default")
|
|
20
21
|
], 14, _hoisted_1);
|
|
@@ -34,12 +35,13 @@ const __sfc__ = defineComponent({
|
|
|
34
35
|
translate.value = x;
|
|
35
36
|
}
|
|
36
37
|
return {
|
|
37
|
-
n,
|
|
38
38
|
size,
|
|
39
39
|
index,
|
|
40
40
|
currentIndex,
|
|
41
41
|
vertical,
|
|
42
|
-
translate
|
|
42
|
+
translate,
|
|
43
|
+
n,
|
|
44
|
+
toSizeUnit
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
});
|