ngwr 16.1.0 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/date-picker/styles/_index.scss +89 -1
- package/dropdown/styles/_index.scss +37 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +152 -8
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +73 -9
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +86 -5
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +358 -24
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +7 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +7 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +7 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +7 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +7 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +7 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +7 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +7 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +7 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +7 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +7 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +7 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +7 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +7 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +7 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +7 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +7 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +7 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +7 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +7 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +7 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +7 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +246 -10
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +28 -6
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +17 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +87 -11
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
- package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sortable-list.mjs +257 -53
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/i18n/ar.json +7 -2
- package/i18n/cs.json +7 -2
- package/i18n/de.json +7 -2
- package/i18n/en.json +7 -2
- package/i18n/es.json +7 -2
- package/i18n/fr.json +7 -2
- package/i18n/he.json +7 -2
- package/i18n/hi.json +7 -2
- package/i18n/id.json +7 -2
- package/i18n/it.json +7 -2
- package/i18n/ja.json +7 -2
- package/i18n/ko.json +7 -2
- package/i18n/nl.json +7 -2
- package/i18n/pl.json +7 -2
- package/i18n/pt.json +7 -2
- package/i18n/ru.json +7 -2
- package/i18n/sv.json +7 -2
- package/i18n/tr.json +7 -2
- package/i18n/uk.json +7 -2
- package/i18n/vi.json +7 -2
- package/i18n/zh-TW.json +7 -2
- package/i18n/zh.json +7 -2
- package/lightbox/styles/_rules.scss +96 -0
- package/llms-full.txt +12 -8
- package/llms.txt +12 -0
- package/package.json +5 -1
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +2 -1
- package/slider/styles/_index.scss +106 -0
- package/sortable-list/styles/_rules.scss +23 -1
- package/types/ngwr-date-picker-testing.d.ts +17 -0
- package/types/ngwr-date-picker.d.ts +79 -2
- package/types/ngwr-date-stamp-testing.d.ts +1 -1
- package/types/ngwr-date-stamp.d.ts +53 -7
- package/types/ngwr-date.d.ts +118 -15
- package/types/ngwr-dropdown-testing.d.ts +53 -5
- package/types/ngwr-dropdown.d.ts +100 -0
- package/types/ngwr-lightbox-testing.d.ts +27 -0
- package/types/ngwr-lightbox.d.ts +71 -6
- package/types/ngwr-pipes.d.ts +33 -13
- package/types/ngwr-slider-testing.d.ts +8 -1
- package/types/ngwr-slider.d.ts +89 -3
- package/types/ngwr-sortable-list-testing.d.ts +79 -0
- package/types/ngwr-sortable-list.d.ts +113 -10
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-lightbox-testing.mjs","names":[],"sources":["../../../projects/lib/lightbox/testing/wr-lightbox-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrLightboxHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-lightbox>` — the thumbnail, and the full-size viewer it\n * opens.\n *\n * The thumbnail is an element in your fixture and the viewer is a portal in the NGWR\n * overlay container, so this is loaded from the normal fixture loader and reaches\n * across for you — scoped by the id the trigger publishes as `aria-controls`, never\n * by `.wr-lightbox-viewer`, which would answer with whichever lightbox opened first.\n *\n * **A closed lightbox has no viewer at all**, unlike the collapse or the speed dial:\n * the overlay is created on open and disposed on close, so every viewer read here\n * throws while it is shut rather than answering about a stale element.\n *\n * **`disablePreview` removes the button, not just its behaviour.** The thumbnail is\n * then a bare `<img>` with nothing to click and nothing in the tab order, which is\n * why {@link isInteractive} exists and why {@link open} explains itself rather than\n * timing out on a missing element.\n *\n * @example\n * ```ts\n * const lightbox = await loader.getHarness(WrLightboxHarness.with({ alt: 'Mountain' }));\n *\n * await lightbox.open();\n * expect(await lightbox.getFullSrc()).toBe('/photo.jpg');\n *\n * await lightbox.sendEscape();\n * expect(await lightbox.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrLightboxHarness extends ComponentHarness {\n static hostSelector = 'wr-lightbox';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrLightboxHarnessFilters = {}): HarnessPredicate<WrLightboxHarness> {\n return new HarnessPredicate(WrLightboxHarness, options)\n .addOption('alt', options.alt, (harness, alt) => HarnessPredicate.stringMatches(harness.getAlt(), alt))\n .addOption('caption', options.caption, (harness, caption) =>\n HarnessPredicate.stringMatches(harness.readCaption(), caption)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n private readonly thumb = this.locatorFor('.wr-lightbox__thumb');\n private readonly trigger = this.locatorForOptional('.wr-lightbox__trigger');\n\n /**\n * Whether the viewer is open, from the host's own modifier.\n *\n * The class rather than the overlay, because it is the answer that holds for a\n * harness you are HOLDING: the viewer is disposed on close, and a query for it\n * cannot tell \"shut\" apart from \"never opened\".\n */\n async isOpen(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--open');\n }\n\n /**\n * Whether the thumbnail has settled — loaded OR failed.\n *\n * A failure counts on purpose: the loading state animates a shimmer and hides the\n * image, so a broken `src` with no error path would shimmer for ever instead of\n * falling back to its alt text. The two cases are deliberately not separated here,\n * because the DOM does not separate them either.\n */\n async isLoading(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--loading');\n }\n\n /** The thumbnail's alt text — the same string the viewer takes its name from. */\n async getAlt(): Promise<string> {\n return (await this.thumb()).getProperty<string>('alt');\n }\n\n /**\n * What the THUMBNAIL is showing: `preview` when one was given, `src` otherwise.\n *\n * Worth its own method because the two images are different files by design — a\n * grid of thumbnails should not pull full-size originals — and because the\n * thumbnail never swaps to `src` later. Compare with {@link getFullSrc}.\n */\n async getThumbSrc(): Promise<string> {\n return (await this.thumb()).getProperty<string>('src');\n }\n\n /** Whether the thumbnail can be clicked open at all (`disablePreview` off). */\n async isInteractive(): Promise<boolean> {\n return (await this.trigger()) !== null;\n }\n\n /** The trigger's accessible name — falls back to the alt text, then to the catalog. */\n async getOpenLabel(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-label') : null;\n }\n\n /** Open the viewer. An already-open one is left alone; a non-interactive one throws. */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n const trigger = await this.trigger();\n if (!trigger) {\n throw new Error(\n 'WrLightboxHarness.open(): this lightbox has `disablePreview` set, so there is no trigger — the ' +\n 'thumbnail renders as a bare <img> with nothing to click and nothing in the tab order.'\n );\n }\n await trigger.click();\n }\n\n /** Close the viewer through its ✕ button. An already-closed one is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n await (await this.viewerPart('.wr-lightbox-viewer__close', 'close')).click();\n }\n\n /**\n * Click the full image — which closes the viewer.\n *\n * It looks like decoration and is not: the image is styled `cursor: zoom-out`, and\n * that is a promise. It is deliberately NOT in the tab order, since the ✕ button,\n * Escape, the backdrop and a swipe all do the same thing and all reach a keyboard —\n * so this is a mouse affordance, and the only way to assert it still works.\n */\n async clickImage(): Promise<void> {\n await (await this.viewerPart('.wr-lightbox-viewer__full', 'clickImage')).click();\n }\n\n /**\n * Press Escape.\n *\n * Sent to the viewer, though it would arrive from anywhere: the overlay is fed by\n * the CDK's keyboard dispatcher, which keeps one document listener and routes to\n * the top-most overlay.\n */\n async sendEscape(): Promise<void> {\n await (await this.requireViewer('sendEscape')).sendKeys(TestKey.ESCAPE);\n }\n\n /** The full-size image's `src`. Throws while the viewer is closed. */\n async getFullSrc(): Promise<string> {\n return (await this.viewerPart('.wr-lightbox-viewer__full', 'getFullSrc')).getProperty<string>('src');\n }\n\n /** The caption under the full image, or `null` when there is none. Throws while closed. */\n async getCaption(): Promise<string | null> {\n await this.requireViewer('getCaption');\n return this.readCaption();\n }\n\n /** The name the viewer dialog announces — its alt text, or the catalog's fallback. */\n async getViewerLabel(): Promise<string | null> {\n return (await this.requireViewer('getViewerLabel')).getAttribute('aria-label');\n }\n\n /** The ✕ button's accessible name. Throws while the viewer is closed. */\n async getCloseLabel(): Promise<string | null> {\n return (await this.viewerPart('.wr-lightbox-viewer__close', 'getCloseLabel')).getAttribute('aria-label');\n }\n\n /** Whether the viewer announces itself as a modal dialog. */\n async isModal(): Promise<boolean> {\n const viewer = await this.requireViewer('isModal');\n return (await viewer.getAttribute('role')) === 'dialog' && (await viewer.getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * Whether focus is inside the viewer, where the trap should be holding it.\n *\n * `role=\"dialog\"` with `aria-modal` promises the page behind is out of reach, and a\n * missing trap makes that a lie — Tab walks straight through the backdrop. Note\n * that in a unit test the trap needs elements with a box to find anything tabbable,\n * so a spec asserting this has to hand the DOM some dimensions first.\n */\n async isFocusTrapped(): Promise<boolean> {\n return (await this.requireViewer('isFocusTrapped')).matchesSelector(':focus-within');\n }\n\n /**\n * Whether the trigger's `aria-controls` names THIS lightbox's viewer, and nothing\n * else on the page.\n *\n * The reference only exists while the viewer does — an id naming an element that is\n * not in the document is not a pairing, it is a dangling reference — so this is\n * `false` for a closed lightbox by construction. Counted across the document too,\n * because two viewers answering to one id hand every reference to the first.\n */\n async isViewerBound(): Promise<boolean> {\n const id = await this.viewerId();\n if (!id) return false;\n\n const matches = await this.documentRootLocatorFactory().locatorForAll(`.wr-lightbox-viewer#${id}`)();\n const everywhere = await this.documentRootLocatorFactory().locatorForAll(`[id=\"${id}\"]`)();\n return matches.length === 1 && everywhere.length === 1;\n }\n\n /** The caption without the open check — for filters, which must not throw. */\n private async readCaption(): Promise<string | null> {\n const id = await this.viewerId();\n if (!id) return null;\n\n const caption = await this.documentRootLocatorFactory().locatorForOptional(`#${id} .wr-lightbox-viewer__caption`)();\n return caption ? caption.text() : null;\n }\n\n /** The id the trigger currently points at, or `null` while the viewer is closed. */\n private async viewerId(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-controls') : null;\n }\n\n private async requireViewer(method: string): Promise<TestElement> {\n const id = await this.viewerId();\n const viewer = id\n ? await this.documentRootLocatorFactory().locatorForOptional(`.wr-lightbox-viewer#${id}`)()\n : null;\n\n if (!viewer) {\n throw new Error(\n `WrLightboxHarness.${method}(): the viewer is not open. It is an overlay created on open and disposed ` +\n 'on close, so there is nothing to read while the lightbox is shut — call open() first.'\n );\n }\n return viewer;\n }\n\n private async viewerPart(selector: string, method: string): Promise<TestElement> {\n const viewer = await this.requireViewer(method);\n const id = await viewer.getAttribute('id');\n\n const part = await this.documentRootLocatorFactory().locatorForOptional(`#${id} ${selector}`)();\n if (!part) {\n throw new Error(`WrLightboxHarness.${method}(): the viewer has no \\`${selector}\\` element.`);\n }\n return part;\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"ngwr-lightbox-testing.mjs","names":[],"sources":["../../../projects/lib/lightbox/testing/wr-lightbox-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrLightboxHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-lightbox>` — the thumbnail, and the full-size viewer it\n * opens.\n *\n * The thumbnail is an element in your fixture and the viewer is a portal in the NGWR\n * overlay container, so this is loaded from the normal fixture loader and reaches\n * across for you — scoped by the id the trigger publishes as `aria-controls`, never\n * by `.wr-lightbox-viewer`, which would answer with whichever lightbox opened first.\n *\n * **A closed lightbox has no viewer at all**, unlike the collapse or the speed dial:\n * the overlay is created on open and disposed on close, so every viewer read here\n * throws while it is shut rather than answering about a stale element.\n *\n * **`disablePreview` removes the button, not just its behaviour.** The thumbnail is\n * then a bare `<img>` with nothing to click and nothing in the tab order, which is\n * why {@link isInteractive} exists and why {@link open} explains itself rather than\n * timing out on a missing element.\n *\n * @example\n * ```ts\n * const lightbox = await loader.getHarness(WrLightboxHarness.with({ alt: 'Mountain' }));\n *\n * await lightbox.open();\n * expect(await lightbox.getFullSrc()).toBe('/photo.jpg');\n *\n * await lightbox.sendEscape();\n * expect(await lightbox.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrLightboxHarness extends ComponentHarness {\n static hostSelector = 'wr-lightbox';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrLightboxHarnessFilters = {}): HarnessPredicate<WrLightboxHarness> {\n return new HarnessPredicate(WrLightboxHarness, options)\n .addOption('alt', options.alt, (harness, alt) => HarnessPredicate.stringMatches(harness.getAlt(), alt))\n .addOption('caption', options.caption, (harness, caption) =>\n HarnessPredicate.stringMatches(harness.readCaption(), caption)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n private readonly thumb = this.locatorFor('.wr-lightbox__thumb');\n private readonly trigger = this.locatorForOptional('.wr-lightbox__trigger');\n\n /**\n * Whether the viewer is open, from the host's own modifier.\n *\n * The class rather than the overlay, because it is the answer that holds for a\n * harness you are HOLDING: the viewer is disposed on close, and a query for it\n * cannot tell \"shut\" apart from \"never opened\".\n */\n async isOpen(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--open');\n }\n\n /**\n * Whether the thumbnail has settled — loaded OR failed.\n *\n * A failure counts on purpose: the loading state animates a shimmer and hides the\n * image, so a broken `src` with no error path would shimmer for ever instead of\n * falling back to its alt text. The two cases are deliberately not separated here,\n * because the DOM does not separate them either.\n */\n async isLoading(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--loading');\n }\n\n /** The thumbnail's alt text — the same string the viewer takes its name from. */\n async getAlt(): Promise<string> {\n return (await this.thumb()).getProperty<string>('alt');\n }\n\n /**\n * What the THUMBNAIL is showing: `preview` when one was given, `src` otherwise.\n *\n * Worth its own method because the two images are different files by design — a\n * grid of thumbnails should not pull full-size originals — and because the\n * thumbnail never swaps to `src` later. Compare with {@link getFullSrc}.\n */\n async getThumbSrc(): Promise<string> {\n return (await this.thumb()).getProperty<string>('src');\n }\n\n /** Whether the thumbnail can be clicked open at all (`disablePreview` off). */\n async isInteractive(): Promise<boolean> {\n return (await this.trigger()) !== null;\n }\n\n /** The trigger's accessible name — falls back to the alt text, then to the catalog. */\n async getOpenLabel(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-label') : null;\n }\n\n /** Open the viewer. An already-open one is left alone; a non-interactive one throws. */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n const trigger = await this.trigger();\n if (!trigger) {\n throw new Error(\n 'WrLightboxHarness.open(): this lightbox has `disablePreview` set, so there is no trigger — the ' +\n 'thumbnail renders as a bare <img> with nothing to click and nothing in the tab order.'\n );\n }\n await trigger.click();\n }\n\n /** Close the viewer through its ✕ button. An already-closed one is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n await (await this.viewerPart('.wr-lightbox-viewer__close', 'close')).click();\n }\n\n /**\n * Click the full image — which closes the viewer.\n *\n * It looks like decoration and is not: the image is styled `cursor: zoom-out`, and\n * that is a promise. It is deliberately NOT in the tab order, since the ✕ button,\n * Escape, the backdrop and a swipe all do the same thing and all reach a keyboard —\n * so this is a mouse affordance, and the only way to assert it still works.\n */\n async clickImage(): Promise<void> {\n await (await this.viewerPart('.wr-lightbox-viewer__full', 'clickImage')).click();\n }\n\n /**\n * Press Escape.\n *\n * Sent to the viewer, though it would arrive from anywhere: the overlay is fed by\n * the CDK's keyboard dispatcher, which keeps one document listener and routes to\n * the top-most overlay.\n */\n async sendEscape(): Promise<void> {\n await (await this.requireViewer('sendEscape')).sendKeys(TestKey.ESCAPE);\n }\n\n /** The full-size image's `src`. Throws while the viewer is closed. */\n async getFullSrc(): Promise<string> {\n return (await this.viewerPart('.wr-lightbox-viewer__full', 'getFullSrc')).getProperty<string>('src');\n }\n\n /**\n * The image the viewer is showing right now.\n *\n * {@link getFullSrc} under the name a gallery spec reads better with: after\n * {@link next} it is another member's `src`, not this lightbox's own.\n */\n async getCurrentSrc(): Promise<string> {\n return this.getFullSrc();\n }\n\n /**\n * Go to the next image of the group through the viewer's button.\n *\n * At the last image without `loop` the button is `aria-disabled` and the click\n * lands on nothing — read {@link isNextDisabled} to tell the two apart. Throws on\n * a lightbox that is closed, or that has no gallery to move through.\n */\n async next(): Promise<void> {\n await (await this.navButton('next', 'next')).click();\n }\n\n /** Go to the previous image of the group. The mirror of {@link next}. */\n async previous(): Promise<void> {\n await (await this.navButton('previous', 'previous')).click();\n }\n\n /** Whether the next button reports the end of the group (`aria-disabled`). */\n async isNextDisabled(): Promise<boolean> {\n return (await (await this.navButton('next', 'isNextDisabled')).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the previous button reports the start of the group (`aria-disabled`). */\n async isPreviousDisabled(): Promise<boolean> {\n return (await (await this.navButton('previous', 'isPreviousDisabled')).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * The counter as drawn, e.g. `2 / 3`, or `null` for a lightbox outside a gallery.\n * Throws while the viewer is closed.\n */\n async getCounter(): Promise<string | null> {\n const viewer = await this.requireViewer('getCounter');\n const id = await viewer.getAttribute('id');\n const counter = await this.documentRootLocatorFactory().locatorForOptional(`#${id} .wr-lightbox-viewer__counter`)();\n return counter ? counter.text() : null;\n }\n\n /** The caption under the full image, or `null` when there is none. Throws while closed. */\n async getCaption(): Promise<string | null> {\n await this.requireViewer('getCaption');\n return this.readCaption();\n }\n\n /** The name the viewer dialog announces — its alt text, or the catalog's fallback. */\n async getViewerLabel(): Promise<string | null> {\n return (await this.requireViewer('getViewerLabel')).getAttribute('aria-label');\n }\n\n /** The ✕ button's accessible name. Throws while the viewer is closed. */\n async getCloseLabel(): Promise<string | null> {\n return (await this.viewerPart('.wr-lightbox-viewer__close', 'getCloseLabel')).getAttribute('aria-label');\n }\n\n /** Whether the viewer announces itself as a modal dialog. */\n async isModal(): Promise<boolean> {\n const viewer = await this.requireViewer('isModal');\n return (await viewer.getAttribute('role')) === 'dialog' && (await viewer.getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * Whether focus is inside the viewer, where the trap should be holding it.\n *\n * `role=\"dialog\"` with `aria-modal` promises the page behind is out of reach, and a\n * missing trap makes that a lie — Tab walks straight through the backdrop. Note\n * that in a unit test the trap needs elements with a box to find anything tabbable,\n * so a spec asserting this has to hand the DOM some dimensions first.\n */\n async isFocusTrapped(): Promise<boolean> {\n return (await this.requireViewer('isFocusTrapped')).matchesSelector(':focus-within');\n }\n\n /**\n * Whether the trigger's `aria-controls` names THIS lightbox's viewer, and nothing\n * else on the page.\n *\n * The reference only exists while the viewer does — an id naming an element that is\n * not in the document is not a pairing, it is a dangling reference — so this is\n * `false` for a closed lightbox by construction. Counted across the document too,\n * because two viewers answering to one id hand every reference to the first.\n */\n async isViewerBound(): Promise<boolean> {\n const id = await this.viewerId();\n if (!id) return false;\n\n const matches = await this.documentRootLocatorFactory().locatorForAll(`.wr-lightbox-viewer#${id}`)();\n const everywhere = await this.documentRootLocatorFactory().locatorForAll(`[id=\"${id}\"]`)();\n return matches.length === 1 && everywhere.length === 1;\n }\n\n /** The caption without the open check — for filters, which must not throw. */\n private async readCaption(): Promise<string | null> {\n const id = await this.viewerId();\n if (!id) return null;\n\n const caption = await this.documentRootLocatorFactory().locatorForOptional(`#${id} .wr-lightbox-viewer__caption`)();\n return caption ? caption.text() : null;\n }\n\n /** The id the trigger currently points at, or `null` while the viewer is closed. */\n private async viewerId(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-controls') : null;\n }\n\n private async requireViewer(method: string): Promise<TestElement> {\n const id = await this.viewerId();\n const viewer = id\n ? await this.documentRootLocatorFactory().locatorForOptional(`.wr-lightbox-viewer#${id}`)()\n : null;\n\n if (!viewer) {\n throw new Error(\n `WrLightboxHarness.${method}(): the viewer is not open. It is an overlay created on open and disposed ` +\n 'on close, so there is nothing to read while the lightbox is shut — call open() first.'\n );\n }\n return viewer;\n }\n\n private async navButton(side: 'previous' | 'next', method: string): Promise<TestElement> {\n const viewer = await this.requireViewer(method);\n const id = await viewer.getAttribute('id');\n\n const button = await this.documentRootLocatorFactory().locatorForOptional(\n `#${id} .wr-lightbox-viewer__nav--${side}`\n )();\n if (!button) {\n throw new Error(\n `WrLightboxHarness.${method}(): this lightbox is not in a gallery, so the viewer has no ${side} button. ` +\n 'It needs a `group` shared with at least one other lightbox that can open.'\n );\n }\n return button;\n }\n\n private async viewerPart(selector: string, method: string): Promise<TestElement> {\n const viewer = await this.requireViewer(method);\n const id = await viewer.getAttribute('id');\n\n const part = await this.documentRootLocatorFactory().locatorForOptional(`#${id} ${selector}`)();\n if (!part) {\n throw new Error(`WrLightboxHarness.${method}(): the viewer has no \\`${selector}\\` element.`);\n }\n return part;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, DestroyRef, EnvironmentInjector, Injector, ViewContainerRef, ViewEncapsulation, computed, effect, inject, input, signal, viewChild } from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, ElementRef, EnvironmentInjector, Injector, PLATFORM_ID, Service, ViewContainerRef, ViewEncapsulation, computed, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
4
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
4
5
|
import { wrRestoreFocus, wrToClassList } from "ngwr/utils";
|
|
5
|
-
import { useI18nText } from "ngwr/i18n";
|
|
6
|
+
import { useI18nFormatter, useI18nText } from "ngwr/i18n";
|
|
6
7
|
import { Directionality } from "@angular/cdk/bidi";
|
|
7
8
|
import { TemplatePortal } from "@angular/cdk/portal";
|
|
8
9
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
@@ -14,6 +15,62 @@ import { ConfigurableFocusTrapFactory, FocusMonitor } from "@angular/cdk/a11y";
|
|
|
14
15
|
* Use of this source code is governed by an MIT-style license that can be
|
|
15
16
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
16
17
|
*/
|
|
18
|
+
var WrLightboxGroups = class WrLightboxGroups {
|
|
19
|
+
groups = /* @__PURE__ */ new Map();
|
|
20
|
+
add(group, member, host) {
|
|
21
|
+
this.entries(group).update((list) => [...list, {
|
|
22
|
+
member,
|
|
23
|
+
host
|
|
24
|
+
}]);
|
|
25
|
+
}
|
|
26
|
+
remove(group, member) {
|
|
27
|
+
const entries = this.entries(group);
|
|
28
|
+
entries.update((list) => list.filter((entry) => entry.member !== member));
|
|
29
|
+
if (!entries().length) this.groups.delete(group);
|
|
30
|
+
}
|
|
31
|
+
refresh(group) {
|
|
32
|
+
this.groups.get(group)?.update((list) => [...list]);
|
|
33
|
+
}
|
|
34
|
+
members(group) {
|
|
35
|
+
return [...this.entries(group)()].sort((a, b) => (a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0 ? -1 : 1).map((entry) => entry.member);
|
|
36
|
+
}
|
|
37
|
+
entries(group) {
|
|
38
|
+
let entries = this.groups.get(group);
|
|
39
|
+
if (!entries) {
|
|
40
|
+
entries = signal([]);
|
|
41
|
+
this.groups.set(group, entries);
|
|
42
|
+
}
|
|
43
|
+
return entries;
|
|
44
|
+
}
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
46
|
+
minVersion: "12.0.0",
|
|
47
|
+
version: "22.2.5",
|
|
48
|
+
ngImport: i0,
|
|
49
|
+
type: WrLightboxGroups,
|
|
50
|
+
deps: [],
|
|
51
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
52
|
+
});
|
|
53
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
54
|
+
minVersion: "22.0.0",
|
|
55
|
+
version: "22.2.5",
|
|
56
|
+
ngImport: i0,
|
|
57
|
+
type: WrLightboxGroups
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
61
|
+
minVersion: "12.0.0",
|
|
62
|
+
version: "22.2.5",
|
|
63
|
+
ngImport: i0,
|
|
64
|
+
type: WrLightboxGroups,
|
|
65
|
+
decorators: [{ type: Service }]
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* @license
|
|
69
|
+
*
|
|
70
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
71
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
72
|
+
*/
|
|
73
|
+
const SWIPE_STEP_PX = 48;
|
|
17
74
|
let viewerUid = 0;
|
|
18
75
|
var WrLightbox = class WrLightbox {
|
|
19
76
|
openLabel = input(null, ...ngDevMode ? [{ debugName: "openLabel" }] : /* istanbul ignore next */ []);
|
|
@@ -27,7 +84,7 @@ var WrLightbox = class WrLightbox {
|
|
|
27
84
|
if (explicit) return explicit;
|
|
28
85
|
return this.alt();
|
|
29
86
|
}), "image.open", "Open preview");
|
|
30
|
-
resolvedViewerLabel = useI18nText(this.alt, "image.viewer", "Image preview");
|
|
87
|
+
resolvedViewerLabel = useI18nText(computed(() => this.shown().alt()), "image.viewer", "Image preview");
|
|
31
88
|
disablePreview = input(false, {
|
|
32
89
|
...ngDevMode ? { debugName: "disablePreview" } : /* istanbul ignore next */ {},
|
|
33
90
|
transform: coerceBooleanProperty
|
|
@@ -35,6 +92,17 @@ var WrLightbox = class WrLightbox {
|
|
|
35
92
|
caption = input("", ...ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []);
|
|
36
93
|
aspectRatio = input(null, ...ngDevMode ? [{ debugName: "aspectRatio" }] : /* istanbul ignore next */ []);
|
|
37
94
|
panelClass = input(null, ...ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []);
|
|
95
|
+
group = input(null, ...ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []);
|
|
96
|
+
loop = input(false, {
|
|
97
|
+
...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
|
|
98
|
+
transform: coerceBooleanProperty
|
|
99
|
+
});
|
|
100
|
+
previousLabel = input(null, ...ngDevMode ? [{ debugName: "previousLabel" }] : /* istanbul ignore next */ []);
|
|
101
|
+
nextLabel = input(null, ...ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []);
|
|
102
|
+
resolvedPreviousLabel = useI18nText(this.previousLabel, "common.previous", "Previous");
|
|
103
|
+
resolvedNextLabel = useI18nText(this.nextLabel, "common.next", "Next");
|
|
104
|
+
counterText = useI18nFormatter("image.counter", "{{current}} / {{total}}");
|
|
105
|
+
positionText = useI18nFormatter("image.position", "Image {{current}} of {{total}}");
|
|
38
106
|
open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
39
107
|
loaded = signal(false, ...ngDevMode ? [{ debugName: "loaded" }] : /* istanbul ignore next */ []);
|
|
40
108
|
viewerId = `wr-lightbox-viewer-${++viewerUid}`;
|
|
@@ -45,6 +113,9 @@ var WrLightbox = class WrLightbox {
|
|
|
45
113
|
return parts.join(" ");
|
|
46
114
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
47
115
|
panelTpl = viewChild.required("viewerTpl", ...ngDevMode ? [{ debugName: "panelTpl" }] : /* istanbul ignore next */ []);
|
|
116
|
+
groups = inject(WrLightboxGroups);
|
|
117
|
+
host = inject(ElementRef).nativeElement;
|
|
118
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
48
119
|
focusMonitor = inject(FocusMonitor);
|
|
49
120
|
overlay = inject(WR_OVERLAY);
|
|
50
121
|
vcr = inject(ViewContainerRef);
|
|
@@ -55,25 +126,100 @@ var WrLightbox = class WrLightbox {
|
|
|
55
126
|
focusTrap = null;
|
|
56
127
|
previouslyFocused = null;
|
|
57
128
|
overlayRef = null;
|
|
129
|
+
gallery = computed(() => {
|
|
130
|
+
const group = this.group();
|
|
131
|
+
if (!group) return [];
|
|
132
|
+
const members = this.groups.members(group).filter((member) => !member.disablePreview());
|
|
133
|
+
return members.length > 1 && members.includes(this) ? members : [];
|
|
134
|
+
}, ...ngDevMode ? [{ debugName: "gallery" }] : /* istanbul ignore next */ []);
|
|
135
|
+
target = signal(null, ...ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []);
|
|
136
|
+
lastIndex = 0;
|
|
137
|
+
shown = computed(() => {
|
|
138
|
+
const target = this.target();
|
|
139
|
+
return target && this.gallery().includes(target) ? target : this;
|
|
140
|
+
}, ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
|
|
141
|
+
index = computed(() => this.gallery().indexOf(this.shown()), ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
|
|
142
|
+
canPrevious = computed(() => this.loop() || this.index() > 0, ...ngDevMode ? [{ debugName: "canPrevious" }] : /* istanbul ignore next */ []);
|
|
143
|
+
canNext = computed(() => this.loop() || this.index() < this.gallery().length - 1, ...ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []);
|
|
144
|
+
counter = computed(() => this.counterText(this.place()), ...ngDevMode ? [{ debugName: "counter" }] : /* istanbul ignore next */ []);
|
|
145
|
+
announcement = computed(() => {
|
|
146
|
+
const alt = this.shown().alt();
|
|
147
|
+
const position = this.positionText(this.place());
|
|
148
|
+
return alt ? `${position}, ${alt}` : position;
|
|
149
|
+
}, ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
|
|
150
|
+
preloaded = /* @__PURE__ */ new Set();
|
|
58
151
|
constructor() {
|
|
59
152
|
this.destroyRef.onDestroy(() => this.closeOverlay());
|
|
60
153
|
effect(() => {
|
|
61
154
|
if (this.open()) this.openOverlay();
|
|
62
155
|
else this.closeOverlay();
|
|
63
156
|
});
|
|
157
|
+
effect((onCleanup) => {
|
|
158
|
+
const group = this.group();
|
|
159
|
+
if (!group) return;
|
|
160
|
+
this.groups.add(group, this, this.host);
|
|
161
|
+
onCleanup(() => this.groups.remove(group, this));
|
|
162
|
+
});
|
|
163
|
+
effect(() => {
|
|
164
|
+
const target = this.target();
|
|
165
|
+
if (!target) return;
|
|
166
|
+
const gallery = this.gallery();
|
|
167
|
+
const index = gallery.indexOf(target);
|
|
168
|
+
if (index >= 0) {
|
|
169
|
+
this.lastIndex = index;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
untracked(() => this.target.set(gallery[Math.min(this.lastIndex, gallery.length - 1)] ?? null));
|
|
173
|
+
});
|
|
174
|
+
effect(() => {
|
|
175
|
+
if (!this.isBrowser || !this.open()) return;
|
|
176
|
+
const gallery = this.gallery();
|
|
177
|
+
this.preloaded.add(this.shown().src());
|
|
178
|
+
for (const delta of [-1, 1]) {
|
|
179
|
+
const neighbour = gallery[this.wrap(this.index() + delta)];
|
|
180
|
+
if (neighbour) this.preload(neighbour.src());
|
|
181
|
+
}
|
|
182
|
+
});
|
|
64
183
|
}
|
|
65
184
|
onClick() {
|
|
66
185
|
if (this.disablePreview()) return;
|
|
186
|
+
const group = this.group();
|
|
187
|
+
if (group) this.groups.refresh(group);
|
|
188
|
+
this.target.set(this);
|
|
67
189
|
this.open.set(true);
|
|
68
190
|
}
|
|
191
|
+
step(delta) {
|
|
192
|
+
this.show(this.wrap(this.index() + delta));
|
|
193
|
+
}
|
|
194
|
+
show(index) {
|
|
195
|
+
const member = this.gallery()[index];
|
|
196
|
+
if (member) this.target.set(member);
|
|
197
|
+
}
|
|
198
|
+
wrap(index) {
|
|
199
|
+
const total = this.gallery().length;
|
|
200
|
+
return this.loop() && total ? (index + total) % total : index;
|
|
201
|
+
}
|
|
202
|
+
place() {
|
|
203
|
+
return {
|
|
204
|
+
current: this.index() + 1,
|
|
205
|
+
total: this.gallery().length
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
preload(src) {
|
|
209
|
+
if (this.preloaded.has(src)) return;
|
|
210
|
+
this.preloaded.add(src);
|
|
211
|
+
new Image().src = src;
|
|
212
|
+
}
|
|
69
213
|
onClose() {
|
|
70
214
|
this.open.set(false);
|
|
71
215
|
}
|
|
216
|
+
viewerStartX = 0;
|
|
72
217
|
viewerStartY = 0;
|
|
73
218
|
viewerSwiping = false;
|
|
74
219
|
onViewerSwipeStart(event) {
|
|
75
220
|
const touch = event.touches[0];
|
|
76
221
|
if (!touch) return;
|
|
222
|
+
this.viewerStartX = touch.clientX;
|
|
77
223
|
this.viewerStartY = touch.clientY;
|
|
78
224
|
this.viewerSwiping = true;
|
|
79
225
|
}
|
|
@@ -82,7 +228,7 @@ var WrLightbox = class WrLightbox {
|
|
|
82
228
|
const touch = event.touches[0];
|
|
83
229
|
if (!touch) return;
|
|
84
230
|
const dy = touch.clientY - this.viewerStartY;
|
|
85
|
-
if (dy <= 0) {
|
|
231
|
+
if (dy <= 0 || this.isSideways(touch.clientX - this.viewerStartX, dy)) {
|
|
86
232
|
viewer.style.transform = "";
|
|
87
233
|
viewer.style.opacity = "";
|
|
88
234
|
return;
|
|
@@ -96,13 +242,23 @@ var WrLightbox = class WrLightbox {
|
|
|
96
242
|
if (!this.viewerSwiping) return;
|
|
97
243
|
this.viewerSwiping = false;
|
|
98
244
|
const touch = event.changedTouches[0];
|
|
99
|
-
|
|
245
|
+
const dx = touch ? touch.clientX - this.viewerStartX : 0;
|
|
246
|
+
const dy = touch ? touch.clientY - this.viewerStartY : 0;
|
|
247
|
+
if (this.isSideways(dx, dy)) {
|
|
248
|
+
if (Math.abs(dx) >= SWIPE_STEP_PX) this.step(dx < 0 !== this.isRtl() ? 1 : -1);
|
|
249
|
+
} else if (dy > (viewer.offsetHeight || 0) * .2) this.onClose();
|
|
100
250
|
else {
|
|
101
251
|
viewer.style.transition = "";
|
|
102
252
|
viewer.style.transform = "";
|
|
103
253
|
viewer.style.opacity = "";
|
|
104
254
|
}
|
|
105
255
|
}
|
|
256
|
+
isSideways(dx, dy) {
|
|
257
|
+
return this.gallery().length > 0 && Math.abs(dx) > Math.abs(dy);
|
|
258
|
+
}
|
|
259
|
+
isRtl() {
|
|
260
|
+
return this.dir?.value === "rtl";
|
|
261
|
+
}
|
|
106
262
|
onSettled() {
|
|
107
263
|
this.loaded.set(true);
|
|
108
264
|
}
|
|
@@ -127,9 +283,29 @@ var WrLightbox = class WrLightbox {
|
|
|
127
283
|
if (event.key === "Escape") {
|
|
128
284
|
event.preventDefault();
|
|
129
285
|
this.open.set(false);
|
|
130
|
-
}
|
|
286
|
+
} else this.onGalleryKey(event);
|
|
131
287
|
});
|
|
132
288
|
}
|
|
289
|
+
onGalleryKey(event) {
|
|
290
|
+
const total = this.gallery().length;
|
|
291
|
+
if (!total || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
292
|
+
switch (event.key) {
|
|
293
|
+
case "ArrowLeft":
|
|
294
|
+
this.step(this.isRtl() ? 1 : -1);
|
|
295
|
+
break;
|
|
296
|
+
case "ArrowRight":
|
|
297
|
+
this.step(this.isRtl() ? -1 : 1);
|
|
298
|
+
break;
|
|
299
|
+
case "Home":
|
|
300
|
+
this.show(0);
|
|
301
|
+
break;
|
|
302
|
+
case "End":
|
|
303
|
+
this.show(total - 1);
|
|
304
|
+
break;
|
|
305
|
+
default: return;
|
|
306
|
+
}
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
}
|
|
133
309
|
closeOverlay() {
|
|
134
310
|
if (!this.overlayRef) return;
|
|
135
311
|
this.focusTrap?.destroy();
|
|
@@ -217,6 +393,34 @@ var WrLightbox = class WrLightbox {
|
|
|
217
393
|
isSignal: true,
|
|
218
394
|
isRequired: false,
|
|
219
395
|
transformFunction: null
|
|
396
|
+
},
|
|
397
|
+
group: {
|
|
398
|
+
classPropertyName: "group",
|
|
399
|
+
publicName: "group",
|
|
400
|
+
isSignal: true,
|
|
401
|
+
isRequired: false,
|
|
402
|
+
transformFunction: null
|
|
403
|
+
},
|
|
404
|
+
loop: {
|
|
405
|
+
classPropertyName: "loop",
|
|
406
|
+
publicName: "loop",
|
|
407
|
+
isSignal: true,
|
|
408
|
+
isRequired: false,
|
|
409
|
+
transformFunction: null
|
|
410
|
+
},
|
|
411
|
+
previousLabel: {
|
|
412
|
+
classPropertyName: "previousLabel",
|
|
413
|
+
publicName: "previousLabel",
|
|
414
|
+
isSignal: true,
|
|
415
|
+
isRequired: false,
|
|
416
|
+
transformFunction: null
|
|
417
|
+
},
|
|
418
|
+
nextLabel: {
|
|
419
|
+
classPropertyName: "nextLabel",
|
|
420
|
+
publicName: "nextLabel",
|
|
421
|
+
isSignal: true,
|
|
422
|
+
isRequired: false,
|
|
423
|
+
transformFunction: null
|
|
220
424
|
}
|
|
221
425
|
},
|
|
222
426
|
host: {
|
|
@@ -234,8 +438,8 @@ var WrLightbox = class WrLightbox {
|
|
|
234
438
|
isSignal: true
|
|
235
439
|
}],
|
|
236
440
|
ngImport: i0,
|
|
237
|
-
template: "@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"src()\" [alt]=\"alt()\" (click)=\"onClose()\" />\n @if (caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ caption() }}</div>\n }\n </div>\n</ng-template>\n",
|
|
238
|
-
styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-lightbox{display:inline-block;position:relative;overflow:hidden;border-radius:var(--wr-lightbox-radius, var(--wr-border-radius-base))}@supports (corner-shape: squircle){.wr-lightbox{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-radius, var(--wr-border-radius-base)) * 1.85)}}.wr-lightbox{background:var(--wr-color-hover)}.wr-lightbox--loading{min-height:var(--wr-lightbox-loading-min-height, 4rem)}.wr-lightbox--loading:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,color-mix(in srgb,var(--wr-color-surface) 45%,transparent) 50%,transparent 100%);background-size:200% 100%;animation:wr-lightbox-shimmer 1.4s linear infinite;pointer-events:none;z-index:1}.wr-lightbox__trigger{display:block;width:100%;height:100%;padding:0;margin:0;border:0;background:transparent;cursor:zoom-in}.wr-lightbox__trigger:focus-visible{outline:none}.wr-lightbox__thumb{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;position:relative;z-index:2;opacity:1;transition:opacity .25s ease}.wr-lightbox--loading .wr-lightbox__thumb{opacity:0}.wr-lightbox:has(.wr-lightbox__trigger:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}@keyframes wr-lightbox-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.wr-lightbox-backdrop{background:color-mix(in srgb,var(--wr-color-backdrop) 85%,transparent)}.wr-lightbox-overlay{pointer-events:auto}.wr-lightbox-viewer{--wr-lightbox-viewer-gap: var(--wr-space-lg);--wr-lightbox-viewer-padding: var(--wr-space-lg);display:flex;flex-direction:column;align-items:center;gap:var(--wr-lightbox-viewer-gap);max-width:95vw;max-height:95vh;max-height:95dvh;padding:var(--wr-lightbox-viewer-padding);animation:wr-lightbox-viewer-in .18s ease;outline:none;touch-action:none}.wr-lightbox-viewer__close{--wr-lightbox-viewer-close-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;top:1rem;inset-inline-end:1rem;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-close-radius);background:#ffffff1f;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__close:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__close:hover{background:#fff3}.wr-lightbox-viewer__close:active{transform:scale(.95)}.wr-lightbox-viewer__close:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__full{--wr-lightbox-viewer-full-radius: var(--wr-border-radius-base);display:block;max-width:100%;max-height:calc(95vh - 4rem);max-height:calc(95dvh - 4rem);object-fit:contain;cursor:zoom-out;border-radius:var(--wr-lightbox-viewer-full-radius)}@supports (corner-shape: squircle){.wr-lightbox-viewer__full{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-viewer-full-radius) * 1.85)}}.wr-lightbox-viewer__caption{--wr-lightbox-viewer-caption-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-caption-font-size: var(--wr-text-sm);color:#ffffffd9;font-family:var(--wr-lightbox-viewer-caption-font-family);font-size:var(--wr-lightbox-viewer-caption-font-size);text-align:center;max-width:60ch}@keyframes wr-lightbox-viewer-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}\n"],
|
|
441
|
+
template: "@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__counter\" aria-hidden=\"true\">{{ counter() }}</span>\n <!-- `aria-disabled`, not `disabled`: a disabled button drops focus to <body>,\n out of the trap, the moment the last image is reached. -->\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--previous\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canPrevious()\"\n [attr.aria-label]=\"resolvedPreviousLabel()\"\n [attr.aria-disabled]=\"canPrevious() ? null : 'true'\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--next\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canNext()\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [attr.aria-disabled]=\"canNext() ? null : 'true'\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n }\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"shown().src()\" [alt]=\"shown().alt()\" (click)=\"onClose()\" />\n @if (shown().caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ shown().caption() }}</div>\n }\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__status\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n }\n </div>\n</ng-template>\n",
|
|
442
|
+
styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-lightbox{display:inline-block;position:relative;overflow:hidden;border-radius:var(--wr-lightbox-radius, var(--wr-border-radius-base))}@supports (corner-shape: squircle){.wr-lightbox{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-radius, var(--wr-border-radius-base)) * 1.85)}}.wr-lightbox{background:var(--wr-color-hover)}.wr-lightbox--loading{min-height:var(--wr-lightbox-loading-min-height, 4rem)}.wr-lightbox--loading:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,color-mix(in srgb,var(--wr-color-surface) 45%,transparent) 50%,transparent 100%);background-size:200% 100%;animation:wr-lightbox-shimmer 1.4s linear infinite;pointer-events:none;z-index:1}.wr-lightbox__trigger{display:block;width:100%;height:100%;padding:0;margin:0;border:0;background:transparent;cursor:zoom-in}.wr-lightbox__trigger:focus-visible{outline:none}.wr-lightbox__thumb{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;position:relative;z-index:2;opacity:1;transition:opacity .25s ease}.wr-lightbox--loading .wr-lightbox__thumb{opacity:0}.wr-lightbox:has(.wr-lightbox__trigger:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}@keyframes wr-lightbox-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.wr-lightbox-backdrop{background:color-mix(in srgb,var(--wr-color-backdrop) 85%,transparent)}.wr-lightbox-overlay{pointer-events:auto}.wr-lightbox-viewer{--wr-lightbox-viewer-gap: var(--wr-space-lg);--wr-lightbox-viewer-padding: var(--wr-space-lg);display:flex;flex-direction:column;align-items:center;gap:var(--wr-lightbox-viewer-gap);max-width:95vw;max-height:95vh;max-height:95dvh;padding:var(--wr-lightbox-viewer-padding);animation:wr-lightbox-viewer-in .18s ease;outline:none;touch-action:none}.wr-lightbox-viewer__close{--wr-lightbox-viewer-close-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;top:1rem;inset-inline-end:1rem;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-close-radius);background:#ffffff1f;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__close:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__close:hover{background:#fff3}.wr-lightbox-viewer__close:active{transform:scale(.95)}.wr-lightbox-viewer__close:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__nav{--wr-lightbox-viewer-nav-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;inset-block:0;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;margin-block:auto;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-nav-radius);background:#0000008c;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__nav:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__nav--previous{inset-inline-start:1rem}.wr-lightbox-viewer__nav--next{inset-inline-end:1rem}[dir=rtl] .wr-lightbox-viewer__nav svg{transform:scaleX(-1)}.wr-lightbox-viewer__nav:hover{background:#000000bf}.wr-lightbox-viewer__nav:active{transform:scale(.95)}.wr-lightbox-viewer__nav:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__nav--disabled{opacity:.4;cursor:default}.wr-lightbox-viewer__nav--disabled:hover{background:#0000008c}.wr-lightbox-viewer__nav--disabled:active{transform:none}.wr-lightbox-viewer__counter{--wr-lightbox-viewer-counter-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-counter-font-size: var(--wr-text-sm);position:absolute;top:1rem;inset-inline-start:1rem;color:#ffffffd9;font-family:var(--wr-lightbox-viewer-counter-font-family);font-size:var(--wr-lightbox-viewer-counter-font-size);font-variant-numeric:tabular-nums;line-height:2.25rem}.wr-lightbox-viewer__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;white-space:nowrap}.wr-lightbox-viewer__full{--wr-lightbox-viewer-full-radius: var(--wr-border-radius-base);display:block;max-width:100%;max-height:calc(95vh - 4rem);max-height:calc(95dvh - 4rem);object-fit:contain;cursor:zoom-out;border-radius:var(--wr-lightbox-viewer-full-radius)}@supports (corner-shape: squircle){.wr-lightbox-viewer__full{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-viewer-full-radius) * 1.85)}}.wr-lightbox-viewer__caption{--wr-lightbox-viewer-caption-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-caption-font-size: var(--wr-text-sm);color:#ffffffd9;font-family:var(--wr-lightbox-viewer-caption-font-family);font-size:var(--wr-lightbox-viewer-caption-font-size);text-align:center;max-width:60ch}@keyframes wr-lightbox-viewer-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}\n"],
|
|
239
443
|
encapsulation: i0.ViewEncapsulation.None
|
|
240
444
|
});
|
|
241
445
|
};
|
|
@@ -254,8 +458,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
254
458
|
"[class]": "classes()",
|
|
255
459
|
"[style.aspect-ratio]": "aspectRatio()"
|
|
256
460
|
},
|
|
257
|
-
template: "@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"src()\" [alt]=\"alt()\" (click)=\"onClose()\" />\n @if (caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ caption() }}</div>\n }\n </div>\n</ng-template>\n",
|
|
258
|
-
styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-lightbox{display:inline-block;position:relative;overflow:hidden;border-radius:var(--wr-lightbox-radius, var(--wr-border-radius-base))}@supports (corner-shape: squircle){.wr-lightbox{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-radius, var(--wr-border-radius-base)) * 1.85)}}.wr-lightbox{background:var(--wr-color-hover)}.wr-lightbox--loading{min-height:var(--wr-lightbox-loading-min-height, 4rem)}.wr-lightbox--loading:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,color-mix(in srgb,var(--wr-color-surface) 45%,transparent) 50%,transparent 100%);background-size:200% 100%;animation:wr-lightbox-shimmer 1.4s linear infinite;pointer-events:none;z-index:1}.wr-lightbox__trigger{display:block;width:100%;height:100%;padding:0;margin:0;border:0;background:transparent;cursor:zoom-in}.wr-lightbox__trigger:focus-visible{outline:none}.wr-lightbox__thumb{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;position:relative;z-index:2;opacity:1;transition:opacity .25s ease}.wr-lightbox--loading .wr-lightbox__thumb{opacity:0}.wr-lightbox:has(.wr-lightbox__trigger:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}@keyframes wr-lightbox-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.wr-lightbox-backdrop{background:color-mix(in srgb,var(--wr-color-backdrop) 85%,transparent)}.wr-lightbox-overlay{pointer-events:auto}.wr-lightbox-viewer{--wr-lightbox-viewer-gap: var(--wr-space-lg);--wr-lightbox-viewer-padding: var(--wr-space-lg);display:flex;flex-direction:column;align-items:center;gap:var(--wr-lightbox-viewer-gap);max-width:95vw;max-height:95vh;max-height:95dvh;padding:var(--wr-lightbox-viewer-padding);animation:wr-lightbox-viewer-in .18s ease;outline:none;touch-action:none}.wr-lightbox-viewer__close{--wr-lightbox-viewer-close-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;top:1rem;inset-inline-end:1rem;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-close-radius);background:#ffffff1f;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__close:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__close:hover{background:#fff3}.wr-lightbox-viewer__close:active{transform:scale(.95)}.wr-lightbox-viewer__close:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__full{--wr-lightbox-viewer-full-radius: var(--wr-border-radius-base);display:block;max-width:100%;max-height:calc(95vh - 4rem);max-height:calc(95dvh - 4rem);object-fit:contain;cursor:zoom-out;border-radius:var(--wr-lightbox-viewer-full-radius)}@supports (corner-shape: squircle){.wr-lightbox-viewer__full{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-viewer-full-radius) * 1.85)}}.wr-lightbox-viewer__caption{--wr-lightbox-viewer-caption-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-caption-font-size: var(--wr-text-sm);color:#ffffffd9;font-family:var(--wr-lightbox-viewer-caption-font-family);font-size:var(--wr-lightbox-viewer-caption-font-size);text-align:center;max-width:60ch}@keyframes wr-lightbox-viewer-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}\n"]
|
|
461
|
+
template: "@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__counter\" aria-hidden=\"true\">{{ counter() }}</span>\n <!-- `aria-disabled`, not `disabled`: a disabled button drops focus to <body>,\n out of the trap, the moment the last image is reached. -->\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--previous\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canPrevious()\"\n [attr.aria-label]=\"resolvedPreviousLabel()\"\n [attr.aria-disabled]=\"canPrevious() ? null : 'true'\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--next\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canNext()\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [attr.aria-disabled]=\"canNext() ? null : 'true'\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n }\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"shown().src()\" [alt]=\"shown().alt()\" (click)=\"onClose()\" />\n @if (shown().caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ shown().caption() }}</div>\n }\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__status\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n }\n </div>\n</ng-template>\n",
|
|
462
|
+
styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-lightbox{display:inline-block;position:relative;overflow:hidden;border-radius:var(--wr-lightbox-radius, var(--wr-border-radius-base))}@supports (corner-shape: squircle){.wr-lightbox{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-radius, var(--wr-border-radius-base)) * 1.85)}}.wr-lightbox{background:var(--wr-color-hover)}.wr-lightbox--loading{min-height:var(--wr-lightbox-loading-min-height, 4rem)}.wr-lightbox--loading:after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,color-mix(in srgb,var(--wr-color-surface) 45%,transparent) 50%,transparent 100%);background-size:200% 100%;animation:wr-lightbox-shimmer 1.4s linear infinite;pointer-events:none;z-index:1}.wr-lightbox__trigger{display:block;width:100%;height:100%;padding:0;margin:0;border:0;background:transparent;cursor:zoom-in}.wr-lightbox__trigger:focus-visible{outline:none}.wr-lightbox__thumb{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;position:relative;z-index:2;opacity:1;transition:opacity .25s ease}.wr-lightbox--loading .wr-lightbox__thumb{opacity:0}.wr-lightbox:has(.wr-lightbox__trigger:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}@keyframes wr-lightbox-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.wr-lightbox-backdrop{background:color-mix(in srgb,var(--wr-color-backdrop) 85%,transparent)}.wr-lightbox-overlay{pointer-events:auto}.wr-lightbox-viewer{--wr-lightbox-viewer-gap: var(--wr-space-lg);--wr-lightbox-viewer-padding: var(--wr-space-lg);display:flex;flex-direction:column;align-items:center;gap:var(--wr-lightbox-viewer-gap);max-width:95vw;max-height:95vh;max-height:95dvh;padding:var(--wr-lightbox-viewer-padding);animation:wr-lightbox-viewer-in .18s ease;outline:none;touch-action:none}.wr-lightbox-viewer__close{--wr-lightbox-viewer-close-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;top:1rem;inset-inline-end:1rem;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-close-radius);background:#ffffff1f;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__close:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__close:hover{background:#fff3}.wr-lightbox-viewer__close:active{transform:scale(.95)}.wr-lightbox-viewer__close:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__nav{--wr-lightbox-viewer-nav-radius: var(--wr-border-radius-pill);font-size:inherit;position:absolute;inset-block:0;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;margin-block:auto;padding:0;border:0;border-radius:var(--wr-lightbox-viewer-nav-radius);background:#0000008c;color:#ffffffe6;cursor:pointer;transition:background .15s ease,transform .15s ease}@media(pointer:coarse){.wr-lightbox-viewer__nav:after{content:\"\";position:absolute;top:50%;left:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}}.wr-lightbox-viewer__nav--previous{inset-inline-start:1rem}.wr-lightbox-viewer__nav--next{inset-inline-end:1rem}[dir=rtl] .wr-lightbox-viewer__nav svg{transform:scaleX(-1)}.wr-lightbox-viewer__nav:hover{background:#000000bf}.wr-lightbox-viewer__nav:active{transform:scale(.95)}.wr-lightbox-viewer__nav:focus-visible{outline:2px solid rgba(255,255,255,.9);outline-offset:2px}.wr-lightbox-viewer__nav--disabled{opacity:.4;cursor:default}.wr-lightbox-viewer__nav--disabled:hover{background:#0000008c}.wr-lightbox-viewer__nav--disabled:active{transform:none}.wr-lightbox-viewer__counter{--wr-lightbox-viewer-counter-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-counter-font-size: var(--wr-text-sm);position:absolute;top:1rem;inset-inline-start:1rem;color:#ffffffd9;font-family:var(--wr-lightbox-viewer-counter-font-family);font-size:var(--wr-lightbox-viewer-counter-font-size);font-variant-numeric:tabular-nums;line-height:2.25rem}.wr-lightbox-viewer__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;white-space:nowrap}.wr-lightbox-viewer__full{--wr-lightbox-viewer-full-radius: var(--wr-border-radius-base);display:block;max-width:100%;max-height:calc(95vh - 4rem);max-height:calc(95dvh - 4rem);object-fit:contain;cursor:zoom-out;border-radius:var(--wr-lightbox-viewer-full-radius)}@supports (corner-shape: squircle){.wr-lightbox-viewer__full{corner-shape:squircle;border-radius:calc(var(--wr-lightbox-viewer-full-radius) * 1.85)}}.wr-lightbox-viewer__caption{--wr-lightbox-viewer-caption-font-family: var(--wr-font-family-base);--wr-lightbox-viewer-caption-font-size: var(--wr-text-sm);color:#ffffffd9;font-family:var(--wr-lightbox-viewer-caption-font-family);font-size:var(--wr-lightbox-viewer-caption-font-size);text-align:center;max-width:60ch}@keyframes wr-lightbox-viewer-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}\n"]
|
|
259
463
|
}]
|
|
260
464
|
}],
|
|
261
465
|
ctorParameters: () => [],
|
|
@@ -332,6 +536,38 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
332
536
|
required: false
|
|
333
537
|
}]
|
|
334
538
|
}],
|
|
539
|
+
group: [{
|
|
540
|
+
type: i0.Input,
|
|
541
|
+
args: [{
|
|
542
|
+
isSignal: true,
|
|
543
|
+
alias: "group",
|
|
544
|
+
required: false
|
|
545
|
+
}]
|
|
546
|
+
}],
|
|
547
|
+
loop: [{
|
|
548
|
+
type: i0.Input,
|
|
549
|
+
args: [{
|
|
550
|
+
isSignal: true,
|
|
551
|
+
alias: "loop",
|
|
552
|
+
required: false
|
|
553
|
+
}]
|
|
554
|
+
}],
|
|
555
|
+
previousLabel: [{
|
|
556
|
+
type: i0.Input,
|
|
557
|
+
args: [{
|
|
558
|
+
isSignal: true,
|
|
559
|
+
alias: "previousLabel",
|
|
560
|
+
required: false
|
|
561
|
+
}]
|
|
562
|
+
}],
|
|
563
|
+
nextLabel: [{
|
|
564
|
+
type: i0.Input,
|
|
565
|
+
args: [{
|
|
566
|
+
isSignal: true,
|
|
567
|
+
alias: "nextLabel",
|
|
568
|
+
required: false
|
|
569
|
+
}]
|
|
570
|
+
}],
|
|
335
571
|
panelTpl: [{
|
|
336
572
|
type: i0.ViewChild,
|
|
337
573
|
args: ["viewerTpl", { isSignal: true }]
|