@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3

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.
Files changed (176) hide show
  1. package/dist/nutui.es.js +4019 -19251
  2. package/dist/nutui.umd.js +4012 -19344
  3. package/dist/packages/_es/ActionSheet.js +26 -157
  4. package/dist/packages/_es/Address.js +119 -542
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Audio.js +62 -264
  7. package/dist/packages/_es/AudioOperate.js +18 -107
  8. package/dist/packages/_es/Avatar.js +42 -165
  9. package/dist/packages/_es/AvatarGroup.js +14 -73
  10. package/dist/packages/_es/BackTop.js +43 -156
  11. package/dist/packages/_es/Badge.js +14 -86
  12. package/dist/packages/_es/Barrage.js +41 -120
  13. package/dist/packages/_es/Button.js +23 -128
  14. package/dist/packages/_es/Calendar.js +24 -237
  15. package/dist/packages/_es/CalendarItem.js +1 -1
  16. package/dist/packages/_es/Card.js +10 -107
  17. package/dist/packages/_es/Cascader.js +156 -500
  18. package/dist/packages/_es/Category.js +15 -58
  19. package/dist/packages/_es/CategoryPane.js +11 -111
  20. package/dist/packages/_es/Cell.js +21 -100
  21. package/dist/packages/_es/CellGroup.js +9 -44
  22. package/dist/packages/_es/Checkbox.js +31 -113
  23. package/dist/packages/_es/CheckboxGroup.js +29 -58
  24. package/dist/packages/_es/CircleProgress.js +28 -151
  25. package/dist/packages/_es/Col.js +14 -56
  26. package/dist/packages/_es/Collapse.js +24 -85
  27. package/dist/packages/_es/CollapseItem.js +70 -261
  28. package/dist/packages/_es/Comment.js +64 -434
  29. package/dist/packages/_es/CountDown.js +61 -242
  30. package/dist/packages/_es/CountUp.js +149 -546
  31. package/dist/packages/_es/DatePicker.js +107 -322
  32. package/dist/packages/_es/Dialog.js +69 -261
  33. package/dist/packages/_es/Divider.js +18 -68
  34. package/dist/packages/_es/Drag.js +56 -197
  35. package/dist/packages/_es/Ecard.js +24 -159
  36. package/dist/packages/_es/Elevator.js +63 -198
  37. package/dist/packages/_es/Empty.js +12 -71
  38. package/dist/packages/_es/FixedNav.js +15 -122
  39. package/dist/packages/_es/Form.js +64 -151
  40. package/dist/packages/_es/FormItem.js +15 -110
  41. package/dist/packages/_es/Grid.js +5 -6
  42. package/dist/packages/_es/GridItem.js +33 -144
  43. package/dist/packages/_es/Icon.js +15 -40
  44. package/dist/packages/_es/ImagePreview.js +74 -298
  45. package/dist/packages/_es/Indicator.js +15 -62
  46. package/dist/packages/_es/InfiniteLoading.js +66 -258
  47. package/dist/packages/_es/Input.js +51 -413
  48. package/dist/packages/_es/InputNumber.js +41 -160
  49. package/dist/packages/_es/Layout.js +4 -5
  50. package/dist/packages/_es/List.js +23 -110
  51. package/dist/packages/_es/Menu.js +30 -118
  52. package/dist/packages/_es/MenuItem.js +34 -162
  53. package/dist/packages/_es/Navbar.js +30 -192
  54. package/dist/packages/_es/NoticeBar.js +83 -387
  55. package/dist/packages/_es/Notify.js +81 -236
  56. package/dist/packages/_es/NumberKeyboard.js +41 -272
  57. package/dist/packages/_es/OldPicker.js +140 -464
  58. package/dist/packages/_es/OverLay.js +32 -105
  59. package/dist/packages/_es/Pagination.js +39 -157
  60. package/dist/packages/_es/Picker.js +138 -459
  61. package/dist/packages/_es/Popover.js +327 -965
  62. package/dist/packages/_es/Popup.js +64 -303
  63. package/dist/packages/_es/Price.js +16 -118
  64. package/dist/packages/_es/Progress.js +14 -146
  65. package/dist/packages/_es/PullRefresh.js +92 -346
  66. package/dist/packages/_es/Radio.js +22 -90
  67. package/dist/packages/_es/RadioGroup.js +8 -37
  68. package/dist/packages/_es/Range.js +92 -417
  69. package/dist/packages/_es/Rate.js +16 -139
  70. package/dist/packages/_es/Row.js +22 -64
  71. package/dist/packages/_es/SearchBar.js +46 -247
  72. package/dist/packages/_es/ShortPassword.js +35 -225
  73. package/dist/packages/_es/SideNavBar.js +33 -89
  74. package/dist/packages/_es/SideNavBarItem.js +11 -46
  75. package/dist/packages/_es/Signature.js +46 -165
  76. package/dist/packages/_es/Skeleton.js +20 -136
  77. package/dist/packages/_es/Sku.js +93 -499
  78. package/dist/packages/_es/Step.js +25 -119
  79. package/dist/packages/_es/Steps.js +18 -53
  80. package/dist/packages/_es/Sticky.js +53 -138
  81. package/dist/packages/_es/SubSideNavBar.js +26 -90
  82. package/dist/packages/_es/Swipe.js +46 -183
  83. package/dist/packages/_es/Swiper.js +121 -433
  84. package/dist/packages/_es/SwiperItem.js +22 -53
  85. package/dist/packages/_es/Switch.js +21 -116
  86. package/dist/packages/_es/TabPane.js +12 -39
  87. package/dist/packages/_es/Tabbar.js +17 -72
  88. package/dist/packages/_es/TabbarItem.js +29 -151
  89. package/dist/packages/_es/Table.js +27 -186
  90. package/dist/packages/_es/Tabs.js +51 -209
  91. package/dist/packages/_es/Tag.js +20 -97
  92. package/dist/packages/_es/TextArea.js +42 -160
  93. package/dist/packages/_es/TimeDetail.js +23 -84
  94. package/dist/packages/_es/TimePannel.js +19 -52
  95. package/dist/packages/_es/TimeSelect.js +15 -103
  96. package/dist/packages/_es/Toast.js +80 -319
  97. package/dist/packages/_es/Uploader.js +112 -460
  98. package/dist/packages/_es/Video.js +83 -340
  99. package/dist/packages/_es/common.js +38 -128
  100. package/dist/packages/_es/component.js +35 -76
  101. package/dist/packages/_es/index.js +5 -6
  102. package/dist/packages/_es/index2.js +9 -30
  103. package/dist/packages/_es/index3.js +6 -8
  104. package/dist/packages/_es/index4.js +13 -58
  105. package/dist/packages/_es/index5.js +120 -675
  106. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  107. package/dist/packages/_es/pxCheck.js +3 -5
  108. package/dist/packages/_es/raf.js +8 -15
  109. package/dist/packages/button/index.scss +2 -1
  110. package/dist/packages/cell/index.scss +11 -0
  111. package/dist/packages/checkbox/index.scss +6 -0
  112. package/dist/packages/dialog/index.scss +1 -0
  113. package/dist/packages/elevator/index.scss +21 -0
  114. package/dist/packages/input/index.scss +13 -1
  115. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  118. package/dist/packages/locale/lang/en-US.js +5 -97
  119. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  120. package/dist/packages/locale/lang/id-ID.js +5 -97
  121. package/dist/packages/locale/lang/index.js +16 -38
  122. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  123. package/dist/packages/locale/lang/zh-CN.js +5 -97
  124. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  125. package/dist/packages/locale/lang/zh-TW.js +5 -97
  126. package/dist/packages/radio/index.scss +1 -0
  127. package/dist/packages/switch/index.scss +3 -3
  128. package/dist/packages/tabpane/index.scss +1 -0
  129. package/dist/smartips/attributes.json +62 -10
  130. package/dist/smartips/tags.json +17 -4
  131. package/dist/style.css +1 -1
  132. package/dist/styles/themes/default.scss +49 -49
  133. package/dist/styles/themes/jdb.scss +49 -49
  134. package/dist/styles/themes/jdt.scss +49 -49
  135. package/dist/styles/variables-jdb.scss +10 -1
  136. package/dist/styles/variables-jdt.scss +10 -1
  137. package/dist/styles/variables.scss +10 -1
  138. package/dist/types/__VUE/address/index.vue.d.ts +5 -5
  139. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  140. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  141. package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
  142. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
  147. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  148. package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
  149. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  150. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  151. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  152. package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
  153. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  155. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  156. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  157. package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
  158. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  159. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
  162. package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  165. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/row/index.vue.d.ts +2 -2
  167. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  168. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  169. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  170. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  171. package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
  172. package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
  173. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  175. package/dist/types/index.d.ts +1 -1
  176. package/package.json +2 -1
