@progress/kendo-angular-layout 6.4.1 → 6.5.0-dev.202202091626

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 (82) hide show
  1. package/dist/cdn/js/kendo-angular-layout.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/util.js +4 -0
  4. package/dist/es/expansionpanel/expansionpanel.component.js +1 -0
  5. package/dist/es/gridlayout.module.js +31 -0
  6. package/dist/es/layout.module.js +5 -1
  7. package/dist/es/layouts/grid-layout.component.js +150 -0
  8. package/dist/es/layouts/gridlayout-item.component.js +52 -0
  9. package/dist/es/layouts/models/gridlayout-gap-settings.js +4 -0
  10. package/dist/es/layouts/models/gridlayout-row-col-size.js +4 -0
  11. package/dist/es/layouts/models/layout-align-settings.js +4 -0
  12. package/dist/es/layouts/models/layout-horizontal-align.js +4 -0
  13. package/dist/es/layouts/models/layout-vertical-align.js +4 -0
  14. package/dist/es/layouts/models.js +4 -0
  15. package/dist/es/layouts/stack-layout.component.js +171 -0
  16. package/dist/es/layouts/util.js +87 -0
  17. package/dist/es/main.js +7 -0
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/es/splitter/splitter-bar.component.js +4 -2
  20. package/dist/es/splitter/splitter.component.js +25 -3
  21. package/dist/es/stacklayout.module.js +29 -0
  22. package/dist/es2015/common/orientation.d.ts +1 -1
  23. package/dist/es2015/common/util.d.ts +4 -0
  24. package/dist/es2015/common/util.js +4 -0
  25. package/dist/es2015/expansionpanel/expansionpanel.component.js +1 -0
  26. package/dist/es2015/gridlayout.module.d.ts +10 -0
  27. package/dist/es2015/gridlayout.module.js +30 -0
  28. package/dist/es2015/index.metadata.json +1 -1
  29. package/dist/es2015/layout.module.js +5 -1
  30. package/dist/es2015/layouts/grid-layout.component.d.ts +47 -0
  31. package/dist/es2015/layouts/grid-layout.component.js +139 -0
  32. package/dist/es2015/layouts/gridlayout-item.component.d.ts +33 -0
  33. package/dist/es2015/layouts/gridlayout-item.component.js +53 -0
  34. package/dist/es2015/layouts/models/gridlayout-gap-settings.d.ts +17 -0
  35. package/dist/es2015/layouts/models/gridlayout-gap-settings.js +4 -0
  36. package/dist/es2015/layouts/models/gridlayout-row-col-size.d.ts +22 -0
  37. package/dist/es2015/layouts/models/gridlayout-row-col-size.js +4 -0
  38. package/dist/es2015/layouts/models/layout-align-settings.d.ts +18 -0
  39. package/dist/es2015/layouts/models/layout-align-settings.js +4 -0
  40. package/dist/es2015/layouts/models/layout-horizontal-align.d.ts +8 -0
  41. package/dist/es2015/layouts/models/layout-horizontal-align.js +4 -0
  42. package/dist/es2015/layouts/models/layout-vertical-align.d.ts +8 -0
  43. package/dist/es2015/layouts/models/layout-vertical-align.js +4 -0
  44. package/dist/es2015/layouts/models.d.ts +10 -0
  45. package/dist/es2015/layouts/models.js +4 -0
  46. package/dist/es2015/layouts/stack-layout.component.d.ts +47 -0
  47. package/dist/es2015/layouts/stack-layout.component.js +152 -0
  48. package/dist/es2015/layouts/util.d.ts +38 -0
  49. package/dist/es2015/layouts/util.js +87 -0
  50. package/dist/es2015/main.d.ts +7 -0
  51. package/dist/es2015/main.js +7 -0
  52. package/dist/es2015/package-metadata.js +1 -1
  53. package/dist/es2015/splitter/splitter-bar.component.d.ts +3 -2
  54. package/dist/es2015/splitter/splitter-bar.component.js +4 -2
  55. package/dist/es2015/splitter/splitter-pane.component.d.ts +2 -2
  56. package/dist/es2015/splitter/splitter.component.d.ts +6 -3
  57. package/dist/es2015/splitter/splitter.component.js +21 -3
  58. package/dist/es2015/stacklayout.module.d.ts +10 -0
  59. package/dist/es2015/stacklayout.module.js +28 -0
  60. package/dist/fesm2015/index.js +707 -243
  61. package/dist/fesm5/index.js +878 -379
  62. package/dist/npm/common/util.js +4 -0
  63. package/dist/npm/expansionpanel/expansionpanel.component.js +1 -0
  64. package/dist/npm/gridlayout.module.js +33 -0
  65. package/dist/npm/layout.module.js +5 -1
  66. package/dist/npm/layouts/grid-layout.component.js +152 -0
  67. package/dist/npm/layouts/gridlayout-item.component.js +54 -0
  68. package/dist/npm/layouts/models/gridlayout-gap-settings.js +6 -0
  69. package/dist/npm/layouts/models/gridlayout-row-col-size.js +6 -0
  70. package/dist/npm/layouts/models/layout-align-settings.js +6 -0
  71. package/dist/npm/layouts/models/layout-horizontal-align.js +6 -0
  72. package/dist/npm/layouts/models/layout-vertical-align.js +6 -0
  73. package/dist/npm/layouts/models.js +6 -0
  74. package/dist/npm/layouts/stack-layout.component.js +173 -0
  75. package/dist/npm/layouts/util.js +89 -0
  76. package/dist/npm/main.js +12 -0
  77. package/dist/npm/package-metadata.js +1 -1
  78. package/dist/npm/splitter/splitter-bar.component.js +3 -1
  79. package/dist/npm/splitter/splitter.component.js +24 -2
  80. package/dist/npm/stacklayout.module.js +31 -0
  81. package/dist/systemjs/kendo-angular-layout.js +1 -1
  82. package/package.json +10 -8
