@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.4

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 (236) hide show
  1. package/README.md +9 -8
  2. package/dist/nutui.es.js +3044 -3533
  3. package/dist/nutui.umd.js +3135 -3536
  4. package/dist/packages/_es/ActionSheet.js +64 -42
  5. package/dist/packages/_es/Address.js +69 -78
  6. package/dist/packages/_es/Audio.js +12 -12
  7. package/dist/packages/_es/AudioOperate.js +1 -1
  8. package/dist/packages/_es/Avatar.js +3 -3
  9. package/dist/packages/_es/BackTop.js +110 -68
  10. package/dist/packages/_es/Badge.js +3 -3
  11. package/dist/packages/_es/Barrage.js +55 -62
  12. package/dist/packages/_es/Button.js +2 -2
  13. package/dist/packages/_es/Calendar.js +27 -32
  14. package/dist/packages/_es/CalendarItem.js +3 -3
  15. package/dist/packages/_es/Card.js +5 -6
  16. package/dist/packages/_es/Cascader.js +9 -9
  17. package/dist/packages/_es/Cell.js +11 -4
  18. package/dist/packages/_es/CellGroup.js +1 -1
  19. package/dist/packages/_es/Checkbox.js +13 -3
  20. package/dist/packages/_es/CheckboxGroup.js +2 -2
  21. package/dist/packages/_es/CircleProgress.js +40 -149
  22. package/dist/packages/_es/Col.js +1 -1
  23. package/dist/packages/_es/Collapse.js +8 -34
  24. package/dist/packages/_es/CollapseItem.js +59 -90
  25. package/dist/packages/_es/CountDown.js +11 -10
  26. package/dist/packages/_es/CountUp.js +51 -43
  27. package/dist/packages/_es/DatePicker.js +22 -23
  28. package/dist/packages/_es/Dialog.js +91 -12
  29. package/dist/packages/_es/Divider.js +4 -4
  30. package/dist/packages/_es/Drag.js +54 -92
  31. package/dist/packages/_es/Ecard.js +153 -0
  32. package/dist/packages/_es/Elevator.js +50 -75
  33. package/dist/packages/_es/Empty.js +8 -7
  34. package/dist/packages/_es/FixedNav.js +10 -11
  35. package/dist/packages/_es/Form.js +5 -9
  36. package/dist/packages/_es/FormItem.js +1 -1
  37. package/dist/packages/_es/Grid.js +1 -1
  38. package/dist/packages/_es/GridItem.js +26 -8
  39. package/dist/packages/_es/Icon.js +1 -1
  40. package/dist/packages/_es/ImagePreview.js +83 -14
  41. package/dist/packages/_es/Indicator.js +3 -3
  42. package/dist/packages/_es/InfiniteLoading.js +107 -93
  43. package/dist/packages/_es/Input.js +21 -20
  44. package/dist/packages/_es/InputNumber.js +16 -23
  45. package/dist/packages/_es/Layout.js +1 -1
  46. package/dist/packages/_es/List.js +34 -41
  47. package/dist/packages/_es/Menu.js +12 -15
  48. package/dist/packages/_es/MenuItem.js +7 -7
  49. package/dist/packages/_es/Navbar.js +5 -4
  50. package/dist/packages/_es/NoticeBar.js +40 -47
  51. package/dist/packages/_es/Notify.js +166 -27
  52. package/dist/packages/_es/NumberKeyboard.js +22 -11
  53. package/dist/packages/_es/OldPicker.js +120 -122
  54. package/dist/packages/_es/OverLay.js +25 -5
  55. package/dist/packages/_es/Pagination.js +14 -13
  56. package/dist/packages/_es/Picker.js +23 -45
  57. package/dist/packages/_es/Popover.js +29 -154
  58. package/dist/packages/_es/Popup.js +69 -6
  59. package/dist/packages/_es/Price.js +5 -17
  60. package/dist/packages/_es/Progress.js +23 -19
  61. package/dist/packages/_es/PullRefresh.js +1 -1
  62. package/dist/packages/_es/Radio.js +14 -4
  63. package/dist/packages/_es/RadioGroup.js +1 -1
  64. package/dist/packages/_es/Range.js +33 -46
  65. package/dist/packages/_es/Rate.js +19 -16
  66. package/dist/packages/_es/Row.js +1 -1
  67. package/dist/packages/_es/SearchBar.js +11 -12
  68. package/dist/packages/_es/ShortPassword.js +75 -96
  69. package/dist/packages/_es/SideNavBar.js +16 -5
  70. package/dist/packages/_es/SideNavBarItem.js +1 -1
  71. package/dist/packages/_es/Signature.js +88 -69
  72. package/dist/packages/_es/Skeleton.js +11 -8
  73. package/dist/packages/_es/Sku.js +57 -49
  74. package/dist/packages/_es/Step.js +1 -1
  75. package/dist/packages/_es/Steps.js +1 -1
  76. package/dist/packages/_es/Sticky.js +23 -28
  77. package/dist/packages/_es/SubSideNavBar.js +1 -1
  78. package/dist/packages/_es/Swipe.js +26 -39
  79. package/dist/packages/_es/Swiper.js +14 -32
  80. package/dist/packages/_es/SwiperItem.js +2 -2
  81. package/dist/packages/_es/Switch.js +3 -3
  82. package/dist/packages/_es/TabPane.js +1 -1
  83. package/dist/packages/_es/Tabbar.js +3 -3
  84. package/dist/packages/_es/TabbarItem.js +21 -11
  85. package/dist/packages/_es/Table.js +18 -17
  86. package/dist/packages/_es/Tabs.js +20 -21
  87. package/dist/packages/_es/Tag.js +4 -4
  88. package/dist/packages/_es/TextArea.js +47 -48
  89. package/dist/packages/_es/TimeDetail.js +3 -4
  90. package/dist/packages/_es/TimePannel.js +3 -3
  91. package/dist/packages/_es/TimeSelect.js +7 -8
  92. package/dist/packages/_es/Toast.js +170 -41
  93. package/dist/packages/_es/Uploader.js +145 -116
  94. package/dist/packages/_es/Video.js +9 -8
  95. package/dist/packages/_es/common.js +1 -1
  96. package/dist/packages/_es/component.js +165 -3
  97. package/dist/packages/_es/index.js +6 -44
  98. package/dist/packages/_es/index2.js +31 -8
  99. package/dist/packages/_es/index3.js +7 -58
  100. package/dist/packages/_es/index4.js +56 -413
  101. package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
  102. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  103. package/dist/packages/_es/pxCheck.js +1 -1
  104. package/dist/packages/_es/raf.js +19 -0
  105. package/dist/packages/actionsheet/index.scss +8 -0
  106. package/dist/packages/ecard/index.scss +83 -0
  107. package/dist/style.css +1 -1
  108. package/dist/styles/themes/default.scss +48 -47
  109. package/dist/styles/themes/jdt.scss +48 -47
  110. package/dist/styles/variables-jdt.scss +3 -0
  111. package/dist/styles/variables.scss +3 -0
  112. package/dist/types/__VUE/actionsheet/index.d.ts +280 -0
  113. package/dist/types/__VUE/address/index.d.ts +386 -0
  114. package/dist/types/__VUE/audio/index.d.ts +92 -0
  115. package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
  116. package/dist/types/__VUE/avatar/index.d.ts +66 -0
  117. package/dist/types/__VUE/backtop/index.d.ts +105 -0
  118. package/dist/types/__VUE/badge/index.d.ts +94 -0
  119. package/dist/types/__VUE/barrage/index.d.ts +80 -0
  120. package/dist/types/__VUE/button/index.d.ts +116 -0
  121. package/dist/types/__VUE/calendar/index.d.ts +155 -0
  122. package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
  123. package/dist/types/__VUE/card/index.d.ts +81 -0
  124. package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
  125. package/dist/types/__VUE/cascader/helper.d.ts +8 -0
  126. package/dist/types/__VUE/cascader/index.d.ts +76 -0
  127. package/dist/types/__VUE/cascader/tree.d.ts +17 -0
  128. package/dist/types/__VUE/cascader/types.d.ts +30 -0
  129. package/dist/types/__VUE/cell/index.d.ts +109 -0
  130. package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
  131. package/dist/types/__VUE/checkbox/index.d.ts +102 -0
  132. package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
  133. package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
  134. package/dist/types/__VUE/col/index.d.ts +42 -0
  135. package/dist/types/__VUE/collapse/index.d.ts +104 -0
  136. package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
  137. package/dist/types/__VUE/countdown/index.d.ts +91 -0
  138. package/dist/types/__VUE/countup/index.d.ts +216 -0
  139. package/dist/types/__VUE/datepicker/index.d.ts +347 -0
  140. package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
  141. package/dist/types/__VUE/dialog/index.d.ts +306 -0
  142. package/dist/types/__VUE/divider/index.d.ts +47 -0
  143. package/dist/types/__VUE/drag/index.d.ts +61 -0
  144. package/dist/types/__VUE/ecard/index.d.ts +123 -0
  145. package/dist/types/__VUE/elevator/index.d.ts +71 -0
  146. package/dist/types/__VUE/empty/index.d.ts +47 -0
  147. package/dist/types/__VUE/fixednav/index.d.ts +96 -0
  148. package/dist/types/__VUE/form/common.d.ts +20 -0
  149. package/dist/types/__VUE/form/index.d.ts +32 -0
  150. package/dist/types/__VUE/form/types.d.ts +13 -0
  151. package/dist/types/__VUE/formitem/index.d.ts +120 -0
  152. package/dist/types/__VUE/formitem/types.d.ts +10 -0
  153. package/dist/types/__VUE/grid/common.d.ts +91 -0
  154. package/dist/types/__VUE/grid/index.d.ts +100 -0
  155. package/dist/types/__VUE/griditem/index.d.ts +80 -0
  156. package/dist/types/__VUE/icon/index.d.ts +74 -0
  157. package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
  158. package/dist/types/__VUE/indicator/index.d.ts +70 -0
  159. package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
  160. package/dist/types/__VUE/input/index.d.ts +337 -0
  161. package/dist/types/__VUE/input/util.d.ts +5 -0
  162. package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
  163. package/dist/types/__VUE/layout/index.d.ts +13 -0
  164. package/dist/types/__VUE/list/index.d.ts +48 -0
  165. package/dist/types/__VUE/menu/index.d.ts +51 -0
  166. package/dist/types/__VUE/menuitem/index.d.ts +77 -0
  167. package/dist/types/__VUE/navbar/index.d.ts +83 -0
  168. package/dist/types/__VUE/noticebar/index.d.ts +209 -0
  169. package/dist/types/__VUE/notify/index.d.ts +103 -0
  170. package/dist/types/__VUE/numberkeyboard/index.d.ts +124 -0
  171. package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
  172. package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
  173. package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
  174. package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
  175. package/dist/types/__VUE/overlay/index.d.ts +1614 -0
  176. package/dist/types/__VUE/pagination/index.d.ts +112 -0
  177. package/dist/types/__VUE/picker/Column.d.ts +90 -0
  178. package/dist/types/__VUE/picker/index.d.ts +343 -0
  179. package/dist/types/__VUE/picker/types.d.ts +26 -0
  180. package/dist/types/__VUE/popover/index.d.ts +233 -0
  181. package/dist/types/__VUE/popup/index.d.ts +1734 -0
  182. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
  183. package/dist/types/__VUE/price/index.d.ts +87 -0
  184. package/dist/types/__VUE/progress/index.d.ts +138 -0
  185. package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
  186. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
  187. package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
  188. package/dist/types/__VUE/radio/index.d.ts +90 -0
  189. package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
  190. package/dist/types/__VUE/range/index.d.ts +156 -0
  191. package/dist/types/__VUE/rate/index.d.ts +142 -0
  192. package/dist/types/__VUE/row/index.d.ts +63 -0
  193. package/dist/types/__VUE/searchbar/index.d.ts +100 -0
  194. package/dist/types/__VUE/shortpassword/index.d.ts +137 -0
  195. package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
  196. package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
  197. package/dist/types/__VUE/signature/index.d.ts +73 -0
  198. package/dist/types/__VUE/skeleton/common.d.ts +63 -0
  199. package/dist/types/__VUE/skeleton/index.d.ts +117 -0
  200. package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
  201. package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
  202. package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
  203. package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
  204. package/dist/types/__VUE/sku/index.d.ts +300 -0
  205. package/dist/types/__VUE/step/index.d.ts +70 -0
  206. package/dist/types/__VUE/steps/index.d.ts +47 -0
  207. package/dist/types/__VUE/sticky/index.d.ts +63 -0
  208. package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
  209. package/dist/types/__VUE/swipe/index.d.ts +69 -0
  210. package/dist/types/__VUE/swiper/index.d.ts +163 -0
  211. package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
  212. package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
  213. package/dist/types/__VUE/switch/index.d.ts +136 -0
  214. package/dist/types/__VUE/tabbar/index.d.ts +84 -0
  215. package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
  216. package/dist/types/__VUE/table/common.d.ts +55 -0
  217. package/dist/types/__VUE/table/index.d.ts +76 -0
  218. package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
  219. package/dist/types/__VUE/table/types.d.ts +19 -0
  220. package/dist/types/__VUE/tabpane/index.d.ts +47 -0
  221. package/dist/types/__VUE/tabs/index.d.ts +128 -0
  222. package/dist/types/__VUE/tag/index.d.ts +89 -0
  223. package/dist/types/__VUE/textarea/index.d.ts +121 -0
  224. package/dist/types/__VUE/timedetail/index.d.ts +48 -0
  225. package/dist/types/__VUE/timepannel/index.d.ts +43 -0
  226. package/dist/types/__VUE/timeselect/index.d.ts +82 -0
  227. package/dist/types/__VUE/toast/index.d.ts +149 -0
  228. package/dist/types/__VUE/uploader/index.d.ts +258 -0
  229. package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
  230. package/dist/types/__VUE/video/index.d.ts +123 -0
  231. package/dist/{index.d.ts → types/index.d.ts} +0 -0
  232. package/dist/types/nutui.d.ts +93 -0
  233. package/package.json +14 -5
  234. package/dist/nutui.d.ts +0 -104
  235. package/dist/packages/_es/use-lock-scroll.js +0 -23
  236. package/dist/packages/_es/util.js +0 -47
