@scion/components 22.6.0 → 22.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.
@@ -109,6 +109,7 @@ $sci-table: (
109
109
  --sci-table-header-text-color: inherit,
110
110
  --sci-table-header-column-divider: visible,
111
111
  --sci-table-row-height: 2em,
112
+ --sci-table-row-indent: 1em,
112
113
  --sci-table-row-background-color-hover: var(--sci-color-gray-100),
113
114
  --sci-table-row-background-color-selected: color-mix(in srgb, var(--sci-color-accent) 35%, var(--sci-color-gray-100)),
114
115
  --sci-table-row-border-radius: var(--sci-corner-small),
@@ -120,6 +121,19 @@ $sci-table: (
120
121
  --sci-table-cell-padding-inline: .5em,
121
122
  );
122
123
 
124
+ $sci-tree: (
125
+ --sci-tree-node-height: var(--sci-table-row-height),
126
+ --sci-tree-node-indent: var(--sci-table-row-indent),
127
+ --sci-tree-node-background-color-hover: var(--sci-table-row-background-color-hover),
128
+ --sci-tree-node-background-color-selected: var(--sci-table-row-background-color-selected),
129
+ --sci-tree-node-border-radius: var(--sci-table-row-border-radius),
130
+ --sci-tree-node-outline-color: var(--sci-table-row-outline-color),
131
+ --sci-tree-node-outline-width: var(--sci-table-row-outline-width),
132
+ --sci-tree-node-outline-style: var(--sci-table-row-outline-style),
133
+ --sci-tree-node-action-background-color: var(--sci-table-row-action-background-color),
134
+ --sci-tree-node-action-background-color-selected: var(--sci-table-row-action-background-color-selected),
135
+ );
136
+
123
137
  $sci-button: (
124
138
  --sci-button-cursor: default,
125
139
  --sci-button-background-color-hover: var(--sci-color-gray-200),
@@ -149,5 +163,6 @@ $tokens: sci-theming.map-merge(
149
163
  $sci-toolbar,
150
164
  $sci-button,
151
165
  $sci-table,
166
+ $sci-tree,
152
167
  $sci-skeleton,
153
168
  );
@@ -109,6 +109,7 @@ $sci-table: (
109
109
  --sci-table-header-text-color: inherit,
110
110
  --sci-table-header-column-divider: visible,
111
111
  --sci-table-row-height: 2em,
112
+ --sci-table-row-indent: 1em,
112
113
  --sci-table-row-background-color-hover: color-mix(in srgb, var(--sci-color-gray-200) 60%, var(--sci-static-color-white)),
113
114
  --sci-table-row-background-color-selected: var(--sci-color-background-accent),
114
115
  --sci-table-row-border-radius: var(--sci-corner-small),
@@ -120,6 +121,19 @@ $sci-table: (
120
121
  --sci-table-cell-padding-inline: .5em,
121
122
  );
122
123
 
124
+ $sci-tree: (
125
+ --sci-tree-node-height: var(--sci-table-row-height),
126
+ --sci-tree-node-indent: var(--sci-table-row-indent),
127
+ --sci-tree-node-background-color-hover: var(--sci-table-row-background-color-hover),
128
+ --sci-tree-node-background-color-selected: var(--sci-table-row-background-color-selected),
129
+ --sci-tree-node-border-radius: var(--sci-table-row-border-radius),
130
+ --sci-tree-node-outline-color: var(--sci-table-row-outline-color),
131
+ --sci-tree-node-outline-width: var(--sci-table-row-outline-width),
132
+ --sci-tree-node-outline-style: var(--sci-table-row-outline-style),
133
+ --sci-tree-node-action-background-color: var(--sci-table-row-action-background-color),
134
+ --sci-tree-node-action-background-color-selected: var(--sci-table-row-action-background-color-selected),
135
+ );
136
+
123
137
  $sci-button: (
124
138
  --sci-button-cursor: default,
125
139
  --sci-button-background-color-hover: color-mix(in srgb, var(--sci-color-gray-200) 95%, var(--sci-static-color-white)),
@@ -149,5 +163,6 @@ $tokens: sci-theming.map-merge(
149
163
  $sci-toolbar,
150
164
  $sci-button,
151
165
  $sci-table,
166
+ $sci-tree,
152
167
  $sci-skeleton,
153
168
  );
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { isSignal, signal, inject, Injector, effect, untracked, DestroyRef, assertInInjectionContext, input, ElementRef, IterableDiffers, Renderer2, Directive, ViewContainerRef, inputBinding, InjectionToken, LOCALE_ID, computed } from '@angular/core';
2
+ import { isSignal, signal, inject, Injector, effect, untracked, DestroyRef, assertInInjectionContext, input, ElementRef, IterableDiffers, Renderer2, Directive, ViewContainerRef, inputBinding, InjectionToken, LOCALE_ID, computed, makeEnvironmentProviders } from '@angular/core';
3
3
  import { of, Observable } from 'rxjs';
4
4
  import { coerceElement } from '@angular/cdk/coercion';
5
5
 
@@ -402,6 +402,29 @@ const TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT = new InjectionToken('TOOLTIP
402
402
  */
403
403
  const TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT = new InjectionToken('TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT');
404
404
 
405
+ /*
406
+ * Copyright (c) 2018-2026 Swiss Federal Railways
407
+ *
408
+ * This program and the accompanying materials are made
409
+ * available under the terms of the Eclipse Public License 2.0
410
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
411
+ *
412
+ * SPDX-License-Identifier: EPL-2.0
413
+ */
414
+ const SCI_COMPONENTS_STORAGE = new InjectionToken('SCI_COMPONENTS_STORAGE', { factory: () => ({
415
+ load: (name) => localStorage.getItem(name),
416
+ store: (name, value) => localStorage.setItem(name, value),
417
+ }) });
418
+ /**
419
+ * Defaults to localStorage persistence.
420
+ * @param storage
421
+ */
422
+ function provideComponentsStorage(storage) {
423
+ return makeEnvironmentProviders([
424
+ { provide: SCI_COMPONENTS_STORAGE, useClass: storage },
425
+ ]);
426
+ }
427
+
405
428
  /*
406
429
  * Copyright (c) 2018-2026 Swiss Federal Railways
407
430
  *
@@ -421,5 +444,5 @@ const TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT = new InjectionToken('TOOLTI
421
444
  * Generated bundle index. Do not edit.
422
445
  */
423
446
 
424
- export { SCI_LOCALE, SciAttributesDirective, SciComponentOutletDirective, SciTooltipOnOverflowDirective, TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT, TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, coerceSignal, toLazyObservable, ɵSingleActiveInjectorFactory, ɵassertInInjectionContext, ɵcreateDestroyableInjector };
447
+ export { SCI_COMPONENTS_STORAGE, SCI_LOCALE, SciAttributesDirective, SciComponentOutletDirective, SciTooltipOnOverflowDirective, TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT, TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, coerceSignal, provideComponentsStorage, toLazyObservable, ɵSingleActiveInjectorFactory, ɵassertInInjectionContext, ɵcreateDestroyableInjector };
425
448
  //# 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/locale.ts","../../../../projects/scion/components/common/src/tooltip-on-overflow.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/**\n * Factory for creating new injectors.\n *\n * Creating a new injector automatically destroys the previous injector created by this factory.\n *\n * @docs-private Not public API. For internal use only.\n */\nexport class ɵSingleActiveInjectorFactory {\n\n private _injector: DestroyableInjector | undefined;\n private _options: {parent?: Injector; providers?: Provider[]; name?: string};\n\n constructor(options?: {parent?: Injector; providers?: Provider[]; name?: string}) {\n this._options = {\n parent: options?.parent ?? inject(Injector),\n providers: options?.providers,\n name: options?.name,\n };\n }\n\n /**\n * Creates a new injector, destroying the previously created one, if any.\n */\n public create(): Injector {\n this._injector?.destroy();\n this._injector = ɵcreateDestroyableInjector({parent: this._options.parent, providers: this._options.providers, name: this._options.name});\n return this._injector;\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 * @docs-private Not public API. For internal use only.\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","import {computed, Directive, ElementRef, inject, InjectionToken, input, Signal, signal} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {coerceSignal, MaybeSignal} from './signal.util';\n\n/**\n * Displays element text content as a tooltip when text overflows.\n *\n * Uses the host element text content by default. The content source can be customized via {@link sourceElement} input.\n *\n * Usage:\n *\n * ```html\n * <div sciTooltipOnOverflow>Content</div>\n * ```\n *\n * Can also be used on input elements, displaying a tooltip when the value overflows.\n *\n * Usage:\n *\n * ```html\n * <input sciTooltipOnOverflow>\n * ```\n *\n * Supports appending additional text that is always displayed regardless of whether text overflows.\n *\n * If used as a host directive, configure via the following DI tokens:\n * - {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT} and\n * - {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT}.\n */\n@Directive({\n selector: '[sciTooltipOnOverflow]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '[attr.title]': 'tooltip()',\n },\n})\nexport class SciTooltipOnOverflowDirective {\n\n /**\n * Specifies the element from which to read text content for displaying as tooltip. Defaults to the host element.\n *\n * If used as a host directive, configure an alternative source using {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT} DI token.\n */\n public readonly sourceElement = input<Element | ElementRef<Element> | undefined>(inject(ElementRef), {alias: 'sciTooltipOnOverflowSourceElement'});\n\n /**\n * Specifies additional text appended to the tooltip.\n *\n * This text is always displayed, regardless of whether text overflows.\n *\n * If used as a host directive, specify additional text via {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT} DI token.\n */\n public readonly additionalText = input<string | undefined>(undefined, {alias: 'sciTooltipOnOverflowAdditionalText'});\n\n private readonly _sourceElement = this.computeSourceElement();\n private readonly _additionalText = this.computeAdditionalText();\n private readonly _hasOverflow = signal(false);\n\n protected readonly tooltip = this.computeTooltip();\n\n protected onMouseEnter(): void {\n const sourceElement = this._sourceElement();\n this._hasOverflow.set(!!sourceElement && (sourceElement.scrollWidth > sourceElement.clientWidth || sourceElement.scrollHeight > sourceElement.clientHeight));\n }\n\n protected onMouseLeave(): void {\n this._hasOverflow.set(false);\n }\n\n private computeSourceElement(): Signal<Element | undefined> {\n const sourceElement = coerceSignal(inject(TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, {optional: true}) ?? this.sourceElement);\n return computed(() => coerceElement(sourceElement()));\n }\n\n private computeAdditionalText(): Signal<string | undefined> {\n return coerceSignal(inject(TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT, {optional: true}) ?? this.additionalText);\n }\n\n private computeTooltip(): Signal<string | undefined> {\n return computed(() => {\n const tooltip = new Array<string>();\n const sourceElement = this._sourceElement();\n\n if (this._hasOverflow()) {\n tooltip.push(sourceElement instanceof HTMLInputElement ? sourceElement.value : sourceElement!.textContent.trim());\n }\n\n if (this._additionalText()?.length) {\n tooltip.push(this._additionalText()!);\n }\n\n return tooltip.join('\\n') || undefined;\n });\n }\n}\n\n/**\n * Specifies the element from which to read text content for displaying as tooltip.\n *\n * Use this token to configure {@link SciTooltipOnOverflowDirective} if used as a host directive. Equivalent to {@link SciTooltipOnOverflowDirective.sourceElement}.\n */\nexport const TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT = new InjectionToken<MaybeSignal<Element | ElementRef<Element> | undefined>>('TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT');\n\n/**\n * Specifies additional text appended to the tooltip.\n *\n * Use this token to configure {@link SciTooltipOnOverflowDirective} if used as a host directive. Equivalent to {@link SciTooltipOnOverflowDirective.additionalText}.\n */\nexport const TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT = new InjectionToken<MaybeSignal<string | undefined>>('TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT');\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, ɵSingleActiveInjectorFactory} 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';\nexport {SciTooltipOnOverflowDirective, TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT} from './tooltip-on-overflow.directive';\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,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;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/tooltip-on-overflow.directive.ts","../../../../projects/scion/components/common/src/storage.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/**\n * Factory for creating new injectors.\n *\n * Creating a new injector automatically destroys the previous injector created by this factory.\n *\n * @docs-private Not public API. For internal use only.\n */\nexport class ɵSingleActiveInjectorFactory {\n\n private _injector: DestroyableInjector | undefined;\n private _options: {parent?: Injector; providers?: Provider[]; name?: string};\n\n constructor(options?: {parent?: Injector; providers?: Provider[]; name?: string}) {\n this._options = {\n parent: options?.parent ?? inject(Injector),\n providers: options?.providers,\n name: options?.name,\n };\n }\n\n /**\n * Creates a new injector, destroying the previously created one, if any.\n */\n public create(): Injector {\n this._injector?.destroy();\n this._injector = ɵcreateDestroyableInjector({parent: this._options.parent, providers: this._options.providers, name: this._options.name});\n return this._injector;\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 * @docs-private Not public API. For internal use only.\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","import {computed, Directive, ElementRef, inject, InjectionToken, input, Signal, signal} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {coerceSignal, MaybeSignal} from './signal.util';\n\n/**\n * Displays element text content as a tooltip when text overflows.\n *\n * Uses the host element text content by default. The content source can be customized via {@link sourceElement} input.\n *\n * Usage:\n *\n * ```html\n * <div sciTooltipOnOverflow>Content</div>\n * ```\n *\n * Can also be used on input elements, displaying a tooltip when the value overflows.\n *\n * Usage:\n *\n * ```html\n * <input sciTooltipOnOverflow>\n * ```\n *\n * Supports appending additional text that is always displayed regardless of whether text overflows.\n *\n * If used as a host directive, configure via the following DI tokens:\n * - {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT} and\n * - {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT}.\n */\n@Directive({\n selector: '[sciTooltipOnOverflow]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '[attr.title]': 'tooltip()',\n },\n})\nexport class SciTooltipOnOverflowDirective {\n\n /**\n * Specifies the element from which to read text content for displaying as tooltip. Defaults to the host element.\n *\n * If used as a host directive, configure an alternative source using {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT} DI token.\n */\n public readonly sourceElement = input<Element | ElementRef<Element> | undefined>(inject(ElementRef), {alias: 'sciTooltipOnOverflowSourceElement'});\n\n /**\n * Specifies additional text appended to the tooltip.\n *\n * This text is always displayed, regardless of whether text overflows.\n *\n * If used as a host directive, specify additional text via {@link TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT} DI token.\n */\n public readonly additionalText = input<string | undefined>(undefined, {alias: 'sciTooltipOnOverflowAdditionalText'});\n\n private readonly _sourceElement = this.computeSourceElement();\n private readonly _additionalText = this.computeAdditionalText();\n private readonly _hasOverflow = signal(false);\n\n protected readonly tooltip = this.computeTooltip();\n\n protected onMouseEnter(): void {\n const sourceElement = this._sourceElement();\n this._hasOverflow.set(!!sourceElement && (sourceElement.scrollWidth > sourceElement.clientWidth || sourceElement.scrollHeight > sourceElement.clientHeight));\n }\n\n protected onMouseLeave(): void {\n this._hasOverflow.set(false);\n }\n\n private computeSourceElement(): Signal<Element | undefined> {\n const sourceElement = coerceSignal(inject(TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, {optional: true}) ?? this.sourceElement);\n return computed(() => coerceElement(sourceElement()));\n }\n\n private computeAdditionalText(): Signal<string | undefined> {\n return coerceSignal(inject(TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT, {optional: true}) ?? this.additionalText);\n }\n\n private computeTooltip(): Signal<string | undefined> {\n return computed(() => {\n const tooltip = new Array<string>();\n const sourceElement = this._sourceElement();\n\n if (this._hasOverflow()) {\n tooltip.push(sourceElement instanceof HTMLInputElement ? sourceElement.value : sourceElement!.textContent.trim());\n }\n\n if (this._additionalText()?.length) {\n tooltip.push(this._additionalText()!);\n }\n\n return tooltip.join('\\n') || undefined;\n });\n }\n}\n\n/**\n * Specifies the element from which to read text content for displaying as tooltip.\n *\n * Use this token to configure {@link SciTooltipOnOverflowDirective} if used as a host directive. Equivalent to {@link SciTooltipOnOverflowDirective.sourceElement}.\n */\nexport const TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT = new InjectionToken<MaybeSignal<Element | ElementRef<Element> | undefined>>('TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT');\n\n/**\n * Specifies additional text appended to the tooltip.\n *\n * Use this token to configure {@link SciTooltipOnOverflowDirective} if used as a host directive. Equivalent to {@link SciTooltipOnOverflowDirective.additionalText}.\n */\nexport const TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT = new InjectionToken<MaybeSignal<string | undefined>>('TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT');\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, InjectionToken, makeEnvironmentProviders, Type} from '@angular/core';\n\n/**\n * Provides persistent storage interface.\n */\nexport interface SciComponentsStorage {\n\n /**\n * Method invoked to load a value from persisted storage.\n */\n load(name: `scion.components:${string}`): Promise<string | null> | string | null;\n\n /**\n * Method invoked to write a value to persisted storage.\n */\n store(name: `scion.components:${string}`, value: string): Promise<void> | void;\n}\n\nexport const SCI_COMPONENTS_STORAGE = new InjectionToken<SciComponentsStorage>('SCI_COMPONENTS_STORAGE', {factory: () => ({\n load: (name: `scion.components:${string}`) => localStorage.getItem(name),\n store: (name: `scion.components:${string}`, value: string) => localStorage.setItem(name, value),\n})});\n\n/**\n * Defaults to localStorage persistence.\n * @param storage\n */\nexport function provideComponentsStorage(storage: Type<SciComponentsStorage>): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: SCI_COMPONENTS_STORAGE, useClass: storage},\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\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, ɵSingleActiveInjectorFactory} 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';\nexport {SciTooltipOnOverflowDirective, TOOLTIP_ON_OVERFLOW_DIRECTIVE_SOURCE_ELEMENT, TOOLTIP_ON_OVERFLOW_DIRECTIVE_ADDITIONAL_TEXT} from './tooltip-on-overflow.directive';\nexport {SCI_COMPONENTS_STORAGE, provideComponentsStorage} from './storage';\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,GAAG,MAAM,EAAE;QAC7B,IAAI,gBAAgB,GAAG,IAAI;;AAG3B,QAAA,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;AAE3B,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAK;AAC5B,YAAA,MAAM,KAAK,GAAG,MAAM,EAAE;YAEtB,SAAS,CAAC,MAAK;AACb,gBAAA,IAAI,CAAC,gBAAgB,IAAI,YAAY,KAAK,KAAK,EAAE;AAC/C,oBAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;gBACtB;gBACA,gBAAgB,GAAG,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