@progress/kendo-angular-layout 17.0.0-develop.10 → 17.0.0-develop.12

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.
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-layout',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1729175986,
13
- version: '17.0.0-develop.10',
12
+ publishDate: 1729256670,
13
+ version: '17.0.0-develop.12',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -5,7 +5,7 @@
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
6
  import { ChangeDetectorRef, Component, ElementRef, Host, HostBinding, Input, Renderer2 } from '@angular/core';
7
7
  import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { DraggableDirective, Keys } from '@progress/kendo-angular-common';
8
+ import { DraggableDirective, Keys, isObjectPresent, parseAttributes, removeHTMLAttributes, setHTMLAttributes } from '@progress/kendo-angular-common';
9
9
  import { SplitterService } from './splitter.service';
10
10
  import { Subscription, of } from 'rxjs';
11
11
  import { delay, filter, map, switchMap, takeUntil, tap } from 'rxjs/operators';
@@ -42,10 +42,12 @@ export class SplitterBarComponent {
42
42
  this.renderer = renderer;
43
43
  this.cdr = cdr;
44
44
  this.ariaRole = 'separator';
45
+ this.ariaLabel = 'Splitter pane';
45
46
  this.focused = false;
46
47
  this.orientation = 'horizontal';
47
48
  this.index = 0;
48
49
  this.subscriptions = new Subscription();
50
+ this.parsedAttributes = {};
49
51
  }
50
52
  get hostOrientation() {
51
53
  return this.orientation === 'horizontal' ? 'vertical' : 'horizontal';
@@ -72,6 +74,28 @@ export class SplitterBarComponent {
72
74
  get order() {
73
75
  return 2 * this.index + 1;
74
76
  }
77
+ set htmlAttributes(attributes) {
78
+ if (isObjectPresent(this.parsedAttributes)) {
79
+ removeHTMLAttributes(this.parsedAttributes, this.renderer, this.element.nativeElement);
80
+ }
81
+ this._htmlAttributes = attributes;
82
+ this.parsedAttributes = this.htmlAttributes ?
83
+ parseAttributes(this.htmlAttributes, this.defaultAttributes) :
84
+ this.htmlAttributes;
85
+ this.setHtmlAttributes();
86
+ }
87
+ get htmlAttributes() {
88
+ return this._htmlAttributes;
89
+ }
90
+ get defaultAttributes() {
91
+ return {
92
+ 'aria-orientation': this.hostOrientation,
93
+ role: this.ariaRole
94
+ };
95
+ }
96
+ get mutableAttributes() {
97
+ return { 'tabindex': this.tabIndex };
98
+ }
75
99
  ngOnInit() {
76
100
  let state;
77
101
  const listener = this.draggable.kendoPress.pipe(tap(stopPropagation), filter(() => this.splitterService.isDraggable(this.index)), tap(() => state = this.splitterService.dragState(this.index)), tap(() => this.splitterService.toggleContentOverlay(this.index, true)), switchMap(preventOnDblClick(this.draggable.kendoRelease)), switchMap(createMoveStream(this.draggable))).subscribe(({ pageX, pageY, originalX, originalY }) => {
@@ -218,9 +242,13 @@ export class SplitterBarComponent {
218
242
  this.splitterService.tryToggle(next);
219
243
  }
220
244
  }
245
+ setHtmlAttributes() {
246
+ const attributesToRender = { ...this.mutableAttributes, ...this.parsedAttributes };
247
+ setHTMLAttributes(attributesToRender, this.renderer, this.element.nativeElement);
248
+ }
221
249
  }
222
250
  SplitterBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterBarComponent, deps: [{ token: i1.DraggableDirective, host: true }, { token: i2.LocalizationService }, { token: i3.SplitterService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
223
- SplitterBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterBarComponent, isStandalone: true, selector: "kendo-splitter-bar", inputs: { orientation: "orientation", index: "index" }, host: { properties: { "attr.role": "this.ariaRole", "class.k-focus": "this.focused", "attr.aria-orientation": "this.hostOrientation", "attr.tabindex": "this.tabIndex", "class": "this.hostClasses", "style.-ms-flex-order": "this.order", "style.order": "this.order" } }, ngImport: i0, template: `
251
+ SplitterBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterBarComponent, isStandalone: true, selector: "kendo-splitter-bar", inputs: { orientation: "orientation", index: "index", htmlAttributes: "htmlAttributes" }, host: { properties: { "attr.role": "this.ariaRole", "attr.aria-label": "this.ariaLabel", "class.k-focus": "this.focused", "attr.aria-orientation": "this.hostOrientation", "attr.tabindex": "this.tabIndex", "class": "this.hostClasses", "style.-ms-flex-order": "this.order", "style.order": "this.order" } }, ngImport: i0, template: `
224
252
  <div *ngIf="shouldShowIcon('prev')" class="k-collapse-prev" (click)="togglePrevious()">
225
253
  <kendo-icon-wrapper
226
254
  size="xsmall"
@@ -266,6 +294,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
266
294
  }] }, { type: i2.LocalizationService }, { type: i3.SplitterService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { ariaRole: [{
267
295
  type: HostBinding,
268
296
  args: ['attr.role']
297
+ }], ariaLabel: [{
298
+ type: HostBinding,
299
+ args: ['attr.aria-label']
269
300
  }], focused: [{
270
301
  type: HostBinding,
271
302
  args: ['class.k-focus']
@@ -288,4 +319,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
288
319
  type: Input
289
320
  }], index: [{
290
321
  type: Input
322
+ }], htmlAttributes: [{
323
+ type: Input
291
324
  }] } });
@@ -4,19 +4,18 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Renderer2, Input, Output } from '@angular/core';
6
6
  import { NgIf } from '@angular/common';
