@besaitech/ng-design-system 0.0.78 → 0.0.79

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.
@@ -1 +1 @@
1
- {"version":3,"file":"besaitech-ng-design-system-calendar.mjs","sources":["../../../projects/saitech-design-system/calendar/calendar-layout.ts","../../../projects/saitech-design-system/calendar/sds-event-calendar.ts","../../../projects/saitech-design-system/calendar/public-api.ts","../../../projects/saitech-design-system/calendar/besaitech-ng-design-system-calendar.ts"],"sourcesContent":["import { addDays, startOfDay } from '@besaitech/ng-design-system';\n\n/** Which span of time the calendar is showing. */\nexport type SdsEventCalendarView = 'month' | 'week' | '3day' | 'day';\n\n/**\n * How an event is tinted. These map onto the library's existing accent roles, so an event picks a\n * meaning-free hue — it is NOT a severity and NOT a status. Anything clinical that needs to say\n * \"how bad\" belongs in `sds-severity`, which has its own measured ramp.\n */\nexport type SdsEventColor = 'brand' | 'blue' | 'green' | 'amber' | 'red' | 'indigo' | 'neutral';\n\n/**\n * One thing on the calendar.\n *\n * <p>`start`/`end` are Dates or anything `new Date(...)` parses. Everything is computed in the\n * BROWSER's timezone: a calendar shows a person their own day, and converting on the way in is the\n * caller's job if their data says otherwise.\n */\nexport interface SdsCalendarEvent<T = unknown> {\n id: string;\n title: string;\n start: Date | string | number;\n /** Defaults to `start` + `defaultMinutes` when absent — a zero-length block is unclickable. */\n end?: Date | string | number;\n /** Second line, shown where there is room: a room, a reason, a phone number. */\n subtitle?: string;\n allDay?: boolean;\n color?: SdsEventColor;\n /** Struck through and faded — a cancelled appointment is still part of the day's record. */\n cancelled?: boolean;\n /** Whatever the caller wants back on click. The component never reads it. */\n meta?: T;\n}\n\n/** An event resolved to real Dates, with its place in the grid worked out. */\nexport interface PlacedEvent<T = unknown> {\n event: SdsCalendarEvent<T>;\n start: Date;\n end: Date;\n /** 0..1 of the visible day height. */\n top: number;\n height: number;\n /** 0..1 across the column: side-by-side layout for events sharing a time. */\n left: number;\n width: number;\n}\n\nconst MS_PER_MINUTE = 60_000;\n\nexport function toDate(value: Date | string | number): Date {\n return value instanceof Date ? new Date(value.getTime()) : new Date(value);\n}\n\n/** Minutes since local midnight. Read off the clock, never from an epoch difference — see below. */\nexport function minutesOfDay(d: Date): number {\n return d.getHours() * 60 + d.getMinutes();\n}\n\nexport function startOfWeek(d: Date, firstDayOfWeek: number): Date {\n const day = startOfDay(d);\n const shift = (day.getDay() - firstDayOfWeek + 7) % 7;\n return addDays(day, -shift);\n}\n\n/**\n * The days a view shows.\n *\n * <p>`month` is always a 6×7 block, never 4–6 ragged rows: a grid that changes height as you page\n * through the year makes everything below it jump.\n */\nexport function visibleDays(\n view: SdsEventCalendarView,\n date: Date,\n firstDayOfWeek: number,\n): Date[] {\n if (view === 'day') {\n return [startOfDay(date)];\n }\n if (view === '3day') {\n const from = startOfDay(date);\n return [0, 1, 2].map((i) => addDays(from, i));\n }\n if (view === 'week') {\n const from = startOfWeek(date, firstDayOfWeek);\n return Array.from({ length: 7 }, (_, i) => addDays(from, i));\n }\n const first = new Date(date.getFullYear(), date.getMonth(), 1);\n const from = startOfWeek(first, firstDayOfWeek);\n return Array.from({ length: 42 }, (_, i) => addDays(from, i));\n}\n\n/** The half-open range a view covers — what a host should fetch for. */\nexport function visibleRange(\n view: SdsEventCalendarView,\n date: Date,\n firstDayOfWeek: number,\n): { start: Date; end: Date } {\n const days = visibleDays(view, date, firstDayOfWeek);\n return { start: days[0], end: addDays(days[days.length - 1], 1) };\n}\n\n/** Paging: one month, one week, three days or one day at a time, in the view's own unit. */\nexport function step(view: SdsEventCalendarView, date: Date, direction: 1 | -1): Date {\n switch (view) {\n case 'month': {\n const d = new Date(date.getFullYear(), date.getMonth() + direction, 1);\n return d;\n }\n case 'week':\n return addDays(date, 7 * direction);\n case '3day':\n return addDays(date, 3 * direction);\n default:\n return addDays(date, direction);\n }\n}\n\n/** Whether an event touches a given day at all. Half-open: an event ending at 00:00 is not there. */\nexport function occursOn(start: Date, end: Date, day: Date): boolean {\n const from = startOfDay(day).getTime();\n const to = addDays(startOfDay(day), 1).getTime();\n return start.getTime() < to && end.getTime() > from;\n}\n\n/**\n * Place one day's timed events in the grid, side by side where they overlap.\n *\n * <p>The classic column packing: events are clustered into runs that transitively overlap, each\n * takes the leftmost column that is free at its time, and the whole cluster is then divided by the\n * widest point. So two appointments at 09:00 each take half the width and a third takes a third —\n * and a 14:00 appointment with nothing beside it is full width, because it is in its own cluster.\n *\n * <p><b>Vertical position is read off the clock, not from an epoch difference.</b> On the two days a\n * year when the clocks move, a 09:00–10:00 appointment is still drawn at 09:00 and one hour tall;\n * computing it from elapsed milliseconds would slide every event after the change by an hour.\n *\n * <p>Events are clipped to the visible window rather than dropped: a night shift starting at 06:00\n * on a grid that opens at 08:00 should still show, flush to the top, not vanish.\n */\nexport function placeDay<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n startHour: number,\n endHour: number,\n defaultMinutes: number,\n): PlacedEvent<T>[] {\n const windowStart = startHour * 60;\n const windowEnd = endHour * 60;\n const span = Math.max(1, windowEnd - windowStart);\n const dayStart = startOfDay(day);\n const nextDay = addDays(dayStart, 1);\n\n const resolved = events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => !e.event.allDay && occursOn(e.start, e.end, day))\n .map((e) => {\n // Clip to this day first, so a block running past midnight is drawn on both days correctly.\n const from = e.start < dayStart ? dayStart : e.start;\n const to = e.end > nextDay ? nextDay : e.end;\n const fromMin = from.getTime() === dayStart.getTime() ? 0 : minutesOfDay(from);\n const toMin = to.getTime() === nextDay.getTime() ? 24 * 60 : minutesOfDay(to);\n return { ...e, fromMin, toMin: Math.max(toMin, fromMin + 1) };\n })\n .filter((e) => e.toMin > windowStart && e.fromMin < windowEnd)\n .sort((a, b) => a.fromMin - b.fromMin || b.toMin - a.toMin);\n\n // Cluster transitively overlapping events; each cluster is divided independently.\n const placed: PlacedEvent<T>[] = [];\n let cluster: typeof resolved = [];\n let clusterEnd = -1;\n\n const flush = () => {\n if (!cluster.length) return;\n const columnEnds: number[] = [];\n const columnOf = new Map<(typeof cluster)[number], number>();\n for (const item of cluster) {\n let column = columnEnds.findIndex((endMin) => endMin <= item.fromMin);\n if (column === -1) {\n column = columnEnds.length;\n }\n columnEnds[column] = item.toMin;\n columnOf.set(item, column);\n }\n const columns = columnEnds.length;\n for (const item of cluster) {\n const top = (Math.max(item.fromMin, windowStart) - windowStart) / span;\n const bottom = (Math.min(item.toMin, windowEnd) - windowStart) / span;\n const column = columnOf.get(item) ?? 0;\n placed.push({\n event: item.event,\n start: item.start,\n end: item.end,\n top,\n height: Math.max(bottom - top, 0.012),\n left: column / columns,\n width: 1 / columns,\n });\n }\n cluster = [];\n clusterEnd = -1;\n };\n\n for (const item of resolved) {\n if (cluster.length && item.fromMin >= clusterEnd) {\n flush();\n }\n cluster.push(item);\n clusterEnd = Math.max(clusterEnd, item.toMin);\n }\n flush();\n return placed;\n}\n\n/** The all-day (and multi-day) events touching a given day, in a stable order. */\nexport function allDayOn<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n defaultMinutes: number,\n): SdsCalendarEvent<T>[] {\n return events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => e.event.allDay && occursOn(e.start, e.end, day))\n .sort((a, b) => a.start.getTime() - b.start.getTime())\n .map((e) => e.event);\n}\n\n/** Every event touching a day, all-day first then by start — what a month cell lists. */\nexport function eventsOn<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n defaultMinutes: number,\n): SdsCalendarEvent<T>[] {\n return events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => occursOn(e.start, e.end, day))\n .sort(\n (a, b) =>\n Number(!!b.event.allDay) - Number(!!a.event.allDay) ||\n a.start.getTime() - b.start.getTime(),\n )\n .map((e) => e.event);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n addDays,\n isSameDay,\n SdsIcon,\n SdsSegmented,\n SdsSegmentedOption,\n startOfDay,\n} from '@besaitech/ng-design-system';\nimport {\n allDayOn,\n eventsOn,\n minutesOfDay,\n PlacedEvent,\n placeDay,\n SdsCalendarEvent,\n SdsEventCalendarView,\n SdsEventColor,\n step,\n toDate,\n visibleDays,\n visibleRange,\n} from './calendar-layout';\n\nexport type { SdsCalendarEvent, SdsEventCalendarView, SdsEventColor };\n\n/** A click on empty time: what a host turns into \"new appointment\". */\nexport interface SdsCalendarSlot {\n start: Date;\n end: Date;\n}\n\nexport interface SdsCalendarRange {\n start: Date;\n end: Date;\n view: SdsEventCalendarView;\n}\n\n/** Written out in full — a composed `bg-accent-${c}-soft` would produce no CSS. See sds-severity. */\nconst CHIP: Record<SdsEventColor, string> = {\n brand: 'bg-brand-500/15 text-brand-700 dark:text-brand-200 border-brand-500/40',\n blue: 'bg-accent-blue-soft text-accent-blue border-accent-blue/40',\n green: 'bg-accent-green-soft text-accent-green border-accent-green/40',\n amber: 'bg-accent-amber-soft text-accent-amber border-accent-amber/40',\n red: 'bg-accent-red-soft text-accent-red border-accent-red/40',\n indigo: 'bg-accent-indigo-soft text-accent-indigo border-accent-indigo/40',\n neutral: 'bg-muted text-ink-soft border-border',\n};\n\nconst DOT: Record<SdsEventColor, string> = {\n brand: 'bg-brand-500',\n blue: 'bg-accent-blue',\n green: 'bg-accent-green',\n amber: 'bg-accent-amber',\n red: 'bg-accent-red',\n indigo: 'bg-accent-indigo',\n neutral: 'bg-ink-faint',\n};\n\n/**\n * A calendar of events — month, week, three days or one day.\n *\n * <p><b>Not {@link SdsCalendar}</b>, which is the month grid inside the date picker and exists to\n * pick a date. This one shows what is ON the days, and it owns no data: the host passes `events`\n * and listens to `rangeChange` to fetch the next lot.\n *\n * <p><b>It stores nothing and decides nothing.</b> `view` and `date` are two-way models, so the\n * host can deep-link a view or restore one; every interaction is an output. That is what lets the\n * same component serve a doctor's diary, a room's bookings or a delivery schedule without knowing\n * what any of them are.\n *\n * <p><b>Dates come from `Intl`, control words come from you.</b> Day and month names follow\n * `[locale]` automatically, so the part that is genuinely per-language needs no wiring — but\n * \"Today\", \"All day\" and \"+2 more\" are inputs with English defaults, and a non-English app MUST\n * pass them. An icon-only control's accessible name is the only name it has.\n *\n * <p><b>Mobile.</b> The week view keeps a readable minimum column width and scrolls sideways under\n * its own header rather than squeezing seven columns onto a phone; the month view drops from chips\n * to dots below `sm`. Both are CSS, so there is no resize listener to get wrong and no layout that\n * depends on JavaScript having run.\n *\n * @example\n * <sds-event-calendar\n * [events]=\"appointments()\"\n * [(view)]=\"view\"\n * [(date)]=\"focused\"\n * [todayLabel]=\"'calendar.today' | translate\"\n * (eventClick)=\"open($event)\"\n * (rangeChange)=\"load($event)\" />\n */\n@Component({\n selector: 'sds-event-calendar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SdsIcon, SdsSegmented],\n host: { class: 'block' },\n template: `\n <div class=\"flex flex-col overflow-hidden rounded-card border border-border bg-surface\">\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-3 py-2.5\">\n <div class=\"flex shrink-0 items-center gap-1\">\n <button\n type=\"button\"\n [attr.aria-label]=\"previousLabel()\"\n [title]=\"previousLabel()\"\n class=\"inline-flex size-8 items-center justify-center rounded-control text-ink-soft transition-colors hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"move(-1)\"\n >\n <sds-icon name=\"chevron-left\" [size]=\"18\" />\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center rounded-control border border-border px-3 text-sm font-medium text-ink transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"goToday()\"\n >\n {{ todayLabel() }}\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"nextLabel()\"\n [title]=\"nextLabel()\"\n class=\"inline-flex size-8 items-center justify-center rounded-control text-ink-soft transition-colors hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"move(1)\"\n >\n <sds-icon name=\"chevron-right\" [size]=\"18\" />\n </button>\n </div>\n\n <h2 class=\"min-w-0 flex-1 truncate text-sm font-semibold text-ink sm:text-base\">\n {{ title() }}\n </h2>\n\n @if (showViewSwitcher()) {\n <sds-segmented\n size=\"sm\"\n [ariaLabel]=\"viewSwitcherLabel()\"\n [options]=\"viewOptions()\"\n [value]=\"view()\"\n (valueChange)=\"setView($event)\"\n />\n }\n </div>\n }\n\n @if (view() === 'month') {\n <!-- ------------------------------------------------------------------ month -->\n <div class=\"grid grid-cols-7 border-b border-border bg-muted/50\">\n @for (d of weekdayNames(); track $index) {\n <div class=\"px-1 py-1.5 text-center text-[11px] font-medium text-ink-soft\">\n {{ d }}\n </div>\n }\n </div>\n <div class=\"grid grid-cols-7 grid-rows-6\" [style.height]=\"height()\">\n @for (day of days(); track day.getTime()) {\n <div\n class=\"flex min-w-0 flex-col gap-0.5 border-t border-l border-border p-1 first:border-l-0 [&:nth-child(7n+1)]:border-l-0\"\n [class.bg-muted]=\"!inFocusedMonth(day)\"\n [class.opacity-60]=\"!inFocusedMonth(day)\"\n >\n <button\n type=\"button\"\n class=\"self-start rounded-full px-1.5 text-[11px] font-medium transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n [class]=\"\n isToday(day) ? 'bg-brand-500 text-white hover:bg-brand-600' : 'text-ink-soft'\n \"\n (click)=\"dayClick.emit(day)\"\n >\n {{ day.getDate() }}\n </button>\n\n <!-- Phones get dots: four chips in a 48px-wide cell is four unreadable smears. -->\n <div class=\"flex flex-wrap items-center gap-0.5 px-0.5 sm:hidden\">\n @for (e of cellEvents(day).slice(0, 4); track e.id) {\n <span [class]=\"dotClass(e) + ' size-1.5 rounded-full'\" aria-hidden=\"true\"></span>\n }\n @if (cellEvents(day).length) {\n <span class=\"sr-only\">{{ cellEvents(day).length }}</span>\n }\n </div>\n\n <div class=\"hidden min-h-0 flex-col gap-0.5 overflow-hidden sm:flex\">\n @for (e of cellEvents(day).slice(0, maxPerCell()); track e.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(e) + ' truncate rounded border px-1 py-px text-left text-[11px]'\n \"\n [class.line-through]=\"e.cancelled\"\n [class.opacity-60]=\"e.cancelled\"\n (click)=\"eventClick.emit(e)\"\n >\n @if (!e.allDay) {\n <span class=\"tabular-nums opacity-80\">{{ clock(e.start) }}</span>\n }\n {{ e.title }}\n </button>\n }\n @if (cellEvents(day).length > maxPerCell()) {\n <button\n type=\"button\"\n class=\"px-1 text-left text-[11px] font-medium text-ink-soft hover:text-ink\"\n (click)=\"dayClick.emit(day)\"\n >\n {{\n moreLabel().replace('{count}', '' + (cellEvents(day).length - maxPerCell()))\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <!-- ------------------------------------------------- week / 3 days / one day -->\n <div class=\"overflow-x-auto\">\n <div [style.min-width.px]=\"minWidth()\">\n <div class=\"grid border-b border-border\" [style.grid-template-columns]=\"columns()\">\n <div class=\"border-r border-border\"></div>\n @for (day of days(); track day.getTime()) {\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 px-1 py-1.5 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-500\"\n (click)=\"dayClick.emit(day)\"\n >\n <span class=\"text-[11px] uppercase text-ink-faint\">{{ shortWeekday(day) }}</span>\n <span\n class=\"inline-flex size-6 items-center justify-center rounded-full text-sm font-semibold\"\n [class]=\"isToday(day) ? 'bg-brand-500 text-white' : 'text-ink'\"\n >\n {{ day.getDate() }}\n </span>\n </button>\n }\n </div>\n\n @if (hasAllDay()) {\n <div class=\"grid border-b border-border\" [style.grid-template-columns]=\"columns()\">\n <div\n class=\"border-r border-border px-1 py-1 text-right text-[10px] leading-tight text-ink-faint\"\n >\n {{ allDayLabel() }}\n </div>\n @for (day of days(); track day.getTime()) {\n <div class=\"flex min-w-0 flex-col gap-0.5 p-1\">\n @for (e of allDayEvents(day); track e.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(e) + ' truncate rounded border px-1 py-px text-left text-[11px]'\n \"\n [class.line-through]=\"e.cancelled\"\n (click)=\"eventClick.emit(e)\"\n >\n {{ e.title }}\n </button>\n }\n </div>\n }\n </div>\n }\n\n <div class=\"overflow-y-auto\" [style.height]=\"height()\">\n <div class=\"grid\" [style.grid-template-columns]=\"columns()\">\n <div class=\"relative border-r border-border\" [style.height.px]=\"bodyHeight()\">\n @for (h of hours(); track h) {\n <span\n class=\"absolute right-1.5 -translate-y-1/2 text-[10px] tabular-nums text-ink-faint\"\n [style.top.px]=\"hourTop(h)\"\n >\n {{ hourLabel(h) }}\n </span>\n }\n </div>\n\n @for (day of days(); track day.getTime()) {\n <div\n class=\"relative border-r border-border last:border-r-0\"\n [style.height.px]=\"bodyHeight()\"\n (click)=\"onGridClick($event, day)\"\n >\n @for (h of hours(); track h) {\n <div\n class=\"pointer-events-none absolute inset-x-0 border-t border-border/70\"\n [style.top.px]=\"hourTop(h)\"\n ></div>\n }\n\n @if (nowIndicator() && isToday(day) && nowTop() !== null) {\n <div\n class=\"pointer-events-none absolute inset-x-0 z-20 flex items-center\"\n [style.top.px]=\"nowTop()\"\n aria-hidden=\"true\"\n >\n <span class=\"size-2 shrink-0 rounded-full bg-danger\"></span>\n <span class=\"h-px flex-1 bg-danger\"></span>\n </div>\n }\n\n @for (p of placed(day); track p.event.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(p.event) +\n ' absolute z-10 overflow-hidden rounded border px-1 py-0.5 text-left transition-shadow hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500'\n \"\n [class.line-through]=\"p.event.cancelled\"\n [class.opacity-60]=\"p.event.cancelled\"\n [style.top.%]=\"p.top * 100\"\n [style.height.%]=\"p.height * 100\"\n [style.left.%]=\"p.left * 100\"\n [style.width.%]=\"p.width * 100\"\n [attr.aria-label]=\"\n p.event.title + ', ' + clock(p.start) + ' – ' + clock(p.end)\n \"\n (click)=\"onEventClick($event, p)\"\n >\n <span class=\"block truncate text-[11px] font-medium leading-tight\">\n {{ p.event.title }}\n </span>\n @if (p.height > 0.045) {\n <span class=\"block truncate text-[10px] leading-tight opacity-80\">\n {{ clock(p.start) }}\n @if (p.event.subtitle) {\n · {{ p.event.subtitle }}\n }\n </span>\n }\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n `,\n})\nexport class SdsEventCalendar<T = unknown> {\n private readonly destroyRef = inject(DestroyRef);\n\n readonly events = input<readonly SdsCalendarEvent<T>[]>([]);\n /** Two-way: the host can deep-link or restore a view. */\n readonly view = model<SdsEventCalendarView>('week');\n /** Two-way: any day inside the span being shown. */\n readonly date = model<Date>(new Date());\n\n /** 1 = Monday (the European week), 0 = Sunday. */\n readonly firstDayOfWeek = input(1, { transform: numberAttribute });\n /** The hours the time grid shows. Events outside are clipped to the edge, never dropped. */\n readonly startHour = input(7, { transform: numberAttribute });\n readonly endHour = input(20, { transform: numberAttribute });\n readonly hourHeight = input(48, { transform: numberAttribute });\n /** How long an event with no `end` is assumed to last. */\n readonly defaultMinutes = input(30, { transform: numberAttribute });\n /** CSS height of the scrolling body (month: of the whole grid). */\n readonly height = input('32rem');\n /** BCP-47 tag for day and month names. Empty follows the browser. */\n readonly locale = input('');\n readonly nowIndicator = input(true, { transform: booleanAttribute });\n readonly showToolbar = input(true, { transform: booleanAttribute });\n readonly showViewSwitcher = input(true, { transform: booleanAttribute });\n /** Chips per month cell before it collapses to \"+N\". */\n readonly maxPerCell = input(3, { transform: numberAttribute });\n\n /** Control words. English defaults — a non-English app must pass every one of these. */\n readonly todayLabel = input('Today');\n readonly previousLabel = input('Previous');\n readonly nextLabel = input('Next');\n readonly allDayLabel = input('All day');\n /** `{count}` is substituted. */\n readonly moreLabel = input('+{count} more');\n readonly viewSwitcherLabel = input('View');\n readonly monthLabel = input('Month');\n readonly weekLabel = input('Week');\n readonly threeDayLabel = input('3 days');\n readonly dayLabel = input('Day');\n\n readonly eventClick = output<SdsCalendarEvent<T>>();\n /** A click on empty time, snapped to the hour that was clicked. */\n readonly slotClick = output<SdsCalendarSlot>();\n readonly dayClick = output<Date>();\n /** The span now on screen — fetch for this. Fires whenever the view or the date moves. */\n readonly rangeChange = output<SdsCalendarRange>();\n\n /** Ticks the now-indicator. One timer, cleared with the component. */\n private readonly now = signal(new Date());\n\n constructor() {\n const timer = setInterval(() => this.now.set(new Date()), 60_000);\n this.destroyRef.onDestroy(() => clearInterval(timer));\n\n /*\n * Announce the visible span whenever it changes, HOWEVER it changed. Emitting from the toolbar\n * handlers instead would look identical until a host moved `date` itself — a deep link, a\n * \"jump to this appointment\", restoring a remembered day — and then the calendar would show a\n * week nobody fetched. The models are two-way, so the host is a first-class navigator.\n */\n effect(() => {\n const view = this.view();\n const { start, end } = visibleRange(view, this.date(), this.firstDayOfWeek());\n untracked(() => this.rangeChange.emit({ start, end, view }));\n });\n }\n\n protected readonly days = computed(() =>\n visibleDays(this.view(), this.date(), this.firstDayOfWeek()),\n );\n\n protected readonly hours = computed(() => {\n const out: number[] = [];\n for (let h = this.startHour(); h <= this.endHour(); h++) out.push(h);\n return out;\n });\n\n protected readonly bodyHeight = computed(\n () => Math.max(1, this.endHour() - this.startHour()) * this.hourHeight(),\n );\n\n protected readonly columns = computed(\n () => `3.25rem repeat(${this.days().length}, minmax(0, 1fr))`,\n );\n\n /** Keeps a day column readable on a phone; the grid scrolls sideways instead of squeezing. */\n protected readonly minWidth = computed(() => {\n const perDay = this.days().length > 3 ? 92 : 120;\n return 52 + this.days().length * perDay;\n });\n\n private readonly intl = computed(() => this.locale() || undefined);\n\n protected readonly weekdayNames = computed(() => {\n const fmt = new Intl.DateTimeFormat(this.intl(), { weekday: 'short' });\n const base = startOfDay(new Date(2024, 0, 7)); // a Sunday\n return Array.from({ length: 7 }, (_, i) =>\n fmt.format(addDays(base, (this.firstDayOfWeek() + i) % 7)),\n );\n });\n\n protected readonly title = computed(() => {\n const days = this.days();\n const view = this.view();\n if (view === 'day') {\n return new Intl.DateTimeFormat(this.intl(), {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }).format(days[0]);\n }\n if (view === 'month') {\n return new Intl.DateTimeFormat(this.intl(), { month: 'long', year: 'numeric' }).format(\n this.date(),\n );\n }\n const first = days[0];\n const last = days[days.length - 1];\n const sameMonth = first.getMonth() === last.getMonth();\n const short = new Intl.DateTimeFormat(this.intl(), { day: 'numeric', month: 'short' });\n const long = new Intl.DateTimeFormat(this.intl(), {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n });\n return sameMonth\n ? `${first.getDate()} – ${long.format(last)}`\n : `${short.format(first)} – ${long.format(last)}`;\n });\n\n protected readonly viewOptions = computed<SdsSegmentedOption[]>(() => [\n { value: 'month', label: this.monthLabel() },\n { value: 'week', label: this.weekLabel() },\n { value: '3day', label: this.threeDayLabel() },\n { value: 'day', label: this.dayLabel() },\n ]);\n\n protected readonly hasAllDay = computed(() =>\n this.days().some((d) => allDayOn(this.events(), d, this.defaultMinutes()).length > 0),\n );\n\n protected readonly nowTop = computed(() => {\n const minutes = minutesOfDay(this.now());\n const from = this.startHour() * 60;\n const to = this.endHour() * 60;\n if (minutes < from || minutes > to) return null;\n return ((minutes - from) / 60) * this.hourHeight();\n });\n\n protected placed(day: Date): PlacedEvent<T>[] {\n return placeDay(this.events(), day, this.startHour(), this.endHour(), this.defaultMinutes());\n }\n\n protected allDayEvents(day: Date): SdsCalendarEvent<T>[] {\n return allDayOn(this.events(), day, this.defaultMinutes());\n }\n\n protected cellEvents(day: Date): SdsCalendarEvent<T>[] {\n return eventsOn(this.events(), day, this.defaultMinutes());\n }\n\n protected isToday(day: Date): boolean {\n return isSameDay(day, this.now());\n }\n\n protected inFocusedMonth(day: Date): boolean {\n return day.getMonth() === this.date().getMonth();\n }\n\n protected shortWeekday(day: Date): string {\n return new Intl.DateTimeFormat(this.intl(), { weekday: 'short' }).format(day);\n }\n\n protected hourLabel(hour: number): string {\n return new Intl.DateTimeFormat(this.intl(), { hour: 'numeric', minute: '2-digit' }).format(\n new Date(2024, 0, 1, hour, 0),\n );\n }\n\n protected clock(value: Date | string | number): string {\n return new Intl.DateTimeFormat(this.intl(), { hour: '2-digit', minute: '2-digit' }).format(\n toDate(value),\n );\n }\n\n protected hourTop(hour: number): number {\n return (hour - this.startHour()) * this.hourHeight();\n }\n\n protected chipClass(e: SdsCalendarEvent<T>): string {\n return CHIP[e.color ?? 'brand'];\n }\n\n protected dotClass(e: SdsCalendarEvent<T>): string {\n return DOT[e.color ?? 'brand'];\n }\n\n protected setView(next: unknown): void {\n this.view.set(next as SdsEventCalendarView);\n }\n\n protected move(direction: 1 | -1): void {\n this.date.set(step(this.view(), this.date(), direction));\n }\n\n protected goToday(): void {\n this.date.set(new Date());\n }\n\n /** A click on empty grid becomes a slot of `defaultMinutes`, snapped to the hour clicked. */\n protected onGridClick(event: MouseEvent, day: Date): void {\n const host = event.currentTarget as HTMLElement;\n const y = event.clientY - host.getBoundingClientRect().top;\n const minutes = this.startHour() * 60 + (y / this.hourHeight()) * 60;\n const snapped = Math.floor(minutes / this.defaultMinutes()) * this.defaultMinutes();\n const start = new Date(startOfDay(day).getTime() + snapped * 60_000);\n this.slotClick.emit({\n start,\n end: new Date(start.getTime() + this.defaultMinutes() * 60_000),\n });\n }\n\n protected onEventClick(event: MouseEvent, placed: PlacedEvent<T>): void {\n // Without this the click falls through to the grid and also opens \"new appointment\".\n event.stopPropagation();\n this.eventClick.emit(placed.event);\n }\n}\n","/*\n * @besaitech/ng-design-system/calendar — the event calendar, kept OUT of the main entry point.\n *\n * Same reason the chart family has its own: a consuming app that never shows a calendar should not\n * carry one. It is reachable from a lazy route, but the library is one ES module, so anything the\n * primary entry point exports is linked into whatever bundle already imports from it — measured at\n * roughly 28 kB landing in medicware-clinic's INITIAL bundle, past its budget, for a screen behind\n * a lazy route. A separate entry point is what actually makes it lazy.\n */\nexport * from './calendar-layout';\nexport * from './sds-event-calendar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAgDA,MAAM,aAAa,GAAG,MAAM;AAEtB,SAAU,MAAM,CAAC,KAA6B,EAAA;IAClD,OAAO,KAAK,YAAY,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;AAC5E;AAEA;AACM,SAAU,YAAY,CAAC,CAAO,EAAA;IAClC,OAAO,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,EAAE;AAC3C;AAEM,SAAU,WAAW,CAAC,CAAO,EAAE,cAAsB,EAAA;AACzD,IAAA,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;AACzB,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC;AACrD,IAAA,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAC7B;AAEA;;;;;AAKG;SACa,WAAW,CACzB,IAA0B,EAC1B,IAAU,EACV,cAAsB,EAAA;AAEtB,IAAA,IAAI,IAAI,KAAK,KAAK,EAAE;AAClB,QAAA,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3B;AACA,IAAA,IAAI,IAAI,KAAK,MAAM,EAAE;AACnB,QAAA,MAAM,IAAI,G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;;;AAkPT,EAAA,CAAA;AACF,iBAAA;;;AChWD;;;;;;;;AAQG;;ACRH;;AAEG;;;;"}
1
+ {"version":3,"file":"besaitech-ng-design-system-calendar.mjs","sources":["../../../projects/saitech-design-system/calendar/calendar-layout.ts","../../../projects/saitech-design-system/calendar/sds-event-calendar.ts","../../../projects/saitech-design-system/calendar/public-api.ts","../../../projects/saitech-design-system/calendar/besaitech-ng-design-system-calendar.ts"],"sourcesContent":["import { addDays, startOfDay } from '@besaitech/ng-design-system';\n\n/** Which span of time the calendar is showing. */\nexport type SdsEventCalendarView = 'month' | 'week' | '3day' | 'day';\n\n/**\n * How an event is tinted. These map onto the library's existing accent roles, so an event picks a\n * meaning-free hue — it is NOT a severity and NOT a status. Anything clinical that needs to say\n * \"how bad\" belongs in `sds-severity`, which has its own measured ramp.\n */\nexport type SdsEventColor = 'brand' | 'blue' | 'green' | 'amber' | 'red' | 'indigo' | 'neutral';\n\n/**\n * One thing on the calendar.\n *\n * <p>`start`/`end` are Dates or anything `new Date(...)` parses. Everything is computed in the\n * BROWSER's timezone: a calendar shows a person their own day, and converting on the way in is the\n * caller's job if their data says otherwise.\n */\nexport interface SdsCalendarEvent<T = unknown> {\n id: string;\n title: string;\n start: Date | string | number;\n /** Defaults to `start` + `defaultMinutes` when absent — a zero-length block is unclickable. */\n end?: Date | string | number;\n /** Second line, shown where there is room: a room, a reason, a phone number. */\n subtitle?: string;\n allDay?: boolean;\n color?: SdsEventColor;\n /** Struck through and faded — a cancelled appointment is still part of the day's record. */\n cancelled?: boolean;\n /** Whatever the caller wants back on click. The component never reads it. */\n meta?: T;\n}\n\n/** An event resolved to real Dates, with its place in the grid worked out. */\nexport interface PlacedEvent<T = unknown> {\n event: SdsCalendarEvent<T>;\n start: Date;\n end: Date;\n /** 0..1 of the visible day height. */\n top: number;\n height: number;\n /** 0..1 across the column: side-by-side layout for events sharing a time. */\n left: number;\n width: number;\n}\n\nconst MS_PER_MINUTE = 60_000;\n\nexport function toDate(value: Date | string | number): Date {\n return value instanceof Date ? new Date(value.getTime()) : new Date(value);\n}\n\n/** Minutes since local midnight. Read off the clock, never from an epoch difference — see below. */\nexport function minutesOfDay(d: Date): number {\n return d.getHours() * 60 + d.getMinutes();\n}\n\nexport function startOfWeek(d: Date, firstDayOfWeek: number): Date {\n const day = startOfDay(d);\n const shift = (day.getDay() - firstDayOfWeek + 7) % 7;\n return addDays(day, -shift);\n}\n\n/**\n * The days a view shows.\n *\n * <p>`month` is always a 6×7 block, never 4–6 ragged rows: a grid that changes height as you page\n * through the year makes everything below it jump.\n */\nexport function visibleDays(\n view: SdsEventCalendarView,\n date: Date,\n firstDayOfWeek: number,\n): Date[] {\n if (view === 'day') {\n return [startOfDay(date)];\n }\n if (view === '3day') {\n const from = startOfDay(date);\n return [0, 1, 2].map((i) => addDays(from, i));\n }\n if (view === 'week') {\n const from = startOfWeek(date, firstDayOfWeek);\n return Array.from({ length: 7 }, (_, i) => addDays(from, i));\n }\n const first = new Date(date.getFullYear(), date.getMonth(), 1);\n const from = startOfWeek(first, firstDayOfWeek);\n return Array.from({ length: 42 }, (_, i) => addDays(from, i));\n}\n\n/** The half-open range a view covers — what a host should fetch for. */\nexport function visibleRange(\n view: SdsEventCalendarView,\n date: Date,\n firstDayOfWeek: number,\n): { start: Date; end: Date } {\n const days = visibleDays(view, date, firstDayOfWeek);\n return { start: days[0], end: addDays(days[days.length - 1], 1) };\n}\n\n/** Paging: one month, one week, three days or one day at a time, in the view's own unit. */\nexport function step(view: SdsEventCalendarView, date: Date, direction: 1 | -1): Date {\n switch (view) {\n case 'month': {\n const d = new Date(date.getFullYear(), date.getMonth() + direction, 1);\n return d;\n }\n case 'week':\n return addDays(date, 7 * direction);\n case '3day':\n return addDays(date, 3 * direction);\n default:\n return addDays(date, direction);\n }\n}\n\n/** Whether an event touches a given day at all. Half-open: an event ending at 00:00 is not there. */\nexport function occursOn(start: Date, end: Date, day: Date): boolean {\n const from = startOfDay(day).getTime();\n const to = addDays(startOfDay(day), 1).getTime();\n return start.getTime() < to && end.getTime() > from;\n}\n\n/**\n * Place one day's timed events in the grid, side by side where they overlap.\n *\n * <p>The classic column packing: events are clustered into runs that transitively overlap, each\n * takes the leftmost column that is free at its time, and the whole cluster is then divided by the\n * widest point. So two appointments at 09:00 each take half the width and a third takes a third —\n * and a 14:00 appointment with nothing beside it is full width, because it is in its own cluster.\n *\n * <p><b>Vertical position is read off the clock, not from an epoch difference.</b> On the two days a\n * year when the clocks move, a 09:00–10:00 appointment is still drawn at 09:00 and one hour tall;\n * computing it from elapsed milliseconds would slide every event after the change by an hour.\n *\n * <p>Events are clipped to the visible window rather than dropped: a night shift starting at 06:00\n * on a grid that opens at 08:00 should still show, flush to the top, not vanish.\n */\nexport function placeDay<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n startHour: number,\n endHour: number,\n defaultMinutes: number,\n): PlacedEvent<T>[] {\n const windowStart = startHour * 60;\n const windowEnd = endHour * 60;\n const span = Math.max(1, windowEnd - windowStart);\n const dayStart = startOfDay(day);\n const nextDay = addDays(dayStart, 1);\n\n const resolved = events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => !e.event.allDay && occursOn(e.start, e.end, day))\n .map((e) => {\n // Clip to this day first, so a block running past midnight is drawn on both days correctly.\n const from = e.start < dayStart ? dayStart : e.start;\n const to = e.end > nextDay ? nextDay : e.end;\n const fromMin = from.getTime() === dayStart.getTime() ? 0 : minutesOfDay(from);\n const toMin = to.getTime() === nextDay.getTime() ? 24 * 60 : minutesOfDay(to);\n return { ...e, fromMin, toMin: Math.max(toMin, fromMin + 1) };\n })\n .filter((e) => e.toMin > windowStart && e.fromMin < windowEnd)\n .sort((a, b) => a.fromMin - b.fromMin || b.toMin - a.toMin);\n\n // Cluster transitively overlapping events; each cluster is divided independently.\n const placed: PlacedEvent<T>[] = [];\n let cluster: typeof resolved = [];\n let clusterEnd = -1;\n\n const flush = () => {\n if (!cluster.length) return;\n const columnEnds: number[] = [];\n const columnOf = new Map<(typeof cluster)[number], number>();\n for (const item of cluster) {\n let column = columnEnds.findIndex((endMin) => endMin <= item.fromMin);\n if (column === -1) {\n column = columnEnds.length;\n }\n columnEnds[column] = item.toMin;\n columnOf.set(item, column);\n }\n const columns = columnEnds.length;\n for (const item of cluster) {\n const top = (Math.max(item.fromMin, windowStart) - windowStart) / span;\n const bottom = (Math.min(item.toMin, windowEnd) - windowStart) / span;\n const column = columnOf.get(item) ?? 0;\n placed.push({\n event: item.event,\n start: item.start,\n end: item.end,\n top,\n height: Math.max(bottom - top, 0.012),\n left: column / columns,\n width: 1 / columns,\n });\n }\n cluster = [];\n clusterEnd = -1;\n };\n\n for (const item of resolved) {\n if (cluster.length && item.fromMin >= clusterEnd) {\n flush();\n }\n cluster.push(item);\n clusterEnd = Math.max(clusterEnd, item.toMin);\n }\n flush();\n return placed;\n}\n\n/**\n * A dragged minute, snapped to the grid and held inside the visible window.\n *\n * <p>Clamping is not cosmetic: without it a drag that leaves the top of the grid proposes a time\n * before the practice opens, and the host either books it or has to invent the same rule itself.\n */\nexport function snapMinute(\n minute: number,\n stepMinutes: number,\n startHour: number,\n endHour: number,\n): number {\n const step = Math.max(1, stepMinutes);\n return Math.min(endHour * 60, Math.max(startHour * 60, Math.round(minute / step) * step));\n}\n\n/** The all-day (and multi-day) events touching a given day, in a stable order. */\nexport function allDayOn<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n defaultMinutes: number,\n): SdsCalendarEvent<T>[] {\n return events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => e.event.allDay && occursOn(e.start, e.end, day))\n .sort((a, b) => a.start.getTime() - b.start.getTime())\n .map((e) => e.event);\n}\n\n/** Every event touching a day, all-day first then by start — what a month cell lists. */\nexport function eventsOn<T>(\n events: readonly SdsCalendarEvent<T>[],\n day: Date,\n defaultMinutes: number,\n): SdsCalendarEvent<T>[] {\n return events\n .map((event) => {\n const start = toDate(event.start);\n const end = event.end\n ? toDate(event.end)\n : new Date(start.getTime() + defaultMinutes * MS_PER_MINUTE);\n return { event, start, end };\n })\n .filter((e) => occursOn(e.start, e.end, day))\n .sort(\n (a, b) =>\n Number(!!b.event.allDay) - Number(!!a.event.allDay) ||\n a.start.getTime() - b.start.getTime(),\n )\n .map((e) => e.event);\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n addDays,\n isSameDay,\n SdsIcon,\n SdsSegmented,\n SdsSegmentedOption,\n startOfDay,\n} from '@besaitech/ng-design-system';\nimport {\n allDayOn,\n eventsOn,\n minutesOfDay,\n PlacedEvent,\n placeDay,\n SdsCalendarEvent,\n SdsEventCalendarView,\n SdsEventColor,\n snapMinute,\n step,\n toDate,\n visibleDays,\n visibleRange,\n} from './calendar-layout';\n\nexport type { SdsCalendarEvent, SdsEventCalendarView, SdsEventColor };\n\n/** Where an event was dropped. The component reports; the host decides whether it sticks. */\nexport interface SdsCalendarDrop<T = unknown> {\n event: SdsCalendarEvent<T>;\n start: Date;\n end: Date;\n}\n\n/** The gesture in flight. `atMin` is where the pointer is now, snapped. */\ntype DragState<T> =\n | { kind: 'select'; dayIndex: number; fromMin: number; atMin: number }\n | {\n kind: 'move';\n dayIndex: number;\n placed: PlacedEvent<T>;\n durationMin: number;\n grabOffsetMin: number;\n atMin: number;\n };\n\n/** A click on empty time: what a host turns into \"new appointment\". */\nexport interface SdsCalendarSlot {\n start: Date;\n end: Date;\n}\n\nexport interface SdsCalendarRange {\n start: Date;\n end: Date;\n view: SdsEventCalendarView;\n}\n\n/** Written out in full — a composed `bg-accent-${c}-soft` would produce no CSS. See sds-severity. */\nconst CHIP: Record<SdsEventColor, string> = {\n brand: 'bg-brand-500/15 text-brand-700 dark:text-brand-200 border-brand-500/40',\n blue: 'bg-accent-blue-soft text-accent-blue border-accent-blue/40',\n green: 'bg-accent-green-soft text-accent-green border-accent-green/40',\n amber: 'bg-accent-amber-soft text-accent-amber border-accent-amber/40',\n red: 'bg-accent-red-soft text-accent-red border-accent-red/40',\n indigo: 'bg-accent-indigo-soft text-accent-indigo border-accent-indigo/40',\n neutral: 'bg-muted text-ink-soft border-border',\n};\n\nconst DOT: Record<SdsEventColor, string> = {\n brand: 'bg-brand-500',\n blue: 'bg-accent-blue',\n green: 'bg-accent-green',\n amber: 'bg-accent-amber',\n red: 'bg-accent-red',\n indigo: 'bg-accent-indigo',\n neutral: 'bg-ink-faint',\n};\n\n/**\n * A calendar of events — month, week, three days or one day.\n *\n * <p><b>Not {@link SdsCalendar}</b>, which is the month grid inside the date picker and exists to\n * pick a date. This one shows what is ON the days, and it owns no data: the host passes `events`\n * and listens to `rangeChange` to fetch the next lot.\n *\n * <p><b>It stores nothing and decides nothing.</b> `view` and `date` are two-way models, so the\n * host can deep-link a view or restore one; every interaction is an output. That is what lets the\n * same component serve a doctor's diary, a room's bookings or a delivery schedule without knowing\n * what any of them are.\n *\n * <p><b>Dates come from `Intl`, control words come from you.</b> Day and month names follow\n * `[locale]` automatically, so the part that is genuinely per-language needs no wiring — but\n * \"Today\", \"All day\" and \"+2 more\" are inputs with English defaults, and a non-English app MUST\n * pass them. An icon-only control's accessible name is the only name it has.\n *\n * <p><b>Mobile.</b> The week view keeps a readable minimum column width and scrolls sideways under\n * its own header rather than squeezing seven columns onto a phone; the month view drops from chips\n * to dots below `sm`. Both are CSS, so there is no resize listener to get wrong and no layout that\n * depends on JavaScript having run.\n *\n * @example\n * <sds-event-calendar\n * [events]=\"appointments()\"\n * [(view)]=\"view\"\n * [(date)]=\"focused\"\n * [todayLabel]=\"'calendar.today' | translate\"\n * (eventClick)=\"open($event)\"\n * (rangeChange)=\"load($event)\" />\n */\n@Component({\n selector: 'sds-event-calendar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SdsIcon, SdsSegmented],\n host: { class: 'block' },\n template: `\n <div class=\"flex flex-col overflow-hidden rounded-card border border-border bg-surface\">\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-3 py-2.5\">\n <div class=\"flex shrink-0 items-center gap-1\">\n <button\n type=\"button\"\n [attr.aria-label]=\"previousLabel()\"\n [title]=\"previousLabel()\"\n class=\"inline-flex size-8 items-center justify-center rounded-control text-ink-soft transition-colors hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"move(-1)\"\n >\n <sds-icon name=\"chevron-left\" [size]=\"18\" />\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center rounded-control border border-border px-3 text-sm font-medium text-ink transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"goToday()\"\n >\n {{ todayLabel() }}\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"nextLabel()\"\n [title]=\"nextLabel()\"\n class=\"inline-flex size-8 items-center justify-center rounded-control text-ink-soft transition-colors hover:bg-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n (click)=\"move(1)\"\n >\n <sds-icon name=\"chevron-right\" [size]=\"18\" />\n </button>\n </div>\n\n <h2 class=\"min-w-0 flex-1 truncate text-sm font-semibold text-ink sm:text-base\">\n {{ title() }}\n </h2>\n\n @if (showViewSwitcher()) {\n <sds-segmented\n size=\"sm\"\n [ariaLabel]=\"viewSwitcherLabel()\"\n [options]=\"viewOptions()\"\n [value]=\"view()\"\n (valueChange)=\"setView($event)\"\n />\n }\n </div>\n }\n\n @if (view() === 'month') {\n <!-- ------------------------------------------------------------------ month -->\n <div class=\"grid grid-cols-7 border-b border-border bg-muted/50\">\n @for (d of weekdayNames(); track $index) {\n <div class=\"px-1 py-1.5 text-center text-[11px] font-medium text-ink-soft\">\n {{ d }}\n </div>\n }\n </div>\n <div class=\"grid grid-cols-7 grid-rows-6\" [style.height]=\"height()\">\n @for (day of days(); track day.getTime()) {\n <div\n class=\"flex min-w-0 flex-col gap-0.5 border-t border-l border-border p-1 first:border-l-0 [&:nth-child(7n+1)]:border-l-0\"\n [class.bg-muted]=\"!inFocusedMonth(day)\"\n [class.opacity-60]=\"!inFocusedMonth(day)\"\n >\n <button\n type=\"button\"\n class=\"self-start rounded-full px-1.5 text-[11px] font-medium transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\"\n [class]=\"\n isToday(day) ? 'bg-brand-500 text-white hover:bg-brand-600' : 'text-ink-soft'\n \"\n (click)=\"dayClick.emit(day)\"\n >\n {{ day.getDate() }}\n </button>\n\n <!-- Phones get dots: four chips in a 48px-wide cell is four unreadable smears. -->\n <div class=\"flex flex-wrap items-center gap-0.5 px-0.5 sm:hidden\">\n @for (e of cellEvents(day).slice(0, 4); track e.id) {\n <span [class]=\"dotClass(e) + ' size-1.5 rounded-full'\" aria-hidden=\"true\"></span>\n }\n @if (cellEvents(day).length) {\n <span class=\"sr-only\">{{ cellEvents(day).length }}</span>\n }\n </div>\n\n <div class=\"hidden min-h-0 flex-col gap-0.5 overflow-hidden sm:flex\">\n @for (e of cellEvents(day).slice(0, maxPerCell()); track e.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(e) + ' truncate rounded border px-1 py-px text-left text-[11px]'\n \"\n [class.line-through]=\"e.cancelled\"\n [class.opacity-60]=\"e.cancelled\"\n (click)=\"eventClick.emit(e)\"\n >\n @if (!e.allDay) {\n <span class=\"tabular-nums opacity-80\">{{ clock(e.start) }}</span>\n }\n {{ e.title }}\n </button>\n }\n @if (cellEvents(day).length > maxPerCell()) {\n <button\n type=\"button\"\n class=\"px-1 text-left text-[11px] font-medium text-ink-soft hover:text-ink\"\n (click)=\"dayClick.emit(day)\"\n >\n {{\n moreLabel().replace('{count}', '' + (cellEvents(day).length - maxPerCell()))\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <!-- ------------------------------------------------- week / 3 days / one day -->\n <div class=\"overflow-x-auto\">\n <div [style.min-width.px]=\"minWidth()\">\n <div class=\"grid border-b border-border\" [style.grid-template-columns]=\"columns()\">\n <div class=\"border-r border-border\"></div>\n @for (day of days(); track day.getTime()) {\n <button\n type=\"button\"\n class=\"flex flex-col items-center gap-0.5 px-1 py-1.5 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-500\"\n (click)=\"dayClick.emit(day)\"\n >\n <span class=\"text-[11px] uppercase text-ink-faint\">{{ shortWeekday(day) }}</span>\n <span\n class=\"inline-flex size-6 items-center justify-center rounded-full text-sm font-semibold\"\n [class]=\"isToday(day) ? 'bg-brand-500 text-white' : 'text-ink'\"\n >\n {{ day.getDate() }}\n </span>\n </button>\n }\n </div>\n\n @if (hasAllDay()) {\n <div class=\"grid border-b border-border\" [style.grid-template-columns]=\"columns()\">\n <div\n class=\"border-r border-border px-1 py-1 text-right text-[10px] leading-tight text-ink-faint\"\n >\n {{ allDayLabel() }}\n </div>\n @for (day of days(); track day.getTime()) {\n <div class=\"flex min-w-0 flex-col gap-0.5 p-1\">\n @for (e of allDayEvents(day); track e.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(e) + ' truncate rounded border px-1 py-px text-left text-[11px]'\n \"\n [class.line-through]=\"e.cancelled\"\n (click)=\"eventClick.emit(e)\"\n >\n {{ e.title }}\n </button>\n }\n </div>\n }\n </div>\n }\n\n <div class=\"overflow-y-auto\" [style.height]=\"height()\">\n <div class=\"grid\" [style.grid-template-columns]=\"columns()\">\n <div class=\"relative border-r border-border\" [style.height.px]=\"bodyHeight()\">\n @for (h of hours(); track h) {\n <span\n class=\"absolute right-1.5 -translate-y-1/2 text-[10px] tabular-nums text-ink-faint\"\n [style.top.px]=\"hourTop(h)\"\n >\n {{ hourLabel(h) }}\n </span>\n }\n </div>\n\n @for (day of days(); track day.getTime(); let dayIndex = $index) {\n <div\n class=\"relative touch-none border-r border-border last:border-r-0\"\n [attr.data-sds-day]=\"dayIndex\"\n [style.height.px]=\"bodyHeight()\"\n (click)=\"onGridClick($event, day)\"\n (pointerdown)=\"startSelect($event, dayIndex)\"\n >\n @for (h of hours(); track h) {\n <div\n class=\"pointer-events-none absolute inset-x-0 border-t border-border/70\"\n [style.top.px]=\"hourTop(h)\"\n ></div>\n }\n\n @if (ghostFor(dayIndex); as ghost) {\n <!--\n What the drag will produce, drawn where it will land. A drag with no preview\n is a guess: you find out what you did once the server has been told.\n -->\n <div\n class=\"pointer-events-none absolute inset-x-0.5 z-30 rounded border-2 border-dashed border-brand-500 bg-brand-500/15\"\n [style.top.px]=\"ghost.top\"\n [style.height.px]=\"ghost.height\"\n aria-hidden=\"true\"\n >\n <span\n class=\"block px-1 pt-0.5 text-[10px] font-medium text-brand-700 dark:text-brand-200\"\n >\n {{ ghost.label }}\n </span>\n </div>\n }\n\n @if (nowIndicator() && isToday(day) && nowTop() !== null) {\n <div\n class=\"pointer-events-none absolute inset-x-0 z-20 flex items-center\"\n [style.top.px]=\"nowTop()\"\n aria-hidden=\"true\"\n >\n <span class=\"size-2 shrink-0 rounded-full bg-danger\"></span>\n <span class=\"h-px flex-1 bg-danger\"></span>\n </div>\n }\n\n @for (p of placed(day); track p.event.id) {\n <button\n type=\"button\"\n [class]=\"\n chipClass(p.event) +\n ' absolute z-10 overflow-hidden rounded border px-1 py-0.5 text-left transition-shadow hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500'\n \"\n [class.line-through]=\"p.event.cancelled\"\n [class.opacity-60]=\"p.event.cancelled\"\n [style.top.%]=\"p.top * 100\"\n [style.height.%]=\"p.height * 100\"\n [style.left.%]=\"p.left * 100\"\n [style.width.%]=\"p.width * 100\"\n [attr.aria-label]=\"\n p.event.title + ', ' + clock(p.start) + ' – ' + clock(p.end)\n \"\n [class.cursor-grab]=\"canDrag(p)\"\n [class.opacity-40]=\"isDragging(p)\"\n (click)=\"onEventClick($event, p)\"\n (pointerdown)=\"startMove($event, p, dayIndex)\"\n >\n <span class=\"block truncate text-[11px] font-medium leading-tight\">\n {{ p.event.title }}\n </span>\n @if (p.height > 0.045) {\n <span class=\"block truncate text-[10px] leading-tight opacity-80\">\n {{ clock(p.start) }}\n @if (p.event.subtitle) {\n · {{ p.event.subtitle }}\n }\n </span>\n }\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n `,\n})\nexport class SdsEventCalendar<T = unknown> {\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly events = input<readonly SdsCalendarEvent<T>[]>([]);\n /** Two-way: the host can deep-link or restore a view. */\n readonly view = model<SdsEventCalendarView>('week');\n /** Two-way: any day inside the span being shown. */\n readonly date = model<Date>(new Date());\n\n /** 1 = Monday (the European week), 0 = Sunday. */\n readonly firstDayOfWeek = input(1, { transform: numberAttribute });\n /** The hours the time grid shows. Events outside are clipped to the edge, never dropped. */\n readonly startHour = input(7, { transform: numberAttribute });\n readonly endHour = input(20, { transform: numberAttribute });\n readonly hourHeight = input(48, { transform: numberAttribute });\n /** How long an event with no `end` is assumed to last. */\n readonly defaultMinutes = input(30, { transform: numberAttribute });\n /** CSS height of the scrolling body (month: of the whole grid). */\n readonly height = input('32rem');\n /** BCP-47 tag for day and month names. Empty follows the browser. */\n readonly locale = input('');\n readonly nowIndicator = input(true, { transform: booleanAttribute });\n readonly showToolbar = input(true, { transform: booleanAttribute });\n readonly showViewSwitcher = input(true, { transform: booleanAttribute });\n /** Chips per month cell before it collapses to \"+N\". */\n readonly maxPerCell = input(3, { transform: numberAttribute });\n\n /** Control words. English defaults — a non-English app must pass every one of these. */\n readonly todayLabel = input('Today');\n readonly previousLabel = input('Previous');\n readonly nextLabel = input('Next');\n readonly allDayLabel = input('All day');\n /** `{count}` is substituted. */\n readonly moreLabel = input('+{count} more');\n readonly viewSwitcherLabel = input('View');\n readonly monthLabel = input('Month');\n readonly weekLabel = input('Week');\n readonly threeDayLabel = input('3 days');\n readonly dayLabel = input('Day');\n\n /**\n * Let an event be dragged to another time or day. <b>Opt-in</b>: a calendar whose host does not\n * persist the move would show an appointment settle somewhere it has not been booked, which is\n * worse than not offering the gesture.\n */\n readonly draggable = input(false, { transform: booleanAttribute });\n /** Drag across empty time to propose a span. The plain click keeps emitting `slotClick`. */\n readonly selectable = input(true, { transform: booleanAttribute });\n /** Both gestures snap to this. 15 minutes is the finest grid anybody reads off a week view. */\n readonly snapMinutes = input(15, { transform: numberAttribute });\n\n readonly eventClick = output<SdsCalendarEvent<T>>();\n /**\n * An event was dragged somewhere else. The component does NOT move it: it reports where it was\n * dropped and redraws from `events` as before, so the diary only changes once the host says it\n * did. A drag that moved the chip locally would show a booking that does not exist whenever the\n * write is refused.\n */\n readonly eventDrop = output<SdsCalendarDrop<T>>();\n /** A span was dragged out across empty time — \"book something from here to here\". */\n readonly rangeSelect = output<SdsCalendarSlot>();\n /** A click on empty time, snapped to the hour that was clicked. */\n readonly slotClick = output<SdsCalendarSlot>();\n readonly dayClick = output<Date>();\n /** The span now on screen — fetch for this. Fires whenever the view or the date moves. */\n readonly rangeChange = output<SdsCalendarRange>();\n\n /** Ticks the now-indicator. One timer, cleared with the component. */\n private readonly now = signal(new Date());\n\n /** The gesture in flight, if any. Null between gestures — there is never more than one. */\n private readonly drag = signal<DragState<T> | null>(null);\n /** Set once the pointer has moved far enough to be a drag rather than a click. */\n private readonly dragging = signal(false);\n /**\n * A finished drag still produces a click, and it arrives AFTER pointerup — so checking\n * \"am I dragging\" inside the click handler is always false by then. Measured: dropping an event\n * emitted `eventDrop` AND `slotClick`, so a host both moved the appointment and opened a\n * \"new appointment\" panel for where the finger lifted. This survives until the click it has to\n * swallow, and is cleared either way.\n */\n private suppressClick = false;\n\n constructor() {\n const timer = setInterval(() => this.now.set(new Date()), 60_000);\n this.destroyRef.onDestroy(() => clearInterval(timer));\n\n /*\n * Announce the visible span whenever it changes, HOWEVER it changed. Emitting from the toolbar\n * handlers instead would look identical until a host moved `date` itself — a deep link, a\n * \"jump to this appointment\", restoring a remembered day — and then the calendar would show a\n * week nobody fetched. The models are two-way, so the host is a first-class navigator.\n */\n effect(() => {\n const view = this.view();\n const { start, end } = visibleRange(view, this.date(), this.firstDayOfWeek());\n untracked(() => this.rangeChange.emit({ start, end, view }));\n });\n }\n\n protected readonly days = computed(() =>\n visibleDays(this.view(), this.date(), this.firstDayOfWeek()),\n );\n\n protected readonly hours = computed(() => {\n const out: number[] = [];\n for (let h = this.startHour(); h <= this.endHour(); h++) out.push(h);\n return out;\n });\n\n protected readonly bodyHeight = computed(\n () => Math.max(1, this.endHour() - this.startHour()) * this.hourHeight(),\n );\n\n protected readonly columns = computed(\n () => `3.25rem repeat(${this.days().length}, minmax(0, 1fr))`,\n );\n\n /** Keeps a day column readable on a phone; the grid scrolls sideways instead of squeezing. */\n protected readonly minWidth = computed(() => {\n const perDay = this.days().length > 3 ? 92 : 120;\n return 52 + this.days().length * perDay;\n });\n\n private readonly intl = computed(() => this.locale() || undefined);\n\n protected readonly weekdayNames = computed(() => {\n const fmt = new Intl.DateTimeFormat(this.intl(), { weekday: 'short' });\n const base = startOfDay(new Date(2024, 0, 7)); // a Sunday\n return Array.from({ length: 7 }, (_, i) =>\n fmt.format(addDays(base, (this.firstDayOfWeek() + i) % 7)),\n );\n });\n\n protected readonly title = computed(() => {\n const days = this.days();\n const view = this.view();\n if (view === 'day') {\n return new Intl.DateTimeFormat(this.intl(), {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }).format(days[0]);\n }\n if (view === 'month') {\n return new Intl.DateTimeFormat(this.intl(), { month: 'long', year: 'numeric' }).format(\n this.date(),\n );\n }\n const first = days[0];\n const last = days[days.length - 1];\n const sameMonth = first.getMonth() === last.getMonth();\n const short = new Intl.DateTimeFormat(this.intl(), { day: 'numeric', month: 'short' });\n const long = new Intl.DateTimeFormat(this.intl(), {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n });\n return sameMonth\n ? `${first.getDate()} – ${long.format(last)}`\n : `${short.format(first)} – ${long.format(last)}`;\n });\n\n protected readonly viewOptions = computed<SdsSegmentedOption[]>(() => [\n { value: 'month', label: this.monthLabel() },\n { value: 'week', label: this.weekLabel() },\n { value: '3day', label: this.threeDayLabel() },\n { value: 'day', label: this.dayLabel() },\n ]);\n\n protected readonly hasAllDay = computed(() =>\n this.days().some((d) => allDayOn(this.events(), d, this.defaultMinutes()).length > 0),\n );\n\n protected readonly nowTop = computed(() => {\n const minutes = minutesOfDay(this.now());\n const from = this.startHour() * 60;\n const to = this.endHour() * 60;\n if (minutes < from || minutes > to) return null;\n return ((minutes - from) / 60) * this.hourHeight();\n });\n\n protected placed(day: Date): PlacedEvent<T>[] {\n return placeDay(this.events(), day, this.startHour(), this.endHour(), this.defaultMinutes());\n }\n\n protected allDayEvents(day: Date): SdsCalendarEvent<T>[] {\n return allDayOn(this.events(), day, this.defaultMinutes());\n }\n\n protected cellEvents(day: Date): SdsCalendarEvent<T>[] {\n return eventsOn(this.events(), day, this.defaultMinutes());\n }\n\n protected isToday(day: Date): boolean {\n return isSameDay(day, this.now());\n }\n\n protected inFocusedMonth(day: Date): boolean {\n return day.getMonth() === this.date().getMonth();\n }\n\n protected shortWeekday(day: Date): string {\n return new Intl.DateTimeFormat(this.intl(), { weekday: 'short' }).format(day);\n }\n\n protected hourLabel(hour: number): string {\n return new Intl.DateTimeFormat(this.intl(), { hour: 'numeric', minute: '2-digit' }).format(\n new Date(2024, 0, 1, hour, 0),\n );\n }\n\n protected clock(value: Date | string | number): string {\n return new Intl.DateTimeFormat(this.intl(), { hour: '2-digit', minute: '2-digit' }).format(\n toDate(value),\n );\n }\n\n protected hourTop(hour: number): number {\n return (hour - this.startHour()) * this.hourHeight();\n }\n\n protected chipClass(e: SdsCalendarEvent<T>): string {\n return CHIP[e.color ?? 'brand'];\n }\n\n protected dotClass(e: SdsCalendarEvent<T>): string {\n return DOT[e.color ?? 'brand'];\n }\n\n protected setView(next: unknown): void {\n this.view.set(next as SdsEventCalendarView);\n }\n\n protected move(direction: 1 | -1): void {\n this.date.set(step(this.view(), this.date(), direction));\n }\n\n protected goToday(): void {\n this.date.set(new Date());\n }\n\n /** A click on empty grid becomes a slot of `defaultMinutes`, snapped to the hour clicked. */\n protected onGridClick(event: MouseEvent, day: Date): void {\n if (this.swallowed()) {\n return;\n }\n const host = event.currentTarget as HTMLElement;\n const y = event.clientY - host.getBoundingClientRect().top;\n const minutes = this.startHour() * 60 + (y / this.hourHeight()) * 60;\n const snapped = Math.floor(minutes / this.defaultMinutes()) * this.defaultMinutes();\n const start = new Date(startOfDay(day).getTime() + snapped * 60_000);\n this.slotClick.emit({\n start,\n end: new Date(start.getTime() + this.defaultMinutes() * 60_000),\n });\n }\n\n // ------------------------------------------------------------------ dragging\n\n protected canDrag(placed: PlacedEvent<T>): boolean {\n return this.draggable() && !placed.event.cancelled;\n }\n\n protected isDragging(placed: PlacedEvent<T>): boolean {\n const drag = this.drag();\n return this.dragging() && drag?.kind === 'move' && drag.placed.event.id === placed.event.id;\n }\n\n /** The dashed block: where this drag would land on this column, or null. */\n protected ghostFor(dayIndex: number): { top: number; height: number; label: string } | null {\n const drag = this.drag();\n if (!drag || !this.dragging() || drag.dayIndex !== dayIndex) {\n return null;\n }\n const perMinute = this.hourHeight() / 60;\n const from = this.startHour() * 60;\n const [a, b] =\n drag.kind === 'move'\n ? [drag.atMin, drag.atMin + drag.durationMin]\n : [Math.min(drag.fromMin, drag.atMin), Math.max(drag.fromMin, drag.atMin)];\n const top = (a - from) * perMinute;\n return {\n top,\n height: Math.max((b - a) * perMinute, 2),\n label: `${this.hhmm(a)} – ${this.hhmm(b)}`,\n };\n }\n\n protected startSelect(event: PointerEvent, dayIndex: number): void {\n if (!this.selectable() || event.button !== 0) {\n return;\n }\n const column = event.currentTarget as HTMLElement;\n const minute = this.snap(this.minuteAt(event.clientY, column));\n this.begin(event, { kind: 'select', dayIndex, fromMin: minute, atMin: minute });\n }\n\n protected startMove(event: PointerEvent, placed: PlacedEvent<T>, dayIndex: number): void {\n if (!this.canDrag(placed) || event.button !== 0) {\n return;\n }\n // Stop the column beneath from also starting a range-select under the same finger.\n event.stopPropagation();\n const column = (event.currentTarget as HTMLElement).closest<HTMLElement>('[data-sds-day]');\n if (!column) {\n return;\n }\n const startMin = minutesOfDay(placed.start);\n const durationMin = Math.max(\n this.snapMinutes(),\n Math.round((placed.end.getTime() - placed.start.getTime()) / 60_000),\n );\n this.begin(event, {\n kind: 'move',\n dayIndex,\n placed,\n durationMin,\n // Where in the block the finger went down, so it does not jump to the top on the first move.\n grabOffsetMin: this.minuteAt(event.clientY, column) - startMin,\n atMin: startMin,\n });\n }\n\n /**\n * Listeners are attached for the gesture and removed on release, rather than living on the host\n * for the component's whole life. A calendar sitting idle on a dashboard should not be handling\n * every pointer move on the page.\n */\n private begin(event: PointerEvent, state: DragState<T>): void {\n this.drag.set(state);\n this.dragging.set(false);\n const startY = event.clientY;\n const startX = event.clientX;\n\n const move = (moved: PointerEvent) => {\n const current = this.drag();\n if (!current) {\n return;\n }\n // A few pixels of slop, so a click with a shaky hand is still a click.\n if (\n !this.dragging() &&\n Math.abs(moved.clientY - startY) < 4 &&\n Math.abs(moved.clientX - startX) < 4\n ) {\n return;\n }\n this.dragging.set(true);\n const column = this.columnAt(moved.clientX, moved.clientY);\n const dayIndex = column ? Number(column.dataset['sdsDay']) : current.dayIndex;\n const target = column ?? this.columnFor(current.dayIndex);\n if (!target) {\n return;\n }\n const raw = this.minuteAt(moved.clientY, target);\n const atMin =\n current.kind === 'move' ? this.snap(raw - current.grabOffsetMin) : this.snap(raw);\n this.drag.set({ ...current, dayIndex, atMin });\n };\n\n const up = () => {\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', up);\n window.removeEventListener('pointercancel', up);\n const finished = this.drag();\n const moved = this.dragging();\n this.drag.set(null);\n this.dragging.set(false);\n if (finished && moved) {\n this.suppressClick = true;\n // If no click follows (the pointer left the grid, a touch cancel), do not swallow the\n // NEXT genuine one — a flag that outlives its gesture is a dead control.\n setTimeout(() => {\n this.suppressClick = false;\n });\n this.finish(finished);\n }\n };\n\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', up);\n window.addEventListener('pointercancel', up);\n }\n\n private finish(drag: DragState<T>): void {\n const day = this.days()[drag.dayIndex];\n if (!day) {\n return;\n }\n if (drag.kind === 'move') {\n const start = this.atMinute(day, drag.atMin);\n this.eventDrop.emit({\n event: drag.placed.event,\n start,\n end: new Date(start.getTime() + drag.durationMin * 60_000),\n });\n return;\n }\n const from = Math.min(drag.fromMin, drag.atMin);\n const to = Math.max(drag.fromMin, drag.atMin);\n if (to - from < this.snapMinutes()) {\n // Not a span — the click handler will treat it as a slot click.\n return;\n }\n this.rangeSelect.emit({ start: this.atMinute(day, from), end: this.atMinute(day, to) });\n }\n\n private snap(minute: number): number {\n return snapMinute(minute, this.snapMinutes(), this.startHour(), this.endHour());\n }\n\n private minuteAt(clientY: number, column: HTMLElement): number {\n const y = clientY - column.getBoundingClientRect().top;\n return this.startHour() * 60 + (y / this.hourHeight()) * 60;\n }\n\n private atMinute(day: Date, minute: number): Date {\n return new Date(startOfDay(day).getTime() + minute * 60_000);\n }\n\n private columnAt(x: number, y: number): HTMLElement | null {\n return (\n document\n .elementsFromPoint(x, y)\n .find((el): el is HTMLElement => el instanceof HTMLElement && !!el.dataset['sdsDay']) ??\n null\n );\n }\n\n private columnFor(dayIndex: number): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>(`[data-sds-day=\"${dayIndex}\"]`);\n }\n\n /** True once, for the click that a just-finished drag is about to produce. */\n private swallowed(): boolean {\n if (!this.suppressClick) {\n return false;\n }\n this.suppressClick = false;\n return true;\n }\n\n private hhmm(minute: number): string {\n const h = Math.floor(minute / 60);\n const m = Math.round(minute % 60);\n return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;\n }\n\n protected onEventClick(event: MouseEvent, placed: PlacedEvent<T>): void {\n // Without this the click falls through to the grid and also opens \"new appointment\".\n event.stopPropagation();\n if (this.swallowed()) {\n return;\n }\n this.eventClick.emit(placed.event);\n }\n}\n","/*\n * @besaitech/ng-design-system/calendar — the event calendar, kept OUT of the main entry point.\n *\n * Same reason the chart family has its own: a consuming app that never shows a calendar should not\n * carry one. It is reachable from a lazy route, but the library is one ES module, so anything the\n * primary entry point exports is linked into whatever bundle already imports from it — measured at\n * roughly 28 kB landing in medicware-clinic's INITIAL bundle, past its budget, for a screen behind\n * a lazy route. A separate entry point is what actually makes it lazy.\n */\nexport * from './calendar-layout';\nexport * from './sds-event-calendar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAgDA,MAAM,aAAa,GAAG,MAAM;AAEtB,SAAU,MAAM,CAAC,KAA6B,EAAA;IAClD,OAAO,KAAK,YAAY,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;AAC5E;AAEA;AACM,SAAU,YAAY,CAAC,CAAO,EAAA;IAClC,OAAO,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,UAAU,EAAE;AAC3C;AAEM,SAAU,WAAW,CAAC,CAAO,EAAE,cAAsB,EAAA;AACzD,IAAA,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;AACzB,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC;AACrD,IAAA,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;AAC7B;AAEA;;;;;AAKG;SACa,WAAW,CACzB,IAA0B,EAC1B,IAAU,EACV,cAAsB,EAA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