@tagplus/components 0.2.107 → 0.2.108

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.107",
10
+ "version": "0.2.108",
11
11
  "main": "./dist/tp.common.js",
12
12
  "directories": {
13
13
  "lib": "src/lib"
@@ -41,20 +41,20 @@
41
41
  "test:unit": "vue-cli-service test:unit"
42
42
  },
43
43
  "dependencies": {
44
- "axios": "^0.19.0",
45
- "core-js": "^3.4.8",
44
+ "axios": "^0.27.0",
45
+ "core-js": "^3.21.1",
46
46
  "element-theme-chalk": "^2.13",
47
47
  "element-ui": "^2.13",
48
- "js-cookie": "^2.2.1",
49
- "vue": "^2.6.10",
50
- "vue-axios": "^2.1.4",
48
+ "js-cookie": "^3.0.1",
49
+ "vue": "^2.6.14",
50
+ "vue-axios": "^2.1.5",
51
51
  "vue-i18n": "^8.14.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@vue/cli-plugin-babel": "^4.1.1",
55
- "@vue/cli-plugin-eslint": "^4.1.1",
56
- "@vue/cli-plugin-unit-jest": "^4.1.1",
57
- "@vue/cli-service": "^4.1.1",
54
+ "@vue/cli-plugin-babel": "^5.0.3",
55
+ "@vue/cli-plugin-eslint": "^5.0.3",
56
+ "@vue/cli-plugin-unit-jest": "^5.0.3",
57
+ "@vue/cli-service": "^5.0.3",
58
58
  "@vue/eslint-config-prettier": "^6.0.0",
59
59
  "@vue/test-utils": "1.0.0-beta.30",
60
60
  "@vuese/cli": "^2.10.0",
@@ -286,8 +286,10 @@ export default {
286
286
  _id() {
287
287
  return this.id || this.$options.name
288
288
  },
289
- newItem(){
290
- return this.query ? this.$tpI18n.t('autosuggests.cadastrar', {nameItem: this.query}) : this.$tpI18n.t(`autosuggests.newItem.${this.$parent.$options.name}`)
289
+ newItem() {
290
+ return this.query
291
+ ? this.$tpI18n.t('autosuggests.cadastrar', { nameItem: this.query })
292
+ : this.$tpI18n.t(`autosuggests.newItem.${this.$parent.$options.name}`)
291
293
  },
292
294
 
293
295
  /**
@@ -302,7 +304,9 @@ export default {
302
304
  } else if (this.value && typeof this.value === 'object') {
303
305
  if (!this.value[this.valueKey]) {
304
306
  if (process.env.DEBUG === 'true') {
305
- console.error(`Autosuggest '${this.$options.name}' option doesn't have a valueKey '${this.valueKey}' key`)
307
+ console.error(
308
+ `Autosuggest '${this.$options.name}' option doesn't have a valueKey '${this.valueKey}' key`
309
+ )
306
310
  }
307
311
  } else {
308
312
  newVal = this.value[this.valueKey]
@@ -335,6 +339,22 @@ export default {
335
339
  list.push(createdSuggestion)
336
340
  }
337
341
  return list
342
+ },
343
+
344
+ emptyText() {
345
+ if (this.loading) {
346
+ return this.loadingText || this.t('el.select.loading')
347
+ } else {
348
+ if (this.remote && this.query === '' && this.options.length === 0) {
349
+ return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')}
350
+ if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
351
+ return this.noMatchText || this.t('el.select.noMatch')
352
+ }
353
+ if (this.options.length === 0) {
354
+ return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')
355
+ }
356
+ }
357
+ return null
338
358
  }
339
359
  },
340
360
 
@@ -354,7 +374,7 @@ export default {
354
374
  })
355
375
  },
356
376
 
357
- beforeMount () {
377
+ beforeMount() {
358
378
  this.doRequest = false
359
379
 
360
380
  if (this.loadOnCreate) {
@@ -458,7 +478,9 @@ export default {
458
478
  } else if (val && typeof val === 'object') {
459
479
  // Se val for Object converte para outro tipo
460
480
  if (!this.value[this.valueKey]) {
461
- console.error(`Autosuggest '${this.$options.name}' option doesn't have a valueKey '${this.valueKey}' key`)
481
+ console.error(
482
+ `Autosuggest '${this.$options.name}' option doesn't have a valueKey '${this.valueKey}' key`
483
+ )
462
484
  } else {
463
485
  // Se mandou a label no objeto value
464
486
  if (this.value[this.labelKey]) {
@@ -604,18 +626,20 @@ export default {
604
626
 
605
627
  // Correção para habilitar teclado mobile em iOS
606
628
  fixElSelect() {
607
- document.querySelectorAll('.el-select[data-is-search="true"]:hover').forEach(() => {
608
- let elInput = document.querySelector('.el-select[data-is-search="true"]:hover input[readonly]')
609
- if (elInput) {
610
- elInput.readOnly = false
611
- elInput.blur()
612
- elInput.focus()
613
- }
614
- })
629
+ document
630
+ .querySelectorAll('.el-select[data-is-search="true"]:hover')
631
+ .forEach(() => {
632
+ let elInput = document.querySelector(
633
+ '.el-select[data-is-search="true"]:hover input[readonly]'
634
+ )
635
+ if (elInput) {
636
+ elInput.readOnly = false
637
+ elInput.blur()
638
+ elInput.focus()
639
+ }
640
+ })
615
641
  }
616
642
  }
617
-
618
-
619
643
  }
620
644
  </script>
621
645
 
@@ -402,6 +402,22 @@ export default {
402
402
  list.push(createdSuggestion)
403
403
  }
404
404
  return list
405
+ },
406
+
407
+ emptyText() {
408
+ if (this.loading) {
409
+ return this.loadingText || this.t('el.select.loading')
410
+ } else {
411
+ if (this.remote && this.query === '' && this.options.length === 0) {
412
+ return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')}
413
+ if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
414
+ return this.noMatchText || this.t('el.select.noMatch')
415
+ }
416
+ if (this.options.length === 0) {
417
+ return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')
418
+ }
419
+ }
420
+ return null
405
421
  }
406
422
  },
407
423