@progress/kendo-angular-layout 7.1.5-dev.202210241150 → 7.1.6-dev.202211081310

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/avatar/avatar.component.d.ts +1 -1
  2. package/avatar.module.d.ts +1 -1
  3. package/bundles/kendo-angular-layout.umd.js +1 -1
  4. package/card.module.d.ts +1 -1
  5. package/drawer/models/drawer-animation.interface.d.ts +1 -1
  6. package/drawer/models/drawer-item.interface.d.ts +2 -2
  7. package/drawer.module.d.ts +1 -1
  8. package/esm2015/avatar.module.js +1 -1
  9. package/esm2015/card.module.js +1 -1
  10. package/esm2015/drawer/list.component.js +1 -0
  11. package/esm2015/drawer.module.js +1 -1
  12. package/esm2015/expansionpanel.module.js +1 -1
  13. package/esm2015/gridlayout.module.js +1 -1
  14. package/esm2015/layout.module.js +1 -1
  15. package/esm2015/package-metadata.js +1 -1
  16. package/esm2015/panelbar.module.js +1 -1
  17. package/esm2015/splitter/splitter-bar.component.js +54 -73
  18. package/esm2015/splitter/splitter-pane.component.js +7 -1
  19. package/esm2015/splitter/splitter.component.js +22 -2
  20. package/esm2015/splitter/splitter.service.js +19 -0
  21. package/esm2015/splitter/util.js +34 -0
  22. package/esm2015/splitter.module.js +1 -1
  23. package/esm2015/stacklayout.module.js +1 -1
  24. package/esm2015/stepper.module.js +1 -1
  25. package/esm2015/tabstrip.module.js +1 -1
  26. package/esm2015/tilelayout.module.js +1 -1
  27. package/expansionpanel.module.d.ts +1 -1
  28. package/fesm2015/kendo-angular-layout.js +142 -88
  29. package/gridlayout.module.d.ts +1 -1
  30. package/layout.module.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/panelbar.module.d.ts +1 -1
  33. package/splitter/splitter-bar.component.d.ts +7 -8
  34. package/splitter/splitter-pane.component.d.ts +5 -1
  35. package/splitter/splitter.component.d.ts +7 -1
  36. package/splitter/splitter.service.d.ts +3 -0
  37. package/splitter/util.d.ts +17 -0
  38. package/splitter.module.d.ts +1 -1
  39. package/stacklayout.module.d.ts +1 -1
  40. package/stepper/models/stepper-step.interface.d.ts +2 -2
  41. package/stepper.module.d.ts +1 -1
  42. package/tabstrip/models/tabstrip-tab.component.d.ts +2 -2
  43. package/tabstrip.module.d.ts +1 -1
  44. package/tilelayout.module.d.ts +1 -1
package/card.module.d.ts CHANGED
@@ -14,7 +14,7 @@ import * as i8 from "./card/directives/card-separator.directive";
14
14
  import * as i9 from "./card/directives/card-media.directive";
15
15
  import * as i10 from "@angular/common";
16
16
  /**
17
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
17
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
18
18
  * definition for the Card component.
19
19
  */
