@scion/components 19.2.1 → 20.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 (49) hide show
  1. package/design/themes/_scion-dark-theme.scss +3 -1
  2. package/design/themes/_scion-light-theme.scss +3 -1
  3. package/dimension/index.d.ts +79 -3
  4. package/fesm2022/scion-components-dimension.mjs +5 -38
  5. package/fesm2022/scion-components-dimension.mjs.map +1 -1
  6. package/fesm2022/scion-components-sashbox.mjs +18 -85
  7. package/fesm2022/scion-components-sashbox.mjs.map +1 -1
  8. package/fesm2022/scion-components-splitter.mjs +6 -44
  9. package/fesm2022/scion-components-splitter.mjs.map +1 -1
  10. package/fesm2022/scion-components-throbber.mjs +17 -48
  11. package/fesm2022/scion-components-throbber.mjs.map +1 -1
  12. package/fesm2022/scion-components-viewport.mjs +16 -57
  13. package/fesm2022/scion-components-viewport.mjs.map +1 -1
  14. package/index.d.ts +2 -5
  15. package/package.json +6 -5
  16. package/sashbox/index.d.ts +169 -3
  17. package/splitter/index.d.ts +101 -3
  18. package/throbber/index.d.ts +45 -3
  19. package/viewport/index.d.ts +316 -3
  20. package/dimension/bounding-client-rect.signal.d.ts +0 -23
  21. package/dimension/dimension.d.ts +0 -10
  22. package/dimension/dimension.directive.d.ts +0 -25
  23. package/dimension/dimension.module.d.ts +0 -14
  24. package/dimension/dimension.signal.d.ts +0 -19
  25. package/dimension/public_api.d.ts +0 -5
  26. package/public-api.d.ts +0 -4
  27. package/sashbox/element-ref.directive.d.ts +0 -9
  28. package/sashbox/public_api.d.ts +0 -3
  29. package/sashbox/sash/sash.component.d.ts +0 -31
  30. package/sashbox/sash.directive.d.ts +0 -70
  31. package/sashbox/sashbox-accessor.d.ts +0 -10
  32. package/sashbox/sashbox.component.d.ts +0 -110
  33. package/sashbox/sashbox.module.d.ts +0 -31
  34. package/splitter/public_api.d.ts +0 -2
  35. package/splitter/splitter.component.d.ts +0 -99
  36. package/splitter/splitter.module.d.ts +0 -18
  37. package/throbber/ellipsis-throbber/ellipsis-throbber.component.d.ts +0 -10
  38. package/throbber/public_api.d.ts +0 -2
  39. package/throbber/ripple-throbber/ripple-throbber.component.d.ts +0 -10
  40. package/throbber/roller-throbber/roller-throbber.component.d.ts +0 -10
  41. package/throbber/spinner-throbber/spinner-throbber.component.d.ts +0 -11
  42. package/throbber/throbber.component.d.ts +0 -44
  43. package/throbber/throbber.module.d.ts +0 -12
  44. package/viewport/native-scrollbar-track-size-provider.service.d.ts +0 -30
  45. package/viewport/public_api.d.ts +0 -4
  46. package/viewport/scrollable.directive.d.ts +0 -38
  47. package/viewport/scrollbar/scrollbar.component.d.ts +0 -86
  48. package/viewport/viewport.component.d.ts +0 -162
  49. package/viewport/viewport.module.d.ts +0 -14
@@ -1,5 +1,171 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { SplitterMoveEvent } from '@scion/components/splitter';
3
+
1
4
  /**
2
- * Generated bundle index. Do not edit.
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
+ * ```
3
57
  */
