@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,4 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -14,14 +16,15 @@ var __spreadValues = (a, b) => {
14
16
  }
15
17
  return a;
16
18
  };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
17
20
  /*!
18
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
19
22
  * (c) 2022 @jdf2e.
20
23
  * Released under the MIT License.
21
24
  */
22
- import { ref, computed, reactive, onMounted, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, createVNode, withCtx, normalizeStyle, createTextVNode } from "vue";
25
+ import { ref, computed, reactive, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle, createTextVNode } from "vue";
23
26
  import { c as createComponent } from "./component.js";
24
- import Taro from "@tarojs/taro";
27
+ import { r as requestAniFrame } from "./raf.js";
25
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
26
29
  const Utils = {
27
30
  isLeapYear: function(y) {
@@ -104,8 +107,7 @@ const Utils = {
104
107
  return false;
105
108
  }
106
109
  };
107
- const { create } = createComponent("calendar-item");
108
- let TARO_ENV = {}.TARO_ENV;
110
+ const { create, translate } = createComponent("calendar-item");
109
111
  const _sfc_main = create({
110
112
  props: {
111
113
  type: {
@@ -134,19 +136,19 @@ const _sfc_main = create({
134
136
  },
135
137
  title: {
136
138
  type: String,
137
- default: "\u65E5\u5386\u9009\u62E9"
139
+ default: ""
138
140
  },
139
141
  confirmText: {
140
142
  type: String,
141
- default: "\u786E\u8BA4"
143
+ default: ""
142
144
  },
143
145
  startText: {
144
146
  type: String,
145
- default: "\u5F00\u59CB"
147
+ default: ""
146
148
  },
147
149
  endText: {
148
150
  type: String,
149
- default: "\u7ED3\u675F"
151
+ default: ""
150
152
  },
151
153
  defaultValue: {
152
154
  type: [String, Array],
@@ -163,11 +165,13 @@ const _sfc_main = create({
163
165
  },
164
166
  emits: ["choose", "update", "close", "select"],
165
167
  setup(props, { emit, slots }) {
166
- const weeks = ref(["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"]);
167
- const scalePx = ref(2);
168
- const viewHeight = ref(0);
168
+ const weeks = ref(translate("weekdays"));
169
169
  const months = ref(null);
170
- computed(() => {
170
+ const monthsPanel = ref(null);
171
+ const weeksPanel = ref(null);
172
+ const viewArea = ref(null);
173
+ const viewHeight = ref(0);
174
+ const compConthsData = computed(() => {
171
175
  return state.monthsData.slice(state.defaultRange[0], state.defaultRange[1]);
172
176
  });
173
177
  const showTopBtn = computed(() => {
@@ -181,9 +185,7 @@ const _sfc_main = create({
181
185
  });
182
186
  const state = reactive({
183
187
  yearMonthTitle: "",
184
- defaultRange: [0, 1],
185
- compConthsDatas: [],
186
- containerHeight: "",
188
+ defaultRange: [],
187
189
  currDate: "",
188
190
  propStartDate: "",
189
191
  propEndDate: "",
@@ -209,7 +211,6 @@ const _sfc_main = create({
209
211
  timer: 0,
210
212
  currentIndex: 0,
211
213
  avgHeight: 0,
212
- scrollTop: 0,
213
214
  monthsNum: 0
214
215
  });
215
216
  const splitDate = (date) => {
@@ -229,7 +230,7 @@ const _sfc_main = create({
229
230
  if (day.type == "curr") {
230
231
  if (!state.isRange && Utils.isEqual(state.currDate, currDate) || state.isRange && (isStart(currDate) || isEnd(currDate))) {
231
232
  return `${state.dayPrefix}-active`;
232
- } else if (props.startDate && Utils.compareDate(currDate, props.startDate) || props.endDate && Utils.compareDate(props.endDate, currDate)) {
233
+ } else if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
233
234
  return `${state.dayPrefix}-disabled`;
234
235
  } else 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])) {
235
236
  return `${state.dayPrefix}-choose`;
@@ -346,21 +347,13 @@ const _sfc_main = create({
346
347
  };
347
348
  const monthInfo = {
348
349
  curData,
349
- title: `${title.year}\u5E74${title.month}\u6708`,
350
+ title: translate("monthTitle", title.year, title.month),
350
351
  monthData: [
351
352
  ...getPreDaysStatus(preMonthDays, "prev", { month: preMonth, year: preYear }, preCurrMonthDays),
352
353
  ...getDaysStatus(currMonthDays, "curr", title)
353
354
  ]
354
355
  };
355
- let titleHeight, itemHeight;
356
- if (TARO_ENV === "h5") {
357
- titleHeight = 46 * scalePx.value + 16 * scalePx.value * 2;
358
- itemHeight = 128 * scalePx.value;
359
- } else {
360
- titleHeight = Math.floor(46 * scalePx.value) + Math.floor(16 * scalePx.value) * 2;
361
- itemHeight = Math.floor(128 * scalePx.value);
362
- }
363
- monthInfo.cssHeight = titleHeight + (monthInfo.monthData.length > 35 ? itemHeight * 6 : itemHeight * 5);
356
+ monthInfo.cssHeight = 39 + (monthInfo.monthData.length > 35 ? 384 : 320);
364
357
  let cssScrollHeight = 0;
365
358
  if (state.monthsData.length > 0) {
366
359
  cssScrollHeight = state.monthsData[state.monthsData.length - 1].cssScrollHeight + state.monthsData[state.monthsData.length - 1].cssHeight;
@@ -427,11 +420,11 @@ const _sfc_main = create({
427
420
  let current = 0;
428
421
  let lastCurrent = 0;
429
422
  state.monthsData.forEach((item, index) => {
430
- if (item.title == `${state.defaultData[0]}\u5E74${state.defaultData[1]}\u6708`) {
423
+ if (item.title == translate("monthTitle", state.defaultData[0], state.defaultData[1])) {
431
424
  current = index;
432
425
  }
433
426
  if (state.isRange) {
434
- if (item.title == `${state.defaultData[3]}\u5E74${state.defaultData[4]}\u6708`) {
427
+ if (item.title == translate("monthTitle", state.defaultData[3], state.defaultData[4])) {
435
428
  lastCurrent = index;
436
429
  }
437
430
  }
@@ -447,37 +440,26 @@ const _sfc_main = create({
447
440
  }
448
441
  let lastItem = state.monthsData[state.monthsData.length - 1];
449
442
  let containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;
450
- state.containerHeight = `${containerHeight}px`;
451
- state.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
443
+ requestAniFrame(() => {
444
+ if ((months == null ? void 0 : months.value) && (monthsPanel == null ? void 0 : monthsPanel.value) && (viewArea == null ? void 0 : viewArea.value)) {
445
+ viewHeight.value = months.value.clientHeight;
446
+ monthsPanel.value.style.height = `${containerHeight}px`;
447
+ months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
448
+ }
449
+ });
452
450
  state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
453
- if (months == null ? void 0 : months.value) {
454
- viewHeight.value = months.value.clientHeight;
455
- }
456
- if (TARO_ENV === "h5") {
457
- Taro.nextTick(() => {
458
- Taro.createSelectorQuery().select(".nut-calendar-content").boundingClientRect((res) => {
459
- viewHeight.value = res.height;
460
- }).exec();
461
- });
462
- }
463
451
  };
464
452
  const setDefaultRange = (monthsNum, current) => {
465
- let rangeArr = [];
466
453
  if (monthsNum >= 3) {
467
454
  if (current > 0 && current < monthsNum) {
468
- rangeArr = [current - 1, current + 3];
455
+ state.defaultRange = [current - 1, current + 3];
469
456
  } else if (current == 0) {
470
- rangeArr = [current, current + 4];
457
+ state.defaultRange = [current, current + 4];
471
458
  } else if (current == monthsNum) {
472
- rangeArr = [current - 2, current + 2];
459
+ state.defaultRange = [current - 2, current + 2];
473
460
  }
474
461
  } else {
475
- rangeArr = [0, monthsNum + 1];
476
- }
477
- if (JSON.stringify(state.defaultRange) !== JSON.stringify(rangeArr)) {
478
- state.defaultRange[0] = rangeArr[0];
479
- state.defaultRange[1] = rangeArr[1];
480
- state.compConthsDatas = state.monthsData.slice(rangeArr[0], rangeArr[1]);
462
+ state.defaultRange = [0, monthsNum + 2];
481
463
  }
482
464
  let defaultScrollTop = state.monthsData[state.defaultRange[0]].cssScrollHeight;
483
465
  state.translateY = defaultScrollTop;
@@ -519,7 +501,7 @@ const _sfc_main = create({
519
501
  }
520
502
  } else {
521
503
  const viewPosition = Math.round(currentScrollTop + viewHeight.value);
522
- if (viewPosition < state.monthsData[current].cssScrollHeight + state.monthsData[current].cssHeight && currentScrollTop < state.monthsData[current].cssScrollHeight) {
504
+ if (viewPosition < state.monthsData[current].cssScrollHeight + state.monthsData[current].cssHeight && currentScrollTop > state.monthsData[current - 1].cssScrollHeight) {
523
505
  current -= 1;
524
506
  }
525
507
  if (current + 1 <= state.monthsNum && viewPosition >= state.monthsData[current + 1].cssScrollHeight + state.monthsData[current + 1].cssHeight) {
@@ -540,21 +522,7 @@ const _sfc_main = create({
540
522
  state.monthsData.splice(0);
541
523
  initData();
542
524
  };
543
- onMounted(() => {
544
- Taro.getSystemInfo({
545
- success(res) {
546
- let scale = 2;
547
- let screenWidth = res.screenWidth;
548
- let toFixed = 3;
549
- if (TARO_ENV === "h5") {
550
- toFixed = 5;
551
- }
552
- scale = Number((screenWidth / 750).toFixed(toFixed));
553
- scalePx.value = scale;
554
- initData();
555
- }
556
- });
557
- });
525
+ initData();
558
526
  watch(() => props.defaultValue, (val) => {
559
527
  if (val) {
560
528
  if (props.poppable) {
@@ -562,8 +530,9 @@ const _sfc_main = create({
562
530
  }
563
531
  }
564
532
  });
565
- return __spreadValues(__spreadValues({
533
+ return __spreadProps(__spreadValues(__spreadValues({
566
534
  weeks,
535
+ compConthsData,
567
536
  showTopBtn,
568
537
  topInfo,
569
538
  bottomInfo,
@@ -575,8 +544,13 @@ const _sfc_main = create({
575
544
  chooseDay,
576
545
  isCurrDay,
577
546
  confirm,
578
- months
579
- }, toRefs(state)), toRefs(props));
547
+ monthsPanel,
548
+ months,
549
+ weeksPanel,
550
+ viewArea
551
+ }, toRefs(state)), toRefs(props)), {
552
+ translate
553
+ });
580
554
  }
581
555
  });
582
556
  const _hoisted_1 = {
@@ -591,10 +565,13 @@ const _hoisted_3 = {
591
565
  key: 2,
592
566
  class: "calendar-curr-month"
593
567
  };
594
- const _hoisted_4 = { class: "calendar-weeks" };
568
+ const _hoisted_4 = {
569
+ class: "calendar-weeks",
570
+ ref: "weeksPanel"
571
+ };
595
572
  const _hoisted_5 = {
596
573
  class: "calendar-months-panel",
597
- style: { "{{heihgt": "containerHeight}}" }
574
+ ref: "monthsPanel"
598
575
  };
599
576
  const _hoisted_6 = { class: "calendar-month-title" };
600
577
  const _hoisted_7 = { class: "calendar-month-con" };
@@ -613,7 +590,7 @@ const _hoisted_12 = {
613
590
  class: "calendar-curr-tip-curr"
614
591
  };
615
592
  const _hoisted_13 = {
616
- key: 3,
593
+ key: 4,
617
594
  class: "calendar-day-tip"
618
595
  };
619
596
  const _hoisted_14 = {
@@ -621,7 +598,6 @@ const _hoisted_14 = {
621
598
  class: "nut-calendar-footer"
622
599
  };
623
600
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
624
- const _component_scroll_view = resolveComponent("scroll-view");
625
601
  return openBlock(), createElementBlock("view", {
626
602
  class: normalizeClass(["nut-calendar nut-calendar-taro", {
627
603
  "nut-calendar-tile": !_ctx.poppable,
@@ -631,7 +607,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
631
607
  createElementVNode("view", {
632
608
  class: normalizeClass(["nut-calendar-header", { "nut-calendar-header-tile": !_ctx.poppable }])
633
609
  }, [
634
- _ctx.showTitle ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
610
+ _ctx.showTitle ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.title || _ctx.translate("title")), 1)) : createCommentVNode("", true),
635
611
  _ctx.showTopBtn ? (openBlock(), createElementBlock("view", _hoisted_2, [
636
612
  renderSlot(_ctx.$slots, "btn")
637
613
  ])) : createCommentVNode("", true),
@@ -643,75 +619,72 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
643
619
  key: index
644
620
  }, toDisplayString(item), 1);
645
621
  }), 128))
646
- ])
622
+ ], 512)
647
623
  ], 2),
648
- createVNode(_component_scroll_view, {
649
- "scroll-top": _ctx.scrollTop,
650
- "scroll-y": true,
624
+ createElementVNode("view", {
651
625
  class: "nut-calendar-content",
652
- onScroll: _ctx.mothsViewScroll,
653
- ref: "months"
654
- }, {
655
- default: withCtx(() => [
656
- createElementVNode("view", _hoisted_5, [
657
- createElementVNode("view", {
658
- class: "viewArea",
659
- style: normalizeStyle({ transform: `translateY(${_ctx.translateY}px)` })
660
- }, [
661
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.compConthsDatas, (month, index) => {
662
- return openBlock(), createElementBlock("view", {
663
- class: "calendar-month",
664
- key: index
665
- }, [
666
- createElementVNode("view", _hoisted_6, toDisplayString(month.title), 1),
667
- createElementVNode("view", _hoisted_7, [
668
- createElementVNode("view", {
669
- class: normalizeClass(["calendar-month-item", _ctx.type === "range" ? "month-item-range" : ""])
670
- }, [
671
- (openBlock(true), createElementBlock(Fragment, null, renderList(month.monthData, (day, i) => {
672
- return openBlock(), createElementBlock("view", {
673
- key: i,
674
- class: normalizeClass(["calendar-month-day", _ctx.getClass(day, month)]),
675
- onClick: ($event) => _ctx.chooseDay(day, month)
676
- }, [
677
- createElementVNode("view", _hoisted_9, [
678
- renderSlot(_ctx.$slots, "day", {
679
- date: day.type == "curr" ? day : ""
680
- }, () => [
681
- createTextVNode(toDisplayString(day.type == "curr" ? day.day : ""), 1)
682
- ])
683
- ]),
684
- _ctx.topInfo ? (openBlock(), createElementBlock("view", _hoisted_10, [
685
- renderSlot(_ctx.$slots, "topInfo", {
686
- date: day.type == "curr" ? day : ""
687
- })
688
- ])) : createCommentVNode("", true),
689
- _ctx.bottomInfo ? (openBlock(), createElementBlock("view", _hoisted_11, [
690
- renderSlot(_ctx.$slots, "bottomInfo", {
691
- date: day.type == "curr" ? day : ""
692
- })
693
- ])) : createCommentVNode("", true),
694
- !_ctx.bottomInfo && _ctx.showToday && _ctx.isCurrDay(day) ? (openBlock(), createElementBlock("view", _hoisted_12, " \u4ECA\u5929 ")) : createCommentVNode("", true),
695
- createElementVNode("view", {
696
- class: normalizeClass({ "calendar-curr-tips-top": _ctx.rangeTip(day, month), "calendar-day-tip": true })
697
- }, toDisplayString(_ctx.isStartTip(day, month) ? _ctx.startText : ""), 3),
698
- _ctx.isEndTip(day, month) ? (openBlock(), createElementBlock("view", _hoisted_13, toDisplayString(_ctx.endText), 1)) : createCommentVNode("", true)
699
- ], 10, _hoisted_8);
700
- }), 128))
701
- ], 2)
702
- ])
703
- ]);
704
- }), 128))
705
- ], 4)
706
- ])
707
- ]),
708
- _: 3
709
- }, 8, ["scroll-top", "onScroll"]),
626
+ ref: "months",
627
+ onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.mothsViewScroll && _ctx.mothsViewScroll(...args))
628
+ }, [
629
+ createElementVNode("view", _hoisted_5, [
630
+ createElementVNode("view", {
631
+ class: "viewArea",
632
+ ref: "viewArea",
633
+ style: normalizeStyle({ transform: `translateY(${_ctx.translateY}px)` })
634
+ }, [
635
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.compConthsData, (month, index) => {
636
+ return openBlock(), createElementBlock("view", {
637
+ class: "calendar-month",
638
+ key: index
639
+ }, [
640
+ createElementVNode("view", _hoisted_6, toDisplayString(month.title), 1),
641
+ createElementVNode("view", _hoisted_7, [
642
+ createElementVNode("view", {
643
+ class: normalizeClass(["calendar-month-item", _ctx.type === "range" ? "month-item-range" : ""])
644
+ }, [
645
+ (openBlock(true), createElementBlock(Fragment, null, renderList(month.monthData, (day, i) => {
646
+ return openBlock(), createElementBlock("view", {
647
+ key: i,
648
+ class: normalizeClass(["calendar-month-day", _ctx.getClass(day, month)]),
649
+ onClick: ($event) => _ctx.chooseDay(day, month)
650
+ }, [
651
+ createElementVNode("view", _hoisted_9, [
652
+ renderSlot(_ctx.$slots, "day", {
653
+ date: day.type == "curr" ? day : ""
654
+ }, () => [
655
+ createTextVNode(toDisplayString(day.type == "curr" ? day.day : ""), 1)
656
+ ])
657
+ ]),
658
+ _ctx.topInfo ? (openBlock(), createElementBlock("view", _hoisted_10, [
659
+ renderSlot(_ctx.$slots, "topInfo", {
660
+ date: day.type == "curr" ? day : ""
661
+ })
662
+ ])) : createCommentVNode("", true),
663
+ _ctx.bottomInfo ? (openBlock(), createElementBlock("view", _hoisted_11, [
664
+ renderSlot(_ctx.$slots, "bottomInfo", {
665
+ date: day.type == "curr" ? day : ""
666
+ })
667
+ ])) : createCommentVNode("", true),
668
+ !_ctx.bottomInfo && _ctx.showToday && _ctx.isCurrDay(day) ? (openBlock(), createElementBlock("view", _hoisted_12, toDisplayString(_ctx.translate("today")), 1)) : createCommentVNode("", true),
669
+ _ctx.isStartTip(day, month) ? (openBlock(), createElementBlock("view", {
670
+ key: 3,
671
+ class: normalizeClass(["calendar-day-tip", { "calendar-curr-tips-top": _ctx.rangeTip(day, month) }])
672
+ }, toDisplayString(_ctx.startText || _ctx.translate("start")), 3)) : createCommentVNode("", true),
673
+ _ctx.isEndTip(day, month) ? (openBlock(), createElementBlock("view", _hoisted_13, toDisplayString(_ctx.endText || _ctx.translate("end")), 1)) : createCommentVNode("", true)
674
+ ], 10, _hoisted_8);
675
+ }), 128))
676
+ ], 2)
677
+ ])
678
+ ]);
679
+ }), 128))
680
+ ], 4)
681
+ ], 512)
682
+ ], 544),
710
683
  _ctx.poppable && !_ctx.isAutoBackFill ? (openBlock(), createElementBlock("view", _hoisted_14, [
711
684
  createElementVNode("view", {
712
685
  class: "calendar-confirm-btn",
713
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.confirm && _ctx.confirm(...args))
714
- }, toDisplayString(_ctx.confirmText), 1)
686
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.confirm && _ctx.confirm(...args))
687
+ }, toDisplayString(_ctx.confirmText || _ctx.translate("confirm")), 1)
715
688
  ])) : createCommentVNode("", true)
716
689
  ], 2);
717
690
  }
@@ -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
  */
@@ -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
  */
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ const _window = window;
7
+ function requestAniFrame() {
8
+ if (typeof _window !== "undefined") {
9
+ return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
10
+ _window.setTimeout(callback, 1e3 / 60);
11
+ };
12
+ } else {
13
+ return function(callback) {
14
+ setTimeout(callback, 1e3 / 60);
15
+ };
16
+ }
17
+ }
18
+ var requestAniFrame$1 = requestAniFrame();
19
+ export { requestAniFrame$1 as r };
@@ -1,5 +1,9 @@
1
1
  .nut-actionsheet-panel {
2
2
  display: block;
3
+ &.nut-actionsheet-safebottom {
4
+ margin-bottom: constant(safe-area-inset-bottom);
5
+ margin-bottom: env(safe-area-inset-bottom);
6
+ }
3
7
  .nut-actionsheet-title {
4
8
  display: block;
5
9
  padding: 10px;
@@ -49,6 +53,7 @@
49
53
  .desc {
50
54
  font-size: $actionsheet-item-font-size;
51
55
  color: #999;
56
+ cursor: default;
52
57
  }
53
58
 
54
59
  .subdesc {
@@ -61,6 +66,9 @@
61
66
  color: #e1e1e1 !important;
62
67
  cursor: not-allowed;
63
68
  }
69
+ .nut-actionsheet-item-loading {
70
+ cursor: default;
71
+ }
64
72
 
65
73
  .nut-actionsheet-cancel {
66
74
  margin-top: 5px;
@@ -0,0 +1,83 @@
1
+ .nut-ecard {
2
+ width: 100%;
3
+
4
+ &__title {
5
+ line-height: 1;
6
+ font-size: 15px;
7
+ font-family: PingFangSC;
8
+ font-weight: normal;
9
+ color: rgba(0, 0, 0, 0.6);
10
+ }
11
+
12
+ &__list {
13
+ display: flex;
14
+ justify-content: space-between;
15
+ flex-wrap: wrap;
16
+ margin-top: 15px;
17
+
18
+ &__item {
19
+ width: 48%;
20
+ height: 46px;
21
+ background: $ecard-bg-color;
22
+ border-radius: 4px;
23
+ margin-bottom: 12px;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+
28
+ &.active {
29
+ background: $white;
30
+ border: 1px solid $primary-color;
31
+ border-radius: 4px;
32
+ }
33
+ }
34
+
35
+ &__input {
36
+ width: 100%;
37
+ height: 46px;
38
+ background: $ecard-bg-color;
39
+ color: rgba(0, 0, 0, 0.8);
40
+ border-radius: 4px;
41
+ display: flex;
42
+ padding: 0 15px 0 20px;
43
+ font-size: 14px;
44
+ justify-content: space-between;
45
+ align-items: center;
46
+
47
+ &--con {
48
+ flex: 1;
49
+ display: flex;
50
+ justify-content: flex-end;
51
+ > input {
52
+ caret-color: $primary-color; //光标颜色
53
+ text-align: right;
54
+ background: $ecard-bg-color;
55
+ margin-right: 10px;
56
+ outline: 0 none;
57
+ border: 0;
58
+ text-decoration: none;
59
+ }
60
+ }
61
+
62
+ &.active {
63
+ background: $white;
64
+ border: 1px solid $primary-color;
65
+
66
+ > view > input {
67
+ background: $white;
68
+ }
69
+ }
70
+ }
71
+
72
+ &__step {
73
+ width: 100%;
74
+ margin-top: 17px;
75
+ display: flex;
76
+ justify-content: space-between;
77
+ font-size: 20px;
78
+ font-family: PingFangSC;
79
+ font-weight: normal;
80
+ color: $primary-color;
81
+ }
82
+ }
83
+ }