@cdevhub/ngx-tw 0.5.0 → 0.6.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 +78 -15
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +16 -5
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +26 -15
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +17 -5
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +27 -6
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +23 -11
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +5 -5
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +427 -122
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +21 -11
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +215 -96
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +108 -64
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +18 -6
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +55 -30
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs +218 -0
- package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +236 -211
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs +200 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +34 -7
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +135 -15
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs +203 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +160 -102
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs +209 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +182 -107
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs +122 -0
- package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +11 -2
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs +149 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +57 -67
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +42 -24
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +114 -21
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +16 -6
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +52 -61
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +18 -3
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs +168 -0
- package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +58 -21
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +34 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +95 -45
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +81 -32
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +131 -98
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +207 -42
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs +165 -0
- package/fesm2022/cdevhub-ngx-tw-select-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-select.mjs +386 -210
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs → cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs} +3 -3
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs +129 -0
- package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +23 -7
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +89 -54
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +122 -17
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -19
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +63 -25
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +35 -8
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +54 -48
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +12 -15
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +74 -13
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +84 -30
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs +172 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +107 -71
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +41 -9
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +257 -45
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs +201 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +184 -77
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +110 -27
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/{cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs → cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs} +107 -19
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +21 -13
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +102 -15
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs +219 -0
- package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +88 -69
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +68 -19
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -1
- package/index.json +1 -1
- package/package.json +63 -2
- package/theme/_base.css +13 -0
- package/theme/_dark.css +110 -36
- package/theme/_high-contrast-dark.css +367 -0
- package/theme/_high-contrast.css +13 -2
- package/theme/_light.css +276 -0
- package/theme/_semantic.css +47 -12
- package/theme/_typography.css +17 -0
- package/theme/index.css +86 -7
- package/types/cdevhub-ngx-tw-accordion.d.ts +12 -4
- package/types/cdevhub-ngx-tw-avatar.d.ts +10 -3
- package/types/cdevhub-ngx-tw-button.d.ts +1 -0
- package/types/cdevhub-ngx-tw-calendar-luxon.d.ts +2 -2
- package/types/cdevhub-ngx-tw-calendar-testing.d.ts +1 -1
- package/types/cdevhub-ngx-tw-calendar.d.ts +179 -73
- package/types/cdevhub-ngx-tw-card.d.ts +11 -3
- package/types/cdevhub-ngx-tw-carousel.d.ts +89 -20
- package/types/cdevhub-ngx-tw-checkbox.d.ts +40 -12
- package/types/cdevhub-ngx-tw-code-block.d.ts +11 -2
- package/types/cdevhub-ngx-tw-collapsible.d.ts +32 -5
- package/types/cdevhub-ngx-tw-combobox-testing.d.ts +157 -0
- package/types/cdevhub-ngx-tw-combobox.d.ts +94 -53
- package/types/cdevhub-ngx-tw-command-palette-testing.d.ts +136 -0
- package/types/cdevhub-ngx-tw-command-palette.d.ts +33 -5
- package/types/cdevhub-ngx-tw-core.d.ts +152 -21
- package/types/cdevhub-ngx-tw-date-picker-testing.d.ts +141 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +37 -29
- package/types/cdevhub-ngx-tw-date-range-picker-testing.d.ts +148 -0
- package/types/cdevhub-ngx-tw-date-range-picker.d.ts +36 -29
- package/types/cdevhub-ngx-tw-dialog-testing.d.ts +98 -0
- package/types/cdevhub-ngx-tw-dialog.d.ts +12 -3
- package/types/cdevhub-ngx-tw-file-upload-testing.d.ts +120 -0
- package/types/cdevhub-ngx-tw-file-upload.d.ts +8 -10
- package/types/cdevhub-ngx-tw-flip-card.d.ts +18 -11
- package/types/cdevhub-ngx-tw-form-field.d.ts +19 -2
- package/types/cdevhub-ngx-tw-icon.d.ts +3 -3
- package/types/cdevhub-ngx-tw-input.d.ts +5 -8
- package/types/cdevhub-ngx-tw-item.d.ts +2 -0
- package/types/cdevhub-ngx-tw-menu-testing.d.ts +131 -0
- package/types/cdevhub-ngx-tw-menu.d.ts +2 -2
- package/types/cdevhub-ngx-tw-number-input.d.ts +20 -0
- package/types/cdevhub-ngx-tw-paginator.d.ts +58 -24
- package/types/cdevhub-ngx-tw-popover.d.ts +41 -10
- package/types/cdevhub-ngx-tw-progress-bar.d.ts +1 -1
- package/types/cdevhub-ngx-tw-radio.d.ts +68 -25
- package/types/cdevhub-ngx-tw-segmented-control.d.ts +79 -16
- package/types/cdevhub-ngx-tw-select-testing.d.ts +114 -0
- package/types/cdevhub-ngx-tw-select.d.ts +104 -33
- package/types/cdevhub-ngx-tw-sheet-testing.d.ts +104 -0
- package/types/cdevhub-ngx-tw-sheet.d.ts +19 -3
- package/types/cdevhub-ngx-tw-slider.d.ts +79 -25
- package/types/cdevhub-ngx-tw-sort.d.ts +45 -4
- package/types/cdevhub-ngx-tw-split.d.ts +32 -2
- package/types/cdevhub-ngx-tw-stat.d.ts +14 -4
- package/types/cdevhub-ngx-tw-stepper.d.ts +16 -2
- package/types/cdevhub-ngx-tw-switch.d.ts +35 -13
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +7 -6
- package/types/cdevhub-ngx-tw-table.d.ts +53 -10
- package/types/cdevhub-ngx-tw-tabs.d.ts +41 -10
- package/types/cdevhub-ngx-tw-tags-input-testing.d.ts +135 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +26 -11
- package/types/cdevhub-ngx-tw-textarea.d.ts +3 -2
- package/types/cdevhub-ngx-tw-theme.d.ts +245 -39
- package/types/cdevhub-ngx-tw-time-picker-testing.d.ts +129 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +76 -19
- package/types/cdevhub-ngx-tw-timeline.d.ts +36 -12
- package/types/cdevhub-ngx-tw-toast.d.ts +20 -6
- package/types/cdevhub-ngx-tw-tooltip.d.ts +28 -6
- package/types/cdevhub-ngx-tw-transfer-testing.d.ts +152 -0
- package/types/cdevhub-ngx-tw-transfer.d.ts +21 -8
- package/types/cdevhub-ngx-tw-tree.d.ts +6 -1
- package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-ByyNluUd.mjs.map +0 -1
- package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-DSu4YoTy.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CdkDialogContainer, Dialog, DialogConfig } from '@angular/cdk/dialog';
|
|
2
2
|
import { createBlockScrollStrategy, createNoopScrollStrategy, createRepositionScrollStrategy, createCloseScrollStrategy, createGlobalPositionStrategy } from '@angular/cdk/overlay';
|
|
3
|
-
import { SheetRef,
|
|
3
|
+
import { SheetRef, TW_SHEET_DATA, SheetConfig } from './cdevhub-ngx-tw-sheet.mjs';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
6
|
import { CdkPortalOutlet } from '@angular/cdk/portal';
|
|
@@ -215,7 +215,7 @@ function openRenderedSheet(injector, content, merged, sheetRef) {
|
|
|
215
215
|
sheetRef._attach(cdkRef, container);
|
|
216
216
|
const providers = [
|
|
217
217
|
{ provide: SheetRef, useValue: sheetRef },
|
|
218
|
-
{ provide:
|
|
218
|
+
{ provide: TW_SHEET_DATA, useValue: merged.data ?? null },
|
|
219
219
|
];
|
|
220
220
|
if (Array.isArray(merged.providers))
|
|
221
221
|
providers.push(...merged.providers);
|
|
@@ -253,4 +253,4 @@ function resolvePositionStrategy(injector, side) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
export { openRenderedSheet };
|
|
256
|
-
//# sourceMappingURL=cdevhub-ngx-tw-sheet-sheet-renderer-
|
|
256
|
+
//# sourceMappingURL=cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs","sources":["../../../projects/ngx-tw/sheet/sheet-container.ts","../../../projects/ngx-tw/sheet/sheet-renderer.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n type EventEmitter,\n inject,\n type Signal,\n ViewEncapsulation,\n computed,\n} from '@angular/core';\nimport { CdkDialogContainer } from '@angular/cdk/dialog';\nimport { CdkPortalOutlet } from '@angular/cdk/portal';\nimport {\n coerceOverlayDuration,\n mergeOverlayPanelClass,\n OverlayContainerCoordinator,\n type OverlayContainerAnimationEvent,\n type OverlayContainerState,\n} from '@cdevhub/ngx-tw/core';\nimport { tv } from 'tailwind-variants';\nimport { type SheetConfig } from './sheet-config';\n\n/** Lifecycle states a sheet passes through. */\nexport type SheetState = OverlayContainerState;\n\n/** Event emitted when the sheet's animation state transitions. */\nexport type SheetAnimationEvent = OverlayContainerAnimationEvent;\n\n// Sheet uses a `data-[state]` + `data-[side]` driven CSS transition rather than\n// the project's `animate.enter`/`animate.leave` keyframes. Same rationale as\n// the dialog container (see `dialog-container.ts`):\n// 1. The ref owns the open/close lifecycle (state signal, observables) and\n// needs runtime-configurable enter/exit durations per `Sheet.open()` call\n// — `animate.enter` only accepts a static class name.\n// 2. The transform direction depends on `side`, and encoding four pairs of\n// keyframe classes (slide-in/out × 4 sides) is noisier than four\n// `data-[side=…]` selectors on a single transition rule.\n// All other library overlays (popover, menu, tooltip) use animate.enter/leave;\n// this divergence is intentional and isolated to the sheet container.\nconst sheetContainerVariants = tv(\n {\n slots: {\n host: 'fixed flex flex-col outline-none bg-surface-raised text-fg shadow-md overflow-hidden transition-[transform,opacity] ease-out motion-reduce:transition-none opacity-0 data-[state=open]:opacity-100',\n },\n variants: {\n side: {\n right: {\n host: 'h-screen right-0 top-0 border-l border-border data-[state=opening]:translate-x-full data-[state=closing]:translate-x-full data-[state=open]:translate-x-0',\n },\n left: {\n host: 'h-screen left-0 top-0 border-r border-border data-[state=opening]:-translate-x-full data-[state=closing]:-translate-x-full data-[state=open]:translate-x-0',\n },\n top: {\n host: 'w-screen left-0 top-0 border-b border-border data-[state=opening]:-translate-y-full data-[state=closing]:-translate-y-full data-[state=open]:translate-y-0',\n },\n bottom: {\n host: 'w-screen left-0 bottom-0 border-t border-border data-[state=opening]:translate-y-full data-[state=closing]:translate-y-full data-[state=open]:translate-y-0',\n },\n },\n size: {\n xs: { host: '' },\n sm: { host: '' },\n md: { host: '' },\n lg: { host: '' },\n xl: { host: '' },\n full: { host: '' },\n },\n },\n // Sheets are axis-aware: `size` controls width on horizontal sides and\n // height on vertical sides. Encoded as compound variants so a single\n // {side, size} pair resolves to one set of utility classes.\n compoundVariants: [\n // ── Right-anchored ─────────────────────────────────────────────\n { side: 'right', size: 'xs', class: { host: 'w-full max-w-xs' } },\n { side: 'right', size: 'sm', class: { host: 'w-full max-w-sm' } },\n { side: 'right', size: 'md', class: { host: 'w-full max-w-md' } },\n { side: 'right', size: 'lg', class: { host: 'w-full max-w-xl' } },\n { side: 'right', size: 'xl', class: { host: 'w-full max-w-2xl' } },\n { side: 'right', size: 'full', class: { host: 'w-screen max-w-none' } },\n // ── Left-anchored ──────────────────────────────────────────────\n { side: 'left', size: 'xs', class: { host: 'w-full max-w-xs' } },\n { side: 'left', size: 'sm', class: { host: 'w-full max-w-sm' } },\n { side: 'left', size: 'md', class: { host: 'w-full max-w-md' } },\n { side: 'left', size: 'lg', class: { host: 'w-full max-w-xl' } },\n { side: 'left', size: 'xl', class: { host: 'w-full max-w-2xl' } },\n { side: 'left', size: 'full', class: { host: 'w-screen max-w-none' } },\n // ── Top-anchored ───────────────────────────────────────────────\n { side: 'top', size: 'xs', class: { host: 'h-[20vh]' } },\n { side: 'top', size: 'sm', class: { host: 'h-[33vh]' } },\n { side: 'top', size: 'md', class: { host: 'h-[50vh]' } },\n { side: 'top', size: 'lg', class: { host: 'h-[66vh]' } },\n { side: 'top', size: 'xl', class: { host: 'h-[80vh]' } },\n { side: 'top', size: 'full', class: { host: 'h-screen' } },\n // ── Bottom-anchored ────────────────────────────────────────────\n { side: 'bottom', size: 'xs', class: { host: 'h-[20vh]' } },\n { side: 'bottom', size: 'sm', class: { host: 'h-[33vh]' } },\n { side: 'bottom', size: 'md', class: { host: 'h-[50vh]' } },\n { side: 'bottom', size: 'lg', class: { host: 'h-[66vh]' } },\n { side: 'bottom', size: 'xl', class: { host: 'h-[80vh]' } },\n { side: 'bottom', size: 'full', class: { host: 'h-screen' } },\n ],\n defaultVariants: { side: 'right', size: 'md' },\n },\n { twMerge: true },\n);\n\n/**\n * Sheet container rendered inside the CDK overlay. Wraps the user-provided\n * content in a Tailwind-styled, edge-anchored surface and coordinates slide\n * enter/exit transitions with {@link SheetRef}.\n *\n * The animation state machine, `aria-describedby` queue, and panel-class\n * merge are shared with `DialogContainer` via {@link OverlayContainerCoordinator}\n * (component-scoped — see `providers: [OverlayContainerCoordinator]`).\n *\n * @docs-private\n */\n@Component({\n selector: 'tw-sheet-container',\n template: '<ng-template cdkPortalOutlet />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CdkPortalOutlet],\n providers: [OverlayContainerCoordinator],\n host: {\n tabindex: '-1',\n '[attr.id]': '_config.id || null',\n '[attr.role]': '_config.role',\n '[attr.aria-modal]': '_config.ariaModal',\n '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledByQueue[0]',\n '[attr.aria-label]': '_config.ariaLabel',\n '[attr.aria-describedby]': 'ariaDescribedByAttr()',\n '[attr.data-state]': 'state()',\n '[attr.data-side]': 'sideAttr()',\n '[class]': 'hostClasses()',\n '[style.transition-duration.ms]': 'transitionDuration()',\n },\n})\nexport class SheetContainer extends CdkDialogContainer<SheetConfig> {\n private readonly coordinator = inject(OverlayContainerCoordinator);\n\n /** Lifecycle state of the sheet's enter/exit animation. */\n readonly state: Signal<SheetState> = this.coordinator.state;\n\n /** Emits whenever the animation state transitions. */\n readonly animationStateChanged: EventEmitter<SheetAnimationEvent> =\n this.coordinator.animationStateChanged;\n\n /** Resolved enter-animation duration in ms. */\n readonly enterAnimationDuration: number;\n /** Resolved exit-animation duration in ms. */\n readonly exitAnimationDuration: number;\n\n protected readonly sideAttr = computed(() => this._config.side ?? 'right');\n\n private readonly variants = computed(() => {\n const side = this._config.side ?? 'right';\n const size = this._config.size ?? 'md';\n return sheetContainerVariants({ side, size });\n });\n\n protected readonly hostClasses = computed(() =>\n mergeOverlayPanelClass(this.variants().host(), this._config.panelClass),\n );\n\n protected readonly ariaDescribedByAttr = computed(\n () =>\n this._config.ariaDescribedBy ||\n this.coordinator.describedByIds()[0] ||\n null,\n );\n\n protected readonly transitionDuration = this.coordinator.transitionDuration;\n\n constructor() {\n super();\n this.enterAnimationDuration = coerceOverlayDuration(this._config.enterAnimationDuration, 200);\n this.exitAnimationDuration = coerceOverlayDuration(this._config.exitAnimationDuration, 160);\n this.coordinator.setDurations(this.enterAnimationDuration, this.exitAnimationDuration);\n }\n\n protected override _contentAttached(): void {\n super._contentAttached();\n this.coordinator.startEnterAnimation();\n }\n\n /** Triggered by the sheet ref to play the exit transition before disposing the overlay. */\n _startExitAnimation(): void {\n this.coordinator.startExitAnimation();\n }\n\n /** Registers a description id for the container's `aria-describedby`. */\n _addAriaDescribedBy(id: string): void {\n this.coordinator.addAriaDescribedBy(id);\n }\n\n /** Removes a previously registered description id. */\n _removeAriaDescribedBy(id: string): void {\n this.coordinator.removeAriaDescribedBy(id);\n }\n}\n","import {\n type ComponentRef,\n type Injector,\n type StaticProvider,\n type TemplateRef,\n} from '@angular/core';\nimport { Dialog, DialogConfig as CdkDialogConfig } from '@angular/cdk/dialog';\nimport {\n createBlockScrollStrategy,\n createCloseScrollStrategy,\n createGlobalPositionStrategy,\n createNoopScrollStrategy,\n createRepositionScrollStrategy,\n type GlobalPositionStrategy,\n type ScrollStrategy,\n} from '@angular/cdk/overlay';\nimport type { ComponentType } from '@angular/cdk/portal';\nimport {\n TW_SHEET_DATA,\n SheetConfig,\n type SheetScrollStrategy,\n type SheetSide,\n} from './sheet-config';\nimport { SheetContainer } from './sheet-container';\nimport { SheetRef } from './sheet-ref';\n\n/**\n * Rendering half of the sheet feature: the only module that pulls in\n * `@angular/cdk/dialog`, the overlay position/scroll strategies, and the\n * Tailwind `SheetContainer`. Reached exclusively through a dynamic `import()`\n * in {@link Sheet}, which keeps that graph out of a consumer's initial bundle.\n * Nothing here may be imported as a value from `sheet.ts`.\n *\n * @docs-private\n */\nexport function openRenderedSheet<R, D, C>(\n injector: Injector,\n content: ComponentType<C> | TemplateRef<C>,\n merged: SheetConfig<D, R>,\n sheetRef: SheetRef<R, C>,\n): void {\n // `Dialog` is `providedIn: 'root'`, so resolving it here — rather than\n // injecting it into the service — keeps the CDK symbol in this lazy chunk.\n const cdkDialog = injector.get(Dialog);\n\n const cdkRef = cdkDialog.open<R, D, C>(content, {\n id: merged.id,\n role: merged.role,\n data: merged.data,\n panelClass: merged.panelClass,\n backdropClass: merged.backdropClass || 'tw-sheet-backdrop',\n hasBackdrop: merged.hasBackdrop,\n // Sheet sizing happens on the container element (axis-aware width/height\n // utilities). The overlay pane itself is the full-edge bounding box.\n direction: merged.direction,\n ariaDescribedBy: merged.ariaDescribedBy,\n ariaLabelledBy: merged.ariaLabelledBy,\n ariaLabel: merged.ariaLabel,\n ariaModal: merged.ariaModal,\n autoFocus: merged.autoFocus,\n restoreFocus: merged.restoreFocus,\n scrollStrategy:\n merged.scrollStrategy ?? resolveScrollStrategy(injector, merged.scrollBehavior),\n positionStrategy:\n merged.positionStrategy ?? resolvePositionStrategy(injector, merged.side ?? 'right'),\n closeOnNavigation: merged.closeOnNavigation,\n viewContainerRef: merged.viewContainerRef,\n injector: merged.injector,\n // We handle close/Escape/backdrop ourselves so we can run the exit slide animation.\n disableClose: true,\n closeOnOverlayDetachments: false,\n container: {\n type: SheetContainer,\n providers: () => [\n { provide: SheetConfig, useValue: merged },\n { provide: CdkDialogConfig, useValue: merged },\n ],\n },\n providers: (cdkRef, _cdkConfig, container) => {\n sheetRef._attach(cdkRef, container as SheetContainer);\n const providers: StaticProvider[] = [\n { provide: SheetRef, useValue: sheetRef },\n { provide: TW_SHEET_DATA, useValue: merged.data ?? null },\n ];\n if (Array.isArray(merged.providers)) providers.push(...merged.providers);\n return providers;\n },\n });\n\n sheetRef._setComponent(\n cdkRef.componentInstance as C | null,\n cdkRef.componentRef as ComponentRef<C> | null,\n );\n}\n\nfunction resolveScrollStrategy(\n injector: Injector,\n strategy: SheetScrollStrategy | undefined,\n): ScrollStrategy {\n switch (strategy) {\n case 'close':\n return createCloseScrollStrategy(injector);\n case 'reposition':\n return createRepositionScrollStrategy(injector);\n case 'noop':\n return createNoopScrollStrategy();\n case 'block':\n default:\n return createBlockScrollStrategy(injector);\n }\n}\n\nfunction resolvePositionStrategy(injector: Injector, side: SheetSide): GlobalPositionStrategy {\n const strategy = createGlobalPositionStrategy(injector);\n switch (side) {\n case 'left':\n return strategy.top('0').left('0').bottom('0');\n case 'top':\n return strategy.top('0').left('0').right('0');\n case 'bottom':\n return strategy.bottom('0').left('0').right('0');\n case 'right':\n default:\n return strategy.top('0').right('0').bottom('0');\n }\n}\n"],"names":["CdkDialogConfig"],"mappings":";;;;;;;;;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,sBAAsB,GAAG,EAAE,CAC/B;AACE,IAAA,KAAK,EAAE;AACL,QAAA,IAAI,EAAE,oMAAoM;AAC3M,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,2JAA2J;AAClK,aAAA;AACD,YAAA,IAAI,EAAE;AACJ,gBAAA,IAAI,EAAE,4JAA4J;AACnK,aAAA;AACD,YAAA,GAAG,EAAE;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A,KAAK,OAAO;AACV,YAAA,OAAO,yBAAyB,CAAC,QAAQ,CAAC;AAC5C,QAAA,KAAK,YAAY;AACf,YAAA,OAAO,8BAA8B,CAAC,QAAQ,CAAC;AACjD,QAAA,KAAK,MAAM;YACT,OAAO,wBAAwB,EAAE;AACnC,QAAA,KAAK,OAAO;AACZ,QAAA;AACE,YAAA,OAAO,yBAAyB,CAAC,QAAQ,CAAC;;AAEhD;AAEA,SAAS,uBAAuB,CAAC,QAAkB,EAAE,IAAe,EAAA;AAClE,IAAA,MAAM,QAAQ,GAAG,4BAA4B,CAAC,QAAQ,CAAC;IACvD,QAAQ,IAAI;AACV,QAAA,KAAK,MAAM;AACT,YAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAChD,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;AAC/C,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;AAClD,QAAA,KAAK,OAAO;AACZ,QAAA;AACE,YAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;;AAErD;;;;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Harness for a sheet opened with `Sheet.open()`.
|
|
5
|
+
*
|
|
6
|
+
* ## Loading it
|
|
7
|
+
*
|
|
8
|
+
* A sheet is **service-opened**, not template-declared: nothing in the test
|
|
9
|
+
* fixture's own DOM represents it, and the container renders into the CDK
|
|
10
|
+
* overlay container on `document.body`. This harness's host *is* that container,
|
|
11
|
+
* so it must be loaded from
|
|
12
|
+
* `TestbedHarnessEnvironment.documentRootLoader(fixture)` — the ordinary
|
|
13
|
+
* `loader(fixture)` searches inside `fixture.nativeElement` and will never find
|
|
14
|
+
* it. Overlay panels belonging to template-declared components (`tw-select`,
|
|
15
|
+
* `tw-popover-overlay`, `tw-menu`) are the opposite case: those harnesses host
|
|
16
|
+
* on the in-fixture trigger and reach their panel internally, so the plain
|
|
17
|
+
* fixture loader is correct there.
|
|
18
|
+
*
|
|
19
|
+
* ## Waiting for it
|
|
20
|
+
*
|
|
21
|
+
* `Sheet` loads its render layer through a dynamic `import()`, so the container
|
|
22
|
+
* does **not** exist synchronously after `open()`. Await the ref's public
|
|
23
|
+
* {@link SheetRef.whenComponentReady} before asking for the harness — it
|
|
24
|
+
* resolves once the chunk has landed and the overlay is attached, for template
|
|
25
|
+
* sheets (with `null`) as well as component sheets.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const ref = sheet.open(FiltersSheet, { side: 'left' });
|
|
30
|
+
* await ref.whenComponentReady();
|
|
31
|
+
* const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);
|
|
32
|
+
* const harness = await rootLoader.getHarness(SheetHarness);
|
|
33
|
+
* expect(await harness.getSide()).toBe('left');
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
class SheetHarness extends ComponentHarness {
|
|
37
|
+
static hostSelector = 'tw-sheet-container';
|
|
38
|
+
title = this.locatorForOptional('[twSheetTitle], tw-sheet-title');
|
|
39
|
+
content = this.locatorForOptional('[twSheetContent], tw-sheet-content');
|
|
40
|
+
/** Any descendant of the container that currently holds DOM focus. */
|
|
41
|
+
focusedDescendant = this.locatorForOptional(':focus');
|
|
42
|
+
/**
|
|
43
|
+
* Overlay backdrops, which are siblings of the sheet's overlay pane rather
|
|
44
|
+
* than descendants of the container — hence the document-root lookup.
|
|
45
|
+
*/
|
|
46
|
+
backdrops = this.documentRootLocatorFactory().locatorForAll('.cdk-overlay-backdrop');
|
|
47
|
+
/** Predicate for `locatorFor` / `locatorForAll`. */
|
|
48
|
+
static with(options = {}) {
|
|
49
|
+
return new HarnessPredicate(SheetHarness, options)
|
|
50
|
+
.addOption('id', options.id, async (h, id) => HarnessPredicate.stringMatches(await h.getId(), id))
|
|
51
|
+
.addOption('title', options.title, async (h, title) => HarnessPredicate.stringMatches(await h.getTitleText(), title))
|
|
52
|
+
.addOption('side', options.side, async (h, side) => (await h.getSide()) === side);
|
|
53
|
+
}
|
|
54
|
+
/** The sheet's id. Matches the `id` on the `SheetRef` returned by `open()`. */
|
|
55
|
+
async getId() {
|
|
56
|
+
return (await this.host()).getAttribute('id');
|
|
57
|
+
}
|
|
58
|
+
/** The sheet's ARIA role — `'dialog'`, or `'alertdialog'` when so configured. */
|
|
59
|
+
async getRole() {
|
|
60
|
+
return (await this.host()).getAttribute('role');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The edge the sheet is anchored to, read from the container's `data-side`
|
|
64
|
+
* attribute. This is the one axis a sheet has that a dialog does not.
|
|
65
|
+
*/
|
|
66
|
+
async getSide() {
|
|
67
|
+
return (await (await this.host()).getAttribute('data-side'));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Text of the projected `[twSheetTitle]` element, trimmed, or `null` when the
|
|
71
|
+
* sheet's content does not use the title directive.
|
|
72
|
+
*/
|
|
73
|
+
async getTitleText() {
|
|
74
|
+
const title = await this.title();
|
|
75
|
+
return title ? (await title.text()).trim() : null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Text of the projected `[twSheetContent]` region, trimmed, or `null` when
|
|
79
|
+
* the sheet's content does not use the content directive.
|
|
80
|
+
*/
|
|
81
|
+
async getContentText() {
|
|
82
|
+
const content = await this.content();
|
|
83
|
+
return content ? (await content.text()).trim() : null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether DOM focus currently sits on the sheet container or anywhere inside
|
|
87
|
+
* it — the observable consequence of the CDK focus trap. CDK moves focus
|
|
88
|
+
* asynchronously, so let the fixture settle after opening before asserting.
|
|
89
|
+
*/
|
|
90
|
+
async containsFocus() {
|
|
91
|
+
if (await (await this.host()).isFocused())
|
|
92
|
+
return true;
|
|
93
|
+
return (await this.focusedDescendant()) !== null;
|
|
94
|
+
}
|
|
95
|
+
/** Whether the sheet rendered a backdrop. */
|
|
96
|
+
async hasBackdrop() {
|
|
97
|
+
return (await this.backdrops()).length > 0;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Clicks the backdrop — the pointer dismiss gesture. Does nothing observable
|
|
101
|
+
* when the sheet was opened with `disableClose: true` or
|
|
102
|
+
* `closeOnBackdropClick: false`, which is how a test asserts those flags.
|
|
103
|
+
*
|
|
104
|
+
* Throws when no backdrop is rendered. With several overlays stacked, the
|
|
105
|
+
* last backdrop in the overlay container is used, i.e. the topmost one.
|
|
106
|
+
*/
|
|
107
|
+
async clickBackdrop() {
|
|
108
|
+
const backdrops = await this.backdrops();
|
|
109
|
+
if (backdrops.length === 0) {
|
|
110
|
+
throw new Error('SheetHarness.clickBackdrop: no backdrop is rendered. The sheet was opened with `hasBackdrop: false`.');
|
|
111
|
+
}
|
|
112
|
+
await backdrops[backdrops.length - 1].click();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Sends Escape to the sheet — the keyboard dismiss gesture. Deliberately a
|
|
116
|
+
* no-op when the sheet was opened with `disableClose: true` or
|
|
117
|
+
* `closeOnEscape: false`.
|
|
118
|
+
*/
|
|
119
|
+
async pressEscape() {
|
|
120
|
+
await (await this.host()).sendKeys(TestKey.ESCAPE);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Generated bundle index. Do not edit.
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
export { SheetHarness };
|
|
129
|
+
//# sourceMappingURL=cdevhub-ngx-tw-sheet-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdevhub-ngx-tw-sheet-testing.mjs","sources":["../../../projects/ngx-tw/sheet/testing/sheet-harness.ts","../../../projects/ngx-tw/sheet/testing/cdevhub-ngx-tw-sheet-testing.ts"],"sourcesContent":["import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\nimport type { BaseHarnessFilters, TestElement } from '@angular/cdk/testing';\n// Imported through the package entry point, not a `../` path: a secondary entry\n// point's `rootDir` is its own directory, so ng-packagr rejects a relative\n// import that climbs out of `sheet/testing`.\nimport type { SheetSide } from '@cdevhub/ngx-tw/sheet';\n\n/** Filters accepted by `SheetHarness.with`. */\nexport interface SheetHarnessFilters extends BaseHarnessFilters {\n /** Match by the sheet's id — the same value as `SheetRef.id`. */\n id?: string | RegExp;\n /** Match by the text of the projected `[twSheetTitle]` element. */\n title?: string | RegExp;\n /** Match by the edge the sheet is anchored to. */\n side?: SheetSide;\n}\n\n/**\n * Harness for a sheet opened with `Sheet.open()`.\n *\n * ## Loading it\n *\n * A sheet is **service-opened**, not template-declared: nothing in the test\n * fixture's own DOM represents it, and the container renders into the CDK\n * overlay container on `document.body`. This harness's host *is* that container,\n * so it must be loaded from\n * `TestbedHarnessEnvironment.documentRootLoader(fixture)` — the ordinary\n * `loader(fixture)` searches inside `fixture.nativeElement` and will never find\n * it. Overlay panels belonging to template-declared components (`tw-select`,\n * `tw-popover-overlay`, `tw-menu`) are the opposite case: those harnesses host\n * on the in-fixture trigger and reach their panel internally, so the plain\n * fixture loader is correct there.\n *\n * ## Waiting for it\n *\n * `Sheet` loads its render layer through a dynamic `import()`, so the container\n * does **not** exist synchronously after `open()`. Await the ref's public\n * {@link SheetRef.whenComponentReady} before asking for the harness — it\n * resolves once the chunk has landed and the overlay is attached, for template\n * sheets (with `null`) as well as component sheets.\n *\n * @example\n * ```ts\n * const ref = sheet.open(FiltersSheet, { side: 'left' });\n * await ref.whenComponentReady();\n * const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n * const harness = await rootLoader.getHarness(SheetHarness);\n * expect(await harness.getSide()).toBe('left');\n * ```\n */\nexport class SheetHarness extends ComponentHarness {\n static hostSelector = 'tw-sheet-container';\n\n private readonly title = this.locatorForOptional(\n '[twSheetTitle], tw-sheet-title',\n );\n private readonly content = this.locatorForOptional(\n '[twSheetContent], tw-sheet-content',\n );\n /** Any descendant of the container that currently holds DOM focus. */\n private readonly focusedDescendant = this.locatorForOptional(':focus');\n /**\n * Overlay backdrops, which are siblings of the sheet's overlay pane rather\n * than descendants of the container — hence the document-root lookup.\n */\n private readonly backdrops =\n this.documentRootLocatorFactory().locatorForAll('.cdk-overlay-backdrop');\n\n /** Predicate for `locatorFor` / `locatorForAll`. */\n static with(options: SheetHarnessFilters = {}): HarnessPredicate<SheetHarness> {\n return new HarnessPredicate(SheetHarness, options)\n .addOption('id', options.id, async (h, id) =>\n HarnessPredicate.stringMatches(await h.getId(), id),\n )\n .addOption('title', options.title, async (h, title) =>\n HarnessPredicate.stringMatches(await h.getTitleText(), title),\n )\n .addOption('side', options.side, async (h, side) => (await h.getSide()) === side);\n }\n\n /** The sheet's id. Matches the `id` on the `SheetRef` returned by `open()`. */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /** The sheet's ARIA role — `'dialog'`, or `'alertdialog'` when so configured. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * The edge the sheet is anchored to, read from the container's `data-side`\n * attribute. This is the one axis a sheet has that a dialog does not.\n */\n async getSide(): Promise<SheetSide | null> {\n return (await (await this.host()).getAttribute('data-side')) as SheetSide | null;\n }\n\n /**\n * Text of the projected `[twSheetTitle]` element, trimmed, or `null` when the\n * sheet's content does not use the title directive.\n */\n async getTitleText(): Promise<string | null> {\n const title: TestElement | null = await this.title();\n return title ? (await title.text()).trim() : null;\n }\n\n /**\n * Text of the projected `[twSheetContent]` region, trimmed, or `null` when\n * the sheet's content does not use the content directive.\n */\n async getContentText(): Promise<string | null> {\n const content: TestElement | null = await this.content();\n return content ? (await content.text()).trim() : null;\n }\n\n /**\n * Whether DOM focus currently sits on the sheet container or anywhere inside\n * it — the observable consequence of the CDK focus trap. CDK moves focus\n * asynchronously, so let the fixture settle after opening before asserting.\n */\n async containsFocus(): Promise<boolean> {\n if (await (await this.host()).isFocused()) return true;\n return (await this.focusedDescendant()) !== null;\n }\n\n /** Whether the sheet rendered a backdrop. */\n async hasBackdrop(): Promise<boolean> {\n return (await this.backdrops()).length > 0;\n }\n\n /**\n * Clicks the backdrop — the pointer dismiss gesture. Does nothing observable\n * when the sheet was opened with `disableClose: true` or\n * `closeOnBackdropClick: false`, which is how a test asserts those flags.\n *\n * Throws when no backdrop is rendered. With several overlays stacked, the\n * last backdrop in the overlay container is used, i.e. the topmost one.\n */\n async clickBackdrop(): Promise<void> {\n const backdrops = await this.backdrops();\n if (backdrops.length === 0) {\n throw new Error(\n 'SheetHarness.clickBackdrop: no backdrop is rendered. The sheet was opened with `hasBackdrop: false`.',\n );\n }\n await backdrops[backdrops.length - 1].click();\n }\n\n /**\n * Sends Escape to the sheet — the keyboard dismiss gesture. Deliberately a\n * no-op when the sheet was opened with `disableClose: true` or\n * `closeOnEscape: false`.\n */\n async pressEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACG,MAAO,YAAa,SAAQ,gBAAgB,CAAA;AAChD,IAAA,OAAO,YAAY,GAAG,oBAAoB;AAEzB,IAAA,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAC9C,gCAAgC,CACjC;AACgB,IAAA,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAChD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AAK,EAAE;AACpD,QAAA,OAAO,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI;IACnD;AAEA;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAA;AAClB,QAAA,MAAM,OAAO,GAAuB,MAAM,IAAI,CAAC,OAAO,EAAE;AACxD,QAAA,OAAO,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI;IACvD;AAEA;;;;AAIG;AACH,IAAA,MAAM,aAAa,GAAA;QACjB,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE;AAAE,YAAA,OAAO,IAAI;QACtD,OAAO,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,MAAM,IAAI;IAClD;;AAGA,IAAA,MAAM,WAAW,GAAA;QACf,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC;IAC5C;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE;AACxC,QAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AAC1B,YAAA,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG;QACH;QACA,MAAM,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;IAC/C;AAEA;;;;AAIG;AACH,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACpD;;;AC5JF;;AAEG;;;;"}
|
|
@@ -65,9 +65,25 @@ class SheetConfig extends DialogConfig {
|
|
|
65
65
|
restoreFocus = true;
|
|
66
66
|
}
|
|
67
67
|
/** Injection token carrying the `data` value passed via {@link SheetConfig.data}. */
|
|
68
|
-
const
|
|
68
|
+
const TW_SHEET_DATA = new InjectionToken('TW_SHEET_DATA');
|
|
69
69
|
/** Injection token for application-wide default sheet options. Set via `provideSheet()`. */
|
|
70
|
-
const
|
|
70
|
+
const TW_SHEET_DEFAULT_OPTIONS = new InjectionToken('TW_SHEET_DEFAULT_OPTIONS');
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Renamed to {@link TW_SHEET_DATA} for consistency with every other
|
|
73
|
+
* ngx-tw injection token — and with `TW_DIALOG_DATA`, its direct counterpart.
|
|
74
|
+
* This is the *same token instance*, not a copy — providing under either name
|
|
75
|
+
* and injecting under the other resolves — so the rename is safe to adopt
|
|
76
|
+
* incrementally. Removed in the next major.
|
|
77
|
+
*/
|
|
78
|
+
const SHEET_DATA = TW_SHEET_DATA;
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Renamed to {@link TW_SHEET_DEFAULT_OPTIONS} for consistency with
|
|
81
|
+
* every other ngx-tw injection token — and with `TW_DIALOG_DEFAULT_OPTIONS`,
|
|
82
|
+
* its direct counterpart. This is the *same token instance*, not a copy —
|
|
83
|
+
* providing under either name and injecting under the other resolves — so the
|
|
84
|
+
* rename is safe to adopt incrementally. Removed in the next major.
|
|
85
|
+
*/
|
|
86
|
+
const SHEET_DEFAULT_OPTIONS = TW_SHEET_DEFAULT_OPTIONS;
|
|
71
87
|
|
|
72
88
|
/**
|
|
73
89
|
* Reference to a sheet opened via {@link Sheet.open}. Drives the sheet
|
|
@@ -315,7 +331,7 @@ function generateSheetId() {
|
|
|
315
331
|
*/
|
|
316
332
|
class Sheet {
|
|
317
333
|
injector = inject(Injector);
|
|
318
|
-
defaultOptions = inject(
|
|
334
|
+
defaultOptions = inject(TW_SHEET_DEFAULT_OPTIONS, { optional: true }) ?? {};
|
|
319
335
|
parentSheet = inject(Sheet, { optional: true, skipSelf: true });
|
|
320
336
|
/** Cached renderer chunk import — kicked off on the first `open()`. */
|
|
321
337
|
rendererPromise = null;
|
|
@@ -407,7 +423,7 @@ class Sheet {
|
|
|
407
423
|
}
|
|
408
424
|
loadRenderer() {
|
|
409
425
|
if (!this.rendererPromise) {
|
|
410
|
-
this.rendererPromise = import('./cdevhub-ngx-tw-sheet-sheet-renderer-
|
|
426
|
+
this.rendererPromise = import('./cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs').then(({ openRenderedSheet }) => this.destroyed ? null : openRenderedSheet);
|
|
411
427
|
}
|
|
412
428
|
return this.rendererPromise;
|
|
413
429
|
}
|
|
@@ -459,7 +475,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
459
475
|
function provideSheet(defaultOptions) {
|
|
460
476
|
const providers = [Sheet];
|
|
461
477
|
if (defaultOptions) {
|
|
462
|
-
providers.push({ provide:
|
|
478
|
+
providers.push({ provide: TW_SHEET_DEFAULT_OPTIONS, useValue: defaultOptions });
|
|
463
479
|
}
|
|
464
480
|
return makeEnvironmentProviders(providers);
|
|
465
481
|
}
|
|
@@ -653,7 +669,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
653
669
|
* `[twSheetClose]` value to pass a result to `afterClosed()` subscribers.
|
|
654
670
|
*/
|
|
655
671
|
class SheetCloseDirective {
|
|
656
|
-
/** Value passed to `afterClosed()` when the button is clicked. */
|
|
672
|
+
/** Value passed to `afterClosed()` when the button is clicked. Defaults to `undefined`. */
|
|
657
673
|
twSheetClose = input(undefined, /* @ts-ignore */
|
|
658
674
|
...(ngDevMode ? [{ debugName: "twSheetClose" }] : /* istanbul ignore next */ []));
|
|
659
675
|
/** Native button `type`. Defaults to `'button'` to avoid accidental form submission. */
|
|
@@ -681,5 +697,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
681
697
|
* Generated bundle index. Do not edit.
|
|
682
698
|
*/
|
|
683
699
|
|
|
684
|
-
export { SHEET_DATA, SHEET_DEFAULT_OPTIONS, Sheet, SheetActionsDirective, SheetCloseDirective, SheetConfig, SheetContentDirective, SheetDescriptionDirective, SheetHeaderDirective, SheetIconDirective, SheetRef, SheetSubtitleDirective, SheetTitleDirective, provideSheet };
|
|
700
|
+
export { SHEET_DATA, SHEET_DEFAULT_OPTIONS, Sheet, SheetActionsDirective, SheetCloseDirective, SheetConfig, SheetContentDirective, SheetDescriptionDirective, SheetHeaderDirective, SheetIconDirective, SheetRef, SheetSubtitleDirective, SheetTitleDirective, TW_SHEET_DATA, TW_SHEET_DEFAULT_OPTIONS, provideSheet };
|
|
685
701
|
//# sourceMappingURL=cdevhub-ngx-tw-sheet.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdevhub-ngx-tw-sheet.mjs","sources":["../../../projects/ngx-tw/sheet/sheet-config.ts","../../../projects/ngx-tw/sheet/sheet-ref.ts","../../../projects/ngx-tw/sheet/sheet.ts","../../../projects/ngx-tw/sheet/sheet-content.ts","../../../projects/ngx-tw/sheet/cdevhub-ngx-tw-sheet.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport {\n type AutoFocusTarget,\n DialogConfig as CdkDialogConfig,\n type DialogRole,\n type RestoreFocusValue,\n} from '@angular/cdk/dialog';\n\n/** Edge the sheet anchors against. */\nexport type SheetSide = 'top' | 'right' | 'bottom' | 'left';\n\n/**\n * Preset size for the sheet panel.\n *\n * Sizing is axis-dependent:\n * - `'left' | 'right'` — controls panel width (height is always `100vh`).\n * - `'top' | 'bottom'` — controls panel height (width is always `100vw`).\n */\nexport type SheetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\n/** ARIA role of the sheet element. Use `'alertdialog'` for destructive confirmation surfaces. */\nexport type SheetRole = DialogRole;\n\n/** Where to move focus when the sheet opens. */\nexport type SheetAutoFocus = AutoFocusTarget | string | boolean;\n\n/** How to restore focus on close. `true` restores to the previously focused element; a selector or element targets a specific node. */\nexport type SheetRestoreFocus = RestoreFocusValue;\n\n/** Scroll behavior for content underneath the sheet. */\nexport type SheetScrollStrategy = 'block' | 'close' | 'reposition' | 'noop';\n\n/**\n * Configuration for opening a sheet with {@link Sheet.open}.\n *\n * Extends `@angular/cdk/dialog`'s `DialogConfig` with sheet-specific options\n * (`side`, `size`, animation durations, split close flags).\n */\nexport class SheetConfig<D = unknown, R = unknown> extends CdkDialogConfig<D, R> {\n /** Edge the sheet anchors against. Defaults to `'right'`. */\n side?: SheetSide = 'right';\n\n /** Preset size for the sheet panel. Axis-dependent (width for left/right, height for top/bottom). Defaults to `'md'`. */\n size?: SheetSize = 'md';\n\n /** Duration of the open slide animation in ms. Defaults to `200`. Use `0` to disable. */\n enterAnimationDuration?: number = 200;\n\n /**\n * Duration of the close slide animation in ms. Defaults to `160`. Use `0` to disable.\n * Asymmetric with `enterAnimationDuration` by design — the close transition is slightly\n * faster so the sheet feels dismissive rather than reluctant.\n */\n exitAnimationDuration?: number = 160;\n\n /** Scroll strategy preset applied when `scrollStrategy` isn't set. Defaults to `'block'`. */\n scrollBehavior?: SheetScrollStrategy = 'block';\n\n /**\n * Whether the sheet is modal — sets `aria-modal` on the container. Defaults to `true`:\n * a sheet opened over the page is modal by default and the rest of the document is\n * inert while it is open. Set to `false` only for non-modal surfaces.\n */\n override ariaModal?: boolean = true;\n\n /** Whether the sheet renders a backdrop. Defaults to `true`. */\n override hasBackdrop?: boolean = true;\n\n /**\n * Whether pressing `Escape` closes the sheet.\n *\n * Defaults to `true` — Escape is the universal dismiss key for modal surfaces; the\n * \"swallow Escape\" variant is the special case. `disableClose` overrides this when\n * `true`.\n */\n closeOnEscape?: boolean = true;\n\n /**\n * Whether clicking the backdrop closes the sheet.\n *\n * Defaults to `true` — clicking outside a modal sheet is the expected dismiss\n * gesture; enforcing an explicit dismiss button is the special case. `disableClose`\n * overrides this when `true`.\n */\n closeOnBackdropClick?: boolean = true;\n\n /**\n * Whether Escape AND backdrop clicks are blocked. Defaults to `false`.\n * When `true`, this overrides both `closeOnEscape` and `closeOnBackdropClick`.\n */\n override disableClose?: boolean = false;\n\n /** Whether navigation (e.g. router) closes the sheet. Defaults to `true`. */\n override closeOnNavigation?: boolean = true;\n\n /** Where to move focus when the sheet opens. Defaults to `'first-tabbable'`. */\n override autoFocus?: SheetAutoFocus = 'first-tabbable';\n\n /** Whether to restore focus to the previously focused element after close. Defaults to `true`. */\n override restoreFocus?: SheetRestoreFocus = true;\n}\n\n/** Injection token carrying the `data` value passed via {@link SheetConfig.data}. */\nexport const SHEET_DATA = new InjectionToken<unknown>('SHEET_DATA');\n\n/** Injection token for application-wide default sheet options. Set via `provideSheet()`. */\nexport const SHEET_DEFAULT_OPTIONS = new InjectionToken<Partial<SheetConfig>>(\n 'SHEET_DEFAULT_OPTIONS',\n);\n","import { type ComponentRef, signal, type Signal } from '@angular/core';\nimport { type DialogRef as CdkDialogRef } from '@angular/cdk/dialog';\nimport { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { filter, merge, type Observable, ReplaySubject, Subject, take } from 'rxjs';\nimport type { FocusOrigin } from '@angular/cdk/a11y';\nimport type { SheetConfig } from './sheet-config';\nimport type { SheetContainer, SheetState } from './sheet-container';\n\n/**\n * Reference to a sheet opened via {@link Sheet.open}. Drives the sheet\n * lifecycle (close, state, observables) and forwards useful overlay streams.\n *\n * The ref is returned **synchronously** from `open()`, but the sheet's render\n * layer (`@angular/cdk/dialog` + the Tailwind container) is loaded through a\n * dynamic `import()`. The ref therefore starts *detached*: `id`, `state`,\n * `close()`, the lifecycle observables, and panel mutations all work\n * immediately (mutations are buffered and replayed on attach), but the rendered\n * component instance does not exist yet — read it via {@link whenComponentReady}\n * instead of a synchronous `componentInstance` field.\n */\nexport class SheetRef<R = unknown, C = unknown> {\n /** Unique ID of the sheet. Generated eagerly by the service, so it is valid the instant `open()` returns. */\n readonly id: string;\n\n /** Current lifecycle state. Reactively readable. */\n readonly state: Signal<SheetState>;\n\n /** When `true`, close-via-escape AND close-via-backdrop are both disabled. */\n disableClose: boolean | undefined;\n\n /** When `false`, pressing Escape does not close the sheet. */\n closeOnEscape: boolean | undefined;\n\n /** When `false`, clicking the backdrop does not close the sheet. */\n closeOnBackdropClick: boolean | undefined;\n\n private readonly stateSignal = signal<SheetState>('opening');\n private readonly afterOpenedSubject = new ReplaySubject<void>(1);\n private readonly beforeClosedSubject = new ReplaySubject<R | undefined>(1);\n private readonly afterClosedSubject = new ReplaySubject<R | undefined>(1);\n // Facade-owned pass-throughs for the raw overlay streams, so a consumer that\n // subscribes before the render chunk attaches still receives events once it\n // does — the pre-deferral behaviour when `open()` wrapped a live `cdkRef`.\n private readonly backdropClickSubject = new Subject<MouseEvent>();\n private readonly keydownEventsSubject = new Subject<KeyboardEvent>();\n\n private cdkRef: CdkDialogRef<R, C> | null = null;\n private container: SheetContainer | null = null;\n\n private componentInstanceValue: C | null = null;\n private componentRefValue: ComponentRef<C> | null = null;\n private resolveComponentReady!: (value: C | null) => void;\n private readonly componentReadyPromise = new Promise<C | null>((resolve) => {\n this.resolveComponentReady = resolve;\n });\n\n // Buffered mutations issued before the render chunk attached the CDK backend.\n private readonly pendingPanelAdds: string[] = [];\n private readonly pendingPanelRemoves: string[] = [];\n\n private pendingResult: R | undefined;\n private closeFocusOrigin: FocusOrigin | undefined;\n\n constructor(id: string, readonly config: SheetConfig<unknown, R>) {\n this.id = id;\n this.disableClose = config.disableClose;\n this.closeOnEscape = config.closeOnEscape;\n this.closeOnBackdropClick = config.closeOnBackdropClick;\n this.state = this.stateSignal.asReadonly();\n }\n\n /** The Tailwind container instance, or `null` until the sheet has attached. */\n get containerInstance(): SheetContainer | null {\n return this.container;\n }\n\n /**\n * @internal Wire this facade to its CDK backend. Called from the sheet\n * renderer **inside** `cdkDialog.open()`'s `providers` callback — the same\n * point the constructor ran before deferral — so subscriptions to\n * `animationStateChanged` are in place before the container emits `'open'`.\n */\n _attach(cdkRef: CdkDialogRef<R, C>, container: SheetContainer): void {\n this.cdkRef = cdkRef;\n this.container = container;\n\n // Forward the raw overlay streams into the facade pass-throughs.\n cdkRef.backdropClick.subscribe(this.backdropClickSubject);\n cdkRef.keydownEvents.subscribe(this.keydownEventsSubject);\n\n cdkRef.addPanelClass('tw-sheet-panel');\n for (const cls of this.pendingPanelAdds) cdkRef.addPanelClass(cls);\n for (const cls of this.pendingPanelRemoves) cdkRef.removePanelClass(cls);\n this.pendingPanelAdds.length = 0;\n this.pendingPanelRemoves.length = 0;\n\n const animationChanges = container.animationStateChanged;\n\n animationChanges\n .pipe(\n filter((event) => event.state === 'open'),\n take(1),\n )\n .subscribe(() => {\n this.stateSignal.set('open');\n this.afterOpenedSubject.next();\n this.afterOpenedSubject.complete();\n });\n\n // The container owns the exit-animation fallback timer\n // (ANIMATION_FALLBACK_PADDING in sheet-container.ts), so we trust its\n // `closed` emission and run finishClose exactly once from here.\n animationChanges\n .pipe(\n filter((event) => event.state === 'closed'),\n take(1),\n )\n .subscribe(() => this.finishClose());\n\n cdkRef.overlayRef.detachments().subscribe(() => {\n if (this.stateSignal() !== 'closed') {\n this.beforeClosedSubject.next(this.pendingResult);\n this.beforeClosedSubject.complete();\n this.finishClose();\n }\n });\n\n merge(\n cdkRef.backdropClick.pipe(\n filter(() => !this.disableClose && this.closeOnBackdropClick !== false),\n ),\n cdkRef.keydownEvents.pipe(\n filter(\n (event) =>\n event.keyCode === ESCAPE &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event),\n ),\n ),\n ).subscribe((event) => {\n event.preventDefault();\n this.closeWithOrigin(event.type === 'keydown' ? 'keyboard' : 'mouse');\n });\n }\n\n /** @internal Record the rendered component after `cdkDialog.open()` returns. */\n _setComponent(instance: C | null, ref: ComponentRef<C> | null): void {\n this.componentInstanceValue = instance;\n this.componentRefValue = ref;\n this.resolveComponentReady(instance);\n }\n\n /**\n * Resolves with the rendered content-component instance once the sheet's\n * render chunk has loaded and attached. Resolves `null` for template sheets,\n * and for a sheet closed before it ever opened.\n *\n * Replaces the former synchronous `componentInstance` field, which cannot be\n * populated before the deferred render chunk lands.\n *\n * @example\n * ```ts\n * const ref = sheet.open(FilterSheet);\n * const filters = await ref.whenComponentReady();\n * filters?.reset();\n * ```\n */\n whenComponentReady(): Promise<C | null> {\n return this.componentReadyPromise;\n }\n\n /** The rendered component instance, or `null` if not yet attached / a template sheet. Prefer {@link whenComponentReady}. */\n get componentInstance(): C | null {\n return this.componentInstanceValue;\n }\n\n /** The rendered `ComponentRef`, or `null` if not yet attached / a template sheet. */\n get componentRef(): ComponentRef<C> | null {\n return this.componentRefValue;\n }\n\n /**\n * Closes the sheet. The exit slide animation runs before the overlay is disposed.\n * @param result Value forwarded to `afterClosed()` subscribers.\n */\n close(result?: R): void {\n this.closeWithOrigin('program', result);\n }\n\n /** Observable that emits once after the enter animation finishes. */\n afterOpened(): Observable<void> {\n return this.afterOpenedSubject.asObservable();\n }\n\n /** Observable that emits once when the close animation starts. */\n beforeClosed(): Observable<R | undefined> {\n return this.beforeClosedSubject.asObservable();\n }\n\n /** Observable that emits once after the sheet has fully closed and the overlay is disposed. */\n afterClosed(): Observable<R | undefined> {\n return this.afterClosedSubject.asObservable();\n }\n\n /** Backdrop click stream (emits even when `closeOnBackdropClick` / `disableClose` is set). Buffered — a subscription made before the sheet attaches receives events once it does. */\n backdropClick(): Observable<MouseEvent> {\n return this.backdropClickSubject.asObservable();\n }\n\n /** Keydown event stream for the overlay. Buffered — a subscription made before the sheet attaches receives events once it does. */\n keydownEvents(): Observable<KeyboardEvent> {\n return this.keydownEventsSubject.asObservable();\n }\n\n /** Adds CSS classes to the overlay panel. Buffered until attach. */\n addPanelClass(classes: string | string[]): this {\n if (this.cdkRef) {\n this.cdkRef.addPanelClass(classes);\n } else {\n this.pendingPanelAdds.push(...(Array.isArray(classes) ? classes : [classes]));\n }\n return this;\n }\n\n /** Removes CSS classes from the overlay panel. Buffered until attach. */\n removePanelClass(classes: string | string[]): this {\n if (this.cdkRef) {\n this.cdkRef.removePanelClass(classes);\n } else {\n this.pendingPanelRemoves.push(...(Array.isArray(classes) ? classes : [classes]));\n }\n return this;\n }\n\n private closeWithOrigin(origin: FocusOrigin, result?: R): void {\n if (this.stateSignal() === 'closing' || this.stateSignal() === 'closed') return;\n\n const predicate = this.config.closePredicate;\n if (\n predicate &&\n !predicate(\n result,\n this.config as unknown as Parameters<typeof predicate>[1],\n this.componentInstanceValue,\n )\n ) {\n return;\n }\n\n this.pendingResult = result;\n this.closeFocusOrigin = origin;\n this.stateSignal.set('closing');\n\n this.beforeClosedSubject.next(result);\n this.beforeClosedSubject.complete();\n\n if (!this.cdkRef) {\n // Closed before the render chunk attached: the overlay was never created,\n // so there is nothing to animate or dispose. Synthesize the closed state\n // and let the service skip opening entirely (it checks state()).\n this.finishClose();\n return;\n }\n\n this.cdkRef.overlayRef.detachBackdrop();\n this.container!._startExitAnimation();\n }\n\n private finishClose(): void {\n if (this.stateSignal() === 'closed') return;\n this.stateSignal.set('closed');\n\n this.afterClosedSubject.next(this.pendingResult);\n this.afterClosedSubject.complete();\n\n // Idempotent — a no-op if _setComponent already resolved with an instance.\n this.resolveComponentReady(null);\n this.backdropClickSubject.complete();\n this.keydownEventsSubject.complete();\n\n if (this.cdkRef?.containerInstance) {\n this.cdkRef.close(this.pendingResult, { focusOrigin: this.closeFocusOrigin });\n }\n\n this.componentInstanceValue = null;\n }\n}\n","import {\n inject,\n Injectable,\n Injector,\n type OnDestroy,\n type Provider,\n type TemplateRef,\n signal,\n type Signal,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n} from '@angular/core';\nimport type { ComponentType } from '@angular/cdk/portal';\nimport { defer, type Observable, startWith, Subject } from 'rxjs';\nimport {\n SHEET_DEFAULT_OPTIONS,\n SheetConfig,\n} from './sheet-config';\nimport { SheetRef } from './sheet-ref';\n// Type-only: importing the renderer as a value would drag `@angular/cdk/dialog`\n// and the overlay strategies back into the eager chunk. See `sheet-renderer.ts`.\nimport type { openRenderedSheet } from './sheet-renderer';\n\nlet nextSheetId = 0;\n\nfunction generateSheetId(): string {\n return `tw-sheet-${++nextSheetId}`;\n}\n\n/**\n * Opens edge-anchored sheet (drawer) overlays. Composes `@angular/cdk/dialog`\n * for focus trapping, portals, and overlay plumbing — adds a `GlobalPositionStrategy`\n * pinned to the requested viewport edge, a Tailwind container with axis-aware\n * sizing, slide enter/exit animations, and split close-behavior flags.\n *\n * The rendering layer (`@angular/cdk/dialog` + the Tailwind container) is loaded\n * through a dynamic `import()` on the first `open()` call, so merely registering\n * this service costs nothing in the initial bundle. `open()` still returns its\n * {@link SheetRef} synchronously — the sheet is rendered once the chunk lands.\n * Read the rendered component via {@link SheetRef.whenComponentReady}.\n *\n * Not `providedIn: 'root'` — register it via {@link provideSheet}.\n */\n@Injectable()\nexport class Sheet implements OnDestroy {\n private readonly injector = inject(Injector);\n private readonly defaultOptions = inject(SHEET_DEFAULT_OPTIONS, { optional: true }) ?? {};\n private readonly parentSheet = inject(Sheet, { optional: true, skipSelf: true });\n\n /** Cached renderer chunk import — kicked off on the first `open()`. */\n private rendererPromise: Promise<typeof openRenderedSheet | null> | null = null;\n private destroyed = false;\n\n private readonly openSheetsAtThisLevel = signal<readonly SheetRef<unknown, unknown>[]>([]);\n private readonly afterOpenedSubject = new Subject<SheetRef<unknown, unknown>>();\n private readonly afterAllClosedSubject = new Subject<void>();\n\n /** Reactively-readable list of currently-open sheets across the full sheet tree. */\n readonly openSheets: Signal<readonly SheetRef<unknown, unknown>[]> = this.parentSheet\n ? this.parentSheet.openSheets\n : this.openSheetsAtThisLevel.asReadonly();\n\n /** Emits every time a sheet is opened. */\n readonly afterOpened: Observable<SheetRef<unknown, unknown>> = this.parentSheet\n ? this.parentSheet.afterOpened\n : this.afterOpenedSubject.asObservable();\n\n /**\n * Emits when every open sheet has closed. Emits immediately on subscribe if\n * there are none open.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openSheets().length\n ? this.getAfterAllClosedSource()\n : this.getAfterAllClosedSource().pipe(startWith(undefined as void)),\n );\n\n /**\n * Opens a sheet using the given component or template.\n * @param content Component class or `TemplateRef`.\n * @param config Options merged over the application defaults.\n * @returns Reference controlling the opened sheet, returned synchronously.\n */\n open<R = unknown, D = unknown, C = unknown>(\n content: ComponentType<C> | TemplateRef<C>,\n config?: SheetConfig<D, R>,\n ): SheetRef<R, C> {\n const merged = this.resolveConfig<D, R>(config);\n const id = merged.id ?? generateSheetId();\n merged.id = id;\n\n // Enforce id uniqueness eagerly. CDK throws this synchronously from\n // `open()`; since our CDK open is now deferred, replicate the check here so\n // the error still surfaces at the call site rather than in a later tick.\n if (this.getSheetById(id)) {\n throw new Error(`Sheet with id \"${id}\" exists already. The sheet id must be unique.`);\n }\n\n const sheetRef = new SheetRef<R, C>(id, merged as unknown as SheetConfig<unknown, R>);\n\n const scope = this.parentSheet ?? this;\n scope.registerOpen(sheetRef as unknown as SheetRef<unknown, unknown>);\n sheetRef.afterClosed().subscribe(() => {\n scope.unregister(sheetRef as unknown as SheetRef<unknown, unknown>);\n });\n\n void this.renderWhenReady(content, merged, sheetRef);\n\n return sheetRef;\n }\n\n /** Closes every open sheet managed by this service (and child services). */\n closeAll(): void {\n const sheets = [...this.openSheets()];\n for (let i = sheets.length - 1; i >= 0; i--) sheets[i].close();\n }\n\n /** Looks up an open sheet by its id. */\n getSheetById<R = unknown, C = unknown>(id: string): SheetRef<R, C> | undefined {\n return this.openSheets().find((sheet) => sheet.id === id) as SheetRef<R, C> | undefined;\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n const sheets = [...this.openSheetsAtThisLevel()];\n for (let i = sheets.length - 1; i >= 0; i--) sheets[i].close();\n this.afterOpenedSubject.complete();\n this.afterAllClosedSubject.complete();\n }\n\n /**\n * @internal Resolves once the renderer chunk has loaded. Exposed for tests,\n * which must await the dynamic import before asserting on rendered DOM.\n */\n async _whenRendered(): Promise<void> {\n await this.loadRenderer();\n await Promise.resolve();\n }\n\n /**\n * Render a sheet once the renderer chunk has loaded. The ref was already\n * returned to the caller, so it may have been closed (or the service\n * destroyed) while the import was in flight — both skip the actual open.\n */\n private async renderWhenReady<R, D, C>(\n content: ComponentType<C> | TemplateRef<C>,\n merged: SheetConfig<D, R>,\n sheetRef: SheetRef<R, C>,\n ): Promise<void> {\n const openRendered = await this.loadRenderer();\n if (!openRendered || this.destroyed) return;\n // Closed before the chunk landed — the facade already synthesized its\n // closed state; never create the overlay.\n if (sheetRef.state() === 'closed') return;\n openRendered(this.injector, content, merged, sheetRef);\n }\n\n private loadRenderer(): Promise<typeof openRenderedSheet | null> {\n if (!this.rendererPromise) {\n this.rendererPromise = import('./sheet-renderer').then(({ openRenderedSheet }) =>\n this.destroyed ? null : openRenderedSheet,\n );\n }\n return this.rendererPromise;\n }\n\n private registerOpen(ref: SheetRef<unknown, unknown>): void {\n if (this.parentSheet) {\n this.parentSheet.registerOpen(ref);\n } else {\n this.openSheetsAtThisLevel.update((list) => [...list, ref]);\n this.afterOpenedSubject.next(ref);\n }\n }\n\n private unregister(ref: SheetRef<unknown, unknown>): void {\n if (this.parentSheet) {\n this.parentSheet.unregister(ref);\n } else {\n this.openSheetsAtThisLevel.update((list) => list.filter((d) => d !== ref));\n if (this.openSheetsAtThisLevel().length === 0) {\n this.afterAllClosedSubject.next();\n }\n }\n }\n\n private getAfterAllClosedSource(): Subject<void> {\n return this.parentSheet\n ? this.parentSheet.getAfterAllClosedSource()\n : this.afterAllClosedSubject;\n }\n\n private resolveConfig<D, R>(config: SheetConfig<D, R> | undefined): SheetConfig<D, R> {\n const merged = new SheetConfig<D, R>();\n Object.assign(merged, this.defaultOptions, config);\n return merged;\n }\n}\n\n/**\n * Registers the {@link Sheet} service for dependency injection.\n *\n * @param defaultOptions Optional defaults merged into every `open()` call.\n * @example\n * ```ts\n * provideSheet({ side: 'left', size: 'lg' })\n * ```\n */\nexport function provideSheet(defaultOptions?: Partial<SheetConfig>): EnvironmentProviders {\n const providers: Provider[] = [Sheet];\n if (defaultOptions) {\n providers.push({ provide: SHEET_DEFAULT_OPTIONS, useValue: defaultOptions });\n }\n return makeEnvironmentProviders(providers);\n}\n","import {\n computed,\n Directive,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { CdkScrollable } from '@angular/cdk/scrolling';\nimport type { TwColor } from '@cdevhub/ngx-tw/core';\nimport { SheetRef } from './sheet-ref';\n\n/**\n * Header wrapper for a sheet. Provides consistent padding and spacing for\n * title + subtitle + leading icon, and separates the header from scrollable\n * content below.\n */\n@Directive({\n selector: '[twSheetHeader], tw-sheet-header',\n host: {\n class: 'flex items-start gap-3 px-6 pt-6 pb-4',\n },\n})\nexport class SheetHeaderDirective {}\n\n// Slot tokens own light/dark contrast — no `dark:` overrides, no shade picks.\n// See role slot conventions in `projects/ngx-tw/theme/_semantic.css`.\nconst ICON_COLOR_CLASSES: Record<TwColor, string> = {\n primary: 'bg-primary-soft text-primary-icon',\n secondary: 'bg-secondary-soft text-secondary-icon',\n accent: 'bg-accent-soft text-accent-icon',\n neutral: 'bg-neutral-soft text-neutral-icon',\n info: 'bg-info-soft text-info-icon',\n success: 'bg-success-soft text-success-icon',\n warning: 'bg-warning-soft text-warning-icon',\n error: 'bg-error-soft text-error-icon',\n};\n\n/**\n * Decorative leading icon for a sheet header. Use with a semantic `color` to\n * match destructive / informational / success sheets.\n */\n@Directive({\n selector: '[twSheetIcon]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class SheetIconDirective {\n /** Semantic color for the icon container. Defaults to a neutral surface. */\n readonly color = input<TwColor | undefined>(undefined);\n\n protected readonly classes = computed(() => {\n const base = 'flex size-10 shrink-0 items-center justify-center rounded-full';\n const color = this.color();\n return color ? `${base} ${ICON_COLOR_CLASSES[color]}` : `${base} bg-surface-muted text-fg`;\n });\n}\n\n/**\n * Sheet title. Registers its ID with the container's `aria-labelledby` queue\n * so screen readers announce it automatically.\n */\n@Directive({\n selector: '[twSheetTitle], tw-sheet-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class SheetTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-sheet-title-');\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n // directive's injector chain (e.g. heavily nested template portals). The\n // container ALWAYS resolves via element-injector traversal because the\n // directive lives inside `<tw-sheet-container>`'s DOM tree.\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._addAriaLabelledBy(this.id());\n }\n\n ngOnDestroy(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._removeAriaLabelledBy(this.id());\n }\n}\n\n/** Secondary line beneath the sheet title — intended for a short description. */\n@Directive({\n selector: '[twSheetSubtitle], tw-sheet-subtitle',\n host: {\n class: 'text-sm text-fg-muted',\n },\n})\nexport class SheetSubtitleDirective {}\n\n/**\n * Sheet description. Registers its ID with the container's `aria-describedby`\n * queue so screen readers announce the descriptive paragraph after the title.\n * Mirrors {@link SheetTitleDirective} but for `aria-describedby`.\n */\n@Directive({\n selector: '[twSheetDescription], tw-sheet-description',\n host: {\n '[id]': 'id()',\n },\n})\nexport class SheetDescriptionDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-sheet-description-');\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n\n /** Custom id for the description element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._addAriaDescribedBy(this.id());\n }\n\n ngOnDestroy(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._removeAriaDescribedBy(this.id());\n }\n}\n\n/**\n * Scrollable content region of the sheet. Apply between the header and the\n * actions bar. Inherits CDK's `CdkScrollable` to play nicely with scroll\n * strategies and nested scrollables.\n */\n@Directive({\n selector: '[twSheetContent], tw-sheet-content',\n hostDirectives: [CdkScrollable],\n host: {\n class: 'flex-1 overflow-y-auto px-6 py-4 text-sm text-fg',\n },\n})\nexport class SheetContentDirective {}\n\n/** Horizontal alignment for sheet action buttons. */\nexport type SheetActionsAlign = 'start' | 'center' | 'end';\n\n/**\n * Bottom action bar of a sheet. Use inside the sheet content or template to\n * host Cancel/Confirm buttons. Stays pinned below scrollable content.\n */\n@Directive({\n selector: '[twSheetActions], tw-sheet-actions',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class SheetActionsDirective {\n /** Horizontal alignment of the action buttons. Defaults to `'end'`. */\n readonly align = input<SheetActionsAlign>('end');\n\n protected readonly classes = computed(() => {\n const align = this.align();\n const justify =\n align === 'start' ? 'justify-start' : align === 'center' ? 'justify-center' : 'justify-end';\n return `flex flex-wrap items-center gap-2 px-6 py-4 border-t border-border-muted ${justify}`;\n });\n}\n\n/**\n * Closes the enclosing sheet when the host button is clicked. Provide a\n * `[twSheetClose]` value to pass a result to `afterClosed()` subscribers.\n */\n@Directive({\n selector: '[twSheetClose]',\n host: {\n '(click)': 'onClick()',\n '[attr.type]': 'type()',\n },\n})\nexport class SheetCloseDirective {\n /** Value passed to `afterClosed()` when the button is clicked. */\n readonly twSheetClose = input<unknown>(undefined);\n\n /** Native button `type`. Defaults to `'button'` to avoid accidental form submission. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n\n protected onClick(): void {\n this.sheetRef?.close(this.twSheetClose());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["CdkDialogConfig"],"mappings":";;;;;;;;;AAgCA;;;;;AAKG;AACG,MAAO,WAAsC,SAAQA,YAAqB,CAAA;;IAE9E,IAAI,GAAe,OAAO;;IAG1B,IAAI,GAAe,IAAI;;IAGvB,sBAAsB,GA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ref.ts","../../../projects/ngx-tw/sheet/sheet.ts","../../../projects/ngx-tw/sheet/sheet-content.ts","../../../projects/ngx-tw/sheet/cdevhub-ngx-tw-sheet.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport {\n type AutoFocusTarget,\n DialogConfig as CdkDialogConfig,\n type DialogRole,\n type RestoreFocusValue,\n} from '@angular/cdk/dialog';\n\n/** Edge the sheet anchors against. */\nexport type SheetSide = 'top' | 'right' | 'bottom' | 'left';\n\n/**\n * Preset size for the sheet panel.\n *\n * Sizing is axis-dependent:\n * - `'left' | 'right'` — controls panel width (height is always `100vh`).\n * - `'top' | 'bottom'` — controls panel height (width is always `100vw`).\n */\nexport type SheetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\n/** ARIA role of the sheet element. Use `'alertdialog'` for destructive confirmation surfaces. */\nexport type SheetRole = DialogRole;\n\n/** Where to move focus when the sheet opens. */\nexport type SheetAutoFocus = AutoFocusTarget | string | boolean;\n\n/** How to restore focus on close. `true` restores to the previously focused element; a selector or element targets a specific node. */\nexport type SheetRestoreFocus = RestoreFocusValue;\n\n/** Scroll behavior for content underneath the sheet. */\nexport type SheetScrollStrategy = 'block' | 'close' | 'reposition' | 'noop';\n\n/**\n * Configuration for opening a sheet with {@link Sheet.open}.\n *\n * Extends `@angular/cdk/dialog`'s `DialogConfig` with sheet-specific options\n * (`side`, `size`, animation durations, split close flags).\n */\nexport class SheetConfig<D = unknown, R = unknown> extends CdkDialogConfig<D, R> {\n /** Edge the sheet anchors against. Defaults to `'right'`. */\n side?: SheetSide = 'right';\n\n /** Preset size for the sheet panel. Axis-dependent (width for left/right, height for top/bottom). Defaults to `'md'`. */\n size?: SheetSize = 'md';\n\n /** Duration of the open slide animation in ms. Defaults to `200`. Use `0` to disable. */\n enterAnimationDuration?: number = 200;\n\n /**\n * Duration of the close slide animation in ms. Defaults to `160`. Use `0` to disable.\n * Asymmetric with `enterAnimationDuration` by design — the close transition is slightly\n * faster so the sheet feels dismissive rather than reluctant.\n */\n exitAnimationDuration?: number = 160;\n\n /** Scroll strategy preset applied when `scrollStrategy` isn't set. Defaults to `'block'`. */\n scrollBehavior?: SheetScrollStrategy = 'block';\n\n /**\n * Whether the sheet is modal — sets `aria-modal` on the container. Defaults to `true`:\n * a sheet opened over the page is modal by default and the rest of the document is\n * inert while it is open. Set to `false` only for non-modal surfaces.\n */\n override ariaModal?: boolean = true;\n\n /** Whether the sheet renders a backdrop. Defaults to `true`. */\n override hasBackdrop?: boolean = true;\n\n /**\n * Whether pressing `Escape` closes the sheet.\n *\n * Defaults to `true` — Escape is the universal dismiss key for modal surfaces; the\n * \"swallow Escape\" variant is the special case. `disableClose` overrides this when\n * `true`.\n */\n closeOnEscape?: boolean = true;\n\n /**\n * Whether clicking the backdrop closes the sheet.\n *\n * Defaults to `true` — clicking outside a modal sheet is the expected dismiss\n * gesture; enforcing an explicit dismiss button is the special case. `disableClose`\n * overrides this when `true`.\n */\n closeOnBackdropClick?: boolean = true;\n\n /**\n * Whether Escape AND backdrop clicks are blocked. Defaults to `false`.\n * When `true`, this overrides both `closeOnEscape` and `closeOnBackdropClick`.\n */\n override disableClose?: boolean = false;\n\n /** Whether navigation (e.g. router) closes the sheet. Defaults to `true`. */\n override closeOnNavigation?: boolean = true;\n\n /** Where to move focus when the sheet opens. Defaults to `'first-tabbable'`. */\n override autoFocus?: SheetAutoFocus = 'first-tabbable';\n\n /** Whether to restore focus to the previously focused element after close. Defaults to `true`. */\n override restoreFocus?: SheetRestoreFocus = true;\n}\n\n/** Injection token carrying the `data` value passed via {@link SheetConfig.data}. */\nexport const TW_SHEET_DATA = new InjectionToken<unknown>('TW_SHEET_DATA');\n\n/** Injection token for application-wide default sheet options. Set via `provideSheet()`. */\nexport const TW_SHEET_DEFAULT_OPTIONS = new InjectionToken<Partial<SheetConfig>>(\n 'TW_SHEET_DEFAULT_OPTIONS',\n);\n\n/**\n * @deprecated Renamed to {@link TW_SHEET_DATA} for consistency with every other\n * ngx-tw injection token — and with `TW_DIALOG_DATA`, its direct counterpart.\n * This is the *same token instance*, not a copy — providing under either name\n * and injecting under the other resolves — so the rename is safe to adopt\n * incrementally. Removed in the next major.\n */\nexport const SHEET_DATA = TW_SHEET_DATA;\n\n/**\n * @deprecated Renamed to {@link TW_SHEET_DEFAULT_OPTIONS} for consistency with\n * every other ngx-tw injection token — and with `TW_DIALOG_DEFAULT_OPTIONS`,\n * its direct counterpart. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const SHEET_DEFAULT_OPTIONS = TW_SHEET_DEFAULT_OPTIONS;\n","import { type ComponentRef, signal, type Signal } from '@angular/core';\nimport { type DialogRef as CdkDialogRef } from '@angular/cdk/dialog';\nimport { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { filter, merge, type Observable, ReplaySubject, Subject, take } from 'rxjs';\nimport type { FocusOrigin } from '@angular/cdk/a11y';\nimport type { SheetConfig } from './sheet-config';\nimport type { SheetContainer, SheetState } from './sheet-container';\n\n/**\n * Reference to a sheet opened via {@link Sheet.open}. Drives the sheet\n * lifecycle (close, state, observables) and forwards useful overlay streams.\n *\n * The ref is returned **synchronously** from `open()`, but the sheet's render\n * layer (`@angular/cdk/dialog` + the Tailwind container) is loaded through a\n * dynamic `import()`. The ref therefore starts *detached*: `id`, `state`,\n * `close()`, the lifecycle observables, and panel mutations all work\n * immediately (mutations are buffered and replayed on attach), but the rendered\n * component instance does not exist yet — read it via {@link whenComponentReady}\n * instead of a synchronous `componentInstance` field.\n */\nexport class SheetRef<R = unknown, C = unknown> {\n /** Unique ID of the sheet. Generated eagerly by the service, so it is valid the instant `open()` returns. */\n readonly id: string;\n\n /** Current lifecycle state. Reactively readable. */\n readonly state: Signal<SheetState>;\n\n /** When `true`, close-via-escape AND close-via-backdrop are both disabled. */\n disableClose: boolean | undefined;\n\n /** When `false`, pressing Escape does not close the sheet. */\n closeOnEscape: boolean | undefined;\n\n /** When `false`, clicking the backdrop does not close the sheet. */\n closeOnBackdropClick: boolean | undefined;\n\n private readonly stateSignal = signal<SheetState>('opening');\n private readonly afterOpenedSubject = new ReplaySubject<void>(1);\n private readonly beforeClosedSubject = new ReplaySubject<R | undefined>(1);\n private readonly afterClosedSubject = new ReplaySubject<R | undefined>(1);\n // Facade-owned pass-throughs for the raw overlay streams, so a consumer that\n // subscribes before the render chunk attaches still receives events once it\n // does — the pre-deferral behaviour when `open()` wrapped a live `cdkRef`.\n private readonly backdropClickSubject = new Subject<MouseEvent>();\n private readonly keydownEventsSubject = new Subject<KeyboardEvent>();\n\n private cdkRef: CdkDialogRef<R, C> | null = null;\n private container: SheetContainer | null = null;\n\n private componentInstanceValue: C | null = null;\n private componentRefValue: ComponentRef<C> | null = null;\n private resolveComponentReady!: (value: C | null) => void;\n private readonly componentReadyPromise = new Promise<C | null>((resolve) => {\n this.resolveComponentReady = resolve;\n });\n\n // Buffered mutations issued before the render chunk attached the CDK backend.\n private readonly pendingPanelAdds: string[] = [];\n private readonly pendingPanelRemoves: string[] = [];\n\n private pendingResult: R | undefined;\n private closeFocusOrigin: FocusOrigin | undefined;\n\n constructor(id: string, readonly config: SheetConfig<unknown, R>) {\n this.id = id;\n this.disableClose = config.disableClose;\n this.closeOnEscape = config.closeOnEscape;\n this.closeOnBackdropClick = config.closeOnBackdropClick;\n this.state = this.stateSignal.asReadonly();\n }\n\n /** The Tailwind container instance, or `null` until the sheet has attached. */\n get containerInstance(): SheetContainer | null {\n return this.container;\n }\n\n /**\n * @internal Wire this facade to its CDK backend. Called from the sheet\n * renderer **inside** `cdkDialog.open()`'s `providers` callback — the same\n * point the constructor ran before deferral — so subscriptions to\n * `animationStateChanged` are in place before the container emits `'open'`.\n */\n _attach(cdkRef: CdkDialogRef<R, C>, container: SheetContainer): void {\n this.cdkRef = cdkRef;\n this.container = container;\n\n // Forward the raw overlay streams into the facade pass-throughs.\n cdkRef.backdropClick.subscribe(this.backdropClickSubject);\n cdkRef.keydownEvents.subscribe(this.keydownEventsSubject);\n\n cdkRef.addPanelClass('tw-sheet-panel');\n for (const cls of this.pendingPanelAdds) cdkRef.addPanelClass(cls);\n for (const cls of this.pendingPanelRemoves) cdkRef.removePanelClass(cls);\n this.pendingPanelAdds.length = 0;\n this.pendingPanelRemoves.length = 0;\n\n const animationChanges = container.animationStateChanged;\n\n animationChanges\n .pipe(\n filter((event) => event.state === 'open'),\n take(1),\n )\n .subscribe(() => {\n this.stateSignal.set('open');\n this.afterOpenedSubject.next();\n this.afterOpenedSubject.complete();\n });\n\n // The container owns the exit-animation fallback timer\n // (ANIMATION_FALLBACK_PADDING in sheet-container.ts), so we trust its\n // `closed` emission and run finishClose exactly once from here.\n animationChanges\n .pipe(\n filter((event) => event.state === 'closed'),\n take(1),\n )\n .subscribe(() => this.finishClose());\n\n cdkRef.overlayRef.detachments().subscribe(() => {\n if (this.stateSignal() !== 'closed') {\n this.beforeClosedSubject.next(this.pendingResult);\n this.beforeClosedSubject.complete();\n this.finishClose();\n }\n });\n\n merge(\n cdkRef.backdropClick.pipe(\n filter(() => !this.disableClose && this.closeOnBackdropClick !== false),\n ),\n cdkRef.keydownEvents.pipe(\n filter(\n (event) =>\n event.keyCode === ESCAPE &&\n !this.disableClose &&\n this.closeOnEscape !== false &&\n !hasModifierKey(event),\n ),\n ),\n ).subscribe((event) => {\n event.preventDefault();\n this.closeWithOrigin(event.type === 'keydown' ? 'keyboard' : 'mouse');\n });\n }\n\n /** @internal Record the rendered component after `cdkDialog.open()` returns. */\n _setComponent(instance: C | null, ref: ComponentRef<C> | null): void {\n this.componentInstanceValue = instance;\n this.componentRefValue = ref;\n this.resolveComponentReady(instance);\n }\n\n /**\n * Resolves with the rendered content-component instance once the sheet's\n * render chunk has loaded and attached. Resolves `null` for template sheets,\n * and for a sheet closed before it ever opened.\n *\n * Replaces the former synchronous `componentInstance` field, which cannot be\n * populated before the deferred render chunk lands.\n *\n * @example\n * ```ts\n * const ref = sheet.open(FilterSheet);\n * const filters = await ref.whenComponentReady();\n * filters?.reset();\n * ```\n */\n whenComponentReady(): Promise<C | null> {\n return this.componentReadyPromise;\n }\n\n /** The rendered component instance, or `null` if not yet attached / a template sheet. Prefer {@link whenComponentReady}. */\n get componentInstance(): C | null {\n return this.componentInstanceValue;\n }\n\n /** The rendered `ComponentRef`, or `null` if not yet attached / a template sheet. */\n get componentRef(): ComponentRef<C> | null {\n return this.componentRefValue;\n }\n\n /**\n * Closes the sheet. The exit slide animation runs before the overlay is disposed.\n * @param result Value forwarded to `afterClosed()` subscribers.\n */\n close(result?: R): void {\n this.closeWithOrigin('program', result);\n }\n\n /** Observable that emits once after the enter animation finishes. */\n afterOpened(): Observable<void> {\n return this.afterOpenedSubject.asObservable();\n }\n\n /** Observable that emits once when the close animation starts. */\n beforeClosed(): Observable<R | undefined> {\n return this.beforeClosedSubject.asObservable();\n }\n\n /** Observable that emits once after the sheet has fully closed and the overlay is disposed. */\n afterClosed(): Observable<R | undefined> {\n return this.afterClosedSubject.asObservable();\n }\n\n /** Backdrop click stream (emits even when `closeOnBackdropClick` / `disableClose` is set). Buffered — a subscription made before the sheet attaches receives events once it does. */\n backdropClick(): Observable<MouseEvent> {\n return this.backdropClickSubject.asObservable();\n }\n\n /** Keydown event stream for the overlay. Buffered — a subscription made before the sheet attaches receives events once it does. */\n keydownEvents(): Observable<KeyboardEvent> {\n return this.keydownEventsSubject.asObservable();\n }\n\n /** Adds CSS classes to the overlay panel. Buffered until attach. */\n addPanelClass(classes: string | string[]): this {\n if (this.cdkRef) {\n this.cdkRef.addPanelClass(classes);\n } else {\n this.pendingPanelAdds.push(...(Array.isArray(classes) ? classes : [classes]));\n }\n return this;\n }\n\n /** Removes CSS classes from the overlay panel. Buffered until attach. */\n removePanelClass(classes: string | string[]): this {\n if (this.cdkRef) {\n this.cdkRef.removePanelClass(classes);\n } else {\n this.pendingPanelRemoves.push(...(Array.isArray(classes) ? classes : [classes]));\n }\n return this;\n }\n\n private closeWithOrigin(origin: FocusOrigin, result?: R): void {\n if (this.stateSignal() === 'closing' || this.stateSignal() === 'closed') return;\n\n const predicate = this.config.closePredicate;\n if (\n predicate &&\n !predicate(\n result,\n this.config as unknown as Parameters<typeof predicate>[1],\n this.componentInstanceValue,\n )\n ) {\n return;\n }\n\n this.pendingResult = result;\n this.closeFocusOrigin = origin;\n this.stateSignal.set('closing');\n\n this.beforeClosedSubject.next(result);\n this.beforeClosedSubject.complete();\n\n if (!this.cdkRef) {\n // Closed before the render chunk attached: the overlay was never created,\n // so there is nothing to animate or dispose. Synthesize the closed state\n // and let the service skip opening entirely (it checks state()).\n this.finishClose();\n return;\n }\n\n this.cdkRef.overlayRef.detachBackdrop();\n this.container!._startExitAnimation();\n }\n\n private finishClose(): void {\n if (this.stateSignal() === 'closed') return;\n this.stateSignal.set('closed');\n\n this.afterClosedSubject.next(this.pendingResult);\n this.afterClosedSubject.complete();\n\n // Idempotent — a no-op if _setComponent already resolved with an instance.\n this.resolveComponentReady(null);\n this.backdropClickSubject.complete();\n this.keydownEventsSubject.complete();\n\n if (this.cdkRef?.containerInstance) {\n this.cdkRef.close(this.pendingResult, { focusOrigin: this.closeFocusOrigin });\n }\n\n this.componentInstanceValue = null;\n }\n}\n","import {\n inject,\n Injectable,\n Injector,\n type OnDestroy,\n type Provider,\n type TemplateRef,\n signal,\n type Signal,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n} from '@angular/core';\nimport type { ComponentType } from '@angular/cdk/portal';\nimport { defer, type Observable, startWith, Subject } from 'rxjs';\nimport {\n TW_SHEET_DEFAULT_OPTIONS,\n SheetConfig,\n} from './sheet-config';\nimport { SheetRef } from './sheet-ref';\n// Type-only: importing the renderer as a value would drag `@angular/cdk/dialog`\n// and the overlay strategies back into the eager chunk. See `sheet-renderer.ts`.\nimport type { openRenderedSheet } from './sheet-renderer';\n\nlet nextSheetId = 0;\n\nfunction generateSheetId(): string {\n return `tw-sheet-${++nextSheetId}`;\n}\n\n/**\n * Opens edge-anchored sheet (drawer) overlays. Composes `@angular/cdk/dialog`\n * for focus trapping, portals, and overlay plumbing — adds a `GlobalPositionStrategy`\n * pinned to the requested viewport edge, a Tailwind container with axis-aware\n * sizing, slide enter/exit animations, and split close-behavior flags.\n *\n * The rendering layer (`@angular/cdk/dialog` + the Tailwind container) is loaded\n * through a dynamic `import()` on the first `open()` call, so merely registering\n * this service costs nothing in the initial bundle. `open()` still returns its\n * {@link SheetRef} synchronously — the sheet is rendered once the chunk lands.\n * Read the rendered component via {@link SheetRef.whenComponentReady}.\n *\n * Not `providedIn: 'root'` — register it via {@link provideSheet}.\n */\n@Injectable()\nexport class Sheet implements OnDestroy {\n private readonly injector = inject(Injector);\n private readonly defaultOptions = inject(TW_SHEET_DEFAULT_OPTIONS, { optional: true }) ?? {};\n private readonly parentSheet = inject(Sheet, { optional: true, skipSelf: true });\n\n /** Cached renderer chunk import — kicked off on the first `open()`. */\n private rendererPromise: Promise<typeof openRenderedSheet | null> | null = null;\n private destroyed = false;\n\n private readonly openSheetsAtThisLevel = signal<readonly SheetRef<unknown, unknown>[]>([]);\n private readonly afterOpenedSubject = new Subject<SheetRef<unknown, unknown>>();\n private readonly afterAllClosedSubject = new Subject<void>();\n\n /** Reactively-readable list of currently-open sheets across the full sheet tree. */\n readonly openSheets: Signal<readonly SheetRef<unknown, unknown>[]> = this.parentSheet\n ? this.parentSheet.openSheets\n : this.openSheetsAtThisLevel.asReadonly();\n\n /** Emits every time a sheet is opened. */\n readonly afterOpened: Observable<SheetRef<unknown, unknown>> = this.parentSheet\n ? this.parentSheet.afterOpened\n : this.afterOpenedSubject.asObservable();\n\n /**\n * Emits when every open sheet has closed. Emits immediately on subscribe if\n * there are none open.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openSheets().length\n ? this.getAfterAllClosedSource()\n : this.getAfterAllClosedSource().pipe(startWith(undefined as void)),\n );\n\n /**\n * Opens a sheet using the given component or template.\n * @param content Component class or `TemplateRef`.\n * @param config Options merged over the application defaults.\n * @returns Reference controlling the opened sheet, returned synchronously.\n */\n open<R = unknown, D = unknown, C = unknown>(\n content: ComponentType<C> | TemplateRef<C>,\n config?: SheetConfig<D, R>,\n ): SheetRef<R, C> {\n const merged = this.resolveConfig<D, R>(config);\n const id = merged.id ?? generateSheetId();\n merged.id = id;\n\n // Enforce id uniqueness eagerly. CDK throws this synchronously from\n // `open()`; since our CDK open is now deferred, replicate the check here so\n // the error still surfaces at the call site rather than in a later tick.\n if (this.getSheetById(id)) {\n throw new Error(`Sheet with id \"${id}\" exists already. The sheet id must be unique.`);\n }\n\n const sheetRef = new SheetRef<R, C>(id, merged as unknown as SheetConfig<unknown, R>);\n\n const scope = this.parentSheet ?? this;\n scope.registerOpen(sheetRef as unknown as SheetRef<unknown, unknown>);\n sheetRef.afterClosed().subscribe(() => {\n scope.unregister(sheetRef as unknown as SheetRef<unknown, unknown>);\n });\n\n void this.renderWhenReady(content, merged, sheetRef);\n\n return sheetRef;\n }\n\n /** Closes every open sheet managed by this service (and child services). */\n closeAll(): void {\n const sheets = [...this.openSheets()];\n for (let i = sheets.length - 1; i >= 0; i--) sheets[i].close();\n }\n\n /** Looks up an open sheet by its id. */\n getSheetById<R = unknown, C = unknown>(id: string): SheetRef<R, C> | undefined {\n return this.openSheets().find((sheet) => sheet.id === id) as SheetRef<R, C> | undefined;\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n const sheets = [...this.openSheetsAtThisLevel()];\n for (let i = sheets.length - 1; i >= 0; i--) sheets[i].close();\n this.afterOpenedSubject.complete();\n this.afterAllClosedSubject.complete();\n }\n\n /**\n * @internal Resolves once the renderer chunk has loaded. Exposed for tests,\n * which must await the dynamic import before asserting on rendered DOM.\n */\n async _whenRendered(): Promise<void> {\n await this.loadRenderer();\n await Promise.resolve();\n }\n\n /**\n * Render a sheet once the renderer chunk has loaded. The ref was already\n * returned to the caller, so it may have been closed (or the service\n * destroyed) while the import was in flight — both skip the actual open.\n */\n private async renderWhenReady<R, D, C>(\n content: ComponentType<C> | TemplateRef<C>,\n merged: SheetConfig<D, R>,\n sheetRef: SheetRef<R, C>,\n ): Promise<void> {\n const openRendered = await this.loadRenderer();\n if (!openRendered || this.destroyed) return;\n // Closed before the chunk landed — the facade already synthesized its\n // closed state; never create the overlay.\n if (sheetRef.state() === 'closed') return;\n openRendered(this.injector, content, merged, sheetRef);\n }\n\n private loadRenderer(): Promise<typeof openRenderedSheet | null> {\n if (!this.rendererPromise) {\n this.rendererPromise = import('./sheet-renderer').then(({ openRenderedSheet }) =>\n this.destroyed ? null : openRenderedSheet,\n );\n }\n return this.rendererPromise;\n }\n\n private registerOpen(ref: SheetRef<unknown, unknown>): void {\n if (this.parentSheet) {\n this.parentSheet.registerOpen(ref);\n } else {\n this.openSheetsAtThisLevel.update((list) => [...list, ref]);\n this.afterOpenedSubject.next(ref);\n }\n }\n\n private unregister(ref: SheetRef<unknown, unknown>): void {\n if (this.parentSheet) {\n this.parentSheet.unregister(ref);\n } else {\n this.openSheetsAtThisLevel.update((list) => list.filter((d) => d !== ref));\n if (this.openSheetsAtThisLevel().length === 0) {\n this.afterAllClosedSubject.next();\n }\n }\n }\n\n private getAfterAllClosedSource(): Subject<void> {\n return this.parentSheet\n ? this.parentSheet.getAfterAllClosedSource()\n : this.afterAllClosedSubject;\n }\n\n private resolveConfig<D, R>(config: SheetConfig<D, R> | undefined): SheetConfig<D, R> {\n const merged = new SheetConfig<D, R>();\n Object.assign(merged, this.defaultOptions, config);\n return merged;\n }\n}\n\n/**\n * Registers the {@link Sheet} service for dependency injection.\n *\n * @param defaultOptions Optional defaults merged into every `open()` call.\n * @example\n * ```ts\n * provideSheet({ side: 'left', size: 'lg' })\n * ```\n */\nexport function provideSheet(defaultOptions?: Partial<SheetConfig>): EnvironmentProviders {\n const providers: Provider[] = [Sheet];\n if (defaultOptions) {\n providers.push({ provide: TW_SHEET_DEFAULT_OPTIONS, useValue: defaultOptions });\n }\n return makeEnvironmentProviders(providers);\n}\n","import {\n computed,\n Directive,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { CdkScrollable } from '@angular/cdk/scrolling';\nimport type { TwColor } from '@cdevhub/ngx-tw/core';\nimport { SheetRef } from './sheet-ref';\n\n/**\n * Header wrapper for a sheet. Provides consistent padding and spacing for\n * title + subtitle + leading icon, and separates the header from scrollable\n * content below.\n */\n@Directive({\n selector: '[twSheetHeader], tw-sheet-header',\n host: {\n class: 'flex items-start gap-3 px-6 pt-6 pb-4',\n },\n})\nexport class SheetHeaderDirective {}\n\n// Slot tokens own light/dark contrast — no `dark:` overrides, no shade picks.\n// See role slot conventions in `projects/ngx-tw/theme/_semantic.css`.\nconst ICON_COLOR_CLASSES: Record<TwColor, string> = {\n primary: 'bg-primary-soft text-primary-icon',\n secondary: 'bg-secondary-soft text-secondary-icon',\n accent: 'bg-accent-soft text-accent-icon',\n neutral: 'bg-neutral-soft text-neutral-icon',\n info: 'bg-info-soft text-info-icon',\n success: 'bg-success-soft text-success-icon',\n warning: 'bg-warning-soft text-warning-icon',\n error: 'bg-error-soft text-error-icon',\n};\n\n/**\n * Decorative leading icon for a sheet header. Use with a semantic `color` to\n * match destructive / informational / success sheets.\n */\n@Directive({\n selector: '[twSheetIcon]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class SheetIconDirective {\n /** Semantic color for the icon container. Defaults to a neutral surface. */\n readonly color = input<TwColor | undefined>(undefined);\n\n protected readonly classes = computed(() => {\n const base = 'flex size-10 shrink-0 items-center justify-center rounded-full';\n const color = this.color();\n return color ? `${base} ${ICON_COLOR_CLASSES[color]}` : `${base} bg-surface-muted text-fg`;\n });\n}\n\n/**\n * Sheet title. Registers its ID with the container's `aria-labelledby` queue\n * so screen readers announce it automatically.\n */\n@Directive({\n selector: '[twSheetTitle], tw-sheet-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class SheetTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-sheet-title-');\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n // directive's injector chain (e.g. heavily nested template portals). The\n // container ALWAYS resolves via element-injector traversal because the\n // directive lives inside `<tw-sheet-container>`'s DOM tree.\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._addAriaLabelledBy(this.id());\n }\n\n ngOnDestroy(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._removeAriaLabelledBy(this.id());\n }\n}\n\n/** Secondary line beneath the sheet title — intended for a short description. */\n@Directive({\n selector: '[twSheetSubtitle], tw-sheet-subtitle',\n host: {\n class: 'text-sm text-fg-muted',\n },\n})\nexport class SheetSubtitleDirective {}\n\n/**\n * Sheet description. Registers its ID with the container's `aria-describedby`\n * queue so screen readers announce the descriptive paragraph after the title.\n * Mirrors {@link SheetTitleDirective} but for `aria-describedby`.\n */\n@Directive({\n selector: '[twSheetDescription], tw-sheet-description',\n host: {\n '[id]': 'id()',\n },\n})\nexport class SheetDescriptionDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-sheet-description-');\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n\n /** Custom id for the description element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._addAriaDescribedBy(this.id());\n }\n\n ngOnDestroy(): void {\n const containerInstance = this.sheetRef?.containerInstance;\n if (containerInstance) containerInstance._removeAriaDescribedBy(this.id());\n }\n}\n\n/**\n * Scrollable content region of the sheet. Apply between the header and the\n * actions bar. Inherits CDK's `CdkScrollable` to play nicely with scroll\n * strategies and nested scrollables.\n */\n@Directive({\n selector: '[twSheetContent], tw-sheet-content',\n hostDirectives: [CdkScrollable],\n host: {\n class: 'flex-1 overflow-y-auto px-6 py-4 text-sm text-fg',\n },\n})\nexport class SheetContentDirective {}\n\n/** Horizontal alignment for sheet action buttons. */\nexport type SheetActionsAlign = 'start' | 'center' | 'end';\n\n/**\n * Bottom action bar of a sheet. Use inside the sheet content or template to\n * host Cancel/Confirm buttons. Stays pinned below scrollable content.\n */\n@Directive({\n selector: '[twSheetActions], tw-sheet-actions',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class SheetActionsDirective {\n /** Horizontal alignment of the action buttons. Defaults to `'end'`. */\n readonly align = input<SheetActionsAlign>('end');\n\n protected readonly classes = computed(() => {\n const align = this.align();\n const justify =\n align === 'start' ? 'justify-start' : align === 'center' ? 'justify-center' : 'justify-end';\n return `flex flex-wrap items-center gap-2 px-6 py-4 border-t border-border-muted ${justify}`;\n });\n}\n\n/**\n * Closes the enclosing sheet when the host button is clicked. Provide a\n * `[twSheetClose]` value to pass a result to `afterClosed()` subscribers.\n */\n@Directive({\n selector: '[twSheetClose]',\n host: {\n '(click)': 'onClick()',\n '[attr.type]': 'type()',\n },\n})\nexport class SheetCloseDirective {\n /** Value passed to `afterClosed()` when the button is clicked. Defaults to `undefined`. */\n readonly twSheetClose = input<unknown>(undefined);\n\n /** Native button `type`. Defaults to `'button'` to avoid accidental form submission. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n private readonly sheetRef = inject<SheetRef<unknown, unknown>>(SheetRef, { optional: true });\n\n protected onClick(): void {\n this.sheetRef?.close(this.twSheetClose());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["CdkDialogConfig"],"mappings":";;;;;;;;;AAgCA;;;;;AAKG;AACG,MAAO,WAAsC,SAAQA,YAAqB,CAAA;;IAE9E,IAAI,GAAe,OAAO;;IAG1B,IAAI,GAAe,IAAI;;IAGvB,sBAAsB,GAAY,GAAG;AAErC;;;;AAIG;IACH,qBAAqB,GAAY,GAAG;;IAGpC,cAAc,GAA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