4
- /// <amd-module name="@scion/components/sashbox" />
5
- export * from './public_api';
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,103 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit } from '@angular/core';
3
+
1
4
  /**
2
- * Generated bundle index. Do not edit.
5
+ * Represents a splitter, a visual element that allows the user to control the size of elements next to it.
6
+ *
7
+ * The splitter has a handle that the user can move depending on the orientation of the splitter.
8
+ *
9
+ * Note that this control neither does change the size of adjacent elements nor does it (re-)position itself, but emits the distance by
10
+ * which the user has theoretically moved the splitter. You must subscribe to these events and change your layout accordingly.
11
+ *
12
+ * In the toolkit, {@link SciSashboxComponent} uses this splitter to divide a layout into several resizable sections.
13
+ * Another use case would be a resizable sidebar panel.
14
+ *
15
+ * ### Usage
16
+ *
17
+ * ```html
18
+ * <sci-splitter (move)="onSplitterMove($event.distance)"></sci-splitter>
19
+ * ```
20
+ *
21
+ * ### Styling
22
+ *
23
+ * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
24
+ * To style a specific `sci-splitter` component, the following CSS variables can be set directly on the component.
25
+ *
26
+ * - --sci-splitter-background-color: Sets the background color of the splitter.
27
+ * - --sci-splitter-background-color-hover: Sets the background color of the splitter when hovering it.
28
+ * - --sci-splitter-size: Sets the size of the splitter along the main axis.
29
+ * - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.
30
+ * - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).
31
+ * - --sci-splitter-cross-axis-size: Sets the splitter size along the cross axis.
32
+ * - --sci-splitter-border-radius: Sets the border radius of the splitter.
33
+ * - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.
34
+ * - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.
35
+ *
36
+ * Example:
37
+ *
38
+ * ```scss
39
+ * sci-splitter {
40
+ * --sci-splitter-background-color: black;
41
+ * --sci-splitter-background-color-hover: black;
42
+ * }
43
+ * ```
3
44
  */
4
- /// <amd-module name="@scion/components/splitter" />
5
- export * from './public_api';
45
+ declare class SciSplitterComponent implements OnInit {
46
+ /**
47
+ * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.
48
+ */
49
+ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
50
+ /**
51
+ * Notifies when start moving the splitter.
52
+ */
53
+ readonly start: _angular_core.OutputEmitterRef<void>;
54
+ /**
55
+ * Notifies when moving the splitter. The event is emitted outside the Angular zone.
56
+ */
57
+ readonly move: _angular_core.OutputEmitterRef<SplitterMoveEvent>;
58
+ /**
59
+ * Notifies when end moving the splitter.
60
+ */
61
+ readonly end: _angular_core.OutputEmitterRef<void>;
62
+ /**
63
+ * Notifies when resetting the spliter position.
64
+ */
65
+ readonly reset: _angular_core.OutputEmitterRef<void>;
66
+ private readonly _zone;
67
+ private readonly _cd;
68
+ private readonly _document;
69
+ private readonly _destroyRef;
70
+ private readonly _touchTarget;
71
+ protected moving: boolean;
72
+ protected get isVertical(): boolean;
73
+ protected get isHorizontal(): boolean;
74
+ protected get splitterCursor(): string;
75
+ ngOnInit(): void;
76
+ private onReset;
77
+ private onTouchStart;
78
+ private onMouseDown;
79
+ private installMoveListener;
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>;
82
+ }
83
+ interface EventPosition {
84
+ clientPos: number;
85
+ pagePos: number;
86
+ screenPos: number;
87
+ }
88
+ /**
89
+ * Event that is emitted when moving the splitter.
90
+ */
91
+ interface SplitterMoveEvent {
92
+ /**
93
+ * The distance in pixels by which the user has moved the splitter since the last emission.
94
+ */
95
+ distance: number;
96
+ /**
97
+ * The position where the mouse or touch event has occurred.
98
+ */
99
+ position: EventPosition;
100
+ }
101
+
102
+ export { SciSplitterComponent };
103
+ export type { EventPosition, SplitterMoveEvent };
@@ -1,5 +1,47 @@
1
+ import * as i0 from '@angular/core';
2
+
1
3
  /**
2
- * Generated bundle index. Do not edit.
4
+ * Animated graphical control to indicate the execution of an action.
5
+ *
6
+ * Choose between different throbber presentations by setting the `type` property: `ellipsis`, `ripple`, `roller`, `spinner`.
7
+ *
8
+ * ### Styling:
9
+ *
10
+ * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
11
+ * To style a specific `sci-throbber` component, the following CSS variables can be set directly on the component.
12
+ *
13
+ * - sci-throbber-color: Sets the color of the throbber (by default, uses `lightgray`).
14
+ * - sci-throbber-size: Defines the size of the throbber. Most throbbers are quadratic having the same width and height.
15
+ * For non-quadratic throbbers, the size usually specifies the height (by default, uses `50px`).
16
+ * - sci-throbber-duration: Sets the duration of a single animation cycle (by default, uses `1.25s`).
17
+ *
18
+ * Example:
19
+ *
20
+ * ```css
21
+ *
22
+ * sci-throbber {
23
+ * --sci-throbber-color: blue;
24
+ * --sci-throbber-size: 50px;
25
+ * --sci-throbber-duration: 1s
26
+ * }
27
+ * ```
3
28
  */
