@scion/components 19.0.0 → 19.2.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.
@@ -1,5 +1,3 @@
1
- import { OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
- import { SciSashBoxAccessor } from './sashbox-accessor';
3
1
  import * as i0 from "@angular/core";
4
2
  /**
5
3
  * Use this directive to model a sash for {@link SciSashboxComponent}.
@@ -20,41 +18,53 @@ import * as i0 from "@angular/core";
20
18
  * </ng-template>
21
19
  * </sci-sashbox>
22
20
  */
23
- export declare class SciSashDirective implements OnInit, OnChanges {
24
- readonly sashTemplate: TemplateRef<void>;
25
- private _sashBoxAccessor;
26
- private _size;
27
- private _flexGrow$;
21
+ export declare class SciSashDirective {
28
22
  /**
29
23
  * Specifies the sash size, either as fixed size with an explicit unit,
30
- * or as a unitless proportion to distibute remaining space. A proportional
24
+ * or as a unitless proportion to distribute remaining space. A proportional
31
25
  * sash has the ability to grow or shrink if necessary, and must be >= 1.
32
26
  *
33
27
  * If not set, remaining space is distributed equally.
34
28
  */
35
- set size(size: string | number | null | undefined);
36
- get size(): string | number;
29
+ readonly size: import("@angular/core").InputSignalWithTransform<string | number, string | number | null | undefined>;
37
30
  /**
38
31
  * Specifies the minimal sash size in pixel or percent.
39
32
  * The min-size prevents the user from shrinking the sash below this minimal size.
40
33
  *
41
34
  * If the unit is omitted, the value is interpreted as a pixel value.
42
35
  */
43
- minSize?: string | number | undefined;
44
- constructor(sashTemplate: TemplateRef<void>, _sashBoxAccessor: SciSashBoxAccessor);
45
- ngOnInit(): void;
46
- ngOnChanges(changes: SimpleChanges): void;
36
+ readonly minSize: import("@angular/core").InputSignal<string | number | undefined>;
47
37
  /**
48
- * Computes and sets the flex item properties based on the modelled size.
38
+ * Specifies an optional key to identify this sash.
39
+ *
40
+ * The key is used as the property key in the object emitted by {@link SciSashboxComponent.sashEnd2} to associate the size of this sash.
41
+ */
42
+ readonly key: import("@angular/core").InputSignal<string | undefined>;
43
+ /**
44
+ * Controls whether to animate the entering and leaving of this sash, only if fixed-sized. Defaults to `false`.
45
+ *
46
+ * Enabling animation will mimic the behavior of a side panel that slides in or out.
47
+ *
48
+ * Note: Animates only sashes added or removed after the initial rendering.
49
+ */
50
+ readonly animate: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
51
+ private readonly _sashBoxAccessor;
52
+ private readonly _component;
53
+ /**
54
+ * Flex properties computed based on the configured {@link size}. Properties are updated when moving this sash.
55
+ */
56
+ private readonly _flexProperties;
57
+ /**
58
+ * Computes the flex properties to lay out this sash in the sashbox's flex layout based on the configured {@link size}.
49
59
  */
50
- private setFlexItemProperties;
60
+ private computeFlexProperties;
51
61
  /**
52
- * Computes the normalized flex-grow proportion of the given sash, which is a value >= 1.
62
+ * Normalizes the 'flex-grow' of the passed {@link FlexProperties} to ensure that the sum of the 'flex-grow' proportions of all sashes is 1.
53
63
  *
54
- * If the sum of all flex-grow proportions would be less than 1, then, the sashes would not fill the entire sash-box space.
55
- * Without normalization in place, e.g., this could happen when removing a sash.
64
+ * If the sum of all flex-grow proportions were less than 1, the sashes would not fill the entire sash-box space.
65
+ * Without normalization, this could occur when a sash is removed.
56
66
  */
57
67
  private normalizeFlexGrow;
58
68
  static ɵfac: i0.ɵɵFactoryDeclaration<SciSashDirective, never>;
59
- static ɵdir: i0.ɵɵDirectiveDeclaration<SciSashDirective, "ng-template[sciSash]", ["sciSash"], { "size": { "alias": "size"; "required": false; }; "minSize": { "alias": "minSize"; "required": false; }; }, {}, never, never, true, never>;
69
+ static ɵdir: i0.ɵɵ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>;
60
70
  }
@@ -1,10 +1,10 @@
1
1
  import { SciSashDirective } from './sash.directive';
2
- import { Observable } from 'rxjs';
2
+ import { Signal } from '@angular/core';
3
3
  /**
4
4
  * Allows accessing the sashbox component from sashes.
5
5
  */
6
6
  export declare abstract class SciSashBoxAccessor {
7
- abstract get sashes(): SciSashDirective[];
8
- abstract get sashes$(): Observable<SciSashDirective[]>;
9
- abstract get direction(): 'column' | 'row';
7
+ abstract readonly sashes: Signal<readonly SciSashDirective[]>;
8
+ abstract readonly direction: Signal<'column' | 'row'>;
9
+ abstract readonly afterFirstRender: Signal<boolean>;
10
10
  }
@@ -1,17 +1,15 @@
1
- import { EventEmitter, OnDestroy } from '@angular/core';
2
- import { BehaviorSubject } from 'rxjs';
3
1
  import { SplitterMoveEvent } from '@scion/components/splitter';
4
- import { SciSashDirective } from './sash.directive';
5
2
  import * as i0 from "@angular/core";
6
3
  /**
7
4
  * The <sci-sashbox> is like a CSS flexbox container that lays out its content children (sashes) in a row (which is by default)
8
5
  * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to
9
6
  * shrink or stretch the individual sashes.
10
7
  *
11
- * Sashes are modelled as content children inside a <ng-template> decorated with the 'sciSash' directive.
12
- * A sash can have a fixed size with an explicit unit, or a unitless proportion to distibute remaining space.
8
+ * Sashes are modelled as <ng-template> decorated with the 'sciSash' directive.
9
+ * A sash can have a fixed size with an explicit unit, or a unitless proportion to distribute remaining space.
13
10
  * A proportional sash has the ability to grow or shrink if necessary.
14
11
  *
12
+ * Sash content is added to a CSS grid container with a single column, stretching the content vertically and horizontally.
15
13
  *
16
14
  * ### Usage
17
15
  *
@@ -56,35 +54,59 @@ import * as i0 from "@angular/core";
56
54
  * }
57
55
  * ```
58
56
  */
59
- export declare class SciSashboxComponent implements OnDestroy {
60
- private _destroy$;
61
- private _host;
62
- private _zone;
63
- sashes$: BehaviorSubject<SciSashDirective[]>;
64
- sashing: boolean;
65
- maxHeight: number | undefined;
66
- maxWidth: number | undefined;
57
+ export declare class SciSashboxComponent {
67
58
  /**
68
59
  * Specifies if to lay out sashes in a row (which is by default) or column arrangement.
69
60
  */
70
- direction: 'column' | 'row';
61
+ readonly direction: import("@angular/core").InputSignal<"column" | "row">;
71
62
  /**
72
- * Emits when start sashing.
63
+ * Notifies when start sashing.
73
64
  */
74
- sashStart: EventEmitter<void>;
65
+ readonly sashStart: import("@angular/core").OutputEmitterRef<void>;
75
66
  /**
76
- * Emits the absolute sash sizes (px) when finished sashing.
67
+ * Emits an array with new sash sizes when sashing ends.
68
+ *
69
+ * The array contains the sash sizes in display order.
70
+ *
71
+ * TODO [Angular 20] BREAKING CHANGE: Change signature from `number[]` to `{[key: string]: number}` and remove {@link sashEnd2}.
77
72
  */
78
- sashEnd: EventEmitter<number[]>;
79
- onSashStart(): void;
80
- onSashEnd(): void;
81
- onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void;
82
- onSashReset(sashIndex: number): void;
83
- get isColumnDirection(): boolean;
84
- get isRowDirection(): boolean;
85
- private get sashes();
86
- ngOnDestroy(): void;
73
+ readonly sashEnd: import("@angular/core").OutputEmitterRef<number[]>;
74
+ /**
75
+ * Emits an object with new sash sizes when sashing ends.
76
+ *
77
+ * Each sash size is associated with its {@link SciSashDirective.key} or its display position (zero-based) if not set.
78
+ *
79
+ * Note: This output will be renamed to `sashEnd` in version 20, changing the signature of {@link sashEnd} from `number[]` to `{[key: string]: number}`.
80
+ *
81
+ * TODO [Angular 20] BREAKING CHANGE: Replace with {@link sashEnd}.
82
+ */
83
+ readonly sashEnd2: import("@angular/core").OutputEmitterRef<{
84
+ [key: string]: number;
85
+ }>;
86
+ private readonly _host;
87
+ private readonly _contentChildren;
88
+ protected sashing: boolean;
89
+ protected maxHeight: number | undefined;
90
+ protected maxWidth: number | undefined;
91
+ constructor();
92
+ protected onSashStart(): void;
93
+ protected onSashEnd(): void;
94
+ protected onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void;
95
+ protected onSashReset(sashIndex: number): void;
96
+ protected get isColumnDirection(): boolean;
97
+ protected get isRowDirection(): boolean;
87
98
  private toPixel;
99
+ /**
100
+ * Detects when rendered this component for the first time.
101
+ */
102
+ private detectFirstRendering;
103
+ /**
104
+ * Mirrors the provided signal. If animated sashes are being removed, delays emission until the animation completes,
105
+ * effectively removing the element after the animation.
106
+ *
107
+ * Delayed removal is required for CDK Portals to not remove displayed content immediately.
108
+ */
109
+ private computeSashes;
88
110
  static ɵfac: i0.ɵɵFactoryDeclaration<SciSashboxComponent, never>;
89
- static ɵcmp: i0.ɵɵComponentDeclaration<SciSashboxComponent, "sci-sashbox", never, { "direction": { "alias": "direction"; "required": false; }; }, { "sashStart": "sashStart"; "sashEnd": "sashEnd"; }, ["setSashes"], never, true, never>;
111
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciSashboxComponent, "sci-sashbox", never, { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, { "sashStart": "sashStart"; "sashEnd": "sashEnd"; "sashEnd2": "sashEnd2"; }, ["_contentChildren"], never, true, never>;
90
112
  }
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core';
1
+ import { OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Represents a splitter, a visual element that allows the user to control the size of elements next to it.
@@ -41,47 +41,43 @@ import * as i0 from "@angular/core";
41
41
  * }
42
42
  * ```
43
43
  */
44
- export declare class SciSplitterComponent implements OnInit, OnDestroy {
45
- private _zone;
46
- private _cd;
47
- private _document;
48
- private _destroy$;
49
- moving: boolean;
50
- get isVertical(): boolean;
51
- get isHorizontal(): boolean;
44
+ export declare class SciSplitterComponent implements OnInit {
52
45
  /**
53
- * Controls whether to render a vertical or horizontal splitter.
54
- * By default, if not specified, renders a vertical splitter.
46
+ * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.
55
47
  */
56
- orientation: 'vertical' | 'horizontal';
48
+ readonly orientation: import("@angular/core").InputSignal<"vertical" | "horizontal">;
57
49
  /**
58
- * Emits when starting to move the splitter.
50
+ * Notifies when start moving the splitter.
59
51
  */
60
- start: EventEmitter<void>;
52
+ readonly start: import("@angular/core").OutputEmitterRef<void>;
61
53
  /**
62
- * Emits the distance in pixels when the splitter is moved.
63
- * The event is emitted outside of the Angular zone.
54
+ * Notifies when moving the splitter. The event is emitted outside the Angular zone.
64
55
  */
65
- move: EventEmitter<SplitterMoveEvent>;
56
+ readonly move: import("@angular/core").OutputEmitterRef<SplitterMoveEvent>;
66
57
  /**
67
- * Emits when ending to move the splitter.
58
+ * Notifies when end moving the splitter.
68
59
  */
69
- end: EventEmitter<void>;
60
+ readonly end: import("@angular/core").OutputEmitterRef<void>;
70
61
  /**
71
- * Emits when to reset the splitter position.
62
+ * Notifies when resetting the spliter position.
72
63
  */
73
- reset: EventEmitter<void>;
74
- get splitterCursor(): string;
75
- touchTargetElementRef: ElementRef<HTMLElement>;
76
- constructor(_zone: NgZone, _cd: ChangeDetectorRef, _document: Document);
64
+ readonly reset: import("@angular/core").OutputEmitterRef<void>;
65
+ private readonly _zone;
66
+ private readonly _cd;
67
+ private readonly _document;
68
+ private readonly _destroyRef;
69
+ private readonly _touchTarget;
70
+ protected moving: boolean;
71
+ protected get isVertical(): boolean;
72
+ protected get isHorizontal(): boolean;
73
+ protected get splitterCursor(): string;
77
74
  ngOnInit(): void;
78
75
  private onReset;
79
76
  private onTouchStart;
80
77
  private onMouseDown;
81
78
  private installMoveListener;
82
- ngOnDestroy(): void;
83
79
  static ɵfac: i0.ɵɵFactoryDeclaration<SciSplitterComponent, never>;
84
- static ɵcmp: i0.ɵɵComponentDeclaration<SciSplitterComponent, "sci-splitter", never, { "orientation": { "alias": "orientation"; "required": false; }; }, { "start": "start"; "move": "move"; "end": "end"; "reset": "reset"; }, never, never, true, 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>;
85
81
  }
86
82
  export interface EventPosition {
87
83
  clientPos: number;
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
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.
4
+ * and then fade out again.
5
5
  *
6
6
  * Throbber type: `spinner`
7
7
  */
@@ -38,7 +38,7 @@ export declare class SciThrobberComponent {
38
38
  * - **spinner** (default)
39
39
  * 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
40
  */
41
- type: 'ellipsis' | 'ripple' | 'roller' | 'spinner';
41
+ readonly type: import("@angular/core").InputSignal<"ellipsis" | "ripple" | "roller" | "spinner">;
42
42
  static ɵfac: i0.ɵɵFactoryDeclaration<SciThrobberComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<SciThrobberComponent, "sci-throbber", never, { "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciThrobberComponent, "sci-throbber", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
44
44
  }
@@ -4,8 +4,8 @@ import * as i0 from "@angular/core";
4
4
  * Provides the native scrollbar tracksize.
5
5
  */
6
6
  export declare class SciNativeScrollbarTrackSizeProvider {
7
- private _document;
8
- private _zone;
7
+ private readonly _document;
8
+ private readonly _zone;
9
9
  /**
10
10
  * Provides the track size of the native scrollbar, or `null` if the native scrollbars sit on top of the content.
11
11
  */
@@ -11,14 +11,14 @@ import * as i0 from "@angular/core";
11
11
  * to hide the pushed out native scrollbars.
12
12
  */
13
13
  export declare class SciScrollableDirective {
14
- private _host;
15
- private _renderer;
16
- private _nativeScrollbarTrackSizeProvider;
17
14
  /**
18
15
  * Controls whether to display native scrollbars.
19
16
  * Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.
20
17
  */
21
- displayNativeScrollbar: import("@angular/core").InputSignal<boolean>;
18
+ readonly displayNativeScrollbar: import("@angular/core").InputSignal<boolean>;
19
+ private readonly _host;
20
+ private readonly _renderer;
21
+ private readonly _nativeScrollbarTrackSizeProvider;
22
22
  constructor();
23
23
  /**
24
24
  * Controls the display of the native scrollbar based on this directive's configuration.
@@ -24,38 +24,32 @@ import * as i0 from "@angular/core";
24
24
  * ```
25
25
  */
26
26
  export declare class SciScrollbarComponent {
27
- private _host;
28
- private _document;
29
- private _zone;
30
- private _destroyRef;
31
- private _lastDragPosition;
32
- private _overflow;
33
- private _thumbSizeFr;
34
- private _thumbPositionFr;
35
- private _thumbElement;
36
- private _vertical;
37
- get vertical(): boolean;
38
- get horizontal(): boolean;
39
- get scrolling(): boolean;
40
27
  /**
41
- * Specifies the direction of the scrollbar.
42
- *
43
- * By default, if not specified, renders a vertical scrollbar.
28
+ * Specifies the direction of the scrollbar. Defaults to a vertical scrollbar.
44
29
  */
45
- direction: import("@angular/core").InputSignal<"vscroll" | "hscroll">;
30
+ readonly direction: import("@angular/core").InputSignal<"vscroll" | "hscroll">;
46
31
  /**
47
32
  * The viewport to provide scrollbars for.
48
33
  */
49
- viewport: import("@angular/core").InputSignal<HTMLElement>;
34
+ readonly viewport: import("@angular/core").InputSignal<HTMLElement>;
35
+ private readonly _host;
36
+ private readonly _document;
37
+ private readonly _zone;
38
+ private readonly _destroyRef;
39
+ private readonly _thumbElement;
40
+ private readonly _vertical;
41
+ private _lastDragPosition;
42
+ private _overflow;
43
+ private _thumbSizeFr;
44
+ private _thumbPositionFr;
45
+ protected get vertical(): boolean;
46
+ protected get horizontal(): boolean;
47
+ protected get scrolling(): boolean;
50
48
  constructor();
51
49
  /**
52
50
  * Computes the scroll position and updates CSS variables to render the scroll position in the UI.
53
51
  */
54
52
  private renderScrollPosition;
55
- /**
56
- * Clears CSS variables used for rendering the scroll position in the UI.
57
- */
58
- private unsetScrollPosition;
59
53
  protected onTouchStart(event: TouchEvent): void;
60
54
  protected onTouchMove(event: TouchEvent): void;
61
55
  protected onTouchEnd(event: TouchEvent): void;
@@ -69,18 +69,18 @@ import * as i0 from "@angular/core";
69
69
  * ```
70
70
  */
71
71
  export declare class SciViewportComponent {
72
- private _viewport;
73
- private _viewportClient;
74
- private _host;
75
- protected nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider;
76
72
  /**
77
73
  * Controls if to use the native scrollbar or a scrollbar that sits on top of the viewport. Defaults to `on-top`.
78
74
  */
79
- scrollbarStyle: import("@angular/core").InputSignal<ScrollbarStyle>;
75
+ readonly scrollbarStyle: import("@angular/core").InputSignal<ScrollbarStyle>;
80
76
  /**
81
77
  * Emits when the viewport is scrolled. The event is emitted outside the Angular zone to avoid unnecessary change detection cycles.
82
78
  */
83
- scroll: import("@angular/core").OutputEmitterRef<Event>;
79
+ readonly scroll: import("@angular/core").OutputEmitterRef<Event>;
80
+ private readonly _host;
81
+ private readonly _viewport;
82
+ private readonly _viewportClient;
83
+ protected readonly nativeScrollbarTrackSizeProvider: SciNativeScrollbarTrackSizeProvider;
84
84
  constructor();
85
85
  focus(): void;
86
86
  /**
@@ -1,14 +0,0 @@
1
- import { ElementRef, OnChanges, SimpleChanges } from '@angular/core';
2
- import { SciSashDirective } from './sash.directive';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Initializes {SashDirective} with the target {HTMLDivElement}.
6
- */
7
- export declare class SciSashInitializerDirective implements OnChanges {
8
- private _host;
9
- sash: SciSashDirective;
10
- constructor(_host: ElementRef<HTMLDivElement>);
11
- ngOnChanges(changes: SimpleChanges): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<SciSashInitializerDirective, never>;
13
- static ɵdir: i0.ɵɵDirectiveDeclaration<SciSashInitializerDirective, "div[sciSashInitializer].sash", never, { "sash": { "alias": "sciSashInitializer"; "required": true; }; }, {}, never, never, true, never>;
14
- }