7
+ import { SplitterService } from './splitter.service';
7
8
  import * as i0 from "@angular/core";
9
+ import * as i1 from "./splitter.service";
8
10
  /**
9
11
  * Represents the pane component of the Splitter.
10
12
  */
11
13
  export class SplitterPaneComponent {
12
- constructor(element, renderer, cdr) {
14
+ constructor(element, renderer, cdr, splitterService) {
13
15
  this.element = element;
14
16
  this.renderer = renderer;
15
17
  this.cdr = cdr;
16
- /**
17
- * The value of the aria-label attribute of the auxiliary separator.
18
- */
19
- this.separatorLabel = 'Splitter pane';
18
+ this.splitterService = splitterService;
20
19
  /**
21
20
  * Specifies if the user is allowed to resize the pane and provide space for other panes.
22
21
  */
@@ -81,29 +80,42 @@ export class SplitterPaneComponent {
81
80
  */
82
81
  set size(newSize) {
83
82
  this._size = newSize;
84
- const element = this.element.nativeElement;
85
- this.renderer.setStyle(element, '-ms-flex-preferred-size', newSize);
86
- this.renderer.setStyle(element, 'flex-basis', newSize);
83
+ this.renderer.setStyle(this.nativeElement, '-ms-flex-preferred-size', newSize);
84
+ this.renderer.setStyle(this.nativeElement, 'flex-basis', newSize);
87
85
  if (this.staticPaneClass) {
88
- this.renderer.addClass(element, 'k-pane-static');
86
+ this.renderer.addClass(this.nativeElement, 'k-pane-static');
89
87
  }
90
88
  else {
91
- this.renderer.removeClass(element, 'k-pane-static');
89
+ this.renderer.removeClass(this.nativeElement, 'k-pane-static');
92
90
  }
93
91
  }
94
92
  get size() {
95
93
  return this._size;
96
94
  }
95
+ /**
96
+ * Sets the HTML attributes of the splitter bar.
97
+ * The property accepts string key-value based pairs.
98
+ * Attributes which are essential for certain functionalities cannot be changed.
99
+ */
100
+ set splitterBarAttributes(attributes) {
101
+ this._splitterBarAttributes = attributes;
102
+ const splitterBar = this.splitterService.getPaneSplitterBar(this);
103
+ if (splitterBar) {
104
+ splitterBar.htmlAttributes = attributes;
105
+ }
106
+ }
107
+ get splitterBarAttributes() {
108
+ return this._splitterBarAttributes;
109
+ }
97
110
  /**
98
111
  * @hidden
99
112
  */
100
113
  set containsSplitter(value) {
101
- const element = this.element.nativeElement;
102
114
  if (value) {
103
- this.renderer.addClass(element, 'k-pane-flex');
115
+ this.renderer.addClass(this.nativeElement, 'k-pane-flex');
104
116
  }
105
117
  else {
106
- this.renderer.removeClass(element, 'k-pane-flex');
118
+ this.renderer.removeClass(this.nativeElement, 'k-pane-flex');
107
119
  }
108
120
  }
109
121
  get isHidden() {
@@ -122,14 +134,13 @@ export class SplitterPaneComponent {
122
134
  return this.size && this.size.length > 0;
123
135
  }
124
136
  ngAfterViewChecked() {
125
- const element = this.element.nativeElement;
126
137
  if (this.isHidden) {
127
- this.renderer.addClass(element, 'k-hidden');
128
- this.renderer.addClass(element, 'hidden');
138
+ this.renderer.addClass(this.nativeElement, 'k-hidden');
139
+ this.renderer.addClass(this.nativeElement, 'hidden');
129
140
  }
130
141
  else {
131
- this.renderer.removeClass(element, 'k-hidden');
132
- this.renderer.removeClass(element, 'hidden');
142
+ this.renderer.removeClass(this.nativeElement, 'k-hidden');
143
+ this.renderer.removeClass(this.nativeElement, 'hidden');
133
144
  }
134
145
  }
135
146
  /**
@@ -137,12 +148,18 @@ export class SplitterPaneComponent {
137
148
  */
138
149
  get computedSize() {
139
150
  if (this.orientation === 'vertical') {
140
- return this.element.nativeElement.offsetHeight;
151
+ return this.nativeElement.offsetHeight;
141
152
  }
142
153
  else {
143
- return this.element.nativeElement.offsetWidth;
154
+ return this.nativeElement.offsetWidth;
144
155
  }
145
156
  }
157
+ /**
158
+ * @hidden
159
+ */
160
+ get nativeElement() {
161
+ return this.element.nativeElement;
162
+ }
146
163
  /**
147
164
  * @hidden
148
165
  */
@@ -157,13 +174,12 @@ export class SplitterPaneComponent {
157
174
  this.cdr.detectChanges();
158
175
  }
159
176
  setOrderStyles() {
160
- const element = this.element.nativeElement;
161
- this.renderer.setStyle(element, '-ms-flex-order', this.order);
162
- this.renderer.setStyle(element, 'order', this.order);
177
+ this.renderer.setStyle(this.nativeElement, '-ms-flex-order', this.order);
178
+ this.renderer.setStyle(this.nativeElement, 'order', this.order);
163
179
  }
164
180
  }
165
- SplitterPaneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterPaneComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
166
- SplitterPaneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterPaneComponent, isStandalone: true, selector: "kendo-splitter-pane", inputs: { order: "order", size: "size", separatorLabel: "separatorLabel", min: "min", max: "max", resizable: "resizable", collapsible: "collapsible", scrollable: "scrollable", collapsed: "collapsed", orientation: "orientation", containsSplitter: "containsSplitter", overlayContent: "overlayContent" }, outputs: { sizeChange: "sizeChange", collapsedChange: "collapsedChange" }, host: { properties: { "attr.role": "this.ariaRole", "class.k-pane": "this.hostClass", "class.k-pane-static": "this.staticPaneClass", "class.k-scrollable": "this.scrollablePaneClass" } }, exportAs: ["kendoSplitterPane"], ngImport: i0, template: `
181
+ SplitterPaneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterPaneComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.SplitterService }], target: i0.ɵɵFactoryTarget.Component });
182
+ SplitterPaneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterPaneComponent, isStandalone: true, selector: "kendo-splitter-pane", inputs: { order: "order", size: "size", splitterBarAttributes: "splitterBarAttributes", splitterBarClass: "splitterBarClass", min: "min", max: "max", resizable: "resizable", collapsible: "collapsible", scrollable: "scrollable", collapsed: "collapsed", orientation: "orientation", containsSplitter: "containsSplitter", overlayContent: "overlayContent" }, outputs: { sizeChange: "sizeChange", collapsedChange: "collapsedChange" }, host: { properties: { "attr.role": "this.ariaRole", "class.k-pane": "this.hostClass", "class.k-pane-static": "this.staticPaneClass", "class.k-scrollable": "this.scrollablePaneClass" } }, exportAs: ["kendoSplitterPane"], ngImport: i0, template: `
167
183
  <ng-container *ngIf="!collapsed"><ng-content></ng-content></ng-container>
168
184
  <div *ngIf="overlayContent" class="k-splitter-overlay k-overlay"></div>
169
185
  `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
@@ -179,11 +195,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
179
195
  standalone: true,
180
196
  imports: [NgIf]
181
197
  }]
182
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { order: [{
198
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.SplitterService }]; }, propDecorators: { order: [{
183
199
  type: Input
184
200
  }], size: [{
185
201
  type: Input
186
- }], separatorLabel: [{
202
+ }], splitterBarAttributes: [{
203
+ type: Input
204
+ }], splitterBarClass: [{
187
205
  type: Input
188
206
  }], min: [{
189
207
  type: Input
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { Component, ElementRef, EventEmitter, ContentChildren, Host, HostBinding, Inject, Input, Optional, Output, QueryList, ViewChildren, Renderer2 } from '@angular/core';
5
+ import { Component, ElementRef, EventEmitter, ContentChildren, Host, HostBinding, Inject, Input, Optional, Output, QueryList, ViewChildren, Renderer2, NgZone, isDevMode } from '@angular/core';
6
6
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
7
7
  import { validatePackage } from '@progress/kendo-licensing';
8
8
  import { isDocumentAvailable } from '@progress/kendo-angular-common';
@@ -12,11 +12,12 @@ import { SplitterBarComponent } from './splitter-bar.component';
12
12
  import { SplitterService } from './splitter.service';
13
13
  import { isPresent } from '../common/util';
14
14
  import { DraggableDirective } from '@progress/kendo-angular-common';
15
- import { NgFor, NgIf, NgStyle } from '@angular/common';
15
+ import { NgClass, NgFor, NgIf, NgStyle } from '@angular/common';
16
16
  import * as i0 from "@angular/core";
17
17
  import * as i1 from "./splitter.service";
18
18
  import * as i2 from "@progress/kendo-angular-l10n";
19
19
  import * as i3 from "./splitter-pane.component";
20
+ const SIZING_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/layout/splitter/panes/#toc-size';
20
21
  /**
21
22
  * Represents the [Kendo UI Splitter component for Angular]({% slug overview_splitter %}).
22
23
  *
@@ -53,11 +54,12 @@ import * as i3 from "./splitter-pane.component";
53
54
  * ```
54
55
  */
55
56
  export class SplitterComponent {
56
- constructor(element, splitterService, localization, renderer, enclosingPane) {
57
+ constructor(element, splitterService, localization, renderer, ngZone, enclosingPane) {
57
58
  this.element = element;
58
59
  this.splitterService = splitterService;
59
60
  this.localization = localization;
60
61
  this.renderer = renderer;
62
+ this.ngZone = ngZone;
61
63
  this.enclosingPane = enclosingPane;
62
64
  /**
63
65
  * Specifies the orientation of the panes within the Splitter.
@@ -97,6 +99,7 @@ export class SplitterComponent {
97
99
  return this.direction;
98
100
  }
99
101
  set splitbars(splitbars) {
102
+ this.splitterService.splitterBars = splitbars ? splitbars.toArray() : [];
100
103
  if (!isPresent(splitbars) || !isPresent(this.panes)) {
101
104
  return;
102
105
  }
@@ -109,15 +112,29 @@ export class SplitterComponent {
109
112
  .sort((a, b) => a.order - b.order);
110
113
  const elements = components.map(component => component.element.nativeElement);
111
114
  panesArray.forEach((pane, i) => {
112
- if (splitBarsArray[i] && pane.separatorLabel) {
113
- const splitbar = splitBarsArray[i].element.nativeElement;
114
- this.renderer.setAttribute(splitbar, 'aria-label', pane.separatorLabel);
115
+ const splitbar = splitBarsArray[i];
116
+ if (splitbar && pane.splitterBarAttributes) {
117
+ splitbar.htmlAttributes = pane.splitterBarAttributes;
115
118
  }
116
119
  });
117
120
  elements.forEach(element => this.renderer.appendChild(this.element.nativeElement, element));
118
121
  }
119
122
  ngAfterContentInit() {
120
123
  this.reconfigure();
124
+ this.setFixedHeight();
125
+ const allHaveFixedSize = this.panes.length && Array.from(this.panes).every(p => p.fixedSize);
126
+ if (allHaveFixedSize && isDevMode()) {
127
+ throw new Error(`
128
+ The Splitter should have at least one pane without a set size.
129
+ See ${SIZING_DOC_LINK} for more information.
130
+ `);
131
+ }
132
+ this._styleObserver = new MutationObserver(() => {
133
+ this.ngZone.runOutsideAngular(() => {
134
+ this.setFixedHeight();
135
+ });
136
+ });
137
+ this._styleObserver.observe(this.element.nativeElement, { attributeFilter: ['style'] });
121
138
  }
122
139
  ngOnChanges(changes) {
123
140
  if (changes.orientation && !changes.orientation.isFirstChange()) {
@@ -128,6 +145,10 @@ export class SplitterComponent {
128
145
  if (this.enclosingPane) {
129
146
  this.enclosingPane.containsSplitter = false;
130
147
  }
148
+ if (this._styleObserver) {
149
+ this._styleObserver.disconnect();
150
+ this._styleObserver = null;
151
+ }
131
152
  this.unsubscribeChanges();
132
153
  }
133
154
  reconfigure() {
@@ -159,9 +180,12 @@ export class SplitterComponent {
159
180
  get direction() {
160
181
  return this.localization.rtl ? 'rtl' : 'ltr';
161
182
  }
183
+ setFixedHeight() {
184
+ this.splitterService.fixedHeight = getComputedStyle(this.element.nativeElement).getPropertyValue('height') !== 'auto';
185
+ }
162
186
  }
163
- SplitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterComponent, deps: [{ token: i0.ElementRef }, { token: i1.SplitterService }, { token: i2.LocalizationService }, { token: i0.Renderer2 }, { token: SplitterPaneComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
164
- SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterComponent, isStandalone: true, selector: "kendo-splitter", inputs: { orientation: "orientation", splitbarWidth: "splitbarWidth", resizeStep: "resizeStep" }, outputs: { layoutChange: "layoutChange" }, host: { properties: { "class.k-splitter": "this.hostClasses", "class.k-splitter-flex": "this.hostClasses", "class.k-splitter-horizontal": "this.horizontalHostClasses", "class.k-splitter-vertical": "this.verticalHostClasses", "attr.dir": "this.dir" } }, providers: [
187
+ SplitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterComponent, deps: [{ token: i0.ElementRef }, { token: i1.SplitterService }, { token: i2.LocalizationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: SplitterPaneComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
188
+ SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SplitterComponent, isStandalone: true, selector: "kendo-splitter", inputs: { orientation: "orientation", splitbarWidth: "splitbarWidth", resizeStep: "resizeStep", splitterBarClass: "splitterBarClass" }, outputs: { layoutChange: "layoutChange" }, host: { properties: { "class.k-splitter": "this.hostClasses", "class.k-splitter-flex": "this.hostClasses", "class.k-splitter-horizontal": "this.horizontalHostClasses", "class.k-splitter-vertical": "this.verticalHostClasses", "attr.dir": "this.dir" } }, providers: [
165
189
  SplitterService,
166
190
  LocalizationService,
167
191
  {
@@ -180,13 +204,14 @@ SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
180
204
  *ngIf="!last"
181
205
  [index]="index"
182
206
  [orientation]="orientation"
207
+ [ngClass]="pane.splitterBarClass || splitterBarClass"
183
208
  [ngStyle]="{
184
209
  width: orientation === 'horizontal' ? splitbarWidth + 'px' : undefined,
185
210
  height: orientation === 'vertical' ? splitbarWidth + 'px' : undefined
186
211
  }">
187
212
  </kendo-splitter-bar>
188
213
  </ng-container>
189
- `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SplitterBarComponent, selector: "kendo-splitter-bar", inputs: ["orientation", "index"] }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
214
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SplitterBarComponent, selector: "kendo-splitter-bar", inputs: ["orientation", "index", "htmlAttributes"] }, { kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
190
215
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterComponent, decorators: [{
191
216
  type: Component,
192
217
  args: [{
@@ -212,6 +237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
212
237
  *ngIf="!last"
213
238
  [index]="index"
214
239
  [orientation]="orientation"
240
+ [ngClass]="pane.splitterBarClass || splitterBarClass"
215
241
  [ngStyle]="{
216
242
  width: orientation === 'horizontal' ? splitbarWidth + 'px' : undefined,
217
243
  height: orientation === 'vertical' ? splitbarWidth + 'px' : undefined
@@ -220,9 +246,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
220
246
  </ng-container>
221
247
  `,
222
248
  standalone: true,
223
- imports: [NgFor, NgIf, SplitterBarComponent, DraggableDirective, NgStyle]
249
+ imports: [NgFor, NgIf, SplitterBarComponent, DraggableDirective, NgStyle, NgClass]
224
250
  }]
225
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.SplitterService }, { type: i2.LocalizationService }, { type: i0.Renderer2 }, { type: i3.SplitterPaneComponent, decorators: [{
251
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.SplitterService }, { type: i2.LocalizationService }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i3.SplitterPaneComponent, decorators: [{
226
252
  type: Optional
227
253
  }, {
228
254
  type: Host
@@ -235,6 +261,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
235
261
  type: Input
236
262
  }], resizeStep: [{
237
263
  type: Input
264
+ }], splitterBarClass: [{
265
+ type: Input
238
266
  }], layoutChange: [{
239
267
  type: Output
240
268
  }], hostClasses: [{
@@ -2,11 +2,11 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { isDevMode, EventEmitter, NgZone, Injectable } from '@angular/core';
5
+ import { EventEmitter, NgZone, Injectable } from '@angular/core';
6
6
  import { Keys } from '@progress/kendo-angular-common';
7
7
  import { shouldTogglePrev, shouldToggleNext } from './util';
8
8
  import * as i0 from "@angular/core";
9
- const SIZING_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/layout/splitter/panes/#toc-size';
9
+ const MAX_PANE_HEIGHT = 33554400;
10
10
  /**
11
11
  * @hidden
12
12
  */
@@ -79,10 +79,10 @@ export class SplitterService {
79
79
  }
80
80
  setSize(state, delta) {
81
81
  const clamp = (min, max, v) => Math.min(max, Math.max(min, v));
82
- const resize = (paneState, change) => {
82
+ const resize = (paneState, change, modifyMax = false) => {
83
83
  const pane = this.pane(paneState.index);
84
84
  const splitterSize = this.containerSize();
85
- const newSize = clamp(paneState.min, paneState.max, paneState.initialSize + change);
85
+ const newSize = clamp(paneState.min, modifyMax ? MAX_PANE_HEIGHT : paneState.max, paneState.initialSize + change);
86
86
  let size = "";
87
87
  if (this.isPercent(pane.size)) {
88
88
  size = (100 * newSize / splitterSize) + "%";
@@ -94,9 +94,36 @@ export class SplitterService {
94
94
  pane.isResized = true;
95
95
  this.emit(pane.sizeChange, size);
96
96
  };
97
- // resizing both panes
98
- resize(state.prev, delta);
99
- resize(state.next, -delta);
97
+ const prevPane = this.pane(state.prev.index);
98
+ const nextPane = this.pane(state.next.index);
99
+ const canResizeBothPanes = this.panes.length > 2;
100
+ const modifyPrevMax = prevPane.orientation === 'vertical' && !this.fixedHeight && !prevPane.max;
101
+ const modifyNextMax = prevPane.orientation === 'vertical' && !this.fixedHeight && !nextPane.max;
102
+ if (prevPane.fixedSize && nextPane.fixedSize || canResizeBothPanes) {
103
+ const bothVertical = prevPane.orientation === 'vertical' && nextPane.orientation === 'vertical';
104
+ if (bothVertical) {
105
+ if (modifyNextMax) {
106
+ resize(state.prev, delta, modifyPrevMax);
107
+ }
108
+ else if (modifyPrevMax) {
109
+ resize(state.next, -delta, modifyNextMax);
110
+ }
111
+ else {
112
+ resize(state.prev, delta, modifyNextMax);
113
+ resize(state.next, -delta, modifyPrevMax);
114
+ }
115
+ }
116
+ else {
117
+ resize(state.prev, delta);
118
+ resize(state.next, -delta);
119
+ }
120
+ }
121
+ else if (nextPane.fixedSize || nextPane.collapsible) {
122
+ resize(state.next, -delta, modifyNextMax);
123
+ }
124
+ else {
125
+ resize(state.prev, delta, modifyPrevMax);
126
+ }
100
127
  this.emit(this.layoutChange, {});
101
128
  }
102
129
  isDraggable(splitBarIndex) {
@@ -122,22 +149,28 @@ export class SplitterService {
122
149
  }
123
150
  return this.panes[index];
124
151
  }
152
+ paneByIndex(pane) {
153
+ if (!this.panes) {
154
+ return -1;
155
+ }
156
+ return this.panes.findIndex(splitterPane => splitterPane === pane);
157
+ }
158
+ getPaneSplitterBar(pane) {
159
+ if (!this.splitterBars) {
160
+ return;
161
+ }
162
+ const paneIndex = this.paneByIndex(pane);
163
+ if (paneIndex < 0 || paneIndex >= this.splitterBars.length) {
164
+ return null;
165
+ }
166
+ return this.splitterBars[paneIndex];
167
+ }
125
168
  configure({ panes, orientation, containerSize, direction }) {
126
169
  this.panes = panes;
127
170
  this.panes.forEach((pane, index) => {
128
171
  pane.order = index * 2;
129
172
  pane.orientation = orientation;
130
173
  });
131
- if (isDevMode()) {
132
- const allPanesWithSize = panes.length && !panes.some(pane => !pane.fixedSize);
133
- const hasResizedPane = panes.length && panes.some(pane => pane.isResized);
134
- if (allPanesWithSize && !hasResizedPane) {
135
- throw new Error(`
136
- The Splitter should have at least one pane without a set size.
137
- See ${SIZING_DOC_LINK} for more information.
138
- `);
139
- }
140
- }
141
174
  this.containerSize = containerSize;
142
175
  this.rtl = direction === 'rtl';
143
176
  }