@@ -5,276 +5,74 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
8
+ var __spreadValues = (a2, b2) => {
9
+ for (var prop in b2 || (b2 = {}))
10
+ if (__hasOwnProp.call(b2, prop))
11
+ __defNormalProp(a2, prop, b2[prop]);
12
12
  if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
13
+ for (var prop of __getOwnPropSymbols(b2)) {
14
+ if (__propIsEnum.call(b2, prop))
15
+ __defNormalProp(a2, prop, b2[prop]);
16
16
  }
17
- return a;
17
+ return a2;
18
18
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
19
+ var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
20
  /*!
21
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { ref, reactive, onMounted, watch, provide, toRefs, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createCommentVNode, normalizeClass, createBlock, renderSlot } from "vue";
26
- import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
+ import { ref as e, reactive as a, onMounted as t, watch as n, provide as o, toRefs as r, resolveComponent as u, openBlock as i, createElementBlock as l, createElementVNode as c, toDisplayString as d, createVNode as s, withCtx as p, createCommentVNode as m, normalizeClass as y, createBlock as g, renderSlot as h } from "vue";
26
+ import { c as f } from "./component.js";
27
+ import { _ as v } from "./plugin-vue_export-helper.js";
28
28
  import "../locale/lang";
29
- const { componentName, create } = createComponent("audio");
30
- const _sfc_main = create({
31
- props: {
32
- url: {
33
- type: String,
34
- default: ""
35
- },
36
- muted: {
37
- type: Boolean,
38
- default: false
39
- },
40
- autoplay: {
41
- type: Boolean,
42
- default: false
43
- },
44
- loop: {
45
- type: Boolean,
46
- default: false
47
- },
48
- preload: {
49
- type: String,
50
- default: "auto"
51
- },
52
- second: {
53
- type: Number,
54
- default: 0
55
- },
56
- type: {
57
- type: String,
58
- default: "progress"
29
+ const { componentName: T, create: k } = f("audio"), M = k({ props: { url: { type: String, default: "" }, muted: { type: Boolean, default: false }, autoplay: { type: Boolean, default: false }, loop: { type: Boolean, default: false }, preload: { type: String, default: "auto" }, second: { type: Number, default: 0 }, type: { type: String, default: "progress" } }, components: {}, emits: ["fastBack", "play", "forward", "ended", "changeProgress", "mute"], setup(u2, { emit: i2 }) {
30
+ const l2 = e(null), c2 = a({ currentTime: 0, currentDuration: "00:00:00", percent: 0, duration: "00:00:00", second: 0, hanMuted: u2.muted, playing: u2.autoplay, handPlaying: false });
31
+ t(() => {
32
+ var e2 = ["webkitVisibilityState", "visibilitychange"];
33
+ try {
34
+ for (let a2 = 0; a2 < e2.length; a2++)
35
+ document.addEventListener(e2[a2], () => {
36
+ document.hidden ? l2.value.pause() : c2.playing && setTimeout(() => {
37
+ l2.value.play();
38
+ }, 200);
39
+ });
40
+ } catch (e3) {
59
41
  }
60
- },
61
- components: {},
62
- emits: ["fastBack", "play", "forward", "ended", "changeProgress", "mute"],
63
- setup(props, { emit }) {
64
- const audioRef = ref(null);
65
- const audioData = reactive({
66
- currentTime: 0,
67
- currentDuration: "00:00:00",
68
- percent: 0,
69
- duration: "00:00:00",
70
- second: 0,
71
- hanMuted: props.muted,
72
- playing: props.autoplay,
73
- handPlaying: false
74
- });
75
- onMounted(() => {
76
- var arr = ["webkitVisibilityState", "visibilitychange"];
77
- try {
78
- for (let i = 0; i < arr.length; i++) {
79
- document.addEventListener(arr[i], () => {
80
- if (document.hidden) {
81
- audioRef.value.pause();
82
- } else {
83
- if (audioData.playing) {
84
- setTimeout(() => {
85
- audioRef.value.play();
86
- }, 200);
87
- }
88
- }
89
- });
90
- }
91
- } catch (e) {
92
- console.log(e.message);
93
- }
94
- setTimeout(() => {
95
- const audioR = audioRef.value;
96
- if (props.autoplay) {
97
- if (audioR && audioR.paused) {
98
- audioR.play();
99
- }
100
- }
101
- audioData.second = audioR.duration;
102
- audioData.duration = formatSeconds(audioR.duration);
103
- }, 500);
104
- });
105
- const onTimeupdate = (e) => {
106
- audioData.currentTime = parseInt(e.target.currentTime);
107
- };
108
- const fastBack = () => {
109
- audioData.currentTime--;
110
- audioRef.value.currentTime = audioData.currentTime;
111
- emit("fastBack", audioData.currentTime);
112
- };
113
- const changeStatus = () => {
114
- const audioR = audioRef.value;
115
- if (audioData.playing) {
116
- audioR.pause();
117
- audioData.handPlaying = false;
118
- } else {
119
- audioR.play();
120
- audioData.handPlaying = true;
121
- }
122
- audioData.playing = !audioData.playing;
123
- emit("play", audioData.playing);
124
- };
125
- const forward = () => {
126
- audioData.currentTime++;
127
- audioRef.value.currentTime = audioData.currentTime;
128
- emit("forward", audioData.currentTime);
129
- };
130
- const handle = (val) => {
131
- audioData.currentDuration = formatSeconds(val);
132
- audioData.percent = val / audioData.second * 100;
133
- };
134
- const audioEnd = () => {
135
- audioData.playing = false;
136
- emit("ended");
137
- };
138
- const progressChange = (val) => {
139
- const ar = audioRef.value;
140
- ar.currentTime = audioData.second * val / 100;
141
- emit("changeProgress", ar.currentTime);
142
- };
143
- const handleMute = () => {
144
- audioData.hanMuted = !audioData.hanMuted;
145
- emit("mute", audioData.hanMuted);
146
- };
147
- const formatSeconds = (value) => {
148
- let theTime = parseInt(value);
149
- let theTime1 = 0;
150
- let theTime2 = 0;
151
- if (theTime > 60) {
152
- theTime1 = Math.floor(theTime / 60);
153
- theTime = Math.floor(theTime % 60);
154
- if (theTime1 > 60) {
155
- theTime2 = Math.floor(theTime1 / 60);
156
- theTime1 = Math.floor(theTime1 % 60);
157
- }
158
- }
159
- let result = "";
160
- if (theTime < 10) {
161
- result = "0" + result;
162
- }
163
- if (theTime1 > 0) {
164
- result = "" + theTime1 + ":" + result;
165
- if (theTime1 < 10) {
166
- result = "0" + result;
167
- }
168
- } else {
169
- result = "00:" + result;
170
- }
171
- if (theTime2 > 0) {
172
- result = "" + theTime2 + ":" + result;
173
- if (theTime2 < 10) {
174
- result = "0" + result;
175
- }
176
- } else {
177
- result = "00:" + result;
178
- }
179
- return result;
180
- };
181
- watch(() => audioData.currentTime, (value) => {
182
- handle(value);
183
- });
184
- provide("audioParent", {
185
- children: [],
186
- props,
187
- audioData,
188
- handleMute,
189
- forward,
190
- fastBack,
191
- changeStatus
192
- });
193
- return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(audioData)), {
194
- audioRef,
195
- fastBack,
196
- forward,
197
- changeStatus,
198
- progressChange,
199
- audioEnd,
200
- onTimeupdate,
201
- handleMute
202
- });
203
- }
204
- });
205
- const _hoisted_1 = { class: "nut-audio" };
206
- const _hoisted_2 = {
207
- key: 0,
208
- class: "progress-wrapper"
209
- };
210
- const _hoisted_3 = { class: "time" };
211
- const _hoisted_4 = { class: "progress-bar-wrapper" };
212
- const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "custom-button" }, null, -1);
213
- const _hoisted_6 = { class: "time" };
214
- const _hoisted_7 = {
215
- key: 1,
216
- class: "nut-audio-icon"
217
- };
218
- const _hoisted_8 = ["controls", "src", "preload", "autoplay", "loop", "muted"];
219
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
220
- const _component_nut_range = resolveComponent("nut-range");
221
- const _component_nut_icon = resolveComponent("nut-icon");
222
- return openBlock(), createElementBlock("div", _hoisted_1, [
223
- _ctx.type == "progress" ? (openBlock(), createElementBlock("div", _hoisted_2, [
224
- createElementVNode("div", _hoisted_3, toDisplayString(_ctx.currentDuration), 1),
225
- createElementVNode("div", _hoisted_4, [
226
- createVNode(_component_nut_range, {
227
- modelValue: _ctx.percent,
228
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.percent = $event),
229
- "hidden-range": "",
230
- onChange: _ctx.progressChange,
231
- "inactive-color": "#cccccc",
232
- "active-color": "#fa2c19"
233
- }, {
234
- button: withCtx(() => [
235
- _hoisted_5
236
- ]),
237
- _: 1
238
- }, 8, ["modelValue", "onChange"])
239
- ]),
240
- createElementVNode("div", _hoisted_6, toDisplayString(_ctx.duration), 1)
241
- ])) : createCommentVNode("", true),
242
- _ctx.type == "icon" ? (openBlock(), createElementBlock("div", _hoisted_7, [
243
- createElementVNode("div", {
244
- class: normalizeClass(["nut-audio-icon-box", _ctx.playing ? "nut-audio-icon-play" : "nut-audio-icon-stop"]),
245
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
246
- }, [
247
- _ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
248
- key: 0,
249
- name: "service",
250
- class: "nut-icon-am-rotate nut-icon-am-infinite"
251
- })) : createCommentVNode("", true),
252
- !_ctx.playing ? (openBlock(), createBlock(_component_nut_icon, {
253
- key: 1,
254
- name: "service"
255
- })) : createCommentVNode("", true)
256
- ], 2)
257
- ])) : createCommentVNode("", true),
258
- _ctx.type == "none" ? (openBlock(), createElementBlock("div", {
259
- key: 2,
260
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
261
- }, [
262
- renderSlot(_ctx.$slots, "default")
263
- ])) : createCommentVNode("", true),
264
- _ctx.type != "none" ? renderSlot(_ctx.$slots, "default", { key: 3 }) : createCommentVNode("", true),
265
- createElementVNode("audio", {
266
- class: "audioMain",
267
- controls: _ctx.type == "controls",
268
- ref: "audioRef",
269
- src: _ctx.url,
270
- preload: _ctx.preload,
271
- autoplay: _ctx.autoplay,
272
- loop: _ctx.loop,
273
- onTimeupdate: _cache[3] || (_cache[3] = (...args) => _ctx.onTimeupdate && _ctx.onTimeupdate(...args)),
274
- onEnded: _cache[4] || (_cache[4] = (...args) => _ctx.audioEnd && _ctx.audioEnd(...args)),
275
- muted: _ctx.hanMuted
276
- }, null, 40, _hoisted_8)
277
- ]);
278
- }
279
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
280
- export { index as default };
42
+ setTimeout(() => {
43
+ const e3 = l2.value;
44
+ u2.autoplay && e3 && e3.paused && e3.play(), c2.second = e3.duration, c2.duration = y2(e3.duration);
45
+ }, 500);
46
+ });
47
+ const d2 = () => {
48
+ c2.currentTime--, l2.value.currentTime = c2.currentTime, i2("fastBack", c2.currentTime);
49
+ }, s2 = () => {
50
+ const e2 = l2.value;
51
+ c2.playing ? (e2.pause(), c2.handPlaying = false) : (e2.play(), c2.handPlaying = true), c2.playing = !c2.playing, i2("play", c2.playing);
52
+ }, p2 = () => {
53
+ c2.currentTime++, l2.value.currentTime = c2.currentTime, i2("forward", c2.currentTime);
54
+ }, m2 = () => {
55
+ c2.hanMuted = !c2.hanMuted, i2("mute", c2.hanMuted);
56
+ }, y2 = (e2) => {
57
+ let a2 = parseInt(e2), t2 = 0, n2 = 0;
58
+ a2 > 60 && (t2 = Math.floor(a2 / 60), a2 = Math.floor(a2 % 60), t2 > 60 && (n2 = Math.floor(t2 / 60), t2 = Math.floor(t2 % 60)));
59
+ let o2 = "";
60
+ return a2 < 10 && (o2 = "0" + o2), t2 > 0 ? (o2 = t2 + ":" + o2, t2 < 10 && (o2 = "0" + o2)) : o2 = "00:" + o2, n2 > 0 ? (o2 = n2 + ":" + o2, n2 < 10 && (o2 = "0" + o2)) : o2 = "00:" + o2, o2;
61
+ };
62
+ return n(() => c2.currentTime, (e2) => {
63
+ var a2;
64
+ a2 = e2, c2.currentDuration = y2(a2), c2.percent = a2 / c2.second * 100;
65
+ }), o("audioParent", { children: [], props: u2, audioData: c2, handleMute: m2, forward: p2, fastBack: d2, changeStatus: s2 }), __spreadProps(__spreadValues(__spreadValues({}, r(u2)), r(c2)), { audioRef: l2, fastBack: d2, forward: p2, changeStatus: s2, progressChange: (e2) => {
66
+ const a2 = l2.value;
67
+ a2.currentTime = c2.second * e2 / 100, i2("changeProgress", a2.currentTime);
68
+ }, audioEnd: () => {
69
+ c2.playing = false, i2("ended");
70
+ }, onTimeupdate: (e2) => {
71
+ c2.currentTime = parseInt(e2.target.currentTime);
72
+ }, handleMute: m2 });
73
+ } }), S = { class: "nut-audio" }, b = { key: 0, class: "progress-wrapper" }, w = { class: "time" }, B = { class: "progress-bar-wrapper" }, C = c("div", { class: "custom-button" }, null, -1), P = { class: "time" }, E = { key: 1, class: "nut-audio-icon" }, D = ["controls", "src", "preload", "autoplay", "loop", "muted"];
74
+ var V = v(M, [["render", function(e2, a2, t2, n2, o2, r2) {
75
+ const f2 = u("nut-range"), v2 = u("nut-icon");
76
+ return i(), l("div", S, [e2.type == "progress" ? (i(), l("div", b, [c("div", w, d(e2.currentDuration), 1), c("div", B, [s(f2, { modelValue: e2.percent, "onUpdate:modelValue": a2[0] || (a2[0] = (a3) => e2.percent = a3), "hidden-range": "", onChange: e2.progressChange, "inactive-color": "#cccccc", "active-color": "#fa2c19" }, { button: p(() => [C]), _: 1 }, 8, ["modelValue", "onChange"])]), c("div", P, d(e2.duration), 1)])) : m("", true), e2.type == "icon" ? (i(), l("div", E, [c("div", { class: y(["nut-audio-icon-box", e2.playing ? "nut-audio-icon-play" : "nut-audio-icon-stop"]), onClick: a2[1] || (a2[1] = (...a3) => e2.changeStatus && e2.changeStatus(...a3)) }, [e2.playing ? (i(), g(v2, { key: 0, name: "service", class: "nut-icon-am-rotate nut-icon-am-infinite" })) : m("", true), e2.playing ? m("", true) : (i(), g(v2, { key: 1, name: "service" }))], 2)])) : m("", true), e2.type == "none" ? (i(), l("div", { key: 2, onClick: a2[2] || (a2[2] = (...a3) => e2.changeStatus && e2.changeStatus(...a3)) }, [h(e2.$slots, "default")])) : m("", true), e2.type != "none" ? h(e2.$slots, "default", { key: 3 }) : m("", true), c("audio", { class: "audioMain", controls: e2.type == "controls", ref: "audioRef", src: e2.url, preload: e2.preload, autoplay: e2.autoplay, loop: e2.loop, onTimeupdate: a2[3] || (a2[3] = (...a3) => e2.onTimeupdate && e2.onTimeupdate(...a3)), onEnded: a2[4] || (a2[4] = (...a3) => e2.audioEnd && e2.audioEnd(...a3)), muted: e2.hanMuted }, null, 40, D)]);
77
+ }]]);
78
+ export { V as default };
@@ -5,122 +5,33 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
8
+ var __spreadValues = (a2, b) => {
9
9
  for (var prop in b || (b = {}))
10
10
  if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
11
+ __defNormalProp(a2, prop, b[prop]);
12
12
  if (__getOwnPropSymbols)
13
13
  for (var prop of __getOwnPropSymbols(b)) {
14
14
  if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
15
+ __defNormalProp(a2, prop, b[prop]);
16
16
  }
17
- return a;
17
+ return a2;
18
18
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
19
+ var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.22-beta.0 Tue May 31 2022 21:47:10 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { inject, reactive, ref, useSlots, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
26
- import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
+ import { inject as t, reactive as e, ref as a, useSlots as o, toRefs as l, resolveComponent as s, openBlock as r, createElementBlock as u, createBlock as i, withCtx as n, createTextVNode as p, toDisplayString as d, createCommentVNode as c, renderSlot as m } from "vue";
26
+ import { c as y } from "./component.js";
27
+ import { _ as f } from "./plugin-vue_export-helper.js";
28
28
  import "../locale/lang";
29
- const { componentName, create } = createComponent("audio-operate");
30
- const _sfc_main = create({
31
- props: {
32
- type: {
33
- type: String,
34
- default() {
35
- return "play";
36
- }
37
- }
38
- },
39
- components: {},
40
- emits: ["click"],
41
- setup(props, { emit }) {
42
- const audio = inject("audioParent");
43
- const parent = reactive(audio);
44
- const customSlot = ref(useSlots().default);
45
- return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(parent)), { customSlot });
46
- }
47
- });
48
- const _hoisted_1 = { class: "nut-audio-operate" };
49
- const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u5012\u9000");
50
- const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u5FEB\u8FDB");
51
- const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u9759\u97F3");
52
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
53
- const _component_nut_button = resolveComponent("nut-button");
54
- return openBlock(), createElementBlock("div", _hoisted_1, [
55
- _ctx.type == "back" ? (openBlock(), createElementBlock("div", {
56
- key: 0,
57
- class: "nut-audio-operate-item",
58
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.fastBack && _ctx.fastBack(...args))
59
- }, [
60
- !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
61
- key: 0,
62
- type: "primary",
63
- size: "small"
64
- }, {
65
- default: withCtx(() => [
66
- _hoisted_2
67
- ]),
68
- _: 1
69
- })) : createCommentVNode("", true),
70
- renderSlot(_ctx.$slots, "default")
71
- ])) : createCommentVNode("", true),
72
- _ctx.type == "play" ? (openBlock(), createElementBlock("div", {
73
- key: 1,
74
- class: "nut-audio-operate-item",
75
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.changeStatus && _ctx.changeStatus(...args))
76
- }, [
77
- !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
78
- key: 0,
79
- type: "primary",
80
- size: "small"
81
- }, {
82
- default: withCtx(() => [
83
- createTextVNode(toDisplayString(!_ctx.audioData.playing ? "\u5F00\u59CB" : "\u6682\u505C"), 1)
84
- ]),
85
- _: 1
86
- })) : createCommentVNode("", true),
87
- renderSlot(_ctx.$slots, "default")
88
- ])) : createCommentVNode("", true),
89
- _ctx.type == "forward" ? (openBlock(), createElementBlock("div", {
90
- key: 2,
91
- class: "nut-audio-operate-item",
92
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.forward && _ctx.forward(...args))
93
- }, [
94
- !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
95
- key: 0,
96
- type: "primary",
97
- size: "small"
98
- }, {
99
- default: withCtx(() => [
100
- _hoisted_3
101
- ]),
102
- _: 1
103
- })) : createCommentVNode("", true),
104
- renderSlot(_ctx.$slots, "default")
105
- ])) : createCommentVNode("", true),
106
- _ctx.type == "mute" ? (openBlock(), createElementBlock("div", {
107
- key: 3,
108
- class: "nut-audio-operate-item",
109
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleMute && _ctx.handleMute(...args))
110
- }, [
111
- !_ctx.customSlot ? (openBlock(), createBlock(_component_nut_button, {
112
- key: 0,
113
- type: !_ctx.audioData.hanMuted ? "primary" : "default",
114
- size: "small"
115
- }, {
116
- default: withCtx(() => [
117
- _hoisted_4
118
- ]),
119
- _: 1
120
- }, 8, ["type"])) : createCommentVNode("", true),
121
- renderSlot(_ctx.$slots, "default")
122
- ])) : createCommentVNode("", true)
123
- ]);
124
- }
125
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
126
- export { index as default };
29
+ const { componentName: k, create: v, translate: S } = y("audio-operate"), g = v({ props: { type: { type: String, default: () => "play" } }, components: {}, emits: ["click"], setup(s2, { emit: r2 }) {
30
+ const u2 = t("audioParent"), i2 = e(u2), n2 = a(o().default);
31
+ return __spreadProps(__spreadValues(__spreadValues({}, l(s2)), l(i2)), { customSlot: n2, translate: S });
32
+ } }), h = { class: "nut-audio-operate" }, $ = p("\u5FEB\u8FDB");
33
+ var _ = f(g, [["render", function(t2, e2, a2, o2, l2, y2) {
34
+ const f2 = s("nut-button");
35
+ return r(), u("div", h, [t2.type == "back" ? (r(), u("div", { key: 0, class: "nut-audio-operate-item", onClick: e2[0] || (e2[0] = (...e3) => t2.fastBack && t2.fastBack(...e3)) }, [t2.customSlot ? c("", true) : (r(), i(f2, { key: 0, type: "primary", size: "small" }, { default: n(() => [p(d(t2.translate("back")), 1)]), _: 1 })), m(t2.$slots, "default")])) : c("", true), t2.type == "play" ? (r(), u("div", { key: 1, class: "nut-audio-operate-item", onClick: e2[1] || (e2[1] = (...e3) => t2.changeStatus && t2.changeStatus(...e3)) }, [t2.customSlot ? c("", true) : (r(), i(f2, { key: 0, type: "primary", size: "small" }, { default: n(() => [p(d(t2.audioData.playing ? `${t2.translate("pause")}` : `${t2.translate("start")}`), 1)]), _: 1 })), m(t2.$slots, "default")])) : c("", true), t2.type == "forward" ? (r(), u("div", { key: 2, class: "nut-audio-operate-item", onClick: e2[2] || (e2[2] = (...e3) => t2.forward && t2.forward(...e3)) }, [t2.customSlot ? c("", true) : (r(), i(f2, { key: 0, type: "primary", size: "small" }, { default: n(() => [$]), _: 1 })), m(t2.$slots, "default")])) : c("", true), t2.type == "mute" ? (r(), u("div", { key: 3, class: "nut-audio-operate-item", onClick: e2[3] || (e2[3] = (...e3) => t2.handleMute && t2.handleMute(...e3)) }, [t2.customSlot ? c("", true) : (r(), i(f2, { key: 0, type: t2.audioData.hanMuted ? "default" : "primary", size: "small" }, { default: n(() => [p(d(t2.translate("mute")), 1)]), _: 1 }, 8, ["type"])), m(t2.$slots, "default")])) : c("", true)]);
36
+ }]]);
37
+ export { _ as default };