slick-components 17.0.80 → 17.0.81

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.80"; }
26
+ static { this.version = "17.0.81"; }
27
27
  constructor() { }
28
28
  static init(initParams) {
29
29
  console.info(`Slick Components Version ${SlickInitService.version}`);
@@ -2851,13 +2851,15 @@ 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();
2858
2860
  }
2859
2861
  onDragOver(event) {
2860
- event.preventDefault(); // Needed to allow drop
2862
+ event.preventDefault();
2861
2863
  }
2862
2864
  onDragEnter(event) {
2863
2865
  event.preventDefault();
@@ -2870,10 +2872,9 @@ class SlickDragDropDirective {
2870
2872
  event.preventDefault();
2871
2873
  if (!event.dataTransfer)
2872
2874
  return;
2873
- // Only accept slick-draggable items
2874
2875
  const slickData = event.dataTransfer.getData('application/x-slick-draggable');
2875
2876
  if (!slickData)
2876
- return; // Not from slick-draggable, ignore
2877
+ return;
2877
2878
  try {
2878
2879
  const item = JSON.parse(slickData);
2879
2880
  this.itemDropped.emit(item);
@@ -2882,7 +2883,7 @@ class SlickDragDropDirective {
2882
2883
  console.warn('Dropped data not valid JSON', e);
2883
2884
  }
2884
2885
  }
2885
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDragDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2886
+ /** @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
2887
  /** @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
2888
  }
2888
2889
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDragDropDirective, decorators: [{
@@ -2890,7 +2891,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
2890
2891
  args: [{
2891
2892
  selector: '[slick-drag-drop]'
2892
2893
  }]
2893
- }], propDecorators: { itemDropped: [{
2894
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { itemDropped: [{
2894
2895
  type: Output
2895
2896
  }], dragEntered: [{
2896
2897
  type: Output
@@ -2911,8 +2912,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
2911
2912
  }] } });
2912
2913
 
2913
2914
  class SlickDraggableDirective {
2914
- constructor(el) {
2915
+ constructor(el, renderer) {
2915
2916
  this.el = el;
2917
+ this.renderer = renderer;
2916
2918
  this.dragStarted = new EventEmitter();
2917
2919
  this.dragEnded = new EventEmitter();
2918
2920
  this.el.nativeElement.draggable = true;
@@ -2920,23 +2922,28 @@ class SlickDraggableDirective {
2920
2922
  onDragStart(event) {
2921
2923
  if (!event.dataTransfer)
2922
2924
  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
2925
  event.dataTransfer.setData('application/x-slick-draggable', JSON.stringify(this.data));
2932
2926
  this.el.nativeElement.style.opacity = '0.5';
2933
2927
  this.dragStarted.emit(this.data);
2928
+ // Highlight all drop zones (works on any tag)
2929
+ const dropZones = document.querySelectorAll('[slick-drag-drop]');
2930
+ dropZones.forEach(zone => {
2931
+ zone.classList.add('slick-drop-highlight');
2932
+ // Use box-shadow instead of border so it overrides inline styles
2933
+ 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)');
2934
+ });
2934
2935
  }
2935
2936
  onDragEnd(event) {
2936
2937
  this.el.nativeElement.style.opacity = '1';
2937
2938
  this.dragEnded.emit(this.data);
2939
+ // Remove highlight from all drop zones
2940
+ const dropZones = document.querySelectorAll('[slick-drag-drop]');
2941
+ dropZones.forEach(zone => {
2942
+ zone.classList.remove('slick-drop-highlight');
2943
+ this.renderer.removeStyle(zone, 'box-shadow');
2944
+ });
2938
2945
  }
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 }); }
2946
+ /** @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
2947
  /** @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
2948
  }
2942
2949
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SlickDraggableDirective, decorators: [{
@@ -2944,7 +2951,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
2944
2951
  args: [{
2945
2952
  selector: '[slick-draggable]'
2946
2953
  }]
2947
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
2954
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { data: [{
2948
2955
  type: Input
2949
2956
  }], dragStarted: [{
2950
2957
  type: Output