@4sh/ui-kit 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +10 -9
- package/README.md +10 -9
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +338 -14
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +1 -76
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +179 -0
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms.mjs +99 -1
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1 -25
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +1 -25
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1 -25
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1 -25
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs +60 -2
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +175 -5
- package/mcp/data/ui-config.json +546 -0
- package/mcp/package.json +1 -1
- package/package.json +5 -1
- package/styles/component-vars.scss +39 -1
- package/types/4sh-ui-kit-base-ui-image.d.ts +151 -6
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +110 -0
- package/types/4sh-ui-kit-forms.d.ts +43 -1
- package/types/4sh-ui-kit-overlay.d.ts +35 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-base-ui-image.mjs","sources":["../../../projects/ui-kit/base/ui-image/src/lib/ui-image-svg.ts","../../../projects/ui-kit/base/ui-image/src/lib/ui-image.ts","../../../projects/ui-kit/base/ui-image/src/lib/ui-image.html","../../../projects/ui-kit/base/ui-image/src/public-api.ts","../../../projects/ui-kit/base/ui-image/src/4sh-ui-kit-base-ui-image.ts"],"sourcesContent":["/**\n * Assainissement des SVG inlinés par `ui-image`.\n *\n * Angular's HTML sanitizer strips `<svg>` wholesale, so inlining an SVG — which\n * is what lets the asset inherit `currentColor` and the theme's CSS — has no\n * choice but to go through `bypassSecurityTrustHtml()`. That bypass is only\n * defensible if the markup has already been scrubbed here, which is the single\n * reason this file exists. See `docs/SECURITY-PRACTICES.md`.\n *\n * The threat model is not \"the kit's own assets\": it is a project serving\n * `assets/img/` from a CDN, or letting a client drop its own logo in a brand\n * folder (white-label). In both cases the SVG is markup of unknown origin\n * rendered into the application's own origin.\n */\n\n/**\n * Tags dropped WITH their content — unwrapping them would put their body in the\n * document as text, or leave the vector intact.\n *\n * `foreignObject` re-opens the whole HTML namespace inside the SVG, and the SMIL\n * elements (`animate`, `set`…) can retarget an attribute *after* this scrub ran.\n */\nconst VOIDED_TAGS =\n 'script, foreignObject, iframe, object, embed, animate, animateTransform, animateMotion, set, handler';\n\n/** Attributes carrying a reference — the only ones allowed to name a target. */\nconst REF_ATTRS = new Set(['href', 'xlink:href', 'src']);\n\n/** A reference either stays inside the document, or navigates over http(s). */\nconst ALLOWED_REF_PROTOCOLS = ['http:', 'https:'];\n\n/**\n * Strips from an SVG everything that can execute or fetch, and returns the\n * scrubbed markup.\n *\n * Parsing happens inside a detached `<template>`: its content is inert, so\n * nothing runs and nothing is fetched while we inspect it. Returns `''` when\n * there is no DOM to parse with (SSR) — failing closed, since un-scrubbed\n * markup must never reach the bypass.\n */\nexport function sanitizeInlineSvg(raw: string): string {\n if (typeof document === 'undefined') return '';\n\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE : on\n écrit DANS un `<template>` détaché, dont le contenu est inerte — rien ne\n s'exécute et rien n'est chargé. C'est l'étape de PARSING du scrub, pas une\n injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */\n template.innerHTML = raw;\n\n for (const el of Array.from(template.content.querySelectorAll(VOIDED_TAGS))) el.remove();\n\n for (const el of Array.from(template.content.querySelectorAll('*'))) {\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase();\n // Every event handler, whatever the element it sits on.\n if (name.startsWith('on')) {\n el.removeAttributeNode(attr);\n continue;\n }\n if (REF_ATTRS.has(name) && !isSafeRef(attr.value)) el.removeAttributeNode(attr);\n }\n }\n\n return template.innerHTML;\n}\n\n/** @internal Rejects `javascript:`, `data:` and the other non-navigational schemes. */\nfunction isSafeRef(value: string): boolean {\n const ref = value.trim();\n // `<use href=\"#icon\">` — a same-document reference names no external target.\n if (ref.startsWith('#')) return true;\n try {\n return ALLOWED_REF_PROTOCOLS.includes(new URL(ref, document.baseURI).protocol);\n } catch {\n return false;\n }\n}\n","import {\n Component,\n computed,\n effect,\n inject,\n InjectionToken,\n input,\n isDevMode,\n linkedSignal,\n output,\n Provider,\n} from '@angular/core';\nimport { NgOptimizedImage } from '@angular/common';\nimport { httpResource } from '@angular/common/http';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ThemeService } from '@4sh/ui-kit/theming';\nimport { BrandService } from '@4sh/ui-kit/theming';\nimport { UiIcon } from '@4sh/ui-kit/base/ui-icon';\nimport { sanitizeInlineSvg } from './ui-image-svg';\n\ninterface ModeMap {\n base?: string;\n light?: string;\n dark?: string;\n}\ntype ThemeMap = Record<string, ModeMap>;\n/** filename → { brand|'common' → { base|light|dark → extension } }. */\nexport type UiImageAssetsMap = Record<string, ThemeMap>;\n\n/**\n * Map of the LOCAL assets available to `ui-image` (its `name` input).\n *\n * The kit cannot know a project's assets, so the map is injected rather than\n * bundled: generate it in your app (see the `generate:assets` script in the\n * starter, which writes `src/assets/assets-map.json`) and provide it with\n * `provideUiImageAssets()`. Without it, `name` resolves to nothing and the\n * component falls back to its placeholder — `src` (remote URLs) still works.\n */\nexport const UI_IMAGE_ASSETS = new InjectionToken<UiImageAssetsMap>('UI_IMAGE_ASSETS');\n\n/**\n * Registers the local asset map consumed by `ui-image`.\n *\n * ```ts\n * import assetsMap from './assets/assets-map.json';\n * providers: [provideUiImageAssets(assetsMap)]\n * ```\n */\nexport function provideUiImageAssets(map: UiImageAssetsMap): Provider {\n return { provide: UI_IMAGE_ASSETS, useValue: map };\n}\n\n/**\n * Cross-instance memoization: the same resolved URL is fetched once (logos\n * repeated across the app).\n *\n * Holds the **scrubbed** markup, never the raw response — nothing that skipped\n * `sanitizeInlineSvg()` may ever be read back out of here.\n */\nconst SVG_CACHE = new Map<string, string>();\n\n/**\n * ui-image — theme/brand-aware image.\n *\n * Two sources: `name` (local asset key resolved through `assets-map.json`,\n * theme/brand variants) or `src` (remote/absolute URL — takes precedence).\n * Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS — after\n * being scrubbed by `sanitizeInlineSvg()`; remote URLs always render through\n * `<img [ngSrc]>` (never inlined).\n * On load failure the `fallback` local asset is shown, then a token-styled\n * placeholder if the fallback also fails (or none is provided).\n */\n@Component({\n selector: 'ui-image',\n templateUrl: './ui-image.html',\n styleUrl: './ui-image.scss',\n imports: [NgOptimizedImage, UiIcon],\n})\nexport class UiImage {\n private readonly sanitizer = inject(DomSanitizer);\n private readonly assetsMap = inject(UI_IMAGE_ASSETS, { optional: true }) ?? {};\n private readonly themeService = inject(ThemeService);\n private readonly brandService = inject(BrandService);\n\n /** Local asset key in `assets-map.json` (theme/brand-aware resolution). */\n name = input<string>();\n /** Remote/absolute URL, rendered via `NgOptimizedImage` — takes precedence over `name`. */\n src = input<string>();\n /** Local asset name (`assets-map.json` key) displayed when the main image fails to load. */\n fallback = input<string>();\n priority = input(false);\n fill = input(false);\n width = input<string | number>();\n widthUnit = input<string>();\n height = input<string | number>();\n heightUnit = input<string>();\n alt = input<string>();\n\n /** Emitted with the failed URL when an image fails to load. */\n loadFailed = output<string>();\n\n protected readonly isRemote = computed(() => !!this.src());\n /** Inline SVG is reserved for LOCAL assets — a remote `.svg` renders through `<img>` (no XSS surface). */\n protected readonly isInlineSvg = computed(\n () => !this.isRemote() && !!this.name()?.toLowerCase().endsWith('.svg'),\n );\n\n protected readonly localSrc = computed(() => this.resolveLocal(this.name()));\n protected readonly fallbackSrc = computed(() => this.resolveLocal(this.fallback()));\n protected readonly primarySrc = computed(() => this.src() || this.localSrc());\n\n // Failure flags auto-reset when their source URL changes (theme/brand/src swap → automatic retry).\n private readonly primaryImgFailed = linkedSignal({\n source: this.primarySrc,\n computation: () => false,\n });\n private readonly fallbackImgFailed = linkedSignal({\n source: this.fallbackSrc,\n computation: () => false,\n });\n\n private readonly svgResource = httpResource.text(() => {\n if (!this.isInlineSvg()) return undefined;\n const url = this.localSrc();\n return !url || SVG_CACHE.has(url) ? undefined : url;\n });\n\n /**\n * The inlined SVG, scrubbed then trusted.\n *\n * FSHSP-177 — this is the kit's ONLY `bypassSecurityTrust*()`. It is not\n * avoidable: Angular's HTML sanitizer strips `<svg>` wholesale, so passing the\n * asset through `sanitize(SecurityContext.HTML, …)` would render nothing, and\n * inlining is the whole point (the asset inherits `currentColor` and the\n * theme's CSS — an `<img>` cannot). What makes the bypass defensible is that\n * the markup went through `sanitizeInlineSvg()` first: scripts, `foreignObject`,\n * SMIL, event handlers and non-navigational references are already gone.\n * Justified in `docs/SECURITY-PRACTICES.md`.\n */\n protected readonly svgContent = computed<SafeHtml | null>(() => {\n if (!this.isInlineSvg()) return null;\n const url = this.localSrc();\n if (!url) return null;\n const safe =\n SVG_CACHE.get(url) ??\n (this.svgResource.hasValue() ? sanitizeInlineSvg(this.svgResource.value()) : undefined);\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n seul bypass du kit. Inévitable (l'assainisseur d'Angular supprime `<svg>`\n en entier) et sûr parce que `sanitizeInlineSvg()` a déjà retiré scripts,\n foreignObject, SMIL, gestionnaires d'événements et références non\n navigationnelles. Registre : docs/SECURITY-PRACTICES.md. */\n return safe === undefined ? null : this.sanitizer.bypassSecurityTrustHtml(safe);\n });\n\n protected readonly primaryFailed = computed(() =>\n this.isInlineSvg() ? this.svgResource.status() === 'error' : this.primaryImgFailed(),\n );\n protected readonly showFallback = computed(\n () => this.primaryFailed() && !!this.fallbackSrc() && !this.fallbackImgFailed(),\n );\n protected readonly showPlaceholder = computed(\n () =>\n !this.primarySrc() ||\n (this.primaryFailed() && (!this.fallbackSrc() || this.fallbackImgFailed())),\n );\n protected readonly displayedSrc = computed(() =>\n this.showFallback() ? this.fallbackSrc() : this.primarySrc(),\n );\n\n protected readonly cssWidth = computed(() =>\n this.width() != null ? `${this.width()}${this.widthUnit() || 'px'}` : null,\n );\n protected readonly cssHeight = computed(() =>\n this.height() != null ? `${this.height()}${this.heightUnit() || 'px'}` : null,\n );\n\n constructor() {\n // Side effect only: populate the module-level SVG cache once a fetch\n // resolves. Scrubbed on the way in — the cache is read straight into the\n // bypass, so it must never hold a raw response.\n effect(() => {\n if (!this.isInlineSvg()) return;\n const url = this.localSrc();\n if (url && this.svgResource.hasValue())\n SVG_CACHE.set(url, sanitizeInlineSvg(this.svgResource.value()));\n });\n if (isDevMode()) {\n effect(() => {\n if (this.src() && this.name()) {\n console.warn('[ui-image] `src` and `name` are both set — `src` takes precedence.');\n }\n if (!this.src() && !this.name()) {\n console.warn(\n '[ui-image] Neither `src` nor `name` is set — the placeholder is displayed.',\n );\n }\n });\n }\n }\n\n protected onImgError(): void {\n const failed = this.displayedSrc();\n if (this.showFallback()) this.fallbackImgFailed.set(true);\n else this.primaryImgFailed.set(true);\n if (failed) this.loadFailed.emit(failed);\n }\n\n private resolveLocal(filename: string | undefined): string {\n if (!filename) return '';\n const mode = this.themeService.currentMode();\n const brand = this.brandService.currentBrand();\n\n const fileEntry = this.assetsMap[filename];\n if (!fileEntry) return '';\n\n if (fileEntry[brand]) {\n const path = this.resolvePath(brand, fileEntry[brand], mode, filename);\n if (path) return path;\n }\n\n if (fileEntry['common']) {\n return this.buildPath('common', fileEntry['common'], mode, filename);\n }\n\n return '';\n }\n\n private resolvePath(\n themeFolder: string,\n variants: ModeMap,\n currentMode: 'light' | 'dark',\n filename: string,\n ): string | null {\n if (variants[currentMode]) {\n const type = variants[currentMode]!;\n return `assets/img/${themeFolder}/${type}/${currentMode}/${filename}`;\n }\n\n if (variants.base) {\n const type = variants.base;\n return `assets/img/${themeFolder}/${type}/${filename}`;\n }\n\n return null;\n }\n\n private buildPath(\n themeName: string,\n variants: ModeMap,\n currentMode: 'light' | 'dark',\n filename: string,\n ): string {\n if (variants[currentMode]) {\n const type = variants[currentMode]!;\n return `assets/img/${themeName}/${type}/${currentMode}/${filename}`;\n }\n\n if (variants.base) {\n const type = variants.base;\n return `assets/img/${themeName}/${type}/${filename}`;\n }\n\n return '';\n }\n}\n","@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 {\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","/*\n * Public API Surface of ui-kit/ui-image\n */\n\nexport * from './lib/ui-image';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;AAaG;AAEH;;;;;;AAMG;AACH,MAAM,WAAW,GACf,sGAAsG;AAExG;AACA,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;AAExD;AACA,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;AAEjD;;;;;;;;AAQG;AACG,SAAU,iBAAiB,CAAC,GAAW,EAAA;IAC3C,IAAI,OAAO,QAAQ,KAAK,WAAW;AAAE,QAAA,OAAO,EAAE;IAE9C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC;AACnD;;;AAGwE;AACxE,IAAA,QAAQ,CAAC,SAAS,GAAG,GAAG;AAExB,IAAA,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAAE,EAAE,CAAC,MAAM,EAAE;AAExF,IAAA,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE;AACnE,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;YAC5C,MAAM,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AA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAEvB,OAAO,EAAA,UAAA,EAAA,CAAA;kBANnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EAGX,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,44CAAA,EAAA,MAAA,EAAA,CAAA,gpBAAA,CAAA,EAAA;;;AE5ErC;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-base-ui-image.mjs","sources":["../../../projects/ui-kit/base/ui-image/src/lib/ui-image-preview.ts","../../../projects/ui-kit/base/ui-image/src/lib/ui-image-preview.html","../../../projects/ui-kit/base/ui-image/src/lib/ui-image-svg.ts","../../../projects/ui-kit/base/ui-image/src/lib/ui-image.ts","../../../projects/ui-kit/base/ui-image/src/lib/ui-image.html","../../../projects/ui-kit/base/ui-image/src/public-api.ts","../../../projects/ui-kit/base/ui-image/src/4sh-ui-kit-base-ui-image.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { UiIcon } from '@4sh/ui-kit/base/ui-icon';\nimport { lockBodyScroll, unlockBodyScroll } from '@4sh/ui-kit/overlay';\n\n/** Clamp `value` into `[min, max]`. */\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/**\n * ui-image-preview — the enlarged view (lightbox) opened by `ui-image`'s\n * `preview` mode.\n *\n * A viewport mask holding a toolbar (zoom in/out, rotate, reset, optional\n * download, close) and the image itself, which the three transforms drive\n * through a single `transform`: pan, scale, rotation. Zoom is reachable at the\n * pointer (toolbar, wheel) and at the keyboard (`+`/`-`/`0`/`r`, arrows to pan)\n * — a zoom a keyboard user cannot pan is a zoom they cannot read.\n *\n * Lives in `ui-image`'s entry point: it renders that component's resolved\n * source, so a separate entry point would be a cycle. Mount it directly only to\n * drive the enlarged view yourself.\n */\n@Component({\n selector: 'ui-image-preview',\n imports: [A11yModule, UiIcon],\n templateUrl: './ui-image-preview.html',\n styleUrl: './ui-image-preview.scss',\n})\nexport class UiImagePreview {\n private readonly document = inject(DOCUMENT);\n\n /** URL of the image to show enlarged (already resolved — `http(s)`, `blob:` or `data:`). */\n src = input.required<string>();\n /** Alt text of the enlarged image (empty = decorative). */\n alt = input<string>('');\n /** Accessible name of the dialog. */\n ariaLabel = input<string>('Aperçu de l’image');\n\n /** Zoom increment applied by one toolbar click, one wheel notch or one `+`/`-` press. */\n zoomStep = input(0.25, { transform: numberAttribute });\n /** Lower zoom bound. */\n minZoom = input(0.5, { transform: numberAttribute });\n /** Upper zoom bound. */\n maxZoom = input(4, { transform: numberAttribute });\n\n /** Offer a download action in the toolbar. */\n downloadable = input(false, { transform: booleanAttribute });\n /** Filename proposed by the download action (defaults to the browser's choice). */\n downloadName = input<string>();\n\n /** Close when the mask around the image is clicked. */\n dismissableMask = input(true, { transform: booleanAttribute });\n\n zoomInAriaLabel = input('Zoom avant');\n zoomOutAriaLabel = input('Zoom arrière');\n rotateLeftAriaLabel = input('Pivoter vers la gauche');\n rotateRightAriaLabel = input('Pivoter vers la droite');\n resetAriaLabel = input('Réinitialiser l’affichage');\n downloadAriaLabel = input('Télécharger l’image');\n closeAriaLabel = input('Fermer l’aperçu');\n\n /** Emitted when the view asks to be dismissed (Escape, close button, mask click). */\n closed = output<void>();\n\n private readonly stage = viewChild.required<ElementRef<HTMLElement>>('stage');\n\n protected readonly scale = signal(1);\n protected readonly rotation = signal(0);\n protected readonly panX = signal(0);\n protected readonly panY = signal(0);\n\n protected readonly canZoomIn = computed(() => this.scale() < this.maxZoom());\n protected readonly canZoomOut = computed(() => this.scale() > this.minZoom());\n /** Nothing to reset while the three transforms are at their neutral value. */\n protected readonly isPristine = computed(\n () => this.scale() === 1 && this.rotation() === 0 && this.panX() === 0 && this.panY() === 0,\n );\n /** Panning only makes sense once the image overflows its stage. */\n protected readonly canPan = computed(() => this.scale() > 1);\n /** A quarter turn: what is drawn no longer fits the layout box's axes. */\n protected readonly isQuarterTurned = computed(() => this.rotation() % 180 !== 0);\n\n protected readonly transform = computed(\n () =>\n `translate(${this.panX()}px, ${this.panY()}px) scale(${this.scale()}) rotate(${this.rotation()}deg)`,\n );\n\n constructor() {\n lockBodyScroll(this.document);\n inject(DestroyRef).onDestroy(() => unlockBodyScroll(this.document));\n }\n\n protected zoomIn(): void {\n this.setScale(this.scale() + this.zoomStep());\n }\n\n protected zoomOut(): void {\n this.setScale(this.scale() - this.zoomStep());\n }\n\n protected rotateLeft(): void {\n this.rotation.update((deg) => deg - 90);\n }\n\n protected rotateRight(): void {\n this.rotation.update((deg) => deg + 90);\n }\n\n protected reset(): void {\n this.scale.set(1);\n this.rotation.set(0);\n this.panX.set(0);\n this.panY.set(0);\n }\n\n protected close(): void {\n this.closed.emit();\n }\n\n /** A press that lands on the stage itself (not on the image) is a press outside. */\n protected onStagePointerDown(event: PointerEvent): void {\n if (this.dismissableMask() && event.target === this.stage().nativeElement) this.close();\n }\n\n protected onWheel(event: WheelEvent): void {\n event.preventDefault();\n this.setScale(this.scale() + (event.deltaY < 0 ? this.zoomStep() : -this.zoomStep()));\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const step = 24;\n switch (event.key) {\n case 'Escape':\n this.close();\n break;\n case '+':\n case '=':\n this.zoomIn();\n break;\n case '-':\n this.zoomOut();\n break;\n case '0':\n this.reset();\n break;\n case 'r':\n case 'R':\n this.rotateRight();\n break;\n case 'ArrowLeft':\n this.panX.update((x) => x - step);\n break;\n case 'ArrowRight':\n this.panX.update((x) => x + step);\n break;\n case 'ArrowUp':\n this.panY.update((y) => y - step);\n break;\n case 'ArrowDown':\n this.panY.update((y) => y + step);\n break;\n default:\n return;\n }\n // Only a handled key is swallowed: Tab must keep cycling the focus trap.\n event.preventDefault();\n event.stopPropagation();\n }\n\n // --- Drag to pan ------------------------------------------------------\n private dragOrigin: { x: number; y: number; panX: number; panY: number } | null = null;\n\n protected onPointerDown(event: PointerEvent): void {\n if (!this.canPan() || event.button !== 0) return;\n this.dragOrigin = { x: event.clientX, y: event.clientY, panX: this.panX(), panY: this.panY() };\n (event.target as Element).setPointerCapture?.(event.pointerId);\n event.preventDefault();\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const origin = this.dragOrigin;\n if (!origin) return;\n this.panX.set(origin.panX + (event.clientX - origin.x));\n this.panY.set(origin.panY + (event.clientY - origin.y));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragOrigin) return;\n this.dragOrigin = null;\n (event.target as Element).releasePointerCapture?.(event.pointerId);\n }\n\n private setScale(value: number): void {\n const next = clamp(Number(value.toFixed(4)), this.minZoom(), this.maxZoom());\n this.scale.set(next);\n // Back to fit: the pan offset would otherwise strand the image off-centre.\n if (next <= 1) {\n this.panX.set(0);\n this.panY.set(0);\n }\n }\n}\n","<!-- 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","/**\n * Assainissement des SVG inlinés par `ui-image`.\n *\n * Angular's HTML sanitizer strips `<svg>` wholesale, so inlining an SVG — which\n * is what lets the asset inherit `currentColor` and the theme's CSS — has no\n * choice but to go through `bypassSecurityTrustHtml()`. That bypass is only\n * defensible if the markup has already been scrubbed here, which is the single\n * reason this file exists. See `docs/SECURITY-PRACTICES.md`.\n *\n * The threat model is not \"the kit's own assets\": it is a project serving\n * `assets/img/` from a CDN, or letting a client drop its own logo in a brand\n * folder (white-label). In both cases the SVG is markup of unknown origin\n * rendered into the application's own origin.\n */\n\n/**\n * Tags dropped WITH their content — unwrapping them would put their body in the\n * document as text, or leave the vector intact.\n *\n * `foreignObject` re-opens the whole HTML namespace inside the SVG, and the SMIL\n * elements (`animate`, `set`…) can retarget an attribute *after* this scrub ran.\n */\nconst VOIDED_TAGS =\n 'script, foreignObject, iframe, object, embed, animate, animateTransform, animateMotion, set, handler';\n\n/** Attributes carrying a reference — the only ones allowed to name a target. */\nconst REF_ATTRS = new Set(['href', 'xlink:href', 'src']);\n\n/** A reference either stays inside the document, or navigates over http(s). */\nconst ALLOWED_REF_PROTOCOLS = ['http:', 'https:'];\n\n/**\n * Strips from an SVG everything that can execute or fetch, and returns the\n * scrubbed markup.\n *\n * Parsing happens inside a detached `<template>`: its content is inert, so\n * nothing runs and nothing is fetched while we inspect it. Returns `''` when\n * there is no DOM to parse with (SSR) — failing closed, since un-scrubbed\n * markup must never reach the bypass.\n */\nexport function sanitizeInlineSvg(raw: string): string {\n if (typeof document === 'undefined') return '';\n\n const template = document.createElement('template');\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE : on\n écrit DANS un `<template>` détaché, dont le contenu est inerte — rien ne\n s'exécute et rien n'est chargé. C'est l'étape de PARSING du scrub, pas une\n injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */\n template.innerHTML = raw;\n\n for (const el of Array.from(template.content.querySelectorAll(VOIDED_TAGS))) el.remove();\n\n for (const el of Array.from(template.content.querySelectorAll('*'))) {\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase();\n // Every event handler, whatever the element it sits on.\n if (name.startsWith('on')) {\n el.removeAttributeNode(attr);\n continue;\n }\n if (REF_ATTRS.has(name) && !isSafeRef(attr.value)) el.removeAttributeNode(attr);\n }\n }\n\n return template.innerHTML;\n}\n\n/** @internal Rejects `javascript:`, `data:` and the other non-navigational schemes. */\nfunction isSafeRef(value: string): boolean {\n const ref = value.trim();\n // `<use href=\"#icon\">` — a same-document reference names no external target.\n if (ref.startsWith('#')) return true;\n try {\n return ALLOWED_REF_PROTOCOLS.includes(new URL(ref, document.baseURI).protocol);\n } catch {\n return false;\n }\n}\n","import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n InjectionToken,\n input,\n isDevMode,\n linkedSignal,\n model,\n numberAttribute,\n output,\n PLATFORM_ID,\n Provider,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { isPlatformBrowser, NgOptimizedImage, NgTemplateOutlet } from '@angular/common';\nimport { httpResource } from '@angular/common/http';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ThemeService } from '@4sh/ui-kit/theming';\nimport { BrandService } from '@4sh/ui-kit/theming';\nimport { UiIcon } from '@4sh/ui-kit/base/ui-icon';\nimport { UiSpinner } from '@4sh/ui-kit/informative/ui-spinner';\nimport { UiMotion } from '@4sh/ui-kit/motion';\nimport { sanitizeInlineSvg } from './ui-image-svg';\nimport { UiImagePreview } from './ui-image-preview';\n\ninterface ModeMap {\n base?: string;\n light?: string;\n dark?: string;\n}\ntype ThemeMap = Record<string, ModeMap>;\n/** filename → { brand|'common' → { base|light|dark → extension } }. */\nexport type UiImageAssetsMap = Record<string, ThemeMap>;\n\n/**\n * Map of the LOCAL assets available to `ui-image` (its `name` input).\n *\n * The kit cannot know a project's assets, so the map is injected rather than\n * bundled: generate it in your app (see the `generate:assets` script in the\n * starter, which writes `src/assets/assets-map.json`) and provide it with\n * `provideUiImageAssets()`. Without it, `name` resolves to nothing and the\n * component falls back to its placeholder — `src` (remote URLs) still works.\n */\nexport const UI_IMAGE_ASSETS = new InjectionToken<UiImageAssetsMap>('UI_IMAGE_ASSETS');\n\n/**\n * Registers the local asset map consumed by `ui-image`.\n *\n * ```ts\n * import assetsMap from './assets/assets-map.json';\n * providers: [provideUiImageAssets(assetsMap)]\n * ```\n */\nexport function provideUiImageAssets(map: UiImageAssetsMap): Provider {\n return { provide: UI_IMAGE_ASSETS, useValue: map };\n}\n\n/**\n * Cross-instance memoization: the same resolved URL is fetched once (logos\n * repeated across the app).\n *\n * Holds the **scrubbed** markup, never the raw response — nothing that skipped\n * `sanitizeInlineSvg()` may ever be read back out of here.\n */\nconst SVG_CACHE = new Map<string, string>();\n\n/** Payload carried in the URL itself (`data:image/png;base64,…`). */\nconst DATA_URL = /^data:/i;\n\n/**\n * ui-image — theme/brand-aware image.\n *\n * Three sources: `name` (local asset key resolved through `assets-map.json`,\n * theme/brand variants), `src` (remote/absolute URL — takes precedence), and\n * `src` + `secured` (the URL is fetched through `HttpClient`, so the app's\n * interceptors authenticate it, and the response `Blob` is shown from an object\n * URL revoked with the component).\n * Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS — after\n * being scrubbed by `sanitizeInlineSvg()`; remote URLs always render through\n * `<img [ngSrc]>` (never inlined), except `data:`/`blob:` payloads, which\n * `NgOptimizedImage` rejects and a plain `<img>` renders.\n * On load failure the `fallback` local asset is shown, then a token-styled\n * placeholder if the fallback also fails (or none is provided).\n *\n * `preview` turns the image into a trigger for the enlarged view\n * (`ui-image-preview`): zoom, rotation, pan, reset, optional download.\n */\n@Component({\n selector: 'ui-image',\n templateUrl: './ui-image.html',\n styleUrl: './ui-image.scss',\n imports: [NgOptimizedImage, NgTemplateOutlet, UiIcon, UiSpinner, UiMotion, UiImagePreview],\n})\nexport class UiImage {\n private readonly sanitizer = inject(DomSanitizer);\n private readonly assetsMap = inject(UI_IMAGE_ASSETS, { optional: true }) ?? {};\n private readonly themeService = inject(ThemeService);\n private readonly brandService = inject(BrandService);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Local asset key in `assets-map.json` (theme/brand-aware resolution). */\n name = input<string>();\n /** Remote/absolute URL, rendered via `NgOptimizedImage` — takes precedence over `name`. */\n src = input<string>();\n /** Local asset name (`assets-map.json` key) displayed when the main image fails to load. */\n fallback = input<string>();\n priority = input(false);\n fill = input(false);\n width = input<string | number>();\n widthUnit = input<string>();\n height = input<string | number>();\n heightUnit = input<string>();\n alt = input<string>();\n\n /**\n * Fetch `src` through `HttpClient` instead of letting the browser load it.\n *\n * That is what an endpoint behind an `Authorization` header needs: an `<img\n * src>` is a plain browser request, which carries no interceptor and no\n * bearer token. The response `Blob` is shown from an object URL, revoked as\n * soon as the source changes or the component goes away.\n *\n * Cross-origin still applies: the endpoint must answer the CORS preflight\n * (`Access-Control-Allow-Origin`, and `Access-Control-Allow-Headers` for the\n * auth header) — an `<img>` would have displayed it without any of that.\n */\n secured = input(false, { transform: booleanAttribute });\n /** Send cookies/TLS credentials with the `secured` request (cross-origin sessions). */\n withCredentials = input(false, { transform: booleanAttribute });\n /** Visible text of the loading indicator shown while a `secured` fetch is in flight. */\n loadingLabel = input<string>();\n /** Accessible name of that loading indicator. */\n loadingAriaLabel = input('Chargement de l’image');\n\n /** Clicking the image opens the enlarged view (`ui-image-preview`). */\n preview = input(false, { transform: booleanAttribute });\n /** Enlarged view open state (two-way — set it to open the preview yourself). */\n previewVisible = model(false);\n /** Accessible name of the trigger (defaults to the image's own `alt`). */\n previewAriaLabel = input<string>();\n /** Accessible name of the enlarged view dialog. */\n previewDialogAriaLabel = input('Aperçu de l’image');\n /** Zoom increment of one toolbar click, wheel notch or `+`/`-` press in the preview. */\n zoomStep = input(0.25, { transform: numberAttribute });\n /** Lower zoom bound in the preview. */\n minZoom = input(0.5, { transform: numberAttribute });\n /** Upper zoom bound in the preview. */\n maxZoom = input(4, { transform: numberAttribute });\n /** Offer a download action in the preview toolbar. */\n downloadable = input(false, { transform: booleanAttribute });\n /** Filename proposed by that download action. */\n downloadName = input<string>();\n\n /** Emitted with the failed URL when an image fails to load. */\n loadFailed = output<string>();\n\n /**\n * Replaces the hover indicator of the `preview` mode (the magnifier). Rendered\n * over the image, decorative — the accessible name stays on the trigger.\n *\n * ```html\n * <ui-image src=\"…\" preview>\n * <ng-template #previewIndicator>Agrandir</ng-template>\n * </ui-image>\n * ```\n */\n protected readonly previewIndicator = contentChild<TemplateRef<unknown>>('previewIndicator');\n\n protected readonly isRemote = computed(() => !!this.src());\n /** Inline SVG is reserved for LOCAL assets — a remote `.svg` renders through `<img>` (no XSS surface). */\n protected readonly isInlineSvg = computed(\n () => !this.isRemote() && !!this.name()?.toLowerCase().endsWith('.svg'),\n );\n /** `secured` only means anything with a `src` to fetch. */\n protected readonly isSecured = computed(() => this.secured() && !!this.src());\n /** A `data:` payload is already the image — `NgOptimizedImage` refuses it. */\n protected readonly isDataUrl = computed(() => DATA_URL.test(this.src() ?? ''));\n\n protected readonly localSrc = computed(() => this.resolveLocal(this.name()));\n protected readonly fallbackSrc = computed(() => this.resolveLocal(this.fallback()));\n\n // --- Secured source (HttpClient → Blob → object URL) ------------------\n private readonly blobResource = httpResource.blob(() =>\n this.isSecured() ? { url: this.src()!, withCredentials: this.withCredentials() } : undefined,\n );\n private readonly blobUrl = signal<string | null>(null);\n\n protected readonly securedLoading = computed(\n () => this.isSecured() && this.blobResource.isLoading(),\n );\n private readonly securedFailed = computed(\n () => this.isSecured() && this.blobResource.status() === 'error',\n );\n\n protected readonly primarySrc = computed(() =>\n this.isSecured() ? (this.blobUrl() ?? '') : this.src() || this.localSrc(),\n );\n\n // Failure flags auto-reset when their source URL changes (theme/brand/src swap → automatic retry).\n private readonly primaryImgFailed = linkedSignal({\n source: this.primarySrc,\n computation: () => false,\n });\n private readonly fallbackImgFailed = linkedSignal({\n source: this.fallbackSrc,\n computation: () => false,\n });\n\n private readonly svgResource = httpResource.text(() => {\n if (!this.isInlineSvg()) return undefined;\n const url = this.localSrc();\n return !url || SVG_CACHE.has(url) ? undefined : url;\n });\n\n /**\n * The inlined SVG, scrubbed then trusted.\n *\n * FSHSP-177 — this is the kit's ONLY `bypassSecurityTrust*()`. It is not\n * avoidable: Angular's HTML sanitizer strips `<svg>` wholesale, so passing the\n * asset through `sanitize(SecurityContext.HTML, …)` would render nothing, and\n * inlining is the whole point (the asset inherits `currentColor` and the\n * theme's CSS — an `<img>` cannot). What makes the bypass defensible is that\n * the markup went through `sanitizeInlineSvg()` first: scripts, `foreignObject`,\n * SMIL, event handlers and non-navigational references are already gone.\n * Justified in `docs/SECURITY-PRACTICES.md`.\n */\n protected readonly svgContent = computed<SafeHtml | null>(() => {\n if (!this.isInlineSvg()) return null;\n const url = this.localSrc();\n if (!url) return null;\n const safe =\n SVG_CACHE.get(url) ??\n (this.svgResource.hasValue() ? sanitizeInlineSvg(this.svgResource.value()) : undefined);\n /* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :\n seul bypass du kit. Inévitable (l'assainisseur d'Angular supprime `<svg>`\n en entier) et sûr parce que `sanitizeInlineSvg()` a déjà retiré scripts,\n foreignObject, SMIL, gestionnaires d'événements et références non\n navigationnelles. Registre : docs/SECURITY-PRACTICES.md. */\n return safe === undefined ? null : this.sanitizer.bypassSecurityTrustHtml(safe);\n });\n\n protected readonly primaryFailed = computed(() => {\n if (this.isInlineSvg()) return this.svgResource.status() === 'error';\n return this.securedFailed() || this.primaryImgFailed();\n });\n protected readonly showFallback = computed(\n () => this.primaryFailed() && !!this.fallbackSrc() && !this.fallbackImgFailed(),\n );\n protected readonly showPlaceholder = computed(\n () =>\n !this.securedLoading() &&\n (!this.primarySrc() ||\n (this.primaryFailed() && (!this.fallbackSrc() || this.fallbackImgFailed()))),\n );\n protected readonly displayedSrc = computed(() =>\n this.showFallback() ? this.fallbackSrc() : this.primarySrc(),\n );\n /** `blob:`/`data:` bypass `NgOptimizedImage`; a local fallback never does. */\n protected readonly isRawSrc = computed(\n () => !this.showFallback() && (this.isSecured() || this.isDataUrl()),\n );\n\n /** The image is a preview trigger only once there is something to enlarge. */\n protected readonly canPreview = computed(\n () => this.preview() && !this.showPlaceholder() && !this.securedLoading(),\n );\n\n protected readonly cssWidth = computed(() =>\n this.width() != null ? `${this.width()}${this.widthUnit() || 'px'}` : null,\n );\n protected readonly cssHeight = computed(() =>\n this.height() != null ? `${this.height()}${this.heightUnit() || 'px'}` : null,\n );\n\n constructor() {\n // Side effect only: populate the module-level SVG cache once a fetch\n // resolves. Scrubbed on the way in — the cache is read straight into the\n // bypass, so it must never hold a raw response.\n effect(() => {\n if (!this.isInlineSvg()) return;\n const url = this.localSrc();\n if (url && this.svgResource.hasValue())\n SVG_CACHE.set(url, sanitizeInlineSvg(this.svgResource.value()));\n });\n\n // The object URL's whole lifetime: created when a Blob arrives, revoked by\n // the cleanup — which runs before the next source AND on destroy. That is\n // what keeps a list of secured images from leaking one URL per render.\n effect((onCleanup) => {\n const blob = this.blobResource.hasValue() ? this.blobResource.value() : undefined;\n if (!blob || !this.isBrowser) {\n this.blobUrl.set(null);\n return;\n }\n const url = URL.createObjectURL(blob);\n this.blobUrl.set(url);\n onCleanup(() => URL.revokeObjectURL(url));\n });\n\n // A failed fetch never reaches an `<img>`, so `(error)` cannot report it.\n effect(() => {\n if (this.securedFailed()) this.loadFailed.emit(this.src()!);\n });\n\n // Nothing left to enlarge (source swapped, load failed): close rather than\n // leave the dialog on a stale image.\n effect(() => {\n if (this.previewVisible() && !this.canPreview()) this.previewVisible.set(false);\n });\n\n if (isDevMode()) {\n effect(() => {\n if (this.src() && this.name()) {\n console.warn('[ui-image] `src` and `name` are both set — `src` takes precedence.');\n }\n if (!this.src() && !this.name()) {\n console.warn(\n '[ui-image] Neither `src` nor `name` is set — the placeholder is displayed.',\n );\n }\n if (this.secured() && !this.src()) {\n console.warn('[ui-image] `secured` has no effect without `src` — nothing to fetch.');\n }\n if (this.preview() && !this.alt() && !this.previewAriaLabel()) {\n console.warn(\n '[ui-image] `preview` renders a button with no accessible name — set `alt` or `previewAriaLabel`.',\n );\n }\n });\n }\n }\n\n protected onImgError(): void {\n const failed = this.displayedSrc();\n if (this.showFallback()) this.fallbackImgFailed.set(true);\n else this.primaryImgFailed.set(true);\n if (failed) this.loadFailed.emit(failed);\n }\n\n private resolveLocal(filename: string | undefined): string {\n if (!filename) return '';\n const mode = this.themeService.currentMode();\n const brand = this.brandService.currentBrand();\n\n const fileEntry = this.assetsMap[filename];\n if (!fileEntry) return '';\n\n if (fileEntry[brand]) {\n const path = this.resolvePath(brand, fileEntry[brand], mode, filename);\n if (path) return path;\n }\n\n if (fileEntry['common']) {\n return this.buildPath('common', fileEntry['common'], mode, filename);\n }\n\n return '';\n }\n\n private resolvePath(\n themeFolder: string,\n variants: ModeMap,\n currentMode: 'light' | 'dark',\n filename: string,\n ): string | null {\n if (variants[currentMode]) {\n const type = variants[currentMode]!;\n return `assets/img/${themeFolder}/${type}/${currentMode}/${filename}`;\n }\n\n if (variants.base) {\n const type = variants.base;\n return `assets/img/${themeFolder}/${type}/${filename}`;\n }\n\n return null;\n }\n\n private buildPath(\n themeName: string,\n variants: ModeMap,\n currentMode: 'light' | 'dark',\n filename: string,\n ): string {\n if (variants[currentMode]) {\n const type = variants[currentMode]!;\n return `assets/img/${themeName}/${type}/${currentMode}/${filename}`;\n }\n\n if (variants.base) {\n const type = variants.base;\n return `assets/img/${themeName}/${type}/${filename}`;\n }\n\n return '';\n }\n}\n","<!-- 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","/*\n * Public API Surface of ui-kit/ui-image\n *\n * Includes `ui-image-preview`: it renders the source `ui-image` has already\n * resolved, so the two live in one entry point (a separate one would be a cycle).\n */\n\nexport * from './lib/ui-image-preview';\nexport * from './lib/ui-image';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAkBA;AACA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAA;AACpD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5C;AAEA;;;;;;;;;;;;;AAaG;MAO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,EAAA,UAAA,EAAA,MAAA,EAAA,aAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,QAAQ,qQAAE,cAAc,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,KAAA,EAAA,KAAA,EAAA,WAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,cAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,qBAAA,EAAA,sBAAA,EAAA,gBAAA,EAAA,mBAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAE9E,OAAO,EAAA,UAAA,EAAA,CAAA;kBANnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EAGX,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAA,QAAA,EAAA,soHAAA,EAAA,MAAA,EAAA,CAAA,+xDAAA,CAAA,EAAA;u7EA2EjB,kBAAkB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3K7F;;;;;AAKG;;ACLH;;AAEG;;"}
|
|
@@ -4,88 +4,13 @@ import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/cdk/overlay';
|
|
6
6
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
7
|
-
import { BaseFormField, dropdownOverlayPositions, buildMaskSlots, extractMaskData, autoFormatSegments, caretForMask } from '@4sh/ui-kit/forms';
|
|
7
|
+
import { BaseFormField, toIsoDateTime, toIsoDate, parseIsoDateTime, parseIsoDate, startOfDay, dropdownOverlayPositions, normalizeDateInput, buildMaskSlots, addDays, firstOfMonth, addMonths, extractMaskData, autoFormatSegments, caretForMask, isSameDay, finalizeParsed } from '@4sh/ui-kit/forms';
|
|
8
8
|
import { FocusMonitor, CdkTrapFocus } from '@angular/cdk/a11y';
|
|
9
9
|
import { UiInput } from '@4sh/ui-kit/forms/ui-input';
|
|
10
10
|
import { UiButton } from '@4sh/ui-kit/actions/ui-button';
|
|
11
11
|
import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
|
|
12
12
|
import { closeOnNavigation } from '@4sh/ui-kit/overlay';
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Pure date helpers for `ui-datepicker` (no framework dependency). Extracted out of
|
|
16
|
-
* `ui-datepicker.ts` into their own module — same precedent as `mask-engine.ts` in `forms/` —
|
|
17
|
-
* so they're unit-testable directly and so importing them can never leak them into the public
|
|
18
|
-
* API: `public-api.ts` only re-exports `./lib/ui-datepicker`, not this file.
|
|
19
|
-
*/
|
|
20
|
-
function startOfDay(d) {
|
|
21
|
-
const x = new Date(d);
|
|
22
|
-
x.setHours(0, 0, 0, 0);
|
|
23
|
-
return x;
|
|
24
|
-
}
|
|
25
|
-
function firstOfMonth(d) {
|
|
26
|
-
return new Date(d.getFullYear(), d.getMonth(), 1);
|
|
27
|
-
}
|
|
28
|
-
function isSameDay(a, b) {
|
|
29
|
-
if (!a || !b)
|
|
30
|
-
return false;
|
|
31
|
-
return (a.getFullYear() === b.getFullYear() &&
|
|
32
|
-
a.getMonth() === b.getMonth() &&
|
|
33
|
-
a.getDate() === b.getDate());
|
|
34
|
-
}
|
|
35
|
-
function addDays(d, n) {
|
|
36
|
-
const x = new Date(d);
|
|
37
|
-
x.setDate(x.getDate() + n);
|
|
38
|
-
return x;
|
|
39
|
-
}
|
|
40
|
-
function addMonths(d, n) {
|
|
41
|
-
return new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
42
|
-
}
|
|
43
|
-
/** Build a Date and reject overflowed components (e.g. 31 Feb). */
|
|
44
|
-
function finalizeParsed(year, month, day, h, min) {
|
|
45
|
-
if (month < 0 || month > 11 || day < 1 || day > 31 || h > 23 || min > 59)
|
|
46
|
-
return null;
|
|
47
|
-
const d = new Date(year, month, day, h, min, 0, 0);
|
|
48
|
-
if (d.getFullYear() !== year || d.getMonth() !== month || d.getDate() !== day)
|
|
49
|
-
return null;
|
|
50
|
-
return d;
|
|
51
|
-
}
|
|
52
|
-
const ISO_DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
53
|
-
const ISO_DATETIME_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/;
|
|
54
|
-
function pad2(n) {
|
|
55
|
-
return String(n).padStart(2, '0');
|
|
56
|
-
}
|
|
57
|
-
/** Serialize a `Date` to `"yyyy-MM-dd"` from its LOCAL components — never `toISOString()`
|
|
58
|
-
* (which converts to UTC and can shift the day by ±1 depending on the timezone). */
|
|
59
|
-
function toIsoDate(d) {
|
|
60
|
-
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
61
|
-
}
|
|
62
|
-
/** `"yyyy-MM-ddTHH:mm"` — date part built the same local, never-UTC way as {@link toIsoDate}. */
|
|
63
|
-
function toIsoDateTime(d) {
|
|
64
|
-
return `${toIsoDate(d)}T${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
|
|
65
|
-
}
|
|
66
|
-
/** Strict `"yyyy-MM-dd"` parser (rejects anything else, incl. overflowed dates via `finalizeParsed`). */
|
|
67
|
-
function parseIsoDate(s) {
|
|
68
|
-
const m = ISO_DATE_RE.exec(s);
|
|
69
|
-
if (!m)
|
|
70
|
-
return null;
|
|
71
|
-
return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), 0, 0);
|
|
72
|
-
}
|
|
73
|
-
/** Strict `"yyyy-MM-ddTHH:mm"` parser (`showTime`/`timeOnly` round-trip). */
|
|
74
|
-
function parseIsoDateTime(s) {
|
|
75
|
-
const m = ISO_DATETIME_RE.exec(s);
|
|
76
|
-
if (!m)
|
|
77
|
-
return null;
|
|
78
|
-
return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), Number(m[4]), Number(m[5]));
|
|
79
|
-
}
|
|
80
|
-
/** Accepts a `Date` as-is, or parses a `"yyyy-MM-dd"` string — used to let config inputs
|
|
81
|
-
* (`minDate`/`maxDate`/`disabledDates`) take either shape. Invalid strings degrade to `null`
|
|
82
|
-
* (no constraint) rather than throwing: a malformed config shouldn't crash the picker. */
|
|
83
|
-
function normalizeDateInput(v) {
|
|
84
|
-
if (!v)
|
|
85
|
-
return null;
|
|
86
|
-
return v instanceof Date ? v : parseIsoDate(v);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
14
|
let nextPanelUid = 0;
|
|
90
15
|
/** Typed `range` separator (FSHSP-118: `"jj/mm/aaaa - jj/mm/aaaa"`) — placeholder, live mask,
|
|
91
16
|
* and `parseTypedMulti` splitting. A plain hyphen, distinct from the DISPLAYED en dash below —
|