@scion/components 15.0.2 → 16.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dimension/dimension.directive.d.ts +2 -2
  2. package/dimension/dimension.module.d.ts +1 -2
  3. package/esm2022/dimension/dimension.directive.mjs +85 -0
  4. package/esm2022/dimension/dimension.module.mjs +35 -0
  5. package/esm2022/sashbox/element-ref.directive.mjs +32 -0
  6. package/esm2022/sashbox/public_api.mjs +18 -0
  7. package/esm2022/sashbox/sash-initializer.directive.mjs +36 -0
  8. package/esm2022/sashbox/sash.directive.mjs +146 -0
  9. package/esm2022/sashbox/sashbox.component.mjs +286 -0
  10. package/esm2022/sashbox/sashbox.module.mjs +56 -0
  11. package/esm2022/splitter/public_api.mjs +17 -0
  12. package/esm2022/splitter/splitter.component.mjs +226 -0
  13. package/esm2022/splitter/splitter.module.mjs +39 -0
  14. package/esm2022/throbber/ellipsis-throbber/ellipsis-throbber.component.mjs +26 -0
  15. package/esm2022/throbber/ripple-throbber/ripple-throbber.component.mjs +26 -0
  16. package/esm2022/throbber/roller-throbber/roller-throbber.component.mjs +26 -0
  17. package/esm2022/throbber/spinner-throbber/spinner-throbber.component.mjs +27 -0
  18. package/esm2022/throbber/throbber.component.mjs +76 -0
  19. package/esm2022/throbber/throbber.module.mjs +33 -0
  20. package/esm2022/viewport/native-scrollbar-track-size-provider.service.mjs +113 -0
  21. package/esm2022/viewport/public_api.mjs +19 -0
  22. package/esm2022/viewport/scrollable.directive.mjs +95 -0
  23. package/esm2022/viewport/scrollbar/scrollbar.component.mjs +323 -0
  24. package/esm2022/viewport/viewport.component.mjs +289 -0
  25. package/esm2022/viewport/viewport.module.mjs +43 -0
  26. package/{fesm2015 → fesm2022}/scion-components-dimension.mjs +13 -11
  27. package/fesm2022/scion-components-dimension.mjs.map +1 -0
  28. package/{fesm2020 → fesm2022}/scion-components-sashbox.mjs +69 -61
  29. package/fesm2022/scion-components-sashbox.mjs.map +1 -0
  30. package/{fesm2020 → fesm2022}/scion-components-splitter.mjs +25 -25
  31. package/fesm2022/scion-components-splitter.mjs.map +1 -0
  32. package/fesm2022/scion-components-throbber.mjs +215 -0
  33. package/fesm2022/scion-components-throbber.mjs.map +1 -0
  34. package/{fesm2020 → fesm2022}/scion-components-viewport.mjs +164 -161
  35. package/fesm2022/scion-components-viewport.mjs.map +1 -0
  36. package/package.json +27 -43
  37. package/sashbox/element-ref.directive.d.ts +1 -1
  38. package/sashbox/public_api.d.ts +3 -3
  39. package/sashbox/sash-initializer.directive.d.ts +1 -1
  40. package/sashbox/sash.directive.d.ts +2 -2
  41. package/sashbox/sashbox.component.d.ts +1 -3
  42. package/sashbox/sashbox.module.d.ts +1 -5
  43. package/splitter/public_api.d.ts +2 -2
  44. package/splitter/splitter.component.d.ts +1 -3
  45. package/splitter/splitter.module.d.ts +1 -2
  46. package/throbber/ellipsis-throbber/ellipsis-throbber.component.d.ts +1 -1
  47. package/throbber/ripple-throbber/ripple-throbber.component.d.ts +1 -1
  48. package/throbber/roller-throbber/roller-throbber.component.d.ts +1 -1
  49. package/throbber/spinner-throbber/spinner-throbber.component.d.ts +1 -1
  50. package/throbber/throbber.component.d.ts +1 -1
  51. package/throbber/throbber.module.d.ts +1 -6
  52. package/viewport/native-scrollbar-track-size-provider.service.d.ts +0 -2
  53. package/viewport/public_api.d.ts +3 -4
  54. package/viewport/scrollable.directive.d.ts +1 -1
  55. package/viewport/scrollbar/scrollbar.component.d.ts +2 -2
  56. package/viewport/viewport.component.d.ts +2 -2
  57. package/viewport/viewport.module.d.ts +1 -3
  58. package/esm2020/dimension/dimension.directive.mjs +0 -83
  59. package/esm2020/dimension/dimension.module.mjs +0 -38
  60. package/esm2020/sashbox/element-ref.directive.mjs +0 -27
  61. package/esm2020/sashbox/public_api.mjs +0 -18
  62. package/esm2020/sashbox/sash-initializer.directive.mjs +0 -32
  63. package/esm2020/sashbox/sash.directive.mjs +0 -144
  64. package/esm2020/sashbox/sashbox.component.mjs +0 -278
  65. package/esm2020/sashbox/sashbox.module.mjs +0 -69
  66. package/esm2020/splitter/public_api.mjs +0 -17
  67. package/esm2020/splitter/splitter.component.mjs +0 -227
  68. package/esm2020/splitter/splitter.module.mjs +0 -42
  69. package/esm2020/throbber/ellipsis-throbber/ellipsis-throbber.component.mjs +0 -25
  70. package/esm2020/throbber/ripple-throbber/ripple-throbber.component.mjs +0 -25
  71. package/esm2020/throbber/roller-throbber/roller-throbber.component.mjs +0 -25
  72. package/esm2020/throbber/spinner-throbber/spinner-throbber.component.mjs +0 -26
  73. package/esm2020/throbber/throbber.component.mjs +0 -67
  74. package/esm2020/throbber/throbber.module.mjs +0 -48
  75. package/esm2020/viewport/native-scrollbar-track-size-provider.service.mjs +0 -114
  76. package/esm2020/viewport/public_api.mjs +0 -20
  77. package/esm2020/viewport/scrollable.directive.mjs +0 -93
  78. package/esm2020/viewport/scrollbar/scrollbar.component.mjs +0 -322
  79. package/esm2020/viewport/viewport.component.mjs +0 -281
  80. package/esm2020/viewport/viewport.module.mjs +0 -50
  81. package/fesm2015/scion-components-dimension.mjs.map +0 -1
  82. package/fesm2015/scion-components-sashbox.mjs +0 -554
  83. package/fesm2015/scion-components-sashbox.mjs.map +0 -1
  84. package/fesm2015/scion-components-splitter.mjs +0 -284
  85. package/fesm2015/scion-components-splitter.mjs.map +0 -1
  86. package/fesm2015/scion-components-throbber.mjs +0 -214
  87. package/fesm2015/scion-components-throbber.mjs.map +0 -1
  88. package/fesm2015/scion-components-viewport.mjs +0 -861
  89. package/fesm2015/scion-components-viewport.mjs.map +0 -1
  90. package/fesm2015/scion-components.mjs +0 -4
  91. package/fesm2015/scion-components.mjs.map +0 -1
  92. package/fesm2020/scion-components-dimension.mjs +0 -135
  93. package/fesm2020/scion-components-dimension.mjs.map +0 -1
  94. package/fesm2020/scion-components-sashbox.mjs.map +0 -1
  95. package/fesm2020/scion-components-splitter.mjs.map +0 -1
  96. package/fesm2020/scion-components-throbber.mjs +0 -214
  97. package/fesm2020/scion-components-throbber.mjs.map +0 -1
  98. package/fesm2020/scion-components-viewport.mjs.map +0 -1
  99. /package/{esm2020 → esm2022}/dimension/public_api.mjs +0 -0
  100. /package/{esm2020 → esm2022}/dimension/scion-components-dimension.mjs +0 -0
  101. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  102. /package/{esm2020 → esm2022}/sashbox/sashbox-accessor.mjs +0 -0
  103. /package/{esm2020 → esm2022}/sashbox/scion-components-sashbox.mjs +0 -0
  104. /package/{esm2020 → esm2022}/scion-components.mjs +0 -0
  105. /package/{esm2020 → esm2022}/splitter/scion-components-splitter.mjs +0 -0
  106. /package/{esm2020 → esm2022}/throbber/public_api.mjs +0 -0
  107. /package/{esm2020 → esm2022}/throbber/scion-components-throbber.mjs +0 -0
  108. /package/{esm2020 → esm2022}/viewport/scion-components-viewport.mjs +0 -0
  109. /package/{fesm2020 → fesm2022}/scion-components.mjs +0 -0
  110. /package/{fesm2020 → fesm2022}/scion-components.mjs.map +0 -0
