@scion/components 21.0.0 → 21.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/scion-components-dimension.mjs +6 -3
- package/fesm2022/scion-components-dimension.mjs.map +1 -1
- package/fesm2022/scion-components-sashbox.mjs +15 -21
- package/fesm2022/scion-components-sashbox.mjs.map +1 -1
- package/fesm2022/scion-components-splitter.mjs +32 -46
- package/fesm2022/scion-components-splitter.mjs.map +1 -1
- package/fesm2022/scion-components-viewport.mjs +32 -45
- package/fesm2022/scion-components-viewport.mjs.map +1 -1
- package/package.json +1 -1
- package/types/scion-components-sashbox.d.ts +3 -3
- package/types/scion-components-splitter.d.ts +7 -8
- package/types/scion-components-viewport.d.ts +18 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-splitter.mjs","sources":["../../../../projects/scion/components/splitter/src/splitter.component.ts","../../../../projects/scion/components/splitter/src/splitter.component.html","../../../../projects/scion/components/splitter/src/public_api.ts","../../../../projects/scion/components/splitter/src/scion-components-splitter.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, ElementRef, HostBinding, inject, input, NgZone, OnInit, output, viewChild, DOCUMENT} from '@angular/core';\nimport {audit, fromEvent, merge, Observable} from 'rxjs';\nimport {tapFirst} from '@scion/toolkit/operators';\nimport {first, takeUntil} from 'rxjs/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Represents a splitter, a visual element that allows the user to control the size of elements next to it.\n *\n * The splitter has a handle that the user can move depending on the orientation of the splitter.\n *\n * Note that this control neither does change the size of adjacent elements nor does it (re-)position itself, but emits the distance by\n * which the user has theoretically moved the splitter. You must subscribe to these events and change your layout accordingly.\n *\n * In the toolkit, {@link SciSashboxComponent} uses this splitter to divide a layout into several resizable sections.\n * Another use case would be a resizable sidebar panel.\n *\n * ### Usage\n *\n * ```html\n * <sci-splitter (move)=\"onSplitterMove($event.distance)\"></sci-splitter>\n * ```\n *\n * ### Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-splitter` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-splitter-background-color: Sets the background color of the splitter.\n * - --sci-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-splitter-cross-axis-size: Sets the splitter size along the cross axis.\n * - --sci-splitter-border-radius: Sets the border radius of the splitter.\n * - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-splitter {\n * --sci-splitter-background-color: black;\n * --sci-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-splitter',\n templateUrl: './splitter.component.html',\n styleUrls: ['./splitter.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciSplitterComponent implements OnInit {\n\n /**\n * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.\n */\n public readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /**\n * Notifies when start moving the splitter.\n */\n public readonly start = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n /**\n * Notifies when moving the splitter. The event is emitted outside the Angular zone.\n */\n public readonly move = output<SplitterMoveEvent>();\n\n /**\n * Notifies when end moving the splitter.\n */\n public readonly end = output<void>();\n\n /**\n * Notifies when resetting the spliter position.\n */\n public readonly reset = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _zone = inject(NgZone);\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _document = inject(DOCUMENT);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _touchTarget = viewChild.required<ElementRef<HTMLElement>>('touch_target');\n\n @HostBinding('class.moving')\n protected moving = false;\n\n @HostBinding('class.vertical')\n protected get isVertical(): boolean {\n return !this.isHorizontal;\n }\n\n @HostBinding('class.horizontal')\n protected get isHorizontal(): boolean {\n return this.orientation() === 'horizontal';\n }\n\n @HostBinding('style.cursor')\n protected get splitterCursor(): string {\n return this.isVertical ? 'ew-resize' : 'ns-resize';\n }\n\n /* @docs-private */\n public ngOnInit(): void {\n const touchTargetElement = this._touchTarget().nativeElement;\n\n fromEvent(touchTargetElement, 'dblclick')\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => this.onReset());\n\n fromEvent<TouchEvent>(touchTargetElement, 'touchstart')\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe((event: TouchEvent) => this.onTouchStart(event));\n\n fromEvent<MouseEvent>(touchTargetElement, 'mousedown')\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe((event: MouseEvent) => this.onMouseDown(event));\n }\n\n private onReset(): void {\n this.reset.emit();\n }\n\n private onTouchStart(startEvent: TouchEvent): void {\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['touchmove'],\n endEventNames: ['touchend', 'touchcancel'],\n eventPositionFn: (touchEvent: TouchEvent): EventPosition => {\n const touch: Touch = touchEvent.touches[0]!;\n if (this.isVertical) {\n return {screenPos: touch.screenX, clientPos: touch.clientX, pagePos: touch.pageX};\n }\n else {\n return {screenPos: touch.screenY, clientPos: touch.clientY, pagePos: touch.pageY};\n }\n },\n });\n }\n\n private onMouseDown(startEvent: MouseEvent): void {\n if (startEvent.button !== 0) {\n return;\n }\n\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['mousemove', 'sci-mousemove'],\n endEventNames: ['mouseup', 'sci-mouseup'],\n eventPositionFn: (mouseEvent: MouseEvent): EventPosition => {\n if (this.isVertical) {\n return {screenPos: mouseEvent.screenX, clientPos: mouseEvent.clientX, pagePos: mouseEvent.pageX};\n }\n else {\n return {screenPos: mouseEvent.screenY, clientPos: mouseEvent.clientY, pagePos: mouseEvent.pageY};\n }\n },\n });\n }\n\n private installMoveListener<EVENT extends Event>(config: {startEvent: EVENT; moveEventNames: string[]; endEventNames: string[]; eventPositionFn: (event: EVENT) => EventPosition}): void {\n const startEvent = config.startEvent;\n\n startEvent.preventDefault();\n\n this._zone.runOutsideAngular(() => {\n // install listeners on document level to allow fast dragging the splitter.\n const moveEvent$ = merge(...config.moveEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n const endEvent$ = merge(...config.endEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n let lastClientPos = config.eventPositionFn(startEvent).clientPos;\n\n // Apply cursor on document level to prevent flickering while moving the splitter\n const oldDocumentCursor = this._document.body.style.cursor;\n this._document.body.style.cursor = this.splitterCursor;\n\n // Listen for 'move' events until stop moving the splitter\n moveEvent$\n .pipe(\n tapFirst(() => this._zone.run(() => {\n this.moving = true;\n this.start.emit();\n this._cd.markForCheck();\n })),\n // Throttle emission to a single event per animation frame.\n audit(() => nextAnimationFrame$()),\n takeUntilDestroyed(this._destroyRef),\n takeUntil(endEvent$),\n )\n .subscribe((moveEvent: EVENT) => {\n NgZone.assertNotInAngularZone();\n\n const eventPos = config.eventPositionFn(moveEvent);\n const newClientPos = eventPos.clientPos;\n const distance = newClientPos - lastClientPos;\n lastClientPos = newClientPos;\n\n this.move.emit({distance, position: eventPos});\n });\n\n // Listen for 'end' events; call 'stop propagation' to not close overlays\n endEvent$\n .pipe(\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe((endEvent: EVENT) => {\n endEvent.stopPropagation();\n this._document.body.style.cursor = oldDocumentCursor;\n this.moving && this._zone.run(() => {\n this.end.emit();\n this.moving = false;\n this._cd.markForCheck();\n });\n });\n });\n }\n}\n\nexport interface EventPosition {\n clientPos: number;\n pagePos: number;\n screenPos: number;\n}\n\n/**\n * Event that is emitted when moving the splitter.\n */\nexport interface SplitterMoveEvent {\n /**\n * The distance in pixels by which the user has moved the splitter since the last emission.\n */\n distance: number;\n /**\n * The position where the mouse or touch event has occurred.\n */\n position: EventPosition;\n}\n\n/**\n * Emits when the next animation frame is executed.\n *\n * Unlike using `timer(0, animationFrameScheduler)`, this observable emits within the zone where it is subscribed.\n *\n * Note that the RxJS `animationFrameScheduler` may not necessarily execute in the current execution context, such as inside or outside Angular.\n * The scheduler always executes tasks in the zone where it was first used in the application.\n */\nfunction nextAnimationFrame$(): Observable<void> {\n return new Observable<void>(observer => {\n const animationFrame = requestAnimationFrame(() => observer.next());\n return () => cancelAnimationFrame(animationFrame);\n });\n}\n","<div #touch_target class=\"touch-target\">\n <div class=\"handle\"></div>\n</div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/splitter'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSplitterComponent, type SplitterMoveEvent, type EventPosition} from './splitter.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MAOU,oBAAoB,CAAA;AAE/B;;AAEG;AACa,IAAA,WAAW,GAAG,KAAK,CAA4B,UAAU,uDAAC;AAE1E;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEvC;;AAEG;IACa,IAAI,GAAG,MAAM,EAAqB;AAElD;;AAEG;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AA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,ilBC/DjC,sFAGA,EAAA,MAAA,EAAA,CAAA,uiDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FD4Da,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;+BACE,cAAc,EAAA,eAAA,EAGP,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sFAAA,EAAA,MAAA,EAAA,CAAA,uiDAAA,CAAA,EAAA;sWAiC6B,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA;sBAEzF,WAAW;uBAAC,cAAc;;sBAG1B,WAAW;uBAAC,gBAAgB;;sBAK5B,WAAW;uBAAC,kBAAkB;;sBAK9B,WAAW;uBAAC,cAAc;;AA6I7B;;;;;;;AAOG;AACH,SAAS,mBAAmB,GAAA;AAC1B,IAAA,OAAO,IAAI,UAAU,CAAO,QAAQ,IAAG;AACrC,QAAA,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnE,QAAA,OAAO,MAAM,oBAAoB,CAAC,cAAc,CAAC;AACnD,IAAA,CAAC,CAAC;AACJ;;AEvQA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-splitter.mjs","sources":["../../../../projects/scion/components/splitter/src/splitter.component.ts","../../../../projects/scion/components/splitter/src/splitter.component.html","../../../../projects/scion/components/splitter/src/public_api.ts","../../../../projects/scion/components/splitter/src/scion-components-splitter.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, input, NgZone, output, signal, untracked, viewChild} from '@angular/core';\nimport {audit, fromEvent, merge, Observable, Subscription} from 'rxjs';\nimport {tapFirst} from '@scion/toolkit/operators';\nimport {first, takeUntil} from 'rxjs/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Represents a splitter, a visual element that allows the user to control the size of elements next to it.\n *\n * The splitter has a handle that the user can move depending on the orientation of the splitter.\n *\n * Note that this control neither does change the size of adjacent elements nor does it (re-)position itself, but emits the distance by\n * which the user has theoretically moved the splitter. You must subscribe to these events and change your layout accordingly.\n *\n * In the toolkit, {@link SciSashboxComponent} uses this splitter to divide a layout into several resizable sections.\n * Another use case would be a resizable sidebar panel.\n *\n * ### Usage\n *\n * ```html\n * <sci-splitter (move)=\"onSplitterMove($event.distance)\"></sci-splitter>\n * ```\n *\n * ### Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-splitter` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-splitter-background-color: Sets the background color of the splitter.\n * - --sci-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-splitter-cross-axis-size: Sets the splitter size along the cross axis.\n * - --sci-splitter-border-radius: Sets the border radius of the splitter.\n * - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-splitter {\n * --sci-splitter-background-color: black;\n * --sci-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-splitter',\n templateUrl: './splitter.component.html',\n styleUrls: ['./splitter.component.scss'],\n host: {\n '[class.moving]': 'moving()',\n '[class.horizontal]': 'isHorizontal()',\n '[class.vertical]': 'isVertical()',\n '[style.cursor]': 'splitterCursor()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciSplitterComponent {\n\n /**\n * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.\n */\n public readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /**\n * Notifies when start moving the splitter.\n */\n public readonly start = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n /**\n * Notifies when moving the splitter. The event is emitted outside the Angular zone.\n */\n public readonly move = output<SplitterMoveEvent>();\n\n /**\n * Notifies when end moving the splitter.\n */\n public readonly end = output<void>();\n\n /**\n * Notifies when resetting the splitter position.\n */\n public readonly reset = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _zone = inject(NgZone);\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _document = inject(DOCUMENT);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _touchTarget = viewChild.required<ElementRef<HTMLElement>>('touch_target');\n\n protected readonly moving = signal(false);\n protected readonly isHorizontal = computed(() => this.orientation() === 'horizontal');\n protected readonly isVertical = computed(() => !this.isHorizontal());\n protected readonly splitterCursor = computed(() => this.isVertical() ? 'ew-resize' : 'ns-resize');\n\n constructor() {\n effect(onCleanup => {\n const touchTargetElement = this._touchTarget().nativeElement;\n const subscription = new Subscription();\n\n untracked(() => {\n subscription.add(fromEvent(touchTargetElement, 'dblclick').subscribe(() => this.onReset()));\n subscription.add(fromEvent<TouchEvent>(touchTargetElement, 'touchstart').subscribe((event: TouchEvent) => this.onTouchStart(event)));\n subscription.add(fromEvent<MouseEvent>(touchTargetElement, 'mousedown').subscribe((event: MouseEvent) => this.onMouseDown(event)));\n });\n\n onCleanup(() => subscription.unsubscribe());\n });\n }\n\n private onReset(): void {\n this.reset.emit();\n }\n\n private onTouchStart(startEvent: TouchEvent): void {\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['touchmove'],\n endEventNames: ['touchend', 'touchcancel'],\n eventPositionFn: (touchEvent: TouchEvent): EventPosition => {\n const touch: Touch = touchEvent.touches[0]!;\n if (this.isVertical()) {\n return {screenPos: touch.screenX, clientPos: touch.clientX, pagePos: touch.pageX};\n }\n else {\n return {screenPos: touch.screenY, clientPos: touch.clientY, pagePos: touch.pageY};\n }\n },\n });\n }\n\n private onMouseDown(startEvent: MouseEvent): void {\n if (startEvent.button !== 0) {\n return;\n }\n\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['mousemove', 'sci-mousemove'],\n endEventNames: ['mouseup', 'sci-mouseup'],\n eventPositionFn: (mouseEvent: MouseEvent): EventPosition => {\n if (this.isVertical()) {\n return {screenPos: mouseEvent.screenX, clientPos: mouseEvent.clientX, pagePos: mouseEvent.pageX};\n }\n else {\n return {screenPos: mouseEvent.screenY, clientPos: mouseEvent.clientY, pagePos: mouseEvent.pageY};\n }\n },\n });\n }\n\n private installMoveListener<EVENT extends Event>(config: {startEvent: EVENT; moveEventNames: string[]; endEventNames: string[]; eventPositionFn: (event: EVENT) => EventPosition}): void {\n const startEvent = config.startEvent;\n\n startEvent.preventDefault();\n\n this._zone.runOutsideAngular(() => {\n // install listeners on document level to allow fast dragging the splitter.\n const moveEvent$ = merge(...config.moveEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n const endEvent$ = merge(...config.endEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n let lastClientPos = config.eventPositionFn(startEvent).clientPos;\n\n // Apply cursor on document level to prevent flickering while moving the splitter\n const oldDocumentCursor = this._document.body.style.cursor;\n this._document.body.style.cursor = this.splitterCursor();\n\n // Listen for 'move' events until stop moving the splitter\n moveEvent$\n .pipe(\n tapFirst(() => this._zone.run(() => {\n this.moving.set(true);\n this.start.emit();\n this._cd.markForCheck();\n })),\n // Throttle emission to a single event per animation frame.\n audit(() => nextAnimationFrame$()),\n takeUntilDestroyed(this._destroyRef),\n takeUntil(endEvent$),\n )\n .subscribe((moveEvent: EVENT) => {\n NgZone.assertNotInAngularZone();\n\n const eventPos = config.eventPositionFn(moveEvent);\n const newClientPos = eventPos.clientPos;\n const distance = newClientPos - lastClientPos;\n lastClientPos = newClientPos;\n\n this.move.emit({distance, position: eventPos});\n });\n\n // Listen for 'end' events; call 'stop propagation' to not close overlays\n endEvent$\n .pipe(\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe((endEvent: EVENT) => {\n endEvent.stopPropagation();\n this._document.body.style.cursor = oldDocumentCursor;\n this.moving() && this._zone.run(() => {\n this.end.emit();\n this.moving.set(false);\n this._cd.markForCheck();\n });\n });\n });\n }\n}\n\nexport interface EventPosition {\n clientPos: number;\n pagePos: number;\n screenPos: number;\n}\n\n/**\n * Event that is emitted when moving the splitter.\n */\nexport interface SplitterMoveEvent {\n /**\n * The distance in pixels by which the user has moved the splitter since the last emission.\n */\n distance: number;\n /**\n * The position where the mouse or touch event has occurred.\n */\n position: EventPosition;\n}\n\n/**\n * Emits when the next animation frame is executed.\n *\n * Unlike using `timer(0, animationFrameScheduler)`, this observable emits within the zone where it is subscribed.\n *\n * Note that the RxJS `animationFrameScheduler` may not necessarily execute in the current execution context, such as inside or outside Angular.\n * The scheduler always executes tasks in the zone where it was first used in the application.\n */\nfunction nextAnimationFrame$(): Observable<void> {\n return new Observable<void>(observer => {\n const animationFrame = requestAnimationFrame(() => observer.next());\n return () => cancelAnimationFrame(animationFrame);\n });\n}\n","<div #touch_target class=\"touch-target\">\n <div class=\"handle\"></div>\n</div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/splitter'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSplitterComponent, type SplitterMoveEvent, type EventPosition} from './splitter.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MAaU,oBAAoB,CAAA;AAE/B;;AAEG;AACa,IAAA,WAAW,GAAG,KAAK,CAA4B,UAAU,uDAAC;AAE1E;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEvC;;AAEG;IACa,IAAI,GAAG,MAAM,EAAqB;AAElD;;AAEG;IACa,GAAG,GAAG,MAAM,EAAQ;AAEpC;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEtB,IAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AACtB,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,YAAY,GAAG,SAAS,CAAC,QAAQ,CAA0B,cAAc,CAAC;AAExE,IAAA,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC;AACtB,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,wDAAC;AAClE,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AACjD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,GAAG,WAAW,GAAG,WAAW,0DAAC;AAEjG,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,SAAS,IAAG;YACjB,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,aA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A,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AA6I5F;;;;;;;AAOG;AACH,SAAS,mBAAmB,GAAA;AAC1B,IAAA,OAAO,IAAI,UAAU,CAAO,QAAQ,IAAG;AACrC,QAAA,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnE,QAAA,OAAO,MAAM,oBAAoB,CAAC,cAAc,CAAC;AACnD,IAAA,CAAC,CAAC;AACJ;;AE9PA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DOCUMENT, NgZone, Injectable, input, ElementRef, Renderer2, effect, untracked, Directive, DestroyRef, viewChild,
|
|
2
|
+
import { inject, DOCUMENT, NgZone, Injectable, input, ElementRef, Renderer2, effect, untracked, Directive, DestroyRef, viewChild, signal, computed, ChangeDetectionStrategy, Component, output, ViewEncapsulation } from '@angular/core';
|
|
3
3
|
import { fromEvent, merge, mergeWith, timer, of } from 'rxjs';
|
|
4
4
|
import { debounceTime, startWith, map, distinctUntilChanged, first, withLatestFrom, takeWhile, takeUntil, switchMap } from 'rxjs/operators';
|
|
5
5
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -239,20 +239,13 @@ class SciScrollbarComponent {
|
|
|
239
239
|
_zone = inject(NgZone);
|
|
240
240
|
_destroyRef = inject(DestroyRef);
|
|
241
241
|
_thumbElement = viewChild.required('thumb_handle');
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
_lastDragPosition = signal(null, ...(ngDevMode ? [{ debugName: "_lastDragPosition" }] : []));
|
|
243
|
+
vertical = computed(() => this.direction() === 'vscroll', ...(ngDevMode ? [{ debugName: "vertical" }] : []));
|
|
244
|
+
horizontal = computed(() => !this.vertical(), ...(ngDevMode ? [{ debugName: "horizontal" }] : []));
|
|
245
|
+
scrolling = computed(() => this._lastDragPosition() !== null, ...(ngDevMode ? [{ debugName: "scrolling" }] : []));
|
|
244
246
|
_overflow = false;
|
|
245
247
|
_thumbSizeFr = 0;
|
|
246
248
|
_thumbPositionFr = 0;
|
|
247
|
-
get vertical() {
|
|
248
|
-
return this._vertical();
|
|
249
|
-
}
|
|
250
|
-
get horizontal() {
|
|
251
|
-
return !this._vertical();
|
|
252
|
-
}
|
|
253
|
-
get scrolling() {
|
|
254
|
-
return this._lastDragPosition !== null;
|
|
255
|
-
}
|
|
256
249
|
constructor() {
|
|
257
250
|
this.installScrollPositionRenderer();
|
|
258
251
|
}
|
|
@@ -279,36 +272,36 @@ class SciScrollbarComponent {
|
|
|
279
272
|
}
|
|
280
273
|
onTouchStart(event) {
|
|
281
274
|
event.preventDefault();
|
|
282
|
-
this._lastDragPosition
|
|
275
|
+
this._lastDragPosition.set(this.vertical() ? event.touches[0].screenY : event.touches[0].screenX);
|
|
283
276
|
}
|
|
284
277
|
onTouchMove(event) {
|
|
285
278
|
event.preventDefault();
|
|
286
|
-
const newDragPositionPx = this.vertical ? event.touches[0].screenY : event.touches[0].screenX;
|
|
287
|
-
const scrollbarPanPx = newDragPositionPx - this._lastDragPosition;
|
|
279
|
+
const newDragPositionPx = this.vertical() ? event.touches[0].screenY : event.touches[0].screenX;
|
|
280
|
+
const scrollbarPanPx = newDragPositionPx - this._lastDragPosition();
|
|
288
281
|
const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);
|
|
289
|
-
this._lastDragPosition
|
|
282
|
+
this._lastDragPosition.set(newDragPositionPx);
|
|
290
283
|
this.moveViewportClient(viewportPanPx);
|
|
291
284
|
}
|
|
292
285
|
onTouchEnd(event) {
|
|
293
286
|
event.preventDefault();
|
|
294
|
-
this._lastDragPosition
|
|
287
|
+
this._lastDragPosition.set(null);
|
|
295
288
|
}
|
|
296
289
|
onMouseDown(mousedownEvent) {
|
|
297
290
|
if (mousedownEvent.button !== 0) {
|
|
298
291
|
return;
|
|
299
292
|
}
|
|
300
293
|
mousedownEvent.preventDefault();
|
|
301
|
-
this._lastDragPosition
|
|
294
|
+
this._lastDragPosition.set(this.vertical() ? mousedownEvent.screenY : mousedownEvent.screenX);
|
|
302
295
|
// Listen for 'mousemove' events
|
|
303
296
|
const mousemoveListener = merge(fromEvent(this._document, 'mousemove'), fromEvent(this._document, 'sci-mousemove'))
|
|
304
297
|
.pipe(subscribeIn(fn => this._zone.runOutsideAngular(fn)), takeUntilDestroyed(this._destroyRef))
|
|
305
298
|
.subscribe(mousemoveEvent => {
|
|
306
299
|
NgZone.assertNotInAngularZone();
|
|
307
300
|
mousemoveEvent.preventDefault();
|
|
308
|
-
const newDragPositionPx = this.vertical ? mousemoveEvent.screenY : mousemoveEvent.screenX;
|
|
309
|
-
const scrollbarPanPx = newDragPositionPx - this._lastDragPosition;
|
|
301
|
+
const newDragPositionPx = this.vertical() ? mousemoveEvent.screenY : mousemoveEvent.screenX;
|
|
302
|
+
const scrollbarPanPx = newDragPositionPx - this._lastDragPosition();
|
|
310
303
|
const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);
|
|
311
|
-
this._lastDragPosition
|
|
304
|
+
this._lastDragPosition.set(newDragPositionPx);
|
|
312
305
|
this.moveViewportClient(viewportPanPx);
|
|
313
306
|
});
|
|
314
307
|
// Listen for 'mouseup' events; use 'capture phase' and 'stop propagation' to not close overlays
|
|
@@ -318,7 +311,7 @@ class SciScrollbarComponent {
|
|
|
318
311
|
NgZone.assertNotInAngularZone();
|
|
319
312
|
mouseupEvent.stopPropagation();
|
|
320
313
|
mousemoveListener.unsubscribe();
|
|
321
|
-
this._lastDragPosition
|
|
314
|
+
this._lastDragPosition.set(null);
|
|
322
315
|
});
|
|
323
316
|
}
|
|
324
317
|
onScrollTrackMouseDown(event, direction) {
|
|
@@ -351,7 +344,7 @@ class SciScrollbarComponent {
|
|
|
351
344
|
* Moves the viewport client by the specified numbers of pixels.
|
|
352
345
|
*/
|
|
353
346
|
moveViewportClient(viewportPanPx) {
|
|
354
|
-
if (this.vertical) {
|
|
347
|
+
if (this.vertical()) {
|
|
355
348
|
this.viewport().scrollTop += viewportPanPx;
|
|
356
349
|
}
|
|
357
350
|
else {
|
|
@@ -391,37 +384,32 @@ class SciScrollbarComponent {
|
|
|
391
384
|
this._host.style.setProperty(key, `${value}`);
|
|
392
385
|
}
|
|
393
386
|
get viewportSize() {
|
|
394
|
-
return this.vertical ? this.viewport().clientHeight : this.viewport().clientWidth;
|
|
387
|
+
return this.vertical() ? this.viewport().clientHeight : this.viewport().clientWidth;
|
|
395
388
|
}
|
|
396
389
|
get viewportClientSize() {
|
|
397
|
-
return this.vertical ? this.viewport().scrollHeight : this.viewport().scrollWidth;
|
|
390
|
+
return this.vertical() ? this.viewport().scrollHeight : this.viewport().scrollWidth;
|
|
398
391
|
}
|
|
399
392
|
get scrollPosition() {
|
|
400
|
-
return this.vertical ? this.viewport().scrollTop : this.viewport().scrollLeft;
|
|
393
|
+
return this.vertical() ? this.viewport().scrollTop : this.viewport().scrollLeft;
|
|
401
394
|
}
|
|
402
395
|
get thumbSize() {
|
|
403
396
|
const thumbElement = this._thumbElement().nativeElement;
|
|
404
|
-
return this.vertical ? thumbElement.clientHeight : thumbElement.clientWidth;
|
|
397
|
+
return this.vertical() ? thumbElement.clientHeight : thumbElement.clientWidth;
|
|
405
398
|
}
|
|
406
399
|
get trackSize() {
|
|
407
|
-
return this.vertical ? this._host.clientHeight : this._host.clientWidth;
|
|
400
|
+
return this.vertical() ? this._host.clientHeight : this._host.clientWidth;
|
|
408
401
|
}
|
|
409
402
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SciScrollbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
410
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: SciScrollbarComponent, isStandalone: true, selector: "sci-scrollbar", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, viewport: { classPropertyName: "viewport", publicName: "viewport", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.vertical": "
|
|
403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: SciScrollbarComponent, isStandalone: true, selector: "sci-scrollbar", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, viewport: { classPropertyName: "viewport", publicName: "viewport", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.vertical": "vertical()", "class.horizontal": "horizontal()", "class.scrolling": "scrolling()" } }, viewQueries: [{ propertyName: "_thumbElement", first: true, predicate: ["thumb_handle"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box;--\\275sci-scrollbar-thumb-position-fr: 0;--\\275sci-scrollbar-thumb-size-fr: 0}:host.vertical{flex-direction:column}:host.horizontal{flex-direction:row}:host>div.scrolltrack-start{flex-grow:var(--\\275sci-scrollbar-thumb-position-fr)}:host>div.thumb-handle{flex-basis:20px;display:flex;flex-grow:var(--\\275sci-scrollbar-thumb-size-fr);align-items:center}:host>div.thumb-handle.vertical{flex-direction:column}:host>div.thumb-handle.horizontal{flex-direction:row}:host>div.thumb-handle>div.thumb{flex:auto;border-radius:4px;background-color:var(--sci-scrollbar-color);opacity:.4;transition-duration:125ms;transition-property:width,height;transition-timing-function:ease-out}:host>div.thumb-handle>div.thumb.vertical{width:60%}:host>div.thumb-handle>div.thumb.horizontal{height:60%}:host>div.scrolltrack-end{flex-grow:calc(1 - (var(--\\275sci-scrollbar-thumb-position-fr) + var(--\\275sci-scrollbar-thumb-size-fr)))}:host-context:not(.overflow){display:none}:host-context:hover>div.thumb-handle>div.thumb,:host-context(.scrolling)>div.thumb-handle>div.thumb{background-color:var(--sci-scrollbar-color);opacity:.75}:host-context:hover>div.thumb-handle>div.thumb.vertical,:host-context(.scrolling)>div.thumb-handle>div.thumb.vertical{width:100%}:host-context:hover>div.thumb-handle>div.thumb.horizontal,:host-context(.scrolling)>div.thumb-handle>div.thumb.horizontal{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
411
404
|
}
|
|
412
405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SciScrollbarComponent, decorators: [{
|
|
413
406
|
type: Component,
|
|
414
|
-
args: [{ selector: 'sci-scrollbar', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
args: ['class.horizontal']
|
|
421
|
-
}], scrolling: [{
|
|
422
|
-
type: HostBinding,
|
|
423
|
-
args: ['class.scrolling']
|
|
424
|
-
}] } });
|
|
407
|
+
args: [{ selector: 'sci-scrollbar', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
408
|
+
'[class.vertical]': 'vertical()',
|
|
409
|
+
'[class.horizontal]': 'horizontal()',
|
|
410
|
+
'[class.scrolling]': 'scrolling()',
|
|
411
|
+
}, template: "<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n", styles: ["@charset \"UTF-8\";:host{display:flex;border:2px solid transparent;box-sizing:border-box;--\\275sci-scrollbar-thumb-position-fr: 0;--\\275sci-scrollbar-thumb-size-fr: 0}:host.vertical{flex-direction:column}:host.horizontal{flex-direction:row}:host>div.scrolltrack-start{flex-grow:var(--\\275sci-scrollbar-thumb-position-fr)}:host>div.thumb-handle{flex-basis:20px;display:flex;flex-grow:var(--\\275sci-scrollbar-thumb-size-fr);align-items:center}:host>div.thumb-handle.vertical{flex-direction:column}:host>div.thumb-handle.horizontal{flex-direction:row}:host>div.thumb-handle>div.thumb{flex:auto;border-radius:4px;background-color:var(--sci-scrollbar-color);opacity:.4;transition-duration:125ms;transition-property:width,height;transition-timing-function:ease-out}:host>div.thumb-handle>div.thumb.vertical{width:60%}:host>div.thumb-handle>div.thumb.horizontal{height:60%}:host>div.scrolltrack-end{flex-grow:calc(1 - (var(--\\275sci-scrollbar-thumb-position-fr) + var(--\\275sci-scrollbar-thumb-size-fr)))}:host-context:not(.overflow){display:none}:host-context:hover>div.thumb-handle>div.thumb,:host-context(.scrolling)>div.thumb-handle>div.thumb{background-color:var(--sci-scrollbar-color);opacity:.75}:host-context:hover>div.thumb-handle>div.thumb.vertical,:host-context(.scrolling)>div.thumb-handle>div.thumb.vertical{width:100%}:host-context:hover>div.thumb-handle>div.thumb.horizontal,:host-context(.scrolling)>div.thumb-handle>div.thumb.horizontal{height:100%}\n"] }]
|
|
412
|
+
}], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], viewport: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewport", required: true }] }], _thumbElement: [{ type: i0.ViewChild, args: ['thumb_handle', { isSignal: true }] }] } });
|
|
425
413
|
/**
|
|
426
414
|
* Emits whenever the viewport scrolls.
|
|
427
415
|
*/
|
|
@@ -721,11 +709,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
|
|
|
721
709
|
SciScrollableDirective,
|
|
722
710
|
SciScrollbarComponent,
|
|
723
711
|
CdkScrollable,
|
|
724
|
-
],
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}] } });
|
|
712
|
+
], host: {
|
|
713
|
+
'(focus)': 'focus()',
|
|
714
|
+
}, template: "<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle() === 'native'\"\n cdkScrollable>\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n@if (scrollbarStyle() === 'on-top' && nativeScrollbarTrackSizeProvider.trackSize() !== null) {\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"/>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"/>\n}\n", styles: [":host{display:grid;grid-template-columns:100%;grid-template-rows:100%;position:relative;overflow:hidden;outline:none}:host:host-context(:not(:hover):not(:active)) sci-scrollbar:not(.scrolling){opacity:0}:host>div.viewport{display:grid;position:relative;outline:none;-webkit-overflow-scrolling:touch}:host>div.viewport>div.viewport-client{display:grid}:host>sci-scrollbar{--sci-scrollbar-color: var(--sci-viewport-scrollbar-color);position:absolute;transition-duration:1s;transition-property:opacity;transition-timing-function:ease-out}:host>sci-scrollbar.vertical{top:0;right:0;bottom:0;left:unset;width:12px}:host>sci-scrollbar.horizontal{top:unset;right:0;bottom:0;left:0;height:12px}\n"] }]
|
|
715
|
+
}], ctorParameters: () => [], propDecorators: { scrollbarStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarStyle", required: false }] }], scroll: [{ type: i0.Output, args: ["scroll"] }], _viewport: [{ type: i0.ViewChild, args: ['viewport', { isSignal: true }] }], _viewportClient: [{ type: i0.ViewChild, args: ['viewport_client', { isSignal: true }] }] } });
|
|
729
716
|
|
|
730
717
|
/*
|
|
731
718
|
* Copyright (c) 2018-2019 Swiss Federal Railways
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-viewport.mjs","sources":["../../../../projects/scion/components/viewport/src/native-scrollbar-track-size-provider.service.ts","../../../../projects/scion/components/viewport/src/scrollable.directive.ts","../../../../projects/scion/components/viewport/src/scrollbar/scrollbar.component.ts","../../../../projects/scion/components/viewport/src/scrollbar/scrollbar.component.html","../../../../projects/scion/components/viewport/src/viewport.component.ts","../../../../projects/scion/components/viewport/src/viewport.component.html","../../../../projects/scion/components/viewport/src/public_api.ts","../../../../projects/scion/components/viewport/src/scion-components-viewport.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, NgZone, Signal, DOCUMENT} from '@angular/core';\nimport {fromEvent} from 'rxjs';\nimport {debounceTime, distinctUntilChanged, map, startWith} from 'rxjs/operators';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Provides the native scrollbar tracksize.\n */\n@Injectable({providedIn: 'root'})\nexport class SciNativeScrollbarTrackSizeProvider {\n\n private readonly _document = inject(DOCUMENT);\n private readonly _zone = inject(NgZone);\n\n /**\n * Provides the track size of the native scrollbar, or `null` if the native scrollbars sit on top of the content.\n */\n public trackSize: Signal<NativeScrollbarTrackSize | null>;\n\n constructor() {\n this.trackSize = this.createNativeScrollbarTrackSizeSignal();\n }\n\n /**\n * Computes the native scrollbar track size.\n *\n * @returns native track size, or `null` if the native scrollbars sit on top of the content.\n */\n private computeTrackSize(): NativeScrollbarTrackSize | null {\n // Create temporary viewport and viewport client with native scrollbars to compute the scrolltrack width.\n const viewportDiv = this._document.createElement('div');\n setStyle(viewportDiv, {\n position: 'absolute',\n overflow: 'scroll',\n height: '100px',\n width: '100px',\n border: '0',\n visibility: 'hidden',\n });\n\n const viewportClientDiv = this._document.createElement('div');\n setStyle(viewportClientDiv, {\n height: '100%',\n width: '100%',\n border: '0',\n });\n\n viewportDiv.appendChild(viewportClientDiv);\n this._document.body.appendChild(viewportDiv);\n\n // Do not use client and offset width/height to calculate the size of the scrollbar, as they are rounded, resulting in unwanted spacing when zooming the page.\n const viewportBounds = viewportDiv.getBoundingClientRect();\n const viewportClientBounds = viewportClientDiv.getBoundingClientRect();\n const trackSize: NativeScrollbarTrackSize = {\n hScrollbarTrackHeight: viewportBounds.height - viewportClientBounds.height,\n vScrollbarTrackWidth: viewportBounds.width - viewportClientBounds.width,\n };\n\n // Destroy temporary viewport.\n this._document.body.removeChild(viewportDiv);\n if (trackSize.hScrollbarTrackHeight === 0 && trackSize.vScrollbarTrackWidth === 0) {\n return null;\n }\n\n return trackSize;\n }\n\n private createNativeScrollbarTrackSizeSignal(): Signal<NativeScrollbarTrackSize | null> {\n // We compute the size of the native scrollbar track when the browser fires the onresize window event.\n // This event is also fired on page zoom or when displaying a hidden document. Hidden documents do not have\n // a scrollbar track size until being displayed, e.g., after showing hidden iframes.\n const trackSize$ = fromEvent(window, 'resize')\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n debounceTime(5),\n startWith(null), // trigger the initial computation\n map(() => this.computeTrackSize()),\n distinctUntilChanged((t1, t2) => t1?.hScrollbarTrackHeight === t2?.hScrollbarTrackHeight && t1?.vScrollbarTrackWidth === t2?.vScrollbarTrackWidth),\n );\n return toSignal(trackSize$, {initialValue: null});\n }\n}\n\n/**\n * Applies the given style(s) to the given element.\n *\n * Specify styles to be modified by passing a dictionary containing CSS property names (hyphen case).\n * To remove a style, set its value to `null`.\n *\n * @ignore\n */\nfunction setStyle(element: HTMLElement, styles: {[style: string]: string}): void {\n Object.entries(styles).forEach(([name, value]) => element.style.setProperty(name, value));\n}\n\n/**\n * Represents the native scrollbar track size.\n */\nexport interface NativeScrollbarTrackSize {\n hScrollbarTrackHeight: number;\n vScrollbarTrackWidth: number;\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, Renderer2, untracked} from '@angular/core';\nimport {NativeScrollbarTrackSize, SciNativeScrollbarTrackSizeProvider} from './native-scrollbar-track-size-provider.service';\nimport {Dictionary} from '@scion/toolkit/util';\n\n/**\n * Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars\n * already sit on top of the viewport (e.g. in OS X).\n *\n * Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'\n * to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.\n *\n * This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element\n * fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`\n * to hide the pushed out native scrollbars.\n */\n@Directive({selector: '[sciScrollable]'})\nexport class SciScrollableDirective {\n\n /**\n * Controls whether to display native scrollbars.\n * Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.\n */\n public readonly displayNativeScrollbar = input(false, {alias: 'sciScrollableDisplayNativeScrollbar'});\n\n private readonly _host = inject(ElementRef<HTMLDivElement>).nativeElement as HTMLElement;\n private readonly _renderer = inject(Renderer2);\n private readonly _nativeScrollbarTrackSizeProvider = inject(SciNativeScrollbarTrackSizeProvider);\n\n constructor() {\n this.controlDisplayOfNativeScrollbar();\n }\n\n /**\n * Controls the display of the native scrollbar based on this directive's configuration.\n */\n private controlDisplayOfNativeScrollbar(): void {\n effect(() => {\n const displayNativeScrollbar = this.displayNativeScrollbar();\n if (displayNativeScrollbar) {\n untracked(() => this.useNativeScrollbars());\n return;\n }\n\n const nativeScrollbarTrackSize = this._nativeScrollbarTrackSizeProvider.trackSize();\n if (nativeScrollbarTrackSize) {\n untracked(() => this.shiftNativeScrollbars(nativeScrollbarTrackSize));\n }\n else {\n untracked(() => this.useNativeScrollbars());\n }\n });\n }\n\n /**\n * Uses the native scrollbars when content overflows.\n */\n private useNativeScrollbars(): void {\n this.setStyle(this._host, {\n overflow: 'auto',\n width: '100%',\n height: '100%',\n marginRight: 0,\n marginBottom: 0,\n });\n }\n\n /**\n * Shifts the native scrollbars out of the visible viewport area.\n */\n private shiftNativeScrollbars(nativeScrollbarTrackSize: NativeScrollbarTrackSize): void {\n this.setStyle(this._host, {\n overflow: 'scroll',\n width: `calc(100% + ${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,\n height: `calc(100% + ${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,\n marginRight: `-${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,\n marginBottom: `-${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,\n });\n }\n\n private setStyle(element: Element, style: Dictionary): void {\n Object.keys(style).forEach(key => this._renderer.setStyle(element, key, style[key]));\n }\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, HostBinding, inject, input, NgZone, untracked, viewChild, DOCUMENT} from '@angular/core';\nimport {fromEvent, merge, mergeWith, Observable, of, timer} from 'rxjs';\nimport {debounceTime, first, map, startWith, switchMap, takeUntil, takeWhile, withLatestFrom} from 'rxjs/operators';\nimport {fromMutation$, fromResize$} from '@scion/toolkit/observable';\nimport {filterArray, subscribeIn} from '@scion/toolkit/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Renders a vertical or horizontal scrollbar.\n *\n * The scrollbar features the following functionality:\n * - allows to move the thumb by mouse or touch\n * - enlarges the thumb if the mouse pointer is near the thumb\n * - allows paging on mousedown on the scroll track\n *\n * ### Styling:\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-scrollbar` component, the following CSS variables can be set directly on the component.\n *\n * - sci-scrollbar-color: Sets the color of the scrollbar.\n *\n * Example:\n *\n * ```css\n *\n * sci-scrollbar {\n * --sci-scrollbar-color: blue;\n * }\n * ```\n */\n@Component({\n selector: 'sci-scrollbar',\n templateUrl: './scrollbar.component.html',\n styleUrl: './scrollbar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SciScrollbarComponent {\n\n /**\n * Timeout for debouncing viewport resize events that trigger the scroll position computation.\n *\n * Debouncing is particularly important in the context of Angular animations, since they continuously\n * trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n * expands a panel that contains a viewport.\n *\n * @internal\n */\n public static readonly VIEWPORT_RESIZE_DEBOUNCE_TIME = 50;\n\n /**\n * Specifies the direction of the scrollbar. Defaults to a vertical scrollbar.\n */\n public readonly direction = input<'vscroll' | 'hscroll'>('vscroll');\n\n /**\n * The viewport to provide scrollbars for.\n */\n public readonly viewport = input.required<HTMLElement>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _document = inject(DOCUMENT);\n private readonly _zone = inject(NgZone);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _thumbElement = viewChild.required<ElementRef<HTMLDivElement>>('thumb_handle');\n private readonly _vertical = computed(() => this.direction() === 'vscroll');\n\n private _lastDragPosition: number | null = null;\n private _overflow = false;\n private _thumbSizeFr = 0;\n private _thumbPositionFr = 0;\n\n @HostBinding('class.vertical')\n protected get vertical(): boolean {\n return this._vertical();\n }\n\n @HostBinding('class.horizontal')\n protected get horizontal(): boolean {\n return !this._vertical();\n }\n\n @HostBinding('class.scrolling')\n protected get scrolling(): boolean {\n return this._lastDragPosition !== null;\n }\n\n constructor() {\n this.installScrollPositionRenderer();\n }\n\n /**\n * Computes the scroll position and updates CSS variables to render the scroll position in the UI.\n */\n private renderScrollPosition(): void {\n NgZone.assertNotInAngularZone();\n const viewportSize = this.viewportSize;\n const viewportClientSize = this.viewportClientSize;\n const thumbPositionFr = this.scrollPosition / viewportClientSize;\n const thumbSizeFr = viewportSize / viewportClientSize;\n const overflow = viewportClientSize > viewportSize;\n\n if (thumbPositionFr !== this._thumbPositionFr || thumbSizeFr !== this._thumbSizeFr) {\n this._thumbPositionFr = thumbPositionFr;\n this._thumbSizeFr = thumbSizeFr;\n this.setCssVariable('--ɵsci-scrollbar-thumb-position-fr', thumbPositionFr);\n this.setCssVariable('--ɵsci-scrollbar-thumb-size-fr', thumbSizeFr);\n }\n\n if (overflow !== this._overflow) {\n this._overflow = overflow;\n overflow ? this._host.classList.add('overflow') : this._host.classList.remove('overflow');\n }\n }\n\n protected onTouchStart(event: TouchEvent): void {\n event.preventDefault();\n this._lastDragPosition = this.vertical ? event.touches[0]!.screenY : event.touches[0]!.screenX;\n }\n\n protected onTouchMove(event: TouchEvent): void {\n event.preventDefault();\n\n const newDragPositionPx = this.vertical ? event.touches[0]!.screenY : event.touches[0]!.screenX;\n const scrollbarPanPx = newDragPositionPx - this._lastDragPosition!;\n const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);\n this._lastDragPosition = newDragPositionPx;\n this.moveViewportClient(viewportPanPx);\n }\n\n protected onTouchEnd(event: TouchEvent): void {\n event.preventDefault();\n this._lastDragPosition = null;\n }\n\n protected onMouseDown(mousedownEvent: MouseEvent): void {\n if (mousedownEvent.button !== 0) {\n return;\n }\n\n mousedownEvent.preventDefault();\n this._lastDragPosition = this.vertical ? mousedownEvent.screenY : mousedownEvent.screenX;\n\n // Listen for 'mousemove' events\n const mousemoveListener = merge(fromEvent<MouseEvent>(this._document, 'mousemove'), fromEvent<MouseEvent>(this._document, 'sci-mousemove'))\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe(mousemoveEvent => {\n NgZone.assertNotInAngularZone();\n mousemoveEvent.preventDefault();\n const newDragPositionPx = this.vertical ? mousemoveEvent.screenY : mousemoveEvent.screenX;\n const scrollbarPanPx = newDragPositionPx - this._lastDragPosition!;\n const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);\n this._lastDragPosition = newDragPositionPx;\n this.moveViewportClient(viewportPanPx);\n });\n\n // Listen for 'mouseup' events; use 'capture phase' and 'stop propagation' to not close overlays\n merge(fromEvent<MouseEvent>(this._document, 'mouseup', {capture: true}), fromEvent<MouseEvent>(this._document, 'sci-mouseup'))\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe(mouseupEvent => {\n NgZone.assertNotInAngularZone();\n mouseupEvent.stopPropagation();\n mousemoveListener.unsubscribe();\n this._lastDragPosition = null;\n });\n }\n\n protected onScrollTrackMouseDown(event: MouseEvent, direction: 'up' | 'down'): void {\n const signum = (direction === 'up' ? -1 : 1);\n this.scrollWhileMouseDown(this.toViewportPanPx(signum * this.thumbSize), event);\n }\n\n /**\n * Renders the current scroll position when the viewport is scrolled.\n */\n private installScrollPositionRenderer(): void {\n effect(onCleanup => {\n const viewport = this.viewport();\n\n untracked(() => {\n const subscription = viewportScroll$(viewport)\n .pipe(\n mergeWith(viewportSize$(viewport, {debounceTime: SciScrollbarComponent.VIEWPORT_RESIZE_DEBOUNCE_TIME})),\n mergeWith(viewportClientSize$(viewport, {debounceTime: SciScrollbarComponent.VIEWPORT_RESIZE_DEBOUNCE_TIME})),\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n )\n .subscribe(() => this.renderScrollPosition());\n onCleanup(() => subscription.unsubscribe());\n });\n });\n }\n\n /**\n * Projects the given scrollbar scroll pixels into viewport scroll pixels.\n */\n private toViewportPanPx(scrollbarPanPx: number): number {\n const scrollRangePx = this.trackSize - this.thumbSize;\n const scrollRatio = scrollbarPanPx / scrollRangePx;\n return scrollRatio * (this.viewportClientSize - this.viewportSize);\n }\n\n /**\n * Moves the viewport client by the specified numbers of pixels.\n */\n private moveViewportClient(viewportPanPx: number): void {\n if (this.vertical) {\n this.viewport().scrollTop += viewportPanPx;\n }\n else {\n this.viewport().scrollLeft += viewportPanPx;\n }\n }\n\n /**\n * Indicates if the content overflows.\n */\n public get overflow(): boolean {\n return this._overflow;\n }\n\n /**\n * Scrolls continuously while holding the mouse pressed, or until the mouse leaves the scrolltrack.\n */\n private scrollWhileMouseDown(viewportScrollPx: number, mousedownEvent: MouseEvent): void {\n // The `EventTarget` type of `Event.target` is not yet compatible with `FromEventTarget` used in `fromEvent`.\n // This will be fixed in rxjs version 7.0.0. Refer to https://github.com/ReactiveX/rxjs/commit/5f022d784570684632e6fd5ae247fc259ee34c4b\n // for more details.\n const scrollTrackElement = mousedownEvent.target as Element;\n\n // scroll continuously every 50ms after an initial delay of 250ms\n timer(250, 50)\n .pipe(\n // continue chain with latest mouse event\n withLatestFrom(merge(of(mousedownEvent), fromEvent<MouseEvent>(scrollTrackElement, 'mousemove')), (tick, event) => event),\n // start immediately\n startWith(mousedownEvent),\n // stop scrolling if the thumb hits the mouse pointer position\n takeWhile((event: MouseEvent) => scrollTrackElement === this._document.elementFromPoint(event.clientX, event.clientY)),\n debounceTime(10),\n // stop scrolling on mouseout or mouseup\n takeUntil(merge(fromEvent(scrollTrackElement, 'mouseout'), fromEvent(scrollTrackElement, 'mouseup'))),\n )\n .subscribe(() => {\n this.moveViewportClient(viewportScrollPx);\n });\n }\n\n private setCssVariable(key: string, value: number): void {\n this._host.style.setProperty(key, `${value}`);\n }\n\n private get viewportSize(): number {\n return this.vertical ? this.viewport().clientHeight : this.viewport().clientWidth;\n }\n\n private get viewportClientSize(): number {\n return this.vertical ? this.viewport().scrollHeight : this.viewport().scrollWidth;\n }\n\n private get scrollPosition(): number {\n return this.vertical ? this.viewport().scrollTop : this.viewport().scrollLeft;\n }\n\n private get thumbSize(): number {\n const thumbElement = this._thumbElement().nativeElement;\n return this.vertical ? thumbElement.clientHeight : thumbElement.clientWidth;\n }\n\n private get trackSize(): number {\n return this.vertical ? this._host.clientHeight : this._host.clientWidth;\n }\n}\n\n/**\n * Emits whenever the viewport scrolls.\n */\nfunction viewportScroll$(viewport: HTMLElement): Observable<void> {\n return fromEvent(viewport, 'scroll', {passive: true}).pipe(map(() => undefined));\n}\n\n/**\n * Emits on subscription, and then each time the size of the viewport changes.\n */\nfunction viewportSize$(viewport: HTMLElement, options: {debounceTime: number}): Observable<void> {\n return fromResize$(viewport)\n .pipe(\n // Debouncing is particularly important in the context of Angular animations, since they continuously\n // trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n // expands a panel that contains a viewport.\n debounceTime(options.debounceTime),\n map(() => undefined),\n );\n}\n\n/**\n * Emits on subscription, and then each time the size or style property of the viewport client changes.\n */\nfunction viewportClientSize$(viewport: HTMLElement, options: {debounceTime: number}): Observable<void> {\n return children$(viewport)\n .pipe(\n switchMap(children => merge(...children.map(child => merge(\n fromResize$(child),\n // Observe style mutations since some transformations change the scroll position without necessarily triggering a dimension change,\n // e.g., `scale` or `translate` used by some virtual scroll implementations\n fromMutation$(child, {subtree: false, childList: false, attributeFilter: ['style']})),\n ))),\n // Debouncing is particularly important in the context of Angular animations, since they continuously\n // trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n // expands a panel that contains a viewport.\n debounceTime(options.debounceTime),\n map(() => undefined),\n );\n}\n\n/**\n * Emits the children of the passed element, and then each time child elements are added or removed.\n */\nfunction children$(element: HTMLElement): Observable<HTMLElement[]> {\n return fromMutation$(element, {subtree: false, childList: true})\n .pipe(\n startWith(undefined as void),\n map(() => Array.from(element.children)),\n filterArray((child: Element): child is HTMLElement => child instanceof HTMLElement),\n );\n}\n","<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical\"\n [class.horizontal]=\"horizontal\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, effect, ElementRef, HostListener, inject, input, NgZone, output, untracked, viewChild, ViewEncapsulation} from '@angular/core';\nimport {SciNativeScrollbarTrackSizeProvider} from './native-scrollbar-track-size-provider.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {SciScrollableDirective} from './scrollable.directive';\nimport {SciScrollbarComponent} from './scrollbar/scrollbar.component';\nimport {fromEvent} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {CdkScrollable} from '@angular/cdk/scrolling';\n\n/**\n * Represents a viewport with slotted content (`<ng-content>`) used as scrollable content. By default, content is added to a CSS grid layout.\n *\n * The viewport component displays scrollbars when its content overflows. Scrollbars are displayed on top of the content, not next to it.\n * 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.\n * The viewport remains natively scrollable with the native scrollbars shifted out of the viewport's visible area. Consequently, the viewport keeps supporting\n * native scrolling features such as touch gestures, scroll speed acceleration, or scrolling near the viewport edges during drag-and-drop operations.\n *\n * ```html\n * <sci-viewport>\n * your content\n * </sci-viewport>\n * ```\n *\n * ## Adding the viewport to a layout\n *\n * Typically, you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container\n * with the viewport's `flex` CSS property set to either `flex: auto` or `flex: 1 1 0`.\n *\n * 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\n * a layout constraint. Depending on the layout, different steps may be necessary to prevent the viewport from growing to infinity.\n *\n * - If practical, give the viewport a fixed size or a maximum size.\n * - 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,\n * 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\n * `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\n * the remaining extra space is distributed. If the viewport does not appear after setting this property, check its parent elements' content sizes.\n * 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`.\n * Another approach would be to set the minimum height of all parents to `0`, as follows: `min-height: 0`.\n *\n * For the complete documentation on the flex layout and its features, refer to https://developer.mozilla.org/en-US/docs/Web/CSS/flex.\n *\n *\n * ## Layouting the viewport's slotted content\n *\n * By default, the viewport's content is added to a CSS grid container with a single column, filling remaining space vertically and horizontally.\n * 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.\n *\n * #### Example of adding slotted content to a CSS flex container\n * ```css\n * sci-viewport::part(content) {\n * display: flex;\n * flex-direction: column;\n * }\n * ```\n *\n * #### Example of configuring CSS grid container with two columns\n * ```css\n * sci-viewport::part(content) {\n * grid-template-columns: 1fr 1fr;\n * gap: 1em;\n * }\n * ```\n *\n * ## Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-viewport` component, the following CSS variables can be set directly on the component.\n *\n * - sci-viewport-scrollbar-color: Sets the color of the scrollbar.\n *\n * ```css\n * sci-viewport {\n * --sci-viewport-scrollbar-color: blue;\n * }\n * ```\n */\n@Component({\n selector: 'sci-viewport',\n templateUrl: './viewport.component.html',\n styleUrl: './viewport.component.scss',\n encapsulation: ViewEncapsulation.ShadowDom,\n imports: [\n SciScrollableDirective,\n SciScrollbarComponent,\n CdkScrollable,\n ],\n})\nexport class SciViewportComponent {\n\n /**\n * Controls if to use the native scrollbar or a scrollbar that sits on top of the viewport. Defaults to `on-top`.\n */\n public readonly scrollbarStyle = input<ScrollbarStyle>('on-top');\n\n /**\n * Emits when the viewport is scrolled. The event is emitted outside the Angular zone to avoid unnecessary change detection cycles.\n */\n public readonly scroll = output<Event>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _viewport = viewChild.required<ElementRef<HTMLDivElement>>('viewport');\n private readonly _viewportClient = viewChild.required<ElementRef<HTMLDivElement>>('viewport_client');\n\n protected readonly nativeScrollbarTrackSizeProvider = inject(SciNativeScrollbarTrackSizeProvider);\n\n constructor() {\n this.installScrollEmitter();\n }\n\n @HostListener('focus')\n public focus(): void { // do not rename to expose the same focus method like `HTMLElement.focus()`.\n this.viewportElement.focus();\n }\n\n /**\n * Returns the number of pixels that the viewport client is scrolled vertically.\n *\n * @see Element.scrollTop\n */\n public get scrollTop(): number {\n return this.viewportElement.scrollTop;\n }\n\n /**\n * Sets the number of pixels that the viewport client is scrolled vertically.\n *\n * @see Element.scrollTop\n */\n public set scrollTop(scrollTop: number) {\n this.viewportElement.scrollTop = scrollTop;\n }\n\n /**\n * Returns the number of pixels that the viewport client is scrolled horizontally.\n *\n * @see Element.scrollLeft\n */\n public get scrollLeft(): number {\n return this.viewportElement.scrollLeft;\n }\n\n /**\n * Sets the number of pixels that the viewport client is scrolled horizontally.\n *\n * @see Element.scrollLeft\n */\n public set scrollLeft(scrollLeft: number) {\n this.viewportElement.scrollLeft = scrollLeft;\n }\n\n /**\n * Returns the height of the viewport client.\n *\n * @see Element.scrollHeight\n */\n public get scrollHeight(): number {\n return this.viewportElement.scrollHeight;\n }\n\n /**\n * Returns the width of the viewport client.\n *\n * @see Element.scrollWidth\n */\n public get scrollWidth(): number {\n return this.viewportElement.scrollWidth;\n }\n\n /**\n * Returns the viewport {HTMLElement}.\n */\n public get viewportElement(): HTMLElement {\n return this._viewport().nativeElement;\n }\n\n /**\n * Returns the viewport client {HTMLElement}.\n */\n public get viewportClientElement(): HTMLElement {\n return this._viewportClient().nativeElement;\n }\n\n /**\n * Checks if the specified element is scrolled into the viewport.\n *\n * @param element - the element to be checked\n * @param fit - control if the element must fully or partially fit into the viewport\n * @return `true` if the element is scrolled into the viewport, or `false` otherwise.\n */\n public isElementInView(element: ElementRef<HTMLElement> | HTMLElement, fit: 'full' | 'partial'): boolean {\n const elTop = this.computeOffset(element, 'top');\n if (elTop === null) {\n return false;\n }\n const elLeft = this.computeOffset(element, 'left');\n if (elLeft === null) {\n return false;\n }\n\n // Consider elements as scrolled into view when there is no viewport overflow.\n // The calculation of whether an element is scrolled into view may be wrong by a few pixels if the viewport contains elements with decimal sizes.\n // This can happen because `offsetLeft` and `offsetTop` operate on an integer (not a decimal), losing precision that can accumulate.\n // To avoid incorrect calculation when there is no viewport overflow, we consider all contained elements as scrolled into the view.\n if (this.viewportElement.scrollWidth <= this.viewportElement.clientWidth && this.viewportElement.scrollHeight <= this.viewportElement.clientHeight) {\n return true;\n }\n\n const elBottom = elTop + coerceElement(element).offsetHeight;\n const elRight = elLeft + coerceElement(element).offsetWidth;\n\n const vpTop = this.viewportElement.scrollTop;\n const vpLeft = this.viewportElement.scrollLeft;\n const vpBottom = vpTop + this.viewportElement.clientHeight;\n const vpRight = vpLeft + this.viewportElement.clientWidth;\n\n if (fit === 'full') {\n return (elTop >= vpTop && elBottom <= vpBottom) && (elLeft >= vpLeft && elRight <= vpRight);\n }\n else {\n return (elBottom >= vpTop && elTop <= vpBottom) && (elRight >= vpLeft && elLeft <= vpRight);\n }\n }\n\n /**\n * Scrolls the specified element into the viewport.\n *\n * @param element - the element to scroll into the viewport\n * @param offset - the gap between the element and the viewport\n */\n public scrollIntoView(element: ElementRef<HTMLElement> | HTMLElement, offset: number = 50): void {\n const top = this.computeOffset(element, 'top');\n if (top === null) {\n return;\n }\n const left = this.computeOffset(element, 'left');\n if (left === null) {\n return;\n }\n\n this.viewportElement.scrollTop = top - offset;\n this.viewportElement.scrollLeft = left - offset;\n }\n\n /**\n * Computes the distance of the element to the viewport's left or top border.\n *\n * @return distance of the element to the viewport's left or top border, or `null` if not contained\n * in the viewport or the element or any ancestor has the `display` property set to `none`.\n */\n public computeOffset(element: ElementRef<HTMLElement> | HTMLElement, border: 'left' | 'top'): number | null {\n let offset = 0;\n let el = coerceElement(element);\n do {\n offset += (border === 'left' ? el.offsetLeft : el.offsetTop);\n const offsetParent = el.offsetParent;\n if (offsetParent === null) {\n // `offsetParent` is `null` in the following situations:\n // - The element or any ancestor has the `display` property set to `none`\n // - The element has the position property set to fixed (Firefox returns <body>).\n // - The element is <body> or <html>.\n // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent.\n return null;\n }\n if (!(offsetParent instanceof HTMLElement)) {\n return null;\n }\n el = offsetParent;\n } while (el !== this._host);\n\n return offset;\n }\n\n /**\n * Emits when the scroll position changes.\n */\n private installScrollEmitter(): void {\n const zone = inject(NgZone);\n effect(onCleanup => {\n const viewport = this._viewport();\n untracked(() => {\n const subscription = fromEvent(viewport.nativeElement, 'scroll')\n .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n .subscribe(event => this.scroll.emit(event));\n onCleanup(() => subscription.unsubscribe());\n });\n });\n }\n}\n\n/**\n * Represents a scrollbar style.\n */\nexport type ScrollbarStyle = 'native' | 'on-top' | 'hidden';\n","<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle() === 'native'\"\n cdkScrollable>\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n@if (scrollbarStyle() === 'on-top' && nativeScrollbarTrackSizeProvider.trackSize() !== null) {\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"/>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"/>\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/viewport'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciViewportComponent, type ScrollbarStyle} from './viewport.component';\nexport {SciScrollbarComponent} from './scrollbar/scrollbar.component';\nexport {SciScrollableDirective} from './scrollable.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;;AAQG;AAQH;;AAEG;MAEU,mCAAmC,CAAA;AAE7B,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,KAAK,GAAG,MAAM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AAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,yEACJ,iBAAiB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA;sBAQlG,YAAY;uBAAC,OAAO;;;AEvHvB;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-viewport.mjs","sources":["../../../../projects/scion/components/viewport/src/native-scrollbar-track-size-provider.service.ts","../../../../projects/scion/components/viewport/src/scrollable.directive.ts","../../../../projects/scion/components/viewport/src/scrollbar/scrollbar.component.ts","../../../../projects/scion/components/viewport/src/scrollbar/scrollbar.component.html","../../../../projects/scion/components/viewport/src/viewport.component.ts","../../../../projects/scion/components/viewport/src/viewport.component.html","../../../../projects/scion/components/viewport/src/public_api.ts","../../../../projects/scion/components/viewport/src/scion-components-viewport.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2024 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {inject, Injectable, NgZone, Signal, DOCUMENT} from '@angular/core';\nimport {fromEvent} from 'rxjs';\nimport {debounceTime, distinctUntilChanged, map, startWith} from 'rxjs/operators';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Provides the native scrollbar tracksize.\n */\n@Injectable({providedIn: 'root'})\nexport class SciNativeScrollbarTrackSizeProvider {\n\n private readonly _document = inject(DOCUMENT);\n private readonly _zone = inject(NgZone);\n\n /**\n * Provides the track size of the native scrollbar, or `null` if the native scrollbars sit on top of the content.\n */\n public trackSize: Signal<NativeScrollbarTrackSize | null>;\n\n constructor() {\n this.trackSize = this.createNativeScrollbarTrackSizeSignal();\n }\n\n /**\n * Computes the native scrollbar track size.\n *\n * @returns native track size, or `null` if the native scrollbars sit on top of the content.\n */\n private computeTrackSize(): NativeScrollbarTrackSize | null {\n // Create temporary viewport and viewport client with native scrollbars to compute the scrolltrack width.\n const viewportDiv = this._document.createElement('div');\n setStyle(viewportDiv, {\n position: 'absolute',\n overflow: 'scroll',\n height: '100px',\n width: '100px',\n border: '0',\n visibility: 'hidden',\n });\n\n const viewportClientDiv = this._document.createElement('div');\n setStyle(viewportClientDiv, {\n height: '100%',\n width: '100%',\n border: '0',\n });\n\n viewportDiv.appendChild(viewportClientDiv);\n this._document.body.appendChild(viewportDiv);\n\n // Do not use client and offset width/height to calculate the size of the scrollbar, as they are rounded, resulting in unwanted spacing when zooming the page.\n const viewportBounds = viewportDiv.getBoundingClientRect();\n const viewportClientBounds = viewportClientDiv.getBoundingClientRect();\n const trackSize: NativeScrollbarTrackSize = {\n hScrollbarTrackHeight: viewportBounds.height - viewportClientBounds.height,\n vScrollbarTrackWidth: viewportBounds.width - viewportClientBounds.width,\n };\n\n // Destroy temporary viewport.\n this._document.body.removeChild(viewportDiv);\n if (trackSize.hScrollbarTrackHeight === 0 && trackSize.vScrollbarTrackWidth === 0) {\n return null;\n }\n\n return trackSize;\n }\n\n private createNativeScrollbarTrackSizeSignal(): Signal<NativeScrollbarTrackSize | null> {\n // We compute the size of the native scrollbar track when the browser fires the onresize window event.\n // This event is also fired on page zoom or when displaying a hidden document. Hidden documents do not have\n // a scrollbar track size until being displayed, e.g., after showing hidden iframes.\n const trackSize$ = fromEvent(window, 'resize')\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n debounceTime(5),\n startWith(null), // trigger the initial computation\n map(() => this.computeTrackSize()),\n distinctUntilChanged((t1, t2) => t1?.hScrollbarTrackHeight === t2?.hScrollbarTrackHeight && t1?.vScrollbarTrackWidth === t2?.vScrollbarTrackWidth),\n );\n return toSignal(trackSize$, {initialValue: null});\n }\n}\n\n/**\n * Applies the given style(s) to the given element.\n *\n * Specify styles to be modified by passing a dictionary containing CSS property names (hyphen case).\n * To remove a style, set its value to `null`.\n *\n * @ignore\n */\nfunction setStyle(element: HTMLElement, styles: {[style: string]: string}): void {\n Object.entries(styles).forEach(([name, value]) => element.style.setProperty(name, value));\n}\n\n/**\n * Represents the native scrollbar track size.\n */\nexport interface NativeScrollbarTrackSize {\n hScrollbarTrackHeight: number;\n vScrollbarTrackWidth: number;\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, effect, ElementRef, inject, input, Renderer2, untracked} from '@angular/core';\nimport {NativeScrollbarTrackSize, SciNativeScrollbarTrackSizeProvider} from './native-scrollbar-track-size-provider.service';\nimport {Dictionary} from '@scion/toolkit/util';\n\n/**\n * Makes the host element natively scrollable and hides native scrollbars by default, unless native scrollbars\n * already sit on top of the viewport (e.g. in OS X).\n *\n * Because there is no cross-browser API to hide scrollbars without losing native scroll support, we set 'overflow'\n * to 'scroll' but shift the native scrollbars out of the visible viewport area. The shift offset is computed upfront.\n *\n * This directive expects its host element to be the only child in document flow in its parent DOM element. It makes the host element\n * fill up the entire space (width and height set to 100%). The parent element must have its CSS `overflow` property set to `hidden`\n * to hide the pushed out native scrollbars.\n */\n@Directive({selector: '[sciScrollable]'})\nexport class SciScrollableDirective {\n\n /**\n * Controls whether to display native scrollbars.\n * Has no effect if the native scrollbar sits on top of the content, e.g. in OS X.\n */\n public readonly displayNativeScrollbar = input(false, {alias: 'sciScrollableDisplayNativeScrollbar'});\n\n private readonly _host = inject(ElementRef<HTMLDivElement>).nativeElement as HTMLElement;\n private readonly _renderer = inject(Renderer2);\n private readonly _nativeScrollbarTrackSizeProvider = inject(SciNativeScrollbarTrackSizeProvider);\n\n constructor() {\n this.controlDisplayOfNativeScrollbar();\n }\n\n /**\n * Controls the display of the native scrollbar based on this directive's configuration.\n */\n private controlDisplayOfNativeScrollbar(): void {\n effect(() => {\n const displayNativeScrollbar = this.displayNativeScrollbar();\n if (displayNativeScrollbar) {\n untracked(() => this.useNativeScrollbars());\n return;\n }\n\n const nativeScrollbarTrackSize = this._nativeScrollbarTrackSizeProvider.trackSize();\n if (nativeScrollbarTrackSize) {\n untracked(() => this.shiftNativeScrollbars(nativeScrollbarTrackSize));\n }\n else {\n untracked(() => this.useNativeScrollbars());\n }\n });\n }\n\n /**\n * Uses the native scrollbars when content overflows.\n */\n private useNativeScrollbars(): void {\n this.setStyle(this._host, {\n overflow: 'auto',\n width: '100%',\n height: '100%',\n marginRight: 0,\n marginBottom: 0,\n });\n }\n\n /**\n * Shifts the native scrollbars out of the visible viewport area.\n */\n private shiftNativeScrollbars(nativeScrollbarTrackSize: NativeScrollbarTrackSize): void {\n this.setStyle(this._host, {\n overflow: 'scroll',\n width: `calc(100% + ${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,\n height: `calc(100% + ${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,\n marginRight: `-${nativeScrollbarTrackSize.vScrollbarTrackWidth}px`,\n marginBottom: `-${nativeScrollbarTrackSize.hScrollbarTrackHeight}px`,\n });\n }\n\n private setStyle(element: Element, style: Dictionary): void {\n Object.keys(style).forEach(key => this._renderer.setStyle(element, key, style[key]));\n }\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectionStrategy, Component, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, input, NgZone, signal, untracked, viewChild} from '@angular/core';\nimport {fromEvent, merge, mergeWith, Observable, of, timer} from 'rxjs';\nimport {debounceTime, first, map, startWith, switchMap, takeUntil, takeWhile, withLatestFrom} from 'rxjs/operators';\nimport {fromMutation$, fromResize$} from '@scion/toolkit/observable';\nimport {filterArray, subscribeIn} from '@scion/toolkit/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Renders a vertical or horizontal scrollbar.\n *\n * The scrollbar features the following functionality:\n * - allows to move the thumb by mouse or touch\n * - enlarges the thumb if the mouse pointer is near the thumb\n * - allows paging on mousedown on the scroll track\n *\n * ### Styling:\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-scrollbar` component, the following CSS variables can be set directly on the component.\n *\n * - sci-scrollbar-color: Sets the color of the scrollbar.\n *\n * Example:\n *\n * ```css\n *\n * sci-scrollbar {\n * --sci-scrollbar-color: blue;\n * }\n * ```\n */\n@Component({\n selector: 'sci-scrollbar',\n templateUrl: './scrollbar.component.html',\n styleUrl: './scrollbar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.vertical]': 'vertical()',\n '[class.horizontal]': 'horizontal()',\n '[class.scrolling]': 'scrolling()',\n },\n})\nexport class SciScrollbarComponent {\n\n /**\n * Timeout for debouncing viewport resize events that trigger the scroll position computation.\n *\n * Debouncing is particularly important in the context of Angular animations, since they continuously\n * trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n * expands a panel that contains a viewport.\n *\n * @internal\n */\n public static readonly VIEWPORT_RESIZE_DEBOUNCE_TIME = 50;\n\n /**\n * Specifies the direction of the scrollbar. Defaults to a vertical scrollbar.\n */\n public readonly direction = input<'vscroll' | 'hscroll'>('vscroll');\n\n /**\n * The viewport to provide scrollbars for.\n */\n public readonly viewport = input.required<HTMLElement>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _document = inject(DOCUMENT);\n private readonly _zone = inject(NgZone);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _thumbElement = viewChild.required<ElementRef<HTMLDivElement>>('thumb_handle');\n private readonly _lastDragPosition = signal<number | null>(null);\n\n protected readonly vertical = computed(() => this.direction() === 'vscroll');\n protected readonly horizontal = computed(() => !this.vertical());\n protected readonly scrolling = computed(() => this._lastDragPosition() !== null);\n\n private _overflow = false;\n private _thumbSizeFr = 0;\n private _thumbPositionFr = 0;\n\n constructor() {\n this.installScrollPositionRenderer();\n }\n\n /**\n * Computes the scroll position and updates CSS variables to render the scroll position in the UI.\n */\n private renderScrollPosition(): void {\n NgZone.assertNotInAngularZone();\n const viewportSize = this.viewportSize;\n const viewportClientSize = this.viewportClientSize;\n const thumbPositionFr = this.scrollPosition / viewportClientSize;\n const thumbSizeFr = viewportSize / viewportClientSize;\n const overflow = viewportClientSize > viewportSize;\n\n if (thumbPositionFr !== this._thumbPositionFr || thumbSizeFr !== this._thumbSizeFr) {\n this._thumbPositionFr = thumbPositionFr;\n this._thumbSizeFr = thumbSizeFr;\n this.setCssVariable('--ɵsci-scrollbar-thumb-position-fr', thumbPositionFr);\n this.setCssVariable('--ɵsci-scrollbar-thumb-size-fr', thumbSizeFr);\n }\n\n if (overflow !== this._overflow) {\n this._overflow = overflow;\n overflow ? this._host.classList.add('overflow') : this._host.classList.remove('overflow');\n }\n }\n\n protected onTouchStart(event: TouchEvent): void {\n event.preventDefault();\n this._lastDragPosition.set(this.vertical() ? event.touches[0]!.screenY : event.touches[0]!.screenX);\n }\n\n protected onTouchMove(event: TouchEvent): void {\n event.preventDefault();\n\n const newDragPositionPx = this.vertical() ? event.touches[0]!.screenY : event.touches[0]!.screenX;\n const scrollbarPanPx = newDragPositionPx - this._lastDragPosition()!;\n const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);\n this._lastDragPosition.set(newDragPositionPx);\n this.moveViewportClient(viewportPanPx);\n }\n\n protected onTouchEnd(event: TouchEvent): void {\n event.preventDefault();\n this._lastDragPosition.set(null);\n }\n\n protected onMouseDown(mousedownEvent: MouseEvent): void {\n if (mousedownEvent.button !== 0) {\n return;\n }\n\n mousedownEvent.preventDefault();\n this._lastDragPosition.set(this.vertical() ? mousedownEvent.screenY : mousedownEvent.screenX);\n\n // Listen for 'mousemove' events\n const mousemoveListener = merge(fromEvent<MouseEvent>(this._document, 'mousemove'), fromEvent<MouseEvent>(this._document, 'sci-mousemove'))\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe(mousemoveEvent => {\n NgZone.assertNotInAngularZone();\n mousemoveEvent.preventDefault();\n const newDragPositionPx = this.vertical() ? mousemoveEvent.screenY : mousemoveEvent.screenX;\n const scrollbarPanPx = newDragPositionPx - this._lastDragPosition()!;\n const viewportPanPx = this.toViewportPanPx(scrollbarPanPx);\n this._lastDragPosition.set(newDragPositionPx);\n this.moveViewportClient(viewportPanPx);\n });\n\n // Listen for 'mouseup' events; use 'capture phase' and 'stop propagation' to not close overlays\n merge(fromEvent<MouseEvent>(this._document, 'mouseup', {capture: true}), fromEvent<MouseEvent>(this._document, 'sci-mouseup'))\n .pipe(\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe(mouseupEvent => {\n NgZone.assertNotInAngularZone();\n mouseupEvent.stopPropagation();\n mousemoveListener.unsubscribe();\n this._lastDragPosition.set(null);\n });\n }\n\n protected onScrollTrackMouseDown(event: MouseEvent, direction: 'up' | 'down'): void {\n const signum = (direction === 'up' ? -1 : 1);\n this.scrollWhileMouseDown(this.toViewportPanPx(signum * this.thumbSize), event);\n }\n\n /**\n * Renders the current scroll position when the viewport is scrolled.\n */\n private installScrollPositionRenderer(): void {\n effect(onCleanup => {\n const viewport = this.viewport();\n\n untracked(() => {\n const subscription = viewportScroll$(viewport)\n .pipe(\n mergeWith(viewportSize$(viewport, {debounceTime: SciScrollbarComponent.VIEWPORT_RESIZE_DEBOUNCE_TIME})),\n mergeWith(viewportClientSize$(viewport, {debounceTime: SciScrollbarComponent.VIEWPORT_RESIZE_DEBOUNCE_TIME})),\n subscribeIn(fn => this._zone.runOutsideAngular(fn)),\n )\n .subscribe(() => this.renderScrollPosition());\n onCleanup(() => subscription.unsubscribe());\n });\n });\n }\n\n /**\n * Projects the given scrollbar scroll pixels into viewport scroll pixels.\n */\n private toViewportPanPx(scrollbarPanPx: number): number {\n const scrollRangePx = this.trackSize - this.thumbSize;\n const scrollRatio = scrollbarPanPx / scrollRangePx;\n return scrollRatio * (this.viewportClientSize - this.viewportSize);\n }\n\n /**\n * Moves the viewport client by the specified numbers of pixels.\n */\n private moveViewportClient(viewportPanPx: number): void {\n if (this.vertical()) {\n this.viewport().scrollTop += viewportPanPx;\n }\n else {\n this.viewport().scrollLeft += viewportPanPx;\n }\n }\n\n /**\n * Indicates if the content overflows.\n */\n public get overflow(): boolean {\n return this._overflow;\n }\n\n /**\n * Scrolls continuously while holding the mouse pressed, or until the mouse leaves the scrolltrack.\n */\n private scrollWhileMouseDown(viewportScrollPx: number, mousedownEvent: MouseEvent): void {\n // The `EventTarget` type of `Event.target` is not yet compatible with `FromEventTarget` used in `fromEvent`.\n // This will be fixed in rxjs version 7.0.0. Refer to https://github.com/ReactiveX/rxjs/commit/5f022d784570684632e6fd5ae247fc259ee34c4b\n // for more details.\n const scrollTrackElement = mousedownEvent.target as Element;\n\n // scroll continuously every 50ms after an initial delay of 250ms\n timer(250, 50)\n .pipe(\n // continue chain with latest mouse event\n withLatestFrom(merge(of(mousedownEvent), fromEvent<MouseEvent>(scrollTrackElement, 'mousemove')), (tick, event) => event),\n // start immediately\n startWith(mousedownEvent),\n // stop scrolling if the thumb hits the mouse pointer position\n takeWhile((event: MouseEvent) => scrollTrackElement === this._document.elementFromPoint(event.clientX, event.clientY)),\n debounceTime(10),\n // stop scrolling on mouseout or mouseup\n takeUntil(merge(fromEvent(scrollTrackElement, 'mouseout'), fromEvent(scrollTrackElement, 'mouseup'))),\n )\n .subscribe(() => {\n this.moveViewportClient(viewportScrollPx);\n });\n }\n\n private setCssVariable(key: string, value: number): void {\n this._host.style.setProperty(key, `${value}`);\n }\n\n private get viewportSize(): number {\n return this.vertical() ? this.viewport().clientHeight : this.viewport().clientWidth;\n }\n\n private get viewportClientSize(): number {\n return this.vertical() ? this.viewport().scrollHeight : this.viewport().scrollWidth;\n }\n\n private get scrollPosition(): number {\n return this.vertical() ? this.viewport().scrollTop : this.viewport().scrollLeft;\n }\n\n private get thumbSize(): number {\n const thumbElement = this._thumbElement().nativeElement;\n return this.vertical() ? thumbElement.clientHeight : thumbElement.clientWidth;\n }\n\n private get trackSize(): number {\n return this.vertical() ? this._host.clientHeight : this._host.clientWidth;\n }\n}\n\n/**\n * Emits whenever the viewport scrolls.\n */\nfunction viewportScroll$(viewport: HTMLElement): Observable<void> {\n return fromEvent(viewport, 'scroll', {passive: true}).pipe(map(() => undefined));\n}\n\n/**\n * Emits on subscription, and then each time the size of the viewport changes.\n */\nfunction viewportSize$(viewport: HTMLElement, options: {debounceTime: number}): Observable<void> {\n return fromResize$(viewport)\n .pipe(\n // Debouncing is particularly important in the context of Angular animations, since they continuously\n // trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n // expands a panel that contains a viewport.\n debounceTime(options.debounceTime),\n map(() => undefined),\n );\n}\n\n/**\n * Emits on subscription, and then each time the size or style property of the viewport client changes.\n */\nfunction viewportClientSize$(viewport: HTMLElement, options: {debounceTime: number}): Observable<void> {\n return children$(viewport)\n .pipe(\n switchMap(children => merge(...children.map(child => merge(\n fromResize$(child),\n // Observe style mutations since some transformations change the scroll position without necessarily triggering a dimension change,\n // e.g., `scale` or `translate` used by some virtual scroll implementations\n fromMutation$(child, {subtree: false, childList: false, attributeFilter: ['style']})),\n ))),\n // Debouncing is particularly important in the context of Angular animations, since they continuously\n // trigger resize events. Debouncing prevents the scrollbar from flickering, for example, when the user\n // expands a panel that contains a viewport.\n debounceTime(options.debounceTime),\n map(() => undefined),\n );\n}\n\n/**\n * Emits the children of the passed element, and then each time child elements are added or removed.\n */\nfunction children$(element: HTMLElement): Observable<HTMLElement[]> {\n return fromMutation$(element, {subtree: false, childList: true})\n .pipe(\n startWith(undefined as void),\n map(() => Array.from(element.children)),\n filterArray((child: Element): child is HTMLElement => child instanceof HTMLElement),\n );\n}\n","<!-- scrolltrack to move the viewport client upwards (paging) -->\n<div class=\"scrolltrack-start\" (mousedown)=\"onScrollTrackMouseDown($event, 'up')\"></div>\n\n<!-- scrollthumb -->\n<div #thumb_handle\n class=\"thumb-handle\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\"\n (mousedown)=\"onMouseDown($event)\"\n (touchstart)=\"onTouchStart($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchcancel)=\"onTouchEnd($event)\">\n <div class=\"thumb\"\n [class.vertical]=\"vertical()\"\n [class.horizontal]=\"horizontal()\">\n </div>\n</div>\n\n<!-- scrolltrack to move the viewport client downwards (paging) -->\n<div class=\"scrolltrack-end\" (mousedown)=\"onScrollTrackMouseDown($event, 'down')\"></div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, effect, ElementRef, inject, input, NgZone, output, untracked, viewChild, ViewEncapsulation} from '@angular/core';\nimport {SciNativeScrollbarTrackSizeProvider} from './native-scrollbar-track-size-provider.service';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {SciScrollableDirective} from './scrollable.directive';\nimport {SciScrollbarComponent} from './scrollbar/scrollbar.component';\nimport {fromEvent} from 'rxjs';\nimport {subscribeIn} from '@scion/toolkit/operators';\nimport {CdkScrollable} from '@angular/cdk/scrolling';\n\n/**\n * Represents a viewport with slotted content (`<ng-content>`) used as scrollable content. By default, content is added to a CSS grid layout.\n *\n * The viewport component displays scrollbars when its content overflows. Scrollbars are displayed on top of the content, not next to it.\n * 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.\n * The viewport remains natively scrollable with the native scrollbars shifted out of the viewport's visible area. Consequently, the viewport keeps supporting\n * native scrolling features such as touch gestures, scroll speed acceleration, or scrolling near the viewport edges during drag-and-drop operations.\n *\n * ```html\n * <sci-viewport>\n * your content\n * </sci-viewport>\n * ```\n *\n * ## Adding the viewport to a layout\n *\n * Typically, you would add the viewport component to a flexible layout, filling the remaining space vertically and horizontally, such as a flexbox container\n * with the viewport's `flex` CSS property set to either `flex: auto` or `flex: 1 1 0`.\n *\n * 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\n * a layout constraint. Depending on the layout, different steps may be necessary to prevent the viewport from growing to infinity.\n *\n * - If practical, give the viewport a fixed size or a maximum size.\n * - 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,\n * 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\n * `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\n * the remaining extra space is distributed. If the viewport does not appear after setting this property, check its parent elements' content sizes.\n * 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`.\n * Another approach would be to set the minimum height of all parents to `0`, as follows: `min-height: 0`.\n *\n * For the complete documentation on the flex layout and its features, refer to https://developer.mozilla.org/en-US/docs/Web/CSS/flex.\n *\n *\n * ## Layouting the viewport's slotted content\n *\n * By default, the viewport's content is added to a CSS grid container with a single column, filling remaining space vertically and horizontally.\n * 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.\n *\n * #### Example of adding slotted content to a CSS flex container\n * ```css\n * sci-viewport::part(content) {\n * display: flex;\n * flex-direction: column;\n * }\n * ```\n *\n * #### Example of configuring CSS grid container with two columns\n * ```css\n * sci-viewport::part(content) {\n * grid-template-columns: 1fr 1fr;\n * gap: 1em;\n * }\n * ```\n *\n * ## Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-viewport` component, the following CSS variables can be set directly on the component.\n *\n * - sci-viewport-scrollbar-color: Sets the color of the scrollbar.\n *\n * ```css\n * sci-viewport {\n * --sci-viewport-scrollbar-color: blue;\n * }\n * ```\n */\n@Component({\n selector: 'sci-viewport',\n templateUrl: './viewport.component.html',\n styleUrl: './viewport.component.scss',\n encapsulation: ViewEncapsulation.ShadowDom,\n imports: [\n SciScrollableDirective,\n SciScrollbarComponent,\n CdkScrollable,\n ],\n host: {\n '(focus)': 'focus()',\n },\n})\nexport class SciViewportComponent {\n\n /**\n * Controls if to use the native scrollbar or a scrollbar that sits on top of the viewport. Defaults to `on-top`.\n */\n public readonly scrollbarStyle = input<ScrollbarStyle>('on-top');\n\n /**\n * Emits when the viewport is scrolled. The event is emitted outside the Angular zone to avoid unnecessary change detection cycles.\n */\n public readonly scroll = output<Event>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _viewport = viewChild.required<ElementRef<HTMLDivElement>>('viewport');\n private readonly _viewportClient = viewChild.required<ElementRef<HTMLDivElement>>('viewport_client');\n\n protected readonly nativeScrollbarTrackSizeProvider = inject(SciNativeScrollbarTrackSizeProvider);\n\n constructor() {\n this.installScrollEmitter();\n }\n\n public focus(): void { // do not rename to expose the same focus method like `HTMLElement.focus()`.\n this.viewportElement.focus();\n }\n\n /**\n * Returns the number of pixels that the viewport client is scrolled vertically.\n *\n * @see Element.scrollTop\n */\n public get scrollTop(): number {\n return this.viewportElement.scrollTop;\n }\n\n /**\n * Sets the number of pixels that the viewport client is scrolled vertically.\n *\n * @see Element.scrollTop\n */\n public set scrollTop(scrollTop: number) {\n this.viewportElement.scrollTop = scrollTop;\n }\n\n /**\n * Returns the number of pixels that the viewport client is scrolled horizontally.\n *\n * @see Element.scrollLeft\n */\n public get scrollLeft(): number {\n return this.viewportElement.scrollLeft;\n }\n\n /**\n * Sets the number of pixels that the viewport client is scrolled horizontally.\n *\n * @see Element.scrollLeft\n */\n public set scrollLeft(scrollLeft: number) {\n this.viewportElement.scrollLeft = scrollLeft;\n }\n\n /**\n * Returns the height of the viewport client.\n *\n * @see Element.scrollHeight\n */\n public get scrollHeight(): number {\n return this.viewportElement.scrollHeight;\n }\n\n /**\n * Returns the width of the viewport client.\n *\n * @see Element.scrollWidth\n */\n public get scrollWidth(): number {\n return this.viewportElement.scrollWidth;\n }\n\n /**\n * Returns the viewport {HTMLElement}.\n */\n public get viewportElement(): HTMLElement {\n return this._viewport().nativeElement;\n }\n\n /**\n * Returns the viewport client {HTMLElement}.\n */\n public get viewportClientElement(): HTMLElement {\n return this._viewportClient().nativeElement;\n }\n\n /**\n * Checks if the specified element is scrolled into the viewport.\n *\n * @param element - the element to be checked\n * @param fit - control if the element must fully or partially fit into the viewport\n * @return `true` if the element is scrolled into the viewport, or `false` otherwise.\n */\n public isElementInView(element: ElementRef<HTMLElement> | HTMLElement, fit: 'full' | 'partial'): boolean {\n const elTop = this.computeOffset(element, 'top');\n if (elTop === null) {\n return false;\n }\n const elLeft = this.computeOffset(element, 'left');\n if (elLeft === null) {\n return false;\n }\n\n // Consider elements as scrolled into view when there is no viewport overflow.\n // The calculation of whether an element is scrolled into view may be wrong by a few pixels if the viewport contains elements with decimal sizes.\n // This can happen because `offsetLeft` and `offsetTop` operate on an integer (not a decimal), losing precision that can accumulate.\n // To avoid incorrect calculation when there is no viewport overflow, we consider all contained elements as scrolled into the view.\n if (this.viewportElement.scrollWidth <= this.viewportElement.clientWidth && this.viewportElement.scrollHeight <= this.viewportElement.clientHeight) {\n return true;\n }\n\n const elBottom = elTop + coerceElement(element).offsetHeight;\n const elRight = elLeft + coerceElement(element).offsetWidth;\n\n const vpTop = this.viewportElement.scrollTop;\n const vpLeft = this.viewportElement.scrollLeft;\n const vpBottom = vpTop + this.viewportElement.clientHeight;\n const vpRight = vpLeft + this.viewportElement.clientWidth;\n\n if (fit === 'full') {\n return (elTop >= vpTop && elBottom <= vpBottom) && (elLeft >= vpLeft && elRight <= vpRight);\n }\n else {\n return (elBottom >= vpTop && elTop <= vpBottom) && (elRight >= vpLeft && elLeft <= vpRight);\n }\n }\n\n /**\n * Scrolls the specified element into the viewport.\n *\n * @param element - the element to scroll into the viewport\n * @param offset - the gap between the element and the viewport\n */\n public scrollIntoView(element: ElementRef<HTMLElement> | HTMLElement, offset: number = 50): void {\n const top = this.computeOffset(element, 'top');\n if (top === null) {\n return;\n }\n const left = this.computeOffset(element, 'left');\n if (left === null) {\n return;\n }\n\n this.viewportElement.scrollTop = top - offset;\n this.viewportElement.scrollLeft = left - offset;\n }\n\n /**\n * Computes the distance of the element to the viewport's left or top border.\n *\n * @return distance of the element to the viewport's left or top border, or `null` if not contained\n * in the viewport or the element or any ancestor has the `display` property set to `none`.\n */\n public computeOffset(element: ElementRef<HTMLElement> | HTMLElement, border: 'left' | 'top'): number | null {\n let offset = 0;\n let el = coerceElement(element);\n do {\n offset += (border === 'left' ? el.offsetLeft : el.offsetTop);\n const offsetParent = el.offsetParent;\n if (offsetParent === null) {\n // `offsetParent` is `null` in the following situations:\n // - The element or any ancestor has the `display` property set to `none`\n // - The element has the position property set to fixed (Firefox returns <body>).\n // - The element is <body> or <html>.\n // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent.\n return null;\n }\n if (!(offsetParent instanceof HTMLElement)) {\n return null;\n }\n el = offsetParent;\n } while (el !== this._host);\n\n return offset;\n }\n\n /**\n * Emits when the scroll position changes.\n */\n private installScrollEmitter(): void {\n const zone = inject(NgZone);\n effect(onCleanup => {\n const viewport = this._viewport();\n untracked(() => {\n const subscription = fromEvent(viewport.nativeElement, 'scroll')\n .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n .subscribe(event => this.scroll.emit(event));\n onCleanup(() => subscription.unsubscribe());\n });\n });\n }\n}\n\n/**\n * Represents a scrollbar style.\n */\nexport type ScrollbarStyle = 'native' | 'on-top' | 'hidden';\n","<!-- viewport and viewport client -->\n<div #viewport\n class=\"viewport\"\n tabindex=\"-1\"\n sciScrollable [sciScrollableDisplayNativeScrollbar]=\"scrollbarStyle() === 'native'\"\n cdkScrollable>\n <div #viewport_client class=\"viewport-client\" part=\"content\">\n <slot></slot>\n </div>\n</div>\n\n<!-- render emulated scrollbars which sit on-top -->\n@if (scrollbarStyle() === 'on-top' && nativeScrollbarTrackSizeProvider.trackSize() !== null) {\n <sci-scrollbar [direction]=\"'vscroll'\" [viewport]=\"viewport\" class=\"e2e-vertical\"/>\n <sci-scrollbar [direction]=\"'hscroll'\" [viewport]=\"viewport\" class=\"e2e-horizontal\"/>\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/viewport'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciViewportComponent, type ScrollbarStyle} from './viewport.component';\nexport {SciScrollbarComponent} from './scrollbar/scrollbar.component';\nexport {SciScrollableDirective} from './scrollable.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;;AAQG;AAQH;;AAEG;MAEU,mCAAmC,CAAA;AAE7B,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AAEvC;;AAEG;AACI,IAAA,SAAS;AA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AAA,EACK;AACJ,wBAAA,SAAS,EAAE,SAAS;AACrB,qBAAA,EAAA,QAAA,EAAA,0pBAAA,EAAA,MAAA,EAAA,CAAA,krBAAA,CAAA,EAAA;AAe2E,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,yEACJ,iBAAiB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElHrG;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scion/components",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.1.1",
|
|
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,
|
|
@@ -74,9 +74,9 @@ declare class SciSashboxComponent {
|
|
|
74
74
|
}>;
|
|
75
75
|
private readonly _host;
|
|
76
76
|
private readonly _contentChildren;
|
|
77
|
-
protected sashing: boolean
|
|
78
|
-
protected maxHeight: number | undefined
|
|
79
|
-
protected maxWidth: number | undefined
|
|
77
|
+
protected readonly sashing: _angular_core.WritableSignal<boolean>;
|
|
78
|
+
protected readonly maxHeight: _angular_core.WritableSignal<number | undefined>;
|
|
79
|
+
protected readonly maxWidth: _angular_core.WritableSignal<number | undefined>;
|
|
80
80
|
constructor();
|
|
81
81
|
protected onSashStart(): void;
|
|
82
82
|
protected onSashEnd(): void;
|