@scion/components 13.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 (101) hide show
  1. package/README.md +40 -0
  2. package/_components.scss +1 -0
  3. package/_index.scss +23 -0
  4. package/dimension/dimension.directive.d.ts +43 -0
  5. package/dimension/dimension.module.d.ts +13 -0
  6. package/dimension/package.json +10 -0
  7. package/dimension/public_api.d.ts +2 -0
  8. package/dimension/scion-components-dimension.d.ts +5 -0
  9. package/esm2020/dimension/dimension.directive.mjs +83 -0
  10. package/esm2020/dimension/dimension.module.mjs +40 -0
  11. package/esm2020/dimension/public_api.mjs +17 -0
  12. package/esm2020/dimension/scion-components-dimension.mjs +5 -0
  13. package/esm2020/public-api.mjs +11 -0
  14. package/esm2020/sashbox/element-ref.directive.mjs +27 -0
  15. package/esm2020/sashbox/public_api.mjs +18 -0
  16. package/esm2020/sashbox/sash-initializer.directive.mjs +32 -0
  17. package/esm2020/sashbox/sash.directive.mjs +144 -0
  18. package/esm2020/sashbox/sashbox-accessor.mjs +6 -0
  19. package/esm2020/sashbox/sashbox.component.mjs +278 -0
  20. package/esm2020/sashbox/sashbox.module.mjs +71 -0
  21. package/esm2020/sashbox/scion-components-sashbox.mjs +5 -0
  22. package/esm2020/scion-components.mjs +5 -0
  23. package/esm2020/splitter/public_api.mjs +17 -0
  24. package/esm2020/splitter/scion-components-splitter.mjs +5 -0
  25. package/esm2020/splitter/splitter.component.mjs +227 -0
  26. package/esm2020/splitter/splitter.module.mjs +44 -0
  27. package/esm2020/throbber/ellipsis-throbber/ellipsis-throbber.component.mjs +25 -0
  28. package/esm2020/throbber/public_api.mjs +17 -0
  29. package/esm2020/throbber/ripple-throbber/ripple-throbber.component.mjs +25 -0
  30. package/esm2020/throbber/roller-throbber/roller-throbber.component.mjs +25 -0
  31. package/esm2020/throbber/scion-components-throbber.mjs +5 -0
  32. package/esm2020/throbber/spinner-throbber/spinner-throbber.component.mjs +26 -0
  33. package/esm2020/throbber/throbber.component.mjs +67 -0
  34. package/esm2020/throbber/throbber.module.mjs +50 -0
  35. package/esm2020/viewport/native-scrollbar-track-size-provider.service.mjs +114 -0
  36. package/esm2020/viewport/public_api.mjs +20 -0
  37. package/esm2020/viewport/scion-components-viewport.mjs +5 -0
  38. package/esm2020/viewport/scrollable.directive.mjs +93 -0
  39. package/esm2020/viewport/scrollbar/scrollbar.component.mjs +322 -0
  40. package/esm2020/viewport/viewport.component.mjs +265 -0
  41. package/esm2020/viewport/viewport.module.mjs +52 -0
  42. package/fesm2015/scion-components-dimension.mjs +137 -0
  43. package/fesm2015/scion-components-dimension.mjs.map +1 -0
  44. package/fesm2015/scion-components-sashbox.mjs +556 -0
  45. package/fesm2015/scion-components-sashbox.mjs.map +1 -0
  46. package/fesm2015/scion-components-splitter.mjs +286 -0
  47. package/fesm2015/scion-components-splitter.mjs.map +1 -0
  48. package/fesm2015/scion-components-throbber.mjs +216 -0
  49. package/fesm2015/scion-components-throbber.mjs.map +1 -0
  50. package/fesm2015/scion-components-viewport.mjs +846 -0
  51. package/fesm2015/scion-components-viewport.mjs.map +1 -0
  52. package/fesm2015/scion-components.mjs +4 -0
  53. package/fesm2015/scion-components.mjs.map +1 -0
  54. package/fesm2020/scion-components-dimension.mjs +137 -0
  55. package/fesm2020/scion-components-dimension.mjs.map +1 -0
  56. package/fesm2020/scion-components-sashbox.mjs +556 -0
  57. package/fesm2020/scion-components-sashbox.mjs.map +1 -0
  58. package/fesm2020/scion-components-splitter.mjs +284 -0
  59. package/fesm2020/scion-components-splitter.mjs.map +1 -0
  60. package/fesm2020/scion-components-throbber.mjs +216 -0
  61. package/fesm2020/scion-components-throbber.mjs.map +1 -0
  62. package/fesm2020/scion-components-viewport.mjs +842 -0
  63. package/fesm2020/scion-components-viewport.mjs.map +1 -0
  64. package/fesm2020/scion-components.mjs +14 -0
  65. package/fesm2020/scion-components.mjs.map +1 -0
  66. package/package.json +93 -0
  67. package/public-api.d.ts +4 -0
  68. package/sashbox/element-ref.directive.d.ts +12 -0
  69. package/sashbox/package.json +10 -0
  70. package/sashbox/public_api.d.ts +3 -0
  71. package/sashbox/sash-initializer.directive.d.ts +14 -0
  72. package/sashbox/sash.directive.d.ts +60 -0
  73. package/sashbox/sashbox-accessor.d.ts +10 -0
  74. package/sashbox/sashbox.component.d.ts +90 -0
  75. package/sashbox/sashbox.module.d.ts +33 -0
  76. package/sashbox/scion-components-sashbox.d.ts +5 -0
  77. package/scion-components.d.ts +5 -0
  78. package/splitter/package.json +10 -0
  79. package/splitter/public_api.d.ts +2 -0
  80. package/splitter/scion-components-splitter.d.ts +5 -0
  81. package/splitter/splitter.component.d.ts +104 -0
  82. package/splitter/splitter.module.d.ts +17 -0
  83. package/throbber/ellipsis-throbber/ellipsis-throbber.component.d.ts +10 -0
  84. package/throbber/package.json +10 -0
  85. package/throbber/public_api.d.ts +2 -0
  86. package/throbber/ripple-throbber/ripple-throbber.component.d.ts +10 -0
  87. package/throbber/roller-throbber/roller-throbber.component.d.ts +10 -0
  88. package/throbber/scion-components-throbber.d.ts +5 -0
  89. package/throbber/spinner-throbber/spinner-throbber.component.d.ts +11 -0
  90. package/throbber/throbber.component.d.ts +43 -0
  91. package/throbber/throbber.module.d.ts +15 -0
  92. package/viewport/_index.scss +1 -0
  93. package/viewport/_scrollbar.scss +44 -0
  94. package/viewport/native-scrollbar-track-size-provider.service.d.ts +42 -0
  95. package/viewport/package.json +10 -0
  96. package/viewport/public_api.d.ts +5 -0
  97. package/viewport/scion-components-viewport.d.ts +5 -0
  98. package/viewport/scrollable.directive.d.ts +39 -0
  99. package/viewport/scrollbar/scrollbar.component.d.ts +106 -0
  100. package/viewport/viewport.component.d.ts +160 -0
  101. package/viewport/viewport.module.d.ts +14 -0
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./splitter.component";
3
+ import * as i2 from "@angular/common";
4
+ /**
5
+ * Provides a splitter, a visual element that allows the user to control the size of elements next to it.
6
+ *
7
+ * ### Usage:
8
+ *
9
+ * ```html
10
+ * <sci-splitter (move)="onSplitterMove($event.distance)"></sci-splitter>
11
+ * ```
12
+ */
13
+ export declare class SciSplitterModule {
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciSplitterModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SciSplitterModule, [typeof i1.SciSplitterComponent], [typeof i2.CommonModule], [typeof i1.SciSplitterComponent]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<SciSplitterModule>;
17
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.
4
+ *
5
+ * Throbber type: `ellipsis`
6
+ */
7
+ export declare class SciEllipsisThrobberComponent {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciEllipsisThrobberComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciEllipsisThrobberComponent, "sci-ellipsis-throbber", never, {}, {}, never, never>;
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "module": "../fesm2015/scion-components-throbber.mjs",
3
+ "es2020": "../fesm2020/scion-components-throbber.mjs",
4
+ "esm2020": "../esm2020/throbber/scion-components-throbber.mjs",
5
+ "fesm2020": "../fesm2020/scion-components-throbber.mjs",
6
+ "fesm2015": "../fesm2015/scion-components-throbber.mjs",
7
+ "typings": "scion-components-throbber.d.ts",
8
+ "sideEffects": false,
9
+ "name": "@scion/components/throbber"
10
+ }
@@ -0,0 +1,2 @@
1
+ export { SciThrobberModule } from './throbber.module';
2
+ export { SciThrobberComponent } from './throbber.component';
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.
4
+ *
5
+ * Throbber type: `ripple`
6
+ */
7
+ export declare class SciRippleThrobberComponent {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciRippleThrobberComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciRippleThrobberComponent, "sci-ripple-throbber", never, {}, {}, never, never>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.
4
+ *
5
+ * Throbber type: `roller`
6
+ */
7
+ export declare class SciRollerThrobberComponent {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciRollerThrobberComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciRollerThrobberComponent, "sci-roller-throbber", never, {}, {}, never, never>;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@scion/components/throbber" />
5
+ export * from './public_api';
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Represents a classic spinner throbber with strokes arranged radially. The strokes light up one after the other in clockwise direction
4
+ * and then then fade out again.
5
+ *
6
+ * Throbber type: `spinner`
7
+ */
8
+ export declare class SciSpinnerThrobberComponent {
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciSpinnerThrobberComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciSpinnerThrobberComponent, "sci-spinner-throbber", never, {}, {}, never, never>;
11
+ }
@@ -0,0 +1,43 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Animated graphical control to indicate the execution of an action.
4
+ *
5
+ * Choose between different throbber presentations by setting the `type` property: `ellipsis`, `ripple`, `roller`, `spinner`.
6
+ *
7
+ * ### CSS styling:
8
+ *
9
+ * You can override the following CSS variables:
10
+ *
11
+ * - sci-throbber-color: Sets the color of the throbber (by default, uses `lightgray`).
12
+ * - sci-throbber-size: Defines the size of the throbber. Most throbbers are quadratic having the same width and height.
13
+ * For non-quadratic throbbers, the size usually specifies the height (by default, uses `50px`).
14
+ * - sci-throbber-duration: Sets the duration of a single animation cycle (by default, uses `1.25s`).
15
+ *
16
+ * Example:
17
+ *
18
+ * ```css
19
+ *
20
+ * sci-throbber {
21
+ * --sci-throbber-color: blue;
22
+ * --sci-throbber-size: 50px;
23
+ * --sci-throbber-duration: 1s
24
+ * }
25
+ * ```
26
+ */
27
+ export declare class SciThrobberComponent {
28
+ /**
29
+ * Chooses between different throbber presentation. If not set, uses `spinner` type.
30
+ *
31
+ * - **ellipsis**
32
+ * Represents a throbber as an ellipsis consisting of three horizontally arranged points that appear one after the other.
33
+ * - **ripple**
34
+ * Represents a throbber with a rippled, centric wave effect, similar to throwing a stone into water.
35
+ * - **roller**
36
+ * Represents a circular throbber with points rotating around the center of a circle. Points have a delayed acceleration, which leads to an accordion effect.
37
+ * - **spinner** (default)
38
+ * 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.
39
+ */
40
+ type: 'ellipsis' | 'ripple' | 'roller' | 'spinner';
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciThrobberComponent, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciThrobberComponent, "sci-throbber", never, { "type": "type"; }, {}, never, never>;
43
+ }
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./throbber.component";
3
+ import * as i2 from "./ellipsis-throbber/ellipsis-throbber.component";
4
+ import * as i3 from "./ripple-throbber/ripple-throbber.component";
5
+ import * as i4 from "./roller-throbber/roller-throbber.component";
6
+ import * as i5 from "./spinner-throbber/spinner-throbber.component";
7
+ import * as i6 from "@angular/common";
8
+ /**
9
+ * Provides {@link SciThrobberComponent}, an animated graphical control to indicate the execution of an action.
10
+ */
11
+ export declare class SciThrobberModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciThrobberModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SciThrobberModule, [typeof i1.SciThrobberComponent, typeof i2.SciEllipsisThrobberComponent, typeof i3.SciRippleThrobberComponent, typeof i4.SciRollerThrobberComponent, typeof i5.SciSpinnerThrobberComponent], [typeof i6.CommonModule], [typeof i1.SciThrobberComponent]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<SciThrobberModule>;
15
+ }
@@ -0,0 +1 @@
1
+ @forward './scrollbar' as scrollbar-* show scrollbar-position, scrollbar-hide-when-inactive;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Positions scrollbars absolutely relative to the bounding box of the nearest positioned parent.
3
+ *
4
+ * Invoke from within the 'sci-scrollbar' selector.
5
+ */
6
+ @mixin position($theme: ()) {
7
+ $scrollbar-size: map-get($theme, scrollbar-size);
8
+ $scrollbar-size: 12px !default;
9
+
10
+ position: absolute;
11
+ transition-duration: 1s;
12
+ transition-property: opacity;
13
+ transition-timing-function: ease-out;
14
+
15
+ &.vertical {
16
+ top: 0;
17
+ right: 0;
18
+ bottom: 0;
19
+ left: unset;
20
+ width: $scrollbar-size;
21
+ }
22
+
23
+ &.horizontal {
24
+ top: unset;
25
+ right: 0;
26
+ bottom: 0;
27
+ left: 0;
28
+ height: $scrollbar-size;
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Hides emulated scrollbars if all the following conditions are met:
34
+ * - host element not hovered (mouse navigation)
35
+ * - host element not active (touch navigation)
36
+ * - 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)
37
+ *
38
+ * Invoke from within the viewport selector.
39
+ */
40
+ @mixin hide-when-inactive($theme: ()) {
41
+ &:not(:hover):not(:active) sci-scrollbar:not(.scrolling) {
42
+ opacity: 0; // do not use 'display' nor 'visibility' property to fade the scrollbar
43
+ }
44
+ }
@@ -0,0 +1,42 @@
1
+ import { NgZone, OnDestroy } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Provides the native scrollbar tracksize.
6
+ *
7
+ * @dynamic ignore 'strictMetadataEmit' errors due to the usage of {@link Document} as ambient type for DI.
8
+ */
9
+ export declare class SciNativeScrollbarTrackSizeProvider implements OnDestroy {
10
+ private _document;
11
+ private _zone;
12
+ private readonly _trackSize$;
13
+ private readonly _destroy$;
14
+ constructor(_document: Document, _zone: NgZone);
15
+ /**
16
+ * Returns an {Observable} which emits the native scrollbar track size, if any, or else `null`.
17
+ *
18
+ * Upon subscription, it emits the track size immediately, and then continuously emits when the track size changes.
19
+ */
20
+ get trackSize$(): Observable<NativeScrollbarTrackSize | null>;
21
+ /**
22
+ * Returns the native scrollbar track size, if any, or else `null`.
23
+ */
24
+ get trackSize(): NativeScrollbarTrackSize | null;
25
+ /**
26
+ * Computes the native scrollbar track size.
27
+ *
28
+ * @returns native track size, or `null` if the native scrollbars sit on top of the content.
29
+ */
30
+ private computeTrackSize;
31
+ private installNativeScrollbarTrackSizeListener;
32
+ ngOnDestroy(): void;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciNativeScrollbarTrackSizeProvider, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<SciNativeScrollbarTrackSizeProvider>;
35
+ }
36
+ /**
37
+ * Represents the native scrollbar track size.
38
+ */
39
+ export interface NativeScrollbarTrackSize {
40
+ hScrollbarTrackHeight: number;
41
+ vScrollbarTrackWidth: number;
42
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "module": "../fesm2015/scion-components-viewport.mjs",
3
+ "es2020": "../fesm2020/scion-components-viewport.mjs",
4
+ "esm2020": "../esm2020/viewport/scion-components-viewport.mjs",
5
+ "fesm2020": "../fesm2020/scion-components-viewport.mjs",
6
+ "fesm2015": "../fesm2015/scion-components-viewport.mjs",
7
+ "typings": "scion-components-viewport.d.ts",
8
+ "sideEffects": false,
9
+ "name": "@scion/components/viewport"
10
+ }
@@ -0,0 +1,5 @@
1
+ export { SciViewportModule } from './viewport.module';
2
+ export * from './viewport.component';
3
+ export * from './scrollable.directive';
4
+ export * from './scrollbar/scrollbar.component';
5
+ export * from './native-scrollbar-track-size-provider.service';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@scion/components/viewport" />
5
+ export * from './public_api';
@@ -0,0 +1,39 @@
1
+ import { ElementRef, OnChanges, OnDestroy, Renderer2, SimpleChanges } from '@angular/core';
2
+ import { SciNativeScrollbarTrackSizeProvider } from './native-scrollbar-track-size-provider.service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars
6
+ * already sit on top of the viewport (e.g. in OS X).
7
+ *
8
+ * Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'
9
+ * to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.
10
+ *
11
+ * This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element
12
+ * fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`
13
+ * to hide the pushed out native scrollbars.
14
+ */
15
+ export declare class SciScrollableDirective implements OnChanges, OnDestroy {
16
+ private _host;
17
+ private _renderer;
18
+ private _destroy$;
19
+ private _inputChange$;
20
+ /**
21
+ * Controls whether to display native scrollbars.
22
+ * Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.
23
+ */
24
+ isDisplayNativeScrollbar: boolean;
25
+ constructor(_host: ElementRef<HTMLDivElement>, _renderer: Renderer2, nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider);
26
+ /**
27
+ * Uses the native scrollbars when content overflows.
28
+ */
29
+ private useNativeScrollbars;
30
+ /**
31
+ * Shifts the native scrollbars out of the visible viewport area.
32
+ */
33
+ private shiftNativeScrollbars;
34
+ private setStyle;
35
+ ngOnChanges(changes: SimpleChanges): void;
36
+ ngOnDestroy(): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciScrollableDirective, never>;
38
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SciScrollableDirective, "[sciScrollable]", never, { "isDisplayNativeScrollbar": "sciScrollableDisplayNativeScrollbar"; }, {}, never>;
39
+ }
@@ -0,0 +1,106 @@
1
+ import { ElementRef, NgZone, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Renders a vertical or horizontal scrollbar.
5
+ *
6
+ * The scrollbar features the following functionality:
7
+ * - allows to move the thumb by mouse or touch
8
+ * - enlarges the thumb if the mouse pointer is near the thumb
9
+ * - allows paging on mousedown on the scroll track
10
+ *
11
+ * ### CSS styling:
12
+ *
13
+ * You can override the following CSS variables:
14
+ *
15
+ * - sci-scrollbar-color: Sets the color of the scrollbar (by default, uses `rgb(78, 78, 78)`).
16
+ *
17
+ * Example:
18
+ *
19
+ * ```css
20
+ *
21
+ * sci-scrollbar {
22
+ * --sci-scrollbar-color: blue;
23
+ * }
24
+ * ```
25
+ */
26
+ export declare class SciScrollbarComponent implements OnDestroy {
27
+ private _host;
28
+ private _document;
29
+ private _zone;
30
+ private _destroy$;
31
+ private _viewport;
32
+ private _viewportChange$;
33
+ private _lastDragPosition;
34
+ private _overflow;
35
+ private _thumbSizeFr;
36
+ private _thumbPositionFr;
37
+ thumbElement: ElementRef<HTMLDivElement>;
38
+ get vertical(): boolean;
39
+ get horizontal(): boolean;
40
+ get scrolling(): boolean;
41
+ /**
42
+ * Specifies the direction of the scrollbar.
43
+ *
44
+ * By default, if not specified, renders a vertical scrollbar.
45
+ */
46
+ direction: 'vscroll' | 'hscroll';
47
+ /**
48
+ * The viewport to provide scrollbars for.
49
+ */
50
+ set setViewport(viewport: HTMLElement);
51
+ constructor(_host: ElementRef<HTMLElement>, _document: any, _zone: NgZone);
52
+ /**
53
+ * Computes the scroll position and updates CSS variables to render the scroll position in the UI.
54
+ */
55
+ private renderScrollPosition;
56
+ /**
57
+ * Clears CSS variables used for rendering the scroll position in the UI.
58
+ */
59
+ private unsetScrollPosition;
60
+ onTouchStart(event: TouchEvent): void;
61
+ onTouchMove(event: TouchEvent): void;
62
+ onTouchEnd(event: TouchEvent): void;
63
+ onMouseDown(mousedownEvent: MouseEvent): void;
64
+ onScrollTrackMouseDown(event: MouseEvent, direction: 'up' | 'down'): void;
65
+ /**
66
+ * Projects the given scrollbar scroll pixels into viewport scroll pixels.
67
+ */
68
+ private toViewportPanPx;
69
+ /**
70
+ * Moves the viewport client by the specified numbers of pixels.
71
+ */
72
+ private moveViewportClient;
73
+ /**
74
+ * Indicates if the content overflows.
75
+ */
76
+ get overflow(): boolean;
77
+ /**
78
+ * Scrolls continuously while holding the mouse pressed, or until the mouse leaves the scrolltrack.
79
+ */
80
+ private scrollWhileMouseDown;
81
+ /**
82
+ * Emits whenever the viewport scrolls.
83
+ */
84
+ private viewportScrollChange$;
85
+ /**
86
+ * Emits on subscription, and then each time the size of the viewport changes.
87
+ */
88
+ private viewportDimensionChange$;
89
+ /**
90
+ * Emits on subscription, and then each time the size or style property of the viewport client changes.
91
+ */
92
+ private viewportClientDimensionChange$;
93
+ /**
94
+ * Emits the children of the passed element, and then each time child elements are added or removed.
95
+ */
96
+ private children$;
97
+ private setCssVariable;
98
+ private get viewportSize();
99
+ private get viewportClientSize();
100
+ private get scrollPosition();
101
+ private get thumbSize();
102
+ private get trackSize();
103
+ ngOnDestroy(): void;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciScrollbarComponent, never>;
105
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciScrollbarComponent, "sci-scrollbar", never, { "direction": "direction"; "setViewport": "viewport"; }, {}, never, never>;
106
+ }
@@ -0,0 +1,160 @@
1
+ import { ElementRef, EventEmitter } from '@angular/core';
2
+ import { SciNativeScrollbarTrackSizeProvider } from './native-scrollbar-track-size-provider.service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Represents a viewport with the `<ng-content>` used as scrollable content. Content is added to a CSS grid layout.
6
+ *
7
+ * The viewport component displays scrollbars when its content overflows. Scrollbars are displayed on top of the content, not next to it.
8
+ * 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.
9
+ * The viewport remains natively scrollable with the native scrollbars shifted out of the viewport's visible area. Consequently, the viewport keeps supporting
10
+ * native scrolling features such as touch gestures, scroll speed acceleration, or scrolling near the viewport edges during drag-and-drop operations.
11
+ *
12
+ * ```html
13
+ * <sci-viewport>
14
+ * your content
15
+ * </sci-viewport>
16
+ * ```
17
+ *
18
+ * ## Adding the viewport to a layout
19
+ *
20
+ * Typically you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container
21
+ * with the viewport's `flex` CSS property set to either `flex: auto` or `flex: 1 1 0`.
22
+ *
23
+ * 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
24
+ * a layout constraint. Depending on the layout, different steps may be necessary to prevent the viewport from growing to infinity.
25
+ *
26
+ * - If practical, give the viewport a fixed size or a maximum size.
27
+ * - 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,
28
+ * 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
29
+ * `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
30
+ * the remaining extra space is distributed. If the viewport does not appear after setting this property, check its parent elements' content sizes.
31
+ * 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`.
32
+ * Another approach would be to set the minimum height of all parents to `0`, as follows: `min-height: 0`.
33
+ *
34
+ * For the complete documentation on the flex layout and its features, refer to https://developer.mozilla.org/en-US/docs/Web/CSS/flex.
35
+ *
36
+ *
37
+ * ## Layouting the viewport content
38
+ *
39
+ * `NgContent` is added to a CSS grid container with, by default, a single column, filling remaining space vertically and horizontally.
40
+ *
41
+ * You can override the following CSS variables to control the grid:
42
+ *
43
+ * - sci-viewport-content-grid-template-columns: Defines the columns and their track sizes (by default, single column with track size auto)
44
+ * - sci-viewport-content-grid-template-rows: Defines the rows and their track sizes (by default, single row with track size auto)
45
+ * - sci-viewport-content-grid-auto-columns: Defines the track size of not explicitly declared columns.
46
+ * - sci-viewport-content-grid-auto-rows: Defines the track size of not explicitly declared rows.
47
+ * - sci-viewport-content-grid-gap: Sets the gaps (gutters) between rows and columns.
48
+ *
49
+ * Example of how to control the CSS grid:
50
+ *
51
+ * ```css
52
+ * sci-viewport {
53
+ * --sci-viewport-content-grid-auto-rows: min-content;
54
+ * --sci-viewport-content-grid-gap: .5em; // specifies the row and column gap
55
+ * }
56
+ * ```
57
+ *
58
+ * ## Styling of scrollbars
59
+ *
60
+ * You can override the following CSS variables to control the appearance of the scrollbar:
61
+ *
62
+ * - sci-viewport-scrollbar-color: Sets the color of the scrollbar (by default, uses `rgb(78, 78, 78)`).
63
+ *
64
+ * ```css
65
+ * sci-viewport {
66
+ * --sci-viewport-scrollbar-color: blue;
67
+ * }
68
+ * ```
69
+ */
70
+ export declare class SciViewportComponent {
71
+ host: ElementRef<HTMLElement>;
72
+ nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider;
73
+ private _viewport;
74
+ private _viewportClient;
75
+ private _scrollbarStyle;
76
+ tabindex: number;
77
+ /**
78
+ * Controls whether to use native scrollbars or, which is by default, emulated scrollbars that sit on top of the viewport client.
79
+ * In the latter, the viewport client remains natively scrollable.
80
+ */
81
+ set scrollbarStyle(scrollbarStyle: ScrollbarStyle);
82
+ get scrollbarStyle(): ScrollbarStyle;
83
+ /**
84
+ * Emits upon a scroll event.
85
+ *
86
+ * You can add [sciDimension] directive to the viewport or viewport client to be notified about layout changes.
87
+ */
88
+ scroll: EventEmitter<Event>;
89
+ constructor(host: ElementRef<HTMLElement>, nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider);
90
+ focus(): void;
91
+ onScroll(event: Event): void;
92
+ /**
93
+ * Returns the number of pixels that the viewport client is scrolled vertically.
94
+ *
95
+ * @see Element.scrollTop
96
+ */
97
+ get scrollTop(): number;
98
+ /**
99
+ * Sets the number of pixels that the viewport client is scrolled vertically.
100
+ *
101
+ * @see Element.scrollTop
102
+ */
103
+ set scrollTop(scrollTop: number);
104
+ /**
105
+ * Returns the number of pixels that the viewport client is scrolled horizontally.
106
+ *
107
+ * @see Element.scrollLeft
108
+ */
109
+ get scrollLeft(): number;
110
+ /**
111
+ * Sets the number of pixels that the viewport client is scrolled horizontally.
112
+ *
113
+ * @see Element.scrollLeft
114
+ */
115
+ set scrollLeft(scrollLeft: number);
116
+ /**
117
+ * Returns the height of the viewport client.
118
+ *
119
+ * @see Element.scrollHeight
120
+ */
121
+ get scrollHeight(): number;
122
+ /**
123
+ * Returns the width of the viewport client.
124
+ *
125
+ * @see Element.scrollWidth
126
+ */
127
+ get scrollWidth(): number;
128
+ /**
129
+ * Returns the viewport {HTMLElement}.
130
+ */
131
+ get viewportElement(): HTMLElement;
132
+ /**
133
+ * Returns the viewport client {HTMLElement}.
134
+ */
135
+ get viewportClientElement(): HTMLElement;
136
+ /**
137
+ * Checks if the specified element is scrolled into the viewport.
138
+ *
139
+ * @param element - the element to be checked
140
+ * @param fit - control if the element must fully or partially fit into the viewport
141
+ */
142
+ isElementInView(element: HTMLElement, fit: 'full' | 'partial'): boolean;
143
+ /**
144
+ * Scrolls the specified element into the viewport.
145
+ *
146
+ * @param element - the element to scroll into the viewport
147
+ * @param offset - the gap between the element and the viewport
148
+ */
149
+ scrollIntoView(element: HTMLElement, offset?: number): void;
150
+ /**
151
+ * Computes the distance of the element to the viewport's left or top border.
152
+ */
153
+ computeOffset(element: HTMLElement, border: 'left' | 'top'): number;
154
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciViewportComponent, never>;
155
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciViewportComponent, "sci-viewport", never, { "scrollbarStyle": "scrollbarStyle"; }, { "scroll": "scroll"; }, never, ["*"]>;
156
+ }
157
+ /**
158
+ * Represents a scrollbar style.
159
+ */
160
+ export declare type ScrollbarStyle = 'native' | 'on-top' | 'hidden';
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./viewport.component";
3
+ import * as i2 from "./scrollbar/scrollbar.component";
4
+ import * as i3 from "./scrollable.directive";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/cdk/scrolling";
7
+ /**
8
+ * Provides a viewport component with scrollbars that sit on top of the viewport client.
9
+ */
10
+ export declare class SciViewportModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciViewportModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SciViewportModule, [typeof i1.SciViewportComponent, typeof i2.SciScrollbarComponent, typeof i3.SciScrollableDirective], [typeof i4.CommonModule, typeof i5.ScrollingModule], [typeof i1.SciViewportComponent, typeof i2.SciScrollbarComponent, typeof i3.SciScrollableDirective]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<SciViewportModule>;
14
+ }