@nutui/nutui-react 1.2.3-beta.4 → 2.0.0-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 (210) hide show
  1. package/dist/esm/Avatar.js +7 -5
  2. package/dist/esm/CalendarItem.js +19 -15
  3. package/dist/esm/CheckboxGroup.js +0 -1
  4. package/dist/esm/Drag.js +1 -1
  5. package/dist/esm/Icon/style/index.js +1 -0
  6. package/dist/esm/Icon.js +2 -2
  7. package/dist/esm/Input.js +8 -2
  8. package/dist/esm/InputNumber.js +11 -11
  9. package/dist/esm/NoticeBar.js +67 -28
  10. package/dist/esm/Notify.js +17 -3
  11. package/dist/esm/Picker.js +9 -4
  12. package/dist/esm/Popover.js +56 -72
  13. package/dist/esm/Price.js +14 -3
  14. package/dist/esm/Progress.js +1 -1
  15. package/dist/esm/Range.js +9 -3
  16. package/dist/esm/TabbarItem.js +1 -1
  17. package/dist/esm/Tag.js +1 -1
  18. package/dist/esm/TextArea.js +3 -0
  19. package/dist/esm/Toast.js +22 -12
  20. package/dist/esm/Uploader.js +16 -6
  21. package/dist/esm/{icon-62bd7379.js → icon-8dc4de10.js} +9 -9
  22. package/dist/locales/base.js +1 -1
  23. package/dist/locales/en-US.js +1 -1
  24. package/dist/locales/id-ID.js +1 -1
  25. package/dist/locales/zh-CN.js +1 -1
  26. package/dist/locales/zh-TW.js +1 -1
  27. package/dist/nutui.react.es.js +215 -152
  28. package/dist/nutui.react.umd.js +215 -152
  29. package/dist/packages/col/col.scss +2 -2
  30. package/dist/packages/collapseitem/collapseitem.scss +1 -2
  31. package/dist/packages/icon/icon.scss +104 -12
  32. package/dist/packages/noticebar/noticebar.scss +31 -15
  33. package/dist/packages/notify/notify.scss +9 -0
  34. package/dist/packages/popover/popover.scss +205 -83
  35. package/dist/packages/rate/rate.scss +14 -13
  36. package/dist/packages/toast/toast.scss +16 -13
  37. package/dist/style.css +1 -1
  38. package/dist/style.es.js +1 -1
  39. package/dist/styles/animation/icon.scss +245 -0
  40. package/dist/styles/animation/index.scss +1 -0
  41. package/dist/styles/font/config.json +169 -0
  42. package/dist/styles/font/demo_index.html +210 -3
  43. package/dist/styles/font/iconfont.css +39 -3
  44. package/dist/styles/font/iconfont.js +32 -32
  45. package/dist/styles/font/iconfont.json +63 -0
  46. package/dist/styles/font/iconfont.ttf +0 -0
  47. package/dist/styles/font/iconfont.woff +0 -0
  48. package/dist/styles/font/iconfont.woff2 +0 -0
  49. package/dist/styles/variables.scss +23 -7
  50. package/dist/types/actionsheet/actionsheet.taro.d.ts +20 -0
  51. package/dist/types/actionsheet/index.taro.d.ts +2 -0
  52. package/dist/types/address/address.taro.d.ts +34 -0
  53. package/dist/types/address/index.taro.d.ts +2 -0
  54. package/dist/types/animatingnumbers/animatingnumbers.taro.d.ts +12 -0
  55. package/dist/types/animatingnumbers/countup.taro.d.ts +11 -0
  56. package/dist/types/animatingnumbers/index.taro.d.ts +2 -0
  57. package/dist/types/avatar/avatar.taro.d.ts +17 -0
  58. package/dist/types/avatar/index.taro.d.ts +2 -0
  59. package/dist/types/avatargroup/index.taro.d.ts +2 -0
  60. package/dist/types/backtop/backtop.taro.d.ts +15 -0
  61. package/dist/types/backtop/index.taro.d.ts +2 -0
  62. package/dist/types/badge/badge.taro.d.ts +14 -0
  63. package/dist/types/badge/index.taro.d.ts +2 -0
  64. package/dist/types/barrage/barrage.taro.d.ts +12 -0
  65. package/dist/types/barrage/index.taro.d.ts +2 -0
  66. package/dist/types/button/button.taro.d.ts +20 -0
  67. package/dist/types/button/index.taro.d.ts +2 -0
  68. package/dist/types/calendar/calendar.taro.d.ts +14 -0
  69. package/dist/types/calendar/index.taro.d.ts +2 -0
  70. package/dist/types/calendaritem/calendaritem.taro.d.ts +17 -0
  71. package/dist/types/calendaritem/index.taro.d.ts +2 -0
  72. package/dist/types/card/card.taro.d.ts +17 -0
  73. package/dist/types/card/index.taro.d.ts +2 -0
  74. package/dist/types/cell/cell.taro.d.ts +20 -0
  75. package/dist/types/cell/index.taro.d.ts +2 -0
  76. package/dist/types/cellgroup/cellgroup.taro.d.ts +10 -0
  77. package/dist/types/cellgroup/index.taro.d.ts +2 -0
  78. package/dist/types/checkbox/checkbox.taro.d.ts +19 -0
  79. package/dist/types/checkbox/index.taro.d.ts +2 -0
  80. package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +8 -0
  81. package/dist/types/checkboxgroup/index.taro.d.ts +2 -0
  82. package/dist/types/circleprogress/circleprogress.taro.d.ts +15 -0
  83. package/dist/types/circleprogress/index.taro.d.ts +2 -0
  84. package/dist/types/col/col.taro.d.ts +10 -0
  85. package/dist/types/col/index.taro.d.ts +2 -0
  86. package/dist/types/collapse/collapse.taro.d.ts +12 -0
  87. package/dist/types/collapse/index.taro.d.ts +2 -0
  88. package/dist/types/collapseitem/index.taro.d.ts +2 -0
  89. package/dist/types/configprovider/configprovider.taro.d.ts +12 -0
  90. package/dist/types/configprovider/index.taro.d.ts +2 -0
  91. package/dist/types/countdown/countdown.taro.d.ts +15 -0
  92. package/dist/types/countdown/index.taro.d.ts +2 -0
  93. package/dist/types/datepicker/datepicker.taro.d.ts +27 -0
  94. package/dist/types/datepicker/index.taro.d.ts +2 -0
  95. package/dist/types/dialog/dialog.taro.d.ts +2 -0
  96. package/dist/types/dialog/index.taro.d.ts +2 -0
  97. package/dist/types/divider/divider.taro.d.ts +12 -0
  98. package/dist/types/divider/index.taro.d.ts +2 -0
  99. package/dist/types/drag/drag.taro.d.ts +14 -0
  100. package/dist/types/drag/index.taro.d.ts +2 -0
  101. package/dist/types/elevator/elevator.taro.d.ts +22 -0
  102. package/dist/types/elevator/index.taro.d.ts +2 -0
  103. package/dist/types/empty/empty.taro.d.ts +8 -0
  104. package/dist/types/empty/index.taro.d.ts +2 -0
  105. package/dist/types/fixednav/fixednav.taro.d.ts +22 -0
  106. package/dist/types/fixednav/index.taro.d.ts +2 -0
  107. package/dist/types/icon/icon.d.ts +9 -3
  108. package/dist/types/icon/icon.taro.d.ts +19 -0
  109. package/dist/types/icon/index.taro.d.ts +2 -0
  110. package/dist/types/indicator/index.taro.d.ts +2 -0
  111. package/dist/types/indicator/indicator.taro.d.ts +10 -0
  112. package/dist/types/infiniteloading/index.taro.d.ts +2 -0
  113. package/dist/types/infiniteloading/infiniteloading.taro.d.ts +20 -0
  114. package/dist/types/input/index.taro.d.ts +2 -0
  115. package/dist/types/input/input.taro.d.ts +57 -0
  116. package/dist/types/inputnumber/index.taro.d.ts +2 -0
  117. package/dist/types/inputnumber/inputnumber.taro.d.ts +22 -0
  118. package/dist/types/layout/index.taro.d.ts +2 -0
  119. package/dist/types/layout/layout.taro.d.ts +4 -0
  120. package/dist/types/navbar/index.taro.d.ts +2 -0
  121. package/dist/types/navbar/navbar.taro.d.ts +21 -0
  122. package/dist/types/noticebar/demo.d.ts +1 -0
  123. package/dist/types/noticebar/index.taro.d.ts +2 -0
  124. package/dist/types/noticebar/noticebar.d.ts +1 -1
  125. package/dist/types/noticebar/noticebar.taro.d.ts +23 -0
  126. package/dist/types/notify/Notification.d.ts +8 -7
  127. package/dist/types/notify/index.taro.d.ts +2 -0
  128. package/dist/types/notify/notify.taro.d.ts +10 -0
  129. package/dist/types/numberkeyboard/index.taro.d.ts +2 -0
  130. package/dist/types/numberkeyboard/numberkeyboard.taro.d.ts +20 -0
  131. package/dist/types/overlay/index.taro.d.ts +2 -0
  132. package/dist/types/overlay/overlay.taro.d.ts +12 -0
  133. package/dist/types/pagination/index.taro.d.ts +2 -0
  134. package/dist/types/pagination/pagination.taro.d.ts +19 -0
  135. package/dist/types/picker/index.taro.d.ts +2 -0
  136. package/dist/types/picker/picker.d.ts +1 -0
  137. package/dist/types/picker/picker.taro.d.ts +24 -0
  138. package/dist/types/picker/pickerSlot.d.ts +1 -0
  139. package/dist/types/popover/__tests__/popover.spec.d.ts +1 -0
  140. package/dist/types/popover/index.taro.d.ts +2 -0
  141. package/dist/types/popover/popover.d.ts +14 -7
  142. package/dist/types/popover/popover.taro.d.ts +21 -0
  143. package/dist/types/popup/index.taro.d.ts +2 -0
  144. package/dist/types/popup/popup.taro.d.ts +25 -0
  145. package/dist/types/price/index.taro.d.ts +2 -0
  146. package/dist/types/price/price.taro.d.ts +11 -0
  147. package/dist/types/progress/index.taro.d.ts +2 -0
  148. package/dist/types/progress/progress.taro.d.ts +26 -0
  149. package/dist/types/radio/index.taro.d.ts +2 -0
  150. package/dist/types/radio/radio.taro.d.ts +21 -0
  151. package/dist/types/radiogroup/index.taro.d.ts +2 -0
  152. package/dist/types/range/index.taro.d.ts +2 -0
  153. package/dist/types/range/range.taro.d.ts +25 -0
  154. package/dist/types/rate/index.taro.d.ts +2 -0
  155. package/dist/types/rate/rate.taro.d.ts +17 -0
  156. package/dist/types/row/index.taro.d.ts +2 -0
  157. package/dist/types/row/row.taro.d.ts +12 -0
  158. package/dist/types/searchbar/index.taro.d.ts +2 -0
  159. package/dist/types/searchbar/searchbar.taro.d.ts +60 -0
  160. package/dist/types/shortpassword/index.taro.d.ts +2 -0
  161. package/dist/types/shortpassword/shortpassword.taro.d.ts +21 -0
  162. package/dist/types/sidenavbar/index.taro.d.ts +2 -0
  163. package/dist/types/sidenavbar/sidenavbar.taro.d.ts +3 -0
  164. package/dist/types/sidenavbaritem/index.taro.d.ts +2 -0
  165. package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -0
  166. package/dist/types/signature/index.taro.d.ts +2 -0
  167. package/dist/types/signature/signature.taro.d.ts +11 -0
  168. package/dist/types/skeleton/index.taro.d.ts +2 -0
  169. package/dist/types/skeleton/skeleton.taro.d.ts +19 -0
  170. package/dist/types/step/index.taro.d.ts +2 -0
  171. package/dist/types/steps/index.taro.d.ts +2 -0
  172. package/dist/types/steps/steps.taro.d.ts +10 -0
  173. package/dist/types/subsidenavbar/index.taro.d.ts +2 -0
  174. package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +3 -0
  175. package/dist/types/swiper/index.taro.d.ts +2 -0
  176. package/dist/types/swiper/swiper.taro.d.ts +27 -0
  177. package/dist/types/swiperitem/index.taro.d.ts +2 -0
  178. package/dist/types/switch/index.taro.d.ts +2 -0
  179. package/dist/types/switch/switch.taro.d.ts +14 -0
  180. package/dist/types/tabbar/index.taro.d.ts +2 -0
  181. package/dist/types/tabbar/tabbar.taro.d.ts +14 -0
  182. package/dist/types/tabbaritem/index.taro.d.ts +2 -0
  183. package/dist/types/tabbaritem/tabbaritem.taro.d.ts +17 -0
  184. package/dist/types/table/index.taro.d.ts +2 -0
  185. package/dist/types/table/table.taro.d.ts +3 -0
  186. package/dist/types/tabpane/index.taro.d.ts +2 -0
  187. package/dist/types/tabpane/tabpane.taro.d.ts +10 -0
  188. package/dist/types/tabs/index.taro.d.ts +2 -0
  189. package/dist/types/tabs/tabs.taro.d.ts +30 -0
  190. package/dist/types/tag/index.taro.d.ts +2 -0
  191. package/dist/types/tag/tag.taro.d.ts +16 -0
  192. package/dist/types/textarea/index.taro.d.ts +2 -0
  193. package/dist/types/textarea/textarea.taro.d.ts +18 -0
  194. package/dist/types/timedetail/index.taro.d.ts +2 -0
  195. package/dist/types/timedetail/timedetail.taro.d.ts +13 -0
  196. package/dist/types/timepannel/index.taro.d.ts +2 -0
  197. package/dist/types/timepannel/timepannel.taro.d.ts +8 -0
  198. package/dist/types/timeselect/index.taro.d.ts +2 -0
  199. package/dist/types/timeselect/timeselect.taro.d.ts +21 -0
  200. package/dist/types/toast/Notification.d.ts +6 -4
  201. package/dist/types/toast/__test__/toast.spec.d.ts +1 -0
  202. package/dist/types/toast/index.taro.d.ts +2 -0
  203. package/dist/types/toast/toast.taro.d.ts +11 -0
  204. package/dist/types/uploader/index.taro.d.ts +2 -0
  205. package/dist/types/uploader/uploader.d.ts +2 -2
  206. package/dist/types/uploader/uploader.taro.d.ts +68 -0
  207. package/dist/types/video/index.taro.d.ts +2 -0
  208. package/dist/types/virtuallist/index.taro.d.ts +2 -0
  209. package/dist/types/virtuallist/virtuallist.taro.d.ts +3 -0
  210. package/package.json +15 -4
