@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scion/components",
3
- "version": "22.3.0",
3
+ "version": "22.5.0",
4
4
  "description": "Provides a collection of Angular components and directives primarily for use in SCION libraries such as `@scion/workbench` and `@scion/microfrontend-platform`. This library is not a comprehensive component library as its focus is on SCION requirements.",
5
5
  "license": "EPL-2.0",
6
6
  "private": false,
@@ -78,12 +78,12 @@
78
78
  "@angular/common": "^22.0.0",
79
79
  "@angular/animations": "^22.0.0",
80
80
  "@angular/cdk": "^22.0.0",
81
- "@scion/toolkit": "^2.2.0",
81
+ "@scion/toolkit": "^2.3.0",
82
82
  "rxjs": "^7.8.0"
83
83
  },
84
84
  "repository": {
85
85
  "type": "git",
86
- "url": "https://github.com/SchweizerischeBundesbahnen/scion-toolkit.git"
86
+ "url": "git+https://github.com/SchweizerischeBundesbahnen/scion-toolkit.git"
87
87
  },
88
88
  "sideEffects": false,
89
89
  "module": "fesm2022/scion-components.mjs",
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Signal, Injector, Provider, DestroyableInjector, Binding, Type, TemplateRef } from '@angular/core';
2
+ import { Signal, Injector, Provider, DestroyableInjector, Binding, Type, TemplateRef, InjectionToken, WritableSignal } from '@angular/core';
3
3
  import { Observable } from 'rxjs';
4
4
  import { ComponentType } from '@angular/cdk/portal';
5
5
 
@@ -181,5 +181,39 @@ interface SciTemplateDescriptor {
181
181
  };
182
182
  }
183
183
 
184
- export { SciAttributesDirective, SciComponentOutletDirective, assertInInjectionContext, coerceSignal, createDestroyableInjector, toLazyObservable };
184
+ /**
185
+ * DI token providing the current locale to SCION components for localizing dates and numbers.
186
+ *
187
+ * Defaults to {@link LOCALE_ID}. Changing the locale updates formatting in SCION components, unless overridden at the component level.
188
+ *
189
+ * Change the locale at runtime as follows:
190
+ * ```ts
191
+ * inject(SCI_LOCALE).set('de-CH');
192
+ * ```
193
+ *
194
+ * Angular includes only `en-US` by default. Register other locales via `registerLocaleData()`, typically in an environment initializer at app startup:
195
+ *
196
+ * ```ts
197
+ * import {bootstrapApplication} from '@angular/platform-browser';
198
+ * import {provideEnvironmentInitializer} from '@angular/core';
199
+ * import {registerLocaleData} from '@angular/common';
200
+ *
201
+ * import localeDeCH from '@angular/common/locales/de-CH';
202
+ * import localeFrCH from '@angular/common/locales/fr-CH';
203
+ * import localeItCH from '@angular/common/locales/it-CH';
204
+ *
205
+ * bootstrapApplication(AppComponent, {
206
+ * providers: [
207
+ * provideEnvironmentInitializer(() => {
208
+ * registerLocaleData(localeDeCH);
209
+ * registerLocaleData(localeFrCH);
210
+ * registerLocaleData(localeItCH);
211
+ * }),
212
+ * ],
213
+ * });
214
+ * ```
215
+ */
216
+ declare const SCI_LOCALE: InjectionToken<WritableSignal<string>>;
217
+
218
+ export { SCI_LOCALE, SciAttributesDirective, SciComponentOutletDirective, assertInInjectionContext, coerceSignal, createDestroyableInjector, toLazyObservable };
185
219
  export type { MaybeSignal, SciComponentDescriptor, SciTemplateDescriptor };
@@ -60,61 +60,8 @@ declare class SciIconComponent {
60
60
  * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..24,400,0&display=block');
61
61
  * ```
62
62
  *
63
- * SCION uses the following built-in icons:
64
- * - scion.add : Add an item
65
- * - scion.add_large : Add an item (large)
66
- * - scion.bin : Bin symbol
67
- * - scion.checkmark : Indicates a selected option
68
- * - scion.chevron_down : Chevron down symbol
69
- * - scion.chevron_left : Chevron left symbol
70
- * - scion.chevron_right : Chevron right symbol
71
- * - scion.chevron_up : Chevron up symbol
72
- * - scion.clear : Clear items
73
- * - scion.close : Close a popover
74
- * - scion.collapse_all : Collapse all items
75
- * - scion.copy : Copy an item
76
- * - scion.delete : Delete an item
77
- * - scion.dirty : Indicates unsaved data
78
- * - scion.drag_handle : Drag or move an item
79
- * - scion.duplicate : Duplicate an item
80
- * - scion.edit : Edit an item
81
- * - scion.emdash : Em dash symbol
82
- * - scion.envelope : Envelope symbol
83
- * - scion.envelope_closed : Indicates a closed envelope
84
- * - scion.envelope_opened : Indicates an opened envelope
85
- * - scion.expand_all : Expand an item
86
- * - scion.external_link : Open link in a new tab
87
- * - scion.filter : Set or change a filter
88
- * - scion.find : Find an item
89
- * - scion.folder : Directory symbol
90
- * - scion.help : Indicates help, support, or documentation
91
- * - scion.hide : Hide a panel
92
- * - scion.magnifier : Magnifier symbol
93
- * - scion.minimize : Minimize a panel
94
- * - scion.minus : Minus sign
95
- * - scion.modified : Indicates modified data
96
- * - scion.more_horizontal : Show a popover to the left or right
97
- * - scion.more_vertical : Show a popover above or below
98
- * - scion.new : Create an item
99
- * - scion.new_large : Create an item (large)
100
- * - scion.paste : Paste from clipboard
101
- * - scion.pen : Pen symbol
102
- * - scion.pin : Pin an item
103
- * - scion.pinned : Indicates a pinned item
104
- * - scion.placeholder_frame : Placeholder symbol
105
- * - scion.placeholder_image : Placeholder symbol for an image
106
- * - scion.plus : Plus sign
107
- * - scion.plus_large : Plus sign (large)
108
- * - scion.remove : Remove an item (x)
109
- * - scion.remove_minus : Remove an item (-)
110
- * - scion.reset : Reset a form
111
- * - scion.search : Search for an item
112
- * - scion.sort_ascending : Sort items in ascending order (A-Z, 0-9)
113
- * - scion.sort_by : Change sort order
114
- * - scion.sort_descending : Sort items in descending order (Z-A, 9-0)
115
- * - scion.user : User symbol
116
- *
117
- * To not replace built-in icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.
63
+ * 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.
64
+ * Refer to https://icons.scion.vercel.app for available SCION icons.
118
65
  *
119
66
  * The function can call `inject` to get any required dependencies.
120
67
  *
@@ -130,7 +77,7 @@ declare function provideIconProvider(iconProviderFn: SciIconProviderFn | undefin
130
77
  * Alternatively, the icon provider can return a descriptor, allowing for additional configuration such as inputs.
131
78
  * Inputs are available as input properties in the component. The component can use the inputs to render the icon.
132
79
  *
133
- * Icon keys used by SCION start with the `scion.` prefix. To not replace built-in icons, the icon provider can
80
+ * Icon keys used by SCION start with the `scion.` prefix. To not replace SCION icons, the icon provider can
134
81
  * return `undefined` for icons starting with the `scion.` prefix.
135
82
  *
136
83
  * An icon provider can be registered via {@link provideIconProvider} function.