@scion/components 19.3.0 → 21.0.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.
Files changed (55) hide show
  1. package/dimension/package.json +2 -1
  2. package/fesm2022/scion-components-dimension.mjs +11 -44
  3. package/fesm2022/scion-components-dimension.mjs.map +1 -1
  4. package/fesm2022/scion-components-sashbox.mjs +34 -101
  5. package/fesm2022/scion-components-sashbox.mjs.map +1 -1
  6. package/fesm2022/scion-components-splitter.mjs +8 -46
  7. package/fesm2022/scion-components-splitter.mjs.map +1 -1
  8. package/fesm2022/scion-components-throbber.mjs +19 -50
  9. package/fesm2022/scion-components-throbber.mjs.map +1 -1
  10. package/fesm2022/scion-components-viewport.mjs +25 -66
  11. package/fesm2022/scion-components-viewport.mjs.map +1 -1
  12. package/package.json +13 -12
  13. package/sashbox/package.json +2 -1
  14. package/splitter/package.json +2 -1
  15. package/throbber/package.json +2 -1
  16. package/types/scion-components-dimension.d.ts +81 -0
  17. package/types/scion-components-sashbox.d.ts +171 -0
  18. package/{splitter/splitter.component.d.ts → types/scion-components-splitter.d.ts} +15 -11
  19. package/{throbber/throbber.component.d.ts → types/scion-components-throbber.d.ts} +6 -3
  20. package/{viewport/viewport.component.d.ts → types/scion-components-viewport.d.ts} +163 -7
  21. package/types/scion-components.d.ts +2 -0
  22. package/viewport/package.json +2 -1
  23. package/dimension/bounding-client-rect.signal.d.ts +0 -23
  24. package/dimension/dimension.d.ts +0 -10
  25. package/dimension/dimension.directive.d.ts +0 -25
  26. package/dimension/dimension.module.d.ts +0 -14
  27. package/dimension/dimension.signal.d.ts +0 -19
  28. package/dimension/index.d.ts +0 -5
  29. package/dimension/public_api.d.ts +0 -5
  30. package/index.d.ts +0 -5
  31. package/public-api.d.ts +0 -4
  32. package/sashbox/element-ref.directive.d.ts +0 -9
  33. package/sashbox/index.d.ts +0 -5
  34. package/sashbox/public_api.d.ts +0 -3
  35. package/sashbox/sash/sash.component.d.ts +0 -31
  36. package/sashbox/sash.directive.d.ts +0 -70
  37. package/sashbox/sashbox-accessor.d.ts +0 -10
  38. package/sashbox/sashbox.component.d.ts +0 -110
  39. package/sashbox/sashbox.module.d.ts +0 -31
  40. package/splitter/index.d.ts +0 -5
  41. package/splitter/public_api.d.ts +0 -2
  42. package/splitter/splitter.module.d.ts +0 -18
  43. package/throbber/ellipsis-throbber/ellipsis-throbber.component.d.ts +0 -10
  44. package/throbber/index.d.ts +0 -5
  45. package/throbber/public_api.d.ts +0 -2
  46. package/throbber/ripple-throbber/ripple-throbber.component.d.ts +0 -10
  47. package/throbber/roller-throbber/roller-throbber.component.d.ts +0 -10
  48. package/throbber/spinner-throbber/spinner-throbber.component.d.ts +0 -11
  49. package/throbber/throbber.module.d.ts +0 -12
  50. package/viewport/index.d.ts +0 -5
  51. package/viewport/native-scrollbar-track-size-provider.service.d.ts +0 -30
  52. package/viewport/public_api.d.ts +0 -4
  53. package/viewport/scrollable.directive.d.ts +0 -38
  54. package/viewport/scrollbar/scrollbar.component.d.ts +0 -86
  55. package/viewport/viewport.module.d.ts +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scion/components",
