feat: establish shared calendar range selection foundation

This commit is contained in:
maoyingjie
2026-10-25 10:22:22 +08:00
parent 5c4375a98a
commit cfc97fdc07
27 changed files with 2475 additions and 401 deletions
@@ -191,7 +191,7 @@ export const CalendarYearPickerGrid = defineComponent({
}).format(date.toDate("UTC"));
function measure() {
const grid = ctx.root.value?.querySelector<HTMLElement>(
'[data-slot="calendar-grid"]',
`[data-slot="${ctx.prefix}-grid"]`,
);
if (grid) {
top.value = grid.offsetTop;
@@ -206,7 +206,9 @@ export const CalendarYearPickerGrid = defineComponent({
cell?.scrollIntoView?.({ block: "nearest" });
}
const rootGrid = computed(() =>
ctx.root.value?.querySelector<HTMLElement>('[data-slot="calendar-grid"]'),
ctx.root.value?.querySelector<HTMLElement>(
`[data-slot="${ctx.prefix}-grid"]`,
),
);
useResizeObserver(rootGrid, measure);
onMounted(measure);