@progress/kendo-angular-layout 17.0.0-develop.2 → 17.0.0-develop.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -27
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/splitter/splitter-bar.component.mjs +35 -2
- package/esm2020/splitter/splitter-pane.component.mjs +45 -27
- package/esm2020/splitter/splitter.component.mjs +39 -11
- package/esm2020/splitter/splitter.service.mjs +50 -17
- package/esm2020/tabstrip/rendering/tab.component.mjs +10 -9
- package/esm2020/tabstrip/tabstrip.component.mjs +16 -6
- package/esm2020/timeline/timeline-card.component.mjs +1 -1
- package/esm2020/timeline/timeline-horizontal.component.mjs +1 -1
- package/fesm2015/progress-kendo-angular-layout.mjs +365 -244
- package/fesm2020/progress-kendo-angular-layout.mjs +365 -244
- package/package.json +8 -8
- package/splitter/splitter-bar.component.d.ts +13 -1
- package/splitter/splitter-pane.component.d.ts +23 -4
- package/splitter/splitter.component.d.ts +12 -4
- package/splitter/splitter.service.d.ts +5 -0
- package/tabstrip/tabstrip.component.d.ts +2 -0
package/README.md
CHANGED
|
@@ -2,42 +2,57 @@
|
|
|
2
2
|
<img width="631" src="https://www.telerik.com/kendo-angular-ui/npm-banner.svg">
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
|
-
## Kendo UI for Angular Layout Package (
|
|
5
|
+
## Kendo UI for Angular Layout Package (Avatar, Card, Drawer, ExpansionPanel, GridLayout, PanelBar, Splitter, StackLayout, Stepper, TabStrip, TileLayout and Timeline Components)
|
|
6
6
|
|
|
7
|
-
>
|
|
8
|
-
> *
|
|
9
|
-
> * You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Angular My License page](https://www.telerik.com/kendo-angular-ui/my-license?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout).
|
|
10
|
-
> * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout). Doing so indicates that you [accept the Kendo UI for Angular License Agreement](https://www.telerik.com/purchase/license-agreement/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout).
|
|
7
|
+
> * This package is part of [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui)—a commercial library designed and built for developing business applications with Angular. Every UI component in the Kendo UI for Angular suite has been built from the ground-up specifically for Angular.
|
|
8
|
+
> * You must [install a license key](https://www.telerik.com/kendo-angular-ui/my-license) when adding the package to your project. To receive a license key, either [purchase a license](https://www.telerik.com/purchase/kendo-ui) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui).
|
|
11
9
|
> * The 30-day free trial gives you access to all the Kendo UI for Angular components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Angular dev team!
|
|
12
10
|
>
|
|
13
|
-
> [Start using Kendo UI for Angular](https://www.telerik.com/download-login-v2-kendo-angular-ui
|
|
11
|
+
> [Start using Kendo UI for Angular](https://www.telerik.com/download-login-v2-kendo-angular-ui) and speed up your development process!
|
|
14
12
|
|
|
15
|
-
Kendo UI for Angular is a
|
|
13
|
+
The [Kendo UI for Angular Layout package](https://www.telerik.com/kendo-angular-ui/components/layout/) is a collection of popular components for laying out a professional quality app. The components include a variety of layout types and styles that have extensive configuration options allowing flexibility.
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
* [Avatar](https://www.telerik.com/kendo-angular-ui/avatar?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
19
|
-
* [Card](https://www.telerik.com/kendo-angular-ui/card?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
20
|
-
* [Drawer](https://www.telerik.com/kendo-angular-ui/drawer?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
21
|
-
* [ExpansionPanel](https://www.telerik.com/kendo-angular-ui/expansionpanel?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
22
|
-
* [PanelBar](https://www.telerik.com/kendo-angular-ui/panelbar?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
23
|
-
* [Splitter](https://www.telerik.com/kendo-angular-ui/splitter?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
24
|
-
* [Stepper](https://www.telerik.com/kendo-angular-ui/stepper?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
25
|
-
* [TabStrip](https://www.telerik.com/kendo-angular-ui/tabstrip?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
26
|
-
* [TileLayout](https://www.telerik.com/kendo-angular-ui/tilelayout?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
15
|
+
## What's Included in the Angular Layout Package
|
|
27
16
|
|
|
28
|
-
|
|
17
|
+
* [Avatar](https://www.telerik.com/kendo-angular-ui/components/layout/avatar)—Displays a graphical representation of a profile or online avatar, including people or entities with initials, custom icons, and images.
|
|
18
|
+
* [Card](https://www.telerik.com/kendo-angular-ui/components/layout/card)—Combines text, visual content and actions about a single subject. It provides clarity, categorization, and an attractive way of presentation.
|
|
19
|
+
* [Drawer](https://www.telerik.com/kendo-angular-ui/components/layout/drawer)—Offers a side navigation element that can be toggled to be displayed or hidden, or permanently displayed. It enables the user to change the content of a specific section of the page.
|
|
20
|
+
* [ExpansionPanel](https://www.telerik.com/kendo-angular-ui/components/layout/expansionpanel)—Organizes any content into a details-summary view consisting of a title bar and expandable/collapsible content.
|
|
21
|
+
* [GridLayout](https://www.telerik.com/kendo-angular-ui/components/layout/gridlayout)—Based on the CSS Grid Layout system, which allows setting the specific row, column and size of each item. It allows you to arrange your content in columns and rows, forming a grid structure.
|
|
22
|
+
* [PanelBar](https://www.telerik.com/kendo-angular-ui/components/layout/panelbar)—Showcases hierarchical or multi-level content in a component, whose individual items can be expanded or collapsed.
|
|
23
|
+
* [Splitter](https://www.telerik.com/kendo-angular-ui/components/layout/splitter)—Splits a page into sections, which can be expanded, collapsed or resized, and allows users to control the page layout.
|
|
24
|
+
* [StackLayout](https://www.telerik.com/kendo-angular-ui/components/layout/stacklayout)—Allows you to easily arrange vertically or horizontally multiple elements in a stack according to the alignment and spacing you like.
|
|
25
|
+
* [Stepper](https://www.telerik.com/kendo-angular-ui/components/layout/stepper)—Visualizes the progress of a process by dividing it into chronological steps.
|
|
26
|
+
* [TabStrip](https://www.telerik.com/kendo-angular-ui/components/layout/tabstrip)—Displays a collection of tabs, each with their own associated content, which enable the user to switch between different views inside a single component.
|
|
27
|
+
* [TileLayout](https://www.telerik.com/kendo-angular-ui/components/layout/tilelayout)—Displays a collection of tiles and aligns them into columns and rows, allowing end users to rearrange and resize any of the tiles.
|
|
28
|
+
* [Timeline](https://www.telerik.com/kendo-angular-ui/components/layout/timeline)—Displays a collection of events and their data in a chronological succession for each year.
|
|
29
|
+
|
|
30
|
+
## Key Features
|
|
31
|
+
|
|
32
|
+
Among the many features which the Kendo UI for Angular Layout components deliver are:
|
|
33
|
+
|
|
34
|
+
* [Appearance](https://www.telerik.com/kendo-angular-ui/components/layout/avatar/appearance)—The appearance of all Layout components can be customized using theme variables and configuration options. Kendo UI for Angular offers a variety of popular themes, including Bootstrap and Material. These themes can be easily tailored to your needs using the [Progress ThemeBuilder](https://www.telerik.com/themebuilder), an online utility application.
|
|
35
|
+
* [Globalization](https://www.telerik.com/kendo-angular-ui/components/inputs/globalization)—The Kendo UI for Angular Layout package supports globalization to ensure that each Layout component can fit well in any application, no matter what languages and locales need to be supported. Additionally, the Layout controls support rendering in a right-to-left (RTL) direction.
|
|
36
|
+
* [Accessibility](https://www.telerik.com/kendo-angular-ui/components/inputs/maskedtextbox/accessibility)—Most Layout components are accessible for screen readers and support WAI-ARIA attributes.
|
|
37
|
+
* [Keyboard Navigation](https://www.telerik.com/kendo-angular-ui/components/inputs/maskedtextbox/keyboard-navigation)—Apart from the Avatar, Card, and TileLayout, the Layout components support a number of keyboard shortcuts which allow users to accomplish various commands.
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
32
|
-
* [Blogs](http://www.telerik.com/blogs/kendo-ui)
|
|
33
|
-
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-layout)
|
|
39
|
+
## Support Options
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
For any issues you might encounter while working with the Kendo UI for Angular Layout, you have the following support channels available:
|
|
42
|
+
|
|
43
|
+
* Industry-leading technical support—Kendo UI for Angular paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use the [dedicated Kendo UI for Angular support system](https://www.telerik.com/account/support-tickets).
|
|
44
|
+
* Product forums—The [Kendo UI for Angular forums](https://www.telerik.com/forums/kendo-angular-ui) are part of the free support you can get from the community and from the Kendo UI for Angular team.
|
|
45
|
+
* Feedback portal—The [Kendo UI for Angular feedback portal](https://feedback.telerik.com/kendo-angular-ui) is where you can request and vote for new features to be added.
|
|
46
|
+
|
|
47
|
+
## Resources
|
|
36
48
|
|
|
37
|
-
* [
|
|
38
|
-
* [
|
|
39
|
-
* [
|
|
40
|
-
* [
|
|
49
|
+
* [Getting Started with Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/getting-started)
|
|
50
|
+
* [Getting Started with the Kendo UI for Angular Layout](https://www.telerik.com/kendo-angular-ui/components/layout/installation/getting-started)
|
|
51
|
+
* [Layout Overview page](https://www.telerik.com/kendo-angular-ui/components/layout) and [Layout API reference](https://www.telerik.com/kendo-angular-ui/components/layout/api)
|
|
52
|
+
* [Kendo UI for Angular roadmap](https://www.telerik.com/kendo-angular-ui/roadmap)
|
|
53
|
+
* [Kendo UI for Angular Blog](https://www.telerik.com/blogs/tag/kendo-ui-for-angular)
|
|
54
|
+
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components)
|
|
55
|
+
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui)
|
|
41
56
|
|
|
42
57
|
*Copyright © 2024 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
|
43
58
|
|
|
@@ -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:
|
|
13
|
-
version: '17.0.0-develop.
|
|
12
|
+
publishDate: 1729854978,
|
|
13
|
+
version: '17.0.0-develop.20',
|
|
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
|
-
|
|
85
|
-
this.renderer.setStyle(
|
|
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(
|
|
86
|
+
this.renderer.addClass(this.nativeElement, 'k-pane-static');
|
|
89
87
|
}
|
|
90
88
|
else {
|
|
91
|
-
this.renderer.removeClass(
|
|
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(
|
|
115
|
+
this.renderer.addClass(this.nativeElement, 'k-pane-flex');
|
|
104
116
|
}
|
|
105
117
|
else {
|
|
106
|
-
this.renderer.removeClass(
|
|
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(
|
|
128
|
-
this.renderer.addClass(
|
|
138
|
+
this.renderer.addClass(this.nativeElement, 'k-hidden');
|
|
139
|
+
this.renderer.addClass(this.nativeElement, 'hidden');
|
|
129
140
|
}
|
|
130
141
|
else {
|
|
131
|
-
this.renderer.removeClass(
|
|
132
|
-
this.renderer.removeClass(
|
|
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.
|
|
151
|
+
return this.nativeElement.offsetHeight;
|
|
141
152
|
}
|
|
142
153
|
else {
|
|
143
|
-
return this.
|
|
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
|
-
|
|
161
|
-
this.renderer.setStyle(
|
|
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",
|
|
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
|
-
}],
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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 {
|
|
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
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
}
|