@tagplus/components 0.2.110 → 1.0.0

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.
Files changed (47) hide show
  1. package/dist/demo.html +10 -1
  2. package/dist/tp.common.js +1 -9055
  3. package/dist/tp.common.js.map +1 -1
  4. package/dist/tp.css +1 -1
  5. package/dist/tp.umd.js +1 -9082
  6. package/dist/tp.umd.js.map +1 -1
  7. package/dist/tp.umd.min.js +1 -1
  8. package/dist/tp.umd.min.js.map +1 -1
  9. package/package.json +17 -13
  10. package/src/components/Autosuggest/Autosuggest.vue +39 -39
  11. package/src/components/Inline/Inline.vue +9 -10
  12. package/src/components/Inline/index.js +1 -1
  13. package/src/components/InputNumber/InputNumber.vue +3 -3
  14. package/src/components/InputNumber/index.js +1 -1
  15. package/src/components/Loader/Loader.vue +6 -6
  16. package/src/components/Loader/index.js +1 -1
  17. package/src/components/Money/Money.vue +8 -8
  18. package/src/components/Money/index.js +1 -1
  19. package/src/components/Multisuggest/Multisuggest.vue +39 -40
  20. package/src/components/OptionsList/OptionsList.vue +1 -1
  21. package/src/components/OptionsList/index.js +1 -1
  22. package/src/components/OptionsListItem/OptionsListItem.vue +4 -4
  23. package/src/components/OptionsListItem/index.js +1 -1
  24. package/src/components/Percent/Percent.vue +9 -9
  25. package/src/components/Percent/index.js +1 -1
  26. package/src/components/Skeleton/Skeleton.vue +7 -7
  27. package/src/components/Skeleton/index.js +1 -1
  28. package/src/components/Step/Step.vue +20 -20
  29. package/src/components/Step/index.js +1 -1
  30. package/src/components/Steps/Steps.vue +3 -3
  31. package/src/components/Steps/index.js +2 -2
  32. package/src/components/Tip/Tip.vue +19 -15
  33. package/src/components/Tip/index.js +2 -2
  34. package/src/components/index.js +1 -1
  35. package/src/locale/index.js +13 -15
  36. package/src/locale/lang/en.js +3 -3
  37. package/src/locale/lang/pt-br.js +3 -3
  38. package/src/main.js +3 -6
  39. package/src/mixins/locale.js +2 -2
  40. package/src/utils/currency.js +15 -15
  41. package/src/utils/filters.js +8 -10
  42. package/dist/fonts/bevi-bold.7e4dcd11.woff +0 -0
  43. package/dist/fonts/bevi-bold.873def84.woff2 +0 -0
  44. package/dist/fonts/bevi-medium.6187e050.woff2 +0 -0
  45. package/dist/fonts/bevi-medium.65b3056d.woff +0 -0
  46. package/dist/fonts/bevi-regular.c89f126e.woff +0 -0
  47. package/dist/fonts/bevi-regular.f81e4b8f.woff2 +0 -0
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@tagplus/components",
3
3
  "description": "Componentes customizados TagPlus Baseados no ElementUI",
4
+ "target": "web",
4
5
  "maintainers": [
5
6
  {
6
7
  "name": "Bruno Barbosa",
7
8
  "email": "bruno@tagplus.com.br"
8
9
  }
9
10
  ],
10
- "version": "0.2.110",
11
+ "version": "1.0.0",
11
12
  "main": "./dist/tp.common.js",
12
13
  "directories": {
13
14
  "lib": "src/lib"
@@ -44,35 +45,38 @@
44
45
  "axios": "^0.27.0",
45
46
  "core-js": "^3.21.1",
46
47
  "element-theme-chalk": "^2.13",
47
- "element-ui": "^2.13",
48
+ "element-ui": "^2.15.9",
48
49
  "js-cookie": "^3.0.1",
49
50
  "vue": "^2.6.14",
50
51
  "vue-axios": "^2.1.5",
51
52
  "vue-i18n": "^8.14.0"
52
53
  },