@@ -0,0 +1,87 @@
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
+ /**
6
+ * @hidden
7
+ */
8
+ export const VERTICAL_SUFFIX = {
9
+ top: 'start',
10
+ middle: 'center',
11
+ bottom: 'end',
12
+ stretch: 'stretch'
13
+ };
14
+ /**
15
+ * @hidden
16
+ */
17
+ export const JUSTIFY_PREFIX = `k-justify-content`;
18
+ /**
19
+ * @hidden
20
+ */
21
+ export const GRID_JUSTIFY_PREFIX = `k-justify-items`;
22
+ /**
23
+ * @hidden
24
+ */
25
+ export const ALIGN_PREFIX = `k-align-items`;
26
+ /**
27
+ * @hidden
28
+ */
29
+ export const normalizeGap = (gap) => {
30
+ if (typeof gap === 'number' || typeof gap === 'string') {
31
+ return { cols: gap, rows: gap };
32
+ }
33
+ else {
34
+ let parsedGap = {};
35
+ parsedGap.rows = gap.rows ? gap.rows : 0;
36
+ parsedGap.cols = gap.cols ? gap.cols : 0;
37
+ return parsedGap;
38
+ }
39
+ };
40
+ /**
41
+ * @hidden
42
+ */
43
+ export const generateGapStyle = (gap) => {
44
+ if (gap.rows === gap.cols) {
45
+ return typeof gap.rows === 'number' ? `${gap.rows}px` : gap.rows;
46
+ }
47
+ else {
48
+ let rowStyle = `${typeof gap.rows === 'number' ? gap.rows + 'px' : gap.rows}`;
49
+ let colStyle = `${typeof gap.cols === 'number' ? gap.cols + 'px' : gap.cols}`;
50
+ return `${rowStyle} ${colStyle}`;
51
+ }
52
+ };
53
+ /**
54
+ * @hidden
55
+ */
56
+ export const generateGridStyle = (items, itemType) => {
57
+ let styling = [];
58
+ items.forEach((item) => {
59
+ if (typeof item === 'number') {
60
+ styling.push(`${item}px`);
61
+ }
62
+ else if (typeof item === 'string') {
63
+ styling.push(item);
64
+ }
65
+ else {
66
+ if (itemType === 'rows') {
67
+ const rowHeight = item.height;
68
+ if (rowHeight) {
69
+ styling.push(typeof rowHeight === 'number' ? `${rowHeight}px` : rowHeight);
70
+ }
71
+ else {
72
+ styling.push('0px');
73
+ }
74
+ }
75
+ else {
76
+ const colWidth = item.width;
77
+ if (colWidth) {
78
+ styling.push(typeof colWidth === 'number' ? `${colWidth}px` : colWidth);
79
+ }
80
+ else {
81
+ styling.push('0px');
82
+ }
83
+ }
84
+ }
85
+ });
86
+ return styling;
87
+ };
@@ -69,3 +69,10 @@ export { StepperModule } from './stepper.module';
69
69
  export { TabStripModule } from './tabstrip.module';
