@progress/kendo-angular-sortable 4.0.6 → 5.0.0-dev.202204191145

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 (85) hide show
  1. package/{dist/es2015/binding.directive.d.ts → binding.directive.d.ts} +4 -1
  2. package/bundles/kendo-angular-sortable.umd.js +5 -0
  3. package/{dist/es2015/data-event-args.interface.d.ts → data-event-args.interface.d.ts} +0 -0
  4. package/{dist/es2015/data-events.d.ts → data-events.d.ts} +0 -0
  5. package/{dist/es2015/draggable-event.d.ts → draggable-event.d.ts} +0 -0
  6. package/{dist/es2015/draggable.directive.d.ts → draggable.directive.d.ts} +11 -4
  7. package/{dist/es2015 → esm2015}/binding.directive.js +16 -18
  8. package/{dist/es2015 → esm2015}/data-event-args.interface.js +1 -0
  9. package/{dist/es2015 → esm2015}/data-events.js +0 -0
  10. package/{dist/es2015 → esm2015}/draggable-event.js +0 -0
  11. package/esm2015/draggable.directive.js +71 -0
  12. package/esm2015/item-template.directive.js +39 -0
  13. package/{dist/es/index.js → esm2015/kendo-angular-sortable.js} +0 -0
  14. package/{dist/es → esm2015}/main.js +0 -0
  15. package/{dist/es2015 → esm2015}/navigate-event.js +0 -0
  16. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  17. package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
  18. package/esm2015/sortable-container.js +16 -0
  19. package/{dist/es2015 → esm2015}/sortable-event-args.interface.js +1 -0
  20. package/{dist/es2015 → esm2015}/sortable-events.js +0 -0
  21. package/{dist/es2015 → esm2015}/sortable.component.js +162 -179
  22. package/{dist/es2015 → esm2015}/sortable.module.js +23 -12
  23. package/{dist/es2015 → esm2015}/sortable.service.js +9 -11
  24. package/{dist/es2015 → esm2015}/util.js +0 -3
  25. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-sortable.js} +406 -407
  26. package/{dist/es2015/item-template.directive.d.ts → item-template.directive.d.ts} +5 -0
  27. package/{dist/es2015/index.d.ts → kendo-angular-sortable.d.ts} +1 -0
  28. package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
  29. package/{dist/es2015/navigate-event.d.ts → navigate-event.d.ts} +0 -0
  30. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  31. package/package.json +28 -90
  32. package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
  33. package/schematics/ngAdd/index.js +5 -2
  34. package/schematics/ngAdd/index.js.map +1 -1
  35. package/{dist/es2015/sortable-container.d.ts → sortable-container.d.ts} +3 -0
  36. package/{dist/es2015/sortable-event-args.interface.d.ts → sortable-event-args.interface.d.ts} +0 -0
  37. package/{dist/es2015/sortable-events.d.ts → sortable-events.d.ts} +0 -0
  38. package/{dist/es2015/sortable.component.d.ts → sortable.component.d.ts} +13 -8
  39. package/{dist/es2015/sortable.module.d.ts → sortable.module.d.ts} +9 -0
  40. package/{dist/es2015/sortable.service.d.ts → sortable.service.d.ts} +5 -1
  41. package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
  42. package/dist/cdn/js/kendo-angular-sortable.js +0 -20
  43. package/dist/cdn/main.js +0 -5
  44. package/dist/es/binding.directive.js +0 -177
  45. package/dist/es/data-event-args.interface.js +0 -4
  46. package/dist/es/data-events.js +0 -54
  47. package/dist/es/draggable-event.js +0 -23
  48. package/dist/es/draggable.directive.js +0 -88
  49. package/dist/es/item-template.directive.js +0 -39
  50. package/dist/es/navigate-event.js +0 -22
  51. package/dist/es/package-metadata.js +0 -15
  52. package/dist/es/preventable-event.js +0 -34
  53. package/dist/es/sortable-container.js +0 -18
  54. package/dist/es/sortable-event-args.interface.js +0 -4
  55. package/dist/es/sortable-events.js +0 -54
  56. package/dist/es/sortable.component.js +0 -1075
  57. package/dist/es/sortable.module.js +0 -64
  58. package/dist/es/sortable.service.js +0 -236
  59. package/dist/es/util.js +0 -144
  60. package/dist/es2015/draggable.directive.js +0 -75
  61. package/dist/es2015/index.js +0 -8
  62. package/dist/es2015/index.metadata.json +0 -1
  63. package/dist/es2015/item-template.directive.js +0 -37
  64. package/dist/es2015/main.js +0 -17
  65. package/dist/es2015/sortable-container.js +0 -15
  66. package/dist/fesm5/index.js +0 -1944
  67. package/dist/npm/binding.directive.js +0 -179
  68. package/dist/npm/data-event-args.interface.js +0 -6
  69. package/dist/npm/data-events.js +0 -56
  70. package/dist/npm/draggable-event.js +0 -25
  71. package/dist/npm/draggable.directive.js +0 -90
  72. package/dist/npm/index.js +0 -11
  73. package/dist/npm/item-template.directive.js +0 -41
  74. package/dist/npm/main.js +0 -34
  75. package/dist/npm/navigate-event.js +0 -24
  76. package/dist/npm/package-metadata.js +0 -17
  77. package/dist/npm/preventable-event.js +0 -36
  78. package/dist/npm/sortable-container.js +0 -20
  79. package/dist/npm/sortable-event-args.interface.js +0 -6
  80. package/dist/npm/sortable-events.js +0 -56
  81. package/dist/npm/sortable.component.js +0 -1077
  82. package/dist/npm/sortable.module.js +0 -66
  83. package/dist/npm/sortable.service.js +0 -238
  84. package/dist/npm/util.js +0 -147
  85. package/dist/systemjs/kendo-angular-sortable.js +0 -5