20
20
  export declare class CardModule {
@@ -13,7 +13,7 @@ export interface DrawerAnimation {
13
13
  */
14
14
  duration: number;
15
15
  /**
16
- * Specifies the type of the Drawer animation.
16
+ * Specifies the type of the Drawer animation. Currently, only the `slide` animation type is supported.
17
17
  */
18
18
  type?: string;
19
19
  }
@@ -8,12 +8,12 @@
8
8
  export interface DrawerItem {
9
9
  /**
10
10
  * The CSS classes that will be rendered on the item element of the Drawer.
11
- * Supports the type of values that are supported by [ngClass]({{ site.data.urls.angular['ngclassapi'] }}).
11
+ * Supports the type of values that are supported by [ngClass](link:site.data.urls.angular['ngclassapi']).
12
12
  */
13
13
  cssClass?: any;
14
14
  /**
15
15
  * The CSS styles that will be rendered on the item element of the Drawer.
16
- * Supports the type of values that are supported by [ngStyle]({{ site.data.urls.angular['ngstyleapi'] }}).
16
+ * Supports the type of values that are supported by [ngStyle](link:site.data.urls.angular['ngstyleapi']).
17
17
  */
18
18
  cssStyle?: any;
19
19
  /**
@@ -14,7 +14,7 @@ import * as i8 from "./drawer/template-directives/footer-template.directive";
14
14
  import * as i9 from "./drawer/template-directives/item-template.directive";
15
15
  import * as i10 from "@angular/common";
16
16
  /**
17
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
17
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
18
18
  * definition for the Drawer component.
19
19
  */
20
20
  export declare class DrawerModule {
@@ -13,7 +13,7 @@ const declarations = [
13
13
  ...exportedModules
14
14
  ];
15
15
  /**
16
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
16
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
17
17
  * definition for the Avatar component.
18
18
  */
19
19
  export class AvatarModule {
@@ -30,7 +30,7 @@ const exportedModules = [
30
30
  ];
31
31
  const declarations = [...exportedModules];
32
32
  /**
33
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
33
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
34
34
  * definition for the Card component.
35
35
  */
36
36
  export class CardModule {
@@ -52,6 +52,7 @@ export class DrawerListComponent {
52
52
  }
53
53
  else if (isArrowUpOrDown) {
54
54
  if (e.target.classList.contains('k-drawer-item')) {
55
+ e.preventDefault();
55
56
  const keyName = e.keyCode === Keys.ArrowUp ? 'arrowUp' : 'arrowDown';
56
57
  this.drawerService.changeFocusedItem(this.items, keyName, this.renderer);
57
58
  }
@@ -29,7 +29,7 @@ const declarations = [
29
29
  ...exportedModules
30
30
  ];
31
31
  /**
32
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
32
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
33
33
  * definition for the Drawer component.
34
34
  */
35
35
  export class DrawerModule {
@@ -16,7 +16,7 @@ const declarations = [
16
16
  ...exportedModules
17
17
  ];
18
18
  /**
19
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
19
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
20
20
  * definition for the ExpansionPanel component.
21
21
  */
22
22
  export class ExpansionPanelModule {
@@ -15,7 +15,7 @@ const declarations = [
15
15
  ...exportedModules
16
16
  ];
17
17
  /**
18
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
18
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
19
19
  * definition for the GridLayout component.
20
20
  */
21
21
  export class GridLayoutModule {
@@ -16,7 +16,7 @@ import { StackLayoutModule } from './stacklayout.module';
16
16
  import { GridLayoutModule } from './gridlayout.module';
17
17
  import * as i0 from "@angular/core";
18
18
  /**
19
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
19
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
20
20
  * definition for the Layout components.
21
21
  *
22
22
  * @example
@@ -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: 1666612185,
12
+ publishDate: 1667912971,
13
13
  version: '',
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
  };
@@ -21,7 +21,7 @@ const declarations = [
21
21
  ...exportedModules
22
22
  ];
23
23
  /**
24
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
24
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
25
25
  * definition for the PanelBar component.
26
26
  *
27
27
  * The module registers:
@@ -2,10 +2,11 @@
2
2
  * Copyright © 2021 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, Host, HostBinding, HostListener, Input } from '@angular/core';
5
+ import { Component, Host, HostBinding, Input } from '@angular/core';
6
6
  import { Keys } from '@progress/kendo-angular-common';
7
7
  import { Subscription, of } from 'rxjs';
8
8
  import { delay, filter, map, switchMap, takeUntil, tap } from 'rxjs/operators';
9
+ import { shouldToggleOrResize } from './util';
9
10
  import * as i0 from "@angular/core";
10
11
  import * as i1 from "@progress/kendo-angular-common";
11
12
  import * as i2 from "./splitter.service";
@@ -28,11 +29,12 @@ const createMoveStream = (draggable) => mouseDown => draggable.kendoDrag
28
29
  * @hidden
29
30
  */
30
31
  export class SplitterBarComponent {
31
- constructor(draggable, element, splitter, localization) {
32
+ constructor(draggable, element, splitterService, localization, renderer) {
32
33
  this.draggable = draggable;
33
34
  this.element = element;
34
- this.splitter = splitter;
35
+ this.splitterService = splitterService;
35
36
  this.localization = localization;
37
+ this.renderer = renderer;
36
38
  this.orientation = 'horizontal';
37
39
  this.index = 0;
38
40
  this.ariaRole = 'separator';
@@ -43,12 +45,12 @@ export class SplitterBarComponent {
43
45
  return this.localization.rtl ? 'rtl' : 'ltr';
44
46
  }
45
47
  get tabIndex() {
46
- return this.splitter.isStatic(this.index) ? -1 : 0;
48
+ return this.splitterService.isStatic(this.index) ? -1 : 0;
47
49
  }
48
50
  get hostClasses() {
49
51
  const isHorizontal = this.orientation === 'horizontal';
50
- const isDraggable = this.splitter.isDraggable(this.index);
51
- const isStatic = this.splitter.isStatic(this.index);
52
+ const isDraggable = this.splitterService.isDraggable(this.index);
53
+ const isStatic = this.splitterService.isStatic(this.index);
52
54
  return classFromObject({
53
55
  'k-focus': this.focused,
54
56
  'k-splitbar': true,
@@ -64,52 +66,13 @@ export class SplitterBarComponent {
64
66
  get order() {
65
67
  return 2 * this.index + 1;
66
68
  }
67
- collapseAny() {
68
- if (this.expandLast) {
69
- this.toggleNext();
70
- }
71
- else {
72
- this.tryToggleNearest();
73
- }
74
- }
75
- onFocusIn() {
76
- this.focused = true;
77
- }
78
- onFocusOut() {
79
- this.focused = false;
80
- }
81
- onKeyDown(event) {
82
- const keyCode = event && event.keyCode;
83
- const isHorizontal = this.orientation === 'horizontal';
84
- const resize = delta => {
85
- event.preventDefault();
86
- const state = this.splitter.dragState(this.index);
87
- this.splitter.setSize(state, delta);
88
- };
89
- if (keyCode === Keys.Enter) {
90
- event.preventDefault();
91
- this.collapseAny();
92
- }
93
- else if (isHorizontal && keyCode === Keys.ArrowLeft) {
94
- resize(-10);
95
- }
96
- else if (isHorizontal && keyCode === Keys.ArrowRight) {
97
- resize(10);
98
- }
99
- else if (!isHorizontal && keyCode === Keys.ArrowUp) {
100
- resize(-10);
101
- }
102
- else if (!isHorizontal && keyCode === Keys.ArrowDown) {
103
- resize(10);
104
- }
105
- }
106
69
  get expandLast() {
107
- const panes = this.splitter.panes;
70
+ const panes = this.splitterService.panes;
108
71
  return panes.length === 2 && panes[1].collapsed;
109
72
  }
110
73
  ngOnInit() {
111
74
  let state;
112
- const listener = this.draggable.kendoPress.pipe(tap(stopPropagation), filter(() => this.splitter.isDraggable(this.index)), tap(() => state = this.splitter.dragState(this.index)), tap(() => this.splitter.toggleContentOverlay(this.index, true)), switchMap(preventOnDblClick(this.draggable.kendoRelease)), switchMap(createMoveStream(this.draggable))).subscribe(({ pageX, pageY, originalX, originalY }) => {
75
+ 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 }) => {
113
76
  let delta;
114
77
  if (this.orientation === 'vertical') {
115
78
  delta = pageY - originalY;
@@ -120,10 +83,15 @@ export class SplitterBarComponent {
120
83
  else {
121
84
  delta = pageX - originalX;
122
85
  }
123
- this.splitter.setSize(state, delta);
86
+ this.splitterService.setSize(state, delta);
124
87
  });
125
88
  this.subscriptions.add(listener);
126
- this.subscriptions.add(this.draggable.kendoRelease.subscribe(() => this.splitter.toggleContentOverlay(this.index, false)));
89
+ this.subscriptions.add(this.draggable.kendoRelease.subscribe(() => this.splitterService.toggleContentOverlay(this.index, false)));
90
+ const element = this.element.nativeElement;
91
+ this.subscriptions.add(this.renderer.listen(element, 'keydown', event => this.onKeyDown(event)));
92
+ this.subscriptions.add(this.renderer.listen(element, 'focusin', () => this.focused = true));
93
+ this.subscriptions.add(this.renderer.listen(element, 'focusout', () => this.focused = false));
94
+ this.subscriptions.add(this.renderer.listen(element, 'dblclick', () => this.togglePane()));
127
95
  }
128
96
  ngOnDestroy() {
129
97
  if (this.subscriptions) {
@@ -131,26 +99,26 @@ export class SplitterBarComponent {
131
99
  }
132
100
  }
133
101
  togglePrevious() {
134
- this.splitter.tryToggle(this.index);
102
+ this.splitterService.tryToggle(this.index);
135
103
  }
136
104
  toggleNext() {
137
- this.splitter.tryToggle(this.index + 1);
105
+ this.splitterService.tryToggle(this.index + 1);
138
106
  }
139
107
  shouldShowIcon(iconName) {
140
108
  const paneIndex = iconName === 'prev' ? this.index : this.index + 1;
141
109
  const relatedPaneIndex = iconName === 'prev' ? this.index + 1 : this.index;
142
- const pane = this.splitter.pane(paneIndex);
143
- const relatedPane = this.splitter.pane(relatedPaneIndex);
110
+ const pane = this.splitterService.pane(paneIndex);
111
+ const relatedPane = this.splitterService.pane(relatedPaneIndex);
144
112
  const isCollapsible = pane.collapsible;
145
113
  return isCollapsible && !relatedPane.isHidden;
146
114
  }
147
115
  collapseClass(order) {
148
- const pane = this.splitter.pane(this.index);
116
+ const pane = this.splitterService.pane(this.index);
149
117
  const isCollapsible = pane.collapsible;
150
118
  return isCollapsible ? `k-collapse-${order}` : '';
151
119
  }
152
120
  previousArrowClass() {
153
- const pane = this.splitter.pane(this.index);
121
+ const pane = this.splitterService.pane(this.index);
154
122
  const isCollapsible = pane.collapsible;
155
123
  const isCollapsed = pane.collapsed;
156
124
  const isHorizontal = this.orientation === 'horizontal';
@@ -163,7 +131,7 @@ export class SplitterBarComponent {
163
131
  });
164
132
  }
165
133
  nextArrowClass() {
166
- const pane = this.splitter.pane(this.index + 1);
134
+ const pane = this.splitterService.pane(this.index + 1);
167
135
  const isCollapsible = pane.collapsible;
168
136
  const isCollapsed = pane.collapsed;
169
137
  const isHorizontal = this.orientation === 'horizontal';
@@ -175,16 +143,41 @@ export class SplitterBarComponent {
175
143
  'k-i-caret-alt-up': isCollapsible && !isHorizontal && isCollapsed
176
144
  });
177
145
  }
146
+ togglePane() {
147
+ if (this.expandLast) {
148
+ this.toggleNext();
149
+ }
150
+ else {
151
+ this.tryToggleNearest();
152
+ }
153
+ }
154
+ onKeyDown(event) {
155
+ const keyCode = event.keyCode;
156
+ const shouldToggle = event.ctrlKey || event.metaKey;
157
+ if (keyCode === Keys.Enter) {
158
+ event.preventDefault();
159
+ this.togglePane();
160
+ }
161
+ else if (shouldToggleOrResize(keyCode, this.orientation)) {
162
+ event.preventDefault();
163
+ if (shouldToggle) {
164
+ this.splitterService.togglePane(keyCode, this.index);
165
+ }
166
+ else {
167
+ this.splitterService.resizePane(keyCode, this.index);
168
+ }
169
+ }
170
+ }
178
171
  tryToggleNearest() {
179
172
  const prev = this.index;
180
173
  const next = this.index + 1;
181
- if (!this.splitter.tryToggle(prev)) {
182
- this.splitter.tryToggle(next);
174
+ if (!this.splitterService.tryToggle(prev)) {
175
+ this.splitterService.tryToggle(next);
183
176
  }
184
177
  }
185
178
  }
186
- SplitterBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitterBarComponent, deps: [{ token: i1.DraggableDirective, host: true }, { token: i0.ElementRef }, { token: i2.SplitterService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
187
- SplitterBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterBarComponent, selector: "kendo-splitter-bar", inputs: { orientation: "orientation", index: "index" }, host: { listeners: { "dblclick": "collapseAny()", "focusin": "onFocusIn()", "focusout": "onFocusOut()", "keydown": "onKeyDown($event)" }, properties: { "attr.aria-orientation": "this.orientation", "attr.role": "this.ariaRole", "class.k-focus": "this.focused", "attr.tabindex": "this.tabIndex", "class": "this.hostClasses", "style.-ms-flex-order": "this.order", "style.order": "this.order" } }, ngImport: i0, template: `
179
+ SplitterBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitterBarComponent, deps: [{ token: i1.DraggableDirective, host: true }, { token: i0.ElementRef }, { token: i2.SplitterService }, { token: i3.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
180
+ SplitterBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterBarComponent, selector: "kendo-splitter-bar", inputs: { orientation: "orientation", index: "index" }, host: { properties: { "attr.aria-orientation": "this.orientation", "attr.role": "this.ariaRole", "class.k-focus": "this.focused", "attr.tabindex": "this.tabIndex", "class": "this.hostClasses", "style.-ms-flex-order": "this.order", "style.order": "this.order" } }, ngImport: i0, template: `
188
181
  <div *ngIf="shouldShowIcon('prev')" [class]="collapseClass('prev')" (click)="togglePrevious()">
189
182
  <span [class]="previousArrowClass()"></span>
190
183
  </div>
@@ -209,7 +202,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
209
202
  }]
210
203
  }], ctorParameters: function () { return [{ type: i1.DraggableDirective, decorators: [{
211
204
  type: Host
212
- }] }, { type: i0.ElementRef }, { type: i2.SplitterService }, { type: i3.LocalizationService }]; }, propDecorators: { orientation: [{
205
+ }] }, { type: i0.ElementRef }, { type: i2.SplitterService }, { type: i3.LocalizationService }, { type: i0.Renderer2 }]; }, propDecorators: { orientation: [{
213
206
  type: Input
214
207
  }, {
215
208
  type: HostBinding,
@@ -234,16 +227,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
234
227
  }, {
235
228
  type: HostBinding,
236
229
  args: ['style.order']
237
- }], collapseAny: [{
238
- type: HostListener,
239
- args: ['dblclick']
240
- }], onFocusIn: [{
241
- type: HostListener,
242
- args: ['focusin']
243
- }], onFocusOut: [{
244
- type: HostListener,
245
- args: ['focusout']
246
- }], onKeyDown: [{
247
- type: HostListener,
248
- args: ['keydown', ['$event']]
249
230
  }] } });
@@ -13,6 +13,10 @@ export class SplitterPaneComponent {
13
13
  this.element = element;
14
14
  this.renderer = renderer;
15
15
  this.cdr = cdr;
16
+ /**
17
+ * The value of the aria-label attribute of the auxiliary separator.
18
+ */
19
+ this.separatorLabel = 'Splitter pane';
16
20
  /**
17
21
  * Specifies if the user is allowed to resize the pane and provide space for other panes.
18
22
  */
@@ -158,7 +162,7 @@ export class SplitterPaneComponent {
158
162
  }
159
163
  }
160
164
  SplitterPaneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitterPaneComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
161
- SplitterPaneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterPaneComponent, selector: "kendo-splitter-pane", inputs: { order: "order", size: "size", 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: `
165
+ SplitterPaneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterPaneComponent, 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: `
162
166
  <ng-container *ngIf="!collapsed"><ng-content></ng-content></ng-container>
163
167
  <div *ngIf="overlayContent" class="k-splitter-overlay k-overlay"></div>
164
168
  `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
@@ -176,6 +180,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
176
180
  type: Input
177
181
  }], size: [{
178
182
  type: Input
183
+ }], separatorLabel: [{
184
+ type: Input
179
185
  }], min: [{
180
186
  type: Input
181
187
  }], max: [{
@@ -74,6 +74,16 @@ export class SplitterComponent {
74
74
  this.layoutChange = this.splitterService.layoutChange;
75
75
  this.configure = this.configure.bind(this);
76
76
  }
77
+ /**
78
+ * The distance in pixels that the separator is moved with during keyboard navigation.
79
+ * @default 10
80
+ */
81
+ set resizeStep(value) {
82
+ this.splitterService.resizeStep = value;
83
+ }
84
+ get resizeStep() {
85
+ return this.splitterService.resizeStep;
86
+ }
77
87
  get hostClasses() {
78
88
  return true;
79
89
  }
@@ -90,9 +100,17 @@ export class SplitterComponent {
90
100
  if (!isPresent(splitbars) || !isPresent(this.panes)) {
91
101
  return;
92
102
  }
93
- const components = [...this.panes.toArray(), ...splitbars.toArray()]
103
+ const panesArray = this.panes.toArray();
104
+ const splitBarsArray = splitbars.toArray();
105
+ const components = [...panesArray, ...splitBarsArray]
94
106
  .sort((a, b) => a.order - b.order);
95
107
  const elements = components.map(component => component.element.nativeElement);
108
+ panesArray.forEach((pane, i) => {
109
+ if (splitBarsArray[i] && pane.separatorLabel) {
110
+ const splitbar = splitBarsArray[i].element.nativeElement;
111
+ this.renderer.setAttribute(splitbar, 'aria-label', pane.separatorLabel);
112
+ }
113
+ });
96
114
  elements.forEach(element => this.renderer.appendChild(this.element.nativeElement, element));
97
115
  }
98
116
  ngAfterContentInit() {
@@ -139,7 +157,7 @@ export class SplitterComponent {
139
157
  }
140
158
  }
141
159
  SplitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", 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 });
142
- SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterComponent, selector: "kendo-splitter", inputs: { orientation: "orientation" }, 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: [
160
+ SplitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitterComponent, selector: "kendo-splitter", inputs: { orientation: "orientation", 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: [
143
161
  SplitterService,
144
162
  LocalizationService,
145
163
  {
@@ -199,6 +217,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
199
217
  args: [SplitterPaneComponent]
200
218
  }] }]; }, propDecorators: { orientation: [{
201
219
  type: Input
220
+ }], resizeStep: [{
221
+ type: Input
202
222
  }], layoutChange: [{
203
223
  type: Output
204
224
  }], hostClasses: [{
@@ -3,6 +3,8 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { isDevMode, EventEmitter, Injectable } from '@angular/core';
6
+ import { Keys } from '@progress/kendo-angular-common';
7
+ import { shouldTogglePrev, shouldToggleNext } from './util';
6
8
  import * as i0 from "@angular/core";
7
9
  const SIZING_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/layout/splitter/panes/#toc-size';
8
10
  /**
@@ -12,6 +14,7 @@ export class SplitterService {
12
14
  constructor(zone) {
13
15
  this.zone = zone;
14
16
  this.layoutChange = new EventEmitter();
17
+ this.resizeStep = 10;
15
18
  this.containerSize = () => { };
16
19
  }
17
20
  tryToggle(paneIndex) {
@@ -29,6 +32,22 @@ export class SplitterService {
29
32
  notCollapsed[notCollapsed.length - 1].forceExpand = allHaveFixedSize ? true : false;
30
33
  return pane.collapsible;
31
34
  }
35
+ togglePane(keyCode, index) {
36
+ const prev = this.pane(index);
37
+ const next = this.pane(index + 1);
38
+ if (shouldTogglePrev(keyCode, prev, next)) {
39
+ this.tryToggle(index);
40
+ }
41
+ else if (shouldToggleNext(keyCode, prev, next)) {
42
+ this.tryToggle(index + 1);
43
+ }
44
+ }
45
+ resizePane(keyCode, index) {
46
+ const state = this.dragState(index);
47
+ const direction = keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowUp;
48
+ const step = direction ? (-this.resizeStep) : this.resizeStep;
49
+ this.setSize(state, step);
50
+ }
32
51
  toggleContentOverlay(index, show) {
33
52
  this.pane(index).toggleOverlay(show);
34
53
  this.pane(index + 1).toggleOverlay(show);
@@ -0,0 +1,34 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Keys } from "@progress/kendo-angular-common";
6
+ /**
7
+ * @hidden
8
+ */
9
+ export const shouldTogglePrev = (keyCode, prev, next) => {
10
+ const leftArrow = keyCode === Keys.ArrowLeft;
11
+ const upArrow = keyCode === Keys.ArrowUp;
12
+ const collapsePrev = !prev.collapsed && !next.collapsed && (leftArrow || upArrow);
13
+ const expandPrev = prev.collapsed && !(leftArrow || upArrow);
14
+ return collapsePrev || expandPrev;
15
+ };
16
+ /**
17
+ * @hidden
18
+ */
19
+ export const shouldToggleNext = (keyCode, prev, next) => {
20
+ const leftArrow = keyCode === Keys.ArrowLeft;
21
+ const upArrow = keyCode === Keys.ArrowUp;
22
+ const collapseNext = !next.collapsed && !prev.collapsed && !(leftArrow || upArrow);
23
+ const expandNext = next.collapsed && (leftArrow || upArrow);
24
+ return collapseNext || expandNext;
25
+ };
26
+ /**
27
+ * @hidden
28
+ */
29
+ export const shouldToggleOrResize = (keyCode, orientation) => {
30
+ const isHorizontal = orientation === 'horizontal';
31
+ const isHorizontalChange = isHorizontal && (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight);
32
+ const isVerticalChange = !isHorizontal && (keyCode === Keys.ArrowUp || keyCode === Keys.ArrowDown);
33
+ return isHorizontalChange || isVerticalChange;
34
+ };
@@ -18,7 +18,7 @@ const declarations = [
18
18
  ...exportedModules
19
19
  ];
20
20
  /**
21
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
21
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
22
22
  * definition for the Splitter component.
23
23
  *
24
24
  * The module registers:
@@ -13,7 +13,7 @@ const declarations = [
13
13
  ...exportedModules
14
14
  ];
15
15
  /**
16
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
16
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
17
17
  * definition for the StackLayout component.
18
18
  */
19
19
  export class StackLayoutModule {
@@ -31,7 +31,7 @@ const declarations = [
31
31
  ...exportedModules
32
32
  ];
33
33
  /**
34
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
34
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
35
35
  * definition for the Stepper component.
36
36
  */
37
37
  export class StepperModule {
@@ -28,7 +28,7 @@ const declarations = [
28
28
  TabStripScrollableButtonComponent
29
29
  ];
30
30
  /**
31
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
31
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
32
32
  * definition for the TabStrip component.
33
33
  *
34
34
  * The module registers:
@@ -21,7 +21,7 @@ const declarations = [
21
21
  ...exportedModules
22
22
  ];
23
23
  /**
24
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
24
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
25
25
  * definition for the TileLayout component.
26
26
  *
27
27
  * The module registers:
@@ -8,7 +8,7 @@ import * as i2 from "./expansionpanel/expansionpanel-title.directive";
8
8
  import * as i3 from "@angular/common";
9
9
  import * as i4 from "@progress/kendo-angular-common";
10
10
  /**
11
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
11
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
12
12
  * definition for the ExpansionPanel component.
13
13
  */
14
14
  export declare class ExpansionPanelModule {