@bildvitta/quasar-ui-asteroid 3.11.0-beta.10 → 3.11.0-beta.11

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.11.0-beta.10",
4
+ "version": "3.11.0-beta.11",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -25,11 +25,6 @@ export default {
25
25
  type: Object
26
26
  },
27
27
 
28
- list: {
29
- default: () => [],
30
- type: Array
31
- },
32
-
33
28
  tag: {
34
29
  default: 'div',
35
30
  type: String
@@ -40,7 +35,7 @@ export default {
40
35
  type: String
41
36
  },
42
37
 
43
- sorted: {
38
+ modelValue: {
44
39
  default: () => [],
45
40
  type: Array
46
41
  },
@@ -52,7 +47,7 @@ export default {
52
47
  },
53
48
 
54
49
  emits: [
55
- 'update:sorted',
50
+ 'update:modelValue',
56
51
  'sort',
57
52
  'success',
58
53
  'error'
@@ -76,9 +71,9 @@ export default {
76
71
  this.sortable.options = { ...this.sortable.options, ...value }
77
72
  },
78
73
 
79
- list: {
80
- handler (value) {
81
- this.setSortedValue(value)
74
+ modelValue: {
75
+ handler (newValues) {
76
+ this.sortedList = newValues
82
77
  },
83
78
 
84
79
  deep: true
@@ -139,16 +134,17 @@ export default {
139
134
  const deleted = this.sortedList.splice(oldIndex, 1)
140
135
  this.sortedList.splice(newIndex, 0, deleted[0])
141
136
 
137
+ this.updateModel()
138
+
142
139
  this.useSaveOnSort && this.replace()
143
140
  },
144
141
 
145
- setSortedValue (value) {
146
- this.sortedList = extend(true, [], value || this.list)
147
- this.updateSortedModel()
142
+ setSortedValue () {
143
+ this.sortedList = extend(true, [], this.modelValue)
148
144
  },
149
145
 
150
- updateSortedModel () {
151
- return this.$emit('update:sorted', this.sortedList)
146
+ updateModel () {
147
+ this.$emit('update:modelValue', this.sortedList)
152
148
  }
153
149
  }
154
150
  }
@@ -9,21 +9,16 @@ props:
9
9
  required: true
10
10
  type: String
11
11
 
12
- list:
13
- desc: Lista que vai ser reordenada.
14
- default: []
15
- type: Array
16
-
17
12
  sortable-options:
18
13
  desc: Opções do "sortablejs" (https://github.com/SortableJS/Sortable#options).
19
14
  default: { animation: 500 }
20
15
  type: Object
21
16
 
22
- sorted:
23
- desc: Model da lista reordenada
17
+ model-value:
18
+ desc: Model do componente onde será fornecido a lista, e ele será responsável pela ordenação.
24
19
  default: []
25
20
  type: Array
26
- examples: [v-model:sorted="fields"]
21
+ examples: [v-model="fields"]
27
22
  model: true
28
23
 
29
24
  tag:
@@ -62,9 +57,9 @@ events:
62
57
  desc: fields.
63
58
  type: Object
64
59
 
65
- '@update:sorted -> function(value)':
66
- desc: Dispara no created e toda vez que a prop "list" muda, usado para o v-model:sorted.
60
+ '@update:model-value -> function(values)':
61
+ desc: Dispara quando o model-value altera, após acontecer uma ordenação.
67
62
  params:
68
- value:
69
- desc: Lista contendo nova ordenação.
63
+ values:
64
+ desc: Novo valor do model.
70
65
  type: Array
@@ -92,7 +92,7 @@ export default {
92
92
  watch: {
93
93
  'lazyLoadingProps.params': {
94
94
  handler (newParams, oldParams) {
95
- if (isEqual(newParams, oldParams)) return
95
+ if (!this.useLazyLoading || isEqual(newParams, oldParams)) return
96
96
 
97
97
  this.mx_cachedOptions = []
98
98