@@ -72,8 +72,8 @@ var Avatar = function Avatar(props) {
72
72
  height: sizeValue.indexOf(size) > -1 ? '' : "".concat(size, "px"),
73
73
  backgroundColor: "".concat(bgColor),
74
74
  color: "".concat(color),
75
- marginLeft: avatarIndex != 1 && parent !== null && parent !== void 0 && (_parent$propAvatarGro3 = parent.propAvatarGroup) !== null && _parent$propAvatarGro3 !== void 0 && _parent$propAvatarGro3.span ? "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro4 = parent.propAvatarGroup) === null || _parent$propAvatarGro4 === void 0 ? void 0 : _parent$propAvatarGro4.span, "px") : '',
76
- zIndex: (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro5 = parent.propAvatarGroup) === null || _parent$propAvatarGro5 === void 0 ? void 0 : _parent$propAvatarGro5.zIndex) == 'right' ? "".concat(Math.abs(maxSum - avatarIndex)) : ''
75
+ marginLeft: avatarIndex !== 1 && parent !== null && parent !== void 0 && (_parent$propAvatarGro3 = parent.propAvatarGroup) !== null && _parent$propAvatarGro3 !== void 0 && _parent$propAvatarGro3.span ? "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro4 = parent.propAvatarGroup) === null || _parent$propAvatarGro4 === void 0 ? void 0 : _parent$propAvatarGro4.span, "px") : '',
76
+ zIndex: (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro5 = parent.propAvatarGroup) === null || _parent$propAvatarGro5 === void 0 ? void 0 : _parent$propAvatarGro5.zIndex) === 'right' ? "".concat(Math.abs(maxSum - avatarIndex)) : ''
77
77
  }, style);
