@4sh/ui-kit 0.6.1 → 0.7.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 +46 -22
- package/README.md +45 -23
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +439 -0
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +111 -10
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +10 -4
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +457 -75
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1107 -0
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +30 -3
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +8 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +15 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +8 -4
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +40 -4
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +5 -2
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +317 -0
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +8 -2
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +372 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +44 -14
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +45 -4
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +22 -10
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +15 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +654 -74
- package/mcp/data/ui-config.json +5908 -3732
- package/mcp/index.js +682 -410
- package/mcp/package.json +1 -1
- package/package.json +17 -1
- package/schematics/index.cjs +1 -1
- package/styles/component-vars.scss +119 -2
- package/styles/generated/_tokens-breakpoint.scss +1 -1
- package/styles/generated/_tokens-metrics.scss +1 -1
- package/styles/generated/_tokens-primitives.scss +1 -1
- package/styles/generated/_tokens-responsive.scss +17 -17
- package/styles/generated/_tokens-semantics.scss +15 -15
- package/styles/generated/_tokens-styles.scss +1 -1
- package/styles/generated/_tokens-transitions.scss +1 -1
- package/styles/generated/_tokens-typography.scss +1 -1
- package/styles/generated/_tokens.scss +1 -1
- package/styles/utils/_helpers.scss +15 -0
- package/styles/utils/_mixins.scss +17 -1
- package/styles.css +1 -1
- package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +234 -0
- package/types/4sh-ui-kit-base-ui-image.d.ts +16 -3
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +4 -1
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +186 -36
- package/types/4sh-ui-kit-forms-ui-editor.d.ts +481 -0
- package/types/4sh-ui-kit-forms-ui-field.d.ts +20 -2
- package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +4 -0
- package/types/4sh-ui-kit-forms-ui-input-number.d.ts +9 -0
- package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +4 -1
- package/types/4sh-ui-kit-forms-ui-input.d.ts +28 -2
- package/types/4sh-ui-kit-forms-ui-select.d.ts +2 -0
- package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +126 -0
- package/types/4sh-ui-kit-forms-ui-textarea.d.ts +4 -0
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +220 -0
- package/types/4sh-ui-kit-forms.d.ts +34 -7
- package/types/4sh-ui-kit-layout-ui-modal.d.ts +7 -0
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +8 -3
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +14 -3
|
@@ -6,11 +6,85 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|
|
6
6
|
import { ThemeService, BrandService } from '@4sh/ui-kit/theming';
|
|
7
7
|
import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Assainissement des SVG inlinés par `ui-image`.
|
|
11
|
+
*
|
|
12
|
+
* Angular's HTML sanitizer strips `<svg>` wholesale, so inlining an SVG — which
|
|
13
|
+
* is what lets the asset inherit `currentColor` and the theme's CSS — has no
|
|
14
|
+
* choice but to go through `bypassSecurityTrustHtml()`. That bypass is only
|
|
15
|
+
* defensible if the markup has already been scrubbed here, which is the single
|
|
16
|
+
* reason this file exists. See `docs/SECURITY-PRACTICES.md`.
|
|
17
|
+
*
|
|
18
|
+
* The threat model is not "the kit's own assets": it is a project serving
|
|
19
|
+
* `assets/img/` from a CDN, or letting a client drop its own logo in a brand
|
|
20
|
+
* folder (white-label). In both cases the SVG is markup of unknown origin
|
|
21
|
+
* rendered into the application's own origin.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Tags dropped WITH their content — unwrapping them would put their body in the
|
|
25
|
+
* document as text, or leave the vector intact.
|
|
26
|
+
*
|
|
27
|
+
* `foreignObject` re-opens the whole HTML namespace inside the SVG, and the SMIL
|
|
28
|
+
* elements (`animate`, `set`…) can retarget an attribute *after* this scrub ran.
|
|
29
|
+
*/
|
|
30
|
+
const VOIDED_TAGS = 'script, foreignObject, iframe, object, embed, animate, animateTransform, animateMotion, set, handler';
|
|
31
|
+
/** Attributes carrying a reference — the only ones allowed to name a target. */
|
|
32
|
+
const REF_ATTRS = new Set(['href', 'xlink:href', 'src']);
|
|
33
|
+
/** A reference either stays inside the document, or navigates over http(s). */
|
|
34
|
+
const ALLOWED_REF_PROTOCOLS = ['http:', 'https:'];
|
|
35
|
+
/**
|
|
36
|
+
* Strips from an SVG everything that can execute or fetch, and returns the
|
|
37
|
+
* scrubbed markup.
|
|
38
|
+
*
|
|
39
|
+
* Parsing happens inside a detached `<template>`: its content is inert, so
|
|
40
|
+
* nothing runs and nothing is fetched while we inspect it. Returns `''` when
|
|
41
|
+
* there is no DOM to parse with (SSR) — failing closed, since un-scrubbed
|
|
42
|
+
* markup must never reach the bypass.
|
|
43
|
+
*/
|
|
44
|
+
function sanitizeInlineSvg(raw) {
|
|
45
|
+
if (typeof document === 'undefined')
|
|
46
|
+
return '';
|
|
47
|
+
const template = document.createElement('template');
|
|
48
|
+
/* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE : on
|
|
49
|
+
écrit DANS un `<template>` détaché, dont le contenu est inerte — rien ne
|
|
50
|
+
s'exécute et rien n'est chargé. C'est l'étape de PARSING du scrub, pas une
|
|
51
|
+
injection dans le document. Registre : docs/SECURITY-PRACTICES.md. */
|
|
52
|
+
template.innerHTML = raw;
|
|
53
|
+
for (const el of Array.from(template.content.querySelectorAll(VOIDED_TAGS)))
|
|
54
|
+
el.remove();
|
|
55
|
+
for (const el of Array.from(template.content.querySelectorAll('*'))) {
|
|
56
|
+
for (const attr of Array.from(el.attributes)) {
|
|
57
|
+
const name = attr.name.toLowerCase();
|
|
58
|
+
// Every event handler, whatever the element it sits on.
|
|
59
|
+
if (name.startsWith('on')) {
|
|
60
|
+
el.removeAttributeNode(attr);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (REF_ATTRS.has(name) && !isSafeRef(attr.value))
|
|
64
|
+
el.removeAttributeNode(attr);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return template.innerHTML;
|
|
68
|
+
}
|
|
69
|
+
/** @internal Rejects `javascript:`, `data:` and the other non-navigational schemes. */
|
|
70
|
+
function isSafeRef(value) {
|
|
71
|
+
const ref = value.trim();
|
|
72
|
+
// `<use href="#icon">` — a same-document reference names no external target.
|
|
73
|
+
if (ref.startsWith('#'))
|
|
74
|
+
return true;
|
|
75
|
+
try {
|
|
76
|
+
return ALLOWED_REF_PROTOCOLS.includes(new URL(ref, document.baseURI).protocol);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
9
83
|
/**
|
|
10
84
|
* Map of the LOCAL assets available to `ui-image` (its `name` input).
|
|
11
85
|
*
|
|
12
86
|
* The kit cannot know a project's assets, so the map is injected rather than
|
|
13
|
-
* bundled: generate it in your app (see `
|
|
87
|
+
* bundled: generate it in your app (see the `generate:assets` script in the
|
|
14
88
|
* starter, which writes `src/assets/assets-map.json`) and provide it with
|
|
15
89
|
* `provideUiImageAssets()`. Without it, `name` resolves to nothing and the
|
|
16
90
|
* component falls back to its placeholder — `src` (remote URLs) still works.
|
|
@@ -27,15 +101,22 @@ const UI_IMAGE_ASSETS = new InjectionToken('UI_IMAGE_ASSETS');
|
|
|
27
101
|
function provideUiImageAssets(map) {
|
|
28
102
|
return { provide: UI_IMAGE_ASSETS, useValue: map };
|
|
29
103
|
}
|
|
30
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Cross-instance memoization: the same resolved URL is fetched once (logos
|
|
106
|
+
* repeated across the app).
|
|
107
|
+
*
|
|
108
|
+
* Holds the **scrubbed** markup, never the raw response — nothing that skipped
|
|
109
|
+
* `sanitizeInlineSvg()` may ever be read back out of here.
|
|
110
|
+
*/
|
|
31
111
|
const SVG_CACHE = new Map();
|
|
32
112
|
/**
|
|
33
113
|
* ui-image — theme/brand-aware image.
|
|
34
114
|
*
|
|
35
115
|
* Two sources: `name` (local asset key resolved through `assets-map.json`,
|
|
36
116
|
* theme/brand variants) or `src` (remote/absolute URL — takes precedence).
|
|
37
|
-
* Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS
|
|
38
|
-
* remote URLs always render through
|
|
117
|
+
* Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS — after
|
|
118
|
+
* being scrubbed by `sanitizeInlineSvg()`; remote URLs always render through
|
|
119
|
+
* `<img [ngSrc]>` (never inlined).
|
|
39
120
|
* On load failure the `fallback` local asset is shown, then a token-styled
|
|
40
121
|
* placeholder if the fallback also fails (or none is provided).
|
|
41
122
|
*/
|
|
@@ -93,14 +174,32 @@ class UiImage {
|
|
|
93
174
|
return !url || SVG_CACHE.has(url) ? undefined : url;
|
|
94
175
|
}, /* @ts-ignore */
|
|
95
176
|
...(ngDevMode ? [{ debugName: "svgResource" }] : /* istanbul ignore next */ []));
|
|
177
|
+
/**
|
|
178
|
+
* The inlined SVG, scrubbed then trusted.
|
|
179
|
+
*
|
|
180
|
+
* FSHSP-177 — this is the kit's ONLY `bypassSecurityTrust*()`. It is not
|
|
181
|
+
* avoidable: Angular's HTML sanitizer strips `<svg>` wholesale, so passing the
|
|
182
|
+
* asset through `sanitize(SecurityContext.HTML, …)` would render nothing, and
|
|
183
|
+
* inlining is the whole point (the asset inherits `currentColor` and the
|
|
184
|
+
* theme's CSS — an `<img>` cannot). What makes the bypass defensible is that
|
|
185
|
+
* the markup went through `sanitizeInlineSvg()` first: scripts, `foreignObject`,
|
|
186
|
+
* SMIL, event handlers and non-navigational references are already gone.
|
|
187
|
+
* Justified in `docs/SECURITY-PRACTICES.md`.
|
|
188
|
+
*/
|
|
96
189
|
this.svgContent = computed(() => {
|
|
97
190
|
if (!this.isInlineSvg())
|
|
98
191
|
return null;
|
|
99
192
|
const url = this.localSrc();
|
|
100
193
|
if (!url)
|
|
101
194
|
return null;
|
|
102
|
-
const
|
|
103
|
-
|
|
195
|
+
const safe = SVG_CACHE.get(url) ??
|
|
196
|
+
(this.svgResource.hasValue() ? sanitizeInlineSvg(this.svgResource.value()) : undefined);
|
|
197
|
+
/* eslint-disable-next-line no-restricted-syntax -- EXCEPTION JUSTIFIÉE :
|
|
198
|
+
seul bypass du kit. Inévitable (l'assainisseur d'Angular supprime `<svg>`
|
|
199
|
+
en entier) et sûr parce que `sanitizeInlineSvg()` a déjà retiré scripts,
|
|
200
|
+
foreignObject, SMIL, gestionnaires d'événements et références non
|
|
201
|
+
navigationnelles. Registre : docs/SECURITY-PRACTICES.md. */
|
|
202
|
+
return safe === undefined ? null : this.sanitizer.bypassSecurityTrustHtml(safe);
|
|
104
203
|
}, /* @ts-ignore */
|
|
105
204
|
...(ngDevMode ? [{ debugName: "svgContent" }] : /* istanbul ignore next */ []));
|
|
106
205
|
this.primaryFailed = computed(() => this.isInlineSvg() ? this.svgResource.status() === 'error' : this.primaryImgFailed(), /* @ts-ignore */
|
|
@@ -116,13 +215,15 @@ class UiImage {
|
|
|
116
215
|
...(ngDevMode ? [{ debugName: "cssWidth" }] : /* istanbul ignore next */ []));
|
|
117
216
|
this.cssHeight = computed(() => this.height() != null ? `${this.height()}${this.heightUnit() || 'px'}` : null, /* @ts-ignore */
|
|
118
217
|
...(ngDevMode ? [{ debugName: "cssHeight" }] : /* istanbul ignore next */ []));
|
|
119
|
-
// Side effect only: populate the module-level SVG cache once a fetch
|
|
218
|
+
// Side effect only: populate the module-level SVG cache once a fetch
|
|
219
|
+
// resolves. Scrubbed on the way in — the cache is read straight into the
|
|
220
|
+
// bypass, so it must never hold a raw response.
|
|
120
221
|
effect(() => {
|
|
121
222
|
if (!this.isInlineSvg())
|
|
122
223
|
return;
|
|
123
224
|
const url = this.localSrc();
|
|
124
225
|
if (url && this.svgResource.hasValue())
|
|
125
|
-
SVG_CACHE.set(url, this.svgResource.value());
|
|
226
|
+
SVG_CACHE.set(url, sanitizeInlineSvg(this.svgResource.value()));
|
|
126
227
|
});
|
|
127
228
|
if (isDevMode()) {
|
|
128
229
|
effect(() => {
|
|
@@ -185,11 +286,11 @@ class UiImage {
|
|
|
185
286
|
return '';
|
|
186
287
|
}
|
|
187
288
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiImage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
188
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", 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 } }, outputs: { loadFailed: "loadFailed" }, ngImport: i0, template: "@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 <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\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", 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(--global-background-muted);color:var(--global-text-muted)}\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: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
|
|
289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", 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 } }, outputs: { loadFailed: "loadFailed" }, ngImport: i0, template: "@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 {\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", 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(--global-background-muted);color:var(--global-text-muted)}\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: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
|
|
189
290
|
}
|
|
190
291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiImage, decorators: [{
|
|
191
292
|
type: Component,
|
|
192
|
-
args: [{ selector: 'ui-image', imports: [NgOptimizedImage, UiIcon], template: "@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 <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\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", 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(--global-background-muted);color:var(--global-text-muted)}\n"] }]
|
|
293
|
+
args: [{ selector: 'ui-image', imports: [NgOptimizedImage, UiIcon], template: "@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 {\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", 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(--global-background-muted);color:var(--global-text-muted)}\n"] }]
|
|
193
294
|
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], fallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallback", required: false }] }], priority: [{ type: i0.Input, args: [{ isSignal: true, alias: "priority", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], widthUnit: [{ type: i0.Input, args: [{ isSignal: true, alias: "widthUnit", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], heightUnit: [{ type: i0.Input, args: [{ isSignal: true, alias: "heightUnit", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], loadFailed: [{ type: i0.Output, args: ["loadFailed"] }] } });
|
|
194
295
|
|
|
195
296
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-base-ui-image.mjs","sources":["../../../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 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';\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 `npm run generate:assets` 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/** Cross-instance memoization: the same resolved URL is fetched once (logos repeated across the app). */\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;\n * remote URLs always render through `<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 protected readonly svgContent = computed<SafeHtml | null>(() => {\n if (!this.isInlineSvg()) return null;\n const url = this.localSrc();\n if (!url) return null;\n const raw =\n SVG_CACHE.get(url) ?? (this.svgResource.hasValue() ? this.svgResource.value() : undefined);\n return raw === undefined ? null : this.sanitizer.bypassSecurityTrustHtml(raw);\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 resolves.\n effect(() => {\n if (!this.isInlineSvg()) return;\n const url = this.localSrc();\n if (url && this.svgResource.hasValue()) SVG_CACHE.set(url, 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 <div\n class=\"ui-image-svg\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [innerHTML]=\"svgContent()\"\n ></div>\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":";;;;;;;;AA4BA;;;;;;;;AAQG;MACU,eAAe,GAAG,IAAI,cAAc,CAAmB,i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AAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtEpB,2zBA8BA,EAAA,MAAA,EAAA,CAAA,wkBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDsCY,gBAAgB,4PAAE,MAAM,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,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,2zBAAA,EAAA,MAAA,EAAA,CAAA,wkBAAA,CAAA,EAAA;;;AEpErC;;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-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,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Contexts" }] : /* istanbul ignore next */ []));
|
|
338
|
-
/** @ignore Placeholder hidden as soon as values are selected (`multiple`)
|
|
339
|
-
|
|
338
|
+
/** @ignore Placeholder hidden as soon as values are selected (`multiple`), and
|
|
339
|
+
* while a floating label is at rest: it already holds that spot. */
|
|
340
|
+
this.effectivePlaceholder = computed(() => this.hasFloatLabel() || (this.multiple() && this.selectedValues().length)
|
|
341
|
+
? ''
|
|
342
|
+
: (this.placeholder() ?? ''), /* @ts-ignore */
|
|
340
343
|
...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
|
|
344
|
+
/** @ignore Keeps a floating label raised once focus leaves. */
|
|
345
|
+
this.isFilled = computed(() => this.hasText() || this.selectedValues().length > 0, /* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [{ debugName: "isFilled" }] : /* istanbul ignore next */ []));
|
|
341
347
|
/** @ignore Chips are removable unless the field is disabled/readonly. */
|
|
342
348
|
this.canRemove = computed(() => !this.isDisabled() && !this.readonly(), /* @ts-ignore */
|
|
343
349
|
...(ngDevMode ? [{ debugName: "canRemove" }] : /* istanbul ignore next */ []));
|
|
@@ -916,7 +922,7 @@ class UiAutocomplete extends BaseFormField {
|
|
|
916
922
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
917
923
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiAutocomplete, isStandalone: true, selector: "ui-autocomplete", inputs: { suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, optionGroupLabel: { classPropertyName: "optionGroupLabel", publicName: "optionGroupLabel", isSignal: true, isRequired: false, transformFunction: null }, optionGroupChildren: { classPropertyName: "optionGroupChildren", publicName: "optionGroupChildren", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, completeOnFocus: { classPropertyName: "completeOnFocus", publicName: "completeOnFocus", isSignal: true, isRequired: false, transformFunction: null }, dropdown: { classPropertyName: "dropdown", publicName: "dropdown", isSignal: true, isRequired: false, transformFunction: null }, dropdownMode: { classPropertyName: "dropdownMode", publicName: "dropdownMode", isSignal: true, isRequired: false, transformFunction: null }, dropdownAriaLabel: { classPropertyName: "dropdownAriaLabel", publicName: "dropdownAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, dropdownIcon: { classPropertyName: "dropdownIcon", publicName: "dropdownIcon", isSignal: true, isRequired: false, transformFunction: null }, forceSelection: { classPropertyName: "forceSelection", publicName: "forceSelection", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, unique: { classPropertyName: "unique", publicName: "unique", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedLabels: { classPropertyName: "maxSelectedLabels", publicName: "maxSelectedLabels", isSignal: true, isRequired: false, transformFunction: null }, overflowLabel: { classPropertyName: "overflowLabel", publicName: "overflowLabel", isSignal: true, isRequired: false, transformFunction: null }, removeTagLabel: { classPropertyName: "removeTagLabel", publicName: "removeTagLabel", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, showEmptyMessage: { classPropertyName: "showEmptyMessage", publicName: "showEmptyMessage", isSignal: true, isRequired: false, transformFunction: null }, autoOptionFocus: { classPropertyName: "autoOptionFocus", publicName: "autoOptionFocus", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, focusOnHover: { classPropertyName: "focusOnHover", publicName: "focusOnHover", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, autoFlip: { classPropertyName: "autoFlip", publicName: "autoFlip", isSignal: true, isRequired: false, transformFunction: null }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { completeMethod: "completeMethod", valueChange: "valueChange", optionSelect: "optionSelect", optionUnselect: "optionUnselect", opened: "opened", closed: "closed", cleared: "cleared", dropdownClick: "dropdownClick", lazyLoad: "lazyLoad", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [
|
|
918
924
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiAutocomplete), multi: true },
|
|
919
|
-
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "selectedItemTemplate", first: true, predicate: ["selectedItem"], descendants: true, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }, { propertyName: "tagEls", predicate: ["tagEl"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!-- One rendered row: group header or suggestion (shared by the plain and virtual lists). -->\n<ng-template #rowTpl let-row>\n @if (row.kind === 'group') {\n <li class=\"ui-autocomplete-group\" role=\"presentation\" [class._small]=\"size() === 'small'\">\n @if (groupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row.original, group: row.original }\"\n />\n } @else {\n {{ row.label }}\n }\n </li>\n } @else {\n <!-- ARIA combobox/listbox pattern: keyboard and focus are handled by\n the input role=\"combobox\" (roving via aria-activedescendant). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"ui-autocomplete-option\"\n role=\"option\"\n [attr.id]=\"row.id\"\n [class._small]=\"size() === 'small'\"\n [class._selected]=\"row.selected\"\n [class._focused]=\"row.index === focusedIndex()\"\n [class._disabled]=\"row.entry.disabled\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.entry.disabled || null\"\n [attr.aria-setsize]=\"optionCount()\"\n [attr.aria-posinset]=\"row.index + 1\"\n (mousedown)=\"onOptionMousedown($event)\"\n (click)=\"onOptionClick(row, $event)\"\n (mouseenter)=\"onOptionMouseEnter(row)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.entry.original,\n option: row.entry.original,\n selected: row.selected,\n index: row.index,\n }\"\n />\n } @else {\n <span class=\"ui-autocomplete-option-label\">{{ row.entry.label }}</span>\n }\n </li>\n }\n</ng-template>\n\n<!-- Suggestions panel (CDK overlay). -->\n<ng-template #panelTpl>\n <div\n #panel\n class=\"ui-autocomplete-panel\"\n [class]=\"panelStyleClass()\"\n [class._small]=\"size() === 'small'\"\n [style.width.px]=\"overlayWidth()\"\n [uiMotion]=\"'slide-down'\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n >\n @if (headerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-header\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"ui-autocomplete-viewport\"\n [itemSize]=\"virtualScrollItemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n <ng-container *cdkVirtualFor=\"let row of visibleRows(); trackBy: trackRow\">\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n </ng-container>\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n class=\"ui-autocomplete-scroller\"\n [class._small]=\"size() === 'small'\"\n [style.max-height]=\"scrollHeight() || null\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n @for (row of visibleRows(); track row.key) {\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n }\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </div>\n }\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Empty state row. -->\n<ng-template #emptyTpl>\n <li class=\"ui-autocomplete-empty\" role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ emptyMessage() }}\n }\n </li>\n</ng-template>\n\n<!-- Trigger: composed field around a native combobox input. -->\n<div #container class=\"ui-autocomplete\">\n <ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [autoHeight]=\"multiple()\"\n >\n <div\n class=\"ui-autocomplete-control\"\n [attr.role]=\"multiple() && !selectedItemTemplate() ? 'listbox' : null\"\n [attr.aria-orientation]=\"multiple() && !selectedItemTemplate() ? 'horizontal' : null\"\n [attr.aria-label]=\"\n multiple() && !selectedItemTemplate() && !label() ? ariaLabel() || null : null\n \"\n [attr.aria-labelledby]=\"\n multiple() && !selectedItemTemplate() ? ariaLabelledBy() || null : null\n \"\n (mousedown)=\"onBoxMousedown($event)\"\n >\n @if (multiple()) {\n @if (selectedItemTemplate(); as tpl) {\n @for (ctx of selectedItemContexts(); track $index) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"ctx\" />\n }\n } @else {\n @for (tag of visibleTagRows(); track $index) {\n <ui-chip\n #tagEl\n class=\"ui-autocomplete-tag\"\n role=\"option\"\n aria-selected=\"true\"\n [attr.aria-label]=\"tag.label\"\n [label]=\"tag.label\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n [removable]=\"canRemove()\"\n [removeTabindex]=\"-1\"\n [removeAriaLabel]=\"tag.removeAriaLabel\"\n [attr.aria-setsize]=\"tagRows().length\"\n [attr.aria-posinset]=\"tag.index + 1\"\n [attr.tabindex]=\"isDisabled() ? null : focusedTag() === tag.index ? 0 : -1\"\n (keydown)=\"onTagKeydown($event, tag.index)\"\n (focus)=\"focusedTag.set(tag.index)\"\n (remove)=\"removeAt(tag.index)\"\n />\n }\n }\n @if (overflowCount() > 0) {\n <!-- Collapsed remainder (`maxSelectedLabels`): informative only, not removable. -->\n <ui-chip\n class=\"ui-autocomplete-tag _overflow\"\n role=\"presentation\"\n [label]=\"overflowText()\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n />\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n class=\"ui-autocomplete-input\"\n [class._small]=\"size() === 'small'\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [id]=\"resolvedId()\"\n [value]=\"inputText()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n />\n </div>\n\n @if (showClearButton()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-clear\"\n [attr.aria-label]=\"clearAriaLabel()\"\n (click)=\"onClearClick($event)\"\n >\n <ui-icon name=\"xmark\" [size]=\"iconSize()\" />\n </button>\n }\n\n @if (loading()) {\n <ui-spinner\n uiFieldSuffix\n class=\"ui-autocomplete-loading\"\n size=\"small\"\n orientation=\"horizontal\"\n ariaLabel=\"Recherche en cours\"\n />\n } @else if (dropdown()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-dropdown\"\n [class._open]=\"panelOpen()\"\n [disabled]=\"isDisabled()\"\n tabindex=\"-1\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-label]=\"dropdownAriaLabel()\"\n (click)=\"onDropdownClick($event)\"\n >\n <ui-icon [name]=\"dropdownIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n </ui-field>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"panelOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\"\n (overlayOutsideClick)=\"close(false)\"\n (detach)=\"close(false)\"\n>\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n</ng-template>\n", styles: [".ui-autocomplete{display:block;--ui-field-box-cursor: text}.ui-autocomplete-control{display:flex;align-items:center;align-self:stretch;flex:1 1 auto;flex-wrap:wrap;gap:var(--ui-autocomplete-tag-gap, var(--units-xs));min-width:0}.ui-autocomplete-control:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-tag{display:inline-flex;align-items:center;max-width:100%;border-radius:var(--ui-autocomplete-tag-radius, var(--radius-full));transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-tag:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-input{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-autocomplete-input::placeholder{color:var(--form-low-content-default);opacity:1}.ui-autocomplete-input:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-input{flex:1 1 var(--ui-autocomplete-input-min-width, 5rem);min-width:var(--ui-autocomplete-input-min-width, 5rem);width:auto}.ui-autocomplete-input._small{font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-clear{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-autocomplete-clear-size, var(--size-components-2xs));height:var(--ui-autocomplete-clear-size, var(--size-components-2xs));flex-shrink:0;margin:0;padding:0;border:none;border-radius:var(--ui-autocomplete-clear-radius, var(--radius-full));background:none;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-clear:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-clear:focus-visible{outline:none;color:var(--form-high-content-focused);box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-clear:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{flex-shrink:0;color:var(--form-low-content-default)}.ui-autocomplete-dropdown:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown._disabled{color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{transition:rotate var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms);margin:0;padding:0;border:none;background:none;color:var(--form-low-content-default);cursor:pointer}.ui-autocomplete-dropdown:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-dropdown._open{rotate:180deg}.ui-autocomplete-dropdown:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-loading{flex-shrink:0}.ui-autocomplete-loading:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-loading:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-panel{border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, var(--form-high-stroke-default));border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--form-high-surface-default));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--fontfamily-base);display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));box-sizing:border-box;max-width:var(--ui-autocomplete-panel-max-width, calc(100vw - var(--units-lg)));padding:var(--ui-autocomplete-panel-padding, var(--units-xs))}.ui-autocomplete-panel .ui-autocomplete-header,.ui-autocomplete-panel .ui-autocomplete-footer{padding:var(--ui-autocomplete-header-padding-y, var(--units-xs)) var(--ui-autocomplete-header-padding-x, var(--units-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));color:var(--form-high-content-default)}.ui-autocomplete-panel .ui-autocomplete-scroller{overflow:auto;max-height:var(--ui-autocomplete-scroller-max-height, 19.5rem)}.ui-autocomplete-panel .ui-autocomplete-scroller._small{max-height:var(--ui-autocomplete-scroller-max-height-small, 16rem)}.ui-autocomplete-panel .ui-autocomplete-viewport{width:100%}.ui-autocomplete-panel .ui-autocomplete-list{display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));margin:0;padding:0;list-style:none}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-list{gap:0}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group{height:var(--ui-autocomplete-option-height, 2.5rem)}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group._small{height:var(--ui-autocomplete-option-height-small, 2rem)}.ui-autocomplete-panel .ui-autocomplete-option{display:flex;align-items:center;gap:var(--ui-autocomplete-option-gap, var(--units-sm));box-sizing:border-box;height:var(--ui-autocomplete-option-height, 2.5rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));border-radius:var(--ui-autocomplete-option-radius, var(--radius-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-high-content-default);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-panel .ui-autocomplete-option._small{height:var(--ui-autocomplete-option-height-small, 2rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-panel .ui-autocomplete-option._focused,.ui-autocomplete-panel .ui-autocomplete-option:hover:not(._disabled){background-color:var(--global-background-default-hover)}.ui-autocomplete-panel .ui-autocomplete-option._selected{background-color:var(--form-high-surface-hover);color:var(--form-high-content-checked)}.ui-autocomplete-panel .ui-autocomplete-option._disabled{color:var(--form-high-content-disabled);cursor:not-allowed}.ui-autocomplete-panel .ui-autocomplete-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-autocomplete-panel .ui-autocomplete-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ui-autocomplete-group-height, 2rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));font-weight:var(--weight-bold);color:var(--form-low-content-default)}.ui-autocomplete-panel .ui-autocomplete-group._small{height:var(--ui-autocomplete-group-height-small, 1.5rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-group-font-size-small, var(--size-typography-text-sm))}.ui-autocomplete-panel .ui-autocomplete-empty{display:flex;align-items:center;box-sizing:border-box;min-height:var(--ui-autocomplete-option-height, 2.5rem);padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-low-content-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.ɵɵCdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "hasFooter"] }, { 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: "component", type: UiChip, selector: "ui-chip", inputs: ["label", "level", "subLevel", "size", "icon", "image", "alt", "rounded", "removable", "removeIcon", "disabled", "selectable", "selected", "selectedIcon", "ariaLabel", "ariaLabelledBy", "removeAriaLabel", "removeTabindex"], outputs: ["selectedChange", "remove", "chipClick", "imageError"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }] }); }
|
|
925
|
+
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "selectedItemTemplate", first: true, predicate: ["selectedItem"], descendants: true, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }, { propertyName: "tagEls", predicate: ["tagEl"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!-- One rendered row: group header or suggestion (shared by the plain and virtual lists). -->\n<ng-template #rowTpl let-row>\n @if (row.kind === 'group') {\n <li class=\"ui-autocomplete-group\" role=\"presentation\" [class._small]=\"size() === 'small'\">\n @if (groupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row.original, group: row.original }\"\n />\n } @else {\n {{ row.label }}\n }\n </li>\n } @else {\n <!-- ARIA combobox/listbox pattern: keyboard and focus are handled by\n the input role=\"combobox\" (roving via aria-activedescendant). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"ui-autocomplete-option\"\n role=\"option\"\n [attr.id]=\"row.id\"\n [class._small]=\"size() === 'small'\"\n [class._selected]=\"row.selected\"\n [class._focused]=\"row.index === focusedIndex()\"\n [class._disabled]=\"row.entry.disabled\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.entry.disabled || null\"\n [attr.aria-setsize]=\"optionCount()\"\n [attr.aria-posinset]=\"row.index + 1\"\n (mousedown)=\"onOptionMousedown($event)\"\n (click)=\"onOptionClick(row, $event)\"\n (mouseenter)=\"onOptionMouseEnter(row)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.entry.original,\n option: row.entry.original,\n selected: row.selected,\n index: row.index,\n }\"\n />\n } @else {\n <span class=\"ui-autocomplete-option-label\">{{ row.entry.label }}</span>\n }\n </li>\n }\n</ng-template>\n\n<!-- Suggestions panel (CDK overlay). -->\n<ng-template #panelTpl>\n <div\n #panel\n class=\"ui-autocomplete-panel\"\n [class]=\"panelStyleClass()\"\n [class._small]=\"size() === 'small'\"\n [style.width.px]=\"overlayWidth()\"\n [uiMotion]=\"'slide-down'\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n >\n @if (headerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-header\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"ui-autocomplete-viewport\"\n [itemSize]=\"virtualScrollItemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n <ng-container *cdkVirtualFor=\"let row of visibleRows(); trackBy: trackRow\">\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n </ng-container>\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n class=\"ui-autocomplete-scroller\"\n [class._small]=\"size() === 'small'\"\n [style.max-height]=\"scrollHeight() || null\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n @for (row of visibleRows(); track row.key) {\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n }\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </div>\n }\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Empty state row. -->\n<ng-template #emptyTpl>\n <li class=\"ui-autocomplete-empty\" role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ emptyMessage() }}\n }\n </li>\n</ng-template>\n\n<!-- Trigger: composed field around a native combobox input. -->\n<div #container class=\"ui-autocomplete\">\n <ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [autoHeight]=\"multiple()\"\n >\n <div\n class=\"ui-autocomplete-control\"\n (mousedown)=\"onBoxMousedown($event)\"\n >\n @if (multiple()) {\n @if (selectedItemTemplate(); as tpl) {\n @for (ctx of selectedItemContexts(); track $index) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"ctx\" />\n }\n } @else {\n <!-- The listbox wraps ONLY the option tags: it may contain neither the combobox input\n nor the informative overflow chip. `display: contents` keeps the tags flowing in\n the box exactly as before. -->\n <div\n class=\"ui-autocomplete-tags\"\n role=\"listbox\"\n aria-orientation=\"horizontal\"\n [attr.aria-label]=\"ariaLabelledBy() ? null : ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n >\n @for (tag of visibleTagRows(); track $index) {\n <ui-chip\n #tagEl\n class=\"ui-autocomplete-tag\"\n role=\"option\"\n aria-selected=\"true\"\n [attr.aria-label]=\"tag.label\"\n [label]=\"tag.label\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n [removable]=\"canRemove()\"\n [removeTabindex]=\"-1\"\n [removeAriaLabel]=\"tag.removeAriaLabel\"\n [attr.aria-setsize]=\"tagRows().length\"\n [attr.aria-posinset]=\"tag.index + 1\"\n [attr.tabindex]=\"isDisabled() ? null : focusedTag() === tag.index ? 0 : -1\"\n (keydown)=\"onTagKeydown($event, tag.index)\"\n (focus)=\"focusedTag.set(tag.index)\"\n (remove)=\"removeAt(tag.index)\"\n />\n }\n </div>\n }\n @if (overflowCount() > 0) {\n <!-- Collapsed remainder (`maxSelectedLabels`): informative only, not removable. -->\n <ui-chip\n class=\"ui-autocomplete-tag _overflow\"\n role=\"presentation\"\n [label]=\"overflowText()\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n />\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n class=\"ui-autocomplete-input\"\n [class._small]=\"size() === 'small'\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [id]=\"resolvedId()\"\n [value]=\"inputText()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n />\n </div>\n\n @if (showClearButton()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-clear\"\n [attr.aria-label]=\"clearAriaLabel()\"\n (click)=\"onClearClick($event)\"\n >\n <ui-icon name=\"xmark\" [size]=\"iconSize()\" />\n </button>\n }\n\n @if (loading()) {\n <ui-spinner\n uiFieldSuffix\n class=\"ui-autocomplete-loading\"\n size=\"small\"\n orientation=\"horizontal\"\n ariaLabel=\"Recherche en cours\"\n />\n } @else if (dropdown()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-dropdown\"\n [class._open]=\"panelOpen()\"\n [disabled]=\"isDisabled()\"\n tabindex=\"-1\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-label]=\"dropdownAriaLabel()\"\n (click)=\"onDropdownClick($event)\"\n >\n <ui-icon [name]=\"dropdownIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n </ui-field>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"panelOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\"\n (overlayOutsideClick)=\"close(false)\"\n (detach)=\"close(false)\"\n>\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n</ng-template>\n", styles: [".ui-autocomplete{display:block;--ui-field-box-cursor: text}.ui-autocomplete-control{display:flex;align-items:center;align-self:stretch;flex:1 1 auto;flex-wrap:wrap;gap:var(--ui-autocomplete-tag-gap, var(--units-xs));min-width:0}.ui-autocomplete-control:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-autocomplete-tags{display:contents}.ui-autocomplete-tag{display:inline-flex;align-items:center;max-width:100%;border-radius:var(--ui-autocomplete-tag-radius, var(--radius-full));transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-tag:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-input{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-autocomplete-input::placeholder{color:var(--form-low-content-default);opacity:1}.ui-autocomplete-input:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-input{flex:1 1 var(--ui-autocomplete-input-min-width, 5rem);min-width:var(--ui-autocomplete-input-min-width, 5rem);width:auto}.ui-autocomplete-input._small{font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-clear{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-autocomplete-clear-size, var(--size-components-2xs));height:var(--ui-autocomplete-clear-size, var(--size-components-2xs));flex-shrink:0;margin:0;padding:0;border:none;border-radius:var(--ui-autocomplete-clear-radius, var(--radius-full));background:none;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-clear:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-clear:focus-visible{outline:none;color:var(--form-high-content-focused);box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-clear:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{flex-shrink:0;color:var(--form-low-content-default)}.ui-autocomplete-dropdown:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown._disabled{color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{transition:rotate var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms);margin:0;padding:0;border:none;background:none;color:var(--form-low-content-default);cursor:pointer}.ui-autocomplete-dropdown:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-dropdown._open{rotate:180deg}.ui-autocomplete-dropdown:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-loading{flex-shrink:0}.ui-autocomplete-loading:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-loading:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-panel{border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, var(--form-high-stroke-default));border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--form-high-surface-default));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--fontfamily-base);display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));box-sizing:border-box;max-width:var(--ui-autocomplete-panel-max-width, calc(100vw - var(--units-lg)));padding:var(--ui-autocomplete-panel-padding, var(--units-xs))}.ui-autocomplete-panel .ui-autocomplete-header,.ui-autocomplete-panel .ui-autocomplete-footer{padding:var(--ui-autocomplete-header-padding-y, var(--units-xs)) var(--ui-autocomplete-header-padding-x, var(--units-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));color:var(--form-high-content-default)}.ui-autocomplete-panel .ui-autocomplete-scroller{overflow:auto;max-height:var(--ui-autocomplete-scroller-max-height, 19.5rem)}.ui-autocomplete-panel .ui-autocomplete-scroller._small{max-height:var(--ui-autocomplete-scroller-max-height-small, 16rem)}.ui-autocomplete-panel .ui-autocomplete-viewport{width:100%}.ui-autocomplete-panel .ui-autocomplete-list{display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));margin:0;padding:0;list-style:none}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-list{gap:0}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group{height:var(--ui-autocomplete-option-height, 2.5rem)}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group._small{height:var(--ui-autocomplete-option-height-small, 2rem)}.ui-autocomplete-panel .ui-autocomplete-option{display:flex;align-items:center;gap:var(--ui-autocomplete-option-gap, var(--units-sm));box-sizing:border-box;height:var(--ui-autocomplete-option-height, 2.5rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));border-radius:var(--ui-autocomplete-option-radius, var(--radius-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-high-content-default);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-panel .ui-autocomplete-option._small{height:var(--ui-autocomplete-option-height-small, 2rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-panel .ui-autocomplete-option._focused,.ui-autocomplete-panel .ui-autocomplete-option:hover:not(._disabled){background-color:var(--global-background-default-hover)}.ui-autocomplete-panel .ui-autocomplete-option._selected{background-color:var(--form-high-surface-hover);color:var(--form-high-content-checked)}.ui-autocomplete-panel .ui-autocomplete-option._disabled{color:var(--form-high-content-disabled);cursor:not-allowed}.ui-autocomplete-panel .ui-autocomplete-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-autocomplete-panel .ui-autocomplete-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ui-autocomplete-group-height, 2rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));font-weight:var(--weight-bold);color:var(--form-low-content-default)}.ui-autocomplete-panel .ui-autocomplete-group._small{height:var(--ui-autocomplete-group-height-small, 1.5rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-group-font-size-small, var(--size-typography-text-sm))}.ui-autocomplete-panel .ui-autocomplete-empty{display:flex;align-items:center;box-sizing:border-box;min-height:var(--ui-autocomplete-option-height, 2.5rem);padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-low-content-default)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.ɵɵCdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.ɵɵCdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.ɵɵCdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "floatLabel", "filled", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "hasFooter", "hasPrefix"] }, { 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: "component", type: UiChip, selector: "ui-chip", inputs: ["label", "level", "subLevel", "size", "icon", "image", "alt", "rounded", "removable", "removeIcon", "disabled", "selectable", "selected", "selectedIcon", "ariaLabel", "ariaLabelledBy", "removeAriaLabel", "removeTabindex"], outputs: ["selectedChange", "remove", "chipClick", "imageError"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }] }); }
|
|
920
926
|
}
|
|
921
927
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiAutocomplete, decorators: [{
|
|
922
928
|
type: Component,
|
|
@@ -931,7 +937,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
|
|
|
931
937
|
UiMotion,
|
|
932
938
|
], providers: [
|
|
933
939
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiAutocomplete), multi: true },
|
|
934
|
-
], template: "<!-- One rendered row: group header or suggestion (shared by the plain and virtual lists). -->\n<ng-template #rowTpl let-row>\n @if (row.kind === 'group') {\n <li class=\"ui-autocomplete-group\" role=\"presentation\" [class._small]=\"size() === 'small'\">\n @if (groupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row.original, group: row.original }\"\n />\n } @else {\n {{ row.label }}\n }\n </li>\n } @else {\n <!-- ARIA combobox/listbox pattern: keyboard and focus are handled by\n the input role=\"combobox\" (roving via aria-activedescendant). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"ui-autocomplete-option\"\n role=\"option\"\n [attr.id]=\"row.id\"\n [class._small]=\"size() === 'small'\"\n [class._selected]=\"row.selected\"\n [class._focused]=\"row.index === focusedIndex()\"\n [class._disabled]=\"row.entry.disabled\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.entry.disabled || null\"\n [attr.aria-setsize]=\"optionCount()\"\n [attr.aria-posinset]=\"row.index + 1\"\n (mousedown)=\"onOptionMousedown($event)\"\n (click)=\"onOptionClick(row, $event)\"\n (mouseenter)=\"onOptionMouseEnter(row)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.entry.original,\n option: row.entry.original,\n selected: row.selected,\n index: row.index,\n }\"\n />\n } @else {\n <span class=\"ui-autocomplete-option-label\">{{ row.entry.label }}</span>\n }\n </li>\n }\n</ng-template>\n\n<!-- Suggestions panel (CDK overlay). -->\n<ng-template #panelTpl>\n <div\n #panel\n class=\"ui-autocomplete-panel\"\n [class]=\"panelStyleClass()\"\n [class._small]=\"size() === 'small'\"\n [style.width.px]=\"overlayWidth()\"\n [uiMotion]=\"'slide-down'\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n >\n @if (headerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-header\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"ui-autocomplete-viewport\"\n [itemSize]=\"virtualScrollItemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n <ng-container *cdkVirtualFor=\"let row of visibleRows(); trackBy: trackRow\">\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n </ng-container>\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n class=\"ui-autocomplete-scroller\"\n [class._small]=\"size() === 'small'\"\n [style.max-height]=\"scrollHeight() || null\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n @for (row of visibleRows(); track row.key) {\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n }\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </div>\n }\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Empty state row. -->\n<ng-template #emptyTpl>\n <li class=\"ui-autocomplete-empty\" role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ emptyMessage() }}\n }\n </li>\n</ng-template>\n\n<!-- Trigger: composed field around a native combobox input. -->\n<div #container class=\"ui-autocomplete\">\n <ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [autoHeight]=\"multiple()\"\n >\n <div\n class=\"ui-autocomplete-control\"\n [attr.role]=\"multiple() && !selectedItemTemplate() ? 'listbox' : null\"\n [attr.aria-orientation]=\"multiple() && !selectedItemTemplate() ? 'horizontal' : null\"\n [attr.aria-label]=\"\n multiple() && !selectedItemTemplate() && !label() ? ariaLabel() || null : null\n \"\n [attr.aria-labelledby]=\"\n multiple() && !selectedItemTemplate() ? ariaLabelledBy() || null : null\n \"\n (mousedown)=\"onBoxMousedown($event)\"\n >\n @if (multiple()) {\n @if (selectedItemTemplate(); as tpl) {\n @for (ctx of selectedItemContexts(); track $index) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"ctx\" />\n }\n } @else {\n @for (tag of visibleTagRows(); track $index) {\n <ui-chip\n #tagEl\n class=\"ui-autocomplete-tag\"\n role=\"option\"\n aria-selected=\"true\"\n [attr.aria-label]=\"tag.label\"\n [label]=\"tag.label\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n [removable]=\"canRemove()\"\n [removeTabindex]=\"-1\"\n [removeAriaLabel]=\"tag.removeAriaLabel\"\n [attr.aria-setsize]=\"tagRows().length\"\n [attr.aria-posinset]=\"tag.index + 1\"\n [attr.tabindex]=\"isDisabled() ? null : focusedTag() === tag.index ? 0 : -1\"\n (keydown)=\"onTagKeydown($event, tag.index)\"\n (focus)=\"focusedTag.set(tag.index)\"\n (remove)=\"removeAt(tag.index)\"\n />\n }\n }\n @if (overflowCount() > 0) {\n <!-- Collapsed remainder (`maxSelectedLabels`): informative only, not removable. -->\n <ui-chip\n class=\"ui-autocomplete-tag _overflow\"\n role=\"presentation\"\n [label]=\"overflowText()\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n />\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n class=\"ui-autocomplete-input\"\n [class._small]=\"size() === 'small'\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [id]=\"resolvedId()\"\n [value]=\"inputText()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n />\n </div>\n\n @if (showClearButton()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-clear\"\n [attr.aria-label]=\"clearAriaLabel()\"\n (click)=\"onClearClick($event)\"\n >\n <ui-icon name=\"xmark\" [size]=\"iconSize()\" />\n </button>\n }\n\n @if (loading()) {\n <ui-spinner\n uiFieldSuffix\n class=\"ui-autocomplete-loading\"\n size=\"small\"\n orientation=\"horizontal\"\n ariaLabel=\"Recherche en cours\"\n />\n } @else if (dropdown()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-dropdown\"\n [class._open]=\"panelOpen()\"\n [disabled]=\"isDisabled()\"\n tabindex=\"-1\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-label]=\"dropdownAriaLabel()\"\n (click)=\"onDropdownClick($event)\"\n >\n <ui-icon [name]=\"dropdownIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n </ui-field>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"panelOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\"\n (overlayOutsideClick)=\"close(false)\"\n (detach)=\"close(false)\"\n>\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n</ng-template>\n", styles: [".ui-autocomplete{display:block;--ui-field-box-cursor: text}.ui-autocomplete-control{display:flex;align-items:center;align-self:stretch;flex:1 1 auto;flex-wrap:wrap;gap:var(--ui-autocomplete-tag-gap, var(--units-xs));min-width:0}.ui-autocomplete-control:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-tag{display:inline-flex;align-items:center;max-width:100%;border-radius:var(--ui-autocomplete-tag-radius, var(--radius-full));transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-tag:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-input{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-autocomplete-input::placeholder{color:var(--form-low-content-default);opacity:1}.ui-autocomplete-input:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-input{flex:1 1 var(--ui-autocomplete-input-min-width, 5rem);min-width:var(--ui-autocomplete-input-min-width, 5rem);width:auto}.ui-autocomplete-input._small{font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-clear{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-autocomplete-clear-size, var(--size-components-2xs));height:var(--ui-autocomplete-clear-size, var(--size-components-2xs));flex-shrink:0;margin:0;padding:0;border:none;border-radius:var(--ui-autocomplete-clear-radius, var(--radius-full));background:none;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-clear:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-clear:focus-visible{outline:none;color:var(--form-high-content-focused);box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-clear:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{flex-shrink:0;color:var(--form-low-content-default)}.ui-autocomplete-dropdown:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown._disabled{color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{transition:rotate var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms);margin:0;padding:0;border:none;background:none;color:var(--form-low-content-default);cursor:pointer}.ui-autocomplete-dropdown:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-dropdown._open{rotate:180deg}.ui-autocomplete-dropdown:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-loading{flex-shrink:0}.ui-autocomplete-loading:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-loading:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-panel{border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, var(--form-high-stroke-default));border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--form-high-surface-default));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--fontfamily-base);display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));box-sizing:border-box;max-width:var(--ui-autocomplete-panel-max-width, calc(100vw - var(--units-lg)));padding:var(--ui-autocomplete-panel-padding, var(--units-xs))}.ui-autocomplete-panel .ui-autocomplete-header,.ui-autocomplete-panel .ui-autocomplete-footer{padding:var(--ui-autocomplete-header-padding-y, var(--units-xs)) var(--ui-autocomplete-header-padding-x, var(--units-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));color:var(--form-high-content-default)}.ui-autocomplete-panel .ui-autocomplete-scroller{overflow:auto;max-height:var(--ui-autocomplete-scroller-max-height, 19.5rem)}.ui-autocomplete-panel .ui-autocomplete-scroller._small{max-height:var(--ui-autocomplete-scroller-max-height-small, 16rem)}.ui-autocomplete-panel .ui-autocomplete-viewport{width:100%}.ui-autocomplete-panel .ui-autocomplete-list{display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));margin:0;padding:0;list-style:none}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-list{gap:0}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group{height:var(--ui-autocomplete-option-height, 2.5rem)}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group._small{height:var(--ui-autocomplete-option-height-small, 2rem)}.ui-autocomplete-panel .ui-autocomplete-option{display:flex;align-items:center;gap:var(--ui-autocomplete-option-gap, var(--units-sm));box-sizing:border-box;height:var(--ui-autocomplete-option-height, 2.5rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));border-radius:var(--ui-autocomplete-option-radius, var(--radius-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-high-content-default);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-panel .ui-autocomplete-option._small{height:var(--ui-autocomplete-option-height-small, 2rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-panel .ui-autocomplete-option._focused,.ui-autocomplete-panel .ui-autocomplete-option:hover:not(._disabled){background-color:var(--global-background-default-hover)}.ui-autocomplete-panel .ui-autocomplete-option._selected{background-color:var(--form-high-surface-hover);color:var(--form-high-content-checked)}.ui-autocomplete-panel .ui-autocomplete-option._disabled{color:var(--form-high-content-disabled);cursor:not-allowed}.ui-autocomplete-panel .ui-autocomplete-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-autocomplete-panel .ui-autocomplete-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ui-autocomplete-group-height, 2rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));font-weight:var(--weight-bold);color:var(--form-low-content-default)}.ui-autocomplete-panel .ui-autocomplete-group._small{height:var(--ui-autocomplete-group-height-small, 1.5rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-group-font-size-small, var(--size-typography-text-sm))}.ui-autocomplete-panel .ui-autocomplete-empty{display:flex;align-items:center;box-sizing:border-box;min-height:var(--ui-autocomplete-option-height, 2.5rem);padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-low-content-default)}\n"] }]
|
|
940
|
+
], template: "<!-- One rendered row: group header or suggestion (shared by the plain and virtual lists). -->\n<ng-template #rowTpl let-row>\n @if (row.kind === 'group') {\n <li class=\"ui-autocomplete-group\" role=\"presentation\" [class._small]=\"size() === 'small'\">\n @if (groupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row.original, group: row.original }\"\n />\n } @else {\n {{ row.label }}\n }\n </li>\n } @else {\n <!-- ARIA combobox/listbox pattern: keyboard and focus are handled by\n the input role=\"combobox\" (roving via aria-activedescendant). -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n class=\"ui-autocomplete-option\"\n role=\"option\"\n [attr.id]=\"row.id\"\n [class._small]=\"size() === 'small'\"\n [class._selected]=\"row.selected\"\n [class._focused]=\"row.index === focusedIndex()\"\n [class._disabled]=\"row.entry.disabled\"\n [attr.aria-selected]=\"row.selected\"\n [attr.aria-disabled]=\"row.entry.disabled || null\"\n [attr.aria-setsize]=\"optionCount()\"\n [attr.aria-posinset]=\"row.index + 1\"\n (mousedown)=\"onOptionMousedown($event)\"\n (click)=\"onOptionClick(row, $event)\"\n (mouseenter)=\"onOptionMouseEnter(row)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.entry.original,\n option: row.entry.original,\n selected: row.selected,\n index: row.index,\n }\"\n />\n } @else {\n <span class=\"ui-autocomplete-option-label\">{{ row.entry.label }}</span>\n }\n </li>\n }\n</ng-template>\n\n<!-- Suggestions panel (CDK overlay). -->\n<ng-template #panelTpl>\n <div\n #panel\n class=\"ui-autocomplete-panel\"\n [class]=\"panelStyleClass()\"\n [class._small]=\"size() === 'small'\"\n [style.width.px]=\"overlayWidth()\"\n [uiMotion]=\"'slide-down'\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n >\n @if (headerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-header\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (virtualScroll()) {\n <cdk-virtual-scroll-viewport\n class=\"ui-autocomplete-viewport\"\n [itemSize]=\"virtualScrollItemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n <ng-container *cdkVirtualFor=\"let row of visibleRows(); trackBy: trackRow\">\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n </ng-container>\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div\n class=\"ui-autocomplete-scroller\"\n [class._small]=\"size() === 'small'\"\n [style.max-height]=\"scrollHeight() || null\"\n >\n <ul\n class=\"ui-autocomplete-list\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.id]=\"listboxId()\"\n [attr.aria-label]=\"label() || ariaLabel() || null\"\n >\n @for (row of visibleRows(); track row.key) {\n <ng-container\n [ngTemplateOutlet]=\"rowTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\n />\n }\n @if (showEmpty()) {\n <ng-container [ngTemplateOutlet]=\"emptyTpl\" />\n }\n </ul>\n </div>\n }\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-autocomplete-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n </div>\n</ng-template>\n\n<!-- Empty state row. -->\n<ng-template #emptyTpl>\n <li class=\"ui-autocomplete-empty\" role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ emptyMessage() }}\n }\n </li>\n</ng-template>\n\n<!-- Trigger: composed field around a native combobox input. -->\n<div #container class=\"ui-autocomplete\">\n <ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [autoHeight]=\"multiple()\"\n >\n <div\n class=\"ui-autocomplete-control\"\n (mousedown)=\"onBoxMousedown($event)\"\n >\n @if (multiple()) {\n @if (selectedItemTemplate(); as tpl) {\n @for (ctx of selectedItemContexts(); track $index) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"ctx\" />\n }\n } @else {\n <!-- The listbox wraps ONLY the option tags: it may contain neither the combobox input\n nor the informative overflow chip. `display: contents` keeps the tags flowing in\n the box exactly as before. -->\n <div\n class=\"ui-autocomplete-tags\"\n role=\"listbox\"\n aria-orientation=\"horizontal\"\n [attr.aria-label]=\"ariaLabelledBy() ? null : ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n >\n @for (tag of visibleTagRows(); track $index) {\n <ui-chip\n #tagEl\n class=\"ui-autocomplete-tag\"\n role=\"option\"\n aria-selected=\"true\"\n [attr.aria-label]=\"tag.label\"\n [label]=\"tag.label\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n [removable]=\"canRemove()\"\n [removeTabindex]=\"-1\"\n [removeAriaLabel]=\"tag.removeAriaLabel\"\n [attr.aria-setsize]=\"tagRows().length\"\n [attr.aria-posinset]=\"tag.index + 1\"\n [attr.tabindex]=\"isDisabled() ? null : focusedTag() === tag.index ? 0 : -1\"\n (keydown)=\"onTagKeydown($event, tag.index)\"\n (focus)=\"focusedTag.set(tag.index)\"\n (remove)=\"removeAt(tag.index)\"\n />\n }\n </div>\n }\n @if (overflowCount() > 0) {\n <!-- Collapsed remainder (`maxSelectedLabels`): informative only, not removable. -->\n <ui-chip\n class=\"ui-autocomplete-tag _overflow\"\n role=\"presentation\"\n [label]=\"overflowText()\"\n size=\"small\"\n [disabled]=\"isDisabled()\"\n />\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n class=\"ui-autocomplete-input\"\n [class._small]=\"size() === 'small'\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [id]=\"resolvedId()\"\n [value]=\"inputText()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n />\n </div>\n\n @if (showClearButton()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-clear\"\n [attr.aria-label]=\"clearAriaLabel()\"\n (click)=\"onClearClick($event)\"\n >\n <ui-icon name=\"xmark\" [size]=\"iconSize()\" />\n </button>\n }\n\n @if (loading()) {\n <ui-spinner\n uiFieldSuffix\n class=\"ui-autocomplete-loading\"\n size=\"small\"\n orientation=\"horizontal\"\n ariaLabel=\"Recherche en cours\"\n />\n } @else if (dropdown()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-autocomplete-dropdown\"\n [class._open]=\"panelOpen()\"\n [disabled]=\"isDisabled()\"\n tabindex=\"-1\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"panelOpen()\"\n [attr.aria-controls]=\"panelOpen() ? listboxId() : null\"\n [attr.aria-label]=\"dropdownAriaLabel()\"\n (click)=\"onDropdownClick($event)\"\n >\n <ui-icon [name]=\"dropdownIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n </ui-field>\n</div>\n\n<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"panelOpen()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\"\n (overlayOutsideClick)=\"close(false)\"\n (detach)=\"close(false)\"\n>\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\n</ng-template>\n", styles: [".ui-autocomplete{display:block;--ui-field-box-cursor: text}.ui-autocomplete-control{display:flex;align-items:center;align-self:stretch;flex:1 1 auto;flex-wrap:wrap;gap:var(--ui-autocomplete-tag-gap, var(--units-xs));min-width:0}.ui-autocomplete-control:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-control{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-autocomplete-tags{display:contents}.ui-autocomplete-tag{display:inline-flex;align-items:center;max-width:100%;border-radius:var(--ui-autocomplete-tag-radius, var(--radius-full));transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-tag:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-input{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-autocomplete-input::placeholder{color:var(--form-low-content-default);opacity:1}.ui-autocomplete-input:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-input{flex:1 1 var(--ui-autocomplete-input-min-width, 5rem);min-width:var(--ui-autocomplete-input-min-width, 5rem);width:auto}.ui-autocomplete-input._small{font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-clear{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--ui-autocomplete-clear-size, var(--size-components-2xs));height:var(--ui-autocomplete-clear-size, var(--size-components-2xs));flex-shrink:0;margin:0;padding:0;border:none;border-radius:var(--ui-autocomplete-clear-radius, var(--radius-full));background:none;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-clear:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-clear:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-clear:focus-visible{outline:none;color:var(--form-high-content-focused);box-shadow:0 0 0 var(--ui-autocomplete-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--form-high-stroke-focused) r g b/50%)}.ui-autocomplete-clear:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{flex-shrink:0;color:var(--form-low-content-default)}.ui-autocomplete-dropdown:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-dropdown._disabled{color:var(--form-high-content-disabled)}.ui-autocomplete-dropdown{transition:rotate var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms);margin:0;padding:0;border:none;background:none;color:var(--form-low-content-default);cursor:pointer}.ui-autocomplete-dropdown:hover:not(:disabled){color:var(--form-high-content-hover)}.ui-autocomplete-dropdown._open{rotate:180deg}.ui-autocomplete-dropdown:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-autocomplete-loading{flex-shrink:0}.ui-autocomplete-loading:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-loading:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-autocomplete-panel{border:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-overlay-stroke, var(--form-high-stroke-default));border-radius:var(--ui-overlay-radius, var(--ui-overlay-panel-radius, var(--radius-default)));background-color:var(--ui-overlay-surface, var(--form-high-surface-default));box-shadow:var(--ui-overlay-shadow, var(--ui-overlay-panel-shadow, var(--shadow-default-md)));font-family:var(--fontfamily-base);display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));box-sizing:border-box;max-width:var(--ui-autocomplete-panel-max-width, calc(100vw - var(--units-lg)));padding:var(--ui-autocomplete-panel-padding, var(--units-xs))}.ui-autocomplete-panel .ui-autocomplete-header,.ui-autocomplete-panel .ui-autocomplete-footer{padding:var(--ui-autocomplete-header-padding-y, var(--units-xs)) var(--ui-autocomplete-header-padding-x, var(--units-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));color:var(--form-high-content-default)}.ui-autocomplete-panel .ui-autocomplete-scroller{overflow:auto;max-height:var(--ui-autocomplete-scroller-max-height, 19.5rem)}.ui-autocomplete-panel .ui-autocomplete-scroller._small{max-height:var(--ui-autocomplete-scroller-max-height-small, 16rem)}.ui-autocomplete-panel .ui-autocomplete-viewport{width:100%}.ui-autocomplete-panel .ui-autocomplete-list{display:flex;flex-direction:column;gap:var(--ui-autocomplete-panel-gap, var(--units-xs));margin:0;padding:0;list-style:none}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-list{gap:0}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group{height:var(--ui-autocomplete-option-height, 2.5rem)}.ui-autocomplete-panel .ui-autocomplete-viewport .ui-autocomplete-group._small{height:var(--ui-autocomplete-option-height-small, 2rem)}.ui-autocomplete-panel .ui-autocomplete-option{display:flex;align-items:center;gap:var(--ui-autocomplete-option-gap, var(--units-sm));box-sizing:border-box;height:var(--ui-autocomplete-option-height, 2.5rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));border-radius:var(--ui-autocomplete-option-radius, var(--radius-sm));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-high-content-default);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-autocomplete-panel .ui-autocomplete-option._small{height:var(--ui-autocomplete-option-height-small, 2rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-font-size-small, var(--size-typography-text-md))}.ui-autocomplete-panel .ui-autocomplete-option._focused,.ui-autocomplete-panel .ui-autocomplete-option:hover:not(._disabled){background-color:var(--global-background-default-hover)}.ui-autocomplete-panel .ui-autocomplete-option._selected{background-color:var(--form-high-surface-hover);color:var(--form-high-content-checked)}.ui-autocomplete-panel .ui-autocomplete-option._disabled{color:var(--form-high-content-disabled);cursor:not-allowed}.ui-autocomplete-panel .ui-autocomplete-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-autocomplete-panel .ui-autocomplete-group{display:flex;align-items:center;box-sizing:border-box;height:var(--ui-autocomplete-group-height, 2rem);flex-shrink:0;padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-group-font-size, var(--size-typography-text-md));font-weight:var(--weight-bold);color:var(--form-low-content-default)}.ui-autocomplete-panel .ui-autocomplete-group._small{height:var(--ui-autocomplete-group-height-small, 1.5rem);padding:0 var(--ui-autocomplete-option-padding-x-small, var(--units-md));font-size:var(--ui-autocomplete-group-font-size-small, var(--size-typography-text-sm))}.ui-autocomplete-panel .ui-autocomplete-empty{display:flex;align-items:center;box-sizing:border-box;min-height:var(--ui-autocomplete-option-height, 2.5rem);padding:0 var(--ui-autocomplete-option-padding-x, var(--units-default));font-family:var(--fontfamily-base);font-size:var(--ui-autocomplete-font-size, var(--size-typography-text-default));color:var(--form-low-content-default)}\n"] }]
|
|
935
941
|
}], ctorParameters: () => [], propDecorators: { suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], optionGroupLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupLabel", required: false }] }], optionGroupChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupChildren", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], completeOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "completeOnFocus", required: false }] }], dropdown: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdown", required: false }] }], dropdownMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownMode", required: false }] }], dropdownAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownAriaLabel", required: false }] }], dropdownIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownIcon", required: false }] }], forceSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceSelection", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], unique: [{ type: i0.Input, args: [{ isSignal: true, alias: "unique", required: false }] }], maxSelectedLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedLabels", required: false }] }], overflowLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "overflowLabel", required: false }] }], removeTagLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeTagLabel", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], showEmptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEmptyMessage", required: false }] }], autoOptionFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoOptionFocus", required: false }] }], selectOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnFocus", required: false }] }], focusOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnHover", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollItemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollItemSize", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], autoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFlip", required: false }] }], panelStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelStyleClass", required: false }] }], completeMethod: [{ type: i0.Output, args: ["completeMethod"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], optionSelect: [{ type: i0.Output, args: ["optionSelect"] }], optionUnselect: [{ type: i0.Output, args: ["optionUnselect"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], cleared: [{ type: i0.Output, args: ["cleared"] }], dropdownClick: [{ type: i0.Output, args: ["dropdownClick"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], itemTemplate: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], selectedItemTemplate: [{ type: i0.ContentChild, args: ['selectedItem', { isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: ['group', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], containerEl: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], panelEl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], viewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], tagEls: [{ type: i0.ViewChildren, args: ['tagEl', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
936
942
|
|
|
937
943
|
/*
|