@nutui/nutui-react-taro 1.5.2 → 1.5.3-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 (232) hide show
  1. package/CHANGELOG.md +0 -1
  2. package/dist/esm/ActionSheet.js +14 -90
  3. package/dist/esm/Address.js +21 -620
  4. package/dist/esm/Animate.js +7 -53
  5. package/dist/esm/AnimatingNumbers.js +7 -125
  6. package/dist/esm/Audio.js +19 -264
  7. package/dist/esm/Avatar.js +11 -130
  8. package/dist/esm/{AvatarContext-15733596.js → AvatarContext-c96afdcc.js} +3 -1
  9. package/dist/esm/AvatarGroup.js +11 -41
  10. package/dist/esm/BackTop.js +10 -138
  11. package/dist/esm/Badge.js +9 -71
  12. package/dist/esm/Barrage.js +8 -97
  13. package/dist/esm/Button.js +9 -108
  14. package/dist/esm/Calendar.js +20 -128
  15. package/dist/esm/CalendarItem.js +12 -674
  16. package/dist/esm/Card.js +11 -61
  17. package/dist/esm/Cascader.js +16 -671
  18. package/dist/esm/Cell.js +9 -101
  19. package/dist/esm/CellGroup.js +5 -2
  20. package/dist/esm/Checkbox.js +7 -5
  21. package/dist/esm/CheckboxGroup.js +8 -111
  22. package/dist/esm/CircleProgress.js +8 -114
  23. package/dist/esm/Col.js +7 -57
  24. package/dist/esm/Collapse.js +7 -97
  25. package/dist/esm/CollapseItem.js +8 -146
  26. package/dist/esm/ConfigProvider.js +8 -187
  27. package/dist/esm/CountDown.js +9 -247
  28. package/dist/esm/DatePicker.js +25 -309
  29. package/dist/esm/Dialog.js +17 -296
  30. package/dist/esm/Divider.js +7 -34
  31. package/dist/esm/Drag.js +7 -118
  32. package/dist/esm/Elevator.js +8 -234
  33. package/dist/esm/Ellipsis.js +10 -176
  34. package/dist/esm/Empty.js +8 -79
  35. package/dist/esm/FixedNav.js +14 -103
  36. package/dist/esm/Form.js +10 -215
  37. package/dist/esm/FormItem.js +10 -3
  38. package/dist/esm/Grid.js +11 -81
  39. package/dist/esm/GridItem.js +13 -123
  40. package/dist/esm/Icon.js +5 -2
  41. package/dist/esm/Image.js +11 -169
  42. package/dist/esm/ImagePreview.js +19 -225
  43. package/dist/esm/Indicator.js +7 -50
  44. package/dist/esm/Infiniteloading.js +14 -215
  45. package/dist/esm/Input.js +12 -362
  46. package/dist/esm/InputNumber.js +9 -275
  47. package/dist/esm/Layout.js +5 -13
  48. package/dist/esm/Menu.js +10 -153
  49. package/dist/esm/MenuItem.js +15 -175
  50. package/dist/esm/NavBar.js +9 -114
  51. package/dist/esm/NoticeBar.js +10 -568
  52. package/dist/esm/Notify.js +8 -234
  53. package/dist/esm/NumberKeyboard.js +17 -247
  54. package/dist/esm/Overlay.js +6 -2
  55. package/dist/esm/Pagination.js +9 -168
  56. package/dist/esm/Picker.js +22 -494
  57. package/dist/esm/Popover.js +12 -223
  58. package/dist/esm/Popup.js +13 -193
  59. package/dist/esm/Price.js +6 -84
  60. package/dist/esm/Progress.js +9 -122
  61. package/dist/esm/PullToRefresh.js +13 -276
  62. package/dist/esm/Radio.js +8 -4
  63. package/dist/esm/RadioGroup.js +7 -120
  64. package/dist/esm/Range.js +15 -406
  65. package/dist/esm/Rate.js +9 -121
  66. package/dist/esm/Row.js +7 -49
  67. package/dist/esm/SearchBar.js +12 -235
  68. package/dist/esm/ShortPassword.js +17 -191
  69. package/dist/esm/SideNavBar.js +19 -57
  70. package/dist/esm/SideNavBarItem.js +5 -24
  71. package/dist/esm/Signature.js +13 -153
  72. package/dist/esm/Skeleton.js +12 -98
  73. package/dist/esm/Step.js +10 -87
  74. package/dist/esm/Steps.js +8 -38
  75. package/dist/esm/Sticky.js +11 -190
  76. package/dist/esm/SubSideNavBar.js +6 -78
  77. package/dist/esm/Swipe.js +10 -230
  78. package/dist/esm/Swiper.js +9 -490
  79. package/dist/esm/SwiperItem.js +8 -36
  80. package/dist/esm/Switch.js +6 -71
  81. package/dist/esm/TabPane.js +5 -2
  82. package/dist/esm/Tabbar.js +6 -68
  83. package/dist/esm/TabbarItem.js +9 -78
  84. package/dist/esm/Table.js +12 -140
  85. package/dist/esm/Tabs.js +8 -5
  86. package/dist/esm/Tag.js +10 -110
  87. package/dist/esm/TextArea.js +9 -148
  88. package/dist/esm/TimeDetail.js +9 -67
  89. package/dist/esm/TimePannel.js +9 -29
  90. package/dist/esm/TimeSelect.js +19 -171
  91. package/dist/esm/Toast.js +7 -268
  92. package/dist/esm/TrendArrow.js +7 -99
  93. package/dist/esm/Uploader.js +17 -566
  94. package/dist/esm/{UserContext-101ad4a4.js → UserContext-0aac9a82.js} +3 -1
  95. package/dist/esm/{UserContext-2629d479.js → UserContext-e402e1a6.js} +3 -1
  96. package/dist/esm/{UserContext-b33bcf21.js → UserContext-e8176108.js} +3 -1
  97. package/dist/esm/Video.js +7 -90
  98. package/dist/esm/VirtualList.js +9 -313
  99. package/dist/esm/WaterMark.js +11 -111
  100. package/dist/esm/actionsheet.taro-e6a51446.js +53 -0
  101. package/dist/esm/address.taro-3a9b6396.js +461 -0
  102. package/dist/esm/animate.taro-fb7986d6.js +40 -0
  103. package/dist/esm/animatingnumbers.taro-03e5d61d.js +104 -0
  104. package/dist/esm/audio.taro-87ec8bf2.js +161 -0
  105. package/dist/esm/avatar.taro-3676f38f.js +103 -0
  106. package/dist/esm/avatargroup-f3574510.js +34 -0
  107. package/dist/esm/backtop.taro-66394a36.js +48 -0
  108. package/dist/esm/badge.taro-a4e59c11.js +52 -0
  109. package/dist/esm/barrage.taro-0495a1b2.js +94 -0
  110. package/dist/esm/{bem-3b438e61.js → bem-350c1702.js} +3 -6
  111. package/dist/esm/button.taro-9244d065.js +100 -0
  112. package/dist/esm/calendar.taro-670842ea.js +65 -0
  113. package/dist/esm/calendaritem.taro-2a603571.js +787 -0
  114. package/dist/esm/can-use-dom-3eeb5af4.js +6 -0
  115. package/dist/esm/card.taro-e4c76dad.js +33 -0
  116. package/dist/esm/cascader.taro-eb1fb011.js +438 -0
  117. package/dist/esm/cell.taro-a10a74d3.js +64 -0
  118. package/dist/esm/cellgroup.taro-abe501bc.js +25 -0
  119. package/dist/esm/checkbox.taro-6120e3e3.js +171 -0
  120. package/dist/esm/circleprogress.taro-79854448.js +109 -0
  121. package/dist/esm/col.taro-53eed3cc.js +41 -0
  122. package/dist/esm/collapse.taro-1a9e4ba2.js +83 -0
  123. package/dist/esm/collapseitem-4d0bc55d.js +83 -0
  124. package/dist/esm/configprovider-67d19d3a.js +19 -0
  125. package/dist/esm/configprovider.taro-8d71eb49.js +42 -0
  126. package/dist/esm/countdown.taro-5b17c607.js +226 -0
  127. package/dist/esm/datepicker.taro-6e9b4b8f.js +275 -0
  128. package/dist/esm/dialog.taro-a3267d29.js +118 -0
  129. package/dist/esm/divider.taro-26d1d8b4.js +35 -0
  130. package/dist/esm/drag.taro-79bb8744.js +110 -0
  131. package/dist/esm/elevator.taro-6019669e.js +178 -0
  132. package/dist/esm/ellipsis.taro-f15f26da.js +241 -0
  133. package/dist/esm/empty.taro-04ae4389.js +62 -0
  134. package/dist/esm/fixednav.taro-1f05acaf.js +53 -0
  135. package/dist/esm/form.taro-0c8e7a39.js +179 -0
  136. package/dist/esm/formitem.taro-190a3326.js +89 -0
  137. package/dist/esm/get-scroll-parent-b4a07e65.js +25 -0
  138. package/dist/esm/grid.taro-3503b82c.js +61 -0
  139. package/dist/esm/{grid.context-2ee27d95.js → grid.taro.context-c2bbfb4f.js} +4 -2
  140. package/dist/esm/griditem.taro-cdb3f119.js +98 -0
  141. package/dist/esm/icon-296a1bec.js +63 -0
  142. package/dist/esm/icon.taro-296a1bec.js +63 -0
  143. package/dist/esm/image.taro-142cf512.js +64 -0
  144. package/dist/esm/imagepreview.taro-c50bb0a3.js +167 -0
  145. package/dist/esm/index-5bcb0ff8.js +7 -0
  146. package/dist/esm/indicator.taro-cba8b010.js +37 -0
  147. package/dist/esm/infiniteloading.taro-183bccbf.js +144 -0
  148. package/dist/esm/input.taro-97af6c96.js +240 -0
  149. package/dist/esm/inputnumber.taro-91f65d17.js +130 -0
  150. package/dist/esm/layout.taro-9046d093.js +11 -0
  151. package/dist/esm/menu.taro-7e4038a1.js +99 -0
  152. package/dist/esm/menuitem.taro-96cc4f15.js +130 -0
  153. package/dist/esm/navbar.taro-777c4705.js +79 -0
  154. package/dist/esm/noticebar.taro-4a23cdee.js +448 -0
  155. package/dist/esm/notify.taro-e17c6f82.js +75 -0
  156. package/dist/esm/numberkeyboard.taro-1bc24744.js +159 -0
  157. package/dist/esm/nutui-react.es.js +119 -94
  158. package/dist/esm/offsetContext-c2a746fa.js +5 -0
  159. package/dist/esm/overlay.taro-21e87fb1.js +69 -0
  160. package/dist/esm/pagination.taro-715a173b.js +124 -0
  161. package/dist/esm/picker.taro-9ad1b7c5.js +473 -0
  162. package/dist/esm/popover.taro-ad5e76ea.js +156 -0
  163. package/dist/esm/popup.taro-01676bff.js +137 -0
  164. package/dist/esm/price.taro-776ed16e.js +83 -0
  165. package/dist/esm/progress.taro-f0ce38e9.js +90 -0
  166. package/dist/esm/pulltorefresh.taro-a294f656.js +181 -0
  167. package/dist/esm/radio.taro-a6eff96c.js +168 -0
  168. package/dist/esm/range.taro-d8fc7656.js +332 -0
  169. package/dist/esm/rate.taro-6cdf03bd.js +75 -0
  170. package/dist/esm/row.taro-f64d4a13.js +46 -0
  171. package/dist/esm/searchbar.taro-0c25927b.js +152 -0
  172. package/dist/esm/shortpassword.taro-9ee034f7.js +111 -0
  173. package/dist/esm/sidenavbar.taro-c307b35e.js +35 -0
  174. package/dist/esm/sidenavbaritem.taro-5a7965d0.js +12 -0
  175. package/dist/esm/signature.taro-ec4e713b.js +143 -0
  176. package/dist/esm/skeleton.taro-76faf63f.js +62 -0
  177. package/dist/esm/step.taro-b7903e8c.js +59 -0
  178. package/dist/esm/steps.taro-c82d2252.js +30 -0
  179. package/dist/esm/sticky.taro-218bda37.js +138 -0
  180. package/dist/esm/subsidenavbar.taro-69cb9752.js +63 -0
  181. package/dist/esm/supports-passive-c85ef996.js +18 -0
  182. package/dist/esm/swipe.taro-ea35f07f.js +177 -0
  183. package/dist/esm/swiper.taro-7a94e211.js +451 -0
  184. package/dist/esm/swiperitem-c9e3d0d5.js +29 -0
  185. package/dist/esm/switch.taro-34ca8228.js +50 -0
  186. package/dist/esm/tabbar.taro-9acfc2fa.js +59 -0
  187. package/dist/esm/tabbaritem.taro-bf517487.js +58 -0
  188. package/dist/esm/table.taro-91fc0c01.js +93 -0
  189. package/dist/esm/tabpane.taro-4ca340ef.js +23 -0
  190. package/dist/esm/tabs.taro-6a7524a4.js +140 -0
  191. package/dist/esm/tag.taro-23ba0834.js +92 -0
  192. package/dist/esm/textarea.taro-442e7350.js +94 -0
  193. package/dist/esm/timedetail.taro-5b2f2269.js +44 -0
  194. package/dist/esm/timepannel.taro-d6e40180.js +22 -0
  195. package/dist/esm/timeselect.taro-a07036f4.js +133 -0
  196. package/dist/esm/toast.taro-d6c14811.js +109 -0
  197. package/dist/esm/trendarrow.taro-b8c5ccd9.js +73 -0
  198. package/dist/esm/typings-b9828dba.js +9 -0
  199. package/dist/esm/uploader.taro-587e6bf3.js +492 -0
  200. package/dist/esm/useClientRect-1f8ed1fe.js +18 -0
  201. package/dist/esm/useTouch-db24bb5c.js +69 -0
  202. package/dist/esm/video-f1be8a91.js +67 -0
  203. package/dist/esm/virtuallist.taro-f0b0270d.js +214 -0
  204. package/dist/esm/watermark.taro-9ce2ae37.js +114 -0
  205. package/dist/esm/zh-CN-c779e6c1.js +131 -0
  206. package/dist/locales/base.js +1 -1
  207. package/dist/locales/en-US.js +1 -1
  208. package/dist/locales/id-ID.js +1 -1
  209. package/dist/locales/zh-CN.js +1 -1
  210. package/dist/locales/zh-TW.js +1 -1
  211. package/dist/locales/zh-UG.js +1 -1
  212. package/dist/nutui.react.mjs +13030 -14863
  213. package/dist/nutui.react.umd.js +13029 -14864
  214. package/dist/style.mjs +1 -1
  215. package/dist/types/index.d.ts +176 -183
  216. package/package.json +1 -1
  217. package/dist/esm/cellgroup-fcc72767.js +0 -34
  218. package/dist/esm/checkbox-44e13cd0.js +0 -137
  219. package/dist/esm/date-c7aad4c0.js +0 -97
  220. package/dist/esm/formitem-8a73a5fb.js +0 -157
  221. package/dist/esm/get-scroll-parent-5f85dee8.js +0 -24
  222. package/dist/esm/icon-4ef1581c.js +0 -70
  223. package/dist/esm/index-030b7245.js +0 -11
  224. package/dist/esm/offsetContext-3ab00d40.js +0 -16
  225. package/dist/esm/overlay-de6c79d5.js +0 -83
  226. package/dist/esm/radio-9f141e6b.js +0 -118
  227. package/dist/esm/render-bbebb760.js +0 -79
  228. package/dist/esm/tabpane-01075e6c.js +0 -29
  229. package/dist/esm/tabs-e1b4e4b1.js +0 -181
  230. package/dist/esm/typings-f27b58f4.js +0 -8
  231. package/dist/esm/useClientRect-56bb675b.js +0 -39
  232. package/dist/esm/useTouch-cf73a407.js +0 -99
