@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,44 +1,27 @@
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 { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } 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 I = Object.defineProperty, G = Object.defineProperties;
2
+ var J = Object.getOwnPropertyDescriptors;
3
+ var k = Object.getOwnPropertySymbols;
4
+ var K = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable;
5
+ var B = (o, t, e) => t in o ? I(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, c = (o, t) => {
6
+ for (var e in t || (t = {}))
7
+ K.call(t, e) && B(o, e, t[e]);
8
+ if (k)
9
+ for (var e of k(t))
10
+ Q.call(t, e) && B(o, e, t[e]);
11
+ return o;
12
+ }, C = (o, t) => G(o, J(t));
13
+ import { reactive as U, ref as W, computed as Y, watch as $, nextTick as Z, onMounted as _, toRefs as D, openBlock as f, createElementBlock as y, createElementVNode as r, createCommentVNode as L, withDirectives as E, vShow as g, normalizeClass as X, toDisplayString as v, normalizeStyle as R, withModifiers as h } from "vue";
14
+ import { c as x } from "./component-234624bc.js";
15
+ import { _ as ee } from "./_plugin-vue_export-helper-dad06003.js";
23
16
  import "../locale/lang";
24
- function throttle(fn, delay) {
25
- let timer = null;
26
- let startTime = Date.now();
17
+ function A(o, t) {
18
+ let e = null, a = Date.now();
27
19
  return function() {
28
- let now = Date.now();
29
- let remaining = delay - (now - startTime);
30
- if (timer)
31
- clearTimeout(timer);
32
- if (remaining <= 0) {
33
- fn.apply(null, arguments);
34
- startTime = Date.now();
35
- } else {
36
- timer = setTimeout(fn, remaining);
37
- }
20
+ let p = Date.now(), u = t - (p - a);
21
+ e && clearTimeout(e), u <= 0 ? (o.apply(null, arguments), a = Date.now()) : e = setTimeout(o, u);
38
22
  };
39
23
  }
40
- const { create, translate } = createComponent("video");
41
- const _sfc_main = create({
24
+ const { create: oe, translate: te } = x("video"), le = oe({
42
25
  props: {
43
26
  source: {
44
27
  type: Object,
@@ -47,22 +30,22 @@ const _sfc_main = create({
47
30
  options: {
48
31
  type: Object,
49
32
  default: {
50
- autoplay: false,
33
+ autoplay: !1,
51
34
  //是否自动播放
52
35
  volume: 0.5,
53
36
  poster: "",
54
- loop: false,
55
- controls: true,
56
- muted: false,
37
+ loop: !1,
38
+ controls: !0,
39
+ muted: !1,
57
40
  //是否静音
58
- disabled: false,
41
+ disabled: !1,
59
42
  //禁止操作
60
- playsinline: false,
43
+ playsinline: !1,
61
44
  //行内展示
62
- touchPlay: false,
45
+ touchPlay: !1,
63
46
  preload: ""
64
47
  },
65
- required: true
48
+ required: !0
66
49
  },
67
50
  model: {
68
51
  type: String,
@@ -71,12 +54,12 @@ const _sfc_main = create({
71
54
  },
72
55
  components: {},
73
56
  emits: ["click", "play", "pause", "playend", "time"],
74
- setup(props, { emit }) {
75
- const state = reactive({
57
+ setup(o, { emit: t }) {
58
+ const e = U({
76
59
  videoElm: null,
77
- initial: true,
60
+ initial: !0,
78
61
  //控制封面的显示
79
- showToolbox: false,
62
+ showToolbox: !1,
80
63
  //控制控制器和标题的显示
81
64
  // 视频容器元素
82
65
  player: {
@@ -105,322 +88,214 @@ const _sfc_main = create({
105
88
  }
106
89
  },
107
90
  state: {
108
- controlShow: true,
91
+ controlShow: !0,
109
92
  vol: 0.5,
110
93
  //音量
111
94
  currentTime: 0,
112
95
  //当前时间
113
- fullScreen: false,
114
- playing: false,
96
+ fullScreen: !1,
97
+ playing: !1,
115
98
  //是否正在播放
116
- isLoading: false,
117
- isEnd: false,
118
- isError: false,
119
- isMuted: false
99
+ isLoading: !1,
100
+ isEnd: !1,
101
+ isError: !1,
102
+ isMuted: !1
120
103
  },
121
- showTouchMask: false
122
- });
123
- const root = ref(null);
124
- const isDisabled = computed(() => {
125
- return props.options.disabled;
126
- });
127
- watch(
128
- () => props.source,
129
- (newValue) => {
130
- if (newValue.src) {
131
- nextTick(() => {
132
- state.videoElm.load();
133
- });
134
- }
104
+ showTouchMask: !1
105
+ }), a = W(null), p = Y(() => o.options.disabled);
106
+ $(
107
+ () => o.source,
108
+ (s) => {
109
+ s.src && Z(() => {
110
+ e.videoElm.load();
111
+ });
135
112
  },
136
- { immediate: true, deep: true }
137
- );
138
- watch(
139
- () => props.options,
140
- (newValue) => {
141
- state.state.isMuted = newValue ? newValue.muted : false;
113
+ { immediate: !0, deep: !0 }
114
+ ), $(
115
+ () => o.options,
116
+ (s) => {
117
+ e.state.isMuted = s ? s.muted : !1;
142
118
  },
143
- { immediate: true }
119
+ { immediate: !0 }
144
120
  );
145
- const init = () => {
146
- state.videoElm = root.value;
147
- if (props.options.autoplay) {
148
- setTimeout(() => {
149
- state.videoElm.play();
150
- }, 200);
151
- }
152
- if (props.options.touchPlay) {
153
- state.showTouchMask = true;
154
- }
155
- if (props.options.playsinline) {
156
- state.videoElm.setAttribute("playsinline", props.options.playsinline);
157
- state.videoElm.setAttribute("webkit-playsinline", props.options.playsinline);
158
- state.videoElm.setAttribute("x5-video-player-type", "h5-page");
159
- state.videoElm.setAttribute("x5-video-player-fullscreen", false);
160
- }
161
- volumeHandle();
162
- if (state.showToolbox) {
163
- customerInit();
164
- } else {
165
- state.videoElm.addEventListener("play", () => {
166
- state.state.playing = true;
167
- emit("play", state.videoElm);
168
- });
169
- state.videoElm.addEventListener("pause", () => {
170
- state.state.playing = false;
171
- emit("pause", state.videoElm);
172
- });
173
- state.videoElm.addEventListener("ended", playEnded);
174
- state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 1e3));
175
- }
176
- };
177
- const customerInit = () => {
178
- const $player = root.value;
179
- const $progress = root.value.getElementsByClassName("nut-video-controller__progress-value")[0];
180
- state.player.$player = $player;
181
- state.progressBar.progressElm = $progress;
182
- state.progressBar.pos = $progress.getBoundingClientRect();
183
- state.videoSet.progress.width = Math.round($progress.getBoundingClientRect().width);
184
- };
185
- const play = () => {
186
- if (props.options.autoplay && props.options.disabled) {
187
- state.state.playing = true;
188
- return false;
189
- }
190
- state.state.playing = !state.state.playing;
191
- if (state.videoElm) {
192
- if (state.state.playing) {
121
+ const u = () => {
122
+ e.videoElm = a.value, o.options.autoplay && setTimeout(() => {
123
+ e.videoElm.play();
124
+ }, 200), o.options.touchPlay && (e.showTouchMask = !0), o.options.playsinline && (e.videoElm.setAttribute("playsinline", o.options.playsinline), e.videoElm.setAttribute("webkit-playsinline", o.options.playsinline), e.videoElm.setAttribute("x5-video-player-type", "h5-page"), e.videoElm.setAttribute("x5-video-player-fullscreen", !1)), N(), e.showToolbox ? l() : (e.videoElm.addEventListener("play", () => {
125
+ e.state.playing = !0, t("play", e.videoElm);
126
+ }), e.videoElm.addEventListener("pause", () => {
127
+ e.state.playing = !1, t("pause", e.videoElm);
128
+ }), e.videoElm.addEventListener("ended", w), e.videoElm.addEventListener("timeupdate", A(T, 1e3)));
129
+ }, l = () => {
130
+ const s = a.value, n = a.value.getElementsByClassName("nut-video-controller__progress-value")[0];
131
+ e.player.$player = s, e.progressBar.progressElm = n, e.progressBar.pos = n.getBoundingClientRect(), e.videoSet.progress.width = Math.round(n.getBoundingClientRect().width);
132
+ }, P = () => {
133
+ if (o.options.autoplay && o.options.disabled)
134
+ return e.state.playing = !0, !1;
135
+ if (e.state.playing = !e.state.playing, e.videoElm)
136
+ if (e.state.playing)
193
137
  try {
194
138
  setTimeout(() => {
195
- state.videoElm.play();
196
- }, 200);
197
- state.videoElm.addEventListener("progress", () => {
198
- getLoadTime();
199
- });
200
- state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 1e3));
201
- state.videoElm.addEventListener("ended", playEnded);
202
- emit("play", state.videoElm);
203
- } catch (e) {
204
- handleError();
139
+ e.videoElm.play();
140
+ }, 200), e.videoElm.addEventListener("progress", () => {
141
+ F();
142
+ }), e.videoElm.addEventListener("timeupdate", A(T, 1e3)), e.videoElm.addEventListener("ended", w), t("play", e.videoElm);
143
+ } catch (s) {
144
+ b();
205
145
  }
206
- } else {
207
- state.videoElm.pause();
208
- emit("pause", state.videoElm);
209
- }
210
- }
211
- };
212
- const timeFormat = (t) => {
213
- var h = Math.floor(t / 3600);
214
- if (h < 10) {
215
- h = "0" + h;
216
- }
217
- var m = Math.floor(t % 3600 / 60);
218
- if (m < 10) {
219
- m = "0" + m;
220
- }
221
- var s = Math.round(t % 3600 % 60);
222
- if (s < 10) {
223
- s = "0" + s;
224
- }
225
- var str = "";
226
- if (h != 0) {
227
- str = h + ":" + m + ":" + s;
228
- } else {
229
- str = m + ":" + s;
230
- }
231
- return str;
232
- };
233
- const getLoadTime = () => {
234
- if (state.videoSet.loaded)
235
- state.videoSet.loaded = state.videoElm.buffered.end(0) / state.videoElm.duration * 100;
146
+ else
147
+ e.videoElm.pause(), t("pause", e.videoElm);
148
+ }, S = (s) => {
149
+ var n = Math.floor(s / 3600);
150
+ n < 10 && (n = "0" + n);
151
+ var i = Math.floor(s % 3600 / 60);
152
+ i < 10 && (i = "0" + i);
153
+ var d = Math.round(s % 3600 % 60);
154
+ d < 10 && (d = "0" + d);
155
+ var m = "";
156
+ return n != 0 ? m = n + ":" + i + ":" + d : m = i + ":" + d, m;
157
+ }, F = () => {
158
+ e.videoSet.loaded && (e.videoSet.loaded = e.videoElm.buffered.end(0) / e.videoElm.duration * 100);
159
+ }, T = () => {
160
+ const s = e.videoElm.currentTime / e.videoElm.duration;
161
+ e.videoSet.progress.current = Math.round(e.videoSet.progress.width * s), e.videoSet.totalTime = S(e.videoElm.duration), e.videoSet.displayTime = S(e.videoElm.currentTime), t("time", e.videoSet.displayTime, e.videoSet.totalTime);
162
+ }, w = () => {
163
+ e.state.playing = !1, e.state.isEnd = !0, e.videoSet.displayTime = "00:00", e.videoSet.progress.current = 0, e.videoElm.currentTime = 0, t("playend", e.videoElm);
164
+ }, b = () => {
165
+ e.state.isError = !0;
166
+ }, N = () => {
167
+ e.state.vol = o.options.volume;
168
+ }, j = () => {
169
+ e.state.isMuted = !e.state.isMuted, e.videoElm.muted = e.state.isMuted;
170
+ }, q = () => {
171
+ }, z = (s) => {
172
+ let i = s.targetTouches[0].pageX - e.progressBar.pos.left;
173
+ i <= 0 && (i = 0), i >= e.videoSet.progress.width && (i = e.videoSet.progress.width), e.videoSet.progress.current = i;
174
+ let d = e.videoSet.progress.current / e.videoSet.progress.width;
175
+ e.videoElm.duration && M(d, e.videoElm.duration);
176
+ }, O = (s) => {
177
+ let i = s.changedTouches[0].pageX - e.progressBar.pos.left;
178
+ e.videoSet.progress.current = i;
179
+ let d = i / e.videoSet.progress.width;
180
+ e.videoElm.duration && M(d, e.videoElm.duration);
181
+ }, M = (s, n) => {
182
+ e.videoElm.currentTime = Math.floor(s * n);
183
+ }, V = () => {
184
+ e.state.isError = !1, u();
185
+ }, H = () => {
186
+ e.state.fullScreen ? (e.state.fullScreen = !1, document.webkitCancelFullScreen()) : (e.state.fullScreen = !0, e.videoElm.webkitRequestFullScreen());
236
187
  };
237
- const getPlayTime = () => {
238
- const percent = state.videoElm.currentTime / state.videoElm.duration;
239
- state.videoSet.progress.current = Math.round(state.videoSet.progress.width * percent);
240
- state.videoSet.totalTime = timeFormat(state.videoElm.duration);
241
- state.videoSet.displayTime = timeFormat(state.videoElm.currentTime);
242
- emit("time", state.videoSet.displayTime, state.videoSet.totalTime);
243
- };
244
- const playEnded = () => {
245
- state.state.playing = false;
246
- state.state.isEnd = true;
247
- state.videoSet.displayTime = "00:00";
248
- state.videoSet.progress.current = 0;
249
- state.videoElm.currentTime = 0;
250
- emit("playend", state.videoElm);
251
- };
252
- const handleError = () => {
253
- state.state.isError = true;
254
- };
255
- const volumeHandle = () => {
256
- state.state.vol = props.options.volume;
257
- };
258
- const handleMuted = () => {
259
- state.state.isMuted = !state.state.isMuted;
260
- state.videoElm.muted = state.state.isMuted;
261
- };
262
- const touchSlidSrart = () => {
263
- };
264
- const touchSlidMove = (e) => {
265
- let currentX = e.targetTouches[0].pageX;
266
- let offsetX = currentX - state.progressBar.pos.left;
267
- if (offsetX <= 0) {
268
- offsetX = 0;
269
- }
270
- if (offsetX >= state.videoSet.progress.width) {
271
- offsetX = state.videoSet.progress.width;
272
- }
273
- state.videoSet.progress.current = offsetX;
274
- let percent = state.videoSet.progress.current / state.videoSet.progress.width;
275
- state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
276
- };
277
- const touchSlidEnd = (e) => {
278
- let currentX = e.changedTouches[0].pageX;
279
- let offsetX = currentX - state.progressBar.pos.left;
280
- state.videoSet.progress.current = offsetX;
281
- let percent = offsetX / state.videoSet.progress.width;
282
- state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
283
- };
284
- const setPlayTime = (percent, totalTime) => {
285
- state.videoElm.currentTime = Math.floor(percent * totalTime);
286
- };
287
- const retry = () => {
288
- state.state.isError = false;
289
- init();
290
- };
291
- const fullScreen = () => {
292
- if (!state.state.fullScreen) {
293
- state.state.fullScreen = true;
294
- state.videoElm.webkitRequestFullScreen();
295
- } else {
296
- state.state.fullScreen = false;
297
- document.webkitCancelFullScreen();
298
- }
299
- };
300
- onMounted(() => {
301
- init();
302
- });
303
- return __spreadProps(__spreadValues(__spreadValues({
304
- root
305
- }, toRefs(props)), toRefs(state)), {
306
- handleError,
307
- isDisabled,
308
- play,
309
- handleMuted,
310
- touchSlidSrart,
311
- touchSlidMove,
312
- touchSlidEnd,
313
- retry,
314
- fullScreen,
315
- translate
188
+ return _(() => {
189
+ u();
190
+ }), C(c(c({
191
+ root: a
192
+ }, D(o)), D(e)), {
193
+ handleError: b,
194
+ isDisabled: p,
195
+ play: P,
196
+ handleMuted: j,
197
+ touchSlidSrart: q,
198
+ touchSlidMove: z,
199
+ touchSlidEnd: O,
200
+ retry: V,
201
+ fullScreen: H,
202
+ translate: te
316
203
  });
317
204
  }
318
- });
319
- const _hoisted_1 = {
205
+ }), se = {
320
206
  class: "nut-video",
321
207
  ref: "videocon"
322
- };
323
- const _hoisted_2 = ["muted", "autoplay", "loop", "poster", "controls", "preload"];
324
- const _hoisted_3 = ["src", "type"];
325
- const _hoisted_4 = { class: "nut-video-controller__now" };
326
- const _hoisted_5 = { class: "nut-video-controller__progress" };
327
- const _hoisted_6 = {
208
+ }, re = ["muted", "autoplay", "loop", "poster", "controls", "preload"], ie = ["src", "type"], ne = { class: "nut-video-controller__now" }, de = { class: "nut-video-controller__progress" }, ae = {
328
209
  class: "nut-video-controller__progress-value",
329
210
  ref: "progressBar"
330
- };
331
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("div", { class: "nut-video-controller__ball-move" }, null, -1);
332
- const _hoisted_8 = [
333
- _hoisted_7
334
- ];
335
- const _hoisted_9 = {
211
+ }, ue = /* @__PURE__ */ r("div", { class: "nut-video-controller__ball-move" }, null, -1), pe = [
212
+ ue
213
+ ], ve = {
336
214
  class: "nut-video-controller__played",
337
215
  ref: "playedBar"
338
- };
339
- const _hoisted_10 = { class: "nut-video-controller__total" };
340
- const _hoisted_11 = { class: "nut-video-error" };
341
- const _hoisted_12 = { class: "nut-video-error-tip" };
342
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
343
- return openBlock(), createElementBlock("div", _hoisted_1, [
344
- createElementVNode("video", {
216
+ }, me = { class: "nut-video-controller__total" }, ce = { class: "nut-video-error" }, fe = { class: "nut-video-error-tip" };
217
+ function ye(o, t, e, a, p, u) {
218
+ return f(), y("div", se, [
219
+ r("video", {
345
220
  ref: "root",
346
221
  class: "nut-video-player",
347
- muted: _ctx.options.muted,
348
- autoplay: _ctx.options.autoplay,
349
- loop: _ctx.options.loop,
350
- poster: _ctx.options.poster,
351
- controls: _ctx.options.controls,
352
- preload: _ctx.options.preload,
353
- onError: _cache[0] || (_cache[0] = (...args) => _ctx.handleError && _ctx.handleError(...args))
222
+ muted: o.options.muted,
223
+ autoplay: o.options.autoplay,
224
+ loop: o.options.loop,
225
+ poster: o.options.poster,
226
+ controls: o.options.controls,
227
+ preload: o.options.preload,
228
+ onError: t[0] || (t[0] = (...l) => o.handleError && o.handleError(...l))
354
229
  }, [
355
- createElementVNode("source", {
356
- src: _ctx.source.src,
357
- type: _ctx.source.type
358
- }, null, 8, _hoisted_3)
359
- ], 40, _hoisted_2),
360
- _ctx.showToolbox && !_ctx.isDisabled ? (openBlock(), createElementBlock("div", {
230
+ r("source", {
231
+ src: o.source.src,
232
+ type: o.source.type
233
+ }, null, 8, ie)
234
+ ], 40, re),
235
+ o.showToolbox && !o.isDisabled ? (f(), y("div", {
361
236
  key: 0,
362
237
  class: "nut-video-mask",
363
238
  ref: "touchMask",
364
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.play && _ctx.play(...args))
365
- }, null, 512)) : createCommentVNode("", true),
366
- _ctx.showToolbox && !_ctx.isDisabled ? withDirectives((openBlock(), createElementBlock("div", {
239
+ onClick: t[1] || (t[1] = (...l) => o.play && o.play(...l))
240
+ }, null, 512)) : L("", !0),
241
+ o.showToolbox && !o.isDisabled ? E((f(), y("div", {
367
242
  key: 1,
368
243
  class: "nut-video-play-btn",
369
244
  ref: "palyBtn",
370
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.play && _ctx.play(...args))
245
+ onClick: t[2] || (t[2] = (...l) => o.play && o.play(...l))
371
246
  }, null, 512)), [
372
- [vShow, !_ctx.state.playing]
373
- ]) : createCommentVNode("", true),
374
- withDirectives(createElementVNode("div", {
375
- class: normalizeClass(["nut-video-controller", { "nut-video-controller--show": !_ctx.state.playing, "nut-video-controller--hide": _ctx.state.playing }])
247
+ [g, !o.state.playing]
248
+ ]) : L("", !0),
249
+ E(r("div", {
250
+ class: X(["nut-video-controller", { "nut-video-controller--show": !o.state.playing, "nut-video-controller--hide": o.state.playing }])
376
251
  }, [
377
- createElementVNode("div", {
252
+ r("div", {
378
253
  class: "nut-video-controller__playbtn",
379
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.play && _ctx.play(...args))
254
+ onClick: t[3] || (t[3] = (...l) => o.play && o.play(...l))
380
255
  }),
381
- createElementVNode("div", _hoisted_4, toDisplayString(_ctx.videoSet.displayTime), 1),
382
- createElementVNode("div", _hoisted_5, [
383
- createElementVNode("div", _hoisted_6, [
384
- createElementVNode("div", {
256
+ r("div", ne, v(o.videoSet.displayTime), 1),
257
+ r("div", de, [
258
+ r("div", ae, [
259
+ r("div", {
385
260
  class: "buffered",
386
- style: normalizeStyle({ width: `${_ctx.videoSet.loaded}%` })
261
+ style: R({ width: `${o.videoSet.loaded}%` })
387
262
  }, null, 4),
388
- createElementVNode("div", {
263
+ r("div", {
389
264
  class: "nut-video-controller__ball",
390
- style: normalizeStyle({
391
- transform: `translate3d(${_ctx.videoSet.progress.current}px, -50%, 0)`
265
+ style: R({
266
+ transform: `translate3d(${o.videoSet.progress.current}px, -50%, 0)`
392
267
  }),
393
- onTouchmove: _cache[4] || (_cache[4] = withModifiers(($event) => _ctx.touchSlidMove($event), ["stop", "prevent"])),
394
- onTouchstart: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.touchSlidSrart(), ["stop"])),
395
- onTouchend: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.touchSlidEnd($event), ["stop"]))
396
- }, _hoisted_8, 36),
397
- createElementVNode("div", _hoisted_9, null, 512)
268
+ onTouchmove: t[4] || (t[4] = h((l) => o.touchSlidMove(l), ["stop", "prevent"])),
269
+ onTouchstart: t[5] || (t[5] = h((l) => o.touchSlidSrart(), ["stop"])),
270
+ onTouchend: t[6] || (t[6] = h((l) => o.touchSlidEnd(l), ["stop"]))
271
+ }, pe, 36),
272
+ r("div", ve, null, 512)
398
273
  ], 512)
399
274
  ]),
400
- createElementVNode("div", _hoisted_10, toDisplayString(_ctx.videoSet.totalTime), 1),
401
- createElementVNode("div", {
402
- class: normalizeClass(["nut-video-controller__volume", { muted: _ctx.state.isMuted }]),
403
- onClick: _cache[7] || (_cache[7] = (...args) => _ctx.handleMuted && _ctx.handleMuted(...args))
275
+ r("div", me, v(o.videoSet.totalTime), 1),
276
+ r("div", {
277
+ class: X(["nut-video-controller__volume", { muted: o.state.isMuted }]),
278
+ onClick: t[7] || (t[7] = (...l) => o.handleMuted && o.handleMuted(...l))
404
279
  }, null, 2),
405
- createElementVNode("div", {
280
+ r("div", {
406
281
  class: "nut-video-controller__full",
407
- onClick: _cache[8] || (_cache[8] = (...args) => _ctx.fullScreen && _ctx.fullScreen(...args))
282
+ onClick: t[8] || (t[8] = (...l) => o.fullScreen && o.fullScreen(...l))
408
283
  })
409
284
  ], 2), [
410
- [vShow, _ctx.showToolbox && !_ctx.isDisabled]
285
+ [g, o.showToolbox && !o.isDisabled]
411
286
  ]),
412
- withDirectives(createElementVNode("div", _hoisted_11, [
413
- createElementVNode("p", _hoisted_12, toDisplayString(_ctx.translate("errorTip")), 1),
414
- createElementVNode("p", {
287
+ E(r("div", ce, [
288
+ r("p", fe, v(o.translate("errorTip")), 1),
289
+ r("p", {
415
290
  class: "nut-video-error-retry",
416
- onClick: _cache[9] || (_cache[9] = (...args) => _ctx.retry && _ctx.retry(...args))
417
- }, toDisplayString(_ctx.translate("clickRetry")), 1)
291
+ onClick: t[9] || (t[9] = (...l) => o.retry && o.retry(...l))
292
+ }, v(o.translate("clickRetry")), 1)
418
293
  ], 512), [
419
- [vShow, _ctx.state.isError]
294
+ [g, o.state.isError]
420
295
  ])
421
296
  ], 512);
422
297
  }
423
- const Video = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
298
+ const we = /* @__PURE__ */ ee(le, [["render", ye]]);
424
299
  export {
425
- Video as default
300
+ we as default
426
301
  };