@nutui/nutui 4.0.12-beta.1 → 4.0.12

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 (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +1 -1
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +50 -50
  135. package/dist/styles/themes/jdb.scss +50 -50
  136. package/dist/styles/themes/jddkh.scss +50 -50
  137. package/dist/styles/themes/jdt.scss +50 -50
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +2 -2
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,22 +1,30 @@
1
- var J = Object.defineProperty, K = Object.defineProperties;
2
- var P = Object.getOwnPropertyDescriptors;
3
- var T = Object.getOwnPropertySymbols;
4
- var Q = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable;
5
- var B = (e, l, i) => l in e ? J(e, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[l] = i, S = (e, l) => {
6
- for (var i in l || (l = {}))
7
- Q.call(l, i) && B(e, i, l[i]);
8
- if (T)
9
- for (var i of T(l))
10
- Z.call(l, i) && B(e, i, l[i]);
11
- return e;
12
- }, E = (e, l) => K(e, P(l));
13
- import { h as _, ref as W, reactive as x, computed as d, watch as R, onMounted as ee, onActivated as te, onDeactivated as le, onUnmounted as ne, toRefs as D, resolveComponent as p, openBlock as a, createElementBlock as r, normalizeClass as N, withDirectives as ie, normalizeStyle as c, createElementVNode as u, renderSlot as h, createBlock as b, createCommentVNode as y, createTextVNode as oe, toDisplayString as z, withModifiers as se, vShow as ae, Fragment as L, renderList as V } from "vue";
14
- import { Notice as re, CircleClose as ce } from "@nutui/icons-vue";
15
- import { c as ue } from "./component-234624bc.js";
16
- import { p as de } from "./pxCheck-38173291.js";
17
- import { _ as me } from "./_plugin-vue_export-helper-dad06003.js";
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 { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, createElementVNode, renderSlot, createBlock, createCommentVNode, createTextVNode, toDisplayString, withModifiers, vShow, Fragment, renderList } from "vue";
21
+ import { Notice, CircleClose } from "@nutui/icons-vue";
22
+ import { c as createComponent } from "./component-81a4c1d0.js";
23
+ import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
24
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
18
25
  import "../locale/lang";
19
- const { componentName: fe, create: he } = ue("noticebar"), ye = he({
26
+ const { componentName, create } = createComponent("noticebar");
27
+ const _sfc_main = create({
20
28
  props: {
21
29
  // 滚动方向 across 横向 vertical 纵向
22
30
  direction: {
@@ -25,7 +33,9 @@ const { componentName: fe, create: he } = ue("noticebar"), ye = he({
25
33
  },
26
34
  list: {
27
35
  type: Array,
28
- default: () => []
36
+ default: () => {
37
+ return [];
38
+ }
29
39
  },
30
40
  standTime: {
31
41
  type: Number,
@@ -33,7 +43,7 @@ const { componentName: fe, create: he } = ue("noticebar"), ye = he({
33
43
  },
34
44
  complexAm: {
35
45
  type: Boolean,
36
- default: !1
46
+ default: false
37
47
  },
38
48
  height: {
39
49
  type: Number,
@@ -45,13 +55,13 @@ const { componentName: fe, create: he } = ue("noticebar"), ye = he({
45
55
  },
46
56
  closeMode: {
47
57
  type: Boolean,
48
- default: !1
58
+ default: false
49
59
  },
50
60
  wrapable: {
51
61
  type: Boolean,
52
- default: !1
62
+ default: false
53
63
  },
54
- leftIcon: { type: Boolean, default: !0 },
64
+ leftIcon: { type: Boolean, default: true },
55
65
  color: {
56
66
  type: String,
57
67
  default: ""
@@ -74,247 +84,352 @@ const { componentName: fe, create: he } = ue("noticebar"), ye = he({
74
84
  }
75
85
  },
76
86
  components: {
77
- ScrollItem: function(e) {
78
- return e.item.props.style = e.style, e.item.key = e.key, _(e.item);
87
+ ScrollItem: function(props) {
88
+ props.item.props.style = props.style;
89
+ props.item.key = props.key;
90
+ return h(props.item);
79
91
  },
80
- Notice: re,
81
- CircleClose: ce
92
+ Notice,
93
+ CircleClose
82
94
  },
83
95
  emits: ["click", "close", "across-end"],
84
- setup(e, { emit: l, slots: i }) {
85
- const g = W(null), w = W(null), t = x({
96
+ setup(props, { emit, slots }) {
97
+ const wrap = ref(null);
98
+ const content = ref(null);
99
+ const state = reactive({
86
100
  wrapWidth: 0,
87
- firstRound: !0,
101
+ firstRound: true,
88
102
  duration: 0,
89
103
  offsetWidth: 0,
90
- showNoticebar: !0,
104
+ showNoticebar: true,
91
105
  animationClass: "",
92
- animate: !1,
106
+ animate: false,
93
107
  scrollList: [],
94
108
  distance: 0,
95
109
  timer: null,
96
- keepAlive: !1,
110
+ keepAlive: false,
97
111
  isCanScroll: null,
98
- showNotica: !0
99
- }), k = d(() => ({
100
- [fe]: !0
101
- })), m = d(() => t.isCanScroll == null ? e.wrapable : !t.isCanScroll && !e.wrapable), v = d(() => ({
102
- "nut-noticebar__page-wrap-content": !0,
103
- "nut-ellipsis": m.value,
104
- [t.animationClass]: !0
105
- })), o = d(() => {
106
- let n = {};
107
- return e.color && (n.color = e.color), e.background && (n.background = e.background), e.direction == "vertical" && (n.height = `${e.height}px`), n;
108
- }), f = d(() => ({
109
- animationDelay: (t.firstRound ? e.delay : 0) + "s",
110
- animationDuration: t.duration + "s",
111
- transform: `translateX(${t.firstRound ? 0 : t.wrapWidth + "px"})`
112
- })), $ = d(() => {
113
- let n = {};
114
- if (e.complexAm)
115
- n = {
116
- transform: `translateY(${t.distance}px)`
117
- };
118
- else if (t.animate) {
119
- let s = ~~(e.height / e.speed / 4);
120
- n = {
121
- transition: `all ${s == 0 ? ~~(e.height / e.speed) : s}s`,
122
- "margin-top": `-${e.height}px`
112
+ showNotica: true
113
+ });
114
+ const classes = computed(() => {
115
+ const prefixCls = componentName;
116
+ return {
117
+ [prefixCls]: true
118
+ };
119
+ });
120
+ const isEllipsis = computed(() => {
121
+ if (state.isCanScroll == null) {
122
+ return props.wrapable;
123
+ } else {
124
+ return !state.isCanScroll && !props.wrapable;
125
+ }
126
+ });
127
+ const wrapContentClass = computed(() => {
128
+ return {
129
+ "nut-noticebar__page-wrap-content": true,
130
+ "nut-ellipsis": isEllipsis.value,
131
+ [state.animationClass]: true
132
+ };
133
+ });
134
+ const barStyle = computed(() => {
135
+ let style = {};
136
+ props.color && (style.color = props.color);
137
+ props.background && (style.background = props.background);
138
+ if (props.direction == "vertical") {
139
+ style.height = `${props.height}px`;
140
+ }
141
+ return style;
142
+ });
143
+ const contentStyle = computed(() => {
144
+ return {
145
+ animationDelay: (state.firstRound ? props.delay : 0) + "s",
146
+ animationDuration: state.duration + "s",
147
+ transform: `translateX(${state.firstRound ? 0 : state.wrapWidth + "px"})`
148
+ };
149
+ });
150
+ const horseLampStyle = computed(() => {
151
+ let styles = {};
152
+ if (props.complexAm) {
153
+ styles = {
154
+ transform: `translateY(${state.distance}px)`
123
155
  };
156
+ } else {
157
+ if (state.animate) {
158
+ let a = ~~(props.height / props.speed / 4);
159
+ styles = {
160
+ transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
161
+ "margin-top": `-${props.height}px`
162
+ };
163
+ }
124
164
  }
125
- return n;
165
+ return styles;
126
166
  });
127
- R(
128
- () => e.text,
129
- (n) => {
130
- A();
167
+ watch(
168
+ () => props.text,
169
+ (value) => {
170
+ initScrollWrap();
131
171
  }
132
- ), R(
133
- () => e.list,
134
- (n) => {
135
- t.scrollList = [].concat(n);
172
+ );
173
+ watch(
174
+ () => props.list,
175
+ (value) => {
176
+ state.scrollList = [].concat(value);
136
177
  }
137
178
  );
138
- const A = (n) => {
139
- t.showNoticebar != !1 && setTimeout(() => {
140
- if (!g.value || !w.value)
179
+ const initScrollWrap = (value) => {
180
+ if (state.showNoticebar == false) {
181
+ return;
182
+ }
183
+ setTimeout(() => {
184
+ if (!wrap.value || !content.value) {
141
185
  return;
142
- const s = g.value.getBoundingClientRect().width, C = w.value.getBoundingClientRect().width;
143
- t.isCanScroll = e.scrollable == null ? C > s : e.scrollable, t.isCanScroll ? (t.wrapWidth = s, t.offsetWidth = C, t.duration = C / e.speed, t.animationClass = "play") : t.animationClass = "";
186
+ }
187
+ const wrapWidth = wrap.value.getBoundingClientRect().width;
188
+ const offsetWidth = content.value.getBoundingClientRect().width;
189
+ state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
190
+ if (state.isCanScroll) {
191
+ state.wrapWidth = wrapWidth;
192
+ state.offsetWidth = offsetWidth;
193
+ state.duration = offsetWidth / props.speed;
194
+ state.animationClass = "play";
195
+ } else {
196
+ state.animationClass = "";
197
+ }
144
198
  }, 0);
145
- }, F = (n) => {
146
- l("click", n);
147
- }, H = (n) => {
148
- e.closeMode && (t.showNoticebar = !e.closeMode), l("close", n);
149
- }, O = (n) => {
150
- t.firstRound = !1, l("across-end", n), setTimeout(() => {
151
- t.duration = (t.offsetWidth + t.wrapWidth) / e.speed, t.animationClass = "play-infinite";
199
+ };
200
+ const handleClick = (event) => {
201
+ emit("click", event);
202
+ };
203
+ const onClickIcon = (event) => {
204
+ if (props.closeMode) {
205
+ state.showNoticebar = !props.closeMode;
206
+ }
207
+ emit("close", event);
208
+ };
209
+ const onAnimationEnd = (event) => {
210
+ state.firstRound = false;
211
+ emit("across-end", event);
212
+ setTimeout(() => {
213
+ state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
214
+ state.animationClass = "play-infinite";
152
215
  }, 0);
153
- }, U = () => {
154
- I(), t.timer = setInterval(I, ~~(e.height / e.speed / 4 * 1e3) + e.standTime);
155
- }, I = () => {
156
- t.animate = !0, setTimeout(() => {
157
- t.scrollList.push(t.scrollList[0]), t.scrollList.shift(), t.animate = !1;
158
- }, ~~(e.height / e.speed / 4 * 1e3));
159
- }, X = () => {
160
- t.timer = setInterval(() => {
161
- let n = 100;
162
- for (let s = 0; s < n; s++)
163
- Y(s, !(s < n - 1));
164
- }, e.standTime + 100 * e.speed);
165
- }, Y = (n, s) => {
216
+ };
217
+ const startRollEasy = () => {
218
+ showhorseLamp();
219
+ state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
220
+ };
221
+ const showhorseLamp = () => {
222
+ state.animate = true;
166
223
  setTimeout(() => {
167
- t.distance -= e.height / 100, s && (t.scrollList.push(t.scrollList[0]), t.scrollList.shift(), t.distance = 0);
168
- }, n * e.speed);
169
- }, j = (n) => {
170
- l("click", n);
171
- }, q = () => {
172
- e.closeMode && (t.showNoticebar = !e.closeMode), l("close", t.scrollList[0]);
224
+ state.scrollList.push(state.scrollList[0]);
225
+ state.scrollList.shift();
226
+ state.animate = false;
227
+ }, ~~(props.height / props.speed / 4 * 1e3));
228
+ };
229
+ const startRoll = () => {
230
+ state.timer = setInterval(() => {
231
+ let chunk = 100;
232
+ for (let i = 0; i < chunk; i++) {
233
+ scroll(i, i < chunk - 1 ? false : true);
234
+ }
235
+ }, props.standTime + 100 * props.speed);
236
+ };
237
+ const scroll = (n, last) => {
238
+ setTimeout(() => {
239
+ state.distance -= props.height / 100;
240
+ if (last) {
241
+ state.scrollList.push(state.scrollList[0]);
242
+ state.scrollList.shift();
243
+ state.distance = 0;
244
+ }
245
+ }, n * props.speed);
246
+ };
247
+ const go = (item) => {
248
+ emit("click", item);
249
+ };
250
+ const handleClickIcon = () => {
251
+ if (props.closeMode) {
252
+ state.showNoticebar = !props.closeMode;
253
+ }
254
+ emit("close", state.scrollList[0]);
173
255
  };
174
- ee(() => {
175
- e.direction == "vertical" ? (i.default ? (M(), G()) : t.scrollList = [].concat(e.list), setTimeout(() => {
176
- e.complexAm ? X() : U();
177
- }, e.standTime)) : A(e.text);
256
+ onMounted(() => {
257
+ if (props.direction == "vertical") {
258
+ if (slots.default) {
259
+ updateSlotChild();
260
+ watchSlots();
261
+ } else {
262
+ state.scrollList = [].concat(props.list);
263
+ }
264
+ setTimeout(() => {
265
+ props.complexAm ? startRoll() : startRollEasy();
266
+ }, props.standTime);
267
+ } else {
268
+ initScrollWrap(props.text);
269
+ }
178
270
  });
179
- const M = () => {
180
- i.default && (t.scrollList = [].concat(i.default()[0].children));
181
- }, G = () => {
271
+ const updateSlotChild = () => {
272
+ if (slots.default)
273
+ state.scrollList = [].concat(slots.default()[0].children);
274
+ };
275
+ const watchSlots = () => {
182
276
  setTimeout(() => {
183
- var n = new MutationObserver((C) => {
184
- t.showNotica = !1, setTimeout(() => {
185
- t.showNotica = !0;
186
- }), M();
187
- });
188
- const s = document.getElementsByClassName("nut-noticebar-custom-item")[0];
189
- s && n.observe(s, {
190
- childList: !0,
191
- subtree: !0
277
+ var observer = new MutationObserver((slots2) => {
278
+ state.showNotica = false;
279
+ setTimeout(() => {
280
+ state.showNotica = true;
281
+ });
282
+ updateSlotChild();
192
283
  });
284
+ const ele = document.getElementsByClassName("nut-noticebar-custom-item")[0];
285
+ if (ele) {
286
+ observer.observe(ele, {
287
+ childList: true,
288
+ subtree: true
289
+ });
290
+ }
193
291
  }, 100);
194
292
  };
195
- return te(() => {
196
- t.keepAlive && (t.keepAlive = !1);
197
- }), le(() => {
198
- t.keepAlive = !0, clearInterval(t.timer);
199
- }), ne(() => {
200
- clearInterval(t.timer);
201
- }), E(S(S({}, D(e)), D(t)), {
202
- isEllipsis: m,
203
- classes: k,
204
- barStyle: o,
205
- contentStyle: f,
206
- horseLampStyle: $,
207
- wrap: g,
208
- content: w,
209
- handleClick: F,
210
- onClickIcon: H,
211
- onAnimationEnd: O,
212
- go: j,
213
- handleClickIcon: q,
214
- slots: i,
215
- pxCheck: de,
216
- wrapContentClass: v
293
+ onActivated(() => {
294
+ if (state.keepAlive) {
295
+ state.keepAlive = false;
296
+ }
297
+ });
298
+ onDeactivated(() => {
299
+ state.keepAlive = true;
300
+ clearInterval(state.timer);
301
+ });
302
+ onUnmounted(() => {
303
+ clearInterval(state.timer);
304
+ });
305
+ return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(state)), {
306
+ isEllipsis,
307
+ classes,
308
+ barStyle,
309
+ contentStyle,
310
+ horseLampStyle,
311
+ wrap,
312
+ content,
313
+ handleClick,
314
+ onClickIcon,
315
+ onAnimationEnd,
316
+ go,
317
+ handleClickIcon,
318
+ slots,
319
+ pxCheck,
320
+ wrapContentClass
217
321
  });
218
322
  }
219
- }), ge = { class: "nut-noticebar__page-lefticon" }, we = {
323
+ });
324
+ const _hoisted_1 = { class: "nut-noticebar__page-lefticon" };
325
+ const _hoisted_2 = {
220
326
  ref: "wrap",
221
327
  class: "nut-noticebar__page-wrap"
222
- }, Ce = { class: "showNotica" }, be = { class: "nut-noticebar-custom-item" }, ke = ["onClick"];
223
- function ve(e, l, i, g, w, t) {
224
- const k = p("Notice"), m = p("CircleClose"), v = p("ScrollItem");
225
- return a(), r("view", {
226
- class: N(e.classes)
328
+ };
329
+ const _hoisted_3 = { class: "showNotica" };
330
+ const _hoisted_4 = { class: "nut-noticebar-custom-item" };
331
+ const _hoisted_5 = ["onClick"];
332
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
333
+ const _component_Notice = resolveComponent("Notice");
334
+ const _component_CircleClose = resolveComponent("CircleClose");
335
+ const _component_ScrollItem = resolveComponent("ScrollItem");
336
+ return openBlock(), createElementBlock("view", {
337
+ class: normalizeClass(_ctx.classes)
227
338
  }, [
228
- e.direction == "across" ? ie((a(), r("view", {
339
+ _ctx.direction == "across" ? withDirectives((openBlock(), createElementBlock("view", {
229
340
  key: 0,
230
- class: N(["nut-noticebar__page", {
231
- "nut-noticebar__page--withicon": e.closeMode,
232
- "nut-noticebar__page--close": e.closeMode,
233
- "nut-noticebar__page--wrapable": e.wrapable
341
+ class: normalizeClass(["nut-noticebar__page", {
342
+ "nut-noticebar__page--withicon": _ctx.closeMode,
343
+ "nut-noticebar__page--close": _ctx.closeMode,
344
+ "nut-noticebar__page--wrapable": _ctx.wrapable
234
345
  }]),
235
- style: c(e.barStyle),
236
- onClick: l[3] || (l[3] = (...o) => e.handleClick && e.handleClick(...o))
346
+ style: normalizeStyle(_ctx.barStyle),
347
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
237
348
  }, [
238
- u("view", ge, [
239
- h(e.$slots, "left-icon", {}, () => [
240
- e.leftIcon ? (a(), b(k, {
349
+ createElementVNode("view", _hoisted_1, [
350
+ renderSlot(_ctx.$slots, "left-icon", {}, () => [
351
+ _ctx.leftIcon ? (openBlock(), createBlock(_component_Notice, {
241
352
  key: 0,
242
353
  size: "16px"
243
- })) : y("", !0)
354
+ })) : createCommentVNode("", true)
244
355
  ])
245
356
  ]),
246
- u("view", we, [
247
- u("view", {
357
+ createElementVNode("view", _hoisted_2, [
358
+ createElementVNode("view", {
248
359
  ref: "content",
249
- class: N(e.wrapContentClass),
250
- style: c(e.contentStyle),
251
- onAnimationend: l[0] || (l[0] = (...o) => e.onAnimationEnd && e.onAnimationEnd(...o)),
252
- "on:webkitAnimationEnd": l[1] || (l[1] = (...o) => e.onAnimationEnd && e.onAnimationEnd(...o))
360
+ class: normalizeClass(_ctx.wrapContentClass),
361
+ style: normalizeStyle(_ctx.contentStyle),
362
+ onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
363
+ "on:webkitAnimationEnd": _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
253
364
  }, [
254
- h(e.$slots, "default", {}, () => [
255
- oe(z(e.text), 1)
365
+ renderSlot(_ctx.$slots, "default", {}, () => [
366
+ createTextVNode(toDisplayString(_ctx.text), 1)
256
367
  ])
257
368
  ], 38)
258
369
  ], 512),
259
- e.closeMode || e.$slots["right-icon"] ? (a(), r("view", {
370
+ _ctx.closeMode || _ctx.$slots["right-icon"] ? (openBlock(), createElementBlock("view", {
260
371
  key: 0,
261
372
  class: "nut-noticebar__page-righticon",
262
- onClick: l[2] || (l[2] = se((...o) => e.onClickIcon && e.onClickIcon(...o), ["stop"]))
373
+ onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.onClickIcon && _ctx.onClickIcon(...args), ["stop"]))
263
374
  }, [
264
- e.$slots["right-icon"] ? h(e.$slots, "right-icon", { key: 0 }) : (a(), b(m, { key: 1 }))
265
- ])) : y("", !0)
375
+ _ctx.$slots["right-icon"] ? renderSlot(_ctx.$slots, "right-icon", { key: 0 }) : (openBlock(), createBlock(_component_CircleClose, { key: 1 }))
376
+ ])) : createCommentVNode("", true)
266
377
  ], 6)), [
267
- [ae, e.showNoticebar]
268
- ]) : y("", !0),
269
- e.scrollList.length > 0 && e.direction == "vertical" && e.showNoticebar ? (a(), r("view", {
378
+ [vShow, _ctx.showNoticebar]
379
+ ]) : createCommentVNode("", true),
380
+ _ctx.scrollList.length > 0 && _ctx.direction == "vertical" && _ctx.showNoticebar ? (openBlock(), createElementBlock("view", {
270
381
  key: 1,
271
382
  class: "nut-noticebar__vertical",
272
- style: c(e.barStyle)
383
+ style: normalizeStyle(_ctx.barStyle)
273
384
  }, [
274
- e.slots.default ? (a(), r(L, { key: 0 }, [
275
- u("view", {
385
+ _ctx.slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
386
+ createElementVNode("view", {
276
387
  class: "nut-noticebar__vertical-list",
277
- style: c(e.horseLampStyle)
388
+ style: normalizeStyle(_ctx.horseLampStyle)
278
389
  }, [
279
- u("div", Ce, [
280
- (a(!0), r(L, null, V(e.scrollList, (o, f) => (a(), b(v, {
281
- key: f,
282
- style: c({ height: e.height + "px", "line-height": e.height + "px" }),
283
- item: o
284
- }, null, 8, ["style", "item"]))), 128))
390
+ createElementVNode("div", _hoisted_3, [
391
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
392
+ return openBlock(), createBlock(_component_ScrollItem, {
393
+ key: index2,
394
+ style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
395
+ item
396
+ }, null, 8, ["style", "item"]);
397
+ }), 128))
285
398
  ])
286
399
  ], 4),
287
- u("view", be, [
288
- h(e.$slots, "default")
400
+ createElementVNode("view", _hoisted_4, [
401
+ renderSlot(_ctx.$slots, "default")
289
402
  ])
290
- ], 64)) : (a(), r("ul", {
403
+ ], 64)) : (openBlock(), createElementBlock("ul", {
291
404
  key: 1,
292
405
  class: "nut-noticebar__vertical-list",
293
- style: c(e.horseLampStyle)
406
+ style: normalizeStyle(_ctx.horseLampStyle)
294
407
  }, [
295
- (a(!0), r(L, null, V(e.scrollList, (o, f) => (a(), r("li", {
296
- class: "nut-noticebar__vertical-item",
297
- key: f,
298
- style: c({ height: e.pxCheck(e.height), lineHeight: e.pxCheck(e.height) }),
299
- onClick: ($) => e.go(o)
300
- }, z(o), 13, ke))), 128))
408
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
409
+ return openBlock(), createElementBlock("li", {
410
+ class: "nut-noticebar__vertical-item",
411
+ key: index2,
412
+ style: normalizeStyle({ height: _ctx.pxCheck(_ctx.height), lineHeight: _ctx.pxCheck(_ctx.height) }),
413
+ onClick: ($event) => _ctx.go(item)
414
+ }, toDisplayString(item), 13, _hoisted_5);
415
+ }), 128))
301
416
  ], 4)),
302
- u("view", {
417
+ createElementVNode("view", {
303
418
  class: "go",
304
- onClick: l[4] || (l[4] = (o) => !e.slots.rightIcon && e.handleClickIcon())
419
+ onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
305
420
  }, [
306
- h(e.$slots, "right-icon", {}, () => [
307
- e.closeMode ? (a(), b(m, {
421
+ renderSlot(_ctx.$slots, "right-icon", {}, () => [
422
+ _ctx.closeMode ? (openBlock(), createBlock(_component_CircleClose, {
308
423
  key: 0,
309
- color: e.color,
424
+ color: _ctx.color,
310
425
  size: "11px"
311
- }, null, 8, ["color"])) : y("", !0)
426
+ }, null, 8, ["color"])) : createCommentVNode("", true)
312
427
  ])
313
428
  ])
314
- ], 4)) : y("", !0)
429
+ ], 4)) : createCommentVNode("", true)
315
430
  ], 2);
316
431
  }
317
- const Me = /* @__PURE__ */ me(ye, [["render", ve]]);
432
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
318
433
  export {
319
- Me as default
434
+ index as default
320
435
  };