@scion/components 21.0.0 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, inject, ElementRef, NgZone, Directive, assertNotInReactiveContext, assertInInjectionContext, Injector, computed, isSignal, signal, effect, untracked } from '@angular/core';
|
|
2
|
+
import { input, output, inject, ElementRef, NgZone, ɵZONELESS_ENABLED as _ZONELESS_ENABLED, Directive, assertNotInReactiveContext, assertInInjectionContext, Injector, computed, isSignal, signal, effect, untracked } from '@angular/core';
|
|
3
3
|
import { fromResize$, fromBoundingClientRect$ } from '@scion/toolkit/observable';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { subscribeIn, observeIn } from '@scion/toolkit/operators';
|
|
@@ -37,6 +37,7 @@ class SciDimensionDirective {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
const host = inject(ElementRef).nativeElement;
|
|
39
39
|
const zone = inject(NgZone);
|
|
40
|
+
const zonelessEnabled = inject(_ZONELESS_ENABLED);
|
|
40
41
|
fromResize$(host)
|
|
41
42
|
.pipe(
|
|
42
43
|
// Avoid triggering change detection cycle.
|
|
@@ -46,8 +47,10 @@ class SciDimensionDirective {
|
|
|
46
47
|
// The scheduler always executes tasks in the context (e.g. zone) where the scheduler was first used in the application.
|
|
47
48
|
observeIn(fn => requestAnimationFrame(fn)), observeIn(fn => this.emitOutsideAngular() ? fn() : zone.run(fn)), takeUntilDestroyed())
|
|
48
49
|
.subscribe(() => {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
if (!zonelessEnabled) {
|
|
51
|
+
// Assert Angular zone.
|
|
52
|
+
this.emitOutsideAngular() ? NgZone.assertNotInAngularZone() : NgZone.assertInAngularZone();
|
|
53
|
+
}
|
|
51
54
|
this.dimensionChange.emit({
|
|
52
55
|
clientWidth: host.clientWidth,
|
|
53
56
|
offsetWidth: host.offsetWidth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-dimension.mjs","sources":["../../../../projects/scion/components/dimension/src/dimension.directive.ts","../../../../projects/scion/components/dimension/src/dimension.signal.ts","../../../../projects/scion/components/dimension/src/bounding-client-rect.signal.ts","../../../../projects/scion/components/dimension/src/public_api.ts","../../../../projects/scion/components/dimension/src/scion-components-dimension.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 {Directive, ElementRef, inject, input, NgZone, output} from '@angular/core';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {SciDimension} from './dimension';\n\n/**\n * Observes the size of the host element.\n *\n * ---\n * Usage:\n *\n * ```html\n * <div sciDimension (sciDimensionChange)=\"onDimensionChange($event)\"></div>\n * ```\n */\n@Directive({\n selector: '[sciDimension]',\n})\nexport class SciDimensionDirective {\n\n /**\n * Controls if to output outside the Angular zone. Defaults to `false`.\n */\n public readonly emitOutsideAngular = input(false);\n\n /**\n * Outputs the size of the element.\n */\n public readonly dimensionChange = output<SciDimension>({alias: 'sciDimensionChange'});\n\n constructor() {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n const zone = inject(NgZone);\n\n fromResize$(host)\n .pipe(\n // Avoid triggering change detection cycle.\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n // Run in animation frame to prevent 'ResizeObserver loop completed with undelivered notifications' error.\n // Do not use `animationFrameScheduler` because the scheduler does not necessarily execute in the current execution context, such as inside or outside Angular.\n // The scheduler always executes tasks in the context (e.g. zone) where the scheduler was first used in the application.\n observeIn(fn => requestAnimationFrame(fn)),\n observeIn(fn => this.emitOutsideAngular() ? fn() : zone.run(fn)),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n // Assert Angular zone.\n this.emitOutsideAngular() ? NgZone.assertNotInAngularZone() : NgZone.assertInAngularZone();\n\n this.dimensionChange.emit({\n clientWidth: host.clientWidth,\n offsetWidth: host.offsetWidth,\n clientHeight: host.clientHeight,\n offsetHeight: host.offsetHeight,\n element: host,\n });\n });\n }\n}\n","/*\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 {assertInInjectionContext, assertNotInReactiveContext, computed, effect, ElementRef, inject, Injector, isSignal, NgZone, signal, Signal, untracked} from '@angular/core';\nimport {SciDimension} from './dimension';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {Objects} from '@scion/toolkit/util';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Creates a signal observing the size of an element.\n *\n * The element can be passed as a signal, enabling observation of view children in the component constructor.\n *\n * The signal subscribes to the native {@link ResizeObserver} to monitor element size changes. Destroying the injection context will unsubscribe the observer.\n *\n * Usage:\n * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.\n * - Must not be called within a reactive context to avoid repeated subscriptions.\n */\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {injector?: Injector}): Signal<SciDimension>;\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<SciDimension | undefined>;\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<SciDimension | undefined> {\n assertNotInReactiveContext(dimension, 'Invoking `dimension` causes new subscriptions every time. Move `dimension` outside of the reactive context and read the signal value where needed.');\n if (!options?.injector) {\n assertInInjectionContext(dimension);\n }\n\n const injector = options?.injector ?? inject(Injector);\n const zone = injector.get(NgZone);\n const element = computed(() => coerceElement(isSignal(elementLike) ? elementLike() : elementLike));\n const onResize = signal<void>(undefined, {equal: () => false});\n\n // Subscribe to element size changes.\n effect(onCleanup => {\n const el = element();\n if (!el) {\n return;\n }\n\n untracked(() => {\n const subscription = fromResize$(el)\n .pipe(\n // Avoid triggering change detection cycle.\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n // Run in animation frame to prevent 'ResizeObserver loop completed with undelivered notifications' error.\n // Do not use `animationFrameScheduler` because the scheduler does not necessarily execute in the current execution context, such as inside or outside Angular.\n // The scheduler always executes tasks in the context (e.g. zone) where the scheduler was first used in the application.\n observeIn(fn => requestAnimationFrame(fn)),\n )\n .subscribe(() => {\n NgZone.assertNotInAngularZone();\n onResize.set();\n });\n onCleanup(() => subscription.unsubscribe());\n });\n }, {injector});\n\n // Create signal that recomputes each time the size changes.\n return computed(() => {\n const el = element();\n if (!el) {\n return undefined;\n }\n\n // Track element size.\n onResize();\n\n return {\n clientWidth: el.clientWidth,\n offsetWidth: el.offsetWidth,\n clientHeight: el.clientHeight,\n offsetHeight: el.offsetHeight,\n element: el,\n };\n }, {equal: Objects.isEqual});\n}\n","/*\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 {assertInInjectionContext, assertNotInReactiveContext, computed, effect, ElementRef, inject, Injector, isSignal, NgZone, signal, Signal, untracked} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {fromBoundingClientRect$} from '@scion/toolkit/observable';\nimport {subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Creates a signal observing the bounding box of an element.\n *\n * The bounding box includes the element's position relative to the top-left of the viewport and its size.\n * Refer to https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect for more details.\n *\n * The element can be passed as a signal, enabling observation of view children in the component constructor.\n *\n * There is no native browser API to observe the position of an element. The signal uses {@link IntersectionObserver} and\n * {@link ResizeObserver} to detect position changes. For tracking only size changes, use the {@link dimension} signal instead.\n *\n * Usage:\n * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.\n * - Must not be called within a reactive context to avoid repeated subscriptions.\n * - The element and the document root (`<html>`) must be positioned `relative` or `absolute`. If not, positioning is changed to `relative`.\n */\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {injector?: Injector}): Signal<DOMRect>;\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<DOMRect | undefined>;\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<DOMRect | undefined> {\n assertNotInReactiveContext(boundingClientRect, 'Invoking `boundingClientRect` causes new subscriptions every time. Move `boundingClientRect` outside of the reactive context and read the signal value where needed.');\n if (!options?.injector) {\n assertInInjectionContext(boundingClientRect);\n }\n\n const injector = options?.injector ?? inject(Injector);\n const zone = injector.get(NgZone);\n const element = computed(() => coerceElement(isSignal(elementLike) ? elementLike() : elementLike));\n const onBoundingBoxChange = signal<void>(undefined, {equal: () => false});\n\n // Subscribe to element bounding box changes.\n effect(onCleanup => {\n const el = element();\n if (!el) {\n return;\n }\n\n untracked(() => {\n const subscription = fromBoundingClientRect$(el)\n // Avoid triggering change detection cycle.\n .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n .subscribe(() => {\n NgZone.assertNotInAngularZone();\n onBoundingBoxChange.set();\n });\n onCleanup(() => subscription.unsubscribe());\n });\n }, {injector});\n\n // Create signal that recomputes each time the bounding box changes.\n return computed(() => {\n const el = element();\n if (!el) {\n return undefined;\n }\n\n // Track bounding box.\n onBoundingBoxChange();\n\n return el.getBoundingClientRect();\n }, {equal: isEqualDomRect});\n}\n\nfunction isEqualDomRect(a: DOMRect | undefined, b: DOMRect | undefined): boolean {\n return a?.top === b?.top && a?.right === b?.right && a?.bottom === b?.bottom && a?.left === b?.left;\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/dimension'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciDimensionDirective} from './dimension.directive';\nexport {dimension} from './dimension.signal';\nexport {boundingClientRect} from './bounding-client-rect.signal';\nexport {type SciDimension} from './dimension';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;AASG;MAIU,qBAAqB,CAAA;AAEhC;;AAEG;AACa,IAAA,kBAAkB,GAAG,KAAK,CAAC,KAAK,8DAAC;AAEjD;;AAEG;IACa,eAAe,GAAG,MAAM,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,GAAG,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,IAAI;AACrG;;AC/EA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-dimension.mjs","sources":["../../../../projects/scion/components/dimension/src/dimension.directive.ts","../../../../projects/scion/components/dimension/src/dimension.signal.ts","../../../../projects/scion/components/dimension/src/bounding-client-rect.signal.ts","../../../../projects/scion/components/dimension/src/public_api.ts","../../../../projects/scion/components/dimension/src/scion-components-dimension.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 {Directive, ElementRef, inject, input, NgZone, output, ɵZONELESS_ENABLED} from '@angular/core';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\nimport {SciDimension} from './dimension';\n\n/**\n * Observes the size of the host element.\n *\n * ---\n * Usage:\n *\n * ```html\n * <div sciDimension (sciDimensionChange)=\"onDimensionChange($event)\"></div>\n * ```\n */\n@Directive({\n selector: '[sciDimension]',\n})\nexport class SciDimensionDirective {\n\n /**\n * Controls if to output outside the Angular zone. Defaults to `false`.\n */\n public readonly emitOutsideAngular = input(false);\n\n /**\n * Outputs the size of the element.\n */\n public readonly dimensionChange = output<SciDimension>({alias: 'sciDimensionChange'});\n\n constructor() {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n const zone = inject(NgZone);\n const zonelessEnabled = inject(ɵZONELESS_ENABLED);\n\n fromResize$(host)\n .pipe(\n // Avoid triggering change detection cycle.\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n // Run in animation frame to prevent 'ResizeObserver loop completed with undelivered notifications' error.\n // Do not use `animationFrameScheduler` because the scheduler does not necessarily execute in the current execution context, such as inside or outside Angular.\n // The scheduler always executes tasks in the context (e.g. zone) where the scheduler was first used in the application.\n observeIn(fn => requestAnimationFrame(fn)),\n observeIn(fn => this.emitOutsideAngular() ? fn() : zone.run(fn)),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n if (!zonelessEnabled) {\n // Assert Angular zone.\n this.emitOutsideAngular() ? NgZone.assertNotInAngularZone() : NgZone.assertInAngularZone();\n }\n\n this.dimensionChange.emit({\n clientWidth: host.clientWidth,\n offsetWidth: host.offsetWidth,\n clientHeight: host.clientHeight,\n offsetHeight: host.offsetHeight,\n element: host,\n });\n });\n }\n}\n","/*\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 {assertInInjectionContext, assertNotInReactiveContext, computed, effect, ElementRef, inject, Injector, isSignal, NgZone, signal, Signal, untracked} from '@angular/core';\nimport {SciDimension} from './dimension';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {Objects} from '@scion/toolkit/util';\nimport {fromResize$} from '@scion/toolkit/observable';\nimport {observeIn, subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Creates a signal observing the size of an element.\n *\n * The element can be passed as a signal, enabling observation of view children in the component constructor.\n *\n * The signal subscribes to the native {@link ResizeObserver} to monitor element size changes. Destroying the injection context will unsubscribe the observer.\n *\n * Usage:\n * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.\n * - Must not be called within a reactive context to avoid repeated subscriptions.\n */\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {injector?: Injector}): Signal<SciDimension>;\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<SciDimension | undefined>;\nexport function dimension(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<SciDimension | undefined> {\n assertNotInReactiveContext(dimension, 'Invoking `dimension` causes new subscriptions every time. Move `dimension` outside of the reactive context and read the signal value where needed.');\n if (!options?.injector) {\n assertInInjectionContext(dimension);\n }\n\n const injector = options?.injector ?? inject(Injector);\n const zone = injector.get(NgZone);\n const element = computed(() => coerceElement(isSignal(elementLike) ? elementLike() : elementLike));\n const onResize = signal<void>(undefined, {equal: () => false});\n\n // Subscribe to element size changes.\n effect(onCleanup => {\n const el = element();\n if (!el) {\n return;\n }\n\n untracked(() => {\n const subscription = fromResize$(el)\n .pipe(\n // Avoid triggering change detection cycle.\n subscribeIn(fn => zone.runOutsideAngular(fn)),\n // Run in animation frame to prevent 'ResizeObserver loop completed with undelivered notifications' error.\n // Do not use `animationFrameScheduler` because the scheduler does not necessarily execute in the current execution context, such as inside or outside Angular.\n // The scheduler always executes tasks in the context (e.g. zone) where the scheduler was first used in the application.\n observeIn(fn => requestAnimationFrame(fn)),\n )\n .subscribe(() => {\n NgZone.assertNotInAngularZone();\n onResize.set();\n });\n onCleanup(() => subscription.unsubscribe());\n });\n }, {injector});\n\n // Create signal that recomputes each time the size changes.\n return computed(() => {\n const el = element();\n if (!el) {\n return undefined;\n }\n\n // Track element size.\n onResize();\n\n return {\n clientWidth: el.clientWidth,\n offsetWidth: el.offsetWidth,\n clientHeight: el.clientHeight,\n offsetHeight: el.offsetHeight,\n element: el,\n };\n }, {equal: Objects.isEqual});\n}\n","/*\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 {assertInInjectionContext, assertNotInReactiveContext, computed, effect, ElementRef, inject, Injector, isSignal, NgZone, signal, Signal, untracked} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {fromBoundingClientRect$} from '@scion/toolkit/observable';\nimport {subscribeIn} from '@scion/toolkit/operators';\n\n/**\n * Creates a signal observing the bounding box of an element.\n *\n * The bounding box includes the element's position relative to the top-left of the viewport and its size.\n * Refer to https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect for more details.\n *\n * The element can be passed as a signal, enabling observation of view children in the component constructor.\n *\n * There is no native browser API to observe the position of an element. The signal uses {@link IntersectionObserver} and\n * {@link ResizeObserver} to detect position changes. For tracking only size changes, use the {@link dimension} signal instead.\n *\n * Usage:\n * - Must be called within an injection context or an injector provided. Destroying the injector will unsubscribe the signal.\n * - Must not be called within a reactive context to avoid repeated subscriptions.\n * - The element and the document root (`<html>`) must be positioned `relative` or `absolute`. If not, positioning is changed to `relative`.\n */\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement>>, options?: {injector?: Injector}): Signal<DOMRect>;\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<DOMRect | undefined>;\nexport function boundingClientRect(elementLike: HTMLElement | ElementRef<HTMLElement> | Signal<HTMLElement | ElementRef<HTMLElement> | undefined>, options?: {injector?: Injector}): Signal<DOMRect | undefined> {\n assertNotInReactiveContext(boundingClientRect, 'Invoking `boundingClientRect` causes new subscriptions every time. Move `boundingClientRect` outside of the reactive context and read the signal value where needed.');\n if (!options?.injector) {\n assertInInjectionContext(boundingClientRect);\n }\n\n const injector = options?.injector ?? inject(Injector);\n const zone = injector.get(NgZone);\n const element = computed(() => coerceElement(isSignal(elementLike) ? elementLike() : elementLike));\n const onBoundingBoxChange = signal<void>(undefined, {equal: () => false});\n\n // Subscribe to element bounding box changes.\n effect(onCleanup => {\n const el = element();\n if (!el) {\n return;\n }\n\n untracked(() => {\n const subscription = fromBoundingClientRect$(el)\n // Avoid triggering change detection cycle.\n .pipe(subscribeIn(fn => zone.runOutsideAngular(fn)))\n .subscribe(() => {\n NgZone.assertNotInAngularZone();\n onBoundingBoxChange.set();\n });\n onCleanup(() => subscription.unsubscribe());\n });\n }, {injector});\n\n // Create signal that recomputes each time the bounding box changes.\n return computed(() => {\n const el = element();\n if (!el) {\n return undefined;\n }\n\n // Track bounding box.\n onBoundingBoxChange();\n\n return el.getBoundingClientRect();\n }, {equal: isEqualDomRect});\n}\n\nfunction isEqualDomRect(a: DOMRect | undefined, b: DOMRect | undefined): boolean {\n return a?.top === b?.top && a?.right === b?.right && a?.bottom === b?.bottom && a?.left === b?.left;\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/dimension'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciDimensionDirective} from './dimension.directive';\nexport {dimension} from './dimension.signal';\nexport {boundingClientRect} from './bounding-client-rect.signal';\nexport {type SciDimension} from './dimension';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ɵZONELESS_ENABLED"],"mappings":";;;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;AASG;MAIU,qBAAqB,CAAA;AAEhC;;AAEG;AACa,IAAA,kBAAkB,GAAG,KAAK,CAAC,KAAK,8DAAC;AAEjD;;AAEG;IACa,eAAe,GAAG,MAAM,CAAe,EAAC,KAAK,EAAE,oBAAoB,EAAC,CAAC;AAErF,IAAA,WAAA,GAAA;QACE,MAAM,IAAI,GAAG,M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AE,GAAG,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,IAAI;AACrG;;AC/EA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, inject, signal, TemplateRef, computed, linkedSignal, Directive, ElementRef, ChangeDetectorRef, effect, Component, output, contentChildren, NgZone, afterNextRender, IterableDiffers, untracked
|
|
2
|
+
import { input, booleanAttribute, inject, signal, TemplateRef, computed, linkedSignal, Directive, ElementRef, ChangeDetectorRef, effect, Component, output, contentChildren, NgZone, afterNextRender, IterableDiffers, untracked } from '@angular/core';
|
|
3
3
|
import { SciSplitterComponent } from '@scion/components/splitter';
|
|
4
4
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
@@ -383,18 +383,18 @@ class SciSashboxComponent {
|
|
|
383
383
|
sashes = this.computeSashes(this._contentChildren);
|
|
384
384
|
/** @internal */
|
|
385
385
|
afterFirstRender = signal(false, ...(ngDevMode ? [{ debugName: "afterFirstRender" }] : []));
|
|
386
|
-
sashing = false;
|
|
387
|
-
maxHeight;
|
|
388
|
-
maxWidth;
|
|
386
|
+
sashing = signal(false, ...(ngDevMode ? [{ debugName: "sashing" }] : []));
|
|
387
|
+
maxHeight = signal(undefined, ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
|
|
388
|
+
maxWidth = signal(undefined, ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
389
389
|
constructor() {
|
|
390
390
|
this.detectFirstRendering();
|
|
391
391
|
}
|
|
392
392
|
onSashStart() {
|
|
393
|
-
this.sashing
|
|
393
|
+
this.sashing.set(true);
|
|
394
394
|
// Avoid overflow when sashing.
|
|
395
395
|
const hostBounds = this._host.getBoundingClientRect();
|
|
396
|
-
this.maxHeight
|
|
397
|
-
this.maxWidth
|
|
396
|
+
this.maxHeight.set(hostBounds.height);
|
|
397
|
+
this.maxWidth.set(hostBounds.width);
|
|
398
398
|
this.sashStart.emit();
|
|
399
399
|
// Set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas).
|
|
400
400
|
this.sashes().forEach(sash => {
|
|
@@ -408,9 +408,9 @@ class SciSashboxComponent {
|
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
onSashEnd() {
|
|
411
|
-
this.sashing
|
|
412
|
-
this.maxHeight
|
|
413
|
-
this.maxWidth
|
|
411
|
+
this.sashing.set(false);
|
|
412
|
+
this.maxHeight.set(undefined);
|
|
413
|
+
this.maxWidth.set(undefined);
|
|
414
414
|
// Unset the flex-basis for non-fixed sashes and set the flex-grow accordingly.
|
|
415
415
|
const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());
|
|
416
416
|
const sashSizes = this.sashes().reduce((acc, sash, i) => acc.set(sash.computeKey(i), sash.component().size), new Map());
|
|
@@ -530,7 +530,7 @@ class SciSashboxComponent {
|
|
|
530
530
|
return sashes;
|
|
531
531
|
}
|
|
532
532
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SciSashboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
533
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: SciSashboxComponent, isStandalone: true, selector: "sci-sashbox", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sashStart: "sashStart", sashEnd: "sashEnd" }, host: { properties: { "attr.data-direction": "direction()", "class.sashing": "
|
|
533
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: SciSashboxComponent, isStandalone: true, selector: "sci-sashbox", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sashStart: "sashStart", sashEnd: "sashEnd" }, host: { properties: { "attr.data-direction": "direction()", "class.sashing": "sashing()", "style.--\u0275sci-sashbox-max-height": "maxHeight()", "style.--\u0275sci-sashbox-max-width": "maxWidth()" } }, providers: [{
|
|
534
534
|
provide: SciSashBoxAccessor,
|
|
535
535
|
useFactory: provideSashBoxAccessor,
|
|
536
536
|
}], queries: [{ propertyName: "_contentChildren", predicate: SciSashDirective, isSignal: true }], ngImport: i0, template: "@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <sci-sash [sash]=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\"/>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"direction() === 'row' ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.host, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\"/>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;align-items:stretch;box-sizing:border-box;overflow:hidden;z-index:0}:host *{box-sizing:border-box}:host[data-direction=column]{flex-direction:column}:host[data-direction=row]{flex-direction:row}:host[data-direction=row]>sci-sash{margin:0 var(--sci-sashbox-gap)}:host[data-direction=row]>sci-sash.first{margin-left:0}:host[data-direction=row]>sci-sash.last{margin-right:0}:host[data-direction=column]>sci-sash{margin:var(--sci-sashbox-gap) 0}:host[data-direction=column]>sci-sash.first{margin-top:0}:host[data-direction=column]>sci-sash.last{margin-bottom:0}:host.sashing{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>sci-sash{pointer-events:none}:host>sci-splitter{--sci-splitter-background-color: var(--sci-sashbox-splitter-background-color);--sci-splitter-background-color-hover: var(--sci-sashbox-splitter-background-color-hover);--sci-splitter-size: var(--sci-sashbox-splitter-size);--sci-splitter-size-hover: var(--sci-sashbox-splitter-size-hover);--sci-splitter-touch-target-size: var(--sci-sashbox-splitter-touch-target-size);--sci-splitter-cross-axis-size: var(--sci-sashbox-splitter-cross-axis-size);--sci-splitter-border-radius: var(--sci-sashbox-splitter-border-radius);--sci-splitter-opacity-active: var(--sci-sashbox-splitter-opacity-active);--sci-splitter-opacity-hover: var(--sci-sashbox-splitter-opacity-hover);flex:none;z-index:1}\n"], dependencies: [{ kind: "component", type: SciSplitterComponent, selector: "sci-splitter", inputs: ["orientation"], outputs: ["start", "move", "end", "reset"] }, { kind: "directive", type: SciElementRefDirective, selector: "[sciElementRef]", exportAs: ["sciElementRef"] }, { kind: "component", type: SashComponent, selector: "sci-sash", inputs: ["sash"] }] });
|
|
@@ -546,17 +546,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
|
|
|
546
546
|
useFactory: provideSashBoxAccessor,
|
|
547
547
|
}], host: {
|
|
548
548
|
'[attr.data-direction]': 'direction()',
|
|
549
|
+
'[class.sashing]': 'sashing()',
|
|
550
|
+
'[style.--ɵsci-sashbox-max-height]': 'maxHeight()',
|
|
551
|
+
'[style.--ɵsci-sashbox-max-width]': 'maxWidth()',
|
|
549
552
|
}, template: "@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <sci-sash [sash]=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\"/>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"direction() === 'row' ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.host, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\"/>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;align-items:stretch;box-sizing:border-box;overflow:hidden;z-index:0}:host *{box-sizing:border-box}:host[data-direction=column]{flex-direction:column}:host[data-direction=row]{flex-direction:row}:host[data-direction=row]>sci-sash{margin:0 var(--sci-sashbox-gap)}:host[data-direction=row]>sci-sash.first{margin-left:0}:host[data-direction=row]>sci-sash.last{margin-right:0}:host[data-direction=column]>sci-sash{margin:var(--sci-sashbox-gap) 0}:host[data-direction=column]>sci-sash.first{margin-top:0}:host[data-direction=column]>sci-sash.last{margin-bottom:0}:host.sashing{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>sci-sash{pointer-events:none}:host>sci-splitter{--sci-splitter-background-color: var(--sci-sashbox-splitter-background-color);--sci-splitter-background-color-hover: var(--sci-sashbox-splitter-background-color-hover);--sci-splitter-size: var(--sci-sashbox-splitter-size);--sci-splitter-size-hover: var(--sci-sashbox-splitter-size-hover);--sci-splitter-touch-target-size: var(--sci-sashbox-splitter-touch-target-size);--sci-splitter-cross-axis-size: var(--sci-sashbox-splitter-cross-axis-size);--sci-splitter-border-radius: var(--sci-sashbox-splitter-border-radius);--sci-splitter-opacity-active: var(--sci-sashbox-splitter-opacity-active);--sci-splitter-opacity-hover: var(--sci-sashbox-splitter-opacity-hover);flex:none;z-index:1}\n"] }]
|
|
550
|
-
}], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], sashStart: [{ type: i0.Output, args: ["sashStart"] }], sashEnd: [{ type: i0.Output, args: ["sashEnd"] }], _contentChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SciSashDirective), { isSignal: true }] }]
|
|
551
|
-
type: HostBinding,
|
|
552
|
-
args: ['class.sashing']
|
|
553
|
-
}], maxHeight: [{
|
|
554
|
-
type: HostBinding,
|
|
555
|
-
args: ['style.--ɵsci-sashbox-max-height']
|
|
556
|
-
}], maxWidth: [{
|
|
557
|
-
type: HostBinding,
|
|
558
|
-
args: ['style.--ɵsci-sashbox-max-width']
|
|
559
|
-
}] } });
|
|
553
|
+
}], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], sashStart: [{ type: i0.Output, args: ["sashStart"] }], sashEnd: [{ type: i0.Output, args: ["sashEnd"] }], _contentChildren: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SciSashDirective), { isSignal: true }] }] } });
|
|
560
554
|
function between(value, minmax) {
|
|
561
555
|
return Math.min(minmax.max, Math.max(minmax.min, value));
|
|
562
556
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-sashbox.mjs","sources":["../../../../projects/scion/components/sashbox/src/sashbox-accessor.ts","../../../../projects/scion/components/sashbox/src/sash.directive.ts","../../../../projects/scion/components/sashbox/src/element-ref.directive.ts","../../../../projects/scion/components/sashbox/src/sash/sash.component.ts","../../../../projects/scion/components/sashbox/src/sash/sash.component.html","../../../../projects/scion/components/sashbox/src/sashbox.component.ts","../../../../projects/scion/components/sashbox/src/sashbox.component.html","../../../../projects/scion/components/sashbox/src/public_api.ts","../../../../projects/scion/components/sashbox/src/scion-components-sashbox.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2025 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 {SciSashDirective} from './sash.directive';\nimport {Signal} from '@angular/core';\n\n/**\n * Allows accessing the sashbox component from sashes.\n */\nexport abstract class SciSashBoxAccessor {\n\n public abstract readonly sashes: Signal<readonly SciSashDirective[]>;\n public abstract readonly direction: Signal<'column' | 'row'>;\n public abstract readonly afterFirstRender: Signal<boolean>;\n}\n","/*\n * Copyright (c) 2018-2025 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 {booleanAttribute, computed, Directive, inject, input, linkedSignal, signal, Signal, TemplateRef, WritableSignal} from '@angular/core';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\nimport {SashComponent} from './sash/sash.component';\n\n/**\n * Use this directive to model a sash for {@link SciSashboxComponent}.\n * The host element of this modelling directive must be a <ng-template> which is used as sash template.\n *\n *\n * ### Usage:\n *\n * <sci-sashbox direction=\"row\">\n * <!-- fixed size sash -->\n * <ng-template sciSash size=\"200px\">\n * ...\n * </ng-template>\n *\n * <!-- sash which takes the remaining space -->\n * <ng-template sciSash>\n * ...\n * </ng-template>\n * </sci-sashbox>\n */\n@Directive({\n selector: 'ng-template[sciSash]',\n exportAs: 'sciSash',\n})\nexport class SciSashDirective {\n\n /**\n * Specifies the sash size, either as fixed size with an explicit unit,\n * or as a unitless proportion to distribute remaining space. A proportional\n * sash has the ability to grow or shrink if necessary, and must be >= 1.\n *\n * If not set, remaining space is distributed equally.\n */\n public readonly size = input('1', {transform: (size: string | number | null | undefined): string | number => size ?? '1'});\n\n /**\n * Specifies the minimal sash size in pixel or percent.\n * The min-size prevents the user from shrinking the sash below this minimal size.\n *\n * If the unit is omitted, the value is interpreted as a pixel value.\n */\n public readonly minSize = input<string | number | undefined>();\n\n /**\n * Specifies an optional key to identify this sash.\n *\n * The key is used as the property key in the object emitted by {@link SciSashboxComponent.sashEnd} to associate the size of this sash.\n */\n public readonly key = input<string | undefined>();\n\n /**\n * Controls whether to animate the entering and leaving of this sash, only if fixed-sized. Defaults to `false`.\n *\n * Enabling animation will mimic the behavior of a side panel that slides in or out.\n *\n * Note: Animates only sashes added or removed after the initial rendering.\n */\n public readonly animate = input(false, {transform: booleanAttribute});\n\n private readonly _sashBoxAccessor = inject(SciSashBoxAccessor);\n private readonly _component = signal<SashComponent | undefined>(undefined);\n\n /**\n * Flex properties computed based on the configured {@link size}. Properties are updated when moving this sash.\n */\n private readonly _flexProperties = this.computeFlexProperties();\n\n /**\n * Represents the template used as sash content.\n *\n * @internal\n */\n public readonly sashTemplate = inject<TemplateRef<void>>(TemplateRef);\n\n /**\n * Flex properties with normalized 'flex-grow' to ensure the sashes fill the entire sash-box space.\n *\n * Use these properties to lay out this sash in the sashbox's flex layout.\n *\n * @internal\n */\n public readonly flexProperties = this.normalizeFlexGrow(this._flexProperties);\n\n /**\n * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink.\n *\n * @internal\n */\n public readonly isFixedSize = computed(() => Number.isNaN(+this.size()));\n\n /**\n * Gets the component that renders this sash.\n *\n * @internal\n */\n public readonly component = computed(() => this._component() ?? throwError('[SciSashbox] SashComponent not available yet.'));\n\n /**\n * Sets the component that renders this sash.\n *\n * @internal\n */\n public setComponent(component: SashComponent): void {\n this._component.set(component);\n }\n\n /**\n * Returns the identity of this sash, or the passed index if not configured.\n *\n * @internal\n */\n public computeKey(index: number): string {\n return this.key() ?? `${index}`;\n }\n\n /**\n * Updates the flex properties of this sash for layout in the sashbox's flex layout.\n *\n * @internal\n */\n public updateFlexProperties(flexProperties: Partial<FlexProperties>): void {\n this._flexProperties.update(previousFlexProperties => ({...previousFlexProperties, ...flexProperties}));\n }\n\n /**\n * Computes the flex properties to lay out this sash in the sashbox's flex layout based on the configured {@link size}.\n */\n private computeFlexProperties(): WritableSignal<FlexProperties> {\n return linkedSignal(() => {\n const size = this.size();\n if (this.isFixedSize()) {\n // fixed-sized sash\n return {\n flexGrow: 0,\n flexShrink: 0,\n flexBasis: `${size}`,\n };\n }\n else {\n // remaining space is distributed according to given proportion\n const proportion = +size;\n if (proportion < 1) {\n throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size()}]`);\n }\n return {\n flexGrow: proportion,\n flexShrink: 1,\n flexBasis: '0',\n };\n }\n });\n }\n\n /**\n * Normalizes the 'flex-grow' of the passed {@link FlexProperties} to ensure that the sum of the 'flex-grow' proportions of all sashes is 1.\n *\n * If the sum of all flex-grow proportions were less than 1, the sashes would not fill the entire sash-box space.\n * Without normalization, this could occur when a sash is removed.\n */\n private normalizeFlexGrow(flexProperties: Signal<FlexProperties>): Signal<FlexProperties> {\n return computed(() => {\n const sashes = this._sashBoxAccessor.sashes();\n const {flexGrow, flexShrink, flexBasis} = flexProperties();\n const flexGrowSum = sashes.reduce((sum, sash) => sum + sash._flexProperties().flexGrow, 0);\n\n return {\n flexGrow: flexGrow === 0 || flexGrowSum === 0 ? 0 : flexGrow / flexGrowSum, // Sum of normalized flex-grow proportions must be 1;\n flexShrink,\n flexBasis,\n };\n });\n }\n}\n\n/**\n * Flex properties to lay out the sash in the sashbox's flex layout.\n */\ninterface FlexProperties {\n flexGrow: number;\n flexShrink: number;\n flexBasis: string;\n}\n\nfunction throwError(error: string): never {\n throw Error(error);\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, ElementRef, inject} from '@angular/core';\n\n/**\n * Provides access to the native {@link HTMLElement} of the host.\n */\n@Directive({\n selector: '[sciElementRef]',\n exportAs: 'sciElementRef',\n})\nexport class SciElementRefDirective {\n\n public readonly host = inject(ElementRef).nativeElement as HTMLElement;\n}\n","/*\n * Copyright (c) 2018-2025 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 {ChangeDetectorRef, Component, computed, effect, ElementRef, inject, input, linkedSignal, Signal} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {animate, AnimationMetadata, style, transition, trigger} from '@angular/animations';\nimport {SciSashBoxAccessor} from '../sashbox-accessor';\nimport {SciSashDirective} from '../sash.directive';\n\n/**\n * Represents a {@link SciSashDirective} in the DOM, displaying the specified sash template.\n */\n@Component({\n selector: 'sci-sash',\n templateUrl: './sash.component.html',\n styleUrls: ['./sash.component.scss'],\n imports: [\n NgTemplateOutlet,\n ],\n animations: [\n trigger('sash-animation', provideAnimation()),\n ],\n host: {\n '[@sash-animation]': 'animationState()',\n '(@sash-animation.done)': 'onAnimationEnd();',\n },\n})\nexport class SashComponent {\n\n /**\n * Specifies the sash representing this component.\n */\n public readonly sash = input.required<SciSashDirective>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _sashBoxAccessor = inject(SciSashBoxAccessor);\n\n protected readonly animationState = linkedSignal<'enter' | 'leave' | null>(() => this.sash().animate() && this._sashBoxAccessor.afterFirstRender() ? 'enter' : null);\n\n constructor() {\n // Associate sash with this component.\n effect(() => this.sash().setComponent(this));\n }\n\n /**\n * Starts the leave animation, returning a signal to track animation completion.\n */\n public startLeaveAnimation(): Signal<void> {\n // Detach change detector to prevent updates to the component during the animation.\n this._cd.detach();\n // Trigger 'leave' animation.\n this.animationState.set('leave');\n // Return signal to track animation completion.\n return computed(() => void this.animationState(), {equal: () => false});\n }\n\n /**\n * Notifies when ending the animation.\n */\n protected onAnimationEnd(): void {\n this.animationState.set(null);\n }\n\n /**\n * Gets the size of this sash in pixel.\n */\n public get size(): number {\n const {width, height} = this._host.getBoundingClientRect();\n return this._sashBoxAccessor.direction() === 'row' ? width : height;\n }\n}\n\n/**\n * Returns animation metadata to slide-in and slide-out a sash.\n */\nfunction provideAnimation(): AnimationMetadata[] {\n return [\n transition('void => enter', [\n style({'flex-basis': 0}),\n animate(`125ms ease-out`, style({'flex-basis': '*'})),\n ]),\n transition('* => leave', [\n style({'flex-basis': '*'}),\n animate(`125ms ease-out`, style({'flex-basis': 0})),\n ]),\n ];\n}\n","<ng-container *ngTemplateOutlet=\"sash().sashTemplate\"/>\n","/*\n * Copyright (c) 2018-2025 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 {afterNextRender, Component, contentChildren, effect, ElementRef, HostBinding, inject, input, IterableDiffers, NgZone, output, Signal, signal, untracked} from '@angular/core';\nimport {SciSplitterComponent, SplitterMoveEvent} from '@scion/components/splitter';\nimport {SciSashDirective} from './sash.directive';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\nimport {SciElementRefDirective} from './element-ref.directive';\nimport {SashComponent} from './sash/sash.component';\n\n/**\n * The <sci-sashbox> is like a CSS flexbox container that lays out its content children (sashes) in a row (which is by default)\n * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to\n * shrink or stretch the individual sashes.\n *\n * Sashes are modelled as <ng-template> decorated with the 'sciSash' directive.\n * A sash can have a fixed size with an explicit unit, or a unitless proportion to distribute remaining space.\n * A proportional sash has the ability to grow or shrink if necessary.\n *\n * Sash content is added to a CSS grid container with a single column, stretching the content vertically and horizontally.\n *\n * ### Usage\n *\n * ```html\n * <sci-sashbox direction=\"row\">\n * <ng-template sciSash size=\"1\">\n * ...\n * </ng-template>\n *\n * <ng-template sciSash size=\"2\">\n * ...\n * </ng-template>\n *\n * <ng-template sciSash size=\"1\">\n * ...\n * </ng-template>\n * </sci-sashbox>\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-sashbox` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-sashbox-gap: Sets the gaps (gutters) between sashes.\n * - --sci-sashbox-splitter-background-color: Sets the background color of the splitter.\n * - --sci-sashbox-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-sashbox-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-sashbox-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-sashbox-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross axis.\n * - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter.\n * - --sci-sashbox-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-sashbox-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-sashbox {\n * --sci-sashbox-splitter-background-color: black;\n * --sci-sashbox-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-sashbox',\n templateUrl: './sashbox.component.html',\n styleUrls: ['./sashbox.component.scss'],\n imports: [\n SciSplitterComponent,\n SciElementRefDirective,\n SashComponent,\n ],\n providers: [{\n provide: SciSashBoxAccessor,\n useFactory: provideSashBoxAccessor,\n }],\n host: {\n '[attr.data-direction]': 'direction()',\n },\n})\nexport class SciSashboxComponent {\n\n /**\n * Specifies if to lay out sashes in a row (which is by default) or column arrangement.\n */\n public readonly direction = input<'column' | 'row'>('row');\n\n /**\n * Notifies when start sashing.\n */\n public readonly sashStart = output<void>();\n\n /**\n * Emits an object with new sash sizes when sashing ends.\n *\n * Each sash size is associated with its {@link SciSashDirective.key} or its display position (zero-based) if not set.\n */\n public readonly sashEnd = output<{[key: string]: number}>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _contentChildren = contentChildren(SciSashDirective);\n\n /** @internal */\n public readonly sashes = this.computeSashes(this._contentChildren);\n /** @internal */\n public afterFirstRender = signal(false);\n\n @HostBinding('class.sashing')\n protected sashing = false;\n\n @HostBinding('style.--ɵsci-sashbox-max-height')\n protected maxHeight: number | undefined;\n\n @HostBinding('style.--ɵsci-sashbox-max-width')\n protected maxWidth: number | undefined;\n\n constructor() {\n this.detectFirstRendering();\n }\n\n protected onSashStart(): void {\n this.sashing = true;\n\n // Avoid overflow when sashing.\n const hostBounds = this._host.getBoundingClientRect();\n this.maxHeight = hostBounds.height;\n this.maxWidth = hostBounds.width;\n this.sashStart.emit();\n\n // Set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas).\n this.sashes().forEach(sash => {\n if (!sash.isFixedSize()) {\n sash.updateFlexProperties({\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: `${sash.component().size}px`,\n });\n }\n });\n }\n\n protected onSashEnd(): void {\n this.sashing = false;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n\n // Unset the flex-basis for non-fixed sashes and set the flex-grow accordingly.\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());\n const sashSizes = this.sashes().reduce((acc, sash, i) => acc.set(sash.computeKey(i), sash.component().size), new Map<string, number>());\n\n this.sashes().forEach((sash, i) => {\n if (!sash.isFixedSize()) {\n sash.updateFlexProperties({\n flexGrow: pixelToFlexGrowFactor * sashSizes.get(sash.computeKey(i))!,\n flexShrink: 1,\n flexBasis: '0',\n });\n }\n });\n\n this.sashEnd.emit(Object.fromEntries(sashSizes));\n }\n\n protected onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void {\n NgZone.assertNotInAngularZone();\n\n const distance = moveEvent.distance;\n if (distance === 0) {\n return;\n }\n\n // Compute the splitter position.\n const splitterRect = splitter.getBoundingClientRect();\n const splitterStart = (this.direction() === 'row' ? splitterRect.left : splitterRect.top);\n const splitterEnd = (this.direction() === 'row' ? splitterRect.left + splitterRect.width : splitterRect.top + splitterRect.height);\n\n // Ignore the event if outside the splitter's action scope.\n const eventPos = moveEvent.position.clientPos;\n // The sash should not grow after moved the mouse pointer beyond the left bounds of the sash and now moving the mouse pointer back toward the current sash.\n if (distance > 0 && eventPos < splitterStart) {\n return;\n }\n\n // The sash should not shrink after moved the mouse pointer beyond the right bounds of the sash and now moving the mouse pointer back toward the current sash.\n if (distance < 0 && eventPos > splitterEnd) {\n return;\n }\n\n // Compute the new sash sizes.\n const sash1 = this.sashes()[sashIndex]!;\n const sash2 = this.sashes()[sashIndex + 1]!;\n\n const sashSize1 = sash1.component().size;\n const sashSize2 = sash2.component().size;\n\n const sashMinSize1 = sash1.minSize() ? this.toPixel(sash1.minSize()!) : 0;\n const sashMinSize2 = sash2.minSize() ? this.toPixel(sash2.minSize()!) : 0;\n\n const newSashSize1 = between(Math.round(sashSize1 + distance), {min: sashMinSize1, max: sashSize1 + sashSize2 - sashMinSize2});\n const newSashSize2 = between(Math.round(sashSize2 - distance), {min: sashMinSize2, max: sashSize1 + sashSize2 - sashMinSize1});\n\n // Set the new computed sash sizes.\n sash1.updateFlexProperties({flexBasis: `${newSashSize1}px`});\n sash2.updateFlexProperties({flexBasis: `${newSashSize2}px`});\n }\n\n protected onSashReset(sashIndex: number): void {\n const sash1 = this.sashes()[sashIndex]!;\n const sash2 = this.sashes()[sashIndex + 1]!;\n const equalSashSize = (sash1.component().size + sash2.component().size) / 2;\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());\n\n const sashSizesAfterReset = this.sashes().reduce((acc, sash, index) => {\n const size = index === sashIndex || index === sashIndex + 1 ? equalSashSize : sash.component().size;\n return acc.set(sash.computeKey(index), size);\n }, new Map<string, number>());\n\n [sash1, sash2].forEach(sash => {\n if (sash.isFixedSize()) {\n sash.updateFlexProperties({flexBasis: `${equalSashSize}px`});\n }\n else {\n sash.updateFlexProperties({flexGrow: pixelToFlexGrowFactor * equalSashSize});\n }\n });\n\n this.sashStart.emit();\n this.sashEnd.emit(Object.fromEntries(sashSizesAfterReset));\n }\n\n private toPixel(value: string | number): number {\n if (typeof value === 'number') {\n return value;\n }\n if (value.endsWith('%')) {\n const hostBounds = this._host.getBoundingClientRect();\n const hostSize = (this.direction() === 'row' ? hostBounds.width : hostBounds.height);\n return parseInt(value, 10) * hostSize / 100;\n }\n return parseInt(value, 10);\n }\n\n /**\n * Detects when rendered this component for the first time.\n */\n private detectFirstRendering(): void {\n afterNextRender({\n read: () => this.afterFirstRender.set(true),\n });\n }\n\n /**\n * Mirrors the provided signal. If animated sashes are being removed, delays emission until the animation completes,\n * effectively removing the element after the animation.\n *\n * Delayed removal is required for CDK Portals to not remove displayed content immediately.\n */\n private computeSashes(contentChildren: Signal<readonly SciSashDirective[]>): Signal<readonly SciSashDirective[]> {\n const differ = inject(IterableDiffers).find([]).create<SciSashDirective>();\n const sashes = signal<readonly SciSashDirective[]>([]);\n\n effect(() => {\n // Compute removed sashes to be removed with an animation.\n const removedAnimatedSashes = new Array<SciSashDirective>();\n differ.diff(contentChildren())?.forEachRemovedItem(({item: sash}) => untracked(() => {\n if (sash.animate()) {\n removedAnimatedSashes.push(sash);\n }\n }));\n\n // Emit if no sashes are removed with an animation.\n if (!removedAnimatedSashes.length) {\n sashes.set(contentChildren());\n return;\n }\n\n // Delay emission until a leave animation completes.\n removedAnimatedSashes.forEach(sash => {\n // Start the leave animation.\n const done = sash.component().startLeaveAnimation();\n // Track animation completion, re-running this effect to finally emit the sashes.\n done();\n });\n });\n\n return sashes;\n }\n}\n\nfunction between(value: number, minmax: {min: number; max: number}): number {\n return Math.min(minmax.max, Math.max(minmax.min, value));\n}\n\n/**\n * Returns the factor to compute the flex-grow proportion from the pixel size of a sash.\n */\nfunction computePixelToFlexGrowFactor(sashes: readonly SciSashDirective[]): number {\n const flexibleSashes = sashes.filter(sash => !sash.isFixedSize());\n\n const proportionSum = flexibleSashes.reduce((sum, sash) => sum + Number(sash.size()), 0);\n const pixelSum = flexibleSashes.reduce((sum, sash) => sum + sash.component().size, 0);\n\n return proportionSum / pixelSum;\n}\n\nfunction provideSashBoxAccessor(): SciSashBoxAccessor {\n const component = inject(SciSashboxComponent);\n\n return new class implements SciSashBoxAccessor {\n public readonly sashes = component.sashes;\n public readonly direction = component.direction;\n public readonly afterFirstRender = component.afterFirstRender;\n }();\n}\n","@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <sci-sash [sash]=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\"/>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"direction() === 'row' ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.host, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\"/>\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\n/*\n * Secondary entrypoint: '@scion/components/sashbox'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSashboxComponent} from './sashbox.component';\nexport {SciSashDirective} from './sash.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;AAQG;AAKH;;AAEG;MACmB,kBAAkB,CAAA;AAKvC;;ACrBD;;;;;;;;AAQG;AAMH;;;;;;;;;;;;;;;;;;AAkBG;MAKU,gBAAgB,CAAA;AAE3B;;;;;;AAMG;AACa,IAAA,IAAI,GAAG,KAAK,CAAC,GAAG,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAG,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,EAAA,CAAA,GAAA,CAAtF,EAAC,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,EAAC,GAAC;AAE1H;;;;;AAKG;IACa,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA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,CAAC,CAAC;IACxF,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAErF,OAAO,aAAa,GAAG,QAAQ;AACjC;AAEA,SAAS,sBAAsB,GAAA;AAC7B,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAE7C,IAAA,OAAO,IAAI,MAAA;AACO,QAAA,MAAM,GAAG,SAAS,CAAC,MAAM;AACzB,QAAA,SAAS,GAAG,SAAS,CAAC,SAAS;AAC/B,QAAA,gBAAgB,GAAG,SAAS,CAAC,gBAAgB;AAC9D,KAAA,EAAE;AACL;;AEjUA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-sashbox.mjs","sources":["../../../../projects/scion/components/sashbox/src/sashbox-accessor.ts","../../../../projects/scion/components/sashbox/src/sash.directive.ts","../../../../projects/scion/components/sashbox/src/element-ref.directive.ts","../../../../projects/scion/components/sashbox/src/sash/sash.component.ts","../../../../projects/scion/components/sashbox/src/sash/sash.component.html","../../../../projects/scion/components/sashbox/src/sashbox.component.ts","../../../../projects/scion/components/sashbox/src/sashbox.component.html","../../../../projects/scion/components/sashbox/src/public_api.ts","../../../../projects/scion/components/sashbox/src/scion-components-sashbox.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2025 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 {SciSashDirective} from './sash.directive';\nimport {Signal} from '@angular/core';\n\n/**\n * Allows accessing the sashbox component from sashes.\n */\nexport abstract class SciSashBoxAccessor {\n\n public abstract readonly sashes: Signal<readonly SciSashDirective[]>;\n public abstract readonly direction: Signal<'column' | 'row'>;\n public abstract readonly afterFirstRender: Signal<boolean>;\n}\n","/*\n * Copyright (c) 2018-2025 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 {booleanAttribute, computed, Directive, inject, input, linkedSignal, signal, Signal, TemplateRef, WritableSignal} from '@angular/core';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\nimport {SashComponent} from './sash/sash.component';\n\n/**\n * Use this directive to model a sash for {@link SciSashboxComponent}.\n * The host element of this modelling directive must be a <ng-template> which is used as sash template.\n *\n *\n * ### Usage:\n *\n * <sci-sashbox direction=\"row\">\n * <!-- fixed size sash -->\n * <ng-template sciSash size=\"200px\">\n * ...\n * </ng-template>\n *\n * <!-- sash which takes the remaining space -->\n * <ng-template sciSash>\n * ...\n * </ng-template>\n * </sci-sashbox>\n */\n@Directive({\n selector: 'ng-template[sciSash]',\n exportAs: 'sciSash',\n})\nexport class SciSashDirective {\n\n /**\n * Specifies the sash size, either as fixed size with an explicit unit,\n * or as a unitless proportion to distribute remaining space. A proportional\n * sash has the ability to grow or shrink if necessary, and must be >= 1.\n *\n * If not set, remaining space is distributed equally.\n */\n public readonly size = input('1', {transform: (size: string | number | null | undefined): string | number => size ?? '1'});\n\n /**\n * Specifies the minimal sash size in pixel or percent.\n * The min-size prevents the user from shrinking the sash below this minimal size.\n *\n * If the unit is omitted, the value is interpreted as a pixel value.\n */\n public readonly minSize = input<string | number | undefined>();\n\n /**\n * Specifies an optional key to identify this sash.\n *\n * The key is used as the property key in the object emitted by {@link SciSashboxComponent.sashEnd} to associate the size of this sash.\n */\n public readonly key = input<string | undefined>();\n\n /**\n * Controls whether to animate the entering and leaving of this sash, only if fixed-sized. Defaults to `false`.\n *\n * Enabling animation will mimic the behavior of a side panel that slides in or out.\n *\n * Note: Animates only sashes added or removed after the initial rendering.\n */\n public readonly animate = input(false, {transform: booleanAttribute});\n\n private readonly _sashBoxAccessor = inject(SciSashBoxAccessor);\n private readonly _component = signal<SashComponent | undefined>(undefined);\n\n /**\n * Flex properties computed based on the configured {@link size}. Properties are updated when moving this sash.\n */\n private readonly _flexProperties = this.computeFlexProperties();\n\n /**\n * Represents the template used as sash content.\n *\n * @internal\n */\n public readonly sashTemplate = inject<TemplateRef<void>>(TemplateRef);\n\n /**\n * Flex properties with normalized 'flex-grow' to ensure the sashes fill the entire sash-box space.\n *\n * Use these properties to lay out this sash in the sashbox's flex layout.\n *\n * @internal\n */\n public readonly flexProperties = this.normalizeFlexGrow(this._flexProperties);\n\n /**\n * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink.\n *\n * @internal\n */\n public readonly isFixedSize = computed(() => Number.isNaN(+this.size()));\n\n /**\n * Gets the component that renders this sash.\n *\n * @internal\n */\n public readonly component = computed(() => this._component() ?? throwError('[SciSashbox] SashComponent not available yet.'));\n\n /**\n * Sets the component that renders this sash.\n *\n * @internal\n */\n public setComponent(component: SashComponent): void {\n this._component.set(component);\n }\n\n /**\n * Returns the identity of this sash, or the passed index if not configured.\n *\n * @internal\n */\n public computeKey(index: number): string {\n return this.key() ?? `${index}`;\n }\n\n /**\n * Updates the flex properties of this sash for layout in the sashbox's flex layout.\n *\n * @internal\n */\n public updateFlexProperties(flexProperties: Partial<FlexProperties>): void {\n this._flexProperties.update(previousFlexProperties => ({...previousFlexProperties, ...flexProperties}));\n }\n\n /**\n * Computes the flex properties to lay out this sash in the sashbox's flex layout based on the configured {@link size}.\n */\n private computeFlexProperties(): WritableSignal<FlexProperties> {\n return linkedSignal(() => {\n const size = this.size();\n if (this.isFixedSize()) {\n // fixed-sized sash\n return {\n flexGrow: 0,\n flexShrink: 0,\n flexBasis: `${size}`,\n };\n }\n else {\n // remaining space is distributed according to given proportion\n const proportion = +size;\n if (proportion < 1) {\n throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size()}]`);\n }\n return {\n flexGrow: proportion,\n flexShrink: 1,\n flexBasis: '0',\n };\n }\n });\n }\n\n /**\n * Normalizes the 'flex-grow' of the passed {@link FlexProperties} to ensure that the sum of the 'flex-grow' proportions of all sashes is 1.\n *\n * If the sum of all flex-grow proportions were less than 1, the sashes would not fill the entire sash-box space.\n * Without normalization, this could occur when a sash is removed.\n */\n private normalizeFlexGrow(flexProperties: Signal<FlexProperties>): Signal<FlexProperties> {\n return computed(() => {\n const sashes = this._sashBoxAccessor.sashes();\n const {flexGrow, flexShrink, flexBasis} = flexProperties();\n const flexGrowSum = sashes.reduce((sum, sash) => sum + sash._flexProperties().flexGrow, 0);\n\n return {\n flexGrow: flexGrow === 0 || flexGrowSum === 0 ? 0 : flexGrow / flexGrowSum, // Sum of normalized flex-grow proportions must be 1;\n flexShrink,\n flexBasis,\n };\n });\n }\n}\n\n/**\n * Flex properties to lay out the sash in the sashbox's flex layout.\n */\ninterface FlexProperties {\n flexGrow: number;\n flexShrink: number;\n flexBasis: string;\n}\n\nfunction throwError(error: string): never {\n throw Error(error);\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, ElementRef, inject} from '@angular/core';\n\n/**\n * Provides access to the native {@link HTMLElement} of the host.\n */\n@Directive({\n selector: '[sciElementRef]',\n exportAs: 'sciElementRef',\n})\nexport class SciElementRefDirective {\n\n public readonly host = inject(ElementRef).nativeElement as HTMLElement;\n}\n","/*\n * Copyright (c) 2018-2025 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 {ChangeDetectorRef, Component, computed, effect, ElementRef, inject, input, linkedSignal, Signal} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {animate, AnimationMetadata, style, transition, trigger} from '@angular/animations';\nimport {SciSashBoxAccessor} from '../sashbox-accessor';\nimport {SciSashDirective} from '../sash.directive';\n\n/**\n * Represents a {@link SciSashDirective} in the DOM, displaying the specified sash template.\n */\n@Component({\n selector: 'sci-sash',\n templateUrl: './sash.component.html',\n styleUrls: ['./sash.component.scss'],\n imports: [\n NgTemplateOutlet,\n ],\n animations: [\n trigger('sash-animation', provideAnimation()),\n ],\n host: {\n '[@sash-animation]': 'animationState()',\n '(@sash-animation.done)': 'onAnimationEnd();',\n },\n})\nexport class SashComponent {\n\n /**\n * Specifies the sash representing this component.\n */\n public readonly sash = input.required<SciSashDirective>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _sashBoxAccessor = inject(SciSashBoxAccessor);\n\n protected readonly animationState = linkedSignal<'enter' | 'leave' | null>(() => this.sash().animate() && this._sashBoxAccessor.afterFirstRender() ? 'enter' : null);\n\n constructor() {\n // Associate sash with this component.\n effect(() => this.sash().setComponent(this));\n }\n\n /**\n * Starts the leave animation, returning a signal to track animation completion.\n */\n public startLeaveAnimation(): Signal<void> {\n // Detach change detector to prevent updates to the component during the animation.\n this._cd.detach();\n // Trigger 'leave' animation.\n this.animationState.set('leave');\n // Return signal to track animation completion.\n return computed(() => void this.animationState(), {equal: () => false});\n }\n\n /**\n * Notifies when ending the animation.\n */\n protected onAnimationEnd(): void {\n this.animationState.set(null);\n }\n\n /**\n * Gets the size of this sash in pixel.\n */\n public get size(): number {\n const {width, height} = this._host.getBoundingClientRect();\n return this._sashBoxAccessor.direction() === 'row' ? width : height;\n }\n}\n\n/**\n * Returns animation metadata to slide-in and slide-out a sash.\n */\nfunction provideAnimation(): AnimationMetadata[] {\n return [\n transition('void => enter', [\n style({'flex-basis': 0}),\n animate(`125ms ease-out`, style({'flex-basis': '*'})),\n ]),\n transition('* => leave', [\n style({'flex-basis': '*'}),\n animate(`125ms ease-out`, style({'flex-basis': 0})),\n ]),\n ];\n}\n","<ng-container *ngTemplateOutlet=\"sash().sashTemplate\"/>\n","/*\n * Copyright (c) 2018-2025 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 {afterNextRender, Component, contentChildren, effect, ElementRef, inject, input, IterableDiffers, NgZone, output, Signal, signal, untracked} from '@angular/core';\nimport {SciSplitterComponent, SplitterMoveEvent} from '@scion/components/splitter';\nimport {SciSashDirective} from './sash.directive';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\nimport {SciElementRefDirective} from './element-ref.directive';\nimport {SashComponent} from './sash/sash.component';\n\n/**\n * The <sci-sashbox> is like a CSS flexbox container that lays out its content children (sashes) in a row (which is by default)\n * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to\n * shrink or stretch the individual sashes.\n *\n * Sashes are modelled as <ng-template> decorated with the 'sciSash' directive.\n * A sash can have a fixed size with an explicit unit, or a unitless proportion to distribute remaining space.\n * A proportional sash has the ability to grow or shrink if necessary.\n *\n * Sash content is added to a CSS grid container with a single column, stretching the content vertically and horizontally.\n *\n * ### Usage\n *\n * ```html\n * <sci-sashbox direction=\"row\">\n * <ng-template sciSash size=\"1\">\n * ...\n * </ng-template>\n *\n * <ng-template sciSash size=\"2\">\n * ...\n * </ng-template>\n *\n * <ng-template sciSash size=\"1\">\n * ...\n * </ng-template>\n * </sci-sashbox>\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-sashbox` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-sashbox-gap: Sets the gaps (gutters) between sashes.\n * - --sci-sashbox-splitter-background-color: Sets the background color of the splitter.\n * - --sci-sashbox-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-sashbox-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-sashbox-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-sashbox-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross axis.\n * - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter.\n * - --sci-sashbox-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-sashbox-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-sashbox {\n * --sci-sashbox-splitter-background-color: black;\n * --sci-sashbox-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-sashbox',\n templateUrl: './sashbox.component.html',\n styleUrls: ['./sashbox.component.scss'],\n imports: [\n SciSplitterComponent,\n SciElementRefDirective,\n SashComponent,\n ],\n providers: [{\n provide: SciSashBoxAccessor,\n useFactory: provideSashBoxAccessor,\n }],\n host: {\n '[attr.data-direction]': 'direction()',\n '[class.sashing]': 'sashing()',\n '[style.--ɵsci-sashbox-max-height]': 'maxHeight()',\n '[style.--ɵsci-sashbox-max-width]': 'maxWidth()',\n },\n})\nexport class SciSashboxComponent {\n\n /**\n * Specifies if to lay out sashes in a row (which is by default) or column arrangement.\n */\n public readonly direction = input<'column' | 'row'>('row');\n\n /**\n * Notifies when start sashing.\n */\n public readonly sashStart = output<void>();\n\n /**\n * Emits an object with new sash sizes when sashing ends.\n *\n * Each sash size is associated with its {@link SciSashDirective.key} or its display position (zero-based) if not set.\n */\n public readonly sashEnd = output<{[key: string]: number}>();\n\n private readonly _host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly _contentChildren = contentChildren(SciSashDirective);\n\n /** @internal */\n public readonly sashes = this.computeSashes(this._contentChildren);\n /** @internal */\n public readonly afterFirstRender = signal(false);\n\n protected readonly sashing = signal(false);\n protected readonly maxHeight = signal<number | undefined>(undefined);\n protected readonly maxWidth = signal<number | undefined>(undefined);\n\n constructor() {\n this.detectFirstRendering();\n }\n\n protected onSashStart(): void {\n this.sashing.set(true);\n\n // Avoid overflow when sashing.\n const hostBounds = this._host.getBoundingClientRect();\n this.maxHeight.set(hostBounds.height);\n this.maxWidth.set(hostBounds.width);\n this.sashStart.emit();\n\n // Set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas).\n this.sashes().forEach(sash => {\n if (!sash.isFixedSize()) {\n sash.updateFlexProperties({\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: `${sash.component().size}px`,\n });\n }\n });\n }\n\n protected onSashEnd(): void {\n this.sashing.set(false);\n this.maxHeight.set(undefined);\n this.maxWidth.set(undefined);\n\n // Unset the flex-basis for non-fixed sashes and set the flex-grow accordingly.\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());\n const sashSizes = this.sashes().reduce((acc, sash, i) => acc.set(sash.computeKey(i), sash.component().size), new Map<string, number>());\n\n this.sashes().forEach((sash, i) => {\n if (!sash.isFixedSize()) {\n sash.updateFlexProperties({\n flexGrow: pixelToFlexGrowFactor * sashSizes.get(sash.computeKey(i))!,\n flexShrink: 1,\n flexBasis: '0',\n });\n }\n });\n\n this.sashEnd.emit(Object.fromEntries(sashSizes));\n }\n\n protected onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void {\n NgZone.assertNotInAngularZone();\n\n const distance = moveEvent.distance;\n if (distance === 0) {\n return;\n }\n\n // Compute the splitter position.\n const splitterRect = splitter.getBoundingClientRect();\n const splitterStart = (this.direction() === 'row' ? splitterRect.left : splitterRect.top);\n const splitterEnd = (this.direction() === 'row' ? splitterRect.left + splitterRect.width : splitterRect.top + splitterRect.height);\n\n // Ignore the event if outside the splitter's action scope.\n const eventPos = moveEvent.position.clientPos;\n // The sash should not grow after moved the mouse pointer beyond the left bounds of the sash and now moving the mouse pointer back toward the current sash.\n if (distance > 0 && eventPos < splitterStart) {\n return;\n }\n\n // The sash should not shrink after moved the mouse pointer beyond the right bounds of the sash and now moving the mouse pointer back toward the current sash.\n if (distance < 0 && eventPos > splitterEnd) {\n return;\n }\n\n // Compute the new sash sizes.\n const sash1 = this.sashes()[sashIndex]!;\n const sash2 = this.sashes()[sashIndex + 1]!;\n\n const sashSize1 = sash1.component().size;\n const sashSize2 = sash2.component().size;\n\n const sashMinSize1 = sash1.minSize() ? this.toPixel(sash1.minSize()!) : 0;\n const sashMinSize2 = sash2.minSize() ? this.toPixel(sash2.minSize()!) : 0;\n\n const newSashSize1 = between(Math.round(sashSize1 + distance), {min: sashMinSize1, max: sashSize1 + sashSize2 - sashMinSize2});\n const newSashSize2 = between(Math.round(sashSize2 - distance), {min: sashMinSize2, max: sashSize1 + sashSize2 - sashMinSize1});\n\n // Set the new computed sash sizes.\n sash1.updateFlexProperties({flexBasis: `${newSashSize1}px`});\n sash2.updateFlexProperties({flexBasis: `${newSashSize2}px`});\n }\n\n protected onSashReset(sashIndex: number): void {\n const sash1 = this.sashes()[sashIndex]!;\n const sash2 = this.sashes()[sashIndex + 1]!;\n const equalSashSize = (sash1.component().size + sash2.component().size) / 2;\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());\n\n const sashSizesAfterReset = this.sashes().reduce((acc, sash, index) => {\n const size = index === sashIndex || index === sashIndex + 1 ? equalSashSize : sash.component().size;\n return acc.set(sash.computeKey(index), size);\n }, new Map<string, number>());\n\n [sash1, sash2].forEach(sash => {\n if (sash.isFixedSize()) {\n sash.updateFlexProperties({flexBasis: `${equalSashSize}px`});\n }\n else {\n sash.updateFlexProperties({flexGrow: pixelToFlexGrowFactor * equalSashSize});\n }\n });\n\n this.sashStart.emit();\n this.sashEnd.emit(Object.fromEntries(sashSizesAfterReset));\n }\n\n private toPixel(value: string | number): number {\n if (typeof value === 'number') {\n return value;\n }\n if (value.endsWith('%')) {\n const hostBounds = this._host.getBoundingClientRect();\n const hostSize = (this.direction() === 'row' ? hostBounds.width : hostBounds.height);\n return parseInt(value, 10) * hostSize / 100;\n }\n return parseInt(value, 10);\n }\n\n /**\n * Detects when rendered this component for the first time.\n */\n private detectFirstRendering(): void {\n afterNextRender({\n read: () => this.afterFirstRender.set(true),\n });\n }\n\n /**\n * Mirrors the provided signal. If animated sashes are being removed, delays emission until the animation completes,\n * effectively removing the element after the animation.\n *\n * Delayed removal is required for CDK Portals to not remove displayed content immediately.\n */\n private computeSashes(contentChildren: Signal<readonly SciSashDirective[]>): Signal<readonly SciSashDirective[]> {\n const differ = inject(IterableDiffers).find([]).create<SciSashDirective>();\n const sashes = signal<readonly SciSashDirective[]>([]);\n\n effect(() => {\n // Compute removed sashes to be removed with an animation.\n const removedAnimatedSashes = new Array<SciSashDirective>();\n differ.diff(contentChildren())?.forEachRemovedItem(({item: sash}) => untracked(() => {\n if (sash.animate()) {\n removedAnimatedSashes.push(sash);\n }\n }));\n\n // Emit if no sashes are removed with an animation.\n if (!removedAnimatedSashes.length) {\n sashes.set(contentChildren());\n return;\n }\n\n // Delay emission until a leave animation completes.\n removedAnimatedSashes.forEach(sash => {\n // Start the leave animation.\n const done = sash.component().startLeaveAnimation();\n // Track animation completion, re-running this effect to finally emit the sashes.\n done();\n });\n });\n\n return sashes;\n }\n}\n\nfunction between(value: number, minmax: {min: number; max: number}): number {\n return Math.min(minmax.max, Math.max(minmax.min, value));\n}\n\n/**\n * Returns the factor to compute the flex-grow proportion from the pixel size of a sash.\n */\nfunction computePixelToFlexGrowFactor(sashes: readonly SciSashDirective[]): number {\n const flexibleSashes = sashes.filter(sash => !sash.isFixedSize());\n\n const proportionSum = flexibleSashes.reduce((sum, sash) => sum + Number(sash.size()), 0);\n const pixelSum = flexibleSashes.reduce((sum, sash) => sum + sash.component().size, 0);\n\n return proportionSum / pixelSum;\n}\n\nfunction provideSashBoxAccessor(): SciSashBoxAccessor {\n const component = inject(SciSashboxComponent);\n\n return new class implements SciSashBoxAccessor {\n public readonly sashes = component.sashes;\n public readonly direction = component.direction;\n public readonly afterFirstRender = component.afterFirstRender;\n }();\n}\n","@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <sci-sash [sash]=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\"/>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"direction() === 'row' ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.host, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\"/>\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\n/*\n * Secondary entrypoint: '@scion/components/sashbox'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSashboxComponent} from './sashbox.component';\nexport {SciSashDirective} from './sash.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;AAQG;AAKH;;AAEG;MACmB,kBAAkB,CAAA;AAKvC;;ACrBD;;;;;;;;AAQG;AAMH;;;;;;;;;;;;;;;;;;AAkBG;MAKU,gBAAgB,CAAA;AAE3B;;;;;;AAMG;AACa,IAAA,IAAI,GAAG,KAAK,CAAC,GAAG,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAG,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,EAAA,CAAA,GAAA,CAAtF,EAAC,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,EAAC,GAAC;AAE1H;;;;;AAKG;IACa,OAAO,GAAG,KAAK,CAAA,IAAA,SAA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AACvE,IAAA,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAEjE,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACxF,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAErF,OAAO,aAAa,GAAG,QAAQ;AACjC;AAEA,SAAS,sBAAsB,GAAA;AAC7B,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAE7C,IAAA,OAAO,IAAI,MAAA;AACO,QAAA,MAAM,GAAG,SAAS,CAAC,MAAM;AACzB,QAAA,SAAS,GAAG,SAAS,CAAC,SAAS;AAC/B,QAAA,gBAAgB,GAAG,SAAS,CAAC,gBAAgB;AAC9D,KAAA,EAAE;AACL;;AE/TA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, inject, NgZone, ChangeDetectorRef, DOCUMENT, DestroyRef, viewChild,
|
|
3
|
-
import { fromEvent, merge, audit, Observable } from 'rxjs';
|
|
2
|
+
import { input, output, inject, NgZone, ChangeDetectorRef, DOCUMENT, DestroyRef, viewChild, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Subscription, fromEvent, merge, audit, Observable } from 'rxjs';
|
|
4
4
|
import { tapFirst } from '@scion/toolkit/operators';
|
|
5
5
|
import { takeUntil, first } from 'rxjs/operators';
|
|
6
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -73,7 +73,7 @@ class SciSplitterComponent {
|
|
|
73
73
|
*/
|
|
74
74
|
end = output();
|
|
75
75
|
/**
|
|
76
|
-
* Notifies when resetting the
|
|
76
|
+
* Notifies when resetting the splitter position.
|
|
77
77
|
*/
|
|
78
78
|
reset = output(); // eslint-disable-line @angular-eslint/no-output-native
|
|
79
79
|
_zone = inject(NgZone);
|
|
@@ -81,28 +81,21 @@ class SciSplitterComponent {
|
|
|
81
81
|
_document = inject(DOCUMENT);
|
|
82
82
|
_destroyRef = inject(DestroyRef);
|
|
83
83
|
_touchTarget = viewChild.required('touch_target');
|
|
84
|
-
moving = false;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.subscribe(() => this.onReset());
|
|
100
|
-
fromEvent(touchTargetElement, 'touchstart')
|
|
101
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
102
|
-
.subscribe((event) => this.onTouchStart(event));
|
|
103
|
-
fromEvent(touchTargetElement, 'mousedown')
|
|
104
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
105
|
-
.subscribe((event) => this.onMouseDown(event));
|
|
84
|
+
moving = signal(false, ...(ngDevMode ? [{ debugName: "moving" }] : []));
|
|
85
|
+
isHorizontal = computed(() => this.orientation() === 'horizontal', ...(ngDevMode ? [{ debugName: "isHorizontal" }] : []));
|
|
86
|
+
isVertical = computed(() => !this.isHorizontal(), ...(ngDevMode ? [{ debugName: "isVertical" }] : []));
|
|
87
|
+
splitterCursor = computed(() => this.isVertical() ? 'ew-resize' : 'ns-resize', ...(ngDevMode ? [{ debugName: "splitterCursor" }] : []));
|
|
88
|
+
constructor() {
|
|
89
|
+
effect(onCleanup => {
|
|
90
|
+
const touchTargetElement = this._touchTarget().nativeElement;
|
|
91
|
+
const subscription = new Subscription();
|
|
92
|
+
untracked(() => {
|
|
93
|
+
subscription.add(fromEvent(touchTargetElement, 'dblclick').subscribe(() => this.onReset()));
|
|
94
|
+
subscription.add(fromEvent(touchTargetElement, 'touchstart').subscribe((event) => this.onTouchStart(event)));
|
|
95
|
+
subscription.add(fromEvent(touchTargetElement, 'mousedown').subscribe((event) => this.onMouseDown(event)));
|
|
96
|
+
});
|
|
97
|
+
onCleanup(() => subscription.unsubscribe());
|
|
98
|
+
});
|
|
106
99
|
}
|
|
107
100
|
onReset() {
|
|
108
101
|
this.reset.emit();
|
|
@@ -114,7 +107,7 @@ class SciSplitterComponent {
|
|
|
114
107
|
endEventNames: ['touchend', 'touchcancel'],
|
|
115
108
|
eventPositionFn: (touchEvent) => {
|
|
116
109
|
const touch = touchEvent.touches[0];
|
|
117
|
-
if (this.isVertical) {
|
|
110
|
+
if (this.isVertical()) {
|
|
118
111
|
return { screenPos: touch.screenX, clientPos: touch.clientX, pagePos: touch.pageX };
|
|
119
112
|
}
|
|
120
113
|
else {
|
|
@@ -132,7 +125,7 @@ class SciSplitterComponent {
|
|
|
132
125
|
moveEventNames: ['mousemove', 'sci-mousemove'],
|
|
133
126
|
endEventNames: ['mouseup', 'sci-mouseup'],
|
|
134
127
|
eventPositionFn: (mouseEvent) => {
|
|
135
|
-
if (this.isVertical) {
|
|
128
|
+
if (this.isVertical()) {
|
|
136
129
|
return { screenPos: mouseEvent.screenX, clientPos: mouseEvent.clientX, pagePos: mouseEvent.pageX };
|
|
137
130
|
}
|
|
138
131
|
else {
|
|
@@ -151,11 +144,11 @@ class SciSplitterComponent {
|
|
|
151
144
|
let lastClientPos = config.eventPositionFn(startEvent).clientPos;
|
|
152
145
|
// Apply cursor on document level to prevent flickering while moving the splitter
|
|
153
146
|
const oldDocumentCursor = this._document.body.style.cursor;
|
|
154
|
-
this._document.body.style.cursor = this.splitterCursor;
|
|
147
|
+
this._document.body.style.cursor = this.splitterCursor();
|
|
155
148
|
// Listen for 'move' events until stop moving the splitter
|
|
156
149
|
moveEvent$
|
|
157
150
|
.pipe(tapFirst(() => this._zone.run(() => {
|
|
158
|
-
this.moving
|
|
151
|
+
this.moving.set(true);
|
|
159
152
|
this.start.emit();
|
|
160
153
|
this._cd.markForCheck();
|
|
161
154
|
})),
|
|
@@ -175,33 +168,26 @@ class SciSplitterComponent {
|
|
|
175
168
|
.subscribe((endEvent) => {
|
|
176
169
|
endEvent.stopPropagation();
|
|
177
170
|
this._document.body.style.cursor = oldDocumentCursor;
|
|
178
|
-
this.moving && this._zone.run(() => {
|
|
171
|
+
this.moving() && this._zone.run(() => {
|
|
179
172
|
this.end.emit();
|
|
180
|
-
this.moving
|
|
173
|
+
this.moving.set(false);
|
|
181
174
|
this._cd.markForCheck();
|
|
182
175
|
});
|
|
183
176
|
});
|
|
184
177
|
});
|
|
185
178
|
}
|
|
186
179
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SciSplitterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
187
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: SciSplitterComponent, isStandalone: true, selector: "sci-splitter", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { start: "start", move: "move", end: "end", reset: "reset" }, host: { properties: { "class.moving": "
|
|
180
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.0", type: SciSplitterComponent, isStandalone: true, selector: "sci-splitter", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { start: "start", move: "move", end: "end", reset: "reset" }, host: { properties: { "class.moving": "moving()", "class.horizontal": "isHorizontal()", "class.vertical": "isVertical()", "style.cursor": "splitterCursor()" } }, viewQueries: [{ propertyName: "_touchTarget", first: true, predicate: ["touch_target"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #touch_target class=\"touch-target\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{display:grid;position:relative;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);place-items:center;align-self:center}:host>div.touch-target{position:absolute;display:grid;place-items:center;pointer-events:auto}:host>div.touch-target>div.handle{position:absolute;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);opacity:var(--sci-splitter-opacity-hover);transition-property:width,height;transition-timing-function:ease-in;transition-duration:75ms}:host.vertical{width:var(--sci-splitter-size);height:var(--sci-splitter-cross-axis-size)}:host.vertical>div.touch-target{width:var(--sci-splitter-touch-target-size);height:100%}:host.vertical>div.touch-target>div.handle{width:var(--sci-splitter-size);height:100%}:host.horizontal{height:var(--sci-splitter-size);width:var(--sci-splitter-cross-axis-size)}:host.horizontal>div.touch-target{width:100%;height:var(--sci-splitter-touch-target-size)}:host.horizontal>div.touch-target>div.handle{width:100%;height:var(--sci-splitter-size)}:host>div.touch-target:active>div.handle{opacity:var(--sci-splitter-opacity-active)}:host.vertical.moving>div.touch-target>div.handle,:host.vertical>div.touch-target:hover>div.handle{background-color:var(--sci-splitter-background-color-hover);width:var(--sci-splitter-size-hover)}:host.horizontal.moving>div.touch-target>div.handle,:host.horizontal>div.touch-target:hover>div.handle{background-color:var(--sci-splitter-background-color-hover);height:var(--sci-splitter-size-hover)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
188
181
|
}
|
|
189
182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: SciSplitterComponent, decorators: [{
|
|
190
183
|
type: Component,
|
|
191
|
-
args: [{ selector: 'sci-splitter',
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}], isHorizontal: [{
|
|
199
|
-
type: HostBinding,
|
|
200
|
-
args: ['class.horizontal']
|
|
201
|
-
}], splitterCursor: [{
|
|
202
|
-
type: HostBinding,
|
|
203
|
-
args: ['style.cursor']
|
|
204
|
-
}] } });
|
|
184
|
+
args: [{ selector: 'sci-splitter', host: {
|
|
185
|
+
'[class.moving]': 'moving()',
|
|
186
|
+
'[class.horizontal]': 'isHorizontal()',
|
|
187
|
+
'[class.vertical]': 'isVertical()',
|
|
188
|
+
'[style.cursor]': 'splitterCursor()',
|
|
189
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #touch_target class=\"touch-target\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{display:grid;position:relative;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);place-items:center;align-self:center}:host>div.touch-target{position:absolute;display:grid;place-items:center;pointer-events:auto}:host>div.touch-target>div.handle{position:absolute;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);opacity:var(--sci-splitter-opacity-hover);transition-property:width,height;transition-timing-function:ease-in;transition-duration:75ms}:host.vertical{width:var(--sci-splitter-size);height:var(--sci-splitter-cross-axis-size)}:host.vertical>div.touch-target{width:var(--sci-splitter-touch-target-size);height:100%}:host.vertical>div.touch-target>div.handle{width:var(--sci-splitter-size);height:100%}:host.horizontal{height:var(--sci-splitter-size);width:var(--sci-splitter-cross-axis-size)}:host.horizontal>div.touch-target{width:100%;height:var(--sci-splitter-touch-target-size)}:host.horizontal>div.touch-target>div.handle{width:100%;height:var(--sci-splitter-size)}:host>div.touch-target:active>div.handle{opacity:var(--sci-splitter-opacity-active)}:host.vertical.moving>div.touch-target>div.handle,:host.vertical>div.touch-target:hover>div.handle{background-color:var(--sci-splitter-background-color-hover);width:var(--sci-splitter-size-hover)}:host.horizontal.moving>div.touch-target>div.handle,:host.horizontal>div.touch-target:hover>div.handle{background-color:var(--sci-splitter-background-color-hover);height:var(--sci-splitter-size-hover)}\n"] }]
|
|
190
|
+
}], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], start: [{ type: i0.Output, args: ["start"] }], move: [{ type: i0.Output, args: ["move"] }], end: [{ type: i0.Output, args: ["end"] }], reset: [{ type: i0.Output, args: ["reset"] }], _touchTarget: [{ type: i0.ViewChild, args: ['touch_target', { isSignal: true }] }] } });
|
|
205
191
|
/**
|
|
206
192
|
* Emits when the next animation frame is executed.
|
|
207
193
|
*
|