70
70
  export { ExpansionPanelModule } from './expansionpanel.module';
71
71
  export { TileLayoutModule } from './tilelayout.module';
72
+ export { StackLayoutModule } from './stacklayout.module';
73
+ export { GridLayoutModule } from './gridlayout.module';
74
+ export { StackLayoutComponent } from './layouts/stack-layout.component';
75
+ export { AlignSettings, HorizontalAlign, VerticalAlign } from './layouts/models';
76
+ export { GridLayoutComponent } from './layouts/grid-layout.component';
77
+ export { GridLayoutItemComponent } from './layouts/gridlayout-item.component';
78
+ export { GridLayoutRowSize, GridLayoutColSize, GridLayoutGapSettings } from './layouts/models';
@@ -63,3 +63,10 @@ export { StepperModule } from './stepper.module';
63
63
  export { TabStripModule } from './tabstrip.module';
64
64
  export { ExpansionPanelModule } from './expansionpanel.module';
65
65
  export { TileLayoutModule } from './tilelayout.module';
66
+ export { StackLayoutModule } from './stacklayout.module';
67
+ export { GridLayoutModule } from './gridlayout.module';
68
+ // StackLayout exports
69
+ export { StackLayoutComponent } from './layouts/stack-layout.component';
70
+ // GridLayout exports
71
+ export { GridLayoutComponent } from './layouts/grid-layout.component';
72
+ export { GridLayoutItemComponent } from './layouts/gridlayout-item.component';
@@ -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: 1643117691,
12
+ publishDate: 1644423873,
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
  };
@@ -2,7 +2,7 @@
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 { OnDestroy, OnInit } from '@angular/core';
5
+ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
6
6
  import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { Orientation } from '../common/orientation';
8
8
  import { DraggableDirective } from '@progress/kendo-angular-common';
@@ -12,6 +12,7 @@ import { SplitterService } from './splitter.service';
12
12
  */
