@youcan/celeste 0.7.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/celeste.css +465 -0
  2. package/dist/cjs/calendar.cjs +2 -0
  3. package/dist/cjs/chunks/ComboboxContent.cjs +1 -1
  4. package/dist/cjs/chunks/DialogPortal.cjs +1 -1
  5. package/dist/cjs/chunks/DismissableLayer.cjs +0 -34
  6. package/dist/cjs/chunks/FocusScope.cjs +2 -2
  7. package/dist/cjs/chunks/MenuContentImpl.cjs +1 -1
  8. package/dist/cjs/chunks/SelectItemAlignedPosition.cjs +1 -1
  9. package/dist/cjs/chunks/calendar.cjs +923 -0
  10. package/dist/cjs/chunks/components.cjs +9 -1
  11. package/dist/cjs/chunks/counter-input.cjs +2 -13
  12. package/dist/cjs/chunks/date-picker.cjs +99 -0
  13. package/dist/cjs/chunks/defu.cjs +34 -0
  14. package/dist/cjs/chunks/popover-content.cjs +1 -1
  15. package/dist/cjs/chunks/range-calendar.cjs +1170 -0
  16. package/dist/cjs/chunks/range-picker.cjs +231 -0
  17. package/dist/cjs/chunks/tooltip-content.cjs +3 -2
  18. package/dist/cjs/chunks/useCalendar.cjs +2439 -0
  19. package/dist/cjs/chunks/useLocale.cjs +20 -0
  20. package/dist/cjs/date-picker.cjs +2 -0
  21. package/dist/cjs/index.cjs +9 -1
  22. package/dist/cjs/range-calendar.cjs +2 -0
  23. package/dist/cjs/range-picker.cjs +2 -0
  24. package/dist/components/calendar/calendar.d.ts +19 -0
  25. package/dist/components/calendar/index.d.ts +2 -0
  26. package/dist/components/date-picker/date-picker.d.ts +27 -0
  27. package/dist/components/date-picker/index.d.ts +2 -0
  28. package/dist/components/index.d.ts +4 -0
  29. package/dist/components/range-calendar/index.d.ts +2 -0
  30. package/dist/components/range-calendar/range-calendar.d.ts +24 -0
  31. package/dist/components/range-picker/index.d.ts +2 -0
  32. package/dist/components/range-picker/range-picker.d.ts +38 -0
  33. package/dist/components/rich-editor/rich-editor.d.ts +1 -1
  34. package/dist/es/calendar.js +2 -0
  35. package/dist/es/chunks/ComboboxContent.js +1 -1
  36. package/dist/es/chunks/DialogPortal.js +1 -1
  37. package/dist/es/chunks/DismissableLayer.js +1 -29
  38. package/dist/es/chunks/FocusScope.js +1 -1
  39. package/dist/es/chunks/MenuContentImpl.js +1 -1
  40. package/dist/es/chunks/SelectItemAlignedPosition.js +1 -1
  41. package/dist/es/chunks/calendar.js +916 -0
  42. package/dist/es/chunks/components.js +9 -1
  43. package/dist/es/chunks/counter-input.js +1 -12
  44. package/dist/es/chunks/date-picker.js +92 -0
  45. package/dist/es/chunks/defu.js +29 -0
  46. package/dist/es/chunks/popover-content.js +1 -1
  47. package/dist/es/chunks/range-calendar.js +1163 -0
  48. package/dist/es/chunks/range-picker.js +224 -0
  49. package/dist/es/chunks/tooltip-content.js +2 -1
  50. package/dist/es/chunks/useCalendar.js +2331 -0
  51. package/dist/es/chunks/useLocale.js +14 -0
  52. package/dist/es/date-picker.js +2 -0
  53. package/dist/es/index.js +6 -2
  54. package/dist/es/range-calendar.js +2 -0
  55. package/dist/es/range-picker.js +2 -0
  56. package/package.json +5 -3
  57. package/src/components/calendar/calendar.vue +305 -0
  58. package/src/components/calendar/index.ts +2 -0
  59. package/src/components/calendar/stories/calendar.stories.ts +76 -0
  60. package/src/components/date-picker/date-picker.vue +91 -0
  61. package/src/components/date-picker/index.ts +2 -0
  62. package/src/components/date-picker/stories/date-picker.stories.ts +92 -0
  63. package/src/components/index.ts +4 -0
  64. package/src/components/range-calendar/index.ts +2 -0
  65. package/src/components/range-calendar/range-calendar.vue +363 -0
  66. package/src/components/range-calendar/stories/range-calendar.stories.ts +46 -0
  67. package/src/components/range-picker/index.ts +2 -0
  68. package/src/components/range-picker/range-picker.vue +237 -0
  69. package/src/components/range-picker/stories/range-picker.stories.ts +97 -0
