@nutui/nutui 3.1.6 → 3.1.7

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 (92) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/nutui.d.ts +7 -1
  3. package/dist/nutui.es.js +1097 -517
  4. package/dist/nutui.umd.js +1158 -571
  5. package/dist/packages/_es/ActionSheet.js +158 -0
  6. package/dist/packages/_es/Address.js +525 -0
  7. package/dist/packages/_es/Avatar.js +87 -0
  8. package/dist/packages/_es/BackTop.js +159 -0
  9. package/dist/packages/_es/Badge.js +90 -0
  10. package/dist/packages/_es/Barrage.js +118 -0
  11. package/dist/packages/_es/Button.js +124 -0
  12. package/dist/packages/_es/Calendar.js +700 -0
  13. package/dist/packages/_es/Cell.js +95 -0
  14. package/dist/packages/_es/CellGroup.js +42 -0
  15. package/dist/packages/_es/Checkbox.js +109 -0
  16. package/dist/packages/_es/CheckboxGroup.js +62 -0
  17. package/dist/packages/_es/CircleProgress.js +109 -0
  18. package/dist/packages/_es/Col.js +53 -0
  19. package/dist/packages/_es/Collapse.js +89 -0
  20. package/dist/packages/_es/CollapseItem.js +257 -0
  21. package/dist/packages/_es/CountDown.js +224 -0
  22. package/dist/packages/_es/CountUp.js +547 -0
  23. package/dist/packages/_es/DatePicker.js +282 -0
  24. package/dist/packages/_es/Dialog.js +313 -0
  25. package/dist/packages/_es/Divider.js +49 -0
  26. package/dist/packages/_es/Drag.js +198 -0
  27. package/dist/packages/_es/Elevator.js +207 -0
  28. package/dist/packages/_es/FixedNav.js +127 -0
  29. package/dist/packages/_es/Icon.js +44 -0
  30. package/dist/packages/_es/ImagePreview.js +109 -0
  31. package/dist/packages/_es/InfiniteLoading.js +265 -0
  32. package/dist/packages/_es/Input.js +183 -0
  33. package/dist/packages/_es/InputNumber.js +172 -0
  34. package/dist/packages/_es/Layout.js +10 -0
  35. package/dist/packages/_es/MenuItem.js +180 -0
  36. package/dist/packages/_es/Navbar.js +160 -0
  37. package/dist/packages/_es/NoticeBar.js +389 -0
  38. package/dist/packages/_es/Notify.js +233 -0
  39. package/dist/packages/_es/NumberKeyboard.js +248 -0
  40. package/dist/packages/_es/OverLay.js +118 -0
  41. package/dist/packages/_es/Pagination.js +163 -0
  42. package/dist/packages/_es/Picker.js +485 -0
  43. package/dist/packages/_es/Popover.js +157 -0
  44. package/dist/packages/_es/Popup.js +268 -0
  45. package/dist/packages/_es/Price.js +104 -0
  46. package/dist/packages/_es/Progress.js +131 -0
  47. package/dist/packages/_es/Radio.js +72 -0
  48. package/dist/packages/_es/RadioGroup.js +37 -0
  49. package/dist/packages/_es/Range.js +350 -0
  50. package/dist/packages/_es/Rate.js +129 -0
  51. package/dist/packages/_es/Row.js +61 -0
  52. package/dist/packages/_es/ShortPassword.js +221 -0
  53. package/dist/packages/_es/Signature.js +167 -0
  54. package/dist/packages/_es/Step.js +116 -0
  55. package/dist/packages/_es/Steps.js +52 -0
  56. package/dist/packages/_es/Swipe.js +193 -0
  57. package/dist/packages/_es/Swiper.js +429 -0
  58. package/dist/packages/_es/SwiperItem.js +60 -0
  59. package/dist/packages/_es/Switch.js +90 -0
  60. package/dist/packages/_es/Tab.js +179 -0
  61. package/dist/packages/_es/TabPane.js +42 -0
  62. package/dist/packages/_es/TabPanel.js +30 -0
  63. package/dist/packages/_es/Tabbar.js +73 -0
  64. package/dist/packages/_es/TabbarItem.js +142 -0
  65. package/dist/packages/_es/Tag.js +98 -0
  66. package/dist/packages/_es/TextArea.js +127 -0
  67. package/dist/packages/_es/Toast.js +317 -0
  68. package/dist/packages/_es/Uploader.js +400 -0
  69. package/dist/packages/_es/Video.js +405 -0
  70. package/dist/packages/_es/component.js +26 -0
  71. package/dist/packages/_es/index.js +64 -0
  72. package/dist/packages/_es/index2.js +13 -0
  73. package/dist/packages/_es/plugin-vue_export-helper.js +12 -0
  74. package/dist/packages/_es/pxCheck.js +9 -0
  75. package/dist/packages/_es/raf.js +19 -0
  76. package/dist/packages/avatar/index.scss +0 -1
  77. package/dist/packages/badge/index.scss +35 -0
  78. package/dist/packages/calendar/index.scss +13 -0
  79. package/dist/packages/imagepreview/index.scss +48 -0
  80. package/dist/packages/input/index.scss +14 -7
  81. package/dist/packages/pagination/index.scss +51 -0
  82. package/dist/packages/popover/index.scss +159 -0
  83. package/dist/packages/shortpassword/index.scss +19 -7
  84. package/dist/packages/tabpane/index.scss +1 -0
  85. package/dist/packages/tabs/index.scss +1 -0
  86. package/dist/packages/tag/index.scss +47 -0
  87. package/dist/packages/uploader/index.scss +0 -1
  88. package/dist/style.css +1 -1
  89. package/dist/style.es.js +2 -1
  90. package/dist/styles/themes/default.scss +35 -28
  91. package/dist/styles/variables.scss +55 -32
  92. package/package.json +7 -7
