@bagelink/vue 1.4.174 → 1.4.176
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/dist/components/calendar/views/WeekView.vue.d.ts +1 -0
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -1
- package/dist/index.cjs +20 -20
- package/dist/index.mjs +20 -20
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/calendar/views/WeekView.vue +13 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { SetupContext, ComponentPublicInstance } from 'vue'
|
|
3
3
|
import type { CalendarEvent, WeekStart } from '../CalendarTypes'
|
|
4
4
|
import { formatDate } from '@bagelink/vue'
|
|
5
|
-
import { ref, computed, onMounted, onUnmounted, useSlots } from 'vue'
|
|
5
|
+
import { ref, computed, onMounted, onUnmounted, useSlots, nextTick } from 'vue'
|
|
6
6
|
|
|
7
7
|
interface WeekViewEvent extends CalendarEvent {
|
|
8
8
|
top: number
|
|
@@ -61,6 +61,7 @@ const timeSlotsContainer = ref<HTMLElement>()
|
|
|
61
61
|
const calendarGrid = ref<HTMLElement>()
|
|
62
62
|
const dayColumns = ref<HTMLElement[]>([])
|
|
63
63
|
const dayColumnsContainer = ref<HTMLElement>()
|
|
64
|
+
const scrollableContainer = ref<HTMLElement>()
|
|
64
65
|
|
|
65
66
|
// Calculate week days based on start date and week start preference
|
|
66
67
|
const weekDays = computed(() => {
|
|
@@ -401,10 +402,19 @@ function setDayColumnRef(el: Element | ComponentPublicInstance | null | undefine
|
|
|
401
402
|
}
|
|
402
403
|
}
|
|
403
404
|
|
|
405
|
+
function scrollToTime(time: number) {
|
|
406
|
+
if (scrollableContainer.value) {
|
|
407
|
+
scrollableContainer.value.scrollTop = time * slotHeight
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
404
411
|
// Lifecycle hooks
|
|
405
412
|
onMounted(() => {
|
|
406
413
|
updateCurrentTimeIndicator()
|
|
407
414
|
currentTimeInterval.value = setInterval(updateCurrentTimeIndicator, 60000)
|
|
415
|
+
|
|
416
|
+
// Scroll to 6:00 AM on mount
|
|
417
|
+
nextTick(() => { scrollToTime(6) })
|
|
408
418
|
})
|
|
409
419
|
|
|
410
420
|
onUnmounted(() => {
|
|
@@ -433,7 +443,7 @@ onUnmounted(() => {
|
|
|
433
443
|
</span>
|
|
434
444
|
</div>
|
|
435
445
|
</div>
|
|
436
|
-
<div class="overflow h-100p pe-05">
|
|
446
|
+
<div ref="scrollableContainer" class="overflow h-100p pe-05">
|
|
437
447
|
<div ref="dayColumnsContainer" class="weekGrid border-end relative">
|
|
438
448
|
<div ref="timeSlotsContainer">
|
|
439
449
|
<div
|
|
@@ -576,6 +586,7 @@ onUnmounted(() => {
|
|
|
576
586
|
flex-direction: column;
|
|
577
587
|
justify-content: center; */
|
|
578
588
|
}
|
|
589
|
+
|
|
579
590
|
@media (max-width: 910px) {
|
|
580
591
|
.weekGrid {
|
|
581
592
|
display: grid;
|