@nutui/nutui 4.0.11 → 4.0.12

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