@4sh/ui-kit 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +10 -10
- package/README.md +10 -10
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
- package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-types.mjs +0 -12
- package/fesm2022/4sh-ui-kit.mjs +3 -15
- package/fesm2022/4sh-ui-kit.mjs.map +1 -1
- package/mcp/data/component-api.json +299 -2
- package/mcp/data/text-search-docs.json +149 -9
- package/mcp/data/ui-config.json +378 -1
- package/mcp/index.js +8190 -2876
- package/mcp/package.json +1 -1
- package/package.json +5 -1
- package/styles/component-vars.scss +22 -1
- package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
- package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
- package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
- package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
- package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
- package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
- package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
- package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
- package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
- package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
- package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
- package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
- package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
- package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
- package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
- package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
- package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
- package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
- package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
- package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
- package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
- package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
- package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
- package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
- package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
- package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
- package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
- package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
- package/types/4sh-ui-kit-forms.d.ts +275 -194
- package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
- package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
- package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
- package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
- package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
- package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
- package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
- package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
- package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
- package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
- package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
- package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
- package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
- package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
- package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
- package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
- package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
- package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
- package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
- package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
- package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
- package/types/4sh-ui-kit-motion.d.ts +117 -67
- package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
- package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
- package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
- package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
- package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
- package/types/4sh-ui-kit-overlay.d.ts +6 -6
- package/types/4sh-ui-kit-ripple.d.ts +99 -74
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
- package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
- package/types/4sh-ui-kit-theming.d.ts +27 -29
- package/types/4sh-ui-kit-types.d.ts +6 -5
- package/types/4sh-ui-kit.d.ts +4 -3
- package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
|
@@ -1,643 +1,1210 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { DOCUMENT,
|
|
4
|
-
import * as i1 from
|
|
5
|
-
import { A11yModule } from
|
|
6
|
-
import { UiIcon } from
|
|
7
|
-
import { lockBodyScroll, unlockBodyScroll } from
|
|
8
|
-
import { httpResource } from
|
|
9
|
-
import { DomSanitizer } from
|
|
10
|
-
import {
|
|
11
|
-
import { UiSpinner } from
|
|
12
|
-
import { UiMotion } from
|
|
13
|
-
|
|
14
|
-
/** Clamp `value` into `[min, max]`. */
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, InjectionToken, PLATFORM_ID, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, numberAttribute, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { DOCUMENT, NgOptimizedImage, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
|
+
import * as i1 from "@angular/cdk/a11y";
|
|
5
|
+
import { A11yModule } from "@angular/cdk/a11y";
|
|
6
|
+
import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
|
|
7
|
+
import { lockBodyScroll, unlockBodyScroll } from "@4sh/ui-kit/overlay";
|
|
8
|
+
import { httpResource } from "@angular/common/http";
|
|
9
|
+
import { DomSanitizer } from "@angular/platform-browser";
|
|
10
|
+
import { BrandService, ThemeService } from "@4sh/ui-kit/theming";
|
|
11
|
+
import { UiSpinner } from "@4sh/ui-kit/informative/ui-spinner";
|
|
12
|
+
import { UiMotion } from "@4sh/ui-kit/motion";
|
|
15
13
|
function clamp(value, min, max) {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* ui-image-preview — the enlarged view (lightbox) opened by `ui-image`'s
|
|
20
|
-
* `preview` mode.
|
|
21
|
-
*
|
|
22
|
-
* A viewport mask holding a toolbar (zoom in/out, rotate, reset, optional
|
|
23
|
-
* download, close) and the image itself, which the three transforms drive
|
|
24
|
-
* through a single `transform`: pan, scale, rotation. Zoom is reachable at the
|
|
25
|
-
* pointer (toolbar, wheel) and at the keyboard (`+`/`-`/`0`/`r`, arrows to pan)
|
|
26
|
-
* — a zoom a keyboard user cannot pan is a zoom they cannot read.
|
|
27
|
-
*
|
|
28
|
-
* Lives in `ui-image`'s entry point: it renders that component's resolved
|
|
29
|
-
* source, so a separate entry point would be a cycle. Mount it directly only to
|
|
30
|
-
* drive the enlarged view yourself.
|
|
31
|
-
*/
|
|
32
|
-
class UiImagePreview {
|
|
33
|
-
constructor() {
|
|
34
|
-
this.document = inject(DOCUMENT);
|
|
35
|
-
/** URL of the image to show enlarged (already resolved — `http(s)`, `blob:` or `data:`). */
|
|
36
|
-
this.src = input.required(/* @ts-ignore */
|
|
37
|
-
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
38
|
-
/** Alt text of the enlarged image (empty = decorative). */
|
|
39
|
-
this.alt = input('', /* @ts-ignore */
|
|
40
|
-
...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
41
|
-
/** Accessible name of the dialog. */
|
|
42
|
-
this.ariaLabel = input('Aperçu de l’image', /* @ts-ignore */
|
|
43
|
-
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
44
|
-
/** Zoom increment applied by one toolbar click, one wheel notch or one `+`/`-` press. */
|
|
45
|
-
this.zoomStep = input(0.25, { ...(ngDevMode ? { debugName: "zoomStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
46
|
-
/** Lower zoom bound. */
|
|
47
|
-
this.minZoom = input(0.5, { ...(ngDevMode ? { debugName: "minZoom" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
48
|
-
/** Upper zoom bound. */
|
|
49
|
-
this.maxZoom = input(4, { ...(ngDevMode ? { debugName: "maxZoom" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
50
|
-
/** Offer a download action in the toolbar. */
|
|
51
|
-
this.downloadable = input(false, { ...(ngDevMode ? { debugName: "downloadable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
52
|
-
/** Filename proposed by the download action (defaults to the browser's choice). */
|
|
53
|
-
this.downloadName = input(/* @ts-ignore */
|
|
54
|
-
...(ngDevMode ? [undefined, { debugName: "downloadName" }] : /* istanbul ignore next */ []));
|
|
55
|
-
/** Close when the mask around the image is clicked. */
|
|
56
|
-
this.dismissableMask = input(true, { ...(ngDevMode ? { debugName: "dismissableMask" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
57
|
-
/** Accessible name of the zoom-in button. */
|
|
58
|
-
this.zoomInAriaLabel = input('Zoom avant', /* @ts-ignore */
|
|
59
|
-
...(ngDevMode ? [{ debugName: "zoomInAriaLabel" }] : /* istanbul ignore next */ []));
|
|
60
|
-
/** Accessible name of the zoom-out button. */
|
|
61
|
-
this.zoomOutAriaLabel = input('Zoom arrière', /* @ts-ignore */
|
|
62
|
-
...(ngDevMode ? [{ debugName: "zoomOutAriaLabel" }] : /* istanbul ignore next */ []));
|
|
63
|
-
/** Accessible name of the rotate-left button. */
|
|
64
|
-
this.rotateLeftAriaLabel = input('Pivoter vers la gauche', /* @ts-ignore */
|
|
65
|
-
...(ngDevMode ? [{ debugName: "rotateLeftAriaLabel" }] : /* istanbul ignore next */ []));
|
|
66
|
-
/** Accessible name of the rotate-right button. */
|
|
67
|
-
this.rotateRightAriaLabel = input('Pivoter vers la droite', /* @ts-ignore */
|
|
68
|
-
...(ngDevMode ? [{ debugName: "rotateRightAriaLabel" }] : /* istanbul ignore next */ []));
|
|
69
|
-
/** Accessible name of the button that resets zoom and rotation. */
|
|
70
|
-
this.resetAriaLabel = input('Réinitialiser l’affichage', /* @ts-ignore */
|
|
71
|
-
...(ngDevMode ? [{ debugName: "resetAriaLabel" }] : /* istanbul ignore next */ []));
|
|
72
|
-
/** Accessible name of the download button. */
|
|
73
|
-
this.downloadAriaLabel = input('Télécharger l’image', /* @ts-ignore */
|
|
74
|
-
...(ngDevMode ? [{ debugName: "downloadAriaLabel" }] : /* istanbul ignore next */ []));
|
|
75
|
-
/** Accessible name of the close button. */
|
|
76
|
-
this.closeAriaLabel = input('Fermer l’aperçu', /* @ts-ignore */
|
|
77
|
-
...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
78
|
-
/** Emitted when the view asks to be dismissed (Escape, close button, mask click). */
|
|
79
|
-
this.closed = output();
|
|
80
|
-
this.stage = viewChild.required('stage', /* @ts-ignore */
|
|
81
|
-
...(ngDevMode ? [{ debugName: "stage" }] : /* istanbul ignore next */ []));
|
|
82
|
-
this.scale = signal(1, /* @ts-ignore */
|
|
83
|
-
...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
|
|
84
|
-
this.rotation = signal(0, /* @ts-ignore */
|
|
85
|
-
...(ngDevMode ? [{ debugName: "rotation" }] : /* istanbul ignore next */ []));
|
|
86
|
-
this.panX = signal(0, /* @ts-ignore */
|
|
87
|
-
...(ngDevMode ? [{ debugName: "panX" }] : /* istanbul ignore next */ []));
|
|
88
|
-
this.panY = signal(0, /* @ts-ignore */
|
|
89
|
-
...(ngDevMode ? [{ debugName: "panY" }] : /* istanbul ignore next */ []));
|
|
90
|
-
this.canZoomIn = computed(() => this.scale() < this.maxZoom(), /* @ts-ignore */
|
|
91
|
-
...(ngDevMode ? [{ debugName: "canZoomIn" }] : /* istanbul ignore next */ []));
|
|
92
|
-
this.canZoomOut = computed(() => this.scale() > this.minZoom(), /* @ts-ignore */
|
|
93
|
-
...(ngDevMode ? [{ debugName: "canZoomOut" }] : /* istanbul ignore next */ []));
|
|
94
|
-
/** Nothing to reset while the three transforms are at their neutral value. */
|
|
95
|
-
this.isPristine = computed(() => this.scale() === 1 && this.rotation() === 0 && this.panX() === 0 && this.panY() === 0, /* @ts-ignore */
|
|
96
|
-
...(ngDevMode ? [{ debugName: "isPristine" }] : /* istanbul ignore next */ []));
|
|
97
|
-
/** Panning only makes sense once the image overflows its stage. */
|
|
98
|
-
this.canPan = computed(() => this.scale() > 1, /* @ts-ignore */
|
|
99
|
-
...(ngDevMode ? [{ debugName: "canPan" }] : /* istanbul ignore next */ []));
|
|
100
|
-
/** A quarter turn: what is drawn no longer fits the layout box's axes. */
|
|
101
|
-
this.isQuarterTurned = computed(() => this.rotation() % 180 !== 0, /* @ts-ignore */
|
|
102
|
-
...(ngDevMode ? [{ debugName: "isQuarterTurned" }] : /* istanbul ignore next */ []));
|
|
103
|
-
this.transform = computed(() => `translate(${this.panX()}px, ${this.panY()}px) scale(${this.scale()}) rotate(${this.rotation()}deg)`, /* @ts-ignore */
|
|
104
|
-
...(ngDevMode ? [{ debugName: "transform" }] : /* istanbul ignore next */ []));
|
|
105
|
-
// --- Drag to pan ------------------------------------------------------
|
|
106
|
-
this.dragOrigin = null;
|
|
107
|
-
lockBodyScroll(this.document);
|
|
108
|
-
inject(DestroyRef).onDestroy(() => unlockBodyScroll(this.document));
|
|
109
|
-
}
|
|
110
|
-
zoomIn() {
|
|
111
|
-
this.setScale(this.scale() + this.zoomStep());
|
|
112
|
-
}
|
|
113
|
-
zoomOut() {
|
|
114
|
-
this.setScale(this.scale() - this.zoomStep());
|
|
115
|
-
}
|
|
116
|
-
rotateLeft() {
|
|
117
|
-
this.rotation.update((deg) => deg - 90);
|
|
118
|
-
}
|
|
119
|
-
rotateRight() {
|
|
120
|
-
this.rotation.update((deg) => deg + 90);
|
|
121
|
-
}
|
|
122
|
-
reset() {
|
|
123
|
-
this.scale.set(1);
|
|
124
|
-
this.rotation.set(0);
|
|
125
|
-
this.panX.set(0);
|
|
126
|
-
this.panY.set(0);
|
|
127
|
-
}
|
|
128
|
-
close() {
|
|
129
|
-
this.closed.emit();
|
|
130
|
-
}
|
|
131
|
-
/** A press that lands on the stage itself (not on the image) is a press outside. */
|
|
132
|
-
onStagePointerDown(event) {
|
|
133
|
-
if (this.dismissableMask() && event.target === this.stage().nativeElement)
|
|
134
|
-
this.close();
|
|
135
|
-
}
|
|
136
|
-
onWheel(event) {
|
|
137
|
-
event.preventDefault();
|
|
138
|
-
this.setScale(this.scale() + (event.deltaY < 0 ? this.zoomStep() : -this.zoomStep()));
|
|
139
|
-
}
|
|
140
|
-
onKeydown(event) {
|
|
141
|
-
const step = 24;
|
|
142
|
-
switch (event.key) {
|
|
143
|
-
case 'Escape':
|
|
144
|
-
this.close();
|
|
145
|
-
break;
|
|
146
|
-
case '+':
|
|
147
|
-
case '=':
|
|
148
|
-
this.zoomIn();
|
|
149
|
-
break;
|
|
150
|
-
case '-':
|
|
151
|
-
this.zoomOut();
|
|
152
|
-
break;
|
|
153
|
-
case '0':
|
|
154
|
-
this.reset();
|
|
155
|
-
break;
|
|
156
|
-
case 'r':
|
|
157
|
-
case 'R':
|
|
158
|
-
this.rotateRight();
|
|
159
|
-
break;
|
|
160
|
-
case 'ArrowLeft':
|
|
161
|
-
this.panX.update((x) => x - step);
|
|
162
|
-
break;
|
|
163
|
-
case 'ArrowRight':
|
|
164
|
-
this.panX.update((x) => x + step);
|
|
165
|
-
break;
|
|
166
|
-
case 'ArrowUp':
|
|
167
|
-
this.panY.update((y) => y - step);
|
|
168
|
-
break;
|
|
169
|
-
case 'ArrowDown':
|
|
170
|
-
this.panY.update((y) => y + step);
|
|
171
|
-
break;
|
|
172
|
-
default:
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
// Only a handled key is swallowed: Tab must keep cycling the focus trap.
|
|
176
|
-
event.preventDefault();
|
|
177
|
-
event.stopPropagation();
|
|
178
|
-
}
|
|
179
|
-
onPointerDown(event) {
|
|
180
|
-
if (!this.canPan() || event.button !== 0)
|
|
181
|
-
return;
|
|
182
|
-
this.dragOrigin = { x: event.clientX, y: event.clientY, panX: this.panX(), panY: this.panY() };
|
|
183
|
-
event.target.setPointerCapture?.(event.pointerId);
|
|
184
|
-
event.preventDefault();
|
|
185
|
-
}
|
|
186
|
-
onPointerMove(event) {
|
|
187
|
-
const origin = this.dragOrigin;
|
|
188
|
-
if (!origin)
|
|
189
|
-
return;
|
|
190
|
-
this.panX.set(origin.panX + (event.clientX - origin.x));
|
|
191
|
-
this.panY.set(origin.panY + (event.clientY - origin.y));
|
|
192
|
-
}
|
|
193
|
-
onPointerUp(event) {
|
|
194
|
-
if (!this.dragOrigin)
|
|
195
|
-
return;
|
|
196
|
-
this.dragOrigin = null;
|
|
197
|
-
event.target.releasePointerCapture?.(event.pointerId);
|
|
198
|
-
}
|
|
199
|
-
setScale(value) {
|
|
200
|
-
const next = clamp(Number(value.toFixed(4)), this.minZoom(), this.maxZoom());
|
|
201
|
-
this.scale.set(next);
|
|
202
|
-
// Back to fit: the pan offset would otherwise strand the image off-centre.
|
|
203
|
-
if (next <= 1) {
|
|
204
|
-
this.panX.set(0);
|
|
205
|
-
this.panY.set(0);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiImagePreview, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
209
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiImagePreview, isStandalone: true, selector: "ui-image-preview", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, zoomStep: { classPropertyName: "zoomStep", publicName: "zoomStep", isSignal: true, isRequired: false, transformFunction: null }, minZoom: { classPropertyName: "minZoom", publicName: "minZoom", isSignal: true, isRequired: false, transformFunction: null }, maxZoom: { classPropertyName: "maxZoom", publicName: "maxZoom", isSignal: true, isRequired: false, transformFunction: null }, downloadable: { classPropertyName: "downloadable", publicName: "downloadable", isSignal: true, isRequired: false, transformFunction: null }, downloadName: { classPropertyName: "downloadName", publicName: "downloadName", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, zoomInAriaLabel: { classPropertyName: "zoomInAriaLabel", publicName: "zoomInAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, zoomOutAriaLabel: { classPropertyName: "zoomOutAriaLabel", publicName: "zoomOutAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rotateLeftAriaLabel: { classPropertyName: "rotateLeftAriaLabel", publicName: "rotateLeftAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rotateRightAriaLabel: { classPropertyName: "rotateRightAriaLabel", publicName: "rotateRightAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, resetAriaLabel: { classPropertyName: "resetAriaLabel", publicName: "resetAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, downloadAriaLabel: { classPropertyName: "downloadAriaLabel", publicName: "downloadAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "stage", first: true, predicate: ["stage"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- The host is the mask; this is the dialog that owns the focus, the keyboard\n shortcuts and the aria wiring. -->\n<div\n class=\"ui-image-preview\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel() || null\"\n tabindex=\"-1\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Unavailable actions are `aria-disabled`, not `disabled`: a real `disabled`\n drops the focus to the body the moment the button that holds it hits a\n bound, and `Escape` then no longer reaches the dialog. The handlers clamp,\n so a press at the bound is a no-op. -->\n <div class=\"ui-image-preview-toolbar\">\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomOutAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomOut() || null\"\n (click)=\"zoomOut()\"\n >\n <ui-icon name=\"magnifying-glass-minus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomInAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomIn() || null\"\n (click)=\"zoomIn()\"\n >\n <ui-icon name=\"magnifying-glass-plus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateLeftAriaLabel() || null\"\n (click)=\"rotateLeft()\"\n >\n <ui-icon name=\"rotate-left\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateRightAriaLabel() || null\"\n (click)=\"rotateRight()\"\n >\n <ui-icon name=\"rotate-right\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"resetAriaLabel() || null\"\n [attr.aria-disabled]=\"isPristine() || null\"\n (click)=\"reset()\"\n >\n <ui-icon name=\"arrows-rotate\" size=\"sm\" />\n </button>\n\n @if (downloadable()) {\n <a\n class=\"ui-image-preview-action\"\n [href]=\"src()\"\n [attr.download]=\"downloadName() || ''\"\n [attr.aria-label]=\"downloadAriaLabel() || null\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <ui-icon name=\"download\" size=\"sm\" />\n </a>\n }\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"closeAriaLabel() || null\"\n (click)=\"close()\"\n >\n <ui-icon name=\"xmark\" size=\"sm\" />\n </button>\n </div>\n\n <!-- The stage is the dismiss-on-outside target: a press that lands on it, and\n not on the image, closes. Escape is its keyboard equivalent, which is why\n there is no key handler here. -->\n <div\n #stage\n class=\"ui-image-preview-stage\"\n (pointerdown)=\"onStagePointerDown($event)\"\n (wheel)=\"onWheel($event)\"\n >\n <img\n class=\"ui-image-preview-media\"\n [class._pannable]=\"canPan()\"\n [class._rotated]=\"isQuarterTurned()\"\n [src]=\"src()\"\n [alt]=\"alt()\"\n [style.transform]=\"transform()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n draggable=\"false\"\n />\n </div>\n</div>\n", styles: [":host{position:fixed;inset:0;z-index:var(--ui-image-preview-z-index, 1100);display:block;background-color:var(--ui-image-preview-mask-background, var(--primitives-black-80))}.ui-image-preview{display:flex;flex-direction:column;gap:var(--ui-image-preview-gap, var(--units-md));box-sizing:border-box;width:100%;height:100%;padding:var(--ui-image-preview-padding, var(--units-lg));outline:none}.ui-image-preview-toolbar{flex:0 0 auto;display:flex;flex-wrap:wrap;align-self:center;justify-content:center;gap:var(--ui-image-preview-toolbar-gap, var(--units-2xs));padding:var(--ui-image-preview-toolbar-padding, var(--units-2xs));border-radius:var(--ui-image-preview-toolbar-radius, var(--radius-full));background-color:var(--ui-image-preview-toolbar-background, var(--primitives-black-50))}.ui-image-preview-action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-image-preview-action-size, 2.25rem);height:var(--ui-image-preview-action-size, 2.25rem);padding:0;border:none;border-radius:var(--ui-image-preview-action-radius, var(--radius-full));background:transparent;color:var(--ui-image-preview-action-color, var(--primitives-white-base));line-height:0;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-image-preview-action:hover:not([aria-disabled]){background-color:var(--ui-image-preview-action-surface-hover, var(--primitives-white-20))}.ui-image-preview-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-preview-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-preview-action-focus-ring-color, var(--global-border-focus))}.ui-image-preview-action[aria-disabled=true]{opacity:var(--ui-image-preview-action-opacity-disabled, .4);cursor:not-allowed}@media(prefers-reduced-motion:reduce){.ui-image-preview-action{transition-duration:.01ms}}:root[data-motion=off] .ui-image-preview-action{transition-duration:.01ms}.ui-image-preview-stage{flex:1 1 auto;display:flex;align-items:center;justify-content:center;min-height:0;overflow:hidden;container-type:size}.ui-image-preview-media{max-width:var(--ui-image-preview-media-max-width, 100%);max-height:var(--ui-image-preview-media-max-height, 100%);box-shadow:var(--ui-image-preview-media-shadow, var(--shadow-default-lg));object-fit:contain;transform-origin:center;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ui-image-preview-media._rotated{max-width:var(--ui-image-preview-media-max-width-rotated, 100cqh);max-height:var(--ui-image-preview-media-max-height-rotated, 100cqw)}.ui-image-preview-media._pannable{cursor:grab}.ui-image-preview-media._pannable:active{cursor:grabbing}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
|
|
14
|
+
return Math.min(max, Math.max(min, value));
|
|
210
15
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*/
|
|
16
|
+
var UiImagePreview = class UiImagePreview {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.document = inject(DOCUMENT);
|
|
19
|
+
this.src = input.required(...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
20
|
+
this.alt = input("", ...ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []);
|
|
21
|
+
this.ariaLabel = input("Aperçu de l’image", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
22
|
+
this.zoomStep = input(.25, {
|
|
23
|
+
...ngDevMode ? { debugName: "zoomStep" } : /* istanbul ignore next */ {},
|
|
24
|
+
transform: numberAttribute
|
|
25
|
+
});
|
|
26
|
+
this.minZoom = input(.5, {
|
|
27
|
+
...ngDevMode ? { debugName: "minZoom" } : /* istanbul ignore next */ {},
|
|
28
|
+
transform: numberAttribute
|
|
29
|
+
});
|
|
30
|
+
this.maxZoom = input(4, {
|
|
31
|
+
...ngDevMode ? { debugName: "maxZoom" } : /* istanbul ignore next */ {},
|
|
32
|
+
transform: numberAttribute
|
|
33
|
+
});
|
|
34
|
+
this.downloadable = input(false, {
|
|
35
|
+
...ngDevMode ? { debugName: "downloadable" } : /* istanbul ignore next */ {},
|
|
36
|
+
transform: booleanAttribute
|
|
37
|
+
});
|
|
38
|
+
this.downloadName = input(...ngDevMode ? [void 0, { debugName: "downloadName" }] : /* istanbul ignore next */ []);
|
|
39
|
+
this.dismissableMask = input(true, {
|
|
40
|
+
...ngDevMode ? { debugName: "dismissableMask" } : /* istanbul ignore next */ {},
|
|
41
|
+
transform: booleanAttribute
|
|
42
|
+
});
|
|
43
|
+
this.zoomInAriaLabel = input("Zoom avant", ...ngDevMode ? [{ debugName: "zoomInAriaLabel" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this.zoomOutAriaLabel = input("Zoom arrière", ...ngDevMode ? [{ debugName: "zoomOutAriaLabel" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.rotateLeftAriaLabel = input("Pivoter vers la gauche", ...ngDevMode ? [{ debugName: "rotateLeftAriaLabel" }] : /* istanbul ignore next */ []);
|
|
46
|
+
this.rotateRightAriaLabel = input("Pivoter vers la droite", ...ngDevMode ? [{ debugName: "rotateRightAriaLabel" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this.resetAriaLabel = input("Réinitialiser l’affichage", ...ngDevMode ? [{ debugName: "resetAriaLabel" }] : /* istanbul ignore next */ []);
|
|
48
|
+
this.downloadAriaLabel = input("Télécharger l’image", ...ngDevMode ? [{ debugName: "downloadAriaLabel" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.closeAriaLabel = input("Fermer l’aperçu", ...ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []);
|
|
50
|
+
this.closed = output();
|
|
51
|
+
this.stage = viewChild.required("stage", ...ngDevMode ? [{ debugName: "stage" }] : /* istanbul ignore next */ []);
|
|
52
|
+
this.scale = signal(1, ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
|
|
53
|
+
this.rotation = signal(0, ...ngDevMode ? [{ debugName: "rotation" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.panX = signal(0, ...ngDevMode ? [{ debugName: "panX" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.panY = signal(0, ...ngDevMode ? [{ debugName: "panY" }] : /* istanbul ignore next */ []);
|
|
56
|
+
this.canZoomIn = computed(() => this.scale() < this.maxZoom(), ...ngDevMode ? [{ debugName: "canZoomIn" }] : /* istanbul ignore next */ []);
|
|
57
|
+
this.canZoomOut = computed(() => this.scale() > this.minZoom(), ...ngDevMode ? [{ debugName: "canZoomOut" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this.isPristine = computed(() => this.scale() === 1 && this.rotation() === 0 && this.panX() === 0 && this.panY() === 0, ...ngDevMode ? [{ debugName: "isPristine" }] : /* istanbul ignore next */ []);
|
|
59
|
+
this.canPan = computed(() => this.scale() > 1, ...ngDevMode ? [{ debugName: "canPan" }] : /* istanbul ignore next */ []);
|
|
60
|
+
this.isQuarterTurned = computed(() => this.rotation() % 180 !== 0, ...ngDevMode ? [{ debugName: "isQuarterTurned" }] : /* istanbul ignore next */ []);
|
|
61
|
+
this.transform = computed(() => `translate(${this.panX()}px, ${this.panY()}px) scale(${this.scale()}) rotate(${this.rotation()}deg)`, ...ngDevMode ? [{ debugName: "transform" }] : /* istanbul ignore next */ []);
|
|
62
|
+
this.dragOrigin = null;
|
|
63
|
+
lockBodyScroll(this.document);
|
|
64
|
+
inject(DestroyRef).onDestroy(() => unlockBodyScroll(this.document));
|
|
65
|
+
}
|
|
66
|
+
zoomIn() {
|
|
67
|
+
this.setScale(this.scale() + this.zoomStep());
|
|
68
|
+
}
|
|
69
|
+
zoomOut() {
|
|
70
|
+
this.setScale(this.scale() - this.zoomStep());
|
|
71
|
+
}
|
|
72
|
+
rotateLeft() {
|
|
73
|
+
this.rotation.update((deg) => deg - 90);
|
|
74
|
+
}
|
|
75
|
+
rotateRight() {
|
|
76
|
+
this.rotation.update((deg) => deg + 90);
|
|
77
|
+
}
|
|
78
|
+
reset() {
|
|
79
|
+
this.scale.set(1);
|
|
80
|
+
this.rotation.set(0);
|
|
81
|
+
this.panX.set(0);
|
|
82
|
+
this.panY.set(0);
|
|
83
|
+
}
|
|
84
|
+
close() {
|
|
85
|
+
this.closed.emit();
|
|
86
|
+
}
|
|
87
|
+
onStagePointerDown(event) {
|
|
88
|
+
if (this.dismissableMask() && event.target === this.stage().nativeElement) this.close();
|
|
89
|
+
}
|
|
90
|
+
onWheel(event) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
this.setScale(this.scale() + (event.deltaY < 0 ? this.zoomStep() : -this.zoomStep()));
|
|
93
|
+
}
|
|
94
|
+
onKeydown(event) {
|
|
95
|
+
const step = 24;
|
|
96
|
+
switch (event.key) {
|
|
97
|
+
case "Escape":
|
|
98
|
+
this.close();
|
|
99
|
+
break;
|
|
100
|
+
case "+":
|
|
101
|
+
case "=":
|
|
102
|
+
this.zoomIn();
|
|
103
|
+
break;
|
|
104
|
+
case "-":
|
|
105
|
+
this.zoomOut();
|
|
106
|
+
break;
|
|
107
|
+
case "0":
|
|
108
|
+
this.reset();
|
|
109
|
+
break;
|
|
110
|
+
case "r":
|
|
111
|
+
case "R":
|
|
112
|
+
this.rotateRight();
|
|
113
|
+
break;
|
|
114
|
+
case "ArrowLeft":
|
|
115
|
+
this.panX.update((x) => x - step);
|
|
116
|
+
break;
|
|
117
|
+
case "ArrowRight":
|
|
118
|
+
this.panX.update((x) => x + step);
|
|
119
|
+
break;
|
|
120
|
+
case "ArrowUp":
|
|
121
|
+
this.panY.update((y) => y - step);
|
|
122
|
+
break;
|
|
123
|
+
case "ArrowDown":
|
|
124
|
+
this.panY.update((y) => y + step);
|
|
125
|
+
break;
|
|
126
|
+
default: return;
|
|
127
|
+
}
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
}
|
|
131
|
+
onPointerDown(event) {
|
|
132
|
+
if (!this.canPan() || event.button !== 0) return;
|
|
133
|
+
this.dragOrigin = {
|
|
134
|
+
x: event.clientX,
|
|
135
|
+
y: event.clientY,
|
|
136
|
+
panX: this.panX(),
|
|
137
|
+
panY: this.panY()
|
|
138
|
+
};
|
|
139
|
+
event.target.setPointerCapture?.(event.pointerId);
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
}
|
|
142
|
+
onPointerMove(event) {
|
|
143
|
+
const origin = this.dragOrigin;
|
|
144
|
+
if (!origin) return;
|
|
145
|
+
this.panX.set(origin.panX + (event.clientX - origin.x));
|
|
146
|
+
this.panY.set(origin.panY + (event.clientY - origin.y));
|
|
147
|
+
}
|
|
148
|
+
onPointerUp(event) {
|
|
149
|
+
if (!this.dragOrigin) return;
|
|
150
|
+
this.dragOrigin = null;
|
|
151
|
+
event.target.releasePointerCapture?.(event.pointerId);
|
|
152
|
+
}
|
|
153
|
+
setScale(value) {
|
|
154
|
+
const next = clamp(Number(value.toFixed(4)), this.minZoom(), this.maxZoom());
|
|
155
|
+
this.scale.set(next);
|
|
156
|
+
if (next <= 1) {
|
|
157
|
+
this.panX.set(0);
|
|
158
|
+
this.panY.set(0);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
static {
|
|
162
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
163
|
+
minVersion: "12.0.0",
|
|
164
|
+
version: "22.3.0",
|
|
165
|
+
ngImport: i0,
|
|
166
|
+
type: UiImagePreview,
|
|
167
|
+
deps: [],
|
|
168
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
static {
|
|
172
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
173
|
+
minVersion: "17.0.0",
|
|
174
|
+
version: "22.3.0",
|
|
175
|
+
type: UiImagePreview,
|
|
176
|
+
isStandalone: true,
|
|
177
|
+
selector: "ui-image-preview",
|
|
178
|
+
inputs: {
|
|
179
|
+
src: {
|
|
180
|
+
classPropertyName: "src",
|
|
181
|
+
publicName: "src",
|
|
182
|
+
isSignal: true,
|
|
183
|
+
isRequired: true,
|
|
184
|
+
transformFunction: null
|
|
185
|
+
},
|
|
186
|
+
alt: {
|
|
187
|
+
classPropertyName: "alt",
|
|
188
|
+
publicName: "alt",
|
|
189
|
+
isSignal: true,
|
|
190
|
+
isRequired: false,
|
|
191
|
+
transformFunction: null
|
|
192
|
+
},
|
|
193
|
+
ariaLabel: {
|
|
194
|
+
classPropertyName: "ariaLabel",
|
|
195
|
+
publicName: "ariaLabel",
|
|
196
|
+
isSignal: true,
|
|
197
|
+
isRequired: false,
|
|
198
|
+
transformFunction: null
|
|
199
|
+
},
|
|
200
|
+
zoomStep: {
|
|
201
|
+
classPropertyName: "zoomStep",
|
|
202
|
+
publicName: "zoomStep",
|
|
203
|
+
isSignal: true,
|
|
204
|
+
isRequired: false,
|
|
205
|
+
transformFunction: null
|
|
206
|
+
},
|
|
207
|
+
minZoom: {
|
|
208
|
+
classPropertyName: "minZoom",
|
|
209
|
+
publicName: "minZoom",
|
|
210
|
+
isSignal: true,
|
|
211
|
+
isRequired: false,
|
|
212
|
+
transformFunction: null
|
|
213
|
+
},
|
|
214
|
+
maxZoom: {
|
|
215
|
+
classPropertyName: "maxZoom",
|
|
216
|
+
publicName: "maxZoom",
|
|
217
|
+
isSignal: true,
|
|
218
|
+
isRequired: false,
|
|
219
|
+
transformFunction: null
|
|
220
|
+
},
|
|
221
|
+
downloadable: {
|
|
222
|
+
classPropertyName: "downloadable",
|
|
223
|
+
publicName: "downloadable",
|
|
224
|
+
isSignal: true,
|
|
225
|
+
isRequired: false,
|
|
226
|
+
transformFunction: null
|
|
227
|
+
},
|
|
228
|
+
downloadName: {
|
|
229
|
+
classPropertyName: "downloadName",
|
|
230
|
+
publicName: "downloadName",
|
|
231
|
+
isSignal: true,
|
|
232
|
+
isRequired: false,
|
|
233
|
+
transformFunction: null
|
|
234
|
+
},
|
|
235
|
+
dismissableMask: {
|
|
236
|
+
classPropertyName: "dismissableMask",
|
|
237
|
+
publicName: "dismissableMask",
|
|
238
|
+
isSignal: true,
|
|
239
|
+
isRequired: false,
|
|
240
|
+
transformFunction: null
|
|
241
|
+
},
|
|
242
|
+
zoomInAriaLabel: {
|
|
243
|
+
classPropertyName: "zoomInAriaLabel",
|
|
244
|
+
publicName: "zoomInAriaLabel",
|
|
245
|
+
isSignal: true,
|
|
246
|
+
isRequired: false,
|
|
247
|
+
transformFunction: null
|
|
248
|
+
},
|
|
249
|
+
zoomOutAriaLabel: {
|
|
250
|
+
classPropertyName: "zoomOutAriaLabel",
|
|
251
|
+
publicName: "zoomOutAriaLabel",
|
|
252
|
+
isSignal: true,
|
|
253
|
+
isRequired: false,
|
|
254
|
+
transformFunction: null
|
|
255
|
+
},
|
|
256
|
+
rotateLeftAriaLabel: {
|
|
257
|
+
classPropertyName: "rotateLeftAriaLabel",
|
|
258
|
+
publicName: "rotateLeftAriaLabel",
|
|
259
|
+
isSignal: true,
|
|
260
|
+
isRequired: false,
|
|
261
|
+
transformFunction: null
|
|
262
|
+
},
|
|
263
|
+
rotateRightAriaLabel: {
|
|
264
|
+
classPropertyName: "rotateRightAriaLabel",
|
|
265
|
+
publicName: "rotateRightAriaLabel",
|
|
266
|
+
isSignal: true,
|
|
267
|
+
isRequired: false,
|
|
268
|
+
transformFunction: null
|
|
269
|
+
},
|
|
270
|
+
resetAriaLabel: {
|
|
271
|
+
classPropertyName: "resetAriaLabel",
|
|
272
|
+
publicName: "resetAriaLabel",
|
|
273
|
+
isSignal: true,
|
|
274
|
+
isRequired: false,
|
|
275
|
+
transformFunction: null
|
|
276
|
+
},
|
|
277
|
+
downloadAriaLabel: {
|
|
278
|
+
classPropertyName: "downloadAriaLabel",
|
|
279
|
+
publicName: "downloadAriaLabel",
|
|
280
|
+
isSignal: true,
|
|
281
|
+
isRequired: false,
|
|
282
|
+
transformFunction: null
|
|
283
|
+
},
|
|
284
|
+
closeAriaLabel: {
|
|
285
|
+
classPropertyName: "closeAriaLabel",
|
|
286
|
+
publicName: "closeAriaLabel",
|
|
287
|
+
isSignal: true,
|
|
288
|
+
isRequired: false,
|
|
289
|
+
transformFunction: null
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
outputs: { closed: "closed" },
|
|
293
|
+
viewQueries: [{
|
|
294
|
+
propertyName: "stage",
|
|
295
|
+
first: true,
|
|
296
|
+
predicate: ["stage"],
|
|
297
|
+
descendants: true,
|
|
298
|
+
isSignal: true
|
|
299
|
+
}],
|
|
300
|
+
ngImport: i0,
|
|
301
|
+
template: "<!-- The host is the mask; this is the dialog that owns the focus, the keyboard\n shortcuts and the aria wiring. -->\n<div\n class=\"ui-image-preview\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel() || null\"\n tabindex=\"-1\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Unavailable actions are `aria-disabled`, not `disabled`: a real `disabled`\n drops the focus to the body the moment the button that holds it hits a\n bound, and `Escape` then no longer reaches the dialog. The handlers clamp,\n so a press at the bound is a no-op. -->\n <div class=\"ui-image-preview-toolbar\">\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomOutAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomOut() || null\"\n (click)=\"zoomOut()\"\n >\n <ui-icon name=\"magnifying-glass-minus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomInAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomIn() || null\"\n (click)=\"zoomIn()\"\n >\n <ui-icon name=\"magnifying-glass-plus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateLeftAriaLabel() || null\"\n (click)=\"rotateLeft()\"\n >\n <ui-icon name=\"rotate-left\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateRightAriaLabel() || null\"\n (click)=\"rotateRight()\"\n >\n <ui-icon name=\"rotate-right\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"resetAriaLabel() || null\"\n [attr.aria-disabled]=\"isPristine() || null\"\n (click)=\"reset()\"\n >\n <ui-icon name=\"arrows-rotate\" size=\"sm\" />\n </button>\n\n @if (downloadable()) {\n <a\n class=\"ui-image-preview-action\"\n [href]=\"src()\"\n [attr.download]=\"downloadName() || ''\"\n [attr.aria-label]=\"downloadAriaLabel() || null\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <ui-icon name=\"download\" size=\"sm\" />\n </a>\n }\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"closeAriaLabel() || null\"\n (click)=\"close()\"\n >\n <ui-icon name=\"xmark\" size=\"sm\" />\n </button>\n </div>\n\n <!-- The stage is the dismiss-on-outside target: a press that lands on it, and\n not on the image, closes. Escape is its keyboard equivalent, which is why\n there is no key handler here. -->\n <div\n #stage\n class=\"ui-image-preview-stage\"\n (pointerdown)=\"onStagePointerDown($event)\"\n (wheel)=\"onWheel($event)\"\n >\n <img\n class=\"ui-image-preview-media\"\n [class._pannable]=\"canPan()\"\n [class._rotated]=\"isQuarterTurned()\"\n [src]=\"src()\"\n [alt]=\"alt()\"\n [style.transform]=\"transform()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n draggable=\"false\"\n />\n </div>\n</div>\n",
|
|
302
|
+
styles: [":host{position:fixed;inset:0;z-index:var(--ui-image-preview-z-index, 1100);display:block;background-color:var(--ui-image-preview-mask-background, var(--primitives-black-80))}.ui-image-preview{display:flex;flex-direction:column;gap:var(--ui-image-preview-gap, var(--units-md));box-sizing:border-box;width:100%;height:100%;padding:var(--ui-image-preview-padding, var(--units-lg));outline:none}.ui-image-preview-toolbar{flex:0 0 auto;display:flex;flex-wrap:wrap;align-self:center;justify-content:center;gap:var(--ui-image-preview-toolbar-gap, var(--units-2xs));padding:var(--ui-image-preview-toolbar-padding, var(--units-2xs));border-radius:var(--ui-image-preview-toolbar-radius, var(--radius-full));background-color:var(--ui-image-preview-toolbar-background, var(--primitives-black-50))}.ui-image-preview-action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-image-preview-action-size, 2.25rem);height:var(--ui-image-preview-action-size, 2.25rem);padding:0;border:none;border-radius:var(--ui-image-preview-action-radius, var(--radius-full));background:transparent;color:var(--ui-image-preview-action-color, var(--primitives-white-base));line-height:0;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-image-preview-action:hover:not([aria-disabled]){background-color:var(--ui-image-preview-action-surface-hover, var(--primitives-white-20))}.ui-image-preview-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-preview-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-preview-action-focus-ring-color, var(--global-border-focus))}.ui-image-preview-action[aria-disabled=true]{opacity:var(--ui-image-preview-action-opacity-disabled, .4);cursor:not-allowed}@media(prefers-reduced-motion:reduce){.ui-image-preview-action{transition-duration:.01ms}}:root[data-motion=off] .ui-image-preview-action{transition-duration:.01ms}.ui-image-preview-stage{flex:1 1 auto;display:flex;align-items:center;justify-content:center;min-height:0;overflow:hidden;container-type:size}.ui-image-preview-media{max-width:var(--ui-image-preview-media-max-width, 100%);max-height:var(--ui-image-preview-media-max-height, 100%);box-shadow:var(--ui-image-preview-media-shadow, var(--shadow-default-lg));object-fit:contain;transform-origin:center;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ui-image-preview-media._rotated{max-width:var(--ui-image-preview-media-max-width-rotated, 100cqh);max-height:var(--ui-image-preview-media-max-height-rotated, 100cqw)}.ui-image-preview-media._pannable{cursor:grab}.ui-image-preview-media._pannable:active{cursor:grabbing}\n"],
|
|
303
|
+
dependencies: [
|
|
304
|
+
{
|
|
305
|
+
kind: "ngmodule",
|
|
306
|
+
type: A11yModule
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
kind: "directive",
|
|
310
|
+
type: i1.CdkTrapFocus,
|
|
311
|
+
selector: "[cdkTrapFocus]",
|
|
312
|
+
inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
|
|
313
|
+
exportAs: ["cdkTrapFocus"]
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
kind: "component",
|
|
317
|
+
type: UiIcon,
|
|
318
|
+
selector: "ui-icon",
|
|
319
|
+
inputs: [
|
|
320
|
+
"name",
|
|
321
|
+
"size",
|
|
322
|
+
"type",
|
|
323
|
+
"family",
|
|
324
|
+
"decorative",
|
|
325
|
+
"ariaLabel"
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
333
|
+
minVersion: "12.0.0",
|
|
334
|
+
version: "22.3.0",
|
|
335
|
+
ngImport: i0,
|
|
336
|
+
type: UiImagePreview,
|
|
337
|
+
decorators: [{
|
|
338
|
+
type: Component,
|
|
339
|
+
args: [{
|
|
340
|
+
selector: "ui-image-preview",
|
|
341
|
+
imports: [A11yModule, UiIcon],
|
|
342
|
+
template: "<!-- The host is the mask; this is the dialog that owns the focus, the keyboard\n shortcuts and the aria wiring. -->\n<div\n class=\"ui-image-preview\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel() || null\"\n tabindex=\"-1\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onKeydown($event)\"\n>\n <!-- Unavailable actions are `aria-disabled`, not `disabled`: a real `disabled`\n drops the focus to the body the moment the button that holds it hits a\n bound, and `Escape` then no longer reaches the dialog. The handlers clamp,\n so a press at the bound is a no-op. -->\n <div class=\"ui-image-preview-toolbar\">\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomOutAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomOut() || null\"\n (click)=\"zoomOut()\"\n >\n <ui-icon name=\"magnifying-glass-minus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"zoomInAriaLabel() || null\"\n [attr.aria-disabled]=\"!canZoomIn() || null\"\n (click)=\"zoomIn()\"\n >\n <ui-icon name=\"magnifying-glass-plus\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateLeftAriaLabel() || null\"\n (click)=\"rotateLeft()\"\n >\n <ui-icon name=\"rotate-left\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"rotateRightAriaLabel() || null\"\n (click)=\"rotateRight()\"\n >\n <ui-icon name=\"rotate-right\" size=\"sm\" />\n </button>\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"resetAriaLabel() || null\"\n [attr.aria-disabled]=\"isPristine() || null\"\n (click)=\"reset()\"\n >\n <ui-icon name=\"arrows-rotate\" size=\"sm\" />\n </button>\n\n @if (downloadable()) {\n <a\n class=\"ui-image-preview-action\"\n [href]=\"src()\"\n [attr.download]=\"downloadName() || ''\"\n [attr.aria-label]=\"downloadAriaLabel() || null\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <ui-icon name=\"download\" size=\"sm\" />\n </a>\n }\n\n <button\n type=\"button\"\n class=\"ui-image-preview-action\"\n [attr.aria-label]=\"closeAriaLabel() || null\"\n (click)=\"close()\"\n >\n <ui-icon name=\"xmark\" size=\"sm\" />\n </button>\n </div>\n\n <!-- The stage is the dismiss-on-outside target: a press that lands on it, and\n not on the image, closes. Escape is its keyboard equivalent, which is why\n there is no key handler here. -->\n <div\n #stage\n class=\"ui-image-preview-stage\"\n (pointerdown)=\"onStagePointerDown($event)\"\n (wheel)=\"onWheel($event)\"\n >\n <img\n class=\"ui-image-preview-media\"\n [class._pannable]=\"canPan()\"\n [class._rotated]=\"isQuarterTurned()\"\n [src]=\"src()\"\n [alt]=\"alt()\"\n [style.transform]=\"transform()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n draggable=\"false\"\n />\n </div>\n</div>\n",
|
|
343
|
+
styles: [":host{position:fixed;inset:0;z-index:var(--ui-image-preview-z-index, 1100);display:block;background-color:var(--ui-image-preview-mask-background, var(--primitives-black-80))}.ui-image-preview{display:flex;flex-direction:column;gap:var(--ui-image-preview-gap, var(--units-md));box-sizing:border-box;width:100%;height:100%;padding:var(--ui-image-preview-padding, var(--units-lg));outline:none}.ui-image-preview-toolbar{flex:0 0 auto;display:flex;flex-wrap:wrap;align-self:center;justify-content:center;gap:var(--ui-image-preview-toolbar-gap, var(--units-2xs));padding:var(--ui-image-preview-toolbar-padding, var(--units-2xs));border-radius:var(--ui-image-preview-toolbar-radius, var(--radius-full));background-color:var(--ui-image-preview-toolbar-background, var(--primitives-black-50))}.ui-image-preview-action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-image-preview-action-size, 2.25rem);height:var(--ui-image-preview-action-size, 2.25rem);padding:0;border:none;border-radius:var(--ui-image-preview-action-radius, var(--radius-full));background:transparent;color:var(--ui-image-preview-action-color, var(--primitives-white-base));line-height:0;text-decoration:none;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-image-preview-action:hover:not([aria-disabled]){background-color:var(--ui-image-preview-action-surface-hover, var(--primitives-white-20))}.ui-image-preview-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-preview-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-preview-action-focus-ring-color, var(--global-border-focus))}.ui-image-preview-action[aria-disabled=true]{opacity:var(--ui-image-preview-action-opacity-disabled, .4);cursor:not-allowed}@media(prefers-reduced-motion:reduce){.ui-image-preview-action{transition-duration:.01ms}}:root[data-motion=off] .ui-image-preview-action{transition-duration:.01ms}.ui-image-preview-stage{flex:1 1 auto;display:flex;align-items:center;justify-content:center;min-height:0;overflow:hidden;container-type:size}.ui-image-preview-media{max-width:var(--ui-image-preview-media-max-width, 100%);max-height:var(--ui-image-preview-media-max-height, 100%);box-shadow:var(--ui-image-preview-media-shadow, var(--shadow-default-lg));object-fit:contain;transform-origin:center;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ui-image-preview-media._rotated{max-width:var(--ui-image-preview-media-max-width-rotated, 100cqh);max-height:var(--ui-image-preview-media-max-height-rotated, 100cqw)}.ui-image-preview-media._pannable{cursor:grab}.ui-image-preview-media._pannable:active{cursor:grabbing}\n"]
|
|
344
|
+
}]
|
|
345
|
+
}],
|
|
346
|
+
ctorParameters: () => [],
|
|
347
|
+
propDecorators: {
|
|
348
|
+
src: [{
|
|
349
|
+
type: i0.Input,
|
|
350
|
+
args: [{
|
|
351
|
+
isSignal: true,
|
|
352
|
+
alias: "src",
|
|
353
|
+
required: true
|
|
354
|
+
}]
|
|
355
|
+
}],
|
|
356
|
+
alt: [{
|
|
357
|
+
type: i0.Input,
|
|
358
|
+
args: [{
|
|
359
|
+
isSignal: true,
|
|
360
|
+
alias: "alt",
|
|
361
|
+
required: false
|
|
362
|
+
}]
|
|
363
|
+
}],
|
|
364
|
+
ariaLabel: [{
|
|
365
|
+
type: i0.Input,
|
|
366
|
+
args: [{
|
|
367
|
+
isSignal: true,
|
|
368
|
+
alias: "ariaLabel",
|
|
369
|
+
required: false
|
|
370
|
+
}]
|
|
371
|
+
}],
|
|
372
|
+
zoomStep: [{
|
|
373
|
+
type: i0.Input,
|
|
374
|
+
args: [{
|
|
375
|
+
isSignal: true,
|
|
376
|
+
alias: "zoomStep",
|
|
377
|
+
required: false
|
|
378
|
+
}]
|
|
379
|
+
}],
|
|
380
|
+
minZoom: [{
|
|
381
|
+
type: i0.Input,
|
|
382
|
+
args: [{
|
|
383
|
+
isSignal: true,
|
|
384
|
+
alias: "minZoom",
|
|
385
|
+
required: false
|
|
386
|
+
}]
|
|
387
|
+
}],
|
|
388
|
+
maxZoom: [{
|
|
389
|
+
type: i0.Input,
|
|
390
|
+
args: [{
|
|
391
|
+
isSignal: true,
|
|
392
|
+
alias: "maxZoom",
|
|
393
|
+
required: false
|
|
394
|
+
}]
|
|
395
|
+
}],
|
|
396
|
+
downloadable: [{
|
|
397
|
+
type: i0.Input,
|
|
398
|
+
args: [{
|
|
399
|
+
isSignal: true,
|
|
400
|
+
alias: "downloadable",
|
|
401
|
+
required: false
|
|
402
|
+
}]
|
|
403
|
+
}],
|
|
404
|
+
downloadName: [{
|
|
405
|
+
type: i0.Input,
|
|
406
|
+
args: [{
|
|
407
|
+
isSignal: true,
|
|
408
|
+
alias: "downloadName",
|
|
409
|
+
required: false
|
|
410
|
+
}]
|
|
411
|
+
}],
|
|
412
|
+
dismissableMask: [{
|
|
413
|
+
type: i0.Input,
|
|
414
|
+
args: [{
|
|
415
|
+
isSignal: true,
|
|
416
|
+
alias: "dismissableMask",
|
|
417
|
+
required: false
|
|
418
|
+
}]
|
|
419
|
+
}],
|
|
420
|
+
zoomInAriaLabel: [{
|
|
421
|
+
type: i0.Input,
|
|
422
|
+
args: [{
|
|
423
|
+
isSignal: true,
|
|
424
|
+
alias: "zoomInAriaLabel",
|
|
425
|
+
required: false
|
|
426
|
+
}]
|
|
427
|
+
}],
|
|
428
|
+
zoomOutAriaLabel: [{
|
|
429
|
+
type: i0.Input,
|
|
430
|
+
args: [{
|
|
431
|
+
isSignal: true,
|
|
432
|
+
alias: "zoomOutAriaLabel",
|
|
433
|
+
required: false
|
|
434
|
+
}]
|
|
435
|
+
}],
|
|
436
|
+
rotateLeftAriaLabel: [{
|
|
437
|
+
type: i0.Input,
|
|
438
|
+
args: [{
|
|
439
|
+
isSignal: true,
|
|
440
|
+
alias: "rotateLeftAriaLabel",
|
|
441
|
+
required: false
|
|
442
|
+
}]
|
|
443
|
+
}],
|
|
444
|
+
rotateRightAriaLabel: [{
|
|
445
|
+
type: i0.Input,
|
|
446
|
+
args: [{
|
|
447
|
+
isSignal: true,
|
|
448
|
+
alias: "rotateRightAriaLabel",
|
|
449
|
+
required: false
|
|
450
|
+
}]
|
|
451
|
+
}],
|
|
452
|
+
resetAriaLabel: [{
|
|
453
|
+
type: i0.Input,
|
|
454
|
+
args: [{
|
|
455
|
+
isSignal: true,
|
|
456
|
+
alias: "resetAriaLabel",
|
|
457
|
+
required: false
|
|
458
|
+
}]
|
|
459
|
+
}],
|
|
460
|
+
downloadAriaLabel: [{
|
|
461
|
+
type: i0.Input,
|
|
462
|
+
args: [{
|
|
463
|
+
isSignal: true,
|
|
464
|
+
alias: "downloadAriaLabel",
|
|
465
|
+
required: false
|
|
466
|
+
}]
|
|
467
|
+
}],
|
|
468
|
+
closeAriaLabel: [{
|
|
469
|
+
type: i0.Input,
|
|
470
|
+
args: [{
|
|
471
|
+
isSignal: true,
|
|
472
|
+
alias: "closeAriaLabel",
|
|
473
|
+
required: false
|
|
474
|
+
}]
|
|
475
|
+
}],
|
|
476
|
+
closed: [{
|
|
477
|
+
type: i0.Output,
|
|
478
|
+
args: ["closed"]
|
|
479
|
+
}],
|
|
480
|
+
stage: [{
|
|
481
|
+
type: i0.ViewChild,
|
|
482
|
+
args: ["stage", { isSignal: true }]
|
|
483
|
+
}]
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
const VOIDED_TAGS = "script, foreignObject, iframe, object, embed, animate, animateTransform, animateMotion, set, handler";
|
|
487
|
+
const REF_ATTRS = /* @__PURE__ */ new Set([
|
|
488
|
+
"href",
|
|
489
|
+
"xlink:href",
|
|
490
|
+
"src"
|
|
491
|
+
]);
|
|
492
|
+
const ALLOWED_REF_PROTOCOLS = ["http:", "https:"];
|
|
251
493
|
function sanitizeInlineSvg(raw) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
// Every event handler, whatever the element it sits on.
|
|
266
|
-
if (name.startsWith('on')) {
|
|
267
|
-
el.removeAttributeNode(attr);
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
if (REF_ATTRS.has(name) && !isSafeRef(attr.value))
|
|
271
|
-
el.removeAttributeNode(attr);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return template.innerHTML;
|
|
494
|
+
if (typeof document === "undefined") return "";
|
|
495
|
+
const template = document.createElement("template");
|
|
496
|
+
template.innerHTML = raw;
|
|
497
|
+
for (const el of Array.from(template.content.querySelectorAll(VOIDED_TAGS))) el.remove();
|
|
498
|
+
for (const el of Array.from(template.content.querySelectorAll("*"))) for (const attr of Array.from(el.attributes)) {
|
|
499
|
+
const name = attr.name.toLowerCase();
|
|
500
|
+
if (name.startsWith("on")) {
|
|
501
|
+
el.removeAttributeNode(attr);
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
if (REF_ATTRS.has(name) && !isSafeRef(attr.value)) el.removeAttributeNode(attr);
|
|
505
|
+
}
|
|
506
|
+
return template.innerHTML;
|
|
275
507
|
}
|
|
276
|
-
/** @internal Rejects `javascript:`, `data:` and the other non-navigational schemes. */
|
|
277
508
|
function isSafeRef(value) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
catch {
|
|
286
|
-
return false;
|
|
287
|
-
}
|
|
509
|
+
const ref = value.trim();
|
|
510
|
+
if (ref.startsWith("#")) return true;
|
|
511
|
+
try {
|
|
512
|
+
return ALLOWED_REF_PROTOCOLS.includes(new URL(ref, document.baseURI).protocol);
|
|
513
|
+
} catch {
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
288
516
|
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Map of the LOCAL assets available to `ui-image` (its `name` input).
|
|
292
|
-
*
|
|
293
|
-
* The kit cannot know a project's assets, so the map is injected rather than
|
|
294
|
-
* bundled: generate it in your app (see the `generate:assets` script in the
|
|
295
|
-
* starter, which writes `src/assets/assets-map.json`) and provide it with
|
|
296
|
-
* `provideUiImageAssets()`. Without it, `name` resolves to nothing and the
|
|
297
|
-
* component falls back to its placeholder — `src` (remote URLs) still works.
|
|
298
|
-
*/
|
|
299
|
-
const UI_IMAGE_ASSETS = new InjectionToken('UI_IMAGE_ASSETS');
|
|
300
|
-
/**
|
|
301
|
-
* Registers the local asset map consumed by `ui-image`.
|
|
302
|
-
*
|
|
303
|
-
* ```ts
|
|
304
|
-
* import assetsMap from './assets/assets-map.json';
|
|
305
|
-
* providers: [provideUiImageAssets(assetsMap)]
|
|
306
|
-
* ```
|
|
307
|
-
*/
|
|
517
|
+
const UI_IMAGE_ASSETS = new InjectionToken("UI_IMAGE_ASSETS");
|
|
308
518
|
function provideUiImageAssets(map) {
|
|
309
|
-
|
|
519
|
+
return {
|
|
520
|
+
provide: UI_IMAGE_ASSETS,
|
|
521
|
+
useValue: map
|
|
522
|
+
};
|
|
310
523
|
}
|
|
311
|
-
|
|
312
|
-
* Cross-instance memoization: the same resolved URL is fetched once (logos
|
|
313
|
-
* repeated across the app).
|
|
314
|
-
*
|
|
315
|
-
* Holds the **scrubbed** markup, never the raw response — nothing that skipped
|
|
316
|
-
* `sanitizeInlineSvg()` may ever be read back out of here.
|
|
317
|
-
*/
|
|
318
|
-
const SVG_CACHE = new Map();
|
|
319
|
-
/** Payload carried in the URL itself (`data:image/png;base64,…`). */
|
|
524
|
+
const SVG_CACHE = /* @__PURE__ */ new Map();
|
|
320
525
|
const DATA_URL = /^data:/i;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiImage, isStandalone: true, selector: "ui-image", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null }, priority: { classPropertyName: "priority", publicName: "priority", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, widthUnit: { classPropertyName: "widthUnit", publicName: "widthUnit", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, heightUnit: { classPropertyName: "heightUnit", publicName: "heightUnit", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, secured: { classPropertyName: "secured", publicName: "secured", isSignal: true, isRequired: false, transformFunction: null }, withCredentials: { classPropertyName: "withCredentials", publicName: "withCredentials", isSignal: true, isRequired: false, transformFunction: null }, loadingLabel: { classPropertyName: "loadingLabel", publicName: "loadingLabel", isSignal: true, isRequired: false, transformFunction: null }, loadingAriaLabel: { classPropertyName: "loadingAriaLabel", publicName: "loadingAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, preview: { classPropertyName: "preview", publicName: "preview", isSignal: true, isRequired: false, transformFunction: null }, previewVisible: { classPropertyName: "previewVisible", publicName: "previewVisible", isSignal: true, isRequired: false, transformFunction: null }, previewAriaLabel: { classPropertyName: "previewAriaLabel", publicName: "previewAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, previewDialogAriaLabel: { classPropertyName: "previewDialogAriaLabel", publicName: "previewDialogAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, zoomStep: { classPropertyName: "zoomStep", publicName: "zoomStep", isSignal: true, isRequired: false, transformFunction: null }, minZoom: { classPropertyName: "minZoom", publicName: "minZoom", isSignal: true, isRequired: false, transformFunction: null }, maxZoom: { classPropertyName: "maxZoom", publicName: "maxZoom", isSignal: true, isRequired: false, transformFunction: null }, downloadable: { classPropertyName: "downloadable", publicName: "downloadable", isSignal: true, isRequired: false, transformFunction: null }, downloadName: { classPropertyName: "downloadName", publicName: "downloadName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { previewVisible: "previewVisibleChange", loadFailed: "loadFailed" }, queries: [{ propertyName: "previewIndicator", first: true, predicate: ["previewIndicator"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- The media is written once and rendered either bare, or inside the preview\n trigger \u2014 a `<button>` cannot wrap three `@else if` branches otherwise. -->\n<ng-template #media>\n @if (securedLoading()) {\n <div\n class=\"ui-image-placeholder _loading\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n >\n <ui-spinner size=\"small\" [label]=\"loadingLabel()\" [ariaLabel]=\"loadingAriaLabel()\" />\n </div>\n } @else if (showPlaceholder()) {\n <div\n class=\"ui-image-placeholder\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [attr.role]=\"alt() ? 'img' : null\"\n [attr.aria-label]=\"alt() || null\"\n [attr.aria-hidden]=\"alt() ? null : true\"\n >\n <ui-icon name=\"image\" />\n </div>\n } @else if (isInlineSvg() && !primaryFailed()) {\n <!--\n EXCEPTION JUSTIFI\u00C9E (FSHSP-177) : le SVG local est inlin\u00E9 pour h\u00E9riter du CSS\n (currentColor, th\u00E8me) \u2014 un <img> ne le permet pas. La valeur est assainie par\n sanitizeInlineSvg() puis pass\u00E9e \u00E0 bypassSecurityTrustHtml() dans ui-image.ts.\n Registre : docs/SECURITY-PRACTICES.md.\n Une paire disable/enable et non un disable-next-line : un commentaire HTML ne\n peut pas se glisser \u00E0 l'int\u00E9rieur d'une balise ouvrante.\n -->\n <!-- eslint-disable no-restricted-syntax -->\n <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\n <!-- eslint-enable no-restricted-syntax -->\n } @else if (isRawSrc()) {\n <!-- `blob:` / `data:` : NgOptimizedImage refuses both, a plain <img> shows them. -->\n <img\n class=\"ui-image\"\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [style.width]=\"!fill() ? cssWidth() : null\"\n [style.height]=\"!fill() ? cssHeight() : null\"\n [attr.loading]=\"priority() ? null : 'lazy'\"\n [attr.fetchpriority]=\"priority() ? 'high' : null\"\n (error)=\"onImgError()\"\n />\n } @else {\n <img\n class=\"ui-image\"\n [ngSrc]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [width]=\"!fill() ? width() : null\"\n [height]=\"!fill() ? (height() ? height() : width()) : null\"\n [fill]=\"fill()\"\n [priority]=\"priority()\"\n (error)=\"onImgError()\"\n />\n }\n</ng-template>\n\n@if (canPreview()) {\n <button\n type=\"button\"\n class=\"ui-image-trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"previewAriaLabel() || null\"\n (click)=\"previewVisible.set(true)\"\n >\n <ng-container [ngTemplateOutlet]=\"media\" />\n\n <!-- Decorative: the affordance is already carried by the button's role and\n its accessible name. -->\n <span class=\"ui-image-indicator\" aria-hidden=\"true\">\n @if (previewIndicator(); as indicator) {\n <ng-container [ngTemplateOutlet]=\"indicator\" />\n } @else {\n <ui-icon name=\"magnifying-glass-plus\" />\n }\n </span>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"media\" />\n}\n\n@if (previewVisible()) {\n <ui-image-preview\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [ariaLabel]=\"previewDialogAriaLabel()\"\n [zoomStep]=\"zoomStep()\"\n [minZoom]=\"minZoom()\"\n [maxZoom]=\"maxZoom()\"\n [downloadable]=\"downloadable()\"\n [downloadName]=\"downloadName()\"\n (closed)=\"previewVisible.set(false)\"\n [uiMotion]=\"'fade'\"\n #previewMotion=\"uiMotion\"\n [animate.enter]=\"previewMotion.enter()\"\n [animate.leave]=\"previewMotion.leave()\"\n />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;justify-content:center}.ui-image{object-fit:var(--ui-image-object-fit, contain)}.ui-image-svg{display:flex;width:100%}.ui-image-svg ::ng-deep svg{width:100%;height:100%}.ui-image-placeholder{display:flex;align-items:center;justify-content:center;min-width:var(--ui-image-placeholder-min-width, var(--units-xl));min-height:var(--ui-image-placeholder-min-height, var(--units-xl));border-radius:var(--ui-image-placeholder-radius, var(--radius-default));background:var(--ui-image-placeholder-surface, var(--global-background-muted));color:var(--ui-image-placeholder-color, var(--global-text-muted))}.ui-image-trigger{position:relative;display:inline-flex;padding:0;border:none;border-radius:var(--ui-image-trigger-radius, 0);background:none;line-height:0;cursor:pointer}.ui-image-trigger:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-trigger-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-trigger-focus-ring-color, var(--global-border-focus))}.ui-image-trigger:hover .ui-image-indicator,.ui-image-trigger:focus-visible .ui-image-indicator{opacity:1}.ui-image-indicator{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:var(--ui-image-indicator-background, var(--primitives-black-50));color:var(--ui-image-indicator-color, var(--primitives-white-base));font-size:var(--ui-image-indicator-font-size, var(--size-typography-text-lg));line-height:1;opacity:0;transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}@media(prefers-reduced-motion:reduce){.ui-image-indicator{transition-duration:.01ms}}:root[data-motion=off] .ui-image-indicator{transition-duration:.01ms}\n"], dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "component", type: UiSpinner, selector: "ui-spinner", inputs: ["size", "orientation", "label", "ariaLabel", "spinnerTemplate", "image", "imageAlt", "icon", "strokeWidth", "fill", "animationDuration", "delay"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }, { kind: "component", type: UiImagePreview, selector: "ui-image-preview", inputs: ["src", "alt", "ariaLabel", "zoomStep", "minZoom", "maxZoom", "downloadable", "downloadName", "dismissableMask", "zoomInAriaLabel", "zoomOutAriaLabel", "rotateLeftAriaLabel", "rotateRightAriaLabel", "resetAriaLabel", "downloadAriaLabel", "closeAriaLabel"], outputs: ["closed"] }] }); }
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
526
|
+
var UiImage = class UiImage {
|
|
527
|
+
constructor() {
|
|
528
|
+
this.sanitizer = inject(DomSanitizer);
|
|
529
|
+
this.assetsMap = inject(UI_IMAGE_ASSETS, { optional: true }) ?? {};
|
|
530
|
+
this.themeService = inject(ThemeService);
|
|
531
|
+
this.brandService = inject(BrandService);
|
|
532
|
+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
533
|
+
this.name = input(...ngDevMode ? [void 0, { debugName: "name" }] : /* istanbul ignore next */ []);
|
|
534
|
+
this.src = input(...ngDevMode ? [void 0, { debugName: "src" }] : /* istanbul ignore next */ []);
|
|
535
|
+
this.fallback = input(...ngDevMode ? [void 0, { debugName: "fallback" }] : /* istanbul ignore next */ []);
|
|
536
|
+
this.priority = input(false, ...ngDevMode ? [{ debugName: "priority" }] : /* istanbul ignore next */ []);
|
|
537
|
+
this.fill = input(false, ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
|
|
538
|
+
this.width = input(...ngDevMode ? [void 0, { debugName: "width" }] : /* istanbul ignore next */ []);
|
|
539
|
+
this.widthUnit = input(...ngDevMode ? [void 0, { debugName: "widthUnit" }] : /* istanbul ignore next */ []);
|
|
540
|
+
this.height = input(...ngDevMode ? [void 0, { debugName: "height" }] : /* istanbul ignore next */ []);
|
|
541
|
+
this.heightUnit = input(...ngDevMode ? [void 0, { debugName: "heightUnit" }] : /* istanbul ignore next */ []);
|
|
542
|
+
this.alt = input(...ngDevMode ? [void 0, { debugName: "alt" }] : /* istanbul ignore next */ []);
|
|
543
|
+
this.secured = input(false, {
|
|
544
|
+
...ngDevMode ? { debugName: "secured" } : /* istanbul ignore next */ {},
|
|
545
|
+
transform: booleanAttribute
|
|
546
|
+
});
|
|
547
|
+
this.withCredentials = input(false, {
|
|
548
|
+
...ngDevMode ? { debugName: "withCredentials" } : /* istanbul ignore next */ {},
|
|
549
|
+
transform: booleanAttribute
|
|
550
|
+
});
|
|
551
|
+
this.loadingLabel = input(...ngDevMode ? [void 0, { debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
|
|
552
|
+
this.loadingAriaLabel = input("Chargement de l’image", ...ngDevMode ? [{ debugName: "loadingAriaLabel" }] : /* istanbul ignore next */ []);
|
|
553
|
+
this.preview = input(false, {
|
|
554
|
+
...ngDevMode ? { debugName: "preview" } : /* istanbul ignore next */ {},
|
|
555
|
+
transform: booleanAttribute
|
|
556
|
+
});
|
|
557
|
+
this.previewVisible = model(false, ...ngDevMode ? [{ debugName: "previewVisible" }] : /* istanbul ignore next */ []);
|
|
558
|
+
this.previewAriaLabel = input(...ngDevMode ? [void 0, { debugName: "previewAriaLabel" }] : /* istanbul ignore next */ []);
|
|
559
|
+
this.previewDialogAriaLabel = input("Aperçu de l’image", ...ngDevMode ? [{ debugName: "previewDialogAriaLabel" }] : /* istanbul ignore next */ []);
|
|
560
|
+
this.zoomStep = input(.25, {
|
|
561
|
+
...ngDevMode ? { debugName: "zoomStep" } : /* istanbul ignore next */ {},
|
|
562
|
+
transform: numberAttribute
|
|
563
|
+
});
|
|
564
|
+
this.minZoom = input(.5, {
|
|
565
|
+
...ngDevMode ? { debugName: "minZoom" } : /* istanbul ignore next */ {},
|
|
566
|
+
transform: numberAttribute
|
|
567
|
+
});
|
|
568
|
+
this.maxZoom = input(4, {
|
|
569
|
+
...ngDevMode ? { debugName: "maxZoom" } : /* istanbul ignore next */ {},
|
|
570
|
+
transform: numberAttribute
|
|
571
|
+
});
|
|
572
|
+
this.downloadable = input(false, {
|
|
573
|
+
...ngDevMode ? { debugName: "downloadable" } : /* istanbul ignore next */ {},
|
|
574
|
+
transform: booleanAttribute
|
|
575
|
+
});
|
|
576
|
+
this.downloadName = input(...ngDevMode ? [void 0, { debugName: "downloadName" }] : /* istanbul ignore next */ []);
|
|
577
|
+
this.loadFailed = output();
|
|
578
|
+
this.previewIndicator = contentChild("previewIndicator", ...ngDevMode ? [{ debugName: "previewIndicator" }] : /* istanbul ignore next */ []);
|
|
579
|
+
this.isRemote = computed(() => !!this.src(), ...ngDevMode ? [{ debugName: "isRemote" }] : /* istanbul ignore next */ []);
|
|
580
|
+
this.isInlineSvg = computed(() => !this.isRemote() && !!this.name()?.toLowerCase().endsWith(".svg"), ...ngDevMode ? [{ debugName: "isInlineSvg" }] : /* istanbul ignore next */ []);
|
|
581
|
+
this.isSecured = computed(() => this.secured() && !!this.src(), ...ngDevMode ? [{ debugName: "isSecured" }] : /* istanbul ignore next */ []);
|
|
582
|
+
this.isDataUrl = computed(() => DATA_URL.test(this.src() ?? ""), ...ngDevMode ? [{ debugName: "isDataUrl" }] : /* istanbul ignore next */ []);
|
|
583
|
+
this.localSrc = computed(() => this.resolveLocal(this.name()), ...ngDevMode ? [{ debugName: "localSrc" }] : /* istanbul ignore next */ []);
|
|
584
|
+
this.fallbackSrc = computed(() => this.resolveLocal(this.fallback()), ...ngDevMode ? [{ debugName: "fallbackSrc" }] : /* istanbul ignore next */ []);
|
|
585
|
+
this.blobResource = httpResource.blob(() => this.isSecured() ? {
|
|
586
|
+
url: this.src(),
|
|
587
|
+
withCredentials: this.withCredentials()
|
|
588
|
+
} : void 0, ...ngDevMode ? [{ debugName: "blobResource" }] : /* istanbul ignore next */ []);
|
|
589
|
+
this.blobUrl = signal(null, ...ngDevMode ? [{ debugName: "blobUrl" }] : /* istanbul ignore next */ []);
|
|
590
|
+
this.securedLoading = computed(() => this.isSecured() && this.blobResource.isLoading(), ...ngDevMode ? [{ debugName: "securedLoading" }] : /* istanbul ignore next */ []);
|
|
591
|
+
this.securedFailed = computed(() => this.isSecured() && this.blobResource.status() === "error", ...ngDevMode ? [{ debugName: "securedFailed" }] : /* istanbul ignore next */ []);
|
|
592
|
+
this.primarySrc = computed(() => this.isSecured() ? this.blobUrl() ?? "" : this.src() || this.localSrc(), ...ngDevMode ? [{ debugName: "primarySrc" }] : /* istanbul ignore next */ []);
|
|
593
|
+
this.primaryImgFailed = linkedSignal({
|
|
594
|
+
...ngDevMode ? { debugName: "primaryImgFailed" } : /* istanbul ignore next */ {},
|
|
595
|
+
source: this.primarySrc,
|
|
596
|
+
computation: () => false
|
|
597
|
+
});
|
|
598
|
+
this.fallbackImgFailed = linkedSignal({
|
|
599
|
+
...ngDevMode ? { debugName: "fallbackImgFailed" } : /* istanbul ignore next */ {},
|
|
600
|
+
source: this.fallbackSrc,
|
|
601
|
+
computation: () => false
|
|
602
|
+
});
|
|
603
|
+
this.svgResource = httpResource.text(() => {
|
|
604
|
+
if (!this.isInlineSvg()) return void 0;
|
|
605
|
+
const url = this.localSrc();
|
|
606
|
+
return !url || SVG_CACHE.has(url) ? void 0 : url;
|
|
607
|
+
}, ...ngDevMode ? [{ debugName: "svgResource" }] : /* istanbul ignore next */ []);
|
|
608
|
+
this.svgContent = computed(() => {
|
|
609
|
+
if (!this.isInlineSvg()) return null;
|
|
610
|
+
const url = this.localSrc();
|
|
611
|
+
if (!url) return null;
|
|
612
|
+
const safe = SVG_CACHE.get(url) ?? (this.svgResource.hasValue() ? sanitizeInlineSvg(this.svgResource.value()) : void 0);
|
|
613
|
+
return safe === void 0 ? null : this.sanitizer.bypassSecurityTrustHtml(safe);
|
|
614
|
+
}, ...ngDevMode ? [{ debugName: "svgContent" }] : /* istanbul ignore next */ []);
|
|
615
|
+
this.primaryFailed = computed(() => {
|
|
616
|
+
if (this.isInlineSvg()) return this.svgResource.status() === "error";
|
|
617
|
+
return this.securedFailed() || this.primaryImgFailed();
|
|
618
|
+
}, ...ngDevMode ? [{ debugName: "primaryFailed" }] : /* istanbul ignore next */ []);
|
|
619
|
+
this.showFallback = computed(() => this.primaryFailed() && !!this.fallbackSrc() && !this.fallbackImgFailed(), ...ngDevMode ? [{ debugName: "showFallback" }] : /* istanbul ignore next */ []);
|
|
620
|
+
this.showPlaceholder = computed(() => !this.securedLoading() && (!this.primarySrc() || this.primaryFailed() && (!this.fallbackSrc() || this.fallbackImgFailed())), ...ngDevMode ? [{ debugName: "showPlaceholder" }] : /* istanbul ignore next */ []);
|
|
621
|
+
this.displayedSrc = computed(() => this.showFallback() ? this.fallbackSrc() : this.primarySrc(), ...ngDevMode ? [{ debugName: "displayedSrc" }] : /* istanbul ignore next */ []);
|
|
622
|
+
this.isRawSrc = computed(() => !this.showFallback() && (this.isSecured() || this.isDataUrl()), ...ngDevMode ? [{ debugName: "isRawSrc" }] : /* istanbul ignore next */ []);
|
|
623
|
+
this.canPreview = computed(() => this.preview() && !this.showPlaceholder() && !this.securedLoading(), ...ngDevMode ? [{ debugName: "canPreview" }] : /* istanbul ignore next */ []);
|
|
624
|
+
this.cssWidth = computed(() => this.width() != null ? `${this.width()}${this.widthUnit() || "px"}` : null, ...ngDevMode ? [{ debugName: "cssWidth" }] : /* istanbul ignore next */ []);
|
|
625
|
+
this.cssHeight = computed(() => this.height() != null ? `${this.height()}${this.heightUnit() || "px"}` : null, ...ngDevMode ? [{ debugName: "cssHeight" }] : /* istanbul ignore next */ []);
|
|
626
|
+
effect(() => {
|
|
627
|
+
if (!this.isInlineSvg()) return;
|
|
628
|
+
const url = this.localSrc();
|
|
629
|
+
if (url && this.svgResource.hasValue()) SVG_CACHE.set(url, sanitizeInlineSvg(this.svgResource.value()));
|
|
630
|
+
});
|
|
631
|
+
effect((onCleanup) => {
|
|
632
|
+
const blob = this.blobResource.hasValue() ? this.blobResource.value() : void 0;
|
|
633
|
+
if (!blob || !this.isBrowser) {
|
|
634
|
+
this.blobUrl.set(null);
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
const url = URL.createObjectURL(blob);
|
|
638
|
+
this.blobUrl.set(url);
|
|
639
|
+
onCleanup(() => URL.revokeObjectURL(url));
|
|
640
|
+
});
|
|
641
|
+
effect(() => {
|
|
642
|
+
if (this.securedFailed()) this.loadFailed.emit(this.src());
|
|
643
|
+
});
|
|
644
|
+
effect(() => {
|
|
645
|
+
if (this.previewVisible() && !this.canPreview()) this.previewVisible.set(false);
|
|
646
|
+
});
|
|
647
|
+
if (isDevMode()) effect(() => {
|
|
648
|
+
if (this.src() && this.name()) console.warn("[ui-image] `src` and `name` are both set — `src` takes precedence.");
|
|
649
|
+
if (!this.src() && !this.name()) console.warn("[ui-image] Neither `src` nor `name` is set — the placeholder is displayed.");
|
|
650
|
+
if (this.secured() && !this.src()) console.warn("[ui-image] `secured` has no effect without `src` — nothing to fetch.");
|
|
651
|
+
if (this.preview() && !this.alt() && !this.previewAriaLabel()) console.warn("[ui-image] `preview` renders a button with no accessible name — set `alt` or `previewAriaLabel`.");
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
onImgError() {
|
|
655
|
+
const failed = this.displayedSrc();
|
|
656
|
+
if (this.showFallback()) this.fallbackImgFailed.set(true);
|
|
657
|
+
else this.primaryImgFailed.set(true);
|
|
658
|
+
if (failed) this.loadFailed.emit(failed);
|
|
659
|
+
}
|
|
660
|
+
resolveLocal(filename) {
|
|
661
|
+
if (!filename) return "";
|
|
662
|
+
const mode = this.themeService.currentMode();
|
|
663
|
+
const brand = this.brandService.currentBrand();
|
|
664
|
+
const fileEntry = this.assetsMap[filename];
|
|
665
|
+
if (!fileEntry) return "";
|
|
666
|
+
if (fileEntry[brand]) {
|
|
667
|
+
const path = this.resolvePath(brand, fileEntry[brand], mode, filename);
|
|
668
|
+
if (path) return path;
|
|
669
|
+
}
|
|
670
|
+
if (fileEntry["common"]) return this.buildPath("common", fileEntry["common"], mode, filename);
|
|
671
|
+
return "";
|
|
672
|
+
}
|
|
673
|
+
resolvePath(themeFolder, variants, currentMode, filename) {
|
|
674
|
+
if (variants[currentMode]) return `assets/img/${themeFolder}/${variants[currentMode]}/${currentMode}/${filename}`;
|
|
675
|
+
if (variants.base) return `assets/img/${themeFolder}/${variants.base}/${filename}`;
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
buildPath(themeName, variants, currentMode, filename) {
|
|
679
|
+
if (variants[currentMode]) return `assets/img/${themeName}/${variants[currentMode]}/${currentMode}/${filename}`;
|
|
680
|
+
if (variants.base) return `assets/img/${themeName}/${variants.base}/${filename}`;
|
|
681
|
+
return "";
|
|
682
|
+
}
|
|
683
|
+
static {
|
|
684
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
685
|
+
minVersion: "12.0.0",
|
|
686
|
+
version: "22.3.0",
|
|
687
|
+
ngImport: i0,
|
|
688
|
+
type: UiImage,
|
|
689
|
+
deps: [],
|
|
690
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
static {
|
|
694
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
695
|
+
minVersion: "17.0.0",
|
|
696
|
+
version: "22.3.0",
|
|
697
|
+
type: UiImage,
|
|
698
|
+
isStandalone: true,
|
|
699
|
+
selector: "ui-image",
|
|
700
|
+
inputs: {
|
|
701
|
+
name: {
|
|
702
|
+
classPropertyName: "name",
|
|
703
|
+
publicName: "name",
|
|
704
|
+
isSignal: true,
|
|
705
|
+
isRequired: false,
|
|
706
|
+
transformFunction: null
|
|
707
|
+
},
|
|
708
|
+
src: {
|
|
709
|
+
classPropertyName: "src",
|
|
710
|
+
publicName: "src",
|
|
711
|
+
isSignal: true,
|
|
712
|
+
isRequired: false,
|
|
713
|
+
transformFunction: null
|
|
714
|
+
},
|
|
715
|
+
fallback: {
|
|
716
|
+
classPropertyName: "fallback",
|
|
717
|
+
publicName: "fallback",
|
|
718
|
+
isSignal: true,
|
|
719
|
+
isRequired: false,
|
|
720
|
+
transformFunction: null
|
|
721
|
+
},
|
|
722
|
+
priority: {
|
|
723
|
+
classPropertyName: "priority",
|
|
724
|
+
publicName: "priority",
|
|
725
|
+
isSignal: true,
|
|
726
|
+
isRequired: false,
|
|
727
|
+
transformFunction: null
|
|
728
|
+
},
|
|
729
|
+
fill: {
|
|
730
|
+
classPropertyName: "fill",
|
|
731
|
+
publicName: "fill",
|
|
732
|
+
isSignal: true,
|
|
733
|
+
isRequired: false,
|
|
734
|
+
transformFunction: null
|
|
735
|
+
},
|
|
736
|
+
width: {
|
|
737
|
+
classPropertyName: "width",
|
|
738
|
+
publicName: "width",
|
|
739
|
+
isSignal: true,
|
|
740
|
+
isRequired: false,
|
|
741
|
+
transformFunction: null
|
|
742
|
+
},
|
|
743
|
+
widthUnit: {
|
|
744
|
+
classPropertyName: "widthUnit",
|
|
745
|
+
publicName: "widthUnit",
|
|
746
|
+
isSignal: true,
|
|
747
|
+
isRequired: false,
|
|
748
|
+
transformFunction: null
|
|
749
|
+
},
|
|
750
|
+
height: {
|
|
751
|
+
classPropertyName: "height",
|
|
752
|
+
publicName: "height",
|
|
753
|
+
isSignal: true,
|
|
754
|
+
isRequired: false,
|
|
755
|
+
transformFunction: null
|
|
756
|
+
},
|
|
757
|
+
heightUnit: {
|
|
758
|
+
classPropertyName: "heightUnit",
|
|
759
|
+
publicName: "heightUnit",
|
|
760
|
+
isSignal: true,
|
|
761
|
+
isRequired: false,
|
|
762
|
+
transformFunction: null
|
|
763
|
+
},
|
|
764
|
+
alt: {
|
|
765
|
+
classPropertyName: "alt",
|
|
766
|
+
publicName: "alt",
|
|
767
|
+
isSignal: true,
|
|
768
|
+
isRequired: false,
|
|
769
|
+
transformFunction: null
|
|
770
|
+
},
|
|
771
|
+
secured: {
|
|
772
|
+
classPropertyName: "secured",
|
|
773
|
+
publicName: "secured",
|
|
774
|
+
isSignal: true,
|
|
775
|
+
isRequired: false,
|
|
776
|
+
transformFunction: null
|
|
777
|
+
},
|
|
778
|
+
withCredentials: {
|
|
779
|
+
classPropertyName: "withCredentials",
|
|
780
|
+
publicName: "withCredentials",
|
|
781
|
+
isSignal: true,
|
|
782
|
+
isRequired: false,
|
|
783
|
+
transformFunction: null
|
|
784
|
+
},
|
|
785
|
+
loadingLabel: {
|
|
786
|
+
classPropertyName: "loadingLabel",
|
|
787
|
+
publicName: "loadingLabel",
|
|
788
|
+
isSignal: true,
|
|
789
|
+
isRequired: false,
|
|
790
|
+
transformFunction: null
|
|
791
|
+
},
|
|
792
|
+
loadingAriaLabel: {
|
|
793
|
+
classPropertyName: "loadingAriaLabel",
|
|
794
|
+
publicName: "loadingAriaLabel",
|
|
795
|
+
isSignal: true,
|
|
796
|
+
isRequired: false,
|
|
797
|
+
transformFunction: null
|
|
798
|
+
},
|
|
799
|
+
preview: {
|
|
800
|
+
classPropertyName: "preview",
|
|
801
|
+
publicName: "preview",
|
|
802
|
+
isSignal: true,
|
|
803
|
+
isRequired: false,
|
|
804
|
+
transformFunction: null
|
|
805
|
+
},
|
|
806
|
+
previewVisible: {
|
|
807
|
+
classPropertyName: "previewVisible",
|
|
808
|
+
publicName: "previewVisible",
|
|
809
|
+
isSignal: true,
|
|
810
|
+
isRequired: false,
|
|
811
|
+
transformFunction: null
|
|
812
|
+
},
|
|
813
|
+
previewAriaLabel: {
|
|
814
|
+
classPropertyName: "previewAriaLabel",
|
|
815
|
+
publicName: "previewAriaLabel",
|
|
816
|
+
isSignal: true,
|
|
817
|
+
isRequired: false,
|
|
818
|
+
transformFunction: null
|
|
819
|
+
},
|
|
820
|
+
previewDialogAriaLabel: {
|
|
821
|
+
classPropertyName: "previewDialogAriaLabel",
|
|
822
|
+
publicName: "previewDialogAriaLabel",
|
|
823
|
+
isSignal: true,
|
|
824
|
+
isRequired: false,
|
|
825
|
+
transformFunction: null
|
|
826
|
+
},
|
|
827
|
+
zoomStep: {
|
|
828
|
+
classPropertyName: "zoomStep",
|
|
829
|
+
publicName: "zoomStep",
|
|
830
|
+
isSignal: true,
|
|
831
|
+
isRequired: false,
|
|
832
|
+
transformFunction: null
|
|
833
|
+
},
|
|
834
|
+
minZoom: {
|
|
835
|
+
classPropertyName: "minZoom",
|
|
836
|
+
publicName: "minZoom",
|
|
837
|
+
isSignal: true,
|
|
838
|
+
isRequired: false,
|
|
839
|
+
transformFunction: null
|
|
840
|
+
},
|
|
841
|
+
maxZoom: {
|
|
842
|
+
classPropertyName: "maxZoom",
|
|
843
|
+
publicName: "maxZoom",
|
|
844
|
+
isSignal: true,
|
|
845
|
+
isRequired: false,
|
|
846
|
+
transformFunction: null
|
|
847
|
+
},
|
|
848
|
+
downloadable: {
|
|
849
|
+
classPropertyName: "downloadable",
|
|
850
|
+
publicName: "downloadable",
|
|
851
|
+
isSignal: true,
|
|
852
|
+
isRequired: false,
|
|
853
|
+
transformFunction: null
|
|
854
|
+
},
|
|
855
|
+
downloadName: {
|
|
856
|
+
classPropertyName: "downloadName",
|
|
857
|
+
publicName: "downloadName",
|
|
858
|
+
isSignal: true,
|
|
859
|
+
isRequired: false,
|
|
860
|
+
transformFunction: null
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
outputs: {
|
|
864
|
+
previewVisible: "previewVisibleChange",
|
|
865
|
+
loadFailed: "loadFailed"
|
|
866
|
+
},
|
|
867
|
+
queries: [{
|
|
868
|
+
propertyName: "previewIndicator",
|
|
869
|
+
first: true,
|
|
870
|
+
predicate: ["previewIndicator"],
|
|
871
|
+
descendants: true,
|
|
872
|
+
isSignal: true
|
|
873
|
+
}],
|
|
874
|
+
ngImport: i0,
|
|
875
|
+
template: "<!-- The media is written once and rendered either bare, or inside the preview\n trigger — a `<button>` cannot wrap three `@else if` branches otherwise. -->\n<ng-template #media>\n @if (securedLoading()) {\n <div\n class=\"ui-image-placeholder _loading\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n >\n <ui-spinner size=\"small\" [label]=\"loadingLabel()\" [ariaLabel]=\"loadingAriaLabel()\" />\n </div>\n } @else if (showPlaceholder()) {\n <div\n class=\"ui-image-placeholder\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [attr.role]=\"alt() ? 'img' : null\"\n [attr.aria-label]=\"alt() || null\"\n [attr.aria-hidden]=\"alt() ? null : true\"\n >\n <ui-icon name=\"image\" />\n </div>\n } @else if (isInlineSvg() && !primaryFailed()) {\n <!--\n EXCEPTION JUSTIFIÉE (FSHSP-177) : le SVG local est inliné pour hériter du CSS\n (currentColor, thème) — un <img> ne le permet pas. La valeur est assainie par\n sanitizeInlineSvg() puis passée à bypassSecurityTrustHtml() dans ui-image.ts.\n Registre : docs/SECURITY-PRACTICES.md.\n Une paire disable/enable et non un disable-next-line : un commentaire HTML ne\n peut pas se glisser à l'intérieur d'une balise ouvrante.\n -->\n <!-- eslint-disable no-restricted-syntax -->\n <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\n <!-- eslint-enable no-restricted-syntax -->\n } @else if (isRawSrc()) {\n <!-- `blob:` / `data:` : NgOptimizedImage refuses both, a plain <img> shows them. -->\n <img\n class=\"ui-image\"\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [style.width]=\"!fill() ? cssWidth() : null\"\n [style.height]=\"!fill() ? cssHeight() : null\"\n [attr.loading]=\"priority() ? null : 'lazy'\"\n [attr.fetchpriority]=\"priority() ? 'high' : null\"\n (error)=\"onImgError()\"\n />\n } @else {\n <img\n class=\"ui-image\"\n [ngSrc]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [width]=\"!fill() ? width() : null\"\n [height]=\"!fill() ? (height() ? height() : width()) : null\"\n [fill]=\"fill()\"\n [priority]=\"priority()\"\n (error)=\"onImgError()\"\n />\n }\n</ng-template>\n\n@if (canPreview()) {\n <button\n type=\"button\"\n class=\"ui-image-trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"previewAriaLabel() || null\"\n (click)=\"previewVisible.set(true)\"\n >\n <ng-container [ngTemplateOutlet]=\"media\" />\n\n <!-- Decorative: the affordance is already carried by the button's role and\n its accessible name. -->\n <span class=\"ui-image-indicator\" aria-hidden=\"true\">\n @if (previewIndicator(); as indicator) {\n <ng-container [ngTemplateOutlet]=\"indicator\" />\n } @else {\n <ui-icon name=\"magnifying-glass-plus\" />\n }\n </span>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"media\" />\n}\n\n@if (previewVisible()) {\n <ui-image-preview\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [ariaLabel]=\"previewDialogAriaLabel()\"\n [zoomStep]=\"zoomStep()\"\n [minZoom]=\"minZoom()\"\n [maxZoom]=\"maxZoom()\"\n [downloadable]=\"downloadable()\"\n [downloadName]=\"downloadName()\"\n (closed)=\"previewVisible.set(false)\"\n [uiMotion]=\"'fade'\"\n #previewMotion=\"uiMotion\"\n [animate.enter]=\"previewMotion.enter()\"\n [animate.leave]=\"previewMotion.leave()\"\n />\n}\n",
|
|
876
|
+
styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;justify-content:center}.ui-image{object-fit:var(--ui-image-object-fit, contain)}.ui-image-svg{display:flex;width:100%}.ui-image-svg ::ng-deep svg{width:100%;height:100%}.ui-image-placeholder{display:flex;align-items:center;justify-content:center;min-width:var(--ui-image-placeholder-min-width, var(--units-xl));min-height:var(--ui-image-placeholder-min-height, var(--units-xl));border-radius:var(--ui-image-placeholder-radius, var(--radius-default));background:var(--ui-image-placeholder-surface, var(--global-background-muted));color:var(--ui-image-placeholder-color, var(--global-text-muted))}.ui-image-trigger{position:relative;display:inline-flex;padding:0;border:none;border-radius:var(--ui-image-trigger-radius, 0);background:none;line-height:0;cursor:pointer}.ui-image-trigger:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-trigger-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-trigger-focus-ring-color, var(--global-border-focus))}.ui-image-trigger:hover .ui-image-indicator,.ui-image-trigger:focus-visible .ui-image-indicator{opacity:1}.ui-image-indicator{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:var(--ui-image-indicator-background, var(--primitives-black-50));color:var(--ui-image-indicator-color, var(--primitives-white-base));font-size:var(--ui-image-indicator-font-size, var(--size-typography-text-lg));line-height:1;opacity:0;transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}@media(prefers-reduced-motion:reduce){.ui-image-indicator{transition-duration:.01ms}}:root[data-motion=off] .ui-image-indicator{transition-duration:.01ms}\n"],
|
|
877
|
+
dependencies: [
|
|
878
|
+
{
|
|
879
|
+
kind: "directive",
|
|
880
|
+
type: NgOptimizedImage,
|
|
881
|
+
selector: "img[ngSrc]",
|
|
882
|
+
inputs: [
|
|
883
|
+
"ngSrc",
|
|
884
|
+
"ngSrcset",
|
|
885
|
+
"sizes",
|
|
886
|
+
"width",
|
|
887
|
+
"height",
|
|
888
|
+
"decoding",
|
|
889
|
+
"loading",
|
|
890
|
+
"priority",
|
|
891
|
+
"loaderParams",
|
|
892
|
+
"disableOptimizedSrcset",
|
|
893
|
+
"fill",
|
|
894
|
+
"placeholder",
|
|
895
|
+
"placeholderConfig",
|
|
896
|
+
"src",
|
|
897
|
+
"srcset"
|
|
898
|
+
]
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
kind: "directive",
|
|
902
|
+
type: NgTemplateOutlet,
|
|
903
|
+
selector: "[ngTemplateOutlet]",
|
|
904
|
+
inputs: [
|
|
905
|
+
"ngTemplateOutletContext",
|
|
906
|
+
"ngTemplateOutlet",
|
|
907
|
+
"ngTemplateOutletInjector"
|
|
908
|
+
]
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
kind: "component",
|
|
912
|
+
type: UiIcon,
|
|
913
|
+
selector: "ui-icon",
|
|
914
|
+
inputs: [
|
|
915
|
+
"name",
|
|
916
|
+
"size",
|
|
917
|
+
"type",
|
|
918
|
+
"family",
|
|
919
|
+
"decorative",
|
|
920
|
+
"ariaLabel"
|
|
921
|
+
]
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
kind: "component",
|
|
925
|
+
type: UiSpinner,
|
|
926
|
+
selector: "ui-spinner",
|
|
927
|
+
inputs: [
|
|
928
|
+
"size",
|
|
929
|
+
"orientation",
|
|
930
|
+
"label",
|
|
931
|
+
"ariaLabel",
|
|
932
|
+
"spinnerTemplate",
|
|
933
|
+
"image",
|
|
934
|
+
"imageAlt",
|
|
935
|
+
"icon",
|
|
936
|
+
"strokeWidth",
|
|
937
|
+
"fill",
|
|
938
|
+
"animationDuration",
|
|
939
|
+
"delay"
|
|
940
|
+
]
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
kind: "directive",
|
|
944
|
+
type: UiMotion,
|
|
945
|
+
selector: "[uiMotion]",
|
|
946
|
+
inputs: [
|
|
947
|
+
"uiMotion",
|
|
948
|
+
"motionDuration",
|
|
949
|
+
"motionDelay",
|
|
950
|
+
"motionEasing",
|
|
951
|
+
"motionEnterEasing",
|
|
952
|
+
"motionLeaveEasing",
|
|
953
|
+
"motionDistance",
|
|
954
|
+
"motionScale",
|
|
955
|
+
"motionDisabled",
|
|
956
|
+
"motionOnInsert"
|
|
957
|
+
],
|
|
958
|
+
exportAs: ["uiMotion"]
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
kind: "component",
|
|
962
|
+
type: UiImagePreview,
|
|
963
|
+
selector: "ui-image-preview",
|
|
964
|
+
inputs: [
|
|
965
|
+
"src",
|
|
966
|
+
"alt",
|
|
967
|
+
"ariaLabel",
|
|
968
|
+
"zoomStep",
|
|
969
|
+
"minZoom",
|
|
970
|
+
"maxZoom",
|
|
971
|
+
"downloadable",
|
|
972
|
+
"downloadName",
|
|
973
|
+
"dismissableMask",
|
|
974
|
+
"zoomInAriaLabel",
|
|
975
|
+
"zoomOutAriaLabel",
|
|
976
|
+
"rotateLeftAriaLabel",
|
|
977
|
+
"rotateRightAriaLabel",
|
|
978
|
+
"resetAriaLabel",
|
|
979
|
+
"downloadAriaLabel",
|
|
980
|
+
"closeAriaLabel"
|
|
981
|
+
],
|
|
982
|
+
outputs: ["closed"]
|
|
983
|
+
}
|
|
984
|
+
]
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
989
|
+
minVersion: "12.0.0",
|
|
990
|
+
version: "22.3.0",
|
|
991
|
+
ngImport: i0,
|
|
992
|
+
type: UiImage,
|
|
993
|
+
decorators: [{
|
|
994
|
+
type: Component,
|
|
995
|
+
args: [{
|
|
996
|
+
selector: "ui-image",
|
|
997
|
+
imports: [
|
|
998
|
+
NgOptimizedImage,
|
|
999
|
+
NgTemplateOutlet,
|
|
1000
|
+
UiIcon,
|
|
1001
|
+
UiSpinner,
|
|
1002
|
+
UiMotion,
|
|
1003
|
+
UiImagePreview
|
|
1004
|
+
],
|
|
1005
|
+
template: "<!-- The media is written once and rendered either bare, or inside the preview\n trigger — a `<button>` cannot wrap three `@else if` branches otherwise. -->\n<ng-template #media>\n @if (securedLoading()) {\n <div\n class=\"ui-image-placeholder _loading\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n >\n <ui-spinner size=\"small\" [label]=\"loadingLabel()\" [ariaLabel]=\"loadingAriaLabel()\" />\n </div>\n } @else if (showPlaceholder()) {\n <div\n class=\"ui-image-placeholder\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [attr.role]=\"alt() ? 'img' : null\"\n [attr.aria-label]=\"alt() || null\"\n [attr.aria-hidden]=\"alt() ? null : true\"\n >\n <ui-icon name=\"image\" />\n </div>\n } @else if (isInlineSvg() && !primaryFailed()) {\n <!--\n EXCEPTION JUSTIFIÉE (FSHSP-177) : le SVG local est inliné pour hériter du CSS\n (currentColor, thème) — un <img> ne le permet pas. La valeur est assainie par\n sanitizeInlineSvg() puis passée à bypassSecurityTrustHtml() dans ui-image.ts.\n Registre : docs/SECURITY-PRACTICES.md.\n Une paire disable/enable et non un disable-next-line : un commentaire HTML ne\n peut pas se glisser à l'intérieur d'une balise ouvrante.\n -->\n <!-- eslint-disable no-restricted-syntax -->\n <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\n <!-- eslint-enable no-restricted-syntax -->\n } @else if (isRawSrc()) {\n <!-- `blob:` / `data:` : NgOptimizedImage refuses both, a plain <img> shows them. -->\n <img\n class=\"ui-image\"\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [style.width]=\"!fill() ? cssWidth() : null\"\n [style.height]=\"!fill() ? cssHeight() : null\"\n [attr.loading]=\"priority() ? null : 'lazy'\"\n [attr.fetchpriority]=\"priority() ? 'high' : null\"\n (error)=\"onImgError()\"\n />\n } @else {\n <img\n class=\"ui-image\"\n [ngSrc]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [width]=\"!fill() ? width() : null\"\n [height]=\"!fill() ? (height() ? height() : width()) : null\"\n [fill]=\"fill()\"\n [priority]=\"priority()\"\n (error)=\"onImgError()\"\n />\n }\n</ng-template>\n\n@if (canPreview()) {\n <button\n type=\"button\"\n class=\"ui-image-trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"previewAriaLabel() || null\"\n (click)=\"previewVisible.set(true)\"\n >\n <ng-container [ngTemplateOutlet]=\"media\" />\n\n <!-- Decorative: the affordance is already carried by the button's role and\n its accessible name. -->\n <span class=\"ui-image-indicator\" aria-hidden=\"true\">\n @if (previewIndicator(); as indicator) {\n <ng-container [ngTemplateOutlet]=\"indicator\" />\n } @else {\n <ui-icon name=\"magnifying-glass-plus\" />\n }\n </span>\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"media\" />\n}\n\n@if (previewVisible()) {\n <ui-image-preview\n [src]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [ariaLabel]=\"previewDialogAriaLabel()\"\n [zoomStep]=\"zoomStep()\"\n [minZoom]=\"minZoom()\"\n [maxZoom]=\"maxZoom()\"\n [downloadable]=\"downloadable()\"\n [downloadName]=\"downloadName()\"\n (closed)=\"previewVisible.set(false)\"\n [uiMotion]=\"'fade'\"\n #previewMotion=\"uiMotion\"\n [animate.enter]=\"previewMotion.enter()\"\n [animate.leave]=\"previewMotion.leave()\"\n />\n}\n",
|
|
1006
|
+
styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;justify-content:center}.ui-image{object-fit:var(--ui-image-object-fit, contain)}.ui-image-svg{display:flex;width:100%}.ui-image-svg ::ng-deep svg{width:100%;height:100%}.ui-image-placeholder{display:flex;align-items:center;justify-content:center;min-width:var(--ui-image-placeholder-min-width, var(--units-xl));min-height:var(--ui-image-placeholder-min-height, var(--units-xl));border-radius:var(--ui-image-placeholder-radius, var(--radius-default));background:var(--ui-image-placeholder-surface, var(--global-background-muted));color:var(--ui-image-placeholder-color, var(--global-text-muted))}.ui-image-trigger{position:relative;display:inline-flex;padding:0;border:none;border-radius:var(--ui-image-trigger-radius, 0);background:none;line-height:0;cursor:pointer}.ui-image-trigger:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-image-trigger-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-image-trigger-focus-ring-color, var(--global-border-focus))}.ui-image-trigger:hover .ui-image-indicator,.ui-image-trigger:focus-visible .ui-image-indicator{opacity:1}.ui-image-indicator{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:inherit;background:var(--ui-image-indicator-background, var(--primitives-black-50));color:var(--ui-image-indicator-color, var(--primitives-white-base));font-size:var(--ui-image-indicator-font-size, var(--size-typography-text-lg));line-height:1;opacity:0;transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}@media(prefers-reduced-motion:reduce){.ui-image-indicator{transition-duration:.01ms}}:root[data-motion=off] .ui-image-indicator{transition-duration:.01ms}\n"]
|
|
1007
|
+
}]
|
|
1008
|
+
}],
|
|
1009
|
+
ctorParameters: () => [],
|
|
1010
|
+
propDecorators: {
|
|
1011
|
+
name: [{
|
|
1012
|
+
type: i0.Input,
|
|
1013
|
+
args: [{
|
|
1014
|
+
isSignal: true,
|
|
1015
|
+
alias: "name",
|
|
1016
|
+
required: false
|
|
1017
|
+
}]
|
|
1018
|
+
}],
|
|
1019
|
+
src: [{
|
|
1020
|
+
type: i0.Input,
|
|
1021
|
+
args: [{
|
|
1022
|
+
isSignal: true,
|
|
1023
|
+
alias: "src",
|
|
1024
|
+
required: false
|
|
1025
|
+
}]
|
|
1026
|
+
}],
|
|
1027
|
+
fallback: [{
|
|
1028
|
+
type: i0.Input,
|
|
1029
|
+
args: [{
|
|
1030
|
+
isSignal: true,
|
|
1031
|
+
alias: "fallback",
|
|
1032
|
+
required: false
|
|
1033
|
+
}]
|
|
1034
|
+
}],
|
|
1035
|
+
priority: [{
|
|
1036
|
+
type: i0.Input,
|
|
1037
|
+
args: [{
|
|
1038
|
+
isSignal: true,
|
|
1039
|
+
alias: "priority",
|
|
1040
|
+
required: false
|
|
1041
|
+
}]
|
|
1042
|
+
}],
|
|
1043
|
+
fill: [{
|
|
1044
|
+
type: i0.Input,
|
|
1045
|
+
args: [{
|
|
1046
|
+
isSignal: true,
|
|
1047
|
+
alias: "fill",
|
|
1048
|
+
required: false
|
|
1049
|
+
}]
|
|
1050
|
+
}],
|
|
1051
|
+
width: [{
|
|
1052
|
+
type: i0.Input,
|
|
1053
|
+
args: [{
|
|
1054
|
+
isSignal: true,
|
|
1055
|
+
alias: "width",
|
|
1056
|
+
required: false
|
|
1057
|
+
}]
|
|
1058
|
+
}],
|
|
1059
|
+
widthUnit: [{
|
|
1060
|
+
type: i0.Input,
|
|
1061
|
+
args: [{
|
|
1062
|
+
isSignal: true,
|
|
1063
|
+
alias: "widthUnit",
|
|
1064
|
+
required: false
|
|
1065
|
+
}]
|
|
1066
|
+
}],
|
|
1067
|
+
height: [{
|
|
1068
|
+
type: i0.Input,
|
|
1069
|
+
args: [{
|
|
1070
|
+
isSignal: true,
|
|
1071
|
+
alias: "height",
|
|
1072
|
+
required: false
|
|
1073
|
+
}]
|
|
1074
|
+
}],
|
|
1075
|
+
heightUnit: [{
|
|
1076
|
+
type: i0.Input,
|
|
1077
|
+
args: [{
|
|
1078
|
+
isSignal: true,
|
|
1079
|
+
alias: "heightUnit",
|
|
1080
|
+
required: false
|
|
1081
|
+
}]
|
|
1082
|
+
}],
|
|
1083
|
+
alt: [{
|
|
1084
|
+
type: i0.Input,
|
|
1085
|
+
args: [{
|
|
1086
|
+
isSignal: true,
|
|
1087
|
+
alias: "alt",
|
|
1088
|
+
required: false
|
|
1089
|
+
}]
|
|
1090
|
+
}],
|
|
1091
|
+
secured: [{
|
|
1092
|
+
type: i0.Input,
|
|
1093
|
+
args: [{
|
|
1094
|
+
isSignal: true,
|
|
1095
|
+
alias: "secured",
|
|
1096
|
+
required: false
|
|
1097
|
+
}]
|
|
1098
|
+
}],
|
|
1099
|
+
withCredentials: [{
|
|
1100
|
+
type: i0.Input,
|
|
1101
|
+
args: [{
|
|
1102
|
+
isSignal: true,
|
|
1103
|
+
alias: "withCredentials",
|
|
1104
|
+
required: false
|
|
1105
|
+
}]
|
|
1106
|
+
}],
|
|
1107
|
+
loadingLabel: [{
|
|
1108
|
+
type: i0.Input,
|
|
1109
|
+
args: [{
|
|
1110
|
+
isSignal: true,
|
|
1111
|
+
alias: "loadingLabel",
|
|
1112
|
+
required: false
|
|
1113
|
+
}]
|
|
1114
|
+
}],
|
|
1115
|
+
loadingAriaLabel: [{
|
|
1116
|
+
type: i0.Input,
|
|
1117
|
+
args: [{
|
|
1118
|
+
isSignal: true,
|
|
1119
|
+
alias: "loadingAriaLabel",
|
|
1120
|
+
required: false
|
|
1121
|
+
}]
|
|
1122
|
+
}],
|
|
1123
|
+
preview: [{
|
|
1124
|
+
type: i0.Input,
|
|
1125
|
+
args: [{
|
|
1126
|
+
isSignal: true,
|
|
1127
|
+
alias: "preview",
|
|
1128
|
+
required: false
|
|
1129
|
+
}]
|
|
1130
|
+
}],
|
|
1131
|
+
previewVisible: [{
|
|
1132
|
+
type: i0.Input,
|
|
1133
|
+
args: [{
|
|
1134
|
+
isSignal: true,
|
|
1135
|
+
alias: "previewVisible",
|
|
1136
|
+
required: false
|
|
1137
|
+
}]
|
|
1138
|
+
}, {
|
|
1139
|
+
type: i0.Output,
|
|
1140
|
+
args: ["previewVisibleChange"]
|
|
1141
|
+
}],
|
|
1142
|
+
previewAriaLabel: [{
|
|
1143
|
+
type: i0.Input,
|
|
1144
|
+
args: [{
|
|
1145
|
+
isSignal: true,
|
|
1146
|
+
alias: "previewAriaLabel",
|
|
1147
|
+
required: false
|
|
1148
|
+
}]
|
|
1149
|
+
}],
|
|
1150
|
+
previewDialogAriaLabel: [{
|
|
1151
|
+
type: i0.Input,
|
|
1152
|
+
args: [{
|
|
1153
|
+
isSignal: true,
|
|
1154
|
+
alias: "previewDialogAriaLabel",
|
|
1155
|
+
required: false
|
|
1156
|
+
}]
|
|
1157
|
+
}],
|
|
1158
|
+
zoomStep: [{
|
|
1159
|
+
type: i0.Input,
|
|
1160
|
+
args: [{
|
|
1161
|
+
isSignal: true,
|
|
1162
|
+
alias: "zoomStep",
|
|
1163
|
+
required: false
|
|
1164
|
+
}]
|
|
1165
|
+
}],
|
|
1166
|
+
minZoom: [{
|
|
1167
|
+
type: i0.Input,
|
|
1168
|
+
args: [{
|
|
1169
|
+
isSignal: true,
|
|
1170
|
+
alias: "minZoom",
|
|
1171
|
+
required: false
|
|
1172
|
+
}]
|
|
1173
|
+
}],
|
|
1174
|
+
maxZoom: [{
|
|
1175
|
+
type: i0.Input,
|
|
1176
|
+
args: [{
|
|
1177
|
+
isSignal: true,
|
|
1178
|
+
alias: "maxZoom",
|
|
1179
|
+
required: false
|
|
1180
|
+
}]
|
|
1181
|
+
}],
|
|
1182
|
+
downloadable: [{
|
|
1183
|
+
type: i0.Input,
|
|
1184
|
+
args: [{
|
|
1185
|
+
isSignal: true,
|
|
1186
|
+
alias: "downloadable",
|
|
1187
|
+
required: false
|
|
1188
|
+
}]
|
|
1189
|
+
}],
|
|
1190
|
+
downloadName: [{
|
|
1191
|
+
type: i0.Input,
|
|
1192
|
+
args: [{
|
|
1193
|
+
isSignal: true,
|
|
1194
|
+
alias: "downloadName",
|
|
1195
|
+
required: false
|
|
1196
|
+
}]
|
|
1197
|
+
}],
|
|
1198
|
+
loadFailed: [{
|
|
1199
|
+
type: i0.Output,
|
|
1200
|
+
args: ["loadFailed"]
|
|
1201
|
+
}],
|
|
1202
|
+
previewIndicator: [{
|
|
1203
|
+
type: i0.ContentChild,
|
|
1204
|
+
args: ["previewIndicator", { isSignal: true }]
|
|
1205
|
+
}]
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
642
1208
|
export { UI_IMAGE_ASSETS, UiImage, UiImagePreview, provideUiImageAssets };
|
|
643
|
-
|
|
1209
|
+
|
|
1210
|
+
//# sourceMappingURL=4sh-ui-kit-base-ui-image.mjs.map
|