@@ -0,0 +1,405 @@
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
+ /*!
21
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
22
+ * (c) 2021 @jdf2e.
23
+ * Released under the MIT License.
24
+ */
25
+ import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const throttle = (func, wait, type) => {
29
+ if (type === 1) {
30
+ var previous = 0;
31
+ } else if (type === 2) {
32
+ var timeout;
33
+ }
34
+ return function() {
35
+ let context = this;
36
+ let args = arguments;
37
+ if (type === 1) {
38
+ let now = Date.now();
39
+ if (now - previous > wait) {
40
+ func.apply(context, args);
41
+ previous = now;
42
+ }
43
+ } else if (type === 2) {
44
+ if (!timeout) {
45
+ timeout = setTimeout(() => {
46
+ timeout = null;
47
+ func.apply(context, args);
48
+ }, wait);
49
+ }
50
+ }
51
+ };
52
+ };
53
+ const { create } = createComponent("video");
54
+ const _sfc_main = create({
55
+ props: {
56
+ source: {
57
+ type: Object,
58
+ default: {}
59
+ },
60
+ options: {
61
+ type: Object,
62
+ default: {
63
+ autoplay: false,
64
+ volume: 0.5,
65
+ poster: "",
66
+ loop: false,
67
+ controls: true,
68
+ muted: false,
69
+ disabled: false,
70
+ playsinline: false,
71
+ touchPlay: false,
72
+ preload: ""
73
+ },
74
+ required: true
75
+ },
76
+ model: {
77
+ type: String,
78
+ default: ""
79
+ }
80
+ },
81
+ components: {},
82
+ emits: ["click", "play", "pause", "playend"],
83
+ setup(props, { emit }) {
84
+ const state = reactive({
85
+ videoElm: null,
86
+ initial: true,
87
+ showToolbox: false,
88
+ player: {
89
+ $player: null,
90
+ pos: null
91
+ },
92
+ progressBar: {
93
+ progressElm: null,
94
+ pos: null
95
+ },
96
+ videoSet: {
97
+ loaded: 0,
98
+ displayTime: "00:00",
99
+ totalTime: "00:00",
100
+ progress: {
101
+ width: 0,
102
+ current: 0
103
+ }
104
+ },
105
+ state: {
106
+ controlShow: true,
107
+ vol: 0.5,
108
+ currentTime: 0,
109
+ fullScreen: false,
110
+ playing: false,
111
+ isLoading: false,
112
+ isEnd: false,
113
+ isError: false,
114
+ isMuted: false
115
+ },
116
+ showTouchMask: false
117
+ });
118
+ const root = ref();
119
+ const isDisabled = computed(() => {
120
+ return props.options.disabled;
121
+ });
122
+ watch(props.source, (newValue) => {
123
+ if (newValue.src) {
124
+ nextTick(() => {
125
+ state.videoElm.load();
126
+ });
127
+ }
128
+ });
129
+ watch(props.options, (newValue) => {
130
+ state.state.isMuted = newValue.muted ? newValue.muted : false;
131
+ }, { immediate: true });
132
+ const init = () => {
133
+ state.videoElm = root.value;
134
+ if (props.options.autoplay) {
135
+ state.videoElm.play();
136
+ }
137
+ if (props.options.touchPlay) {
138
+ state.showTouchMask = true;
139
+ }
140
+ if (props.options.playsinline) {
141
+ state.videoElm.setAttribute("playsinline", props.options.playsinline);
142
+ state.videoElm.setAttribute("webkit-playsinline", props.options.playsinline);
143
+ state.videoElm.setAttribute("x5-video-player-type", "h5-page");
144
+ state.videoElm.setAttribute("x5-video-player-fullscreen", false);
145
+ }
146
+ volumeHandle();
147
+ if (state.showToolbox) {
148
+ customerInit();
149
+ } else {
150
+ state.videoElm.addEventListener("play", () => {
151
+ state.state.playing = true;
152
+ emit("play", state.videoElm);
153
+ });
154
+ state.videoElm.addEventListener("pause", () => {
155
+ state.state.playing = false;
156
+ emit("pause", state.videoElm);
157
+ });
158
+ state.videoElm.addEventListener("ended", playEnded);
159
+ state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 100, 1));
160
+ }
161
+ };
162
+ const customerInit = () => {
163
+ const $player = root.value;
164
+ const $progress = root.value.getElementsByClassName("progress")[0];
165
+ state.player.$player = $player;
166
+ state.progressBar.progressElm = $progress;
167
+ state.progressBar.pos = $progress.getBoundingClientRect();
168
+ state.videoSet.progress.width = Math.round($progress.getBoundingClientRect().width);
169
+ };
170
+ const play = () => {
171
+ if (props.options.autoplay && props.options.disabled) {
172
+ state.state.playing = true;
173
+ return false;
174
+ }
175
+ state.state.playing = !state.state.playing;
176
+ if (state.videoElm) {
177
+ if (state.state.playing) {
178
+ try {
179
+ state.videoElm.play();
180
+ state.videoElm.addEventListener("progress", () => {
181
+ getLoadTime();
182
+ });
183
+ state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 100, 1));
184
+ state.videoElm.addEventListener("ended", playEnded);
185
+ emit("play", state.videoElm);
186
+ } catch (e) {
187
+ handleError();
188
+ }
189
+ } else {
190
+ state.videoElm.pause();
191
+ emit("pause", state.videoElm);
192
+ }
193
+ }
194
+ };
195
+ const timeFormat = (t) => {
196
+ var h = Math.floor(t / 3600);
197
+ if (h < 10) {
198
+ h = "0" + h;
199
+ }
200
+ var m = Math.floor(t % 3600 / 60);
201
+ if (m < 10) {
202
+ m = "0" + m;
203
+ }
204
+ var s = Math.round(t % 3600 % 60);
205
+ if (s < 10) {
206
+ s = "0" + s;
207
+ }
208
+ var str = "";
209
+ if (h != 0) {
210
+ str = h + ":" + m + ":" + s;
211
+ } else {
212
+ str = m + ":" + s;
213
+ }
214
+ return str;
215
+ };
216
+ const getLoadTime = () => {
217
+ if (state.videoSet.loaded)
218
+ state.videoSet.loaded = state.videoElm.buffered.end(0) / state.videoElm.duration * 100;
219
+ };
220
+ const getPlayTime = () => {
221
+ const percent = state.videoElm.currentTime / state.videoElm.duration;
222
+ state.videoSet.progress.current = Math.round(state.videoSet.progress.width * percent);
223
+ state.videoSet.totalTime = timeFormat(state.videoElm.duration);
224
+ state.videoSet.displayTime = timeFormat(state.videoElm.currentTime);
225
+ };
226
+ const playEnded = () => {
227
+ state.state.playing = false;
228
+ state.state.isEnd = true;
229
+ state.videoSet.displayTime = "00:00";
230
+ state.videoSet.progress.current = 0;
231
+ state.videoElm.currentTime = 0;
232
+ emit("playend", state.videoElm);
233
+ };
234
+ const handleError = () => {
235
+ state.state.isError = true;
236
+ };
237
+ const volumeHandle = () => {
238
+ state.state.vol = props.options.volume;
239
+ };
240
+ const handleMuted = () => {
241
+ state.state.isMuted = !state.state.isMuted;
242
+ state.videoElm.muted = state.state.isMuted;
243
+ };
244
+ const touchSlidSrart = () => {
245
+ };
246
+ const touchSlidMove = (e) => {
247
+ let currentX = e.targetTouches[0].pageX;
248
+ let offsetX = currentX - state.progressBar.pos.left;
249
+ if (offsetX <= 0) {
250
+ offsetX = 0;
251
+ }
252
+ if (offsetX >= state.videoSet.progress.width) {
253
+ offsetX = state.videoSet.progress.width;
254
+ }
255
+ state.videoSet.progress.current = offsetX;
256
+ let percent = state.videoSet.progress.current / state.videoSet.progress.width;
257
+ state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
258
+ };
259
+ const touchSlidEnd = (e) => {
260
+ let currentX = e.changedTouches[0].pageX;
261
+ let offsetX = currentX - state.progressBar.pos.left;
262
+ state.videoSet.progress.current = offsetX;
263
+ let percent = offsetX / state.videoSet.progress.width;
264
+ state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
265
+ };
266
+ const setPlayTime = (percent, totalTime) => {
267
+ state.videoElm.currentTime = Math.floor(percent * totalTime);
268
+ };
269
+ const retry = () => {
270
+ state.state.isError = false;
271
+ init();
272
+ };
273
+ const fullScreen = () => {
274
+ if (!state.state.fullScreen) {
275
+ state.state.fullScreen = true;
276
+ state.videoElm.webkitRequestFullScreen();
277
+ } else {
278
+ state.state.fullScreen = false;
279
+ document.webkitCancelFullScreen();
280
+ }
281
+ };
282
+ onMounted(() => {
283
+ init();
284
+ });
285
+ return __spreadProps(__spreadValues(__spreadValues({
286
+ root
287
+ }, toRefs(props)), toRefs(state)), {
288
+ handleError,
289
+ isDisabled,
290
+ play,
291
+ handleMuted,
292
+ touchSlidSrart,
293
+ touchSlidMove,
294
+ touchSlidEnd,
295
+ retry,
296
+ fullScreen
297
+ });
298
+ }
299
+ });
300
+ const _hoisted_1 = {
301
+ class: "nut-video",
302
+ ref: "videocon"
303
+ };
304
+ const _hoisted_2 = ["muted", "autoplay", "loop", "poster", "controls", "preload"];
305
+ const _hoisted_3 = ["src", "type"];
306
+ const _hoisted_4 = { class: "current-time" };
307
+ const _hoisted_5 = { class: "progress-container" };
308
+ const _hoisted_6 = {
309
+ class: "progress",
310
+ ref: "progressBar"
311
+ };
312
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("div", { class: "move-handle" }, null, -1);
313
+ const _hoisted_8 = [
314
+ _hoisted_7
315
+ ];
316
+ const _hoisted_9 = {
317
+ class: "played",
318
+ ref: "playedBar"
319
+ };
320
+ const _hoisted_10 = { class: "duration-time" };
321
+ const _hoisted_11 = { class: "nut-video-error" };
322
+ const _hoisted_12 = /* @__PURE__ */ createElementVNode("p", { class: "lose" }, "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25", -1);
323
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
324
+ return openBlock(), createElementBlock("div", _hoisted_1, [
325
+ createElementVNode("video", {
326
+ ref: "root",
327
+ class: "nut-video-player",
328
+ muted: _ctx.options.muted,
329
+ autoplay: _ctx.options.autoplay,
330
+ loop: _ctx.options.loop,
331
+ poster: _ctx.options.poster,
332
+ controls: _ctx.options.controls,
333
+ preload: _ctx.options.preload,
334
+ onError: _cache[0] || (_cache[0] = (...args) => _ctx.handleError && _ctx.handleError(...args))
335
+ }, [
336
+ createElementVNode("source", {
337
+ src: _ctx.source.src,
338
+ type: _ctx.source.type
339
+ }, null, 8, _hoisted_3)
340
+ ], 40, _hoisted_2),
341
+ _ctx.showToolbox && !_ctx.isDisabled ? (openBlock(), createElementBlock("div", {
342
+ key: 0,
343
+ class: "playing-mask",
344
+ ref: "touchMask",
345
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.play && _ctx.play(...args))
346
+ }, null, 512)) : createCommentVNode("", true),
347
+ _ctx.showToolbox && !_ctx.isDisabled ? withDirectives((openBlock(), createElementBlock("div", {
348
+ key: 1,
349
+ class: "nut-video-play-btn",
350
+ ref: "palyBtn",
351
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.play && _ctx.play(...args))
352
+ }, null, 512)), [
353
+ [vShow, !_ctx.state.playing]
354
+ ]) : createCommentVNode("", true),
355
+ withDirectives(createElementVNode("div", {
356
+ class: normalizeClass(["nut-video-controller", { "show-control": !_ctx.state.playing, "hide-control": _ctx.state.playing }])
357
+ }, [
358
+ createElementVNode("div", {
359
+ class: "control-play-btn",
360
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.play && _ctx.play(...args))
361
+ }),
362
+ createElementVNode("div", _hoisted_4, toDisplayString(_ctx.videoSet.displayTime), 1),
363
+ createElementVNode("div", _hoisted_5, [
364
+ createElementVNode("div", _hoisted_6, [
365
+ createElementVNode("div", {
366
+ class: "buffered",
367
+ style: normalizeStyle({ width: `${_ctx.videoSet.loaded}%` })
368
+ }, null, 4),
369
+ createElementVNode("div", {
370
+ class: "video-ball",
371
+ style: normalizeStyle({
372
+ transform: `translate3d(${_ctx.videoSet.progress.current}px, -50%, 0)`
373
+ }),
374
+ onTouchmove: _cache[4] || (_cache[4] = withModifiers(($event) => _ctx.touchSlidMove($event), ["stop", "prevent"])),
375
+ onTouchstart: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.touchSlidSrart($event), ["stop"])),
376
+ onTouchend: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.touchSlidEnd($event), ["stop"]))
377
+ }, _hoisted_8, 36),
378
+ createElementVNode("div", _hoisted_9, null, 512)
379
+ ], 512)
380
+ ]),
381
+ createElementVNode("div", _hoisted_10, toDisplayString(_ctx.videoSet.totalTime), 1),
382
+ createElementVNode("div", {
383
+ class: normalizeClass(["volume", { muted: _ctx.state.isMuted }]),
384
+ onClick: _cache[7] || (_cache[7] = (...args) => _ctx.handleMuted && _ctx.handleMuted(...args))
385
+ }, null, 2),
386
+ createElementVNode("div", {
387
+ class: "fullscreen-icon",
388
+ onClick: _cache[8] || (_cache[8] = (...args) => _ctx.fullScreen && _ctx.fullScreen(...args))
389
+ })
390
+ ], 2), [
391
+ [vShow, _ctx.showToolbox && !_ctx.isDisabled]
392
+ ]),
393
+ withDirectives(createElementVNode("div", _hoisted_11, [
394
+ _hoisted_12,
395
+ createElementVNode("p", {
396
+ class: "retry",
397
+ onClick: _cache[9] || (_cache[9] = (...args) => _ctx.retry && _ctx.retry(...args))
398
+ }, "\u70B9\u51FB\u91CD\u8BD5")
399
+ ], 512), [
400
+ [vShow, _ctx.state.isError]
401
+ ])
402
+ ], 512);
403
+ }
404
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
405
+ export { index as default };
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { defineComponent } from "vue";
7
+ function createComponent(name) {
8
+ const componentName = "nut-" + name;
9
+ return {
10
+ componentName,
11
+ create: function(_component) {
12
+ _component.baseName = name;
13
+ _component.name = componentName;
14
+ _component.install = (vue) => {
15
+ vue.component(_component.name, _component);
16
+ };
17
+ return defineComponent(_component);
18
+ },
19
+ createDemo: function(_component) {
20
+ _component.baseName = name;
21
+ _component.name = "demo-" + name;
22
+ return defineComponent(_component);
23
+ }
24
+ };
25
+ }
26
+ export { createComponent as c };
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { ref } from "vue";
7
+ const MIN_DISTANCE = 10;
8
+ function getDirection(x, y) {
9
+ if (x > y && x > MIN_DISTANCE) {
10
+ return "horizontal";
11
+ }
12
+ if (y > x && y > MIN_DISTANCE) {
13
+ return "vertical";
14
+ }
15
+ return "";
16
+ }
17
+ function useTouch() {
18
+ const startX = ref(0);
19
+ const startY = ref(0);
20
+ const deltaX = ref(0);
21
+ const deltaY = ref(0);
22
+ const offsetX = ref(0);
23
+ const offsetY = ref(0);
24
+ const direction = ref("");
25
+ const isVertical = () => direction.value === "vertical";
26
+ const isHorizontal = () => direction.value === "horizontal";
27
+ const reset = () => {
28
+ deltaX.value = 0;
29
+ deltaY.value = 0;
30
+ offsetX.value = 0;
31
+ offsetY.value = 0;
32
+ direction.value = "";
33
+ };
34
+ const start = (event) => {
35
+ reset();
36
+ startX.value = event.touches[0].clientX;
37
+ startY.value = event.touches[0].clientY;
38
+ };
39
+ const move = (event) => {
40
+ const touch = event.touches[0];
41
+ deltaX.value = touch.clientX - startX.value;
42
+ deltaY.value = touch.clientY - startY.value;
43
+ offsetX.value = Math.abs(deltaX.value);
44
+ offsetY.value = Math.abs(deltaY.value);
45
+ if (!direction.value) {
46
+ direction.value = getDirection(offsetX.value, offsetY.value);
47
+ }
48
+ };
49
+ return {
50
+ move,
51
+ start,
52
+ reset,
53
+ startX,
54
+ startY,
55
+ deltaX,
56
+ deltaY,
57
+ offsetX,
58
+ offsetY,
59
+ direction,
60
+ isVertical,
61
+ isHorizontal
62
+ };
63
+ }
64
+ export { useTouch as u };
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { getCurrentInstance } from "vue";
7
+ function useExpose(apis) {
8
+ const instance = getCurrentInstance();
9
+ if (instance) {
10
+ Object.assign(instance.proxy, apis);
11
+ }
12
+ }
13
+ export { useExpose as u };
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ var _export_sfc = (sfc, props) => {
7
+ for (const [key, val] of props) {
8
+ sfc[key] = val;
9
+ }
10
+ return sfc;
11
+ };
12
+ export { _export_sfc as _ };
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ const pxCheck = (value) => {
7
+ return isNaN(Number(value)) ? String(value) : `${value}px`;
8
+ };
9
+ export { pxCheck as p };
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ const _window = window;
7
+ function requestAniFrame() {
8
+ if (typeof _window !== "undefined") {
9
+ return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
10
+ _window.setTimeout(callback, 1e3 / 60);
11
+ };
12
+ } else {
13
+ return function(callback) {
14
+ setTimeout(callback, 1e3 / 60);
15
+ };
16
+ }
17
+ }
18
+ var requestAniFrame$1 = requestAniFrame();
19
+ export { requestAniFrame$1 as r };
@@ -4,7 +4,6 @@
4
4
  background-position: center center;