@@ -1,43 +1,13 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- import React__default, { useRef } from 'react';
5
- import classNames from 'classnames';
6
- import { A as AvatarContext } from './AvatarContext-15733596.js';
7
- import { c as cn } from './bem-3b438e61.js';
8
- import { useConfig } from './ConfigProvider.js';
1
+ import { A as AvatarGroup } from './avatargroup-f3574510.js';
2
+ import 'react';
3
+ import 'classnames';
4
+ import './AvatarContext-c96afdcc.js';
5
+ import './bem-350c1702.js';
9
6
  import '@bem-react/classname';
10
- var defaultProps = {
11
- maxContent: '',
12
- maxCount: '',
13
- maxBgColor: '#eee',
14
- maxColor: '#666',
15
- size: '',
16
- shape: '',
17
- span: '-8',
18
- zIndex: 'left'
19
- };
20
- var AvatarGroup = function AvatarGroup(props) {
21
- useConfig();
22
- var propAvatarGroup = _objectSpread(_objectSpread({}, defaultProps), props);
23
- var className = propAvatarGroup.className,
24
- style = propAvatarGroup.style,
25
- children = propAvatarGroup.children;
26
- var avatarGroupRef = useRef(null);
27
- var b = cn('avatar-group');
28
- var cls = classNames(b(''), className);
29
- var parentAvatar = {
30
- propAvatarGroup: propAvatarGroup,
31
- avatarGroupRef: avatarGroupRef
32
- };
33
- return React__default.createElement(AvatarContext.Provider, {
34
- value: parentAvatar
35
- }, React__default.createElement("div", {
36
- className: cls,
37
- style: style,
38
- ref: avatarGroupRef
39
- }, children));
40
- };
41
- AvatarGroup.defaultProps = defaultProps;
42
- AvatarGroup.displayName = 'NutAvatarGroup';
7
+ import './configprovider-67d19d3a.js';
8
+ import 'lodash.kebabcase';
9
+ import './zh-CN-c779e6c1.js';
10
+
11
+
12
+
43
13
  export { AvatarGroup as default };
