@scion/components 22.3.0 → 22.5.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/_index.scss +37 -18
- package/design/icons/_scion-icon-font.scss +2 -2
- package/fesm2022/scion-components-common.mjs +48 -2
- package/fesm2022/scion-components-common.mjs.map +1 -1
- package/fesm2022/scion-components-icon.mjs +3 -56
- package/fesm2022/scion-components-icon.mjs.map +1 -1
- package/fesm2022/scion-components-menu.mjs +4 -4
- package/fesm2022/scion-components-menu.mjs.map +1 -1
- package/fesm2022/scion-components-splitter.mjs +1 -1
- package/fesm2022/scion-components-splitter.mjs.map +1 -1
- package/fesm2022/scion-components-table.mjs +513 -232
- package/fesm2022/scion-components-table.mjs.map +1 -1
- package/package.json +3 -3
- package/types/scion-components-common.d.ts +36 -2
- package/types/scion-components-icon.d.ts +3 -56
- package/types/scion-components-table.d.ts +457 -117
package/_index.scss
CHANGED
|
@@ -89,61 +89,80 @@
|
|
|
89
89
|
* ## SCION Icon Font
|
|
90
90
|
* This module provides the standard icon font used by SCION components.
|
|
91
91
|
*
|
|
92
|
-
* By default, SCION icons are loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/
|
|
92
|
+
* By default, SCION icons are loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/icons.
|
|
93
93
|
*
|
|
94
94
|
* ### Content Security Policy (CSP)
|
|
95
95
|
* Applications enforcing a Content Security Policy must whitelist the CDN using the `font-src` directive.
|
|
96
96
|
*
|
|
97
97
|
* ```
|
|
98
|
-
* Content-Security-Policy: font-src 'self' https://cdn.jsdelivr.net/npm/@scion/
|
|
98
|
+
* Content-Security-Policy: font-src 'self' https://cdn.jsdelivr.net/npm/@scion/icons/;
|
|
99
99
|
* ```
|
|
100
100
|
*
|
|
101
101
|
* ### Self-Hosting the SCION Icon Font
|
|
102
|
-
* As an alternative to loading SCION icons from the CDN,
|
|
102
|
+
* As an alternative to loading SCION icons from the CDN, you can host the SCION icon font directly within your application.
|
|
103
103
|
*
|
|
104
|
-
* To host the icon font
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
104
|
+
* To self-host the SCION icon font:
|
|
105
|
+
*
|
|
106
|
+
* 1. Install the `@scion/icons` NPM module:
|
|
107
|
+
* ```
|
|
108
|
+
* npm install @scion/icons
|
|
109
|
+
* ```
|
|
110
|
+
* 2. Register the icon font files in `assets` in `angular.json`.
|
|
111
|
+
* ```
|
|
112
|
+
* "assets": [
|
|
113
|
+
* {
|
|
114
|
+
* "glob": "**\/*",
|
|
115
|
+
* "input": "node_modules/@scion/icons",
|
|
116
|
+
* "output": "/scion-icons"
|
|
117
|
+
* }
|
|
118
|
+
* ]
|
|
119
|
+
* ```
|
|
120
|
+
* 3. Configure `@scion/components` SCSS module to load the icon font from `/scion-icons` (leading slash required):
|
|
108
121
|
* ```scss
|
|
109
122
|
* @use '@scion/components' with (
|
|
110
123
|
* $icon-font: (
|
|
111
|
-
* directory: '/scion-icons'
|
|
124
|
+
* directory: '/scion-icons'
|
|
112
125
|
* )
|
|
113
126
|
* );
|
|
114
127
|
* ```
|
|
115
128
|
*
|
|
129
|
+
* As an alternative to steps 1 and 2, you can manually download the icon font files from the CDN and place them directly into your application's public assets folder (`public/scion-icons/`):
|
|
130
|
+
* - https://cdn.jsdelivr.net/npm/@scion/icons/scion-icons.ttf
|
|
131
|
+
* - https://cdn.jsdelivr.net/npm/@scion/icons/scion-icons.svg
|
|
132
|
+
* - https://cdn.jsdelivr.net/npm/@scion/icons/scion-icons.woff
|
|
133
|
+
*
|
|
116
134
|
* ### Loading Self-Hosted Icon Font Relative to Document Base
|
|
117
|
-
* Applications deployed in a subdirectory must configure the `@scion/components` SCSS module to load the self-hosted icon font relative to the document base URL (defined by the `<base>` HTML tag)
|
|
118
|
-
* and exclude the font files from the application build.
|
|
135
|
+
* Applications deployed in a subdirectory must configure the `@scion/components` SCSS module to load the self-hosted icon font relative to the document base URL (defined by the `<base>` HTML tag) and exclude the icon font files from the application build.
|
|
119
136
|
*
|
|
120
137
|
* Different steps are required depending on whether building the application with esbuild or Webpack.
|
|
121
138
|
*
|
|
122
139
|
* **Using `@angular/build:application` (esbuild, default since Angular 20)**
|
|
123
140
|
*
|
|
124
|
-
* 1.
|
|
141
|
+
* 1. Configure `@scion/components` SCSS module to load the icon font from `scion-icons` (no leading slash to be relative to the document base URL):
|
|
125
142
|
* ```scss
|
|
126
143
|
* @use '@scion/components' with (
|
|
127
144
|
* $icon-font: (
|
|
128
|
-
* directory: 'scion-icons'
|
|
145
|
+
* directory: 'scion-icons'
|
|
129
146
|
* )
|
|
130
147
|
* );
|
|
131
148
|
* ```
|
|
132
|
-
* 2. Exclude the font files from the application build via `externalDependencies` in `angular.json`:
|
|
133
|
-
* ```
|
|
149
|
+
* 2. Exclude the icon font files from the application build via `externalDependencies` in `angular.json`:
|
|
150
|
+
* ```
|
|
134
151
|
* "externalDependencies": [
|
|
135
|
-
* "scion-icons
|
|
152
|
+
* "scion-icons/*"
|
|
136
153
|
* ]
|
|
137
154
|
* ```
|
|
138
155
|
*
|
|
139
|
-
* **Using `@angular-devkit/build-angular:browser` (Webpack)**
|
|
156
|
+
* **Using `@angular-devkit/build-angular:browser` (Webpack, deprecated since Angular 22)**
|
|
157
|
+
*
|
|
158
|
+
* Configure `@scion/components` SCSS module to load the icon font from `^scion-icons` (no leading slash to be relative to the document base URL):
|
|
140
159
|
*
|
|
141
|
-
*
|
|
160
|
+
* The leading caret (`^`) instructs Webpack to exclude the icon font files from the application build.
|
|
142
161
|
*
|
|
143
162
|
* ```scss
|
|
144
163
|
* @use '@scion/components' with (
|
|
145
164
|
* $icon-font: (
|
|
146
|
-
* directory: '^scion-icons'
|
|
165
|
+
* directory: '^scion-icons'
|
|
147
166
|
* )
|
|
148
167
|
* );
|
|
149
168
|
* ```
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
$-version: 1;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* By default, the icon font is loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/
|
|
17
|
+
* By default, the icon font is loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/icons
|
|
18
18
|
*/
|
|
19
19
|
$-icon-font-defaults: (
|
|
20
20
|
// NOTE: If self-hosting SCION icons, the font path must be "root-relative" or excluded from the application build.
|
|
21
21
|
// Otherwise, the build fails because the builder cannot resolve the font files relative to "this" SASS file.
|
|
22
22
|
// For esbuild, register excluded assets as `externalDependencies` in angular.json.
|
|
23
23
|
// For webpack, exclude assets by prefixing their path with a leading caret (^).
|
|
24
|
-
directory: 'https://cdn.jsdelivr.net/npm/@scion/
|
|
24
|
+
directory: 'https://cdn.jsdelivr.net/npm/@scion/icons',
|
|
25
25
|
filename: 'scion-icons',
|
|
26
26
|
version: $-version,
|
|
27
27
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { isSignal, signal, inject, Injector, effect, untracked, DestroyRef, assertInInjectionContext as assertInInjectionContext$1, input, ElementRef, IterableDiffers, Renderer2, Directive, ViewContainerRef, inputBinding } from '@angular/core';
|
|
2
|
+
import { isSignal, signal, inject, Injector, effect, untracked, DestroyRef, assertInInjectionContext as assertInInjectionContext$1, input, ElementRef, IterableDiffers, Renderer2, Directive, ViewContainerRef, inputBinding, InjectionToken, LOCALE_ID } from '@angular/core';
|
|
3
3
|
import { of, Observable } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -228,6 +228,52 @@ function createComponent(viewContainerRef, descriptor) {
|
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/*
|
|
232
|
+
* Copyright (c) 2018-2026 Swiss Federal Railways
|
|
233
|
+
*
|
|
234
|
+
* This program and the accompanying materials are made
|
|
235
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
236
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
237
|
+
*
|
|
238
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
239
|
+
*/
|
|
240
|
+
/**
|
|
241
|
+
* DI token providing the current locale to SCION components for localizing dates and numbers.
|
|
242
|
+
*
|
|
243
|
+
* Defaults to {@link LOCALE_ID}. Changing the locale updates formatting in SCION components, unless overridden at the component level.
|
|
244
|
+
*
|
|
245
|
+
* Change the locale at runtime as follows:
|
|
246
|
+
* ```ts
|
|
247
|
+
* inject(SCI_LOCALE).set('de-CH');
|
|
248
|
+
* ```
|
|
249
|
+
*
|
|
250
|
+
* Angular includes only `en-US` by default. Register other locales via `registerLocaleData()`, typically in an environment initializer at app startup:
|
|
251
|
+
*
|
|
252
|
+
* ```ts
|
|
253
|
+
* import {bootstrapApplication} from '@angular/platform-browser';
|
|
254
|
+
* import {provideEnvironmentInitializer} from '@angular/core';
|
|
255
|
+
* import {registerLocaleData} from '@angular/common';
|
|
256
|
+
*
|
|
257
|
+
* import localeDeCH from '@angular/common/locales/de-CH';
|
|
258
|
+
* import localeFrCH from '@angular/common/locales/fr-CH';
|
|
259
|
+
* import localeItCH from '@angular/common/locales/it-CH';
|
|
260
|
+
*
|
|
261
|
+
* bootstrapApplication(AppComponent, {
|
|
262
|
+
* providers: [
|
|
263
|
+
* provideEnvironmentInitializer(() => {
|
|
264
|
+
* registerLocaleData(localeDeCH);
|
|
265
|
+
* registerLocaleData(localeFrCH);
|
|
266
|
+
* registerLocaleData(localeItCH);
|
|
267
|
+
* }),
|
|
268
|
+
* ],
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
const SCI_LOCALE = new InjectionToken('SCI_LOCALE', {
|
|
273
|
+
providedIn: 'root',
|
|
274
|
+
factory: () => signal(inject(LOCALE_ID)),
|
|
275
|
+
});
|
|
276
|
+
|
|
231
277
|
/*
|
|
232
278
|
* Copyright (c) 2018-2026 Swiss Federal Railways
|
|
233
279
|
*
|
|
@@ -247,5 +293,5 @@ function createComponent(viewContainerRef, descriptor) {
|
|
|
247
293
|
* Generated bundle index. Do not edit.
|
|
248
294
|
*/
|
|
249
295
|
|
|
250
|
-
export { SciAttributesDirective, SciComponentOutletDirective, assertInInjectionContext, coerceSignal, createDestroyableInjector, toLazyObservable };
|
|
296
|
+
export { SCI_LOCALE, SciAttributesDirective, SciComponentOutletDirective, assertInInjectionContext, coerceSignal, createDestroyableInjector, toLazyObservable };
|
|
251
297
|
//# sourceMappingURL=scion-components-common.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-common.mjs","sources":["../../../../projects/scion/components/common/src/signal.util.ts","../../../../projects/scion/components/common/src/injector.util.ts","../../../../projects/scion/components/common/src/attributes.directive.ts","../../../../projects/scion/components/common/src/component-outlet.directive.ts","../../../../projects/scion/components/common/src/public_api.ts","../../../../projects/scion/components/common/src/scion-components-common.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {effect, inject, Injector, isSignal, signal, Signal, untracked} from '@angular/core';\nimport {Observable, of} from 'rxjs';\n\n/**\n * Represents a value or a {@link Signal} of that value.\n */\nexport type MaybeSignal<T> = T | Signal<T>;\n\n/**\n * Coerces the given value into a {@link Signal}. If the value is already a signal, it is returned as-is; otherwise, it is wrapped in a signal.\n *\n * Passing `undefined` returns `undefined`, unless the option `coerceUndefined` is set to `true`.\n *\n * @param value - Specifies the value to coerece.\n */\nexport function coerceSignal<T extends MaybeSignal<unknown>>(value: T): T extends Signal<unknown> ? T : T extends undefined ? undefined : Signal<T>;\n/**\n * Coerces the given value into a {@link Signal}. If the value is already a signal, it is returned as-is; otherwise, it is wrapped in a signal.\n *\n * @param value - Specifies the value to coerece.\n * @param options - Controls coercion.\n * @param options.coerceUndefined - If `true`, returns `signal(undefined)` for a `undefined` value. Defaults to `false`.\n */\nexport function coerceSignal<T>(value: MaybeSignal<T> | undefined, options: {coerceUndefined: true}): Signal<T | undefined>;\n\nexport function coerceSignal<T>(value: MaybeSignal<T>, options?: {coerceUndefined?: true}): Signal<T> | undefined {\n if (value === undefined && !options?.coerceUndefined) {\n return undefined;\n }\n return isSignal(value) ? value : signal(value);\n}\n\n/**\n * Like {@link toObservable}, but lazily creates the effect upon subscription, binding it to the subscription lifecycle instead of the injection context, plus, emits the signal's initial value synchronously.\n */\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>>, options?: {injector?: Injector}): Observable<NonNullable<T>>;\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>> | undefined, options?: {injector?: Injector}): Observable<NonNullable<T>> | undefined;\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>> | undefined, options?: {injector?: Injector}): Observable<NonNullable<T>> | undefined {\n if (signal === undefined) {\n return undefined;\n }\n if (!isSignal(signal)) {\n return of(signal);\n }\n\n const injector = options?.injector ?? inject(Injector);\n return new Observable(observer => {\n const initialValue = signal();\n let isFirstEffectRun = true;\n\n // Emit initial value synchronously.\n observer.next(initialValue);\n\n const effectRef = effect(() => {\n const value = signal();\n\n untracked(() => {\n if (!isFirstEffectRun || initialValue !== value) {\n observer.next(value);\n }\n isFirstEffectRun = false;\n });\n }, {injector, manualCleanup: true});\n\n return () => effectRef.destroy();\n });\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertInInjectionContext as ngAssertInInjectionContext, DestroyableInjector, DestroyRef, inject, Injector, Provider} from '@angular/core';\n\n/**\n * Creates a {@link DestroyableInjector} bound to the lifecycle of its parent injector. Defaults to the current injector if not configuring a parent injector.\n *\n * Unlike injectors created via {@link Injector.create}, the returned injector:\n * - Is destroyed with its parent, also if used outside a component injection context.\n * - Does not throw an error when invoking {@link DestroyableInjector.destroy} if already destroyed.\n * - Uses the current injection context as parent if no explicit parent injector is specified.\n *\n * @docs-private Not public API. For internal use only.\n *\n * @param options - Configures the injector.\n * @param options.parent - Specifies the parent injector. Defaults to the current injector.\n * @param options.providers - Specifies providers to associate with the injector.\n * @param options.name - Names the injector, useful for debugging the injector hierarchy.\n */\nexport function createDestroyableInjector(options?: {parent?: Injector; providers?: Provider[]; name?: string}): DestroyableInjector {\n const parentInjector = options?.parent ?? inject(Injector);\n const injector = Injector.create({parent: parentInjector, providers: options?.providers ?? [], name: options?.name});\n\n // Destroy injector manually since not destroyed when the parent injector is destroyed.\n // Angular only destroys child injectors in the scope of a component injector.\n parentInjector.get(DestroyRef).onDestroy(() => injector.destroy());\n\n // Patch `Injector.destroy` to not error if already destroyed.\n const realDestroyFn = injector.destroy;\n const destroyRef = injector.get(DestroyRef);\n injector.destroy = () => !destroyRef.destroyed && realDestroyFn.apply(injector);\n return injector;\n}\n\n/**\n * Asserts that the current stack frame is within an injection context and has access to inject.\n *\n * Delegates to `assertInInjectionContext` from @angular/core, adding the given message to the error if the assertion fails.\n *\n * @docs-private Not public API. For internal use only.\n */\nexport function assertInInjectionContext(debugFn: Function, message: string): void { // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n try {\n ngAssertInInjectionContext(debugFn);\n }\n catch {\n throw Error([`${debugFn.name}() can only be used within an injection context.`].concat(message ? message : []).join(' '));\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, IterableDiffers, Renderer2, untracked} from '@angular/core';\n\n/**\n * Use to add specified attributes to the host element.\n */\n@Directive({selector: '[sciAttributes]'})\nexport class SciAttributesDirective {\n\n /**\n * Specifies attributes to add to the host element.\n *\n * Attributes with `null` or `undefined` values are removed.\n */\n public readonly attributes = input<{[name: string]: unknown | undefined | null} | undefined | null>(undefined, {alias: 'sciAttributes'});\n\n constructor() {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n const attributeDiffer = inject(IterableDiffers).find([]).create<string>();\n const renderer = inject(Renderer2);\n\n effect(() => {\n const attributes = this.attributes() ?? {};\n\n untracked(() => {\n // Delete removed attributes.\n const diff = attributeDiffer.diff(Object.keys(attributes));\n diff?.forEachRemovedItem(({item: name}) => renderer.removeAttribute(host, name));\n\n // Update added or changed attributes.\n Object.entries(attributes).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n renderer.setAttribute(host, key, `${value}`);\n }\n else {\n renderer.removeAttribute(host, key);\n }\n });\n });\n });\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Binding, ComponentRef, Directive, effect, inject, Injector, input, inputBinding, Provider, Type, untracked, ViewContainerRef} from '@angular/core';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {SciAttributesDirective} from './attributes.directive';\nimport {coerceSignal, MaybeSignal} from './signal.util';\n\n/**\n * Renders a component based on a descriptor, similar to `ngComponentOutlet`, but with input bindings.\n *\n * Usage:\n *\n * ```html\n * <ng-container *sciComponentOutlet=\"descriptor\"/>\n * ````\n *\n * ```ts\n * protected readonly descriptor: SciComponentDescriptor = {\n * component: FilterComponent,\n * bindings: [\n * inputBinding('placeholder', signal('Filter items...')),\n * ],\n * };\n * ```\n */\n@Directive({selector: 'ng-template[sciComponentOutlet]'})\nexport class SciComponentOutletDirective {\n\n /**\n * Specifies the component to render.\n */\n public readonly descriptor = input.required<SciComponentDescriptor | undefined | null>({alias: 'sciComponentOutlet'});\n\n constructor() {\n const viewContainerRef = inject(ViewContainerRef);\n\n effect(onCleanup => {\n const descriptor = this.descriptor();\n\n untracked(() => {\n const component = descriptor && createComponent(viewContainerRef, descriptor);\n onCleanup(() => component?.destroy());\n });\n });\n }\n}\n\n/**\n * Instantiates the specified component and inserts it after the specified view container.\n */\nfunction createComponent(viewContainerRef: ViewContainerRef, descriptor: SciComponentDescriptor): ComponentRef<unknown> {\n // Provide providers via host directive.\n @Directive({providers: descriptor.providers ?? []})\n class ProvidersDirective {\n }\n\n // Provide CSS classes via host directive.\n @Directive({host: {'[class]': 'cssClass?.()'}})\n class CssClassDirective {\n protected readonly cssClass = coerceSignal(descriptor.cssClass);\n }\n\n return viewContainerRef.createComponent(descriptor.component, {\n directives: [\n ProvidersDirective,\n CssClassDirective,\n {type: SciAttributesDirective, bindings: [inputBinding('sciAttributes', coerceSignal(descriptor.attributes ?? {}))]},\n ...descriptor.directives ?? [],\n ],\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n });\n}\n\n/**\n * Describes the rendering of a component.\n */\nexport interface SciComponentDescriptor {\n /**\n * Specifies the component to render.\n */\n component: ComponentType<unknown>;\n /**\n * Specifies input and output bindings.\n *\n * @example - Passing inputs to the component\n * ```ts\n * bindings: [inputBinding('placeholder', signal('Filter items...'))];\n * ```\n *\n * Inputs are available as input properties in the component.\n *\n * @example - Reading inputs in the component\n * ```ts\n * public placeholder = input.required<string>();\n * ```\n *\n * @see inputBinding\n * @see outputBinding\n * @see twoWayBinding\n */\n bindings?: Binding[];\n /**\n * Specifies directives to be applied to the component.\n */\n directives?: Array<Type<unknown> | {type: Type<unknown>; bindings: Binding[]}>;\n /**\n * Specifies the injector used to instantiate the component, giving control over which objects are available for injection. Defaults to the element injector.\n *\n * ```ts\n * Injector.create({\n * parent: ...,\n * providers: [\n * {provide: <TOKEN>, useValue: <VALUE>}\n * ],\n * })\n * ```\n */\n injector?: Injector;\n /**\n * Specifies providers available for injection in the component.\n */\n providers?: Provider[];\n /**\n * Specifies CSS classes to associate with the component.\n */\n cssClass?: MaybeSignal<string | string[]>;\n /**\n * Specifies HTML attributes to associate with the component.\n *\n * Data attributes should start with the `data-` prefix.\n */\n attributes?: MaybeSignal<{[name: string]: string | undefined}>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/common'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {coerceSignal, type MaybeSignal, toLazyObservable} from './signal.util';\nexport {createDestroyableInjector, assertInInjectionContext} from './injector.util';\nexport {type SciComponentDescriptor, SciComponentOutletDirective} from './component-outlet.directive';\nexport {SciAttributesDirective} from './attributes.directive';\nexport {type SciTemplateDescriptor} from './template-descriptor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ngAssertInInjectionContext"],"mappings":";;;;AAAA;;;;;;;;AAQG;AA2BG,SAAU,YAAY,CAAI,KAAqB,EAAE,OAAkC,EAAA;IACvF,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE;AACpD,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAChD;AAOM,SAAU,gBAAgB,CAAI,MAA+C,EAAE,OAA+B,EAAA;AAClH,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACrB,QAAA,OAAO,EAAE,CAAC,MAAM,CAAC;IACnB;IAEA,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;AACtD,IAAA,OAAO,IAAI,UAAU,CAAC,QAAQ,IAAG;AAC/B,QAAA,MAAM,YAAY,G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,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;+FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;+FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;sBADtB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAC,IAAI,EAAE,EAAC,SAAS,EAAE,cAAc,EAAC,EAAC;;AAK9C,IAAA,OAAO,gBAAgB,CAAC,eAAe,CAAC,UAAU,CAAC,SAAS,EAAE;AAC5D,QAAA,UAAU,EAAE;YACV,kBAAkB;YAClB,iBAAiB;YACjB,EAAC,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,EAAC;AACpH,YAAA,GAAG,UAAU,CAAC,UAAU,IAAI,EAAE;AAC/B,SAAA;QACD,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC9B,KAAA,CAAC;AACH;;AChFD;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-common.mjs","sources":["../../../../projects/scion/components/common/src/signal.util.ts","../../../../projects/scion/components/common/src/injector.util.ts","../../../../projects/scion/components/common/src/attributes.directive.ts","../../../../projects/scion/components/common/src/component-outlet.directive.ts","../../../../projects/scion/components/common/src/locale.ts","../../../../projects/scion/components/common/src/public_api.ts","../../../../projects/scion/components/common/src/scion-components-common.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {effect, inject, Injector, isSignal, signal, Signal, untracked} from '@angular/core';\nimport {Observable, of} from 'rxjs';\n\n/**\n * Represents a value or a {@link Signal} of that value.\n */\nexport type MaybeSignal<T> = T | Signal<T>;\n\n/**\n * Coerces the given value into a {@link Signal}. If the value is already a signal, it is returned as-is; otherwise, it is wrapped in a signal.\n *\n * Passing `undefined` returns `undefined`, unless the option `coerceUndefined` is set to `true`.\n *\n * @param value - Specifies the value to coerece.\n */\nexport function coerceSignal<T extends MaybeSignal<unknown>>(value: T): T extends Signal<unknown> ? T : T extends undefined ? undefined : Signal<T>;\n/**\n * Coerces the given value into a {@link Signal}. If the value is already a signal, it is returned as-is; otherwise, it is wrapped in a signal.\n *\n * @param value - Specifies the value to coerece.\n * @param options - Controls coercion.\n * @param options.coerceUndefined - If `true`, returns `signal(undefined)` for a `undefined` value. Defaults to `false`.\n */\nexport function coerceSignal<T>(value: MaybeSignal<T> | undefined, options: {coerceUndefined: true}): Signal<T | undefined>;\n\nexport function coerceSignal<T>(value: MaybeSignal<T>, options?: {coerceUndefined?: true}): Signal<T> | undefined {\n if (value === undefined && !options?.coerceUndefined) {\n return undefined;\n }\n return isSignal(value) ? value : signal(value);\n}\n\n/**\n * Like {@link toObservable}, but lazily creates the effect upon subscription, binding it to the subscription lifecycle instead of the injection context, plus, emits the signal's initial value synchronously.\n */\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>>, options?: {injector?: Injector}): Observable<NonNullable<T>>;\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>> | undefined, options?: {injector?: Injector}): Observable<NonNullable<T>> | undefined;\nexport function toLazyObservable<T>(signal: MaybeSignal<NonNullable<T>> | undefined, options?: {injector?: Injector}): Observable<NonNullable<T>> | undefined {\n if (signal === undefined) {\n return undefined;\n }\n if (!isSignal(signal)) {\n return of(signal);\n }\n\n const injector = options?.injector ?? inject(Injector);\n return new Observable(observer => {\n const initialValue = signal();\n let isFirstEffectRun = true;\n\n // Emit initial value synchronously.\n observer.next(initialValue);\n\n const effectRef = effect(() => {\n const value = signal();\n\n untracked(() => {\n if (!isFirstEffectRun || initialValue !== value) {\n observer.next(value);\n }\n isFirstEffectRun = false;\n });\n }, {injector, manualCleanup: true});\n\n return () => effectRef.destroy();\n });\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {assertInInjectionContext as ngAssertInInjectionContext, DestroyableInjector, DestroyRef, inject, Injector, Provider} from '@angular/core';\n\n/**\n * Creates a {@link DestroyableInjector} bound to the lifecycle of its parent injector. Defaults to the current injector if not configuring a parent injector.\n *\n * Unlike injectors created via {@link Injector.create}, the returned injector:\n * - Is destroyed with its parent, also if used outside a component injection context.\n * - Does not throw an error when invoking {@link DestroyableInjector.destroy} if already destroyed.\n * - Uses the current injection context as parent if no explicit parent injector is specified.\n *\n * @docs-private Not public API. For internal use only.\n *\n * @param options - Configures the injector.\n * @param options.parent - Specifies the parent injector. Defaults to the current injector.\n * @param options.providers - Specifies providers to associate with the injector.\n * @param options.name - Names the injector, useful for debugging the injector hierarchy.\n */\nexport function createDestroyableInjector(options?: {parent?: Injector; providers?: Provider[]; name?: string}): DestroyableInjector {\n const parentInjector = options?.parent ?? inject(Injector);\n const injector = Injector.create({parent: parentInjector, providers: options?.providers ?? [], name: options?.name});\n\n // Destroy injector manually since not destroyed when the parent injector is destroyed.\n // Angular only destroys child injectors in the scope of a component injector.\n parentInjector.get(DestroyRef).onDestroy(() => injector.destroy());\n\n // Patch `Injector.destroy` to not error if already destroyed.\n const realDestroyFn = injector.destroy;\n const destroyRef = injector.get(DestroyRef);\n injector.destroy = () => !destroyRef.destroyed && realDestroyFn.apply(injector);\n return injector;\n}\n\n/**\n * Asserts that the current stack frame is within an injection context and has access to inject.\n *\n * Delegates to `assertInInjectionContext` from @angular/core, adding the given message to the error if the assertion fails.\n *\n * @docs-private Not public API. For internal use only.\n */\nexport function assertInInjectionContext(debugFn: Function, message: string): void { // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n try {\n ngAssertInInjectionContext(debugFn);\n }\n catch {\n throw Error([`${debugFn.name}() can only be used within an injection context.`].concat(message ? message : []).join(' '));\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, IterableDiffers, Renderer2, untracked} from '@angular/core';\n\n/**\n * Use to add specified attributes to the host element.\n */\n@Directive({selector: '[sciAttributes]'})\nexport class SciAttributesDirective {\n\n /**\n * Specifies attributes to add to the host element.\n *\n * Attributes with `null` or `undefined` values are removed.\n */\n public readonly attributes = input<{[name: string]: unknown | undefined | null} | undefined | null>(undefined, {alias: 'sciAttributes'});\n\n constructor() {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n const attributeDiffer = inject(IterableDiffers).find([]).create<string>();\n const renderer = inject(Renderer2);\n\n effect(() => {\n const attributes = this.attributes() ?? {};\n\n untracked(() => {\n // Delete removed attributes.\n const diff = attributeDiffer.diff(Object.keys(attributes));\n diff?.forEachRemovedItem(({item: name}) => renderer.removeAttribute(host, name));\n\n // Update added or changed attributes.\n Object.entries(attributes).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n renderer.setAttribute(host, key, `${value}`);\n }\n else {\n renderer.removeAttribute(host, key);\n }\n });\n });\n });\n }\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Binding, ComponentRef, Directive, effect, inject, Injector, input, inputBinding, Provider, Type, untracked, ViewContainerRef} from '@angular/core';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {SciAttributesDirective} from './attributes.directive';\nimport {coerceSignal, MaybeSignal} from './signal.util';\n\n/**\n * Renders a component based on a descriptor, similar to `ngComponentOutlet`, but with input bindings.\n *\n * Usage:\n *\n * ```html\n * <ng-container *sciComponentOutlet=\"descriptor\"/>\n * ````\n *\n * ```ts\n * protected readonly descriptor: SciComponentDescriptor = {\n * component: FilterComponent,\n * bindings: [\n * inputBinding('placeholder', signal('Filter items...')),\n * ],\n * };\n * ```\n */\n@Directive({selector: 'ng-template[sciComponentOutlet]'})\nexport class SciComponentOutletDirective {\n\n /**\n * Specifies the component to render.\n */\n public readonly descriptor = input.required<SciComponentDescriptor | undefined | null>({alias: 'sciComponentOutlet'});\n\n constructor() {\n const viewContainerRef = inject(ViewContainerRef);\n\n effect(onCleanup => {\n const descriptor = this.descriptor();\n\n untracked(() => {\n const component = descriptor && createComponent(viewContainerRef, descriptor);\n onCleanup(() => component?.destroy());\n });\n });\n }\n}\n\n/**\n * Instantiates the specified component and inserts it after the specified view container.\n */\nfunction createComponent(viewContainerRef: ViewContainerRef, descriptor: SciComponentDescriptor): ComponentRef<unknown> {\n // Provide providers via host directive.\n @Directive({providers: descriptor.providers ?? []})\n class ProvidersDirective {\n }\n\n // Provide CSS classes via host directive.\n @Directive({host: {'[class]': 'cssClass?.()'}})\n class CssClassDirective {\n protected readonly cssClass = coerceSignal(descriptor.cssClass);\n }\n\n return viewContainerRef.createComponent(descriptor.component, {\n directives: [\n ProvidersDirective,\n CssClassDirective,\n {type: SciAttributesDirective, bindings: [inputBinding('sciAttributes', coerceSignal(descriptor.attributes ?? {}))]},\n ...descriptor.directives ?? [],\n ],\n bindings: descriptor.bindings,\n injector: descriptor.injector,\n });\n}\n\n/**\n * Describes the rendering of a component.\n */\nexport interface SciComponentDescriptor {\n /**\n * Specifies the component to render.\n */\n component: ComponentType<unknown>;\n /**\n * Specifies input and output bindings.\n *\n * @example - Passing inputs to the component\n * ```ts\n * bindings: [inputBinding('placeholder', signal('Filter items...'))];\n * ```\n *\n * Inputs are available as input properties in the component.\n *\n * @example - Reading inputs in the component\n * ```ts\n * public placeholder = input.required<string>();\n * ```\n *\n * @see inputBinding\n * @see outputBinding\n * @see twoWayBinding\n */\n bindings?: Binding[];\n /**\n * Specifies directives to be applied to the component.\n */\n directives?: Array<Type<unknown> | {type: Type<unknown>; bindings: Binding[]}>;\n /**\n * Specifies the injector used to instantiate the component, giving control over which objects are available for injection. Defaults to the element injector.\n *\n * ```ts\n * Injector.create({\n * parent: ...,\n * providers: [\n * {provide: <TOKEN>, useValue: <VALUE>}\n * ],\n * })\n * ```\n */\n injector?: Injector;\n /**\n * Specifies providers available for injection in the component.\n */\n providers?: Provider[];\n /**\n * Specifies CSS classes to associate with the component.\n */\n cssClass?: MaybeSignal<string | string[]>;\n /**\n * Specifies HTML attributes to associate with the component.\n *\n * Data attributes should start with the `data-` prefix.\n */\n attributes?: MaybeSignal<{[name: string]: string | undefined}>;\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, InjectionToken, LOCALE_ID, signal, WritableSignal} from '@angular/core';\n\n/**\n * DI token providing the current locale to SCION components for localizing dates and numbers.\n *\n * Defaults to {@link LOCALE_ID}. Changing the locale updates formatting in SCION components, unless overridden at the component level.\n *\n * Change the locale at runtime as follows:\n * ```ts\n * inject(SCI_LOCALE).set('de-CH');\n * ```\n *\n * Angular includes only `en-US` by default. Register other locales via `registerLocaleData()`, typically in an environment initializer at app startup:\n *\n * ```ts\n * import {bootstrapApplication} from '@angular/platform-browser';\n * import {provideEnvironmentInitializer} from '@angular/core';\n * import {registerLocaleData} from '@angular/common';\n *\n * import localeDeCH from '@angular/common/locales/de-CH';\n * import localeFrCH from '@angular/common/locales/fr-CH';\n * import localeItCH from '@angular/common/locales/it-CH';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideEnvironmentInitializer(() => {\n * registerLocaleData(localeDeCH);\n * registerLocaleData(localeFrCH);\n * registerLocaleData(localeItCH);\n * }),\n * ],\n * });\n * ```\n */\nexport const SCI_LOCALE = new InjectionToken<WritableSignal<string>>('SCI_LOCALE', {\n providedIn: 'root',\n factory: () => signal(inject(LOCALE_ID)),\n});\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/common'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {coerceSignal, type MaybeSignal, toLazyObservable} from './signal.util';\nexport {createDestroyableInjector, assertInInjectionContext} from './injector.util';\nexport {type SciComponentDescriptor, SciComponentOutletDirective} from './component-outlet.directive';\nexport {SciAttributesDirective} from './attributes.directive';\nexport {type SciTemplateDescriptor} from './template-descriptor';\nexport {SCI_LOCALE} from './locale';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ngAssertInInjectionContext"],"mappings":";;;;AAAA;;;;;;;;AAQG;AA2BG,SAAU,YAAY,CAAI,KAAqB,EAAE,OAAkC,EAAA;IACvF,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE;AACpD,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAChD;AAOM,SAAU,gBAAgB,CAAI,MAA+C,EAAE,OAA+B,EAAA;AAClH,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,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AAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACzC,CAAA;;AC/CD;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;"}
|
|
@@ -103,7 +103,7 @@ class IconProviders {
|
|
|
103
103
|
_iconProviders = [
|
|
104
104
|
// Provide app-specific icons.
|
|
105
105
|
...inject(SCI_ICON_PROVIDER, { optional: true }) ?? [],
|
|
106
|
-
// Provide
|
|
106
|
+
// Provide SCION icons.
|
|
107
107
|
scionIconProvider,
|
|
108
108
|
// Provide material icons.
|
|
109
109
|
materialIconProvider,
|
|
@@ -286,61 +286,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
286
286
|
* @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..24,400,0&display=block');
|
|
287
287
|
* ```
|
|
288
288
|
*
|
|
289
|
-
* SCION
|
|
290
|
-
*
|
|
291
|
-
* - scion.add_large : Add an item (large)
|
|
292
|
-
* - scion.bin : Bin symbol
|
|
293
|
-
* - scion.checkmark : Indicates a selected option
|
|
294
|
-
* - scion.chevron_down : Chevron down symbol
|
|
295
|
-
* - scion.chevron_left : Chevron left symbol
|
|
296
|
-
* - scion.chevron_right : Chevron right symbol
|
|
297
|
-
* - scion.chevron_up : Chevron up symbol
|
|
298
|
-
* - scion.clear : Clear items
|
|
299
|
-
* - scion.close : Close a popover
|
|
300
|
-
* - scion.collapse_all : Collapse all items
|
|
301
|
-
* - scion.copy : Copy an item
|
|
302
|
-
* - scion.delete : Delete an item
|
|
303
|
-
* - scion.dirty : Indicates unsaved data
|
|
304
|
-
* - scion.drag_handle : Drag or move an item
|
|
305
|
-
* - scion.duplicate : Duplicate an item
|
|
306
|
-
* - scion.edit : Edit an item
|
|
307
|
-
* - scion.emdash : Em dash symbol
|
|
308
|
-
* - scion.envelope : Envelope symbol
|
|
309
|
-
* - scion.envelope_closed : Indicates a closed envelope
|
|
310
|
-
* - scion.envelope_opened : Indicates an opened envelope
|
|
311
|
-
* - scion.expand_all : Expand an item
|
|
312
|
-
* - scion.external_link : Open link in a new tab
|
|
313
|
-
* - scion.filter : Set or change a filter
|
|
314
|
-
* - scion.find : Find an item
|
|
315
|
-
* - scion.folder : Directory symbol
|
|
316
|
-
* - scion.help : Indicates help, support, or documentation
|
|
317
|
-
* - scion.hide : Hide a panel
|
|
318
|
-
* - scion.magnifier : Magnifier symbol
|
|
319
|
-
* - scion.minimize : Minimize a panel
|
|
320
|
-
* - scion.minus : Minus sign
|
|
321
|
-
* - scion.modified : Indicates modified data
|
|
322
|
-
* - scion.more_horizontal : Show a popover to the left or right
|
|
323
|
-
* - scion.more_vertical : Show a popover above or below
|
|
324
|
-
* - scion.new : Create an item
|
|
325
|
-
* - scion.new_large : Create an item (large)
|
|
326
|
-
* - scion.paste : Paste from clipboard
|
|
327
|
-
* - scion.pen : Pen symbol
|
|
328
|
-
* - scion.pin : Pin an item
|
|
329
|
-
* - scion.pinned : Indicates a pinned item
|
|
330
|
-
* - scion.placeholder_frame : Placeholder symbol
|
|
331
|
-
* - scion.placeholder_image : Placeholder symbol for an image
|
|
332
|
-
* - scion.plus : Plus sign
|
|
333
|
-
* - scion.plus_large : Plus sign (large)
|
|
334
|
-
* - scion.remove : Remove an item (x)
|
|
335
|
-
* - scion.remove_minus : Remove an item (-)
|
|
336
|
-
* - scion.reset : Reset a form
|
|
337
|
-
* - scion.search : Search for an item
|
|
338
|
-
* - scion.sort_ascending : Sort items in ascending order (A-Z, 0-9)
|
|
339
|
-
* - scion.sort_by : Change sort order
|
|
340
|
-
* - scion.sort_descending : Sort items in descending order (Z-A, 9-0)
|
|
341
|
-
* - scion.user : User symbol
|
|
342
|
-
*
|
|
343
|
-
* To not replace built-in icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.
|
|
289
|
+
* Built-in SCION icons start with the `scion.` prefix. To not replace SCION icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.
|
|
290
|
+
* Refer to https://icons.scion.vercel.app for available SCION icons.
|
|
344
291
|
*
|
|
345
292
|
* The function can call `inject` to get any required dependencies.
|
|
346
293
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-icon.mjs","sources":["../../../../projects/scion/components/icon/src/material-icon-provider.ts","../../../../projects/scion/components/icon/src/scion-icon-provider.ts","../../../../projects/scion/components/icon/src/icon-providers.ts","../../../../projects/scion/components/icon/src/icon.component.ts","../../../../projects/scion/components/icon/src/icon.component.html","../../../../projects/scion/components/icon/src/icon.provider.ts","../../../../projects/scion/components/icon/src/public_api.ts","../../../../projects/scion/components/icon/src/scion-components-icon.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, input, inputBinding} from '@angular/core';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides Material icons for non-scion icons.\n */\nexport const materialIconProvider: SciIconProviderFn = (ligature: string): SciComponentDescriptor | undefined => {\n if (ligature.startsWith('scion.')) {\n return undefined; // delegate to next provider\n }\n\n return {component: MaterialIconComponent, bindings: [inputBinding('ligature', () => ligature)]};\n};\n\n/**\n * Renders a Material icon based on its ligature.\n *\n * This component requires a Material icon font to be included in the HTML.\n *\n * Supported fonts:\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp\n * - https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Icons+Sharp\n */\n@Component({\n selector: 'sci-material-icon',\n template: '{{ligature()}}',\n styles: `\n :host {\n font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp', 'Material Icons', 'Material Icons Outlined', 'Material Icons Round', 'Material Icons Sharp';\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n font-feature-settings: 'liga';\n -webkit-font-smoothing: antialiased;\n }\n `,\n})\nexport class MaterialIconComponent {\n /**\n * Specifies the ligature of the Material icon.\n */\n public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, input, inputBinding} from '@angular/core';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides icons used in SCION libraries.\n *\n * Register this provider as the last icon provider, enabling replacement of built-in SCION icons.\n */\nexport const scionIconProvider: SciIconProviderFn = (icon: string): SciComponentDescriptor | undefined => {\n const ligature = icon.startsWith('scion.') ? icon.substring('scion.'.length) : undefined;\n if (ligature) {\n return {component: SciIconFontGlyphComponent, bindings: [inputBinding('ligature', () => ligature)]};\n }\n return undefined;\n};\n\n/**\n * Renders the icon for a ligature of the SCION icon font.\n *\n * This component requires the SCION icon font 'scion-icons' to be included in the HTML.\n */\n@Component({\n selector: 'sci-icon-font-glyph',\n template: '{{ligature()}}',\n styles: `\n :host {\n font-family: 'scion-icons';\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Enable Ligatures */\n letter-spacing: 0;\n font-feature-settings: \"liga\";\n font-variant-ligatures: discretionary-ligatures;\n\n /* Better Font Rendering */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n `,\n})\nexport class SciIconFontGlyphComponent {\n\n /**\n * Specifies the ligature of the icon.\n */\n public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, InjectionToken, Injector, runInInjectionContext} from '@angular/core';\nimport {materialIconProvider} from './material-icon-provider';\nimport {scionIconProvider} from './scion-icon-provider';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides icons based on registered icon providers.\n */\n@Injectable({providedIn: 'root'})\nexport class IconProviders {\n\n private readonly _iconProviders: SciIconProviderFn[] = [\n // Provide app-specific icons.\n ...inject(SCI_ICON_PROVIDER, {optional: true}) ?? [],\n // Provide built-in icons.\n scionIconProvider,\n // Provide material icons.\n materialIconProvider,\n ];\n private readonly _injector = inject(Injector);\n\n /**\n * Provides the icon descriptor for the given icon based on icon providers registered under the {@link SCI_ICON_PROVIDER} DI token.\n *\n * Icon providers are called in registration order. If a provider does not provide the icon, the next provider is called, and so on.\n */\n public provide(icon: string | undefined): SciComponentDescriptor | undefined {\n if (!icon) {\n return undefined;\n }\n\n if (!this._iconProviders.length) {\n return undefined;\n }\n\n for (const iconProvider of this._iconProviders) {\n const componentOrDescriptor = runInInjectionContext(this._injector, () => iconProvider(icon));\n if (componentOrDescriptor) {\n return typeof componentOrDescriptor === 'function' ? {component: componentOrDescriptor} : componentOrDescriptor;\n }\n }\n return undefined;\n }\n}\n\n/**\n * Multi-DI token for injecting icon providers.\n *\n * @see provideIconProvider\n * @see SciIconProviderFn\n */\nexport const SCI_ICON_PROVIDER = new InjectionToken<SciIconProviderFn[]>('SCI_ICON_PROVIDER');\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, Directive, effect, inject, signal, Signal, TemplateRef, untracked, viewChild} from '@angular/core';\nimport {coerceSignal, SciComponentDescriptor, SciComponentOutletDirective} from '@scion/components/common';\nimport {IconProviders} from './icon-providers';\nimport {fromMutation$} from '@scion/toolkit/observable';\nimport {concatWith, map, MonoTypeOperatorFunction, of} from 'rxjs';\n\n/**\n * Renders an icon based on registered icon providers.\n *\n * Set the icon name as the slotted content of the `<sci-icon>` component.\n *\n * Example:\n * ```html\n * <sci-icon>home</sci-icon>\n * ```\n *\n * An icon provider can be registered using {@link provideIconProvider}.\n *\n * Providers are called in registration order. If a provider does not provide the icon, the next provider is called, and so on.\n * If no provider provides the icon, defaults to a Material icon provider, interpreting the icon as a Material icon font ligature.\n * Refer to https://fonts.google.com/icons for available Material icons and instructions on including the Material icon font.\n *\n * By default, the icon size is `1em`. To change the size, set the font-size on the `<sci-icon>` element or use the `--sci-icon-size` CSS variable.\n *\n * ```scss\n * sci-icon {\n * --sci-icon-size: 16px;\n * }\n * ```\n *\n * @see provideIconProvider\n *\n * TODO [Angular 23] Consider changing encapsulation to `IsolatedShadowDom` when stable. See branch: issue/icon-shadow-dom.\n */\n@Component({\n selector: 'sci-icon',\n templateUrl: './icon.component.html',\n styleUrl: './icon.component.scss',\n imports: [\n SciComponentOutletDirective,\n ],\n})\nexport class SciIconComponent {\n\n private readonly _slottedContent = viewChild.required<TemplateRef<void>>('slotted_content');\n\n protected readonly icon = this.computeIcon();\n\n /**\n * Reads the icon from slotted content and passes it to registered icon providers for resolution.\n */\n private computeIcon(): Signal<SciComponentDescriptor | undefined> {\n const icon = signal<SciComponentDescriptor | undefined>(undefined);\n const iconProviders = inject(IconProviders);\n\n effect(onCleanup => {\n const slottedContent = this._slottedContent();\n\n untracked(() => {\n // Instantiate template to \"read\" slotted content.\n const view = slottedContent.createEmbeddedView(undefined);\n onCleanup(() => view.destroy());\n\n // Return if empty, i.e., no icon to render.\n if (!view.rootNodes.length) {\n icon.set(undefined);\n return;\n }\n\n // Ensure only text is provided as slotted content.\n if (view.rootNodes.length > 1 || (view.rootNodes[0] as Element).nodeType !== Node.TEXT_NODE) {\n throw Error('[InvalidInputError] Only text (ligature) is allowed in slotted content of <sci-icon>.');\n }\n\n // Watch slotted content.\n const textNode = view.rootNodes[0] as Text;\n const subscription = of(textNode.textContent)\n .pipe(\n concatWith(fromMutation$(textNode, {characterData: true}).pipe(map(() => textNode.textContent))),\n map(slottedContent => iconProviders.provide(slottedContent.trim() || undefined)),\n augmentIconDescriptor(),\n )\n .subscribe(iconDescriptor => icon.set(iconDescriptor));\n\n onCleanup(() => subscription.unsubscribe());\n });\n });\n\n return icon;\n }\n}\n\n/**\n * Augments the icon descriptor:\n *\n * - Prevents the browser from translating the icon.\n * - Sets the icon's font size to 'var(--sci-icon-size, 1em)', required to inherit the location's font size for icons with a fixed font size.\n * For example, Material sets a fixed font size of 24px.\n */\nfunction augmentIconDescriptor(): MonoTypeOperatorFunction<SciComponentDescriptor | undefined> {\n return map((icon: SciComponentDescriptor | undefined) => icon && {\n ...icon,\n attributes: computed(() => ({\n ...coerceSignal(icon.attributes)?.(),\n translate: 'no',\n })),\n directives: [\n ...icon.directives ?? [],\n IconFontSizeDirective,\n ],\n } satisfies SciComponentDescriptor);\n}\n\n/**\n * Sets the font size to 'var(--sci-icon-size, 1em)', required to inherit the location's font size for icons with a fixed font size.\n * For example, Material sets a fixed font size of 24px.\n */\n@Directive({host: {'[style.font-size]': `'var(--sci-icon-size, 1em)'`}})\nclass IconFontSizeDirective {\n}\n","<ng-container *sciComponentOutlet=\"icon()\"/>\n\n<!--Template to capture slotted content. -->\n<ng-template #slotted_content>\n <ng-content/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {SCI_ICON_PROVIDER} from './icon-providers';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Enables contribution or replacement of icons used in SCION.\n *\n * An icon provider is a function that returns a component for an icon. The component renders the icon.\n *\n * Multiple icon providers can be registered. Providers are called in registration order. If a provider does not provide the icon,\n * the next provider is called, and so on.\n *\n * Defaults to a Material icon provider, interpreting the icon as a Material icon ligature.\n *\n * Refer to https://fonts.google.com/icons for available Material icons and https://developers.google.com/fonts/docs/material_symbols#use_in_web\n * for instructions on including the Material icon font.\n *\n * @example - Importing the Material icon font in `styles.scss`\n * ```scss\n * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..24,400,0&display=block');\n * ```\n *\n * SCION uses the following built-in icons:\n * - scion.add : Add an item\n * - scion.add_large : Add an item (large)\n * - scion.bin : Bin symbol\n * - scion.checkmark : Indicates a selected option\n * - scion.chevron_down : Chevron down symbol\n * - scion.chevron_left : Chevron left symbol\n * - scion.chevron_right : Chevron right symbol\n * - scion.chevron_up : Chevron up symbol\n * - scion.clear : Clear items\n * - scion.close : Close a popover\n * - scion.collapse_all : Collapse all items\n * - scion.copy : Copy an item\n * - scion.delete : Delete an item\n * - scion.dirty : Indicates unsaved data\n * - scion.drag_handle : Drag or move an item\n * - scion.duplicate : Duplicate an item\n * - scion.edit : Edit an item\n * - scion.emdash : Em dash symbol\n * - scion.envelope : Envelope symbol\n * - scion.envelope_closed : Indicates a closed envelope\n * - scion.envelope_opened : Indicates an opened envelope\n * - scion.expand_all : Expand an item\n * - scion.external_link : Open link in a new tab\n * - scion.filter : Set or change a filter\n * - scion.find : Find an item\n * - scion.folder : Directory symbol\n * - scion.help : Indicates help, support, or documentation\n * - scion.hide : Hide a panel\n * - scion.magnifier : Magnifier symbol\n * - scion.minimize : Minimize a panel\n * - scion.minus : Minus sign\n * - scion.modified : Indicates modified data\n * - scion.more_horizontal : Show a popover to the left or right\n * - scion.more_vertical : Show a popover above or below\n * - scion.new : Create an item\n * - scion.new_large : Create an item (large)\n * - scion.paste : Paste from clipboard\n * - scion.pen : Pen symbol\n * - scion.pin : Pin an item\n * - scion.pinned : Indicates a pinned item\n * - scion.placeholder_frame : Placeholder symbol\n * - scion.placeholder_image : Placeholder symbol for an image\n * - scion.plus : Plus sign\n * - scion.plus_large : Plus sign (large)\n * - scion.remove : Remove an item (x)\n * - scion.remove_minus : Remove an item (-)\n * - scion.reset : Reset a form\n * - scion.search : Search for an item\n * - scion.sort_ascending : Sort items in ascending order (A-Z, 0-9)\n * - scion.sort_by : Change sort order\n * - scion.sort_descending : Sort items in descending order (Z-A, 9-0)\n * - scion.user : User symbol\n *\n * To not replace built-in icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @see SciIconProviderFn\n * @see SciIconComponent\n */\nexport function provideIconProvider(iconProviderFn: SciIconProviderFn | undefined): EnvironmentProviders {\n return makeEnvironmentProviders(iconProviderFn ? [\n {\n provide: SCI_ICON_PROVIDER,\n useValue: iconProviderFn,\n multi: true,\n },\n ] : []);\n}\n\n/**\n * Signature of a function to provide icons.\n *\n * An icon provider is a function that returns the component for an icon. The component renders the icon.\n *\n * Alternatively, the icon provider can return a descriptor, allowing for additional configuration such as inputs.\n * Inputs are available as input properties in the component. The component can use the inputs to render the icon.\n *\n * Icon keys used by SCION start with the `scion.` prefix. To not replace built-in icons, the icon provider can\n * return `undefined` for icons starting with the `scion.` prefix.\n *\n * An icon provider can be registered via {@link provideIconProvider} function.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @param icon - The key of the icon for which to provide the icon component.\n * @returns ComponentType or {@link SciComponentDescriptor} to render the icon, or `undefined` if not provided by the icon provider.\n */\nexport type SciIconProviderFn = (icon: string) => ComponentType<unknown> | SciComponentDescriptor | undefined;\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/icon'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciIconComponent} from './icon.component';\nexport {provideIconProvider, type SciIconProviderFn} from './icon.provider';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;AAQG;AAMH;;AAEG;AACI,MAAM,oBAAoB,GAAsB,CAAC,QAAgB,KAAwC;AAC9G,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACjC,OAAO,SAAS,CAAC;IACnB;AAEA,IAAA,OAAO,EAAC,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,QAAQ,CAAC,CAAC,EAAC;AACjG,CAAC;AAED;;;;;;;;;;AAUG;MAqBU,qBAAqB,CAAA;AAChC;;AAEG;IACa,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAU;uGAJxC,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,yNAlBtB,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,oZAAA,CAAA,EAAA,CAAA;;2FAkBf,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBApBjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,YACnB,gBAAgB,EAAA,MAAA,EAAA,CAAA,oZAAA,CAAA,EAAA;;;ACtC5B;;;;;;;;AAQG;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AA,UAAU,EAAE;AACV,YAAA,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE;YACxB,qBAAqB;AACtB,SAAA;AAC+B,KAAA,CAAC;AACrC;AAEA;;;AAGG;AACH,MACM,qBAAqB,CAAA;uGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,6BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,IAAI,EAAE,EAAC,mBAAmB,EAAE,CAAA,2BAAA,CAA6B,EAAC,EAAC;;;AE/HvE;;;;;;;;AAQG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EG;AACG,SAAU,mBAAmB,CAAC,cAA6C,EAAA;AAC/E,IAAA,OAAO,wBAAwB,CAAC,cAAc,GAAG;AAC/C,QAAA;AACE,YAAA,OAAO,EAAE,iBAAiB;AAC1B,YAAA,QAAQ,EAAE,cAAc;AACxB,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;AACF,KAAA,GAAG,EAAE,CAAC;AACT;;ACtGA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-icon.mjs","sources":["../../../../projects/scion/components/icon/src/material-icon-provider.ts","../../../../projects/scion/components/icon/src/scion-icon-provider.ts","../../../../projects/scion/components/icon/src/icon-providers.ts","../../../../projects/scion/components/icon/src/icon.component.ts","../../../../projects/scion/components/icon/src/icon.component.html","../../../../projects/scion/components/icon/src/icon.provider.ts","../../../../projects/scion/components/icon/src/public_api.ts","../../../../projects/scion/components/icon/src/scion-components-icon.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, input, inputBinding} from '@angular/core';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides Material icons for non-scion icons.\n */\nexport const materialIconProvider: SciIconProviderFn = (ligature: string): SciComponentDescriptor | undefined => {\n if (ligature.startsWith('scion.')) {\n return undefined; // delegate to next provider\n }\n\n return {component: MaterialIconComponent, bindings: [inputBinding('ligature', () => ligature)]};\n};\n\n/**\n * Renders a Material icon based on its ligature.\n *\n * This component requires a Material icon font to be included in the HTML.\n *\n * Supported fonts:\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined\n * - https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp\n * - https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Icons+Sharp\n */\n@Component({\n selector: 'sci-material-icon',\n template: '{{ligature()}}',\n styles: `\n :host {\n font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp', 'Material Icons', 'Material Icons Outlined', 'Material Icons Round', 'Material Icons Sharp';\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n font-feature-settings: 'liga';\n -webkit-font-smoothing: antialiased;\n }\n `,\n})\nexport class MaterialIconComponent {\n /**\n * Specifies the ligature of the Material icon.\n */\n public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, input, inputBinding} from '@angular/core';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides icons used in SCION libraries.\n *\n * Register this provider as the last icon provider, enabling replacement of built-in SCION icons.\n */\nexport const scionIconProvider: SciIconProviderFn = (icon: string): SciComponentDescriptor | undefined => {\n const ligature = icon.startsWith('scion.') ? icon.substring('scion.'.length) : undefined;\n if (ligature) {\n return {component: SciIconFontGlyphComponent, bindings: [inputBinding('ligature', () => ligature)]};\n }\n return undefined;\n};\n\n/**\n * Renders the icon for a ligature of the SCION icon font.\n *\n * This component requires the SCION icon font 'scion-icons' to be included in the HTML.\n */\n@Component({\n selector: 'sci-icon-font-glyph',\n template: '{{ligature()}}',\n styles: `\n :host {\n font-family: 'scion-icons';\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Enable Ligatures */\n letter-spacing: 0;\n font-feature-settings: \"liga\";\n font-variant-ligatures: discretionary-ligatures;\n\n /* Better Font Rendering */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n `,\n})\nexport class SciIconFontGlyphComponent {\n\n /**\n * Specifies the ligature of the icon.\n */\n public readonly ligature = input.required<string>();\n}\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, InjectionToken, Injector, runInInjectionContext} from '@angular/core';\nimport {materialIconProvider} from './material-icon-provider';\nimport {scionIconProvider} from './scion-icon-provider';\nimport {SciIconProviderFn} from './icon.provider';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Provides icons based on registered icon providers.\n */\n@Injectable({providedIn: 'root'})\nexport class IconProviders {\n\n private readonly _iconProviders: SciIconProviderFn[] = [\n // Provide app-specific icons.\n ...inject(SCI_ICON_PROVIDER, {optional: true}) ?? [],\n // Provide SCION icons.\n scionIconProvider,\n // Provide material icons.\n materialIconProvider,\n ];\n private readonly _injector = inject(Injector);\n\n /**\n * Provides the icon descriptor for the given icon based on icon providers registered under the {@link SCI_ICON_PROVIDER} DI token.\n *\n * Icon providers are called in registration order. If a provider does not provide the icon, the next provider is called, and so on.\n */\n public provide(icon: string | undefined): SciComponentDescriptor | undefined {\n if (!icon) {\n return undefined;\n }\n\n if (!this._iconProviders.length) {\n return undefined;\n }\n\n for (const iconProvider of this._iconProviders) {\n const componentOrDescriptor = runInInjectionContext(this._injector, () => iconProvider(icon));\n if (componentOrDescriptor) {\n return typeof componentOrDescriptor === 'function' ? {component: componentOrDescriptor} : componentOrDescriptor;\n }\n }\n return undefined;\n }\n}\n\n/**\n * Multi-DI token for injecting icon providers.\n *\n * @see provideIconProvider\n * @see SciIconProviderFn\n */\nexport const SCI_ICON_PROVIDER = new InjectionToken<SciIconProviderFn[]>('SCI_ICON_PROVIDER');\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, computed, Directive, effect, inject, signal, Signal, TemplateRef, untracked, viewChild} from '@angular/core';\nimport {coerceSignal, SciComponentDescriptor, SciComponentOutletDirective} from '@scion/components/common';\nimport {IconProviders} from './icon-providers';\nimport {fromMutation$} from '@scion/toolkit/observable';\nimport {concatWith, map, MonoTypeOperatorFunction, of} from 'rxjs';\n\n/**\n * Renders an icon based on registered icon providers.\n *\n * Set the icon name as the slotted content of the `<sci-icon>` component.\n *\n * Example:\n * ```html\n * <sci-icon>home</sci-icon>\n * ```\n *\n * An icon provider can be registered using {@link provideIconProvider}.\n *\n * Providers are called in registration order. If a provider does not provide the icon, the next provider is called, and so on.\n * If no provider provides the icon, defaults to a Material icon provider, interpreting the icon as a Material icon font ligature.\n * Refer to https://fonts.google.com/icons for available Material icons and instructions on including the Material icon font.\n *\n * By default, the icon size is `1em`. To change the size, set the font-size on the `<sci-icon>` element or use the `--sci-icon-size` CSS variable.\n *\n * ```scss\n * sci-icon {\n * --sci-icon-size: 16px;\n * }\n * ```\n *\n * @see provideIconProvider\n *\n * TODO [Angular 23] Consider changing encapsulation to `IsolatedShadowDom` when stable. See branch: issue/icon-shadow-dom.\n */\n@Component({\n selector: 'sci-icon',\n templateUrl: './icon.component.html',\n styleUrl: './icon.component.scss',\n imports: [\n SciComponentOutletDirective,\n ],\n})\nexport class SciIconComponent {\n\n private readonly _slottedContent = viewChild.required<TemplateRef<void>>('slotted_content');\n\n protected readonly icon = this.computeIcon();\n\n /**\n * Reads the icon from slotted content and passes it to registered icon providers for resolution.\n */\n private computeIcon(): Signal<SciComponentDescriptor | undefined> {\n const icon = signal<SciComponentDescriptor | undefined>(undefined);\n const iconProviders = inject(IconProviders);\n\n effect(onCleanup => {\n const slottedContent = this._slottedContent();\n\n untracked(() => {\n // Instantiate template to \"read\" slotted content.\n const view = slottedContent.createEmbeddedView(undefined);\n onCleanup(() => view.destroy());\n\n // Return if empty, i.e., no icon to render.\n if (!view.rootNodes.length) {\n icon.set(undefined);\n return;\n }\n\n // Ensure only text is provided as slotted content.\n if (view.rootNodes.length > 1 || (view.rootNodes[0] as Element).nodeType !== Node.TEXT_NODE) {\n throw Error('[InvalidInputError] Only text (ligature) is allowed in slotted content of <sci-icon>.');\n }\n\n // Watch slotted content.\n const textNode = view.rootNodes[0] as Text;\n const subscription = of(textNode.textContent)\n .pipe(\n concatWith(fromMutation$(textNode, {characterData: true}).pipe(map(() => textNode.textContent))),\n map(slottedContent => iconProviders.provide(slottedContent.trim() || undefined)),\n augmentIconDescriptor(),\n )\n .subscribe(iconDescriptor => icon.set(iconDescriptor));\n\n onCleanup(() => subscription.unsubscribe());\n });\n });\n\n return icon;\n }\n}\n\n/**\n * Augments the icon descriptor:\n *\n * - Prevents the browser from translating the icon.\n * - Sets the icon's font size to 'var(--sci-icon-size, 1em)', required to inherit the location's font size for icons with a fixed font size.\n * For example, Material sets a fixed font size of 24px.\n */\nfunction augmentIconDescriptor(): MonoTypeOperatorFunction<SciComponentDescriptor | undefined> {\n return map((icon: SciComponentDescriptor | undefined) => icon && {\n ...icon,\n attributes: computed(() => ({\n ...coerceSignal(icon.attributes)?.(),\n translate: 'no',\n })),\n directives: [\n ...icon.directives ?? [],\n IconFontSizeDirective,\n ],\n } satisfies SciComponentDescriptor);\n}\n\n/**\n * Sets the font size to 'var(--sci-icon-size, 1em)', required to inherit the location's font size for icons with a fixed font size.\n * For example, Material sets a fixed font size of 24px.\n */\n@Directive({host: {'[style.font-size]': `'var(--sci-icon-size, 1em)'`}})\nclass IconFontSizeDirective {\n}\n","<ng-container *sciComponentOutlet=\"icon()\"/>\n\n<!--Template to capture slotted content. -->\n<ng-template #slotted_content>\n <ng-content/>\n</ng-template>\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {SCI_ICON_PROVIDER} from './icon-providers';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {SciComponentDescriptor} from '@scion/components/common';\n\n/**\n * Enables contribution or replacement of icons used in SCION.\n *\n * An icon provider is a function that returns a component for an icon. The component renders the icon.\n *\n * Multiple icon providers can be registered. Providers are called in registration order. If a provider does not provide the icon,\n * the next provider is called, and so on.\n *\n * Defaults to a Material icon provider, interpreting the icon as a Material icon ligature.\n *\n * Refer to https://fonts.google.com/icons for available Material icons and https://developers.google.com/fonts/docs/material_symbols#use_in_web\n * for instructions on including the Material icon font.\n *\n * @example - Importing the Material icon font in `styles.scss`\n * ```scss\n * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..24,400,0&display=block');\n * ```\n *\n * Built-in SCION icons start with the `scion.` prefix. To not replace SCION icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.\n * Refer to https://icons.scion.vercel.app for available SCION icons.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @see SciIconProviderFn\n * @see SciIconComponent\n */\nexport function provideIconProvider(iconProviderFn: SciIconProviderFn | undefined): EnvironmentProviders {\n return makeEnvironmentProviders(iconProviderFn ? [\n {\n provide: SCI_ICON_PROVIDER,\n useValue: iconProviderFn,\n multi: true,\n },\n ] : []);\n}\n\n/**\n * Signature of a function to provide icons.\n *\n * An icon provider is a function that returns the component for an icon. The component renders the icon.\n *\n * Alternatively, the icon provider can return a descriptor, allowing for additional configuration such as inputs.\n * Inputs are available as input properties in the component. The component can use the inputs to render the icon.\n *\n * Icon keys used by SCION start with the `scion.` prefix. To not replace SCION icons, the icon provider can\n * return `undefined` for icons starting with the `scion.` prefix.\n *\n * An icon provider can be registered via {@link provideIconProvider} function.\n *\n * The function can call `inject` to get any required dependencies.\n *\n * @param icon - The key of the icon for which to provide the icon component.\n * @returns ComponentType or {@link SciComponentDescriptor} to render the icon, or `undefined` if not provided by the icon provider.\n */\nexport type SciIconProviderFn = (icon: string) => ComponentType<unknown> | SciComponentDescriptor | undefined;\n","/*\n * Copyright (c) 2018-2026 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/icon'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciIconComponent} from './icon.component';\nexport {provideIconProvider, type SciIconProviderFn} from './icon.provider';\n","/**\n * Generated bundle index. Do not edit.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