@nutui/nutui 4.0.0 → 4.0.1-2.beta-1

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 (285) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +34 -65
  3. package/dist/nutui.es.js +10 -17
  4. package/dist/nutui.js +16202 -0
  5. package/dist/nutui.umd.js +1 -7
  6. package/dist/packages/_es/ActionSheet.js +79 -94
  7. package/dist/packages/_es/Address.js +260 -345
  8. package/dist/packages/_es/AddressList.js +269 -354
  9. package/dist/packages/_es/Animate.js +46 -38
  10. package/dist/packages/_es/Audio.js +128 -180
  11. package/dist/packages/_es/AudioOperate.js +60 -52
  12. package/dist/packages/_es/Avatar.js +67 -75
  13. package/dist/packages/_es/AvatarGroup.js +23 -31
  14. package/dist/packages/_es/Backtop.js +59 -99
  15. package/dist/packages/_es/Badge.js +39 -46
  16. package/dist/packages/_es/Barrage.js +68 -145
  17. package/dist/packages/_es/Button.js +47 -66
  18. package/dist/packages/_es/Calendar.js +135 -152
  19. package/dist/packages/_es/CalendarItem.js +6 -6
  20. package/dist/packages/_es/Card.js +42 -56
  21. package/dist/packages/_es/Cascader.js +323 -433
  22. package/dist/packages/_es/Category.js +29 -39
  23. package/dist/packages/_es/CategoryPane.js +57 -83
  24. package/dist/packages/_es/Cell.js +56 -71
  25. package/dist/packages/_es/CellGroup.js +19 -27
  26. package/dist/packages/_es/Checkbox.js +109 -138
  27. package/dist/packages/_es/CheckboxGroup.js +38 -61
  28. package/dist/packages/_es/CircleProgress.js +67 -96
  29. package/dist/packages/_es/Col.js +23 -31
  30. package/dist/packages/_es/Collapse.js +37 -67
  31. package/dist/packages/_es/CollapseItem.js +91 -184
  32. package/dist/packages/_es/Comment.js +207 -279
  33. package/dist/packages/_es/ConfigProvider.js +38 -56
  34. package/dist/packages/_es/Countdown.js +100 -194
  35. package/dist/packages/_es/Countup.js +232 -428
  36. package/dist/packages/_es/DatePicker.js +169 -245
  37. package/dist/packages/_es/Dialog.js +163 -188
  38. package/dist/packages/_es/Divider.js +42 -40
  39. package/dist/packages/_es/Drag.js +70 -153
  40. package/dist/packages/_es/Ecard.js +64 -104
  41. package/dist/packages/_es/Elevator.js +144 -201
  42. package/dist/packages/_es/Ellipsis.js +95 -159
  43. package/dist/packages/_es/Empty.js +23 -39
  44. package/dist/packages/_es/FixedNav.js +93 -116
  45. package/dist/packages/_es/Form.js +108 -164
  46. package/dist/packages/_es/FormItem.js +48 -61
  47. package/dist/packages/_es/Grid.js +5 -6
  48. package/dist/packages/_es/GridItem.js +58 -84
  49. package/dist/packages/_es/Image.js +98 -88
  50. package/dist/packages/_es/ImagePreview.js +262 -392
  51. package/dist/packages/_es/Indicator.js +30 -34
  52. package/dist/packages/_es/InfiniteLoading.js +83 -117
  53. package/dist/packages/_es/Input.js +176 -223
  54. package/dist/packages/_es/InputNumber.js +81 -117
  55. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  56. package/dist/packages/_es/Invoice.js +105 -113
  57. package/dist/packages/_es/Layout.js +3 -4
  58. package/dist/packages/_es/List.js +147 -89
  59. package/dist/packages/_es/Menu.js +96 -152
  60. package/dist/packages/_es/MenuItem.js +117 -153
  61. package/dist/packages/_es/Navbar.js +103 -119
  62. package/dist/packages/_es/Noticebar.js +207 -273
  63. package/dist/packages/_es/Notify.js +110 -147
  64. package/dist/packages/_es/NumberKeyboard.js +127 -202
  65. package/dist/packages/_es/Overlay.js +53 -66
  66. package/dist/packages/_es/Pagination.js +70 -100
  67. package/dist/packages/_es/Picker.js +276 -425
  68. package/dist/packages/_es/Popover.js +122 -225
  69. package/dist/packages/_es/Popup.js +4 -4
  70. package/dist/packages/_es/Price.js +47 -80
  71. package/dist/packages/_es/Progress.js +63 -79
  72. package/dist/packages/_es/PullRefresh.js +96 -157
  73. package/dist/packages/_es/Radio.js +4 -4
  74. package/dist/packages/_es/RadioGroup.js +3 -3
  75. package/dist/packages/_es/Range.js +205 -329
  76. package/dist/packages/_es/Rate.js +93 -122
  77. package/dist/packages/_es/Row.js +21 -27
  78. package/dist/packages/_es/Searchbar.js +130 -160
  79. package/dist/packages/_es/ShortPassword.js +69 -93
  80. package/dist/packages/_es/SideNavbar.js +49 -59
  81. package/dist/packages/_es/SideNavbarItem.js +22 -32
  82. package/dist/packages/_es/Signature.js +83 -128
  83. package/dist/packages/_es/Skeleton.js +110 -130
  84. package/dist/packages/_es/Sku.js +251 -326
  85. package/dist/packages/_es/Step.js +60 -69
  86. package/dist/packages/_es/Steps.js +26 -31
  87. package/dist/packages/_es/Sticky.js +4 -4
  88. package/dist/packages/_es/SubSideNavbar.js +52 -56
  89. package/dist/packages/_es/Swipe.js +84 -137
  90. package/dist/packages/_es/Swiper.js +175 -310
  91. package/dist/packages/_es/SwiperItem.js +28 -44
  92. package/dist/packages/_es/Switch.js +55 -67
  93. package/dist/packages/_es/TabPane.js +32 -20
  94. package/dist/packages/_es/Tabbar.js +41 -52
  95. package/dist/packages/_es/TabbarItem.js +61 -81
  96. package/dist/packages/_es/Table.js +110 -148
  97. package/dist/packages/_es/Tabs.js +284 -205
  98. package/dist/packages/_es/Tag.js +44 -61
  99. package/dist/packages/_es/Textarea.js +80 -124
  100. package/dist/packages/_es/TimeDetail.js +49 -57
  101. package/dist/packages/_es/TimePannel.js +35 -31
  102. package/dist/packages/_es/TimeSelect.js +47 -68
  103. package/dist/packages/_es/Toast.js +150 -203
  104. package/dist/packages/_es/Tour.js +139 -175
  105. package/dist/packages/_es/TrendArrow.js +57 -58
  106. package/dist/packages/_es/Uploader.js +235 -359
  107. package/dist/packages/_es/Video.js +191 -298
  108. package/dist/packages/_es/Watermark.js +84 -98
  109. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  110. package/dist/packages/_es/common-d218746f.js +116 -0
  111. package/dist/packages/_es/component-234624bc.js +89 -0
  112. package/dist/packages/_es/index-14dfadc4.js +561 -0
  113. package/dist/packages/_es/index-192a3ef6.js +29 -0
  114. package/dist/packages/_es/index-360c5092.js +210 -0
  115. package/dist/packages/_es/index-496e6e05.js +24 -0
  116. package/dist/packages/_es/index-50eed3d9.js +7 -0
  117. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  118. package/dist/packages/_es/index-fadb0974.js +8 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  121. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  122. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  123. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  124. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  125. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  126. package/dist/packages/actionsheet/index.scss +2 -0
  127. package/dist/packages/actionsheet/style.mjs +0 -2
  128. package/dist/packages/address/index.scss +5 -2
  129. package/dist/packages/address/style.mjs +0 -3
  130. package/dist/packages/addresslist/index.scss +3 -0
  131. package/dist/packages/addresslist/style.mjs +0 -2
  132. package/dist/packages/audio/index.scss +2 -0
  133. package/dist/packages/audio/style.mjs +0 -1
  134. package/dist/packages/audiooperate/index.scss +2 -0
  135. package/dist/packages/audiooperate/style.mjs +0 -1
  136. package/dist/packages/badge/index.scss +3 -0
  137. package/dist/packages/button/index.scss +1 -1
  138. package/dist/packages/calendar/index.scss +3 -0
  139. package/dist/packages/calendar/style.mjs +0 -3
  140. package/dist/packages/card/index.scss +3 -0
  141. package/dist/packages/card/style.mjs +0 -2
  142. package/dist/packages/cascader/index.scss +4 -0
  143. package/dist/packages/cascader/style.mjs +0 -5
  144. package/dist/packages/cellgroup/index.scss +1 -1
  145. package/dist/packages/checkbox/index.scss +41 -0
  146. package/dist/packages/col/index.scss +2 -2
  147. package/dist/packages/comment/index.scss +2 -0
  148. package/dist/packages/comment/style.mjs +0 -1
  149. package/dist/packages/datepicker/index.scss +1 -2
  150. package/dist/packages/datepicker/style.mjs +0 -3
  151. package/dist/packages/dialog/index.scss +11 -0
  152. package/dist/packages/dialog/style.mjs +0 -3
  153. package/dist/packages/ecard/index.scss +2 -0
  154. package/dist/packages/ecard/style.mjs +0 -1
  155. package/dist/packages/fixednav/index.scss +2 -0
  156. package/dist/packages/fixednav/style.mjs +0 -1
  157. package/dist/packages/form/index.scss +1 -2
  158. package/dist/packages/form/style.mjs +0 -1
  159. package/dist/packages/formitem/index.scss +3 -0
  160. package/dist/packages/formitem/style.mjs +0 -1
  161. package/dist/packages/imagepreview/index.scss +5 -5
  162. package/dist/packages/imagepreview/style.mjs +0 -5
  163. package/dist/packages/input/index.scss +13 -13
  164. package/dist/packages/invoice/index.scss +6 -0
  165. package/dist/packages/invoice/style.mjs +0 -7
  166. package/dist/packages/list/index.scss +8 -8
  167. package/dist/packages/menuitem/index.scss +9 -10
  168. package/dist/packages/menuitem/style.mjs +0 -2
  169. package/dist/packages/navbar/index.scss +0 -1
  170. package/dist/packages/noticebar/index.scss +12 -2
  171. package/dist/packages/notify/index.scss +2 -0
  172. package/dist/packages/notify/style.mjs +0 -2
  173. package/dist/packages/numberkeyboard/index.scss +2 -0
  174. package/dist/packages/numberkeyboard/style.mjs +0 -2
  175. package/dist/packages/picker/index.scss +4 -9
  176. package/dist/packages/picker/style.mjs +0 -2
  177. package/dist/packages/popover/index.scss +2 -0
  178. package/dist/packages/popover/style.mjs +0 -2
  179. package/dist/packages/popup/index.scss +2 -0
  180. package/dist/packages/popup/style.mjs +0 -1
  181. package/dist/packages/price/index.scss +5 -10
  182. package/dist/packages/rate/index.scss +6 -9
  183. package/dist/packages/searchbar/index.scss +4 -0
  184. package/dist/packages/shortpassword/index.scss +18 -0
  185. package/dist/packages/shortpassword/style.mjs +0 -2
  186. package/dist/packages/signature/index.scss +2 -0
  187. package/dist/packages/signature/style.mjs +0 -1
  188. package/dist/packages/skeleton/index.scss +2 -0
  189. package/dist/packages/skeleton/style.mjs +0 -1
  190. package/dist/packages/sku/index.scss +4 -0
  191. package/dist/packages/sku/style.mjs +0 -4
  192. package/dist/packages/tabbaritem/index.scss +2 -0
  193. package/dist/packages/tabbaritem/style.mjs +0 -1
  194. package/dist/packages/tabs/index.scss +36 -2
  195. package/dist/packages/tabs/style.mjs +0 -1
  196. package/dist/packages/textarea/index.scss +2 -0
  197. package/dist/packages/timeselect/index.scss +2 -0
  198. package/dist/packages/timeselect/style.mjs +0 -2
  199. package/dist/packages/tour/index.scss +2 -0
  200. package/dist/packages/tour/style.mjs +0 -3
  201. package/dist/packages/uploader/index.scss +10 -2
  202. package/dist/packages/uploader/style.mjs +0 -2
  203. package/dist/resolver/index.d.ts +6 -0
  204. package/dist/resolver/index.js +1 -0
  205. package/dist/resolver/index.mjs +24 -0
  206. package/dist/resolver/package.json +20 -0
  207. package/dist/smartips/web-types.json +114 -15
  208. package/dist/style.css +1 -1
  209. package/dist/styles/themes/default.scss +155 -52
  210. package/dist/styles/themes/jdb.scss +155 -52
  211. package/dist/styles/themes/jddkh.scss +155 -52
  212. package/dist/styles/themes/jdt.scss +155 -52
  213. package/dist/styles/variables-jdb.scss +9 -1
  214. package/dist/styles/variables-jddkh.scss +9 -1
  215. package/dist/styles/variables-jdt.scss +9 -1
  216. package/dist/styles/variables.scss +8 -0
  217. package/dist/types/__VUE/address/index.vue.d.ts +2 -1
  218. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +1 -1
  219. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -1
  220. package/dist/types/__VUE/addresslist/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/animate/index.vue.d.ts +6 -0
  222. package/dist/types/__VUE/audiooperate/index.vue.d.ts +4 -4
  223. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  224. package/dist/types/__VUE/button/type.d.ts +1 -0
  225. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  226. package/dist/types/__VUE/collapse/index.vue.d.ts +31 -5
  227. package/dist/types/__VUE/collapseitem/index.vue.d.ts +117 -11
  228. package/dist/types/__VUE/configprovider/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  230. package/dist/types/__VUE/dialog/index.d.ts +1 -0
  231. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -0
  232. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  233. package/dist/types/__VUE/image/index.vue.d.ts +14 -3
  234. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +9 -0
  235. package/dist/types/__VUE/imagepreview/index.vue.d.ts +1 -1
  236. package/dist/types/__VUE/input/index.vue.d.ts +27 -2
  237. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  238. package/dist/types/__VUE/list/type.d.ts +13 -0
  239. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  240. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  241. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  242. package/dist/types/__VUE/noticebar/index.vue.d.ts +5 -2
  243. package/dist/types/__VUE/picker/common.d.ts +2 -0
  244. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  245. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  246. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  247. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  248. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  249. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  250. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  251. package/dist/types/__VUE/switch/index.vue.d.ts +1 -0
  252. package/dist/types/__VUE/table/common.d.ts +55 -2
  253. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  254. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  255. package/dist/types/__VUE/tabs/index.vue.d.ts +35 -5
  256. package/dist/types/__VUE/tabs/types.d.ts +12 -0
  257. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  258. package/dist/types/__VUE/toast/index.vue.d.ts +11 -4
  259. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  260. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  261. package/dist/types/index.d.ts +1 -2
  262. package/dist/types/resolver/index.d.ts +6 -0
  263. package/dist/types/utils/date.d.ts +4 -0
  264. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  265. package/dist/types/utils/util.d.ts +1 -1
  266. package/package.json +13 -6
  267. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  268. package/dist/packages/_es/common-b9a5e726.js +0 -145
  269. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  270. package/dist/packages/_es/index-29892cda.js +0 -33
  271. package/dist/packages/_es/index-2ae3ae87.js +0 -846
  272. package/dist/packages/_es/index-43c34ac6.js +0 -30
  273. package/dist/packages/_es/index-54d03fc1.js +0 -8
  274. package/dist/packages/_es/index-79c5dc33.js +0 -10
  275. package/dist/packages/_es/index-7a7385e4.js +0 -67
  276. package/dist/packages/_es/index-991c279f.js +0 -244
  277. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  278. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  279. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  280. package/dist/packages/_es/interceptor-956b24fc.js +0 -29
  281. package/dist/packages/_es/mountComponent-1ece4110.js +0 -39
  282. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  283. package/dist/packages/_es/raf-729dad54.js +0 -25
  284. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
  285. /package/dist/types/utils/{interceptor.d.ts → Interceptor.d.ts} +0 -0