@@ -1,139 +1,11 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- import React__default, { useState, useRef, useEffect } from 'react';
6
- import Icon from './Icon.js';
7
- import { C as ComponentDefaults } from './typings-f27b58f4.js';
8
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
9
- bottom: 20,
10
- right: 10,
11
- elId: 'body',
12
- distance: 200,
13
- zIndex: 10,
14
- isAnimation: true,
15
- duration: 1000
16
- });
17
- var BackTop = function BackTop(props) {
18
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
19
- children = _defaultProps$props.children,
20
- bottom = _defaultProps$props.bottom,
21
- right = _defaultProps$props.right,
22
- elId = _defaultProps$props.elId,
23
- distance = _defaultProps$props.distance,
24
- zIndex = _defaultProps$props.zIndex,
25
- isAnimation = _defaultProps$props.isAnimation,
26
- className = _defaultProps$props.className,
27
- duration = _defaultProps$props.duration,
28
- style = _defaultProps$props.style,
29
- onClick = _defaultProps$props.onClick,
30
- iconClassPrefix = _defaultProps$props.iconClassPrefix,
31
- iconFontClassName = _defaultProps$props.iconFontClassName;
32
- var _useState = useState(false),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- backTop = _useState2[0],
35
- SetBackTop = _useState2[1];
36
- var _useState3 = useState(0),
37
- _useState4 = _slicedToArray(_useState3, 2),
38
- scrollTop = _useState4[0],
39
- SetScrollTop = _useState4[1];
40
- var startTime = 0;
41
- var scrollEl = useRef(null);
42
- // 初始化
43
- useEffect(function () {
44
- init();
45
- return function () {
46
- return removeEventListener();
47
- };
48
- }, []);
49
- var init = function init() {
50
- if (elId && document.getElementById(elId)) {
51
- scrollEl.current = document.getElementById(elId);
52
- } else {
53
- scrollEl.current = window;
54
- }
55
- addEventListener();
56
- initCancelAniFrame();
57
- };
58
- var scrollListener = function scrollListener() {
59
- var top = null;
60
- if (scrollEl.current instanceof Window) {
61
- top = scrollEl.current.pageYOffset;
62
- SetScrollTop(top);
63
- } else {
64
- top = scrollEl.current.scrollTop;
65
- SetScrollTop(top);
66
- }
67
- var showBtn = top >= distance;
68
- SetBackTop(showBtn);
69
- };
70
- var scroll = function scroll() {
71
- var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
72
- if (scrollEl.current instanceof Window) {
73
- window.scrollTo(0, y);
74
- } else {
75
- scrollEl.current.scrollTop = y;
76
- window.scrollTo(0, y);
77
- }
78
- };
79
- var scrollAnimation = function scrollAnimation() {
80
- var cid = requestAniFrame()(function fn() {
81
- var t = duration - Math.max(0, startTime - +new Date() + duration / 2);
82
- var y = t * -scrollTop / duration + scrollTop;
83
- scroll(y);
84
- cid = requestAniFrame()(fn);
85
- if (t === duration || y === 0) {
86
- window.cancelAnimationFrame(cid);
87
- }
88
- });
89
- };
90
- var initCancelAniFrame = function initCancelAniFrame() {
91
- window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
92
- };
93
- // 防频
94
- var requestAniFrame = function requestAniFrame() {
95
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) {
96
- window.setTimeout(callback, 1000 / 60);
97
- };
98
- };
99
- // 监听事件
100
- function addEventListener() {
101
- var _scrollEl$current, _scrollEl$current2;
102
- (_scrollEl$current = scrollEl.current) === null || _scrollEl$current === void 0 ? void 0 : _scrollEl$current.addEventListener('scroll', scrollListener, false);
103
- (_scrollEl$current2 = scrollEl.current) === null || _scrollEl$current2 === void 0 ? void 0 : _scrollEl$current2.addEventListener('resize', scrollListener, false);
104
- }
105
- // 移除监听事件
106
- function removeEventListener() {
107
- var _scrollEl$current3, _scrollEl$current4;
108
- (_scrollEl$current3 = scrollEl.current) === null || _scrollEl$current3 === void 0 ? void 0 : _scrollEl$current3.removeEventListener('scroll', scrollListener, false);
109
- (_scrollEl$current4 = scrollEl.current) === null || _scrollEl$current4 === void 0 ? void 0 : _scrollEl$current4.removeEventListener('resize', scrollListener, false);
110
- }
111
- // 返回顶部点击事件
112
- var goTop = function goTop(e) {
113
- onClick && onClick(e);
114
- var otime = +new Date();
115
- startTime = otime;
116
- isAnimation && duration > 0 ? scrollAnimation() : scroll();
117
- };
118
- var backTopClass = {
119
- right: "".concat(right, "px"),
120
- bottom: "".concat(bottom, "px"),
121
- zIndex: zIndex
122
- };
123
- return React__default.createElement("div", {
124
- className: "nut-backtop ".concat(backTop ? 'show' : '', " ").concat(className || ''),
125
- style: _objectSpread(_objectSpread({}, backTopClass), style),
126
- onClick: function onClick(e) {
127
- goTop(e);
128
- }
129
- }, children || React__default.createElement(Icon, {
130
- classPrefix: iconClassPrefix,
131
- fontClassName: iconFontClassName,
132
- size: "19px",
133
- className: "nut-backtop-main",
134
- name: "top"
135
- }));
136
- };
137
- BackTop.defaultProps = defaultProps;
138
- BackTop.displayName = 'NutBackTop';
1
+ import { B as BackTop } from './backtop.taro-66394a36.js';
2
+ import 'react';
3
+ import '@tarojs/taro';
4
+ import './icon.taro-296a1bec.js';
5
+ import './bem-350c1702.js';
6
+ import '@bem-react/classname';
7
+ import './typings-b9828dba.js';
8
+
9
+
10
+
139
11
  export { BackTop as default };
