@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,22 +1,64 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs, reactive, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
const { componentName, create } = createComponent("animate");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
action: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "initial"
|
|
20
|
+
},
|
|
21
|
+
loop: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["click"],
|
|
27
|
+
setup(props, { emit }) {
|
|
28
|
+
const { type, loop, action } = toRefs(props);
|
|
29
|
+
const state = reactive({
|
|
30
|
+
clicked: false
|
|
31
|
+
});
|
|
32
|
+
let classes = computed(() => {
|
|
33
|
+
const prefixCls = componentName;
|
|
34
|
+
return {
|
|
35
|
+
"nut-ani-container": true,
|
|
36
|
+
[`${prefixCls}-${type.value}`]: action.value === "initial" || state.clicked ? type.value : false,
|
|
37
|
+
loop: loop.value
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
const handleClick = (event) => {
|
|
41
|
+
state.clicked = true;
|
|
42
|
+
if (!loop.value) {
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
state.clicked = false;
|
|
45
|
+
}, 1e3);
|
|
46
|
+
}
|
|
47
|
+
emit("click", event);
|
|
48
|
+
};
|
|
49
|
+
return { ...toRefs(state), classes, handleClick };
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const _hoisted_1 = { class: "nut-animate" };
|
|
53
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
54
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
55
|
+
createElementVNode("view", {
|
|
56
|
+
class: normalizeClass(_ctx.classes),
|
|
57
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
58
|
+
}, [
|
|
59
|
+
renderSlot(_ctx.$slots, "default")
|
|
60
|
+
], 2)
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
64
|
+
export { index as default };
|
|
@@ -1,59 +1,263 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { ref, reactive, onMounted, watch, provide, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createCommentVNode, normalizeClass, createBlock, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const { componentName, create } = createComponent("audio");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
url: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
muted: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
autoplay: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
loop: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
preload: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "auto"
|
|
32
|
+
},
|
|
33
|
+
second: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 0
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "progress"
|
|
22
40
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
},
|
|
42
|
+
components: {},
|
|
43
|
+
emits: ["fastBack", "play", "forward", "ended", "changeProgress", "mute"],
|
|
44
|
+
setup(props, { emit }) {
|
|
45
|
+
const audioRef = ref(null);
|
|
46
|
+
const audioData = reactive({
|
|
47
|
+
currentTime: 0,
|
|
48
|
+
currentDuration: "00:00:00",
|
|
49
|
+
percent: 0,
|
|
50
|
+
duration: "00:00:00",
|
|
51
|
+
second: 0,
|
|
52
|
+
hanMuted: props.muted,
|
|
53
|
+
playing: props.autoplay,
|
|
54
|
+
handPlaying: false
|
|
55
|
+
});
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
var arr = ["webkitVisibilityState", "visibilitychange"];
|
|
58
|
+
try {
|
|
59
|
+
for (let i = 0; i < arr.length; i++) {
|
|
60
|
+
document.addEventListener(arr[i], () => {
|
|
61
|
+
if (document.hidden) {
|
|
62
|
+
audioRef.value.pause();
|
|
63
|
+
} else {
|
|
64
|
+
if (audioData.playing) {
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
audioRef.value.play();
|
|
67
|
+
}, 200);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.log(e.message);
|
|
74
|
+
}
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
const audioR = audioRef.value;
|
|
77
|
+
if (props.autoplay) {
|
|
78
|
+
if (audioR && audioR.paused) {
|
|
79
|
+
audioR.play();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
audioData.second = audioR.duration;
|
|
83
|
+
audioData.duration = formatSeconds(audioR.duration);
|
|
84
|
+
}, 500);
|
|
85
|
+
});
|
|
86
|
+
const onTimeupdate = (e) => {
|
|
87
|
+
audioData.currentTime = parseInt(e.target.currentTime);
|
|
88
|
+
};
|
|
89
|
+
const fastBack = () => {
|
|
90
|
+
audioData.currentTime--;
|
|
91
|
+
audioRef.value.currentTime = audioData.currentTime;
|
|
92
|
+
emit("fastBack", audioData.currentTime);
|
|
93
|
+
};
|
|
94
|
+
const changeStatus = () => {
|
|
95
|
+
const audioR = audioRef.value;
|
|
96
|
+
if (audioData.playing) {
|
|
97
|
+
audioR.pause();
|
|
98
|
+
audioData.handPlaying = false;
|
|
99
|
+
} else {
|
|
100
|
+
audioR.play();
|
|
101
|
+
audioData.handPlaying = true;
|
|
102
|
+
}
|
|
103
|
+
audioData.playing = !audioData.playing;
|
|
104
|
+
emit("play", audioData.playing);
|
|
105
|
+
};
|
|
106
|
+
const forward = () => {
|
|
107
|
+
audioData.currentTime++;
|
|
108
|
+
audioRef.value.currentTime = audioData.currentTime;
|
|
109
|
+
emit("forward", audioData.currentTime);
|
|
110
|
+
};
|
|
111
|
+
const handle = (val) => {
|
|
112
|
+
audioData.currentDuration = formatSeconds(val);
|
|
113
|
+
audioData.percent = val / audioData.second * 100;
|
|
114
|
+
};
|
|
115
|
+
const audioEnd = () => {
|
|
116
|
+
audioData.playing = false;
|
|
117
|
+
emit("ended");
|
|
118
|
+
};
|
|
119
|
+
const progressChange = (val) => {
|
|
120
|
+
const ar = audioRef.value;
|
|
121
|
+
ar.currentTime = audioData.second * val / 100;
|
|
122
|
+
emit("changeProgress", ar.currentTime);
|
|
123
|
+
};
|
|
124
|
+
const handleMute = () => {
|
|
125
|
+
audioData.hanMuted = !audioData.hanMuted;
|
|
126
|
+
emit("mute", audioData.hanMuted);
|
|
127
|
+
};
|
|
128
|
+
const formatSeconds = (value) => {
|
|
129
|
+
let theTime = parseInt(value);
|
|
130
|
+
let theTime1 = 0;
|
|
131
|
+
let theTime2 = 0;
|
|
132
|
+
if (theTime > 60) {
|
|
133
|
+
theTime1 = Math.floor(theTime / 60);
|
|
134
|
+
theTime = Math.floor(theTime % 60);
|
|
135
|
+
if (theTime1 > 60) {
|
|
136
|
+
theTime2 = Math.floor(theTime1 / 60);
|
|
137
|
+
theTime1 = Math.floor(theTime1 % 60);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
let result = "";
|
|
141
|
+
if (theTime < 10) {
|
|
142
|
+
result = "0" + result;
|
|
143
|
+
}
|
|
144
|
+
if (theTime1 > 0) {
|
|
145
|
+
result = "" + theTime1 + ":" + result;
|
|
146
|
+
if (theTime1 < 10) {
|
|
147
|
+
result = "0" + result;
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
result = "00:" + result;
|
|
151
|
+
}
|
|
152
|
+
if (theTime2 > 0) {
|
|
153
|
+
result = "" + theTime2 + ":" + result;
|
|
154
|
+
if (theTime2 < 10) {
|
|
155
|
+
result = "0" + result;
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
result = "00:" + result;
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
};
|
|
162
|
+
watch(() => audioData.currentTime, (value) => {
|
|
163
|
+
handle(value);
|
|
164
|
+
});
|
|
165
|
+
provide("audioParent", {
|
|
166
|
+
children: [],
|
|
167
|
+
props,
|
|
168
|
+
audioData,
|
|
169
|
+
handleMute,
|
|
170
|
+
forward,
|
|
171
|
+
fastBack,
|
|
172
|
+
changeStatus
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
...toRefs(props),
|
|
176
|
+
...toRefs(audioData),
|
|
177
|
+
audioRef,
|
|
178
|
+
fastBack,
|
|
179
|
+
forward,
|
|
180
|
+
changeStatus,
|
|
181
|
+
progressChange,
|
|
182
|
+
audioEnd,
|
|
183
|
+
onTimeupdate,
|
|
184
|
+
handleMute
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const _hoisted_1 = { class: "nut-audio" };
|
|
189
|
+
const _hoisted_2 = {
|
|
190
|
+
key: 0,
|
|
191
|
+
class: "progress-wrapper"
|
|
192
|
+
};
|
|
193
|
+
const _hoisted_3 = { class: "time" };
|
|
194
|
+
const _hoisted_4 = { class: "progress-bar-wrapper" };
|
|
195
|
+
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "custom-button" }, null, -1);
|
|
196
|
+
const _hoisted_6 = { class: "time" };
|
|
197
|
+
const _hoisted_7 = {
|
|
198
|
+
key: 1,
|
|
199
|
+
class: "nut-audio-icon"
|
|
200
|
+
};
|
|
201
|
+
const _hoisted_8 = ["controls", "src", "preload", "autoplay", "loop", "muted"];
|
|
202
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
203
|
+
const _component_nut_range = resolveComponent("nut-range");
|
|
204
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
205
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
206
|
+
_ctx.type == "progress" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
207
|
+
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.currentDuration), 1),
|
|
208
|
+
createElementVNode("div", _hoisted_4, [
|
|
209
|
+
createVNode(_component_nut_range, {
|
|
210
|
+
modelValue: _ctx.percent,
|
|
211
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.percent = $event),
|
|
212
|
+
"hidden-range": "",
|
|
213
|
+
onChange: _ctx.progressChange,
|
|
214
|
+
"inactive-color": "#cccccc",
|
|
215
|
+
"active-color": "#fa2c19"
|
|
216
|
+
}, {
|
|
217
|
+
button: withCtx(() => [
|
|
218
|
+
_hoisted_5
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["modelValue", "onChange"])
|
|
222
|
+
]),
|
|
223
|
+
createElementVNode("div", _hoisted_6, toDisplayString(_ctx.duration), 1)
|
|
224
|
+
])) : createCommentVNode("", true),
|
|
225
|
+
_ctx.type == "icon" ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
226
|
+
createElementVNode("div", {
|
|
227
|
+
class: normalizeClass(["nut-audio-icon-box", _ctx.playing ? "nut-audio-icon-play" : "nut-audio-icon-stop"]),
|
|
228
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
229
|
+
}, [
|
|
230
|
+
_ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
|
|
231
|
+
key: 0,
|
|
232
|
+
name: "service",
|
|
233
|
+
class: "nut-icon-am-rotate nut-icon-am-infinite"
|
|
234
|
+
})) : createCommentVNode("", true),
|
|
235
|
+
!_ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
|
|
236
|
+
key: 1,
|
|
237
|
+
name: "service"
|
|
238
|
+
})) : createCommentVNode("", true)
|
|
239
|
+
], 2)
|
|
240
|
+
])) : createCommentVNode("", true),
|
|
241
|
+
_ctx.type == "none" ? (openBlock(), createElementBlock("div", {
|
|
242
|
+
key: 2,
|
|
243
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
244
|
+
}, [
|
|
245
|
+
renderSlot(_ctx.$slots, "default")
|
|
246
|
+
])) : createCommentVNode("", true),
|
|
247
|
+
_ctx.type != "none" ? renderSlot(_ctx.$slots, "default", { key: 3 }) : createCommentVNode("", true),
|
|
248
|
+
createElementVNode("audio", {
|
|
249
|
+
class: "audioMain",
|
|
250
|
+
controls: _ctx.type == "controls",
|
|
251
|
+
ref: "audioRef",
|
|
252
|
+
src: _ctx.url,
|
|
253
|
+
preload: _ctx.preload,
|
|
254
|
+
autoplay: _ctx.autoplay,
|
|
255
|
+
loop: _ctx.loop,
|
|
256
|
+
onTimeupdate: _cache[3] || (_cache[3] = (...args) => _ctx.onTimeupdate && _ctx.onTimeupdate(...args)),
|
|
257
|
+
onEnded: _cache[4] || (_cache[4] = (...args) => _ctx.audioEnd && _ctx.audioEnd(...args)),
|
|
258
|
+
muted: _ctx.hanMuted
|
|
259
|
+
}, null, 40, _hoisted_8)
|
|
260
|
+
]);
|
|
261
|
+
}
|
|
262
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
263
|
+
export { index as default };
|
|
@@ -1,18 +1,105 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { inject
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { inject, reactive, ref, useSlots, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
10
|
+
const { componentName, create, translate } = createComponent("audio-operate");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
default() {
|
|
16
|
+
return "play";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
components: {},
|
|
21
|
+
emits: ["click"],
|
|
22
|
+
setup(props, { emit }) {
|
|
23
|
+
const audio = inject("audioParent");
|
|
24
|
+
const parent = reactive(audio);
|
|
25
|
+
const customSlot = ref(useSlots().default);
|
|
26
|
+
return { ...toRefs(props), ...toRefs(parent), customSlot, translate };
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const _hoisted_1 = { class: "nut-audio-operate" };
|
|
30
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u5FEB\u8FDB");
|
|
31
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
32
|
+
const _component_nut_button = resolveComponent("nut-button");
|
|
33
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
34
|
+
_ctx.type == "back" ? (openBlock(), createElementBlock("div", {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "nut-audio-operate-item",
|
|
37
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.fastBack && _ctx.fastBack(...args))
|
|
38
|
+
}, [
|
|
39
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
40
|
+
key: 0,
|
|
41
|
+
type: "primary",
|
|
42
|
+
size: "small"
|
|
43
|
+
}, {
|
|
44
|
+
default: withCtx(() => [
|
|
45
|
+
createTextVNode(toDisplayString(_ctx.translate("back")), 1)
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
})) : createCommentVNode("", true),
|
|
49
|
+
renderSlot(_ctx.$slots, "default")
|
|
50
|
+
])) : createCommentVNode("", true),
|
|
51
|
+
_ctx.type == "play" ? (openBlock(), createElementBlock("div", {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "nut-audio-operate-item",
|
|
54
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
|
|
55
|
+
}, [
|
|
56
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
57
|
+
key: 0,
|
|
58
|
+
type: "primary",
|
|
59
|
+
size: "small"
|
|
60
|
+
}, {
|
|
61
|
+
default: withCtx(() => [
|
|
62
|
+
createTextVNode(toDisplayString(!_ctx.audioData.playing ? `${_ctx.translate("start")}` : `${_ctx.translate("pause")}`), 1)
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
})) : createCommentVNode("", true),
|
|
66
|
+
renderSlot(_ctx.$slots, "default")
|
|
67
|
+
])) : createCommentVNode("", true),
|
|
68
|
+
_ctx.type == "forward" ? (openBlock(), createElementBlock("div", {
|
|
69
|
+
key: 2,
|
|
70
|
+
class: "nut-audio-operate-item",
|
|
71
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.forward && _ctx.forward(...args))
|
|
72
|
+
}, [
|
|
73
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
74
|
+
key: 0,
|
|
75
|
+
type: "primary",
|
|
76
|
+
size: "small"
|
|
77
|
+
}, {
|
|
78
|
+
default: withCtx(() => [
|
|
79
|
+
_hoisted_2
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
})) : createCommentVNode("", true),
|
|
83
|
+
renderSlot(_ctx.$slots, "default")
|
|
84
|
+
])) : createCommentVNode("", true),
|
|
85
|
+
_ctx.type == "mute" ? (openBlock(), createElementBlock("div", {
|
|
86
|
+
key: 3,
|
|
87
|
+
class: "nut-audio-operate-item",
|
|
88
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleMute && _ctx.handleMute(...args))
|
|
89
|
+
}, [
|
|
90
|
+
!_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
|
|
91
|
+
key: 0,
|
|
92
|
+
type: !_ctx.audioData.hanMuted ? "primary" : "default",
|
|
93
|
+
size: "small"
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => [
|
|
96
|
+
createTextVNode(toDisplayString(_ctx.translate("mute")), 1)
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}, 8, ["type"])) : createCommentVNode("", true),
|
|
100
|
+
renderSlot(_ctx.$slots, "default")
|
|
101
|
+
])) : createCommentVNode("", true)
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
104
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
105
|
+
export { index as default };
|