@@ -1,846 +0,0 @@
1
- import { ref, computed, reactive, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle, createTextVNode } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { r as requestAniFrame } from "./raf-729dad54.js";
4
- import { u as useExpose } from "./index-79c5dc33.js";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
- const Utils = {
7
- /**
8
- * 是否为闫年
9
- * @return {Boolse} true|false
10
- */
11
- isLeapYear: function(y) {
12
- return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
13
- },
14
- /**
15
- * 返回星期数
16
- * @return {String}
17
- */
18
- getWhatDay: function(year, month, day) {
19
- const date = new Date(year + "/" + month + "/" + day);
20
- const index = date.getDay();
21
- const dayNames = [
22
- "星期日",
23
- "星期一",
24
- "星期二",
25
- "星期三",
26
- "星期四",
27
- "星期五",
28
- "星期六"
29
- ];
30
- return dayNames[index];
31
- },
32
- /**
33
- * 返回星期数
34
- * @return {Number}
35
- */
36
- getMonthPreDay: function(year, month) {
37
- const date = new Date(year + "/" + month + "/01");
38
- let day = date.getDay();
39
- if (day == 0) {
40
- day = 7;
41
- }
42
- return day;
43
- },
44
- /**
45
- * 返回月份天数
46
- * @return {Number}
47
- */
48
- getMonthDays: function(year, month) {
49
- if (/^0/.test(month)) {
50
- month = month.split("")[1];
51
- }
52
- return [
53
- 0,
54
- 31,
55
- this.isLeapYear(Number(year)) ? 29 : 28,
56
- 31,
57
- 30,
58
- 31,
59
- 30,
60
- 31,
61
- 31,
62
- 30,
63
- 31,
64
- 30,
65
- 31
66
- ][month];
67
- },
68
- /**
69
- * 补齐数字位数
70
- * @return {string}
71
- */
72
- getNumTwoBit: function(n) {
73
- n = Number(n);
74
- return (n > 9 ? "" : "0") + n;
75
- },
76
- /**
77
- * 日期对象转成字符串
78
- * @return {string}
79
- */
80
- date2Str: function(date, split) {
81
- split = split || "-";
82
- const y = date.getFullYear();
83
- const m = this.getNumTwoBit(date.getMonth() + 1);
84
- const d = this.getNumTwoBit(date.getDate());
85
- return [y, m, d].join(split);
86
- },
87
- /**
88
- * 返回日期格式字符串
89
- * @param {Number} 0返回今天的日期、1返回明天的日期,2返回后天得日期,依次类推
90
- * @return {string} '2014-12-31'
91
- */
92
- getDay: function(i) {
93
- i = i || 0;
94
- let date = new Date();
95
- const diff = i * (1e3 * 60 * 60 * 24);
96
- date = new Date(date.getTime() + diff);
97
- return this.date2Str(date);
98
- },
99
- /**
100
- * 时间比较
101
- * @return {Boolean}
102
- */
103
- compareDate: function(date1, date2) {
104
- const startTime = new Date(date1.replace("-", "/").replace("-", "/"));
105
- const endTime = new Date(date2.replace("-", "/").replace("-", "/"));
106
- if (startTime >= endTime) {
107
- return false;
108
- }
109
- return true;
110
- },
111
- /**
112
- * 时间是否相等
113
- * @return {Boolean}
114
- */
115
- isEqual: function(date1, date2) {
116
- const startTime = new Date(date1).getTime();
117
- const endTime = new Date(date2).getTime();
118
- if (startTime == endTime) {
119
- return true;
120
- }
121
- return false;
122
- }
123
- };
124
- const { create, translate } = createComponent("calendar-item");
125
- const _sfc_main = create({
126
- props: {
127
- type: {
128
- type: String,
129
- default: "one"
130
- },
131
- isAutoBackFill: {
132
- type: Boolean,
133
- default: false
134
- },
135
- toDateAnimation: {
136
- type: Boolean,
137
- default: true
138
- },
139
- poppable: {
140
- type: Boolean,
141
- default: true
142
- },
143
- showTitle: {
144
- type: Boolean,
145
- default: true
146
- },
147
- showSubTitle: {
148
- type: Boolean,
149
- default: true
150
- },
151
- showToday: {
152
- type: Boolean,
153
- default: true
154
- },
155
- title: {
156
- type: String,
157
- default: ""
158
- },
159
- confirmText: {
160
- type: String,
161
- default: ""
162
- },
163
- startText: {
164
- type: String,
165
- default: ""
166
- },
167
- endText: {
168
- type: String,
169
- default: ""
170
- },
171
- defaultValue: {
172
- type: [String, Array],
173
- default: ""
174
- },
175
- startDate: {
176
- type: String,
177
- default: Utils.getDay(0)
178
- },
179
- endDate: {
180
- type: String,
181
- default: Utils.getDay(365)
182
- },
183
- firstDayOfWeek: {
184
- type: Number,
185
- default: 0
186
- }
187
- },
188
- emits: ["choose", "update", "close", "select"],
189
- setup(props, { emit, slots }) {
190
- const weekdays = translate("weekdays");
191
- const weeks = ref([...weekdays.slice(props.firstDayOfWeek, 7), ...weekdays.slice(0, props.firstDayOfWeek)]);
192
- const months = ref(null);
193
- const monthsPanel = ref(null);
194
- const weeksPanel = ref(null);
195
- const viewArea = ref(null);
196
- const viewHeight = ref(0);
197
- const compConthsData = computed(() => {
198
- return state.monthsData.slice(state.defaultRange[0], state.defaultRange[1]);
199
- });
200
- const showTopBtn = computed(() => {
201
- return slots.btn;
202
- });
203
- const topInfo = computed(() => {
204
- return slots["top-info"];
205
- });
206
- const bottomInfo = computed(() => {
207
- return slots["bottom-info"];
208
- });
209
- const state = reactive({
210
- yearMonthTitle: "",
211
- defaultRange: [],
212
- currDate: "",
213
- propStartDate: "",
214
- propEndDate: "",
215
- unLoadPrev: false,
216
- touchParams: {
217
- startY: 0,
218
- endY: 0,
219
- startTime: 0,
220
- endTime: 0,
221
- lastY: 0,
222
- lastTime: 0
223
- },
224
- transformY: 0,
225
- translateY: 0,
226
- scrollDistance: 0,
227
- defaultData: [],
228
- chooseData: [],
229
- monthsData: [],
230
- dayPrefix: "nut-calendar__day",
231
- startData: "",
232
- endData: "",
233
- isRange: props.type === "range",
234
- timer: 0,
235
- currentIndex: 0,
236
- avgHeight: 0,
237
- monthsNum: 0
238
- });
239
- const splitDate = (date) => {
240
- return date.split("-");
241
- };
242
- const isStart = (currDate) => {
243
- return Utils.isEqual(state.currDate[0], currDate);
244
- };
245
- const isEnd = (currDate) => {
246
- return Utils.isEqual(state.currDate[1], currDate);
247
- };
248
- const isMultiple = (currDate) => {
249
- if (state.currDate.length > 0) {
250
- return state.currDate.some((item) => {
251
- return Utils.isEqual(item, currDate);
252
- });
253
- } else {
254
- return false;
255
- }
256
- };
257
- const getCurrDate = (day, month) => {
258
- return month.curData[0] + "-" + month.curData[1] + "-" + Utils.getNumTwoBit(+day.day);
259
- };
260
- const getClass = (day, month) => {
261
- const currDate = getCurrDate(day, month);
262
- const { type } = props;
263
- if (day.type == "curr") {
264
- if (Utils.isEqual(state.currDate, currDate) || type == "range" && (isStart(currDate) || isEnd(currDate)) || type == "multiple" && isMultiple(currDate)) {
265
- return `${state.dayPrefix}--active`;
266
- } else if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
267
- return `${state.dayPrefix}--disabled`;
268
- } else if (type == "range" && Array.isArray(state.currDate) && Object.values(state.currDate).length == 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
269
- return `${state.dayPrefix}--choose`;
270
- } else {
271
- return null;
272
- }
273
- } else {
274
- return `${state.dayPrefix}--disabled`;
275
- }
276
- };
277
- const confirm = () => {
278
- const { type } = props;
279
- if (type == "range" && state.chooseData.length == 2 || type != "range") {
280
- let chooseData = state.chooseData.slice(0);
281
- emit("choose", chooseData);
282
- if (props.poppable) {
283
- emit("update");
284
- }
285
- }
286
- };
287
- const chooseDay = (day, month, isFirst = false) => {
288
- if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
289
- const { type } = props;
290
- let days = [...month.curData];
291
- days[2] = Utils.getNumTwoBit(Number(day.day));
292
- days[3] = `${days[0]}-${days[1]}-${days[2]}`;
293
- days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
294
- if (type == "multiple") {
295
- if (state.currDate.length > 0) {
296
- let hasIndex = void 0;
297
- state.currDate.forEach((item, index) => {
298
- if (item == days[3]) {
299
- hasIndex = index;
300
- }
301
- });
302
- if (isFirst) {
303
- state.chooseData.push([...days]);
304
- } else {
305
- if (hasIndex !== void 0) {
306
- state.currDate.splice(hasIndex, 1);
307
- state.chooseData.splice(hasIndex, 1);
308
- } else {
309
- state.currDate.push(days[3]);
310
- state.chooseData.push([...days]);
311
- }
312
- }
313
- } else {
314
- state.currDate = [days[3]];
315
- state.chooseData = [[...days]];
316
- }
317
- } else if (type == "range") {
318
- let curDataLength = Object.values(state.currDate).length;
319
- if (curDataLength == 2 || curDataLength == 0) {
320
- state.currDate = [days[3]];
321
- } else {
322
- if (Utils.compareDate(state.currDate[0], days[3])) {
323
- Array.isArray(state.currDate) && state.currDate.push(days[3]);
324
- } else {
325
- Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
326
- }
327
- }
328
- if (state.chooseData.length == 2 || !state.chooseData.length) {
329
- state.chooseData = [[...days]];
330
- } else {
331
- if (Utils.compareDate(state.chooseData[0][3], days[3])) {
332
- state.chooseData = [...state.chooseData, [...days]];
333
- } else {
334
- state.chooseData = [[...days], ...state.chooseData];
335
- }
336
- }
337
- } else {
338
- state.currDate = days[3];
339
- state.chooseData = [...days];
340
- }
341
- if (!isFirst) {
342
- emit("select", state.chooseData);
343
- if (props.isAutoBackFill || !props.poppable) {
344
- confirm();
345
- }
346
- }
347
- }
348
- };
349
- const getCurrData = (type) => {
350
- const monthData = type == "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
351
- let year = parseInt(monthData.curData[0]);
352
- let month = parseInt(monthData.curData[1].toString().replace(/^0/, ""));
353
- switch (type) {
354
- case "prev":
355
- month == 1 && (year -= 1);
356
- month = month == 1 ? 12 : --month;
357
- break;
358
- case "next":
359
- month == 12 && (year += 1);
360
- month = month == 12 ? 1 : ++month;
361
- break;
362
- }
363
- return [year + "", Utils.getNumTwoBit(month), Utils.getMonthDays(String(year), String(month)) + ""];
364
- };
365
- const getDaysStatus = (days, type, dateInfo) => {
366
- let { year, month } = dateInfo;
367
- if (type == "prev" && days >= 7) {
368
- days -= 7;
369
- }
370
- return Array.from(Array(days), (v, k) => {
371
- return {
372
- day: String(k + 1),
373
- type,
374
- year,
375
- month
376
- };
377
- });
378
- };
379
- const getPreDaysStatus = (days, type, dateInfo, preCurrMonthDays) => {
380
- days = days - props.firstDayOfWeek;
381
- let { year, month } = dateInfo;
382
- if (type == "prev" && days >= 7) {
383
- days -= 7;
384
- }
385
- let months2 = Array.from(Array(preCurrMonthDays), (v, k) => {
386
- return {
387
- day: String(k + 1),
388
- type,
389
- year,
390
- month
391
- };
392
- });
393
- return months2.slice(preCurrMonthDays - days);
394
- };
395
- const getMonth = (curData, type) => {
396
- const preMonthDays = Utils.getMonthPreDay(+curData[0], +curData[1]);
397
- let preMonth = Number(curData[1]) - 1;
398
- let preYear = Number(curData[0]);
399
- if (preMonth <= 0) {
400
- preMonth = 12;
401
- preYear += 1;
402
- }
403
- const currMonthDays = Utils.getMonthDays(String(curData[0]), String(curData[1]));
404
- const preCurrMonthDays = Utils.getMonthDays(preYear + "", preMonth + "");
405
- const title = {
406
- year: curData[0],
407
- month: curData[1]
408
- };
409
- const monthInfo = {
410
- curData,
411
- title: translate("monthTitle", title.year, title.month),
412
- monthData: [
413
- ...getPreDaysStatus(
414
- preMonthDays,
415
- "prev",
416
- { month: preMonth + "", year: preYear + "" },
417
- preCurrMonthDays
418
- ),
419
- ...getDaysStatus(currMonthDays, "curr", title)
420
- ],
421
- cssHeight: 0,
422
- cssScrollHeight: 0
423
- };
424
- monthInfo.cssHeight = 39 + (monthInfo.monthData.length > 35 ? 384 : 320);
425
- let cssScrollHeight = 0;
426
- if (state.monthsData.length > 0) {
427
- cssScrollHeight = state.monthsData[state.monthsData.length - 1].cssScrollHeight + state.monthsData[state.monthsData.length - 1].cssHeight;
428
- }
429
- monthInfo.cssScrollHeight = cssScrollHeight;
430
- if (type == "next") {
431
- if (!state.endData || !Utils.compareDate(
432
- `${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(state.endData[0], state.endData[1])}`,
433
- `${curData[0]}-${curData[1]}-${curData[2]}`
434
- )) {
435
- state.monthsData.push(monthInfo);
436
- }
437
- } else {
438
- if (!state.startData || !Utils.compareDate(
439
- `${curData[0]}-${curData[1]}-${curData[2]}`,
440
- `${state.startData[0]}-${state.startData[1]}-01`
441
- )) {
442
- state.monthsData.unshift(monthInfo);
443
- } else {
444
- state.unLoadPrev = true;
445
- }
446
- }
447
- };
448
- const initData = () => {
449
- let propStartDate = props.startDate ? props.startDate : Utils.getDay(0);
450
- let propEndDate = props.endDate ? props.endDate : Utils.getDay(365);
451
- state.propStartDate = propStartDate;
452
- state.propEndDate = propEndDate;
453
- state.startData = splitDate(propStartDate);
454
- state.endData = splitDate(propEndDate);
455
- if (props.defaultValue || Array.isArray(props.defaultValue) && props.defaultValue.length > 0) {
456
- state.currDate = props.type != "one" ? [...props.defaultValue] : props.defaultValue;
457
- }
458
- const startDate = {
459
- year: Number(state.startData[0]),
460
- month: Number(state.startData[1])
461
- };
462
- const endDate = {
463
- year: Number(state.endData[0]),
464
- month: Number(state.endData[1])
465
- };
466
- let monthsNum = endDate.month - startDate.month;
467
- if (endDate.year - startDate.year > 0) {
468
- monthsNum = monthsNum + 12 * (endDate.year - startDate.year);
469
- }
470
- if (monthsNum <= 0) {
471
- monthsNum = 1;
472
- }
473
- getMonth(state.startData, "next");
474
- let i = 1;
475
- do {
476
- getMonth(getCurrData("next"), "next");
477
- } while (i++ < monthsNum);
478
- state.monthsNum = monthsNum;
479
- if (props.type == "range" && Array.isArray(state.currDate)) {
480
- if (state.currDate.length > 0) {
481
- if (propStartDate && Utils.compareDate(state.currDate[0], propStartDate)) {
482
- state.currDate.splice(0, 1, propStartDate);
483
- }
484
- if (propEndDate && Utils.compareDate(propEndDate, state.currDate[1])) {
485
- state.currDate.splice(1, 1, propEndDate);
486
- }
487
- state.defaultData = [...splitDate(state.currDate[0]), ...splitDate(state.currDate[1])];
488
- }
489
- } else if (props.type == "multiple" && Array.isArray(state.currDate)) {
490
- if (state.currDate.length > 0) {
491
- let defaultArr = [];
492
- let obj = {};
493
- state.currDate.forEach((item) => {
494
- if (propStartDate && !Utils.compareDate(item, propStartDate) && propEndDate && !Utils.compareDate(propEndDate, item)) {
495
- if (!Object.hasOwnProperty.call(obj, item)) {
496
- defaultArr.push(item);
497
- obj[item] = item;
498
- }
499
- }
500
- });
501
- state.currDate = [...defaultArr];
502
- state.defaultData = [...splitDate(defaultArr[0])];
503
- }
504
- } else {
505
- if (state.currDate) {
506
- if (propStartDate && Utils.compareDate(state.currDate, propStartDate)) {
507
- state.currDate = propStartDate;
508
- } else if (propEndDate && !Utils.compareDate(state.currDate, propEndDate)) {
509
- state.currDate = propEndDate;
510
- }
511
- state.defaultData = [...splitDate(state.currDate)];
512
- }
513
- }
514
- let current = 0;
515
- let lastCurrent = 0;
516
- if (state.defaultData.length > 0) {
517
- state.monthsData.forEach((item, index) => {
518
- if (item.title == translate("monthTitle", state.defaultData[0], state.defaultData[1])) {
519
- current = index;
520
- }
521
- if (props.type == "range") {
522
- if (item.title == translate("monthTitle", state.defaultData[3], state.defaultData[4])) {
523
- lastCurrent = index;
524
- }
525
- }
526
- });
527
- }
528
- setDefaultRange(monthsNum, current);
529
- state.currentIndex = current;
530
- state.yearMonthTitle = state.monthsData[state.currentIndex].title;
531
- if (state.defaultData.length > 0) {
532
- if (props.type == "range") {
533
- chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
534
- chooseDay({ day: state.defaultData[5], type: "curr" }, state.monthsData[lastCurrent], true);
535
- } else if (props.type == "multiple") {
536
- [...state.currDate].forEach((item) => {
537
- let dateArr = splitDate(item);
538
- let current2 = state.currentIndex;
539
- state.monthsData.forEach((item2, index) => {
540
- if (item2.title == translate("monthTitle", dateArr[0], dateArr[1])) {
541
- current2 = index;
542
- }
543
- });
544
- chooseDay({ day: dateArr[2], type: "curr" }, state.monthsData[current2], true);
545
- });
546
- } else {
547
- chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
548
- }
549
- }
550
- let lastItem = state.monthsData[state.monthsData.length - 1];
551
- let containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;
552
- requestAniFrame(() => {
553
- if ((months == null ? void 0 : months.value) && (monthsPanel == null ? void 0 : monthsPanel.value) && (viewArea == null ? void 0 : viewArea.value)) {
554
- viewHeight.value = months.value.clientHeight;
555
- monthsPanel.value.style.height = `${containerHeight}px`;
556
- months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
557
- }
558
- });
559
- state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
560
- };
561
- const scrollToDate = (date) => {
562
- if (Utils.compareDate(date, state.propStartDate)) {
563
- date = state.propStartDate;
564
- } else if (!Utils.compareDate(date, state.propEndDate)) {
565
- date = state.propEndDate;
566
- }
567
- let dateArr = splitDate(date);
568
- state.monthsData.forEach((item, index) => {
569
- if (item.title == translate("monthTitle", dateArr[0], dateArr[1])) {
570
- if (months.value) {
571
- let distance = state.monthsData[index].cssScrollHeight - months.value.scrollTop;
572
- if (props.toDateAnimation) {
573
- let flag = 0;
574
- let interval = setInterval(() => {
575
- flag++;
576
- if (months.value) {
577
- let offset = distance / 10;
578
- months.value.scrollTop = months.value.scrollTop + offset;
579
- }
580
- if (flag >= 10) {
581
- clearInterval(interval);
582
- if (months.value) {
583
- months.value.scrollTop = state.monthsData[index].cssScrollHeight;
584
- }
585
- }
586
- }, 40);
587
- } else {
588
- months.value.scrollTop = state.monthsData[index].cssScrollHeight;
589
- }
590
- }
591
- }
592
- });
593
- };
594
- useExpose({
595
- scrollToDate
596
- });
597
- const setDefaultRange = (monthsNum, current) => {
598
- if (monthsNum >= 3) {
599
- if (current > 0 && current < monthsNum) {
600
- state.defaultRange = [current - 1, current + 3];
601
- } else if (current == 0) {
602
- state.defaultRange = [current, current + 4];
603
- } else if (current == monthsNum) {
604
- state.defaultRange = [current - 2, current + 2];
605
- }
606
- } else {
607
- state.defaultRange = [0, monthsNum + 2];
608
- }
609
- let defaultScrollTop = state.monthsData[state.defaultRange[0]].cssScrollHeight;
610
- state.translateY = defaultScrollTop;
611
- };
612
- const isActive = (day, month) => {
613
- return props.type == "range" && day.type == "curr" && getClass(day, month) == "nut-calendar__day--active";
614
- };
615
- const isStartTip = (day, month) => {
616
- return isActive(day, month) && isStart(getCurrDate(day, month));
617
- };
618
- const isEndTip = (day, month) => {
619
- if (state.currDate.length >= 2 && isEnd(getCurrDate(day, month))) {
620
- return isActive(day, month);
621
- }
622
- return false;
623
- };
624
- const rangeTip = () => {
625
- if (state.currDate.length >= 2) {
626
- return Utils.isEqual(state.currDate[0], state.currDate[1]);
627
- }
628
- };
629
- const isCurrDay = (dateInfo) => {
630
- const date = `${dateInfo.year}-${dateInfo.month}-${Number(dateInfo.day) < 10 ? "0" + dateInfo.day : dateInfo.day}`;
631
- return Utils.isEqual(date, Utils.date2Str(new Date()));
632
- };
633
- const mothsViewScroll = (e) => {
634
- if (state.monthsData.length <= 1) {
635
- return;
636
- }
637
- const currentScrollTop = e.target.scrollTop;
638
- let current = Math.floor(currentScrollTop / state.avgHeight);
639
- if (current == 0) {
640
- if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
641
- current += 1;
642
- }
643
- } else if (current > 0 && current < state.monthsNum - 1) {
644
- if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
645
- current += 1;
646
- }
647
- if (currentScrollTop < state.monthsData[current].cssScrollHeight) {
648
- current -= 1;
649
- }
650
- } else {
651
- const viewPosition = Math.round(currentScrollTop + viewHeight.value);
652
- if (viewPosition < state.monthsData[current].cssScrollHeight + state.monthsData[current].cssHeight && currentScrollTop > state.monthsData[current - 1].cssScrollHeight) {
653
- current -= 1;
654
- }
655
- if (current + 1 <= state.monthsNum && viewPosition >= state.monthsData[current + 1].cssScrollHeight + state.monthsData[current + 1].cssHeight) {
656
- current += 1;
657
- }
658
- if (current >= 1 && currentScrollTop < state.monthsData[current - 1].cssScrollHeight) {
659
- current -= 1;
660
- }
661
- }
662
- if (state.currentIndex !== current) {
663
- state.currentIndex = current;
664
- setDefaultRange(state.monthsNum, current);
665
- }
666
- state.yearMonthTitle = state.monthsData[current].title;
667
- };
668
- const resetRender = () => {
669
- state.chooseData.splice(0);
670
- state.monthsData.splice(0);
671
- initData();
672
- };
673
- initData();
674
- watch(
675
- () => props.defaultValue,
676
- (val) => {
677
- if (val) {
678
- if (props.poppable) {
679
- resetRender();
680
- }
681
- }
682
- }
683
- );
684
- return {
685
- weeks,
686
- compConthsData,
687
- showTopBtn,
688
- topInfo,
689
- bottomInfo,
690
- rangeTip,
691
- mothsViewScroll,
692
- getClass,
693
- isStartTip,
694
- isEndTip,
695
- chooseDay,
696
- isCurrDay,
697
- confirm,
698
- monthsPanel,
699
- months,
700
- weeksPanel,
701
- viewArea,
702
- ...toRefs(state),
703
- ...toRefs(props),
704
- translate
705
- };
706
- }
707
- });
708
- const _hoisted_1 = { class: "nut-calendar__header" };
709
- const _hoisted_2 = {
710
- key: 0,
711
- class: "nut-calendar__header-title"
712
- };
713
- const _hoisted_3 = {
714
- key: 1,
715
- class: "nut-calendar__header-slot"
716
- };
717
- const _hoisted_4 = {
718
- key: 2,
719
- class: "nut-calendar__header-subtitle"
720
- };
721
- const _hoisted_5 = {
722
- class: "nut-calendar__weekdays",
723
- ref: "weeksPanel"
724
- };
725
- const _hoisted_6 = {
726
- class: "nut-calendar__panel",
727
- ref: "monthsPanel"
728
- };
729
- const _hoisted_7 = { class: "nut-calendar__month-title" };
730
- const _hoisted_8 = { class: "nut-calendar__days" };
731
- const _hoisted_9 = ["onClick"];
732
- const _hoisted_10 = { class: "nut-calendar__day-value" };
733
- const _hoisted_11 = {
734
- key: 0,
735
- class: "nut-calendar__day-tips nut-calendar__day-tips--top"
736
- };
737
- const _hoisted_12 = {
738
- key: 1,
739
- class: "nut-calendar__day-tips nut-calendar__day-tips--bottom"
740
- };
741
- const _hoisted_13 = {
742
- key: 2,
743
- class: "nut-calendar__day-tips--curr"
744
- };
745
- const _hoisted_14 = {
746
- key: 4,
747
- class: "nut-calendar__day-tip"
748
- };
749
- const _hoisted_15 = {
750
- key: 0,
751
- class: "nut-calendar__footer"
752
- };
753
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
754
- return openBlock(), createElementBlock("view", {
755
- class: normalizeClass(["nut-calendar", {
756
- "nut-calendar--nopop": !_ctx.poppable,
757
- "nut-calendar--nofooter": _ctx.isAutoBackFill
758
- }])
759
- }, [
760
- createElementVNode("view", _hoisted_1, [
761
- _ctx.showTitle ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.title || _ctx.translate("title")), 1)) : createCommentVNode("", true),
762
- _ctx.showTopBtn ? (openBlock(), createElementBlock("view", _hoisted_3, [
763
- renderSlot(_ctx.$slots, "btn")
764
- ])) : createCommentVNode("", true),
765
- _ctx.showSubTitle ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.yearMonthTitle), 1)) : createCommentVNode("", true),
766
- createElementVNode("view", _hoisted_5, [
767
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weeks, (item, index) => {
768
- return openBlock(), createElementBlock("view", {
769
- class: "nut-calendar__weekday",
770
- key: index
771
- }, toDisplayString(item), 1);
772
- }), 128))
773
- ], 512)
774
- ]),
775
- createElementVNode("view", {
776
- class: "nut-calendar__content",
777
- ref: "months",
778
- onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.mothsViewScroll && _ctx.mothsViewScroll(...args))
779
- }, [
780
- createElementVNode("view", _hoisted_6, [
781
- createElementVNode("view", {
782
- class: "nut-calendar__body",
783
- ref: "viewArea",
784
- style: normalizeStyle({ transform: `translateY(${_ctx.translateY}px)` })
785
- }, [
786
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.compConthsData, (month, index) => {
787
- return openBlock(), createElementBlock("view", {
788
- class: "nut-calendar__month",
789
- key: index
790
- }, [
791
- createElementVNode("view", _hoisted_7, toDisplayString(month.title), 1),
792
- createElementVNode("view", _hoisted_8, [
793
- createElementVNode("view", {
794
- class: normalizeClass(["nut-calendar__days-item", _ctx.type === "range" ? "nut-calendar__days-item--range" : ""])
795
- }, [
796
- (openBlock(true), createElementBlock(Fragment, null, renderList(month.monthData, (day, i) => {
797
- return openBlock(), createElementBlock("view", {
798
- key: i,
799
- class: normalizeClass(["nut-calendar__day", _ctx.getClass(day, month)]),
800
- onClick: ($event) => _ctx.chooseDay(day, month)
801
- }, [
802
- createElementVNode("view", _hoisted_10, [
803
- renderSlot(_ctx.$slots, "day", {
804
- date: day.type == "curr" ? day : ""
805
- }, () => [
806
- createTextVNode(toDisplayString(day.type == "curr" ? day.day : ""), 1)
807
- ])
808
- ]),
809
- _ctx.topInfo ? (openBlock(), createElementBlock("view", _hoisted_11, [
810
- renderSlot(_ctx.$slots, "top-info", {
811
- date: day.type == "curr" ? day : ""
812
- })
813
- ])) : createCommentVNode("", true),
814
- _ctx.bottomInfo ? (openBlock(), createElementBlock("view", _hoisted_12, [
815
- renderSlot(_ctx.$slots, "bottom-info", {
816
- date: day.type == "curr" ? day : ""
817
- })
818
- ])) : createCommentVNode("", true),
819
- !_ctx.bottomInfo && _ctx.showToday && _ctx.isCurrDay(day) ? (openBlock(), createElementBlock("view", _hoisted_13, toDisplayString(_ctx.translate("today")), 1)) : createCommentVNode("", true),
820
- _ctx.isStartTip(day, month) ? (openBlock(), createElementBlock("view", {
821
- key: 3,
822
- class: normalizeClass(["nut-calendar__day-tip", { "nut-calendar__day-tips--top": _ctx.rangeTip() }])
823
- }, toDisplayString(_ctx.startText || _ctx.translate("start")), 3)) : createCommentVNode("", true),
824
- _ctx.isEndTip(day, month) ? (openBlock(), createElementBlock("view", _hoisted_14, toDisplayString(_ctx.endText || _ctx.translate("end")), 1)) : createCommentVNode("", true)
825
- ], 10, _hoisted_9);
826
- }), 128))
827
- ], 2)
828
- ])
829
- ]);
830
- }), 128))
831
- ], 4)
832
- ], 512)
833
- ], 544),
834
- _ctx.poppable && !_ctx.isAutoBackFill ? (openBlock(), createElementBlock("view", _hoisted_15, [
835
- createElementVNode("view", {
836
- class: "nut-calendar__confirm",
837
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.confirm && _ctx.confirm(...args))
838
- }, toDisplayString(_ctx.confirmText || _ctx.translate("confirm")), 1)
839
- ])) : createCommentVNode("", true)
840
- ], 2);
841
- }
842
- const CalendarItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
843
- export {
844
- CalendarItem as C,
845
- Utils as U
846
- };