53
54
  "devDependencies": {
55
+ "@babel/core": "^7.18.5",
54
56
  "@babel/eslint-parser": "^7.17.0",
55
- "@nuxtjs/eslint-config": "^8.0.0",
56
- "@nuxtjs/eslint-module": "^3.0.2",
57
57
  "@vue/cli-plugin-babel": "^5.0.3",
58
58
  "@vue/cli-plugin-unit-jest": "^5.0.3",
59
59
  "@vue/cli-service": "^5.0.3",
60
- "@vue/test-utils": "1.0.0-beta.30",
60
+ "@vue/test-utils": "^1.0.0-beta.31",
61
61
  "@vuese/cli": "^2.10.0",
62
- "babel-core": "7.0.0-bridge.0",
63
62
  "babel-jest": "^24.9.0",
64
63
  "babel-plugin-module-resolver": "^3.2.0",
64
+ "babel-plugin-require-context-hook": "^1.0.0",
65
65
  "eslint": "^8.9.0",
66
66
  "eslint-config-prettier": "^8.4.0",
67
- "eslint-config-standard": "^16.0.3",
68
- "eslint-plugin-nuxt": ">=0.4.2",
67
+ "eslint-config-standard": "^17.0.0",
68
+ "eslint-import-resolver-babel-module": "^5.3.1",
69
+ "eslint-plugin-import": "^2.25.2",
70
+ "eslint-plugin-n": "^15.0.0",
69
71
  "eslint-plugin-prettier": "^4.0.0",
70
- "node-sass": "^4.9.0",
71
- "nodemon": "^2.0.1",
72
- "prettier": "^1.18.2",
72
+ "eslint-plugin-promise": "^6.0.0",
73
+ "eslint-plugin-vue": "^9.1.1",
74
+ "node-sass": "^4.14.1",
75
+ "nodemon": "^2.0.2",
76
+ "prettier": "^2.5.1",
73
77
  "sass-loader": "^7.1.0",
78
+ "vue": "^2.6.14",
74
79
  "vue-template-compiler": "^2.6.10",
75
- "webpack": "^5.61.0",
76
- "webpack-bundle-analyzer": "^3.5.0"
80
+ "webpack": "4.46.0"
77
81
  }
78
82
  }
@@ -276,17 +276,17 @@ export default {
276
276
  }
277
277
  },
278
278
 
