@scion/components 18.1.1 → 19.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 (68) hide show
  1. package/dimension/dimension.directive.d.ts +2 -2
  2. package/dimension/dimension.module.d.ts +2 -0
  3. package/dimension/public_api.d.ts +1 -1
  4. package/fesm2022/scion-components-dimension.mjs +18 -17
  5. package/fesm2022/scion-components-dimension.mjs.map +1 -1
  6. package/fesm2022/scion-components-sashbox.mjs +222 -215
  7. package/fesm2022/scion-components-sashbox.mjs.map +1 -1
  8. package/fesm2022/scion-components-splitter.mjs +69 -74
  9. package/fesm2022/scion-components-splitter.mjs.map +1 -1
  10. package/fesm2022/scion-components-throbber.mjs +43 -45
  11. package/fesm2022/scion-components-throbber.mjs.map +1 -1
  12. package/fesm2022/scion-components-viewport.mjs +94 -99
  13. package/fesm2022/scion-components-viewport.mjs.map +1 -1
  14. package/package.json +4 -16
  15. package/sashbox/element-ref.directive.d.ts +1 -4
  16. package/sashbox/sash-initializer.directive.d.ts +4 -7
  17. package/sashbox/sash.directive.d.ts +21 -20
  18. package/sashbox/sashbox-accessor.d.ts +3 -4
  19. package/sashbox/sashbox.component.d.ts +36 -27
  20. package/sashbox/sashbox.module.d.ts +2 -0
  21. package/splitter/public_api.d.ts +1 -1
  22. package/splitter/splitter.component.d.ts +22 -26
  23. package/splitter/splitter.module.d.ts +2 -0
  24. package/throbber/spinner-throbber/spinner-throbber.component.d.ts +1 -1
  25. package/throbber/throbber.component.d.ts +2 -2
  26. package/throbber/throbber.module.d.ts +2 -0
  27. package/viewport/native-scrollbar-track-size-provider.service.d.ts +2 -2
  28. package/viewport/public_api.d.ts +1 -1
  29. package/viewport/scrollable.directive.d.ts +4 -4
  30. package/viewport/scrollbar/scrollbar.component.d.ts +16 -22
  31. package/viewport/viewport.component.d.ts +13 -12
  32. package/viewport/viewport.module.d.ts +2 -0
  33. package/esm2022/dimension/bounding-client-rect.signal.mjs +0 -54
  34. package/esm2022/dimension/dimension.directive.mjs +0 -67
  35. package/esm2022/dimension/dimension.mjs +0 -11
  36. package/esm2022/dimension/dimension.module.mjs +0 -34
  37. package/esm2022/dimension/dimension.signal.mjs +0 -63
  38. package/esm2022/dimension/public_api.mjs +0 -19
  39. package/esm2022/dimension/scion-components-dimension.mjs +0 -5
  40. package/esm2022/public-api.mjs +0 -11
  41. package/esm2022/sashbox/element-ref.directive.mjs +0 -31
  42. package/esm2022/sashbox/public_api.mjs +0 -18
  43. package/esm2022/sashbox/sash-initializer.directive.mjs +0 -35
  44. package/esm2022/sashbox/sash.directive.mjs +0 -145
  45. package/esm2022/sashbox/sashbox-accessor.mjs +0 -6
  46. package/esm2022/sashbox/sashbox.component.mjs +0 -282
  47. package/esm2022/sashbox/sashbox.module.mjs +0 -55
  48. package/esm2022/sashbox/scion-components-sashbox.mjs +0 -5
  49. package/esm2022/scion-components.mjs +0 -5
  50. package/esm2022/splitter/public_api.mjs +0 -17
  51. package/esm2022/splitter/scion-components-splitter.mjs +0 -5
  52. package/esm2022/splitter/splitter.component.mjs +0 -226
  53. package/esm2022/splitter/splitter.module.mjs +0 -38
  54. package/esm2022/throbber/ellipsis-throbber/ellipsis-throbber.component.mjs +0 -25
  55. package/esm2022/throbber/public_api.mjs +0 -17
  56. package/esm2022/throbber/ripple-throbber/ripple-throbber.component.mjs +0 -25
  57. package/esm2022/throbber/roller-throbber/roller-throbber.component.mjs +0 -25
  58. package/esm2022/throbber/scion-components-throbber.mjs +0 -5
  59. package/esm2022/throbber/spinner-throbber/spinner-throbber.component.mjs +0 -26
  60. package/esm2022/throbber/throbber.component.mjs +0 -72
  61. package/esm2022/throbber/throbber.module.mjs +0 -32
  62. package/esm2022/viewport/native-scrollbar-track-size-provider.service.mjs +0 -91
  63. package/esm2022/viewport/public_api.mjs +0 -19
  64. package/esm2022/viewport/scion-components-viewport.mjs +0 -5
  65. package/esm2022/viewport/scrollable.directive.mjs +0 -92
  66. package/esm2022/viewport/scrollbar/scrollbar.component.mjs +0 -305
  67. package/esm2022/viewport/viewport.component.mjs +0 -264
  68. package/esm2022/viewport/viewport.module.mjs +0 -42
