slick-components 17.0.80 → 17.0.82
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.
|
@@ -23,7 +23,7 @@ class SlickInitParams {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
class SlickInitService {
|
|
26
|
-
static { this.version = "17.0.
|
|
26
|
+
static { this.version = "17.0.82"; }
|
|
27
27
|
constructor() { }
|
|
28
28
|
static init(initParams) {
|
|
29
29
|
console.info(`Slick Components Version ${SlickInitService.version}`);
|
|
@@ -2851,29 +2851,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
2851
2851
|
}] });
|
|
2852
2852
|
|
|
2853
2853
|
class SlickDragDropDirective {
|
|
2854
|
-
constructor() {
|
|
2854
|
+
constructor(el, renderer) {
|
|
2855
|
+
this.el = el;
|
|
2856
|
+
this.renderer = renderer;
|
|
2855
2857
|
this.itemDropped = new EventEmitter();
|
|
2856
2858
|
this.dragEntered = new EventEmitter();
|
|
2857
2859
|
this.dragLeft = new EventEmitter();
|
|
2860
|
+
this.dragCounter = 0;
|
|
2858
2861
|
}
|
|
2859
2862
|
onDragOver(event) {
|
|
2860
|
-
event.preventDefault();
|
|
2863
|
+
event.preventDefault();
|
|
2861
2864
|
}
|
|
2862
2865
|
onDragEnter(event) {
|
|
2863
2866
|
event.preventDefault();
|
|
2864
|
-
this.
|
|
2867
|
+
this.dragCounter++;
|
|
2868
|
+
if (this.dragCounter === 1) {
|
|
2869
|
+
this.renderer.setStyle(this.el.nativeElement, 'background-color', 'rgba(var(--bs-primary-rgb), 0.05)');
|
|
2870
|
+
this.dragEntered.emit();
|
|
2871
|
+
}
|
|
2865
2872
|
}
|
|
2866
2873
|
onDragLeave(event) {
|
|
2867
|
-
this.
|
|
2874
|
+
this.dragCounter--;
|
|
2875
|
+
if (this.dragCounter === 0) {
|
|
2876
|
+
this.renderer.removeStyle(this.el.nativeElement, 'background-color');
|
|
2877
|
+
this.dragLeft.emit();
|
|
2878
|
+
}
|
|
2868
2879
|
}
|
|
2869
2880
|
onDrop(event) {
|
|
2870
2881
|
event.preventDefault();
|
|
2882
|
+
this.dragCounter = 0;
|
|
2883
|
+
this.renderer.removeStyle(this.el.nativeElement, 'background-color');
|
|
2871
2884
|
if (!event.dataTransfer)
|
|
2872
2885
|
return;
|
|
2873
|
-
// Only accept slick-draggable items
|
|
2874
2886
|
const slickData = event.dataTransfer.getData('application/x-slick-draggable');
|
|
2875
2887
|
if (!slickData)
|
|
2876
|
-
return;
|
|
2888
|
+
return;
|
|
2877
2889
|
try {
|
|
2878
2890
|
const item = JSON.parse(slickData);
|
|
2879
2891
|
this.itemDropped.emit(item);
|
|
@@ -2882,7 +2894,7 @@ class SlickDragDropDirective {
|
|
|
2882
2894
|
console.warn('Dropped data not valid JSON', e);
|
|
2883
2895
|
}
|
|
2884
2896
|
}
|
|
2885
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDragDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2897
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDragDropDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2886
2898
|
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: SlickDragDropDirective, selector: "[slick-drag-drop]", outputs: { itemDropped: "itemDropped", dragEntered: "dragEntered", dragLeft: "dragLeft" }, host: { listeners: { "dragover": "onDragOver($event)", "dragenter": "onDragEnter($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0 }); }
|
|
2887
2899
|
}
|
|
2888
2900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDragDropDirective, decorators: [{
|
|
@@ -2890,7 +2902,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
2890
2902
|
args: [{
|
|
2891
2903
|
selector: '[slick-drag-drop]'
|
|
2892
2904
|
}]
|
|
2893
|
-
}], propDecorators: { itemDropped: [{
|
|
2905
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { itemDropped: [{
|
|
2894
2906
|
type: Output
|
|
2895
2907
|
}], dragEntered: [{
|
|
2896
2908
|
type: Output
|
|
@@ -2911,8 +2923,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
2911
2923
|
}] } });
|
|
2912
2924
|
|
|
2913
2925
|
class SlickDraggableDirective {
|
|
2914
|
-
constructor(el) {
|
|
2926
|
+
constructor(el, renderer) {
|
|
2915
2927
|
this.el = el;
|
|
2928
|
+
this.renderer = renderer;
|
|
2916
2929
|
this.dragStarted = new EventEmitter();
|
|
2917
2930
|
this.dragEnded = new EventEmitter();
|
|
2918
2931
|
this.el.nativeElement.draggable = true;
|
|
@@ -2920,23 +2933,28 @@ class SlickDraggableDirective {
|
|
|
2920
2933
|
onDragStart(event) {
|
|
2921
2934
|
if (!event.dataTransfer)
|
|
2922
2935
|
return;
|
|
2923
|
-
// Check if the click started on a drop-list grab handle
|
|
2924
|
-
const target = event.target;
|
|
2925
|
-
if (target.closest('[slick-drop-list-grab]')) {
|
|
2926
|
-
// Ignore dragging if the grab handle was clicked
|
|
2927
|
-
event.preventDefault();
|
|
2928
|
-
return;
|
|
2929
|
-
}
|
|
2930
|
-
// Use a custom MIME type for slick-draggable items
|
|
2931
2936
|
event.dataTransfer.setData('application/x-slick-draggable', JSON.stringify(this.data));
|
|
2932
2937
|
this.el.nativeElement.style.opacity = '0.5';
|
|
2933
2938
|
this.dragStarted.emit(this.data);
|
|
2939
|
+
// Highlight all drop zones (works on any tag)
|
|
2940
|
+
const dropZones = document.querySelectorAll('[slick-drag-drop]');
|
|
2941
|
+
dropZones.forEach(zone => {
|
|
2942
|
+
zone.classList.add('slick-drop-highlight');
|
|
2943
|
+
// Use box-shadow instead of border so it overrides inline styles
|
|
2944
|
+
this.renderer.setStyle(zone, 'box-shadow', '0 0 0 2px rgba(var(--bs-primary-rgb)) inset, 0 0 8px rgba(var(--bs-primary-rgb), 1)');
|
|
2945
|
+
});
|
|
2934
2946
|
}
|
|
2935
2947
|
onDragEnd(event) {
|
|
2936
2948
|
this.el.nativeElement.style.opacity = '1';
|
|
2937
2949
|
this.dragEnded.emit(this.data);
|
|
2950
|
+
// Remove highlight from all drop zones
|
|
2951
|
+
const dropZones = document.querySelectorAll('[slick-drag-drop]');
|
|
2952
|
+
dropZones.forEach(zone => {
|
|
2953
|
+
zone.classList.remove('slick-drop-highlight');
|
|
2954
|
+
this.renderer.removeStyle(zone, 'box-shadow');
|
|
2955
|
+
});
|
|
2938
2956
|
}
|
|
2939
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDraggableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2957
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDraggableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2940
2958
|
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: SlickDraggableDirective, selector: "[slick-draggable]", inputs: { data: "data" }, outputs: { dragStarted: "dragStarted", dragEnded: "dragEnded" }, host: { listeners: { "dragstart": "onDragStart($event)", "dragend": "onDragEnd($event)" } }, ngImport: i0 }); }
|
|
2941
2959
|
}
|
|
2942
2960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDraggableDirective, decorators: [{
|
|
@@ -2944,7 +2962,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
2944
2962
|
args: [{
|
|
2945
2963
|
selector: '[slick-draggable]'
|
|
2946
2964
|
}]
|
|
2947
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
|
|
2965
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { data: [{
|
|
2948
2966
|
type: Input
|
|
2949
2967
|
}], dragStarted: [{
|
|
2950
2968
|
type: Output
|