@tagplus/components 4.7.10 → 4.7.13

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
@@ -8,7 +8,7 @@
8
8
  "email": "bruno@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "4.7.10",
11
+ "version": "4.7.13",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -81,9 +81,9 @@
81
81
  "husky": "^8.0.1",
82
82
  "jest": "^27.1.0",
83
83
  "lint-staged": "^13.2.2",
84
- "sass": "^1.63.4",
85
84
  "nodemon": "^2.0.19",
86
85
  "prettier": "^2.7.1",
86
+ "sass": "^1.63.4",
87
87
  "sass-loader": "^13.0.2",
88
88
  "vue-template-compiler": "^2.7.10",
89
89
  "webpack": "^5.74.0"
@@ -5,50 +5,50 @@
5
5
  type="flex"
6
6
  align="middle"
7
7
  :class="tptipclasses"
8
+ class="text-black"
8
9
  >
9
- <el-col
10
- :sm="24"
11
- :lg="3"
12
- >
13
- <div style="display: flex; min-width:25px; justify-content: center; margin:15px; padding: auto">
14
- <em class="far fa-lightbulb-on" />
15
- </div>
10
+ <el-col :xs="3" :sm="1" style="align-self: start;">
11
+ <em class="far fa-lightbulb-on" />
16
12
  </el-col>
17
13
 
18
- <el-col
19
- :sm="24"
20
- :lg="21"
21
- >
14
+ <el-col :xs="21" :sm="23">
22
15
  <div
23
16
  :id="`${_id}-text`"
24
- style="margin:15px; margin-left:0px"
25
17
  v-html="text"
26
18
  />
27
19
  </el-col>
28
20
  </el-row>
21
+
29
22
  <el-row
30
23
  v-else
31
24
  :id="`${_id}`"
32
25
  type="flex"
33
26
  align="middle"
34
- justify="space-between"
35
- :class="tptipclasses">
36
- <el-col
37
- :span="17"
38
- >
39
- <el-row align="middle" type="flex" style="min-width:25px; margin:15px; padding: auto">
27
+ justify="center"
28
+ :class="tptipclasses"
29
+ class="text-black"
30
+ >
31
+
32
+ <el-col :xs="3" :sm="1">
33
+ <el-row type="flex" justify="start">
40
34
  <em class="far fa-lightbulb-on" />
41
- <b class="tp-title">{{ title }}</b>
42
35
  </el-row>
43
36
  </el-col>
44
- <el-col :span="3" class="flexContent justify-content-end">
45
- <em class="fa fa-ellipsis-h tp-close-button" @click="closed = !closed" />
37
+
38
+ <el-col :xs="18" :sm="22">
39
+ <b class="tp-title">{{ title }}</b>
40
+ </el-col>
41
+
42
+ <el-col :xs="3" :sm="1">
43
+ <el-row type="flex" justify="end">
44
+ <em v-if="closed" class="fa fa-plus tp-close-button" @click="closed = !closed" />
45
+ <em v-else class="fa fa-minus tp-close-button" @click="closed = !closed" />
46
+ </el-row>
46
47
  </el-col>
47
48
 
48
- <el-col :class="'tp-text ' + (closed ? 'tp-vanish' : '' )" :span="24">
49
+ <el-col :xs="18" :sm="22" :class="'tp-text ' + (closed ? 'tp-vanish' : '' )">
49
50
  <div
50
51
  :id="`${_id}-text`"
51
- style="margin:15px; margin-left:0px"
52
52
  v-html="text"
53
53
  />
54
54
  </el-col>
@@ -171,13 +171,11 @@ export default {
171
171
  }
172
172
 
173
173
  .tp-close-button {
174
- padding: 10px;
175
174
  cursor: pointer;
176
175
  }
177
176
 
178
177
  .tp-title {
179
178
  font-size: 16px;
180
- padding-left: 16px;
181
179
  }
182
180
 
183
181
  .tp-text {
@@ -38,7 +38,7 @@ function unformat (input, precision = defaults.precision) {
38
38
  * @returns
39
39
  */
40
40
  function formatMoney (input, toString = false, locale = defaults, customPrecision = false) {
41
- let inputString = (`${input}`)
41
+ let inputString = removeSecondSeparator(`${input}`, locale)
42
42
 
43
43
  // Impede de digitar . ou , porque o formatador já adiciona
44
44
  if ((inputString.slice(-1).match(/[.,]/))) {
@@ -90,6 +90,32 @@ function completeZeros (customPrecision, input, locale) {
90
90
  return input
91
91
  }
92
92
 
93
+ // Impede que seja adicionado um segundo separadador apos o ponto ou a virgula
94
+ function removeSecondSeparator (input, locale) {
95
+ const decimal = locale?.number?.decimal
96
+
97
+ if (!decimal || !input) {
98
+ return input
99
+ }
100
+
101
+ // Separa a string pelo decimal
102
+ const newInputParts = input.split(decimal)
103
+
104
+ if (newInputParts.length) {
105
+ let newInput = ''
106
+
107
+ // Percorre as partes dividas da string limpando tudo que nao for numerico depois do separador decimal
108
+ for (let i = 0; i < newInputParts.length; i++) {
109
+ newInputParts[i] = i >= 1 ? newInputParts[i].replace(/[^0-9]/g, '') : newInputParts[i] + decimal
110
+ newInput += newInputParts[i]
111
+ }
112
+
113
+ return newInput
114
+ }
115
+
116
+ return input
117
+ }
118
+
93
119
  function onlyNumbers (input) {
94
120
  return toStr(input).replace(/\D+/g, '') || '0'
95
121
  }