@tagplus/components 1.2.11 → 1.2.12
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/dist/tp.common.js +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +1 -1
- package/dist/tp.umd.js.map +1 -1
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/package.json +2 -1
- package/src/components/Multisuggest/Multisuggest.vue +25 -18
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"email": "bruno@tagplus.com.br"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
|
-
"version": "1.2.
|
|
11
|
+
"version": "1.2.12",
|
|
12
12
|
"main": "./dist/tp.common.js",
|
|
13
13
|
"directories": {
|
|
14
14
|
"lib": "src/lib"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "NODE_ENV=production && vue-cli-service build --target lib --name tp ./src/main.js",
|
|
30
|
+
"build:dev": "NODE_ENV=development && vue-cli-service build --mode development --target lib --name tp ./src/main.js",
|
|
30
31
|
"doc": "yarn docs",
|
|
31
32
|
"docs": "nodemon --exec \"vuese gen && vuese serve\" --watch ./src -e js,vue,scss",
|
|
32
33
|
"docs:gen": "vuese gen",
|
|
@@ -448,6 +448,10 @@ export default {
|
|
|
448
448
|
return item[this.labelKey]
|
|
449
449
|
})
|
|
450
450
|
.join(', ')
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
suggestionsList(_newValue, _oldValue){
|
|
454
|
+
this.setSelectedLabel()
|
|
451
455
|
}
|
|
452
456
|
},
|
|
453
457
|
|
|
@@ -473,24 +477,7 @@ export default {
|
|
|
473
477
|
}
|
|
474
478
|
})
|
|
475
479
|
|
|
476
|
-
|
|
477
|
-
this.value.forEach((item, key) => {
|
|
478
|
-
this.suggestionsList.forEach(suggestion => {
|
|
479
|
-
if (suggestion[this.valueKey] === item) {
|
|
480
|
-
this.selectedLabelsArray.push(suggestion)
|
|
481
|
-
}
|
|
482
|
-
})
|
|
483
|
-
})
|
|
484
|
-
} else if (process.env.DEBUG === 'true') {
|
|
485
|
-
console.log(`'${this.$options.name}' recebeu valor em formato inválido.`)
|
|
486
|
-
console.log(this.value)
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
this.selectedLabels = this.selectedLabelsArray
|
|
490
|
-
.map(item => {
|
|
491
|
-
return item[this.labelKey]
|
|
492
|
-
})
|
|
493
|
-
.join(', ')
|
|
480
|
+
this.setSelectedLabel()
|
|
494
481
|
},
|
|
495
482
|
|
|
496
483
|
beforeMount () {
|
|
@@ -515,6 +502,26 @@ export default {
|
|
|
515
502
|
}
|
|
516
503
|
},
|
|
517
504
|
|
|
505
|
+
setSelectedLabel () {
|
|
506
|
+
if (Array.isArray(this.value)) {
|
|
507
|
+
this.value.forEach((item, key) => {
|
|
508
|
+
this.suggestionsList.forEach(suggestion => {
|
|
509
|
+
if (suggestion[this.valueKey] === item) {
|
|
510
|
+
this.selectedLabelsArray.push(suggestion)
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
})
|
|
514
|
+
} else if (process.env.DEBUG === 'true') {
|
|
515
|
+
console.log(`'${this.$options.name}' recebeu valor em formato inválido.`)
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
this.selectedLabels = this.selectedLabelsArray
|
|
519
|
+
.map(item => {
|
|
520
|
+
return item[this.labelKey]
|
|
521
|
+
})
|
|
522
|
+
.join(', ')
|
|
523
|
+
},
|
|
524
|
+
|
|
518
525
|
// eslint-disable-next-line no-unused-vars
|
|
519
526
|
clearTags (event) {
|
|
520
527
|
// Faz uma requisição limpa
|