@@ -1,37 +1,14 @@
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
1
  /*!
21
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
22
3
  * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, createVNode, normalizeStyle, withCtx, renderSlot, createElementVNode, normalizeClass, withModifiers } from "vue";
6
+ import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
26
7
  import { c as createComponent } from "./component.js";
27
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
9
  const { componentName, create } = createComponent("backtop");
29
10
  const _sfc_main = create({
30
11
  props: {
31
- height: {
32
- type: String,
33
- default: "100vh"
34
- },
35
12
  bottom: {
36
13
  type: Number,
37
14
  default: 20
@@ -40,20 +17,35 @@ const _sfc_main = create({
40
17
  type: Number,
41
18
  default: 10
42
19
  },
20
+ elId: {
21
+ type: [String, Element],
22
+ default: "body"
23
+ },
24
+ distance: {
25
+ type: Number,
26
+ default: 200
27
+ },
43
28
  zIndex: {
44
29
  type: Number,
45
30
  default: 10
46
31
  },
47
- distance: {
32
+ isAnimation: {
33
+ type: Boolean,
34
+ default: true
35
+ },
36
+ duration: {
48
37
  type: Number,
49
- default: 200
38
+ default: 1e3
50
39
  }
51
40
  },
52
41
  emits: ["click"],
53
42
  setup(props, { emit }) {
54
43
  const state = reactive({
55
44
  backTop: false,
56
- scrollTop: 1
45
+ scrollTop: 0,
46
+ scrollEl: window,
47
+ startTime: 0,
48
+ keepAlive: false
57
49
  });
58
50
  const classes = computed(() => {
59
51
  const prefixCls = componentName;
@@ -69,52 +61,102 @@ const _sfc_main = create({
69
61
  zIndex: props.zIndex
70
62
  };
71
63
  });
72
- const scroll = (e) => {
73
- state.scrollTop = 2;
74
- state.backTop = e.detail.scrollTop >= props.distance;
75
- };
76
- const click = (e) => {
77
- state.scrollTop = 1;
64
+ function scrollListener() {
65
+ if (state.scrollEl instanceof Window) {
66
+ state.scrollTop = state.scrollEl.pageYOffset;
67
+ } else {
68
+ state.scrollTop = state.scrollEl.scrollTop;
69
+ }
70
+ state.backTop = state.scrollTop >= props.distance;
71
+ }
72
+ function scroll(y = 0) {
73
+ if (state.scrollEl instanceof Window) {
74
+ window.scrollTo(0, y);
75
+ } else {
76
+ state.scrollEl.scrollTop = y;
77
+ }
78
+ }
79
+ function scrollAnimation() {
80
+ let cid = requestAniFrame()(function fn() {
81
+ var t = props.duration - Math.max(0, state.startTime - +new Date() + props.duration);
82
+ var y = t * -state.scrollTop / props.duration + state.scrollTop;
83
+ scroll(y);
84
+ cid = requestAniFrame()(fn);
85
+ if (t == props.duration || y == 0) {
86
+ window.cancelAnimationFrame(cid);
87
+ }
88
+ });
89
+ }
90
+ function addEventListener() {
91
+ state.scrollEl.addEventListener("scroll", scrollListener, false);
92
+ state.scrollEl.addEventListener("resize", scrollListener, false);
93
+ }
94
+ function removeEventListener() {
95
+ state.scrollEl.removeEventListener("scroll", scrollListener, false);
96
+ state.scrollEl.removeEventListener("resize", scrollListener, false);
97
+ }
98
+ function initCancelAniFrame() {
99
+ window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
100
+ }
101
+ function requestAniFrame() {
102
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
103
+ window.setTimeout(callback, 1e3 / 60);
104
+ };
105
+ }
106
+ function click(e) {
107
+ state.startTime = +new Date();
108
+ props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
78
109
  emit("click", e);
79
- };
80
- return __spreadProps(__spreadValues({}, toRefs(state)), {
110
+ }
111
+ function init() {
112
+ if (props.elId && document.getElementById(props.elId)) {
113
+ state.scrollEl = document.getElementById(props.elId);
114
+ }
115
+ addEventListener();
116
+ initCancelAniFrame();
117
+ }
118
+ onMounted(() => {
119
+ if (props.distance == 0) {
120
+ state.backTop = true;
121
+ }
122
+ init();
123
+ });
124
+ onUnmounted(() => {
125
+ removeEventListener();
126
+ });
127
+ onActivated(() => {
128
+ if (state.keepAlive) {
129
+ state.keepAlive = false;
130
+ init();
131
+ }
132
+ });
133
+ onDeactivated(() => {
134
+ state.keepAlive = true;
135
+ removeEventListener();
136
+ });
137
+ return {
138
+ state,
81
139
  classes,
82
140
  style,
83
- scroll,
84
141
  click
85
- });
142
+ };
86
143
  }
87
144
  });
88
145
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
89
- const _component_scroll_view = resolveComponent("scroll-view");
90
146
  const _component_nut_icon = resolveComponent("nut-icon");
91
- return openBlock(), createElementBlock("view", null, [
92
- createVNode(_component_scroll_view, {
93
- "scroll-y": true,
94
- style: normalizeStyle({ height: _ctx.height }),
95
- onScroll: _ctx.scroll,
96
- "scroll-top": _ctx.scrollTop,
97
- "scroll-with-animation": "true"
98
- }, {
99
- default: withCtx(() => [
100
- renderSlot(_ctx.$slots, "content")
101
- ]),
102
- _: 3
103
- }, 8, ["style", "onScroll", "scroll-top"]),
104
- createElementVNode("view", {
105
- class: normalizeClass(_ctx.classes),
106
- style: normalizeStyle(_ctx.style),
107
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
108
- }, [
109
- renderSlot(_ctx.$slots, "icon", {}, () => [
110
- createVNode(_component_nut_icon, {
111
- size: "19px",
112
- class: "nut-backtop-main",
113
- name: "top"
114
- })
115
- ])
116
- ], 6)
117
- ]);
147
+ return openBlock(), createElementBlock("div", {
148
+ class: normalizeClass(_ctx.classes),
149
+ style: normalizeStyle(_ctx.style),
150
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
151
+ }, [
152
+ renderSlot(_ctx.$slots, "default", {}, () => [
153
+ createVNode(_component_nut_icon, {
154
+ size: "19px",
155
+ class: "nut-backtop-main",
156
+ name: "top"
157
+ })
158
+ ])
159
+ ], 6);
118
160
  }
119
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
120
- export { index_taro as default };
161
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
162
+ export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -86,5 +86,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
86
86
  ])
87
87
  ]);
88
88
  }
89
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
90
- export { index_taro as default };
89
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
90
+ export { index as default };
@@ -1,11 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, computed, onMounted, onUnmounted, onDeactivated, watch, reactive, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
6
+ import { computed, ref, onMounted, onUnmounted, onDeactivated, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import Taro from "@tarojs/taro";
9
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
9
  const { componentName, create } = createComponent("barrage");
11
10
  const _sfc_main = create({
@@ -16,7 +15,7 @@ const _sfc_main = create({
16
15
  },
17
16
  frequency: {
18
17
  type: Number,
19
- default: 200
18
+ default: 500
20
19
  },
21
20
  speeds: {
22
21
  type: Number,
@@ -37,89 +36,83 @@ const _sfc_main = create({
37
36
  },
38
37
  emits: ["click"],
39
38
  setup(props, { emit }) {
40
- const timeId = ref(new Date().getTime());
41
- const danmuList = ref(props.danmu);
42
- const rows = ref(props.rows);
43
- const top = ref(props.top);
44
- const speeds = props.speeds;
45
39
  const classes = computed(() => {
46
40
  const prefixCls = componentName;
47
41
  return {
48
- [prefixCls]: true,
49
- ["dmBody" + timeId.value]: true
42
+ [prefixCls]: true
50
43
  };
51
44
  });
45
+ let dmBody = ref(document.createElement("div"));
46
+ let dmContainer = ref(document.createElement("div"));
47
+ let timer = 0;
48
+ const danmuList = ref(props.danmu);
49
+ const rows = ref(props.rows);
50
+ const top = ref(props.top);
51
+ const index2 = ref(0);
52
+ const speeds = props.speeds;
53
+ const danmuCWidth = ref(0);
52
54
  onMounted(() => {
53
- runStep();
55
+ danmuCWidth.value = dmBody.value.offsetWidth;
56
+ run();
54
57
  });
55
58
  onUnmounted(() => {
56
- danmuList.value = [];
59
+ clearInterval(timer);
60
+ timer = 0;
57
61
  });
58
62
  onDeactivated(() => {
59
- danmuList.value = [];
63
+ clearInterval(timer);
64
+ timer = 0;
60
65
  });
61
66
  watch(() => props.danmu, (newValue, oldVlaue) => {
62
67
  danmuList.value = [...newValue];
63
68
  });
64
69
  const add = (word) => {
65
- danmuList.value = [...danmuList.value, word];
66
- runStep();
70
+ const _index = index2.value % danmuList.value.length;
71
+ danmuList.value.splice(_index, 0, word);
67
72
  };
68
- const getNode = (index) => {
69
- const query = Taro.createSelectorQuery();
70
- setTimeout(() => {
71
- let width = 100;
72
- query.select(".dmBody" + timeId.value).boundingClientRect((rec) => {
73
- width = rec.width || 300;
74
- });
75
- query.select(".dmitem" + index).boundingClientRect((recs) => {
76
- let height = recs.height;
77
- let nodeTop = index % rows.value * (height + top.value) + 20 + "px";
78
- styleInfo(index, nodeTop, width);
79
- }).exec();
80
- }, 500);
73
+ const run = () => {
74
+ clearInterval(timer);
75
+ timer = 0;
76
+ timer = setInterval(() => {
77
+ play();
78
+ run();
79
+ }, props.frequency);
81
80
  };
82
- const runStep = () => {
83
- danmuList.value.forEach((item, index) => {
84
- getNode(index);
81
+ const play = () => {
82
+ const _index = props.loop ? index2.value % danmuList.value.length : index2.value;
83
+ let el = document.createElement(`view`);
84
+ el.innerHTML = danmuList.value[_index];
85
+ el.classList.add("dmitem");
86
+ dmContainer.value.appendChild(el);
87
+ nextTick(() => {
88
+ const width = el.offsetWidth;
89
+ const height = el.offsetHeight;
90
+ el.classList.add("move");
91
+ el.style.animationDuration = `${speeds}ms`;
92
+ el.style.top = _index % rows.value * (height + top.value) + 20 + "px";
93
+ el.style.width = width + 20 + "px";
94
+ el.style.setProperty("--move-distance", `-${danmuCWidth.value}px`);
95
+ el.dataset.index = `${_index}`;
96
+ el.addEventListener("animationend", () => {
97
+ dmContainer.value.removeChild(el);
98
+ });
99
+ index2.value++;
85
100
  });
86
101
  };
87
- let styleList = reactive([]);
88
- const styleInfo = (index, nodeTop, width) => {
89
- let timeIndex = index - rows.value > 0 ? index - rows.value : 0;
90
- let list = styleList;
91
- let time = list[timeIndex] ? Number(list[timeIndex]["--time"]) : 0;
92
- let obj = {
93
- top: nodeTop,
94
- "--time": `${props.frequency * index + time}`,
95
- animationDuration: `${speeds}ms`,
96
- animationIterationCount: `${props.loop ? "infinite" : 1}`,
97
- animationDelay: `${props.frequency * index + time}ms`,
98
- "--move-distance": `-${width}px`
99
- };
100
- styleList.push(obj);
101
- };
102
- return { classes, danmuList, add, styleList };
102
+ return { classes, danmuList, dmBody, dmContainer, add };
103
103
  }
104
104
  });
105
105
  const _hoisted_1 = {
106
- class: "dmContainer",
107
- id: "dmContainer"
106
+ ref: "dmContainer",
107
+ class: "dmContainer"
108
108
  };
109
109
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
110
110
  return openBlock(), createElementBlock("view", {
111
- class: normalizeClass(["dmBody", _ctx.classes])
111
+ ref: "dmBody",
112
+ class: normalizeClass(_ctx.classes)
112
113
  }, [
113
- createElementVNode("view", _hoisted_1, [
114
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.danmuList, (item, index) => {
115
- return openBlock(), createElementBlock("view", {
116
- key: "danmu" + index,
117
- class: normalizeClass(["dmitem", "dmitem" + index, "move"]),
118
- style: normalizeStyle(_ctx.styleList[index])
119
- }, toDisplayString(item.length > 8 ? item.substr(0, 8) + "..." : item), 7);
120
- }), 128))
121
- ])
114
+ createElementVNode("view", _hoisted_1, null, 512)
122
115
  ], 2);
123
116
  }
124
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
125
- export { index_taro as default };
117
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
118
+ export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -104,7 +104,7 @@ const _sfc_main = create({
104
104
  const _hoisted_1 = { class: "nut-button__warp" };
105
105
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
106
106
  const _component_nut_icon = resolveComponent("nut-icon");
107
- return openBlock(), createElementBlock("button", {
107
+ return openBlock(), createElementBlock("view", {
108
108
  class: normalizeClass(_ctx.classes),
109
109
  style: normalizeStyle(_ctx.getStyle),
110
110
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createSlots, renderSlot, createCommentVNode } from "vue";
6
+ import { computed, ref, resolveComponent, openBlock, createBlock, withCtx, createSlots, renderSlot, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { C as CalendarItem, U as Utils } from "./index.taro.js";
8
+ import { C as CalendarItem, U as Utils } from "./index5.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
- import "@tarojs/taro";
10
+ import "./raf.js";
11
11
  const { create } = createComponent("calendar");
12
12
  const _sfc_main = create({
13
13
  components: {
@@ -44,19 +44,19 @@ const _sfc_main = create({
44
44
  },
45
45
  title: {
46
46
  type: String,
47
- default: "\u65E5\u5386\u9009\u62E9"
47
+ default: ""
48
48
  },
49
49
  confirmText: {
50
50
  type: String,
51
- default: "\u786E\u8BA4"
51
+ default: ""
52
52
  },
53
53
  startText: {
54
54
  type: String,
55
- default: "\u5F00\u59CB"
55
+ default: ""
56
56
  },
57
57
  endText: {
58
58
  type: String,
59
- default: "\u7ED3\u675F"
59
+ default: ""
60
60
  },
61
61
  defaultValue: {
62
62
  type: [String, Array]
@@ -84,14 +84,11 @@ const _sfc_main = create({
84
84
  const bottomInfo = computed(() => {
85
85
  return slots.bottomInfo;
86
86
  });
87
- let show = ref(props.visible);
88
87
  const calendarRef = ref(null);
89
88
  const update = () => {
90
- show.value = false;
91
89
  emit("update:visible", false);
92
90
  };
93
91
  const close = () => {
94
- show.value = false;
95
92
  emit("close");
96
93
  emit("update:visible", false);
97
94
  };
@@ -99,22 +96,18 @@ const _sfc_main = create({
99
96
  close();
100
97
  emit("choose", param);
101
98
  };
102
- const closePopup = () => {
103
- close();
104
- };
105
99
  const select = (param) => {
106
100
  emit("select", param);
107
101
  };
108
- watch(() => props.visible, (value) => {
109
- show.value = value;
110
- });
102
+ const closePopup = () => {
103
+ close();
104
+ };
111
105
  return {
112
- show,
113
106
  closePopup,
114
107
  update,
115
108
  close,
116
- select,
117
109
  choose,
110
+ select,
118
111
  calendarRef,
119
112
  showTopBtn,
120
113
  topInfo,
@@ -128,23 +121,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
128
121
  const _component_nut_popup = resolveComponent("nut-popup");
129
122
  return _ctx.poppable ? (openBlock(), createBlock(_component_nut_popup, {
130
123
  key: 0,
131
- visible: _ctx.show,
132
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.show = $event),
124
+ visible: _ctx.visible,
133
125
  position: "bottom",
134
126
  round: "",
135
- closeable: "",
127
+ closeable: true,
136
128
  onClickOverlay: _ctx.closePopup,
137
129
  onClickCloseIcon: _ctx.closePopup,
130
+ "destroy-on-close": true,
138
131
  style: { height: "85vh" }
139
132
  }, {
140
133
  default: withCtx(() => [
141
- _ctx.show ? (openBlock(), createBlock(_component_nut_calendar_item, {
134
+ _ctx.visible ? (openBlock(), createBlock(_component_nut_calendar_item, {
142
135
  key: 0,
136
+ props: "",
143
137
  ref: "calendarRef",
144
138
  type: _ctx.type,
145
139
  "is-auto-back-fill": _ctx.isAutoBackFill,
146
140
  poppable: _ctx.poppable,
147
141
  title: _ctx.title,
142
+ "confirm-text": _ctx.confirmText,
143
+ "start-text": _ctx.startText,
144
+ "end-text": _ctx.endText,
148
145
  "default-value": _ctx.defaultValue,
149
146
  "start-date": _ctx.startDate,
150
147
  "end-date": _ctx.endDate,
@@ -152,9 +149,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
152
149
  onClose: _ctx.close,
153
150
  onChoose: _ctx.choose,
154
151
  onSelect: _ctx.select,
155
- "confirm-text": _ctx.confirmText,
156
- "start-text": _ctx.startText,
157
- "end-text": _ctx.endText,
158
152
  "show-today": _ctx.showToday,
159
153
  "show-title": _ctx.showTitle,
160
154
  "show-sub-title": _ctx.showSubTitle
@@ -189,7 +183,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
189
183
  })
190
184
  ])
191
185
  } : void 0
192
- ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "confirm-text", "start-text", "end-text", "show-today", "show-title", "show-sub-title"])) : createCommentVNode("", true)
186
+ ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title"])) : createCommentVNode("", true)
193
187
  ]),
194
188
  _: 3
195
189
  }, 8, ["visible", "onClickOverlay", "onClickCloseIcon"])) : (openBlock(), createBlock(_component_nut_calendar_item, {
@@ -204,12 +198,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
204
198
  "default-value": _ctx.defaultValue,
205
199
  "start-date": _ctx.startDate,
206
200
  "end-date": _ctx.endDate,
201
+ onUpdate: _ctx.update,
207
202
  onClose: _ctx.close,
208
203
  onChoose: _ctx.choose,
209
204
  onSelect: _ctx.select,
205
+ "show-today": _ctx.showToday,
210
206
  "show-title": _ctx.showTitle,
211
- "show-sub-title": _ctx.showSubTitle,
212
- "show-today": _ctx.showToday
207
+ "show-sub-title": _ctx.showSubTitle
213
208
  }, createSlots({ _: 2 }, [
214
209
  _ctx.showTopBtn ? {
215
210
  name: "btn",
@@ -241,7 +236,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
241
236
  })
242
237
  ])
243
238
  } : void 0
244
- ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onClose", "onChoose", "onSelect", "show-title", "show-sub-title", "show-today"]));
239
+ ]), 1032, ["type", "is-auto-back-fill", "poppable", "title", "confirm-text", "start-text", "end-text", "default-value", "start-date", "end-date", "onUpdate", "onClose", "onChoose", "onSelect", "show-today", "show-title", "show-sub-title"]));
245
240
  }
246
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
247
- export { index_taro as default };
241
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
242
+ export { index as default };
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import "vue";
7
7
  import "./component.js";
8
- import "@tarojs/taro";
9
- export { C as default } from "./index.taro.js";
8
+ export { C as default } from "./index5.js";
9
+ import "./raf.js";
10
10
  import "./plugin-vue_export-helper.js";
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { c as createComponent } from "./component.js";
7
- import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, createVNode, createBlock, createCommentVNode, Fragment, withCtx, createTextVNode } from "vue";
7
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, createVNode, createBlock, Fragment, withCtx, createTextVNode } from "vue";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  const { create } = createComponent("card");
10
10
  const _sfc_main = create({
@@ -75,8 +75,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
75
75
  key: 1,
76
76
  class: "nut-card__right__price__origin",
77
77
  price: _ctx.vipPrice
78
- }, null, 8, ["price"])),
79
- _ctx.isHaveSlot("tag") ? renderSlot(_ctx.$slots, "tag", { key: 2 }) : createCommentVNode("", true)
78
+ }, null, 8, ["price"]))
80
79
  ]),
81
80
  createElementVNode("div", _hoisted_7, [
82
81
  _ctx.isHaveSlot("shop-tag") ? renderSlot(_ctx.$slots, "shop-tag", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
@@ -101,5 +100,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
101
100
  ])
102
101
  ]);
103
102
  }
104
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
105
- export { index_taro as default };
103
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
104
+ export { index as default };