@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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "email": "bruno@tagplus.com.br"
8
8
  }
9
9
  ],
10
- "version": "0.2.91",
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.43.4",
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"
@@ -24,9 +24,4 @@ $light: 300;
24
24
  $normal: 400;
25
25
  $medium: 500;
26
26
  $semi-bold: 600;
27
- $bold: 700;
28
-
29
- $--color-white: #ffffff !default;
30
- $--color-primary: #2d6eda !default;
31
- $--popover-padding: 12px !default;
32
- $--color-text-regular: #606266 !default;
27
+ $bold: 700;
@@ -363,20 +363,17 @@ export default {
363
363
  let newVal = ''
364
364
  if (typeof this.value === 'boolean') {
365
365
  newVal = ''
366
- } else if (Array.isArray(this.value)) {
367
- newVal = this.value
368
- } else if (this.value && typeof this.value === 'object') {
369
- if (!this.value[this.valueKey]) {
370
- if (process.env.DEBUG === 'true') {
371
- throw new TypeError(
372
- 'Autosuggest this.value doesn\'t have a valueKey \'' +
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
- } else {
378
- newVal = this.value[this.valueKey]
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
- } else if (val && typeof val === 'object') {
513
- // Se val for Object converte para outro tipo
514
- if (!this.value[this.valueKey]) {
515
- throw new TypeError(
516
- 'Autosuggest this.value doesn\'t have a valueKey \'' +
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 (this.value[this.labelKey]) {
523
- initialLabel = this.value[this.labelKey]
529
+ if (val[this.labelKey]) {
530
+ initialLabel = val[this.labelKey]
524
531
  }
525
- value = this.value[this.valueKey]
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
- // Se está visivel
595
- if (this.visible) {
596
- if (this.doRequest) {
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
- padding-left: 20px;
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
- display: inline-block;
756
- width: 4px;
757
- top: 5px;
758
- bottom: 5px;
759
- left: 5px;
760
- background: $--color-primary;
761
- border-radius: 2px;
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
@@ -1,5 +1,5 @@
1
1
  import ElementUI from 'element-ui'
2
- // import './assets/scss/index.scss'
2
+ import './assets/scss/index.scss'
3
3
  import * as components from './components'
4
4
 
5
5
  const install = function (Vue, opts = {}) {