@progress/kendo-angular-layout 17.0.0-develop.10 → 17.0.0-develop.11
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/esm2020/package-metadata.mjs +2 -2
- package/esm2020/splitter/splitter-bar.component.mjs +35 -2
- package/esm2020/splitter/splitter-pane.component.mjs +25 -9
- package/esm2020/splitter/splitter.component.mjs +12 -7
- package/esm2020/splitter/splitter.service.mjs +16 -0
- package/fesm2015/progress-kendo-angular-layout.mjs +274 -206
- package/fesm2020/progress-kendo-angular-layout.mjs +274 -206
- package/package.json +8 -8
- package/splitter/splitter-bar.component.d.ts +13 -1
- package/splitter/splitter-pane.component.d.ts +19 -4
- package/splitter/splitter.component.d.ts +6 -1
- package/splitter/splitter.service.d.ts +4 -0
|
@@ -7,7 +7,7 @@ import { Directive, Optional, Injectable, isDevMode, Component, SkipSelf, Host,
|
|
|
7
7
|
import * as i1 from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { LocalizationService, L10N_PREFIX, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
9
9
|
import * as i1$1 from '@progress/kendo-angular-common';
|
|
10
|
-
import { Keys, shouldShowValidationUI, WatermarkOverlayComponent, isDocumentAvailable, DraggableDirective, PreventableEvent as PreventableEvent$1, guid, ResizeSensorComponent, hasObservers, isPresent as isPresent$1, focusableSelector, isChanged } from '@progress/kendo-angular-common';
|
|
10
|
+
import { Keys, shouldShowValidationUI, WatermarkOverlayComponent, isObjectPresent, removeHTMLAttributes, parseAttributes, setHTMLAttributes, isDocumentAvailable, DraggableDirective, PreventableEvent as PreventableEvent$1, guid, ResizeSensorComponent, hasObservers, isPresent as isPresent$1, focusableSelector, isChanged } from '@progress/kendo-angular-common';
|
|
11
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
12
|
import * as i1$2 from '@angular/animations';
|
|
13
13
|
import { trigger, state, style, transition, animate, AUTO_STYLE } from '@angular/animations';
|
|
@@ -28,8 +28,8 @@ const packageMetadata = {
|
|
|
28
28
|
name: '@progress/kendo-angular-layout',
|
|
29
29
|
productName: 'Kendo UI for Angular',
|
|
30
30
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
31
|
-
publishDate:
|
|
32
|
-
version: '17.0.0-develop.
|
|
31
|
+
publishDate: 1729238832,
|
|
32
|
+
version: '17.0.0-develop.11',
|
|
33
33
|
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'
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -1598,18 +1598,218 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1598
1598
|
args: ['keydown', ['$event']]
|
|
1599
1599
|
}] } });
|
|
1600
1600
|
|
|
1601
|
+
/**
|
|
1602
|
+
* @hidden
|
|
1603
|
+
*/
|
|
1604
|
+
const shouldTogglePrev = (keyCode, prev, next) => {
|
|
1605
|
+
const leftArrow = keyCode === Keys.ArrowLeft;
|
|
1606
|
+
const upArrow = keyCode === Keys.ArrowUp;
|
|
1607
|
+
const collapsePrev = !prev.collapsed && !next.collapsed && (leftArrow || upArrow);
|
|
1608
|
+
const expandPrev = prev.collapsed && !(leftArrow || upArrow);
|
|
1609
|
+
return collapsePrev || expandPrev;
|
|
1610
|
+
};
|
|
1611
|
+
/**
|
|
1612
|
+
* @hidden
|
|
1613
|
+
*/
|
|
1614
|
+
const shouldToggleNext = (keyCode, prev, next) => {
|
|
1615
|
+
const leftArrow = keyCode === Keys.ArrowLeft;
|
|
1616
|
+
const upArrow = keyCode === Keys.ArrowUp;
|
|
1617
|
+
const collapseNext = !next.collapsed && !prev.collapsed && !(leftArrow || upArrow);
|
|
1618
|
+
const expandNext = next.collapsed && (leftArrow || upArrow);
|
|
1619
|
+
return collapseNext || expandNext;
|
|
1620
|
+
};
|
|
1621
|
+
/**
|
|
1622
|
+
* @hidden
|
|
1623
|
+
*/
|
|
1624
|
+
const shouldToggleOrResize = (keyCode, orientation) => {
|
|
1625
|
+
const isHorizontal = orientation === 'horizontal';
|
|
1626
|
+
const isHorizontalChange = isHorizontal && (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight);
|
|
1627
|
+
const isVerticalChange = !isHorizontal && (keyCode === Keys.ArrowUp || keyCode === Keys.ArrowDown);
|
|
1628
|
+
return isHorizontalChange || isVerticalChange;
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
const SIZING_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/layout/splitter/panes/#toc-size';
|
|
1632
|
+
/**
|
|
1633
|
+
* @hidden
|
|
1634
|
+
*/
|
|
1635
|
+
class SplitterService {
|
|
1636
|
+
constructor(zone) {
|
|
1637
|
+
this.zone = zone;
|
|
1638
|
+
this.layoutChange = new EventEmitter();
|
|
1639
|
+
this.resizeStep = 10;
|
|
1640
|
+
this.containerSize = () => { };
|
|
1641
|
+
}
|
|
1642
|
+
tryToggle(paneIndex) {
|
|
1643
|
+
const pane = this.pane(paneIndex);
|
|
1644
|
+
if (pane.collapsible) {
|
|
1645
|
+
pane.collapsed = !pane.collapsed;
|
|
1646
|
+
pane.collapsedChange.emit(pane.collapsed);
|
|
1647
|
+
this.emit(this.layoutChange, {});
|
|
1648
|
+
if (pane.collapsed) {
|
|
1649
|
+
pane.detectChanges();
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
const notCollapsed = this.panes.filter(p => !p.collapsed);
|
|
1653
|
+
const allHaveFixedSize = notCollapsed.every(p => p.fixedSize);
|
|
1654
|
+
notCollapsed.filter(p => p.fixedSize).forEach(pane => {
|
|
1655
|
+
pane.forceExpand = allHaveFixedSize ? true : false;
|
|
1656
|
+
});
|
|
1657
|
+
return pane.collapsible;
|
|
1658
|
+
}
|
|
1659
|
+
togglePane(keyCode, index) {
|
|
1660
|
+
const prev = this.pane(index);
|
|
1661
|
+
const next = this.pane(index + 1);
|
|
1662
|
+
if (shouldTogglePrev(keyCode, prev, next)) {
|
|
1663
|
+
this.tryToggle(index);
|
|
1664
|
+
}
|
|
1665
|
+
else if (shouldToggleNext(keyCode, prev, next)) {
|
|
1666
|
+
this.tryToggle(index + 1);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
resizePane(keyCode, index) {
|
|
1670
|
+
const state = this.dragState(index);
|
|
1671
|
+
const direction = keyCode === Keys.ArrowLeft || keyCode === (this.rtl ? Keys.ArrowDown : Keys.ArrowUp);
|
|
1672
|
+
let step = direction ? (-this.resizeStep) : this.resizeStep;
|
|
1673
|
+
if (this.rtl) {
|
|
1674
|
+
step = -step;
|
|
1675
|
+
}
|
|
1676
|
+
this.setSize(state, step);
|
|
1677
|
+
}
|
|
1678
|
+
toggleContentOverlay(index, show) {
|
|
1679
|
+
this.pane(index).toggleOverlay(show);
|
|
1680
|
+
this.pane(index + 1).toggleOverlay(show);
|
|
1681
|
+
}
|
|
1682
|
+
dragState(splitbarIndex) {
|
|
1683
|
+
const prev = this.pane(splitbarIndex);
|
|
1684
|
+
const next = this.pane(splitbarIndex + 1);
|
|
1685
|
+
const total = prev.computedSize + next.computedSize;
|
|
1686
|
+
const px = s => this.toPixels(s);
|
|
1687
|
+
return {
|
|
1688
|
+
prev: {
|
|
1689
|
+
index: splitbarIndex,
|
|
1690
|
+
initialSize: prev.computedSize,
|
|
1691
|
+
min: px(prev.min) || total - px(next.max) || 0,
|
|
1692
|
+
max: px(prev.max) || total - px(next.min) || total
|
|
1693
|
+
},
|
|
1694
|
+
next: {
|
|
1695
|
+
index: splitbarIndex + 1,
|
|
1696
|
+
initialSize: next.computedSize,
|
|
1697
|
+
min: px(next.min) || total - px(prev.max) || 0,
|
|
1698
|
+
max: px(next.max) || total - px(prev.min) || total
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
setSize(state, delta) {
|
|
1703
|
+
const clamp = (min, max, v) => Math.min(max, Math.max(min, v));
|
|
1704
|
+
const resize = (paneState, change) => {
|
|
1705
|
+
const pane = this.pane(paneState.index);
|
|
1706
|
+
const splitterSize = this.containerSize();
|
|
1707
|
+
const newSize = clamp(paneState.min, paneState.max, paneState.initialSize + change);
|
|
1708
|
+
let size = "";
|
|
1709
|
+
if (this.isPercent(pane.size)) {
|
|
1710
|
+
size = (100 * newSize / splitterSize) + "%";
|
|
1711
|
+
}
|
|
1712
|
+
else {
|
|
1713
|
+
size = newSize + "px";
|
|
1714
|
+
}
|
|
1715
|
+
pane.size = size;
|
|
1716
|
+
pane.isResized = true;
|
|
1717
|
+
this.emit(pane.sizeChange, size);
|
|
1718
|
+
};
|
|
1719
|
+
// resizing both panes
|
|
1720
|
+
resize(state.prev, delta);
|
|
1721
|
+
resize(state.next, -delta);
|
|
1722
|
+
this.emit(this.layoutChange, {});
|
|
1723
|
+
}
|
|
1724
|
+
isDraggable(splitBarIndex) {
|
|
1725
|
+
const prev = this.pane(splitBarIndex);
|
|
1726
|
+
const next = this.pane(splitBarIndex + 1);
|
|
1727
|
+
const betweenResizablePanes = prev.resizable && next.resizable;
|
|
1728
|
+
const nearCollapsedPane = prev.collapsed || next.collapsed;
|
|
1729
|
+
return betweenResizablePanes && !nearCollapsedPane;
|
|
1730
|
+
}
|
|
1731
|
+
isStatic(splitBarIndex) {
|
|
1732
|
+
const prev = this.pane(splitBarIndex);
|
|
1733
|
+
const next = this.pane(splitBarIndex + 1);
|
|
1734
|
+
const betweenResizablePanes = prev.resizable && next.resizable;
|
|
1735
|
+
const nearCollapsiblePane = prev.collapsible || next.collapsible;
|
|
1736
|
+
return !betweenResizablePanes && !nearCollapsiblePane;
|
|
1737
|
+
}
|
|
1738
|
+
pane(index) {
|
|
1739
|
+
if (!this.panes) {
|
|
1740
|
+
throw new Error("Panes not initialized");
|
|
1741
|
+
}
|
|
1742
|
+
if (index < 0 || index >= this.panes.length) {
|
|
1743
|
+
throw new Error("Index out of range");
|
|
1744
|
+
}
|
|
1745
|
+
return this.panes[index];
|
|
1746
|
+
}
|
|
1747
|
+
paneByIndex(pane) {
|
|
1748
|
+
if (!this.panes) {
|
|
1749
|
+
return -1;
|
|
1750
|
+
}
|
|
1751
|
+
return this.panes.findIndex(splitterPane => splitterPane === pane);
|
|
1752
|
+
}
|
|
1753
|
+
getPaneSplitterBar(pane) {
|
|
1754
|
+
if (!this.splitterBars) {
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
const paneIndex = this.paneByIndex(pane);
|
|
1758
|
+
if (paneIndex < 0 || paneIndex >= this.splitterBars.length) {
|
|
1759
|
+
return null;
|
|
1760
|
+
}
|
|
1761
|
+
return this.splitterBars[paneIndex];
|
|
1762
|
+
}
|
|
1763
|
+
configure({ panes, orientation, containerSize, direction }) {
|
|
1764
|
+
this.panes = panes;
|
|
1765
|
+
this.panes.forEach((pane, index) => {
|
|
1766
|
+
pane.order = index * 2;
|
|
1767
|
+
pane.orientation = orientation;
|
|
1768
|
+
});
|
|
1769
|
+
if (isDevMode()) {
|
|
1770
|
+
const allPanesWithSize = panes.length && !panes.some(pane => !pane.fixedSize);
|
|
1771
|
+
const hasResizedPane = panes.length && panes.some(pane => pane.isResized);
|
|
1772
|
+
if (allPanesWithSize && !hasResizedPane) {
|
|
1773
|
+
throw new Error(`
|
|
1774
|
+
The Splitter should have at least one pane without a set size.
|
|
1775
|
+
See ${SIZING_DOC_LINK} for more information.
|
|
1776
|
+
`);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
this.containerSize = containerSize;
|
|
1780
|
+
this.rtl = direction === 'rtl';
|
|
1781
|
+
}
|
|
1782
|
+
isPercent(size) {
|
|
1783
|
+
return /%$/.test(size);
|
|
1784
|
+
}
|
|
1785
|
+
toPixels(size) {
|
|
1786
|
+
let result = parseFloat(size);
|
|
1787
|
+
if (this.isPercent(size)) {
|
|
1788
|
+
result = (this.containerSize() * result / 100);
|
|
1789
|
+
}
|
|
1790
|
+
return result;
|
|
1791
|
+
}
|
|
1792
|
+
emit(emitter, args) {
|
|
1793
|
+
if (emitter.observers.length) {
|
|
1794
|
+
this.zone.run(() => emitter.emit(args));
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
SplitterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1799
|
+
SplitterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService });
|
|
1800
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService, decorators: [{
|
|
1801
|
+
type: Injectable
|
|
1802
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
1803
|
+
|
|
1601
1804
|
/**
|
|
1602
1805
|
* Represents the pane component of the Splitter.
|
|
1603
1806
|
*/
|
|
1604
1807
|
class SplitterPaneComponent {
|
|
1605
|
-
constructor(element, renderer, cdr) {
|
|
1808
|
+
constructor(element, renderer, cdr, splitterService) {
|
|
1606
1809
|
this.element = element;
|
|
1607
1810
|
this.renderer = renderer;
|
|
1608
1811
|
this.cdr = cdr;
|
|
1609
|
-
|
|
1610
|
-
* The value of the aria-label attribute of the auxiliary separator.
|
|
1611
|
-
*/
|
|
1612
|
-
this.separatorLabel = 'Splitter pane';
|
|
1812
|
+
this.splitterService = splitterService;
|
|
1613
1813
|
/**
|
|
1614
1814
|
* Specifies if the user is allowed to resize the pane and provide space for other panes.
|
|
1615
1815
|
*/
|
|
@@ -1687,6 +1887,21 @@ class SplitterPaneComponent {
|
|
|
1687
1887
|
get size() {
|
|
1688
1888
|
return this._size;
|
|
1689
1889
|
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Sets the HTML attributes of the splitter bar.
|
|
1892
|
+
* The property accepts string key-value based pairs.
|
|
1893
|
+
* Attributes which are essential for certain functionalities cannot be changed.
|
|
1894
|
+
*/
|
|
1895
|
+
set splitterBarAttributes(attributes) {
|
|
1896
|
+
this._splitterBarAttributes = attributes;
|
|
1897
|
+
const splitterBar = this.splitterService.getPaneSplitterBar(this);
|
|
1898
|
+
if (splitterBar) {
|
|
1899
|
+
splitterBar.htmlAttributes = attributes;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
get splitterBarAttributes() {
|
|
1903
|
+
return this._splitterBarAttributes;
|
|
1904
|
+
}
|
|
1690
1905
|
/**
|
|
1691
1906
|
* @hidden
|
|
1692
1907
|
*/
|
|
@@ -1755,8 +1970,8 @@ class SplitterPaneComponent {
|
|
|
1755
1970
|
this.renderer.setStyle(element, 'order', this.order);
|
|
1756
1971
|
}
|
|
1757
1972
|
}
|
|
1758
|
-
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 });
|
|
1759
|
-
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",
|
|
1973
|
+
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: SplitterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1974
|
+
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: `
|
|
1760
1975
|
<ng-container *ngIf="!collapsed"><ng-content></ng-content></ng-container>
|
|
1761
1976
|
<div *ngIf="overlayContent" class="k-splitter-overlay k-overlay"></div>
|
|
1762
1977
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
@@ -1772,11 +1987,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1772
1987
|
standalone: true,
|
|
1773
1988
|
imports: [NgIf]
|
|
1774
1989
|
}]
|
|
1775
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { order: [{
|
|
1990
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: SplitterService }]; }, propDecorators: { order: [{
|
|
1776
1991
|
type: Input
|
|
1777
1992
|
}], size: [{
|
|
1778
1993
|
type: Input
|
|
1779
|
-
}],
|
|
1994
|
+
}], splitterBarAttributes: [{
|
|
1995
|
+
type: Input
|
|
1996
|
+
}], splitterBarClass: [{
|
|
1780
1997
|
type: Input
|
|
1781
1998
|
}], min: [{
|
|
1782
1999
|
type: Input
|
|
@@ -1814,193 +2031,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1814
2031
|
args: ['class.k-scrollable']
|
|
1815
2032
|
}] } });
|
|
1816
2033
|
|
|
1817
|
-
/**
|
|
1818
|
-
* @hidden
|
|
1819
|
-
*/
|
|
1820
|
-
const shouldTogglePrev = (keyCode, prev, next) => {
|
|
1821
|
-
const leftArrow = keyCode === Keys.ArrowLeft;
|
|
1822
|
-
const upArrow = keyCode === Keys.ArrowUp;
|
|
1823
|
-
const collapsePrev = !prev.collapsed && !next.collapsed && (leftArrow || upArrow);
|
|
1824
|
-
const expandPrev = prev.collapsed && !(leftArrow || upArrow);
|
|
1825
|
-
return collapsePrev || expandPrev;
|
|
1826
|
-
};
|
|
1827
|
-
/**
|
|
1828
|
-
* @hidden
|
|
1829
|
-
*/
|
|
1830
|
-
const shouldToggleNext = (keyCode, prev, next) => {
|
|
1831
|
-
const leftArrow = keyCode === Keys.ArrowLeft;
|
|
1832
|
-
const upArrow = keyCode === Keys.ArrowUp;
|
|
1833
|
-
const collapseNext = !next.collapsed && !prev.collapsed && !(leftArrow || upArrow);
|
|
1834
|
-
const expandNext = next.collapsed && (leftArrow || upArrow);
|
|
1835
|
-
return collapseNext || expandNext;
|
|
1836
|
-
};
|
|
1837
|
-
/**
|
|
1838
|
-
* @hidden
|
|
1839
|
-
*/
|
|
1840
|
-
const shouldToggleOrResize = (keyCode, orientation) => {
|
|
1841
|
-
const isHorizontal = orientation === 'horizontal';
|
|
1842
|
-
const isHorizontalChange = isHorizontal && (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight);
|
|
1843
|
-
const isVerticalChange = !isHorizontal && (keyCode === Keys.ArrowUp || keyCode === Keys.ArrowDown);
|
|
1844
|
-
return isHorizontalChange || isVerticalChange;
|
|
1845
|
-
};
|
|
1846
|
-
|
|
1847
|
-
const SIZING_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/layout/splitter/panes/#toc-size';
|
|
1848
|
-
/**
|
|
1849
|
-
* @hidden
|
|
1850
|
-
*/
|
|
1851
|
-
class SplitterService {
|
|
1852
|
-
constructor(zone) {
|
|
1853
|
-
this.zone = zone;
|
|
1854
|
-
this.layoutChange = new EventEmitter();
|
|
1855
|
-
this.resizeStep = 10;
|
|
1856
|
-
this.containerSize = () => { };
|
|
1857
|
-
}
|
|
1858
|
-
tryToggle(paneIndex) {
|
|
1859
|
-
const pane = this.pane(paneIndex);
|
|
1860
|
-
if (pane.collapsible) {
|
|
1861
|
-
pane.collapsed = !pane.collapsed;
|
|
1862
|
-
pane.collapsedChange.emit(pane.collapsed);
|
|
1863
|
-
this.emit(this.layoutChange, {});
|
|
1864
|
-
if (pane.collapsed) {
|
|
1865
|
-
pane.detectChanges();
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
const notCollapsed = this.panes.filter(p => !p.collapsed);
|
|
1869
|
-
const allHaveFixedSize = notCollapsed.every(p => p.fixedSize);
|
|
1870
|
-
notCollapsed.filter(p => p.fixedSize).forEach(pane => {
|
|
1871
|
-
pane.forceExpand = allHaveFixedSize ? true : false;
|
|
1872
|
-
});
|
|
1873
|
-
return pane.collapsible;
|
|
1874
|
-
}
|
|
1875
|
-
togglePane(keyCode, index) {
|
|
1876
|
-
const prev = this.pane(index);
|
|
1877
|
-
const next = this.pane(index + 1);
|
|
1878
|
-
if (shouldTogglePrev(keyCode, prev, next)) {
|
|
1879
|
-
this.tryToggle(index);
|
|
1880
|
-
}
|
|
1881
|
-
else if (shouldToggleNext(keyCode, prev, next)) {
|
|
1882
|
-
this.tryToggle(index + 1);
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
resizePane(keyCode, index) {
|
|
1886
|
-
const state = this.dragState(index);
|
|
1887
|
-
const direction = keyCode === Keys.ArrowLeft || keyCode === (this.rtl ? Keys.ArrowDown : Keys.ArrowUp);
|
|
1888
|
-
let step = direction ? (-this.resizeStep) : this.resizeStep;
|
|
1889
|
-
if (this.rtl) {
|
|
1890
|
-
step = -step;
|
|
1891
|
-
}
|
|
1892
|
-
this.setSize(state, step);
|
|
1893
|
-
}
|
|
1894
|
-
toggleContentOverlay(index, show) {
|
|
1895
|
-
this.pane(index).toggleOverlay(show);
|
|
1896
|
-
this.pane(index + 1).toggleOverlay(show);
|
|
1897
|
-
}
|
|
1898
|
-
dragState(splitbarIndex) {
|
|
1899
|
-
const prev = this.pane(splitbarIndex);
|
|
1900
|
-
const next = this.pane(splitbarIndex + 1);
|
|
1901
|
-
const total = prev.computedSize + next.computedSize;
|
|
1902
|
-
const px = s => this.toPixels(s);
|
|
1903
|
-
return {
|
|
1904
|
-
prev: {
|
|
1905
|
-
index: splitbarIndex,
|
|
1906
|
-
initialSize: prev.computedSize,
|
|
1907
|
-
min: px(prev.min) || total - px(next.max) || 0,
|
|
1908
|
-
max: px(prev.max) || total - px(next.min) || total
|
|
1909
|
-
},
|
|
1910
|
-
next: {
|
|
1911
|
-
index: splitbarIndex + 1,
|
|
1912
|
-
initialSize: next.computedSize,
|
|
1913
|
-
min: px(next.min) || total - px(prev.max) || 0,
|
|
1914
|
-
max: px(next.max) || total - px(prev.min) || total
|
|
1915
|
-
}
|
|
1916
|
-
};
|
|
1917
|
-
}
|
|
1918
|
-
setSize(state, delta) {
|
|
1919
|
-
const clamp = (min, max, v) => Math.min(max, Math.max(min, v));
|
|
1920
|
-
const resize = (paneState, change) => {
|
|
1921
|
-
const pane = this.pane(paneState.index);
|
|
1922
|
-
const splitterSize = this.containerSize();
|
|
1923
|
-
const newSize = clamp(paneState.min, paneState.max, paneState.initialSize + change);
|
|
1924
|
-
let size = "";
|
|
1925
|
-
if (this.isPercent(pane.size)) {
|
|
1926
|
-
size = (100 * newSize / splitterSize) + "%";
|
|
1927
|
-
}
|
|
1928
|
-
else {
|
|
1929
|
-
size = newSize + "px";
|
|
1930
|
-
}
|
|
1931
|
-
pane.size = size;
|
|
1932
|
-
pane.isResized = true;
|
|
1933
|
-
this.emit(pane.sizeChange, size);
|
|
1934
|
-
};
|
|
1935
|
-
// resizing both panes
|
|
1936
|
-
resize(state.prev, delta);
|
|
1937
|
-
resize(state.next, -delta);
|
|
1938
|
-
this.emit(this.layoutChange, {});
|
|
1939
|
-
}
|
|
1940
|
-
isDraggable(splitBarIndex) {
|
|
1941
|
-
const prev = this.pane(splitBarIndex);
|
|
1942
|
-
const next = this.pane(splitBarIndex + 1);
|
|
1943
|
-
const betweenResizablePanes = prev.resizable && next.resizable;
|
|
1944
|
-
const nearCollapsedPane = prev.collapsed || next.collapsed;
|
|
1945
|
-
return betweenResizablePanes && !nearCollapsedPane;
|
|
1946
|
-
}
|
|
1947
|
-
isStatic(splitBarIndex) {
|
|
1948
|
-
const prev = this.pane(splitBarIndex);
|
|
1949
|
-
const next = this.pane(splitBarIndex + 1);
|
|
1950
|
-
const betweenResizablePanes = prev.resizable && next.resizable;
|
|
1951
|
-
const nearCollapsiblePane = prev.collapsible || next.collapsible;
|
|
1952
|
-
return !betweenResizablePanes && !nearCollapsiblePane;
|
|
1953
|
-
}
|
|
1954
|
-
pane(index) {
|
|
1955
|
-
if (!this.panes) {
|
|
1956
|
-
throw new Error("Panes not initialized");
|
|
1957
|
-
}
|
|
1958
|
-
if (index < 0 || index >= this.panes.length) {
|
|
1959
|
-
throw new Error("Index out of range");
|
|
1960
|
-
}
|
|
1961
|
-
return this.panes[index];
|
|
1962
|
-
}
|
|
1963
|
-
configure({ panes, orientation, containerSize, direction }) {
|
|
1964
|
-
this.panes = panes;
|
|
1965
|
-
this.panes.forEach((pane, index) => {
|
|
1966
|
-
pane.order = index * 2;
|
|
1967
|
-
pane.orientation = orientation;
|
|
1968
|
-
});
|
|
1969
|
-
if (isDevMode()) {
|
|
1970
|
-
const allPanesWithSize = panes.length && !panes.some(pane => !pane.fixedSize);
|
|
1971
|
-
const hasResizedPane = panes.length && panes.some(pane => pane.isResized);
|
|
1972
|
-
if (allPanesWithSize && !hasResizedPane) {
|
|
1973
|
-
throw new Error(`
|
|
1974
|
-
The Splitter should have at least one pane without a set size.
|
|
1975
|
-
See ${SIZING_DOC_LINK} for more information.
|
|
1976
|
-
`);
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
this.containerSize = containerSize;
|
|
1980
|
-
this.rtl = direction === 'rtl';
|
|
1981
|
-
}
|
|
1982
|
-
isPercent(size) {
|
|
1983
|
-
return /%$/.test(size);
|
|
1984
|
-
}
|
|
1985
|
-
toPixels(size) {
|
|
1986
|
-
let result = parseFloat(size);
|
|
1987
|
-
if (this.isPercent(size)) {
|
|
1988
|
-
result = (this.containerSize() * result / 100);
|
|
1989
|
-
}
|
|
1990
|
-
return result;
|
|
1991
|
-
}
|
|
1992
|
-
emit(emitter, args) {
|
|
1993
|
-
if (emitter.observers.length) {
|
|
1994
|
-
this.zone.run(() => emitter.emit(args));
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
}
|
|
1998
|
-
SplitterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1999
|
-
SplitterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService });
|
|
2000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterService, decorators: [{
|
|
2001
|
-
type: Injectable
|
|
2002
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
2003
|
-
|
|
2004
2034
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2005
2035
|
const stopPropagation = ({ originalEvent: event }) => {
|
|
2006
2036
|
event.stopPropagation();
|
|
@@ -2027,10 +2057,12 @@ class SplitterBarComponent {
|
|
|
2027
2057
|
this.renderer = renderer;
|
|
2028
2058
|
this.cdr = cdr;
|
|
2029
2059
|
this.ariaRole = 'separator';
|
|
2060
|
+
this.ariaLabel = 'Splitter pane';
|
|
2030
2061
|
this.focused = false;
|
|
2031
2062
|
this.orientation = 'horizontal';
|
|
2032
2063
|
this.index = 0;
|
|
2033
2064
|
this.subscriptions = new Subscription();
|
|
2065
|
+
this.parsedAttributes = {};
|
|
2034
2066
|
}
|
|
2035
2067
|
get hostOrientation() {
|
|
2036
2068
|
return this.orientation === 'horizontal' ? 'vertical' : 'horizontal';
|
|
@@ -2057,6 +2089,28 @@ class SplitterBarComponent {
|
|
|
2057
2089
|
get order() {
|
|
2058
2090
|
return 2 * this.index + 1;
|
|
2059
2091
|
}
|
|
2092
|
+
set htmlAttributes(attributes) {
|
|
2093
|
+
if (isObjectPresent(this.parsedAttributes)) {
|
|
2094
|
+
removeHTMLAttributes(this.parsedAttributes, this.renderer, this.element.nativeElement);
|
|
2095
|
+
}
|
|
2096
|
+
this._htmlAttributes = attributes;
|
|
2097
|
+
this.parsedAttributes = this.htmlAttributes ?
|
|
2098
|
+
parseAttributes(this.htmlAttributes, this.defaultAttributes) :
|
|
2099
|
+
this.htmlAttributes;
|
|
2100
|
+
this.setHtmlAttributes();
|
|
2101
|
+
}
|
|
2102
|
+
get htmlAttributes() {
|
|
2103
|
+
return this._htmlAttributes;
|
|
2104
|
+
}
|
|
2105
|
+
get defaultAttributes() {
|
|
2106
|
+
return {
|
|
2107
|
+
'aria-orientation': this.hostOrientation,
|
|
2108
|
+
role: this.ariaRole
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
get mutableAttributes() {
|
|
2112
|
+
return { 'tabindex': this.tabIndex };
|
|
2113
|
+
}
|
|
2060
2114
|
ngOnInit() {
|
|
2061
2115
|
let state;
|
|
2062
2116
|
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 }) => {
|
|
@@ -2203,9 +2257,13 @@ class SplitterBarComponent {
|
|
|
2203
2257
|
this.splitterService.tryToggle(next);
|
|
2204
2258
|
}
|
|
2205
2259
|
}
|
|
2260
|
+
setHtmlAttributes() {
|
|
2261
|
+
const attributesToRender = Object.assign(Object.assign({}, this.mutableAttributes), this.parsedAttributes);
|
|
2262
|
+
setHTMLAttributes(attributesToRender, this.renderer, this.element.nativeElement);
|
|
2263
|
+
}
|
|
2206
2264
|
}
|
|
2207
2265
|
SplitterBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterBarComponent, deps: [{ token: i1$1.DraggableDirective, host: true }, { token: i1.LocalizationService }, { token: SplitterService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2208
|
-
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: `
|
|
2266
|
+
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: `
|
|
2209
2267
|
<div *ngIf="shouldShowIcon('prev')" class="k-collapse-prev" (click)="togglePrevious()">
|
|
2210
2268
|
<kendo-icon-wrapper
|
|
2211
2269
|
size="xsmall"
|
|
@@ -2253,6 +2311,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2253
2311
|
}, propDecorators: { ariaRole: [{
|
|
2254
2312
|
type: HostBinding,
|
|
2255
2313
|
args: ['attr.role']
|
|
2314
|
+
}], ariaLabel: [{
|
|
2315
|
+
type: HostBinding,
|
|
2316
|
+
args: ['attr.aria-label']
|
|
2256
2317
|
}], focused: [{
|
|
2257
2318
|
type: HostBinding,
|
|
2258
2319
|
args: ['class.k-focus']
|
|
@@ -2275,6 +2336,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2275
2336
|
type: Input
|
|
2276
2337
|
}], index: [{
|
|
2277
2338
|
type: Input
|
|
2339
|
+
}], htmlAttributes: [{
|
|
2340
|
+
type: Input
|
|
2278
2341
|
}] } });
|
|
2279
2342
|
|
|
2280
2343
|
/**
|
|
@@ -2357,6 +2420,7 @@ class SplitterComponent {
|
|
|
2357
2420
|
return this.direction;
|
|
2358
2421
|
}
|
|
2359
2422
|
set splitbars(splitbars) {
|
|
2423
|
+
this.splitterService.splitterBars = splitbars ? splitbars.toArray() : [];
|
|
2360
2424
|
if (!isPresent(splitbars) || !isPresent(this.panes)) {
|
|
2361
2425
|
return;
|
|
2362
2426
|
}
|
|
@@ -2369,9 +2433,9 @@ class SplitterComponent {
|
|
|
2369
2433
|
.sort((a, b) => a.order - b.order);
|
|
2370
2434
|
const elements = components.map(component => component.element.nativeElement);
|
|
2371
2435
|
panesArray.forEach((pane, i) => {
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2436
|
+
const splitbar = splitBarsArray[i];
|
|
2437
|
+
if (splitbar && pane.splitterBarAttributes) {
|
|
2438
|
+
splitbar.htmlAttributes = pane.splitterBarAttributes;
|
|
2375
2439
|
}
|
|
2376
2440
|
});
|
|
2377
2441
|
elements.forEach(element => this.renderer.appendChild(this.element.nativeElement, element));
|
|
@@ -2421,7 +2485,7 @@ class SplitterComponent {
|
|
|
2421
2485
|
}
|
|
2422
2486
|
}
|
|
2423
2487
|
SplitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterComponent, deps: [{ token: i0.ElementRef }, { token: SplitterService }, { token: i1.LocalizationService }, { token: i0.Renderer2 }, { token: SplitterPaneComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2424
|
-
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: [
|
|
2488
|
+
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: [
|
|
2425
2489
|
SplitterService,
|
|
2426
2490
|
LocalizationService,
|
|
2427
2491
|
{
|
|
@@ -2440,13 +2504,14 @@ SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
2440
2504
|
*ngIf="!last"
|
|
2441
2505
|
[index]="index"
|
|
2442
2506
|
[orientation]="orientation"
|
|
2507
|
+
[ngClass]="pane.splitterBarClass || splitterBarClass"
|
|
2443
2508
|
[ngStyle]="{
|
|
2444
2509
|
width: orientation === 'horizontal' ? splitbarWidth + 'px' : undefined,
|
|
2445
2510
|
height: orientation === 'vertical' ? splitbarWidth + 'px' : undefined
|
|
2446
2511
|
}">
|
|
2447
2512
|
</kendo-splitter-bar>
|
|
2448
2513
|
</ng-container>
|
|
2449
|
-
`, 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"] }] });
|
|
2514
|
+
`, 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"] }] });
|
|
2450
2515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SplitterComponent, decorators: [{
|
|
2451
2516
|
type: Component,
|
|
2452
2517
|
args: [{
|
|
@@ -2472,6 +2537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2472
2537
|
*ngIf="!last"
|
|
2473
2538
|
[index]="index"
|
|
2474
2539
|
[orientation]="orientation"
|
|
2540
|
+
[ngClass]="pane.splitterBarClass || splitterBarClass"
|
|
2475
2541
|
[ngStyle]="{
|
|
2476
2542
|
width: orientation === 'horizontal' ? splitbarWidth + 'px' : undefined,
|
|
2477
2543
|
height: orientation === 'vertical' ? splitbarWidth + 'px' : undefined
|
|
@@ -2480,7 +2546,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2480
2546
|
</ng-container>
|
|
2481
2547
|
`,
|
|
2482
2548
|
standalone: true,
|
|
2483
|
-
imports: [NgFor, NgIf, SplitterBarComponent, DraggableDirective, NgStyle]
|
|
2549
|
+
imports: [NgFor, NgIf, SplitterBarComponent, DraggableDirective, NgStyle, NgClass]
|
|
2484
2550
|
}]
|
|
2485
2551
|
}], ctorParameters: function () {
|
|
2486
2552
|
return [{ type: i0.ElementRef }, { type: SplitterService }, { type: i1.LocalizationService }, { type: i0.Renderer2 }, { type: SplitterPaneComponent, decorators: [{
|
|
@@ -2497,6 +2563,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2497
2563
|
type: Input
|
|
2498
2564
|
}], resizeStep: [{
|
|
2499
2565
|
type: Input
|
|
2566
|
+
}], splitterBarClass: [{
|
|
2567
|
+
type: Input
|
|
2500
2568
|
}], layoutChange: [{
|
|
2501
2569
|
type: Output
|
|
2502
2570
|
}], hostClasses: [{
|