@nutui/nutui 3.1.22-beta.3 → 3.1.23-beta.0

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 (207) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +20426 -4050
  4. package/dist/nutui.umd.js +20529 -4049
  5. package/dist/packages/_es/ActionSheet.js +149 -36
  6. package/dist/packages/_es/Address.js +535 -129
  7. package/dist/packages/_es/AddressList.js +615 -113
  8. package/dist/packages/_es/Animate.js +64 -0
  9. package/dist/packages/_es/Audio.js +257 -72
  10. package/dist/packages/_es/AudioOperate.js +100 -32
  11. package/dist/packages/_es/Avatar.js +162 -54
  12. package/dist/packages/_es/AvatarGroup.js +73 -14
  13. package/dist/packages/_es/BackTop.js +156 -43
  14. package/dist/packages/_es/Badge.js +86 -14
  15. package/dist/packages/_es/Barrage.js +120 -41
  16. package/dist/packages/_es/Button.js +128 -23
  17. package/dist/packages/_es/Calendar.js +246 -24
  18. package/dist/packages/_es/CalendarItem.js +2 -1
  19. package/dist/packages/_es/Card.js +107 -10
  20. package/dist/packages/_es/Cascader.js +496 -179
  21. package/dist/packages/_es/Category.js +58 -15
  22. package/dist/packages/_es/CategoryPane.js +111 -11
  23. package/dist/packages/_es/Cell.js +108 -21
  24. package/dist/packages/_es/CellGroup.js +44 -9
  25. package/dist/packages/_es/Checkbox.js +134 -29
  26. package/dist/packages/_es/CheckboxGroup.js +79 -29
  27. package/dist/packages/_es/CircleProgress.js +150 -28
  28. package/dist/packages/_es/Col.js +56 -14
  29. package/dist/packages/_es/Collapse.js +110 -24
  30. package/dist/packages/_es/CollapseItem.js +252 -80
  31. package/dist/packages/_es/Comment.js +434 -64
  32. package/dist/packages/_es/ConfigProvider.js +25 -0
  33. package/dist/packages/_es/CountDown.js +238 -75
  34. package/dist/packages/_es/CountUp.js +539 -159
  35. package/dist/packages/_es/DatePicker.js +315 -117
  36. package/dist/packages/_es/Dialog.js +289 -79
  37. package/dist/packages/_es/Divider.js +65 -32
  38. package/dist/packages/_es/Drag.js +197 -56
  39. package/dist/packages/_es/Ecard.js +159 -24
  40. package/dist/packages/_es/Elevator.js +255 -77
  41. package/dist/packages/_es/Ellipsis.js +206 -0
  42. package/dist/packages/_es/Empty.js +71 -12
  43. package/dist/packages/_es/FixedNav.js +122 -15
  44. package/dist/packages/_es/Form.js +151 -64
  45. package/dist/packages/_es/FormItem.js +114 -15
  46. package/dist/packages/_es/Grid.js +6 -5
  47. package/dist/packages/_es/GridItem.js +144 -33
  48. package/dist/packages/_es/Icon.js +40 -15
  49. package/dist/packages/_es/Image.js +142 -0
  50. package/dist/packages/_es/ImagePreview.js +547 -84
  51. package/dist/packages/_es/Indicator.js +62 -15
  52. package/dist/packages/_es/InfiniteLoading.js +249 -76
  53. package/dist/packages/_es/Input.js +433 -51
  54. package/dist/packages/_es/InputNumber.js +160 -41
  55. package/dist/packages/_es/Layout.js +5 -4
  56. package/dist/packages/_es/List.js +106 -37
  57. package/dist/packages/_es/Menu.js +168 -29
  58. package/dist/packages/_es/MenuItem.js +173 -34
  59. package/dist/packages/_es/Navbar.js +192 -30
  60. package/dist/packages/_es/NoticeBar.js +380 -93
  61. package/dist/packages/_es/Notify.js +227 -91
  62. package/dist/packages/_es/NumberKeyboard.js +272 -41
  63. package/dist/packages/_es/OldPicker.js +457 -149
  64. package/dist/packages/_es/OverLay.js +98 -40
  65. package/dist/packages/_es/Pagination.js +157 -39
  66. package/dist/packages/_es/Picker.js +460 -148
  67. package/dist/packages/_es/Popover.js +957 -337
  68. package/dist/packages/_es/Popup.js +299 -74
  69. package/dist/packages/_es/Price.js +118 -16
  70. package/dist/packages/_es/Progress.js +146 -14
  71. package/dist/packages/_es/PullRefresh.js +339 -100
  72. package/dist/packages/_es/Radio.js +90 -22
  73. package/dist/packages/_es/RadioGroup.js +37 -8
  74. package/dist/packages/_es/Range.js +408 -102
  75. package/dist/packages/_es/Rate.js +193 -16
  76. package/dist/packages/_es/Row.js +64 -22
  77. package/dist/packages/_es/SearchBar.js +238 -56
  78. package/dist/packages/_es/ShortPassword.js +225 -35
  79. package/dist/packages/_es/SideNavBar.js +81 -43
  80. package/dist/packages/_es/SideNavBarItem.js +46 -11
  81. package/dist/packages/_es/Signature.js +160 -60
  82. package/dist/packages/_es/Skeleton.js +136 -20
  83. package/dist/packages/_es/Sku.js +491 -103
  84. package/dist/packages/_es/Step.js +115 -39
  85. package/dist/packages/_es/Steps.js +53 -18
  86. package/dist/packages/_es/Sticky.js +138 -53
  87. package/dist/packages/_es/SubSideNavBar.js +82 -36
  88. package/dist/packages/_es/Swipe.js +178 -60
  89. package/dist/packages/_es/Swiper.js +433 -121
  90. package/dist/packages/_es/SwiperItem.js +53 -22
  91. package/dist/packages/_es/Switch.js +116 -21
  92. package/dist/packages/_es/TabPane.js +39 -12
  93. package/dist/packages/_es/Tabbar.js +72 -17
  94. package/dist/packages/_es/TabbarItem.js +151 -29
  95. package/dist/packages/_es/Table.js +178 -37
  96. package/dist/packages/_es/Tabs.js +202 -59
  97. package/dist/packages/_es/Tag.js +97 -20
  98. package/dist/packages/_es/TextArea.js +160 -42
  99. package/dist/packages/_es/TimeDetail.js +79 -37
  100. package/dist/packages/_es/TimePannel.js +48 -33
  101. package/dist/packages/_es/TimeSelect.js +112 -15
  102. package/dist/packages/_es/Toast.js +310 -90
  103. package/dist/packages/_es/Uploader.js +455 -120
  104. package/dist/packages/_es/Video.js +332 -93
  105. package/dist/packages/_es/common.js +128 -38
  106. package/dist/packages/_es/component.js +76 -35
  107. package/dist/packages/_es/index.js +6 -5
  108. package/dist/packages/_es/index2.js +30 -9
  109. package/dist/packages/_es/index3.js +8 -6
  110. package/dist/packages/_es/index4.js +64 -13
  111. package/dist/packages/_es/index5.js +783 -130
  112. package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
  113. package/dist/packages/_es/pxCheck.js +5 -3
  114. package/dist/packages/_es/raf.js +15 -8
  115. package/dist/packages/animate/index.scss +299 -0
  116. package/dist/packages/cell/index.scss +7 -1
  117. package/dist/packages/checkbox/index.scss +10 -0
  118. package/dist/packages/configprovider/index.scss +2 -0
  119. package/dist/packages/ellipsis/index.scss +12 -0
  120. package/dist/packages/formitem/index.scss +12 -0
  121. package/dist/packages/griditem/index.scss +11 -0
  122. package/dist/packages/image/index.scss +39 -0
  123. package/dist/packages/imagepreview/index.scss +26 -2
  124. package/dist/packages/input/index.scss +13 -0
  125. package/dist/packages/inputnumber/index.scss +21 -0
  126. package/dist/packages/locale/lang/baseLang.js +3 -3
  127. package/dist/packages/locale/lang/en-US.js +105 -5
  128. package/dist/packages/locale/lang/id-ID.js +105 -5
  129. package/dist/packages/locale/lang/index.js +38 -16
  130. package/dist/packages/locale/lang/zh-CN.js +105 -5
  131. package/dist/packages/locale/lang/zh-TW.js +105 -5
  132. package/dist/packages/menu/index.scss +45 -36
  133. package/dist/packages/menuitem/index.scss +4 -0
  134. package/dist/packages/navbar/index.scss +9 -0
  135. package/dist/packages/pagination/index.scss +19 -0
  136. package/dist/packages/radio/index.scss +18 -0
  137. package/dist/packages/range/index.scss +19 -0
  138. package/dist/packages/rate/index.scss +1 -1
  139. package/dist/packages/searchbar/index.scss +21 -0
  140. package/dist/packages/switch/index.scss +1 -0
  141. package/dist/packages/tabbar/index.scss +5 -0
  142. package/dist/packages/tabbaritem/index.scss +7 -0
  143. package/dist/packages/tabpane/index.scss +5 -0
  144. package/dist/packages/tabs/index.scss +22 -0
  145. package/dist/packages/textarea/index.scss +8 -0
  146. package/dist/smartips/attributes.json +140 -4
  147. package/dist/smartips/tags.json +55 -6
  148. package/dist/smartips/web-types.json +6963 -0
  149. package/dist/style.css +1 -1
  150. package/dist/style.es.js +1 -1
  151. package/dist/styles/font/config.json +3 -1
  152. package/dist/styles/font/demo_index.html +49 -3
  153. package/dist/styles/font/iconfont.css +11 -3
  154. package/dist/styles/font/iconfont.js +15 -15
  155. package/dist/styles/font/iconfont.json +14 -0
  156. package/dist/styles/font/iconfont.ttf +0 -0
  157. package/dist/styles/font/iconfont.woff +0 -0
  158. package/dist/styles/font/iconfont.woff2 +0 -0
  159. package/dist/styles/themes/default.scss +54 -50
  160. package/dist/styles/themes/jdb.scss +54 -50
  161. package/dist/styles/themes/jdt.scss +54 -50
  162. package/dist/styles/variables-jdb.scss +12 -0
  163. package/dist/styles/variables-jdt.scss +12 -0
  164. package/dist/styles/variables.scss +12 -0
  165. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  166. package/dist/types/__VUE/address/index.vue.d.ts +7 -7
  167. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  168. package/dist/types/__VUE/animate/type.d.ts +6 -0
  169. package/dist/types/__VUE/avatar/index.vue.d.ts +3 -3
  170. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  171. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  172. package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
  173. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  174. package/dist/types/__VUE/collapse/index.vue.d.ts +3 -1
  175. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  176. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  177. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  180. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  181. package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
  182. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  183. package/dist/types/__VUE/image/type.d.ts +6 -0
  184. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  185. package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -24
  186. package/dist/types/__VUE/menu/index.vue.d.ts +31 -4
  187. package/dist/types/__VUE/menuitem/index.vue.d.ts +12 -3
  188. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
  189. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  190. package/dist/types/__VUE/oldpicker/index.vue.d.ts +4 -4
  191. package/dist/types/__VUE/picker/index.vue.d.ts +4 -4
  192. package/dist/types/__VUE/popover/index.vue.d.ts +8 -8
  193. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  194. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  195. package/dist/types/__VUE/rate/common.d.ts +149 -0
  196. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  197. package/dist/types/__VUE/row/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  199. package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
  200. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  201. package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
  202. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  203. package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -2
  204. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  205. package/dist/types/index.d.ts +1 -1
  206. package/dist/types/nutui.d.ts +5 -1
  207. package/package.json +5 -4