@@ -1,554 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, Input, EventEmitter, NgZone, forwardRef, Component, HostBinding, Output, ContentChildren, NgModule } from '@angular/core';
3
- import { switchMap, map, startWith, takeUntil } from 'rxjs/operators';
4
- import { BehaviorSubject, merge, Subject } from 'rxjs';
5
- import * as i1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import * as i2 from '@scion/components/splitter';
8
- import { SciSplitterModule } from '@scion/components/splitter';
9
-
10
- /**
11
- * Allows accessing the sashbox component from sashes.
12
- */
13
- class SciSashBoxAccessor {
14
- }
15
-
16
- /*
17
- * Copyright (c) 2018-2019 Swiss Federal Railways
18
- *
19
- * This program and the accompanying materials are made
20
- * available under the terms of the Eclipse Public License 2.0
21
- * which is available at https://www.eclipse.org/legal/epl-2.0/
22
- *
23
- * SPDX-License-Identifier: EPL-2.0
24
- */
25
- /**
26
- * Use this directive to model a sash for {@link SciSashboxComponent}.
27
- * The host element of this modelling directive must be a <ng-template> which is used as sash template.
28
- *
29
- *
30
- * ### Usage:
31
- *
32
- * <sci-sashbox direction="row">
33
- * <!-- fixed size sash -->
34
- * <ng-template sciSash size="200px">
35
- * ...
36
- * </ng-template>
37
- *
38
- * <!-- sash which takes the remaining space -->
39
- * <ng-template sciSash>
40
- * ...
41
- * </ng-template>
42
- * </sci-sashbox>
43
- */
44
- class SciSashDirective {
45
- constructor(sashTemplate, _sashBoxAccessor) {
46
- this.sashTemplate = sashTemplate;
47
- this._sashBoxAccessor = _sashBoxAccessor;
48
- this._size = '1';
49
- this._flexGrow$ = new BehaviorSubject(0);
50
- this.flexGrowNormalized$ = this._sashBoxAccessor.sashes$
51
- .pipe(switchMap(sashes => merge(...sashes.map(sash => sash._flexGrow$))), map(() => this.normalizeFlexGrow(this.flexGrow)));
52
- }
53
- /**
54
- * Specifies the sash size, either as fixed size with an explicit unit,
55
- * or as a unitless proportion to distibute remaining space. A proportional
56
- * sash has the ability to grow or shrink if necessary, and must be >= 1.
57
- *
58
- * If not set, remaining space is distributed equally.
59
- */
60
- set size(size) {
61
- this._size = size !== null && size !== void 0 ? size : '1';
62
- }
63
- get size() {
64
- return this._size;
65
- }
66
- /**
67
- * @internal
68
- */
69
- set flexGrow(flexGrow) {
70
- this._flexGrow$.next(flexGrow);
71
- }
72
- /**
73
- * @internal
74
- */
75
- get flexGrow() {
76
- return this._flexGrow$.value;
77
- }
78
- ngOnInit() {
79
- this.setFlexItemProperties();
80
- }
81
- ngOnChanges(changes) {
82
- this.setFlexItemProperties();
83
- }
84
- /**
85
- * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink if necessary.
86
- *
87
- * @internal
88
- */
89
- get isFixedSize() {
90
- return Number.isNaN(+this.size);
91
- }
92
- /**
93
- * Returns the effective sash size as rendered in the DOM.
94
- *
95
- * @internal
96
- */
97
- get computedSize() {
98
- // Note: Use `boundingClientRect` to get the fractional size.
99
- // see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth
100
- return this._sashBoxAccessor.direction === 'row' ? this.element.getBoundingClientRect().width : this.element.getBoundingClientRect().height;
101
- }
102
- /**
103
- * Computes and sets the flex item properties based on the modelled size.
104
- */
105
- setFlexItemProperties() {
106
- if (this.isFixedSize) {
107
- // fixed-sized sash
108
- this.flexGrow = 0;
109
- this.flexShrink = 0;
110
- this.flexBasis = `${this.size}`;
111
- }
112
- else {
113
- // remaining space is distributed according to given proportion
114
- const proportion = +this.size;
115
- if (proportion < 1) {
116
- throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size}]`);
117
- }
118
- this.flexGrow = proportion;
119
- this.flexShrink = 1;
120
- this.flexBasis = '0';
121
- }
122
- }
123
- /**
124
- * Computes the normalized flex-grow proportion of the given sash, which is a value >= 1.
125
- *
126
- * If the sum of all flex-grow proportions would be less than 1, then, the sashes would not fill the entire sash-box space.
127
- * Without normalization in place, e.g., this could happen when removing a sash.
128
- */
129
- normalizeFlexGrow(flexGrow) {
130
- if (flexGrow === 0) {
131
- return 0;
132
- }
133
- const sashes = this._sashBoxAccessor.sashes;
134
- const flexGrowSum = sashes.reduce((sum, sash) => sum + sash.flexGrow, 0);
135
- if (flexGrowSum === 0) {
136
- return 0;
137
- }
138
- return flexGrow / flexGrowSum;
139
- }
140
- }
141
- SciSashDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashDirective, deps: [{ token: i0.TemplateRef }, { token: SciSashBoxAccessor }], target: i0.ɵɵFactoryTarget.Directive });
142
- SciSashDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: SciSashDirective, selector: "ng-template[sciSash]", inputs: { size: "size", minSize: "minSize" }, exportAs: ["sciSash"], usesOnChanges: true, ngImport: i0 });
143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashDirective, decorators: [{
144
- type: Directive,
145
- args: [{
146
- selector: 'ng-template[sciSash]',
147
- exportAs: 'sciSash',
148
- }]
149
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: SciSashBoxAccessor }]; }, propDecorators: { size: [{
150
- type: Input
151
- }], minSize: [{
152
- type: Input
153
- }] } });
154
-
155
- /*
156
- * Copyright (c) 2018-2019 Swiss Federal Railways
157
- *
158
- * This program and the accompanying materials are made
159
- * available under the terms of the Eclipse Public License 2.0
160
- * which is available at https://www.eclipse.org/legal/epl-2.0/
161
- *
162
- * SPDX-License-Identifier: EPL-2.0
163
- */
164
- /**
165
- * Initializes {SashDirective} with the target {HTMLDivElement}.
166
- */
167
- class SciSashInitializerDirective {
168
- constructor(_host) {
169
- this._host = _host;
170
- }
171
- ngOnChanges(changes) {
172
- this.sash.element = this._host.nativeElement;
173
- }
174
- }
175
- SciSashInitializerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashInitializerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
176
- SciSashInitializerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: SciSashInitializerDirective, selector: "div[sciSashInitializer].sash", inputs: { sash: ["sciSashInitializer", "sash"] }, usesOnChanges: true, ngImport: i0 });
177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashInitializerDirective, decorators: [{
178
- type: Directive,
179
- args: [{ selector: 'div[sciSashInitializer].sash' }]
180
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { sash: [{
181
- type: Input,
182
- args: ['sciSashInitializer']
183
- }] } });
184
-
185
- /*
186
- * Copyright (c) 2018-2019 Swiss Federal Railways
187
- *
188
- * This program and the accompanying materials are made
189
- * available under the terms of the Eclipse Public License 2.0
190
- * which is available at https://www.eclipse.org/legal/epl-2.0/
191
- *
192
- * SPDX-License-Identifier: EPL-2.0
193
- */
194
- /**
195
- * Provides access to the native {@link HTMLElement} of the host.
196
- */
197
- class SciElementRefDirective {
198
- constructor(host) {
199
- this.host = host;
200
- this.nativeElement = host.nativeElement;
201
- }
202
- }
203
- SciElementRefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciElementRefDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
204
- SciElementRefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: SciElementRefDirective, selector: "[sciElementRef]", exportAs: ["sciElementRef"], ngImport: i0 });
205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciElementRefDirective, decorators: [{
206
- type: Directive,
207
- args: [{ selector: '[sciElementRef]', exportAs: 'sciElementRef' }]
208
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
209
-
210
- /*
211
- * Copyright (c) 2018-2019 Swiss Federal Railways
212
- *
213
- * This program and the accompanying materials are made
214
- * available under the terms of the Eclipse Public License 2.0
215
- * which is available at https://www.eclipse.org/legal/epl-2.0/
216
- *
217
- * SPDX-License-Identifier: EPL-2.0
218
- */
219
- /**
220
- * The <sci-sashbox> is like a CSS flexbox container that lays out its content children (sashes) in a row (which is by default)
221
- * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to
222
- * shrink or stretch the individual sashes.
223
- *
224
- * Sashes are modelled as content children inside a <ng-template> decorated with the 'sciSash' directive.
225
- * A sash can have a fixed size with an explicit unit, or a unitless proportion to distibute remaining space.
226
- * A proportional sash has the ability to grow or shrink if necessary.
227
- *
228
- *
229
- * ### Usage:
230
- *
231
- * ```html
232
- * <sci-sashbox direction="row">
233
- * <ng-template sciSash size="1">
234
- * ...
235
- * </ng-template>
236
- *
237
- * <ng-template sciSash size="2">
238
- * ...
239
- * </ng-template>
240
- *
241
- * <ng-template sciSash size="1">
242
- * ...
243
- * </ng-template>
244
- * </sci-sashbox>
245
- * ```
246
- *
247
- * ### Theme override:
248
- * The default style of the sashbox is made up of shades of gray.
249
- * You can control the appearance by overriding the following CSS variables:
250
- *
251
- * - --sci-sashbox-gap: Sets the gaps (gutters) between sashes.
252
- * - --sci-sashbox-splitter-bgcolor: Sets the background color of the splitter.
253
- * - --sci-sashbox-splitter-bgcolor_hover: Sets the background color of the splitter when hovering it.
254
- * - --sci-sashbox-splitter-size: Sets the size of the splitter along the main axis.
255
- * - --sci-sashbox-splitter-size_hover: Sets the size of the splitter along the main axis when hovering it.
256
- * - --sci-sashbox-splitter-touch-target-size: Sets the touch target size to move the splitter (accessibility).
257
- * - --sci-sashbox-splitter-cross-axis-size: Sets the splitter size along the cross axis.
258
- * - --sci-sashbox-splitter-border-radius: Sets the border radius of the splitter.
259
- * - --sci-sashbox-splitter-opacity_active: Sets the opacity of the splitter while the user moves the splitter.
260
- * - --sci-sashbox-splitter-opacity_hover: Sets the opacity of the splitter when hovering it.
261
- *
262
- * Example:
263
- *
264
- * ```scss
265
- * sci-sashbox {
266
- * --sci-sashbox-splitter-bgcolor: black;
267
- * --sci-sashbox-splitter-bgcolor_hover: black;
268
- * }
269
- * ```
270
- */
271
- class SciSashboxComponent {
272
- constructor(_host, _zone) {
273
- this._host = _host;
274
- this._zone = _zone;
275
- this._destroy$ = new Subject();
276
- this.sashes$ = new BehaviorSubject([]);
277
- this.sashing = false;
278
- /**
279
- * Specifies if to lay out sashes in a row (which is by default) or column arrangement.
280
- */
281
- this.direction = 'row';
282
- /**
283
- * Emits when start sashing.
284
- */
285
- this.sashStart = new EventEmitter();
286
- /**
287
- * Emits the absolute sash sizes (px) when finished sashing.
288
- */
289
- this.sashEnd = new EventEmitter();
290
- }
291
- /** @internal */
292
- set setSashes(queryList) {
293
- queryList.changes
294
- .pipe(startWith(queryList), takeUntil(this._destroy$))
295
- .subscribe((sashes) => {
296
- this.sashes$.next(sashes.toArray());
297
- });
298
- }
299
- onSashStart() {
300
- this.sashing = true;
301
- this.sashStart.emit();
302
- // set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas)
303
- this.sashes.forEach(sash => {
304
- if (!sash.isFixedSize) {
305
- sash.flexGrow = 0;
306
- sash.flexShrink = 0;
307
- sash.flexBasis = `${sash.computedSize}px`;
308
- }
309
- });
310
- }
311
- onSashEnd() {
312
- this.sashing = false;
313
- // unset the flex-basis for non-fixed sashes and set the flex-grow accordingly
314
- const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);
315
- const absoluteSashSizes = this.sashes.map(sash => sash.computedSize);
316
- this.sashes.forEach((sash, i) => {
317
- if (!sash.isFixedSize) {
318
- sash.flexGrow = pixelToFlexGrowFactor * absoluteSashSizes[i];
319
- sash.flexShrink = 1;
320
- sash.flexBasis = '0';
321
- }
322
- });
323
- this.sashEnd.emit(absoluteSashSizes);
324
- }
325
- onSash(splitter, sashIndex, moveEvent) {
326
- const distance = moveEvent.distance;
327
- if (distance === 0) {
328
- return;
329
- }
330
- NgZone.assertNotInAngularZone();
331
- // compute the splitter position
332
- const splitterRect = splitter.getBoundingClientRect();
333
- const splitterStart = (this.isRowDirection ? splitterRect.left : splitterRect.top);
334
- const splitterEnd = (this.isRowDirection ? splitterRect.left + splitterRect.width : splitterRect.top + splitterRect.height);
335
- // ignore the event if outside of the splitter's action scope
336
- const eventPos = moveEvent.position.clientPos;
337
- // i.e. the sash should not grow if moved the mouse pointer beyond the left bounds of the sash, and if now moving the mouse pointer back toward the current sash.
338
- if (distance > 0 && eventPos < splitterStart) {
339
- return;
340
- }
341
- // i.e. the sash should not shrink if moved the mouse pointer beyond the right bounds of the sash, and if now moving the mouse pointer back toward the current sash.
342
- if (distance < 0 && eventPos > splitterEnd) {
343
- return;
344
- }
345
- // compute the new sash sizes
346
- const sash1 = this.sashes[sashIndex];
347
- const sash2 = this.sashes[sashIndex + 1];
348
- const sashSize1 = sash1.computedSize;
349
- const sashSize2 = sash2.computedSize;
350
- const maxSashSize = sashSize1 + sashSize2;
351
- const computedNewSashSize1 = Math.round(sashSize1 + distance);
352
- const computedNewSashSize2 = Math.round(sashSize2 - distance);
353
- if (sash1.minSize !== undefined && distance < 0 && computedNewSashSize1 < this.toPixel(sash1.minSize)) {
354
- return;
355
- }
356
- if (sash2.minSize !== undefined && distance > 0 && computedNewSashSize2 < this.toPixel(sash2.minSize)) {
357
- return;
358
- }
359
- const validNewSashSize1 = between(computedNewSashSize1, { min: 0, max: maxSashSize });
360
- const validNewSashSize2 = between(computedNewSashSize2, { min: 0, max: maxSashSize });
361
- // continue only if both sashes adjacent to the splitter change their size (as the event would change other sashes otherwise)
362
- if (validNewSashSize1 !== computedNewSashSize1) {
363
- return;
364
- }
365
- if (validNewSashSize2 !== computedNewSashSize2) {
366
- return;
367
- }
368
- // set the new computed sash sizes
369
- this._zone.run(() => {
370
- sash1.flexBasis = `${computedNewSashSize1}px`;
371
- sash2.flexBasis = `${computedNewSashSize2}px`;
372
- });
373
- }
374
- onSashReset(sashIndex) {
375
- const sash1 = this.sashes[sashIndex];
376
- const sash2 = this.sashes[sashIndex + 1];
377
- const equalSashSize = (sash1.computedSize + sash2.computedSize) / 2;
378
- const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);
379
- const absoluteSashSizesAfterReset = this.sashes.map((sash, index) => {
380
- if (index === sashIndex || index === sashIndex + 1) {
381
- return equalSashSize;
382
- }
383
- return sash.computedSize;
384
- });
385
- [sash1, sash2].forEach(sash => {
386
- if (sash.isFixedSize) {
387
- sash.flexBasis = `${equalSashSize}px`;
388
- }
389
- else {
390
- sash.flexGrow = pixelToFlexGrowFactor * equalSashSize;
391
- }
392
- });
393
- this.sashStart.emit();
394
- this.sashEnd.emit(absoluteSashSizesAfterReset);
395
- }
396
- get isColumnDirection() {
397
- return this.direction === 'column';
398
- }
399
- get isRowDirection() {
400
- return this.direction === 'row';
401
- }
402
- get sashes() {
403
- return this.sashes$.value;
404
- }
405
- ngOnDestroy() {
406
- this._destroy$.next();
407
- }
408
- toPixel(value) {
409
- if (typeof value === 'number') {
410
- return value;
411
- }
412
- if (value.endsWith('%')) {
413
- const hostBounds = this._host.nativeElement.getBoundingClientRect();
414
- const hostSize = (this.isRowDirection ? hostBounds.width : hostBounds.height);
415
- return parseInt(value, 10) * hostSize / 100;
416
- }
417
- return parseInt(value, 10);
418
- }
419
- }
420
- SciSashboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
421
- SciSashboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.2", type: SciSashboxComponent, selector: "sci-sashbox", inputs: { direction: "direction" }, outputs: { sashStart: "sashStart", sashEnd: "sashEnd" }, host: { properties: { "class.sashing": "this.sashing", "class.column": "this.isColumnDirection", "class.row": "this.isRowDirection" } }, providers: [{
422
- provide: SciSashBoxAccessor,
423
- useFactory: provideSashBoxAccessor,
424
- deps: [forwardRef(() => SciSashboxComponent)],
425
- }], queries: [{ propertyName: "setSashes", predicate: SciSashDirective }], ngImport: i0, template: "<ng-container *ngFor=\"let sash of sashes$ | async; index as i; first as first; last as last;\">\n <div class=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [sciSashInitializer]=\"sash\"\n [style.flex-grow]=\"sash.flexGrowNormalized$ | async\"\n [style.flex-shrink]=\"sash.flexShrink\"\n [style.flex-basis]=\"sash.flexBasis\">\n <ng-container *ngTemplateOutlet=\"sash.sashTemplate\"></ng-container>\n </div>\n\n <sci-splitter *ngIf=\"!last\"\n sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"isRowDirection ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.nativeElement, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\">\n </sci-splitter>\n</ng-container>\n", styles: [":host{--sci-sashbox-gap: 10px;--sci-sashbox-splitter-bgcolor: #d2d2d2;--sci-sashbox-splitter-bgcolor_hover: var(--sci-sashbox-splitter-bgcolor);--sci-sashbox-splitter-size: 1px;--sci-sashbox-splitter-size_hover: 8px;--sci-sashbox-splitter-touch-target-size: 15px;--sci-sashbox-splitter-cross-axis-size: 100%;--sci-sashbox-splitter-border-radius: 0;--sci-sashbox-splitter-opacity_active: 1;--sci-sashbox-splitter-opacity_hover: .3;display:flex;align-items:stretch;box-sizing:border-box;overflow:hidden;z-index:0}:host *{box-sizing:border-box}:host.column{flex-direction:column}:host.row{flex-direction:row}:host>div.sash{overflow:hidden;display:grid;grid-auto-rows:100%;grid-auto-columns:100%}:host.row>div.sash{margin:0 var(--sci-sashbox-gap)}:host.row>div.sash.first{margin-left:0}:host.row>div.sash.last{margin-right:0}:host.column>div.sash{margin:var(--sci-sashbox-gap) 0}:host.column>div.sash.first{margin-top:0}:host.column>div.sash.last{margin-bottom:0}:host.sashing>div.sash{pointer-events:none}:host>sci-splitter{--sci-splitter-bgcolor: var(--sci-sashbox-splitter-bgcolor);--sci-splitter-bgcolor_hover: var(--sci-sashbox-splitter-bgcolor_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: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.SciSplitterComponent, selector: "sci-splitter", inputs: ["orientation"], outputs: ["start", "move", "end", "reset"] }, { kind: "directive", type: SciSashInitializerDirective, selector: "div[sciSashInitializer].sash", inputs: ["sciSashInitializer"] }, { kind: "directive", type: SciElementRefDirective, selector: "[sciElementRef]", exportAs: ["sciElementRef"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxComponent, decorators: [{
427
- type: Component,
428
- args: [{ selector: 'sci-sashbox', providers: [{
429
- provide: SciSashBoxAccessor,
430
- useFactory: provideSashBoxAccessor,
431
- deps: [forwardRef(() => SciSashboxComponent)],
432
- }], template: "<ng-container *ngFor=\"let sash of sashes$ | async; index as i; first as first; last as last;\">\n <div class=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [sciSashInitializer]=\"sash\"\n [style.flex-grow]=\"sash.flexGrowNormalized$ | async\"\n [style.flex-shrink]=\"sash.flexShrink\"\n [style.flex-basis]=\"sash.flexBasis\">\n <ng-container *ngTemplateOutlet=\"sash.sashTemplate\"></ng-container>\n </div>\n\n <sci-splitter *ngIf=\"!last\"\n sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"isRowDirection ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.nativeElement, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\">\n </sci-splitter>\n</ng-container>\n", styles: [":host{--sci-sashbox-gap: 10px;--sci-sashbox-splitter-bgcolor: #d2d2d2;--sci-sashbox-splitter-bgcolor_hover: var(--sci-sashbox-splitter-bgcolor);--sci-sashbox-splitter-size: 1px;--sci-sashbox-splitter-size_hover: 8px;--sci-sashbox-splitter-touch-target-size: 15px;--sci-sashbox-splitter-cross-axis-size: 100%;--sci-sashbox-splitter-border-radius: 0;--sci-sashbox-splitter-opacity_active: 1;--sci-sashbox-splitter-opacity_hover: .3;display:flex;align-items:stretch;box-sizing:border-box;overflow:hidden;z-index:0}:host *{box-sizing:border-box}:host.column{flex-direction:column}:host.row{flex-direction:row}:host>div.sash{overflow:hidden;display:grid;grid-auto-rows:100%;grid-auto-columns:100%}:host.row>div.sash{margin:0 var(--sci-sashbox-gap)}:host.row>div.sash.first{margin-left:0}:host.row>div.sash.last{margin-right:0}:host.column>div.sash{margin:var(--sci-sashbox-gap) 0}:host.column>div.sash.first{margin-top:0}:host.column>div.sash.last{margin-bottom:0}:host.sashing>div.sash{pointer-events:none}:host>sci-splitter{--sci-splitter-bgcolor: var(--sci-sashbox-splitter-bgcolor);--sci-splitter-bgcolor_hover: var(--sci-sashbox-splitter-bgcolor_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"] }]
433
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { sashing: [{
434
- type: HostBinding,
435
- args: ['class.sashing']
436
- }], direction: [{
437
- type: Input
438
- }], sashStart: [{
439
- type: Output
440
- }], sashEnd: [{
441
- type: Output
442
- }], setSashes: [{
443
- type: ContentChildren,
444
- args: [SciSashDirective]
445
- }], isColumnDirection: [{
446
- type: HostBinding,
447
- args: ['class.column']
448
- }], isRowDirection: [{
449
- type: HostBinding,
450
- args: ['class.row']
451
- }] } });
452
- function between(value, minmax) {
453
- return Math.min(minmax.max, Math.max(minmax.min, value));
454
- }
455
- /**
456
- * Returns the factor to compute the flex-grow proportion from the pixel size of a sash.
457
- */
458
- function computePixelToFlexGrowFactor(sashes) {
459
- const flexibleSashes = sashes.filter(sash => !sash.isFixedSize);
460
- const proportionSum = flexibleSashes.reduce((sum, sash) => sum + Number(sash.size), 0);
461
- const pixelSum = flexibleSashes.reduce((sum, sash) => sum + sash.computedSize, 0);
462
- return proportionSum / pixelSum;
463
- }
464
- function provideSashBoxAccessor(component) {
465
- return new class {
466
- get direction() {
467
- return component.direction;
468
- }
469
- get sashes$() {
470
- return component.sashes$;
471
- }
472
- get sashes() {
473
- return component.sashes$.value;
474
- }
475
- };
476
- }
477
-
478
- /*
479
- * Copyright (c) 2018-2019 Swiss Federal Railways
480
- *
481
- * This program and the accompanying materials are made
482
- * available under the terms of the Eclipse Public License 2.0
483
- * which is available at https://www.eclipse.org/legal/epl-2.0/
484
- *
485
- * SPDX-License-Identifier: EPL-2.0
486
- */
487
- /**
488
- * Provides a sashbox component that lays out its children in a row or column arrangement and places a splitter between each child.
489
- *
490
- * ### Usage:
491
- *
492
- * ```html
493
- * <sci-sashbox direction="row">
494
- * <ng-template sciSash size="1">
495
- * ...
496
- * </ng-template>
497
- *
498
- * <ng-template sciSash size="2">
499
- * ...
500
- * </ng-template>
501
- *
502
- * <ng-template sciSash size="1">
503
- * ...
504
- * </ng-template>
505
- * </sci-sashbox>
506
- * ```
507
- */
508
- class SciSashboxModule {
509
- }
510
- SciSashboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
511
- SciSashboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxModule, declarations: [SciSashboxComponent,
512
- SciSashDirective,
513
- SciSashInitializerDirective,
514
- SciElementRefDirective], imports: [CommonModule,
515
- SciSplitterModule], exports: [SciSashboxComponent,
516
- SciSashDirective] });
517
- SciSashboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxModule, imports: [CommonModule,
518
- SciSplitterModule] });
519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: SciSashboxModule, decorators: [{
520
- type: NgModule,
521
- args: [{
522
- declarations: [
523
- SciSashboxComponent,
524
- SciSashDirective,
525
- SciSashInitializerDirective,
526
- SciElementRefDirective,
527
- ],
528
- imports: [
529
- CommonModule,
530
- SciSplitterModule,
531
- ],
532
- exports: [
533
- SciSashboxComponent,
534
- SciSashDirective,
535
- ],
536
- }]
537
- }] });
538
-
539
- /*
540
- * Copyright (c) 2018-2019 Swiss Federal Railways
541
- *
542
- * This program and the accompanying materials are made
543
- * available under the terms of the Eclipse Public License 2.0
544
- * which is available at https://www.eclipse.org/legal/epl-2.0/
545
- *
546
- * SPDX-License-Identifier: EPL-2.0
547
- */
548
-
549
- /**
550
- * Generated bundle index. Do not edit.
551
- */
552
-
553
- export { SciSashDirective, SciSashboxComponent, SciSashboxModule, provideSashBoxAccessor };
554
- //# sourceMappingURL=scion-components-sashbox.mjs.map
@@ -1 +0,0 @@
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/sash-initializer.directive.ts","../../../../projects/scion/components/sashbox/src/element-ref.directive.ts","../../../../projects/scion/components/sashbox/src/sashbox.component.ts","../../../../projects/scion/components/sashbox/src/sashbox.component.html","../../../../projects/scion/components/sashbox/src/sashbox.module.ts","../../../../projects/scion/components/sashbox/src/public_api.ts","../../../../projects/scion/components/sashbox/src/scion-components-sashbox.ts"],"sourcesContent":["import {SciSashDirective} from './sash.directive';\nimport {Observable} from 'rxjs';\n\n/**\n * Allows accessing the sashbox component from sashes.\n */\nexport abstract class SciSashBoxAccessor {\n\n public abstract get sashes(): SciSashDirective[];\n\n public abstract get sashes$(): Observable<SciSashDirective[]>;\n\n public abstract get direction(): 'column' | 'row';\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, Input, OnChanges, OnInit, SimpleChanges, TemplateRef} from '@angular/core';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\nimport {BehaviorSubject, merge, Observable} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\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 implements OnInit, OnChanges {\n\n private _size: string | number = '1';\n private _flexGrow$ = new BehaviorSubject<number>(0);\n\n /**\n * Specifies the sash size, either as fixed size with an explicit unit,\n * or as a unitless proportion to distibute 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 @Input()\n public set size(size: string | number | null | undefined) {\n this._size = size ?? '1';\n }\n\n public get size(): string | number {\n return this._size;\n }\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 @Input()\n public minSize?: string | number;\n\n /**\n * @internal\n */\n public element!: HTMLElement;\n\n /**\n * @internal\n */\n public set flexGrow(flexGrow: number) {\n this._flexGrow$.next(flexGrow);\n }\n\n /**\n * @internal\n */\n public get flexGrow(): number {\n return this._flexGrow$.value;\n }\n\n /**\n * @internal\n */\n public flexShrink!: number;\n\n /**\n * @internal\n */\n public flexBasis!: string;\n\n /**\n * Normalized flex-grow proportion of this sash, which is a value >= 1.\n *\n * @internal\n */\n public flexGrowNormalized$: Observable<number>;\n\n constructor(public readonly sashTemplate: TemplateRef<void>, private _sashBoxAccessor: SciSashBoxAccessor) {\n this.flexGrowNormalized$ = this._sashBoxAccessor.sashes$\n .pipe(\n switchMap(sashes => merge(...sashes.map(sash => sash._flexGrow$))),\n map(() => this.normalizeFlexGrow(this.flexGrow)),\n );\n }\n\n public ngOnInit(): void {\n this.setFlexItemProperties();\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.setFlexItemProperties();\n }\n\n /**\n * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink if necessary.\n *\n * @internal\n */\n public get isFixedSize(): boolean {\n return Number.isNaN(+this.size);\n }\n\n /**\n * Returns the effective sash size as rendered in the DOM.\n *\n * @internal\n */\n public get computedSize(): number {\n // Note: Use `boundingClientRect` to get the fractional size.\n // see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth\n return this._sashBoxAccessor.direction === 'row' ? this.element.getBoundingClientRect().width : this.element.getBoundingClientRect().height;\n }\n\n /**\n * Computes and sets the flex item properties based on the modelled size.\n */\n private setFlexItemProperties(): void {\n if (this.isFixedSize) {\n // fixed-sized sash\n this.flexGrow = 0;\n this.flexShrink = 0;\n this.flexBasis = `${this.size}`;\n }\n else {\n // remaining space is distributed according to given proportion\n const proportion = +this.size;\n if (proportion < 1) {\n throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size}]`);\n }\n\n this.flexGrow = proportion;\n this.flexShrink = 1;\n this.flexBasis = '0';\n }\n }\n\n /**\n * Computes the normalized flex-grow proportion of the given sash, which is a value >= 1.\n *\n * If the sum of all flex-grow proportions would be less than 1, then, the sashes would not fill the entire sash-box space.\n * Without normalization in place, e.g., this could happen when removing a sash.\n */\n private normalizeFlexGrow(flexGrow: number): number {\n if (flexGrow === 0) {\n return 0;\n }\n\n const sashes = this._sashBoxAccessor.sashes;\n const flexGrowSum = sashes.reduce((sum, sash) => sum + sash.flexGrow, 0);\n if (flexGrowSum === 0) {\n return 0;\n }\n return flexGrow / flexGrowSum;\n }\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, ElementRef, Input, OnChanges, SimpleChanges} from '@angular/core';\nimport {SciSashDirective} from './sash.directive';\n\n/**\n * Initializes {SashDirective} with the target {HTMLDivElement}.\n */\n@Directive({selector: 'div[sciSashInitializer].sash'})\nexport class SciSashInitializerDirective implements OnChanges {\n\n @Input('sciSashInitializer') // eslint-disable-line @angular-eslint/no-input-rename\n public sash!: SciSashDirective;\n\n constructor(private _host: ElementRef<HTMLDivElement>) {\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.sash.element = this._host.nativeElement;\n }\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Directive, ElementRef} from '@angular/core';\n\n/**\n * Provides access to the native {@link HTMLElement} of the host.\n */\n@Directive({selector: '[sciElementRef]', exportAs: 'sciElementRef'})\nexport class SciElementRefDirective {\n\n public readonly nativeElement: HTMLElement;\n\n constructor(public host: ElementRef<HTMLElement>) {\n this.nativeElement = host.nativeElement;\n }\n}\n","/*\n * Copyright (c) 2018-2019 Swiss Federal Railways\n *\n * This program and the accompanying materials are made\n * available under the terms of the Eclipse Public License 2.0\n * which is available at https://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\n */\n\nimport {Component, ContentChildren, ElementRef, EventEmitter, forwardRef, HostBinding, Input, NgZone, OnDestroy, Output, QueryList} from '@angular/core';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {BehaviorSubject, Observable, Subject} from 'rxjs';\nimport {SplitterMoveEvent} from '@scion/components/splitter';\nimport {SciSashDirective} from './sash.directive';\nimport {SciSashBoxAccessor} from './sashbox-accessor';\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 content children inside a <ng-template> decorated with the 'sciSash' directive.\n * A sash can have a fixed size with an explicit unit, or a unitless proportion to distibute remaining space.\n * A proportional sash has the ability to grow or shrink if necessary.\n *\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 * ### Theme override:\n * The default style of the sashbox is made up of shades of gray.\n * You can control the appearance by overriding the following CSS variables:\n *\n * - --sci-sashbox-gap: Sets the gaps (gutters) between sashes.\n * - --sci-sashbox-splitter-bgcolor: Sets the background color of the splitter.\n * - --sci-sashbox-splitter-bgcolor_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-bgcolor: black;\n * --sci-sashbox-splitter-bgcolor_hover: black;\n * }\n * ```\n */\n@Component({\n selector: 'sci-sashbox',\n templateUrl: './sashbox.component.html',\n styleUrls: ['./sashbox.component.scss'],\n providers: [{\n provide: SciSashBoxAccessor,\n useFactory: provideSashBoxAccessor,\n deps: [forwardRef(() => SciSashboxComponent)],\n }],\n})\nexport class SciSashboxComponent implements OnDestroy {\n\n private _destroy$ = new Subject<void>();\n\n public sashes$ = new BehaviorSubject<SciSashDirective[]>([]);\n\n @HostBinding('class.sashing')\n public sashing = false;\n\n /**\n * Specifies if to lay out sashes in a row (which is by default) or column arrangement.\n */\n @Input()\n public direction: 'column' | 'row' = 'row';\n\n /**\n * Emits when start sashing.\n */\n @Output()\n public sashStart = new EventEmitter<void>();\n\n /**\n * Emits the absolute sash sizes (px) when finished sashing.\n */\n @Output()\n public sashEnd = new EventEmitter<number[]>();\n\n /** @internal */\n @ContentChildren(SciSashDirective)\n public set setSashes(queryList: QueryList<SciSashDirective>) {\n queryList.changes\n .pipe(\n startWith(queryList),\n takeUntil(this._destroy$),\n )\n .subscribe((sashes: QueryList<SciSashDirective>) => {\n this.sashes$.next(sashes.toArray());\n });\n }\n\n constructor(private _host: ElementRef<HTMLElement>, private _zone: NgZone) {\n }\n\n public onSashStart(): void {\n this.sashing = true;\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.flexGrow = 0;\n sash.flexShrink = 0;\n sash.flexBasis = `${sash.computedSize}px`;\n }\n });\n }\n\n public onSashEnd(): void {\n this.sashing = false;\n\n // unset the flex-basis for non-fixed sashes and set the flex-grow accordingly\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);\n const absoluteSashSizes = this.sashes.map(sash => sash.computedSize);\n\n this.sashes.forEach((sash, i) => {\n if (!sash.isFixedSize) {\n sash.flexGrow = pixelToFlexGrowFactor * absoluteSashSizes[i];\n sash.flexShrink = 1;\n sash.flexBasis = '0';\n }\n });\n this.sashEnd.emit(absoluteSashSizes);\n }\n\n public onSash(splitter: HTMLElement, sashIndex: number, moveEvent: SplitterMoveEvent): void {\n const distance = moveEvent.distance;\n if (distance === 0) {\n return;\n }\n\n NgZone.assertNotInAngularZone();\n\n // compute the splitter position\n const splitterRect = splitter.getBoundingClientRect();\n const splitterStart = (this.isRowDirection ? splitterRect.left : splitterRect.top);\n const splitterEnd = (this.isRowDirection ? splitterRect.left + splitterRect.width : splitterRect.top + splitterRect.height);\n\n // ignore the event if outside of the splitter's action scope\n const eventPos = moveEvent.position.clientPos;\n // i.e. the sash should not grow if moved the mouse pointer beyond the left bounds of the sash, and if now moving the mouse pointer back toward the current sash.\n if (distance > 0 && eventPos < splitterStart) {\n return;\n }\n\n // i.e. the sash should not shrink if moved the mouse pointer beyond the right bounds of the sash, and if 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.computedSize;\n const sashSize2 = sash2.computedSize;\n const maxSashSize = sashSize1 + sashSize2;\n const computedNewSashSize1 = Math.round(sashSize1 + distance);\n const computedNewSashSize2 = Math.round(sashSize2 - distance);\n\n if (sash1.minSize !== undefined && distance < 0 && computedNewSashSize1 < this.toPixel(sash1.minSize)) {\n return;\n }\n if (sash2.minSize !== undefined && distance > 0 && computedNewSashSize2 < this.toPixel(sash2.minSize)) {\n return;\n }\n\n const validNewSashSize1 = between(computedNewSashSize1, {min: 0, max: maxSashSize});\n const validNewSashSize2 = between(computedNewSashSize2, {min: 0, max: maxSashSize});\n\n // continue only if both sashes adjacent to the splitter change their size (as the event would change other sashes otherwise)\n if (validNewSashSize1 !== computedNewSashSize1) {\n return;\n }\n if (validNewSashSize2 !== computedNewSashSize2) {\n return;\n }\n\n // set the new computed sash sizes\n this._zone.run(() => {\n sash1.flexBasis = `${computedNewSashSize1}px`;\n sash2.flexBasis = `${computedNewSashSize2}px`;\n });\n }\n\n public onSashReset(sashIndex: number): void {\n const sash1 = this.sashes[sashIndex];\n const sash2 = this.sashes[sashIndex + 1];\n const equalSashSize = (sash1.computedSize + sash2.computedSize) / 2;\n const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);\n const absoluteSashSizesAfterReset = this.sashes.map((sash, index) => {\n if (index === sashIndex || index === sashIndex + 1) {\n return equalSashSize;\n }\n return sash.computedSize;\n });\n\n [sash1, sash2].forEach(sash => {\n if (sash.isFixedSize) {\n sash.flexBasis = `${equalSashSize}px`;\n }\n else {\n sash.flexGrow = pixelToFlexGrowFactor * equalSashSize;\n }\n });\n\n this.sashStart.emit();\n this.sashEnd.emit(absoluteSashSizesAfterReset);\n }\n\n @HostBinding('class.column')\n public get isColumnDirection(): boolean {\n return this.direction === 'column';\n }\n\n @HostBinding('class.row')\n public get isRowDirection(): boolean {\n return this.direction === 'row';\n }\n\n private get sashes(): SciSashDirective[] {\n return this.sashes$.value;\n }\n\n public ngOnDestroy(): void {\n this._destroy$.next();\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.nativeElement.getBoundingClientRect();\n const hostSize = (this.isRowDirection ? hostBounds.width : hostBounds.height);\n return parseInt(value, 10) * hostSize / 100;\n }\n return parseInt(value, 10);\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: 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.computedSize, 0);\n\n return proportionSum / pixelSum;\n}\n\nexport function provideSashBoxAccessor(component: SciSashboxComponent): SciSashBoxAccessor {\n return new class implements SciSashBoxAccessor {\n\n public get direction(): 'column' | 'row' {\n return component.direction;\n }\n\n public get sashes$(): Observable<SciSashDirective[]> {\n return component.sashes$;\n }\n\n public get sashes(): SciSashDirective[] {\n return component.sashes$.value;\n }\n };\n}\n","<ng-container *ngFor=\"let sash of sashes$ | async; index as i; first as first; last as last;\">\n <div class=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [sciSashInitializer]=\"sash\"\n [style.flex-grow]=\"sash.flexGrowNormalized$ | async\"\n [style.flex-shrink]=\"sash.flexShrink\"\n [style.flex-basis]=\"sash.flexBasis\">\n <ng-container *ngTemplateOutlet=\"sash.sashTemplate\"></ng-container>\n </div>\n\n <sci-splitter *ngIf=\"!last\"\n sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"isRowDirection ? 'vertical' : 'horizontal'\"\n (start)=\"onSashStart()\"\n (move)=\"onSash(sciElementRef.nativeElement, i, $event)\"\n (end)=\"onSashEnd()\"\n (reset)=\"onSashReset(i)\">\n </sci-splitter>\n</ng-container>\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 {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {SciSashboxComponent} from './sashbox.component';\nimport {SciSashDirective} from './sash.directive';\nimport {SciSashInitializerDirective} from './sash-initializer.directive';\nimport {SciSplitterModule} from '@scion/components/splitter';\nimport {SciElementRefDirective} from './element-ref.directive';\n\n/**\n * Provides a sashbox component that lays out its children in a row or column arrangement and places a splitter between each child.\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@NgModule({\n declarations: [\n SciSashboxComponent,\n SciSashDirective,\n SciSashInitializerDirective,\n SciElementRefDirective,\n ],\n imports: [\n CommonModule,\n SciSplitterModule,\n ],\n exports: [\n SciSashboxComponent,\n SciSashDirective,\n ],\n})\nexport class SciSashboxModule {\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 * from './sashbox.component';\nexport * from './sash.directive';\nexport * from './sashbox.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.SciSashBoxAccessor","i3.SciSashInitializerDirective","i4.SciElementRefDirective"],"mappings":";;;;;;;;;AAGA;;AAEG;MACmB,kBAAkB,CAAA;AAOvC;;ACbD;;;;;;;;AAQG;AAOH;;;;;;;;;;;;;;;;;;AAkBG;MAKU,gBAAgB,CAAA;IAkE3B,WAA4B,CAAA,YAA+B,EAAU,gBAAoC,EAAA;AAA7E,QAAA,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAmB;AAAU,QAAA,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAoB;AAhEjG,QAAA,IAAK,CAAA,KAAA,GAAoB,GAAG,CAAC;QAC7B,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAS,CAAC,CAAC,CAAC;AAgElD,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO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