13
13
  export declare class SplitterBarComponent implements OnInit, OnDestroy {
14
14
  draggable: DraggableDirective;
15
+ element: ElementRef<HTMLElement>;
15
16
  private splitter;
16
17
  private localization;
17
18
  orientation: Orientation;
@@ -28,7 +29,7 @@ export declare class SplitterBarComponent implements OnInit, OnDestroy {
28
29
  onFocusOut(): void;
29
30
  onKeyDown(event: any): void;
30
31
  private readonly expandLast;
31
- constructor(draggable: DraggableDirective, splitter: SplitterService, localization: LocalizationService);
32
+ constructor(draggable: DraggableDirective, element: ElementRef<HTMLElement>, splitter: SplitterService, localization: LocalizationService);
32
33
  ngOnInit(): void;
33
34
  ngOnDestroy(): void;
34
35
  togglePrevious(): void;
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Component, Host, HostBinding, HostListener, Input } from '@angular/core';
6
+ import { Component, ElementRef, Host, HostBinding, HostListener, Input } from '@angular/core';
7
7
  import { LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { DraggableDirective, Keys } from '@progress/kendo-angular-common';
9
9
  import { SplitterService } from './splitter.service';
@@ -30,8 +30,9 @@ const ɵ3 = createMoveStream;
30
30
  * @hidden
31
31
  */
32
32
  let SplitterBarComponent = class SplitterBarComponent {
33
- constructor(draggable, splitter, localization) {
33
+ constructor(draggable, element, splitter, localization) {
34
34
  this.draggable = draggable;
35
+ this.element = element;
35
36
  this.splitter = splitter;
36
37
  this.localization = localization;
37
38
  this.orientation = 'horizontal';
@@ -245,6 +246,7 @@ SplitterBarComponent = tslib_1.__decorate([
245
246
  }),
246
247
  tslib_1.__param(0, Host()),
247
248
  tslib_1.__metadata("design:paramtypes", [DraggableDirective,
249
+ ElementRef,
248
250
  SplitterService,
249
251
  LocalizationService])
250
252
  ], SplitterBarComponent);
@@ -8,7 +8,7 @@ import { Orientation } from '../common/orientation';
8
8
  * Represents the pane component of the Splitter.
9
9
  */
10
10
  export declare class SplitterPaneComponent implements AfterViewChecked {
11
- private element;
11
+ element: ElementRef<HTMLElement>;
12
12
  private renderer;
13
13
  private cdr;
14
14
  /**
@@ -83,7 +83,7 @@ export declare class SplitterPaneComponent implements AfterViewChecked {
83
83
  isResized: boolean;
84
84
  private _size;
85
85
  private _order;
86
- constructor(element: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef);
86
+ constructor(element: ElementRef<HTMLElement>, renderer: Renderer2, cdr: ChangeDetectorRef);
87
87
  ngAfterViewChecked(): void;
88
88
  /**
89
89
  * @hidden
@@ -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 { ElementRef, EventEmitter, AfterContentInit, QueryList } from '@angular/core';
5
+ import { ElementRef, EventEmitter, AfterContentInit, QueryList, Renderer2 } from '@angular/core';
6
6
  import { LocalizationService } from '@progress/kendo-angular-l10n';
7
7
  import { Orientation } from '../common/orientation';
8
8
  import { SplitterPaneComponent } from './splitter-pane.component';
9
+ import { SplitterBarComponent } from './splitter-bar.component';
9
10
  import { SplitterService } from './splitter.service';
10
11
  /**
11
12
  * Represents the [Kendo UI Splitter component for Angular]({% slug overview_splitter %}).
@@ -43,9 +44,10 @@ import { SplitterService } from './splitter.service';
43
44
  * ```
44
45
  */
45
46
  export declare class SplitterComponent implements AfterContentInit {
46
- protected element: ElementRef;
47
+ protected element: ElementRef<HTMLElement>;
47
48
  protected splitterService: SplitterService;
48
49
  private localization;
50
+ private renderer;
49
51
  private enclosingPane?;
50
52
  /**
51
53
  * Specifies the orientation of the panes within the Splitter.
@@ -64,12 +66,13 @@ export declare class SplitterComponent implements AfterContentInit {
64
66
  readonly verticalHostClasses: boolean;
65
67
  readonly dir: string;
66
68
  ariaRole: string;
69
+ splitbars: QueryList<SplitterBarComponent>;
67
70
  /**
68
71
  * @hidden
69
72
  */
70
73
  panes: QueryList<SplitterPaneComponent>;
71
74
  private paneChangesSubscription;
72
- constructor(element: ElementRef, splitterService: SplitterService, localization: LocalizationService, enclosingPane?: SplitterPaneComponent);
75
+ constructor(element: ElementRef<HTMLElement>, splitterService: SplitterService, localization: LocalizationService, renderer: Renderer2, enclosingPane?: SplitterPaneComponent);
73
76
  ngAfterContentInit(): void;
74
77
  ngOnChanges(changes: any): void;
75
78
  ngOnDestroy(): void;
@@ -3,12 +3,14 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Component, ElementRef, EventEmitter, ContentChildren, Host, HostBinding, Inject, Input, Optional, Output, QueryList } from '@angular/core';
6
+ import { Component, ElementRef, EventEmitter, ContentChildren, Host, HostBinding, Inject, Input, Optional, Output, QueryList, ViewChildren, Renderer2 } from '@angular/core';
7
7
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
8
8
  import { validatePackage } from '@progress/kendo-licensing';
9
9
  import { packageMetadata } from '../package-metadata';
10
10
  import { SplitterPaneComponent } from './splitter-pane.component';
11
+ import { SplitterBarComponent } from './splitter-bar.component';
11
12
  import { SplitterService } from './splitter.service';
13
+ import { isPresent } from '../common/util';
12
14
  /**
13
15
  * Represents the [Kendo UI Splitter component for Angular]({% slug overview_splitter %}).
14
16
  *
@@ -45,10 +47,11 @@ import { SplitterService } from './splitter.service';
45
47
  * ```
46
48
  */
47
49
  let SplitterComponent = class SplitterComponent {
48
- constructor(element, splitterService, localization, enclosingPane) {
50
+ constructor(element, splitterService, localization, renderer, enclosingPane) {
49
51
  this.element = element;
50
52
  this.splitterService = splitterService;
51
53
  this.localization = localization;
54
+ this.renderer = renderer;
52
55
  this.enclosingPane = enclosingPane;
53
56
  /**
54
57
  * Specifies the orientation of the panes within the Splitter.
@@ -78,6 +81,15 @@ let SplitterComponent = class SplitterComponent {
78
81
  get dir() {
79
82
  return this.direction;
80
83
  }
84
+ set splitbars(splitbars) {
85
+ if (!isPresent(splitbars) || !isPresent(this.panes)) {
86
+ return;
87
+ }
88
+ const components = [...this.panes.toArray(), ...splitbars.toArray()]
89
+ .sort((a, b) => a.order - b.order);
90
+ const elements = components.map(component => component.element.nativeElement);
91
+ elements.forEach(element => this.renderer.appendChild(this.element.nativeElement, element));
92
+ }
81
93
  ngAfterContentInit() {
82
94
  this.reconfigure();
83
95
  }
@@ -155,6 +167,11 @@ tslib_1.__decorate([
155
167
  HostBinding('attr.role'),
156
168
  tslib_1.__metadata("design:type", String)
157
169
  ], SplitterComponent.prototype, "ariaRole", void 0);
170
+ tslib_1.__decorate([
171
+ ViewChildren(SplitterBarComponent),
172
+ tslib_1.__metadata("design:type", QueryList),
173
+ tslib_1.__metadata("design:paramtypes", [QueryList])
174
+ ], SplitterComponent.prototype, "splitbars", null);
158
175
  tslib_1.__decorate([
159
176
  ContentChildren(SplitterPaneComponent),
160
177
  tslib_1.__metadata("design:type", QueryList)
@@ -187,10 +204,11 @@ SplitterComponent = tslib_1.__decorate([
187
204
  </ng-container>
188
205
  `
189
206
  }),
190
- tslib_1.__param(3, Optional()), tslib_1.__param(3, Host()), tslib_1.__param(3, Inject(SplitterPaneComponent)),
207
+ tslib_1.__param(4, Optional()), tslib_1.__param(4, Host()), tslib_1.__param(4, Inject(SplitterPaneComponent)),
191
208
  tslib_1.__metadata("design:paramtypes", [ElementRef,
192
209
  SplitterService,
193
210
  LocalizationService,
211
+ Renderer2,
194
212
  SplitterPaneComponent])
195
213
  ], SplitterComponent);
196
214
  export { SplitterComponent };
@@ -0,0 +1,10 @@
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
+ /**
6
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
7
+ * definition for the StackLayout component.
8
+ */
9
+ export declare class StackLayoutModule {
10
+ }
@@ -0,0 +1,28 @@
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 * as tslib_1 from "tslib";
6
+ import { NgModule } from '@angular/core';
7
+ import { CommonModule } from '@angular/common';
8
+ import { StackLayoutComponent } from './layouts/stack-layout.component';
9
+ const exportedModules = [
10
+ StackLayoutComponent
11
+ ];
12
+ const declarations = [
13
+ ...exportedModules
14
+ ];
15
+ /**
16
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
17
+ * definition for the StackLayout component.
18
+ */
19
+ let StackLayoutModule = class StackLayoutModule {
20
+ };
21
+ StackLayoutModule = tslib_1.__decorate([
22
+ NgModule({
23
+ declarations: [declarations],
24
+ exports: [exportedModules],
25
+ imports: [CommonModule]
26
+ })
27
+ ], StackLayoutModule);
28
+ export { StackLayoutModule };