@progress/kendo-angular-layout 21.4.1-develop.1 → 22.0.0-develop.1

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 (182) hide show
  1. package/avatar/l10n/messages.d.ts +1 -1
  2. package/fesm2022/progress-kendo-angular-layout.mjs +290 -290
  3. package/package.json +12 -20
  4. package/stepper/localization/messages.d.ts +1 -1
  5. package/tabstrip/localization/messages.d.ts +1 -1
  6. package/timeline/localization/messages.d.ts +1 -1
  7. package/esm2022/avatar/avatar.component.mjs +0 -406
  8. package/esm2022/avatar/l10n/custom-messages.component.mjs +0 -53
  9. package/esm2022/avatar/l10n/localized-messages.directive.mjs +0 -40
  10. package/esm2022/avatar/l10n/messages.mjs +0 -27
  11. package/esm2022/avatar/models/fill.mjs +0 -5
  12. package/esm2022/avatar/models/models.mjs +0 -9
  13. package/esm2022/avatar/models/rounded.mjs +0 -5
  14. package/esm2022/avatar/models/shape.mjs +0 -5
  15. package/esm2022/avatar/models/size.mjs +0 -5
  16. package/esm2022/avatar/models/theme-color.mjs +0 -5
  17. package/esm2022/avatar.module.mjs +0 -38
  18. package/esm2022/card/card-actions.component.mjs +0 -177
  19. package/esm2022/card/card-body.component.mjs +0 -37
  20. package/esm2022/card/card-footer.component.mjs +0 -37
  21. package/esm2022/card/card-header.component.mjs +0 -38
  22. package/esm2022/card/card.component.mjs +0 -118
  23. package/esm2022/card/directives/card-media.directive.mjs +0 -33
  24. package/esm2022/card/directives/card-separator.directive.mjs +0 -61
  25. package/esm2022/card/directives/card-subtitle.directive.mjs +0 -31
  26. package/esm2022/card/directives/card-title.directive.mjs +0 -31
  27. package/esm2022/card/models/actions-layout.mjs +0 -5
  28. package/esm2022/card/models/card-action.mjs +0 -21
  29. package/esm2022/card.module.mjs +0 -45
  30. package/esm2022/common/direction.mjs +0 -5
  31. package/esm2022/common/dom-queries.mjs +0 -47
  32. package/esm2022/common/orientation.mjs +0 -5
  33. package/esm2022/common/preventable-event.mjs +0 -31
  34. package/esm2022/common/styling-classes.mjs +0 -5
  35. package/esm2022/common/util.mjs +0 -85
  36. package/esm2022/directives.mjs +0 -174
  37. package/esm2022/drawer/animations.mjs +0 -146
  38. package/esm2022/drawer/drawer-container.component.mjs +0 -135
  39. package/esm2022/drawer/drawer-content.component.mjs +0 -39
  40. package/esm2022/drawer/drawer.component.mjs +0 -471
  41. package/esm2022/drawer/drawer.service.mjs +0 -105
  42. package/esm2022/drawer/events/drawer-list-select.event.mjs +0 -29
  43. package/esm2022/drawer/events/select-event.mjs +0 -33
  44. package/esm2022/drawer/item.component.mjs +0 -210
  45. package/esm2022/drawer/list.component.mjs +0 -165
  46. package/esm2022/drawer/models/constants.mjs +0 -8
  47. package/esm2022/drawer/models/drawer-animation.interface.mjs +0 -5
  48. package/esm2022/drawer/models/drawer-item-expand.interface.mjs +0 -5
  49. package/esm2022/drawer/models/drawer-item.interface.mjs +0 -5
  50. package/esm2022/drawer/models/drawer-view-item.interface.mjs +0 -5
  51. package/esm2022/drawer/models/mode.mjs +0 -5
  52. package/esm2022/drawer/models/position.mjs +0 -5
  53. package/esm2022/drawer/template-directives/drawer-template.directive.mjs +0 -43
  54. package/esm2022/drawer/template-directives/footer-template.directive.mjs +0 -36
  55. package/esm2022/drawer/template-directives/header-template.directive.mjs +0 -36
  56. package/esm2022/drawer/template-directives/item-template.directive.mjs +0 -44
  57. package/esm2022/drawer/template-directives.mjs +0 -8
  58. package/esm2022/drawer/types.mjs +0 -5
  59. package/esm2022/drawer/util.mjs +0 -16
  60. package/esm2022/drawer.module.mjs +0 -43
  61. package/esm2022/expansionpanel/animations.mjs +0 -23
  62. package/esm2022/expansionpanel/events/action-event.mjs +0 -21
  63. package/esm2022/expansionpanel/expansionpanel-title.directive.mjs +0 -38
  64. package/esm2022/expansionpanel/expansionpanel.component.mjs +0 -515
  65. package/esm2022/expansionpanel.module.mjs +0 -38
  66. package/esm2022/gridlayout.module.mjs +0 -38
  67. package/esm2022/index.mjs +0 -89
  68. package/esm2022/layout.module.mjs +0 -89
  69. package/esm2022/layouts/grid-layout.component.mjs +0 -179
  70. package/esm2022/layouts/gridlayout-item.component.mjs +0 -82
  71. package/esm2022/layouts/models/gridlayout-gap-settings.mjs +0 -5
  72. package/esm2022/layouts/models/gridlayout-row-col-size.mjs +0 -5
  73. package/esm2022/layouts/models/layout-align-settings.mjs +0 -5
  74. package/esm2022/layouts/models/layout-horizontal-align.mjs +0 -5
  75. package/esm2022/layouts/models/layout-vertical-align.mjs +0 -5
  76. package/esm2022/layouts/models.mjs +0 -10
  77. package/esm2022/layouts/stack-layout.component.mjs +0 -161
  78. package/esm2022/layouts/util.mjs +0 -101
  79. package/esm2022/package-metadata.mjs +0 -16
  80. package/esm2022/panelbar/events/collapse-event.mjs +0 -14
  81. package/esm2022/panelbar/events/expand-event.mjs +0 -14
  82. package/esm2022/panelbar/events/item-click-event.mjs +0 -17
  83. package/esm2022/panelbar/events/select-event.mjs +0 -14
  84. package/esm2022/panelbar/events/state-change-event.mjs +0 -13
  85. package/esm2022/panelbar/events.mjs +0 -9
  86. package/esm2022/panelbar/panelbar-content.directive.mjs +0 -36
  87. package/esm2022/panelbar/panelbar-expand-mode.mjs +0 -29
  88. package/esm2022/panelbar/panelbar-item-model.mjs +0 -5
  89. package/esm2022/panelbar/panelbar-item-template.directive.mjs +0 -37
  90. package/esm2022/panelbar/panelbar-item-title.directive.mjs +0 -42
  91. package/esm2022/panelbar/panelbar-item.component.mjs +0 -722
  92. package/esm2022/panelbar/panelbar.component.mjs +0 -705
  93. package/esm2022/panelbar/panelbar.service.mjs +0 -53
  94. package/esm2022/panelbar.module.mjs +0 -41
  95. package/esm2022/progress-kendo-angular-layout.mjs +0 -8
  96. package/esm2022/splitter/splitter-bar.component.mjs +0 -338
  97. package/esm2022/splitter/splitter-pane.component.mjs +0 -324
  98. package/esm2022/splitter/splitter.component.mjs +0 -301
  99. package/esm2022/splitter/splitter.service.mjs +0 -205
  100. package/esm2022/splitter/util.mjs +0 -34
  101. package/esm2022/splitter.module.mjs +0 -38
  102. package/esm2022/stacklayout.module.mjs +0 -37
  103. package/esm2022/stepper/events/activate-event.mjs +0 -33
  104. package/esm2022/stepper/list.component.mjs +0 -185
  105. package/esm2022/stepper/localization/custom-messages.component.mjs +0 -52
  106. package/esm2022/stepper/localization/localized-messages.directive.mjs +0 -41
  107. package/esm2022/stepper/localization/messages.mjs +0 -27
  108. package/esm2022/stepper/models/constants.mjs +0 -8
  109. package/esm2022/stepper/models/orientation.mjs +0 -5
  110. package/esm2022/stepper/models/step-predicate.mjs +0 -5
  111. package/esm2022/stepper/models/step-type.mjs +0 -5
  112. package/esm2022/stepper/models/stepper-step.interface.mjs +0 -5
  113. package/esm2022/stepper/step.component.mjs +0 -396
  114. package/esm2022/stepper/stepper.component.mjs +0 -423
  115. package/esm2022/stepper/stepper.service.mjs +0 -186
  116. package/esm2022/stepper/template-directives/indicator-template.directive.mjs +0 -37
  117. package/esm2022/stepper/template-directives/label-template.directive.mjs +0 -37
  118. package/esm2022/stepper/template-directives/step-template.directive.mjs +0 -39
  119. package/esm2022/stepper/template-directives.mjs +0 -7
  120. package/esm2022/stepper/types.mjs +0 -5
  121. package/esm2022/stepper.module.mjs +0 -41
  122. package/esm2022/tabstrip/constants.mjs +0 -29
  123. package/esm2022/tabstrip/directives/tab-content.directive.mjs +0 -39
  124. package/esm2022/tabstrip/directives/tab-title.directive.mjs +0 -37
  125. package/esm2022/tabstrip/directives/tab.directive.mjs +0 -24
  126. package/esm2022/tabstrip/events/select-event.mjs +0 -25
  127. package/esm2022/tabstrip/events/tabclose-event.mjs +0 -23
  128. package/esm2022/tabstrip/events/tabscroll-event.mjs +0 -23
  129. package/esm2022/tabstrip/events.mjs +0 -7
  130. package/esm2022/tabstrip/localization/custom-messages.component.mjs +0 -53
  131. package/esm2022/tabstrip/localization/localized-messages.directive.mjs +0 -39
  132. package/esm2022/tabstrip/localization/messages.mjs +0 -39
  133. package/esm2022/tabstrip/models/button-state-change.mjs +0 -5
  134. package/esm2022/tabstrip/models/scroll-button-type.mjs +0 -5
  135. package/esm2022/tabstrip/models/scroll-buttons-visibility.mjs +0 -5
  136. package/esm2022/tabstrip/models/scrollable-settings.mjs +0 -23
  137. package/esm2022/tabstrip/models/size.mjs +0 -5
  138. package/esm2022/tabstrip/models/tab-alignment.mjs +0 -5
  139. package/esm2022/tabstrip/models/tab-position.mjs +0 -5
  140. package/esm2022/tabstrip/models/tabstrip-tab.component.mjs +0 -130
  141. package/esm2022/tabstrip/rendering/tab.component.mjs +0 -182
  142. package/esm2022/tabstrip/scrollable-button.component.mjs +0 -182
  143. package/esm2022/tabstrip/tabstrip-scroll.service.mjs +0 -176
  144. package/esm2022/tabstrip/tabstrip.component.mjs +0 -954
  145. package/esm2022/tabstrip/tabstrip.service.mjs +0 -155
  146. package/esm2022/tabstrip/util.mjs +0 -120
  147. package/esm2022/tabstrip.module.mjs +0 -41
  148. package/esm2022/tilelayout/constants.mjs +0 -70
  149. package/esm2022/tilelayout/dragging-service.mjs +0 -421
  150. package/esm2022/tilelayout/keyboard-navigation.service.mjs +0 -189
  151. package/esm2022/tilelayout/models/dragging-config.interface.mjs +0 -5
  152. package/esm2022/tilelayout/models/flowmode.type.mjs +0 -5
  153. package/esm2022/tilelayout/models/gap.interface.mjs +0 -5
  154. package/esm2022/tilelayout/models/navigation.interface.mjs +0 -5
  155. package/esm2022/tilelayout/reorder-event.mjs +0 -43
  156. package/esm2022/tilelayout/resize-event.mjs +0 -37
  157. package/esm2022/tilelayout/tilelayout-item-body.component.mjs +0 -45
  158. package/esm2022/tilelayout/tilelayout-item-header.component.mjs +0 -43
  159. package/esm2022/tilelayout/tilelayout-item.component.mjs +0 -322
  160. package/esm2022/tilelayout/tilelayout-resize-handle.directive.mjs +0 -61
  161. package/esm2022/tilelayout/tilelayout.component.mjs +0 -388
  162. package/esm2022/tilelayout/util.mjs +0 -138
  163. package/esm2022/tilelayout.module.mjs +0 -40
  164. package/esm2022/timeline/events/navigation-direction.mjs +0 -5
  165. package/esm2022/timeline/localization/custom-messages.component.mjs +0 -43
  166. package/esm2022/timeline/localization/localized-messages.directive.mjs +0 -39
  167. package/esm2022/timeline/localization/messages.mjs +0 -33
  168. package/esm2022/timeline/models/anchor-target.mjs +0 -5
  169. package/esm2022/timeline/models/default-model-fields.mjs +0 -16
  170. package/esm2022/timeline/models/events-order.mjs +0 -5
  171. package/esm2022/timeline/models/model-fields.mjs +0 -5
  172. package/esm2022/timeline/models/timeline-event.mjs +0 -5
  173. package/esm2022/timeline/templates/timeline-card-actions.directive.mjs +0 -40
  174. package/esm2022/timeline/templates/timeline-card-body.directive.mjs +0 -40
  175. package/esm2022/timeline/templates/timeline-card-header.directive.mjs +0 -41
  176. package/esm2022/timeline/timeline-card.component.mjs +0 -451
  177. package/esm2022/timeline/timeline-horizontal.component.mjs +0 -781
  178. package/esm2022/timeline/timeline-vertical.component.mjs +0 -203
  179. package/esm2022/timeline/timeline.component.mjs +0 -491
  180. package/esm2022/timeline/timeline.service.mjs +0 -32
  181. package/esm2022/timeline/util.mjs +0 -26
  182. package/esm2022/timeline.module.mjs +0 -41