3
- "version": "19.3.0",
3
+ "version": "21.0.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,
@@ -17,7 +17,7 @@
17
17
  "exports": {
18
18
  ".": {
19
19
  "sass": "./_index.scss",
20
- "types": "./index.d.ts",
20
+ "types": "./types/scion-components.d.ts",
21
21
  "default": "./fesm2022/scion-components.mjs"
22
22
  },
23
23
  "./design": {
@@ -30,23 +30,23 @@
30
30
  "default": "./package.json"
31
31
  },
32
32
  "./dimension": {
33
- "types": "./dimension/index.d.ts",
33
+ "types": "./types/scion-components-dimension.d.ts",
34
34
  "default": "./fesm2022/scion-components-dimension.mjs"
35
35
  },
36
36
  "./sashbox": {
37
- "types": "./sashbox/index.d.ts",
37
+ "types": "./types/scion-components-sashbox.d.ts",
38
38
  "default": "./fesm2022/scion-components-sashbox.mjs"
39
39
  },
40
40
  "./splitter": {
41
- "types": "./splitter/index.d.ts",
41
+ "types": "./types/scion-components-splitter.d.ts",
42
42
  "default": "./fesm2022/scion-components-splitter.mjs"
43
43
  },
44
44
  "./throbber": {
45
- "types": "./throbber/index.d.ts",
45
+ "types": "./types/scion-components-throbber.d.ts",
46
46
  "default": "./fesm2022/scion-components-throbber.mjs"
47
47
  },
48
48
  "./viewport": {
49
- "types": "./viewport/index.d.ts",
49
+ "types": "./types/scion-components-viewport.d.ts",
50
50
  "default": "./fesm2022/scion-components-viewport.mjs"
51
51
  }
52
52
  },
@@ -54,10 +54,11 @@
54
54
  "tslib": "^2.5.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@angular/common": "^19.0.0",
58
- "@angular/core": "^19.0.0",
59
- "@angular/cdk": "^19.0.0",
60
- "@scion/toolkit": "^1.6.0",
57
+ "@angular/core": "^21.0.0",
58
+ "@angular/common": "^21.0.0",
59
+ "@angular/animations": "^21.0.0",
60
+ "@angular/cdk": "^21.0.0",
61
+ "@scion/toolkit": "^2.0.0",
61
62
  "rxjs": "^7.8.0"
62
63
  },
63
64
  "repository": {
@@ -66,5 +67,5 @@
66
67
  },
67
68
  "sideEffects": false,
68
69
  "module": "fesm2022/scion-components.mjs",
69
- "typings": "index.d.ts"
70
+ "typings": "types/scion-components.d.ts"
70
71
  }
@@ -1,3 +1,4 @@
1
1
  {
2
- "module": "../fesm2022/scion-components-sashbox.mjs"
2
+ "module": "../fesm2022/scion-components-sashbox.mjs",
3
+ "typings": "../types/scion-components-sashbox.d.ts"
3
4
  }
@@ -1,3 +1,4 @@
1
1
  {
2
- "module": "../fesm2022/scion-components-splitter.mjs"
2
+ "module": "../fesm2022/scion-components-splitter.mjs",
3
+ "typings": "../types/scion-components-splitter.d.ts"
3
4
  }
@@ -1,3 +1,4 @@
1
1
  {
2
- "module": "../fesm2022/scion-components-throbber.mjs"
2
+ "module": "../fesm2022/scion-components-throbber.mjs",
3
+ "typings": "../types/scion-components-throbber.d.ts"
3
4
  }