@@ -1,9 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, inject, ElementRef, NgZone, EventEmitter, Component, HostBinding, Output, ContentChildren, NgModule } from '@angular/core';
3
- import { switchMap, map, startWith, takeUntil } from 'rxjs/operators';
4
- import { BehaviorSubject, merge, Subject } from 'rxjs';
2
+ import { input, inject, TemplateRef, computed, signal, linkedSignal, Directive, ElementRef, effect, output, contentChildren, NgZone, Component, HostBinding, NgModule } from '@angular/core';
5
3
  import { SciSplitterComponent } from '@scion/components/splitter';
6
- import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
4
+ import { NgTemplateOutlet } from '@angular/common';
7
5
 
8
6
  /**
9
7
  * Allows accessing the sashbox component from sashes.
@@ -42,114 +40,145 @@ class SciSashBoxAccessor {
42
40
  class SciSashDirective {
43
41
  /**
44
42
  * Specifies the sash size, either as fixed size with an explicit unit,
45
- * or as a unitless proportion to distibute remaining space. A proportional
43
+ * or as a unitless proportion to distribute remaining space. A proportional
46
44
  * sash has the ability to grow or shrink if necessary, and must be >= 1.
47
45
  *
48
46
  * If not set, remaining space is distributed equally.
49
47
  */
50
- set size(size) {
51
- this._size = size ?? '1';
52
- }
53
- get size() {
54
- return this._size;
55
- }
48
+ size = input('1', { transform: (size) => size ?? '1' });
49
+ /**
50
+ * Specifies the minimal sash size in pixel or percent.
51
+ * The min-size prevents the user from shrinking the sash below this minimal size.
52
+ *
53
+ * If the unit is omitted, the value is interpreted as a pixel value.
54
+ */
55
+ minSize = input();
56
56
  /**
57
+ * Optional key to identify this sash.
58
+ *
59
+ * If set, this key is used as the property key in the object emitted by {@link SciSashboxComponent.sashEnd2} to associate the size of this sash.
60
+ */
61
+ key = input();
62
+ /**
63
+ * Represents the template used as sash content.
64
+ *
57
65
  * @internal
58
66
  */
59
- set flexGrow(flexGrow) {
60
- this._flexGrow$.next(flexGrow);
61
- }
67
+ sashTemplate = inject(TemplateRef);
68
+ _sashBoxAccessor = inject(SciSashBoxAccessor);
62
69
  /**
70
+ * Flex properties computed based on the configured {@link size}. Properties are updated when moving this sash.
71
+ */
72
+ _flexProperties = this.computeFlexProperties();
73
+ /**
74
+ * Flex properties with normalized 'flex-grow' to ensure the sashes fill the entire sash-box space.
75
+ *
76
+ * Use these properties to lay out this sash in the sashbox's flex layout.
77
+ *
63
78
  * @internal
64
79
  */
