diff --git a/public/plugins/vue/tt-components/css/tt-position-manager.css b/public/plugins/vue/tt-components/css/tt-position-manager.css index d9b702ee8..8b7bd4090 100644 --- a/public/plugins/vue/tt-components/css/tt-position-manager.css +++ b/public/plugins/vue/tt-components/css/tt-position-manager.css @@ -67,3 +67,21 @@ padding: 0.3rem 0.6rem; /* Small button padding */ font-size: 0.875rem; } + +.positions-manager.ctrl-pressed .position-row { + cursor: grab; +} + +.positions-manager.ctrl-pressed .position-row:active { + cursor: grabbing; +} + +.position-row.dragging { + opacity: 0.5; + background: #f0f0f0; +} + +/* Style for the drop indicator */ +.drop-indicator { + border-top: 2px solid #007bff !important; +} diff --git a/public/plugins/vue/tt-components/tt-position-manager.js b/public/plugins/vue/tt-components/tt-position-manager.js index 50d676a3c..4910c2c05 100644 --- a/public/plugins/vue/tt-components/tt-position-manager.js +++ b/public/plugins/vue/tt-components/tt-position-manager.js @@ -37,30 +37,33 @@ Vue.component('tt-resolver', { Vue.component('tt-positions-manager', { props: { - value: {type: [Array, String], required: false}, - config: {type: Object, required: true}, - groupMode: {type: Boolean, default: false}, + value: {type: [Array, String], required: false}, + config: {type: Object, required: true}, + groupMode: {type: Boolean, default: false}, submitLoading: {type: Boolean, default: false} }, data() { return { - window: window, - positions: this.value, - formData: {}, - groupName: '', - selectedIndex: null, + window: window, + positions: this.value, + formData: {}, + groupName: '', + selectedIndex: null, editingGroupName: null, - tempGroupName: '', - // New state for instant editing + tempGroupName: '', editingCell: { - groupName: null, // For grouped positions - index: null, // Index within the group or flat array - key: null // Field key being edited - } + groupName: null, + index: null, + key: null + }, + // --- New properties for Drag and Drop --- + ctrlPressed: false, // Is the Ctrl key currently pressed? + draggingItem: null, // The actual position object being dragged + dragOverItem: null // The position object the mouse is currently over } }, template: ` -
+
@@ -144,7 +147,6 @@ Vue.component('tt-positions-manager', {
- @@ -153,9 +155,13 @@ Vue.component('tt-positions-manager', { -