@bildvitta/quasar-ui-asteroid 3.17.0-beta.13 → 3.17.0-beta.14
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/package.json
CHANGED
|
@@ -167,7 +167,7 @@ const onConfirmDrop = ref(() => {})
|
|
|
167
167
|
/**
|
|
168
168
|
* Variável auxiliar que controla quando estou atualizando o header em caso de drag and drop
|
|
169
169
|
*/
|
|
170
|
-
const
|
|
170
|
+
const isUpdatingPosition = ref(false)
|
|
171
171
|
|
|
172
172
|
// Consts
|
|
173
173
|
const hasDragAndDrop = !!props.useDragAndDropX || !!props.useDragAndDropY
|
|
@@ -186,8 +186,9 @@ watch(
|
|
|
186
186
|
value => {
|
|
187
187
|
/**
|
|
188
188
|
* isFetchSuccessHeader é uma variavel que pego do listView por inject/provide, no qual caso eu faça request do header e dê sucesso, eu chamo as demais funções.
|
|
189
|
+
* Valido se não houve sucesso na requisição do header ou se não é uma atualização de posição, para assim não bater novamente nas colunas apenas no header.
|
|
189
190
|
*/
|
|
190
|
-
if (!value) return
|
|
191
|
+
if (!value || isUpdatingPosition.value) return
|
|
191
192
|
|
|
192
193
|
fetchColumnsValues()
|
|
193
194
|
}
|
|
@@ -196,9 +197,9 @@ watch(
|
|
|
196
197
|
watch(
|
|
197
198
|
() => props.headers,
|
|
198
199
|
() => {
|
|
199
|
-
if (
|
|
200
|
+
if (isUpdatingPosition.value) return
|
|
200
201
|
|
|
201
|
-
|
|
202
|
+
isUpdatingPosition.value = false
|
|
202
203
|
}
|
|
203
204
|
)
|
|
204
205
|
|
|
@@ -531,12 +532,16 @@ function onDropCard (event) {
|
|
|
531
532
|
onConfirmDrop.value = () => confirmDrop(event)
|
|
532
533
|
|
|
533
534
|
hasConfirmDialogProps.value
|
|
534
|
-
?
|
|
535
|
+
? openConfirmDialog()
|
|
535
536
|
: confirmDrop(event)
|
|
536
537
|
}
|
|
537
538
|
|
|
538
|
-
function
|
|
539
|
-
showConfirmDialog.value =
|
|
539
|
+
function openConfirmDialog () {
|
|
540
|
+
showConfirmDialog.value = true
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function closeConfirmDialog () {
|
|
544
|
+
showConfirmDialog.value = false
|
|
540
545
|
}
|
|
541
546
|
|
|
542
547
|
/**
|
|
@@ -568,7 +573,7 @@ function cancelDrop (event) {
|
|
|
568
573
|
event.from.insertBefore(event.item, insertBeforeElement)
|
|
569
574
|
}
|
|
570
575
|
|
|
571
|
-
if (hasConfirmDialogProps.value)
|
|
576
|
+
if (hasConfirmDialogProps.value) closeConfirmDialog()
|
|
572
577
|
|
|
573
578
|
toggleIsDragging()
|
|
574
579
|
}
|
|
@@ -652,10 +657,11 @@ async function updatePosition ({ newHeaderKey, oldHeaderKey, itemId, event }) {
|
|
|
652
657
|
|
|
653
658
|
setItemList({ headerKey: newHeaderKey, data: data.data, index: event.newIndex })
|
|
654
659
|
|
|
655
|
-
|
|
660
|
+
isUpdatingPosition.value = true
|
|
656
661
|
|
|
657
662
|
toggleIsDragging()
|
|
658
|
-
|
|
663
|
+
|
|
664
|
+
closeConfirmDialog()
|
|
659
665
|
|
|
660
666
|
emit('update-success')
|
|
661
667
|
}
|