@@ -1,1075 +0,0 @@
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 { Component, Input, Output, QueryList, ContentChildren, ViewChild, ViewChildren, TemplateRef, ElementRef, EventEmitter, HostBinding, NgZone, ChangeDetectorRef, forwardRef } from '@angular/core';
7
- import { Subject, merge } from 'rxjs';
8
- import { isDocumentAvailable, isChanged } from '@progress/kendo-angular-common';
9
- import { relativeContextElement } from './util';
10
- import { filter, take } from 'rxjs/operators';
11
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
12
- import { validatePackage } from '@progress/kendo-licensing';
13
- import { packageMetadata } from './package-metadata';
14
- import { SortableService } from './sortable.service';
15
- import { DraggableDirective } from './draggable.directive';
16
- import { SortableContainer } from './sortable-container';
17
- import { ItemTemplateDirective, PlaceholderTemplateDirective } from './item-template.directive';
18
- import { NavigateEvent } from './navigate-event';
19
- import { DraggableEvent } from './draggable-event';
20
- import { DragStartEvent, DragOverEvent, DragEndEvent } from './sortable-events';
21
- import Draggable from '@telerik/kendo-draggable';
22
- /**
23
- * Represents the [Kendo UI Sortable component for Angular]({% slug overview_sortable %}).
24
- *
25
- * {% embed_file sortable-api/app.component.ts %}
26
- * {% embed_file shared/app.module.ts preview %}
27
- * {% embed_file shared/main.ts hidden %}
28
- */
29
- var SortableComponent = /** @class */ (function () {
30
- function SortableComponent(ngZone, localization, changeDetector, wrapper, sortableService) {
31
- this.ngZone = ngZone;
32
- this.localization = localization;
33
- this.changeDetector = changeDetector;
34
- /**
35
- * Specifies the tab index of the Sortable component.
36
- */
37
- this.tabIndex = null;
38
- /**
39
- * Enables or disables the [keyboard navigation]({% slug keyboard_navigation_sortable %}).
40
- * The default value is `false`.
41
- */
42
- this.navigable = false;
43
- /**
44
- * Enables or disables the built-in animations.
45
- * The default value is `false`.
46
- */
47
- this.animation = false;
48
- /**
49
- * Sets an array of integers, which represent the indexes of the disabled items from the data array
50
- * ([see example]({% slug items_sortable %}#toc-disabled-items)).
51
- */
52
- this.disabledIndexes = [];
53
- /**
54
- * Sets a string that represents the name of the zone to which the Sortable belongs
55
- * ([see example]({% slug items_sortable %}#toc-transfer-of-items)). Items can be transferred
56
- * between Sortables which belong to the same zone.
57
- */
58
- this.zone = undefined;
59
- /**
60
- * Defines the zones from which items can be transferred onto the current Sortable component
61
- * ([see example]({% slug items_sortable %}#toc-transfer-of-items)). If the `acceptZones` property
62
- * of the target Sortable is set, allows you to transfer items between Sortables which belong
63
- * to different zones.
64
- */
65
- this.acceptZones = undefined;
66
- /**
67
- * Represents the CSS styles which are applied to each Sortable item.
68
- *
69
- * @example
70
- * ```ts
71
- * import { Component } from '@angular/core';
72
- * import { SortableModule } from '@progress/kendo-angular-sortable';
73
- *
74
- * _@Component({
75
- * selector: 'my-app',
76
- * template: `
77
- * <kendo-sortable
78
- * [data]="['1','2','3','4','5','6','7']"
79
- * [itemStyle] ="{
80
- * 'display': 'inline-block',
81
- * 'background-color': '#51A0ED',
82
- * 'height':'50px',
83
- * 'width':'50px',
84
- * 'margin':'3px',
85
- * 'cursor':'move'
86
- * }"
87
- * >
88
- * </kendo-sortable>
89
- * `
90
- * })
91
- * export class AppComponent {
92
- * }
93
- * ```
94
- */
95
- this.itemStyle = {};
96
- /**
97
- * Defines the CSS styles applied to an empty item ([see example]({% slug templates_sortable %})).
98
- */
99
- this.emptyItemStyle = undefined;
100
- /**
101
- * Defines the CSS styles which are applied to the currently dragged item ([see example]({% slug templates_sortable %})).
102
- */
103
- this.activeItemStyle = undefined;
104
- /**
105
- * Defines the CSS styles which are applied to all disabled items.
106
- */
107
- this.disabledItemStyle = undefined;
108
- /**
109
- * Defines the class which is applied to each Sortable item.
110
- */
111
- this.itemClass = "";
112
- /**
113
- * Defines the class which is applied to the active Sortable item.
114
- */
115
- this.activeItemClass = null;
116
- /**
117
- * Defines the class which is applied to the empty item when the Sortable has empty data.
118
- */
119
- this.emptyItemClass = null;
120
- /**
121
- * Defines the class which is applied to each disabled Sortable item.
122
- */
123
- this.disabledItemClass = null;
124
- /**
125
- * Sets the text message that will be displayed when the Sortable has no items.
126
- *
127
- * @example
128
- * ```ts
129
- * import { Component } from '@angular/core';
130
- * import { SortableModule } from '@progress/kendo-angular-sortable';
131
- *
132
- * _@Component({
133
- * selector: 'my-app',
134
- * template: `
135
- * <kendo-sortable [data]="[]"
136
- * [emptyText]="'No items - custom message and styles'"
137
- * [emptyItemStyle] = "{'height': '40px', 'width':'400px', 'border': '2px dashed black'}" >
138
- * </kendo-sortable>
139
- * `
140
- * })
141
- * export class AppComponent { }
142
- * ```
143
- */
144
- this.emptyText = "Empty";
145
- /**
146
- * @hidden
147
- */
148
- this.defaultTemplateRef = null;
149
- /**
150
- * Defines the template that will be used for rendering the items.
151
- * @hidden
152
- */
153
- this.itemTemplateDirectiveRef = null;
154
- /**
155
- * Defines the template that will be used for rendering the placeholder.
156
- * @hidden
157
- */
158
- this.placeholderTemplateDirectiveRef = null;
159
- this.itemWrappers = null;
160
- /**
161
- * Fires when the dragging of an item is started.
162
- */
163
- this.dragStart = new EventEmitter();
164
- /**
165
- * Fires when the dragging of an item is completed.
166
- */
167
- this.dragEnd = new EventEmitter();
168
- /**
169
- * Fires while the dragging of an item is in progress.
170
- */
171
- this.dragOver = new EventEmitter();
172
- /**
173
- * Fires when dragging an item outside of the component.
174
- */
175
- this.dragLeave = new EventEmitter();
176
- /**
177
- * Fires while the moving an item from one position to another.
178
- */
179
- this.dataMove = new EventEmitter();
180
- /**
181
- * Fires when a new item is added to the Sortable.
182
- */
183
- this.dataAdd = new EventEmitter();
184
- /**
185
- * Fires when an item is removed from the Sortable.
186
- */
187
- this.dataRemove = new EventEmitter();
188
- /**
189
- * Fires when navigating using the keyboard.
190
- */
191
- this.navigate = new EventEmitter();
192
- /**
193
- * The index of the currently focused item.
194
- * If no item is focused, set to `-1`.
195
- */
196
- this.activeIndex = -1;
197
- /**
198
- * Flag indicating if the component is currently playing animations.
199
- * @hidden
200
- */
201
- this.animating = false;
202
- /**
203
- * The index of the currently dragged item.
204
- */
205
- this.dragIndex = -1;
206
- /**
207
- * The index of the item above which the dragged item is.
208
- */
209
- this.dragOverIndex = -1;
210
- this.onDragStartSubject = new Subject();
211
- this.onDragOverSubject = new Subject();
212
- this.onDragLeaveSubject = new Subject();
213
- this.onDragEndSubject = new Subject();
214
- /**
215
- * The location of the hint indicator when dragging on mobile devices.
216
- */
217
- this.hintLocation = null;
218
- this._localData = [];
219
- this.animationDuration = 300;
220
- this.afterKeyPress = false;
221
- this.sortableService = null;
222
- this._hideActiveItem = false;
223
- validatePackage(packageMetadata);
224
- this.wrapper = wrapper.nativeElement;
225
- this.direction = localization.rtl ? 'rtl' : 'ltr';
226
- this.sortableService = sortableService;
227
- this.subscribeEvents();
228
- }
229
- SortableComponent_1 = SortableComponent;
230
- Object.defineProperty(SortableComponent.prototype, "data", {
231
- get: function () {
232
- return this._data;
233
- },
234
- /**
235
- * Sets an array of any data that is used as a data source for the Sortable.
236
- *
237
- * {% embed_file sortable-palettes/app.component.ts %}
238
- * {% embed_file shared/app.module.ts %}
239
- * {% embed_file shared/main.ts hidden %}
240
- */
241
- set: function (data) {
242
- this._data = data;
243
- //Cache each _data item instance locally to avoid repaint due to the ngTemplateOutletContext (generated by itemData)
244
- //This prevents destroying the kendoDraggable instance, which otherwise leads to losing the dragEnd event
245
- //due to non-exisitng HTML element
246
- this.cacheData();
247
- },
248
- enumerable: true,
249
- configurable: true
250
- });
251
- Object.defineProperty(SortableComponent.prototype, "navigatable", {
252
- /**
253
- * @hidden
254
- *
255
- * A misspelled alias for `navigable`.
256
- */
257
- set: function (value) {
258
- this.navigable = value;
259
- },
260
- enumerable: true,
261
- configurable: true
262
- });
263
- Object.defineProperty(SortableComponent.prototype, "touchAction", {
264
- get: function () {
265
- return "none";
266
- },
267
- enumerable: true,
268
- configurable: true
269
- });
270
- Object.defineProperty(SortableComponent.prototype, "dir", {
271
- get: function () {
272
- return this.direction;
273
- },
274
- enumerable: true,
275
- configurable: true
276
- });
277
- SortableComponent.prototype.setItemData = function (data, i) {
278
- this._localData[i].item = data.item;
279
- this._localData[i].index = data.index;
280
- this._localData[i].hidden = data.hidden;
281
- };
282
- /**
283
- * @hidden
284
- */
285
- SortableComponent.prototype.itemTemplate = function (index) {
286
- var template = this.itemTemplateRef;
287
- if (index === this.dragOverIndex) {
288
- template = this.placeholderTemplateRef;
289
- }
290
- else if (index === this.dragIndex) {
291
- template = this.itemTemplateRef;
292
- }
293
- return template;
294
- };
295
- SortableComponent.prototype.ngOnInit = function () {
296
- var _this = this;
297
- if (!this.data) {
298
- this.data = [];
299
- }
300
- this.id = this.sortableService.registerComponent(this);
301
- this.dragIndex = -1;
302
- var display = "display";
303
- if (this.activeItemStyle && !this.activeItemStyle[display]) {
304
- this.activeItemStyle[display] = "";
305
- }
306
- if (!this.itemStyle[display]) {
307
- this.itemStyle[display] = "";
308
- }
309
- if (this.wrapper) {
310
- this.draggable = new Draggable({
311
- press: function (e) { return _this.sortableService.onPress(e); },
312
- drag: function (e) { return _this.sortableService.onDrag(e); },
313
- release: function (e) { return _this.sortableService.onRelease(e); }
314
- });
315
- this.ngZone.runOutsideAngular(function () {
316
- _this.draggable.bindTo(_this.wrapper);
317
- });
318
- }
319
- };
320
- SortableComponent.prototype.ngOnChanges = function (changes) {
321
- if (this.data && isChanged('disabledIndexes', changes, false)) {
322
- this.cacheData();
323
- }
324
- };
325
- SortableComponent.prototype.ngOnDestroy = function () {
326
- this.unsubscribeEvents();
327
- this.sortableService.unregisterComponent(this.id);
328
- if (this.draggable) {
329
- this.draggable.destroy();
330
- }
331
- };
332
- SortableComponent.prototype.ngAfterContentInit = function () {
333
- this.itemTemplateRef = this.itemTemplateDirectiveRef.first || this.defaultTemplateRef.first;
334
- this.placeholderTemplateRef = this.placeholderTemplateDirectiveRef.first || this.defaultTemplateRef.first;
335
- };
336
- SortableComponent.prototype.ngAfterViewChecked = function () {
337
- if (this.afterKeyPress) {
338
- if (this.itemWrappers) {
339
- var elems = this.itemWrappers.toArray();
340
- if (elems && elems.length > 0 && this.activeIndex > -1) {
341
- elems[this.activeIndex].nativeElement.focus();
342
- }
343
- }
344
- this.afterKeyPress = false;
345
- }
346
- };
347
- /**
348
- * @hidden
349
- */
350
- SortableComponent.prototype.updateCacheIndices = function () {
351
- this._localData.forEach(function (item, index) {
352
- item.index = index;
353
- });
354
- };
355
- /**
356
- * @hidden
357
- */
358
- SortableComponent.prototype.cacheData = function () {
359
- var _this = this;
360
- this._localData = [];
361
- this._data.forEach(function (item, index) {
362
- _this._localData.push({ item: item, active: false, disabled: !_this.itemEnabled(index), index: index, hidden: false });
363
- });
364
- };
365
- /**
366
- * @hidden
367
- */
368
- SortableComponent.prototype.startDrag = function (event) {
369
- var startEvent = new DraggableEvent(event);
370
- this.onDragStartSubject.next(startEvent);
371
- var prevented = startEvent.isDefaultPrevented();
372
- if (!prevented) {
373
- this.offsetParent = relativeContextElement(this.wrapper);
374
- }
375
- return prevented;
376
- };
377
- /**
378
- * @hidden
379
- */
380
- SortableComponent.prototype.drag = function (event) {
381
- var dragEvent = new DraggableEvent(event);
382
- this.onDragOverSubject.next(dragEvent);
383
- return dragEvent.isDefaultPrevented();
384
- };
385
- /**
386
- * @hidden
387
- */
388
- SortableComponent.prototype.leave = function (event) {
389
- var leaveEvent = new DraggableEvent(event);
390
- this.onDragLeaveSubject.next(leaveEvent);
391
- return leaveEvent.isDefaultPrevented();
392
- };
393
- /**
394
- * @hidden
395
- */
396
- SortableComponent.prototype.endDrag = function (event) {
397
- var endEvent = new DraggableEvent(event);
398
- this.onDragEndSubject.next(endEvent);
399
- return endEvent.isDefaultPrevented();
400
- };
401
- /**
402
- * @hidden
403
- */
404
- SortableComponent.prototype.hintVisible = function () {
405
- return this.dragIndex >= 0 && this.hintLocation && this === this.sortableService.getSource();
406
- };
407
- /**
408
- * @hidden
409
- */
410
- SortableComponent.prototype.currentItemStyle = function (index) {
411
- if (index === -1) {
412
- return this.emptyItemStyle ? this.emptyItemStyle : this.itemStyle;
413
- }
414
- if (!this.itemEnabled(index) && this.disabledItemStyle) {
415
- return this.disabledItemStyle;
416
- }
417
- if (index === this.dragIndex || (this.dragIndex === -1 && index === this.activeIndex)) {
418
- if (this.hideActiveItem) {
419
- return { "display": "none" };
420
- }
421
- if (this.activeItemStyle) {
422
- return this.activeItemStyle;
423
- }
424
- }
425
- return this.itemStyle;
426
- };
427
- /**
428
- * @hidden
429
- */
430
- SortableComponent.prototype.currentItemClass = function (index) {
431
- if (index === -1) {
432
- return this.emptyItemClass ? this.emptyItemClass : this.itemClass;
433
- }
434
- if (!this.itemEnabled(index) && this.disabledItemClass) {
435
- return this.disabledItemClass;
436
- }
437
- if ((index === this.dragIndex || this.dragIndex === -1 && index === this.activeIndex) && this.activeItemClass) {
438
- return this.activeItemClass;
439
- }
440
- return this.itemClass;
441
- };
442
- /**
443
- * @hidden
444
- */
445
- SortableComponent.prototype.hintStyle = function () {
446
- var position = {
447
- "left": this.hintLocation.x + 10 + "px",
448
- "position": "fixed",
449
- "top": this.hintLocation.y + 10 + "px"
450
- };
451
- var style = {};
452
- Object.assign(style, this.currentItemStyle(this.dragIndex), position);
453
- return style;
454
- };
455
- /**
456
- * @hidden
457
- */
458
- SortableComponent.prototype.itemEnabled = function (index) {
459
- return this.disabledIndexes.indexOf(index) === -1;
460
- };
461
- /**
462
- * @hidden
463
- */
464
- SortableComponent.prototype.acceptDragFrom = function (sortableComponent) {
465
- if (this.acceptZones === undefined) {
466
- return (this.zone === sortableComponent.zone);
467
- }
468
- else if (sortableComponent.zone !== undefined) {
469
- return (this.acceptZones.indexOf(sortableComponent.zone) !== -1);
470
- }
471
- return false;
472
- };
473
- /**
474
- * @hidden
475
- */
476
- SortableComponent.prototype.ariaDropEffect = function (index) {
477
- return this.itemEnabled(index) ? "move" : "none";
478
- };
479
- /**
480
- * @hidden
481
- */
482
- SortableComponent.prototype.focusHandler = function (index) {
483
- if (this.navigable) {
484
- this.activeIndex = index;
485
- }
486
- };
487
- /**
488
- * @hidden
489
- */
490
- SortableComponent.prototype.blurHandler = function () {
491
- if (this.navigable && !this.afterKeyPress) {
492
- this.activeIndex = -1;
493
- }
494
- };
495
- /**
496
- * @hidden
497
- */
498
- SortableComponent.prototype.keydownHandler = function (event) {
499
- var code = event.keyCode;
500
- var navigate = this.navigable && code >= 37 && code <= 40;
501
- var hasFocus = this.activeIndex !== -1;
502
- if (!navigate || !hasFocus) {
503
- return;
504
- }
505
- var leftKey = this.direction === 'rtl' ? 39 : 37;
506
- var dir = code === 38 || code === leftKey ? -1 : 1;
507
- var limit = this.data.length - 1;
508
- var targetIndex = this.activeIndex + dir;
509
- while (!this.itemEnabled(targetIndex) && targetIndex <= limit) {
510
- targetIndex += dir;
511
- }
512
- targetIndex = Math.min(Math.max(targetIndex, 0), limit);
513
- if (!this.itemEnabled(targetIndex)) {
514
- return;
515
- }
516
- if (navigate) {
517
- var ctrl = event.ctrlKey || event.metaKey;
518
- var navigateEvent = new NavigateEvent({ index: targetIndex, oldIndex: this.activeIndex, ctrlKey: ctrl });
519
- this.navigate.emit(navigateEvent);
520
- if (!navigateEvent.isDefaultPrevented()) {
521
- this.activeIndex = targetIndex;
522
- }
523
- this.dragIndex = -1;
524
- this.dragOverIndex = -1;
525
- }
526
- event.stopPropagation();
527
- event.preventDefault();
528
- this.afterKeyPress = true;
529
- };
530
- /**
531
- * Removes the currently active item from the Data collection that the Sortable uses.
532
- */
533
- SortableComponent.prototype.removeDataItem = function (index) {
534
- this.dragIndex = -1;
535
- this.dragOverIndex = -1;
536
- this._localData.splice(index, 1);
537
- this.data.splice(index, 1);
538
- this.updateCacheIndices();
539
- };
540
- /**
541
- * Sets a Boolean value that indicates whether the item will be hidden or not.
542
- * @hidden
543
- */
544
- SortableComponent.prototype.hideItem = function (index, hidden) {
545
- if (hidden === void 0) { hidden = true; }
546
- this._localData[index].hidden = hidden;
547
- };
548
- Object.defineProperty(SortableComponent.prototype, "hideActiveItem", {
549
- /**
550
- * If the currently dragged item is hidden, returns `true`.
551
- * If the currently dragged item is visible, returns `false`.
552
- */
553
- get: function () {
554
- return this._hideActiveItem;
555
- },
556
- /**
557
- * Sets a Boolean value that indicates whether the currently dragged item will be hidden.
558
- */
559
- set: function (value) {
560
- this.activeIndex = -1;
561
- this._hideActiveItem = value;
562
- },
563
- enumerable: true,
564
- configurable: true
565
- });
566
- /**
567
- * Clears the active item.
568
- * An active item is the item which becomes focused when the user navigates with the keyboard.
569
- */
570
- SortableComponent.prototype.clearActiveItem = function () {
571
- if (this.navigable) {
572
- this.fixFocus();
573
- }
574
- else {
575
- this.activeIndex = -1;
576
- }
577
- this.dragIndex = -1;
578
- };
579
- /**
580
- * Returns the currently active item when the user navigates with the keyboard.
581
- * @return - The data item which is currently active.
582
- */
583
- SortableComponent.prototype.getActiveItem = function () {
584
- if (this.data && this.dragIndex >= 0 && this.dragIndex < this.data.length) {
585
- return this.data[this.dragIndex];
586
- }
587
- };
588
- /**
589
- * Adds a new data item to a particular index.
590
- * @param dataItem - The data item.
591
- * @param index - The index at which the data item is inserted.
592
- */
593
- SortableComponent.prototype.addDataItem = function (dataItem, index) {
594
- var _this = this;
595
- var originDraggable = this.sortableService.originDraggable;
596
- if (originDraggable && originDraggable.parent === this) {
597
- var animation = this.animation;
598
- this.hideItem(originDraggable.index, false);
599
- this.animation = false;
600
- this.moveItem(originDraggable.index, index);
601
- this.animation = animation;
602
- }
603
- else {
604
- this.data.splice(index, 0, dataItem);
605
- this._localData.splice(index, 0, { item: dataItem, active: false, disabled: !this.itemEnabled(index), index: index, hidden: false });
606
- this.updateCacheIndices();
607
- }
608
- this.dragIndex = index;
609
- this.dragOverIndex = index;
610
- this.ngZone.onStable.pipe(take(1)).subscribe(function () {
611
- _this.sortableService.target = _this;
612
- _this.sortableService.setSource(_this);
613
- _this.sortableService.activeDraggable = _this.draggables.toArray()[index];
614
- _this.sortableService.lastDraggable = null;
615
- });
616
- };
617
- /**
618
- * Moves data item to a particular index.
619
- * @param fromIndex - The data item's index.
620
- * @param toIndex - The index which the data item should be moved to. Item currently sitting at that index is pushed back one position.
621
- */
622
- SortableComponent.prototype.moveItem = function (fromIndex, toIndex) {
623
- var _this = this;
624
- if (toIndex === fromIndex) {
625
- return;
626
- }
627
- var dragIndex = fromIndex;
628
- var d = toIndex > dragIndex ? 1 : -1;
629
- var originalIndexAnimate = dragIndex;
630
- var toAnimate = [];
631
- var prevIndex = dragIndex;
632
- var tmp;
633
- while (dragIndex !== toIndex) {
634
- dragIndex += d;
635
- if (this.itemEnabled(dragIndex) || dragIndex === toIndex) {
636
- if (this.animation) {
637
- toAnimate.push({ next: dragIndex, prev: prevIndex });
638
- }
639
- tmp = this._localData[prevIndex].index;
640
- this._localData[prevIndex].index = this._localData[dragIndex].index;
641
- this._localData[dragIndex].index = tmp;
642
- tmp = this._localData[prevIndex];
643
- this._localData[prevIndex] = this._localData[dragIndex];
644
- this._localData[dragIndex] = tmp;
645
- tmp = this.data[prevIndex];
646
- this.data[prevIndex] = this.data[dragIndex];
647
- this.data[dragIndex] = tmp;
648
- prevIndex = dragIndex;
649
- }
650
- }
651
- this.dragIndex = dragIndex;
652
- this.dragOverIndex = dragIndex;
653
- this.activeIndex = dragIndex;
654
- if (this.animation) {
655
- setTimeout(function () {
656
- toAnimate.push({ next: originalIndexAnimate, prev: dragIndex });
657
- _this.animating = true;
658
- _this.animate(toAnimate);
659
- });
660
- }
661
- this.ngZone.onStable.pipe(take(1)).subscribe(function () {
662
- _this.sortableService.activeDraggable = _this.draggables.toArray()[dragIndex];
663
- _this.sortableService.lastDraggable = null;
664
- });
665
- };
666
- /**
667
- * @hidden
668
- */
669
- SortableComponent.prototype.animate = function (draggables) {
670
- var _this = this;
671
- var itemArray = this.itemWrappers.toArray();
672
- var prevClientRect = [];
673
- var nextClientRect = [];
674
- var that = this;
675
- clearTimeout(this._animating);
676
- for (var i = 0; i < draggables.length; i++) {
677
- prevClientRect.push(itemArray[draggables[i].prev].nativeElement.getBoundingClientRect());
678
- nextClientRect.push(itemArray[draggables[i].next].nativeElement.getBoundingClientRect());
679
- }
680
- for (var i = 0; i < draggables.length; i++) {
681
- var nextIndex = draggables[i].prev;
682
- var targetRect = nextClientRect[i];
683
- var currentRect = prevClientRect[i];
684
- var target = itemArray[nextIndex].nativeElement;
685
- this.applyAnimationStyle(target, 'transition', 'none');
686
- this.applyAnimationStyle(target, 'transform', 'translate3d('
687
- + (targetRect.left - currentRect.left).toString() + 'px,'
688
- + (targetRect.top - currentRect.top).toString() + 'px,0)');
689
- this.reflow(target);
690
- }
691
- var _loop_1 = function (i) {
692
- var nextIndex = draggables[i].prev;
693
- var target = itemArray[nextIndex].nativeElement;
694
- this_1.applyAnimationStyle(target, 'transition', 'all ' + this_1.animationDuration + 'ms');
695
- this_1.applyAnimationStyle(target, 'transform', 'translate3d(0,0,0)');
696
- clearTimeout(target.animated);
697
- target.animated = setTimeout(function () {
698
- that.applyAnimationStyle(target, 'transition', '');
699
- that.applyAnimationStyle(target, 'transform', '');
700
- target.animated = false;
701
- }, this_1.animationDuration);
702
- };
703
- var this_1 = this;
704
- for (var i = 0; i < draggables.length; i++) {
705
- _loop_1(i);
706
- }
707
- this._animating = setTimeout(function () {
708
- _this.animating = false;
709
- }, this.animationDuration);
710
- };
711
- /**
712
- * @hidden
713
- */
714
- SortableComponent.prototype.positionHintFromEvent = function (event) {
715
- var offset = this.parentOffset();
716
- this.hintLocation = event ? { x: event.clientX - offset.left, y: event.clientY - offset.top } : null;
717
- };
718
- /**
719
- * @hidden
720
- */
721
- SortableComponent.prototype.parentOffset = function () {
722
- var offsetParent = this.offsetParent;
723
- if (offsetParent) {
724
- var rect = offsetParent.getBoundingClientRect();
725
- return {
726
- left: rect.left - offsetParent.scrollLeft,
727
- top: rect.top - offsetParent.scrollTop
728
- };
729
- }
730
- return { left: 0, top: 0 };
731
- };
732
- /**
733
- * @hidden
734
- */
735
- SortableComponent.prototype.markForCheck = function () {
736
- this.changeDetector.markForCheck();
737
- };
738
- /**
739
- * @hidden
740
- */
741
- SortableComponent.prototype.reflow = function (element) {
742
- return element.offsetWidth;
743
- };
744
- /**
745
- * @hidden
746
- */
747
- SortableComponent.prototype.applyAnimationStyle = function (el, prop, val) {
748
- var style = el && el.style;
749
- if (style) {
750
- if (!(prop in style)) {
751
- prop = '-webkit-' + prop;
752
- }
753
- style[prop] = val;
754
- }
755
- };
756
- SortableComponent.prototype.subscribeEvents = function () {
757
- var _this = this;
758
- this.localizationChangeSubscription = this.localization
759
- .changes
760
- .subscribe(function (_a) {
761
- var rtl = _a.rtl;
762
- return _this.direction = rtl ? 'rtl' : 'ltr';
763
- });
764
- this.dragStartSubscription = this.onDragStartSubject
765
- .subscribe(function (event) {
766
- _this.sortableService.originDraggable = event.target;
767
- _this.sortableService.originIndex = event.target.index;
768
- _this.sortableService.activeDraggable = event.target;
769
- _this.sortableService.lastDraggable = event.target;
770
- _this.sortableService.target = _this;
771
- _this.sortableService.setSource(_this);
772
- var dragStartEvent = new DragStartEvent({ index: event.target.index });
773
- _this.dragStart.emit(dragStartEvent);
774
- if (dragStartEvent.isDefaultPrevented()) {
775
- event.preventDefault();
776
- }
777
- else {
778
- if (!event.target.disabled) {
779
- if (_this.sortableService.target) {
780
- _this.sortableService.target.dragOverIndex = -1;
781
- _this.sortableService.target.dragIndex = -1;
782
- }
783
- _this.dragOverIndex = event.target.index;
784
- _this.dragIndex = event.target.index;
785
- }
786
- }
787
- });
788
- this.dragOverSubscription = this.onDragOverSubject.pipe(filter(function (event) { return event.target && event.target.el.nativeElement.style.transition.length === 0; }), filter(function () {
789
- // Drag started from a disabled item
790
- return _this.sortableService.originDraggable && !_this.sortableService.originDraggable.disabled;
791
- }), filter(function () {
792
- return _this.sortableService && _this.acceptDragFrom(_this.sortableService.getSource());
793
- }), filter(function (event) {
794
- return event.target !== _this.sortableService.lastDraggable;
795
- }))
796
- .subscribe(function (event) {
797
- _this.sortableService.lastDraggable = event.target;
798
- var originDraggable = _this.sortableService.originDraggable;
799
- var targetIndex = event.target.index;
800
- if (originDraggable.hidden && originDraggable.parent === _this) {
801
- if (originDraggable.index < event.target.index) {
802
- targetIndex = event.target.index - 1;
803
- }
804
- }
805
- _this.sortableService.target = _this;
806
- var oldIndex = _this.sortableService.activeDraggable ? _this.sortableService.activeDraggable.index : 0;
807
- var dragOverEvent = new DragOverEvent({ index: targetIndex, oldIndex: oldIndex });
808
- _this.dragOver.emit(dragOverEvent);
809
- if (!dragOverEvent.isDefaultPrevented() && event.target && event.target.index >= 0) {
810
- _this.dragOverIndex = event.target.index;
811
- _this.placeHolderItemData(event.target);
812
- }
813
- });
814
- this.dragEndSubscription = this.onDragEndSubject
815
- .subscribe(function (event) {
816
- var source = _this.sortableService.getSource();
817
- if (!source) {
818
- return;
819
- }
820
- var target = _this.sortableService.target;
821
- var index = event.target ? event.target.index : -1;
822
- var oldIndex = _this.sortableService.originDraggable ? _this.sortableService.originIndex : -1;
823
- _this.hintLocation = null;
824
- var dragEndEvent = new DragEndEvent({ index: index, oldIndex: oldIndex });
825
- _this.dragEnd.emit(dragEndEvent);
826
- if (!dragEndEvent.isDefaultPrevented()) {
827
- source.dragIndex = -1;
828
- source.dragOverIndex = -1;
829
- source.activeIndex = -1;
830
- if (target && target !== source) {
831
- target.dragIndex = -1;
832
- target.dragOverIndex = -1;
833
- }
834
- setTimeout(function () {
835
- _this.sortableService.activeDraggable = null;
836
- _this.sortableService.lastDraggable = null;
837
- _this.sortableService.originDraggable = null;
838
- _this.sortableService.target = null;
839
- _this.sortableService.setSource(null);
840
- });
841
- }
842
- });
843
- this.dragLeaveSubscription = this.onDragLeaveSubject.pipe(filter(function (e) {
844
- if (!isDocumentAvailable()) {
845
- return false;
846
- }
847
- return _this.wrapper !== document.elementFromPoint(e.originalEvent.pageX, e.originalEvent.pageY);
848
- }), filter(function (_e) {
849
- return !_this.animating;
850
- }), filter(function (_) { return _this.sortableService.target && _this.sortableService.target.dragOverIndex > -1; }))
851
- .subscribe(function () {
852
- _this.dragLeave.emit({ index: _this.sortableService.originDraggable.index });
853
- _this.sortableService.lastDraggable = null;
854
- _this.dragOverIndex = -1;
855
- _this.sortableService.target = null;
856
- });
857
- };
858
- SortableComponent.prototype.unsubscribeEvents = function () {
859
- if (this.localizationChangeSubscription) {
860
- this.localizationChangeSubscription.unsubscribe();
861
- }
862
- this.dragStartSubscription.unsubscribe();
863
- this.dragOverSubscription.unsubscribe();
864
- this.dragEndSubscription.unsubscribe();
865
- this.dragLeaveSubscription.unsubscribe();
866
- };
867
- SortableComponent.prototype.placeHolderItemData = function (draggable) {
868
- var _this = this;
869
- if (draggable.disabled) {
870
- return;
871
- }
872
- var target = this.sortableService.target;
873
- var source = this.sortableService.getSource();
874
- var originalData = Object.assign({}, this._localData[draggable.index]);
875
- var newData = source._localData[source.dragIndex];
876
- this.setItemData(newData, draggable.index);
877
- var endSub = source.onDragEndSubject.pipe(take(1)).subscribe(function () {
878
- _this.setItemData(originalData, draggable.index);
879
- });
880
- var leaveSub = target.onDragLeaveSubject.pipe(take(1)).subscribe(function () {
881
- _this.setItemData(originalData, draggable.index);
882
- });
883
- var overSub = merge(this.onDragOverSubject.pipe(filter(function () {
884
- return draggable.index !== _this.dragOverIndex;
885
- })), this.onDragLeaveSubject).subscribe(function () {
886
- _this.setItemData(originalData, draggable.index);
887
- endSub.unsubscribe();
888
- overSub.unsubscribe();
889
- leaveSub.unsubscribe();
890
- });
891
- };
892
- SortableComponent.prototype.fixFocus = function () {
893
- if (this.itemWrappers) {
894
- var itemArray = this.itemWrappers.toArray();
895
- if (this.dragIndex > -1 && itemArray && itemArray.length > 0) {
896
- itemArray[this.dragIndex].nativeElement.focus();
897
- this.activeIndex = this.dragIndex;
898
- }
899
- }
900
- };
901
- var SortableComponent_1;
902
- tslib_1.__decorate([
903
- Input(),
904
- tslib_1.__metadata("design:type", Number)
905
- ], SortableComponent.prototype, "tabIndex", void 0);
906
- tslib_1.__decorate([
907
- Input(),
908
- tslib_1.__metadata("design:type", Array),
909
- tslib_1.__metadata("design:paramtypes", [Array])
910
- ], SortableComponent.prototype, "data", null);
911
- tslib_1.__decorate([
912
- Input(),
913
- tslib_1.__metadata("design:type", Boolean)
914
- ], SortableComponent.prototype, "navigable", void 0);
915
- tslib_1.__decorate([
916
- Input(),
917
- tslib_1.__metadata("design:type", Boolean),
918
- tslib_1.__metadata("design:paramtypes", [Boolean])
919
- ], SortableComponent.prototype, "navigatable", null);
920
- tslib_1.__decorate([
921
- Input(),
922
- tslib_1.__metadata("design:type", Boolean)
923
- ], SortableComponent.prototype, "animation", void 0);
924
- tslib_1.__decorate([
925
- Input(),
926
- tslib_1.__metadata("design:type", Array)
927
- ], SortableComponent.prototype, "disabledIndexes", void 0);
928
- tslib_1.__decorate([
929
- Input(),
930
- tslib_1.__metadata("design:type", String)
931
- ], SortableComponent.prototype, "zone", void 0);
932
- tslib_1.__decorate([
933
- Input(),
934
- tslib_1.__metadata("design:type", Array)
935
- ], SortableComponent.prototype, "acceptZones", void 0);
936
- tslib_1.__decorate([
937
- Input(),
938
- tslib_1.__metadata("design:type", Object)
939
- ], SortableComponent.prototype, "itemStyle", void 0);
940
- tslib_1.__decorate([
941
- Input(),
942
- tslib_1.__metadata("design:type", Object)
943
- ], SortableComponent.prototype, "emptyItemStyle", void 0);
944
- tslib_1.__decorate([
945
- Input(),
946
- tslib_1.__metadata("design:type", Object)
947
- ], SortableComponent.prototype, "activeItemStyle", void 0);
948
- tslib_1.__decorate([
949
- Input(),
950
- tslib_1.__metadata("design:type", Object)
951
- ], SortableComponent.prototype, "disabledItemStyle", void 0);
952
- tslib_1.__decorate([
953
- Input(),
954
- tslib_1.__metadata("design:type", Object)
955
- ], SortableComponent.prototype, "itemClass", void 0);
956
- tslib_1.__decorate([
957
- Input(),
958
- tslib_1.__metadata("design:type", Object)
959
- ], SortableComponent.prototype, "activeItemClass", void 0);
960
- tslib_1.__decorate([
961
- Input(),
962
- tslib_1.__metadata("design:type", Object)
963
- ], SortableComponent.prototype, "emptyItemClass", void 0);
964
- tslib_1.__decorate([
965
- Input(),
966
- tslib_1.__metadata("design:type", Object)
967
- ], SortableComponent.prototype, "disabledItemClass", void 0);
968
- tslib_1.__decorate([
969
- Input(),
970
- tslib_1.__metadata("design:type", String)
971
- ], SortableComponent.prototype, "emptyText", void 0);
972
- tslib_1.__decorate([
973
- ContentChildren(TemplateRef, { descendants: false }),
974
- tslib_1.__metadata("design:type", QueryList)
975
- ], SortableComponent.prototype, "defaultTemplateRef", void 0);
976
- tslib_1.__decorate([
977
- ContentChildren(ItemTemplateDirective, { read: TemplateRef, descendants: false }),
978
- tslib_1.__metadata("design:type", QueryList)
979
- ], SortableComponent.prototype, "itemTemplateDirectiveRef", void 0);
980
- tslib_1.__decorate([
981
- ContentChildren(PlaceholderTemplateDirective, { read: TemplateRef, descendants: false }),
982
- tslib_1.__metadata("design:type", QueryList)
983
- ], SortableComponent.prototype, "placeholderTemplateDirectiveRef", void 0);
984
- tslib_1.__decorate([
985
- ViewChildren('itemWrapper'),
986
- tslib_1.__metadata("design:type", QueryList)
987
- ], SortableComponent.prototype, "itemWrappers", void 0);
988
- tslib_1.__decorate([
989
- ViewChildren(DraggableDirective),
990
- tslib_1.__metadata("design:type", QueryList)
991
- ], SortableComponent.prototype, "draggables", void 0);
992
- tslib_1.__decorate([
993
- ViewChild('noDataRef', { static: false }),
994
- tslib_1.__metadata("design:type", ElementRef)
995
- ], SortableComponent.prototype, "noDataContainer", void 0);
996
- tslib_1.__decorate([
997
- ViewChild('hint', { static: false }),
998
- tslib_1.__metadata("design:type", ElementRef)
999
- ], SortableComponent.prototype, "hint", void 0);
1000
- tslib_1.__decorate([
1001
- Output(),
1002
- tslib_1.__metadata("design:type", EventEmitter)
1003
- ], SortableComponent.prototype, "dragStart", void 0);
1004
- tslib_1.__decorate([
1005
- Output(),
1006
- tslib_1.__metadata("design:type", EventEmitter)
1007
- ], SortableComponent.prototype, "dragEnd", void 0);
1008
- tslib_1.__decorate([
1009
- Output(),
1010
- tslib_1.__metadata("design:type", EventEmitter)
1011
- ], SortableComponent.prototype, "dragOver", void 0);
1012
- tslib_1.__decorate([
1013
- Output(),
1014
- tslib_1.__metadata("design:type", EventEmitter)
1015
- ], SortableComponent.prototype, "dragLeave", void 0);
1016
- tslib_1.__decorate([
1017
- Output(),
1018
- tslib_1.__metadata("design:type", EventEmitter)
1019
- ], SortableComponent.prototype, "dataMove", void 0);
1020
- tslib_1.__decorate([
1021
- Output(),
1022
- tslib_1.__metadata("design:type", EventEmitter)
1023
- ], SortableComponent.prototype, "dataAdd", void 0);
1024
- tslib_1.__decorate([
1025
- Output(),
1026
- tslib_1.__metadata("design:type", EventEmitter)
1027
- ], SortableComponent.prototype, "dataRemove", void 0);
1028
- tslib_1.__decorate([
1029
- Output(),
1030
- tslib_1.__metadata("design:type", EventEmitter)
1031
- ], SortableComponent.prototype, "navigate", void 0);
1032
- tslib_1.__decorate([
1033
- Input(),
1034
- tslib_1.__metadata("design:type", Number)
1035
- ], SortableComponent.prototype, "activeIndex", void 0);
1036
- tslib_1.__decorate([
1037
- HostBinding('style.touch-action'),
1038
- tslib_1.__metadata("design:type", String),
1039
- tslib_1.__metadata("design:paramtypes", [])
1040
- ], SortableComponent.prototype, "touchAction", null);
1041
- tslib_1.__decorate([
1042
- HostBinding('attr.dir'),
1043
- tslib_1.__metadata("design:type", String),
1044
- tslib_1.__metadata("design:paramtypes", [])
1045
- ], SortableComponent.prototype, "dir", null);
1046
- SortableComponent = SortableComponent_1 = tslib_1.__decorate([
1047
- Component({
1048
- exportAs: 'kendoSortable',
1049
- providers: [
1050
- LocalizationService,
1051
- {
1052
- provide: L10N_PREFIX,
1053
- useValue: 'kendo.sortable'
1054
- },
1055
- {
1056
- provide: SortableContainer,
1057
- useExisting: forwardRef(function () { return SortableComponent_1; })
1058
- }
1059
- ],
1060
- selector: 'kendo-sortable',
1061
- template: "\n <div #itemWrapper *ngFor=\"let item of _localData;let i=index\"\n kendoDraggable\n [attr.tabIndex]=\"itemEnabled(i)?(navigable?tabIndex||0:tabIndex):null\"\n [attr.aria-grabbed]=\"i===dragIndex\"\n [attr.aria-dropeffect]=\"ariaDropEffect(i)\"\n [attr.data-sortable-item] = \"true\"\n [attr.data-sortable-index]=\"i\"\n [attr.data-sortable-id]=\"id\"\n [index]=\"i\"\n [hidden]=\"item.hidden\"\n [disabled]=\"!itemEnabled(i)\"\n [ngClass]=\"currentItemClass(i)\"\n [ngStyle]=\"currentItemStyle(i)\"\n\n (focus)=\"focusHandler(i)\"\n (blur)=\"blurHandler()\"\n (keydown)=\"keydownHandler($event)\"\n >\n <ng-container *ngIf=\"itemTemplateRef\"\n [ngTemplateOutlet]=\"itemTemplate(i)\"\n [ngTemplateOutletContext]=\"item\">\n </ng-container>\n <ng-container *ngIf=\"!itemTemplateRef\">{{item.item}}</ng-container>\n </div>\n\n <ng-container #noDataRef *ngIf=\"!_data.length || _localData.length === 1 && _localData[0].hidden\">\n <div\n kendoDraggable\n [index]=\"0\"\n [disabled]=\"true\"\n [attr.data-sortable-id]=\"id\"\n [attr.data-sortable-index]=\"0\"\n [ngStyle]=\"currentItemStyle(-1)\"\n [ngClass]=\"currentItemClass(-1)\"\n >{{emptyText}}</div>\n </ng-container>\n <div *ngIf=\"hintVisible()\" [ngStyle]=\"hintStyle()\" [ngClass]=\"currentItemClass(dragIndex)\">\n <ng-container *ngIf=\"itemTemplateRef\"\n [ngTemplateOutlet]=\"itemTemplateRef\"\n [ngTemplateOutletContext]=\"{item: _localData[dragIndex].item}\">\n </ng-container>\n <ng-container *ngIf=\"!itemTemplateRef\">{{_localData[dragIndex].item}}</ng-container>\n </div>\n "
1062
- })
1063
- /**
1064
- * Represents the Kendo UI Sortable component for Angular.
1065
- */
1066
- ,
1067
- tslib_1.__metadata("design:paramtypes", [NgZone,
1068
- LocalizationService,
1069
- ChangeDetectorRef,
1070
- ElementRef,
1071
- SortableService])
1072
- ], SortableComponent);
1073
- return SortableComponent;
1074
- }());
1075
- export { SortableComponent };