@@ -1,100 +1,387 @@
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 = (a2, b2) => {
9
- for (var prop in b2 || (b2 = {}))
10
- if (__hasOwnProp.call(b2, prop))
11
- __defNormalProp(a2, prop, b2[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b2)) {
14
- if (__propIsEnum.call(b2, prop))
15
- __defNormalProp(a2, prop, b2[prop]);
16
- }
17
- return a2;
18
- };
19
- var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
20
1
  /*!
21
- * @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.0 Mon Jun 27 2022 17:55:50 GMT+0800 (中国标准时间)
22
3
  * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- import { h as e, ref as t, reactive as l, computed as o, watch as i, onMounted as n, onActivated as s, onDeactivated as a, onUnmounted as c, toRefs as r, resolveComponent as d, openBlock as p, createElementBlock as u, normalizeClass as m, withDirectives as h, normalizeStyle as y, renderSlot as f, createBlock as g, createCommentVNode as k, createElementVNode as w, createTextVNode as v, toDisplayString as C, withModifiers as b, createVNode as S, vShow as I, Fragment as L, renderList as x } from "vue";
26
- import { c as A } from "./component.js";
27
- import { _ as B } from "./plugin-vue_export-helper.js";
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";
28
9
  import "../locale/lang";
29
- const { componentName: $, create: N } = A("noticebar"), T = N({ props: { direction: { type: String, default: "across" }, list: { type: Array, default: () => [] }, standTime: { type: Number, default: 1e3 }, complexAm: { type: Boolean, default: false }, height: { type: Number, default: 40 }, text: { type: String, default: "" }, closeMode: { type: Boolean, default: false }, wrapable: { type: Boolean, default: false }, leftIcon: { type: String, default: "" }, rightIcon: { type: String, default: "" }, color: { type: String, default: "" }, background: { type: String, default: "" }, delay: { type: [String, Number], default: 1 }, scrollable: { type: Boolean, default: null }, speed: { type: Number, default: 50 } }, components: { ScrollItem: function(t2) {
30
- return t2.item.props.style = t2.style, t2.item.key = t2.key, e(t2.item);
31
- } }, emits: ["click", "close"], setup(e2, { emit: d2, slots: p2 }) {
32
- const u2 = t(null), m2 = t(null), h2 = l({ wrapWidth: 0, firstRound: true, duration: 0, offsetWidth: 0, showNoticeBar: true, animationClass: "", animate: false, scrollList: [], distance: 0, timer: null, keepAlive: false, isCanScroll: null }), y2 = o(() => ({ [$]: true })), f2 = o(() => h2.isCanScroll == null ? e2.wrapable : !h2.isCanScroll && !e2.wrapable), g2 = o(() => e2.leftIcon != "close"), k2 = o(() => {
33
- let t2 = {};
34
- return e2.color && (t2.color = e2.color), e2.background && (t2.background = e2.background), e2.direction == "vertical" && (t2.height = `${e2.height}px`), t2;
35
- }), w2 = o(() => ({ animationDelay: (h2.firstRound ? e2.delay : 0) + "s", animationDuration: h2.duration + "s", transform: `translateX(${h2.firstRound ? 0 : h2.wrapWidth + "px"})` })), v2 = o(() => {
36
- let t2 = "";
37
- return e2.leftIcon && (t2 = e2.leftIcon), t2;
38
- }), C2 = o(() => {
39
- let t2 = {};
40
- if (e2.complexAm)
41
- t2 = { transform: `translateY(${h2.distance}px)` };
42
- else if (h2.animate) {
43
- let l2 = ~~(e2.height / e2.speed / 4);
44
- t2 = { transition: `all ${l2 == 0 ? ~~(e2.height / e2.speed) : l2}s`, "margin-top": `-${e2.height}px` };
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
45
68
  }
46
- return t2;
47
- });
48
- i(() => e2.text, (e3) => {
49
- b2();
50
- }), i(() => e2.list, (e3) => {
51
- h2.scrollList = [].concat(e3);
52
- });
53
- const b2 = (t2) => {
54
- h2.showNoticeBar != 0 && setTimeout(() => {
55
- if (!u2.value || !m2.value)
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) {
56
163
  return;
57
- const t3 = u2.value.getBoundingClientRect().width, l2 = m2.value.getBoundingClientRect().width;
58
- h2.isCanScroll = e2.scrollable == null ? l2 > t3 : e2.scrollable, h2.isCanScroll ? (h2.wrapWidth = t3, h2.offsetWidth = l2, h2.duration = l2 / e2.speed, h2.animationClass = "play") : h2.animationClass = "";
59
- }, 0);
60
- }, S2 = () => {
61
- h2.animate = true, setTimeout(() => {
62
- h2.scrollList.push(h2.scrollList[0]), h2.scrollList.shift(), h2.animate = false;
63
- }, ~~(e2.height / e2.speed / 4 * 1e3));
64
- }, I2 = (t2, l2) => {
65
- setTimeout(() => {
66
- h2.distance -= e2.height / 100, l2 && (h2.scrollList.push(h2.scrollList[0]), h2.scrollList.shift(), h2.distance = 0);
67
- }, t2 * e2.speed);
68
- };
69
- return n(() => {
70
- e2.direction == "vertical" ? (p2.default ? h2.scrollList = [].concat(p2.default()[0].children) : h2.scrollList = [].concat(e2.list), setTimeout(() => {
71
- e2.complexAm ? h2.timer = setInterval(() => {
72
- for (let e3 = 0; e3 < 100; e3++)
73
- I2(e3, !(e3 < 99));
74
- }, e2.standTime + 100 * e2.speed) : (S2(), h2.timer = setInterval(S2, ~~(e2.height / e2.speed / 4 * 1e3) + e2.standTime));
75
- }, e2.standTime)) : b2(e2.text);
76
- }), s(() => {
77
- h2.keepAlive && (h2.keepAlive = false);
78
- }), a(() => {
79
- h2.keepAlive = true, clearInterval(h2.timer);
80
- }), c(() => {
81
- clearInterval(h2.timer);
82
- }), __spreadProps(__spreadValues(__spreadValues({}, r(e2)), r(h2)), { isEllipsis: f2, classes: y2, iconShow: g2, barStyle: k2, contentStyle: w2, iconBg: v2, horseLampStyle: C2, wrap: u2, content: m2, handleClick: (e3) => {
83
- d2("click", e3);
84
- }, onClickIcon: (t2) => {
85
- e2.closeMode && (h2.showNoticeBar = !e2.closeMode), d2("close", t2);
86
- }, onAnimationEnd: () => {
87
- h2.firstRound = false, setTimeout(() => {
88
- h2.duration = (h2.offsetWidth + h2.wrapWidth) / e2.speed, h2.animationClass = "play-infinite";
89
- }, 0);
90
- }, go: (e3) => {
91
- d2("click", e3);
92
- }, handleClickIcon: () => {
93
- d2("close", h2.scrollList[0]);
94
- }, slots: p2 });
95
- } }), E = { ref: "wrap", class: "wrap" }, W = ["onClick"];
96
- var M = B(T, [["render", function(e2, t2, l2, o2, i2, n2) {
97
- const s2 = d("nut-icon"), a2 = d("ScrollItem");
98
- return p(), u("view", { class: m(e2.classes) }, [e2.direction == "across" ? h((p(), u("view", { key: 0, class: m(["nut-noticebar-page", { withicon: e2.closeMode, close: e2.closeMode, wrapable: e2.wrapable }]), style: y(e2.barStyle), onClick: t2[3] || (t2[3] = (...t3) => e2.handleClick && e2.handleClick(...t3)) }, [e2.iconShow ? (p(), u("view", { key: 0, class: "left-icon", style: y({ "background-image": `url(${e2.iconBg})` }) }, [f(e2.$slots, "left-icon", {}, () => [e2.iconBg ? k("", true) : (p(), g(s2, { key: 0, name: "notice", size: "16", color: e2.color }, null, 8, ["color"]))])], 4)) : k("", true), w("view", E, [w("view", { ref: "content", class: m(["content", e2.animationClass, { "nut-ellipsis": e2.isEllipsis }]), style: y(e2.contentStyle), onAnimationend: t2[0] || (t2[0] = (...t3) => e2.onAnimationEnd && e2.onAnimationEnd(...t3)), onWebkitAnimationEnd: t2[1] || (t2[1] = (...t3) => e2.onAnimationEnd && e2.onAnimationEnd(...t3)) }, [f(e2.$slots, "default", {}, () => [v(C(e2.text), 1)])], 38)], 512), e2.closeMode || e2.rightIcon ? (p(), u("view", { key: 1, class: "right-icon", onClick: t2[2] || (t2[2] = b((...t3) => e2.onClickIcon && e2.onClickIcon(...t3), ["stop"])) }, [f(e2.$slots, "right-icon", {}, () => [S(s2, { name: e2.rightIcon ? e2.rightIcon : "close", color: e2.color }, null, 8, ["name", "color"])])])) : k("", true)], 6)), [[I, e2.showNoticeBar]]) : k("", true), e2.scrollList.length > 0 && e2.direction == "vertical" ? (p(), u("view", { key: 1, class: "nut-noticebar-vertical", style: y(e2.barStyle) }, [e2.slots.default ? (p(), u("view", { key: 0, class: "horseLamp_list", style: y(e2.horseLampStyle) }, [(p(true), u(L, null, x(e2.scrollList, (t3, l3) => (p(), g(a2, { key: l3, style: y({ height: e2.height + "px", "line-height": e2.height + "px" }), item: t3 }, null, 8, ["style", "item"]))), 128))], 4)) : (p(), u("ul", { key: 1, class: "horseLamp_list", style: y(e2.horseLampStyle) }, [(p(true), u(L, null, x(e2.scrollList, (t3, l3) => (p(), u("li", { class: "horseLamp_list_item", key: l3, style: y({ height: e2.height }), onClick: (l4) => e2.go(t3) }, C(t3), 13, W))), 128))], 4)), w("view", { class: "go", onClick: t2[4] || (t2[4] = (t3) => !e2.slots.rightIcon && e2.handleClickIcon()) }, [e2.slots.rightIcon ? f(e2.$slots, "rightIcon", { key: 0 }) : e2.closeMode ? (p(), g(s2, { key: 1, type: "cross", color: e2.color, size: "11px" }, null, 8, ["color"])) : k("", true)])], 4)) : k("", true)], 2);
99
- }]]);
100
- export { M as default };
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 };