@tagplus/components 0.2.92 → 0.2.96
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 +581 -1017
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +581 -1017
- 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 +1 -1
- package/src/components/Multisuggest/Multisuggest.vue +57 -45
package/package.json
CHANGED
|
@@ -363,20 +363,17 @@ export default {
|
|
|
363
363
|
let newVal = ''
|
|
364
364
|
if (typeof this.value === 'boolean') {
|
|
365
365
|
newVal = ''
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
this.valueKey +
|
|
374
|
-
'\' key'
|
|
375
|
-
)
|
|
366
|
+
}
|
|
367
|
+
else if (Array.isArray(this.value)) {
|
|
368
|
+
this.value.forEach((item) => {
|
|
369
|
+
if (!item[this.valueKey]) {
|
|
370
|
+
if (process.env.DEBUG === 'true') {
|
|
371
|
+
throw new TypeError('Autosuggest this.value doesn\'t have a valueKey \'' + this.valueKey + '\' key')
|
|
372
|
+
}
|
|
376
373
|
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
newVal = this.value
|
|
380
377
|
}
|
|
381
378
|
|
|
382
379
|
return newVal
|
|
@@ -459,6 +456,21 @@ export default {
|
|
|
459
456
|
this.handleQueryChange(e.target.value, forceBusca)
|
|
460
457
|
}
|
|
461
458
|
})
|
|
459
|
+
|
|
460
|
+
this.value.forEach((item,key) => {
|
|
461
|
+
if (item[this.valueKey]) {
|
|
462
|
+
this.value[key] = item[this.valueKey]
|
|
463
|
+
if(item[this.labelKey]) {
|
|
464
|
+
this.selectedLabelsArray.push(item)
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
this.selectedLabels = this.selectedLabelsArray
|
|
470
|
+
.map(item => {
|
|
471
|
+
return item[this.labelKey]
|
|
472
|
+
})
|
|
473
|
+
.join(', ')
|
|
462
474
|
},
|
|
463
475
|
|
|
464
476
|
beforeMount () {
|
|
@@ -467,7 +479,7 @@ export default {
|
|
|
467
479
|
if (this.loadOnCreate) {
|
|
468
480
|
this.previousQuery = false
|
|
469
481
|
// Chama função do element-ui select que faz o remote method
|
|
470
|
-
this.handleQueryChange('')
|
|
482
|
+
this.handleQueryChange('', true)
|
|
471
483
|
} else {
|
|
472
484
|
// Marca para fazer a requisição no primeiro clique
|
|
473
485
|
this.doRequest = true
|
|
@@ -509,20 +521,18 @@ export default {
|
|
|
509
521
|
value = ''
|
|
510
522
|
} else if (Array.isArray(val)) {
|
|
511
523
|
value = val
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
this.valueKey +
|
|
518
|
-
'\' key'
|
|
519
|
-
)
|
|
524
|
+
}
|
|
525
|
+
else if (val && typeof val === 'object') {
|
|
526
|
+
// Se val for Object converte para outro tipo
|
|
527
|
+
if (!val[this.valueKey]) {
|
|
528
|
+
throw new TypeError('Multisuggest option doesn\'t have a valueKey \'' + this.valueKey + '\' key')
|
|
520
529
|
} else {
|
|
521
530
|
// Se mandou a label no objeto value
|
|
522
|
-
if (
|
|
523
|
-
initialLabel =
|
|
531
|
+
if (val[this.labelKey]) {
|
|
532
|
+
initialLabel = val[this.labelKey]
|
|
524
533
|
}
|
|
525
|
-
|
|
534
|
+
|
|
535
|
+
value = val
|
|
526
536
|
}
|
|
527
537
|
} else {
|
|
528
538
|
value = val
|
|
@@ -586,19 +596,17 @@ export default {
|
|
|
586
596
|
*/
|
|
587
597
|
toggleMenu() {
|
|
588
598
|
if (!this.selectDisabled) {
|
|
599
|
+
// Se mantem visivel quando clica nele aberto
|
|
589
600
|
if (this.menuVisibleOnFocus) {
|
|
590
601
|
this.menuVisibleOnFocus = false
|
|
591
602
|
} else {
|
|
592
603
|
this.visible = !this.visible
|
|
593
604
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
this.handleQueryChange(this.query)
|
|
598
|
-
this.doRequest = false
|
|
599
|
-
}
|
|
600
|
-
(this.$refs.input || this.$refs.reference).focus()
|
|
605
|
+
if (this.doRequest) {
|
|
606
|
+
this.handleQueryChange(this.query, true)
|
|
607
|
+
this.doRequest = false
|
|
601
608
|
}
|
|
609
|
+
(this.$refs.input || this.$refs.reference).focus()
|
|
602
610
|
}
|
|
603
611
|
},
|
|
604
612
|
|
|
@@ -747,23 +755,27 @@ input.el-input__inner {
|
|
|
747
755
|
transition: 100ms all linear;
|
|
748
756
|
|
|
749
757
|
&.hover {
|
|
750
|
-
|
|
758
|
+
background-color: #f5f7fa;
|
|
759
|
+
font-weight: bold;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
&.selected {
|
|
763
|
+
color: #2D6EDA;
|
|
764
|
+
padding-left: 30px;
|
|
765
|
+
background-color: #F0F3F9;
|
|
766
|
+
border-radius: 5px;
|
|
767
|
+
font-weight: none;
|
|
751
768
|
|
|
752
769
|
&::before {
|
|
753
|
-
content: "";
|
|
754
770
|
position: absolute;
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
771
|
+
left: 7px;
|
|
772
|
+
font-family: "element-icons";
|
|
773
|
+
content: "\e6da";
|
|
774
|
+
font-size: 15px;
|
|
775
|
+
}
|
|
776
|
+
&::after {
|
|
777
|
+
content: "";
|
|
762
778
|
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
&.selected {
|
|
766
|
-
color: $--color-text-regular;
|
|
767
779
|
}
|
|
768
780
|
&.created a {
|
|
769
781
|
color: $--color-primary;
|