65
- get flexGrow() {
66
- return this._flexGrow$.value;
67
- }
68
- constructor(sashTemplate, _sashBoxAccessor) {
69
- this.sashTemplate = sashTemplate;
70
- this._sashBoxAccessor = _sashBoxAccessor;
71
- this._size = '1';
72
- this._flexGrow$ = new BehaviorSubject(0);
73
- this.flexGrowNormalized$ = this._sashBoxAccessor.sashes$
74
- .pipe(switchMap(sashes => merge(...sashes.map(sash => sash._flexGrow$))), map(() => this.normalizeFlexGrow(this.flexGrow)));
75
- }
76
- ngOnInit() {
77
- this.setFlexItemProperties();
78
- }
79
- ngOnChanges(changes) {
80
- this.setFlexItemProperties();
80
+ flexProperties = this.normalizeFlexGrow(this._flexProperties);
81
+ /**
82
+ * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink.
83
+ *
84
+ * @internal
85
+ */
86
+ isFixedSize = computed(() => Number.isNaN(+this.size()));
87
+ /**
88
+ * Gets the DOM element that renders this sash.
89
+ *
90
+ * @internal
91
+ */
92
+ element = signal(undefined);
93
+ /**
94
+ * Gets the effective size of this sash in the DOM.
95
+ *
96
+ * @internal
97
+ */
98
+ get elementSize() {
99
+ const element = this.element();
100
+ if (!element) {
101
+ return 0;
102
+ }
103
+ if (this._sashBoxAccessor.direction() === 'row') {
104
+ return element.getBoundingClientRect().width;
105
+ }
106
+ else {
107
+ return element.getBoundingClientRect().height;
108
+ }
81
109
  }
82
110
  /**
83
- * Returns if this sash has a fixed size, meaning that it has not the ability to grow or shrink if necessary.
111
+ * Returns the identity of this sash, or the passed index if not configured.
84
112
  *
85
113
  * @internal
86
114
  */
87
- get isFixedSize() {
88
- return Number.isNaN(+this.size);
115
+ computeKey(index) {
116
+ return this.key() ?? `${index}`;
89
117
  }
90
118
  /**
91
- * Returns the effective sash size as rendered in the DOM.
119
+ * Updates the flex properties of this sash for layout in the sashbox's flex layout.
92
120
  *
93
121
  * @internal
94
122
  */
95
- get computedSize() {
96
- // Note: Use `boundingClientRect` to get the fractional size.
97
- // see https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth
98
- return this._sashBoxAccessor.direction === 'row' ? this.element.getBoundingClientRect().width : this.element.getBoundingClientRect().height;
123
+ updateFlexProperties(flexProperties) {
124
+ this._flexProperties.update(previousFlexProperties => ({ ...previousFlexProperties, ...flexProperties }));
99
125
  }
100
126
  /**
101
- * Computes and sets the flex item properties based on the modelled size.
127
+ * Computes the flex properties to lay out this sash in the sashbox's flex layout based on the configured {@link size}.
102
128
  */
103
- setFlexItemProperties() {
104
- if (this.isFixedSize) {
105
- // fixed-sized sash
106
- this.flexGrow = 0;
107
- this.flexShrink = 0;
108
- this.flexBasis = `${this.size}`;
109
- }
110
- else {
111
- // remaining space is distributed according to given proportion
112
- const proportion = +this.size;
113
- if (proportion < 1) {
114
- throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size}]`);
129
+ computeFlexProperties() {
130
+ return linkedSignal(() => {
131
+ const size = this.size();
132
+ if (this.isFixedSize()) {
133
+ // fixed-sized sash
134
+ return {
135
+ flexGrow: 0,
136
+ flexShrink: 0,
137
+ flexBasis: `${size}`,
138
+ };
115
139
  }
116
- this.flexGrow = proportion;
117
- this.flexShrink = 1;
118
- this.flexBasis = '0';
119
- }
140
+ else {
141
+ // remaining space is distributed according to given proportion
142
+ const proportion = +size;
143
+ if (proportion < 1) {
144
+ throw Error(`[IllegalSashSizeError] The proportion for flexible sized sashes must be >=1 [size=${this.size()}]`);
145
+ }
146
+ return {
147
+ flexGrow: proportion,
148
+ flexShrink: 1,
149
+ flexBasis: '0',
150
+ };
151
+ }
152
+ });
120
153
  }
121
154
  /**
122
- * Computes the normalized flex-grow proportion of the given sash, which is a value >= 1.
155
+ * Normalizes the 'flex-grow' of the passed {@link FlexProperties} to ensure that the sum of the 'flex-grow' proportions of all sashes is 1.
123
156
  *
124
- * If the sum of all flex-grow proportions would be less than 1, then, the sashes would not fill the entire sash-box space.
125
- * Without normalization in place, e.g., this could happen when removing a sash.
157
+ * If the sum of all flex-grow proportions were less than 1, the sashes would not fill the entire sash-box space.
158
+ * Without normalization, this could occur when a sash is removed.
126
159
  */
127
- normalizeFlexGrow(flexGrow) {
128
- if (flexGrow === 0) {
129
- return 0;
130
- }
131
- const sashes = this._sashBoxAccessor.sashes;
132
- const flexGrowSum = sashes.reduce((sum, sash) => sum + sash.flexGrow, 0);
133
- if (flexGrowSum === 0) {
134
- return 0;
135
- }
136
- return flexGrow / flexGrowSum;
160
+ normalizeFlexGrow(flexProperties) {
161
+ return computed(() => {
162
+ const sashes = this._sashBoxAccessor.sashes();
163
+ const { flexGrow, flexShrink, flexBasis } = flexProperties();
164
+ const flexGrowSum = sashes.reduce((sum, sash) => sum + sash._flexProperties().flexGrow, 0);
165
+ return {
166
+ flexGrow: flexGrow === 0 || flexGrowSum === 0 ? 0 : flexGrow / flexGrowSum, // Sum of normalized flex-grow proportions must be 1;
167
+ flexShrink,
168
+ flexBasis,
169
+ };
170
+ });
137
171
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashDirective, deps: [{ token: i0.TemplateRef }, { token: SciSashBoxAccessor }], target: i0.ɵɵFactoryTarget.Directive }); }
139
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: SciSashDirective, isStandalone: true, selector: "ng-template[sciSash]", inputs: { size: "size", minSize: "minSize" }, exportAs: ["sciSash"], usesOnChanges: true, ngImport: i0 }); }
172
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
173
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", 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 } }, exportAs: ["sciSash"], ngImport: i0 });
140
174
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashDirective, decorators: [{
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashDirective, decorators: [{
142
176
  type: Directive,
143
177
  args: [{
144
178
  selector: 'ng-template[sciSash]',
145
179
  exportAs: 'sciSash',
146
- standalone: true,
147
180
  }]
148
- }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: SciSashBoxAccessor }], propDecorators: { size: [{
149
- type: Input
150
- }], minSize: [{
151
- type: Input
152
- }] } });
181
+ }] });
153
182
 
154
183
  /*
155
184
  * Copyright (c) 2018-2019 Swiss Federal Railways
@@ -164,25 +193,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
164
193
  * Initializes {SashDirective} with the target {HTMLDivElement}.
165
194
  */
166
195
  class SciSashInitializerDirective {
167
- constructor(_host) {
168
- this._host = _host;
169
- }
170
- ngOnChanges(changes) {
171
- this.sash.element = this._host.nativeElement;
196
+ sash = input.required({ alias: 'sciSashInitializer' });
197
+ constructor() {
198
+ const host = inject(ElementRef).nativeElement;
199
+ effect(() => this.sash().element.set(host));
172
200
  }
173
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashInitializerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
174
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: SciSashInitializerDirective, isStandalone: true, selector: "div[sciSashInitializer].sash", inputs: { sash: ["sciSashInitializer", "sash"] }, usesOnChanges: true, ngImport: i0 }); }
201
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashInitializerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
202
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: SciSashInitializerDirective, isStandalone: true, selector: "div[sciSashInitializer].sash", inputs: { sash: { classPropertyName: "sash", publicName: "sciSashInitializer", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
175
203
  }
176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashInitializerDirective, decorators: [{
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashInitializerDirective, decorators: [{
177
205
  type: Directive,
178
206
  args: [{
179
207
  selector: 'div[sciSashInitializer].sash',
180
- standalone: true,
181
208
  }]
182
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { sash: [{
183
- type: Input,
184
- args: [{ alias: 'sciSashInitializer', required: true }]
185
- }] } });
209
+ }], ctorParameters: () => [] });
186
210
 
187
211
  /*
188
212
  * Copyright (c) 2018-2019 Swiss Federal Railways
@@ -197,21 +221,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
197
221
  * Provides access to the native {@link HTMLElement} of the host.
198
222
  */
199
223
  class SciElementRefDirective {
200
- constructor(host) {
201
- this.host = host;
202
- this.nativeElement = host.nativeElement;
203
- }
204
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciElementRefDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
205
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: SciElementRefDirective, isStandalone: true, selector: "[sciElementRef]", exportAs: ["sciElementRef"], ngImport: i0 }); }
224
+ host = inject(ElementRef).nativeElement;
225
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciElementRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
226
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: SciElementRefDirective, isStandalone: true, selector: "[sciElementRef]", exportAs: ["sciElementRef"], ngImport: i0 });
206
227
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciElementRefDirective, decorators: [{
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciElementRefDirective, decorators: [{
208
229
  type: Directive,
209
230
  args: [{
210
231
  selector: '[sciElementRef]',
211
232
  exportAs: 'sciElementRef',
212
- standalone: true,
213
233
  }]
214
- }], ctorParameters: () => [{ type: i0.ElementRef }] });
234
+ }] });
215
235
 
216
236
  /*
217
237
  * Copyright (c) 2018-2019 Swiss Federal Railways
@@ -227,10 +247,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
227
247
  * or column arrangement (as specified by the direction property). A splitter is added between each child to allow the user to
228
248
  * shrink or stretch the individual sashes.
229
249
  *
230
- * Sashes are modelled as content children inside a <ng-template> decorated with the 'sciSash' directive.
231
- * A sash can have a fixed size with an explicit unit, or a unitless proportion to distibute remaining space.
250
+ * Sashes are modelled as <ng-template> decorated with the 'sciSash' directive.
251
+ * A sash can have a fixed size with an explicit unit, or a unitless proportion to distribute remaining space.
232
252
  * A proportional sash has the ability to grow or shrink if necessary.
233
253
  *
254
+ * Sash content is added to a CSS grid container with a single column, stretching the content vertically and horizontally.
234
255
  *
235
256
  * ### Usage
236
257
  *
@@ -276,33 +297,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
276
297
  * ```
277
298
  */
278
299
  class SciSashboxComponent {
279
- constructor() {
280
- this._destroy$ = new Subject();
281
- this._host = inject((ElementRef)).nativeElement;
282
- this._zone = inject(NgZone);
283
- this.sashes$ = new BehaviorSubject([]);
284
- this.sashing = false;
285
- /**
286
- * Specifies if to lay out sashes in a row (which is by default) or column arrangement.
287
- */
288
- this.direction = 'row';
289
- /**
290
- * Emits when start sashing.
291
- */
292
- this.sashStart = new EventEmitter();
293
- /**
294
- * Emits the absolute sash sizes (px) when finished sashing.
295
- */
296
- this.sashEnd = new EventEmitter();
297
- }
300
+ /**
301
+ * Specifies if to lay out sashes in a row (which is by default) or column arrangement.
302
+ */
303
+ direction = input('row');
304
+ /**
305
+ * Notifies when start sashing.
306
+ */
307
+ sashStart = output();
308
+ /**
309
+ * Emits an array with new sash sizes when sashing ends.
310
+ *
311
+ * The array contains the sash sizes in display order.
312
+ *
313
+ * TODO [Angular 20] BREAKING CHANGE: Change signature from `number[]` to `{[key: string]: number}` and remove {@link sashEnd2}.
314
+ */
315
+ sashEnd = output();
316
+ /**
317
+ * Emits an object with new sash sizes when sashing ends.
318
+ *
319
+ * Each sash size is associated with its {@link SciSashDirective.key} or its display position (zero-based) if not set.
320
+ *
321
+ * Note: This output will be renamed to `sashEnd` in version 20, changing the signature of {@link sashEnd} from `number[]` to `{[key: string]: number}`.
322
+ *
323
+ * TODO [Angular 20] BREAKING CHANGE: Replace with {@link sashEnd}.
324
+ */
325
+ sashEnd2 = output();
326
+ _host = inject(ElementRef).nativeElement;
298
327
  /** @internal */
299
- set setSashes(queryList) {
300
- queryList.changes
301
- .pipe(startWith(queryList), takeUntil(this._destroy$))
302
- .subscribe((sashes) => {
303
- this.sashes$.next(sashes.toArray());
304
- });
305
- }
328
+ sashes = contentChildren(SciSashDirective);
329
+ sashing = false;
330
+ maxHeight;
331
+ maxWidth;
306
332
  onSashStart() {
307
333
  this.sashing = true;
308
334
  // Avoid overflow when sashing.
@@ -310,12 +336,14 @@ class SciSashboxComponent {
310
336
  this.maxHeight = hostBounds.height;
311
337
  this.maxWidth = hostBounds.width;
312
338
  this.sashStart.emit();
313
- // set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas)
314
- this.sashes.forEach(sash => {
315
- if (!sash.isFixedSize) {
316
- sash.flexGrow = 0;
317
- sash.flexShrink = 1;
318
- sash.flexBasis = `${sash.computedSize}px`;
339
+ // Set the effective sash size as the flex-basis for non-fixed sashes (as sashing operates on pixel deltas).
340
+ this.sashes().forEach(sash => {
341
+ if (!sash.isFixedSize()) {
342
+ sash.updateFlexProperties({
343
+ flexGrow: 0,
344
+ flexShrink: 1,
345
+ flexBasis: `${sash.elementSize}px`,
346
+ });
319
347
  }
320
348
  });
321
349
  }
@@ -323,86 +351,80 @@ class SciSashboxComponent {
323
351
  this.sashing = false;
324
352
  this.maxHeight = undefined;
325
353
  this.maxWidth = undefined;
326
- // unset the flex-basis for non-fixed sashes and set the flex-grow accordingly
327
- const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);
328
- const absoluteSashSizes = this.sashes.map(sash => sash.computedSize);
329
- this.sashes.forEach((sash, i) => {
330
- if (!sash.isFixedSize) {
331
- sash.flexGrow = pixelToFlexGrowFactor * absoluteSashSizes[i];
332
- sash.flexShrink = 1;
333
- sash.flexBasis = '0';
354
+ // Unset the flex-basis for non-fixed sashes and set the flex-grow accordingly.
355
+ const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());
356
+ const sashSizes = this.sashes().reduce((acc, sash, i) => acc.set(sash.computeKey(i), sash.elementSize), new Map());
357
+ this.sashes().forEach((sash, i) => {
358
+ if (!sash.isFixedSize()) {
359
+ sash.updateFlexProperties({
360
+ flexGrow: pixelToFlexGrowFactor * sashSizes.get(sash.computeKey(i)),
361
+ flexShrink: 1,
362
+ flexBasis: '0',
363
+ });
334
364
  }
335
365
  });
336
- this.sashEnd.emit(absoluteSashSizes);
366
+ this.sashEnd.emit(Array.from(sashSizes.values()));
367
+ this.sashEnd2.emit(Object.fromEntries(sashSizes));
337
368
  }
338
369
  onSash(splitter, sashIndex, moveEvent) {
370
+ NgZone.assertNotInAngularZone();
339
371
  const distance = moveEvent.distance;
340
372
  if (distance === 0) {
341
373
  return;
342
374
  }
343
- NgZone.assertNotInAngularZone();
344
- // compute the splitter position
375
+ // Compute the splitter position.
345
376
  const splitterRect = splitter.getBoundingClientRect();
346
377
  const splitterStart = (this.isRowDirection ? splitterRect.left : splitterRect.top);
347
378
  const splitterEnd = (this.isRowDirection ? splitterRect.left + splitterRect.width : splitterRect.top + splitterRect.height);
348
- // ignore the event if outside of the splitter's action scope
379
+ // Ignore the event if outside the splitter's action scope.
349
380
  const eventPos = moveEvent.position.clientPos;
350
- // 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.
381
+ // 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.
351
382
  if (distance > 0 && eventPos < splitterStart) {
352
383
  return;
353
384
  }
354
- // 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.
385
+ // 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.
355
386
  if (distance < 0 && eventPos > splitterEnd) {
356
387
  return;
357
388
  }
358
- // compute the new sash sizes
359
- const sash1 = this.sashes[sashIndex];
360
- const sash2 = this.sashes[sashIndex + 1];
361
- const sashSize1 = sash1.computedSize;
362
- const sashSize2 = sash2.computedSize;
363
- const sashMinSize1 = sash1.minSize ? this.toPixel(sash1.minSize) : 0;
364
- const sashMinSize2 = sash2.minSize ? this.toPixel(sash2.minSize) : 0;
389
+ // Compute the new sash sizes.
390
+ const sash1 = this.sashes()[sashIndex];
391
+ const sash2 = this.sashes()[sashIndex + 1];
392
+ const sashSize1 = sash1.elementSize;
393
+ const sashSize2 = sash2.elementSize;
394
+ const sashMinSize1 = sash1.minSize() ? this.toPixel(sash1.minSize()) : 0;
395
+ const sashMinSize2 = sash2.minSize() ? this.toPixel(sash2.minSize()) : 0;
365
396
  const newSashSize1 = between(Math.round(sashSize1 + distance), { min: sashMinSize1, max: sashSize1 + sashSize2 - sashMinSize2 });
366
397
  const newSashSize2 = between(Math.round(sashSize2 - distance), { min: sashMinSize2, max: sashSize1 + sashSize2 - sashMinSize1 });
367
- // set the new computed sash sizes
368
- this._zone.run(() => {
369
- sash1.flexBasis = `${newSashSize1}px`;
370
- sash2.flexBasis = `${newSashSize2}px`;
371
- });
398
+ // Set the new computed sash sizes.
399
+ sash1.updateFlexProperties({ flexBasis: `${newSashSize1}px` });
400
+ sash2.updateFlexProperties({ flexBasis: `${newSashSize2}px` });
372
401
  }
373
402
  onSashReset(sashIndex) {
374
- const sash1 = this.sashes[sashIndex];
375
- const sash2 = this.sashes[sashIndex + 1];
376
- const equalSashSize = (sash1.computedSize + sash2.computedSize) / 2;
377
- const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes);
378
- const absoluteSashSizesAfterReset = this.sashes.map((sash, index) => {
379
- if (index === sashIndex || index === sashIndex + 1) {
380
- return equalSashSize;
381
- }
382
- return sash.computedSize;
383
- });
403
+ const sash1 = this.sashes()[sashIndex];
404
+ const sash2 = this.sashes()[sashIndex + 1];
405
+ const equalSashSize = (sash1.elementSize + sash2.elementSize) / 2;
406
+ const pixelToFlexGrowFactor = computePixelToFlexGrowFactor(this.sashes());
407
+ const sashSizesAfterReset = this.sashes().reduce((acc, sash, index) => {
408
+ const size = index === sashIndex || index === sashIndex + 1 ? equalSashSize : sash.elementSize;
409
+ return acc.set(sash.computeKey(index), size);
410
+ }, new Map());
384
411
  [sash1, sash2].forEach(sash => {
385
- if (sash.isFixedSize) {
386
- sash.flexBasis = `${equalSashSize}px`;
412
+ if (sash.isFixedSize()) {
413
+ sash.updateFlexProperties({ flexBasis: `${equalSashSize}px` });
387
414
  }
388
415
  else {
389
- sash.flexGrow = pixelToFlexGrowFactor * equalSashSize;
416
+ sash.updateFlexProperties({ flexGrow: pixelToFlexGrowFactor * equalSashSize });
390
417
  }
391
418
  });
392
419
  this.sashStart.emit();
393
- this.sashEnd.emit(absoluteSashSizesAfterReset);
420
+ this.sashEnd.emit(Array.from(sashSizesAfterReset.values()));
421
+ this.sashEnd2.emit(Object.fromEntries(sashSizesAfterReset));
394
422
  }
395
423
  get isColumnDirection() {
396
- return this.direction === 'column';
424
+ return this.direction() === 'column';
397
425
  }
398
426
  get isRowDirection() {
399
- return this.direction === 'row';
400
- }
401
- get sashes() {
402
- return this.sashes$.value;
403
- }
404
- ngOnDestroy() {
405
- this._destroy$.next();
427
+ return this.direction() === 'row';
406
428
  }
407
429
  toPixel(value) {
408
430
  if (typeof value === 'number') {
@@ -415,16 +437,15 @@ class SciSashboxComponent {
415
437
  }
416
438
  return parseInt(value, 10);
417
439
  }
418
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
419
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: SciSashboxComponent, isStandalone: true, selector: "sci-sashbox", inputs: { direction: "direction" }, outputs: { sashStart: "sashStart", sashEnd: "sashEnd" }, host: { properties: { "class.sashing": "this.sashing", "style.--\u0275sci-sashbox-max-height": "this.maxHeight", "style.--\u0275sci-sashbox-max-width": "this.maxWidth", "class.column": "this.isColumnDirection", "class.row": "this.isRowDirection" } }, providers: [{
440
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
441
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: SciSashboxComponent, isStandalone: true, selector: "sci-sashbox", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sashStart: "sashStart", sashEnd: "sashEnd", sashEnd2: "sashEnd2" }, host: { properties: { "class.sashing": "this.sashing", "style.--\u0275sci-sashbox-max-height": "this.maxHeight", "style.--\u0275sci-sashbox-max-width": "this.maxWidth", "class.column": "this.isColumnDirection", "class.row": "this.isRowDirection" } }, providers: [{
420
442
  provide: SciSashBoxAccessor,
421
443
  useFactory: provideSashBoxAccessor,
422
- }], queries: [{ propertyName: "setSashes", predicate: SciSashDirective }], ngImport: i0, template: "@for (sash of sashes$ | async; track sash; let i = $index; let first = $first; let last = $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\"/>\n </div>\n @if (!last) {\n <sci-splitter 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 }\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.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{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>div.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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SciSashInitializerDirective, selector: "div[sciSashInitializer].sash", inputs: ["sciSashInitializer"] }, { kind: "component", type: SciSplitterComponent, selector: "sci-splitter", inputs: ["orientation"], outputs: ["start", "move", "end", "reset"] }, { kind: "directive", type: SciElementRefDirective, selector: "[sciElementRef]", exportAs: ["sciElementRef"] }] }); }
444
+ }], queries: [{ propertyName: "sashes", predicate: SciSashDirective, isSignal: true }], ngImport: i0, template: "@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <div class=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [sciSashInitializer]=\"sash\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\">\n <ng-container *ngTemplateOutlet=\"sash.sashTemplate\"/>\n </div>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"isRowDirection ? '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.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{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>div.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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SciSashInitializerDirective, selector: "div[sciSashInitializer].sash", inputs: ["sciSashInitializer"] }, { kind: "component", type: SciSplitterComponent, selector: "sci-splitter", inputs: ["orientation"], outputs: ["start", "move", "end", "reset"] }, { kind: "directive", type: SciElementRefDirective, selector: "[sciElementRef]", exportAs: ["sciElementRef"] }] });
423
445
  }
424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxComponent, decorators: [{
446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxComponent, decorators: [{
425
447
  type: Component,
426
- args: [{ selector: 'sci-sashbox', standalone: true, imports: [
427
- AsyncPipe,
448
+ args: [{ selector: 'sci-sashbox', imports: [
428
449
  NgTemplateOutlet,
429
450
  SciSashInitializerDirective,
430
451
  SciSplitterComponent,
@@ -432,7 +453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
432
453
  ], providers: [{
433
454
  provide: SciSashBoxAccessor,
434
455
  useFactory: provideSashBoxAccessor,
435
- }], template: "@for (sash of sashes$ | async; track sash; let i = $index; let first = $first; let last = $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\"/>\n </div>\n @if (!last) {\n <sci-splitter 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 }\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.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{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>div.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"] }]
456
+ }], template: "@for (sash of sashes(); track sash; let i = $index; let first = $first; let last = $last) {\n <div class=\"sash\"\n [class.first]=\"first\"\n [class.last]=\"last\"\n [sciSashInitializer]=\"sash\"\n [style.flex-grow]=\"sash.flexProperties().flexGrow\"\n [style.flex-shrink]=\"sash.flexProperties().flexShrink\"\n [style.flex-basis]=\"sash.flexProperties().flexBasis\">\n <ng-container *ngTemplateOutlet=\"sash.sashTemplate\"/>\n </div>\n @if (!last) {\n <sci-splitter sciElementRef #sciElementRef=\"sciElementRef\"\n [orientation]=\"isRowDirection ? '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.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{max-height:calc(var(--\\275sci-sashbox-max-height) * 1px);max-width:calc(var(--\\275sci-sashbox-max-width) * 1px)}:host.sashing>div.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"] }]
436
457
  }], propDecorators: { sashing: [{
437
458
  type: HostBinding,
438
459
  args: ['class.sashing']
@@ -442,15 +463,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
442
463
  }], maxWidth: [{
443
464
  type: HostBinding,
444
465
  args: ['style.--ɵsci-sashbox-max-width']
445
- }], direction: [{
446
- type: Input
447
- }], sashStart: [{
448
- type: Output
449
- }], sashEnd: [{
450
- type: Output
451
- }], setSashes: [{
452
- type: ContentChildren,
453
- args: [SciSashDirective]
454
466
  }], isColumnDirection: [{
455
467
  type: HostBinding,
456
468
  args: ['class.column']
@@ -465,24 +477,17 @@ function between(value, minmax) {
465
477
  * Returns the factor to compute the flex-grow proportion from the pixel size of a sash.
466
478
  */
467
479
  function computePixelToFlexGrowFactor(sashes) {
468
- const flexibleSashes = sashes.filter(sash => !sash.isFixedSize);
469
- const proportionSum = flexibleSashes.reduce((sum, sash) => sum + Number(sash.size), 0);
470
- const pixelSum = flexibleSashes.reduce((sum, sash) => sum + sash.computedSize, 0);
480
+ const flexibleSashes = sashes.filter(sash => !sash.isFixedSize());
481
+ const proportionSum = flexibleSashes.reduce((sum, sash) => sum + Number(sash.size()), 0);
482
+ const pixelSum = flexibleSashes.reduce((sum, sash) => sum + sash.elementSize, 0);
471
483
  return proportionSum / pixelSum;
472
484
  }
473
485
  function provideSashBoxAccessor() {
474
486
  const component = inject(SciSashboxComponent);
475
487
  return new class {
476
- get direction() {
477
- return component.direction;
478
- }
479
- get sashes$() {
480
- return component.sashes$;
481
- }
482
- get sashes() {
483
- return component.sashes$.value;
484
- }
485
- };
488
+ direction = component.direction;
489
+ sashes = component.sashes;
490
+ }();
486
491
  }
487
492
 
488
493
  /*
@@ -514,15 +519,17 @@ function provideSashBoxAccessor() {
514
519
  * </ng-template>
515
520
  * </sci-sashbox>
516
521
  * ```
522
+ *
523
+ * @deprecated since version 19.0.0; Import standalone component and directive instead; API will be removed in a future release.
517
524
  */
518
525
  class SciSashboxModule {
519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
520
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxModule, imports: [SciSashboxComponent,
526
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
527
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxModule, imports: [SciSashboxComponent,
521
528
  SciSashDirective], exports: [SciSashboxComponent,
522
- SciSashDirective] }); }
523
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxModule, imports: [SciSashboxComponent] }); }
529
+ SciSashDirective] });
530
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxModule, imports: [SciSashboxComponent] });
524
531
  }
525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SciSashboxModule, decorators: [{
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SciSashboxModule, decorators: [{
526
533
  type: NgModule,
527
534
  args: [{
528
535
  imports: [