@scion/components 22.5.0 → 22.6.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 +32 -88
- package/fesm2022/scion-components-common.mjs +133 -5
- package/fesm2022/scion-components-common.mjs.map +1 -1
- package/fesm2022/scion-components-dimension.mjs +3 -3
- package/fesm2022/scion-components-dimension.mjs.map +1 -1
- package/fesm2022/scion-components-icon.mjs +134 -98
- package/fesm2022/scion-components-icon.mjs.map +1 -1
- package/fesm2022/scion-components-menu.mjs +58 -51
- package/fesm2022/scion-components-menu.mjs.map +1 -1
- package/fesm2022/scion-components-sashbox.mjs +1 -1
- package/fesm2022/scion-components-sashbox.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 +352 -159
- package/fesm2022/scion-components-table.mjs.map +1 -1
- package/fesm2022/scion-components-text.mjs +83 -40
- package/fesm2022/scion-components-text.mjs.map +1 -1
- package/fesm2022/scion-components-throbber.mjs +1 -1
- package/fesm2022/scion-components-throbber.mjs.map +1 -1
- package/fesm2022/scion-components-viewport.mjs +31 -18
- package/fesm2022/scion-components-viewport.mjs.map +1 -1
- package/package.json +2 -2
- package/types/scion-components-common.d.ts +91 -4
- package/types/scion-components-icon.d.ts +42 -15
- package/types/scion-components-menu.d.ts +7 -2
- package/types/scion-components-sashbox.d.ts +1 -1
- package/types/scion-components-splitter.d.ts +1 -1
- package/types/scion-components-table.d.ts +440 -59
- package/types/scion-components-text.d.ts +6 -5
- package/types/scion-components-throbber.d.ts +1 -1
- package/types/scion-components-viewport.d.ts +20 -11
- package/viewport/scrollbar/_scrollbar.scss +12 -0
- package/design/icons/_scion-icon-font.scss +0 -50
|
@@ -7,15 +7,16 @@ import { MaybeSignal } from '@scion/components/common';
|
|
|
7
7
|
*
|
|
8
8
|
* A text provider is a function that returns the text for a translation key.
|
|
9
9
|
*
|
|
10
|
-
* Multiple text providers can be registered. Providers are called in registration order.
|
|
11
|
-
* the next provider is called, and so on.
|
|
10
|
+
* Multiple text providers can be registered. Providers are called in registration order. Returning `undefined` delegates to the next provider.
|
|
12
11
|
*
|
|
13
|
-
* The translation keys of built-in SCION texts start with the `scion
|
|
12
|
+
* The translation keys of built-in SCION texts start with the `scion:` prefix. To not localize built-in SCION texts, the text provider can return `undefined` instead.
|
|
14
13
|
*
|
|
15
14
|
* The function:
|
|
16
|
-
* - Can call `inject` to get
|
|
15
|
+
* - Can call `inject` to get required dependencies.
|
|
17
16
|
* - Can use `toSignal` to convert an {@link Observable} to a {@link Signal}.
|
|
18
17
|
*
|
|
18
|
+
* For a list of built-in SCION texts, refer to https://github.com/SchweizerischeBundesbahnen/scion-toolkit/blob/master/docs/site/scion-localization.md#built-in-texts.
|
|
19
|
+
*
|
|
19
20
|
* @see SciTextProviderFn
|
|
20
21
|
* @see text
|
|
21
22
|
*/
|
|
@@ -28,7 +29,7 @@ declare function provideTextProvider(textProviderFn: SciTextProviderFn | undefin
|
|
|
28
29
|
* A text provider can be registered via {@link provideTextProvider} function.
|
|
29
30
|
*
|
|
30
31
|
* The function:
|
|
31
|
-
* - Can call `inject` to get
|
|
32
|
+
* - Can call `inject` to get required dependencies from the root injector.
|
|
32
33
|
* - Can call `toSignal` to convert an {@link Observable} to a {@link Signal}.
|
|
33
34
|
*
|
|
34
35
|
* @param key - Translation key of the text.
|
|
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
|
|
|
7
7
|
*
|
|
8
8
|
* ### Styling:
|
|
9
9
|
*
|
|
10
|
-
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
|
|
10
|
+
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `src/styles.scss`.
|
|
11
11
|
* To style a specific `sci-throbber` component, the following CSS variables can be set directly on the component.
|
|
12
12
|
*
|
|
13
13
|
* - sci-throbber-color: Sets the color of the throbber (by default, uses `lightgray`).
|
|
@@ -57,7 +57,7 @@ import { Signal, ElementRef } from '@angular/core';
|
|
|
57
57
|
*
|
|
58
58
|
* ## Styling
|
|
59
59
|
*
|
|
60
|
-
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
|
|
60
|
+
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `src/styles.scss`.
|
|
61
61
|
* To style a specific `sci-viewport` component, the following CSS variables can be set directly on the component.
|
|
62
62
|
*
|
|
63
63
|
* - sci-viewport-scrollbar-color: Sets the color of the scrollbar.
|
|
@@ -164,24 +164,33 @@ declare class SciViewportComponent {
|
|
|
164
164
|
type ScrollbarStyle = 'native' | 'on-top' | 'hidden';
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
* Renders a vertical or horizontal scrollbar.
|
|
167
|
+
* Renders a vertical or horizontal scrollbar to scroll an associated viewport.
|
|
168
168
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
169
|
+
* Usage:
|
|
170
|
+
* ```html
|
|
171
|
+
* <div class="viewport" #viewport>
|
|
172
|
+
* ...
|
|
173
|
+
* </div>
|
|
174
|
+
* <sci-scrollbar [viewport]="viewport"/>
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* To hide the scrollbar when not hovering the associated viewport, set `opacity` to `0`. Transitions on `opacity` fade the scrollbar in and out.
|
|
178
|
+
*
|
|
179
|
+
* ```scss
|
|
180
|
+
* div.viewport:not(:hover) + sci-scrollbar {
|
|
181
|
+
* opacity: 0;
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
173
184
|
*
|
|
174
185
|
* ### Styling:
|
|
175
186
|
*
|
|
176
|
-
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
|
|
187
|
+
* To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `src/styles.scss`.
|
|
177
188
|
* To style a specific `sci-scrollbar` component, the following CSS variables can be set directly on the component.
|
|
178
189
|
*
|
|
179
|
-
* - --sci-scrollbar-color:
|
|
190
|
+
* - --sci-scrollbar-color: Sets the color of the scrollbar.
|
|
180
191
|
*
|
|
181
192
|
* Example:
|
|
182
|
-
*
|
|
183
|
-
* ```css
|
|
184
|
-
*
|
|
193
|
+
* ```scss
|
|
185
194
|
* sci-scrollbar {
|
|
186
195
|
* --sci-scrollbar-color: blue;
|
|
187
196
|
* }
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
* Positions scrollbars absolutely relative to the bounding box of the nearest positioned parent.
|
|
5
5
|
*
|
|
6
6
|
* Invoke from within the 'sci-scrollbar' selector.
|
|
7
|
+
*
|
|
8
|
+
* TODO [Angular 23] Marked for removal.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Since version 22.6.0. Marked for removal in 23.0.0. No replacement. Position the scrollbar using CSS properties (e.g., top, right, bottom, left) based on the scroll direction.
|
|
7
11
|
*/
|
|
8
12
|
@mixin position() {
|
|
13
|
+
@warn 'Deprecated since 22.6.0. Marked for removal in 23.0.0. No replacement. Position the scrollbar using CSS properties (e.g., top, right, bottom, left) based on the scroll direction.';
|
|
14
|
+
|
|
9
15
|
position: absolute;
|
|
10
16
|
|
|
11
17
|
&.vertical {
|
|
@@ -28,8 +34,14 @@
|
|
|
28
34
|
* - not scrolling (ensures the scrollbar to be visible even if dragging the thumb outside of the host element, :active pseudo-class not working in IE and Firefox)
|
|
29
35
|
*
|
|
30
36
|
* Invoke from within the viewport selector.
|
|
37
|
+
*
|
|
38
|
+
* TODO [Angular 23] Marked for removal.
|
|
39
|
+
*
|
|
40
|
+
* @deprecated Since version 22.6.0. Marked for removal in 23.0.0. No replacement. To hide the scrollbar, set its opacity to 0, e.g., when the viewport is not hovered.
|
|
31
41
|
*/
|
|
32
42
|
@mixin hide-when-inactive() {
|
|
43
|
+
@warn 'Deprecated since 22.6.0. Marked for removal in 23.0.0. No replacement. To hide the scrollbar, set its opacity to 0, e.g., when the viewport is not hovered.';
|
|
44
|
+
|
|
33
45
|
&:is(
|
|
34
46
|
:not(:hover):not(:active), // Support "regular" host
|
|
35
47
|
:host(:not(:hover):not(:active)) // Support "shadow" host
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Installs icons used in SCION.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use 'sass:map';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Current version of the icon font.
|
|
9
|
-
*
|
|
10
|
-
* UPDATE THIS VERSION WHEN ADDING, REMOVING OR CHANGING ICONS.
|
|
11
|
-
*
|
|
12
|
-
* This version is appended to the HTTP request as query parameter when fetching the icon font to support cache busting.
|
|
13
|
-
*/
|
|
14
|
-
$-version: 1;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* By default, the icon font is loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/icons
|
|
18
|
-
*/
|
|
19
|
-
$-icon-font-defaults: (
|
|
20
|
-
// NOTE: If self-hosting SCION icons, the font path must be "root-relative" or excluded from the application build.
|
|
21
|
-
// Otherwise, the build fails because the builder cannot resolve the font files relative to "this" SASS file.
|
|
22
|
-
// For esbuild, register excluded assets as `externalDependencies` in angular.json.
|
|
23
|
-
// For webpack, exclude assets by prefixing their path with a leading caret (^).
|
|
24
|
-
directory: 'https://cdn.jsdelivr.net/npm/@scion/icons',
|
|
25
|
-
filename: 'scion-icons',
|
|
26
|
-
version: $-version,
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Installs the 'scion-icons' font to render SCION icons.
|
|
31
|
-
*
|
|
32
|
-
* SCION icons are rendered in `ScionIconComponent`.
|
|
33
|
-
*/
|
|
34
|
-
@mixin install-icon-font($config) {
|
|
35
|
-
$config: if(sass($config): $config; else: ());
|
|
36
|
-
$config: map.merge($-icon-font-defaults, $config);
|
|
37
|
-
$path: map.get($config, directory) + '/' + map.get($config, filename);
|
|
38
|
-
$version: map.get($config, version);
|
|
39
|
-
|
|
40
|
-
@font-face {
|
|
41
|
-
font-family: 'scion-icons';
|
|
42
|
-
src: url($path + '.ttf?' + $version) format('truetype'),
|
|
43
|
-
url($path + '.woff?' + $version) format('woff'),
|
|
44
|
-
url($path + '.svg?' + $version + '#scion-icons') format('svg');
|
|
45
|
-
font-weight: normal;
|
|
46
|
-
font-style: normal;
|
|
47
|
-
// Prevent a flash of unstyled text content (FOUC) showing the ligatures until the font loads.
|
|
48
|
-
font-display: block;
|
|
49
|
-
}
|
|
50
|
-
}
|