snice 7.8.0 → 7.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.
- package/README.md +1 -1
- package/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/table.d.ts +1 -0
- package/adapters/react/table.d.ts.map +1 -1
- package/adapters/react/table.js +1 -1
- package/adapters/react/table.js.map +1 -1
- package/adapters/react/table.tsx +2 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/bin/analyzer-contracts.js +17 -1
- package/custom-elements.json +57 -3
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/calendar/README.md +2 -2
- package/dist/cdn/calendar/snice-calendar.js +537 -44
- package/dist/cdn/calendar/snice-calendar.js.map +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +2 -2
- package/dist/cdn/calendar/snice-calendar.min.js.map +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/code-block/README.md +2 -2
- package/dist/cdn/code-block/snice-code-block.js +177 -167
- package/dist/cdn/code-block/snice-code-block.js.map +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +2 -2
- package/dist/cdn/code-block/snice-code-block.min.js.map +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/command-palette/README.md +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +2 -2
- package/dist/cdn/command-palette/snice-command-palette.js.map +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js.map +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/popover/snice-popover.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/progress/snice-progress.js +2 -2
- package/dist/cdn/progress/snice-progress.js.map +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js.map +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/qr-code/README.md +2 -2
- package/dist/cdn/qr-code/snice-qr-code.js +19 -3
- package/dist/cdn/qr-code/snice-qr-code.js.map +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +2 -2
- package/dist/cdn/qr-code/snice-qr-code.min.js.map +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +5 -2
- package/dist/cdn/receipt/snice-receipt.js.map +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js.map +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.js +4 -4
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +4 -4
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/select/README.md +2 -2
- package/dist/cdn/select/snice-select.js +6 -9
- package/dist/cdn/select/snice-select.js.map +1 -1
- package/dist/cdn/select/snice-select.min.js +2 -2
- package/dist/cdn/select/snice-select.min.js.map +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/table/README.md +2 -2
- package/dist/cdn/table/snice-table.esm.js +1940 -407
- package/dist/cdn/table/snice-table.esm.js.map +1 -1
- package/dist/cdn/table/snice-table.esm.min.js +242 -53
- package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
- package/dist/cdn/table/snice-table.js +1940 -407
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +234 -45
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +187 -5
- package/dist/components/calendar/snice-calendar.js +537 -44
- package/dist/components/calendar/snice-calendar.js.map +1 -1
- package/dist/components/calendar/snice-calendar.types.d.ts +2 -1
- package/dist/components/code-block/formatter.d.ts +6 -0
- package/dist/components/code-block/formatter.js +174 -164
- package/dist/components/code-block/formatter.js.map +1 -1
- package/dist/components/code-block/grammars/snice.json +1 -1
- package/dist/components/code-block/grammars/typescript.json +1 -1
- package/dist/components/command-palette/snice-command-palette.js +1 -1
- package/dist/components/command-palette/snice-command-palette.js.map +1 -1
- package/dist/components/progress/snice-progress.js +1 -1
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/qr-code/qrcode.d.ts +1 -1
- package/dist/components/qr-code/qrcode.js +18 -2
- package/dist/components/qr-code/qrcode.js.map +1 -1
- package/dist/components/receipt/snice-receipt.js +4 -1
- package/dist/components/receipt/snice-receipt.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +1 -1
- package/dist/components/select/snice-select.js +5 -8
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/table/snice-cell-actions.js +1 -1
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-color.js +1 -1
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-date.js +20 -8
- package/dist/components/table/snice-cell-date.js.map +1 -1
- package/dist/components/table/snice-cell-email.js +1 -1
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-image.js +1 -1
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.js +1 -1
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.js +1 -1
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.js +1 -1
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-phone.js +1 -1
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-status.js +1 -1
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell.d.ts +10 -0
- package/dist/components/table/snice-cell.js +59 -13
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +0 -1
- package/dist/components/table/snice-row.js +4 -10
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +170 -2
- package/dist/components/table/snice-table.js +868 -189
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/table/snice-table.types.d.ts +17 -0
- package/dist/components/table/table-cell-presentation.d.ts +17 -4
- package/dist/components/table/table-cell-presentation.js +37 -11
- package/dist/components/table/table-cell-presentation.js.map +1 -1
- package/dist/components/table/table-column-manager.d.ts +153 -2
- package/dist/components/table/table-column-manager.js +364 -43
- package/dist/components/table/table-column-manager.js.map +1 -1
- package/dist/components/table/table-date.d.ts +29 -0
- package/dist/components/table/table-date.js +78 -0
- package/dist/components/table/table-date.js.map +1 -0
- package/dist/components/table/table-export.js +6 -2
- package/dist/components/table/table-export.js.map +1 -1
- package/dist/components/table/table-filter-engine.d.ts +9 -0
- package/dist/components/table/table-filter-engine.js +58 -14
- package/dist/components/table/table-filter-engine.js.map +1 -1
- package/dist/components/table/table-keyboard.d.ts +8 -0
- package/dist/components/table/table-keyboard.js +14 -3
- package/dist/components/table/table-keyboard.js.map +1 -1
- package/dist/components/table/table-toolbar.js +1 -0
- package/dist/components/table/table-toolbar.js.map +1 -1
- package/dist/components/table/table-tree-data.d.ts +2 -0
- package/dist/components/table/table-tree-data.js +35 -9
- package/dist/components/table/table-tree-data.js.map +1 -1
- package/dist/components/table/table-virtualizer.d.ts +44 -7
- package/dist/components/table/table-virtualizer.js +101 -54
- package/dist/components/table/table-virtualizer.js.map +1 -1
- package/dist/components/theme/theme.css +9 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/testing-dom.cjs +1 -1
- package/dist/testing-dom.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/DEVELOPMENT.md +93 -2
- package/docs/ai/components/calendar.md +113 -10
- package/docs/ai/components/code-block.md +4 -0
- package/docs/ai/components/doc.md +1 -1
- package/docs/ai/components/progress.md +1 -0
- package/docs/ai/components/receipt.md +1 -1
- package/docs/ai/components/table.md +29 -30
- package/docs/ai/components/theme.md +1 -0
- package/docs/ai/events.md +30 -0
- package/docs/ai/theme.md +1 -0
- package/docs/components/calendar.md +171 -11
- package/docs/components/code-block.md +2 -0
- package/docs/components/doc.md +1 -1
- package/docs/components/progress.md +13 -0
- package/docs/components/receipt.md +1 -0
- package/docs/components/table.md +274 -15
- package/docs/components/theme.md +5 -0
- package/docs/events.md +49 -0
- package/docs/plans/2026-03-06-date-range-picker-plan.md +4 -4
- package/docs/plans/2026-03-07-table-mui-parity-design.md +1 -1
- package/docs/plans/2026-03-09-action-bar-plan.md +11 -11
- package/docs/superpowers/specs/2026-07-09-table-incredible-design.md +1 -1
- package/docs/superpowers/specs/2026-07-09-table-phase0-implementation.md +2 -2
- package/package.json +3 -1
- package/vscode.html-custom-data.json +13 -1
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import '../avatar/snice-avatar';
|
|
2
2
|
import type { SniceCalendarElement, CalendarView, CalendarEvent, CalendarEventTooltip, CalendarEventPopoverProvider } from './snice-calendar.types';
|
|
3
3
|
export declare class SniceCalendar extends HTMLElement implements SniceCalendarElement {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The selected day, or `null` for "nothing selected yet" — the state a
|
|
6
|
+
* calendar starts in. A default of today would paint the selected
|
|
7
|
+
* background over today's own highlight, making `highlight-today` invisible
|
|
8
|
+
* and announcing `aria-selected` for a choice the user never made.
|
|
9
|
+
*/
|
|
10
|
+
value: Date | string | null;
|
|
5
11
|
view: CalendarView;
|
|
6
12
|
events: CalendarEvent[];
|
|
7
13
|
minDate: Date | string;
|
|
@@ -28,11 +34,30 @@ export declare class SniceCalendar extends HTMLElement implements SniceCalendarE
|
|
|
28
34
|
private header;
|
|
29
35
|
private grid;
|
|
30
36
|
private dayCells;
|
|
37
|
+
private weekNumberHeader;
|
|
38
|
+
private weekNumberCells;
|
|
31
39
|
private focusedDate;
|
|
40
|
+
/**
|
|
41
|
+
* Columns the day grid is shifted by. The week-number column occupies the
|
|
42
|
+
* grid's first column, so every explicitly-placed child — weekday headers,
|
|
43
|
+
* day cells, event stripes — moves one column right while it is shown.
|
|
44
|
+
*/
|
|
45
|
+
private get columnOffset();
|
|
32
46
|
private computeRovingIndex;
|
|
33
47
|
private handleGridKeydown;
|
|
34
48
|
private dispatchChange;
|
|
35
49
|
private dispatchEventClick;
|
|
50
|
+
/**
|
|
51
|
+
* `calendar-more-click` carries a default action (the built-in day panel),
|
|
52
|
+
* so it is cancelable and the component has to read the result of the
|
|
53
|
+
* dispatch. `@dispatch` accepts `cancelable` — it is EventInit passthrough —
|
|
54
|
+
* but the decorated method returns the detail, not `dispatchEvent`'s
|
|
55
|
+
* boolean, so a cancelable default action cannot be observed through it.
|
|
56
|
+
* Dispatched by hand for that reason, the same way `snice-link`'s `navigate`
|
|
57
|
+
* and `snice-stepper`'s `step-change` are.
|
|
58
|
+
*
|
|
59
|
+
* @returns `false` when a listener called `preventDefault()`.
|
|
60
|
+
*/
|
|
36
61
|
private dispatchMoreClick;
|
|
37
62
|
styles(): import("snice").CSSResult;
|
|
38
63
|
initialize(): void;
|
|
@@ -42,24 +67,172 @@ export declare class SniceCalendar extends HTMLElement implements SniceCalendarE
|
|
|
42
67
|
* `@respond('calendar/event-popover')` controller can return the content.
|
|
43
68
|
*/
|
|
44
69
|
private requestEventPopoverContent;
|
|
70
|
+
/**
|
|
71
|
+
* Opens the shared overlay, empty, anchored on `anchor`, and arms its
|
|
72
|
+
* Escape / outside-press dismissal. Both panels the calendar owns — the
|
|
73
|
+
* event popover and the "+N more" day list — go through here, so they share
|
|
74
|
+
* one dismissal contract and one focus-return target.
|
|
75
|
+
*
|
|
76
|
+
* @returns the token identifying this opening; async content must check it
|
|
77
|
+
* against `popoverToken` before painting.
|
|
78
|
+
*/
|
|
79
|
+
private beginPopover;
|
|
45
80
|
private openEventPopover;
|
|
81
|
+
/**
|
|
82
|
+
* The "+N more" chip's built-in default action: the day's hidden events,
|
|
83
|
+
* listed in the shared overlay.
|
|
84
|
+
*
|
|
85
|
+
* Wiring `calendar-more-click` is an application concern, but a chip that
|
|
86
|
+
* visibly does nothing when clicked reads as broken, so the component owns a
|
|
87
|
+
* sensible default. It is only a default — the event is cancelable, and
|
|
88
|
+
* `preventDefault()` leaves the day to the app.
|
|
89
|
+
*/
|
|
90
|
+
private openMorePanel;
|
|
91
|
+
/**
|
|
92
|
+
* A panel entry behaves like the event's own stripe: it reports the click,
|
|
93
|
+
* and drills into the event's popover when it has one. Without popover
|
|
94
|
+
* content there is nothing further to show, so the panel closes and hands
|
|
95
|
+
* focus back to the chip.
|
|
96
|
+
*/
|
|
97
|
+
private handleMorePanelEntry;
|
|
98
|
+
/**
|
|
99
|
+
* Places an overlay at a point given in viewport coordinates.
|
|
100
|
+
*
|
|
101
|
+
* `:host` declares `contain: layout`, which makes the host — not the
|
|
102
|
+
* viewport — the containing block for its `position: fixed` descendants, so
|
|
103
|
+
* viewport coordinates written straight into `left`/`top` land the overlay a
|
|
104
|
+
* whole host-offset down the page. The overlays are `position: absolute`
|
|
105
|
+
* inside `.calendar` instead, and the target is converted into that box
|
|
106
|
+
* here, which is correct with or without the containment.
|
|
107
|
+
*/
|
|
108
|
+
private placeOverlay;
|
|
109
|
+
/** Gap between a bar and its overlay, and the minimum viewport margin. */
|
|
110
|
+
private static readonly OVERLAY_GAP;
|
|
111
|
+
private static readonly OVERLAY_EDGE;
|
|
112
|
+
/** Clamps an overlay's left edge into the viewport. */
|
|
113
|
+
private clampOverlayX;
|
|
46
114
|
private positionPopover;
|
|
47
115
|
closeEventPopover(options?: {
|
|
48
116
|
returnFocus?: boolean;
|
|
49
117
|
}): void;
|
|
118
|
+
/** Keeps a popup trigger's `aria-expanded` in step with the overlay. Guarded
|
|
119
|
+
* on `aria-haspopup` so only the anchors that actually advertise a popup —
|
|
120
|
+
* the "+N more" chip and an event bar carrying popover content — claim the
|
|
121
|
+
* state; a plain bar is not a trigger and must not report one. */
|
|
122
|
+
private setAnchorExpanded;
|
|
50
123
|
cleanupPopover(): void;
|
|
51
124
|
private showEventTooltip;
|
|
125
|
+
private positionTooltip;
|
|
52
126
|
private hideEventTooltip;
|
|
127
|
+
/**
|
|
128
|
+
* Marks the host while a tooltip or popover is showing. Layout containment
|
|
129
|
+
* makes the host a stacking context, so an overlay can only paint above what
|
|
130
|
+
* follows the calendar if the host itself is lifted — see
|
|
131
|
+
* `:host([overlay-open])` in the stylesheet.
|
|
132
|
+
*/
|
|
133
|
+
private syncOverlayLift;
|
|
53
134
|
private updateView;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Attaches or detaches the week-number column and re-places every
|
|
137
|
+
* explicitly-positioned grid child for the resulting column offset.
|
|
138
|
+
*/
|
|
139
|
+
private syncWeekNumberColumn;
|
|
140
|
+
/**
|
|
141
|
+
* Number of the week that starts on `weekStart`.
|
|
142
|
+
*
|
|
143
|
+
* Monday-start calendars use ISO-8601 (week 1 is the week holding the year's
|
|
144
|
+
* first Thursday). Every other start-of-week uses the common civil rule —
|
|
145
|
+
* the week containing January 1 is week 1 — anchored on the year the week
|
|
146
|
+
* ends in, so the turn-of-year week is numbered once, not twice.
|
|
147
|
+
*/
|
|
148
|
+
private getWeekNumber;
|
|
149
|
+
/** Event-lane geometry in rem — mirrors snice-calendar.css. */
|
|
150
|
+
private static readonly LANE_HEIGHT_REM;
|
|
151
|
+
/** Day-number strip above the first lane (the constant in the cell's
|
|
152
|
+
* min-height reservation). */
|
|
153
|
+
private static readonly LANE_STACK_TOP_REM;
|
|
154
|
+
/** Strip the "+N more" chip claims when a stack overflows. */
|
|
155
|
+
private static readonly MORE_CHIP_REM;
|
|
156
|
+
/** Intrinsic floor of a `cell-sizing="stretch"` cell. */
|
|
157
|
+
private static readonly STRETCH_FLOOR_REM;
|
|
158
|
+
/** Lane depth used when there is no layout to measure (headless DOM,
|
|
159
|
+
* detached, `display: none`). */
|
|
160
|
+
private static readonly DEFAULT_EVENT_LANES;
|
|
161
|
+
/**
|
|
162
|
+
* Height a single lane physically occupies, measured from the top of the
|
|
163
|
+
* cell: the bar sits 1.875rem down and is 1.125rem tall.
|
|
164
|
+
*
|
|
165
|
+
* LANE_STACK_TOP_REM + LANE_HEIGHT_REM (3.5rem) is the *budgeted* cost of a
|
|
166
|
+
* lane — it carries a bottom gap so the next lane has somewhere to go. This
|
|
167
|
+
* is the smaller number the budget falls back to when the row cannot grow:
|
|
168
|
+
* the point below which a drawn lane would be clipped by its own cell.
|
|
169
|
+
*/
|
|
170
|
+
private static readonly LANE_MIN_FIT_REM;
|
|
171
|
+
/** Height the "+N more" chip itself occupies at the bottom of the cell. */
|
|
172
|
+
private static readonly MORE_CHIP_FIT_REM;
|
|
173
|
+
/**
|
|
174
|
+
* Narrowest segment, in rem, that still carries an event avatar.
|
|
175
|
+
*
|
|
176
|
+
* A one-day chip in a 400px month grid is ~57px wide; the avatar, its gap,
|
|
177
|
+
* and the bar padding leave the title three characters ("Des…"). The title
|
|
178
|
+
* is the payload and the avatar is an adornment, so — like every
|
|
179
|
+
* professional calendar — a segment that cannot carry both keeps the title
|
|
180
|
+
* and drops the adornment. 4.5rem is the width at which a default-size
|
|
181
|
+
* title still reads next to the avatar.
|
|
182
|
+
*/
|
|
183
|
+
private static readonly AVATAR_MIN_SEGMENT_REM;
|
|
184
|
+
/**
|
|
185
|
+
* How many event lanes fit in a day cell, and how many still fit once the
|
|
186
|
+
* "+N more" chip claims its strip.
|
|
187
|
+
*
|
|
188
|
+
* Measured from the cell's own height with every lane reservation cleared,
|
|
189
|
+
* so the budget follows whatever sizes the cell — the square baseline
|
|
190
|
+
* (`100cqw / 7`), a height the host imposes on the calendar, or the stretch
|
|
191
|
+
* floor — and never feeds back on itself. A `cell-sizing="stretch"` cell the
|
|
192
|
+
* host does not constrain has no budget at all: its row grows to fit every
|
|
193
|
+
* lane, which is what "collapse to content" means.
|
|
194
|
+
*/
|
|
195
|
+
private laneBudget;
|
|
196
|
+
/** True while `--calendar-row-cap` is holding the week rows below the size
|
|
197
|
+
* they would take of their own accord. */
|
|
198
|
+
private rowCapped;
|
|
199
|
+
/**
|
|
200
|
+
* Fits the six week rows inside a host that constrains the calendar's
|
|
201
|
+
* height.
|
|
202
|
+
*
|
|
203
|
+
* The square baseline sizes a week row from the *column width*
|
|
204
|
+
* (`100cqw / 7`), which says nothing about how much height the host has
|
|
205
|
+
* given the grid. A host that hands down a definite height — the components
|
|
206
|
+
* page's `aspect-ratio: 1` card is the reported case — therefore gets a grid
|
|
207
|
+
* whose min-content height exceeds its box: the grid overflows, and whatever
|
|
208
|
+
* clips it (that card's `overflow: hidden`) takes the bottom weeks of the
|
|
209
|
+
* month with it.
|
|
210
|
+
*
|
|
211
|
+
* The room the grid has and the room it wants are both measurable, so the
|
|
212
|
+
* fix is to compare them and publish the per-row ceiling when they disagree.
|
|
213
|
+
* With no constraint the container's height IS its content height, the two
|
|
214
|
+
* agree, and nothing is published — square cells and the growable lane
|
|
215
|
+
* reservation are untouched. Measured with the cap cleared, so it never
|
|
216
|
+
* feeds back on itself.
|
|
217
|
+
*
|
|
218
|
+
* Month view only. The cap divides the room into WEEK_ROWS equal shares and
|
|
219
|
+
* lands as a definite `grid-template-rows` track; the week and day views
|
|
220
|
+
* carry their own taller `min-height` at higher specificity, so a definite
|
|
221
|
+
* track there would leave every cell overflowing its own row and painting
|
|
222
|
+
* over the next one. They keep the pre-cap behaviour — the var stays unset,
|
|
223
|
+
* the tracks stay `auto`.
|
|
224
|
+
*/
|
|
225
|
+
private syncRowCap;
|
|
226
|
+
/** Week rows in a month grid. */
|
|
227
|
+
private static readonly WEEK_ROWS;
|
|
57
228
|
/**
|
|
58
229
|
* Render events as continuous stripes: one bar per (event × week row),
|
|
59
230
|
* spanning the event's days in that week and chopped at week boundaries
|
|
60
231
|
* with continues-left/right styling. Overlapping events stack into lanes
|
|
61
232
|
* per week — earlier start first, longer event first on ties — like
|
|
62
|
-
* professional calendars.
|
|
233
|
+
* professional calendars. How many of those lanes are drawn is the week's
|
|
234
|
+
* share of the day cell's height (see laneBudget); the rest collapse into
|
|
235
|
+
* the day's "+N more" chip.
|
|
63
236
|
*/
|
|
64
237
|
private renderEventStripes;
|
|
65
238
|
goToToday(): void;
|
|
@@ -86,6 +259,15 @@ export declare class SniceCalendar extends HTMLElement implements SniceCalendarE
|
|
|
86
259
|
private getMonthDays;
|
|
87
260
|
private getWeekdays;
|
|
88
261
|
handlePropertyChange(): void;
|
|
262
|
+
/** Box the stripes were last laid out against, so a resize that changes
|
|
263
|
+
* nothing (including the one the render itself causes) is a no-op. */
|
|
264
|
+
private laidOutFor;
|
|
265
|
+
/**
|
|
266
|
+
* The lane budget comes from the cell's height, and that height follows the
|
|
267
|
+
* calendar's own box — column width in square mode, the host's height when
|
|
268
|
+
* it has one. Re-stripe when the box actually changes.
|
|
269
|
+
*/
|
|
270
|
+
handleCalendarResize(entry: ResizeObserverEntry): void;
|
|
89
271
|
handleWeekdayInputsChange(): void;
|
|
90
272
|
}
|
|
91
273
|
declare global {
|