@bildvitta/quasar-ui-asteroid 3.1.0 → 3.1.1-beta.0

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.1.0",
4
+ "version": "3.1.1-beta.0",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -320,8 +320,16 @@ export default {
320
320
  return this.$emit('update:modelValue', value || this.nested)
321
321
  },
322
322
 
323
+ /*
324
+ * Se o item que for removido não tiver o identificador (uuid por ex) e "useRemoveOnDestroy" for "false"
325
+ * ou "useRemoveOnDestroy" for "true" removemos o item do array, senão adicionamos a flag [destroyKey]
326
+ * no item referente do array.
327
+ *
328
+ * Ex: ao adicionar um item e remover sem salvar, mesmo que useRemoveOnDestroy for false ele será removido
329
+ * ao invés de adicionar a flag [destroyKey]
330
+ */
323
331
  destroy (index, row) {
324
- !row[this.identifierItemKey] && this.useRemoveOnDestroy
332
+ !row[this.identifierItemKey] || this.useRemoveOnDestroy
325
333
  ? this.nested.splice(index, 1)
326
334
  : this.nested.splice(index, 1, { [this.destroyKey]: true, ...row })
327
335