+
+
+ {{tip}}
+
+
+
-
diff --git a/src/app/shared/form/chips/chips.component.scss b/src/app/shared/form/chips/chips.component.scss
index a894448730..a136c40cf3 100644
--- a/src/app/shared/form/chips/chips.component.scss
+++ b/src/app/shared/form/chips/chips.component.scss
@@ -1,7 +1,11 @@
-.chip-selected {
- background-color: var(--bs-secondary) !important;
+.cdk-drag-placeholder {
+ filter: grayscale(100%);
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}
-
-.chip-label {
- max-width: 10rem;
+.cdk-drag-preview {
+ color: white;
+ box-sizing: border-box;
+ border-radius: 0.25rem;
+ box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
+ 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
}
diff --git a/src/app/shared/form/chips/chips.component.ts b/src/app/shared/form/chips/chips.component.ts
index 692e2982f5..ae428127a8 100644
--- a/src/app/shared/form/chips/chips.component.ts
+++ b/src/app/shared/form/chips/chips.component.ts
@@ -1,3 +1,10 @@
+import {
+ CdkDrag,
+ CdkDragDrop,
+ CdkDragStart,
+ CdkDropList,
+ moveItemInArray,
+} from '@angular/cdk/drag-drop';
import {
AsyncPipe,
NgClass,
@@ -24,7 +31,6 @@ import {
import isObject from 'lodash/isObject';
import { BehaviorSubject } from 'rxjs';
-import { DragService } from '../../../core/drag.service';
import { AuthorityConfidenceStateDirective } from '../directives/authority-confidence-state.directive';
import { Chips } from './models/chips.model';
import { ChipsItem } from './models/chips-item.model';
@@ -41,6 +47,8 @@ import { ChipsItem } from './models/chips-item.model';
AuthorityConfidenceStateDirective,
NgIf,
TranslateModule,
+ CdkDrag,
+ CdkDropList,
],
standalone: true,
})
@@ -61,7 +69,6 @@ export class ChipsComponent implements OnChanges {
constructor(
private cdr: ChangeDetectorRef,
- private dragService: DragService,
private translate: TranslateService) {
}
@@ -94,21 +101,19 @@ export class ChipsComponent implements OnChanges {
}
}
- onDragStart(index) {
+ onDrag(event: CdkDragStart
) {
this.isDragging.next(true);
- this.dragService.overrideDragOverPage();
- this.dragged = index;
}
-
- onDragEnd(event) {
- this.dragService.allowDragOverPage();
- this.dragged = -1;
+ onDrop(event: CdkDragDrop) {
+ moveItemInArray(this.chips.chipsItems.getValue(), event.previousIndex, event.currentIndex);
this.chips.updateOrder();
this.isDragging.next(false);
}
-
showTooltip(tooltip: NgbTooltip, index, field?) {
tooltip.close();
+ if (this.isDragging.value) {
+ return;
+ }
const chipsItem = this.chips.getChipByIndex(index);
const textToDisplay: string[] = [];
if (!chipsItem.editMode && this.dragged === -1) {
@@ -139,5 +144,4 @@ export class ChipsComponent implements OnChanges {
}
}
-
}
diff --git a/src/modules/app/server-app.module.ts b/src/modules/app/server-app.module.ts
index 9d930b892c..eb99534513 100644
--- a/src/modules/app/server-app.module.ts
+++ b/src/modules/app/server-app.module.ts
@@ -6,9 +6,7 @@ import {
TransferState,
} from '@angular/core';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
-import {
- ServerModule,
-} from '@angular/platform-server';
+import { ServerModule } from '@angular/platform-server';
import { EffectsModule } from '@ngrx/effects';
import {
Action,