@@ -1,421 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { ChangeDetectorRef, Injectable, NgZone, Renderer2 } from '@angular/core';
6
- import { BehaviorSubject, Subject } from 'rxjs';
7
- import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { calculateCellFromPosition, getDropTarget, isRowItemPresent, normalizeValue, propsChanged, setElementStyles } from './util';
9
- import { closestInScope, isFocusable } from '../common/dom-queries';
10
- import { DRAGGED_ZINDEX, HINT_BORDERS_HEIGHT, OVERLAP_THRESHOLD, REVERSE_OVERLAP_THRESHOLD } from './constants';
11
- import { TileLayoutReorderEvent } from './reorder-event';
12
- import { TileLayoutResizeEvent } from './resize-event';
13
- import * as i0 from "@angular/core";
14
- import * as i1 from "@progress/kendo-angular-l10n";
15
- /**
16
- * @hidden
17
- */
18
- export class TileLayoutDraggingService {
19
- zone;
20
- renderer;
21
- cdr;
22
- localization;
23
- reorderable = new BehaviorSubject(null);
24
- resizable = new BehaviorSubject(null);
25
- reorder = new Subject();
26
- resize = new Subject();
27
- tileLayoutSettings;
28
- get colStart() {
29
- return this.currentColStart;
30
- }
31
- get rowStart() {
32
- return this.currentRowStart;
33
- }
34
- get itemWrapper() {
35
- return this.draggedItemWrapper;
36
- }
37
- get order() {
38
- return this.targetOrder;
39
- }
40
- draggedItem;
41
- draggedItemWrapper;
42
- reordering;
43
- resizing;
44
- offset;
45
- targetSize;
46
- cellSize;
47
- targetOrder;
48
- currentColStart;
49
- currentRowStart;
50
- startingPoint;
51
- currentResizingColSpan;
52
- currentResizingRowSpan;
53
- direction;
54
- lastDragCursorOffset = {
55
- x: 0,
56
- y: 0
57
- };
58
- localizationSubscription;
59
- rtl;
60
- constructor(zone, renderer, cdr, localization) {
61
- this.zone = zone;
62
- this.renderer = renderer;
63
- this.cdr = cdr;
64
- this.localization = localization;
65
- this.localizationSubscription = this.localization.changes.subscribe(({ rtl }) => this.rtl = rtl);
66
- }
67
- ngOnDestroy() {
68
- this.localizationSubscription.unsubscribe();
69
- }
70
- handlePress(originalEvent) {
71
- const resizing = !!originalEvent.target.classList.contains('k-resize-handle');
72
- const closestTile = closestInScope(originalEvent.target, el => el.classList.contains('k-tilelayout-item'), this.tileLayoutSettings.tileLayoutElement);
73
- const closestHeader = closestInScope(originalEvent.target, el => el.classList.contains('k-tilelayout-item-header'), this.tileLayoutSettings.tileLayoutElement);
74
- if (!closestTile) {
75
- return;
76
- }
77
- this.zone.run(() => {
78
- this.draggedItemWrapper = closestTile;
79
- this.draggedItem = this.tileLayoutSettings.items
80
- .find(item => item.order === +closestTile.style.order);
81
- });
82
- const reordering = !resizing && this.reorderable.getValue() && this.draggedItem.reorderable && closestHeader;
83
- const focusableTarget = isFocusable(originalEvent.target);
84
- if (!(reordering || resizing) || focusableTarget) {
85
- return;
86
- }
87
- else {
88
- originalEvent.preventDefault();
89
- }
90
- this.zone.run(() => {
91
- this.reordering = reordering;
92
- this.resizing = resizing;
93
- });
94
- const tileRect = this.draggedItemWrapper.getBoundingClientRect();
95
- this.zone.run(() => {
96
- this.offset = {
97
- top: originalEvent.clientY - tileRect.top,
98
- left: originalEvent.clientX - tileRect.left,
99
- x: tileRect.x,
100
- y: tileRect.y,
101
- width: tileRect.width,
102
- height: tileRect.height
103
- };
104
- this.targetSize = {
105
- rowSpan: this.draggedItem.rowSpan,
106
- colSpan: this.draggedItem.colSpan
107
- };
108
- this.cellSize = {
109
- width: (tileRect.width - ((this.targetSize.colSpan - 1) * this.tileLayoutSettings.gap.columns)) / this.targetSize.colSpan,
110
- height: (tileRect.height - ((this.targetSize.rowSpan - 1) * this.tileLayoutSettings.gap.rows)) / this.targetSize.rowSpan
111
- };
112
- this.lastDragCursorOffset = {
113
- x: originalEvent.clientX,
114
- y: originalEvent.clientY
115
- };
116
- });
117
- setElementStyles(this.renderer, this.draggedItemWrapper, {
118
- left: tileRect.left + window.pageXOffset - window.scrollX + 'px',
119
- top: tileRect.top + window.pageYOffset - window.scrollY + 'px',
120
- width: tileRect.width + 'px',
121
- height: tileRect.height + 'px',
122
- zIndex: DRAGGED_ZINDEX
123
- });
124
- setElementStyles(this.renderer, this.tileLayoutSettings.hintElement, {
125
- display: 'flex',
126
- height: (tileRect.height - HINT_BORDERS_HEIGHT) + 'px'
127
- });
128
- this.zone.run(() => this.targetOrder = this.draggedItem.order);
129
- this.cdr.markForCheck();
130
- setElementStyles(this.renderer, this.draggedItemWrapper, {
131
- position: 'fixed'
132
- });
133
- if (this.reorderable.getValue() && !resizing) {
134
- this.zone.run(() => {
135
- this.currentColStart = this.draggedItem.colStart;
136
- this.currentRowStart = this.draggedItem.rowStart;
137
- });
138
- this.cdr.markForCheck();
139
- }
140
- else if (this.resizable && resizing) {
141
- this.zone.run(() => {
142
- this.startingPoint = {
143
- top: originalEvent.clientY,
144
- left: originalEvent.clientX
145
- };
146
- this.currentResizingColSpan = this.draggedItem.colSpan;
147
- this.currentResizingRowSpan = this.draggedItem.rowSpan;
148
- if (this.draggedItem.col) {
149
- this.currentColStart = this.draggedItem.col.toString();
150
- }
151
- if (this.draggedItem.row) {
152
- this.currentRowStart = this.draggedItem.row.toString();
153
- }
154
- this.direction = originalEvent.target.classList[1];
155
- });
156
- }
157
- }
158
- handleDrag(originalEvent) {
159
- if (this.draggedItemWrapper) {
160
- if (this.reordering) {
161
- this.reorderItems(originalEvent);
162
- }
163
- else if (this.resizing) {
164
- this.resizeItem(originalEvent);
165
- }
166
- this.lastDragCursorOffset = {
167
- x: originalEvent.clientX,
168
- y: originalEvent.clientY
169
- };
170
- }
171
- }
172
- handleRelease(originalEvent) {
173
- originalEvent.preventDefault();
174
- if (this.reordering) {
175
- const initialOrder = this.draggedItem.order;
176
- const initialCol = this.draggedItem.col;
177
- const initialRow = this.draggedItem.row;
178
- const targetCol = normalizeValue(this.currentColStart);
179
- const targetRow = normalizeValue(this.currentRowStart);
180
- if (propsChanged([this.targetOrder, targetCol, targetRow], [initialOrder, initialCol, initialRow])) {
181
- const reorderEvent = new TileLayoutReorderEvent(this.draggedItem, this.tileLayoutSettings.items, this.targetOrder, initialOrder, targetCol, initialCol, targetRow, initialRow);
182
- this.reorder.next(reorderEvent);
183
- if (!reorderEvent.isDefaultPrevented()) {
184
- if (this.targetOrder > initialOrder) {
185
- this.zone.run(() => {
186
- for (let i = initialOrder + 1; i <= this.targetOrder; i++) {
187
- const item = this.tileLayoutSettings.items.find(item => item.order === i);
188
- item && (item.order = i - 1);
189
- }
190
- });
191
- }
192
- else {
193
- this.zone.run(() => {
194
- for (let i = initialOrder - 1; i >= this.targetOrder; i--) {
195
- const item = this.tileLayoutSettings.items.find(item => item.order === i);
196
- item && (item.order = i + 1);
197
- }
198
- });
199
- }
200
- this.draggedItem.order = this.targetOrder;
201
- if (this.draggedItem.col) {
202
- this.draggedItem.col = +this.currentColStart;
203
- }
204
- if (this.draggedItem.row) {
205
- this.draggedItem.row = +this.currentRowStart;
206
- }
207
- }
208
- }
209
- this.tileLayoutSettings.tileLayoutElement.appendChild(this.tileLayoutSettings.hintElement);
210
- this.cdr.markForCheck();
211
- this.zone.run(() => this.cleanUp());
212
- }
213
- else if (!this.reordering && this.resizing) {
214
- const initialRowSpan = this.draggedItem.rowSpan;
215
- const initialColSpan = this.draggedItem.colSpan;
216
- const { targetColSpan, targetRowSpan } = isRowItemPresent(this.tileLayoutSettings.items) ?
217
- this.targetSpan() :
218
- { targetColSpan: this.currentResizingColSpan, targetRowSpan: this.currentResizingRowSpan };
219
- if (propsChanged([initialRowSpan, initialColSpan], [targetRowSpan, targetColSpan])) {
220
- const resizeEvent = new TileLayoutResizeEvent(this.draggedItem, this.tileLayoutSettings.items, targetRowSpan, initialRowSpan, targetColSpan, initialColSpan);
221
- this.resize.next(resizeEvent);
222
- if (!resizeEvent.isDefaultPrevented()) {
223
- this.draggedItem.colSpan = this.currentResizingColSpan;
224
- this.draggedItem.rowSpan = this.currentResizingRowSpan;
225
- }
226
- }
227
- this.zone.run(() => this.cleanUp());
228
- }
229
- }
230
- reorderItems(event) {
231
- const targets = getDropTarget(event);
232
- const closestTile = targets.find(t => t !== this.draggedItemWrapper);
233
- const tileOrder = closestTile ? +closestTile.style.order : +this.draggedItemWrapper.style.order;
234
- if (this.tileLayoutSettings.autoFlow !== 'none') {
235
- const deltaX = event.clientX - this.lastDragCursorOffset.x;
236
- const deltaY = event.clientY - this.lastDragCursorOffset.y;
237
- const directionX = deltaX > 0 ? 'right' : deltaX < 0 ? 'left' : undefined;
238
- const directionY = deltaY > 0 ? 'down' : deltaX < 0 ? 'up' : undefined;
239
- const rect = this.draggedItemWrapper.getBoundingClientRect();
240
- const horizontalGap = this.tileLayoutSettings.gap.columns;
241
- const verticalGap = this.tileLayoutSettings.gap.rows;
242
- if (directionX && this.draggedItem.col) {
243
- const { col } = calculateCellFromPosition({
244
- x: directionX === 'right' ? rect.right - horizontalGap : rect.left + horizontalGap,
245
- y: event.clientY
246
- }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl);
247
- const targetStartCol = this.getTargetCol(col, directionX);
248
- this.currentColStart = targetStartCol.toString();
249
- }
250
- if (directionY && this.draggedItem.row) {
251
- const { row } = calculateCellFromPosition({
252
- x: event.clientX,
253
- y: directionY === 'down' ? rect.bottom - verticalGap : rect.top + verticalGap
254
- }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl);
255
- const targetStartRow = this.getTargetRow(row, directionY);
256
- this.currentRowStart = targetStartRow.toString();
257
- }
258
- }
259
- const hintBefore = tileOrder < this.targetOrder;
260
- const hintAfter = tileOrder > this.targetOrder;
261
- this.zone.run(() => this.targetOrder = tileOrder);
262
- if (hintBefore) {
263
- this.tileLayoutSettings.tileLayoutElement
264
- .insertBefore(this.tileLayoutSettings.hintElement, this.tileLayoutSettings.tileLayoutElement.firstChild);
265
- }
266
- else if (hintAfter) {
267
- this.tileLayoutSettings.tileLayoutElement.appendChild(this.tileLayoutSettings.hintElement);
268
- }
269
- setElementStyles(this.renderer, this.draggedItemWrapper, {
270
- top: (event.pageY - this.offset.top - window.scrollY) + 'px',
271
- left: (event.pageX - this.offset.left - window.scrollX) + 'px'
272
- });
273
- this.cdr.markForCheck();
274
- }
275
- resizeItem(event) {
276
- setElementStyles(this.renderer, this.tileLayoutSettings.tileLayoutElement, {
277
- cursor: this.direction.split('k-cursor-')[1]
278
- });
279
- const currentWidth = this.rtl ?
280
- this.offset.width + (this.offset.x - event.clientX) :
281
- this.offset.width + (event.clientX - this.startingPoint.left);
282
- const currentHeight = this.offset.height + (event.clientY - this.startingPoint.top);
283
- const hintRect = this.tileLayoutSettings.hintElement.getBoundingClientRect();
284
- const hintWidth = hintRect.width;
285
- const hintHeight = hintRect.height;
286
- const horizontalDragDirection = event.clientX - this.lastDragCursorOffset.x;
287
- const verticalDragDirection = event.clientY - this.lastDragCursorOffset.y;
288
- const startCol = this.draggedItem.col ? this.draggedItem.col : calculateCellFromPosition({
289
- x: this.rtl ? hintRect.right : hintRect.x,
290
- y: hintRect.y
291
- }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl).col;
292
- const maxWidth = (this.tileLayoutSettings.columns - startCol) * (this.cellSize.width + this.tileLayoutSettings.gap.columns) + this.cellSize.width;
293
- const resizeHorizontally = () => {
294
- setElementStyles(this.renderer, this.draggedItemWrapper, {
295
- width: Math.min(Math.max(currentWidth, this.cellSize.width), maxWidth) + 'px'
296
- });
297
- if (this.rtl && currentWidth > this.cellSize.width) {
298
- const totalWidth = this.tileLayoutSettings.columns * (this.cellSize.width + this.tileLayoutSettings.gap.columns);
299
- const leftBoundary = this.tileLayoutSettings.tileLayoutElement.getBoundingClientRect().right - totalWidth;
300
- setElementStyles(this.renderer, this.draggedItemWrapper, {
301
- left: Math.max(event.clientX, leftBoundary) + 'px'
302
- });
303
- }
304
- const deltaX = currentWidth - hintWidth;
305
- const { x, y, right } = this.draggedItem.elem.nativeElement.getBoundingClientRect();
306
- const { col } = calculateCellFromPosition({ x: (this.rtl ? right : x), y: y }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl);
307
- const resizedColSpan = col + this.currentResizingColSpan;
308
- const expandingCondition = this.rtl ? horizontalDragDirection < 0 : horizontalDragDirection > 0;
309
- const shrinkingCondition = this.rtl ? horizontalDragDirection > 0 : horizontalDragDirection < 0;
310
- if (deltaX > OVERLAP_THRESHOLD * this.cellSize.width &&
311
- expandingCondition &&
312
- resizedColSpan <= this.tileLayoutSettings.columns) {
313
- this.currentResizingColSpan++;
314
- }
315
- else if (this.currentResizingColSpan > 1 &&
316
- shrinkingCondition &&
317
- deltaX < REVERSE_OVERLAP_THRESHOLD * this.cellSize.width) {
318
- this.currentResizingColSpan--;
319
- }
320
- setElementStyles(this.renderer, this.tileLayoutSettings.hintElement, {
321
- gridColumnEnd: `span ${this.currentResizingColSpan}`
322
- });
323
- };
324
- const resizeVertically = () => {
325
- setElementStyles(this.renderer, this.draggedItemWrapper, {
326
- height: Math.max(currentHeight, this.cellSize.height) + 'px'
327
- });
328
- const deltaY = currentHeight - hintHeight;
329
- if (deltaY > OVERLAP_THRESHOLD * this.cellSize.height && verticalDragDirection > 0) {
330
- this.currentResizingRowSpan++;
331
- }
332
- else if (this.currentResizingRowSpan > 1 &&
333
- verticalDragDirection < 0 && deltaY < REVERSE_OVERLAP_THRESHOLD * this.cellSize.height) {
334
- this.currentResizingRowSpan--;
335
- }
336
- setElementStyles(this.renderer, this.tileLayoutSettings.hintElement, {
337
- gridRowEnd: `span ${this.currentResizingRowSpan}`
338
- });
339
- setElementStyles(this.renderer, this.tileLayoutSettings.hintElement, {
340
- height: `${this.calculateHintHeight()}px`
341
- });
342
- };
343
- if (this.direction.indexOf('ew') > -1) {
344
- resizeHorizontally();
345
- }
346
- else if (this.direction.indexOf('ns') > -1) {
347
- resizeVertically();
348
- }
349
- else {
350
- resizeHorizontally();
351
- resizeVertically();
352
- }
353
- }
354
- cleanUp() {
355
- this.targetOrder = this.currentResizingColSpan = this.currentColStart = this.currentResizingRowSpan = this.currentRowStart = undefined;
356
- this.resizing = this.reordering = false;
357
- this.direction = null;
358
- if (this.draggedItemWrapper) {
359
- setElementStyles(this.renderer, this.draggedItemWrapper, {
360
- top: '',
361
- left: '',
362
- display: '',
363
- width: '',
364
- height: '',
365
- zIndex: '',
366
- position: ''
367
- });
368
- setElementStyles(this.renderer, this.tileLayoutSettings.hintElement, {
369
- display: 'none',
370
- height: 'auto'
371
- });
372
- setElementStyles(this.renderer, this.tileLayoutSettings.tileLayoutElement, {
373
- cursor: 'default'
374
- });
375
- this.draggedItemWrapper =
376
- this.offset =
377
- this.draggedItem =
378
- this.resizing =
379
- this.reordering =
380
- this.currentResizingColSpan =
381
- this.currentResizingRowSpan =
382
- this.startingPoint = undefined;
383
- this.lastDragCursorOffset = {
384
- x: 0,
385
- y: 0
386
- };
387
- }
388
- }
389
- targetSpan() {
390
- const itemRect = this.draggedItem.elem.nativeElement.getBoundingClientRect();
391
- const startingCell = calculateCellFromPosition({ x: this.rtl ? itemRect.right : itemRect.x, y: itemRect.y }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl);
392
- const targetEndCell = calculateCellFromPosition({
393
- x: this.rtl ? itemRect.x + OVERLAP_THRESHOLD * this.cellSize.width : itemRect.right - OVERLAP_THRESHOLD * this.cellSize.width,
394
- y: itemRect.bottom - OVERLAP_THRESHOLD * this.cellSize.height
395
- }, this.tileLayoutSettings.tileLayoutElement, this.tileLayoutSettings.gap, this.cellSize, this.tileLayoutSettings.columns, this.rtl);
396
- return {
397
- targetColSpan: targetEndCell.col - startingCell.col + 1,
398
- targetRowSpan: targetEndCell.row - startingCell.row + 1
399
- };
400
- }
401
- getTargetCol(col, direction) {
402
- if (this.rtl) {
403
- return normalizeValue(direction === 'left' ? col - this.draggedItem.colSpan + 1 : col, this.tileLayoutSettings.columns);
404
- }
405
- return normalizeValue(direction === 'right' ? col - this.draggedItem.colSpan + 1 : col);
406
- }
407
- getTargetRow(row, direction) {
408
- return direction === 'down' ? row - this.draggedItem.rowSpan + 1 : row;
409
- }
410
- calculateHintHeight() {
411
- const totalHintCellsHeight = this.currentResizingRowSpan * this.cellSize.height;
412
- const totalHintGapsHeight = (this.currentResizingRowSpan - 1) * this.tileLayoutSettings.gap.rows;
413
- const hintHeight = totalHintCellsHeight + totalHintGapsHeight - HINT_BORDERS_HEIGHT;
414
- return hintHeight;
415
- }
416
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutDraggingService, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
417
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutDraggingService });
418
- }
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutDraggingService, decorators: [{
420
- type: Injectable
421
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }] });
@@ -1,189 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /* eslint-disable no-unused-expressions */
6
- import { Injectable, NgZone, Renderer2 } from '@angular/core';
7
- import { Keys, normalizeKeys } from '@progress/kendo-angular-common';
8
- import { LocalizationService } from '@progress/kendo-angular-l10n';
9
- import { BehaviorSubject } from 'rxjs';
10
- import { focusableSelector } from '@progress/kendo-angular-common';
11
- import { getCurrentCol, shouldReorder, shouldResize } from './util';
12
- import { TileLayoutResizeEvent } from './resize-event';
13
- import { TileLayoutReorderEvent } from './reorder-event';
14
- import * as i0 from "@angular/core";
15
- import * as i1 from "@progress/kendo-angular-l10n";
16
- /**
17
- * @hidden
18
- */
19
- export class TileLayoutKeyboardNavigationService {
20
- zone;
21
- renderer;
22
- localization;
23
- navigable = new BehaviorSubject(true);
24
- owner;
25
- mousedown;
26
- localizationSubscription;
27
- rtl;
28
- lastFocused;
29
- constructor(zone, renderer, localization) {
30
- this.zone = zone;
31
- this.renderer = renderer;
32
- this.localization = localization;
33
- this.localizationSubscription = this.localization.changes.subscribe(({ rtl }) => this.rtl = rtl);
34
- }
35
- ngOnDestroy() {
36
- this.localizationSubscription.unsubscribe();
37
- }
38
- onKeyDown(event, elem, focusableItems, settings) {
39
- const keyCode = normalizeKeys(event);
40
- const isTileFocused = document.activeElement === elem;
41
- const focusedTile = settings.items.find(item => item.elem.nativeElement === elem);
42
- const col = getCurrentCol(focusedTile, settings, this.rtl);
43
- const isArrow = [Keys.ArrowLeft, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowUp].some(key => key === keyCode);
44
- this.lastFocused = focusedTile;
45
- if (keyCode === Keys.Enter && isTileFocused && focusableItems.length > 0) {
46
- this.changeTabIndex('0', elem, focusableItems);
47
- focusableItems[0].focus();
48
- }
49
- else if (keyCode === Keys.Escape) {
50
- this.changeTabIndex('-1', elem, focusableItems);
51
- elem.focus();
52
- }
53
- else if (isArrow && (event.ctrlKey || event.metaKey) && isTileFocused && focusedTile.isResizable) {
54
- event.preventDefault();
55
- this.zone.run(() => {
56
- this.resizeItem(keyCode, focusedTile, settings, col);
57
- });
58
- }
59
- else if (isArrow && event.shiftKey && isTileFocused && focusedTile.isReorderable) {
60
- this.zone.run(() => {
61
- this.reorderItem(keyCode, focusedTile, settings, col);
62
- });
63
- }
64
- else if (keyCode === Keys.Tab) {
65
- if (!isTileFocused) {
66
- this.keepFocusWithinComponent(event, elem);
67
- }
68
- else {
69
- const dir = event.shiftKey ? -1 : 1;
70
- const nextFocusableTileOrder = focusedTile.order + dir;
71
- if (nextFocusableTileOrder < 0 || nextFocusableTileOrder >= settings.items.length) {
72
- const first = settings.items[0];
73
- const last = settings.items[settings.items.length - 1];
74
- if (dir > 0) {
75
- last.focus();
76
- }
77
- else {
78
- first.focus();
79
- }
80
- return;
81
- }
82
- event.preventDefault();
83
- this.lastFocused = settings.items.find(item => item.order === nextFocusableTileOrder);
84
- this.lastFocused?.focus();
85
- }
86
- }
87
- }
88
- onFocusOut(event, elem, focusableItems) {
89
- const isTargetFocusable = focusableItems.includes(event.target);
90
- const isRelatedTargetFocusable = focusableItems.includes(event.relatedTarget);
91
- if (isTargetFocusable && !isRelatedTargetFocusable) {
92
- this.changeTabIndex('-1', elem, focusableItems);
93
- event.relatedTarget?.focus();
94
- }
95
- }
96
- onMousedown(event, elem, focusableItems, tile) {
97
- this.mousedown = true;
98
- const isTargetFocusable = focusableItems.includes(event.target);
99
- this.lastFocused = tile;
100
- if (isTargetFocusable) {
101
- this.changeTabIndex('0', elem, focusableItems);
102
- event.target.focus();
103
- }
104
- }
105
- changeTabIndex(tabIndex, elem, focusableItems) {
106
- this.renderer.setAttribute(elem, 'tabindex', tabIndex === '0' ? '-1' : '0');
107
- focusableItems.forEach((focusItem) => {
108
- this.renderer.setAttribute(focusItem, 'tabindex', tabIndex);
109
- });
110
- }
111
- getAllFocusableChildren(parent) {
112
- return Array.from(parent.querySelectorAll(focusableSelector)).filter((element) => element.offsetParent !== null);
113
- }
114
- returnFocus() {
115
- this.lastFocused ? this.lastFocused.focus() : this.owner.items.find(item => item.order === 0).focus();
116
- }
117
- resizeItem(keyCode, focusedTile, settings, col) {
118
- const { resizeRight, resizeLeft, resizeDown, resizeUp } = shouldResize(keyCode, col, focusedTile, settings);
119
- const resizeHorizontal = resizeLeft || resizeRight;
120
- const resizeVertical = resizeDown || resizeUp;
121
- const resizeDir = resizeLeft || resizeUp ? -1 : 1;
122
- if (!(resizeHorizontal || resizeVertical)) {
123
- return;
124
- }
125
- const resizeEvent = new TileLayoutResizeEvent(focusedTile, this.owner.items ? this.owner.items.toArray() : [], focusedTile.rowSpan + resizeDir, focusedTile.rowSpan, focusedTile.colSpan + resizeDir, focusedTile.colSpan);
126
- this.owner.resize.emit(resizeEvent);
127
- if (!resizeEvent.isDefaultPrevented()) {
128
- if (resizeHorizontal) {
129
- focusedTile.colSpan += resizeDir;
130
- }
131
- else if (resizeVertical) {
132
- focusedTile.rowSpan += resizeDir;
133
- }
134
- }
135
- }
136
- reorderItem(keyCode, focusedTile, settings, col) {
137
- const { reorderLeft, reorderRight } = shouldReorder(keyCode, col, focusedTile, settings);
138
- if (!(reorderLeft || reorderRight)) {
139
- return;
140
- }
141
- const reorder = (dir) => {
142
- const relatedTile = this.targetTile(focusedTile, settings.items, dir);
143
- if (relatedTile) {
144
- relatedTile.order -= dir;
145
- if (relatedTile.col) {
146
- relatedTile.col -= dir;
147
- }
148
- focusedTile.order += dir;
149
- if (focusedTile.col) {
150
- focusedTile.col += dir;
151
- }
152
- }
153
- };
154
- const reorderDir = reorderRight ? 1 : -1;
155
- const reorderEvent = new TileLayoutReorderEvent(focusedTile, this.owner.items ? this.owner.items.toArray() : [], focusedTile.order + reorderDir, focusedTile.order, focusedTile.col ? focusedTile.col + reorderDir : undefined, focusedTile.col, focusedTile.row, focusedTile.row);
156
- this.owner.reorder.next(reorderEvent);
157
- if (!reorderEvent.isDefaultPrevented()) {
158
- reorder(reorderDir);
159
- }
160
- }
161
- keepFocusWithinComponent(event, wrapper) {
162
- const [firstFocusable, lastFocusable] = this.getFirstAndLastFocusable(wrapper);
163
- const tabAfterLastFocusable = !event.shiftKey && event.target === lastFocusable;
164
- const shiftTabAfterFirstFocusable = event.shiftKey && event.target === firstFocusable;
165
- if (tabAfterLastFocusable) {
166
- event.preventDefault();
167
- firstFocusable.focus();
168
- wrapper.blur();
169
- }
170
- if (shiftTabAfterFirstFocusable) {
171
- event.preventDefault();
172
- lastFocusable.focus();
173
- }
174
- }
175
- getFirstAndLastFocusable(parent) {
176
- const all = this.getAllFocusableChildren(parent);
177
- const firstFocusable = all.length > 0 ? all[0] : parent;
178
- const lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
179
- return [firstFocusable, lastFocusable];
180
- }
181
- targetTile(focusedTile, items, offset) {
182
- return items.find(item => item.order === focusedTile.order + offset);
183
- }
184
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutKeyboardNavigationService, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
185
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutKeyboardNavigationService });
186
- }
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TileLayoutKeyboardNavigationService, decorators: [{
188
- type: Injectable
189
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }] });
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};