@tagplus/components 0.2.91 → 0.2.95
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 +413 -602
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +1 -1
- package/dist/tp.umd.js +413 -602
- 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 +3 -3
- package/src/assets/scss/_variables.scss +1 -6
- package/src/components/Multisuggest/Multisuggest.vue +55 -45
- package/src/main.js +1 -1
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"email": "bruno@tagplus.com.br"
|
|
8
8
|
}
|
|
9
9
|
],
|
|
10
|
-
"version": "0.2.
|
|
10
|
+
"version": "0.2.95",
|
|
11
11
|
"main": "./dist/tp.common.js",
|
|
12
12
|
"directories": {
|
|
13
13
|
"lib": "src/lib"
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"eslint": "^6.2.2",
|
|
66
66
|
"eslint-plugin-prettier": "^3.1.0",
|
|
67
67
|
"eslint-plugin-vue": "^6.0.1",
|
|
68
|
+
"node-sass": "^4.9.0",
|
|
68
69
|
"nodemon": "^2.0.1",
|
|
69
70
|
"prettier": "^1.18.2",
|
|
70
|
-
"sass": "^1.
|
|
71
|
-
"sass-loader": "^10.2.0",
|
|
71
|
+
"sass-loader": "^7.1.0",
|
|
72
72
|
"vue-template-compiler": "^2.6.10",
|
|
73
73
|
"webpack": "^5.61.0",
|
|
74
74
|
"webpack-bundle-analyzer": "^3.5.0"
|
|
@@ -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,19 @@ 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.selectedLabelsArray.push(item)
|
|
463
|
+
this.value[key] = item[this.valueKey]
|
|
464
|
+
}
|
|
465
|
+
})
|
|
466
|
+
|
|
467
|
+
this.selectedLabels = this.selectedLabelsArray
|
|
468
|
+
.map(item => {
|
|
469
|
+
return item[this.labelKey]
|
|
470
|
+
})
|
|
471
|
+
.join(', ')
|
|
462
472
|
},
|
|
463
473
|
|
|
464
474
|
beforeMount () {
|
|
@@ -467,7 +477,7 @@ export default {
|
|
|
467
477
|
if (this.loadOnCreate) {
|
|
468
478
|
this.previousQuery = false
|
|
469
479
|
// Chama função do element-ui select que faz o remote method
|
|
470
|
-
this.handleQueryChange('')
|
|
480
|
+
this.handleQueryChange('', true)
|
|
471
481
|
} else {
|
|
472
482
|
// Marca para fazer a requisição no primeiro clique
|
|
473
483
|
this.doRequest = true
|
|
@@ -509,20 +519,18 @@ export default {
|
|
|
509
519
|
value = ''
|
|
510
520
|
} else if (Array.isArray(val)) {
|
|
511
521
|
value = val
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
this.valueKey +
|
|
518
|
-
'\' key'
|
|
519
|
-
)
|
|
522
|
+
}
|
|
523
|
+
else if (val && typeof val === 'object') {
|
|
524
|
+
// Se val for Object converte para outro tipo
|
|
525
|
+
if (!val[this.valueKey]) {
|
|
526
|
+
throw new TypeError('Autosuggest this.value doesn\'t have a valueKey \'' + this.valueKey + '\' key')
|
|
520
527
|
} else {
|
|
521
528
|
// Se mandou a label no objeto value
|
|
522
|
-
if (
|
|
523
|
-
initialLabel =
|
|
529
|
+
if (val[this.labelKey]) {
|
|
530
|
+
initialLabel = val[this.labelKey]
|
|
524
531
|
}
|
|
525
|
-
|
|
532
|
+
|
|
533
|
+
value = val
|
|
526
534
|
}
|
|
527
535
|
} else {
|
|
528
536
|
value = val
|
|
@@ -586,19 +594,17 @@ export default {
|
|
|
586
594
|
*/
|
|
587
595
|
toggleMenu() {
|
|
588
596
|
if (!this.selectDisabled) {
|
|
597
|
+
// Se mantem visivel quando clica nele aberto
|
|
589
598
|
if (this.menuVisibleOnFocus) {
|
|
590
599
|
this.menuVisibleOnFocus = false
|
|
591
600
|
} else {
|
|
592
601
|
this.visible = !this.visible
|
|
593
602
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
this.handleQueryChange(this.query)
|
|
598
|
-
this.doRequest = false
|
|
599
|
-
}
|
|
600
|
-
(this.$refs.input || this.$refs.reference).focus()
|
|
603
|
+
if (this.doRequest) {
|
|
604
|
+
this.handleQueryChange(this.query, true)
|
|
605
|
+
this.doRequest = false
|
|
601
606
|
}
|
|
607
|
+
(this.$refs.input || this.$refs.reference).focus()
|
|
602
608
|
}
|
|
603
609
|
},
|
|
604
610
|
|
|
@@ -747,23 +753,27 @@ input.el-input__inner {
|
|
|
747
753
|
transition: 100ms all linear;
|
|
748
754
|
|
|
749
755
|
&.hover {
|
|
750
|
-
|
|
756
|
+
background-color: #f5f7fa;
|
|
757
|
+
font-weight: bold;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
&.selected {
|
|
761
|
+
color: #2D6EDA;
|
|
762
|
+
padding-left: 30px;
|
|
763
|
+
background-color: #F0F3F9;
|
|
764
|
+
border-radius: 5px;
|
|
765
|
+
font-weight: none;
|
|
751
766
|
|
|
752
767
|
&::before {
|
|
753
|
-
content: "";
|
|
754
768
|
position: absolute;
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
769
|
+
left: 7px;
|
|
770
|
+
font-family: "element-icons";
|
|
771
|
+
content: "\e6da";
|
|
772
|
+
font-size: 15px;
|
|
773
|
+
}
|
|
774
|
+
&::after {
|
|
775
|
+
content: "";
|
|
762
776
|
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
&.selected {
|
|
766
|
-
color: $--color-text-regular;
|
|
767
777
|
}
|
|
768
778
|
&.created a {
|
|
769
779
|
color: $--color-primary;
|
package/src/main.js
CHANGED