@@ -0,0 +1,81 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef, Signal, Injector } from '@angular/core';
3
+
4
+ /**
5
+ * Represents the dimension of an element.
6
+ */
7
+ interface SciDimension {
8
+ offsetWidth: number;
9
+ offsetHeight: number;
10
+ clientWidth: number;
11
+ clientHeight: number;
12
+ element: HTMLElement;
13
+ }
14
+
15
+ /**
16
+ * Observes the size of the host element.
17
+ *
18
+ * ---
19
+ * Usage:
20
+ *
21
+ * ```html
22
+ * <div sciDimension (sciDimensionChange)="onDimensionChange($event)"></div>
23
+ * ```
24
+ */
25
+ declare class SciDimensionDirective {
26
+ /**
27
+ * Controls if to output outside the Angular zone. Defaults to `false`.
28
+ */
29
+ readonly emitOutsideAngular: _angular_core.InputSignal<boolean>;
30
+ /**
31
+ * Outputs the size of the element.
32
+ */
33
+ readonly dimensionChange: _angular_core.OutputEmitterRef<SciDimension>;
34
+ constructor();
35
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SciDimensionDirective, never>;
36
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SciDimensionDirective, "[sciDimension]", never, { "emitOutsideAngular": { "alias": "emitOutsideAngular"; "required": false; "isSignal": true; }; }, { "dimensionChange": "sciDimensionChange"; }, never, never, true, never>;
37
+ }
38
+
39
+ /**
40
+ * Creates a signal observing the size of an element.
41
+ *
42
+ * The element can be passed as a signal, enabling observation of view children in the component constructor.
43
+ *
44
+ * The signal subscribes to the native {@link ResizeObserver} to monitor element size changes. Destroying the injection context will unsubscribe the observer.
45
+ *
46
+ * Usage:
47
+ * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.
48
+ * - Must not be called within a reactive context to avoid repeated subscriptions.
49
+ */
50
+ declare function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {
51
+ injector?: Injector;
52
+ }): Signal<SciDimension>;
53
+ declare function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {
54
+ injector?: Injector;
55
+ }): Signal<SciDimension | undefined>;
56
+
57
+ /**
58
+ * Creates a signal observing the bounding box of an element.
59
+ *
60
+ * The bounding box includes the element's position relative to the top-left of the viewport and its size.
61
+ * Refer to https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect for more details.
62
+ *
63
+ * The element can be passed as a signal, enabling observation of view children in the component constructor.
64
+ *
65
+ * There is no native browser API to observe the position of an element. The signal uses {@link IntersectionObserver} and
66
+ * {@link ResizeObserver} to detect position changes. For tracking only size changes, use the {@link dimension} signal instead.
67
+ *
68
+ * Usage:
69
+ * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.
70
+ * - Must not be called within a reactive context to avoid repeated subscriptions.
71
+ * - The element and the document root (`<html>`) must be positioned `relative` or `absolute`. If not, positioning is changed to `relative`.
72
+ */
73
+ declare function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {
74
+ injector?: Injector;
75
+ }): Signal<DOMRect>;
76
+ declare function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {
77
+ injector?: Injector;
78
+ }): Signal<DOMRect | undefined>;
79
+
80
+ export { SciDimensionDirective, boundingClientRect, dimension };
81
+ export type { SciDimension };
@@ -0,0 +1,171 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { SplitterMoveEvent } from '@scion/components/splitter';
3
+
4
+ /**
5
+ * The <sci-sashbox> is like a CSS flexbox container that lays out its content children (sashes) in a row (which is by default)
6
+ * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to
7
+ * shrink or stretch the individual sashes.
8
+ *
9
+ * Sashes are modelled as <ng-template> decorated with the 'sciSash' directive.
10
+ * A sash can have a fixed size with an explicit unit, or a unitless proportion to distribute remaining space.
11
+ * A proportional sash has the ability to grow or shrink if necessary.
12
+ *
13
+ * Sash content is added to a CSS grid container with a single column, stretching the content vertically and horizontally.
14
+ *
15
+ * ### Usage
16
+ *
17
+ * ```html
18
+ * <sci-sashbox direction="row">
19
+ * <ng-template sciSash size="1">
20
+ * ...
21
+ * </ng-template>
22
+ *
23
+ * <ng-template sciSash size="2">
24
+ * ...
25
+ * </ng-template>
26
+ *
27
+ * <ng-template sciSash size="1">
28
+ * ...
29
+ * </ng-template>
30
+ * </sci-sashbox>
31
+ * ```
32
+ *
33
+ * ### Styling
34
+ *
35
+ * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
36
+ * To style a specific `sci-sashbox` component, the following CSS variables can be set directly on the component.
37
+ *
38
+ * - --sci-sashbox-gap: Sets the gaps (gutters) between sashes.
39
+ * - --sci-sashbox-splitter-background-color: Sets the background color of the splitter.
40
+ * - --sci-sashbox-splitter-background-color-hover: Sets the background color of the splitter when hovering it.
41
+ * - --sci-sashbox-splitter-size: Sets the size of the splitter along the main axis.
42
+ * - --sci-sashbox-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.
43
+ * - --sci-sashbox-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).
44
+ * - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross axis.
45
+ * - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter.
46
+ * - --sci-sashbox-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.
47
+ * - --sci-sashbox-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.
48
+ *
49
+ * Example:
50
+ *
51
+ * ```scss
52
+ * sci-sashbox {
53
+ * --sci-sashbox-splitter-background-color: black;
54
+ * --sci-sashbox-splitter-background-color-hover: black;
55
+ * }
56
+ * ```
57
+ */
58
+ declare class SciSashboxComponent {
59
+ /**
60
+ * Specifies if to lay out sashes in a row (which is by default) or column arrangement.
61
+ */
62
+ readonly direction: _angular_core.InputSignal<"column" | "row">;
63
+ /**
64
+ * Notifies when start sashing.
65
+ */
66
+ readonly sashStart: _angular_core.OutputEmitterRef<void>;
67
+ /**
68
+ * Emits an object with new sash sizes when sashing ends.
69
+ *
70
+ * Each sash size is associated with its {@link SciSashDirective.key} or its display position (zero-based) if not set.
71
+ */
72
+ readonly sashEnd: _angular_core.OutputEmitterRef<{
73
+ [key: string]: number;
74
+ }>;
75
+ private readonly _host;
76
+ private readonly _contentChildren;
77
+ protected sashing: boolean;
78
+ protected maxHeight: number | undefined;
79
+ protected maxWidth: number | undefined;
80
+ constructor();
81
+ protected onSashStart(): void;
82
+ protected onSashEnd(): void;
83
+ protected onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void;
84
+ protected onSashReset(sashIndex: number): void;
85
+ private toPixel;
86
+ /**
87
+ * Detects when rendered this component for the first time.
88
+ */
89
+ private detectFirstRendering;
90
+ /**
91
+ * Mirrors the provided signal. If animated sashes are being removed, delays emission until the animation completes,
92
+ * effectively removing the element after the animation.
93
+ *
94
+ * Delayed removal is required for CDK Portals to not remove displayed content immediately.
95
+ */
96
+ private computeSashes;
97
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SciSashboxComponent, never>;
98
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SciSashboxComponent, "sci-sashbox", never, { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, { "sashStart": "sashStart"; "sashEnd": "sashEnd"; }, ["_contentChildren"], never, true, never>;
99
+ }
100
+
101
+ /**
102
+ * Use this directive to model a sash for {@link SciSashboxComponent}.
103
+ * The host element of this modelling directive must be a <ng-template> which is used as sash template.
104
+ *
105
+ *
106
+ * ### Usage:
107
+ *
108
+ * <sci-sashbox direction="row">
109
+ * <!-- fixed size sash -->
110
+ * <ng-template sciSash size="200px">
111
+ * ...
112
+ * </ng-template>
113
+ *
114
+ * <!-- sash which takes the remaining space -->
115
+ * <ng-template sciSash>
116
+ * ...
117
+ * </ng-template>
118
+ * </sci-sashbox>
119
+ */
120
+ declare class SciSashDirective {
121
+ /**
122
+ * Specifies the sash size, either as fixed size with an explicit unit,
123
+ * or as a unitless proportion to distribute remaining space. A proportional
124
+ * sash has the ability to grow or shrink if necessary, and must be >= 1.
125
+ *
126
+ * If not set, remaining space is distributed equally.
127
+ */
128
+ readonly size: _angular_core.InputSignalWithTransform<string | number, string | number | null | undefined>;
129
+ /**
130
+ * Specifies the minimal sash size in pixel or percent.
131
+ * The min-size prevents the user from shrinking the sash below this minimal size.
132
+ *
133
+ * If the unit is omitted, the value is interpreted as a pixel value.
134
+ */
135
+ readonly minSize: _angular_core.InputSignal<string | number | undefined>;
136
+ /**
137
+ * Specifies an optional key to identify this sash.
138
+ *
139
+ * The key is used as the property key in the object emitted by {@link SciSashboxComponent.sashEnd} to associate the size of this sash.
140
+ */
141
+ readonly key: _angular_core.InputSignal<string | undefined>;
142
+ /**
143
+ * Controls whether to animate the entering and leaving of this sash, only if fixed-sized. Defaults to `false`.
144
+ *
145
+ * Enabling animation will mimic the behavior of a side panel that slides in or out.
146
+ *
147
+ * Note: Animates only sashes added or removed after the initial rendering.
148
+ */
149
+ readonly animate: _angular_core.InputSignalWithTransform<boolean, unknown>;
150
+ private readonly _sashBoxAccessor;
151
+ private readonly _component;
152
+ /**
153
+ * Flex properties computed based on the configured {@link size}. Properties are updated when moving this sash.
154
+ */
155
+ private readonly _flexProperties;
156
+ /**
157
+ * Computes the flex properties to lay out this sash in the sashbox's flex layout based on the configured {@link size}.
158
+ */
159
+ private computeFlexProperties;
160
+ /**
161
+ * Normalizes the 'flex-grow' of the passed {@link FlexProperties} to ensure that the sum of the 'flex-grow' proportions of all sashes is 1.
162
+ *
163
+ * If the sum of all flex-grow proportions were less than 1, the sashes would not fill the entire sash-box space.
164
+ * Without normalization, this could occur when a sash is removed.
165
+ */
166
+ private normalizeFlexGrow;
167
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SciSashDirective, never>;
168
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SciSashDirective, "ng-template[sciSash]", ["sciSash"], { "size": { "alias": "size"; "required": false; "isSignal": true; }; "minSize": { "alias": "minSize"; "required": false; "isSignal": true; }; "key": { "alias": "key"; "required": false; "isSignal": true; }; "animate": { "alias": "animate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
169
+ }
170
+
171
+ export { SciSashDirective, SciSashboxComponent };
@@ -1,5 +1,6 @@
1
+ import * as _angular_core from '@angular/core';
1
2
  import { OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
+
3
4
  /**
4
5
  * Represents a splitter, a visual element that allows the user to control the size of elements next to it.
5
6
  *
@@ -41,27 +42,27 @@ import * as i0 from "@angular/core";
41
42
  * }
42
43
  * ```
43
44
  */
44
- export declare class SciSplitterComponent implements OnInit {
45
+ declare class SciSplitterComponent implements OnInit {
45
46
  /**
46
47
  * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.
47
48
  */
48
- readonly orientation: import("@angular/core").InputSignal<"vertical" | "horizontal">;
49
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
49
50
  /**
50
51
  * Notifies when start moving the splitter.
51
52
  */
52
- readonly start: import("@angular/core").OutputEmitterRef<void>;
53
+ readonly start: _angular_core.OutputEmitterRef<void>;
53
54
  /**
54
55
  * Notifies when moving the splitter. The event is emitted outside the Angular zone.
55
56
  */
56
- readonly move: import("@angular/core").OutputEmitterRef<SplitterMoveEvent>;
57
+ readonly move: _angular_core.OutputEmitterRef<SplitterMoveEvent>;
57
58
  /**
58
59
  * Notifies when end moving the splitter.
59
60
  */
60
- readonly end: import("@angular/core").OutputEmitterRef<void>;
61
+ readonly end: _angular_core.OutputEmitterRef<void>;
61
62
  /**
62
63
  * Notifies when resetting the spliter position.
63
64
  */
64
- readonly reset: import("@angular/core").OutputEmitterRef<void>;
65
+ readonly reset: _angular_core.OutputEmitterRef<void>;
65
66
  private readonly _zone;
66
67
  private readonly _cd;
67
68
  private readonly _document;
@@ -76,10 +77,10 @@ export declare class SciSplitterComponent implements OnInit {
76
77
  private onTouchStart;
77
78
  private onMouseDown;
78
79
  private installMoveListener;
79
- static ɵfac: i0.ɵɵFactoryDeclaration<SciSplitterComponent, never>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<SciSplitterComponent, "sci-splitter", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "start": "start"; "move": "move"; "end": "end"; "reset": "reset"; }, never, never, true, never>;
80
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SciSplitterComponent, never>;
81
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SciSplitterComponent, "sci-splitter", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "start": "start"; "move": "move"; "end": "end"; "reset": "reset"; }, never, never, true, never>;
81
82
  }
82
- export interface EventPosition {
83
+ interface EventPosition {
83
84
  clientPos: number;
84
85
  pagePos: number;
85
86
  screenPos: number;
@@ -87,7 +88,7 @@ export interface EventPosition {
87
88
  /**
88
89
  * Event that is emitted when moving the splitter.
89
90
  */
90
- export interface SplitterMoveEvent {
91
+ interface SplitterMoveEvent {
91
92
  /**
92
93
  * The distance in pixels by which the user has moved the splitter since the last emission.
93
94
  */
@@ -97,3 +98,6 @@ export interface SplitterMoveEvent {
97
98
  */
98
99
  position: EventPosition;
99
100
  }
101
+
102
+ export { SciSplitterComponent };
103
+ export type { EventPosition, SplitterMoveEvent };
@@ -1,4 +1,5 @@
1
- import * as i0 from "@angular/core";
1
+ import * as i0 from '@angular/core';
2
+
2
3
  /**
3
4
  * Animated graphical control to indicate the execution of an action.
4
5
  *
@@ -25,7 +26,7 @@ import * as i0 from "@angular/core";
25
26
  * }
26
27
  * ```
27
28
  */
28
- export declare class SciThrobberComponent {
29
+ declare class SciThrobberComponent {
29
30
  /**
30
31
  * Chooses between different throbber presentation. If not set, uses `spinner` type.
31
32
  *
@@ -38,7 +39,9 @@ export declare class SciThrobberComponent {
38
39
  * - **spinner** (default)
39
40
  * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction and then then fade out again.
40
41
  */
41
- readonly type: import("@angular/core").InputSignal<"ellipsis" | "ripple" | "roller" | "spinner">;
42
+ readonly type: i0.InputSignal<"ellipsis" | "ripple" | "roller" | "spinner">;
42
43
  static ɵfac: i0.ɵɵFactoryDeclaration<SciThrobberComponent, never>;
43
44
  static ɵcmp: i0.ɵɵComponentDeclaration<SciThrobberComponent, "sci-throbber", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
44
45
  }
46
+
47
+ export { SciThrobberComponent };
@@ -1,6 +1,35 @@
1
- import { ElementRef } from '@angular/core';
2
- import { SciNativeScrollbarTrackSizeProvider } from './native-scrollbar-track-size-provider.service';
3
- import * as i0 from "@angular/core";
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, ElementRef } from '@angular/core';
3
+
4
+ /**
5
+ * Provides the native scrollbar tracksize.
6
+ */
7
+ declare class SciNativeScrollbarTrackSizeProvider {
8
+ private readonly _document;
9
+ private readonly _zone;
10
+ /**
11
+ * Provides the track size of the native scrollbar, or `null` if the native scrollbars sit on top of the content.
12
+ */
13
+ trackSize: Signal<NativeScrollbarTrackSize | null>;
14
+ constructor();
15
+ /**
16
+ * Computes the native scrollbar track size.
17
+ *
18
+ * @returns native track size, or `null` if the native scrollbars sit on top of the content.
19
+ */
20
+ private computeTrackSize;
21
+ private createNativeScrollbarTrackSizeSignal;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciNativeScrollbarTrackSizeProvider, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<SciNativeScrollbarTrackSizeProvider>;
24
+ }
25
+ /**
26
+ * Represents the native scrollbar track size.
27
+ */
28
+ interface NativeScrollbarTrackSize {
29
+ hScrollbarTrackHeight: number;
30
+ vScrollbarTrackWidth: number;
31
+ }
32
+
4
33
  /**
5
34
  * Represents a viewport with slotted content (`<ng-content>`) used as scrollable content. By default, content is added to a CSS grid layout.
6
35
  *
@@ -68,15 +97,15 @@ import * as i0 from "@angular/core";
68
97
  * }
69
98
  * ```
70
99
  */
71
- export declare class SciViewportComponent {
100
+ declare class SciViewportComponent {
72
101
  /**
73
102
  * Controls if to use the native scrollbar or a scrollbar that sits on top of the viewport. Defaults to `on-top`.
74
103
  */
75
- readonly scrollbarStyle: import("@angular/core").InputSignal<ScrollbarStyle>;
104
+ readonly scrollbarStyle: i0.InputSignal<ScrollbarStyle>;
76
105
  /**
77
106
  * Emits when the viewport is scrolled. The event is emitted outside the Angular zone to avoid unnecessary change detection cycles.
78
107
  */
79
- readonly scroll: import("@angular/core").OutputEmitterRef<Event>;
108
+ readonly scroll: i0.OutputEmitterRef<Event>;
80
109
  private readonly _host;
81
110
  private readonly _viewport;
82
111
  private readonly _viewportClient;
@@ -159,4 +188,131 @@ export declare class SciViewportComponent {
159
188
  /**
160
189
  * Represents a scrollbar style.
161
190
  */
162
- export type ScrollbarStyle = 'native' | 'on-top' | 'hidden';
191
+ type ScrollbarStyle = 'native' | 'on-top' | 'hidden';
192
+
193
+ /**
194
+ * Renders a vertical or horizontal scrollbar.
195
+ *
196
+ * The scrollbar features the following functionality:
197
+ * - allows to move the thumb by mouse or touch
198
+ * - enlarges the thumb if the mouse pointer is near the thumb
199
+ * - allows paging on mousedown on the scroll track
200
+ *
201
+ * ### Styling:
202
+ *
203
+ * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
204
+ * To style a specific `sci-scrollbar` component, the following CSS variables can be set directly on the component.
205
+ *
206
+ * - sci-scrollbar-color: Sets the color of the scrollbar.
207
+ *
208
+ * Example:
209
+ *
210
+ * ```css
211
+ *
212
+ * sci-scrollbar {
213
+ * --sci-scrollbar-color: blue;
214
+ * }
215
+ * ```
216
+ */
217
+ declare class SciScrollbarComponent {
218
+ /**
219
+ * Specifies the direction of the scrollbar. Defaults to a vertical scrollbar.
220
+ */
221
+ readonly direction: i0.InputSignal<"vscroll" | "hscroll">;
222
+ /**
223
+ * The viewport to provide scrollbars for.
224
+ */
225
+ readonly viewport: i0.InputSignal<HTMLElement>;
226
+ private readonly _host;
227
+ private readonly _document;
228
+ private readonly _zone;
229
+ private readonly _destroyRef;
230
+ private readonly _thumbElement;
231
+ private readonly _vertical;
232
+ private _lastDragPosition;
233
+ private _overflow;
234
+ private _thumbSizeFr;
235
+ private _thumbPositionFr;
236
+ protected get vertical(): boolean;
237
+ protected get horizontal(): boolean;
238
+ protected get scrolling(): boolean;
239
+ constructor();
240
+ /**
241
+ * Computes the scroll position and updates CSS variables to render the scroll position in the UI.
242
+ */
243
+ private renderScrollPosition;
244
+ protected onTouchStart(event: TouchEvent): void;
245
+ protected onTouchMove(event: TouchEvent): void;
246
+ protected onTouchEnd(event: TouchEvent): void;
247
+ protected onMouseDown(mousedownEvent: MouseEvent): void;
248
+ protected onScrollTrackMouseDown(event: MouseEvent, direction: 'up' | 'down'): void;
249
+ /**
250
+ * Renders the current scroll position when the viewport is scrolled.
251
+ */
252
+ private installScrollPositionRenderer;
253
+ /**
254
+ * Projects the given scrollbar scroll pixels into viewport scroll pixels.
255
+ */
256
+ private toViewportPanPx;
257
+ /**
258
+ * Moves the viewport client by the specified numbers of pixels.
259
+ */
260
+ private moveViewportClient;
261
+ /**
262
+ * Indicates if the content overflows.
263
+ */
264
+ get overflow(): boolean;
265
+ /**
266
+ * Scrolls continuously while holding the mouse pressed, or until the mouse leaves the scrolltrack.
267
+ */
268
+ private scrollWhileMouseDown;
269
+ private setCssVariable;
270
+ private get viewportSize();
271
+ private get viewportClientSize();
272
+ private get scrollPosition();
273
+ private get thumbSize();
274
+ private get trackSize();
275
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciScrollbarComponent, never>;
276
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciScrollbarComponent, "sci-scrollbar", never, { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "viewport": { "alias": "viewport"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
277
+ }
278
+
279
+ /**
280
+ * Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars
281
+ * already sit on top of the viewport (e.g. in OS X).
282
+ *
283
+ * Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'
284
+ * to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.
285
+ *
286
+ * This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element
287
+ * fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`
288
+ * to hide the pushed out native scrollbars.
289
+ */
290
+ declare class SciScrollableDirective {
291
+ /**
292
+ * Controls whether to display native scrollbars.
293
+ * Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.
294
+ */
295
+ readonly displayNativeScrollbar: i0.InputSignal<boolean>;
296
+ private readonly _host;
297
+ private readonly _renderer;
298
+ private readonly _nativeScrollbarTrackSizeProvider;
299
+ constructor();
300
+ /**
301
+ * Controls the display of the native scrollbar based on this directive's configuration.
302
+ */
303
+ private controlDisplayOfNativeScrollbar;
304
+ /**
305
+ * Uses the native scrollbars when content overflows.
306
+ */
307
+ private useNativeScrollbars;
308
+ /**
309
+ * Shifts the native scrollbars out of the visible viewport area.
310
+ */
311
+ private shiftNativeScrollbars;
312
+ private setStyle;
313
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciScrollableDirective, never>;
314
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SciScrollableDirective, "[sciScrollable]", never, { "displayNativeScrollbar": { "alias": "sciScrollableDisplayNativeScrollbar"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
315
+ }
316
+
317
+ export { SciScrollableDirective, SciScrollbarComponent, SciViewportComponent };
318
+ export type { ScrollbarStyle };
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -1,3 +1,4 @@
1
1
  {
2
- "module": "../fesm2022/scion-components-viewport.mjs"
2
+ "module": "../fesm2022/scion-components-viewport.mjs",
3
+ "typings": "../types/scion-components-viewport.d.ts"
3
4
  }
@@ -1,23 +0,0 @@
1
- import { ElementRef, Injector, Signal } from '@angular/core';
2
- /**
3
- * Creates a signal observing the bounding box of an element.
4
- *
5
- * The bounding box includes the element's position relative to the top-left of the viewport and its size.
6
- * Refer to https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect for more details.
7
- *
8
- * The element can be passed as a signal, enabling observation of view children in the component constructor.
9
- *
10
- * There is no native browser API to observe the position of an element. The signal uses {@link IntersectionObserver} and
11
- * {@link ResizeObserver} to detect position changes. For tracking only size changes, use the {@link dimension} signal instead.
12
- *
13
- * Usage:
14
- * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.
15
- * - Must not be called within a reactive context to avoid repeated subscriptions.
16
- * - The element and the document root (`<html>`) must be positioned `relative` or `absolute`. If not, a warning is logged, and positioning changed to `relative`.
17
- */
18
- export declare function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {
19
- injector?: Injector;
20
- }): Signal<DOMRect>;
21
- export declare function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {
22
- injector?: Injector;
23
- }): Signal<DOMRect | undefined>;