4
- /// <amd-module name="@scion/components/throbber" />
5
- export * from './public_api';
29
+ declare class SciThrobberComponent {
30
+ /**
31
+ * Chooses between different throbber presentation. If not set, uses `spinner` type.
32
+ *
33
+ * - **ellipsis**
34
+ * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.
35
+ * - **ripple**
36
+ * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.
37
+ * - **roller**
38
+ * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.
39
+ * - **spinner** (default)
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.
41
+ */
42
+ readonly type: i0.InputSignal<"ellipsis" | "ripple" | "roller" | "spinner">;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciThrobberComponent, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciThrobberComponent, "sci-throbber", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
45
+ }
46
+
47
+ export { SciThrobberComponent };
@@ -1,5 +1,318 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, ElementRef } from '@angular/core';
3
+
1
4
  /**
2
- * Generated bundle index. Do not edit.
5
+ * Provides the native scrollbar tracksize.
3
6
  */
4
- /// <amd-module name="@scion/components/viewport" />
5
- export * from './public_api';
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
+
33
+ /**
34
+ * Represents a viewport with slotted content (`<ng-content>`) used as scrollable content. By default, content is added to a CSS grid layout.
35
+ *
36
+ * The viewport component displays scrollbars when its content overflows. Scrollbars are displayed on top of the content, not next to it.
37
+ * The component uses the native scrollbars of the operating system if they are already sitting on top, or falls back and renders scrollbars on top otherwise.
38
+ * The viewport remains natively scrollable with the native scrollbars shifted out of the viewport's visible area. Consequently, the viewport keeps supporting
39
+ * native scrolling features such as touch gestures, scroll speed acceleration, or scrolling near the viewport edges during drag-and-drop operations.
40
+ *
41
+ * ```html
42
+ * <sci-viewport>
43
+ * your content
44
+ * </sci-viewport>
45
+ * ```
46
+ *
47
+ * ## Adding the viewport to a layout
48
+ *
49
+ * Typically, you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container
50
+ * with the viewport's `flex` CSS property set to either `flex: auto` or `flex: 1 1 0`.
51
+ *
52
+ * The viewport is sized according to its content width and height. It grows to absorb any free space, thus overflowing its content only when encountering
53
+ * a layout constraint. Depending on the layout, different steps may be necessary to prevent the viewport from growing to infinity.
54
+ *
55
+ * - If practical, give the viewport a fixed size or a maximum size.
56
+ * - If you add the viewport to a flexbox layout, make sure that it cannot exceed the available space. Instead, the viewport should fill the remaining space,
57
+ * vertically and horizontally. Be aware that, by default, a flex item does not shrink below its minimum content size. To change this, set the viewport's
58
+ * `flex-basis` to `0` (instead of `auto`), or use the CSS shorthand property `flex: 1 1 0`. The `flex-basis` defines the default size of a flex item before
59
+ * the remaining extra space is distributed. If the viewport does not appear after setting this property, check its parent elements' content sizes.
60
+ * As an alternative to setting `flex: 1 1 0`, change the setting to `flex: auto` and hide the overflow in the parent element, as follows: `overflow: hidden`.
61
+ * Another approach would be to set the minimum height of all parents to `0`, as follows: `min-height: 0`.
62
+ *
63
+ * For the complete documentation on the flex layout and its features, refer to https://developer.mozilla.org/en-US/docs/Web/CSS/flex.
64
+ *
65
+ *
66
+ * ## Layouting the viewport's slotted content
67
+ *
68
+ * By default, the viewport's content is added to a CSS grid container with a single column, filling remaining space vertically and horizontally.
69
+ * Using the `::part(content)` pseudo element selector, you can configure the grid container or apply a different layout, such as a flex or flow layout.
70
+ *
71
+ * #### Example of adding slotted content to a CSS flex container
72
+ * ```css
73
+ * sci-viewport::part(content) {
74
+ * display: flex;
75
+ * flex-direction: column;
76
+ * }
77
+ * ```
78
+ *
79
+ * #### Example of configuring CSS grid container with two columns
80
+ * ```css
81
+ * sci-viewport::part(content) {
82
+ * grid-template-columns: 1fr 1fr;
83
+ * gap: 1em;
84
+ * }
85
+ * ```
86
+ *
87
+ * ## Styling
88
+ *
89
+ * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.
90
+ * To style a specific `sci-viewport` component, the following CSS variables can be set directly on the component.
91
+ *
92
+ * - sci-viewport-scrollbar-color: Sets the color of the scrollbar.
93
+ *
94
+ * ```css
95
+ * sci-viewport {
96
+ * --sci-viewport-scrollbar-color: blue;
97
+ * }
98
+ * ```
99
+ */
100
+ declare class SciViewportComponent {
101
+ /**
102
+ * Controls if to use the native scrollbar or a scrollbar that sits on top of the viewport. Defaults to `on-top`.
103
+ */
104
+ readonly scrollbarStyle: i0.InputSignal<ScrollbarStyle>;
105
+ /**
106
+ * Emits when the viewport is scrolled. The event is emitted outside the Angular zone to avoid unnecessary change detection cycles.
107
+ */
108
+ readonly scroll: i0.OutputEmitterRef<Event>;
109
+ private readonly _host;
110
+ private readonly _viewport;
111
+ private readonly _viewportClient;
112
+ protected readonly nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider;
113
+ constructor();
114
+ focus(): void;
115
+ /**
116
+ * Returns the number of pixels that the viewport client is scrolled vertically.
117
+ *
118
+ * @see Element.scrollTop
119
+ */
120
+ get scrollTop(): number;
121
+ /**
122
+ * Sets the number of pixels that the viewport client is scrolled vertically.
123
+ *
124
+ * @see Element.scrollTop
125
+ */
126
+ set scrollTop(scrollTop: number);
127
+ /**
128
+ * Returns the number of pixels that the viewport client is scrolled horizontally.
129
+ *
130
+ * @see Element.scrollLeft
131
+ */
132
+ get scrollLeft(): number;
133
+ /**
134
+ * Sets the number of pixels that the viewport client is scrolled horizontally.
135
+ *
136
+ * @see Element.scrollLeft
137
+ */
138
+ set scrollLeft(scrollLeft: number);
139
+ /**
140
+ * Returns the height of the viewport client.
141
+ *
142
+ * @see Element.scrollHeight
143
+ */
144
+ get scrollHeight(): number;
145
+ /**
146
+ * Returns the width of the viewport client.
147
+ *
148
+ * @see Element.scrollWidth
149
+ */
150
+ get scrollWidth(): number;
151
+ /**
152
+ * Returns the viewport {HTMLElement}.
153
+ */
154
+ get viewportElement(): HTMLElement;
155
+ /**
156
+ * Returns the viewport client {HTMLElement}.
157
+ */
158
+ get viewportClientElement(): HTMLElement;
159
+ /**
160
+ * Checks if the specified element is scrolled into the viewport.
161
+ *
162
+ * @param element - the element to be checked
163
+ * @param fit - control if the element must fully or partially fit into the viewport
164
+ * @return `true` if the element is scrolled into the viewport, or `false` otherwise.
165
+ */
166
+ isElementInView(element: ElementRef<HTMLElement> | HTMLElement, fit: 'full' | 'partial'): boolean;
167
+ /**
168
+ * Scrolls the specified element into the viewport.
169
+ *
170
+ * @param element - the element to scroll into the viewport
171
+ * @param offset - the gap between the element and the viewport
172
+ */
173
+ scrollIntoView(element: ElementRef<HTMLElement> | HTMLElement, offset?: number): void;
174
+ /**
175
+ * Computes the distance of the element to the viewport's left or top border.
176
+ *
177
+ * @return distance of the element to the viewport's left or top border, or `null` if not contained
178
+ * in the viewport or the element or any ancestor has the `display` property set to `none`.
179
+ */
180
+ computeOffset(element: ElementRef<HTMLElement> | HTMLElement, border: 'left' | 'top'): number | null;
181
+ /**
182
+ * Emits when the scroll position changes.
183
+ */
184
+ private installScrollEmitter;
185
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciViewportComponent, never>;
186
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciViewportComponent, "sci-viewport", never, { "scrollbarStyle": { "alias": "scrollbarStyle"; "required": false; "isSignal": true; }; }, { "scroll": "scroll"; }, never, never, true, never>;
187
+ }
188
+ /**
189
+ * Represents a scrollbar style.
190
+ */
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 };
@@ -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>;