package/dist/esm/Badge.js CHANGED
@@ -1,73 +1,11 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- import React__default from 'react';
5
- import classNames from 'classnames';
6
- import Icon from './Icon.js';
7
- import { c as cn } from './bem-3b438e61.js';
8
- import { C as ComponentDefaults } from './typings-f27b58f4.js';
1
+ import { B as Badge } from './badge.taro-a4e59c11.js';
2
+ import 'react';
3
+ import 'classnames';
4
+ import './icon.taro-296a1bec.js';
5
+ import './bem-350c1702.js';
9
6
  import '@bem-react/classname';
10
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
11
- className: '',
12
- value: '',
13
- dot: false,
14
- max: 10000,
15
- top: '0',
16
- right: '0',
17
- zIndex: '0',
18
- color: '',
19
- icons: ''
20
- });
21
- var b = cn('badge');
22
- var Badge = function Badge(props) {
23
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
24
- className = _defaultProps$props.className,
25
- style = _defaultProps$props.style,
26
- children = _defaultProps$props.children,
27
- dot = _defaultProps$props.dot,
28
- top = _defaultProps$props.top,
29
- right = _defaultProps$props.right,
30
- zIndex = _defaultProps$props.zIndex,
31
- color = _defaultProps$props.color,
32
- icons = _defaultProps$props.icons,
33
- iconClassPrefix = _defaultProps$props.iconClassPrefix,
34
- iconFontClassName = _defaultProps$props.iconFontClassName;
35
- function content() {
36
- if (dot) return undefined;
37
- var value = props.value;
38
- var max = props.max;
39
- if (typeof value === 'number' && typeof max === 'number') {
40
- return max < value ? "".concat(max, "+") : value;
41
- }
42
- return value;
43
- }
44
- var getStyle = function getStyle() {
45
- var style = {};
46
- style.top = "".concat(Number(top) || parseFloat(top) || 0, "px");
47
- style.right = "".concat(Number(right) || parseFloat(right) || 0, "px");
48
- style.zIndex = zIndex;
49
- style.background = color;
50
- return style;
51
- };
52
- return React__default.createElement("div", {
53
- className: classNames(b(), className),
54
- style: style
55
- }, icons !== '' && React__default.createElement("div", {
56
- className: "slot-icons"
57
- }, React__default.createElement(Icon, {
58
- classPrefix: iconClassPrefix,
59
- fontClassName: iconFontClassName,
60
- className: "_icon",
61
- name: icons,
62
- color: "#ffffff",
63
- size: "12"
64
- })), React__default.createElement("div", null, children), React__default.createElement("div", {
65
- className: classNames({
66
- 'is-dot': dot
67
- }, b('content'), 'sup'),
68
- style: getStyle()
69
- }, content()));
70
- };
71
- Badge.defaultProps = defaultProps;
72
- Badge.displayName = 'NutBadge';
7
+ import './typings-b9828dba.js';
8
+
9
+
10
+
73
11
  export { Badge as default };
