@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.
- package/CHANGELOG.md +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { r as
|
|
4
|
-
import { Top } from "@nutui/icons-vue";
|
|
5
|
-
import { _ as
|
|
1
|
+
import { reactive as k, computed as u, onMounted as b, onUnmounted as y, onActivated as w, onDeactivated as x, resolveComponent as A, openBlock as I, createElementBlock as g, normalizeClass as h, normalizeStyle as z, withModifiers as L, renderSlot as N, createVNode as $ } from "vue";
|
|
2
|
+
import { c as C } from "./component-234624bc.js";
|
|
3
|
+
import { r as p, c as B } from "./raf-a74f1a06.js";
|
|
4
|
+
import { Top as _ } from "@nutui/icons-vue";
|
|
5
|
+
import { _ as D } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "../locale/lang";
|
|
7
|
-
const { componentName, create } =
|
|
8
|
-
const _sfc_main = create({
|
|
7
|
+
const { componentName: M, create: S } = C("backtop"), W = S({
|
|
9
8
|
components: {
|
|
10
|
-
Top
|
|
9
|
+
Top: _
|
|
11
10
|
},
|
|
12
11
|
props: {
|
|
13
12
|
bottom: {
|
|
@@ -32,7 +31,7 @@ const _sfc_main = create({
|
|
|
32
31
|
},
|
|
33
32
|
isAnimation: {
|
|
34
33
|
type: Boolean,
|
|
35
|
-
default:
|
|
34
|
+
default: !0
|
|
36
35
|
},
|
|
37
36
|
duration: {
|
|
38
37
|
type: Number,
|
|
@@ -40,109 +39,70 @@ const _sfc_main = create({
|
|
|
40
39
|
}
|
|
41
40
|
},
|
|
42
41
|
emits: ["click"],
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
backTop:
|
|
42
|
+
setup(t, { emit: n }) {
|
|
43
|
+
const e = k({
|
|
44
|
+
backTop: !1,
|
|
46
45
|
scrollTop: 0,
|
|
47
46
|
scrollEl: window,
|
|
48
47
|
startTime: 0,
|
|
49
|
-
keepAlive:
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
right: `${props.right}px`,
|
|
61
|
-
bottom: `${props.bottom}px`,
|
|
62
|
-
zIndex: props.zIndex
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
function scrollListener() {
|
|
66
|
-
if (state.scrollEl instanceof Window) {
|
|
67
|
-
state.scrollTop = state.scrollEl.pageYOffset;
|
|
68
|
-
} else {
|
|
69
|
-
state.scrollTop = state.scrollEl.scrollTop;
|
|
70
|
-
}
|
|
71
|
-
state.backTop = state.scrollTop >= props.distance;
|
|
48
|
+
keepAlive: !1
|
|
49
|
+
}), s = u(() => ({
|
|
50
|
+
[M]: !0,
|
|
51
|
+
show: e.backTop
|
|
52
|
+
})), c = u(() => ({
|
|
53
|
+
right: `${t.right}px`,
|
|
54
|
+
bottom: `${t.bottom}px`,
|
|
55
|
+
zIndex: t.zIndex
|
|
56
|
+
}));
|
|
57
|
+
function l() {
|
|
58
|
+
e.scrollEl instanceof Window ? e.scrollTop = e.scrollEl.pageYOffset : e.scrollTop = e.scrollEl.scrollTop, e.backTop = e.scrollTop >= t.distance;
|
|
72
59
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
window.scrollTo(0, y);
|
|
76
|
-
} else {
|
|
77
|
-
state.scrollEl.scrollTop = y;
|
|
78
|
-
}
|
|
60
|
+
function i(o = 0) {
|
|
61
|
+
e.scrollEl instanceof Window ? window.scrollTo(0, o) : e.scrollEl.scrollTop = o;
|
|
79
62
|
}
|
|
80
|
-
function
|
|
81
|
-
let
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
scroll(y);
|
|
85
|
-
cid = requestAniFrame(fn);
|
|
86
|
-
if (t == props.duration || y == 0) {
|
|
87
|
-
cancelRaf(cid);
|
|
88
|
-
}
|
|
63
|
+
function r() {
|
|
64
|
+
let o = p(function T() {
|
|
65
|
+
var f = t.duration - Math.max(0, e.startTime - +/* @__PURE__ */ new Date() + t.duration), m = f * -e.scrollTop / t.duration + e.scrollTop;
|
|
66
|
+
i(m), o = p(T), (f == t.duration || m == 0) && B(o);
|
|
89
67
|
});
|
|
90
68
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
state.scrollEl.addEventListener("resize", scrollListener, false);
|
|
69
|
+
function v() {
|
|
70
|
+
e.scrollEl.addEventListener("scroll", l, !1), e.scrollEl.addEventListener("resize", l, !1);
|
|
94
71
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
state.scrollEl.removeEventListener("resize", scrollListener, false);
|
|
72
|
+
function a() {
|
|
73
|
+
e.scrollEl.removeEventListener("scroll", l, !1), e.scrollEl.removeEventListener("resize", l, !1);
|
|
98
74
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
|
|
102
|
-
emit("click", e);
|
|
75
|
+
function E(o) {
|
|
76
|
+
e.startTime = +/* @__PURE__ */ new Date(), t.isAnimation && t.duration > 0 ? r() : i(), n("click", o);
|
|
103
77
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
state.scrollEl = document.getElementById(props.elId);
|
|
107
|
-
}
|
|
108
|
-
addEventListener();
|
|
78
|
+
function d() {
|
|
79
|
+
t.elId && document.getElementById(t.elId) && (e.scrollEl = document.getElementById(t.elId)), v();
|
|
109
80
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
onDeactivated(() => {
|
|
126
|
-
state.keepAlive = true;
|
|
127
|
-
removeEventListener();
|
|
128
|
-
});
|
|
129
|
-
return {
|
|
130
|
-
state,
|
|
131
|
-
classes,
|
|
132
|
-
style,
|
|
133
|
-
click
|
|
81
|
+
return b(() => {
|
|
82
|
+
t.distance == 0 && (e.backTop = !0), d();
|
|
83
|
+
}), y(() => {
|
|
84
|
+
a();
|
|
85
|
+
}), w(() => {
|
|
86
|
+
e.keepAlive && (e.keepAlive = !1, d());
|
|
87
|
+
}), x(() => {
|
|
88
|
+
e.keepAlive = !0, a();
|
|
89
|
+
}), {
|
|
90
|
+
state: e,
|
|
91
|
+
classes: s,
|
|
92
|
+
style: c,
|
|
93
|
+
click: E
|
|
134
94
|
};
|
|
135
95
|
}
|
|
136
96
|
});
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
class:
|
|
141
|
-
style:
|
|
142
|
-
onClick:
|
|
97
|
+
function q(t, n, e, s, c, l) {
|
|
98
|
+
const i = A("Top");
|
|
99
|
+
return I(), g("div", {
|
|
100
|
+
class: h(t.classes),
|
|
101
|
+
style: z(t.style),
|
|
102
|
+
onClick: n[0] || (n[0] = L((...r) => t.click && t.click(...r), ["stop"]))
|
|
143
103
|
}, [
|
|
144
|
-
|
|
145
|
-
|
|
104
|
+
N(t.$slots, "default", {}, () => [
|
|
105
|
+
$(i, {
|
|
146
106
|
width: "19px",
|
|
147
107
|
height: "19px",
|
|
148
108
|
class: "nut-backtop-main"
|
|
@@ -150,7 +110,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
150
110
|
])
|
|
151
111
|
], 6);
|
|
152
112
|
}
|
|
153
|
-
const
|
|
113
|
+
const j = /* @__PURE__ */ D(W, [["render", q]]);
|
|
154
114
|
export {
|
|
155
|
-
|
|
115
|
+
j as default
|
|
156
116
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { reactive, computed, openBlock, createElementBlock, withDirectives, createElementVNode, normalizeStyle, renderSlot, vShow, toDisplayString, normalizeClass } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { reactive as f, computed as r, openBlock as b, createElementBlock as m, withDirectives as d, createElementVNode as s, normalizeStyle as u, renderSlot as i, vShow as c, toDisplayString as p, normalizeClass as g } from "vue";
|
|
2
|
+
import { c as y } from "./component-234624bc.js";
|
|
3
|
+
import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
|
-
const { create } =
|
|
6
|
-
const _sfc_main = create({
|
|
5
|
+
const { create: $ } = y("badge"), v = $({
|
|
7
6
|
props: {
|
|
8
7
|
value: {
|
|
9
8
|
type: [String, Number]
|
|
@@ -14,15 +13,15 @@ const _sfc_main = create({
|
|
|
14
13
|
},
|
|
15
14
|
dot: {
|
|
16
15
|
type: Boolean,
|
|
17
|
-
default:
|
|
16
|
+
default: !1
|
|
18
17
|
},
|
|
19
18
|
bubble: {
|
|
20
19
|
type: Boolean,
|
|
21
|
-
default:
|
|
20
|
+
default: !1
|
|
22
21
|
},
|
|
23
22
|
hidden: {
|
|
24
23
|
type: Boolean,
|
|
25
|
-
default:
|
|
24
|
+
default: !1
|
|
26
25
|
},
|
|
27
26
|
top: {
|
|
28
27
|
type: String,
|
|
@@ -41,56 +40,46 @@ const _sfc_main = create({
|
|
|
41
40
|
default: ""
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
const content = computed(() => {
|
|
55
|
-
if (props.dot)
|
|
43
|
+
setup(e) {
|
|
44
|
+
const o = f({}), a = r(() => ({
|
|
45
|
+
top: `${e.top}px`,
|
|
46
|
+
right: `${e.right}px`,
|
|
47
|
+
zIndex: e.zIndex,
|
|
48
|
+
background: e.color
|
|
49
|
+
})), l = r(() => {
|
|
50
|
+
if (e.dot)
|
|
56
51
|
return;
|
|
57
|
-
const value =
|
|
58
|
-
|
|
59
|
-
if (typeof value === "number" && typeof max === "number") {
|
|
60
|
-
return max < value ? `${max}+` : value;
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
52
|
+
const t = e.value, n = e.max;
|
|
53
|
+
return typeof t == "number" && typeof n == "number" && n < t ? `${n}+` : t;
|
|
63
54
|
});
|
|
64
55
|
return {
|
|
65
|
-
state,
|
|
66
|
-
stl,
|
|
67
|
-
content
|
|
56
|
+
state: o,
|
|
57
|
+
stl: a,
|
|
58
|
+
content: l
|
|
68
59
|
};
|
|
69
60
|
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
75
|
-
withDirectives(createElementVNode("view", {
|
|
61
|
+
}), _ = { class: "nut-badge" }, S = ["textContent"];
|
|
62
|
+
function B(e, o, a, l, t, n) {
|
|
63
|
+
return b(), m("view", _, [
|
|
64
|
+
d(s("view", {
|
|
76
65
|
class: "nut-badge__icon",
|
|
77
|
-
style:
|
|
66
|
+
style: u(e.stl)
|
|
78
67
|
}, [
|
|
79
|
-
|
|
68
|
+
i(e.$slots, "icon")
|
|
80
69
|
], 4), [
|
|
81
|
-
[
|
|
70
|
+
[c, !e.hidden && !e.dot && e.$slots.icon]
|
|
82
71
|
]),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
textContent:
|
|
86
|
-
class:
|
|
87
|
-
style:
|
|
88
|
-
}, null, 14,
|
|
89
|
-
[
|
|
72
|
+
i(e.$slots, "default"),
|
|
73
|
+
d(s("view", {
|
|
74
|
+
textContent: p(e.content),
|
|
75
|
+
class: g(["nut-badge__content nut-badge__content--sup", { "nut-badge__content--dot": e.dot, "nut-badge__content--bubble": !e.dot && e.bubble }]),
|
|
76
|
+
style: u(e.stl)
|
|
77
|
+
}, null, 14, S), [
|
|
78
|
+
[c, !e.hidden && (e.content || e.dot)]
|
|
90
79
|
])
|
|
91
80
|
]);
|
|
92
81
|
}
|
|
93
|
-
const
|
|
82
|
+
const k = /* @__PURE__ */ h(v, [["render", B]]);
|
|
94
83
|
export {
|
|
95
|
-
|
|
84
|
+
k as default
|
|
96
85
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { useSlots, computed, ref, onMounted, onUnmounted, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createCommentVNode } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { useSlots as w, computed as S, ref as s, onMounted as k, onUnmounted as D, watch as W, nextTick as q, openBlock as E, createElementBlock as _, normalizeClass as p, createElementVNode as A, renderSlot as H, createCommentVNode as M } from "vue";
|
|
2
|
+
import { c as V } from "./component-234624bc.js";
|
|
3
|
+
import { _ as j } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
|
-
const { componentName, create } =
|
|
6
|
-
const _sfc_main = create({
|
|
5
|
+
const { componentName: z, create: P } = V("barrage"), U = P({
|
|
7
6
|
name: "barrage",
|
|
8
7
|
props: {
|
|
9
8
|
danmu: {
|
|
@@ -28,168 +27,90 @@ const _sfc_main = create({
|
|
|
28
27
|
},
|
|
29
28
|
loop: {
|
|
30
29
|
type: Boolean,
|
|
31
|
-
default:
|
|
30
|
+
default: !0
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const danmuList = ref(props.danmu);
|
|
47
|
-
const rows = ref(props.rows);
|
|
48
|
-
const top = ref(props.top);
|
|
49
|
-
const index2 = ref(0);
|
|
50
|
-
const speeds = props.speeds;
|
|
51
|
-
const danmuCWidth = ref(0);
|
|
52
|
-
onMounted(() => {
|
|
53
|
-
init();
|
|
54
|
-
if (slotDefault) {
|
|
55
|
-
document.addEventListener("visibilitychange", function() {
|
|
56
|
-
if (document.visibilityState === "hidden") {
|
|
57
|
-
clearTime();
|
|
58
|
-
index2.value = 0;
|
|
59
|
-
eleSlot("hidden");
|
|
60
|
-
} else if (document.visibilityState === "visible") {
|
|
61
|
-
init();
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
onUnmounted(() => {
|
|
67
|
-
danmuList.value = [];
|
|
68
|
-
clearTime();
|
|
33
|
+
setup(t) {
|
|
34
|
+
const v = (/* @__PURE__ */ new Date()).getTime(), o = !!w().default, h = S(() => ({
|
|
35
|
+
[z]: !0
|
|
36
|
+
}));
|
|
37
|
+
let c = s(document.createElement("div")), r = s(document.createElement("div")), m = null;
|
|
38
|
+
const a = s(t.danmu), B = s(t.rows), T = s(t.top), l = s(0), $ = t.speeds, g = s(0);
|
|
39
|
+
k(() => {
|
|
40
|
+
b(), o && document.addEventListener("visibilitychange", function() {
|
|
41
|
+
document.visibilityState === "hidden" ? (y(), l.value = 0, C("hidden")) : document.visibilityState === "visible" && b();
|
|
42
|
+
});
|
|
43
|
+
}), D(() => {
|
|
44
|
+
a.value = [], y();
|
|
69
45
|
});
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
var _a;
|
|
77
|
-
(_a = dmBody.value) == null ? void 0 : _a.style.setProperty("--move-distance", `-${danmuCWidth.value}px`);
|
|
78
|
-
run();
|
|
46
|
+
const b = () => {
|
|
47
|
+
g.value = c.value.offsetWidth, o && C("init"), setTimeout(() => {
|
|
48
|
+
var n;
|
|
49
|
+
(n = c.value) == null || n.style.setProperty("--move-distance", `-${g.value}px`), L();
|
|
79
50
|
}, 300);
|
|
51
|
+
}, C = (n) => {
|
|
52
|
+
var d;
|
|
53
|
+
const e = document.getElementsByClassName("slotBody" + v);
|
|
54
|
+
let u = ((d = e == null ? void 0 : e[0]) == null ? void 0 : d.children) || [];
|
|
55
|
+
const f = [];
|
|
56
|
+
u && Array.from(u).forEach((i) => {
|
|
57
|
+
n == "init" ? (i.style.opacity = "0", f.push(i)) : (i.classList = "", i.style = {});
|
|
58
|
+
}), n == "init" && (a.value = f);
|
|
59
|
+
}, y = () => {
|
|
60
|
+
m && (clearTimeout(m), m = null);
|
|
80
61
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const dmList = [];
|
|
86
|
-
if (childrens) {
|
|
87
|
-
Array.from(childrens).forEach((item) => {
|
|
88
|
-
if (flag == "init") {
|
|
89
|
-
item.style.opacity = "0";
|
|
90
|
-
dmList.push(item);
|
|
91
|
-
} else {
|
|
92
|
-
item.classList = "";
|
|
93
|
-
item.style = {};
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (flag == "init") {
|
|
98
|
-
danmuList.value = dmList;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const clearTime = () => {
|
|
102
|
-
if (timer) {
|
|
103
|
-
clearTimeout(timer);
|
|
104
|
-
timer = null;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
watch(
|
|
108
|
-
() => props.danmu,
|
|
109
|
-
(newValue) => {
|
|
110
|
-
if (props.danmu.length > 0) {
|
|
111
|
-
danmuList.value = [...newValue];
|
|
112
|
-
}
|
|
62
|
+
W(
|
|
63
|
+
() => t.danmu,
|
|
64
|
+
(n) => {
|
|
65
|
+
t.danmu.length > 0 && (a.value = [...n]);
|
|
113
66
|
}
|
|
114
67
|
);
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
let el = document.createElement(`view`);
|
|
133
|
-
if (slotDefault && typeof danmuList.value[_index] == "object") {
|
|
134
|
-
el = danmuList.value[_index];
|
|
135
|
-
(_a = el == null ? void 0 : el.classList) == null ? void 0 : _a.add("nut-barrage__item");
|
|
136
|
-
} else {
|
|
137
|
-
el.innerHTML = danmuList.value[_index];
|
|
138
|
-
el.classList.add("nut-barrage__item");
|
|
139
|
-
dmContainer.value.appendChild(el);
|
|
140
|
-
}
|
|
141
|
-
nextTick(() => {
|
|
142
|
-
var _a2;
|
|
143
|
-
const height = el.offsetHeight;
|
|
144
|
-
(_a2 = el == null ? void 0 : el.classList) == null ? void 0 : _a2.add("move");
|
|
145
|
-
el.style.animationDuration = `${speeds}ms`;
|
|
146
|
-
el.style.top = _index % rows.value * (height + top.value) + 20 + "px";
|
|
147
|
-
el.style.opacity = "1";
|
|
148
|
-
if (!slotDefault) {
|
|
149
|
-
const width = el.offsetWidth;
|
|
150
|
-
el.style.width = width + 20 + "px";
|
|
151
|
-
}
|
|
152
|
-
el.addEventListener("animationend", () => {
|
|
153
|
-
if (slotDefault) {
|
|
154
|
-
el.classList.remove("move");
|
|
155
|
-
} else {
|
|
156
|
-
dmContainer.value.removeChild(el);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
if (!props.loop && index2.value >= danmuList.value.length - 1) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
index2.value++;
|
|
163
|
-
if (index2.value >= danmuList.value.length) {
|
|
164
|
-
index2.value = 0;
|
|
68
|
+
const x = (n) => {
|
|
69
|
+
const e = l.value % a.value.length;
|
|
70
|
+
!t.loop && l.value === a.value.length ? a.value.splice(a.value.length, 0, n) : a.value.splice(e, 0, n);
|
|
71
|
+
}, L = () => {
|
|
72
|
+
y(), m = setTimeout(() => {
|
|
73
|
+
N();
|
|
74
|
+
}, t.frequency);
|
|
75
|
+
}, N = () => {
|
|
76
|
+
var u;
|
|
77
|
+
const n = t.loop ? l.value % a.value.length : l.value;
|
|
78
|
+
let e = document.createElement("view");
|
|
79
|
+
o && typeof a.value[n] == "object" ? (e = a.value[n], (u = e == null ? void 0 : e.classList) == null || u.add("nut-barrage__item")) : (e.innerHTML = a.value[n], e.classList.add("nut-barrage__item"), r.value.appendChild(e)), q(() => {
|
|
80
|
+
var d;
|
|
81
|
+
const f = e.offsetHeight;
|
|
82
|
+
if ((d = e == null ? void 0 : e.classList) == null || d.add("move"), e.style.animationDuration = `${$}ms`, e.style.top = n % B.value * (f + T.value) + 20 + "px", e.style.opacity = "1", !o) {
|
|
83
|
+
const i = e.offsetWidth;
|
|
84
|
+
e.style.width = i + 20 + "px";
|
|
165
85
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
86
|
+
e.addEventListener("animationend", () => {
|
|
87
|
+
o ? e.classList.remove("move") : r.value.removeChild(e);
|
|
88
|
+
}), !(!t.loop && l.value >= a.value.length - 1) && (l.value++, l.value >= a.value.length && (l.value = 0), e.removeEventListener("animationend", () => {
|
|
89
|
+
}), L());
|
|
169
90
|
});
|
|
170
91
|
};
|
|
171
|
-
return { classTime, classes, danmuList, dmBody, dmContainer, add };
|
|
92
|
+
return { classTime: v, classes: h, danmuList: a, dmBody: c, dmContainer: r, add: x };
|
|
172
93
|
}
|
|
173
94
|
});
|
|
174
|
-
function
|
|
175
|
-
return
|
|
95
|
+
function F(t, v, o, h, c, r) {
|
|
96
|
+
return E(), _("div", {
|
|
176
97
|
ref: "dmBody",
|
|
177
|
-
class:
|
|
98
|
+
class: p(t.classes)
|
|
178
99
|
}, [
|
|
179
|
-
|
|
100
|
+
A("div", {
|
|
180
101
|
ref: "dmContainer",
|
|
181
|
-
class:
|
|
102
|
+
class: p(["dmContainer", t.$slots.default && "slotContainer"])
|
|
182
103
|
}, [
|
|
183
|
-
|
|
104
|
+
t.$slots.default ? (E(), _("div", {
|
|
184
105
|
key: 0,
|
|
185
|
-
class:
|
|
106
|
+
class: p(["slotBody", "slotBody" + t.classTime])
|
|
186
107
|
}, [
|
|
187
|
-
|
|
188
|
-
], 2)) :
|
|
108
|
+
H(t.$slots, "default")
|
|
109
|
+
], 2)) : M("", !0)
|
|
189
110
|
], 2)
|
|
190
111
|
], 2);
|
|
191
112
|
}
|
|
192
|
-
const
|
|
113
|
+
const O = /* @__PURE__ */ j(U, [["render", F]]);
|
|
193
114
|
export {
|
|
194
|
-
|
|
115
|
+
O as default
|
|
195
116
|
};
|