@nutui/nutui 4.0.10-beta.1 → 4.0.10
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 +17 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6550 -8291
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +154 -51
- package/dist/styles/themes/jdb.scss +154 -51
- package/dist/styles/themes/jddkh.scss +154 -51
- package/dist/styles/themes/jdt.scss +154 -51
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { toRefs, reactive, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var f = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var r = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var c = (e, t, o) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, p = (e, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
y.call(t, o) && c(e, o, t[o]);
|
|
8
|
+
if (r)
|
|
9
|
+
for (var o of r(t))
|
|
10
|
+
C.call(t, o) && c(e, o, t[o]);
|
|
11
|
+
return e;
|
|
12
|
+
}, u = (e, t) => k(e, v(t));
|
|
13
|
+
import { toRefs as d, reactive as $, computed as S, openBlock as _, createElementBlock as g, createElementVNode as h, normalizeClass as B, normalizeStyle as N, renderSlot as w } from "vue";
|
|
14
|
+
import { c as z } from "./component-234624bc.js";
|
|
15
|
+
import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
|
|
23
16
|
import "../locale/lang";
|
|
24
|
-
const { componentName, create } =
|
|
25
|
-
const _sfc_main = create({
|
|
17
|
+
const { componentName: b, create: D } = z("animate"), R = D({
|
|
26
18
|
props: {
|
|
27
19
|
type: {
|
|
28
20
|
type: String,
|
|
@@ -34,53 +26,44 @@ const _sfc_main = create({
|
|
|
34
26
|
},
|
|
35
27
|
loop: {
|
|
36
28
|
type: Boolean,
|
|
37
|
-
default:
|
|
29
|
+
default: !1
|
|
38
30
|
},
|
|
39
31
|
duration: {
|
|
40
32
|
type: [String, Number]
|
|
41
33
|
}
|
|
42
34
|
},
|
|
43
35
|
emits: ["click"],
|
|
44
|
-
setup(
|
|
45
|
-
const { type, loop, action } =
|
|
46
|
-
|
|
47
|
-
clicked: false
|
|
48
|
-
});
|
|
49
|
-
let classes = computed(() => {
|
|
50
|
-
const prefixCls = componentName;
|
|
51
|
-
return {
|
|
52
|
-
"nut-animate__container": true,
|
|
53
|
-
[`${prefixCls}-${type.value}`]: action.value === "initial" || state.clicked ? type.value : false,
|
|
54
|
-
loop: loop.value
|
|
55
|
-
};
|
|
36
|
+
setup(e, { emit: t }) {
|
|
37
|
+
const { type: o, loop: n, action: l } = d(e), a = $({
|
|
38
|
+
clicked: !1
|
|
56
39
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
let i = S(() => ({
|
|
41
|
+
"nut-animate__container": !0,
|
|
42
|
+
[`${b}-${o.value}`]: l.value === "initial" || a.clicked ? o.value : !1,
|
|
43
|
+
loop: n.value
|
|
44
|
+
}));
|
|
45
|
+
const m = (s) => {
|
|
46
|
+
a.clicked = !0, n.value || setTimeout(() => {
|
|
47
|
+
a.clicked = !1;
|
|
48
|
+
}, 1e3), t("click", s);
|
|
65
49
|
};
|
|
66
|
-
return
|
|
50
|
+
return u(p({}, d(a)), { classes: i, handleClick: m });
|
|
67
51
|
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
animationDuration: _ctx.duration ? `${_ctx.duration}ms` : void 0
|
|
52
|
+
}), T = { class: "nut-animate" };
|
|
53
|
+
function V(e, t, o, n, l, a) {
|
|
54
|
+
return _(), g("view", T, [
|
|
55
|
+
h("view", {
|
|
56
|
+
class: B(e.classes),
|
|
57
|
+
onClick: t[0] || (t[0] = (...i) => e.handleClick && e.handleClick(...i)),
|
|
58
|
+
style: N({
|
|
59
|
+
animationDuration: e.duration ? `${e.duration}ms` : void 0
|
|
77
60
|
})
|
|
78
61
|
}, [
|
|
79
|
-
|
|
62
|
+
w(e.$slots, "default")
|
|
80
63
|
], 6)
|
|
81
64
|
]);
|
|
82
65
|
}
|
|
83
|
-
const
|
|
66
|
+
const G = /* @__PURE__ */ E(R, [["render", V]]);
|
|
84
67
|
export {
|
|
85
|
-
|
|
68
|
+
G as default
|
|
86
69
|
};
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, reactive, onMounted, watch, provide, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createCommentVNode, normalizeClass, createBlock, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { Service } from "@nutui/icons-vue";
|
|
23
|
-
import Range from "./Range.js";
|
|
24
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var I = Object.defineProperty, z = Object.defineProperties;
|
|
2
|
+
var L = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var C = Object.getOwnPropertySymbols;
|
|
4
|
+
var U = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var M = (e, n, i) => n in e ? I(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i, g = (e, n) => {
|
|
6
|
+
for (var i in n || (n = {}))
|
|
7
|
+
U.call(n, i) && M(e, i, n[i]);
|
|
8
|
+
if (C)
|
|
9
|
+
for (var i of C(n))
|
|
10
|
+
j.call(n, i) && M(e, i, n[i]);
|
|
11
|
+
return e;
|
|
12
|
+
}, B = (e, n) => z(e, L(n));
|
|
13
|
+
import { ref as q, reactive as A, onMounted as F, watch as G, provide as H, toRefs as b, resolveComponent as _, openBlock as s, createElementBlock as p, createElementVNode as l, toDisplayString as E, createVNode as J, withCtx as K, createCommentVNode as m, normalizeClass as O, createBlock as V, renderSlot as w } from "vue";
|
|
14
|
+
import { c as Q } from "./component-234624bc.js";
|
|
15
|
+
import { Service as W } from "@nutui/icons-vue";
|
|
16
|
+
import P from "./Range.js";
|
|
17
|
+
import { _ as X } from "./_plugin-vue_export-helper-dad06003.js";
|
|
25
18
|
import "../locale/lang";
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./index-
|
|
28
|
-
const { componentName, create } =
|
|
29
|
-
const _sfc_main = create({
|
|
19
|
+
import "./index-53ec2d4d.js";
|
|
20
|
+
import "./index-192a3ef6.js";
|
|
21
|
+
const { componentName: he, create: Y } = Q("audio"), Z = Y({
|
|
30
22
|
props: {
|
|
31
23
|
url: {
|
|
32
24
|
type: String,
|
|
@@ -35,17 +27,17 @@ const _sfc_main = create({
|
|
|
35
27
|
// 静音
|
|
36
28
|
muted: {
|
|
37
29
|
type: Boolean,
|
|
38
|
-
default:
|
|
30
|
+
default: !1
|
|
39
31
|
},
|
|
40
32
|
// 自动播放
|
|
41
33
|
autoplay: {
|
|
42
34
|
type: Boolean,
|
|
43
|
-
default:
|
|
35
|
+
default: !1
|
|
44
36
|
},
|
|
45
37
|
// 循环播放
|
|
46
38
|
loop: {
|
|
47
39
|
type: Boolean,
|
|
48
|
-
default:
|
|
40
|
+
default: !1
|
|
49
41
|
},
|
|
50
42
|
// 是否预加载音频
|
|
51
43
|
preload: {
|
|
@@ -64,211 +56,150 @@ const _sfc_main = create({
|
|
|
64
56
|
}
|
|
65
57
|
},
|
|
66
58
|
components: {
|
|
67
|
-
Service,
|
|
68
|
-
[
|
|
59
|
+
Service: W,
|
|
60
|
+
[P.name]: P
|
|
69
61
|
},
|
|
70
62
|
emits: ["fastBack", "play", "forward", "ended", "changeProgress", "mute", "can-play"],
|
|
71
|
-
setup(
|
|
72
|
-
const
|
|
73
|
-
const audioData = reactive({
|
|
63
|
+
setup(e, { emit: n, slots: i }) {
|
|
64
|
+
const u = q(null), t = A({
|
|
74
65
|
currentTime: 0,
|
|
75
66
|
currentDuration: "00:00:00",
|
|
76
67
|
percent: 0,
|
|
77
68
|
duration: "00:00:00",
|
|
78
69
|
second: 0,
|
|
79
|
-
hanMuted:
|
|
80
|
-
playing:
|
|
81
|
-
handPlaying:
|
|
70
|
+
hanMuted: e.muted,
|
|
71
|
+
playing: e.autoplay,
|
|
72
|
+
handPlaying: !1
|
|
82
73
|
});
|
|
83
|
-
|
|
84
|
-
var
|
|
74
|
+
F(() => {
|
|
75
|
+
var o = ["webkitVisibilityState", "visibilitychange"];
|
|
85
76
|
try {
|
|
86
|
-
for (let
|
|
87
|
-
document.addEventListener(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
if (audioData.playing) {
|
|
92
|
-
setTimeout(() => {
|
|
93
|
-
audioRef.value.play();
|
|
94
|
-
}, 200);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
77
|
+
for (let a = 0; a < o.length; a++)
|
|
78
|
+
document.addEventListener(o[a], () => {
|
|
79
|
+
document.hidden ? u.value.pause() : t.playing && setTimeout(() => {
|
|
80
|
+
u.value.play();
|
|
81
|
+
}, 200);
|
|
97
82
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
console.log(e.message);
|
|
83
|
+
} catch (a) {
|
|
84
|
+
console.log(a.message);
|
|
101
85
|
}
|
|
102
86
|
});
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (audioData.playing) {
|
|
127
|
-
audioR.pause();
|
|
128
|
-
audioData.handPlaying = false;
|
|
129
|
-
} else {
|
|
130
|
-
audioR.play();
|
|
131
|
-
audioData.handPlaying = true;
|
|
132
|
-
}
|
|
133
|
-
audioData.playing = !audioData.playing;
|
|
134
|
-
emit("play", audioData.playing);
|
|
135
|
-
};
|
|
136
|
-
const forward = () => {
|
|
137
|
-
audioData.currentTime++;
|
|
138
|
-
audioRef.value.currentTime = audioData.currentTime;
|
|
139
|
-
emit("forward", audioData.currentTime);
|
|
140
|
-
};
|
|
141
|
-
const handle = (val) => {
|
|
142
|
-
audioData.currentDuration = formatSeconds(val);
|
|
143
|
-
audioData.percent = val / audioData.second * 100;
|
|
144
|
-
};
|
|
145
|
-
const audioEnd = () => {
|
|
146
|
-
audioData.playing = false;
|
|
147
|
-
emit("ended");
|
|
148
|
-
};
|
|
149
|
-
const progressChange = (val) => {
|
|
150
|
-
const ar = audioRef.value;
|
|
151
|
-
ar.currentTime = audioData.second * val / 100;
|
|
152
|
-
emit("changeProgress", ar.currentTime);
|
|
153
|
-
};
|
|
154
|
-
const handleMute = () => {
|
|
155
|
-
audioData.hanMuted = !audioData.hanMuted;
|
|
156
|
-
emit("mute", audioData.hanMuted);
|
|
157
|
-
};
|
|
158
|
-
const formatSeconds = (value) => {
|
|
159
|
-
if (!value) {
|
|
87
|
+
const h = (o) => {
|
|
88
|
+
const a = u.value;
|
|
89
|
+
e.autoplay && a && a.paused && a.play(), t.second = a.duration, t.duration = S(a.duration), n("can-play", o);
|
|
90
|
+
}, y = (o) => {
|
|
91
|
+
t.currentTime = parseInt(o.target.currentTime);
|
|
92
|
+
}, d = () => {
|
|
93
|
+
t.currentTime > 0 && t.currentTime--, u.value.currentTime = t.currentTime, n("fastBack", t.currentTime);
|
|
94
|
+
}, r = () => {
|
|
95
|
+
const o = u.value;
|
|
96
|
+
t.playing ? (o.pause(), t.handPlaying = !1) : (o.play(), t.handPlaying = !0), t.playing = !t.playing, n("play", t.playing);
|
|
97
|
+
}, v = () => {
|
|
98
|
+
t.currentTime++, u.value.currentTime = t.currentTime, n("forward", t.currentTime);
|
|
99
|
+
}, R = (o) => {
|
|
100
|
+
t.currentDuration = S(o), t.percent = o / t.second * 100;
|
|
101
|
+
}, $ = () => {
|
|
102
|
+
t.playing = !1, n("ended");
|
|
103
|
+
}, D = (o) => {
|
|
104
|
+
const a = u.value;
|
|
105
|
+
a.currentTime = t.second * o / 100, n("changeProgress", a.currentTime);
|
|
106
|
+
}, T = () => {
|
|
107
|
+
t.hanMuted = !t.hanMuted, n("mute", t.hanMuted);
|
|
108
|
+
}, S = (o) => {
|
|
109
|
+
if (!o)
|
|
160
110
|
return "00:00:00";
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
let hours = Math.floor(time / 3600);
|
|
164
|
-
let minutes = Math.floor((time - hours * 3600) / 60);
|
|
165
|
-
let seconds = time - hours * 3600 - minutes * 60;
|
|
166
|
-
let result = "";
|
|
167
|
-
result += ("0" + hours.toString()).slice(-2) + ":";
|
|
168
|
-
result += ("0" + minutes.toString()).slice(-2) + ":";
|
|
169
|
-
result += ("0" + seconds.toString()).slice(-2);
|
|
170
|
-
return result;
|
|
111
|
+
let a = parseInt(o), f = Math.floor(a / 3600), k = Math.floor((a - f * 3600) / 60), N = a - f * 3600 - k * 60, c = "";
|
|
112
|
+
return c += ("0" + f.toString()).slice(-2) + ":", c += ("0" + k.toString()).slice(-2) + ":", c += ("0" + N.toString()).slice(-2), c;
|
|
171
113
|
};
|
|
172
|
-
|
|
173
|
-
() =>
|
|
174
|
-
(
|
|
175
|
-
|
|
114
|
+
return G(
|
|
115
|
+
() => t.currentTime,
|
|
116
|
+
(o) => {
|
|
117
|
+
R(o);
|
|
176
118
|
}
|
|
177
|
-
)
|
|
178
|
-
provide("audioParent", {
|
|
119
|
+
), H("audioParent", {
|
|
179
120
|
children: [],
|
|
180
|
-
props,
|
|
181
|
-
audioData,
|
|
182
|
-
handleMute,
|
|
183
|
-
forward,
|
|
184
|
-
fastBack,
|
|
185
|
-
changeStatus
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
slots
|
|
121
|
+
props: e,
|
|
122
|
+
audioData: t,
|
|
123
|
+
handleMute: T,
|
|
124
|
+
forward: v,
|
|
125
|
+
fastBack: d,
|
|
126
|
+
changeStatus: r
|
|
127
|
+
}), B(g(g({}, b(e)), b(t)), {
|
|
128
|
+
audioRef: u,
|
|
129
|
+
fastBack: d,
|
|
130
|
+
forward: v,
|
|
131
|
+
changeStatus: r,
|
|
132
|
+
progressChange: D,
|
|
133
|
+
audioEnd: $,
|
|
134
|
+
onTimeupdate: y,
|
|
135
|
+
handleMute: T,
|
|
136
|
+
onCanplay: h,
|
|
137
|
+
slots: i
|
|
198
138
|
});
|
|
199
139
|
}
|
|
200
|
-
})
|
|
201
|
-
const _hoisted_1 = { class: "nut-audio" };
|
|
202
|
-
const _hoisted_2 = {
|
|
140
|
+
}), x = { class: "nut-audio" }, ee = {
|
|
203
141
|
key: 0,
|
|
204
142
|
class: "nut-audio__progress"
|
|
205
|
-
}
|
|
206
|
-
const _hoisted_3 = { class: "nut-audio__time" };
|
|
207
|
-
const _hoisted_4 = { class: "nut-audio__bar" };
|
|
208
|
-
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "nut-audio__button--custom" }, null, -1);
|
|
209
|
-
const _hoisted_6 = { class: "nut-audio__time" };
|
|
210
|
-
const _hoisted_7 = {
|
|
143
|
+
}, ne = { class: "nut-audio__time" }, te = { class: "nut-audio__bar" }, oe = /* @__PURE__ */ l("div", { class: "nut-audio__button--custom" }, null, -1), ae = { class: "nut-audio__time" }, re = {
|
|
211
144
|
key: 1,
|
|
212
145
|
class: "nut-audio__icon"
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
modelValue: _ctx.percent,
|
|
224
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.percent = $event),
|
|
146
|
+
}, ie = ["controls", "src", "preload", "autoplay", "loop", "muted"];
|
|
147
|
+
function ue(e, n, i, u, t, h) {
|
|
148
|
+
const y = _("nut-range"), d = _("Service");
|
|
149
|
+
return s(), p("div", x, [
|
|
150
|
+
e.type == "progress" ? (s(), p("div", ee, [
|
|
151
|
+
l("div", ne, E(e.currentDuration), 1),
|
|
152
|
+
l("div", te, [
|
|
153
|
+
J(y, {
|
|
154
|
+
modelValue: e.percent,
|
|
155
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => e.percent = r),
|
|
225
156
|
"hidden-range": "",
|
|
226
|
-
onChange:
|
|
157
|
+
onChange: e.progressChange,
|
|
227
158
|
"inactive-color": "#cccccc",
|
|
228
159
|
"active-color": "#fa2c19"
|
|
229
160
|
}, {
|
|
230
|
-
button:
|
|
231
|
-
|
|
161
|
+
button: K(() => [
|
|
162
|
+
oe
|
|
232
163
|
]),
|
|
233
164
|
_: 1
|
|
234
165
|
}, 8, ["modelValue", "onChange"])
|
|
235
166
|
]),
|
|
236
|
-
|
|
237
|
-
])) :
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
class:
|
|
241
|
-
onClick:
|
|
167
|
+
l("div", ae, E(e.duration), 1)
|
|
168
|
+
])) : m("", !0),
|
|
169
|
+
e.type == "icon" ? (s(), p("div", re, [
|
|
170
|
+
l("div", {
|
|
171
|
+
class: O(["nut-audio__icon--box", e.playing ? "nut-audio__icon--play" : "nut-audio__icon--stop"]),
|
|
172
|
+
onClick: n[1] || (n[1] = (...r) => e.changeStatus && e.changeStatus(...r))
|
|
242
173
|
}, [
|
|
243
|
-
|
|
174
|
+
e.playing ? (s(), V(d, {
|
|
244
175
|
key: 0,
|
|
245
176
|
class: "nut-icon-am-rotate nut-icon-am-infinite"
|
|
246
|
-
})) : (
|
|
177
|
+
})) : (s(), V(d, { key: 1 }))
|
|
247
178
|
], 2)
|
|
248
|
-
])) :
|
|
249
|
-
|
|
179
|
+
])) : m("", !0),
|
|
180
|
+
e.type == "none" ? (s(), p("div", {
|
|
250
181
|
key: 2,
|
|
251
|
-
onClick:
|
|
182
|
+
onClick: n[2] || (n[2] = (...r) => e.changeStatus && e.changeStatus(...r))
|
|
252
183
|
}, [
|
|
253
|
-
|
|
254
|
-
])) :
|
|
255
|
-
|
|
256
|
-
|
|
184
|
+
w(e.$slots, "default")
|
|
185
|
+
])) : m("", !0),
|
|
186
|
+
e.type != "none" ? w(e.$slots, "default", { key: 3 }) : m("", !0),
|
|
187
|
+
l("audio", {
|
|
257
188
|
class: "audioMain",
|
|
258
|
-
controls:
|
|
189
|
+
controls: e.type == "controls",
|
|
259
190
|
ref: "audioRef",
|
|
260
|
-
src:
|
|
261
|
-
preload:
|
|
262
|
-
autoplay:
|
|
263
|
-
loop:
|
|
264
|
-
onTimeupdate:
|
|
265
|
-
onCanplay:
|
|
266
|
-
onEnded:
|
|
267
|
-
muted:
|
|
268
|
-
}, null, 40,
|
|
191
|
+
src: e.url,
|
|
192
|
+
preload: e.preload,
|
|
193
|
+
autoplay: e.autoplay,
|
|
194
|
+
loop: e.loop,
|
|
195
|
+
onTimeupdate: n[3] || (n[3] = (...r) => e.onTimeupdate && e.onTimeupdate(...r)),
|
|
196
|
+
onCanplay: n[4] || (n[4] = (...r) => e.onCanplay && e.onCanplay(...r)),
|
|
197
|
+
onEnded: n[5] || (n[5] = (...r) => e.audioEnd && e.audioEnd(...r)),
|
|
198
|
+
muted: e.hanMuted
|
|
199
|
+
}, null, 40, ie)
|
|
269
200
|
]);
|
|
270
201
|
}
|
|
271
|
-
const
|
|
202
|
+
const ve = /* @__PURE__ */ X(Z, [["render", ue]]);
|
|
272
203
|
export {
|
|
273
|
-
|
|
204
|
+
ve as default
|
|
274
205
|
};
|