ngwr 13.0.0 → 14.0.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 +13 -6
- package/color-picker/styles/_index.scss +43 -5
- package/fesm2022/ngwr-alert.mjs +5 -5
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +11 -1
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +13 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +12 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +14 -3
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +4 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +15 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +51 -5
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +20 -1
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs +23 -7
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +89 -10
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +27 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +13 -3
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +101 -33
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +10 -2
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -13
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +480 -79
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +22 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +5 -2
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +30 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +24 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +8 -3
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +1 -1
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +52 -12
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +21 -4
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +9 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +63 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +28 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +150 -22
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs +11 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +474 -37
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +21 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +14 -7
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +20 -2
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs +73 -0
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -0
- package/fesm2022/ngwr-loading-bar.mjs +21 -32
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +63 -11
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +104 -14
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +36 -7
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +11 -10
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +65 -30
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +3 -2
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +2 -1
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +38 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +93 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +10 -3
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +2 -1
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +35 -4
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +35 -12
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +158 -0
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -0
- package/fesm2022/ngwr-tabs-testing.mjs +13 -11
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +104 -12
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +20 -1
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +1 -1
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +2 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +18 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +143 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs +10 -2
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +4 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/en.json +33 -6
- package/i18n/ru.json +33 -6
- package/llms-full.txt +20 -11
- package/llms.txt +47 -16
- package/mcp/catalog.js +3 -3
- package/mcp/providers.js +11 -0
- package/package.json +11 -3
- package/schematics/migrations/v13/index.js +101 -0
- package/schematics/migrations/v14/index.js +422 -0
- package/schematics/migrations.json +10 -0
- package/schematics/page/templates.js +1 -1
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/SKILL.md +4 -1
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +4 -0
- package/stepper/styles/_index.scss +19 -1
- package/textarea/styles/_index.scss +14 -6
- package/toast/styles/_index.scss +12 -4
- package/types/ngwr-alert.d.ts +3 -3
- package/types/ngwr-blur-text.d.ts +8 -0
- package/types/ngwr-breadcrumbs.d.ts +1 -0
- package/types/ngwr-button.d.ts +2 -2
- package/types/ngwr-calendar-testing.d.ts +21 -4
- package/types/ngwr-calendar.d.ts +37 -0
- package/types/ngwr-circular-text.d.ts +9 -0
- package/types/ngwr-collapse.d.ts +19 -15
- package/types/ngwr-color-picker-testing.d.ts +10 -4
- package/types/ngwr-color-picker.d.ts +70 -2
- package/types/ngwr-command-palette.d.ts +14 -0
- package/types/ngwr-context-menu.d.ts +1 -1
- package/types/ngwr-date-adapters-fns.d.ts +71 -29
- package/types/ngwr-date-picker-testing.d.ts +206 -185
- package/types/ngwr-date-picker.d.ts +7 -0
- package/types/ngwr-date.d.ts +143 -13
- package/types/ngwr-drag-drop.d.ts +19 -0
- package/types/ngwr-dropdown.d.ts +1 -1
- package/types/ngwr-event-calendar-testing.d.ts +12 -9
- package/types/ngwr-file-upload.d.ts +31 -3
- package/types/ngwr-fuzzy-text.d.ts +5 -0
- package/types/ngwr-i18n.d.ts +89 -7
- package/types/ngwr-icon-adapters-feather.d.ts +11 -0
- package/types/ngwr-icon.d.ts +42 -1
- package/types/ngwr-input-number.d.ts +1 -1
- package/types/ngwr-input-otp.d.ts +3 -0
- package/types/ngwr-input.d.ts +11 -4
- package/types/ngwr-knob-testing.d.ts +8 -4
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-loading-bar-router.d.ts +35 -0
- package/types/ngwr-loading-bar.d.ts +19 -9
- package/types/ngwr-mention.d.ts +13 -0
- package/types/ngwr-pagination-testing.d.ts +11 -10
- package/types/ngwr-pagination.d.ts +39 -10
- package/types/ngwr-popconfirm.d.ts +1 -1
- package/types/ngwr-popover.d.ts +1 -1
- package/types/ngwr-select.d.ts +65 -10
- package/types/ngwr-shiny-text.d.ts +1 -0
- package/types/ngwr-splitter-testing.d.ts +9 -4
- package/types/ngwr-squircle.d.ts +1 -1
- package/types/ngwr-statistic.d.ts +22 -2
- package/types/ngwr-table.d.ts +24 -5
- package/types/ngwr-tabs-router.d.ts +67 -0
- package/types/ngwr-tabs-testing.d.ts +12 -10
- package/types/ngwr-tabs.d.ts +103 -6
- package/types/ngwr-textarea.d.ts +9 -0
- package/types/ngwr-tree.d.ts +7 -0
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window-testing.d.ts +11 -3
- package/types/ngwr-window.d.ts +11 -4
- package/window/styles/_index.scss +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-dropdown.mjs","sources":["../../../projects/lib/dropdown/interfaces/dropdown-position.ts","../../../projects/lib/dropdown/dropdown.ts","../../../projects/lib/dropdown/dropdown-menu.ts","../../../projects/lib/dropdown/dropdown-item.ts","../../../projects/lib/dropdown/dropdown-item.html","../../../projects/lib/dropdown/ngwr-dropdown.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Where the dropdown menu opens, relative to the trigger.\n */\nexport type WrDropdownPosition =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';\n\n/**\n * Maps friendly names to CDK ConnectedPosition fallback lists.\n *\n * @internal\n */\nexport const WR_DROPDOWN_POSITIONS: Record<WrDropdownPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' }],\n 'top-start': [{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }],\n 'top-end': [{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' }],\n 'bottom-start': [{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' }],\n 'bottom-end': [{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, WrOutsideClick, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport type { WrDropdownMenu } from './dropdown-menu';\nimport { WR_DROPDOWN_POSITIONS, type WrDropdownPosition, type WrDropdownTrigger } from './interfaces';\n\n/**\n * Attach to any element to open a `<wr-dropdown-menu>` as a CDK overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\" position=\"bottom-start\" trigger=\"click\">\n * Actions\n * </button>\n *\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" (click)=\"remove()\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\nlet triggerUid = 0;\n\n@Directive({\n selector: '[wrDropdown]',\n host: {\n class: 'wr-dropdown-trigger',\n '[attr.id]': 'triggerId',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'isOpen() ? menu().menuId() : null',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n },\n})\nexport class WrDropdown {\n /** Menu to open. Pass a `<wr-dropdown-menu>` template reference. */\n readonly menu = input.required<WrDropdownMenu>({ alias: 'wrDropdown' });\n\n /** How the menu opens. @default 'click' */\n readonly trigger = input<WrDropdownTrigger>('click');\n\n /** Where the menu anchors relative to the trigger. @default 'bottom-start' */\n readonly position = input<WrDropdownPosition>('bottom-start');\n\n /**\n * Present the menu as a full-width bottom-sheet on small viewports instead\n * of an anchored panel. `undefined` follows the app-wide\n * `provideWrResponsiveOverlays()` setting; `true`/`false` overrides it.\n * @default undefined\n */\n readonly responsive = input<boolean | undefined, BooleanInput>(undefined, {\n transform: (v: BooleanInput): boolean | undefined => (v == null ? undefined : coerceBooleanProperty(v)),\n });\n\n /** Fires after the menu opens. */\n readonly opened = output<void>();\n\n /** Fires after the menu closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so host bindings can read it. */\n readonly isOpen = signal(false);\n\n /**\n * Id the menu names itself after. The trigger is the CONSUMER's own element, so\n * an `id` they already put there wins: overwriting it broke `<label for>`,\n * `document.getElementById` and any `aria-labelledby` aimed at that button from\n * elsewhere in their app. The generated one is only a fallback so the menu has\n * something to reference.\n */\n // `.id` rather than `getAttribute`: it is always a string, and an empty one is no\n // id at all, so it falls through to the generated fallback.\n protected readonly triggerId = this.host.nativeElement.id || `wr-dropdown-trigger-${++triggerUid}`;\n\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // The host view carrying `[wrDropdown]` can be destroyed while the menu is\n // open — a route change, or an `@if` around the trigger. The overlay lives\n // in the CDK container, not in that view, so nothing removes it unless we do.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n }\n\n /** Open the menu. */\n open(): void {\n this.isOpen.set(true);\n }\n\n /** Close the menu. */\n close(): void {\n this.isOpen.set(false);\n }\n\n /** Toggle the menu. */\n toggle(): void {\n this.isOpen.update(v => !v);\n }\n\n // Host listeners\n\n /** @internal */\n /**\n * Whether the pointer, rather than the keyboard, opened the current menu.\n *\n * A hover-opened menu must not take focus — the APG shows a menu on hover and\n * leaves the caret where it was — while a keyboard-opened one must. The\n * trigger MODE cannot answer that on its own: a `trigger=\"hover\"` menu is\n * still openable with Enter, and that open should focus the first item.\n */\n private openedByPointer = false;\n\n protected onClick(event: MouseEvent): void {\n if (this.trigger() !== 'click') return;\n event.stopPropagation();\n this.openedByPointer = false;\n this.toggle();\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n if (this.trigger() !== 'hover') return;\n // A POINTER opened this, so the menu must not take the keyboard with it —\n // see `openedByPointer`.\n this.openedByPointer = true;\n this.isOpen.set(true);\n }\n\n /** @internal */\n protected onMouseLeave(event: MouseEvent): void {\n if (this.trigger() !== 'hover') return;\n const related = event.relatedTarget as Node | null;\n if (related && this.overlayRef?.overlayElement.contains(related)) return;\n this.isOpen.set(false);\n }\n\n // Overlay management\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n // On small viewports (when opted in) detach from the trigger and present\n // the menu as a full-width slide-up sheet pinned to the bottom edge.\n const asSheet = wrPresentAsSheet(this.responsive(), this.responsiveConfig);\n\n const positionStrategy = asSheet\n ? this.overlay.position().global().centerHorizontally().bottom('0')\n : this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(WR_DROPDOWN_POSITIONS[this.position()])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: asSheet ? this.scrollStrategies.block() : this.scrollStrategies.reposition(),\n width: asSheet ? '100%' : undefined,\n hasBackdrop: asSheet,\n backdropClass: asSheet ? 'wr-overlay-backdrop' : undefined,\n panelClass: asSheet\n ? ['wr-dropdown-overlay', 'wr-overlay-sheet']\n : ['wr-dropdown-overlay', `wr-dropdown-overlay--${this.position()}`],\n });\n\n if (asSheet) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.isOpen.set(false));\n }\n\n // Wire trigger id into menu so it can render aria-labelledby.\n this.menu().triggerId.set(this.triggerId);\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Focus the first menu item after the menu renders — unless a POINTER\n // opened it. This used to be unconditional, so merely sweeping the cursor\n // over a `trigger=\"hover\"` menu yanked the caret out of whatever the user\n // was typing; the APG's own rule is that hover shows a menu and does not\n // move focus into it. A keyboard open (Enter / Space / ArrowDown) still\n // focuses the first item, on a hover trigger too.\n if (!this.openedByPointer) queueMicrotask(() => this.focusItemAt(0));\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n this.handleMenuKeydown(event);\n });\n\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.addEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n\n this.opened.emit();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.removeEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n // Take the focus back before the pane goes, or it lands on `<body>` and the\n // next Tab starts from the top of the document. Only when focus is actually\n // inside the menu: closing a menu nobody was in must not steal the caret\n // from wherever the user has since moved.\n const active = document.activeElement;\n const focusWasInside = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (focusWasInside) this.host.nativeElement.focus();\n this.closed.emit();\n }\n\n // Keyboard handling\n\n /** @internal Trigger keydown — ArrowDown/Up/Enter/Space open the menu. */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isOpen()) return;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n // Opened from the keyboard — including on a `hover` trigger, which stays\n // keyboard-operable — so the first item SHOULD take focus.\n this.openedByPointer = false;\n this.open();\n }\n }\n\n private handleMenuKeydown(event: KeyboardEvent): void {\n const items = this.getItems();\n if (items.length === 0 && event.key !== 'Escape' && event.key !== 'Tab') return;\n const current = document.activeElement as HTMLElement | null;\n const idx = current ? items.indexOf(current) : -1;\n\n // CDK's keyboard dispatcher feeds this overlay EVERY document keydown, not\n // just the ones typed into it — and a `trigger=\"hover\"` menu is open with\n // the caret deliberately left wherever the user was (see `openedByPointer`).\n // So ownership is checked here rather than assumed: without it, ArrowDown /\n // ArrowUp / Home / End pressed in an unrelated field were `preventDefault`ed\n // and yanked focus into the menu. The trigger counts as ours — a hover menu\n // that the user has tabbed back to should still open to the keyboard.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n // Escape (and Tab) still close from anywhere — routing to the topmost\n // overlay regardless of focus is the dispatcher's whole job. Escape just\n // must not drag the caret onto the trigger from a field the user is in.\n if (!ours && event.key !== 'Escape' && event.key !== 'Tab') return;\n\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.isOpen.set(false);\n if (ours) this.host.nativeElement.focus();\n break;\n case 'Tab':\n // Let focus leave naturally; close the menu.\n this.isOpen.set(false);\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.focusItemAt(idx < items.length - 1 ? idx + 1 : 0);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusItemAt(idx > 0 ? idx - 1 : items.length - 1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusItemAt(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusItemAt(items.length - 1);\n break;\n default:\n break;\n }\n }\n\n private getItems(): readonly HTMLElement[] {\n if (!this.overlayRef) return [];\n return Array.from(\n this.overlayRef.overlayElement.querySelectorAll<HTMLElement>('.wr-dropdown-item:not(.wr-dropdown-item--disabled)')\n );\n }\n\n private focusItemAt(index: number): void {\n const items = this.getItems();\n if (items.length === 0) return;\n const clamped = ((index % items.length) + items.length) % items.length;\n items[clamped]?.focus();\n }\n\n private readonly onOverlayMouseLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget as Node | null;\n if (related && this.host.nativeElement.contains(related)) return;\n this.isOpen.set(false);\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, TemplateRef, ViewEncapsulation, signal, viewChild } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Holds the menu content rendered when a {@link WrDropdown} opens.\n *\n * The component itself doesn't render anywhere — the directive grabs its\n * internal `<ng-template>` and portals it into an overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\">Actions</button>\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\n@Component({\n selector: 'wr-dropdown-menu',\n template:\n '<ng-template><div class=\"wr-dropdown-menu\" role=\"menu\" [attr.id]=\"menuId()\" [attr.aria-labelledby]=\"triggerId() || null\"><ng-content /></div></ng-template>',\n exportAs: 'wrDropdownMenu',\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrDropdownMenu {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n /** Stable id used on the menu element and referenced from the trigger's `aria-controls`. */\n readonly menuId = signal(`wr-dropdown-menu-${++uid}`);\n\n /** Trigger element id, set by the directive for `aria-labelledby` wiring. */\n readonly triggerId = signal<string | null>(null);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ElementRef, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\n\n/**\n * Single row inside a `<wr-dropdown-menu>`.\n *\n * @example\n * ```html\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" disabled>Delete</wr-dropdown-item>\n * ```\n */\n@Component({\n selector: 'wr-dropdown-item',\n templateUrl: './dropdown-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n },\n imports: [WrIcon],\n})\nexport class WrDropdownItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-dropdown-item'];\n if (this.disabled()) parts.push('wr-dropdown-item--disabled');\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @internal Keyboard activation — fires the same click consumers bind to. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n}\n","@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAUH;;;;AAIG;AACI,MAAM,qBAAqB,GAAoD;AACpF,IAAA,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACpF,IAAA,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC1F,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACpF,IAAA,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACvF,IAAA,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7F,IAAA,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACvF,IAAA,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAA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ects/lib/dropdown/interfaces/dropdown-position.ts","../../../projects/lib/dropdown/dropdown.ts","../../../projects/lib/dropdown/dropdown-menu.ts","../../../projects/lib/dropdown/dropdown-item.ts","../../../projects/lib/dropdown/dropdown-item.html","../../../projects/lib/dropdown/ngwr-dropdown.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Where the dropdown menu opens, relative to the trigger.\n */\nexport type WrDropdownPosition =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';\n\n/**\n * Maps friendly names to CDK ConnectedPosition fallback lists.\n *\n * @internal\n */\nexport const WR_DROPDOWN_POSITIONS: Record<WrDropdownPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' }],\n 'top-start': [{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }],\n 'top-end': [{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' }],\n 'bottom-start': [{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' }],\n 'bottom-end': [{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, WrOutsideClick, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport type { WrDropdownMenu } from './dropdown-menu';\nimport { WR_DROPDOWN_POSITIONS, type WrDropdownPosition, type WrDropdownTrigger } from './interfaces';\n\n/**\n * Attach to any element to open a `<wr-dropdown-menu>` as a CDK overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\" position=\"bottom-start\" trigger=\"click\">\n * Actions\n * </button>\n *\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" (click)=\"remove()\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\nlet triggerUid = 0;\n\n@Directive({\n selector: '[wrDropdown]',\n exportAs: 'wrDropdown',\n host: {\n class: 'wr-dropdown-trigger',\n '[attr.id]': 'triggerId',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'isOpen() ? menu().menuId() : null',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n },\n})\nexport class WrDropdown {\n /** Menu to open. Pass a `<wr-dropdown-menu>` template reference. */\n readonly menu = input.required<WrDropdownMenu>({ alias: 'wrDropdown' });\n\n /** How the menu opens. @default 'click' */\n readonly trigger = input<WrDropdownTrigger>('click');\n\n /** Where the menu anchors relative to the trigger. @default 'bottom-start' */\n readonly position = input<WrDropdownPosition>('bottom-start');\n\n /**\n * Present the menu as a full-width bottom-sheet on small viewports instead\n * of an anchored panel. `undefined` follows the app-wide\n * `provideWrResponsiveOverlays()` setting; `true`/`false` overrides it.\n * @default undefined\n */\n readonly responsive = input<boolean | undefined, BooleanInput>(undefined, {\n transform: (v: BooleanInput): boolean | undefined => (v == null ? undefined : coerceBooleanProperty(v)),\n });\n\n /** Fires after the menu opens. */\n readonly opened = output<void>();\n\n /** Fires after the menu closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so host bindings can read it. */\n readonly isOpen = signal(false);\n\n /**\n * Id the menu names itself after. The trigger is the CONSUMER's own element, so\n * an `id` they already put there wins: overwriting it broke `<label for>`,\n * `document.getElementById` and any `aria-labelledby` aimed at that button from\n * elsewhere in their app. The generated one is only a fallback so the menu has\n * something to reference.\n */\n // `.id` rather than `getAttribute`: it is always a string, and an empty one is no\n // id at all, so it falls through to the generated fallback.\n protected readonly triggerId = this.host.nativeElement.id || `wr-dropdown-trigger-${++triggerUid}`;\n\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // The host view carrying `[wrDropdown]` can be destroyed while the menu is\n // open — a route change, or an `@if` around the trigger. The overlay lives\n // in the CDK container, not in that view, so nothing removes it unless we do.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n }\n\n /** Open the menu. */\n open(): void {\n this.isOpen.set(true);\n }\n\n /** Close the menu. */\n close(): void {\n this.isOpen.set(false);\n }\n\n /** Toggle the menu. */\n toggle(): void {\n this.isOpen.update(v => !v);\n }\n\n // Host listeners\n\n /** @internal */\n /**\n * Whether the pointer, rather than the keyboard, opened the current menu.\n *\n * A hover-opened menu must not take focus — the APG shows a menu on hover and\n * leaves the caret where it was — while a keyboard-opened one must. The\n * trigger MODE cannot answer that on its own: a `trigger=\"hover\"` menu is\n * still openable with Enter, and that open should focus the first item.\n */\n private openedByPointer = false;\n\n protected onClick(event: MouseEvent): void {\n if (this.trigger() !== 'click') return;\n event.stopPropagation();\n this.openedByPointer = false;\n this.toggle();\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n if (this.trigger() !== 'hover') return;\n // A POINTER opened this, so the menu must not take the keyboard with it —\n // see `openedByPointer`.\n this.openedByPointer = true;\n this.isOpen.set(true);\n }\n\n /** @internal */\n protected onMouseLeave(event: MouseEvent): void {\n if (this.trigger() !== 'hover') return;\n const related = event.relatedTarget as Node | null;\n if (related && this.overlayRef?.overlayElement.contains(related)) return;\n this.isOpen.set(false);\n }\n\n // Overlay management\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n // On small viewports (when opted in) detach from the trigger and present\n // the menu as a full-width slide-up sheet pinned to the bottom edge.\n const asSheet = wrPresentAsSheet(this.responsive(), this.responsiveConfig);\n\n const positionStrategy = asSheet\n ? this.overlay.position().global().centerHorizontally().bottom('0')\n : this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(WR_DROPDOWN_POSITIONS[this.position()])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: asSheet ? this.scrollStrategies.block() : this.scrollStrategies.reposition(),\n width: asSheet ? '100%' : undefined,\n hasBackdrop: asSheet,\n backdropClass: asSheet ? 'wr-overlay-backdrop' : undefined,\n panelClass: asSheet\n ? ['wr-dropdown-overlay', 'wr-overlay-sheet']\n : ['wr-dropdown-overlay', `wr-dropdown-overlay--${this.position()}`],\n });\n\n if (asSheet) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.isOpen.set(false));\n }\n\n // Wire trigger id into menu so it can render aria-labelledby.\n this.menu().triggerId.set(this.triggerId);\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Focus the first menu item after the menu renders — unless a POINTER\n // opened it. This used to be unconditional, so merely sweeping the cursor\n // over a `trigger=\"hover\"` menu yanked the caret out of whatever the user\n // was typing; the APG's own rule is that hover shows a menu and does not\n // move focus into it. A keyboard open (Enter / Space / ArrowDown) still\n // focuses the first item, on a hover trigger too.\n if (!this.openedByPointer) queueMicrotask(() => this.focusItemAt(0));\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n this.handleMenuKeydown(event);\n });\n\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.addEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n\n this.opened.emit();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.removeEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n // Take the focus back before the pane goes, or it lands on `<body>` and the\n // next Tab starts from the top of the document. Only when focus is actually\n // inside the menu: closing a menu nobody was in must not steal the caret\n // from wherever the user has since moved.\n const active = document.activeElement;\n const focusWasInside = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (focusWasInside) this.host.nativeElement.focus();\n this.closed.emit();\n }\n\n // Keyboard handling\n\n /** @internal Trigger keydown — ArrowDown/Up/Enter/Space open the menu. */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isOpen()) return;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n // Opened from the keyboard — including on a `hover` trigger, which stays\n // keyboard-operable — so the first item SHOULD take focus.\n this.openedByPointer = false;\n this.open();\n }\n }\n\n private handleMenuKeydown(event: KeyboardEvent): void {\n const items = this.getItems();\n if (items.length === 0 && event.key !== 'Escape' && event.key !== 'Tab') return;\n const current = document.activeElement as HTMLElement | null;\n const idx = current ? items.indexOf(current) : -1;\n\n // CDK's keyboard dispatcher feeds this overlay EVERY document keydown, not\n // just the ones typed into it — and a `trigger=\"hover\"` menu is open with\n // the caret deliberately left wherever the user was (see `openedByPointer`).\n // So ownership is checked here rather than assumed: without it, ArrowDown /\n // ArrowUp / Home / End pressed in an unrelated field were `preventDefault`ed\n // and yanked focus into the menu. The trigger counts as ours — a hover menu\n // that the user has tabbed back to should still open to the keyboard.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n // Escape (and Tab) still close from anywhere — routing to the topmost\n // overlay regardless of focus is the dispatcher's whole job. Escape just\n // must not drag the caret onto the trigger from a field the user is in.\n if (!ours && event.key !== 'Escape' && event.key !== 'Tab') return;\n\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.isOpen.set(false);\n if (ours) this.host.nativeElement.focus();\n break;\n case 'Tab':\n // Let focus leave naturally; close the menu.\n this.isOpen.set(false);\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.focusItemAt(idx < items.length - 1 ? idx + 1 : 0);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusItemAt(idx > 0 ? idx - 1 : items.length - 1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusItemAt(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusItemAt(items.length - 1);\n break;\n default:\n break;\n }\n }\n\n private getItems(): readonly HTMLElement[] {\n if (!this.overlayRef) return [];\n return Array.from(\n this.overlayRef.overlayElement.querySelectorAll<HTMLElement>('.wr-dropdown-item:not(.wr-dropdown-item--disabled)')\n );\n }\n\n private focusItemAt(index: number): void {\n const items = this.getItems();\n if (items.length === 0) return;\n const clamped = ((index % items.length) + items.length) % items.length;\n items[clamped]?.focus();\n }\n\n private readonly onOverlayMouseLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget as Node | null;\n if (related && this.host.nativeElement.contains(related)) return;\n this.isOpen.set(false);\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, TemplateRef, ViewEncapsulation, signal, viewChild } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Holds the menu content rendered when a {@link WrDropdown} opens.\n *\n * The component itself doesn't render anywhere — the directive grabs its\n * internal `<ng-template>` and portals it into an overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\">Actions</button>\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\n@Component({\n selector: 'wr-dropdown-menu',\n template:\n '<ng-template><div class=\"wr-dropdown-menu\" role=\"menu\" [attr.id]=\"menuId()\" [attr.aria-labelledby]=\"triggerId() || null\"><ng-content /></div></ng-template>',\n exportAs: 'wrDropdownMenu',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDropdownMenu {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n /** Stable id used on the menu element and referenced from the trigger's `aria-controls`. */\n readonly menuId = signal(`wr-dropdown-menu-${++uid}`);\n\n /** Trigger element id, set by the directive for `aria-labelledby` wiring. */\n readonly triggerId = signal<string | null>(null);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ElementRef, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\n\n/**\n * Single row inside a `<wr-dropdown-menu>`.\n *\n * @example\n * ```html\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" disabled>Delete</wr-dropdown-item>\n * ```\n */\n@Component({\n selector: 'wr-dropdown-item',\n templateUrl: './dropdown-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n },\n imports: [WrIcon],\n})\nexport class WrDropdownItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-dropdown-item'];\n if (this.disabled()) parts.push('wr-dropdown-item--disabled');\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @internal Keyboard activation — fires the same click consumers bind to. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n}\n","@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAUH;;;;AAIG;AACI,MAAM,qBAAqB,GAAoD;AACpF,IAAA,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,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,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,EAAA,eAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,kBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,eAAA,EAAA,IAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnC3B,mKAMA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED2BY,MAAM,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAEL,cAAc,EAAA,UAAA,EAAA,CAAA;kBAd1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,aAAA,EAEb,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,IAAI,EAAE,UAAU;AAChB,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,iBAAiB,EAAE,IAAI;AACvB,wBAAA,sBAAsB,EAAE,0BAA0B;AAClD,wBAAA,iBAAiB,EAAE,kBAAkB;AACrC,wBAAA,iBAAiB,EAAE,kBAAkB;qBACtC,EAAA,OAAA,EACQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,mKAAA,EAAA;;;AEjCnB;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-event-calendar-testing.mjs","sources":["../../../projects/lib/event-calendar/testing/wr-event-calendar-chip-harness.ts","../../../projects/lib/event-calendar/testing/wr-event-calendar-harness.ts","../../../projects/lib/event-calendar/testing/ngwr-event-calendar-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrEventCalendarChipHarnessFilters } from './interfaces';\n\n/** The arrow keys, by the direction a user would say out loud. */\ntype Arrow = 'left' | 'right' | 'up' | 'down';\n\nconst ARROWS: Record<Arrow, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for one event chip inside a {@link WrEventCalendarHarness}.\n *\n * **The visible text is `aria-hidden`; the name is on the button.** A chip prints a\n * time and a title for the eye, and publishes both as one `aria-label` for a screen\n * reader — so {@link getLabel} is what the control announces and {@link getTitle} is\n * what is drawn. They are separate because a consumer's `[wrCalendarEvent]` template\n * replaces the drawn half and not the announced one.\n *\n * **Moving and resizing are on the keyboard here, and not because of jsdom.** The\n * pointer drag is real, but the same two operations are bound to the arrows —\n * `Alt` to move, `Alt` + `Shift` to resize — precisely so the calendar is usable\n * without one. That is the path this harness drives; a synthetic drag would divide\n * by a rect that measures 0×0 anyway.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrEventCalendarChipHarness extends ComponentHarness {\n static hostSelector = '.wr-event-calendar__chip';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrEventCalendarChipHarnessFilters = {}): HarnessPredicate<WrEventCalendarChipHarness> {\n return new HarnessPredicate(WrEventCalendarChipHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('band', options.band, async (harness, band) => (await harness.isBand()) === band);\n }\n\n /** What the chip announces — its time and title in one string. */\n async getLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /**\n * The title as drawn, or `null` when a consumer template replaced it.\n *\n * The default chip prints its own `.wr-event-calendar__chip-title`; a\n * `[wrCalendarEvent]` template renders whatever the consumer wrote instead, and\n * there is no title element to find. {@link getText} is the fallback that always\n * answers.\n */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-event-calendar__chip-title')();\n return title ? title.text() : null;\n }\n\n /** The chip's whole rendered text, whoever drew it. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** The time as printed on a timed chip, or `null` on a band, which prints none. */\n async getTime(): Promise<string | null> {\n const time = await this.locatorForOptional('.wr-event-calendar__chip-time')();\n return time ? time.text() : null;\n }\n\n /**\n * Whether this is a day-spanning BAND rather than a timed chip.\n *\n * One shape covers two places — a month cell and the all-day row — and the other\n * is the block in a time grid. They size themselves completely differently (a\n * `calc()` width across columns versus a percentage height down one), which is why\n * the two are worth telling apart.\n */\n async isBand(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--band');\n }\n\n /** Whether the event started before this cell — the chip is drawn cut off at the leading edge. */\n async continuesBefore(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--continues-before');\n }\n\n /** Whether the event runs past this cell. */\n async continuesAfter(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--continues-after');\n }\n\n /** Whether the chip is mid-drag. */\n async isDragging(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--dragging');\n }\n\n /**\n * Whether the chip offers a resize grab area.\n *\n * It is `aria-hidden` and not focusable on purpose — the same resize is `Alt` +\n * `Shift` + arrows on the chip itself, so a second tab stop here would lead\n * nowhere. Its\n * presence is still the mouse affordance, and it is dropped on a chip whose event\n * continues past this cell.\n */\n async hasResizeHandle(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__resize')()) !== null;\n }\n\n /**\n * Click the chip — which emits `eventClick` and does NOT bubble to the cell\n * underneath.\n *\n * On an editable calendar this needs `document.elementFromPoint` to exist: the CDK\n * dispatches a whole pointer sequence, and the chip's `pointerdown` hit-tests for\n * the cell under the cursor. jsdom implements no such method, so stub it in your\n * spec — `() => null` is the honest answer where nothing has a box — or the click\n * throws out of the listener.\n */\n async click(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Move keyboard focus to the chip. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the chip currently holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Move the event — `Alt` + an arrow, a day sideways or a slot vertically.\n *\n * The calendar never mutates `events`: this emits `eventChange` and the host is\n * expected to apply it. A spec whose host ignores the output is asserting a\n * CANCELLED move, which is the contract and the most common surprise here. A\n * calendar without `editable` ignores the keys entirely — the same gate the pointer\n * path uses.\n */\n async move(arrow: Arrow): Promise<void> {\n await (await this.host()).sendKeys({ alt: true }, ARROWS[arrow]);\n }\n\n /**\n * Resize the event — `Alt` + `Shift` + an arrow, which moves the END alone.\n *\n * A resize that would end at or before the start emits nothing rather than\n * inverting the event, which is the pointer path's rule too.\n */\n async resize(arrow: Arrow): Promise<void> {\n await (await this.host()).sendKeys({ alt: true, shift: true }, ARROWS[arrow]);\n }\n\n /** Press a bare arrow — which the chip ignores, letting the grid's own navigation run. */\n async pressArrow(arrow: Arrow): Promise<void> {\n await (await this.host()).sendKeys(ARROWS[arrow]);\n }\n\n /** Press Escape — handing focus back to the cell the chip sits in. */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport { WrButtonHarness } from 'ngwr/button/testing';\nimport type { WrCalendarView } from 'ngwr/event-calendar';\n\nimport type { WrEventCalendarChipHarnessFilters, WrEventCalendarHarnessFilters } from './interfaces';\nimport { WrEventCalendarChipHarness } from './wr-event-calendar-chip-harness';\n\n/** The arrow keys, by the direction a user would say out loud. */\ntype Arrow = 'left' | 'right' | 'up' | 'down';\n\nconst ARROWS: Record<Arrow, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for `<wr-event-calendar>` — month, week and day in one component.\n *\n * **Every chip lives inside the `role=\"gridcell\"` where its event STARTS**, and\n * reaches out from there with a `calc()` width or a percentage height. That is a\n * deliberate structural choice — a floating events layer would leave `role=\"row\"`\n * owning something other than cells — and it is why {@link getChips} can be scoped\n * to a cell at all.\n *\n * **The view is read from the DOM, not from the input.** A month renders one grid\n * shape and week / day another, and those two are told apart by how many day columns\n * they draw. That is the honest answer for a harness: `view` is a model a consumer\n * can write, and the grid is what the user sees.\n *\n * **Nothing here mutates the events.** A move or a resize emits `eventChange` and\n * the host applies it — so a spec whose host ignores the output is asserting a\n * CANCELLED gesture, which is the contract rather than a bug.\n *\n * @example\n * ```ts\n * const calendar = await loader.getHarness(WrEventCalendarHarness);\n *\n * expect(await calendar.getView()).toBe('month');\n * const [standup] = await calendar.getChips({ title: 'Standup' });\n * await standup.move('right');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrEventCalendarHarness extends ComponentHarness {\n static hostSelector = 'wr-event-calendar';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrEventCalendarHarnessFilters = {}): HarnessPredicate<WrEventCalendarHarness> {\n return new HarnessPredicate(WrEventCalendarHarness, options)\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('view', options.view, async (harness, view) => (await harness.getView()) === view);\n }\n\n private readonly grid = this.locatorFor('.wr-event-calendar__grid');\n\n /**\n * Which view is on screen.\n *\n * `month` has its own grid modifier; `week` and `day` share the time grid and are\n * told apart by the column count the component publishes on it. Reading the DOM\n * rather than the `view` model is the point — that model is an input a consumer can\n * set to anything, and this is what got rendered.\n */\n async getView(): Promise<WrCalendarView> {\n const grid = await this.grid();\n if (await grid.hasClass('wr-event-calendar__grid--month')) return 'month';\n\n const columns = (await this.locatorForAll('.wr-event-calendar__colhead')()).length;\n return columns > 1 ? 'week' : 'day';\n }\n\n /** The header title — the month, the week's range, or the day. */\n async getTitle(): Promise<string> {\n return (await this.locatorFor('.wr-event-calendar__title')()).text();\n }\n\n /** Whether the header is rendered at all (`hideHeader`). */\n async hasHeader(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__header')()) !== null;\n }\n\n /** The grid's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.grid()).getAttribute('aria-label');\n }\n\n /** Step back one month, week or day, depending on the view. */\n async previous(): Promise<void> {\n await (await this.step('prev')).click();\n }\n\n /** Step forward one month, week or day. */\n async next(): Promise<void> {\n await (await this.step('next')).click();\n }\n\n /** Press the Today button — jumping to the period containing today. */\n async goToday(): Promise<void> {\n await (await this.headerButton('.wr-event-calendar__today', 'goToday')).click();\n }\n\n /** The back arrow's accessible name — the two steps are icon-only. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.stepElement('prev')).getAttribute('aria-label');\n }\n\n /** The forward arrow's accessible name. */\n async getNextLabel(): Promise<string | null> {\n return (await this.stepElement('next')).getAttribute('aria-label');\n }\n\n /** The Today button's label. */\n async getTodayLabel(): Promise<string> {\n return (await this.headerButton('.wr-event-calendar__today', 'getTodayLabel')).getText();\n }\n\n /**\n * The view switcher's labels, in order — empty when the calendar was given a single\n * view, which drops the switcher entirely.\n */\n async getViewLabels(): Promise<string[]> {\n const buttons = await this.locatorForAll(WrButtonHarness.with({ selector: '.wr-event-calendar__view' }))();\n return Promise.all(buttons.map(button => button.getText()));\n }\n\n /** The label of the view currently pressed, or `null` when there is no switcher. */\n async getActiveViewLabel(): Promise<string | null> {\n for (const button of await this.locatorForAll('.wr-event-calendar__view')()) {\n if ((await button.getAttribute('aria-pressed')) === 'true') return button.text();\n }\n return null;\n }\n\n /**\n * Switch view by the label the switcher prints.\n *\n * By label rather than by the `WrCalendarView` value, because the label is what the\n * DOM has — the value never reaches it, and a spec that passed one would be naming\n * something only the component can see. {@link getViewLabels} lists them.\n */\n async setView(label: string): Promise<void> {\n for (const button of await this.locatorForAll('.wr-event-calendar__view')()) {\n if ((await button.text()) === label) {\n await button.click();\n return;\n }\n }\n throw new Error(\n `WrEventCalendarHarness.setView(\"${label}\"): the switcher offers: ` +\n `${(await this.getViewLabels()).join(', ')}.`\n );\n }\n\n /** The weekday column headers of the month view. */\n async getWeekdayNames(): Promise<string[]> {\n const names = await this.locatorForAll('.wr-event-calendar__weekday')();\n return Promise.all(names.map(name => name.text()));\n }\n\n /** The day numbers of the month grid, in order — 42 of them, spill days included. */\n async getDayNumbers(): Promise<string[]> {\n const days = await this.locatorForAll('.wr-event-calendar__daynum')();\n return Promise.all(days.map(day => day.text()));\n }\n\n /** The time-gutter labels down the left of a week or day view. */\n async getSlotLabels(): Promise<string[]> {\n const gutters = await this.locatorForAll('.wr-event-calendar__row .wr-event-calendar__gutter')();\n return Promise.all(gutters.map(gutter => gutter.text()));\n }\n\n /** Whether the time views drew an all-day band, which they only do when something needs it. */\n async hasAllDayRow(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__row--allday')()) !== null;\n }\n\n /**\n * Every chip on screen, in DOM order.\n *\n * A multi-day event has ONE chip, in the cell where it starts — the band reaches\n * across the rest — so this counts events-in-view rather than event-days.\n */\n async getChips(filters: WrEventCalendarChipHarnessFilters = {}): Promise<WrEventCalendarChipHarness[]> {\n return this.locatorForAll(WrEventCalendarChipHarness.with(filters))();\n }\n\n /** The chips' announced names, in DOM order. */\n async getChipLabels(): Promise<(string | null)[]> {\n const chips = await this.getChips();\n return Promise.all(chips.map(chip => chip.getLabel()));\n }\n\n /**\n * The \"+N more\" overflow buttons of the month view, by the text they print.\n *\n * A month cell shows `maxLanes` chips and hides the rest behind one of these, which\n * opens the day view — so its presence is the only sign that a cell has more than\n * it is showing.\n */\n async getOverflowLabels(): Promise<string[]> {\n const more = await this.locatorForAll('.wr-event-calendar__more')();\n return Promise.all(more.map(button => button.text()));\n }\n\n /** Click the first \"+N more\" button, which drops to the day view for that date. */\n async openOverflow(): Promise<void> {\n const [more] = await this.locatorForAll('.wr-event-calendar__more')();\n if (!more) {\n throw new Error(\n 'WrEventCalendarHarness.openOverflow(): no cell is overflowing. A month cell only draws the button ' +\n 'once it has more events than `maxLanes` lets it show.'\n );\n }\n await more.click();\n }\n\n /**\n * Click an empty part of a cell — which emits `slotClick` with its date and minutes.\n *\n * A cell is addressed by its DAY and, in a time view, the minutes from midnight of\n * its row (`-1` means a month cell or the all-day band). Both come off the two data\n * attributes every cell publishes for the drag's own hit-testing, which makes them\n * the one stable way to name a cell from outside — a row index would mean something\n * different in each view.\n */\n async clickCell(day: Date, minutes = -1): Promise<void> {\n await (await this.requireCell(day, minutes, 'clickCell')).click();\n }\n\n /** A cell's accessible name — the date, and the time for a slot. */\n async getCellLabel(day: Date, minutes = -1): Promise<string | null> {\n return (await this.requireCell(day, minutes, 'getCellLabel')).getAttribute('aria-label');\n }\n\n /** The chips inside ONE cell, which is where a chip's event starts. */\n async getCellChips(day: Date, minutes = -1): Promise<WrEventCalendarChipHarness[]> {\n const cell = await this.requireCell(day, minutes, 'getCellChips');\n const index = await cell.getAttribute('data-cell-index');\n return this.locatorForAll(WrEventCalendarChipHarness.with({ ancestor: `[data-cell-index=\"${index}\"]` }))();\n }\n\n /**\n * The grid's single tab stop, as `\"<day>:<minutes>\"`.\n *\n * The cursor roves rather than every cell being tabbable, and it is RAW — it\n * survives a view switch, so the same pair means a different cell in a month grid\n * and a week one.\n */\n async getCursor(): Promise<string | null> {\n for (const cell of await this.locatorForAll('.wr-event-calendar__cell')()) {\n if ((await cell.getAttribute('tabindex')) === '0') return cell.getAttribute('data-cell-index');\n }\n return null;\n }\n\n /** Move keyboard focus to a cell, which is also what moves the roving cursor onto it. */\n async focusCell(day: Date, minutes = -1): Promise<void> {\n await (await this.requireCell(day, minutes, 'focusCell')).focus();\n }\n\n /**\n * Press an arrow on the cell that currently holds the cursor.\n *\n * Sent to that cell rather than to the grid, because the component listens per cell\n * — the element carrying the keyboard should be the one that holds focus — and\n * anything originating inside a chip is deliberately let through untouched.\n */\n async pressArrow(arrow: Arrow): Promise<void> {\n await (await this.cursorCell('pressArrow')).sendKeys(ARROWS[arrow]);\n }\n\n /** Press Home on the cursor cell — the first day of its week. */\n async pressHome(): Promise<void> {\n await (await this.cursorCell('pressHome')).sendKeys(TestKey.HOME);\n }\n\n /** Press End on the cursor cell — the last day of its week. */\n async pressEnd(): Promise<void> {\n await (await this.cursorCell('pressEnd')).sendKeys(TestKey.END);\n }\n\n private async step(direction: 'prev' | 'next'): Promise<WrButtonHarness> {\n return this.locatorFor(WrButtonHarness.with({ selector: `.wr-event-calendar__step--${direction}` }))();\n }\n\n private async stepElement(direction: 'prev' | 'next'): Promise<TestElement> {\n return this.locatorFor(`.wr-event-calendar__step--${direction}`)();\n }\n\n private async headerButton(selector: string, method: string): Promise<WrButtonHarness> {\n const button = await this.locatorForOptional(WrButtonHarness.with({ selector }))();\n if (!button) {\n throw new Error(\n `WrEventCalendarHarness.${method}(): there is no header — this calendar was opened with ` +\n '`hideHeader`, so its navigation belongs to the page around it.'\n );\n }\n return button;\n }\n\n /**\n * The stamp a cell publishes for a day — local midnight, which is what the\n * component's own `startOfDay` produces. Taking a `Date` and normalising here keeps\n * the timestamp out of every spec.\n */\n private stamp(day: Date): number {\n return new Date(day.getFullYear(), day.getMonth(), day.getDate()).getTime();\n }\n\n private async requireCell(day: Date, minutes: number, method: string): Promise<TestElement> {\n const stamp = this.stamp(day);\n const cell = await this.locatorForOptional(`[data-cell-date=\"${stamp}\"][data-cell-minutes=\"${minutes}\"]`)();\n\n if (!cell) {\n throw new Error(\n `WrEventCalendarHarness.${method}(${day.toDateString()}, ${minutes}): no such cell in the ` +\n `${await this.getView()} view — it is not on screen, or \\`minutes\\` names no row. Pass -1 for a ` +\n 'month cell or the all-day band.'\n );\n }\n return cell;\n }\n\n private async cursorCell(method: string): Promise<TestElement> {\n for (const cell of await this.locatorForAll('.wr-event-calendar__cell')()) {\n if ((await cell.getAttribute('tabindex')) === '0') return cell;\n }\n throw new Error(\n `WrEventCalendarHarness.${method}(): no cell holds the roving cursor, so there is nothing to send a key ` +\n 'to. Call focusCell() first.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ARROWS"],"mappings":";;;AAAA;;;;;AAKG;AASH,MAAMA,QAAM,GAA2B;IACrC,IAAI,EAAE,OAAO,CAAC,UAAU;IACxB,KAAK,EAAE,OAAO,CAAC,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC,QAAQ;IACpB,IAAI,EAAE,OAAO,CAAC,UAAU;CACzB;AAED;;;;;;;;;;;;;;;;AAgBG;AACG,MAAO,0BAA2B,SAAQ,gBAAgB,CAAA;AAC9D,IAAA,OAAO,YAAY,GAAG,0BAA0B;;AAGhD,IAAA,OAAO,IAAI,CAAC,OAAA,GAA6C,EAAE,EAAA;AACzD,QAAA,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO;aAC5D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;aAC/G,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;aAC/G,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAK,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAChG;;AAGA,IAAA,MAAM,QAAQ,GAAA;AACZ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E,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IAC7E;AAEQ,IAAA,MAAM,WAAW,CAAC,GAAS,EAAE,OAAe,EAAE,MAAc,EAAA;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAC7B,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,CAAA,iBAAA,EAAoB,KAAK,CAAA,sBAAA,EAAyB,OAAO,CAAA,EAAA,CAAI,CAAC,EAAE;QAE3G,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,uBAAA,EAA0B,MAAM,CAAA,CAAA,EAAI,GAAG,CAAC,YAAY,EAAE,CAAA,EAAA,EAAK,OAAO,CAAA,uBAAA,CAAyB;AACzF,gBAAA,CAAA,EAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA,wEAAA,CAA0E;AACjG,gBAAA,iCAAiC,CACpC;QACH;AACA,QAAA,OAAO,IAAI;IACb;IAEQ,MAAM,UAAU,CAAC,MAAc,EAAA;AACrC,QAAA,KAAK,MAAM,IAAI,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,EAAE,EAAE;YACzE,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG;AAAE,gBAAA,OAAO,IAAI;QAChE;AACA,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,uBAAA,EAA0B,MAAM,CAAA,uEAAA,CAAyE;AACvG,YAAA,6BAA6B,CAChC;IACH;;;ACtVF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-event-calendar-testing.mjs","sources":["../../../projects/lib/event-calendar/testing/wr-event-calendar-chip-harness.ts","../../../projects/lib/event-calendar/testing/wr-event-calendar-harness.ts","../../../projects/lib/event-calendar/testing/ngwr-event-calendar-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrEventCalendarArrowKey, WrEventCalendarChipHarnessFilters } from './interfaces';\n\nconst ARROWS: Record<WrEventCalendarArrowKey, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for one event chip inside a {@link WrEventCalendarHarness}.\n *\n * **The visible text is `aria-hidden`; the name is on the button.** A chip prints a\n * time and a title for the eye, and publishes both as one `aria-label` for a screen\n * reader — so {@link getLabel} is what the control announces and {@link getTitle} is\n * what is drawn. They are separate because a consumer's `[wrCalendarEvent]` template\n * replaces the drawn half and not the announced one.\n *\n * **Moving and resizing are on the keyboard here, and not because of jsdom.** The\n * pointer drag is real, but the same two operations are bound to the arrows —\n * `Alt` to move, `Alt` + `Shift` to resize — precisely so the calendar is usable\n * without one. That is the path this harness drives; a synthetic drag would divide\n * by a rect that measures 0×0 anyway.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrEventCalendarChipHarness extends ComponentHarness {\n static hostSelector = '.wr-event-calendar__chip';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrEventCalendarChipHarnessFilters = {}): HarnessPredicate<WrEventCalendarChipHarness> {\n return new HarnessPredicate(WrEventCalendarChipHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('band', options.band, async (harness, band) => (await harness.isBand()) === band);\n }\n\n /** What the chip announces — its time and title in one string. */\n async getLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /**\n * The title as drawn, or `null` when a consumer template replaced it.\n *\n * The default chip prints its own `.wr-event-calendar__chip-title`; a\n * `[wrCalendarEvent]` template renders whatever the consumer wrote instead, and\n * there is no title element to find. {@link getText} is the fallback that always\n * answers.\n */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-event-calendar__chip-title')();\n return title ? title.text() : null;\n }\n\n /** The chip's whole rendered text, whoever drew it. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** The time as printed on a timed chip, or `null` on a band, which prints none. */\n async getTime(): Promise<string | null> {\n const time = await this.locatorForOptional('.wr-event-calendar__chip-time')();\n return time ? time.text() : null;\n }\n\n /**\n * Whether this is a day-spanning BAND rather than a timed chip.\n *\n * One shape covers two places — a month cell and the all-day row — and the other\n * is the block in a time grid. They size themselves completely differently (a\n * `calc()` width across columns versus a percentage height down one), which is why\n * the two are worth telling apart.\n */\n async isBand(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--band');\n }\n\n /** Whether the event started before this cell — the chip is drawn cut off at the leading edge. */\n async continuesBefore(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--continues-before');\n }\n\n /** Whether the event runs past this cell. */\n async continuesAfter(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--continues-after');\n }\n\n /** Whether the chip is mid-drag. */\n async isDragging(): Promise<boolean> {\n return (await this.host()).hasClass('wr-event-calendar__chip--dragging');\n }\n\n /**\n * Whether the chip offers a resize grab area.\n *\n * It is `aria-hidden` and not focusable on purpose — the same resize is `Alt` +\n * `Shift` + arrows on the chip itself, so a second tab stop here would lead\n * nowhere. Its\n * presence is still the mouse affordance, and it is dropped on a chip whose event\n * continues past this cell.\n */\n async hasResizeHandle(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__resize')()) !== null;\n }\n\n /**\n * Click the chip — which emits `eventClick` and does NOT bubble to the cell\n * underneath.\n *\n * On an editable calendar this needs `document.elementFromPoint` to exist: the CDK\n * dispatches a whole pointer sequence, and the chip's `pointerdown` hit-tests for\n * the cell under the cursor. jsdom implements no such method, so stub it in your\n * spec — `() => null` is the honest answer where nothing has a box — or the click\n * throws out of the listener.\n */\n async click(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Move keyboard focus to the chip. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the chip currently holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Move the event — `Alt` + an arrow, a day sideways or a slot vertically.\n *\n * The calendar never mutates `events`: this emits `eventChange` and the host is\n * expected to apply it. A spec whose host ignores the output is asserting a\n * CANCELLED move, which is the contract and the most common surprise here. A\n * calendar without `editable` ignores the keys entirely — the same gate the pointer\n * path uses.\n */\n async move(arrow: WrEventCalendarArrowKey): Promise<void> {\n await (await this.host()).sendKeys({ alt: true }, ARROWS[arrow]);\n }\n\n /**\n * Resize the event — `Alt` + `Shift` + an arrow, which moves the END alone.\n *\n * A resize that would end at or before the start emits nothing rather than\n * inverting the event, which is the pointer path's rule too.\n */\n async resize(arrow: WrEventCalendarArrowKey): Promise<void> {\n await (await this.host()).sendKeys({ alt: true, shift: true }, ARROWS[arrow]);\n }\n\n /** Press a bare arrow — which the chip ignores, letting the grid's own navigation run. */\n async pressArrow(arrow: WrEventCalendarArrowKey): Promise<void> {\n await (await this.host()).sendKeys(ARROWS[arrow]);\n }\n\n /** Press Escape — handing focus back to the cell the chip sits in. */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport { WrButtonHarness } from 'ngwr/button/testing';\nimport type { WrCalendarView } from 'ngwr/event-calendar';\n\nimport type {\n WrEventCalendarArrowKey,\n WrEventCalendarChipHarnessFilters,\n WrEventCalendarHarnessFilters,\n} from './interfaces';\nimport { WrEventCalendarChipHarness } from './wr-event-calendar-chip-harness';\n\nconst ARROWS: Record<WrEventCalendarArrowKey, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for `<wr-event-calendar>` — month, week and day in one component.\n *\n * **Every chip lives inside the `role=\"gridcell\"` where its event STARTS**, and\n * reaches out from there with a `calc()` width or a percentage height. That is a\n * deliberate structural choice — a floating events layer would leave `role=\"row\"`\n * owning something other than cells — and it is why {@link getChips} can be scoped\n * to a cell at all.\n *\n * **The view is read from the DOM, not from the input.** A month renders one grid\n * shape and week / day another, and those two are told apart by how many day columns\n * they draw. That is the honest answer for a harness: `view` is a model a consumer\n * can write, and the grid is what the user sees.\n *\n * **Nothing here mutates the events.** A move or a resize emits `eventChange` and\n * the host applies it — so a spec whose host ignores the output is asserting a\n * CANCELLED gesture, which is the contract rather than a bug.\n *\n * @example\n * ```ts\n * const calendar = await loader.getHarness(WrEventCalendarHarness);\n *\n * expect(await calendar.getView()).toBe('month');\n * const [standup] = await calendar.getChips({ title: 'Standup' });\n * await standup.move('right');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrEventCalendarHarness extends ComponentHarness {\n static hostSelector = 'wr-event-calendar';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrEventCalendarHarnessFilters = {}): HarnessPredicate<WrEventCalendarHarness> {\n return new HarnessPredicate(WrEventCalendarHarness, options)\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('view', options.view, async (harness, view) => (await harness.getView()) === view);\n }\n\n private readonly grid = this.locatorFor('.wr-event-calendar__grid');\n\n /**\n * Which view is on screen.\n *\n * `month` has its own grid modifier; `week` and `day` share the time grid and are\n * told apart by the column count the component publishes on it. Reading the DOM\n * rather than the `view` model is the point — that model is an input a consumer can\n * set to anything, and this is what got rendered.\n */\n async getView(): Promise<WrCalendarView> {\n const grid = await this.grid();\n if (await grid.hasClass('wr-event-calendar__grid--month')) return 'month';\n\n const columns = (await this.locatorForAll('.wr-event-calendar__colhead')()).length;\n return columns > 1 ? 'week' : 'day';\n }\n\n /** The header title — the month, the week's range, or the day. */\n async getTitle(): Promise<string> {\n return (await this.locatorFor('.wr-event-calendar__title')()).text();\n }\n\n /** Whether the header is rendered at all (`hideHeader`). */\n async hasHeader(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__header')()) !== null;\n }\n\n /** The grid's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.grid()).getAttribute('aria-label');\n }\n\n /** Step back one month, week or day, depending on the view. */\n async previous(): Promise<void> {\n await (await this.step('prev')).click();\n }\n\n /** Step forward one month, week or day. */\n async next(): Promise<void> {\n await (await this.step('next')).click();\n }\n\n /** Press the Today button — jumping to the period containing today. */\n async goToday(): Promise<void> {\n await (await this.headerButton('.wr-event-calendar__today', 'goToday')).click();\n }\n\n /** The back arrow's accessible name — the two steps are icon-only. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.stepElement('prev')).getAttribute('aria-label');\n }\n\n /** The forward arrow's accessible name. */\n async getNextLabel(): Promise<string | null> {\n return (await this.stepElement('next')).getAttribute('aria-label');\n }\n\n /** The Today button's label. */\n async getTodayLabel(): Promise<string> {\n return (await this.headerButton('.wr-event-calendar__today', 'getTodayLabel')).getText();\n }\n\n /**\n * The view switcher's labels, in order — empty when the calendar was given a single\n * view, which drops the switcher entirely.\n */\n async getViewLabels(): Promise<string[]> {\n const buttons = await this.locatorForAll(WrButtonHarness.with({ selector: '.wr-event-calendar__view' }))();\n return Promise.all(buttons.map(button => button.getText()));\n }\n\n /** The label of the view currently pressed, or `null` when there is no switcher. */\n async getActiveViewLabel(): Promise<string | null> {\n for (const button of await this.locatorForAll('.wr-event-calendar__view')()) {\n if ((await button.getAttribute('aria-pressed')) === 'true') return button.text();\n }\n return null;\n }\n\n /**\n * Switch view by the label the switcher prints.\n *\n * By label rather than by the `WrCalendarView` value, because the label is what the\n * DOM has — the value never reaches it, and a spec that passed one would be naming\n * something only the component can see. {@link getViewLabels} lists them.\n */\n async setView(label: string): Promise<void> {\n for (const button of await this.locatorForAll('.wr-event-calendar__view')()) {\n if ((await button.text()) === label) {\n await button.click();\n return;\n }\n }\n throw new Error(\n `WrEventCalendarHarness.setView(\"${label}\"): the switcher offers: ` +\n `${(await this.getViewLabels()).join(', ')}.`\n );\n }\n\n /** The weekday column headers of the month view. */\n async getWeekdayNames(): Promise<string[]> {\n const names = await this.locatorForAll('.wr-event-calendar__weekday')();\n return Promise.all(names.map(name => name.text()));\n }\n\n /** The day numbers of the month grid, in order — 42 of them, spill days included. */\n async getDayNumbers(): Promise<string[]> {\n const days = await this.locatorForAll('.wr-event-calendar__daynum')();\n return Promise.all(days.map(day => day.text()));\n }\n\n /** The time-gutter labels down the left of a week or day view. */\n async getSlotLabels(): Promise<string[]> {\n const gutters = await this.locatorForAll('.wr-event-calendar__row .wr-event-calendar__gutter')();\n return Promise.all(gutters.map(gutter => gutter.text()));\n }\n\n /** Whether the time views drew an all-day band, which they only do when something needs it. */\n async hasAllDayRow(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-event-calendar__row--allday')()) !== null;\n }\n\n /**\n * Every chip on screen, in DOM order.\n *\n * A multi-day event has ONE chip, in the cell where it starts — the band reaches\n * across the rest — so this counts events-in-view rather than event-days.\n */\n async getChips(filters: WrEventCalendarChipHarnessFilters = {}): Promise<WrEventCalendarChipHarness[]> {\n return this.locatorForAll(WrEventCalendarChipHarness.with(filters))();\n }\n\n /** The chips' announced names, in DOM order. */\n async getChipLabels(): Promise<(string | null)[]> {\n const chips = await this.getChips();\n return Promise.all(chips.map(chip => chip.getLabel()));\n }\n\n /**\n * The \"+N more\" overflow buttons of the month view, by the text they print.\n *\n * A month cell shows `maxLanes` chips and hides the rest behind one of these, which\n * opens the day view — so its presence is the only sign that a cell has more than\n * it is showing.\n */\n async getOverflowLabels(): Promise<string[]> {\n const more = await this.locatorForAll('.wr-event-calendar__more')();\n return Promise.all(more.map(button => button.text()));\n }\n\n /** Click the first \"+N more\" button, which drops to the day view for that date. */\n async openOverflow(): Promise<void> {\n const [more] = await this.locatorForAll('.wr-event-calendar__more')();\n if (!more) {\n throw new Error(\n 'WrEventCalendarHarness.openOverflow(): no cell is overflowing. A month cell only draws the button ' +\n 'once it has more events than `maxLanes` lets it show.'\n );\n }\n await more.click();\n }\n\n /**\n * Click an empty part of a cell — which emits `slotClick` with its date and minutes.\n *\n * A cell is addressed by its DAY and, in a time view, the minutes from midnight of\n * its row (`-1` means a month cell or the all-day band). Both come off the two data\n * attributes every cell publishes for the drag's own hit-testing, which makes them\n * the one stable way to name a cell from outside — a row index would mean something\n * different in each view.\n */\n async clickCell(day: Date, minutes = -1): Promise<void> {\n await (await this.requireCell(day, minutes, 'clickCell')).click();\n }\n\n /** A cell's accessible name — the date, and the time for a slot. */\n async getCellLabel(day: Date, minutes = -1): Promise<string | null> {\n return (await this.requireCell(day, minutes, 'getCellLabel')).getAttribute('aria-label');\n }\n\n /** The chips inside ONE cell, which is where a chip's event starts. */\n async getCellChips(day: Date, minutes = -1): Promise<WrEventCalendarChipHarness[]> {\n const cell = await this.requireCell(day, minutes, 'getCellChips');\n const index = await cell.getAttribute('data-cell-index');\n return this.locatorForAll(WrEventCalendarChipHarness.with({ ancestor: `[data-cell-index=\"${index}\"]` }))();\n }\n\n /**\n * The grid's single tab stop, as `\"<day>:<minutes>\"`.\n *\n * The cursor roves rather than every cell being tabbable, and it is RAW — it\n * survives a view switch, so the same pair means a different cell in a month grid\n * and a week one.\n */\n async getCursor(): Promise<string | null> {\n for (const cell of await this.locatorForAll('.wr-event-calendar__cell')()) {\n if ((await cell.getAttribute('tabindex')) === '0') return cell.getAttribute('data-cell-index');\n }\n return null;\n }\n\n /** Move keyboard focus to a cell, which is also what moves the roving cursor onto it. */\n async focusCell(day: Date, minutes = -1): Promise<void> {\n await (await this.requireCell(day, minutes, 'focusCell')).focus();\n }\n\n /**\n * Press an arrow on the cell that currently holds the cursor.\n *\n * Sent to that cell rather than to the grid, because the component listens per cell\n * — the element carrying the keyboard should be the one that holds focus — and\n * anything originating inside a chip is deliberately let through untouched.\n */\n async pressArrow(arrow: WrEventCalendarArrowKey): Promise<void> {\n await (await this.cursorCell('pressArrow')).sendKeys(ARROWS[arrow]);\n }\n\n /** Press Home on the cursor cell — the first day of its week. */\n async pressHome(): Promise<void> {\n await (await this.cursorCell('pressHome')).sendKeys(TestKey.HOME);\n }\n\n /** Press End on the cursor cell — the last day of its week. */\n async pressEnd(): Promise<void> {\n await (await this.cursorCell('pressEnd')).sendKeys(TestKey.END);\n }\n\n private async step(direction: 'prev' | 'next'): Promise<WrButtonHarness> {\n return this.locatorFor(WrButtonHarness.with({ selector: `.wr-event-calendar__step--${direction}` }))();\n }\n\n private async stepElement(direction: 'prev' | 'next'): Promise<TestElement> {\n return this.locatorFor(`.wr-event-calendar__step--${direction}`)();\n }\n\n private async headerButton(selector: string, method: string): Promise<WrButtonHarness> {\n const button = await this.locatorForOptional(WrButtonHarness.with({ selector }))();\n if (!button) {\n throw new Error(\n `WrEventCalendarHarness.${method}(): there is no header — this calendar was opened with ` +\n '`hideHeader`, so its navigation belongs to the page around it.'\n );\n }\n return button;\n }\n\n /**\n * The stamp a cell publishes for a day — local midnight, which is what the\n * component's own `startOfDay` produces. Taking a `Date` and normalising here keeps\n * the timestamp out of every spec.\n */\n private stamp(day: Date): number {\n return new Date(day.getFullYear(), day.getMonth(), day.getDate()).getTime();\n }\n\n private async requireCell(day: Date, minutes: number, method: string): Promise<TestElement> {\n const stamp = this.stamp(day);\n const cell = await this.locatorForOptional(`[data-cell-date=\"${stamp}\"][data-cell-minutes=\"${minutes}\"]`)();\n\n if (!cell) {\n throw new Error(\n `WrEventCalendarHarness.${method}(${day.toDateString()}, ${minutes}): no such cell in the ` +\n `${await this.getView()} view — it is not on screen, or \\`minutes\\` names no row. Pass -1 for a ` +\n 'month cell or the all-day band.'\n );\n }\n return cell;\n }\n\n private async cursorCell(method: string): Promise<TestElement> {\n for (const cell of await this.locatorForAll('.wr-event-calendar__cell')()) {\n if ((await cell.getAttribute('tabindex')) === '0') return cell;\n }\n throw new Error(\n `WrEventCalendarHarness.${method}(): no cell holds the roving cursor, so there is nothing to send a key ` +\n 'to. Call focusCell() first.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ARROWS"],"mappings":";;;AAAA;;;;;AAKG;AAMH,MAAMA,QAAM,GAA6C;IACvD,IAAI,EAAE,OAAO,CAAC,UAAU;IACxB,KAAK,EAAE,OAAO,CAAC,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC,QAAQ;IACpB,IAAI,EAAE,OAAO,CAAC,UAAU;CACzB;AAED;;;;;;;;;;;;;;;;AAgBG;AACG,MAAO,0BAA2B,SAAQ,gBAAgB,CAAA;AAC9D,IAAA,OAAO,YAAY,GAAG,0BAA0B;;AAGhD,IAAA,OAAO,IAAI,CAAC,OAAA,GAA6C,EAAE,EAAA;AACzD,QAAA,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO;aAC5D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;aAC/G,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;aAC/G,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAK,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAChG;;AAGA,IAAA,M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AAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IAC7E;AAEQ,IAAA,MAAM,WAAW,CAAC,GAAS,EAAE,OAAe,EAAE,MAAc,EAAA;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAC7B,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,CAAA,iBAAA,EAAoB,KAAK,CAAA,sBAAA,EAAyB,OAAO,CAAA,EAAA,CAAI,CAAC,EAAE;QAE3G,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,uBAAA,EAA0B,MAAM,CAAA,CAAA,EAAI,GAAG,CAAC,YAAY,EAAE,CAAA,EAAA,EAAK,OAAO,CAAA,uBAAA,CAAyB;AACzF,gBAAA,CAAA,EAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA,wEAAA,CAA0E;AACjG,gBAAA,iCAAiC,CACpC;QACH;AACA,QAAA,OAAO,IAAI;IACb;IAEQ,MAAM,UAAU,CAAC,MAAc,EAAA;AACrC,QAAA,KAAK,MAAM,IAAI,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,EAAE,EAAE;YACzE,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG;AAAE,gBAAA,OAAO,IAAI;QAChE;AACA,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,uBAAA,EAA0B,MAAM,CAAA,uEAAA,CAAyE;AACvG,YAAA,6BAA6B,CAChC;IACH;;;ACvVF;;AAEG;;;;"}
|
|
@@ -787,7 +787,7 @@ class WrEventCalendar {
|
|
|
787
787
|
return key;
|
|
788
788
|
}
|
|
789
789
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrEventCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
790
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrEventCalendar, isStandalone: true, selector: "wr-event-calendar", inputs: { events: { classPropertyName: "events", publicName: "events", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, slotMinutes: { classPropertyName: "slotMinutes", publicName: "slotMinutes", isSignal: true, isRequired: false, transformFunction: null }, dayStartHour: { classPropertyName: "dayStartHour", publicName: "dayStartHour", isSignal: true, isRequired: false, transformFunction: null }, dayEndHour: { classPropertyName: "dayEndHour", publicName: "dayEndHour", isSignal: true, isRequired: false, transformFunction: null }, maxLanes: { classPropertyName: "maxLanes", publicName: "maxLanes", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { view: "viewChange", date: "dateChange", eventClick: "eventClick", slotClick: "slotClick", eventChange: "eventChange" }, host: { listeners: { "pointerup": "onPointerUp($event)", "pointercancel": "drag.set(null)" }, properties: { "class": "classes()" } }, queries: [{ propertyName: "chipTpl", first: true, predicate: WrCalendarEventTemplate, descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there \u2014 `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ todayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"timeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div role=\"row\" class=\"wr-event-calendar__row wr-event-calendar__row--allday\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ allDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.height.%]=\"chip.height\"\n [style.inset-inline-start.%]=\"chip.inlineStart\"\n [style.width.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WrButton, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "shape", "icon", "iconPosition", "disabled", "outlined", "block", "loading", "isDisabledWhenLoading"] }, { kind: "component", type: WrButtonGroup, selector: "wr-btn-group", inputs: ["shape"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
790
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrEventCalendar, isStandalone: true, selector: "wr-event-calendar", inputs: { events: { classPropertyName: "events", publicName: "events", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, slotMinutes: { classPropertyName: "slotMinutes", publicName: "slotMinutes", isSignal: true, isRequired: false, transformFunction: null }, dayStartHour: { classPropertyName: "dayStartHour", publicName: "dayStartHour", isSignal: true, isRequired: false, transformFunction: null }, dayEndHour: { classPropertyName: "dayEndHour", publicName: "dayEndHour", isSignal: true, isRequired: false, transformFunction: null }, maxLanes: { classPropertyName: "maxLanes", publicName: "maxLanes", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { view: "viewChange", date: "dateChange", eventClick: "eventClick", slotClick: "slotClick", eventChange: "eventChange" }, host: { listeners: { "pointerup": "onPointerUp($event)", "pointercancel": "drag.set(null)" }, properties: { "class": "classes()" } }, queries: [{ propertyName: "chipTpl", first: true, predicate: WrCalendarEventTemplate, descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there \u2014 `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ todayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"timeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div role=\"row\" class=\"wr-event-calendar__row wr-event-calendar__row--allday\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ allDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.aria-label]=\"cell.label\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.height.%]=\"chip.height\"\n [style.inset-inline-start.%]=\"chip.inlineStart\"\n [style.width.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WrButton, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "shape", "icon", "iconPosition", "disabled", "outlined", "block", "loading", "disabledWhenLoading"] }, { kind: "component", type: WrButtonGroup, selector: "wr-btn-group", inputs: ["shape"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
791
791
|
}
|
|
792
792
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrEventCalendar, decorators: [{
|
|
793
793
|
type: Component,
|