@bildvitta/quasar-ui-asteroid 3.17.0-beta.13 → 3.17.0-beta.15

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.17.0-beta.13",
4
+ "version": "3.17.0-beta.15",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -19,12 +19,7 @@ defineOptions({
19
19
  const props = defineProps({
20
20
  color: {
21
21
  type: String,
22
- default: AvatarColors.Primary,
23
- validator: value => {
24
- const availableColors = Object.values(AvatarColors)
25
-
26
- return availableColors.includes(value)
27
- }
22
+ default: AvatarColors.Primary
28
23
  },
29
24
 
30
25
  size: {
@@ -42,6 +37,11 @@ const props = defineProps({
42
37
  type: String
43
38
  },
44
39
 
40
+ textColor: {
41
+ default: '',
42
+ type: String
43
+ },
44
+
45
45
  title: {
46
46
  default: '',
47
47
  type: String
@@ -62,7 +62,6 @@ const attributes = computed(() => {
62
62
  rounded,
63
63
  square,
64
64
  fontSize,
65
- textColor,
66
65
  ...attributes
67
66
  } = attrs
68
67
 
@@ -76,7 +75,7 @@ const attributes = computed(() => {
76
75
  return {
77
76
  size: props.size,
78
77
  color: props.color,
79
- textColor: colors[props.color],
78
+ textColor: colors[props.color] || props.textColor,
80
79
  ...attributes
81
80
  }
82
81
  })
@@ -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 isUpdatePosition = ref(false)
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 (!isUpdatePosition.value) return
200
+ if (isUpdatingPosition.value) return
200
201
 
201
- isUpdatePosition.value = false
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
- ? toggleConfirmDialog()
535
+ ? openConfirmDialog()
535
536
  : confirmDrop(event)
536
537
  }
537
538
 
538
- function toggleConfirmDialog () {
539
- showConfirmDialog.value = !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) toggleConfirmDialog()
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
- isUpdatePosition.value = true
660
+ isUpdatingPosition.value = true
656
661
 
657
662
  toggleIsDragging()
658
- toggleConfirmDialog()
663
+
664
+ closeConfirmDialog()
659
665
 
660
666
  emit('update-success')
661
667
  }
@@ -350,7 +350,7 @@ export default {
350
350
  this.handleFetchData()
351
351
  },
352
352
 
353
- unmounted () {
353
+ beforeUnmount () {
354
354
  this.unregisterChartJS()
355
355
  },
356
356