5
5
  display: inline-block;
6
6
  position: relative;
7
- margin-right: 24px;
8
7
  flex: 0 0 auto; // 防止被压缩
9
8
  .icon {
10
9
  background-size: 100% 100%;
@@ -0,0 +1,35 @@
1
+ .nut-badge {
2
+ position: relative;
3
+ display: inline-block;
4
+ .slot-icons {
5
+ position: absolute;
6
+ background: $badge-background-color;
7
+ border-radius: 7px;
8
+ top: -20%;
9
+ right: -20%;
10
+ padding: 0 5px;
11
+ text-align: center;
12
+ border-radius: 14px;
13
+ z-index: 1;
14
+ }
15
+ .sup {
16
+ position: absolute;
17
+ background: $badge-background-color;
18
+ border-radius: 7px;
19
+ padding: 0 5px;
20
+ text-align: center;
21
+ border-radius: 14px;
22
+ font-size: $badge-font-size;
23
+ font-weight: normal;
24
+ color: $badge-default-background-color;
25
+ }
26
+ .nut-badge__content {
27
+ transform: translateY(-50%) translateX(100%);
28
+ }
29
+ .is-dot {
30
+ width: 7px;
31
+ height: 7px;
32
+ border-radius: 7px;
33
+ padding: 0;
34
+ }
35
+ }
@@ -21,6 +21,19 @@
21
21
  }
