@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1
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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,81 +1,387 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { h
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, renderSlot, createBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withModifiers, createVNode, vShow, Fragment, renderList } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
const { componentName, create } = createComponent("noticebar");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
direction: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "across"
|
|
16
|
+
},
|
|
17
|
+
list: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
standTime: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 1e3
|
|
26
|
+
},
|
|
27
|
+
complexAm: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
height: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 40
|
|
34
|
+
},
|
|
35
|
+
text: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
},
|
|
39
|
+
closeMode: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
wrapable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
leftIcon: { type: String, default: "" },
|
|
48
|
+
rightIcon: { type: String, default: "" },
|
|
49
|
+
color: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
background: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
},
|
|
57
|
+
delay: {
|
|
58
|
+
type: [String, Number],
|
|
59
|
+
default: 1
|
|
60
|
+
},
|
|
61
|
+
scrollable: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: null
|
|
64
|
+
},
|
|
65
|
+
speed: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 50
|
|
26
68
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
69
|
+
},
|
|
70
|
+
components: {
|
|
71
|
+
ScrollItem: function(props) {
|
|
72
|
+
props.item.props.style = props.style;
|
|
73
|
+
props.item.key = props.key;
|
|
74
|
+
return h(props.item);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
emits: ["click", "close"],
|
|
78
|
+
setup(props, { emit, slots }) {
|
|
79
|
+
const wrap = ref(null);
|
|
80
|
+
const content = ref(null);
|
|
81
|
+
const state = reactive({
|
|
82
|
+
wrapWidth: 0,
|
|
83
|
+
firstRound: true,
|
|
84
|
+
duration: 0,
|
|
85
|
+
offsetWidth: 0,
|
|
86
|
+
showNoticeBar: true,
|
|
87
|
+
animationClass: "",
|
|
88
|
+
animate: false,
|
|
89
|
+
scrollList: [],
|
|
90
|
+
distance: 0,
|
|
91
|
+
timer: null,
|
|
92
|
+
keepAlive: false,
|
|
93
|
+
isCanScroll: null
|
|
94
|
+
});
|
|
95
|
+
const classes = computed(() => {
|
|
96
|
+
const prefixCls = componentName;
|
|
97
|
+
return {
|
|
98
|
+
[prefixCls]: true
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
const isEllipsis = computed(() => {
|
|
102
|
+
if (state.isCanScroll == null) {
|
|
103
|
+
return props.wrapable;
|
|
104
|
+
} else {
|
|
105
|
+
return !state.isCanScroll && !props.wrapable;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const iconShow = computed(() => {
|
|
109
|
+
if (props.leftIcon == "close") {
|
|
110
|
+
return false;
|
|
111
|
+
} else {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const barStyle = computed(() => {
|
|
116
|
+
let style = {};
|
|
117
|
+
props.color && (style.color = props.color);
|
|
118
|
+
props.background && (style.background = props.background);
|
|
119
|
+
if (props.direction == "vertical") {
|
|
120
|
+
style.height = `${props.height}px`;
|
|
121
|
+
}
|
|
122
|
+
return style;
|
|
123
|
+
});
|
|
124
|
+
const contentStyle = computed(() => {
|
|
125
|
+
return {
|
|
126
|
+
animationDelay: (state.firstRound ? props.delay : 0) + "s",
|
|
127
|
+
animationDuration: state.duration + "s",
|
|
128
|
+
transform: `translateX(${state.firstRound ? 0 : state.wrapWidth + "px"})`
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
const iconBg = computed(() => {
|
|
132
|
+
let iconBg2 = "";
|
|
133
|
+
if (props.leftIcon) {
|
|
134
|
+
iconBg2 = props.leftIcon;
|
|
135
|
+
}
|
|
136
|
+
return iconBg2;
|
|
137
|
+
});
|
|
138
|
+
const horseLampStyle = computed(() => {
|
|
139
|
+
let styles = {};
|
|
140
|
+
if (props.complexAm) {
|
|
141
|
+
styles = {
|
|
142
|
+
transform: `translateY(${state.distance}px)`
|
|
143
|
+
};
|
|
144
|
+
} else {
|
|
145
|
+
if (state.animate) {
|
|
146
|
+
let a = ~~(props.height / props.speed / 4);
|
|
147
|
+
styles = {
|
|
148
|
+
transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
|
|
149
|
+
"margin-top": `-${props.height}px`
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return styles;
|
|
154
|
+
});
|
|
155
|
+
watch(() => props.text, (value) => {
|
|
156
|
+
initScrollWrap();
|
|
157
|
+
});
|
|
158
|
+
watch(() => props.list, (value) => {
|
|
159
|
+
state.scrollList = [].concat(value);
|
|
160
|
+
});
|
|
161
|
+
const initScrollWrap = (value) => {
|
|
162
|
+
if (state.showNoticeBar == false) {
|
|
37
163
|
return;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
164
|
+
}
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
if (!wrap.value || !content.value) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const wrapWidth = wrap.value.getBoundingClientRect().width;
|
|
170
|
+
const offsetWidth = content.value.getBoundingClientRect().width;
|
|
171
|
+
state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
|
|
172
|
+
console.log(111, state.isCanScroll);
|
|
173
|
+
if (state.isCanScroll) {
|
|
174
|
+
state.wrapWidth = wrapWidth;
|
|
175
|
+
state.offsetWidth = offsetWidth;
|
|
176
|
+
state.duration = offsetWidth / props.speed;
|
|
177
|
+
state.animationClass = "play";
|
|
178
|
+
} else {
|
|
179
|
+
state.animationClass = "";
|
|
180
|
+
}
|
|
181
|
+
}, 0);
|
|
182
|
+
};
|
|
183
|
+
const handleClick = (event) => {
|
|
184
|
+
emit("click", event);
|
|
185
|
+
};
|
|
186
|
+
const onClickIcon = (event) => {
|
|
187
|
+
if (props.closeMode) {
|
|
188
|
+
state.showNoticeBar = !props.closeMode;
|
|
189
|
+
}
|
|
190
|
+
emit("close", event);
|
|
191
|
+
};
|
|
192
|
+
const onAnimationEnd = () => {
|
|
193
|
+
state.firstRound = false;
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
|
|
196
|
+
state.animationClass = "play-infinite";
|
|
197
|
+
}, 0);
|
|
198
|
+
};
|
|
199
|
+
const startRollEasy = () => {
|
|
200
|
+
showhorseLamp();
|
|
201
|
+
state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
|
|
202
|
+
};
|
|
203
|
+
const showhorseLamp = () => {
|
|
204
|
+
state.animate = true;
|
|
205
|
+
setTimeout(() => {
|
|
206
|
+
state.scrollList.push(state.scrollList[0]);
|
|
207
|
+
state.scrollList.shift();
|
|
208
|
+
state.animate = false;
|
|
209
|
+
}, ~~(props.height / props.speed / 4 * 1e3));
|
|
210
|
+
};
|
|
211
|
+
const startRoll = () => {
|
|
212
|
+
state.timer = setInterval(() => {
|
|
213
|
+
let chunk = 100;
|
|
214
|
+
for (let i = 0; i < chunk; i++) {
|
|
215
|
+
scroll(i, i < chunk - 1 ? false : true);
|
|
216
|
+
}
|
|
217
|
+
}, props.standTime + 100 * props.speed);
|
|
218
|
+
};
|
|
219
|
+
const scroll = (n, last) => {
|
|
220
|
+
setTimeout(() => {
|
|
221
|
+
state.distance -= props.height / 100;
|
|
222
|
+
if (last) {
|
|
223
|
+
state.scrollList.push(state.scrollList[0]);
|
|
224
|
+
state.scrollList.shift();
|
|
225
|
+
state.distance = 0;
|
|
226
|
+
}
|
|
227
|
+
}, n * props.speed);
|
|
228
|
+
};
|
|
229
|
+
const go = (item) => {
|
|
230
|
+
emit("click", item);
|
|
231
|
+
};
|
|
232
|
+
const handleClickIcon = () => {
|
|
233
|
+
emit("close", state.scrollList[0]);
|
|
234
|
+
};
|
|
235
|
+
onMounted(() => {
|
|
236
|
+
if (props.direction == "vertical") {
|
|
237
|
+
if (slots.default) {
|
|
238
|
+
state.scrollList = [].concat(slots.default()[0].children);
|
|
239
|
+
} else {
|
|
240
|
+
state.scrollList = [].concat(props.list);
|
|
241
|
+
}
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
props.complexAm ? startRoll() : startRollEasy();
|
|
244
|
+
}, props.standTime);
|
|
245
|
+
} else {
|
|
246
|
+
initScrollWrap(props.text);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
onActivated(() => {
|
|
250
|
+
if (state.keepAlive) {
|
|
251
|
+
state.keepAlive = false;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
onDeactivated(() => {
|
|
255
|
+
state.keepAlive = true;
|
|
256
|
+
clearInterval(state.timer);
|
|
257
|
+
});
|
|
258
|
+
onUnmounted(() => {
|
|
259
|
+
clearInterval(state.timer);
|
|
260
|
+
});
|
|
261
|
+
return {
|
|
262
|
+
...toRefs(props),
|
|
263
|
+
...toRefs(state),
|
|
264
|
+
isEllipsis,
|
|
265
|
+
classes,
|
|
266
|
+
iconShow,
|
|
267
|
+
barStyle,
|
|
268
|
+
contentStyle,
|
|
269
|
+
iconBg,
|
|
270
|
+
horseLampStyle,
|
|
271
|
+
wrap,
|
|
272
|
+
content,
|
|
273
|
+
handleClick,
|
|
274
|
+
onClickIcon,
|
|
275
|
+
onAnimationEnd,
|
|
276
|
+
go,
|
|
277
|
+
handleClickIcon,
|
|
278
|
+
slots
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
const _hoisted_1 = {
|
|
283
|
+
ref: "wrap",
|
|
284
|
+
class: "wrap"
|
|
285
|
+
};
|
|
286
|
+
const _hoisted_2 = ["onClick"];
|
|
287
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
288
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
289
|
+
const _component_ScrollItem = resolveComponent("ScrollItem");
|
|
290
|
+
return openBlock(), createElementBlock("view", {
|
|
291
|
+
class: normalizeClass(_ctx.classes)
|
|
292
|
+
}, [
|
|
293
|
+
_ctx.direction == "across" ? withDirectives((openBlock(), createElementBlock("view", {
|
|
294
|
+
key: 0,
|
|
295
|
+
class: normalizeClass(["nut-noticebar-page", { withicon: _ctx.closeMode, close: _ctx.closeMode, wrapable: _ctx.wrapable }]),
|
|
296
|
+
style: normalizeStyle(_ctx.barStyle),
|
|
297
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
298
|
+
}, [
|
|
299
|
+
_ctx.iconShow ? (openBlock(), createElementBlock("view", {
|
|
300
|
+
key: 0,
|
|
301
|
+
class: "left-icon",
|
|
302
|
+
style: normalizeStyle({ "background-image": `url(${_ctx.iconBg})` })
|
|
303
|
+
}, [
|
|
304
|
+
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
305
|
+
!_ctx.iconBg ? (openBlock(), createBlock(_component_nut_icon, {
|
|
306
|
+
key: 0,
|
|
307
|
+
name: "notice",
|
|
308
|
+
size: "16",
|
|
309
|
+
color: _ctx.color
|
|
310
|
+
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
311
|
+
])
|
|
312
|
+
], 4)) : createCommentVNode("", true),
|
|
313
|
+
createElementVNode("view", _hoisted_1, [
|
|
314
|
+
createElementVNode("view", {
|
|
315
|
+
ref: "content",
|
|
316
|
+
class: normalizeClass(["content", _ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }]),
|
|
317
|
+
style: normalizeStyle(_ctx.contentStyle),
|
|
318
|
+
onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
|
|
319
|
+
onWebkitAnimationEnd: _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
|
|
320
|
+
}, [
|
|
321
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
322
|
+
createTextVNode(toDisplayString(_ctx.text), 1)
|
|
323
|
+
])
|
|
324
|
+
], 38)
|
|
325
|
+
], 512),
|
|
326
|
+
_ctx.closeMode || _ctx.rightIcon ? (openBlock(), createElementBlock("view", {
|
|
327
|
+
key: 1,
|
|
328
|
+
class: "right-icon",
|
|
329
|
+
onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.onClickIcon && _ctx.onClickIcon(...args), ["stop"]))
|
|
330
|
+
}, [
|
|
331
|
+
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
332
|
+
createVNode(_component_nut_icon, {
|
|
333
|
+
name: _ctx.rightIcon ? _ctx.rightIcon : "close",
|
|
334
|
+
color: _ctx.color
|
|
335
|
+
}, null, 8, ["name", "color"])
|
|
336
|
+
])
|
|
337
|
+
])) : createCommentVNode("", true)
|
|
338
|
+
], 6)), [
|
|
339
|
+
[vShow, _ctx.showNoticeBar]
|
|
340
|
+
]) : createCommentVNode("", true),
|
|
341
|
+
_ctx.scrollList.length > 0 && _ctx.direction == "vertical" ? (openBlock(), createElementBlock("view", {
|
|
342
|
+
key: 1,
|
|
343
|
+
class: "nut-noticebar-vertical",
|
|
344
|
+
style: normalizeStyle(_ctx.barStyle)
|
|
345
|
+
}, [
|
|
346
|
+
_ctx.slots.default ? (openBlock(), createElementBlock("view", {
|
|
347
|
+
key: 0,
|
|
348
|
+
class: "horseLamp_list",
|
|
349
|
+
style: normalizeStyle(_ctx.horseLampStyle)
|
|
350
|
+
}, [
|
|
351
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
|
|
352
|
+
return openBlock(), createBlock(_component_ScrollItem, {
|
|
353
|
+
key: index2,
|
|
354
|
+
style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
|
|
355
|
+
item
|
|
356
|
+
}, null, 8, ["style", "item"]);
|
|
357
|
+
}), 128))
|
|
358
|
+
], 4)) : (openBlock(), createElementBlock("ul", {
|
|
359
|
+
key: 1,
|
|
360
|
+
class: "horseLamp_list",
|
|
361
|
+
style: normalizeStyle(_ctx.horseLampStyle)
|
|
362
|
+
}, [
|
|
363
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
|
|
364
|
+
return openBlock(), createElementBlock("li", {
|
|
365
|
+
class: "horseLamp_list_item",
|
|
366
|
+
key: index2,
|
|
367
|
+
style: normalizeStyle({ height: _ctx.height }),
|
|
368
|
+
onClick: ($event) => _ctx.go(item)
|
|
369
|
+
}, toDisplayString(item), 13, _hoisted_2);
|
|
370
|
+
}), 128))
|
|
371
|
+
], 4)),
|
|
372
|
+
createElementVNode("view", {
|
|
373
|
+
class: "go",
|
|
374
|
+
onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
|
|
375
|
+
}, [
|
|
376
|
+
_ctx.slots.rightIcon ? renderSlot(_ctx.$slots, "rightIcon", { key: 0 }) : _ctx.closeMode ? (openBlock(), createBlock(_component_nut_icon, {
|
|
377
|
+
key: 1,
|
|
378
|
+
type: "cross",
|
|
379
|
+
color: _ctx.color,
|
|
380
|
+
size: "11px"
|
|
381
|
+
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
382
|
+
])
|
|
383
|
+
], 4)) : createCommentVNode("", true)
|
|
384
|
+
], 2);
|
|
385
|
+
}
|
|
386
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
387
|
+
export { index as default };
|