@nutui/nutui 4.0.0 → 4.0.1-2.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.
Files changed (285) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +34 -65
  3. package/dist/nutui.es.js +10 -17
  4. package/dist/nutui.js +16202 -0
  5. package/dist/nutui.umd.js +1 -7
  6. package/dist/packages/_es/ActionSheet.js +79 -94
  7. package/dist/packages/_es/Address.js +260 -345
  8. package/dist/packages/_es/AddressList.js +269 -354
  9. package/dist/packages/_es/Animate.js +46 -38
  10. package/dist/packages/_es/Audio.js +128 -180
  11. package/dist/packages/_es/AudioOperate.js +60 -52
  12. package/dist/packages/_es/Avatar.js +67 -75
  13. package/dist/packages/_es/AvatarGroup.js +23 -31
  14. package/dist/packages/_es/Backtop.js +59 -99
  15. package/dist/packages/_es/Badge.js +39 -46
  16. package/dist/packages/_es/Barrage.js +68 -145
  17. package/dist/packages/_es/Button.js +47 -66
  18. package/dist/packages/_es/Calendar.js +135 -152
  19. package/dist/packages/_es/CalendarItem.js +6 -6
  20. package/dist/packages/_es/Card.js +42 -56
  21. package/dist/packages/_es/Cascader.js +323 -433
  22. package/dist/packages/_es/Category.js +29 -39
  23. package/dist/packages/_es/CategoryPane.js +57 -83
  24. package/dist/packages/_es/Cell.js +56 -71
  25. package/dist/packages/_es/CellGroup.js +19 -27
  26. package/dist/packages/_es/Checkbox.js +109 -138
  27. package/dist/packages/_es/CheckboxGroup.js +38 -61
  28. package/dist/packages/_es/CircleProgress.js +67 -96
  29. package/dist/packages/_es/Col.js +23 -31
  30. package/dist/packages/_es/Collapse.js +37 -67
  31. package/dist/packages/_es/CollapseItem.js +91 -184
  32. package/dist/packages/_es/Comment.js +207 -279
  33. package/dist/packages/_es/ConfigProvider.js +38 -56
  34. package/dist/packages/_es/Countdown.js +100 -194
  35. package/dist/packages/_es/Countup.js +232 -428
  36. package/dist/packages/_es/DatePicker.js +169 -245
  37. package/dist/packages/_es/Dialog.js +163 -188
  38. package/dist/packages/_es/Divider.js +42 -40
  39. package/dist/packages/_es/Drag.js +70 -153
  40. package/dist/packages/_es/Ecard.js +64 -104
  41. package/dist/packages/_es/Elevator.js +144 -201
  42. package/dist/packages/_es/Ellipsis.js +95 -159
  43. package/dist/packages/_es/Empty.js +23 -39
  44. package/dist/packages/_es/FixedNav.js +93 -116
  45. package/dist/packages/_es/Form.js +108 -164
  46. package/dist/packages/_es/FormItem.js +48 -61
  47. package/dist/packages/_es/Grid.js +5 -6
  48. package/dist/packages/_es/GridItem.js +58 -84
  49. package/dist/packages/_es/Image.js +98 -88
  50. package/dist/packages/_es/ImagePreview.js +262 -392
  51. package/dist/packages/_es/Indicator.js +30 -34
  52. package/dist/packages/_es/InfiniteLoading.js +83 -117
  53. package/dist/packages/_es/Input.js +176 -223
  54. package/dist/packages/_es/InputNumber.js +81 -117
  55. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  56. package/dist/packages/_es/Invoice.js +105 -113
  57. package/dist/packages/_es/Layout.js +3 -4
  58. package/dist/packages/_es/List.js +147 -89
  59. package/dist/packages/_es/Menu.js +96 -152
  60. package/dist/packages/_es/MenuItem.js +117 -153
  61. package/dist/packages/_es/Navbar.js +103 -119
  62. package/dist/packages/_es/Noticebar.js +207 -273
  63. package/dist/packages/_es/Notify.js +110 -147
  64. package/dist/packages/_es/NumberKeyboard.js +127 -202
  65. package/dist/packages/_es/Overlay.js +53 -66
  66. package/dist/packages/_es/Pagination.js +70 -100
  67. package/dist/packages/_es/Picker.js +276 -425
  68. package/dist/packages/_es/Popover.js +122 -225
  69. package/dist/packages/_es/Popup.js +4 -4
  70. package/dist/packages/_es/Price.js +47 -80
  71. package/dist/packages/_es/Progress.js +63 -79
  72. package/dist/packages/_es/PullRefresh.js +96 -157
  73. package/dist/packages/_es/Radio.js +4 -4
  74. package/dist/packages/_es/RadioGroup.js +3 -3
  75. package/dist/packages/_es/Range.js +205 -329
  76. package/dist/packages/_es/Rate.js +93 -122
  77. package/dist/packages/_es/Row.js +21 -27
  78. package/dist/packages/_es/Searchbar.js +130 -160
  79. package/dist/packages/_es/ShortPassword.js +69 -93
  80. package/dist/packages/_es/SideNavbar.js +49 -59
  81. package/dist/packages/_es/SideNavbarItem.js +22 -32
  82. package/dist/packages/_es/Signature.js +83 -128
  83. package/dist/packages/_es/Skeleton.js +110 -130
  84. package/dist/packages/_es/Sku.js +251 -326
  85. package/dist/packages/_es/Step.js +60 -69
  86. package/dist/packages/_es/Steps.js +26 -31
  87. package/dist/packages/_es/Sticky.js +4 -4
  88. package/dist/packages/_es/SubSideNavbar.js +52 -56
  89. package/dist/packages/_es/Swipe.js +84 -137
  90. package/dist/packages/_es/Swiper.js +175 -310
  91. package/dist/packages/_es/SwiperItem.js +28 -44
  92. package/dist/packages/_es/Switch.js +55 -67
  93. package/dist/packages/_es/TabPane.js +32 -20
  94. package/dist/packages/_es/Tabbar.js +41 -52
  95. package/dist/packages/_es/TabbarItem.js +61 -81
  96. package/dist/packages/_es/Table.js +110 -148
  97. package/dist/packages/_es/Tabs.js +284 -205
  98. package/dist/packages/_es/Tag.js +44 -61
  99. package/dist/packages/_es/Textarea.js +80 -124
  100. package/dist/packages/_es/TimeDetail.js +49 -57
  101. package/dist/packages/_es/TimePannel.js +35 -31
  102. package/dist/packages/_es/TimeSelect.js +47 -68
  103. package/dist/packages/_es/Toast.js +150 -203
  104. package/dist/packages/_es/Tour.js +139 -175
  105. package/dist/packages/_es/TrendArrow.js +57 -58
  106. package/dist/packages/_es/Uploader.js +235 -359
  107. package/dist/packages/_es/Video.js +191 -298
  108. package/dist/packages/_es/Watermark.js +84 -98
  109. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  110. package/dist/packages/_es/common-d218746f.js +116 -0
  111. package/dist/packages/_es/component-234624bc.js +89 -0
  112. package/dist/packages/_es/index-14dfadc4.js +561 -0
  113. package/dist/packages/_es/index-192a3ef6.js +29 -0
  114. package/dist/packages/_es/index-360c5092.js +210 -0
  115. package/dist/packages/_es/index-496e6e05.js +24 -0
  116. package/dist/packages/_es/index-50eed3d9.js +7 -0
  117. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  118. package/dist/packages/_es/index-fadb0974.js +8 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  121. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  122. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  123. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  124. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  125. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  126. package/dist/packages/actionsheet/index.scss +2 -0
  127. package/dist/packages/actionsheet/style.mjs +0 -2
  128. package/dist/packages/address/index.scss +5 -2
  129. package/dist/packages/address/style.mjs +0 -3
  130. package/dist/packages/addresslist/index.scss +3 -0
  131. package/dist/packages/addresslist/style.mjs +0 -2
  132. package/dist/packages/audio/index.scss +2 -0
  133. package/dist/packages/audio/style.mjs +0 -1
  134. package/dist/packages/audiooperate/index.scss +2 -0
  135. package/dist/packages/audiooperate/style.mjs +0 -1
  136. package/dist/packages/badge/index.scss +3 -0
  137. package/dist/packages/button/index.scss +1 -1
  138. package/dist/packages/calendar/index.scss +3 -0
  139. package/dist/packages/calendar/style.mjs +0 -3
  140. package/dist/packages/card/index.scss +3 -0
  141. package/dist/packages/card/style.mjs +0 -2
  142. package/dist/packages/cascader/index.scss +4 -0
  143. package/dist/packages/cascader/style.mjs +0 -5
  144. package/dist/packages/cellgroup/index.scss +1 -1
  145. package/dist/packages/checkbox/index.scss +41 -0
  146. package/dist/packages/col/index.scss +2 -2
  147. package/dist/packages/comment/index.scss +2 -0
  148. package/dist/packages/comment/style.mjs +0 -1
  149. package/dist/packages/datepicker/index.scss +1 -2
  150. package/dist/packages/datepicker/style.mjs +0 -3
  151. package/dist/packages/dialog/index.scss +11 -0
  152. package/dist/packages/dialog/style.mjs +0 -3
  153. package/dist/packages/ecard/index.scss +2 -0
  154. package/dist/packages/ecard/style.mjs +0 -1
  155. package/dist/packages/fixednav/index.scss +2 -0
  156. package/dist/packages/fixednav/style.mjs +0 -1
  157. package/dist/packages/form/index.scss +1 -2
  158. package/dist/packages/form/style.mjs +0 -1
  159. package/dist/packages/formitem/index.scss +3 -0
  160. package/dist/packages/formitem/style.mjs +0 -1
  161. package/dist/packages/imagepreview/index.scss +5 -5
  162. package/dist/packages/imagepreview/style.mjs +0 -5
  163. package/dist/packages/input/index.scss +13 -13
  164. package/dist/packages/invoice/index.scss +6 -0
  165. package/dist/packages/invoice/style.mjs +0 -7
  166. package/dist/packages/list/index.scss +8 -8
  167. package/dist/packages/menuitem/index.scss +9 -10
  168. package/dist/packages/menuitem/style.mjs +0 -2
  169. package/dist/packages/navbar/index.scss +0 -1
  170. package/dist/packages/noticebar/index.scss +12 -2
  171. package/dist/packages/notify/index.scss +2 -0
  172. package/dist/packages/notify/style.mjs +0 -2
  173. package/dist/packages/numberkeyboard/index.scss +2 -0
  174. package/dist/packages/numberkeyboard/style.mjs +0 -2
  175. package/dist/packages/picker/index.scss +4 -9
  176. package/dist/packages/picker/style.mjs +0 -2
  177. package/dist/packages/popover/index.scss +2 -0
  178. package/dist/packages/popover/style.mjs +0 -2
  179. package/dist/packages/popup/index.scss +2 -0
  180. package/dist/packages/popup/style.mjs +0 -1
  181. package/dist/packages/price/index.scss +5 -10
  182. package/dist/packages/rate/index.scss +6 -9
  183. package/dist/packages/searchbar/index.scss +4 -0
  184. package/dist/packages/shortpassword/index.scss +18 -0
  185. package/dist/packages/shortpassword/style.mjs +0 -2
  186. package/dist/packages/signature/index.scss +2 -0
  187. package/dist/packages/signature/style.mjs +0 -1
  188. package/dist/packages/skeleton/index.scss +2 -0
  189. package/dist/packages/skeleton/style.mjs +0 -1
  190. package/dist/packages/sku/index.scss +4 -0
  191. package/dist/packages/sku/style.mjs +0 -4
  192. package/dist/packages/tabbaritem/index.scss +2 -0
  193. package/dist/packages/tabbaritem/style.mjs +0 -1
  194. package/dist/packages/tabs/index.scss +36 -2
  195. package/dist/packages/tabs/style.mjs +0 -1
  196. package/dist/packages/textarea/index.scss +2 -0
  197. package/dist/packages/timeselect/index.scss +2 -0
  198. package/dist/packages/timeselect/style.mjs +0 -2
  199. package/dist/packages/tour/index.scss +2 -0
  200. package/dist/packages/tour/style.mjs +0 -3
  201. package/dist/packages/uploader/index.scss +10 -2
  202. package/dist/packages/uploader/style.mjs +0 -2
  203. package/dist/resolver/index.d.ts +6 -0
  204. package/dist/resolver/index.js +1 -0
  205. package/dist/resolver/index.mjs +24 -0
  206. package/dist/resolver/package.json +20 -0
  207. package/dist/smartips/web-types.json +114 -15
  208. package/dist/style.css +1 -1
  209. package/dist/styles/themes/default.scss +155 -52
  210. package/dist/styles/themes/jdb.scss +155 -52
  211. package/dist/styles/themes/jddkh.scss +155 -52
  212. package/dist/styles/themes/jdt.scss +155 -52
  213. package/dist/styles/variables-jdb.scss +9 -1
  214. package/dist/styles/variables-jddkh.scss +9 -1
  215. package/dist/styles/variables-jdt.scss +9 -1
  216. package/dist/styles/variables.scss +8 -0
  217. package/dist/types/__VUE/address/index.vue.d.ts +2 -1
  218. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +1 -1
  219. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -1
  220. package/dist/types/__VUE/addresslist/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/animate/index.vue.d.ts +6 -0
  222. package/dist/types/__VUE/audiooperate/index.vue.d.ts +4 -4
  223. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  224. package/dist/types/__VUE/button/type.d.ts +1 -0
  225. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  226. package/dist/types/__VUE/collapse/index.vue.d.ts +31 -5
  227. package/dist/types/__VUE/collapseitem/index.vue.d.ts +117 -11
  228. package/dist/types/__VUE/configprovider/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  230. package/dist/types/__VUE/dialog/index.d.ts +1 -0
  231. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -0
  232. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  233. package/dist/types/__VUE/image/index.vue.d.ts +14 -3
  234. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +9 -0
  235. package/dist/types/__VUE/imagepreview/index.vue.d.ts +1 -1
  236. package/dist/types/__VUE/input/index.vue.d.ts +27 -2
  237. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  238. package/dist/types/__VUE/list/type.d.ts +13 -0
  239. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  240. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  241. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  242. package/dist/types/__VUE/noticebar/index.vue.d.ts +5 -2
  243. package/dist/types/__VUE/picker/common.d.ts +2 -0
  244. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  245. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  246. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  247. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  248. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  249. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  250. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  251. package/dist/types/__VUE/switch/index.vue.d.ts +1 -0
  252. package/dist/types/__VUE/table/common.d.ts +55 -2
  253. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  254. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  255. package/dist/types/__VUE/tabs/index.vue.d.ts +35 -5
  256. package/dist/types/__VUE/tabs/types.d.ts +12 -0
  257. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  258. package/dist/types/__VUE/toast/index.vue.d.ts +11 -4
  259. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  260. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  261. package/dist/types/index.d.ts +1 -2
  262. package/dist/types/resolver/index.d.ts +6 -0
  263. package/dist/types/utils/date.d.ts +4 -0
  264. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  265. package/dist/types/utils/util.d.ts +1 -1
  266. package/package.json +13 -6
  267. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  268. package/dist/packages/_es/common-b9a5e726.js +0 -145
  269. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  270. package/dist/packages/_es/index-29892cda.js +0 -33
  271. package/dist/packages/_es/index-2ae3ae87.js +0 -846
  272. package/dist/packages/_es/index-43c34ac6.js +0 -30
  273. package/dist/packages/_es/index-54d03fc1.js +0 -8
  274. package/dist/packages/_es/index-79c5dc33.js +0 -10
  275. package/dist/packages/_es/index-7a7385e4.js +0 -67
  276. package/dist/packages/_es/index-991c279f.js +0 -244
  277. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  278. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  279. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  280. package/dist/packages/_es/interceptor-956b24fc.js +0 -29
  281. package/dist/packages/_es/mountComponent-1ece4110.js +0 -39
  282. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  283. package/dist/packages/_es/raf-729dad54.js +0 -25
  284. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
  285. /package/dist/types/utils/{interceptor.d.ts → Interceptor.d.ts} +0 -0
