@scion/components 22.2.0 → 22.3.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/_index.scss +75 -5
- package/common/package.json +4 -0
- package/design/_theming.scss +25 -10
- package/design/components/_scion-component-dark-tokens.scss +153 -0
- package/design/components/_scion-component-light-tokens.scss +153 -0
- package/design/icons/_scion-icon-font.scss +50 -0
- package/design/themes/_scion-dark-theme.scss +2 -7
- package/design/themes/_scion-light-theme.scss +3 -8
- package/fesm2022/scion-components-common.mjs +251 -0
- package/fesm2022/scion-components-common.mjs.map +1 -0
- package/fesm2022/scion-components-dimension.mjs +7 -6
- package/fesm2022/scion-components-dimension.mjs.map +1 -1
- package/fesm2022/scion-components-icon.mjs +380 -0
- package/fesm2022/scion-components-icon.mjs.map +1 -0
- package/fesm2022/scion-components-menu.mjs +3271 -0
- package/fesm2022/scion-components-menu.mjs.map +1 -0
- package/fesm2022/scion-components-sashbox.mjs +21 -21
- package/fesm2022/scion-components-sashbox.mjs.map +1 -1
- package/fesm2022/scion-components-splitter.mjs +16 -13
- package/fesm2022/scion-components-splitter.mjs.map +1 -1
- package/fesm2022/scion-components-table.mjs +2265 -0
- package/fesm2022/scion-components-table.mjs.map +1 -0
- package/fesm2022/scion-components-text.mjs +322 -0
- package/fesm2022/scion-components-text.mjs.map +1 -0
- package/fesm2022/scion-components-throbber.mjs +15 -15
- package/fesm2022/scion-components-throbber.mjs.map +1 -1
- package/fesm2022/scion-components-viewport.mjs +41 -72
- package/fesm2022/scion-components-viewport.mjs.map +1 -1
- package/icon/package.json +4 -0
- package/menu/package.json +4 -0
- package/package.json +22 -2
- package/table/package.json +4 -0
- package/text/package.json +4 -0
- package/types/scion-components-common.d.ts +185 -0
- package/types/scion-components-icon.d.ts +146 -0
- package/types/scion-components-menu.d.ts +1922 -0
- package/types/scion-components-sashbox.d.ts +4 -2
- package/types/scion-components-splitter.d.ts +4 -3
- package/types/scion-components-table.d.ts +577 -0
- package/types/scion-components-text.d.ts +131 -0
- package/types/scion-components-viewport.d.ts +7 -4
- package/design/components/_scion-component-tokens.scss +0 -48
|
@@ -3,6 +3,7 @@ import { input, booleanAttribute, inject, signal, TemplateRef, computed, linkedS
|
|
|
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';
|
|
6
|
+
import { clamp } from '@scion/toolkit/util';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
* Copyright (c) 2018-2025 Swiss Federal Railways
|
|
@@ -184,10 +185,10 @@ class SciSashDirective {
|
|
|
184
185
|
};
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
188
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSashDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
189
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: SciSashDirective, isStandalone: true, selector: "ng-template[sciSash]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, minSize: { classPropertyName: "minSize", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["sciSash"], ngImport: i0 });
|
|
189
190
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSashDirective, decorators: [{
|
|
191
192
|
type: Directive,
|
|
192
193
|
args: [{
|
|
193
194
|
selector: 'ng-template[sciSash]',
|
|
@@ -212,10 +213,10 @@ function throwError(error) {
|
|
|
212
213
|
*/
|
|
213
214
|
class SciElementRefDirective {
|
|
214
215
|
host = inject(ElementRef).nativeElement;
|
|
215
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
216
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciElementRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
217
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: SciElementRefDirective, isStandalone: true, selector: "[sciElementRef]", exportAs: ["sciElementRef"], ngImport: i0 });
|
|
217
218
|
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciElementRefDirective, decorators: [{
|
|
219
220
|
type: Directive,
|
|
220
221
|
args: [{
|
|
221
222
|
selector: '[sciElementRef]',
|
|
@@ -274,12 +275,12 @@ class SashComponent {
|
|
|
274
275
|
const { width, height } = this._host.getBoundingClientRect();
|
|
275
276
|
return this._sashBoxAccessor.direction() === 'row' ? width : height;
|
|
276
277
|
}
|
|
277
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
278
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SashComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
279
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: SashComponent, isStandalone: true, selector: "sci-sash", inputs: { sash: { classPropertyName: "sash", publicName: "sash", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "@sash-animation.done": "onAnimationEnd();" }, properties: { "@sash-animation": "animationState()" } }, ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"sash().sashTemplate\"/>\n", styles: [":host{display:grid;grid-auto-rows:100%;grid-auto-columns:100%;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [
|
|
279
280
|
trigger('sash-animation', provideAnimation()),
|
|
280
281
|
], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
281
282
|
}
|
|
282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SashComponent, decorators: [{
|
|
283
284
|
type: Component,
|
|
284
285
|
args: [{ selector: 'sci-sash', imports: [
|
|
285
286
|
NgTemplateOutlet,
|
|
@@ -355,8 +356,10 @@ function provideAnimation() {
|
|
|
355
356
|
* - --sci-sashbox-splitter-size: Sets the size of the splitter along the main axis.
|
|
356
357
|
* - --sci-sashbox-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.
|
|
357
358
|
* - --sci-sashbox-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).
|
|
358
|
-
* - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross
|
|
359
|
-
* - --sci-sashbox-splitter-
|
|
359
|
+
* - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross-axis. Defaults to `100%`.
|
|
360
|
+
* - --sci-sashbox-splitter-cross-axis-start: Sets the splitter's start position. Defaults to `auto`.
|
|
361
|
+
* - --sci-sashbox-splitter-cross-axis-end: Sets the splitter's end position. Defaults to `auto`. Requires `--sci-sashbox-splitter-cross-axis-size: auto`.
|
|
362
|
+
* - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter. Defaults to 0.
|
|
360
363
|
* - --sci-sashbox-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.
|
|
361
364
|
* - --sci-sashbox-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.
|
|
362
365
|
*
|
|
@@ -465,8 +468,8 @@ class SciSashboxComponent {
|
|
|
465
468
|
const sashSize2 = sash2.component().size;
|
|
466
469
|
const sashMinSize1 = sash1.minSize() ? this.toPixel(sash1.minSize()) : 0;
|
|
467
470
|
const sashMinSize2 = sash2.minSize() ? this.toPixel(sash2.minSize()) : 0;
|
|
468
|
-
const newSashSize1 =
|
|
469
|
-
const newSashSize2 =
|
|
471
|
+
const newSashSize1 = clamp(Math.round(sashSize1 + distance), { min: sashMinSize1, max: sashSize1 + sashSize2 - sashMinSize2 });
|
|
472
|
+
const newSashSize2 = clamp(Math.round(sashSize2 - distance), { min: sashMinSize2, max: sashSize1 + sashSize2 - sashMinSize1 });
|
|
470
473
|
// Set the new computed sash sizes.
|
|
471
474
|
sash1.updateFlexProperties({ flexBasis: `${newSashSize1}px` });
|
|
472
475
|
sash2.updateFlexProperties({ flexBasis: `${newSashSize2}px` });
|
|
@@ -543,13 +546,13 @@ class SciSashboxComponent {
|
|
|
543
546
|
});
|
|
544
547
|
return sashes;
|
|
545
548
|
}
|
|
546
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
547
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
549
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSashboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
550
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", 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: [{
|
|
548
551
|
provide: SciSashBoxAccessor,
|
|
549
552
|
useFactory: provideSashBoxAccessor,
|
|
550
|
-
}], 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"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
553
|
+
}], 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-cross-axis-start: var(--sci-sashbox-splitter-cross-axis-start);--sci-splitter-cross-axis-end: var(--sci-sashbox-splitter-cross-axis-end);--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"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
551
554
|
}
|
|
552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
555
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSashboxComponent, decorators: [{
|
|
553
556
|
type: Component,
|
|
554
557
|
args: [{ selector: 'sci-sashbox', imports: [
|
|
555
558
|
SciSplitterComponent,
|
|
@@ -563,11 +566,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
563
566
|
'[class.sashing]': 'sashing()',
|
|
564
567
|
'[style.--ɵsci-sashbox-max-height]': 'maxHeight()',
|
|
565
568
|
'[style.--ɵsci-sashbox-max-width]': 'maxWidth()',
|
|
566
|
-
}, 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"] }]
|
|
569
|
+
}, 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-cross-axis-start: var(--sci-sashbox-splitter-cross-axis-start);--sci-splitter-cross-axis-end: var(--sci-sashbox-splitter-cross-axis-end);--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"] }]
|
|
567
570
|
}], 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 }] }] } });
|
|
568
|
-
function between(value, minmax) {
|
|
569
|
-
return Math.min(minmax.max, Math.max(minmax.min, value));
|
|
570
|
-
}
|
|
571
571
|
/**
|
|
572
572
|
* Returns the factor to compute the flex-grow proportion from the pixel size of a sash.
|
|
573
573
|
*/
|
|
@@ -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, ChangeDetectionStrategy} 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 // Required for backward compatibility for zone-based applications to support child components with eager change detection.\n changeDetection: ChangeDetectionStrategy.Eager, // eslint-disable-line @angular-eslint/prefer-on-push-component-change-detection\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, ChangeDetectionStrategy} 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 // Required for backward compatibility for zone-based applications to support child components with eager change detection.\n changeDetection: ChangeDetectionStrategy.Eager, // eslint-disable-line @angular-eslint/prefer-on-push-component-change-detection\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,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,8BAAA,EAAA,CAAA,EAAG,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,GAAE;AAE1H;;;;;AAKG;AACa,IAAA,OAAO,GAAG,KAAK;2FAA+B;AAE9D;;;;AAIG;AACa,IAAA,GAAG,GAAG,KAAK;uFAAsB;AAEjD;;;;;;AAMG;IACa,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAG,SAAS,EAAE,gBAAgB,EAAA,CAAE;AAEpD,IAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC7C,UAAU,GAAG,MAAM,CAA4B,SAAS;mFAAC;AAE1E;;AAEG;AACc,IAAA,eAAe,GAAG,IAAI,CAAC,qBAAqB,EAAE;AAE/D;;;;AAIG;AACa,IAAA,YAAY,GAAG,MAAM,CAAoB,WAAW,CAAC;AAErE;;;;;;AAMG;IACa,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC;AAE7E;;;;AAIG;AACa,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;oFAAC;AAExE;;;;AAIG;AACa,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAA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|
|
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, ChangeDetectionStrategy} 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 // Required for backward compatibility for zone-based applications to support child components with eager change detection.\n changeDetection: ChangeDetectionStrategy.Eager, // eslint-disable-line @angular-eslint/prefer-on-push-component-change-detection\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, ChangeDetectionStrategy, 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';\nimport {clamp} from '@scion/toolkit/util';\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. Defaults to `100%`.\n * - --sci-sashbox-splitter-cross-axis-start: Sets the splitter's start position. Defaults to `auto`.\n * - --sci-sashbox-splitter-cross-axis-end: Sets the splitter's end position. Defaults to `auto`. Requires `--sci-sashbox-splitter-cross-axis-size: auto`.\n * - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter. Defaults to 0.\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 // Required for backward compatibility for zone-based applications to support child components with eager change detection.\n changeDetection: ChangeDetectionStrategy.Eager, // eslint-disable-line @angular-eslint/prefer-on-push-component-change-detection\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 = clamp(Math.round(sashSize1 + distance), {min: sashMinSize1, max: sashSize1 + sashSize2 - sashMinSize2});\n const newSashSize2 = clamp(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\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,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,8BAAA,EAAA,CAAA,EAAG,SAAS,EAAE,CAAC,IAAwC,KAAsB,IAAI,IAAI,GAAG,GAAE;AAE1H;;;;;AAKG;AACa,IAAA,OAAO,GAAG,KAAK;2FAA+B;AAE9D;;;;AAIG;AACa,IAAA,GAAG,GAAG,KAAK;uFAAsB;AAEjD;;;;;;AAMG;IACa,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAG,SAAS,EAAE,gBAAgB,EAAA,CAAE;AAEpD,IAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAC7C,UAAU,GAAG,M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,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;;AEhUA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, inject, NgZone, ChangeDetectorRef, DOCUMENT, DestroyRef,
|
|
2
|
+
import { input, output, inject, NgZone, ChangeDetectorRef, DOCUMENT, DestroyRef, signal, computed, ElementRef, effect, untracked, Component } from '@angular/core';
|
|
3
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';
|
|
@@ -41,8 +41,10 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
41
41
|
* - --sci-splitter-size: Sets the size of the splitter along the main axis.
|
|
42
42
|
* - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.
|
|
43
43
|
* - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).
|
|
44
|
-
* - --sci-splitter-cross-axis-size: Sets the splitter size along the cross
|
|
45
|
-
* - --sci-splitter-
|
|
44
|
+
* - --sci-splitter-cross-axis-size: Sets the splitter size along the cross-axis. Defaults to `100%`.
|
|
45
|
+
* - --sci-splitter-cross-axis-start: Sets the splitter's start position. Defaults to `auto`.
|
|
46
|
+
* - --sci-splitter-cross-axis-end: Sets the splitter's end position. Defaults to `auto`. Requires `--sci-splitter-cross-axis-size: auto`.
|
|
47
|
+
* - --sci-splitter-border-radius: Sets the border radius of the splitter. Defaults to 0.
|
|
46
48
|
* - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.
|
|
47
49
|
* - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.
|
|
48
50
|
*
|
|
@@ -81,7 +83,6 @@ class SciSplitterComponent {
|
|
|
81
83
|
_cd = inject(ChangeDetectorRef);
|
|
82
84
|
_document = inject(DOCUMENT);
|
|
83
85
|
_destroyRef = inject(DestroyRef);
|
|
84
|
-
_touchTarget = viewChild.required('touch_target');
|
|
85
86
|
moving = signal(false, /* @ts-ignore */
|
|
86
87
|
...(ngDevMode ? [{ debugName: "moving" }] : /* istanbul ignore next */ []));
|
|
87
88
|
isHorizontal = computed(() => this.orientation() === 'horizontal', /* @ts-ignore */
|
|
@@ -91,13 +92,15 @@ class SciSplitterComponent {
|
|
|
91
92
|
splitterCursor = computed(() => this.isVertical() ? 'ew-resize' : 'ns-resize', /* @ts-ignore */
|
|
92
93
|
...(ngDevMode ? [{ debugName: "splitterCursor" }] : /* istanbul ignore next */ []));
|
|
93
94
|
constructor() {
|
|
95
|
+
const host = inject(ElementRef).nativeElement;
|
|
94
96
|
effect(onCleanup => {
|
|
95
|
-
const touchTargetElement = this._touchTarget().nativeElement;
|
|
96
97
|
const subscription = new Subscription();
|
|
97
98
|
untracked(() => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
subscription.add(fromEvent(
|
|
99
|
+
// Install event listeners on the host element instead of the touch target, enabling tests to target `sci-splitter`
|
|
100
|
+
// to perform a mousedown or double-click. The user can still interact with the touch target because events bubble up.
|
|
101
|
+
subscription.add(fromEvent(host, 'dblclick').subscribe(() => this.onReset()));
|
|
102
|
+
subscription.add(fromEvent(host, 'touchstart').subscribe((event) => this.onTouchStart(event)));
|
|
103
|
+
subscription.add(fromEvent(host, 'mousedown').subscribe((event) => this.onMouseDown(event)));
|
|
101
104
|
});
|
|
102
105
|
onCleanup(() => subscription.unsubscribe());
|
|
103
106
|
});
|
|
@@ -181,18 +184,18 @@ class SciSplitterComponent {
|
|
|
181
184
|
});
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
185
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
187
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSplitterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", 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()" } }, ngImport: i0, template: "<div class=\"touch-target\">\n <div class=\"handle e2e-handle\"></div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:grid;position:relative;place-items:center}:host:is(:hover,.moving){--\\275sci-splitter-hover: true}:host:active{--\\275sci-splitter-active: true}:host.vertical{--\\275sci-splitter-orientation: vertical;width:var(--sci-splitter-size)}:host.horizontal{--\\275sci-splitter-orientation: horizontal;height:var(--sci-splitter-size)}:host>div.touch-target{position:absolute;display:grid;place-items:center}@container style(--\\275sci-splitter-orientation: vertical){:host>div.touch-target{width:var(--sci-splitter-touch-target-size);height:100%}}@container style(--\\275sci-splitter-orientation: horizontal){:host>div.touch-target{width:100%;height:var(--sci-splitter-touch-target-size)}}:host>div.touch-target>div.handle{position:absolute;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);outline:calc((var(--sci-splitter-size-hover) - var(--sci-splitter-size)) / 2) solid transparent;transition:outline-color ease-out 125ms}@container style(--\\275sci-splitter-orientation: vertical){:host>div.touch-target>div.handle{top:var(--sci-splitter-cross-axis-start);height:var(--sci-splitter-cross-axis-size);bottom:var(--sci-splitter-cross-axis-end);width:var(--sci-splitter-size)}}@container style(--\\275sci-splitter-orientation: horizontal){:host>div.touch-target>div.handle{left:var(--sci-splitter-cross-axis-start);width:var(--sci-splitter-cross-axis-size);right:var(--sci-splitter-cross-axis-end);height:var(--sci-splitter-size)}}@container style(--\\275sci-splitter-hover: true){:host>div.touch-target>div.handle{outline-color:rgb(from var(--sci-splitter-background-color-hover) r g b/var(--sci-splitter-opacity-hover))}}@container style(--\\275sci-splitter-active: true){:host>div.touch-target>div.handle{outline-color:rgb(from var(--sci-splitter-background-color-hover) r g b/var(--sci-splitter-opacity-active))}}\n"] });
|
|
186
189
|
}
|
|
187
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SciSplitterComponent, decorators: [{
|
|
188
191
|
type: Component,
|
|
189
192
|
args: [{ selector: 'sci-splitter', host: {
|
|
190
193
|
'[class.moving]': 'moving()',
|
|
191
194
|
'[class.horizontal]': 'isHorizontal()',
|
|
192
195
|
'[class.vertical]': 'isVertical()',
|
|
193
196
|
'[style.cursor]': 'splitterCursor()',
|
|
194
|
-
}, template: "<div
|
|
195
|
-
}], 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"] }]
|
|
197
|
+
}, template: "<div class=\"touch-target\">\n <div class=\"handle e2e-handle\"></div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:grid;position:relative;place-items:center}:host:is(:hover,.moving){--\\275sci-splitter-hover: true}:host:active{--\\275sci-splitter-active: true}:host.vertical{--\\275sci-splitter-orientation: vertical;width:var(--sci-splitter-size)}:host.horizontal{--\\275sci-splitter-orientation: horizontal;height:var(--sci-splitter-size)}:host>div.touch-target{position:absolute;display:grid;place-items:center}@container style(--\\275sci-splitter-orientation: vertical){:host>div.touch-target{width:var(--sci-splitter-touch-target-size);height:100%}}@container style(--\\275sci-splitter-orientation: horizontal){:host>div.touch-target{width:100%;height:var(--sci-splitter-touch-target-size)}}:host>div.touch-target>div.handle{position:absolute;background-color:var(--sci-splitter-background-color);border-radius:var(--sci-splitter-border-radius);outline:calc((var(--sci-splitter-size-hover) - var(--sci-splitter-size)) / 2) solid transparent;transition:outline-color ease-out 125ms}@container style(--\\275sci-splitter-orientation: vertical){:host>div.touch-target>div.handle{top:var(--sci-splitter-cross-axis-start);height:var(--sci-splitter-cross-axis-size);bottom:var(--sci-splitter-cross-axis-end);width:var(--sci-splitter-size)}}@container style(--\\275sci-splitter-orientation: horizontal){:host>div.touch-target>div.handle{left:var(--sci-splitter-cross-axis-start);width:var(--sci-splitter-cross-axis-size);right:var(--sci-splitter-cross-axis-end);height:var(--sci-splitter-size)}}@container style(--\\275sci-splitter-hover: true){:host>div.touch-target>div.handle{outline-color:rgb(from var(--sci-splitter-background-color-hover) r g b/var(--sci-splitter-opacity-hover))}}@container style(--\\275sci-splitter-active: true){:host>div.touch-target>div.handle{outline-color:rgb(from var(--sci-splitter-background-color-hover) r g b/var(--sci-splitter-opacity-active))}}\n"] }]
|
|
198
|
+
}], 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"] }] } });
|
|
196
199
|
/**
|
|
197
200
|
* Emits when the next animation frame is executed.
|
|
198
201
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scion-components-splitter.mjs","sources":["../../../../projects/scion/components/splitter/src/splitter.component.ts","../../../../projects/scion/components/splitter/src/splitter.component.html","../../../../projects/scion/components/splitter/src/public_api.ts","../../../../projects/scion/components/splitter/src/scion-components-splitter.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectorRef, Component, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, input, NgZone, output, signal, untracked, viewChild} from '@angular/core';\nimport {audit, fromEvent, merge, Observable, Subscription} from 'rxjs';\nimport {tapFirst} from '@scion/toolkit/operators';\nimport {first, takeUntil} from 'rxjs/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Represents a splitter, a visual element that allows the user to control the size of elements next to it.\n *\n * The splitter has a handle that the user can move depending on the orientation of the splitter.\n *\n * Note that this control neither does change the size of adjacent elements nor does it (re-)position itself, but emits the distance by\n * which the user has theoretically moved the splitter. You must subscribe to these events and change your layout accordingly.\n *\n * In the toolkit, {@link SciSashboxComponent} uses this splitter to divide a layout into several resizable sections.\n * Another use case would be a resizable sidebar panel.\n *\n * ### Usage\n *\n * ```html\n * <sci-splitter (move)=\"onSplitterMove($event.distance)\"></sci-splitter>\n * ```\n *\n * ### Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-splitter` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-splitter-background-color: Sets the background color of the splitter.\n * - --sci-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-splitter-cross-axis-size: Sets the splitter size along the cross axis.\n * - --sci-splitter-border-radius: Sets the border radius of the splitter.\n * - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-splitter {\n * --sci-splitter-background-color: black;\n * --sci-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-splitter',\n templateUrl: './splitter.component.html',\n styleUrls: ['./splitter.component.scss'],\n host: {\n '[class.moving]': 'moving()',\n '[class.horizontal]': 'isHorizontal()',\n '[class.vertical]': 'isVertical()',\n '[style.cursor]': 'splitterCursor()',\n },\n})\nexport class SciSplitterComponent {\n\n /**\n * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.\n */\n public readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /**\n * Notifies when start moving the splitter.\n */\n public readonly start = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n /**\n * Notifies when moving the splitter. The event is emitted outside the Angular zone.\n */\n public readonly move = output<SplitterMoveEvent>();\n\n /**\n * Notifies when end moving the splitter.\n */\n public readonly end = output<void>();\n\n /**\n * Notifies when resetting the splitter position.\n */\n public readonly reset = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _zone = inject(NgZone);\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _document = inject(DOCUMENT);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _touchTarget = viewChild.required<ElementRef<HTMLElement>>('touch_target');\n\n protected readonly moving = signal(false);\n protected readonly isHorizontal = computed(() => this.orientation() === 'horizontal');\n protected readonly isVertical = computed(() => !this.isHorizontal());\n protected readonly splitterCursor = computed(() => this.isVertical() ? 'ew-resize' : 'ns-resize');\n\n constructor() {\n effect(onCleanup => {\n const touchTargetElement = this._touchTarget().nativeElement;\n const subscription = new Subscription();\n\n untracked(() => {\n subscription.add(fromEvent(touchTargetElement, 'dblclick').subscribe(() => this.onReset()));\n subscription.add(fromEvent<TouchEvent>(touchTargetElement, 'touchstart').subscribe((event: TouchEvent) => this.onTouchStart(event)));\n subscription.add(fromEvent<MouseEvent>(touchTargetElement, 'mousedown').subscribe((event: MouseEvent) => this.onMouseDown(event)));\n });\n\n onCleanup(() => subscription.unsubscribe());\n });\n }\n\n private onReset(): void {\n this.reset.emit();\n }\n\n private onTouchStart(startEvent: TouchEvent): void {\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['touchmove'],\n endEventNames: ['touchend', 'touchcancel'],\n eventPositionFn: (touchEvent: TouchEvent): EventPosition => {\n const touch: Touch = touchEvent.touches[0]!;\n if (this.isVertical()) {\n return {screenPos: touch.screenX, clientPos: touch.clientX, pagePos: touch.pageX};\n }\n else {\n return {screenPos: touch.screenY, clientPos: touch.clientY, pagePos: touch.pageY};\n }\n },\n });\n }\n\n private onMouseDown(startEvent: MouseEvent): void {\n if (startEvent.button !== 0) {\n return;\n }\n\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['mousemove', 'sci-mousemove'],\n endEventNames: ['mouseup', 'sci-mouseup'],\n eventPositionFn: (mouseEvent: MouseEvent): EventPosition => {\n if (this.isVertical()) {\n return {screenPos: mouseEvent.screenX, clientPos: mouseEvent.clientX, pagePos: mouseEvent.pageX};\n }\n else {\n return {screenPos: mouseEvent.screenY, clientPos: mouseEvent.clientY, pagePos: mouseEvent.pageY};\n }\n },\n });\n }\n\n private installMoveListener<EVENT extends Event>(config: {startEvent: EVENT; moveEventNames: string[]; endEventNames: string[]; eventPositionFn: (event: EVENT) => EventPosition}): void {\n const startEvent = config.startEvent;\n\n startEvent.preventDefault();\n\n this._zone.runOutsideAngular(() => {\n // install listeners on document level to allow fast dragging the splitter.\n const moveEvent$ = merge(...config.moveEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n const endEvent$ = merge(...config.endEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n let lastClientPos = config.eventPositionFn(startEvent).clientPos;\n\n // Apply cursor on document level to prevent flickering while moving the splitter\n const oldDocumentCursor = this._document.body.style.cursor;\n this._document.body.style.cursor = this.splitterCursor();\n\n // Listen for 'move' events until stop moving the splitter\n moveEvent$\n .pipe(\n tapFirst(() => this._zone.run(() => {\n this.moving.set(true);\n this.start.emit();\n this._cd.markForCheck();\n })),\n // Throttle emission to a single event per animation frame.\n audit(() => nextAnimationFrame$()),\n takeUntilDestroyed(this._destroyRef),\n takeUntil(endEvent$),\n )\n .subscribe((moveEvent: EVENT) => {\n NgZone.assertNotInAngularZone();\n\n const eventPos = config.eventPositionFn(moveEvent);\n const newClientPos = eventPos.clientPos;\n const distance = newClientPos - lastClientPos;\n lastClientPos = newClientPos;\n\n this.move.emit({distance, position: eventPos});\n });\n\n // Listen for 'end' events; call 'stop propagation' to not close overlays\n endEvent$\n .pipe(\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe((endEvent: EVENT) => {\n endEvent.stopPropagation();\n this._document.body.style.cursor = oldDocumentCursor;\n this.moving() && this._zone.run(() => {\n this.end.emit();\n this.moving.set(false);\n this._cd.markForCheck();\n });\n });\n });\n }\n}\n\nexport interface EventPosition {\n clientPos: number;\n pagePos: number;\n screenPos: number;\n}\n\n/**\n * Event that is emitted when moving the splitter.\n */\nexport interface SplitterMoveEvent {\n /**\n * The distance in pixels by which the user has moved the splitter since the last emission.\n */\n distance: number;\n /**\n * The position where the mouse or touch event has occurred.\n */\n position: EventPosition;\n}\n\n/**\n * Emits when the next animation frame is executed.\n *\n * Unlike using `timer(0, animationFrameScheduler)`, this observable emits within the zone where it is subscribed.\n *\n * Note that the RxJS `animationFrameScheduler` may not necessarily execute in the current execution context, such as inside or outside Angular.\n * The scheduler always executes tasks in the zone where it was first used in the application.\n */\nfunction nextAnimationFrame$(): Observable<void> {\n return new Observable<void>(observer => {\n const animationFrame = requestAnimationFrame(() => observer.next());\n return () => cancelAnimationFrame(animationFrame);\n });\n}\n","<div #touch_target class=\"touch-target\">\n <div class=\"handle\"></div>\n</div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/splitter'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSplitterComponent, type SplitterMoveEvent, type EventPosition} from './splitter.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MAYU,oBAAoB,CAAA;AAE/B;;AAEG;IACa,WAAW,GAAG,KAAK,CAA4B,UAAU;oFAAC;AAE1E;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEvC;;AAEG;IACa,IAAI,GAAG,MAAM,EAAqB;AAElD;;AAEG;IACa,GAAG,GAAG,MAAM,EAAQ;AAEpC;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEtB,IAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AACtB,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,YAAY,GAAG,SAAS,CAAC,QAAQ,CAA0B,cAAc,CAAC;IAExE,MAAM,GAAG,MAAM,CAAC,KAAK;+EAAC;IACtB,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY;qFAAC;IAClE,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE;mFAAC;AACjD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,GAAG,WAAW,GAAG,WAAW;uFAAC;AAEjG,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,SAAS,IAAG;YACjB,MAAM,kBAA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AAA,CAAA;AA6I5F;;;;;;;AAOG;AACH,SAAS,mBAAmB,GAAA;AAC1B,IAAA,OAAO,IAAI,UAAU,CAAO,QAAQ,IAAG;AACrC,QAAA,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnE,QAAA,OAAO,MAAM,oBAAoB,CAAC,cAAc,CAAC;AACnD,IAAA,CAAC,CAAC;AACJ;;AE7PA;;;;;;;;AAQG;AAEH;;;;AAIG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"scion-components-splitter.mjs","sources":["../../../../projects/scion/components/splitter/src/splitter.component.ts","../../../../projects/scion/components/splitter/src/splitter.component.html","../../../../projects/scion/components/splitter/src/public_api.ts","../../../../projects/scion/components/splitter/src/scion-components-splitter.ts"],"sourcesContent":["/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {ChangeDetectorRef, Component, computed, DestroyRef, DOCUMENT, effect, ElementRef, inject, input, NgZone, output, signal, untracked} from '@angular/core';\nimport {audit, fromEvent, merge, Observable, Subscription} from 'rxjs';\nimport {tapFirst} from '@scion/toolkit/operators';\nimport {first, takeUntil} from 'rxjs/operators';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\n\n/**\n * Represents a splitter, a visual element that allows the user to control the size of elements next to it.\n *\n * The splitter has a handle that the user can move depending on the orientation of the splitter.\n *\n * Note that this control neither does change the size of adjacent elements nor does it (re-)position itself, but emits the distance by\n * which the user has theoretically moved the splitter. You must subscribe to these events and change your layout accordingly.\n *\n * In the toolkit, {@link SciSashboxComponent} uses this splitter to divide a layout into several resizable sections.\n * Another use case would be a resizable sidebar panel.\n *\n * ### Usage\n *\n * ```html\n * <sci-splitter (move)=\"onSplitterMove($event.distance)\"></sci-splitter>\n * ```\n *\n * ### Styling\n *\n * To customize the default look of SCION components or support different themes, configure the `@scion/components` SCSS module in `styles.scss`.\n * To style a specific `sci-splitter` component, the following CSS variables can be set directly on the component.\n *\n * - --sci-splitter-background-color: Sets the background color of the splitter.\n * - --sci-splitter-background-color-hover: Sets the background color of the splitter when hovering it.\n * - --sci-splitter-size: Sets the size of the splitter along the main axis.\n * - --sci-splitter-size-hover: Sets the size of the splitter along the main axis when hovering it.\n * - --sci-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).\n * - --sci-splitter-cross-axis-size: Sets the splitter size along the cross-axis. Defaults to `100%`.\n * - --sci-splitter-cross-axis-start: Sets the splitter's start position. Defaults to `auto`.\n * - --sci-splitter-cross-axis-end: Sets the splitter's end position. Defaults to `auto`. Requires `--sci-splitter-cross-axis-size: auto`.\n * - --sci-splitter-border-radius: Sets the border radius of the splitter. Defaults to 0.\n * - --sci-splitter-opacity-active: Sets the opacity of the splitter while the user moves the splitter.\n * - --sci-splitter-opacity-hover: Sets the opacity of the splitter when hovering it.\n *\n * Example:\n *\n * ```scss\n * sci-splitter {\n * --sci-splitter-background-color: black;\n * --sci-splitter-background-color-hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-splitter',\n templateUrl: './splitter.component.html',\n styleUrls: ['./splitter.component.scss'],\n host: {\n '[class.moving]': 'moving()',\n '[class.horizontal]': 'isHorizontal()',\n '[class.vertical]': 'isVertical()',\n '[style.cursor]': 'splitterCursor()',\n },\n})\nexport class SciSplitterComponent {\n\n /**\n * Controls whether to render a vertical or horizontal splitter. By default, if not specified, renders a vertical splitter.\n */\n public readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /**\n * Notifies when start moving the splitter.\n */\n public readonly start = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n /**\n * Notifies when moving the splitter. The event is emitted outside the Angular zone.\n */\n public readonly move = output<SplitterMoveEvent>();\n\n /**\n * Notifies when end moving the splitter.\n */\n public readonly end = output<void>();\n\n /**\n * Notifies when resetting the splitter position.\n */\n public readonly reset = output<void>(); // eslint-disable-line @angular-eslint/no-output-native\n\n private readonly _zone = inject(NgZone);\n private readonly _cd = inject(ChangeDetectorRef);\n private readonly _document = inject(DOCUMENT);\n private readonly _destroyRef = inject(DestroyRef);\n\n protected readonly moving = signal(false);\n protected readonly isHorizontal = computed(() => this.orientation() === 'horizontal');\n protected readonly isVertical = computed(() => !this.isHorizontal());\n protected readonly splitterCursor = computed(() => this.isVertical() ? 'ew-resize' : 'ns-resize');\n\n constructor() {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n\n effect(onCleanup => {\n const subscription = new Subscription();\n\n untracked(() => {\n // Install event listeners on the host element instead of the touch target, enabling tests to target `sci-splitter`\n // to perform a mousedown or double-click. The user can still interact with the touch target because events bubble up.\n subscription.add(fromEvent(host, 'dblclick').subscribe(() => this.onReset()));\n subscription.add(fromEvent<TouchEvent>(host, 'touchstart').subscribe((event: TouchEvent) => this.onTouchStart(event)));\n subscription.add(fromEvent<MouseEvent>(host, 'mousedown').subscribe((event: MouseEvent) => this.onMouseDown(event)));\n });\n\n onCleanup(() => subscription.unsubscribe());\n });\n }\n\n private onReset(): void {\n this.reset.emit();\n }\n\n private onTouchStart(startEvent: TouchEvent): void {\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['touchmove'],\n endEventNames: ['touchend', 'touchcancel'],\n eventPositionFn: (touchEvent: TouchEvent): EventPosition => {\n const touch: Touch = touchEvent.touches[0]!;\n if (this.isVertical()) {\n return {screenPos: touch.screenX, clientPos: touch.clientX, pagePos: touch.pageX};\n }\n else {\n return {screenPos: touch.screenY, clientPos: touch.clientY, pagePos: touch.pageY};\n }\n },\n });\n }\n\n private onMouseDown(startEvent: MouseEvent): void {\n if (startEvent.button !== 0) {\n return;\n }\n\n this.installMoveListener({\n startEvent: startEvent,\n moveEventNames: ['mousemove', 'sci-mousemove'],\n endEventNames: ['mouseup', 'sci-mouseup'],\n eventPositionFn: (mouseEvent: MouseEvent): EventPosition => {\n if (this.isVertical()) {\n return {screenPos: mouseEvent.screenX, clientPos: mouseEvent.clientX, pagePos: mouseEvent.pageX};\n }\n else {\n return {screenPos: mouseEvent.screenY, clientPos: mouseEvent.clientY, pagePos: mouseEvent.pageY};\n }\n },\n });\n }\n\n private installMoveListener<EVENT extends Event>(config: {startEvent: EVENT; moveEventNames: string[]; endEventNames: string[]; eventPositionFn: (event: EVENT) => EventPosition}): void {\n const startEvent = config.startEvent;\n\n startEvent.preventDefault();\n\n this._zone.runOutsideAngular(() => {\n // install listeners on document level to allow fast dragging the splitter.\n const moveEvent$ = merge(...config.moveEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n const endEvent$ = merge(...config.endEventNames.map(eventName => fromEvent<EVENT>(this._document, eventName)));\n let lastClientPos = config.eventPositionFn(startEvent).clientPos;\n\n // Apply cursor on document level to prevent flickering while moving the splitter\n const oldDocumentCursor = this._document.body.style.cursor;\n this._document.body.style.cursor = this.splitterCursor();\n\n // Listen for 'move' events until stop moving the splitter\n moveEvent$\n .pipe(\n tapFirst(() => this._zone.run(() => {\n this.moving.set(true);\n this.start.emit();\n this._cd.markForCheck();\n })),\n // Throttle emission to a single event per animation frame.\n audit(() => nextAnimationFrame$()),\n takeUntilDestroyed(this._destroyRef),\n takeUntil(endEvent$),\n )\n .subscribe((moveEvent: EVENT) => {\n NgZone.assertNotInAngularZone();\n\n const eventPos = config.eventPositionFn(moveEvent);\n const newClientPos = eventPos.clientPos;\n const distance = newClientPos - lastClientPos;\n lastClientPos = newClientPos;\n\n this.move.emit({distance, position: eventPos});\n });\n\n // Listen for 'end' events; call 'stop propagation' to not close overlays\n endEvent$\n .pipe(\n first(),\n takeUntilDestroyed(this._destroyRef),\n )\n .subscribe((endEvent: EVENT) => {\n endEvent.stopPropagation();\n this._document.body.style.cursor = oldDocumentCursor;\n this.moving() && this._zone.run(() => {\n this.end.emit();\n this.moving.set(false);\n this._cd.markForCheck();\n });\n });\n });\n }\n}\n\nexport interface EventPosition {\n clientPos: number;\n pagePos: number;\n screenPos: number;\n}\n\n/**\n * Event that is emitted when moving the splitter.\n */\nexport interface SplitterMoveEvent {\n /**\n * The distance in pixels by which the user has moved the splitter since the last emission.\n */\n distance: number;\n /**\n * The position where the mouse or touch event has occurred.\n */\n position: EventPosition;\n}\n\n/**\n * Emits when the next animation frame is executed.\n *\n * Unlike using `timer(0, animationFrameScheduler)`, this observable emits within the zone where it is subscribed.\n *\n * Note that the RxJS `animationFrameScheduler` may not necessarily execute in the current execution context, such as inside or outside Angular.\n * The scheduler always executes tasks in the zone where it was first used in the application.\n */\nfunction nextAnimationFrame$(): Observable<void> {\n return new Observable<void>(observer => {\n const animationFrame = requestAnimationFrame(() => observer.next());\n return () => cancelAnimationFrame(animationFrame);\n });\n}\n","<div class=\"touch-target\">\n <div class=\"handle e2e-handle\"></div>\n</div>\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\n/*\n * Secondary entrypoint: '@scion/components/splitter'\n *\n * @see https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md\n */\nexport {SciSplitterComponent, type SplitterMoveEvent, type EventPosition} from './splitter.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;MAYU,oBAAoB,CAAA;AAE/B;;AAEG;IACa,WAAW,GAAG,KAAK,CAA4B,UAAU;oFAAC;AAE1E;;AAEG;AACa,IAAA,KAAK,GAAG,MAAM,EAAQ,CAAC;AAEvC;;AAEG;IACa,IAAI,GAAG,MAAM,EAAqB;AAElD;;AAEG;IACa,GAAG,GAAG,MAAM,EAAQ;AAEpC;;AAEG;AACa,IAA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