@@ -1,99 +1,10 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["className", "frequency", "loop", "barrageList", "speeds", "rows", "top"];
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- import React__default, { useRef, useImperativeHandle, useEffect } from 'react';
7
- import classNames from 'classnames';
8
- import { c as cn } from './bem-3b438e61.js';
1
+ import { B as Barrage } from './barrage.taro-0495a1b2.js';
2
+ import 'react';
3
+ import '@tarojs/taro';
4
+ import 'classnames';
5
+ import './bem-350c1702.js';
9
6
  import '@bem-react/classname';
10
- var defaultProps = {
11
- barrageList: [],
12
- frequency: 500,
13
- loop: true,
14
- speeds: 3000,
15
- rows: 3,
16
- top: 10
17
- };
18
- var InternalBarrage = function InternalBarrage(props, ref) {
19
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
20
- className = _defaultProps$props.className,
21
- frequency = _defaultProps$props.frequency,
22
- loop = _defaultProps$props.loop,
23
- barrageList = _defaultProps$props.barrageList,
24
- speeds = _defaultProps$props.speeds,
25
- rows = _defaultProps$props.rows,
26
- top = _defaultProps$props.top,
27
- restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
28
- var barrageBody = useRef(null);
29
- var barrageContainer = useRef(null);
30
- var barrageCWidth = useRef(0);
31
- var timer = useRef(0);
32
- var index = useRef(0);
33
- var b = cn('barrage');
34
- var classes = classNames(className, b(''));
35
- useImperativeHandle(ref, function () {
36
- return {
37
- add: function add(word) {
38
- var _index = index.current % barrageList.length;
39
- if (!loop && index.current === barrageList.length) {
40
- barrageList.splice(barrageList.length, 0, word);
41
- } else {
42
- barrageList.splice(_index, 0, word);
43
- }
44
- }
45
- };
46
- });
47
- useEffect(function () {
48
- if (barrageBody.current) {
49
- barrageCWidth.current = barrageBody.current.offsetWidth;
50
- }
51
- setTimeout(function () {
52
- var _barrageBody$current;
53
- (_barrageBody$current = barrageBody.current) === null || _barrageBody$current === void 0 ? void 0 : _barrageBody$current.style.setProperty('--move-distance', "-".concat(barrageCWidth.current, "px"));
54
- index.current = 0;
55
- run();
56
- }, 300);
57
- return function () {
58
- clearInterval(timer.current);
59
- };
60
- }, [barrageList]);
61
- var run = function run() {
62
- clearInterval(timer.current);
63
- timer.current = window.setTimeout(function () {
64
- play();
65
- }, frequency);
66
- };
67
- var play = function play() {
68
- if (!loop && index.current >= barrageList.length) {
69
- return;
70
- }
71
- var _index = loop ? index.current % barrageList.length : index.current;
72
- var el = document.createElement("div");
73
- el.innerHTML = barrageList[_index];
74
- el.classList.add('barrage-item');
75
- barrageContainer.current.appendChild(el);
76
- var width = el.offsetWidth;
77
- var height = el.offsetHeight;
78
- el.classList.add('move');
79
- el.style.animationDuration = "".concat(speeds, "ms");
80
- el.style.top = "".concat(_index % rows * (height + top) + 20, "px");
81
- el.style.width = "".concat(width, "px");
82
- el.addEventListener('animationend', function () {
83
- barrageContainer.current.removeChild(el);
84
- });
85
- index.current++;
86
- run();
87
- };
88
- return React__default.createElement("div", _objectSpread({
89
- className: classes,
90
- ref: barrageBody
91
- }, restProps), React__default.createElement("div", {
92
- ref: barrageContainer,
93
- className: "bContainer"
94
- }));
95
- };
96
- var Barrage = React__default.forwardRef(InternalBarrage);
97
- Barrage.defaultProps = defaultProps;
98
- Barrage.displayName = 'NutBarrage';
7
+
8
+
9
+
99
10
  export { Barrage as default };