@@ -1,11 +1,22 @@
1
- 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";
2
- import { Notice, CircleClose } from "@nutui/icons-vue";
3
- import { c as createComponent } from "./component-81a4c1d0.js";
4
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
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";
6
18
  import "../locale/lang";
7
- const { componentName, create } = createComponent("noticebar");
8
- const _sfc_main = create({
19
+ const { componentName: fe, create: he } = ue("noticebar"), ye = he({
9
20
  props: {
10
21
  // 滚动方向 across 横向 vertical 纵向
11
22
  direction: {
@@ -14,9 +25,7 @@ const _sfc_main = create({
14
25
  },
15
26
  list: {
16
27
  type: Array,
17
- default: () => {
18
- return [];
19
- }
28
+ default: () => []
20
29
  },
21
30
  standTime: {
22
31
  type: Number,
@@ -24,7 +33,7 @@ const _sfc_main = create({
24
33
  },
25
34
  complexAm: {
26
35
  type: Boolean,
27
- default: false
36
+ default: !1
28
37
  },
29
38
  height: {
30
39
  type: Number,
@@ -36,13 +45,13 @@ const _sfc_main = create({
36
45
  },
37
46
  closeMode: {
38
47
  type: Boolean,
39
- default: false
48
+ default: !1
40
49
  },
41
50
  wrapable: {
42
51
  type: Boolean,
43
- default: false
52
+ default: !1
44
53
  },
45
- leftIcon: { type: Boolean, default: true },
54
+ leftIcon: { type: Boolean, default: !0 },
46
55
  color: {
47
56
  type: String,
48
57
  default: ""
@@ -65,322 +74,247 @@ const _sfc_main = create({
65
74
  }
66
75
  },
67
76
  components: {
68
- ScrollItem: function(props) {
69
- props.item.props.style = props.style;
70
- props.item.key = props.key;
71
- return h(props.item);
77
+ ScrollItem: function(e) {
78
+ return e.item.props.style = e.style, e.item.key = e.key, _(e.item);
72
79
  },
73
- Notice,
74
- CircleClose
80
+ Notice: re,
81
+ CircleClose: ce
75
82
  },
76
- emits: ["click", "close"],
77
- setup(props, { emit, slots }) {
78
- const wrap = ref(null);
79
- const content = ref(null);
80
- const state = reactive({
83
+ emits: ["click", "close", "across-end"],
84
+ setup(e, { emit: l, slots: i }) {
85
+ const g = W(null), w = W(null), t = x({
81
86
  wrapWidth: 0,
82
- firstRound: true,
87
+ firstRound: !0,
83
88
  duration: 0,
84
89
  offsetWidth: 0,
85
- showNoticebar: true,
90
+ showNoticebar: !0,
86
91
  animationClass: "",
87
- animate: false,
92
+ animate: !1,
88
93
  scrollList: [],
89
94
  distance: 0,
90
95
  timer: null,
91
- keepAlive: false,
92
- isCanScroll: null
93
- });
94
- const classes = computed(() => {
95
- const prefixCls = componentName;
96
- return {
97
- [prefixCls]: true
98
- };
99
- });
100
- const isEllipsis = computed(() => {
101
- if (state.isCanScroll == null) {
102
- return props.wrapable;
103
- } else {
104
- return !state.isCanScroll && !props.wrapable;
105
- }
106
- });
107
- const wrapContentClass = computed(() => {
108
- return {
109
- "nut-noticebar__page-wrap-content": true,
110
- "nut-ellipsis": isEllipsis.value,
111
- [state.animationClass]: true
112
- };
113
- });
114
- const barStyle = computed(() => {
115
- let style = {};
116
- props.color && (style.color = props.color);
117
- props.background && (style.background = props.background);
118
- if (props.direction == "vertical") {
119
- style.height = `${props.height}px`;
120
- }
121
- return style;
122
- });
123
- const contentStyle = computed(() => {
124
- return {
125
- animationDelay: (state.firstRound ? props.delay : 0) + "s",
126
- animationDuration: state.duration + "s",
127
- transform: `translateX(${state.firstRound ? 0 : state.wrapWidth + "px"})`
128
- };
129
- });
130
- const horseLampStyle = computed(() => {
131
- let styles = {};
132
- if (props.complexAm) {
133
- styles = {
134
- transform: `translateY(${state.distance}px)`
96
+ keepAlive: !1,
97
+ 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`
135
123
  };
136
- } else {
137
- if (state.animate) {
138
- let a = ~~(props.height / props.speed / 4);
139
- styles = {
140
- transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
141
- "margin-top": `-${props.height}px`
142
- };
143
- }
144
124
  }
145
- return styles;
125
+ return n;
146
126
  });
147
- watch(
148
- () => props.text,
149
- (value) => {
150
- initScrollWrap();
127
+ R(
128
+ () => e.text,
129
+ (n) => {
130
+ A();
151
131
  }
152
- );
153
- watch(
154
- () => props.list,
155
- (value) => {
156
- state.scrollList = [].concat(value);
132
+ ), R(
133
+ () => e.list,
134
+ (n) => {
135
+ t.scrollList = [].concat(n);
157
136
  }
158
137
  );
159
- const initScrollWrap = (value) => {
160
- if (state.showNoticebar == false) {
161
- return;
162
- }
163
- setTimeout(() => {
164
- if (!wrap.value || !content.value) {
138
+ const A = (n) => {
139
+ t.showNoticebar != !1 && setTimeout(() => {
140
+ if (!g.value || !w.value)
165
141
  return;
166
- }
167
- const wrapWidth = wrap.value.getBoundingClientRect().width;
168
- const offsetWidth = content.value.getBoundingClientRect().width;
169
- state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
170
- console.log(111, state.isCanScroll);
171
- if (state.isCanScroll) {
172
- state.wrapWidth = wrapWidth;
173
- state.offsetWidth = offsetWidth;
174
- state.duration = offsetWidth / props.speed;
175
- state.animationClass = "play";
176
- } else {
177
- state.animationClass = "";
178
- }
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 = "";
179
144
  }, 0);
180
- };
181
- const handleClick = (event) => {
182
- emit("click", event);
183
- };
184
- const onClickIcon = (event) => {
185
- if (props.closeMode) {
186
- state.showNoticebar = !props.closeMode;
187
- }
188
- emit("close", event);
189
- };
190
- const onAnimationEnd = () => {
191
- state.firstRound = false;
192
- setTimeout(() => {
193
- state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
194
- state.animationClass = "play-infinite";
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";
195
152
  }, 0);
196
- };
197
- const startRollEasy = () => {
198
- showhorseLamp();
199
- state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
200
- };
201
- const showhorseLamp = () => {
202
- state.animate = true;
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) => {
203
166
  setTimeout(() => {
204
- state.scrollList.push(state.scrollList[0]);
205
- state.scrollList.shift();
206
- state.animate = false;
207
- }, ~~(props.height / props.speed / 4 * 1e3));
208
- };
209
- const startRoll = () => {
210
- state.timer = setInterval(() => {
211
- let chunk = 100;
212
- for (let i = 0; i < chunk; i++) {
213
- scroll(i, i < chunk - 1 ? false : true);
214
- }
215
- }, props.standTime + 100 * props.speed);
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]);
216
173
  };
217
- const scroll = (n, last) => {
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);
178
+ });
179
+ const M = () => {
180
+ i.default && (t.scrollList = [].concat(i.default()[0].children));
181
+ }, G = () => {
218
182
  setTimeout(() => {
219
- state.distance -= props.height / 100;
220
- if (last) {
221
- state.scrollList.push(state.scrollList[0]);
222
- state.scrollList.shift();
223
- state.distance = 0;
224
- }
225
- }, n * props.speed);
226
- };
227
- const go = (item) => {
228
- emit("click", item);
229
- };
230
- const handleClickIcon = () => {
231
- if (props.closeMode) {
232
- state.showNoticebar = !props.closeMode;
233
- }
234
- emit("close", state.scrollList[0]);
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
192
+ });
193
+ }, 100);
235
194
  };
236
- onMounted(() => {
237
- if (props.direction == "vertical") {
238
- if (slots.default) {
239
- state.scrollList = [].concat(slots.default()[0].children);
240
- } else {
241
- state.scrollList = [].concat(props.list);
242
- }
243
- setTimeout(() => {
244
- props.complexAm ? startRoll() : startRollEasy();
245
- }, props.standTime);
246
- } else {
247
- initScrollWrap(props.text);
248
- }
249
- });
250
- onActivated(() => {
251
- if (state.keepAlive) {
252
- state.keepAlive = false;
253
- }
254
- });
255
- onDeactivated(() => {
256
- state.keepAlive = true;
257
- clearInterval(state.timer);
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
258
217
  });
259
- onUnmounted(() => {
260
- clearInterval(state.timer);
261
- });
262
- return {
263
- ...toRefs(props),
264
- ...toRefs(state),
265
- isEllipsis,
266
- classes,
267
- barStyle,
268
- contentStyle,
269
- horseLampStyle,
270
- wrap,
271
- content,
272
- handleClick,
273
- onClickIcon,
274
- onAnimationEnd,
275
- go,
276
- handleClickIcon,
277
- slots,
278
- pxCheck,
279
- wrapContentClass
280
- };
281
218
  }
282
- });
283
- const _hoisted_1 = { class: "nut-noticebar__page-lefticon" };
284
- const _hoisted_2 = {
219
+ }), ge = { class: "nut-noticebar__page-lefticon" }, we = {
285
220
  ref: "wrap",
286
221
  class: "nut-noticebar__page-wrap"
287
- };
288
- const _hoisted_3 = ["onClick"];
289
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
290
- const _component_Notice = resolveComponent("Notice");
291
- const _component_CircleClose = resolveComponent("CircleClose");
292
- const _component_ScrollItem = resolveComponent("ScrollItem");
293
- return openBlock(), createElementBlock("view", {
294
- class: normalizeClass(_ctx.classes)
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)
295
227
  }, [
296
- _ctx.direction == "across" ? withDirectives((openBlock(), createElementBlock("view", {
228
+ e.direction == "across" ? ie((a(), r("view", {
297
229
  key: 0,
298
- class: normalizeClass(["nut-noticebar__page", {
299
- "nut-noticebar__page--withicon": _ctx.closeMode,
300
- "nut-noticebar__page--close": _ctx.closeMode,
301
- "nut-noticebar__page--wrapable": _ctx.wrapable
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
302
234
  }]),
303
- style: normalizeStyle(_ctx.barStyle),
304
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
235
+ style: c(e.barStyle),
236
+ onClick: l[3] || (l[3] = (...o) => e.handleClick && e.handleClick(...o))
305
237
  }, [
306
- createElementVNode("view", _hoisted_1, [
307
- renderSlot(_ctx.$slots, "left-icon", {}, () => [
308
- _ctx.leftIcon ? (openBlock(), createBlock(_component_Notice, {
238
+ u("view", ge, [
239
+ h(e.$slots, "left-icon", {}, () => [
240
+ e.leftIcon ? (a(), b(k, {
309
241
  key: 0,
310
242
  size: "16px"
311
- })) : createCommentVNode("", true)
243
+ })) : y("", !0)
312
244
  ])
313
245
  ]),
314
- createElementVNode("view", _hoisted_2, [
315
- createElementVNode("view", {
246
+ u("view", we, [
247
+ u("view", {
316
248
  ref: "content",
317
- class: normalizeClass(_ctx.wrapContentClass),
318
- style: normalizeStyle(_ctx.contentStyle),
319
- onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
320
- "on:webkitAnimationEnd": _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
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))
321
253
  }, [
322
- renderSlot(_ctx.$slots, "default", {}, () => [
323
- createTextVNode(toDisplayString(_ctx.text), 1)
254
+ h(e.$slots, "default", {}, () => [
255
+ oe(z(e.text), 1)
324
256
  ])
325
257
  ], 38)
326
258
  ], 512),
327
- _ctx.closeMode || _ctx.$slots["right-icon"] ? (openBlock(), createElementBlock("view", {
259
+ e.closeMode || e.$slots["right-icon"] ? (a(), r("view", {
328
260
  key: 0,
329
261
  class: "nut-noticebar__page-righticon",
330
- onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.onClickIcon && _ctx.onClickIcon(...args), ["stop"]))
262
+ onClick: l[2] || (l[2] = se((...o) => e.onClickIcon && e.onClickIcon(...o), ["stop"]))
331
263
  }, [
332
- _ctx.$slots["right-icon"] ? renderSlot(_ctx.$slots, "right-icon", { key: 0 }) : (openBlock(), createBlock(_component_CircleClose, { key: 1 }))
333
- ])) : createCommentVNode("", true)
264
+ e.$slots["right-icon"] ? h(e.$slots, "right-icon", { key: 0 }) : (a(), b(m, { key: 1 }))
265
+ ])) : y("", !0)
334
266
  ], 6)), [
335
- [vShow, _ctx.showNoticebar]
336
- ]) : createCommentVNode("", true),
337
- _ctx.scrollList.length > 0 && _ctx.direction == "vertical" && _ctx.showNoticebar ? (openBlock(), createElementBlock("view", {
267
+ [ae, e.showNoticebar]
268
+ ]) : y("", !0),
269
+ e.scrollList.length > 0 && e.direction == "vertical" && e.showNoticebar ? (a(), r("view", {
338
270
  key: 1,
339
271
  class: "nut-noticebar__vertical",
340
- style: normalizeStyle(_ctx.barStyle)
272
+ style: c(e.barStyle)
341
273
  }, [
342
- _ctx.slots.default ? (openBlock(), createElementBlock("view", {
343
- key: 0,
344
- class: "nut-noticebar__vertical-list",
345
- style: normalizeStyle(_ctx.horseLampStyle)
346
- }, [
347
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
348
- return openBlock(), createBlock(_component_ScrollItem, {
349
- key: index2,
350
- style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
351
- item
352
- }, null, 8, ["style", "item"]);
353
- }), 128))
354
- ], 4)) : (openBlock(), createElementBlock("ul", {
274
+ e.slots.default ? (a(), r(L, { key: 0 }, [
275
+ u("view", {
276
+ class: "nut-noticebar__vertical-list",
277
+ style: c(e.horseLampStyle)
278
+ }, [
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))
285
+ ])
286
+ ], 4),
287
+ u("view", be, [
288
+ h(e.$slots, "default")
289
+ ])
290
+ ], 64)) : (a(), r("ul", {
355
291
  key: 1,
356
292
  class: "nut-noticebar__vertical-list",
357
- style: normalizeStyle(_ctx.horseLampStyle)
293
+ style: c(e.horseLampStyle)
358
294
  }, [
359
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
360
- return openBlock(), createElementBlock("li", {
361
- class: "nut-noticebar__vertical-item",
362
- key: index2,
363
- style: normalizeStyle({ height: _ctx.pxCheck(_ctx.height) }),
364
- onClick: ($event) => _ctx.go(item)
365
- }, toDisplayString(item), 13, _hoisted_3);
366
- }), 128))
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))
367
301
  ], 4)),
368
- createElementVNode("view", {
302
+ u("view", {
369
303
  class: "go",
370
- onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
304
+ onClick: l[4] || (l[4] = (o) => !e.slots.rightIcon && e.handleClickIcon())
371
305
  }, [
372
- renderSlot(_ctx.$slots, "right-icon", {}, () => [
373
- _ctx.closeMode ? (openBlock(), createBlock(_component_CircleClose, {
306
+ h(e.$slots, "right-icon", {}, () => [
307
+ e.closeMode ? (a(), b(m, {
374
308
  key: 0,
375
- color: _ctx.color,
309
+ color: e.color,
376
310
  size: "11px"
377
- }, null, 8, ["color"])) : createCommentVNode("", true)
311
+ }, null, 8, ["color"])) : y("", !0)
378
312
  ])
379
313
  ])
380
- ], 4)) : createCommentVNode("", true)
314
+ ], 4)) : y("", !0)
381
315
  ], 2);
382
316
  }
383
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
317
+ const Me = /* @__PURE__ */ me(ye, [["render", ve]]);
384
318
  export {
385
- index as default
319
+ Me as default
386
320
  };