vueless 0.0.483 → 0.0.484
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.
- package/adatper.locale/vueless.ts +3 -3
- package/composables/useUI.ts +2 -1
- package/package.json +1 -1
- package/types.ts +10 -3
- package/ui.form-calendar/UCalendar.vue +310 -370
- package/ui.form-calendar/UCalendarDayView.vue +211 -257
- package/ui.form-calendar/UCalendarMonthView.vue +120 -164
- package/ui.form-calendar/UCalendarYearView.vue +118 -164
- package/ui.form-calendar/{config.js → config.ts} +0 -2
- package/ui.form-calendar/{constants.js → constants.ts} +35 -16
- package/ui.form-calendar/storybook/Docs.mdx +2 -3
- package/ui.form-calendar/storybook/{stories.js → stories.ts} +12 -4
- package/ui.form-calendar/types.ts +91 -0
- package/ui.form-calendar/{useAttrs.js → useAttrs.ts} +5 -2
- package/ui.form-calendar/{utilCalendar.js → utilCalendar.ts} +50 -53
- package/ui.form-calendar/{utilDate.js → utilDate.ts} +44 -37
- package/ui.form-calendar/utilFormatting.ts +178 -0
- package/ui.text-badge/useAttrs.ts +2 -2
- package/ui.text-block/useAttrs.ts +1 -3
- package/web-types.json +177 -50
- package/ui.form-calendar/utilFormatting.js +0 -180
- package/ui.form-date-picker/storybook/Docs.mdx +0 -53
- package/ui.form-date-picker/storybook/stories.js +0 -185
- package/ui.form-date-picker-range/storybook/Docs.mdx +0 -16
- package/ui.form-date-picker-range/storybook/stories.js +0 -216
|
@@ -1,3 +1,214 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
|
|
4
|
+
import { formatDate, dateIsOutOfRange } from "./utilCalendar.ts";
|
|
5
|
+
import {
|
|
6
|
+
isToday,
|
|
7
|
+
getDateWithoutTime,
|
|
8
|
+
getLastDayOfMonth,
|
|
9
|
+
isSameDay,
|
|
10
|
+
isAnotherMothDay,
|
|
11
|
+
} from "./utilDate.ts";
|
|
12
|
+
|
|
13
|
+
import useAttrs from "./useAttrs.ts";
|
|
14
|
+
|
|
15
|
+
import { DAYS_IN_WEEK, START_WEEK } from "./constants.ts";
|
|
16
|
+
|
|
17
|
+
import type { UCalendarViewProps, UCalendarProps } from "./types.ts";
|
|
18
|
+
|
|
19
|
+
import UButton from "../ui.button/UButton.vue";
|
|
20
|
+
|
|
21
|
+
const props = defineProps<UCalendarViewProps>();
|
|
22
|
+
|
|
23
|
+
const emit = defineEmits(["input"]);
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
dayViewAttrs,
|
|
27
|
+
weekDaysAttrs,
|
|
28
|
+
weekDayAttrs,
|
|
29
|
+
daysAttrs,
|
|
30
|
+
dayAttrs,
|
|
31
|
+
currentDayAttrs,
|
|
32
|
+
dayInRangeAttrs,
|
|
33
|
+
currentDayInRangeAttrs,
|
|
34
|
+
anotherMonthDayAttrs,
|
|
35
|
+
firstDayInRangeAttrs,
|
|
36
|
+
anotherMonthFirstDayInRangeAttrs,
|
|
37
|
+
lastDayInRangeAttrs,
|
|
38
|
+
anotherMonthLastDayInRangeAttrs,
|
|
39
|
+
selectedDayAttrs,
|
|
40
|
+
activeDayAttrs,
|
|
41
|
+
currentLastDayInRangeAttrs,
|
|
42
|
+
currentFirstDayInRangeAttrs,
|
|
43
|
+
} = useAttrs(props as unknown as UCalendarProps);
|
|
44
|
+
|
|
45
|
+
const localSelectedDate = computed(() => {
|
|
46
|
+
return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const activeMonthDate = computed(() => {
|
|
50
|
+
return props.activeMonth || localSelectedDate.value;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const firstDayOfMonth = computed(() => {
|
|
54
|
+
const date = new Date(activeMonthDate.value.valueOf());
|
|
55
|
+
|
|
56
|
+
date.setDate(1);
|
|
57
|
+
|
|
58
|
+
return date;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const lastDayOfMonth = computed(() => {
|
|
62
|
+
return getLastDayOfMonth(activeMonthDate.value);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const firstDayOfPrevMonth = computed(() => {
|
|
66
|
+
const prevMonth = activeMonthDate.value.getMonth() - 1;
|
|
67
|
+
|
|
68
|
+
return new Date(activeMonthDate.value.getFullYear(), prevMonth, 1);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const lastDayOfPrevMonth = computed(() => {
|
|
72
|
+
const date = new Date(activeMonthDate.value.valueOf());
|
|
73
|
+
|
|
74
|
+
date.setDate(0);
|
|
75
|
+
|
|
76
|
+
return date;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const firstDayOfNextMonth = computed(() => {
|
|
80
|
+
const date = new Date(activeMonthDate.value.valueOf());
|
|
81
|
+
const nextMonth = activeMonthDate.value.getMonth() + 1;
|
|
82
|
+
|
|
83
|
+
date.setDate(1);
|
|
84
|
+
date.setMonth(nextMonth);
|
|
85
|
+
|
|
86
|
+
return date;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const monthDays = computed(() => {
|
|
90
|
+
const dayNumber = lastDayOfMonth.value.getDate();
|
|
91
|
+
|
|
92
|
+
return Array.from({ length: dayNumber }, (_, index) => dayNumber - index)
|
|
93
|
+
.map((day) => getDay(activeMonthDate.value, day))
|
|
94
|
+
.reverse();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const prevMonthDays = computed(() => {
|
|
98
|
+
let prevMonthTotalDays = firstDayOfMonth.value.getDay() - START_WEEK;
|
|
99
|
+
|
|
100
|
+
if (prevMonthTotalDays < 0) {
|
|
101
|
+
prevMonthTotalDays = DAYS_IN_WEEK + prevMonthTotalDays;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return Array.from(
|
|
105
|
+
{ length: prevMonthTotalDays },
|
|
106
|
+
(_, index) => lastDayOfPrevMonth.value.getDate() - index,
|
|
107
|
+
)
|
|
108
|
+
.map((day) => getDay(firstDayOfPrevMonth.value, day))
|
|
109
|
+
.reverse();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const nextMonthDays = computed(() => {
|
|
113
|
+
const nextMonthTotalDays =
|
|
114
|
+
DAYS_IN_WEEK - (monthDays.value.concat(prevMonthDays.value).length % DAYS_IN_WEEK);
|
|
115
|
+
|
|
116
|
+
if (nextMonthTotalDays === DAYS_IN_WEEK) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return Array.from({ length: nextMonthTotalDays }, (_, index) => nextMonthTotalDays - index)
|
|
121
|
+
.map((day) => getDay(firstDayOfNextMonth.value, day))
|
|
122
|
+
.reverse();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const weekdays = computed(() =>
|
|
126
|
+
Array.from({ length: DAYS_IN_WEEK }, (_, index) => DAYS_IN_WEEK - index)
|
|
127
|
+
.map(getWeekDayName)
|
|
128
|
+
.reverse(),
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const days = computed(() => {
|
|
132
|
+
return prevMonthDays.value.concat(monthDays.value, nextMonthDays.value);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
function getWeekDayName(dayNumber: number) {
|
|
136
|
+
const date = new Date();
|
|
137
|
+
|
|
138
|
+
date.setDate((date.getDate() + (DAYS_IN_WEEK + dayNumber - date.getDay())) % DAYS_IN_WEEK);
|
|
139
|
+
|
|
140
|
+
return formatDate(date, "D", props.locale);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function getDay(date: Date, dayNumber: number) {
|
|
144
|
+
const day = new Date(date.valueOf());
|
|
145
|
+
|
|
146
|
+
day.setDate(dayNumber);
|
|
147
|
+
|
|
148
|
+
return day;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getDayState(day: Date) {
|
|
152
|
+
const isDayInRange =
|
|
153
|
+
props.range &&
|
|
154
|
+
localSelectedDate.value &&
|
|
155
|
+
props.selectedDate &&
|
|
156
|
+
props.selectedDateTo &&
|
|
157
|
+
!dateIsOutOfRange(
|
|
158
|
+
day,
|
|
159
|
+
props.selectedDate,
|
|
160
|
+
props.selectedDateTo,
|
|
161
|
+
props.locale,
|
|
162
|
+
props.dateFormat,
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const isSelectedDay = isSameDay(day, localSelectedDate.value) && props.selectedDate !== null;
|
|
166
|
+
const isCurrentDay = isToday(day);
|
|
167
|
+
const isAnotherMonthDay = isAnotherMothDay(day, activeMonthDate.value);
|
|
168
|
+
const isCurrentDayInRange = isCurrentDay && isDayInRange;
|
|
169
|
+
const isFirstDayInRange = props.range && isSameDay(day, localSelectedDate.value);
|
|
170
|
+
const isLastDayInRange =
|
|
171
|
+
props.selectedDateTo && props.range && isSameDay(day, props.selectedDateTo);
|
|
172
|
+
const isCurrentFirstDayInRange = isFirstDayInRange && isCurrentDay;
|
|
173
|
+
const isCurrentLastDayInRange = isLastDayInRange && isCurrentDay;
|
|
174
|
+
const isAnotherMonthFirstDayInRange = isFirstDayInRange && isAnotherMonthDay;
|
|
175
|
+
const isAnotherMonthLastDayInRange = isLastDayInRange && isAnotherMonthDay;
|
|
176
|
+
const isActiveDay = props.activeDate && isSameDay(props.activeDate, day) && !props.range;
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
isDayInRange,
|
|
180
|
+
isSelectedDay,
|
|
181
|
+
isCurrentDay,
|
|
182
|
+
isAnotherMonthDay,
|
|
183
|
+
isCurrentDayInRange,
|
|
184
|
+
isFirstDayInRange,
|
|
185
|
+
isLastDayInRange,
|
|
186
|
+
isCurrentFirstDayInRange,
|
|
187
|
+
isCurrentLastDayInRange,
|
|
188
|
+
isAnotherMonthFirstDayInRange,
|
|
189
|
+
isAnotherMonthLastDayInRange,
|
|
190
|
+
isActiveDay,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function onClickDay(day: Date) {
|
|
195
|
+
const isSameDate = isSameDay(day, localSelectedDate.value) && props.selectedDate !== null;
|
|
196
|
+
const isSameDayInRange =
|
|
197
|
+
isSameDay(day, localSelectedDate.value) &&
|
|
198
|
+
props.selectedDate !== null &&
|
|
199
|
+
props.selectedDateTo &&
|
|
200
|
+
props.range;
|
|
201
|
+
|
|
202
|
+
if (isSameDate || isSameDayInRange) {
|
|
203
|
+
emit("input", null);
|
|
204
|
+
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
emit("input", day);
|
|
209
|
+
}
|
|
210
|
+
</script>
|
|
211
|
+
|
|
1
212
|
<template>
|
|
2
213
|
<div v-bind="dayViewAttrs">
|
|
3
214
|
<div v-bind="weekDaysAttrs">
|
|
@@ -196,260 +407,3 @@
|
|
|
196
407
|
</div>
|
|
197
408
|
</div>
|
|
198
409
|
</template>
|
|
199
|
-
|
|
200
|
-
<script setup>
|
|
201
|
-
import { computed } from "vue";
|
|
202
|
-
|
|
203
|
-
import { formatDate, dateIsOutOfRange } from "./utilCalendar.js";
|
|
204
|
-
import {
|
|
205
|
-
isToday,
|
|
206
|
-
getDateWithoutTime,
|
|
207
|
-
getLastDayOfMonth,
|
|
208
|
-
isSameDay,
|
|
209
|
-
isAnotherMothDay,
|
|
210
|
-
} from "./utilDate.js";
|
|
211
|
-
|
|
212
|
-
import useAttrs from "./useAttrs.js";
|
|
213
|
-
|
|
214
|
-
import { DAYS_IN_WEEK, START_WEEK } from "./constants.js";
|
|
215
|
-
|
|
216
|
-
import UButton from "../ui.button/UButton.vue";
|
|
217
|
-
|
|
218
|
-
const props = defineProps({
|
|
219
|
-
selectedDate: {
|
|
220
|
-
type: [Date, null],
|
|
221
|
-
required: true,
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
selectedDateTo: {
|
|
225
|
-
type: [Date, null],
|
|
226
|
-
default: undefined,
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
activeDate: {
|
|
230
|
-
type: [Date, null],
|
|
231
|
-
required: true,
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
activeMonth: {
|
|
235
|
-
type: [Date, null],
|
|
236
|
-
required: true,
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
locale: {
|
|
240
|
-
type: Object,
|
|
241
|
-
required: true,
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
dateFormat: {
|
|
245
|
-
type: String,
|
|
246
|
-
default: undefined,
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
range: {
|
|
250
|
-
type: Boolean,
|
|
251
|
-
default: false,
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
maxDate: {
|
|
255
|
-
type: [Date, String],
|
|
256
|
-
default: undefined,
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
minDate: {
|
|
260
|
-
type: [Date, String],
|
|
261
|
-
default: undefined,
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
config: {
|
|
265
|
-
type: Object,
|
|
266
|
-
default: () => ({}),
|
|
267
|
-
},
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
const emit = defineEmits(["input"]);
|
|
271
|
-
|
|
272
|
-
const {
|
|
273
|
-
dayViewAttrs,
|
|
274
|
-
weekDaysAttrs,
|
|
275
|
-
weekDayAttrs,
|
|
276
|
-
daysAttrs,
|
|
277
|
-
dayAttrs,
|
|
278
|
-
currentDayAttrs,
|
|
279
|
-
dayInRangeAttrs,
|
|
280
|
-
currentDayInRangeAttrs,
|
|
281
|
-
anotherMonthDayAttrs,
|
|
282
|
-
firstDayInRangeAttrs,
|
|
283
|
-
anotherMonthFirstDayInRangeAttrs,
|
|
284
|
-
lastDayInRangeAttrs,
|
|
285
|
-
anotherMonthLastDayInRangeAttrs,
|
|
286
|
-
selectedDayAttrs,
|
|
287
|
-
activeDayAttrs,
|
|
288
|
-
currentLastDayInRangeAttrs,
|
|
289
|
-
currentFirstDayInRangeAttrs,
|
|
290
|
-
} = useAttrs(props);
|
|
291
|
-
|
|
292
|
-
const localSelectedDate = computed(() => {
|
|
293
|
-
return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
const activeMonthDate = computed(() => {
|
|
297
|
-
return props.activeMonth || localSelectedDate.value;
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
const firstDayOfMonth = computed(() => {
|
|
301
|
-
const date = new Date(activeMonthDate.value.valueOf());
|
|
302
|
-
|
|
303
|
-
date.setDate(1);
|
|
304
|
-
|
|
305
|
-
return date;
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
const lastDayOfMonth = computed(() => {
|
|
309
|
-
return getLastDayOfMonth(activeMonthDate.value);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
const firstDayOfPrevMonth = computed(() => {
|
|
313
|
-
const prevMonth = activeMonthDate.value.getMonth() - 1;
|
|
314
|
-
|
|
315
|
-
return new Date(activeMonthDate.value.getFullYear(), prevMonth, 1);
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
const lastDayOfPrevMonth = computed(() => {
|
|
319
|
-
const date = new Date(activeMonthDate.value.valueOf());
|
|
320
|
-
|
|
321
|
-
date.setDate(0);
|
|
322
|
-
|
|
323
|
-
return date;
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
const firstDayOfNextMonth = computed(() => {
|
|
327
|
-
const date = new Date(activeMonthDate.value.valueOf());
|
|
328
|
-
const nextMonth = activeMonthDate.value.getMonth() + 1;
|
|
329
|
-
|
|
330
|
-
date.setDate(1);
|
|
331
|
-
date.setMonth(nextMonth);
|
|
332
|
-
|
|
333
|
-
return date;
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
const monthDays = computed(() => {
|
|
337
|
-
const dayNumber = lastDayOfMonth.value.getDate();
|
|
338
|
-
|
|
339
|
-
return Array.from({ length: dayNumber }, (_, index) => dayNumber - index)
|
|
340
|
-
.map((day) => getDay(activeMonthDate.value, day))
|
|
341
|
-
.reverse();
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
const prevMonthDays = computed(() => {
|
|
345
|
-
let prevMonthTotalDays = firstDayOfMonth.value.getDay() - START_WEEK;
|
|
346
|
-
|
|
347
|
-
if (prevMonthTotalDays < 0) {
|
|
348
|
-
prevMonthTotalDays = DAYS_IN_WEEK + prevMonthTotalDays;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return Array.from(
|
|
352
|
-
{ length: prevMonthTotalDays },
|
|
353
|
-
(_, index) => lastDayOfPrevMonth.value.getDate() - index,
|
|
354
|
-
)
|
|
355
|
-
.map((day) => getDay(firstDayOfPrevMonth.value, day))
|
|
356
|
-
.reverse();
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
const nextMonthDays = computed(() => {
|
|
360
|
-
const nextMonthTotalDays =
|
|
361
|
-
DAYS_IN_WEEK - (monthDays.value.concat(prevMonthDays.value).length % DAYS_IN_WEEK);
|
|
362
|
-
|
|
363
|
-
if (nextMonthTotalDays === DAYS_IN_WEEK) {
|
|
364
|
-
return [];
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return Array.from({ length: nextMonthTotalDays }, (_, index) => nextMonthTotalDays - index)
|
|
368
|
-
.map((day) => getDay(firstDayOfNextMonth.value, day))
|
|
369
|
-
.reverse();
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
const weekdays = computed(() =>
|
|
373
|
-
Array.from({ length: DAYS_IN_WEEK }, (_, index) => DAYS_IN_WEEK - index)
|
|
374
|
-
.map(getWeekDayName)
|
|
375
|
-
.reverse(),
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
const days = computed(() => {
|
|
379
|
-
return prevMonthDays.value.concat(monthDays.value, nextMonthDays.value);
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
function getWeekDayName(dayNumber) {
|
|
383
|
-
const date = new Date();
|
|
384
|
-
|
|
385
|
-
date.setDate((date.getDate() + (DAYS_IN_WEEK + dayNumber - date.getDay())) % DAYS_IN_WEEK);
|
|
386
|
-
|
|
387
|
-
return formatDate(date, "D", props.locale);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function getDay(date, dayNumber) {
|
|
391
|
-
const day = new Date(date.valueOf());
|
|
392
|
-
|
|
393
|
-
day.setDate(dayNumber);
|
|
394
|
-
|
|
395
|
-
return day;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
function getDayState(day) {
|
|
399
|
-
const isDayInRange =
|
|
400
|
-
props.range &&
|
|
401
|
-
localSelectedDate.value &&
|
|
402
|
-
props.selectedDateTo &&
|
|
403
|
-
!dateIsOutOfRange(
|
|
404
|
-
day,
|
|
405
|
-
props.selectedDate,
|
|
406
|
-
props.selectedDateTo,
|
|
407
|
-
props.locale,
|
|
408
|
-
props.dateFormat,
|
|
409
|
-
);
|
|
410
|
-
|
|
411
|
-
const isSelectedDay = isSameDay(day, localSelectedDate.value) && props.selectedDate !== null;
|
|
412
|
-
const isCurrentDay = isToday(day);
|
|
413
|
-
const isAnotherMonthDay = isAnotherMothDay(day, activeMonthDate.value);
|
|
414
|
-
const isCurrentDayInRange = isCurrentDay && isDayInRange;
|
|
415
|
-
const isFirstDayInRange = props.range && isSameDay(day, localSelectedDate.value);
|
|
416
|
-
const isLastDayInRange = props.range && isSameDay(day, props.selectedDateTo);
|
|
417
|
-
const isCurrentFirstDayInRange = isFirstDayInRange && isCurrentDay;
|
|
418
|
-
const isCurrentLastDayInRange = isLastDayInRange && isCurrentDay;
|
|
419
|
-
const isAnotherMonthFirstDayInRange = isFirstDayInRange && isAnotherMonthDay;
|
|
420
|
-
const isAnotherMonthLastDayInRange = isLastDayInRange && isAnotherMonthDay;
|
|
421
|
-
const isActiveDay = isSameDay(props.activeDate, day) && !props.range;
|
|
422
|
-
|
|
423
|
-
return {
|
|
424
|
-
isDayInRange,
|
|
425
|
-
isSelectedDay,
|
|
426
|
-
isCurrentDay,
|
|
427
|
-
isAnotherMonthDay,
|
|
428
|
-
isCurrentDayInRange,
|
|
429
|
-
isFirstDayInRange,
|
|
430
|
-
isLastDayInRange,
|
|
431
|
-
isCurrentFirstDayInRange,
|
|
432
|
-
isCurrentLastDayInRange,
|
|
433
|
-
isAnotherMonthFirstDayInRange,
|
|
434
|
-
isAnotherMonthLastDayInRange,
|
|
435
|
-
isActiveDay,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
function onClickDay(day) {
|
|
440
|
-
const isSameDate = isSameDay(day, localSelectedDate.value) && props.selectedDate !== null;
|
|
441
|
-
const isSameDayInRange =
|
|
442
|
-
isSameDay(day, localSelectedDate.value) &&
|
|
443
|
-
props.selectedDate !== null &&
|
|
444
|
-
props.selectedDateTo &&
|
|
445
|
-
props.range;
|
|
446
|
-
|
|
447
|
-
if (isSameDate || isSameDayInRange) {
|
|
448
|
-
emit("input", null);
|
|
449
|
-
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
emit("input", day);
|
|
454
|
-
}
|
|
455
|
-
</script>
|