@progress/kendo-angular-sortable 25.0.0-develop.1 → 25.0.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/progress-kendo-angular-sortable.mjs +224 -93
- package/index.d.ts +96 -38
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Injectable, HostBinding, Input, Directive, QueryList, EventEmitter, TemplateRef, forwardRef, Output, ViewChild, ViewChildren, ContentChildren, Component, NgModule } from '@angular/core';
|
|
6
|
+
import { signal, Injectable, HostBinding, Input, Directive, QueryList, EventEmitter, computed, afterNextRender, TemplateRef, forwardRef, Output, ViewChild, ViewChildren, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
7
7
|
import { Subject, merge } from 'rxjs';
|
|
8
|
-
import { isDocumentAvailable, focusableSelector,
|
|
8
|
+
import { isDocumentAvailable, focusableSelector, Keys, normalizeKeys, EventsOutsideAngularDirective, KENDO_WEBMCP_HOST } from '@progress/kendo-angular-common';
|
|
9
9
|
import { filter, tap, take, switchMap } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@progress/kendo-angular-l10n';
|
|
11
11
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
@@ -193,8 +193,8 @@ const packageMetadata = {
|
|
|
193
193
|
productName: 'Kendo UI for Angular',
|
|
194
194
|
productCode: 'KENDOUIANGULAR',
|
|
195
195
|
productCodes: ['KENDOUIANGULAR'],
|
|
196
|
-
publishDate:
|
|
197
|
-
version: '25.0.0-develop.
|
|
196
|
+
publishDate: 1783692661,
|
|
197
|
+
version: '25.0.0-develop.3',
|
|
198
198
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
199
199
|
};
|
|
200
200
|
|
|
@@ -240,12 +240,6 @@ class SortableService {
|
|
|
240
240
|
* @hidden
|
|
241
241
|
*/
|
|
242
242
|
onReleaseSubject = new Subject();
|
|
243
|
-
subscriptions;
|
|
244
|
-
source = null;
|
|
245
|
-
_target = null;
|
|
246
|
-
sortableCounter = 0;
|
|
247
|
-
sortableRegister = {};
|
|
248
|
-
pressArgs;
|
|
249
243
|
/**
|
|
250
244
|
* Specifies the `SortableComponent` instance under the currently dragged item.
|
|
251
245
|
*/
|
|
@@ -255,6 +249,16 @@ class SortableService {
|
|
|
255
249
|
get target() {
|
|
256
250
|
return this._target;
|
|
257
251
|
}
|
|
252
|
+
subscriptions;
|
|
253
|
+
source = signal(null, ...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
254
|
+
_target = null;
|
|
255
|
+
sortableCounter = 0;
|
|
256
|
+
sortableRegister = {};
|
|
257
|
+
pressArgs;
|
|
258
|
+
/**
|
|
259
|
+
* @hidden
|
|
260
|
+
*/
|
|
261
|
+
source$ = this.source.asReadonly();
|
|
258
262
|
/**
|
|
259
263
|
* @hidden
|
|
260
264
|
*/
|
|
@@ -328,7 +332,7 @@ class SortableService {
|
|
|
328
332
|
* @param sortable - The `SortableComponent`.
|
|
329
333
|
*/
|
|
330
334
|
setSource(sortable) {
|
|
331
|
-
this.source
|
|
335
|
+
this.source.set(sortable);
|
|
332
336
|
}
|
|
333
337
|
/**
|
|
334
338
|
* Returns the source `SortableComponent` from which
|
|
@@ -337,7 +341,7 @@ class SortableService {
|
|
|
337
341
|
* @return - The `SourceComponent`.
|
|
338
342
|
*/
|
|
339
343
|
getSource() {
|
|
340
|
-
return this.source;
|
|
344
|
+
return this.source();
|
|
341
345
|
}
|
|
342
346
|
/**
|
|
343
347
|
* The method that finds the `SortableComponent` which is registered to
|
|
@@ -378,14 +382,14 @@ class SortableService {
|
|
|
378
382
|
}
|
|
379
383
|
}
|
|
380
384
|
release(event) {
|
|
381
|
-
if (this.source) {
|
|
385
|
+
if (this.source()) {
|
|
382
386
|
this.ngZone.run(() => {
|
|
383
387
|
if (this.targetSortable) {
|
|
384
388
|
const dropTarget = draggableFromEvent(event, this.targetSortable.component);
|
|
385
|
-
this.source.endDrag({ target: dropTarget, originalEvent: event });
|
|
389
|
+
this.source().endDrag({ target: dropTarget, originalEvent: event });
|
|
386
390
|
}
|
|
387
|
-
this.source.positionHintFromEvent(null);
|
|
388
|
-
this.source.markForCheck();
|
|
391
|
+
this.source().positionHintFromEvent(null);
|
|
392
|
+
this.source().markForCheck();
|
|
389
393
|
});
|
|
390
394
|
}
|
|
391
395
|
this.targetSortable = null;
|
|
@@ -400,21 +404,21 @@ class SortableService {
|
|
|
400
404
|
if (this.start()) {
|
|
401
405
|
return;
|
|
402
406
|
}
|
|
403
|
-
this.source.positionHintFromEvent(event);
|
|
407
|
+
this.source().positionHintFromEvent(event);
|
|
404
408
|
const sortable = this.getSortableComponentFromTouch(event);
|
|
405
409
|
if (!sortable || sortable && sortable.component !== this.target) {
|
|
406
410
|
if (this.target) {
|
|
407
411
|
this.target.leave({ target: undefined, originalEvent: event });
|
|
408
412
|
}
|
|
409
|
-
else if (this.source !== this.target) {
|
|
410
|
-
this.source.leave({ target: undefined, originalEvent: event });
|
|
413
|
+
else if (this.source() !== this.target) {
|
|
414
|
+
this.source().leave({ target: undefined, originalEvent: event });
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
417
|
if (sortable && sortable.component) {
|
|
414
418
|
const draggable = draggableFromEvent(event, sortable.component);
|
|
415
419
|
sortable.component.drag({ target: draggable, originalEvent: event });
|
|
416
420
|
}
|
|
417
|
-
this.source.markForCheck();
|
|
421
|
+
this.source().markForCheck();
|
|
418
422
|
});
|
|
419
423
|
}
|
|
420
424
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SortableService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -445,16 +449,25 @@ class DraggableDirective {
|
|
|
445
449
|
parent;
|
|
446
450
|
el;
|
|
447
451
|
renderer;
|
|
448
|
-
index
|
|
449
|
-
|
|
452
|
+
set index(value) {
|
|
453
|
+
this._index.set(value);
|
|
454
|
+
}
|
|
455
|
+
get index() {
|
|
456
|
+
return this._index();
|
|
457
|
+
}
|
|
458
|
+
set disabled(value) {
|
|
459
|
+
this._disabled.set(value);
|
|
460
|
+
}
|
|
461
|
+
get disabled() {
|
|
462
|
+
return this._disabled();
|
|
463
|
+
}
|
|
450
464
|
set hidden(value) {
|
|
451
|
-
this._hidden
|
|
465
|
+
this._hidden.set(value);
|
|
452
466
|
this.updateDisplayStyle();
|
|
453
467
|
}
|
|
454
468
|
get hidden() {
|
|
455
|
-
return this._hidden;
|
|
469
|
+
return this._hidden();
|
|
456
470
|
}
|
|
457
|
-
_hidden;
|
|
458
471
|
get _focused() {
|
|
459
472
|
return this.disabled ? false : (this.index === this.parent.activeIndex);
|
|
460
473
|
}
|
|
@@ -466,6 +479,9 @@ class DraggableDirective {
|
|
|
466
479
|
this.updateDisplayStyle();
|
|
467
480
|
}
|
|
468
481
|
_display;
|
|
482
|
+
_index = signal(undefined, ...(ngDevMode ? [{ debugName: "_index" }] : []));
|
|
483
|
+
_disabled = signal(undefined, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
484
|
+
_hidden = signal(undefined, ...(ngDevMode ? [{ debugName: "_hidden" }] : []));
|
|
469
485
|
constructor(parent, el, renderer) {
|
|
470
486
|
this.parent = parent;
|
|
471
487
|
this.el = el;
|
|
@@ -664,29 +680,39 @@ const KEY_SHORTCUTS = 'Control+ArrowLeft Control+ArrowRight Meta+ArrowLeft Meta+
|
|
|
664
680
|
class SortableComponent {
|
|
665
681
|
ngZone;
|
|
666
682
|
renderer;
|
|
667
|
-
changeDetector;
|
|
668
|
-
localization;
|
|
669
683
|
cdr;
|
|
684
|
+
localization;
|
|
685
|
+
injector;
|
|
670
686
|
/**
|
|
671
687
|
* Specifies the tab index of the Sortable component.
|
|
672
688
|
*/
|
|
673
|
-
tabIndex
|
|
689
|
+
set tabIndex(value) {
|
|
690
|
+
this._tabIndex.set(value);
|
|
691
|
+
}
|
|
692
|
+
get tabIndex() {
|
|
693
|
+
return this._tabIndex();
|
|
694
|
+
}
|
|
674
695
|
/**
|
|
675
696
|
* Configures how the Sortable component tracks changes in its items collection.
|
|
676
697
|
*/
|
|
677
|
-
trackBy
|
|
698
|
+
set trackBy(value) {
|
|
699
|
+
this._trackBy.set(value);
|
|
700
|
+
}
|
|
701
|
+
get trackBy() {
|
|
702
|
+
return this._trackBy();
|
|
703
|
+
}
|
|
678
704
|
/**
|
|
679
705
|
* Sets an array of any data that is used as a data source for the Sortable.
|
|
680
706
|
*/
|
|
681
707
|
set data(data) {
|
|
682
|
-
this._data
|
|
708
|
+
this._data.set(data);
|
|
683
709
|
//Cache each _data item instance locally to avoid repaint due to the ngTemplateOutletContext (generated by itemData)
|
|
684
710
|
//This prevents destroying the kendoDraggable instance, which otherwise leads to losing the dragEnd event
|
|
685
711
|
//due to non-exisitng HTML element
|
|
686
712
|
this.cacheData();
|
|
687
713
|
}
|
|
688
714
|
get data() {
|
|
689
|
-
return this._data;
|
|
715
|
+
return this._data();
|
|
690
716
|
}
|
|
691
717
|
/**
|
|
692
718
|
* Sets a boolean value that determines whether the Sortable items are navigable using the keyboard. [See example](https://www.telerik.com/kendo-angular-ui/components/sortable/keyboard-navigation).
|
|
@@ -695,64 +721,137 @@ class SortableComponent {
|
|
|
695
721
|
* @remarks
|
|
696
722
|
* This property is related to accessibility.
|
|
697
723
|
*/
|
|
698
|
-
navigable
|
|
724
|
+
set navigable(value) {
|
|
725
|
+
this._navigable.set(value);
|
|
726
|
+
}
|
|
727
|
+
get navigable() {
|
|
728
|
+
return this._navigable();
|
|
729
|
+
}
|
|
699
730
|
/**
|
|
700
731
|
* Enables or disables built-in animations.
|
|
701
732
|
* @default false
|
|
702
733
|
*/
|
|
703
|
-
animation
|
|
734
|
+
set animation(value) {
|
|
735
|
+
this._animation.set(value);
|
|
736
|
+
}
|
|
737
|
+
get animation() {
|
|
738
|
+
return this._animation();
|
|
739
|
+
}
|
|
704
740
|
/**
|
|
705
741
|
* Sets an array of integers that represent the indexes of the disabled items from the data array. [See example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#disabling-items).
|
|
706
742
|
*/
|
|
707
|
-
disabledIndexes
|
|
743
|
+
set disabledIndexes(value) {
|
|
744
|
+
this._disabledIndexes.set(value);
|
|
745
|
+
if (this.data) {
|
|
746
|
+
this.cacheData();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
get disabledIndexes() {
|
|
750
|
+
return this._disabledIndexes();
|
|
751
|
+
}
|
|
708
752
|
/**
|
|
709
753
|
* Sets a string that represents the name of the zone to which the Sortable belongs
|
|
710
754
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#transferring-items)). Items can be transferred
|
|
711
755
|
* between Sortables in the same zone.
|
|
712
756
|
*/
|
|
713
|
-
zone
|
|
757
|
+
set zone(value) {
|
|
758
|
+
this._zone.set(value);
|
|
759
|
+
}
|
|
760
|
+
get zone() {
|
|
761
|
+
return this._zone();
|
|
762
|
+
}
|
|
714
763
|
/**
|
|
715
764
|
* Defines the zones from which items can be transferred onto the current Sortable component
|
|
716
765
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#transferring-items)). If the `acceptZones` property
|
|
717
766
|
* of the target Sortable is set, you can transfer items between Sortables in different zones.
|
|
718
767
|
*/
|
|
719
|
-
acceptZones
|
|
768
|
+
set acceptZones(value) {
|
|
769
|
+
this._acceptZones.set(value);
|
|
770
|
+
}
|
|
771
|
+
get acceptZones() {
|
|
772
|
+
return this._acceptZones();
|
|
773
|
+
}
|
|
720
774
|
/**
|
|
721
775
|
* Represents the CSS styles applied to each Sortable item.
|
|
722
776
|
*/
|
|
723
|
-
itemStyle
|
|
777
|
+
set itemStyle(value) {
|
|
778
|
+
this._itemStyle.set(value);
|
|
779
|
+
}
|
|
780
|
+
get itemStyle() {
|
|
781
|
+
return this._itemStyle();
|
|
782
|
+
}
|
|
724
783
|
/**
|
|
725
784
|
* Defines the CSS styles applied to an empty item ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/templates)).
|
|
726
785
|
*/
|
|
727
|
-
emptyItemStyle
|
|
786
|
+
set emptyItemStyle(value) {
|
|
787
|
+
this._emptyItemStyle.set(value);
|
|
788
|
+
}
|
|
789
|
+
get emptyItemStyle() {
|
|
790
|
+
return this._emptyItemStyle();
|
|
791
|
+
}
|
|
728
792
|
/**
|
|
729
793
|
* Defines the CSS styles which are applied to the currently dragged item ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/templates)).
|
|
730
794
|
*/
|
|
731
|
-
activeItemStyle
|
|
795
|
+
set activeItemStyle(value) {
|
|
796
|
+
this._activeItemStyle.set(value);
|
|
797
|
+
}
|
|
798
|
+
get activeItemStyle() {
|
|
799
|
+
return this._activeItemStyle();
|
|
800
|
+
}
|
|
732
801
|
/**
|
|
733
802
|
* Defines the CSS styles which are applied to all disabled items.
|
|
734
803
|
*/
|
|
735
|
-
disabledItemStyle
|
|
804
|
+
set disabledItemStyle(value) {
|
|
805
|
+
this._disabledItemStyle.set(value);
|
|
806
|
+
}
|
|
807
|
+
get disabledItemStyle() {
|
|
808
|
+
return this._disabledItemStyle();
|
|
809
|
+
}
|
|
736
810
|
/**
|
|
737
811
|
* Defines the class which is applied to each Sortable item.
|
|
738
812
|
*/
|
|
739
|
-
itemClass
|
|
813
|
+
set itemClass(value) {
|
|
814
|
+
this._itemClass.set(value);
|
|
815
|
+
}
|
|
816
|
+
get itemClass() {
|
|
817
|
+
return this._itemClass();
|
|
818
|
+
}
|
|
740
819
|
/**
|
|
741
820
|
* Defines the class which is applied to the active Sortable item.
|
|
742
821
|
*/
|
|
743
|
-
activeItemClass
|
|
822
|
+
set activeItemClass(value) {
|
|
823
|
+
this._activeItemClass.set(value);
|
|
824
|
+
}
|
|
825
|
+
get activeItemClass() {
|
|
826
|
+
return this._activeItemClass();
|
|
827
|
+
}
|
|
744
828
|
/**
|
|
745
829
|
* Defines the class which is applied to the empty item when the Sortable has empty data.
|
|
746
830
|
*/
|
|
747
|
-
emptyItemClass
|
|
831
|
+
set emptyItemClass(value) {
|
|
832
|
+
this._emptyItemClass.set(value);
|
|
833
|
+
}
|
|
834
|
+
get emptyItemClass() {
|
|
835
|
+
return this._emptyItemClass();
|
|
836
|
+
}
|
|
748
837
|
/**
|
|
749
838
|
* Defines the class which is applied to each disabled Sortable item.
|
|
750
839
|
*/
|
|
751
|
-
disabledItemClass
|
|
840
|
+
set disabledItemClass(value) {
|
|
841
|
+
this._disabledItemClass.set(value);
|
|
842
|
+
}
|
|
843
|
+
get disabledItemClass() {
|
|
844
|
+
return this._disabledItemClass();
|
|
845
|
+
}
|
|
752
846
|
/**
|
|
753
847
|
* Sets the text message that will be displayed when the Sortable has no items.
|
|
754
848
|
*/
|
|
755
|
-
emptyText
|
|
849
|
+
set emptyText(value) {
|
|
850
|
+
this._emptyText.set(value);
|
|
851
|
+
}
|
|
852
|
+
get emptyText() {
|
|
853
|
+
return this._emptyText();
|
|
854
|
+
}
|
|
756
855
|
/**
|
|
757
856
|
* @hidden
|
|
758
857
|
*/
|
|
@@ -807,12 +906,17 @@ class SortableComponent {
|
|
|
807
906
|
* The index of the currently focused item.
|
|
808
907
|
* If no item is focused, set to `-1`.
|
|
809
908
|
*/
|
|
810
|
-
activeIndex
|
|
909
|
+
set activeIndex(value) {
|
|
910
|
+
this._activeIndex.set(value);
|
|
911
|
+
}
|
|
912
|
+
get activeIndex() {
|
|
913
|
+
return this._activeIndex();
|
|
914
|
+
}
|
|
811
915
|
get touchAction() {
|
|
812
916
|
return "none";
|
|
813
917
|
}
|
|
814
918
|
get dir() {
|
|
815
|
-
return this.
|
|
919
|
+
return this._direction();
|
|
816
920
|
}
|
|
817
921
|
hostRole = 'list';
|
|
818
922
|
/**
|
|
@@ -823,11 +927,21 @@ class SortableComponent {
|
|
|
823
927
|
/**
|
|
824
928
|
* The index of the currently dragged item.
|
|
825
929
|
*/
|
|
826
|
-
dragIndex
|
|
930
|
+
set dragIndex(value) {
|
|
931
|
+
this._dragIndex.set(value);
|
|
932
|
+
}
|
|
933
|
+
get dragIndex() {
|
|
934
|
+
return this._dragIndex();
|
|
935
|
+
}
|
|
827
936
|
/**
|
|
828
937
|
* The index of the item above which the dragged item is.
|
|
829
938
|
*/
|
|
830
|
-
dragOverIndex
|
|
939
|
+
set dragOverIndex(value) {
|
|
940
|
+
this._dragOverIndex.set(value);
|
|
941
|
+
}
|
|
942
|
+
get dragOverIndex() {
|
|
943
|
+
return this._dragOverIndex();
|
|
944
|
+
}
|
|
831
945
|
onDragStartSubject = new Subject();
|
|
832
946
|
onDragOverSubject = new Subject();
|
|
833
947
|
onDragLeaveSubject = new Subject();
|
|
@@ -839,16 +953,41 @@ class SortableComponent {
|
|
|
839
953
|
/**
|
|
840
954
|
* The location of the hint indicator when dragging on mobile devices.
|
|
841
955
|
*/
|
|
842
|
-
hintLocation
|
|
956
|
+
set hintLocation(value) {
|
|
957
|
+
this._hintLocation.set(value);
|
|
958
|
+
}
|
|
959
|
+
get hintLocation() {
|
|
960
|
+
return this._hintLocation();
|
|
961
|
+
}
|
|
843
962
|
id;
|
|
844
963
|
itemTemplateRef;
|
|
845
964
|
placeholderTemplateRef;
|
|
846
|
-
_data;
|
|
847
965
|
_localData = [];
|
|
848
966
|
/**
|
|
849
967
|
* @hidden
|
|
850
968
|
*/
|
|
851
969
|
ariaKeyShortcuts = KEY_SHORTCUTS;
|
|
970
|
+
_tabIndex = signal(null, ...(ngDevMode ? [{ debugName: "_tabIndex" }] : []));
|
|
971
|
+
_trackBy = signal((_, idx) => idx, ...(ngDevMode ? [{ debugName: "_trackBy" }] : []));
|
|
972
|
+
_data = signal(undefined, ...(ngDevMode ? [{ debugName: "_data" }] : []));
|
|
973
|
+
_navigable = signal(true, ...(ngDevMode ? [{ debugName: "_navigable" }] : []));
|
|
974
|
+
_animation = signal(false, ...(ngDevMode ? [{ debugName: "_animation" }] : []));
|
|
975
|
+
_disabledIndexes = signal([], ...(ngDevMode ? [{ debugName: "_disabledIndexes" }] : []));
|
|
976
|
+
_zone = signal(undefined, ...(ngDevMode ? [{ debugName: "_zone" }] : []));
|
|
977
|
+
_acceptZones = signal(undefined, ...(ngDevMode ? [{ debugName: "_acceptZones" }] : []));
|
|
978
|
+
_itemStyle = signal({}, ...(ngDevMode ? [{ debugName: "_itemStyle" }] : []));
|
|
979
|
+
_emptyItemStyle = signal(undefined, ...(ngDevMode ? [{ debugName: "_emptyItemStyle" }] : []));
|
|
980
|
+
_activeItemStyle = signal(undefined, ...(ngDevMode ? [{ debugName: "_activeItemStyle" }] : []));
|
|
981
|
+
_disabledItemStyle = signal(undefined, ...(ngDevMode ? [{ debugName: "_disabledItemStyle" }] : []));
|
|
982
|
+
_itemClass = signal("", ...(ngDevMode ? [{ debugName: "_itemClass" }] : []));
|
|
983
|
+
_activeItemClass = signal(null, ...(ngDevMode ? [{ debugName: "_activeItemClass" }] : []));
|
|
984
|
+
_emptyItemClass = signal(null, ...(ngDevMode ? [{ debugName: "_emptyItemClass" }] : []));
|
|
985
|
+
_disabledItemClass = signal(null, ...(ngDevMode ? [{ debugName: "_disabledItemClass" }] : []));
|
|
986
|
+
_emptyText = signal("Empty", ...(ngDevMode ? [{ debugName: "_emptyText" }] : []));
|
|
987
|
+
_activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "_activeIndex" }] : []));
|
|
988
|
+
_dragIndex = signal(-1, ...(ngDevMode ? [{ debugName: "_dragIndex" }] : []));
|
|
989
|
+
_dragOverIndex = signal(-1, ...(ngDevMode ? [{ debugName: "_dragOverIndex" }] : []));
|
|
990
|
+
_hintLocation = signal(null, ...(ngDevMode ? [{ debugName: "_hintLocation" }] : []));
|
|
852
991
|
localizationChangeSubscription;
|
|
853
992
|
dragStartSubscription;
|
|
854
993
|
dragOverSubscription;
|
|
@@ -859,9 +998,9 @@ class SortableComponent {
|
|
|
859
998
|
animationDuration = 300;
|
|
860
999
|
afterKeyPress = false;
|
|
861
1000
|
sortableService = null;
|
|
862
|
-
_hideActiveItem = false;
|
|
1001
|
+
_hideActiveItem = signal(false, ...(ngDevMode ? [{ debugName: "_hideActiveItem" }] : []));
|
|
863
1002
|
prevActiveIndex = 0;
|
|
864
|
-
|
|
1003
|
+
_direction = signal('ltr', ...(ngDevMode ? [{ debugName: "_direction" }] : []));
|
|
865
1004
|
_animating;
|
|
866
1005
|
draggable;
|
|
867
1006
|
offsetParent;
|
|
@@ -883,15 +1022,19 @@ class SortableComponent {
|
|
|
883
1022
|
}
|
|
884
1023
|
return template;
|
|
885
1024
|
}
|
|
886
|
-
|
|
1025
|
+
/**
|
|
1026
|
+
* @hidden
|
|
1027
|
+
*/
|
|
1028
|
+
hintVisible = computed(() => this._dragIndex() >= 0 && this._hintLocation() !== null && this === this.sortableService.source$(), ...(ngDevMode ? [{ debugName: "hintVisible" }] : []));
|
|
1029
|
+
constructor(ngZone, renderer, cdr, localization, wrapper, sortableService, injector) {
|
|
887
1030
|
this.ngZone = ngZone;
|
|
888
1031
|
this.renderer = renderer;
|
|
889
|
-
this.changeDetector = changeDetector;
|
|
890
|
-
this.localization = localization;
|
|
891
1032
|
this.cdr = cdr;
|
|
1033
|
+
this.localization = localization;
|
|
1034
|
+
this.injector = injector;
|
|
892
1035
|
validatePackage(packageMetadata);
|
|
893
1036
|
this.wrapper = wrapper.nativeElement;
|
|
894
|
-
this.
|
|
1037
|
+
this._direction.set(localization.rtl ? 'rtl' : 'ltr');
|
|
895
1038
|
this.sortableService = sortableService;
|
|
896
1039
|
this.subscribeEvents();
|
|
897
1040
|
}
|
|
@@ -931,11 +1074,6 @@ class SortableComponent {
|
|
|
931
1074
|
}
|
|
932
1075
|
});
|
|
933
1076
|
}
|
|
934
|
-
ngOnChanges(changes) {
|
|
935
|
-
if (this.data && isChanged('disabledIndexes', changes, false)) {
|
|
936
|
-
this.cacheData();
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
1077
|
ngOnDestroy() {
|
|
940
1078
|
this.unsubscribeEvents();
|
|
941
1079
|
this.sortableService.unregisterComponent(this.id);
|
|
@@ -990,7 +1128,7 @@ class SortableComponent {
|
|
|
990
1128
|
*/
|
|
991
1129
|
cacheData() {
|
|
992
1130
|
this._localData = [];
|
|
993
|
-
this.
|
|
1131
|
+
this.data.forEach((item, index) => {
|
|
994
1132
|
this._localData.push({ item: item, active: false, disabled: !this.itemEnabled(index), index: index, hidden: false });
|
|
995
1133
|
});
|
|
996
1134
|
}
|
|
@@ -1045,12 +1183,6 @@ class SortableComponent {
|
|
|
1045
1183
|
this.onDragEndSubject.next(endEvent);
|
|
1046
1184
|
return endEvent.isDefaultPrevented();
|
|
1047
1185
|
}
|
|
1048
|
-
/**
|
|
1049
|
-
* @hidden
|
|
1050
|
-
*/
|
|
1051
|
-
hintVisible() {
|
|
1052
|
-
return this.dragIndex >= 0 && this.hintLocation && this === this.sortableService.getSource();
|
|
1053
|
-
}
|
|
1054
1186
|
/**
|
|
1055
1187
|
* @hidden
|
|
1056
1188
|
*/
|
|
@@ -1144,7 +1276,7 @@ class SortableComponent {
|
|
|
1144
1276
|
* @hidden
|
|
1145
1277
|
*/
|
|
1146
1278
|
onArrowHandler(event, keyCode) {
|
|
1147
|
-
const leftKey = this.
|
|
1279
|
+
const leftKey = this._direction() === 'rtl' ? Keys.ArrowRight : Keys.ArrowLeft;
|
|
1148
1280
|
const dir = keyCode === Keys.ArrowUp || keyCode === leftKey ? -1 : 1;
|
|
1149
1281
|
const limit = this.data.length - 1;
|
|
1150
1282
|
let targetIndex = this.activeIndex + dir;
|
|
@@ -1198,7 +1330,6 @@ class SortableComponent {
|
|
|
1198
1330
|
if (!this.navigable) {
|
|
1199
1331
|
return;
|
|
1200
1332
|
}
|
|
1201
|
-
this.cdr.markForCheck();
|
|
1202
1333
|
const targetIsWrapper = this.itemWrappers.toArray().some((item) => item.nativeElement === event.target);
|
|
1203
1334
|
const index = this.activeIndex === -1 ? this.prevActiveIndex : this.activeIndex;
|
|
1204
1335
|
const item = this.itemWrappers.toArray()[index]?.nativeElement;
|
|
@@ -1250,11 +1381,11 @@ class SortableComponent {
|
|
|
1250
1381
|
* If the currently dragged item is visible, returns `false`.
|
|
1251
1382
|
*/
|
|
1252
1383
|
get hideActiveItem() {
|
|
1253
|
-
return this._hideActiveItem;
|
|
1384
|
+
return this._hideActiveItem();
|
|
1254
1385
|
}
|
|
1255
1386
|
set hideActiveItem(value) {
|
|
1256
1387
|
this.activeIndex = -1;
|
|
1257
|
-
this._hideActiveItem
|
|
1388
|
+
this._hideActiveItem.set(value);
|
|
1258
1389
|
}
|
|
1259
1390
|
/**
|
|
1260
1391
|
* Clears the active item.
|
|
@@ -1299,12 +1430,12 @@ class SortableComponent {
|
|
|
1299
1430
|
}
|
|
1300
1431
|
this.dragIndex = index;
|
|
1301
1432
|
this.dragOverIndex = index;
|
|
1302
|
-
|
|
1433
|
+
afterNextRender(() => {
|
|
1303
1434
|
this.sortableService.target = this;
|
|
1304
1435
|
this.sortableService.setSource(this);
|
|
1305
1436
|
this.sortableService.activeDraggable = this.draggables.toArray()[index];
|
|
1306
1437
|
this.sortableService.lastDraggable = null;
|
|
1307
|
-
});
|
|
1438
|
+
}, { injector: this.injector });
|
|
1308
1439
|
}
|
|
1309
1440
|
/**
|
|
1310
1441
|
* Moves a data item from one index to another in the Sortable component.
|
|
@@ -1352,10 +1483,10 @@ class SortableComponent {
|
|
|
1352
1483
|
this.animate(toAnimate);
|
|
1353
1484
|
});
|
|
1354
1485
|
}
|
|
1355
|
-
|
|
1486
|
+
afterNextRender(() => {
|
|
1356
1487
|
this.sortableService.activeDraggable = this.draggables.toArray()[dragIndex];
|
|
1357
1488
|
this.sortableService.lastDraggable = null;
|
|
1358
|
-
});
|
|
1489
|
+
}, { injector: this.injector });
|
|
1359
1490
|
}
|
|
1360
1491
|
/**
|
|
1361
1492
|
* @hidden
|
|
@@ -1421,7 +1552,9 @@ class SortableComponent {
|
|
|
1421
1552
|
* @hidden
|
|
1422
1553
|
*/
|
|
1423
1554
|
markForCheck() {
|
|
1424
|
-
|
|
1555
|
+
// Retained markForCheck: called by SortableService from native Draggable library callbacks
|
|
1556
|
+
// to trigger CD after _localData mutations and drag state changes
|
|
1557
|
+
this.cdr.markForCheck();
|
|
1425
1558
|
}
|
|
1426
1559
|
/**
|
|
1427
1560
|
* @hidden
|
|
@@ -1450,7 +1583,7 @@ class SortableComponent {
|
|
|
1450
1583
|
subscribeEvents() {
|
|
1451
1584
|
this.localizationChangeSubscription = this.localization
|
|
1452
1585
|
.changes
|
|
1453
|
-
.subscribe(({ rtl }) => this.
|
|
1586
|
+
.subscribe(({ rtl }) => this._direction.set(rtl ? 'rtl' : 'ltr'));
|
|
1454
1587
|
this.dragStartSubscription = this.onDragStartSubject
|
|
1455
1588
|
.subscribe((event) => {
|
|
1456
1589
|
if (!event.target) {
|
|
@@ -1527,6 +1660,7 @@ class SortableComponent {
|
|
|
1527
1660
|
target.dragIndex = -1;
|
|
1528
1661
|
target.dragOverIndex = -1;
|
|
1529
1662
|
}
|
|
1663
|
+
// Retained setTimeout: deferred cleanup allows event propagation to complete before resetting service state
|
|
1530
1664
|
setTimeout(() => {
|
|
1531
1665
|
this.sortableService.activeDraggable = null;
|
|
1532
1666
|
this.sortableService.lastDraggable = null;
|
|
@@ -1596,7 +1730,7 @@ class SortableComponent {
|
|
|
1596
1730
|
}
|
|
1597
1731
|
}
|
|
1598
1732
|
}
|
|
1599
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SortableComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.ElementRef }, { token: SortableService }, { token: i0.
|
|
1733
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SortableComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: i0.ElementRef }, { token: SortableService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1600
1734
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SortableComponent, isStandalone: true, selector: "kendo-sortable", inputs: { tabIndex: "tabIndex", trackBy: "trackBy", data: "data", navigable: "navigable", animation: "animation", disabledIndexes: "disabledIndexes", zone: "zone", acceptZones: "acceptZones", itemStyle: "itemStyle", emptyItemStyle: "emptyItemStyle", activeItemStyle: "activeItemStyle", disabledItemStyle: "disabledItemStyle", itemClass: "itemClass", activeItemClass: "activeItemClass", emptyItemClass: "emptyItemClass", disabledItemClass: "disabledItemClass", emptyText: "emptyText", activeIndex: "activeIndex" }, outputs: { dragStart: "dragStart", dragEnd: "dragEnd", dragOver: "dragOver", dragLeave: "dragLeave", dataMove: "dataMove", dataAdd: "dataAdd", dataRemove: "dataRemove", navigate: "navigate" }, host: { properties: { "style.touch-action": "this.touchAction", "attr.dir": "this.dir", "attr.role": "this.hostRole" } }, providers: [
|
|
1601
1735
|
LocalizationService,
|
|
1602
1736
|
{
|
|
@@ -1611,7 +1745,7 @@ class SortableComponent {
|
|
|
1611
1745
|
provide: KENDO_WEBMCP_HOST,
|
|
1612
1746
|
useExisting: forwardRef(() => SortableComponent)
|
|
1613
1747
|
}
|
|
1614
|
-
], queries: [{ propertyName: "defaultTemplateRef", predicate: TemplateRef }, { propertyName: "itemTemplateDirectiveRef", predicate: ItemTemplateDirective, read: TemplateRef }, { propertyName: "placeholderTemplateDirectiveRef", predicate: PlaceholderTemplateDirective, read: TemplateRef }], viewQueries: [{ propertyName: "noDataContainer", first: true, predicate: ["noDataRef"], descendants: true }, { propertyName: "hint", first: true, predicate: ["hint"], descendants: true }, { propertyName: "itemWrappers", predicate: ["itemWrapper"], descendants: true }, { propertyName: "draggables", predicate: DraggableDirective, descendants: true }], exportAs: ["kendoSortable"],
|
|
1748
|
+
], queries: [{ propertyName: "defaultTemplateRef", predicate: TemplateRef }, { propertyName: "itemTemplateDirectiveRef", predicate: ItemTemplateDirective, read: TemplateRef }, { propertyName: "placeholderTemplateDirectiveRef", predicate: PlaceholderTemplateDirective, read: TemplateRef }], viewQueries: [{ propertyName: "noDataContainer", first: true, predicate: ["noDataRef"], descendants: true }, { propertyName: "hint", first: true, predicate: ["hint"], descendants: true }, { propertyName: "itemWrappers", predicate: ["itemWrapper"], descendants: true }, { propertyName: "draggables", predicate: DraggableDirective, descendants: true }], exportAs: ["kendoSortable"], ngImport: i0, template: `
|
|
1615
1749
|
@for (item of _localData; track trackBy(i, item); let i = $index) {
|
|
1616
1750
|
<div #itemWrapper
|
|
1617
1751
|
kendoDraggable
|
|
@@ -1638,14 +1772,13 @@ class SortableComponent {
|
|
|
1638
1772
|
[ngTemplateOutlet]="itemTemplate(i)"
|
|
1639
1773
|
[ngTemplateOutletContext]="item">
|
|
1640
1774
|
</ng-container>
|
|
1641
|
-
}
|
|
1642
|
-
@if (!itemTemplateRef) {
|
|
1775
|
+
} @else {
|
|
1643
1776
|
{{item.item}}
|
|
1644
1777
|
}
|
|
1645
1778
|
</div>
|
|
1646
1779
|
}
|
|
1647
1780
|
|
|
1648
|
-
@if (!
|
|
1781
|
+
@if (!data.length || _localData.length === 1 && _localData[0].hidden) {
|
|
1649
1782
|
<ng-container #noDataRef>
|
|
1650
1783
|
<div
|
|
1651
1784
|
kendoDraggable
|
|
@@ -1665,18 +1798,18 @@ class SortableComponent {
|
|
|
1665
1798
|
[ngTemplateOutlet]="itemTemplateRef"
|
|
1666
1799
|
[ngTemplateOutletContext]="{item: _localData[dragIndex].item}">
|
|
1667
1800
|
</ng-container>
|
|
1668
|
-
}
|
|
1669
|
-
@if (!itemTemplateRef) {
|
|
1801
|
+
} @else {
|
|
1670
1802
|
{{_localData[dragIndex].item}}
|
|
1671
1803
|
}
|
|
1672
1804
|
</div>
|
|
1673
1805
|
}
|
|
1674
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["index", "disabled", "hidden"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
|
|
1806
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: DraggableDirective, selector: "[kendoDraggable]", inputs: ["index", "disabled", "hidden"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1675
1807
|
}
|
|
1676
1808
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SortableComponent, decorators: [{
|
|
1677
1809
|
type: Component,
|
|
1678
1810
|
args: [{
|
|
1679
1811
|
exportAs: 'kendoSortable',
|
|
1812
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1680
1813
|
providers: [
|
|
1681
1814
|
LocalizationService,
|
|
1682
1815
|
{
|
|
@@ -1720,14 +1853,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1720
1853
|
[ngTemplateOutlet]="itemTemplate(i)"
|
|
1721
1854
|
[ngTemplateOutletContext]="item">
|
|
1722
1855
|
</ng-container>
|
|
1723
|
-
}
|
|
1724
|
-
@if (!itemTemplateRef) {
|
|
1856
|
+
} @else {
|
|
1725
1857
|
{{item.item}}
|
|
1726
1858
|
}
|
|
1727
1859
|
</div>
|
|
1728
1860
|
}
|
|
1729
1861
|
|
|
1730
|
-
@if (!
|
|
1862
|
+
@if (!data.length || _localData.length === 1 && _localData[0].hidden) {
|
|
1731
1863
|
<ng-container #noDataRef>
|
|
1732
1864
|
<div
|
|
1733
1865
|
kendoDraggable
|
|
@@ -1747,8 +1879,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1747
1879
|
[ngTemplateOutlet]="itemTemplateRef"
|
|
1748
1880
|
[ngTemplateOutletContext]="{item: _localData[dragIndex].item}">
|
|
1749
1881
|
</ng-container>
|
|
1750
|
-
}
|
|
1751
|
-
@if (!itemTemplateRef) {
|
|
1882
|
+
} @else {
|
|
1752
1883
|
{{_localData[dragIndex].item}}
|
|
1753
1884
|
}
|
|
1754
1885
|
</div>
|
|
@@ -1757,7 +1888,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1757
1888
|
standalone: true,
|
|
1758
1889
|
imports: [DraggableDirective, NgClass, NgStyle, NgTemplateOutlet, EventsOutsideAngularDirective]
|
|
1759
1890
|
}]
|
|
1760
|
-
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.ElementRef }, { type: SortableService }, { type: i0.
|
|
1891
|
+
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.LocalizationService }, { type: i0.ElementRef }, { type: SortableService }, { type: i0.Injector }], propDecorators: { tabIndex: [{
|
|
1761
1892
|
type: Input
|
|
1762
1893
|
}], trackBy: [{
|
|
1763
1894
|
type: Input
|
package/index.d.ts
CHANGED
|
@@ -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 i0 from '@angular/core';
|
|
6
|
-
import { OnInit, ElementRef, Renderer2, OnDestroy, NgZone,
|
|
6
|
+
import { OnInit, ElementRef, Renderer2, OnDestroy, NgZone, AfterViewInit, AfterViewChecked, AfterContentInit, TrackByFunction, QueryList, TemplateRef, EventEmitter, ChangeDetectorRef, Injector } from '@angular/core';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
8
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
9
|
|
|
@@ -24,15 +24,19 @@ declare class DraggableDirective implements OnInit {
|
|
|
24
24
|
parent: SortableContainer;
|
|
25
25
|
el: ElementRef;
|
|
26
26
|
private renderer;
|
|
27
|
-
index: number;
|
|
28
|
-
|
|
27
|
+
set index(value: number);
|
|
28
|
+
get index(): number;
|
|
29
|
+
set disabled(value: boolean);
|
|
30
|
+
get disabled(): boolean;
|
|
29
31
|
set hidden(value: boolean);
|
|
30
32
|
get hidden(): boolean;
|
|
31
|
-
_hidden: any;
|
|
32
33
|
get _focused(): boolean;
|
|
33
34
|
get display(): string;
|
|
34
35
|
set display(display: string);
|
|
35
36
|
private _display;
|
|
37
|
+
private _index;
|
|
38
|
+
private _disabled;
|
|
39
|
+
private _hidden;
|
|
36
40
|
constructor(parent: SortableContainer, el: ElementRef, renderer: Renderer2);
|
|
37
41
|
ngOnInit(): void;
|
|
38
42
|
private updateDisplayStyle;
|
|
@@ -81,6 +85,11 @@ declare class SortableService implements OnDestroy {
|
|
|
81
85
|
* @hidden
|
|
82
86
|
*/
|
|
83
87
|
onReleaseSubject: Subject<any>;
|
|
88
|
+
/**
|
|
89
|
+
* Specifies the `SortableComponent` instance under the currently dragged item.
|
|
90
|
+
*/
|
|
91
|
+
set target(target: SortableComponent);
|
|
92
|
+
get target(): SortableComponent;
|
|
84
93
|
private subscriptions;
|
|
85
94
|
private source;
|
|
86
95
|
private _target;
|
|
@@ -88,10 +97,9 @@ declare class SortableService implements OnDestroy {
|
|
|
88
97
|
private sortableRegister;
|
|
89
98
|
private pressArgs;
|
|
90
99
|
/**
|
|
91
|
-
*
|
|
100
|
+
* @hidden
|
|
92
101
|
*/
|
|
93
|
-
|
|
94
|
-
get target(): SortableComponent;
|
|
102
|
+
readonly source$: i0.Signal<SortableComponent>;
|
|
95
103
|
/**
|
|
96
104
|
* @hidden
|
|
97
105
|
*/
|
|
@@ -279,20 +287,22 @@ declare class DataMoveEvent extends PreventableEvent implements DataEvent {
|
|
|
279
287
|
* <kendo-sortable [data]="['Item 1', 'Item 2', 'Item 3']"></kendo-sortable>
|
|
280
288
|
* ```
|
|
281
289
|
*/
|
|
282
|
-
declare class SortableComponent implements OnInit, OnDestroy,
|
|
290
|
+
declare class SortableComponent implements OnInit, OnDestroy, AfterViewInit, AfterViewChecked, AfterContentInit, SortableContainer {
|
|
283
291
|
private ngZone;
|
|
284
292
|
private renderer;
|
|
285
|
-
private changeDetector;
|
|
286
|
-
private localization;
|
|
287
293
|
private cdr;
|
|
294
|
+
private localization;
|
|
295
|
+
private injector;
|
|
288
296
|
/**
|
|
289
297
|
* Specifies the tab index of the Sortable component.
|
|
290
298
|
*/
|
|
291
|
-
tabIndex: number;
|
|
299
|
+
set tabIndex(value: number);
|
|
300
|
+
get tabIndex(): number;
|
|
292
301
|
/**
|
|
293
302
|
* Configures how the Sortable component tracks changes in its items collection.
|
|
294
303
|
*/
|
|
295
|
-
trackBy: TrackByFunction<any
|
|
304
|
+
set trackBy(value: TrackByFunction<any>);
|
|
305
|
+
get trackBy(): TrackByFunction<any>;
|
|
296
306
|
/**
|
|
297
307
|
* Sets an array of any data that is used as a data source for the Sortable.
|
|
298
308
|
*/
|
|
@@ -305,72 +315,94 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
305
315
|
* @remarks
|
|
306
316
|
* This property is related to accessibility.
|
|
307
317
|
*/
|
|
308
|
-
navigable: boolean;
|
|
318
|
+
set navigable(value: boolean);
|
|
319
|
+
get navigable(): boolean;
|
|
309
320
|
/**
|
|
310
321
|
* Enables or disables built-in animations.
|
|
311
322
|
* @default false
|
|
312
323
|
*/
|
|
313
|
-
animation: boolean;
|
|
324
|
+
set animation(value: boolean);
|
|
325
|
+
get animation(): boolean;
|
|
314
326
|
/**
|
|
315
327
|
* Sets an array of integers that represent the indexes of the disabled items from the data array. [See example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#disabling-items).
|
|
316
328
|
*/
|
|
317
|
-
disabledIndexes: number[];
|
|
329
|
+
set disabledIndexes(value: number[]);
|
|
330
|
+
get disabledIndexes(): number[];
|
|
318
331
|
/**
|
|
319
332
|
* Sets a string that represents the name of the zone to which the Sortable belongs
|
|
320
333
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#transferring-items)). Items can be transferred
|
|
321
334
|
* between Sortables in the same zone.
|
|
322
335
|
*/
|
|
323
|
-
zone: string;
|
|
336
|
+
set zone(value: string);
|
|
337
|
+
get zone(): string;
|
|
324
338
|
/**
|
|
325
339
|
* Defines the zones from which items can be transferred onto the current Sortable component
|
|
326
340
|
* ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/items#transferring-items)). If the `acceptZones` property
|
|
327
341
|
* of the target Sortable is set, you can transfer items between Sortables in different zones.
|
|
328
342
|
*/
|
|
329
|
-
acceptZones: string[];
|
|
343
|
+
set acceptZones(value: string[]);
|
|
344
|
+
get acceptZones(): string[];
|
|
330
345
|
/**
|
|
331
346
|
* Represents the CSS styles applied to each Sortable item.
|
|
332
347
|
*/
|
|
333
|
-
itemStyle: {
|
|
348
|
+
set itemStyle(value: {
|
|
349
|
+
[key: string]: string;
|
|
350
|
+
});
|
|
351
|
+
get itemStyle(): {
|
|
334
352
|
[key: string]: string;
|
|
335
353
|
};
|
|
336
354
|
/**
|
|
337
355
|
* Defines the CSS styles applied to an empty item ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/templates)).
|
|
338
356
|
*/
|
|
339
|
-
emptyItemStyle: {
|
|
357
|
+
set emptyItemStyle(value: {
|
|
358
|
+
[key: string]: string;
|
|
359
|
+
});
|
|
360
|
+
get emptyItemStyle(): {
|
|
340
361
|
[key: string]: string;
|
|
341
362
|
};
|
|
342
363
|
/**
|
|
343
364
|
* Defines the CSS styles which are applied to the currently dragged item ([see example](https://www.telerik.com/kendo-angular-ui/components/sortable/templates)).
|
|
344
365
|
*/
|
|
345
|
-
activeItemStyle: {
|
|
366
|
+
set activeItemStyle(value: {
|
|
367
|
+
[key: string]: string;
|
|
368
|
+
});
|
|
369
|
+
get activeItemStyle(): {
|
|
346
370
|
[key: string]: string;
|
|
347
371
|
};
|
|
348
372
|
/**
|
|
349
373
|
* Defines the CSS styles which are applied to all disabled items.
|
|
350
374
|
*/
|
|
351
|
-
disabledItemStyle: {
|
|
375
|
+
set disabledItemStyle(value: {
|
|
376
|
+
[key: string]: string;
|
|
377
|
+
});
|
|
378
|
+
get disabledItemStyle(): {
|
|
352
379
|
[key: string]: string;
|
|
353
380
|
};
|
|
354
381
|
/**
|
|
355
382
|
* Defines the class which is applied to each Sortable item.
|
|
356
383
|
*/
|
|
357
|
-
itemClass: string | string[] | Set<string
|
|
384
|
+
set itemClass(value: string | string[] | Set<string>);
|
|
385
|
+
get itemClass(): string | string[] | Set<string>;
|
|
358
386
|
/**
|
|
359
387
|
* Defines the class which is applied to the active Sortable item.
|
|
360
388
|
*/
|
|
361
|
-
activeItemClass: string | string[] | Set<string
|
|
389
|
+
set activeItemClass(value: string | string[] | Set<string>);
|
|
390
|
+
get activeItemClass(): string | string[] | Set<string>;
|
|
362
391
|
/**
|
|
363
392
|
* Defines the class which is applied to the empty item when the Sortable has empty data.
|
|
364
393
|
*/
|
|
365
|
-
emptyItemClass: string | string[] | Set<string
|
|
394
|
+
set emptyItemClass(value: string | string[] | Set<string>);
|
|
395
|
+
get emptyItemClass(): string | string[] | Set<string>;
|
|
366
396
|
/**
|
|
367
397
|
* Defines the class which is applied to each disabled Sortable item.
|
|
368
398
|
*/
|
|
369
|
-
disabledItemClass: string | string[] | Set<string
|
|
399
|
+
set disabledItemClass(value: string | string[] | Set<string>);
|
|
400
|
+
get disabledItemClass(): string | string[] | Set<string>;
|
|
370
401
|
/**
|
|
371
402
|
* Sets the text message that will be displayed when the Sortable has no items.
|
|
372
403
|
*/
|
|
373
|
-
emptyText: string;
|
|
404
|
+
set emptyText(value: string);
|
|
405
|
+
get emptyText(): string;
|
|
374
406
|
/**
|
|
375
407
|
* @hidden
|
|
376
408
|
*/
|
|
@@ -425,7 +457,8 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
425
457
|
* The index of the currently focused item.
|
|
426
458
|
* If no item is focused, set to `-1`.
|
|
427
459
|
*/
|
|
428
|
-
activeIndex: number;
|
|
460
|
+
set activeIndex(value: number);
|
|
461
|
+
get activeIndex(): number;
|
|
429
462
|
get touchAction(): string;
|
|
430
463
|
get dir(): string;
|
|
431
464
|
hostRole: string;
|
|
@@ -437,11 +470,13 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
437
470
|
/**
|
|
438
471
|
* The index of the currently dragged item.
|
|
439
472
|
*/
|
|
440
|
-
dragIndex: number;
|
|
473
|
+
set dragIndex(value: number);
|
|
474
|
+
get dragIndex(): number;
|
|
441
475
|
/**
|
|
442
476
|
* The index of the item above which the dragged item is.
|
|
443
477
|
*/
|
|
444
|
-
dragOverIndex: number;
|
|
478
|
+
set dragOverIndex(value: number);
|
|
479
|
+
get dragOverIndex(): number;
|
|
445
480
|
onDragStartSubject: Subject<any>;
|
|
446
481
|
onDragOverSubject: Subject<any>;
|
|
447
482
|
onDragLeaveSubject: Subject<any>;
|
|
@@ -453,19 +488,43 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
453
488
|
/**
|
|
454
489
|
* The location of the hint indicator when dragging on mobile devices.
|
|
455
490
|
*/
|
|
456
|
-
hintLocation: {
|
|
491
|
+
set hintLocation(value: {
|
|
492
|
+
x: number;
|
|
493
|
+
y: number;
|
|
494
|
+
});
|
|
495
|
+
get hintLocation(): {
|
|
457
496
|
x: number;
|
|
458
497
|
y: number;
|
|
459
498
|
};
|
|
460
499
|
id: string;
|
|
461
500
|
itemTemplateRef: TemplateRef<any>;
|
|
462
501
|
placeholderTemplateRef: TemplateRef<any>;
|
|
463
|
-
_data: Array<any>;
|
|
464
502
|
_localData: Array<any>;
|
|
465
503
|
/**
|
|
466
504
|
* @hidden
|
|
467
505
|
*/
|
|
468
506
|
ariaKeyShortcuts: string;
|
|
507
|
+
private _tabIndex;
|
|
508
|
+
private _trackBy;
|
|
509
|
+
private _data;
|
|
510
|
+
private _navigable;
|
|
511
|
+
private _animation;
|
|
512
|
+
private _disabledIndexes;
|
|
513
|
+
private _zone;
|
|
514
|
+
private _acceptZones;
|
|
515
|
+
private _itemStyle;
|
|
516
|
+
private _emptyItemStyle;
|
|
517
|
+
private _activeItemStyle;
|
|
518
|
+
private _disabledItemStyle;
|
|
519
|
+
private _itemClass;
|
|
520
|
+
private _activeItemClass;
|
|
521
|
+
private _emptyItemClass;
|
|
522
|
+
private _disabledItemClass;
|
|
523
|
+
private _emptyText;
|
|
524
|
+
private _activeIndex;
|
|
525
|
+
private _dragIndex;
|
|
526
|
+
private _dragOverIndex;
|
|
527
|
+
private _hintLocation;
|
|
469
528
|
private localizationChangeSubscription;
|
|
470
529
|
private dragStartSubscription;
|
|
471
530
|
private dragOverSubscription;
|
|
@@ -478,7 +537,7 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
478
537
|
private sortableService;
|
|
479
538
|
private _hideActiveItem;
|
|
480
539
|
private prevActiveIndex;
|
|
481
|
-
private
|
|
540
|
+
private _direction;
|
|
482
541
|
private _animating;
|
|
483
542
|
private draggable;
|
|
484
543
|
private offsetParent;
|
|
@@ -487,10 +546,13 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
487
546
|
* @hidden
|
|
488
547
|
*/
|
|
489
548
|
itemTemplate(index: number): TemplateRef<any>;
|
|
490
|
-
|
|
549
|
+
/**
|
|
550
|
+
* @hidden
|
|
551
|
+
*/
|
|
552
|
+
readonly hintVisible: i0.Signal<boolean>;
|
|
553
|
+
constructor(ngZone: NgZone, renderer: Renderer2, cdr: ChangeDetectorRef, localization: LocalizationService, wrapper: ElementRef, sortableService: SortableService, injector: Injector);
|
|
491
554
|
ngOnInit(): void;
|
|
492
555
|
ngAfterViewInit(): void;
|
|
493
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
494
556
|
ngOnDestroy(): void;
|
|
495
557
|
ngAfterContentInit(): void;
|
|
496
558
|
ngAfterViewChecked(): void;
|
|
@@ -526,10 +588,6 @@ declare class SortableComponent implements OnInit, OnDestroy, OnChanges, AfterVi
|
|
|
526
588
|
* @hidden
|
|
527
589
|
*/
|
|
528
590
|
endDrag(event: any): boolean;
|
|
529
|
-
/**
|
|
530
|
-
* @hidden
|
|
531
|
-
*/
|
|
532
|
-
hintVisible(): boolean;
|
|
533
591
|
/**
|
|
534
592
|
* @hidden
|
|
535
593
|
*/
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = {
|
|
|
7
7
|
"productCodes": [
|
|
8
8
|
"KENDOUIANGULAR"
|
|
9
9
|
],
|
|
10
|
-
"publishDate":
|
|
11
|
-
"version": "25.0.0-develop.
|
|
10
|
+
"publishDate": 1783692661,
|
|
11
|
+
"version": "25.0.0-develop.3",
|
|
12
12
|
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-sortable",
|
|
3
|
-
"version": "25.0.0-develop.
|
|
3
|
+
"version": "25.0.0-develop.3",
|
|
4
4
|
"description": "A Sortable Component for Angular",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"package": {
|
|
20
20
|
"productName": "Kendo UI for Angular",
|
|
21
21
|
"productCode": "KENDOUIANGULAR",
|
|
22
|
-
"publishDate":
|
|
22
|
+
"publishDate": 1783692661,
|
|
23
23
|
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"@angular/core": "20 - 22",
|
|
30
30
|
"@angular/platform-browser": "20 - 22",
|
|
31
31
|
"@progress/kendo-licensing": "^1.11.0",
|
|
32
|
-
"@progress/kendo-angular-common": "25.0.0-develop.
|
|
33
|
-
"@progress/kendo-angular-l10n": "25.0.0-develop.
|
|
32
|
+
"@progress/kendo-angular-common": "25.0.0-develop.3",
|
|
33
|
+
"@progress/kendo-angular-l10n": "25.0.0-develop.3",
|
|
34
34
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"tslib": "^2.3.1",
|
|
38
|
-
"@progress/kendo-angular-schematics": "25.0.0-develop.
|
|
38
|
+
"@progress/kendo-angular-schematics": "25.0.0-develop.3",
|
|
39
39
|
"@progress/kendo-draggable": "^3.0.2"
|
|
40
40
|
},
|
|
41
41
|
"schematics": "./schematics/collection.json",
|