@@ -0,0 +1,1163 @@
1
+ import { t as clsx } from "./clsx.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
3
+ import { t as createContext } from "./createContext.js";
4
+ import { i as useEventListener, s as useVModel } from "./dist.js";
5
+ import { t as Primitive } from "./Primitive.js";
6
+ import { a as handleCalendarInitialFocus, c as isBefore, d as toDate, f as $fb18d541ea1ad717$export$ad991b66133851cf, g as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, h as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, i as getWeekStartsOn, l as isBetween, m as $14e0f24ef4ac5c92$export$91b62ebf2ba703ee, o as areAllDaysBetweenValid, p as $14e0f24ef4ac5c92$export$629b0a497aa65267, r as getDaysBetween, s as getDefaultDate, t as useCalendar, u as isBetweenInclusive, v as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from "./useCalendar.js";
7
+ import { t as useDirection } from "./useDirection.js";
8
+ import { t as useForwardPropsEmits } from "./useForwardPropsEmits.js";
9
+ import { t as useKbd } from "./useKbd.js";
10
+ import { t as useLocale } from "./useLocale.js";
11
+ import { t as usePrimitiveElement } from "./usePrimitiveElement.js";
12
+ import { useDelegatedProps } from "../use-delegated-props.js";
13
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, toRefs, unref, watch, withCtx, withKeys } from "vue";
14
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/useRangeCalendar.js
15
+ function useRangeCalendarState(props) {
16
+ const isStartInvalid = computed(() => {
17
+ if (!props.start.value) return false;
18
+ if (props.isDateDisabled(props.start.value)) return true;
19
+ return false;
20
+ });
21
+ const isEndInvalid = computed(() => {
22
+ if (!props.end.value) return false;
23
+ if (props.isDateDisabled(props.end.value)) return true;
24
+ return false;
25
+ });
26
+ const isInvalid = computed(() => {
27
+ if (isStartInvalid.value || isEndInvalid.value) return true;
28
+ if (props.start.value && props.end.value && isBefore(props.end.value, props.start.value)) return true;
29
+ return false;
30
+ });
31
+ const isSelectionStart = (date) => {
32
+ if (!props.start.value) return false;
33
+ return $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.start.value, date);
34
+ };
35
+ const isSelectionEnd = (date) => {
36
+ if (!props.end.value) return false;
37
+ return $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.end.value, date);
38
+ };
39
+ const isSelected = (date) => {
40
+ if (props.start.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.start.value, date)) return true;
41
+ if (props.end.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.end.value, date)) return true;
42
+ if (props.end.value && props.start.value) return isBetween(date, props.start.value, props.end.value);
43
+ return false;
44
+ };
45
+ const rangeIsDateDisabled = (date) => {
46
+ if (props.isDateDisabled(date)) return true;
47
+ if (props.maximumDays?.value) {
48
+ if (props.start.value && props.end.value) {
49
+ if (props.fixedDate.value) {
50
+ const diff = getDaysBetween(props.start.value, props.end.value).length;
51
+ if (diff <= props.maximumDays.value) {
52
+ const daysLeft = props.maximumDays.value - diff - 1;
53
+ return !isBetween(date, props.start.value.subtract({ days: daysLeft }), props.end.value.add({ days: daysLeft }));
54
+ }
55
+ }
56
+ return false;
57
+ }
58
+ if (props.start.value) {
59
+ const maxDate = props.start.value.add({ days: props.maximumDays.value });
60
+ return !isBetween(date, props.start.value.subtract({ days: props.maximumDays.value }), maxDate);
61
+ }
62
+ }
63
+ return false;
64
+ };
65
+ const isDateHighlightable = (date) => {
66
+ if (props.isDateHighlightable?.(date)) return true;
67
+ return false;
68
+ };
69
+ const highlightedRange = computed(() => {
70
+ if (props.start.value && props.end.value && !props.fixedDate.value) return null;
71
+ if (!props.start.value || !props.focusedValue.value) return null;
72
+ const isStartBeforeFocused = isBefore(props.start.value, props.focusedValue.value);
73
+ const start = isStartBeforeFocused ? props.start.value : props.focusedValue.value;
74
+ const end = isStartBeforeFocused ? props.focusedValue.value : props.start.value;
75
+ if ($14e0f24ef4ac5c92$export$ea39ec197993aef0(start, end)) return {
76
+ start,
77
+ end
78
+ };
79
+ if (props.maximumDays?.value && !props.end.value) {
80
+ const maximumDays = props.maximumDays.value;
81
+ const anchor = props.start.value;
82
+ const focused = props.focusedValue.value;
83
+ if (!isBefore(focused, anchor)) return {
84
+ start: anchor,
85
+ end: anchor.add({ days: maximumDays - 1 })
86
+ };
87
+ return {
88
+ start: anchor.subtract({ days: maximumDays - 1 }),
89
+ end: anchor
90
+ };
91
+ }
92
+ if (areAllDaysBetweenValid(start, end, props.allowNonContiguousRanges.value ? () => false : props.isDateUnavailable, rangeIsDateDisabled, props.isDateHighlightable)) return {
93
+ start,
94
+ end
95
+ };
96
+ return null;
97
+ });
98
+ const isHighlightedStart = (date) => {
99
+ if (!highlightedRange.value || !highlightedRange.value.start) return false;
100
+ return $14e0f24ef4ac5c92$export$ea39ec197993aef0(highlightedRange.value.start, date);
101
+ };
102
+ const isHighlightedEnd = (date) => {
103
+ if (!highlightedRange.value || !highlightedRange.value.end) return false;
104
+ return $14e0f24ef4ac5c92$export$ea39ec197993aef0(highlightedRange.value.end, date);
105
+ };
106
+ const hasSelectedDate = computed(() => {
107
+ return !!(props.start.value || props.end.value);
108
+ });
109
+ const isStartDateDisabled = computed(() => {
110
+ return !!(props.start.value && props.isDateDisabled(props.start.value));
111
+ });
112
+ const isEndDateDisabled = computed(() => {
113
+ return !!(props.end.value && props.isDateDisabled(props.end.value));
114
+ });
115
+ return {
116
+ isInvalid,
117
+ isSelected,
118
+ isDateHighlightable,
119
+ highlightedRange,
120
+ isSelectionStart,
121
+ isSelectionEnd,
122
+ isHighlightedStart,
123
+ isHighlightedEnd,
124
+ isDateDisabled: rangeIsDateDisabled,
125
+ hasSelectedDate,
126
+ isSelectedDisabled: computed(() => {
127
+ const hasStart = !!props.start.value;
128
+ const hasEnd = !!props.end.value;
129
+ if (!hasStart && !hasEnd) return false;
130
+ if (hasStart && hasEnd) return isStartDateDisabled.value && isEndDateDisabled.value;
131
+ return hasStart && isStartDateDisabled.value || hasEnd && isEndDateDisabled.value;
132
+ }),
133
+ selectedFocusableDate: computed(() => {
134
+ if (props.start.value && !isStartDateDisabled.value) return props.start.value;
135
+ if (props.end.value && !isEndDateDisabled.value) return props.end.value;
136
+ })
137
+ };
138
+ }
139
+ //#endregion
140
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarRoot.js
141
+ var _hoisted_1$1 = { style: {
142
+ "border": "0px",
143
+ "clip": "rect(0px, 0px, 0px, 0px)",
144
+ "clip-path": "inset(50%)",
145
+ "height": "1px",
146
+ "margin": "-1px",
147
+ "overflow": "hidden",
148
+ "padding": "0px",
149
+ "position": "absolute",
150
+ "white-space": "nowrap",
151
+ "width": "1px"
152
+ } };
153
+ var _hoisted_2$1 = {
154
+ role: "heading",
155
+ "aria-level": "2"
156
+ };
157
+ var [injectRangeCalendarRootContext, provideRangeCalendarRootContext] = /* @__PURE__ */ createContext("RangeCalendarRoot");
158
+ var RangeCalendarRoot_default = /* @__PURE__ */ defineComponent({
159
+ __name: "RangeCalendarRoot",
160
+ props: {
161
+ defaultPlaceholder: {
162
+ type: null,
163
+ required: false
164
+ },
165
+ defaultValue: {
166
+ type: Object,
167
+ required: false,
168
+ default: () => ({
169
+ start: void 0,
170
+ end: void 0
171
+ })
172
+ },
173
+ modelValue: {
174
+ type: [Object, null],
175
+ required: false
176
+ },
177
+ placeholder: {
178
+ type: null,
179
+ required: false,
180
+ default: void 0
181
+ },
182
+ allowNonContiguousRanges: {
183
+ type: Boolean,
184
+ required: false,
185
+ default: false
186
+ },
187
+ pagedNavigation: {
188
+ type: Boolean,
189
+ required: false,
190
+ default: false
191
+ },
192
+ preventDeselect: {
193
+ type: Boolean,
194
+ required: false,
195
+ default: false
196
+ },
197
+ maximumDays: {
198
+ type: Number,
199
+ required: false,
200
+ default: void 0
201
+ },
202
+ weekStartsOn: {
203
+ type: Number,
204
+ required: false
205
+ },
206
+ weekdayFormat: {
207
+ type: String,
208
+ required: false,
209
+ default: "narrow"
210
+ },
211
+ calendarLabel: {
212
+ type: String,
213
+ required: false
214
+ },
215
+ fixedWeeks: {
216
+ type: Boolean,
217
+ required: false,
218
+ default: false
219
+ },
220
+ maxValue: {
221
+ type: null,
222
+ required: false
223
+ },
224
+ minValue: {
225
+ type: null,
226
+ required: false
227
+ },
228
+ locale: {
229
+ type: String,
230
+ required: false
231
+ },
232
+ numberOfMonths: {
233
+ type: Number,
234
+ required: false,
235
+ default: 1
236
+ },
237
+ disabled: {
238
+ type: Boolean,
239
+ required: false,
240
+ default: false
241
+ },
242
+ readonly: {
243
+ type: Boolean,
244
+ required: false,
245
+ default: false
246
+ },
247
+ initialFocus: {
248
+ type: Boolean,
249
+ required: false,
250
+ default: false
251
+ },
252
+ isDateDisabled: {
253
+ type: Function,
254
+ required: false,
255
+ default: void 0
256
+ },
257
+ isDateUnavailable: {
258
+ type: Function,
259
+ required: false,
260
+ default: void 0
261
+ },
262
+ isDateHighlightable: {
263
+ type: Function,
264
+ required: false,
265
+ default: void 0
266
+ },
267
+ dir: {
268
+ type: String,
269
+ required: false
270
+ },
271
+ nextPage: {
272
+ type: Function,
273
+ required: false
274
+ },
275
+ prevPage: {
276
+ type: Function,
277
+ required: false
278
+ },
279
+ disableDaysOutsideCurrentView: {
280
+ type: Boolean,
281
+ required: false,
282
+ default: false
283
+ },
284
+ fixedDate: {
285
+ type: String,
286
+ required: false
287
+ },
288
+ asChild: {
289
+ type: Boolean,
290
+ required: false
291
+ },
292
+ as: {
293
+ type: null,
294
+ required: false,
295
+ default: "div"
296
+ }
297
+ },
298
+ emits: [
299
+ "update:modelValue",
300
+ "update:validModelValue",
301
+ "update:placeholder",
302
+ "update:startValue"
303
+ ],
304
+ setup(__props, { emit: __emit }) {
305
+ const props = __props;
306
+ const emits = __emit;
307
+ const { disabled, readonly, initialFocus, pagedNavigation, weekdayFormat, fixedWeeks, numberOfMonths, preventDeselect, isDateUnavailable: propsIsDateUnavailable, isDateHighlightable: propsIsDateHighlightable, isDateDisabled: propsIsDateDisabled, calendarLabel, maxValue, minValue, dir: propDir, locale: propLocale, nextPage: propsNextPage, prevPage: propsPrevPage, allowNonContiguousRanges, disableDaysOutsideCurrentView, fixedDate, maximumDays } = toRefs(props);
308
+ const { primitiveElement, currentElement: parentElement } = usePrimitiveElement();
309
+ const dir = useDirection(propDir);
310
+ const locale = useLocale(propLocale);
311
+ const weekStartsOn = computed(() => props.weekStartsOn ?? getWeekStartsOn(locale.value));
312
+ const lastPressedDateValue = ref();
313
+ const focusedValue = ref();
314
+ const isEditing = ref(false);
315
+ const modelValue = useVModel(props, "modelValue", emits, {
316
+ defaultValue: props.defaultValue ?? {
317
+ start: void 0,
318
+ end: void 0
319
+ },
320
+ passive: props.modelValue === void 0
321
+ });
322
+ const normalizeRange = (value) => value ?? {
323
+ start: void 0,
324
+ end: void 0
325
+ };
326
+ const normalizedModelValue = computed(() => normalizeRange(modelValue.value));
327
+ const validModelValue = ref(normalizeRange(modelValue.value));
328
+ watch(validModelValue, (value) => {
329
+ emits("update:validModelValue", value);
330
+ });
331
+ const defaultDate = getDefaultDate({
332
+ defaultPlaceholder: props.placeholder,
333
+ defaultValue: normalizeRange(modelValue.value).start,
334
+ locale: props.locale
335
+ });
336
+ const startValue = ref(normalizeRange(modelValue.value).start);
337
+ const endValue = ref(normalizeRange(modelValue.value).end);
338
+ const placeholder = useVModel(props, "placeholder", emits, {
339
+ defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
340
+ passive: props.placeholder === void 0
341
+ });
342
+ function onPlaceholderChange(value) {
343
+ placeholder.value = value.copy();
344
+ }
345
+ const { fullCalendarLabel, headingValue, isDateDisabled, isDateUnavailable, isNextButtonDisabled, isPrevButtonDisabled, grid, weekdays, isOutsideVisibleView, nextPage, prevPage, formatter, isPlaceholderFocusable, firstFocusableDate } = useCalendar({
346
+ locale,
347
+ placeholder,
348
+ weekStartsOn,
349
+ fixedWeeks,
350
+ numberOfMonths,
351
+ minValue,
352
+ maxValue,
353
+ disabled,
354
+ weekdayFormat,
355
+ pagedNavigation,
356
+ isDateDisabled: propsIsDateDisabled.value,
357
+ isDateUnavailable: propsIsDateUnavailable.value,
358
+ calendarLabel,
359
+ nextPage: propsNextPage,
360
+ prevPage: propsPrevPage
361
+ });
362
+ const { isInvalid, isSelected, isDateHighlightable, highlightedRange, isSelectionStart, isSelectionEnd, isHighlightedStart, isHighlightedEnd, isDateDisabled: rangeIsDateDisabled, hasSelectedDate, isSelectedDisabled, selectedFocusableDate } = useRangeCalendarState({
363
+ start: startValue,
364
+ end: endValue,
365
+ isDateDisabled,
366
+ isDateUnavailable,
367
+ isDateHighlightable: propsIsDateHighlightable.value,
368
+ focusedValue,
369
+ allowNonContiguousRanges,
370
+ fixedDate,
371
+ maximumDays
372
+ });
373
+ watch(modelValue, (_modelValue) => {
374
+ const next = normalizeRange(_modelValue);
375
+ if (!(!next.start && !startValue.value || !!next.start && !!startValue.value && $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(next.start, startValue.value))) startValue.value = next.start?.copy?.();
376
+ if (!(!next.end && !endValue.value || !!next.end && !!endValue.value && $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(next.end, endValue.value))) endValue.value = next.end?.copy?.();
377
+ });
378
+ watch(startValue, (_startValue) => {
379
+ if (_startValue && !$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(_startValue, placeholder.value)) onPlaceholderChange(_startValue);
380
+ emits("update:startValue", _startValue);
381
+ });
382
+ watch([startValue, endValue], ([_startValue, _endValue]) => {
383
+ const value = modelValue.value;
384
+ if (value && value.start && value.end && _startValue && _endValue && $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(value.start, _startValue) && $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(value.end, _endValue)) return;
385
+ isEditing.value = true;
386
+ if (_endValue && _startValue) {
387
+ const nextValue = isBefore(_endValue, _startValue) ? {
388
+ start: _endValue.copy(),
389
+ end: _startValue.copy()
390
+ } : {
391
+ start: _startValue.copy(),
392
+ end: _endValue.copy()
393
+ };
394
+ modelValue.value = {
395
+ start: nextValue.start,
396
+ end: nextValue.end
397
+ };
398
+ isEditing.value = false;
399
+ validModelValue.value = {
400
+ start: nextValue.start.copy(),
401
+ end: nextValue.end.copy()
402
+ };
403
+ } else modelValue.value = _startValue ? {
404
+ start: _startValue.copy(),
405
+ end: void 0
406
+ } : {
407
+ start: _endValue?.copy(),
408
+ end: void 0
409
+ };
410
+ });
411
+ const kbd = useKbd();
412
+ useEventListener(parentElement, "keydown", (ev) => {
413
+ if (ev.key === kbd.ESCAPE && isEditing.value) {
414
+ startValue.value = validModelValue.value.start?.copy();
415
+ endValue.value = validModelValue.value.end?.copy();
416
+ }
417
+ });
418
+ provideRangeCalendarRootContext({
419
+ isDateUnavailable,
420
+ isDateHighlightable,
421
+ startValue,
422
+ endValue,
423
+ formatter,
424
+ modelValue: normalizedModelValue,
425
+ placeholder,
426
+ disabled,
427
+ initialFocus,
428
+ pagedNavigation,
429
+ grid,
430
+ weekDays: weekdays,
431
+ weekStartsOn,
432
+ weekdayFormat,
433
+ fixedWeeks,
434
+ numberOfMonths,
435
+ readonly,
436
+ preventDeselect,
437
+ fullCalendarLabel,
438
+ headingValue,
439
+ isInvalid,
440
+ isDateDisabled: rangeIsDateDisabled,
441
+ allowNonContiguousRanges,
442
+ highlightedRange,
443
+ focusedValue,
444
+ lastPressedDateValue,
445
+ isSelected,
446
+ isSelectionEnd,
447
+ isSelectionStart,
448
+ isNextButtonDisabled,
449
+ isPrevButtonDisabled,
450
+ isOutsideVisibleView,
451
+ nextPage,
452
+ prevPage,
453
+ parentElement,
454
+ onPlaceholderChange,
455
+ locale,
456
+ dir,
457
+ isHighlightedStart,
458
+ isHighlightedEnd,
459
+ disableDaysOutsideCurrentView,
460
+ fixedDate,
461
+ maximumDays,
462
+ minValue,
463
+ maxValue,
464
+ isPlaceholderFocusable,
465
+ firstFocusableDate,
466
+ hasSelectedDate,
467
+ isSelectedDisabled,
468
+ selectedFocusableDate
469
+ });
470
+ onMounted(() => {
471
+ if (initialFocus.value) handleCalendarInitialFocus(parentElement.value);
472
+ });
473
+ return (_ctx, _cache) => {
474
+ return openBlock(), createBlock(unref(Primitive), {
475
+ ref_key: "primitiveElement",
476
+ ref: primitiveElement,
477
+ as: _ctx.as,
478
+ "as-child": _ctx.asChild,
479
+ "aria-label": unref(fullCalendarLabel),
480
+ "data-readonly": unref(readonly) ? "" : void 0,
481
+ "data-disabled": unref(disabled) ? "" : void 0,
482
+ "data-invalid": unref(isInvalid) ? "" : void 0,
483
+ dir: unref(dir)
484
+ }, {
485
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2$1, toDisplayString(unref(fullCalendarLabel)), 1)]), renderSlot(_ctx.$slots, "default", {
486
+ date: unref(placeholder),
487
+ grid: unref(grid),
488
+ weekDays: unref(weekdays),
489
+ weekStartsOn: weekStartsOn.value,
490
+ locale: unref(locale),
491
+ fixedWeeks: unref(fixedWeeks),
492
+ modelValue: normalizedModelValue.value
493
+ })]),
494
+ _: 3
495
+ }, 8, [
496
+ "as",
497
+ "as-child",
498
+ "aria-label",
499
+ "data-readonly",
500
+ "data-disabled",
501
+ "data-invalid",
502
+ "dir"
503
+ ]);
504
+ };
505
+ }
506
+ });
507
+ //#endregion
508
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarCell.js
509
+ var RangeCalendarCell_default = /* @__PURE__ */ defineComponent({
510
+ __name: "RangeCalendarCell",
511
+ props: {
512
+ date: {
513
+ type: null,
514
+ required: true
515
+ },
516
+ asChild: {
517
+ type: Boolean,
518
+ required: false
519
+ },
520
+ as: {
521
+ type: null,
522
+ required: false,
523
+ default: "td"
524
+ }
525
+ },
526
+ setup(__props) {
527
+ const rootContext = injectRangeCalendarRootContext();
528
+ return (_ctx, _cache) => {
529
+ return openBlock(), createBlock(unref(Primitive), {
530
+ as: _ctx.as,
531
+ "as-child": _ctx.asChild,
532
+ role: "gridcell",
533
+ "aria-selected": unref(rootContext).isSelected(_ctx.date) ? true : void 0,
534
+ "aria-disabled": unref(rootContext).isDateDisabled(_ctx.date) || unref(rootContext).isDateUnavailable?.(_ctx.date) || unref(rootContext).disableDaysOutsideCurrentView.value,
535
+ "data-disabled": unref(rootContext).isDateDisabled(_ctx.date) || unref(rootContext).disableDaysOutsideCurrentView.value ? "" : void 0
536
+ }, {
537
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
538
+ _: 3
539
+ }, 8, [
540
+ "as",
541
+ "as-child",
542
+ "aria-selected",
543
+ "aria-disabled",
544
+ "data-disabled"
545
+ ]);
546
+ };
547
+ }
548
+ });
549
+ //#endregion
550
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarCellTrigger.js
551
+ var RangeCalendarCellTrigger_default = /* @__PURE__ */ defineComponent({
552
+ __name: "RangeCalendarCellTrigger",
553
+ props: {
554
+ day: {
555
+ type: null,
556
+ required: true
557
+ },
558
+ month: {
559
+ type: null,
560
+ required: true
561
+ },
562
+ asChild: {
563
+ type: Boolean,
564
+ required: false
565
+ },
566
+ as: {
567
+ type: null,
568
+ required: false,
569
+ default: "div"
570
+ }
571
+ },
572
+ setup(__props) {
573
+ const props = __props;
574
+ const rootContext = injectRangeCalendarRootContext();
575
+ const kbd = useKbd();
576
+ const { primitiveElement, currentElement } = usePrimitiveElement();
577
+ const labelText = computed(() => rootContext.formatter.custom(toDate(props.day), {
578
+ weekday: "long",
579
+ month: "long",
580
+ day: "numeric",
581
+ year: "numeric"
582
+ }));
583
+ const isUnavailable = computed(() => rootContext.isDateUnavailable?.(props.day) ?? false);
584
+ const isSelectedDate = computed(() => rootContext.isSelected(props.day));
585
+ const isSelectionStart = computed(() => rootContext.isSelectionStart(props.day));
586
+ const isSelectionEnd = computed(() => rootContext.isSelectionEnd(props.day));
587
+ const isHighlightStart = computed(() => rootContext.isHighlightedStart(props.day));
588
+ const isHighlightEnd = computed(() => rootContext.isHighlightedEnd(props.day));
589
+ const isHighlighted = computed(() => rootContext.highlightedRange.value ? isBetweenInclusive(props.day, rootContext.highlightedRange.value.start, rootContext.highlightedRange.value.end) : false);
590
+ const allowNonContiguousRanges = computed(() => rootContext.allowNonContiguousRanges.value);
591
+ const isDateToday = computed(() => {
592
+ return $14e0f24ef4ac5c92$export$629b0a497aa65267(props.day, $14e0f24ef4ac5c92$export$aa8b41735afcabd2());
593
+ });
594
+ const isOutsideView = computed(() => {
595
+ return !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(props.day, props.month);
596
+ });
597
+ const isOutsideVisibleView = computed(() => rootContext.isOutsideVisibleView(props.day));
598
+ const isDisabled = computed(() => rootContext.isDateDisabled(props.day) || rootContext.disableDaysOutsideCurrentView.value && isOutsideView.value);
599
+ const dayValue = computed(() => props.day.day.toLocaleString(rootContext.locale.value));
600
+ const isFocusedDate = computed(() => {
601
+ if (isOutsideView.value || isDisabled.value) return false;
602
+ if (!rootContext.disabled.value && rootContext.isPlaceholderFocusable.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.day, rootContext.placeholder.value)) return true;
603
+ if (!rootContext.disabled.value && rootContext.selectedFocusableDate.value && !rootContext.isPlaceholderFocusable.value) return $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.day, rootContext.selectedFocusableDate.value);
604
+ if (!rootContext.disabled.value && (!rootContext.hasSelectedDate.value || rootContext.isSelectedDisabled.value) && !rootContext.isPlaceholderFocusable.value) return rootContext.firstFocusableDate.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(props.day, rootContext.firstFocusableDate.value);
605
+ return false;
606
+ });
607
+ function changeDate(e, date) {
608
+ if (rootContext.readonly.value) return;
609
+ if (rootContext.isDateDisabled(date) || rootContext.isDateUnavailable?.(date)) return;
610
+ if (rootContext.startValue.value && rootContext.highlightedRange.value === null) {
611
+ if ($14e0f24ef4ac5c92$export$ea39ec197993aef0(date, rootContext.startValue.value) && !rootContext.preventDeselect.value && !rootContext.endValue.value) {
612
+ rootContext.startValue.value = void 0;
613
+ rootContext.onPlaceholderChange(date);
614
+ rootContext.lastPressedDateValue.value = date.copy();
615
+ return;
616
+ } else if (!rootContext.endValue.value) {
617
+ e.preventDefault();
618
+ if (rootContext.lastPressedDateValue.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(rootContext.lastPressedDateValue.value, date)) rootContext.startValue.value = date.copy();
619
+ rootContext.lastPressedDateValue.value = date.copy();
620
+ return;
621
+ }
622
+ }
623
+ rootContext.lastPressedDateValue.value = date.copy();
624
+ if (rootContext.startValue.value && rootContext.endValue.value && $14e0f24ef4ac5c92$export$ea39ec197993aef0(rootContext.startValue.value, rootContext.endValue.value) && $14e0f24ef4ac5c92$export$ea39ec197993aef0(rootContext.startValue.value, date) && !rootContext.preventDeselect.value) {
625
+ rootContext.startValue.value = void 0;
626
+ rootContext.endValue.value = void 0;
627
+ rootContext.onPlaceholderChange(date);
628
+ return;
629
+ }
630
+ if (!rootContext.startValue.value) rootContext.startValue.value = date.copy();
631
+ else if (!rootContext.endValue.value) rootContext.endValue.value = date.copy();
632
+ else if (rootContext.endValue.value && rootContext.startValue.value) {
633
+ if (!rootContext.fixedDate.value) {
634
+ rootContext.endValue.value = void 0;
635
+ rootContext.startValue.value = date.copy();
636
+ } else if (rootContext.fixedDate.value === "start") if (date.compare(rootContext.startValue.value) < 0) rootContext.startValue.value = date.copy();
637
+ else rootContext.endValue.value = date.copy();
638
+ else if (rootContext.fixedDate.value === "end") if (date.compare(rootContext.endValue.value) > 0) rootContext.endValue.value = date.copy();
639
+ else rootContext.startValue.value = date.copy();
640
+ }
641
+ }
642
+ function handleClick(e) {
643
+ if (isDisabled.value) return;
644
+ changeDate(e, props.day);
645
+ }
646
+ function handleFocus() {
647
+ if (isDisabled.value || rootContext.isDateUnavailable?.(props.day)) return;
648
+ rootContext.focusedValue.value = props.day.copy();
649
+ }
650
+ function handleArrowKey(e) {
651
+ if (isDisabled.value) return;
652
+ if ((e.code === kbd.ENTER || e.code === kbd.SPACE_CODE) && (e.ctrlKey || e.metaKey || e.altKey)) return;
653
+ e.preventDefault();
654
+ e.stopPropagation();
655
+ const parentElement = rootContext.parentElement.value;
656
+ const indexIncrementation = 7;
657
+ const sign = rootContext.dir.value === "rtl" ? -1 : 1;
658
+ switch (e.code) {
659
+ case kbd.ARROW_RIGHT:
660
+ shiftFocus(props.day, sign);
661
+ break;
662
+ case kbd.ARROW_LEFT:
663
+ shiftFocus(props.day, -sign);
664
+ break;
665
+ case kbd.ARROW_UP:
666
+ shiftFocus(props.day, -indexIncrementation);
667
+ break;
668
+ case kbd.ARROW_DOWN:
669
+ shiftFocus(props.day, indexIncrementation);
670
+ break;
671
+ case kbd.ENTER:
672
+ case kbd.SPACE_CODE: changeDate(e, props.day);
673
+ }
674
+ function shiftFocus(day, add) {
675
+ const candidateDayValue = day.add({ days: add });
676
+ if (rootContext.minValue.value && candidateDayValue.compare(rootContext.minValue.value) < 0 || rootContext.maxValue.value && candidateDayValue.compare(rootContext.maxValue.value) > 0) return;
677
+ const candidateDay = parentElement.querySelector(`[data-value='${candidateDayValue.toString()}']:not([data-outside-view])`);
678
+ if (!candidateDay) {
679
+ if (add > 0) {
680
+ if (rootContext.isNextButtonDisabled()) return;
681
+ rootContext.nextPage();
682
+ } else {
683
+ if (rootContext.isPrevButtonDisabled()) return;
684
+ rootContext.prevPage();
685
+ }
686
+ nextTick(() => {
687
+ shiftFocus(day, add);
688
+ });
689
+ return;
690
+ }
691
+ if (candidateDay && candidateDay.hasAttribute("data-disabled")) return shiftFocus(candidateDayValue, add);
692
+ rootContext.onPlaceholderChange(candidateDayValue);
693
+ candidateDay?.focus();
694
+ }
695
+ }
696
+ return (_ctx, _cache) => {
697
+ return openBlock(), createBlock(unref(Primitive), {
698
+ ref_key: "primitiveElement",
699
+ ref: primitiveElement,
700
+ as: _ctx.as,
701
+ "as-child": _ctx.asChild,
702
+ role: "button",
703
+ "aria-label": labelText.value,
704
+ "data-reka-calendar-cell-trigger": "",
705
+ "aria-pressed": isSelectedDate.value && (allowNonContiguousRanges.value || !isUnavailable.value) ? true : void 0,
706
+ "aria-disabled": isDisabled.value || isUnavailable.value ? true : void 0,
707
+ "data-highlighted": isHighlighted.value && (allowNonContiguousRanges.value || !isUnavailable.value) ? "" : void 0,
708
+ "data-selection-start": isSelectionStart.value ? true : void 0,
709
+ "data-selection-end": isSelectionEnd.value ? true : void 0,
710
+ "data-highlighted-start": isHighlightStart.value ? true : void 0,
711
+ "data-highlighted-end": isHighlightEnd.value ? true : void 0,
712
+ "data-selected": isSelectedDate.value && (allowNonContiguousRanges.value || !isUnavailable.value) ? true : void 0,
713
+ "data-outside-visible-view": isOutsideVisibleView.value ? "" : void 0,
714
+ "data-value": _ctx.day.toString(),
715
+ "data-disabled": isDisabled.value ? "" : void 0,
716
+ "data-unavailable": isUnavailable.value ? "" : void 0,
717
+ "data-today": isDateToday.value ? "" : void 0,
718
+ "data-outside-view": isOutsideView.value ? "" : void 0,
719
+ "data-focused": isFocusedDate.value ? "" : void 0,
720
+ tabindex: isFocusedDate.value ? 0 : isOutsideView.value || isDisabled.value ? void 0 : -1,
721
+ onClick: handleClick,
722
+ onFocusin: handleFocus,
723
+ onMouseenter: handleFocus,
724
+ onKeydown: withKeys(handleArrowKey, [
725
+ "up",
726
+ "down",
727
+ "left",
728
+ "right",
729
+ "enter",
730
+ "space"
731
+ ])
732
+ }, {
733
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
734
+ dayValue: dayValue.value,
735
+ disabled: isDisabled.value,
736
+ today: isDateToday.value,
737
+ selected: isSelectedDate.value,
738
+ outsideView: isOutsideView.value,
739
+ outsideVisibleView: isOutsideVisibleView.value,
740
+ unavailable: isUnavailable.value,
741
+ highlighted: isHighlighted.value && (allowNonContiguousRanges.value || !isUnavailable.value),
742
+ highlightedStart: isHighlightStart.value,
743
+ highlightedEnd: isHighlightEnd.value,
744
+ selectionStart: isSelectionStart.value,
745
+ selectionEnd: isSelectionEnd.value
746
+ }, () => [createTextVNode(toDisplayString(dayValue.value), 1)])]),
747
+ _: 3
748
+ }, 8, [
749
+ "as",
750
+ "as-child",
751
+ "aria-label",
752
+ "aria-pressed",
753
+ "aria-disabled",
754
+ "data-highlighted",
755
+ "data-selection-start",
756
+ "data-selection-end",
757
+ "data-highlighted-start",
758
+ "data-highlighted-end",
759
+ "data-selected",
760
+ "data-outside-visible-view",
761
+ "data-value",
762
+ "data-disabled",
763
+ "data-unavailable",
764
+ "data-today",
765
+ "data-outside-view",
766
+ "data-focused",
767
+ "tabindex"
768
+ ]);
769
+ };
770
+ }
771
+ });
772
+ //#endregion
773
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarGrid.js
774
+ var RangeCalendarGrid_default = /* @__PURE__ */ defineComponent({
775
+ __name: "RangeCalendarGrid",
776
+ props: {
777
+ asChild: {
778
+ type: Boolean,
779
+ required: false
780
+ },
781
+ as: {
782
+ type: null,
783
+ required: false,
784
+ default: "table"
785
+ }
786
+ },
787
+ setup(__props) {
788
+ const props = __props;
789
+ const rootContext = injectRangeCalendarRootContext();
790
+ const disabled = computed(() => rootContext.disabled.value ? true : void 0);
791
+ const readonly = computed(() => rootContext.readonly.value ? true : void 0);
792
+ return (_ctx, _cache) => {
793
+ return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
794
+ tabindex: "-1",
795
+ role: "application",
796
+ "aria-readonly": readonly.value,
797
+ "aria-disabled": disabled.value,
798
+ "data-readonly": readonly.value && "",
799
+ "data-disabled": disabled.value && "",
800
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => unref(rootContext).focusedValue.value = void 0)
801
+ }), {
802
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
803
+ _: 3
804
+ }, 16, [
805
+ "aria-readonly",
806
+ "aria-disabled",
807
+ "data-readonly",
808
+ "data-disabled"
809
+ ]);
810
+ };
811
+ }
812
+ });
813
+ //#endregion
814
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarGridBody.js
815
+ var RangeCalendarGridBody_default = /* @__PURE__ */ defineComponent({
816
+ __name: "RangeCalendarGridBody",
817
+ props: {
818
+ asChild: {
819
+ type: Boolean,
820
+ required: false
821
+ },
822
+ as: {
823
+ type: null,
824
+ required: false,
825
+ default: "tbody"
826
+ }
827
+ },
828
+ setup(__props) {
829
+ const props = __props;
830
+ return (_ctx, _cache) => {
831
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
832
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
833
+ _: 3
834
+ }, 16);
835
+ };
836
+ }
837
+ });
838
+ //#endregion
839
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarGridHead.js
840
+ var RangeCalendarGridHead_default = /* @__PURE__ */ defineComponent({
841
+ __name: "RangeCalendarGridHead",
842
+ props: {
843
+ asChild: {
844
+ type: Boolean,
845
+ required: false
846
+ },
847
+ as: {
848
+ type: null,
849
+ required: false,
850
+ default: "thead"
851
+ }
852
+ },
853
+ setup(__props) {
854
+ const props = __props;
855
+ return (_ctx, _cache) => {
856
+ return openBlock(), createBlock(unref(Primitive), mergeProps(props, { "aria-hidden": "true" }), {
857
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
858
+ _: 3
859
+ }, 16);
860
+ };
861
+ }
862
+ });
863
+ //#endregion
864
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarGridRow.js
865
+ var RangeCalendarGridRow_default = /* @__PURE__ */ defineComponent({
866
+ __name: "RangeCalendarGridRow",
867
+ props: {
868
+ asChild: {
869
+ type: Boolean,
870
+ required: false
871
+ },
872
+ as: {
873
+ type: null,
874
+ required: false,
875
+ default: "tr"
876
+ }
877
+ },
878
+ setup(__props) {
879
+ const props = __props;
880
+ return (_ctx, _cache) => {
881
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
882
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
883
+ _: 3
884
+ }, 16);
885
+ };
886
+ }
887
+ });
888
+ //#endregion
889
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarHeadCell.js
890
+ var RangeCalendarHeadCell_default = /* @__PURE__ */ defineComponent({
891
+ __name: "RangeCalendarHeadCell",
892
+ props: {
893
+ asChild: {
894
+ type: Boolean,
895
+ required: false
896
+ },
897
+ as: {
898
+ type: null,
899
+ required: false,
900
+ default: "th"
901
+ }
902
+ },
903
+ setup(__props) {
904
+ const props = __props;
905
+ return (_ctx, _cache) => {
906
+ return openBlock(), createBlock(unref(Primitive), normalizeProps(guardReactiveProps(props)), {
907
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
908
+ _: 3
909
+ }, 16);
910
+ };
911
+ }
912
+ });
913
+ //#endregion
914
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarNext.js
915
+ var RangeCalendarNext_default = /* @__PURE__ */ defineComponent({
916
+ __name: "RangeCalendarNext",
917
+ props: {
918
+ nextPage: {
919
+ type: Function,
920
+ required: false
921
+ },
922
+ asChild: {
923
+ type: Boolean,
924
+ required: false
925
+ },
926
+ as: {
927
+ type: null,
928
+ required: false,
929
+ default: "button"
930
+ }
931
+ },
932
+ setup(__props) {
933
+ const props = __props;
934
+ const disabled = computed(() => rootContext.disabled.value || rootContext.isNextButtonDisabled(props.nextPage));
935
+ const rootContext = injectRangeCalendarRootContext();
936
+ function handleClick() {
937
+ if (disabled.value) return;
938
+ rootContext.nextPage(props.nextPage);
939
+ }
940
+ return (_ctx, _cache) => {
941
+ return openBlock(), createBlock(unref(Primitive), {
942
+ as: props.as,
943
+ "as-child": props.asChild,
944
+ "aria-label": "Next page",
945
+ type: props.as === "button" ? "button" : void 0,
946
+ "aria-disabled": disabled.value || void 0,
947
+ "data-disabled": disabled.value || void 0,
948
+ disabled: disabled.value,
949
+ onClick: handleClick
950
+ }, {
951
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { disabled: disabled.value }, () => [_cache[0] || (_cache[0] = createTextVNode(" Next page "))])]),
952
+ _: 3
953
+ }, 8, [
954
+ "as",
955
+ "as-child",
956
+ "type",
957
+ "aria-disabled",
958
+ "data-disabled",
959
+ "disabled"
960
+ ]);
961
+ };
962
+ }
963
+ });
964
+ //#endregion
965
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.13_typescript@6.0.3_/node_modules/reka-ui/dist/RangeCalendar/RangeCalendarPrev.js
966
+ var RangeCalendarPrev_default = /* @__PURE__ */ defineComponent({
967
+ __name: "RangeCalendarPrev",
968
+ props: {
969
+ prevPage: {
970
+ type: Function,
971
+ required: false
972
+ },
973
+ asChild: {
974
+ type: Boolean,
975
+ required: false
976
+ },
977
+ as: {
978
+ type: null,
979
+ required: false,
980
+ default: "button"
981
+ }
982
+ },
983
+ setup(__props) {
984
+ const props = __props;
985
+ const disabled = computed(() => rootContext.disabled.value || rootContext.isPrevButtonDisabled(props.prevPage));
986
+ const rootContext = injectRangeCalendarRootContext();
987
+ function handleClick() {
988
+ if (disabled.value) return;
989
+ rootContext.prevPage(props.prevPage);
990
+ }
991
+ return (_ctx, _cache) => {
992
+ return openBlock(), createBlock(unref(Primitive), {
993
+ as: props.as,
994
+ "as-child": props.asChild,
995
+ "aria-label": "Previous page",
996
+ type: props.as === "button" ? "button" : void 0,
997
+ "aria-disabled": disabled.value || void 0,
998
+ "data-disabled": disabled.value || void 0,
999
+ disabled: disabled.value,
1000
+ onClick: handleClick
1001
+ }, {
1002
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", { disabled: disabled.value }, () => [_cache[0] || (_cache[0] = createTextVNode(" Prev page "))])]),
1003
+ _: 3
1004
+ }, 8, [
1005
+ "as",
1006
+ "as-child",
1007
+ "type",
1008
+ "aria-disabled",
1009
+ "data-disabled",
1010
+ "disabled"
1011
+ ]);
1012
+ };
1013
+ }
1014
+ });
1015
+ //#endregion
1016
+ //#region src/components/range-calendar/range-calendar.vue?vue&type=script&setup=true&lang.ts
1017
+ var _hoisted_1 = { class: "celeste-range-calendar-months" };
1018
+ var _hoisted_2 = { class: "celeste-range-calendar-header" };
1019
+ var _hoisted_3 = { class: "celeste-range-calendar-heading" };
1020
+ var _hoisted_4 = { class: "celeste-range-calendar-day-number" };
1021
+ //#endregion
1022
+ //#region src/components/range-calendar/range-calendar.vue
1023
+ var range_calendar_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
1024
+ __name: "range-calendar",
1025
+ props: {
1026
+ class: {},
1027
+ markedDates: {},
1028
+ defaultPlaceholder: {},
1029
+ defaultValue: {},
1030
+ modelValue: {},
1031
+ placeholder: {},
1032
+ allowNonContiguousRanges: { type: Boolean },
1033
+ pagedNavigation: { type: Boolean },
1034
+ preventDeselect: { type: Boolean },
1035
+ maximumDays: {},
1036
+ weekStartsOn: { default: 1 },
1037
+ weekdayFormat: { default: "short" },
1038
+ calendarLabel: {},
1039
+ fixedWeeks: {
1040
+ type: Boolean,
1041
+ default: true
1042
+ },
1043
+ maxValue: {},
1044
+ minValue: {},
1045
+ locale: {},
1046
+ numberOfMonths: { default: 2 },
1047
+ disabled: { type: Boolean },
1048
+ readonly: { type: Boolean },
1049
+ initialFocus: { type: Boolean },
1050
+ isDateDisabled: {},
1051
+ isDateUnavailable: {},
1052
+ isDateHighlightable: {},
1053
+ dir: {},
1054
+ nextPage: {},
1055
+ prevPage: {},
1056
+ disableDaysOutsideCurrentView: { type: Boolean },
1057
+ fixedDate: {},
1058
+ asChild: { type: Boolean },
1059
+ as: {}
1060
+ },
1061
+ emits: [
1062
+ "update:modelValue",
1063
+ "update:validModelValue",
1064
+ "update:placeholder",
1065
+ "update:startValue"
1066
+ ],
1067
+ setup(__props, { emit: __emit }) {
1068
+ const props = __props;
1069
+ const emits = __emit;
1070
+ const forwarded = useForwardPropsEmits(useDelegatedProps(props, ["class", "markedDates"]), emits);
1071
+ const monthFormatter = computed(() => new $fb18d541ea1ad717$export$ad991b66133851cf(props.locale ?? "en-US", {
1072
+ month: "long",
1073
+ year: "numeric"
1074
+ }));
1075
+ function formatMonth(date) {
1076
+ return monthFormatter.value.format(date.toDate($14e0f24ef4ac5c92$export$aa8b41735afcabd2()));
1077
+ }
1078
+ function isMarked(date) {
1079
+ return props.markedDates?.some((marked) => $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(marked, date)) ?? false;
1080
+ }
1081
+ function weekdayLabel(day) {
1082
+ return /^[a-z]/i.test(day.trim()) ? day.slice(0, 2) : day;
1083
+ }
1084
+ return (_ctx, _cache) => {
1085
+ return openBlock(), createBlock(unref(RangeCalendarRoot_default), mergeProps(unref(forwarded), { class: unref(clsx)("celeste-range-calendar", props.class) }), {
1086
+ default: withCtx(({ weekDays, grid }) => [createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(grid, (month) => {
1087
+ return openBlock(), createElementBlock("div", {
1088
+ key: month.value.toString(),
1089
+ class: "celeste-range-calendar-month"
1090
+ }, [createElementVNode("div", _hoisted_2, [
1091
+ createVNode(unref(RangeCalendarPrev_default), { "as-child": "" }, {
1092
+ default: withCtx(() => _cache[0] || (_cache[0] = [createElementVNode("button", {
1093
+ type: "button",
1094
+ class: "celeste-range-calendar-nav"
1095
+ }, [createElementVNode("i", { class: "i-celeste-arrow-left-s-line" })], -1)])),
1096
+ _: 1
1097
+ }),
1098
+ createElementVNode("span", _hoisted_3, toDisplayString(formatMonth(month.value)), 1),
1099
+ createVNode(unref(RangeCalendarNext_default), { "as-child": "" }, {
1100
+ default: withCtx(() => _cache[1] || (_cache[1] = [createElementVNode("button", {
1101
+ type: "button",
1102
+ class: "celeste-range-calendar-nav"
1103
+ }, [createElementVNode("i", { class: "i-celeste-arrow-right-s-line" })], -1)])),
1104
+ _: 1
1105
+ })
1106
+ ]), createVNode(unref(RangeCalendarGrid_default), { class: "celeste-range-calendar-grid" }, {
1107
+ default: withCtx(() => [createVNode(unref(RangeCalendarGridHead_default), null, {
1108
+ default: withCtx(() => [createVNode(unref(RangeCalendarGridRow_default), { class: "celeste-range-calendar-week" }, {
1109
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays, (day) => {
1110
+ return openBlock(), createBlock(unref(RangeCalendarHeadCell_default), {
1111
+ key: day,
1112
+ class: "celeste-range-calendar-weekday"
1113
+ }, {
1114
+ default: withCtx(() => [createTextVNode(toDisplayString(weekdayLabel(day)), 1)]),
1115
+ _: 2
1116
+ }, 1024);
1117
+ }), 128))]),
1118
+ _: 2
1119
+ }, 1024)]),
1120
+ _: 2
1121
+ }, 1024), createVNode(unref(RangeCalendarGridBody_default), { class: "celeste-range-calendar-body" }, {
1122
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(month.rows, (weekDates, index) => {
1123
+ return openBlock(), createBlock(unref(RangeCalendarGridRow_default), {
1124
+ key: `week-${index}`,
1125
+ class: "celeste-range-calendar-week"
1126
+ }, {
1127
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDates, (weekDate) => {
1128
+ return openBlock(), createBlock(unref(RangeCalendarCell_default), {
1129
+ key: weekDate.toString(),
1130
+ date: weekDate,
1131
+ class: "celeste-range-calendar-cell"
1132
+ }, {
1133
+ default: withCtx(() => [createVNode(unref(RangeCalendarCellTrigger_default), {
1134
+ day: weekDate,
1135
+ month: month.value,
1136
+ class: "celeste-range-calendar-day",
1137
+ "data-marked": isMarked(weekDate) ? "" : void 0
1138
+ }, {
1139
+ default: withCtx(() => [createElementVNode("span", _hoisted_4, toDisplayString(weekDate.day), 1)]),
1140
+ _: 2
1141
+ }, 1032, [
1142
+ "day",
1143
+ "month",
1144
+ "data-marked"
1145
+ ])]),
1146
+ _: 2
1147
+ }, 1032, ["date"]);
1148
+ }), 128))]),
1149
+ _: 2
1150
+ }, 1024);
1151
+ }), 128))]),
1152
+ _: 2
1153
+ }, 1024)]),
1154
+ _: 2
1155
+ }, 1024)]);
1156
+ }), 128))])]),
1157
+ _: 1
1158
+ }, 16, ["class"]);
1159
+ };
1160
+ }
1161
+ }), [["__scopeId", "data-v-dc79fc39"]]);
1162
+ //#endregion
1163
+ export { range_calendar_default as t };