ngwr 13.0.0 → 13.0.1
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/fesm2022/ngwr-border-glow.mjs +12 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +14 -3
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +6 -2
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +22 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +5 -2
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +24 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +6 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +21 -4
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +9 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs +11 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +474 -37
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +63 -11
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +36 -7
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +38 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +10 -3
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +6 -2
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +107 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/llms-full.txt +1 -1
- package/package.json +3 -3
- package/types/ngwr-breadcrumbs.d.ts +1 -0
- package/types/ngwr-fuzzy-text.d.ts +5 -0
- package/types/ngwr-icon-adapters-feather.d.ts +11 -0
- package/types/ngwr-icon.d.ts +42 -1
- package/types/ngwr-shiny-text.d.ts +1 -0
- package/types/ngwr-utils.d.ts +47 -1
- package/types/ngwr-version.d.ts +1 -1
|
@@ -110,13 +110,16 @@ class WrAutosize {
|
|
|
110
110
|
node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';
|
|
111
111
|
}
|
|
112
112
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrAutosize, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
113
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrAutosize, isStandalone: true, selector: "textarea[wrAutosize]", inputs: { minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput()" },
|
|
113
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrAutosize, isStandalone: true, selector: "textarea[wrAutosize]", inputs: { minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput()" }, properties: { "style.overflow": "'hidden'", "style.resize": "'none'" } }, ngImport: i0 });
|
|
114
114
|
}
|
|
115
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrAutosize, decorators: [{
|
|
116
116
|
type: Directive,
|
|
117
117
|
args: [{
|
|
118
118
|
selector: 'textarea[wrAutosize]',
|
|
119
|
-
|
|
119
|
+
// Bound rather than a static `style` attribute: a real attribute is refused
|
|
120
|
+
// under `style-src 'self'`, and the textarea then keeps the native resize
|
|
121
|
+
// grip, which fights the directive's own height management.
|
|
122
|
+
host: { '[style.overflow]': "'hidden'", '[style.resize]': "'none'", '(input)': 'onInput()' },
|
|
120
123
|
}]
|
|
121
124
|
}], ctorParameters: () => [], propDecorators: { minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }] } });
|
|
122
125
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-directives.mjs","sources":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/ngwr-directives.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\n }\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, PLATFORM_ID, afterEveryRender, effect, inject, input } from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n host: { style: 'overflow: hidden; resize: none;', '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { Directive, inject, input, output } from '@angular/core';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\" (copied)=\"toast('Copied!')\">Copy</button>\n * ```\n */\n@Directive({ selector: '[wrCopyToClipboard]', host: { '(click)': 'onClick()' } })\nexport class WrCopyToClipboard {\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n private readonly doc = inject(DOCUMENT);\n\n /** @internal */\n protected async onClick(): Promise<void> {\n const text = this.wrCopyToClipboard();\n const async = this.doc.defaultView?.navigator?.clipboard;\n\n try {\n if (async) {\n try {\n await async.writeText(text);\n } catch {\n // The legacy path is a RECOVERY from the async one, so it only runs\n // when there was an async attempt to recover from. Reached from the\n // fallback's own failure it just repeated the same refused write —\n // two selections and two focus jumps for one press.\n this.fallback(text);\n }\n } else {\n this.fallback(text);\n }\n } catch (error) {\n this.copyFailed.emit(error);\n return;\n }\n\n // Outside the try because the try's job is the WRITE. The shape this\n // replaced emitted inside it and recovered by calling `fallback` again, so\n // one refused write became two selections, two focus jumps and two `copied`\n // emissions. (A consumer's own `(copied)` handler cannot reach this frame\n // either way: `OutputEmitterRef.emit` catches what a listener throws and\n // hands it to the `ErrorHandler`.)\n this.copied.emit(text);\n }\n\n /**\n * Legacy clipboard write — hidden textarea + `execCommand('copy')`.\n *\n * Two things this has to get right beyond writing the text. `execCommand`\n * REPORTS refusal rather than throwing it: a document without focus hands back\n * `false` and copies nothing, so ignoring the return value shows a \"Copied!\"\n * toast over an unchanged clipboard. And selecting the textarea moves focus\n * into it, so removing the node afterwards drops focus on `<body>` — the user's\n * next Tab restarts from the top of the page, on every copy.\n */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n\n const previous = this.doc.activeElement;\n this.doc.body.appendChild(node);\n node.select();\n\n try {\n if (!this.doc.execCommand('copy')) throw new Error('The copy command was refused.');\n } finally {\n this.doc.body.removeChild(node);\n if (previous instanceof HTMLElement) previous.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;AASG;MAEU,WAAW,CAAA;;IAEb,WAAW,GAAG,KAAK,CAAC,IAAI,mFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEvD,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEjE,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;YACnB,IAAI,IAAI,CAAC,WAAW,EAAE;AAAE,gBAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;AACvD,QAAA,CAAC,CAAC;QACF,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;;AAEtB,gBAAA,cAAc,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YACrD;AACF,QAAA,CAAC,CAAC;IACJ;uGAhBW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,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E,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;;;ACtBhF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-directives.mjs","sources":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/ngwr-directives.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\n }\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, PLATFORM_ID, afterEveryRender, effect, inject, input } from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n // Bound rather than a static `style` attribute: a real attribute is refused\n // under `style-src 'self'`, and the textarea then keeps the native resize\n // grip, which fights the directive's own height management.\n host: { '[style.overflow]': \"'hidden'\", '[style.resize]': \"'none'\", '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { Directive, inject, input, output } from '@angular/core';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\" (copied)=\"toast('Copied!')\">Copy</button>\n * ```\n */\n@Directive({ selector: '[wrCopyToClipboard]', host: { '(click)': 'onClick()' } })\nexport class WrCopyToClipboard {\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n private readonly doc = inject(DOCUMENT);\n\n /** @internal */\n protected async onClick(): Promise<void> {\n const text = this.wrCopyToClipboard();\n const async = this.doc.defaultView?.navigator?.clipboard;\n\n try {\n if (async) {\n try {\n await async.writeText(text);\n } catch {\n // The legacy path is a RECOVERY from the async one, so it only runs\n // when there was an async attempt to recover from. Reached from the\n // fallback's own failure it just repeated the same refused write —\n // two selections and two focus jumps for one press.\n this.fallback(text);\n }\n } else {\n this.fallback(text);\n }\n } catch (error) {\n this.copyFailed.emit(error);\n return;\n }\n\n // Outside the try because the try's job is the WRITE. The shape this\n // replaced emitted inside it and recovered by calling `fallback` again, so\n // one refused write became two selections, two focus jumps and two `copied`\n // emissions. (A consumer's own `(copied)` handler cannot reach this frame\n // either way: `OutputEmitterRef.emit` catches what a listener throws and\n // hands it to the `ErrorHandler`.)\n this.copied.emit(text);\n }\n\n /**\n * Legacy clipboard write — hidden textarea + `execCommand('copy')`.\n *\n * Two things this has to get right beyond writing the text. `execCommand`\n * REPORTS refusal rather than throwing it: a document without focus hands back\n * `false` and copies nothing, so ignoring the return value shows a \"Copied!\"\n * toast over an unchanged clipboard. And selecting the textarea moves focus\n * into it, so removing the node afterwards drops focus on `<body>` — the user's\n * next Tab restarts from the top of the page, on every copy.\n */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n\n const previous = this.doc.activeElement;\n this.doc.body.appendChild(node);\n node.select();\n\n try {\n if (!this.doc.execCommand('copy')) throw new Error('The copy command was refused.');\n } finally {\n this.doc.body.removeChild(node);\n if (previous instanceof HTMLElement) previous.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;AASG;MAEU,WAAW,CAAA;;IAEb,WAAW,GAAG,KAAK,CAAC,IAAI,mFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEvD,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEjE,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;YACnB,IAAI,IAAI,CAAC,WAAW,EAAE;AAAE,gBAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;AACvD,QAAA,CAAC,CAAC;QACF,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;;AAEtB,gBAAA,cAAc,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YACrD;AACF,QAAA,CAAC,CAAC;IACJ;uGAhBW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB,SAAS;mBAAC,EAAE,QAAQ,EAAE,eAAe,E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AAE;AAEb,QAAA,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;AAAE,gBAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;QACrF;gBAAU;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YAC/B,IAAI,QAAQ,YAAY,WAAW;gBAAE,QAAQ,CAAC,KAAK,EAAE;QACvD;IACF;uGA3EW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,UAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,SAAS;mBAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;;;ACtBhF;;AAEG;;;;"}
|
package/fesm2022/ngwr-drawer.mjs
CHANGED
|
@@ -344,11 +344,11 @@ class WrDrawer {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
347
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrDrawer, isStandalone: true, selector: "wr-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showHandle: { classPropertyName: "showHandle", publicName: "showHandle", isSignal: true, isRequired: false, transformFunction: null }, safeArea: { classPropertyName: "safeArea", publicName: "safeArea", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: {
|
|
347
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrDrawer, isStandalone: true, selector: "wr-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showHandle: { classPropertyName: "showHandle", publicName: "showHandle", isSignal: true, isRequired: false, transformFunction: null }, safeArea: { classPropertyName: "safeArea", publicName: "safeArea", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "style.display": "'none'" } }, queries: [{ propertyName: "projectedTitle", first: true, predicate: WrDrawerTitle, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panelTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <div #panel [class]=\"panelClass()\">\n @if (showHandle()) {\n <div\n class=\"wr-drawer__handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n", encapsulation: i0.ViewEncapsulation.None });
|
|
348
348
|
}
|
|
349
349
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDrawer, decorators: [{
|
|
350
350
|
type: Component,
|
|
351
|
-
args: [{ selector: 'wr-drawer', encapsulation: ViewEncapsulation.None, host: { style: '
|
|
351
|
+
args: [{ selector: 'wr-drawer', encapsulation: ViewEncapsulation.None, host: { '[style.display]': "'none'" }, template: "<ng-template>\n <div #panel [class]=\"panelClass()\">\n @if (showHandle()) {\n <div\n class=\"wr-drawer__handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n" }]
|
|
352
352
|
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHandle", required: false }] }], safeArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "safeArea", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], panelTpl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], projectedTitle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WrDrawerTitle), { isSignal: true }] }] } });
|
|
353
353
|
|
|
354
354
|
/**
|
|
@@ -623,6 +623,28 @@ class WrDrawerManager {
|
|
|
623
623
|
});
|
|
624
624
|
const portal = new ComponentPortal(component, null, injector);
|
|
625
625
|
drawerRef.componentRef = overlayRef.attach(portal);
|
|
626
|
+
// Wired BEFORE the panel is decorated, and the order is the fix: everything
|
|
627
|
+
// below attaches attributes, a ✕ and a focus trap to an overlay that is
|
|
628
|
+
// already on screen, so anything that throws in there used to leave an
|
|
629
|
+
// `aria-modal` panel with no dismissal path at all — no ✕, no backdrop
|
|
630
|
+
// handler, no Escape — over the whole application, and no ref for the caller
|
|
631
|
+
// to close it with. A drawer that fails to finish opening must still be one
|
|
632
|
+
// the user can get rid of. Overlay subscriptions complete when the overlay is
|
|
633
|
+
// disposed, so no explicit teardown is required.
|
|
634
|
+
if (options.closeOnBackdropClick !== false) {
|
|
635
|
+
overlayRef.backdropClick().subscribe(() => drawerRef.close());
|
|
636
|
+
}
|
|
637
|
+
if (options.closeOnEscape !== false) {
|
|
638
|
+
overlayRef.keydownEvents().subscribe(event => {
|
|
639
|
+
if (event.key === 'Escape') {
|
|
640
|
+
event.preventDefault();
|
|
641
|
+
drawerRef.close();
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
if (options.closeOnNavigation !== false) {
|
|
646
|
+
this.watchNavigation(overlayRef, drawerRef);
|
|
647
|
+
}
|
|
626
648
|
if (this.isBrowser) {
|
|
627
649
|
const host = overlayRef.overlayElement;
|
|
628
650
|
host.setAttribute('role', 'dialog');
|
|
@@ -659,22 +681,6 @@ class WrDrawerManager {
|
|
|
659
681
|
drawerRef.focusTrap = trap;
|
|
660
682
|
void trap.focusInitialElementWhenReady();
|
|
661
683
|
}
|
|
662
|
-
// Overlay subscriptions complete when the overlay is disposed, so no
|
|
663
|
-
// explicit teardown is required.
|
|
664
|
-
if (options.closeOnBackdropClick !== false) {
|
|
665
|
-
overlayRef.backdropClick().subscribe(() => drawerRef.close());
|
|
666
|
-
}
|
|
667
|
-
if (options.closeOnEscape !== false) {
|
|
668
|
-
overlayRef.keydownEvents().subscribe(event => {
|
|
669
|
-
if (event.key === 'Escape') {
|
|
670
|
-
event.preventDefault();
|
|
671
|
-
drawerRef.close();
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
if (options.closeOnNavigation !== false) {
|
|
676
|
-
this.watchNavigation(overlayRef, drawerRef);
|
|
677
|
-
}
|
|
678
684
|
return drawerRef;
|
|
679
685
|
}
|
|
680
686
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-drawer.mjs","sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.ts","../../../projects/lib/drawer/directives/drawer-content.ts","../../../projects/lib/drawer/directives/drawer-footer.ts","../../../projects/lib/drawer/directives/drawer-close.ts","../../../projects/lib/drawer/ngwr-drawer.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Marks an element as the drawer's title row. Applies the `wr-drawer__title`\n * class so the drawer's stylesheet can lay it out alongside content and\n * footer slots. Auto-assigns an `id` so the drawer panel references it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"open\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>…</div>\n * </wr-drawer>\n * ```\n */\n@Directive({\n selector: '[wrDrawerTitle]',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n /** Generated id used by the drawer panel for `aria-labelledby`. */\n readonly id = `wr-drawer-title-${++uid}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport type { WrDrawerPosition } from './interfaces';\n\n/**\n * Side panel that slides in from an edge of the viewport. Two-way binds\n * `open` and renders into a CDK overlay so it sits above page content.\n *\n * Compose the body with `<wrDrawerTitle>`, `<wrDrawerContent>`, and\n * `<wrDrawerFooter>` directives.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"settingsOpen\" position=\"right\" width=\"24rem\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>...</div>\n * <div wrDrawerFooter>\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * </div>\n * </wr-drawer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrDrawer {\n /** Two-way bindable open state. */\n readonly open = model<boolean>(false);\n\n /** Side the drawer slides in from. @default 'right' */\n readonly position = input<WrDrawerPosition>('right');\n\n /** Width when position is left/right. Any CSS length. @default '20rem' */\n readonly width = input<string>('20rem');\n\n /** Height when position is top/bottom. Any CSS length. @default '16rem' */\n readonly height = input<string>('16rem');\n\n /**\n * Upper cap on height (top/bottom positions). Useful for bottom sheets\n * that should grow with content up to a viewport-relative max.\n * Any CSS length. @default null (no cap)\n */\n readonly maxHeight = input<string | null>(null);\n\n /**\n * Round the leading corners — the edge facing the viewport interior.\n * Common bottom-sheet styling. @default false\n */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Render a grab handle at the leading edge and enable swipe-to-dismiss:\n * drag the handle toward the drawer's edge (down for `bottom`, left for\n * `left`, …) and release past ~30% of the panel to close. @default false\n */\n readonly showHandle = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Pad the trailing edge with `env(safe-area-inset-*)` so content\n * doesn't sit under the iOS home indicator. @default false\n */\n readonly safeArea = input(false, { transform: coerceBooleanProperty });\n\n /** Show the dimming backdrop. @default true */\n readonly hasBackdrop = input(true, { transform: coerceBooleanProperty });\n\n /** Close when the backdrop is clicked. @default true */\n readonly closeOnBackdropClick = input(true, { transform: coerceBooleanProperty });\n\n /** Close on Escape. @default true */\n readonly closeOnEscape = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\n\n protected panelClass(): string {\n const parts = ['wr-drawer__panel', `wr-drawer__panel--${this.position()}`];\n if (this.rounded()) parts.push('wr-drawer__panel--rounded');\n if (this.safeArea()) parts.push('wr-drawer__panel--safe-area');\n if (this.closable()) parts.push('wr-drawer__panel--closable');\n // The handle sits on the LEADING edge, which for `left` / `right` is a\n // vertical rail rather than a row in the column — so it leaves the flow and\n // the panel has to reserve the gutter it floats over. Only the panel can do\n // that, and only if it knows the handle is there.\n if (this.showHandle()) parts.push('wr-drawer__panel--handle');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\n return parts.join(' ');\n }\n\n // Swipe-to-dismiss — gated to the grab handle, so it never fights the\n // panel's own scrolling. The panel follows the finger toward the closing\n // edge and closes past ~30% of its size, otherwise snaps back.\n\n private swipeStartX = 0;\n private swipeStartY = 0;\n private swiping = false;\n\n // Pointer, not Touch. The handle has always advertised itself to a mouse with\n // `cursor: grab`, but the gesture was bound to touch events only, so on a\n // desktop it could not be dragged at all. Pointer Events cover touch, mouse and\n // pen through one path — the same idiom `wr-splitter` already uses.\n\n protected onSwipeStart(event: PointerEvent): void {\n // Ignore secondary contacts of a multi-touch gesture.\n if (!event.isPrimary) return;\n this.swipeStartX = event.clientX;\n this.swipeStartY = event.clientY;\n this.swiping = true;\n // Capture, so the drag keeps reporting once the cursor leaves the 2.5rem\n // grabber — without it a mouse drag dies the moment it slips off the handle.\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n protected onSwipeMove(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n // Only follow the pointer when dragging toward the closing edge.\n if (delta * sign <= 0) {\n panel.style.transform = '';\n return;\n }\n panel.style.transition = 'none';\n panel.style.transform = axis === 'y' ? `translateY(${delta}px)` : `translateX(${delta}px)`;\n }\n\n /**\n * A cancelled pointer is an ABANDONED swipe, not a completed one — the system\n * took the gesture away (a call, a system gesture, an orientation change) and\n * no `pointerup` ever arrives. Routing it through `onSwipeEnd` dismissed the\n * drawer on an interruption the user did not ask for and, because the overlay\n * is disposed with the dragged offset applied, could not take back. Same rule\n * `wr-pull-to-refresh` states for `touchcancel`.\n */\n protected onSwipeCancel(panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n panel.style.transition = '';\n panel.style.transform = '';\n }\n\n protected onSwipeEnd(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n const panelSize = axis === 'y' ? panel.offsetHeight : panel.offsetWidth;\n if (delta * sign > panelSize * 0.3) {\n this.open.set(false); // keep the dragged offset as the overlay disposes\n } else {\n panel.style.transition = '';\n panel.style.transform = '';\n }\n }\n\n /** Axis + sign of the closing direction for the current position. */\n private closeAxis(): { axis: 'x' | 'y'; sign: number } {\n switch (this.position()) {\n case 'bottom':\n return { axis: 'y', sign: 1 };\n case 'top':\n return { axis: 'y', sign: -1 };\n case 'left':\n return { axis: 'x', sign: -1 };\n case 'right':\n default:\n return { axis: 'x', sign: 1 };\n }\n }\n\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private overlayRef: OverlayRef | null = null;\n private focusTrap: ConfigurableFocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n\n constructor() {\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n }\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n const pos = this.position();\n const isHorizontal = pos === 'left' || pos === 'right';\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') positionStrategy.top();\n else if (pos === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = this.maxHeight();\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: this.hasBackdrop(),\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n scrollStrategy: this.overlay.scrollStrategies.block(),\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const host = this.overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n this.focusTrap = this.focusTrapFactory.create(host);\n void this.focusTrap.focusInitialElementWhenReady();\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n}\n","<ng-template>\n <div #panel [class]=\"panelClass()\">\n @if (showHandle()) {\n <div\n class=\"wr-drawer__handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrAppendOverlayClose } from 'ngwr/overlay';\n\nimport { WrDrawerRef } from './drawer-ref';\nimport type { WrDrawerOptions, WrDrawerPosition } from './interfaces';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — drawers render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * `showHandle` / swipe-to-dismiss is component-only: it needs the drawer's own\n * wrapper markup, which the service path replaces with your component.\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = [\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n ];\n if (options.rounded) panelClasses.push('wr-drawer__panel--rounded');\n if (options.safeArea) panelClasses.push('wr-drawer__panel--safe-area');\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: options.hasBackdrop !== false,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n drawerRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n // Overlay subscriptions complete when the overlay is disposed, so no\n // explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`readI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Marks the scrollable body of the drawer. Applies the `wr-drawer__content`\n * class so the panel's flex layout can stretch it between the title and the\n * footer.\n */\n@Directive({\n selector: '[wrDrawerContent]',\n host: { class: 'wr-drawer__content' },\n})\nexport class WrDrawerContent {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, computed, input } from '@angular/core';\n\n/**\n * Marks the action row pinned to the bottom of the drawer. Adds the\n * `wr-drawer__footer` class plus an alignment modifier so action buttons\n * can sit at the start, center, or end of the row.\n *\n * @example\n * ```html\n * <div wrDrawerFooter align=\"end\">\n * <wr-btn wrDrawerClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" (click)=\"save()\">Save</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDrawerFooter]',\n host: { '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n /** Horizontal alignment of footer content. @default 'end' */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-drawer__footer wr-drawer__footer--${this.align()}`);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, inject, input } from '@angular/core';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAIH,IAAI,GAAG,GAAG,CAAC;AAEX;;;;;;;;;;;;;AAaG;MAKU,aAAa,CAAA;;AAEf,IAAA,EAAE,GAAG,CAAA,gBAAA,EAAmB,EAAE,GAAG,EAAE;uGAF7B,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE;AACvD,iBAAA;;;AC5BD;;;;;AAKG;AA8BH;;;;;;;;;;;;;;;;;;;AAmBG;MAOU,QAAQ,CAAA;;IAEV,IA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Aa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/B,iBAAA;;;AC/BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-drawer.mjs","sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.ts","../../../projects/lib/drawer/directives/drawer-content.ts","../../../projects/lib/drawer/directives/drawer-footer.ts","../../../projects/lib/drawer/directives/drawer-close.ts","../../../projects/lib/drawer/ngwr-drawer.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Marks an element as the drawer's title row. Applies the `wr-drawer__title`\n * class so the drawer's stylesheet can lay it out alongside content and\n * footer slots. Auto-assigns an `id` so the drawer panel references it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"open\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>…</div>\n * </wr-drawer>\n * ```\n */\n@Directive({\n selector: '[wrDrawerTitle]',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n /** Generated id used by the drawer panel for `aria-labelledby`. */\n readonly id = `wr-drawer-title-${++uid}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport type { WrDrawerPosition } from './interfaces';\n\n/**\n * Side panel that slides in from an edge of the viewport. Two-way binds\n * `open` and renders into a CDK overlay so it sits above page content.\n *\n * Compose the body with `<wrDrawerTitle>`, `<wrDrawerContent>`, and\n * `<wrDrawerFooter>` directives.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"settingsOpen\" position=\"right\" width=\"24rem\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>...</div>\n * <div wrDrawerFooter>\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * </div>\n * </wr-drawer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDrawer {\n /** Two-way bindable open state. */\n readonly open = model<boolean>(false);\n\n /** Side the drawer slides in from. @default 'right' */\n readonly position = input<WrDrawerPosition>('right');\n\n /** Width when position is left/right. Any CSS length. @default '20rem' */\n readonly width = input<string>('20rem');\n\n /** Height when position is top/bottom. Any CSS length. @default '16rem' */\n readonly height = input<string>('16rem');\n\n /**\n * Upper cap on height (top/bottom positions). Useful for bottom sheets\n * that should grow with content up to a viewport-relative max.\n * Any CSS length. @default null (no cap)\n */\n readonly maxHeight = input<string | null>(null);\n\n /**\n * Round the leading corners — the edge facing the viewport interior.\n * Common bottom-sheet styling. @default false\n */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Render a grab handle at the leading edge and enable swipe-to-dismiss:\n * drag the handle toward the drawer's edge (down for `bottom`, left for\n * `left`, …) and release past ~30% of the panel to close. @default false\n */\n readonly showHandle = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Pad the trailing edge with `env(safe-area-inset-*)` so content\n * doesn't sit under the iOS home indicator. @default false\n */\n readonly safeArea = input(false, { transform: coerceBooleanProperty });\n\n /** Show the dimming backdrop. @default true */\n readonly hasBackdrop = input(true, { transform: coerceBooleanProperty });\n\n /** Close when the backdrop is clicked. @default true */\n readonly closeOnBackdropClick = input(true, { transform: coerceBooleanProperty });\n\n /** Close on Escape. @default true */\n readonly closeOnEscape = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\n\n protected panelClass(): string {\n const parts = ['wr-drawer__panel', `wr-drawer__panel--${this.position()}`];\n if (this.rounded()) parts.push('wr-drawer__panel--rounded');\n if (this.safeArea()) parts.push('wr-drawer__panel--safe-area');\n if (this.closable()) parts.push('wr-drawer__panel--closable');\n // The handle sits on the LEADING edge, which for `left` / `right` is a\n // vertical rail rather than a row in the column — so it leaves the flow and\n // the panel has to reserve the gutter it floats over. Only the panel can do\n // that, and only if it knows the handle is there.\n if (this.showHandle()) parts.push('wr-drawer__panel--handle');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\n return parts.join(' ');\n }\n\n // Swipe-to-dismiss — gated to the grab handle, so it never fights the\n // panel's own scrolling. The panel follows the finger toward the closing\n // edge and closes past ~30% of its size, otherwise snaps back.\n\n private swipeStartX = 0;\n private swipeStartY = 0;\n private swiping = false;\n\n // Pointer, not Touch. The handle has always advertised itself to a mouse with\n // `cursor: grab`, but the gesture was bound to touch events only, so on a\n // desktop it could not be dragged at all. Pointer Events cover touch, mouse and\n // pen through one path — the same idiom `wr-splitter` already uses.\n\n protected onSwipeStart(event: PointerEvent): void {\n // Ignore secondary contacts of a multi-touch gesture.\n if (!event.isPrimary) return;\n this.swipeStartX = event.clientX;\n this.swipeStartY = event.clientY;\n this.swiping = true;\n // Capture, so the drag keeps reporting once the cursor leaves the 2.5rem\n // grabber — without it a mouse drag dies the moment it slips off the handle.\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n protected onSwipeMove(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n // Only follow the pointer when dragging toward the closing edge.\n if (delta * sign <= 0) {\n panel.style.transform = '';\n return;\n }\n panel.style.transition = 'none';\n panel.style.transform = axis === 'y' ? `translateY(${delta}px)` : `translateX(${delta}px)`;\n }\n\n /**\n * A cancelled pointer is an ABANDONED swipe, not a completed one — the system\n * took the gesture away (a call, a system gesture, an orientation change) and\n * no `pointerup` ever arrives. Routing it through `onSwipeEnd` dismissed the\n * drawer on an interruption the user did not ask for and, because the overlay\n * is disposed with the dragged offset applied, could not take back. Same rule\n * `wr-pull-to-refresh` states for `touchcancel`.\n */\n protected onSwipeCancel(panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n panel.style.transition = '';\n panel.style.transform = '';\n }\n\n protected onSwipeEnd(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n const panelSize = axis === 'y' ? panel.offsetHeight : panel.offsetWidth;\n if (delta * sign > panelSize * 0.3) {\n this.open.set(false); // keep the dragged offset as the overlay disposes\n } else {\n panel.style.transition = '';\n panel.style.transform = '';\n }\n }\n\n /** Axis + sign of the closing direction for the current position. */\n private closeAxis(): { axis: 'x' | 'y'; sign: number } {\n switch (this.position()) {\n case 'bottom':\n return { axis: 'y', sign: 1 };\n case 'top':\n return { axis: 'y', sign: -1 };\n case 'left':\n return { axis: 'x', sign: -1 };\n case 'right':\n default:\n return { axis: 'x', sign: 1 };\n }\n }\n\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private overlayRef: OverlayRef | null = null;\n private focusTrap: ConfigurableFocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n\n constructor() {\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n }\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n const pos = this.position();\n const isHorizontal = pos === 'left' || pos === 'right';\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') positionStrategy.top();\n else if (pos === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = this.maxHeight();\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: this.hasBackdrop(),\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n scrollStrategy: this.overlay.scrollStrategies.block(),\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const host = this.overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n this.focusTrap = this.focusTrapFactory.create(host);\n void this.focusTrap.focusInitialElementWhenReady();\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n}\n","<ng-template>\n <div #panel [class]=\"panelClass()\">\n @if (showHandle()) {\n <div\n class=\"wr-drawer__handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrAppendOverlayClose } from 'ngwr/overlay';\n\nimport { WrDrawerRef } from './drawer-ref';\nimport type { WrDrawerOptions, WrDrawerPosition } from './interfaces';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — drawers render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * `showHandle` / swipe-to-dismiss is component-only: it needs the drawer's own\n * wrapper markup, which the service path replaces with your component.\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = [\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n ];\n if (options.rounded) panelClasses.push('wr-drawer__panel--rounded');\n if (options.safeArea) panelClasses.push('wr-drawer__panel--safe-area');\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: options.hasBackdrop !== false,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n\n // Wired BEFORE the panel is decorated, and the order is the fix: everything\n // below attaches attributes, a ✕ and a focus trap to an overlay that is\n // already on screen, so anything that throws in there used to leave an\n // `aria-modal` panel with no dismissal path at all — no ✕, no backdrop\n // handler, no Escape — over the whole application, and no ref for the caller\n // to close it with. A drawer that fails to finish opening must still be one\n // the user can get rid of. Overlay subscriptions complete when the overlay is\n // disposed, so no explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n drawerRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`readI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Marks the scrollable body of the drawer. Applies the `wr-drawer__content`\n * class so the panel's flex layout can stretch it between the title and the\n * footer.\n */\n@Directive({\n selector: '[wrDrawerContent]',\n host: { class: 'wr-drawer__content' },\n})\nexport class WrDrawerContent {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, computed, input } from '@angular/core';\n\n/**\n * Marks the action row pinned to the bottom of the drawer. Adds the\n * `wr-drawer__footer` class plus an alignment modifier so action buttons\n * can sit at the start, center, or end of the row.\n *\n * @example\n * ```html\n * <div wrDrawerFooter align=\"end\">\n * <wr-btn wrDrawerClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" (click)=\"save()\">Save</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDrawerFooter]',\n host: { '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n /** Horizontal alignment of footer content. @default 'end' */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-drawer__footer wr-drawer__footer--${this.align()}`);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, inject, input } from '@angular/core';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAIH,IAAI,GAAG,GAAG,CA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GAAG,MAAM,CAA0B,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE/E,KAAK,GAAA;;;AAGb,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAC3B;QACF;QACA,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChC;uGAvBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/B,iBAAA;;;AC/BD;;AAEG;;;;"}
|
|
@@ -374,7 +374,7 @@ class WrDropdownMenu {
|
|
|
374
374
|
triggerId = signal(null, /* @ts-ignore */
|
|
375
375
|
...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
|
|
376
376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDropdownMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
377
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.4", type: WrDropdownMenu, isStandalone: true, selector: "wr-dropdown-menu", host: {
|
|
377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.4", type: WrDropdownMenu, isStandalone: true, selector: "wr-dropdown-menu", host: { properties: { "style.display": "'none'" } }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrDropdownMenu"], ngImport: i0, template: '<ng-template><div class="wr-dropdown-menu" role="menu" [attr.id]="menuId()" [attr.aria-labelledby]="triggerId() || null"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
378
378
|
}
|
|
379
379
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDropdownMenu, decorators: [{
|
|
380
380
|
type: Component,
|
|
@@ -383,7 +383,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
|
|
|
383
383
|
template: '<ng-template><div class="wr-dropdown-menu" role="menu" [attr.id]="menuId()" [attr.aria-labelledby]="triggerId() || null"><ng-content /></div></ng-template>',
|
|
384
384
|
exportAs: 'wrDropdownMenu',
|
|
385
385
|
encapsulation: ViewEncapsulation.None,
|
|
386
|
-
|
|
386
|
+
// A BOUND display rather than a static `style` attribute: Angular writes a
|
|
387
|
+
// binding through `style.setProperty`, which no CSP governs, while a real
|
|
388
|
+
// `style="…"` attribute is refused under `style-src 'self'` — and this host
|
|
389
|
+
// would then lay out an empty box in the middle of the content.
|
|
390
|
+
host: { '[style.display]': "'none'" },
|
|
387
391
|
}]
|
|
388
392
|
}], propDecorators: { contentTpl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
389
393
|
|