@@ -1,109 +1,10 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["color", "shape", "plain", "loading", "disabled", "type", "size", "block", "icon", "iconSize", "children", "onClick", "className", "style", "iconClassPrefix", "iconFontClassName"];
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
- import React__default, { useCallback, useState, useEffect } from 'react';
8
- import Icon from './Icon.js';
9
- import { C as ComponentDefaults } from './typings-f27b58f4.js';
10
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
11
- className: '',
12
- color: '',
13
- shape: 'round',
14
- plain: false,
15
- loading: false,
16
- disabled: false,
17
- type: 'default',
18
- size: 'normal',
19
- block: false,
20
- icon: '',
21
- iconSize: '16',
22
- style: {},
23
- children: undefined,
24
- onClick: function onClick(e) {}
25
- });
26
- var Button = function Button(props) {
27
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
28
- color = _defaultProps$props.color,
29
- shape = _defaultProps$props.shape,
30
- plain = _defaultProps$props.plain,
31
- loading = _defaultProps$props.loading,
32
- disabled = _defaultProps$props.disabled,
33
- type = _defaultProps$props.type,
34
- size = _defaultProps$props.size,
35
- block = _defaultProps$props.block,
36
- icon = _defaultProps$props.icon,
37
- iconSize = _defaultProps$props.iconSize,
38
- children = _defaultProps$props.children,
39
- onClick = _defaultProps$props.onClick,
40
- className = _defaultProps$props.className,
41
- style = _defaultProps$props.style,
42
- iconClassPrefix = _defaultProps$props.iconClassPrefix,
43
- iconFontClassName = _defaultProps$props.iconFontClassName,
44
- rest = _objectWithoutProperties(_defaultProps$props, _excluded);
45
- var getStyle = useCallback(function () {
46
- var style = {};
47
- if (color) {
48
- if (plain) {
49
- style.color = color;
50
- style.background = '#fff';
51
- if (!(color !== null && color !== void 0 && color.includes('gradient'))) {
52
- style.borderColor = color;
53
- }
54
- } else {
55
- style.color = '#fff';
56
- style.background = color;
57
- }
58
- }
59
- return style;
60
- }, [color, plain]);
61
- var classes = useCallback(function () {
62
- var prefixCls = 'nut-button';
63
- return [prefixCls, "".concat(type ? "".concat(prefixCls, "--").concat(type) : ''), "".concat(size ? "".concat(prefixCls, "--").concat(size) : ''), "".concat(shape ? "".concat(prefixCls, "--").concat(shape) : ''), "".concat(plain ? "".concat(prefixCls, "--plain") : ''), "".concat(block ? "".concat(prefixCls, "--block") : ''), "".concat(disabled ? "".concat(prefixCls, "--disabled") : ''), "".concat(loading ? "".concat(prefixCls, "--loading") : '')].filter(Boolean).join(' ');
64
- }, [block, disabled, loading, plain, shape, size, type]);
65
- var _useState = useState(classes()),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- btnName = _useState2[0],
68
- setBtnName = _useState2[1];
69
- var _useState3 = useState(getStyle()),
70
- _useState4 = _slicedToArray(_useState3, 2),
71
- btnStyle = _useState4[0],
72
- setBtnStyle = _useState4[1];
73
- useEffect(function () {
74
- setBtnName(classes());
75
- setBtnStyle(getStyle());
76
- }, [className, color, shape, plain, loading, disabled, style, type, size, block, icon, iconSize, children, onClick, classes, getStyle]);
77
- var handleClick = function handleClick(e) {
78
- if (!loading && !disabled && onClick) {
79
- onClick(e);
80
- }
81
- };
82
- return (
83
- // eslint-disable-next-line react/button-has-type
84
- React__default.createElement("button", _objectSpread(_objectSpread({
85
- className: "".concat(btnName, " ").concat(className),
86
- style: _objectSpread(_objectSpread({}, btnStyle), style)
87
- }, rest), {}, {
88
- onClick: function onClick(e) {
89
- return handleClick(e);
90
- }
91
- }), React__default.createElement("div", {
92
- className: "nut-button__warp"
93
- }, loading && React__default.createElement(Icon, {
94
- classPrefix: iconClassPrefix,
95
- fontClassName: iconFontClassName,
96
- name: "loading"
97
- }), !loading && icon ? React__default.createElement(Icon, {
98
- classPrefix: iconClassPrefix,
99
- fontClassName: iconFontClassName,
100
- name: icon,
101
- size: iconSize
102
- }) : '', children && React__default.createElement("div", {
103
- className: icon || loading ? 'text' : ''
104
- }, children)))
105
- );
106
- };
107
- Button.defaultProps = defaultProps;
108
- Button.displayName = 'NutButton';
1
+ import { B as Button } from './button.taro-9244d065.js';
2
+ import 'react';
3
+ import './icon.taro-296a1bec.js';
4
+ import './bem-350c1702.js';
5
+ import '@bem-react/classname';
6
+ import './typings-b9828dba.js';
7
+
8
+
9
+
109
10
  export { Button as default };