22
22
  }
23
23
 
24
+ .nut-calendar-taro {
25
+ height: 60vh;
26
+ }
27
+ .popup-box {
28
+ height: 518px;
29
+ }
30
+ .nut-calendar-content {
31
+ overflow-y: auto;
32
+ }
33
+ ::-webkit-scrollbar {
34
+ display: none;
35
+ }
36
+
24
37
  // 头部导航
25
38
  .nut-calendar-header {
26
39
  position: absolute;
@@ -0,0 +1,48 @@
1
+ .nut-imagepreview {
2
+ &-swiper {
3
+ height: 327px;
4
+ width: 100vw;
5
+ background-color: transparent;
6
+ }
7
+
8
+ &-img {
9
+ width: 100%;
10
+ height: 100%;
11
+ object-fit: contain;
12
+ }
13
+
14
+ &-index {
15
+ position: fixed;
16
+ top: 50px;
17
+ text-align: center;
18
+ left: 0;
19
+ right: 0;
20
+ background: transparent;
21
+ color: #fff;
22
+
23
+ .arrow {
24
+ position: absolute;
25
+ left: 15px;
26
+ transform: rotateZ(180deg);
27
+ }
28
+ }
29
+
30
+ .popup-bg {
31
+ background: rgba(0, 0, 0, 0.9);
32
+ }
33
+
34
+ .popup-box {
35
+ height: 100%;
36
+ overflow: visible;
37
+ background-color: transparent;
38
+ }
39
+ }
40
+ .custom-pop {
41
+ height: 100%;
42
+ background: transparent !important;
43
+ display: flex;
44
+ align-items: center;
45
+ }
46
+ .nut-imagepreview-swiper .nut-swiper-item {
47
+ height: 327px;
48
+ }