78
78
 
79
79
  var maxStyles = {
@@ -95,17 +95,19 @@ var Avatar = function Avatar(props) {
95
95
  var _avatarRef$current, _avatarRef$current$da, _parent$propAvatarGro8;
96
96
 
97
97
  for (var i = 0; i < children.length; i++) {
98
- if (children[i] && children[i].classList && children[i].classList[0] == 'nut-avatar') {
98
+ console.log('child', children[i], children[i].classList);
99
+
100
+ if (children[i] && children[i].classList && children[i].classList[0] === 'nut-avatar') {
99
101
  children[i].setAttribute('data-index', i + 1);
100
102
  }
101
103
  }
102
104
 
103
- var index = avatarRef === null || avatarRef === void 0 ? void 0 : (_avatarRef$current = avatarRef.current) === null || _avatarRef$current === void 0 ? void 0 : (_avatarRef$current$da = _avatarRef$current.dataset) === null || _avatarRef$current$da === void 0 ? void 0 : _avatarRef$current$da.index;
105
+ var index = Number(avatarRef === null || avatarRef === void 0 ? void 0 : (_avatarRef$current = avatarRef.current) === null || _avatarRef$current === void 0 ? void 0 : (_avatarRef$current$da = _avatarRef$current.dataset) === null || _avatarRef$current$da === void 0 ? void 0 : _avatarRef$current$da.index);
104
106
  var maxCount = parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro8 = parent.propAvatarGroup) === null || _parent$propAvatarGro8 === void 0 ? void 0 : _parent$propAvatarGro8.maxCount;
105
107
  setMaxSum(children.length);
106
108
  setAvatarIndex(index);
107
109
 
108
- if (index == children.length && index != maxCount && children.length > maxCount) {
110
+ if (index === children.length && index !== maxCount && children.length > maxCount) {
109
111
  setShowMax(true);
110
112
  }
111
113
  };
@@ -138,7 +138,7 @@ var CalendarItem = function CalendarItem(props) {
138
138
  return "".concat(state.dayPrefix, "-disabled");
139
139
  }
140
140
 
141
- if (state.isRange && Array.isArray(state.currDate) && Object.values(state.currDate).length == 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
141
+ if (state.isRange && Array.isArray(state.currDate) && Object.values(state.currDate).length === 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
142
142
  return "".concat(state.dayPrefix, "-choose");
143
143
  }
144
144
 
@@ -149,7 +149,7 @@ var CalendarItem = function CalendarItem(props) {
149
149
  };
150
150
 
151
151
  var isActive = function isActive(day, month) {
152
- return state.isRange && day.type == 'curr' && getClass(day, month) == 'calendar-month-day-active';
152
+ return state.isRange && day.type === 'curr' && getClass(day, month) === 'calendar-month-day-active';
153
153
  };
154
154
 
155
155
  var isCurrDay = function isCurrDay(month, day) {
@@ -158,7 +158,7 @@ var CalendarItem = function CalendarItem(props) {
158
158
  };
159
159
 
160
160
  var confirm = function confirm() {
161
- if (state.isRange && state.chooseData.length == 2 || !state.isRange) {
161
+ if (state.isRange && state.chooseData.length === 2 || !state.isRange) {
162
162
  onChoose && onChoose(state.chooseData);
163
163
 
164
164
  if (poppable) {
@@ -168,7 +168,7 @@ var CalendarItem = function CalendarItem(props) {
168
168
  };
169
169
 
170
170
  var chooseDay = function chooseDay(day, month, isFirst, isRange) {
171
- if (getClass(day, month, isRange) != "".concat(state.dayPrefix, "-disabled")) {
171
+ if (getClass(day, month, isRange) !== "".concat(state.dayPrefix, "-disabled")) {
172
172
  var days = _toConsumableArray(month.curData);
173
173
 
174
174
  days = isRange ? days.splice(3) : days.splice(0, 3);
@@ -188,7 +188,7 @@ var CalendarItem = function CalendarItem(props) {
188
188
  Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
189
189
  }
190
190
 
191
- if (state.chooseData.length == 2 || !state.chooseData.length) {
191
+ if (state.chooseData.length === 2 || !state.chooseData.length) {
192
192
  state.chooseData = _toConsumableArray(days);
193
193
  } else if (Utils.compareDate(state.chooseData[3], days[3])) {
194
194
  state.chooseData = [_toConsumableArray(state.chooseData), _toConsumableArray(days)];
@@ -215,24 +215,28 @@ var CalendarItem = function CalendarItem(props) {
215
215
 
216
216
 
217
217
  var isEndTip = function isEndTip(day, month) {
218
+ if (isStartTip(day, month)) {
219
+ return false;
220
+ }
221
+
218
222
  return isActive(day, month);
219
223
  }; // 获取当前月数据
220
224
 
221
225
 
222
226
  var getCurrData = function getCurrData(type) {
223
- var monthData = type == 'prev' ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
227
+ var monthData = type === 'prev' ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
224
228
  var year = parseInt(monthData.curData[0]);
225
229
  var month = parseInt(monthData.curData[1].toString().replace(/^0/, ''));
226
230
 
227
231
  switch (type) {
228
232
  case 'prev':
229
- month == 1 && (year -= 1);
230
- month = month == 1 ? 12 : --month;
233
+ month === 1 && (year -= 1);
234
+ month = month === 1 ? 12 : --month;
231
235
  break;
232
236
 
233
237
  case 'next':
234
- month == 12 && (year += 1);
235
- month = month == 12 ? 1 : ++month;
238
+ month === 12 && (year += 1);
239
+ month = month === 12 ? 1 : ++month;
236
240
  break;
237
241
  }
238
242
 
@@ -242,7 +246,7 @@ var CalendarItem = function CalendarItem(props) {
242
246
 
243
247
  var getDaysStatus = function getDaysStatus(days, type) {
244
248
  // 修复:当某个月的1号是周日时,月份下方会空出来一行
245
- if (type == 'prev' && days >= 7) {
249
+ if (type === 'prev' && days >= 7) {
246
250
  days -= 7;
247
251
  }
248
252
 
@@ -268,7 +272,7 @@ var CalendarItem = function CalendarItem(props) {
268
272
  monthData: [].concat(_toConsumableArray(getDaysStatus(preMonthDays, 'prev')), _toConsumableArray(getDaysStatus(currMonthDays, 'curr')))
269
273
  };
270
274
 
271
- if (type == 'next') {
275
+ if (type === 'next') {
272
276
  if (!state.endData || !Utils.compareDate("".concat(state.endData[0], "-").concat(state.endData[1], "-").concat(Utils.getMonthDays(state.endData[0], state.endData[1])), "".concat(curData[0], "-").concat(curData[1], "-").concat(curData[2]))) {
273
277
  state.monthsData.push(monthInfo);
274
278
  }
@@ -344,7 +348,7 @@ var CalendarItem = function CalendarItem(props) {
344
348
  updateMove = -offsetHeight + h;
345
349
  }
346
350
 
347
- if (offsetHeight <= h && state.monthsData.length == 1) {
351
+ if (offsetHeight <= h && state.monthsData.length === 1) {
348
352
  updateMove = 0;
349
353
  }
350
354
 
@@ -358,7 +362,7 @@ var CalendarItem = function CalendarItem(props) {
358
362
  updateMove = -offsetHeight + h - 100;
359
363
  }
360
364
 
361
- if (updateMove < 0 && updateMove < -100 && state.monthsData.length == 1) {
365
+ if (updateMove < 0 && updateMove < -100 && state.monthsData.length === 1) {
362
366
  updateMove = -100;
363
367
  }
364
368
 
@@ -536,7 +540,7 @@ var CalendarItem = function CalendarItem(props) {
536
540
  className: "calendar-curr-tips"
537
541
  }, locale.calendaritem.today) : '', isStartTip(day, month) ? React__default.createElement("div", {
538
542
  className: "calendar-day-tip"
539
- }, locale.calendaritem.start) : isEndTip(day, month) ? React__default.createElement("div", {
543
+ }, locale.calendaritem.start) : '', isEndTip(day, month) ? React__default.createElement("div", {
540
544
  className: "calendar-day-tip"
541
545
  }, locale.calendaritem.end) : '');
542
546
  }))));
@@ -49,7 +49,6 @@ var CheckboxGroup = React__default.forwardRef(function (props, ref) {
49
49
  var childrenLabel = [];
50
50
  React__default.Children.map(children, function (child) {
51
51
  var childProps = child.props;
52
- console.log(child);
53
52
  childrenLabel.push(childProps.label || child.children);
54
53
  });
55
54
  setInnerValue(childrenLabel);
package/dist/esm/Drag.js CHANGED
@@ -94,7 +94,7 @@ var Drag = function Drag(props) {
94
94
  });
95
95
 
96
96
  if (last) {
97
- if (props.direction != 'y' && props.attract) {
97
+ if (props.direction !== 'y' && props.attract) {
98
98
  if (x < middleLine.current) {
99
99
  api.start({
100
100
  x: boundaryState.left,
@@ -1,2 +1,3 @@
1
+
1
2
 
2
3
  require('../../../packages/icon/icon.scss')
package/dist/esm/Icon.js CHANGED
@@ -1,5 +1,5 @@
1
- import { I as Icon } from './icon-62bd7379.js';
2
- export { I as default } from './icon-62bd7379.js';
1
+ import { I as Icon } from './icon-8dc4de10.js';
2
+ export { I as default } from './icon-8dc4de10.js';
3
3
  import 'react';
4
4
  import './bem-893ad28d.js';
5
5
  import '@bem-react/classname';
package/dist/esm/Input.js CHANGED
@@ -181,7 +181,7 @@ var Input = function Input(props) {
181
181
  var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'onChange';
182
182
  var val = value;
183
183
 
184
- if (type === 'digit') {
184
+ if (type === 'digit' || type === 'tel') {
185
185
  val = formatNumber(val, false, false);
186
186
  }
187
187
 
@@ -189,6 +189,12 @@ var Input = function Input(props) {
189
189
  val = formatNumber(val, true, true);
190
190
  }
191
191
 
192
+ if (type === 'tel' && !formatter) {
193
+ var regTel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
194
+ var regNumber = /[^-0-9]/g;
195
+ val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, '');
196
+ }
197
+
192
198
  if (formatter && trigger === formatTrigger) {
193
199
  val = formatter(val);
194
200
  }
@@ -356,7 +362,7 @@ var Input = function Input(props) {
356
362
  className: "nut-input-clear",
357
363
  name: clearIcon,
358
364
  size: clearSize,
359
- click: function click(e) {
365
+ onClick: function onClick(e) {
360
366
  handleClear(e);
361
367
  }
362
368
  }) : null, rightIcon && rightIcon.length > 0 ? React__default.createElement("div", {
@@ -89,16 +89,16 @@ var InputNumber = function InputNumber(props) {
89
89
  };
90
90
 
91
91
  var emitChange = function emitChange(value, e) {
92
- var output_value = fixedDecimalPlaces(value);
93
- change && change(output_value, e);
92
+ var outputValue = fixedDecimalPlaces(value);
93
+ change && change(outputValue, e);
94
94
 
95
95
  if (!isAsync) {
96
- if (Number(output_value) < Number(min)) {
96
+ if (Number(outputValue) < Number(min)) {
97
97
  setInputValue(Number(min));
98
- } else if (Number(output_value) > Number(max)) {
98
+ } else if (Number(outputValue) > Number(max)) {
99
99
  setInputValue(Number(max));
100
100
  } else {
101
- setInputValue(output_value);
101
+ setInputValue(outputValue);
102
102
  }
103
103
  }
104
104
  };
@@ -107,8 +107,8 @@ var InputNumber = function InputNumber(props) {
107
107
  reduce && reduce(e);
108
108
 
109
109
  if (reduceAllow()) {
110
- var output_value = Number(inputValue) - Number(step);
111
- emitChange(output_value, e);
110
+ var outputValue = Number(inputValue) - Number(step);
111
+ emitChange(outputValue, e);
112
112
  } else {
113
113
  overlimit && overlimit(e);
114
114
  }
@@ -118,8 +118,8 @@ var InputNumber = function InputNumber(props) {
118
118
  add && add(e);
119
119
 
120
120
  if (addAllow()) {
121
- var output_value = Number(inputValue) + Number(step);
122
- emitChange(output_value, e);
121
+ var outputValue = Number(inputValue) + Number(step);
122
+ emitChange(outputValue, e);
123
123
  } else {
124
124
  overlimit && overlimit(e);
125
125
  }
@@ -167,7 +167,7 @@ var InputNumber = function InputNumber(props) {
167
167
  className: iconMinusClasses,
168
168
  size: buttonSize,
169
169
  name: "minus",
170
- click: reduceNumber
170
+ onClick: reduceNumber
171
171
  }), React__default.createElement("input", {
172
172
  type: "number",
173
173
  min: min,
@@ -185,7 +185,7 @@ var InputNumber = function InputNumber(props) {
185
185
  className: iconAddClasses,
186
186
  size: buttonSize,
187
187
  name: "plus",
188
- click: addNumber
188
+ onClick: addNumber
189
189
  }));
190
190
  };
191
191
 
@@ -24,7 +24,7 @@ var defaultProps = {
24
24
  color: '',
25
25
  background: '',
26
26
  delay: 1,
27
- scrollable: true,
27
+ scrollable: null,
28
28
  speed: 50
29
29
  };
30
30
 
@@ -101,6 +101,11 @@ var NoticeBar = function NoticeBar(props) {
101
101
  timer = _useState18[0],
102
102
  SetTimer = _useState18[1];
103
103
 
104
+ var _useState19 = useState(null),
105
+ _useState20 = _slicedToArray(_useState19, 2),
106
+ isCanScroll = _useState20[0],
107
+ SetIsCanScroll = _useState20[1];
108
+
104
109
  useState(0);
105
110
  useEffect(function () {
106
111
  if (direction === 'vertical') {
@@ -131,12 +136,14 @@ var NoticeBar = function NoticeBar(props) {
131
136
 
132
137
  var cloneChild = function cloneChild(listItem, listIndex) {
133
138
  return React__default.Children.map(children, function (child, index) {
134
- if (child && index == listIndex) {
139
+ if (child && index === listIndex) {
135
140
  return React__default.cloneElement(child, {
136
141
  key: listIndex,
137
142
  children: listItem
138
143
  });
139
144
  }
145
+
146
+ return null;
140
147
  });
141
148
  };
142
149
 
@@ -161,8 +168,10 @@ var NoticeBar = function NoticeBar(props) {
161
168
 
162
169
  var wrapW = wrap.current.getBoundingClientRect().width;
163
170
  var offsetW = content.current.getBoundingClientRect().width;
171
+ var canScroll = scrollable == null ? offsetW > wrapW : scrollable;
172
+ SetIsCanScroll(canScroll);
164
173
 
165
- if (scrollable && offsetW > wrapW) {
174
+ if (canScroll) {
166
175
  SetWrapWidth(wrapW);
167
176
  SetOffsetW(offsetW);
168
177
  SetDuration(offsetW / speed);
@@ -170,7 +179,7 @@ var NoticeBar = function NoticeBar(props) {
170
179
  } else {
171
180
  SetAnimationClass('');
172
181
  }
173
- });
182
+ }, 0);
174
183
  };
175
184
 
176
185
  var handleClick = function handleClick(event) {
@@ -249,19 +258,47 @@ var NoticeBar = function NoticeBar(props) {
249
258
  close && close(scrollList[0]);
250
259
  };
251
260
 
261
+ var iconShow = function iconShow() {
262
+ if (leftIcon === 'close') {
263
+ return false;
264
+ }
265
+
266
+ return true;
267
+ };
268
+
269
+ var iconBg = function iconBg() {
270
+ var iconBg = '';
271
+
272
+ if (leftIcon) {
273
+ iconBg = leftIcon;
274
+ }
275
+
276
+ return iconBg;
277
+ };
278
+
279
+ var isEllipsis = function isEllipsis() {
280
+ if (isCanScroll == null) {
281
+ return wrapable;
282
+ }
283
+
284
+ return !isCanScroll && !wrapable;
285
+ };
286
+
252
287
  var contentStyle = {
253
- paddingLeft: firstRound ? 0 : "".concat(wrapWidth, "px"),
254
- animationDelay: "".concat(firstRound ? props.delay : 0, "s"),
255
- animationDuration: "".concat(duration, "s")
288
+ // paddingLeft: firstRound ? 0 : `${wrapWidth}px`,
289
+ animationDelay: "".concat(firstRound ? delay : 0, "s"),
290
+ animationDuration: "".concat(duration, "s"),
291
+ transform: "translateX(".concat(firstRound ? 0 : "".concat(wrapWidth, "px"), ")")
256
292
  };
257
293
  var barStyle = {
258
294
  color: color,
259
295
  background: background,
260
- height: direction == 'vertical' ? "".concat(height, "px") : ''
296
+ height: direction === 'vertical' ? "".concat(height, "px") : ''
261
297
  };
298
+ var duringTime = ~~(height / speed / 4);
262
299
  var horseLampStyle = {
263
300
  transform: complexAm ? "translateY(".concat(distance, "px)") : '',
264
- transition: animate ? "all ".concat(~~(height / speed / 4), "s") : '',
301
+ transition: animate ? "all ".concat(duringTime === 0 ? ~~(height / speed) : duringTime, "s") : '',
265
302
  marginTop: animate ? "-".concat(height, "px") : ''
266
303
  };
267
304
  var b = cn('noticebar');
@@ -274,34 +311,34 @@ var NoticeBar = function NoticeBar(props) {
274
311
  return React__default.createElement("div", {
275
312
  className: "".concat(b(), " ").concat(className || ''),
276
313
  style: style
277
- }, showNoticeBar && direction == 'across' ? React__default.createElement("div", {
314
+ }, showNoticeBar && direction === 'across' ? React__default.createElement("div", {
278
315
  className: noticebarClass,
279
316
  style: barStyle,
280
317
  onClick: handleClick
281
- }, React__default.createElement("div", {
318
+ }, iconShow() ? React__default.createElement("div", {
282
319
  className: "left-icon",
283
320
  style: {
284
- backgroundImage: "url(".concat(leftIcon || '', ")")
321
+ backgroundImage: "url(".concat(iconBg() || '', ")")
285
322
  }
286
- }, !leftIcon ? React__default.createElement(Icon, {
323
+ }, !iconBg() ? React__default.createElement(Icon, {
287
324
  name: "notice",
288
325
  size: "16",
289
326
  color: color
290
- }) : null), React__default.createElement("div", {
327
+ }) : null) : null, React__default.createElement("div", {
291
328
  ref: wrap,
292
329
  className: "wrap"
293
330
  }, React__default.createElement("div", {
294
331
  ref: content,
295
- className: "content ".concat(animationClass, " ").concat(!scrollable && !wrapable && 'nut-ellipsis'),
332
+ className: "content ".concat(animationClass, " ").concat(isEllipsis() && 'nut-ellipsis'),
296
333
  style: contentStyle,
297
334
  onAnimationEnd: onAnimationEnd
298
- }, children, text)), closeMode ? React__default.createElement("div", {
335
+ }, children, text)), closeMode || rightIcon ? React__default.createElement("div", {
299
336
  className: "right-icon",
300
337
  onClick: onClickIcon
301
338
  }, React__default.createElement(Icon, {
302
- name: "close",
339
+ name: rightIcon || 'close',
303
340
  color: color
304
- })) : null) : scrollList.current.length > 0 && direction == 'vertical' ? React__default.createElement("div", {
341
+ })) : null) : null, scrollList.current.length > 0 && direction === 'vertical' ? React__default.createElement("div", {
305
342
  className: "nut-noticebar-vertical",
306
343
  style: barStyle
307
344
  }, children ? React__default.createElement("div", {
@@ -313,16 +350,18 @@ var NoticeBar = function NoticeBar(props) {
313
350
  className: "horseLamp_list",
314
351
  style: horseLampStyle
315
352
  }, scrollList.current.map(function (item, index) {
316
- return React__default.createElement("li", {
317
- className: "horseLamp_list_item",
318
- style: {
319
- height: height
320
- },
321
- key: index,
322
- onClick: function onClick() {
323
- go(item);
324
- }
325
- }, item);
353
+ return (// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
354
+ React__default.createElement("li", {
355
+ className: "horseLamp_list_item",
356
+ style: {
357
+ height: height
358
+ },
359
+ key: index,
360
+ onClick: function onClick() {
361
+ go(item);
362
+ }
363
+ }, item)
364
+ );
326
365
  })), React__default.createElement("div", {
327
366
  className: "go",
328
367
  onClick: function onClick() {
@@ -106,11 +106,14 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
106
106
  color = _this$props.color,
107
107
  background = _this$props.background,
108
108
  type = _this$props.type,
109
- className = _this$props.className;
109
+ className = _this$props.className,
110
+ position = _this$props.position,
111
+ isWrapTeleport = _this$props.isWrapTeleport;
110
112
  this.state;
111
113
  cn('notify');
112
114
  var classes = classNames(_defineProperty({
113
- 'popup-top': true,
115
+ 'popup-top': position === 'top',
116
+ 'popup-bottom': position === 'bottom',
114
117
  'nut-notify': true
115
118
  }, "nut-notify--".concat(type), true));
116
119
  return React.createElement(React.Fragment, null, React.createElement(CSSTransition, {
@@ -118,7 +121,9 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
118
121
  timeout: 300,
119
122
  classNames: "fade",
120
123
  unmountOnExit: true,
121
- appear: true
124
+ appear: true,
125
+ position: position,
126
+ isWrapTeleport: isWrapTeleport
122
127
  }, React.createElement("div", {
123
128
  className: "".concat(classes, " ").concat(className),
124
129
  style: {
@@ -170,8 +175,11 @@ var options = {
170
175
  msg: '',
171
176
  id: '',
172
177
  duration: 3000,
178
+ color: '',
173
179
  type: 'danger',
174
180
  className: '',
181
+ position: 'top',
182
+ isWrapTeleport: true,
175
183
  onClosed: function onClosed() {},
176
184
  onClick: function onClick() {}
177
185
  };
@@ -188,6 +196,12 @@ function getInstance(props, callback) {
188
196
  }
189
197
 
190
198
  function notice(opts) {
199
+ // function close() {
200
+ // if (messageInstance) {
201
+ // messageInstance.destroy()
202
+ // messageInstance = null
203
+ // }
204
+ // }
191
205
  opts = _objectSpread(_objectSpread({}, options), opts);
192
206
  getInstance(opts, function (notification) {
193
207
  messageInstance = notification;
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
- var _excluded = ["isVisible", "title", "listData", "defaultValueData", "onConfirm", "onClose", "onCloseUpdate", "onChange", "className", "style", "threeDimensional"];
5
+ var _excluded = ["isVisible", "title", "listData", "defaultValueData", "onConfirm", "onClose", "onCloseUpdate", "onChange", "className", "style", "threeDimensional", "swipeDuration"];
6
6
 
7
7
  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; }
8
8
 
@@ -23,8 +23,11 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
23
23
  listData = _props$listData === void 0 ? [] : _props$listData,
24
24
  _props$threeDimension = props.threeDimensional,
25
25
  threeDimensional = _props$threeDimension === void 0 ? true : _props$threeDimension,
26
+ _props$swipeDuration = props.swipeDuration,
27
+ swipeDuration = _props$swipeDuration === void 0 ? 1000 : _props$swipeDuration,
26
28
  chooseItem = props.chooseItem;
27
- var touch = useTouch(); // 触发惯性滑动条件:
29
+ var touch = useTouch();
30
+ var DEFAULT_DURATION = 200; // 触发惯性滑动条件:
28
31
  // 在手指离开屏幕时,如果和上一次 move 时的间隔小于 `MOMENTUM_TIME` 且 move
29
32
  // 距离大于 `MOMENTUM_DISTANCE` 时,执行惯性滑动
30
33
 
@@ -71,7 +74,7 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
71
74
  var setTransform = function setTransform() {
72
75
  var translateY = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
73
76
  var type = arguments.length > 1 ? arguments[1] : undefined;
74
- var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
77
+ var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_DURATION;
75
78
  var deg = arguments.length > 3 ? arguments[3] : undefined;
76
79
  var nTime = time;
77
80
 
@@ -152,7 +155,7 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
152
155
  if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
153
156
  // 惯性滚动
154
157
  var distance = momentum(move, moveTime);
155
- setMove(distance, 'end', moveTime + 1000);
158
+ setMove(distance, 'end', +swipeDuration);
156
159
  } else {
157
160
  setMove(move, 'end');
158
161
  }
@@ -272,6 +275,7 @@ var InternalPicker = function InternalPicker(props, ref) {
272
275
  className = props.className,
273
276
  style = props.style,
274
277
  threeDimensional = props.threeDimensional,
278
+ swipeDuration = props.swipeDuration,
275
279
  rest = _objectWithoutProperties(props, _excluded);
276
280
 
277
281
  var _useState9 = useState([]),
@@ -494,6 +498,7 @@ var InternalPicker = function InternalPicker(props, ref) {
494
498
  chooseItem: function chooseItem(value, index) {
495
499
  return _chooseItem(value, index);
496
500
  },
501
+ swipeDuration: swipeDuration,
497
502
  key: index,
498
503
  keyIndex: index
499
504
  });