279
- data() {
279
+ data () {
280
280
  return {
281
281
  tooltipVisible: false
282
282
  }
283
283
  },
284
284
 
285
285
  computed: {
286
- _id() {
286
+ _id () {
287
287
  return this.id || this.$options.name
288
288
  },
289
- newItem() {
289
+ newItem () {
290
290
  return this.query
291
291
  ? this.$tpI18n.t('autosuggests.cadastrar', { nameItem: this.query })
292
292
  : this.$tpI18n.t(`autosuggests.newItem.${this.$parent.$options.name}`)
@@ -295,7 +295,7 @@ export default {
295
295
  /**
296
296
  * Trata o caso que o autosuggest recebe um objeto com o valueKey e labelKey
297
297
  */
298
- formatedValue() {
298
+ formatedValue () {
299
299
  let newVal = ''
300
300
  if (typeof this.value === 'boolean') {
301
301
  newVal = ''
@@ -315,25 +315,25 @@ export default {
315
315
 
316
316
  return newVal
317
317
  },
318
- iconClass() {
318
+ iconClass () {
319
319
  return this.visible ? 'arrow-up is-reverse' : 'arrow-up'
320
320
  },
321
- showNewOption() {
322
- let hasExistingOption = this.options
321
+ showNewOption () {
322
+ const hasExistingOption = this.options
323
323
  .filter(option => !option.created)
324
324
  .some(option => option.currentLabel === this.query)
325
325
  return this.filterable && this.allowCreate && !hasExistingOption
326
326
  },
327
327
  // Monta a lista com ou sem "Cadastrar Novo Item"
328
- suggestionsList() {
328
+ suggestionsList () {
329
329
  if (this.loading) return []
330
- //transformando em Array
331
- let list =
330
+ // transformando em Array
331
+ const list =
332
332
  typeof this.suggestions === 'object'
333
333
  ? Object.values(this.suggestions)
334
334
  : this.suggestions
335
335
  if (this.allowCreate) {
336
- let createdSuggestion = { created: true }
336
+ const createdSuggestion = { created: true }
337
337
  createdSuggestion[this.valueKey] = this.query !== '' ? this.query : null
338
338
  createdSuggestion[this.labelKey] = ''
339
339
  list.push(createdSuggestion)
@@ -341,12 +341,13 @@ export default {
341
341
  return list
342
342
  },
343
343
 
344
- emptyText() {
344
+ emptyText () {
345
345
  if (this.loading) {
346
346
  return this.loadingText || this.t('el.select.loading')
347
347
  } else {
348
348
  if (this.remote && this.query === '' && this.options.length === 0) {
349
- return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')}
349
+ return this.noDataText || this.$tpI18n.t('autosuggests.sem_dados')
350
+ }
350
351
  if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
351
352
  return this.noMatchText || this.t('el.select.noMatch')
352
353
  }
@@ -358,7 +359,7 @@ export default {
358
359
  }
359
360
  },
360
361
 
361
- created() {
362
+ created () {
362
363
  this.debouncedOnInputChange = debounce(this.debounce, e => {
363
364
  // Correção para mobile ativar a busca enquanto digita
364
365
  if (e.isComposing) {
@@ -374,7 +375,7 @@ export default {
374
375
  })
375
376
  },
376
377
 
377
- beforeMount() {
378
+ beforeMount () {
378
379
  this.doRequest = false
379
380
 
380
381
  if (this.loadOnCreate) {
@@ -387,10 +388,10 @@ export default {
387
388
  }
388
389
  },
389
390
 
390
- mounted() {
391
+ mounted () {
391
392
  this.$nextTick(() => {
392
393
  // Componente tooltip -> autosuggest -> input
393
- var componenteInputInterno = this.$children[1].$refs['input']
394
+ const componenteInputInterno = this.$children[1].$refs.input
394
395
  // Mostra o tooltip só quando
395
396
  this.createHandler(componenteInputInterno, 'mouseenter', () => {
396
397
  if (this.selectedLabel) {
@@ -406,7 +407,7 @@ export default {
406
407
  })
407
408
  },
408
409
 
409
- beforeDestroy() {
410
+ beforeDestroy () {
410
411
  document.removeEventListener('focusin', this.fixElSelect, false)
411
412
  document.removeEventListener('click', this.fixElSelect, false)
412
413
  document.removeEventListener('touchstart', this.fixElSelect, false)
@@ -419,11 +420,11 @@ export default {
419
420
  * @args ev {String} Nome do listener (mouseenter, click, etc)
420
421
  * @args func {Function} Função a ser executada
421
422
  */
422
- createHandler(el, ev, func) {
423
+ createHandler (el, ev, func) {
423
424
  if (el) {
424
425
  el.addEventListener(
425
426
  ev,
426
- function() {
427
+ function () {
427
428
  func()
428
429
  },
429
430
  false
@@ -431,14 +432,14 @@ export default {
431
432
  }
432
433
  },
433
434
 
434
- onInputChange() {
435
+ onInputChange () {
435
436
  if (this.filterable && this.query !== this.selectedLabel) {
436
437
  this.query = this.selectedLabel
437
438
  this.handleQueryChange(this.query)
438
439
  }
439
440
  },
440
441
 
441
- emitChange(val) {
442
+ emitChange (val) {
442
443
  if (!valueEquals(this.formatedValue, val)) {
443
444
  this.$nextTick(() => {
444
445
  this.$emit('change', val, this.createdSelected)
@@ -447,7 +448,7 @@ export default {
447
448
  },
448
449
 
449
450
  // eslint-disable-next-line no-unused-vars
450
- clearTags(event) {
451
+ clearTags (event) {
451
452
  this.selectedLabel = ''
452
453
  // Faz uma requisição limpa
453
454
  this.query = ''
@@ -467,7 +468,7 @@ export default {
467
468
  /**
468
469
  * Sobrescreve o getOption do select para mostrar o labelValue em vez do idValue
469
470
  */
470
- getOption(val) {
471
+ getOption (val) {
471
472
  let value = ''
472
473
  let initialLabel = false
473
474
 
@@ -514,16 +515,16 @@ export default {
514
515
  }
515
516
  if (option) return option
516
517
  const label = !isObject && !isNull && !isUndefined ? value : ''
517
- let newOption = {
518
- value: value,
519
- currentLabel: initialLabel ? initialLabel : label
518
+ const newOption = {
519
+ value,
520
+ currentLabel: initialLabel || label
520
521
  }
521
522
  if (this.multiple) {
522
523
  newOption.hitState = false
523
524
  }
524
525
  return newOption
525
526
  },
526
- checkDefaultFirstOption() {
527
+ checkDefaultFirstOption () {
527
528
  this.$nextTick(() => {
528
529
  this.hoverIndex = -1
529
530
 
@@ -548,7 +549,7 @@ export default {
548
549
  /**
549
550
  * Sobrescreve a função de abrir menu do select para fazer a busca quando loadOnCreate = false
550
551
  */
551
- toggleMenu() {
552
+ toggleMenu () {
552
553
  if (!this.selectDisabled) {
553
554
  // Se mantem visivel quando clica nele aberto
554
555
  if (this.menuVisibleOnFocus) {
@@ -564,7 +565,7 @@ export default {
564
565
  }
565
566
  },
566
567
 
567
- handleClose() {
568
+ handleClose () {
568
569
  this.visible = false
569
570
  // Limpa busca quando fecha
570
571
  this.doRequest = true
@@ -573,14 +574,13 @@ export default {
573
574
  /**
574
575
  * Sobrescreve função do select
575
576
  */
576
- handleQueryChange(val) {
577
- var _this6 = this
577
+ handleQueryChange (val) {
578
+ const _this6 = this
578
579
  // Correção aqui para forçar primeeira request com createOnLoad = false
579
580
  if (
580
581
  (!this.doRequest && this.previousQuery === val) ||
581
582
  this.isOnComposition
582
- )
583
- return
583
+ ) { return }
584
584
  if (
585
585
  this.previousQuery === null &&
586
586
  (typeof this.filterMethod === 'function' ||
@@ -590,13 +590,13 @@ export default {
590
590
  return
591
591
  }
592
592
  this.previousQuery = val
593
- this.$nextTick(function() {
593
+ this.$nextTick(function () {
594
594
  if (_this6.visible) _this6.broadcast('ElSelectDropdown', 'updatePopper')
595
595
  })
596
596
  this.hoverIndex = -1
597
597
  if (this.multiple && this.filterable) {
598
- this.$nextTick(function() {
599
- var length = _this6.$refs.input.value.length * 15 + 20
598
+ this.$nextTick(function () {
599
+ const length = _this6.$refs.input.value.length * 15 + 20
600
600
  _this6.inputLength = _this6.collapseTags
601
601
  ? Math.min(50, length)
602
602
  : length
@@ -625,11 +625,11 @@ export default {
625
625
  },
626
626
 
627
627
  // Correção para habilitar teclado mobile em iOS
628
- fixElSelect() {
628
+ fixElSelect () {
629
629
  document
630
630
  .querySelectorAll('.el-select[data-is-search="true"]:hover')
631
631
  .forEach(() => {
632
- let elInput = document.querySelector(
632
+ const elInput = document.querySelector(
633
633
  '.el-select[data-is-search="true"]:hover input[readonly]'
634
634
  )
635
635
  if (elInput) {
@@ -73,39 +73,38 @@ export default {
73
73
  }
74
74
  },
75
75
 
76
- data() {
76
+ data () {
77
77
  return {
78
- hideInput: true,
78
+ hideInput: true
79
79
  }
80
80
  },
81
81
 
82
82
  computed: {
83
- _id(){
83
+ _id () {
84
84
  return this.id || this.$options.name
85
85
  }
86
86
  },
87
87
 
88
- mounted() {
88
+ mounted () {
89
89
  this.hideInput = this.inputHidden
90
90
  },
91
91
 
92
92
  methods: {
93
- toggleInput() {
93
+ toggleInput () {
94
94
  const status = !this.hideInput
95
95
 
96
96
  if (this.readonly) {
97
97
  this.hideInput = true
98
- }
99
- else if (!this.readonly) {
98
+ } else if (!this.readonly) {
100
99
  this.hideInput = status
101
100
  if (!this.hideInput) {
102
- this.$nextTick(function() {
101
+ this.$nextTick(function () {
103
102
  this.$refs.inlineInput.focus()
104
103
  })
105
104
  }
106
105
  }
107
106
  },
108
- input(event){
107
+ input (event) {
109
108
  this.$emit('input', event)
110
109
  }
111
110
  }
@@ -137,4 +136,4 @@ export default {
137
136
  }
138
137
  }
139
138
  }
140
- </style>
139
+ </style>
@@ -1,3 +1,3 @@
1
1
  import Inline from './Inline'
2
2
 
3
- export default Inline
3
+ export default Inline
@@ -14,7 +14,7 @@ export default {
14
14
  },
15
15
 
16
16
  computed: {
17
- displayValue() {
17
+ displayValue () {
18
18
  if (this.userInput !== null) {
19
19
  return this.userInput
20
20
  }
@@ -44,12 +44,12 @@ export default {
44
44
  },
45
45
 
46
46
  methods: {
47
- handleInput(value) {
47
+ handleInput (value) {
48
48
  this.userInput = value
49
49
  this.$emit('change', Number(value.replace(',', '.')))
50
50
  },
51
51
 
52
- handleInputChange(value) {
52
+ handleInputChange (value) {
53
53
  let newVal
54
54
  if (value === '') {
55
55
  newVal = 0
@@ -1,3 +1,3 @@
1
1
  import InputNumber from './InputNumber'
2
2
 
3
- export default InputNumber
3
+ export default InputNumber
@@ -2,7 +2,7 @@
2
2
  <div class="tp-loader">
3
3
  <div class="wrapper">
4
4
  <svg xmlns="http://www.w3.org/2000/svg" width="150px" height="150px">
5
- <mask id="mascara">
5
+ <mask id="mascara">
6
6
  <rect x="0" y="0" width="100%" height="100%" fill="white" />
7
7
  <circle id="circulo-interno" class="circulo" cx="45" cy="50" r="40" fill="black" />
8
8
  </mask>
@@ -35,7 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script>
38
- /*
38
+ /*
39
39
  Cria componente de loader com overlayer em toda a página
40
40
  `<tp-loader />`
41
41
  */
@@ -65,7 +65,7 @@ export default {
65
65
  'fad fa-chart-pie-alt'
66
66
  ])
67
67
  }
68
- },
68
+ }
69
69
  }
70
70
  </script>
71
71
 
@@ -166,7 +166,7 @@ export default {
166
166
  }
167
167
  }
168
168
  }
169
-
169
+
170
170
  #bola {
171
171
  .residuo {
172
172
  animation-name: residuo;
@@ -179,7 +179,7 @@ export default {
179
179
  &.top {
180
180
  transform-origin: #{$oCenter} #{$oTop};
181
181
 
182
- &.right {
182
+ &.right {
183
183
  transform-origin: 45% 5%;
184
184
  transform: translate(#{$oTrans}, -#{$oTrans}) scale(0.1);
185
185
  }
@@ -224,4 +224,4 @@ export default {
224
224
 
225
225
  }
226
226
  }
227
- </style>
227
+ </style>
@@ -1,3 +1,3 @@
1
1
  import Loader from './Loader'
2
2
 
3
- export default Loader
3
+ export default Loader
@@ -46,27 +46,27 @@ export default {
46
46
 
47
47
  // remove o simbolo em prepend
48
48
  removePrepend: {
49
- type:Boolean,
49
+ type: Boolean,
50
50
  default: false
51
- },
52
- //valor do campo. Pode ser usado como v-model também
51
+ },
52
+ // valor do campo. Pode ser usado como v-model também
53
53
  value: {
54
54
  type: [Number, String],
55
55
  default: 0
56
56
  },
57
57
 
58
- //tamanho máximo do campo. limitado por padrão a 21 caracteres por limitações do JS
58
+ // tamanho máximo do campo. limitado por padrão a 21 caracteres por limitações do JS
59
59
  maxlength: {
60
60
  type: Number,
61
61
  default: 21
62
- },
62
+ }
63
63
  },
64
-
64
+
65
65
  computed: {
66
- _id(){
66
+ _id () {
67
67
  return this.id || this.$options.name
68
68
  },
69
-
69
+
70
70
  prepend () {
71
71
  return this.t('tp.money.currency')
72
72
  }
@@ -1,3 +1,3 @@
1
1
  import Money from './Money'
2
2
 
3
- export default Money
3
+ export default Money