@@ -1,129 +1,21 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- import React__default, { useRef } from 'react';
5
- import Popup from './Popup.js';
6
- import CalendarItem from './CalendarItem.js';
7
- import { U as Utils } from './date-c7aad4c0.js';
8
- import { useConfig } from './ConfigProvider.js';
9
- var defaultProps = {
10
- type: 'one',
11
- isAutoBackFill: false,
12
- poppable: true,
13
- visible: false,
14
- title: '',
15
- defaultValue: '',
16
- startDate: Utils.getDay(0),
17
- endDate: Utils.getDay(365),
18
- showToday: true,
19
- startText: '',
20
- endText: '',
21
- confirmText: '',
22
- showTitle: true,
23
- showSubTitle: true,
24
- toDateAnimation: true,
25
- onBtn: undefined,
26
- onDay: undefined,
27
- onTopInfo: undefined,
28
- onBottomInfo: undefined,
29
- onClose: function onClose() {},
30
- onChoose: function onChoose(param) {},
31
- onSelected: function onSelected(data) {},
32
- onYearMonthChange: function onYearMonthChange(param) {}
33
- };
34
- var Calendar = React__default.forwardRef(function (props, ref) {
35
- var _useConfig = useConfig(),
36
- locale = _useConfig.locale;
37
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
38
- poppable = _defaultProps$props.poppable,
39
- visible = _defaultProps$props.visible,
40
- type = _defaultProps$props.type,
41
- isAutoBackFill = _defaultProps$props.isAutoBackFill,
42
- title = _defaultProps$props.title,
43
- defaultValue = _defaultProps$props.defaultValue,
44
- startDate = _defaultProps$props.startDate,
45
- endDate = _defaultProps$props.endDate,
46
- showToday = _defaultProps$props.showToday,
47
- startText = _defaultProps$props.startText,
48
- endText = _defaultProps$props.endText,
49
- confirmText = _defaultProps$props.confirmText,
50
- showTitle = _defaultProps$props.showTitle,
51
- showSubTitle = _defaultProps$props.showSubTitle,
52
- toDateAnimation = _defaultProps$props.toDateAnimation,
53
- onBtn = _defaultProps$props.onBtn,
54
- onDay = _defaultProps$props.onDay,
55
- onTopInfo = _defaultProps$props.onTopInfo,
56
- onBottomInfo = _defaultProps$props.onBottomInfo,
57
- onClose = _defaultProps$props.onClose,
58
- onChoose = _defaultProps$props.onChoose,
59
- onSelected = _defaultProps$props.onSelected,
60
- onYearMonthChange = _defaultProps$props.onYearMonthChange;
61
- var calendarRef = useRef(null);
62
- var close = function close() {
63
- onClose && onClose();
64
- };
65
- var choose = function choose(param) {
66
- close();
67
- onChoose && onChoose(param);
68
- };
69
- var closePopup = function closePopup() {
70
- close();
71
- };
72
- var select = function select(param) {
73
- onSelected && onSelected(param);
74
- };
75
- var scrollToDate = function scrollToDate(date) {
76
- var _calendarRef$current;
77
- (_calendarRef$current = calendarRef.current) === null || _calendarRef$current === void 0 ? void 0 : _calendarRef$current.scrollToDate(date);
78
- };
79
- var yearMonthChange = function yearMonthChange(param) {
80
- onYearMonthChange && onYearMonthChange(param);
81
- };
82
- React__default.useImperativeHandle(ref, function () {
83
- return {
84
- scrollToDate: scrollToDate
85
- };
86
- });
87
- var renderItem = function renderItem() {
88
- return React__default.createElement(CalendarItem, {
89
- ref: calendarRef,
90
- type: type,
91
- isAutoBackFill: isAutoBackFill,
92
- poppable: poppable,
93
- title: title || locale.calendaritem.title,
94
- defaultValue: defaultValue,
95
- startDate: startDate,
96
- endDate: endDate,
97
- showToday: showToday,
98
- startText: startText || locale.calendaritem.start,
99
- endText: endText || locale.calendaritem.end,
100
- confirmText: confirmText || locale.calendaritem.confirm,
101
- showTitle: showTitle,
102
- showSubTitle: showSubTitle,
103
- toDateAnimation: toDateAnimation,
104
- onBtn: onBtn,
105
- onDay: onDay,
106
- onTopInfo: onTopInfo,
107
- onBottomInfo: onBottomInfo,
108
- onChoose: choose,
109
- onSelected: select,
110
- onYearMonthChange: yearMonthChange
111
- });
112
- };
113
- return React__default.createElement(React__default.Fragment, null, poppable ? React__default.createElement(Popup, {
114
- visible: visible,
115
- position: "bottom",
116
- round: true,
117
- duration: 0.5,
118
- closeable: true,
119
- destroyOnClose: true,
120
- onClickOverlay: closePopup,
121
- onClickCloseIcon: closePopup,
122
- style: {
123
- height: '85vh'
124
- }
125
- }, renderItem()) : renderItem());
126
- });
127
- Calendar.defaultProps = defaultProps;
128
- Calendar.displayName = 'NutCalendar';
1
+ import { C as Calendar } from './calendar.taro-670842ea.js';
2
+ import 'react';
3
+ import './popup.taro-01676bff.js';
4
+ import 'react-dom';
5
+ import 'react-transition-group';
6
+ import 'classnames';
7
+ import './overlay.taro-21e87fb1.js';
8
+ import './bem-350c1702.js';
9
+ import '@bem-react/classname';
10
+ import '@tarojs/components';
11
+ import './icon.taro-296a1bec.js';
12
+ import './typings-b9828dba.js';
13
+ import './calendaritem.taro-2a603571.js';
14
+ import './configprovider.taro-8d71eb49.js';
15
+ import 'lodash.kebabcase';
16
+ import './zh-CN-c779e6c1.js';
17
+ import '@tarojs/taro';
18
+
19
+
20
+
129
21
  export { Calendar as default };