@nutui/nutui 4.0.10-beta.1 → 4.0.11

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