@tagplus/components 4.7.3 → 4.7.6

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.3",
11
+ "version": "4.7.6",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -92,27 +92,15 @@
92
92
  display: block;
93
93
  }
94
94
 
95
- .flexContent {
96
- display: flex;
97
- }
98
-
99
95
  .justify-between {
100
96
  justify-content: space-between;
101
97
  }
102
98
 
103
- .justify-content-end {
104
- justify-content: end;
105
- }
106
-
107
99
  .text-helper-info {
108
100
  font-size: 13px;
109
101
  color: #565b66;
110
102
  }
111
103
 
112
- .c-pointer {
113
- cursor: pointer;
114
- }
115
-
116
104
  .no-font-weight {
117
105
  font-weight: initial !important;
118
106
  }
@@ -26,44 +26,33 @@
26
26
  />
27
27
  </el-col>
28
28
  </el-row>
29
- <div
29
+ <el-row
30
30
  v-else
31
- class="c-pointer"
32
- @click="onClick"
33
- >
34
- <el-row
35
- :id="`${_id}`"
36
- type="flex"
37
- align="middle"
38
- justify="space-between"
39
- :class="tptipclasses"
31
+ :id="`${_id}`"
32
+ type="flex"
33
+ align="middle"
34
+ justify="space-between"
35
+ :class="tptipclasses">
36
+ <el-col
37
+ :span="17"
40
38
  >
41
- <!-- Titulo -->
42
- <el-col
43
- :span="17"
44
- >
45
- <el-row align="middle" type="flex" style="min-width:25px; margin:15px; padding: auto">
46
- <em class="far fa-lightbulb-on" />
47
- <b class="tp-title">{{ title }}</b>
48
- </el-row>
49
- </el-col>
50
-
51
- <!-- Close/Open Btn -->
52
- <el-col :span="3" class="flexContent justify-content-end">
53
- <em :class="closed ? 'fa fa-plus' : 'fa fa-minus'" class="tp-close-button" />
54
- </el-col>
55
-
56
- <!-- Texto -->
57
- <el-col :class="'tp-text ' + (closed ? 'tp-vanish' : '' )" :span="24">
58
- <div
59
- :id="`${_id}-text`"
60
- data-tp-tip-content
61
- style="margin:15px; margin-left:0px"
62
- v-html="text"
63
- />
64
- </el-col>
65
- </el-row>
66
- </div>
39
+ <el-row align="middle" type="flex" style="min-width:25px; margin:15px; padding: auto">
40
+ <em class="far fa-lightbulb-on" />
41
+ <b class="tp-title">{{ title }}</b>
42
+ </el-row>
43
+ </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" />
46
+ </el-col>
47
+
48
+ <el-col :class="'tp-text ' + (closed ? 'tp-vanish' : '' )" :span="24">
49
+ <div
50
+ :id="`${_id}-text`"
51
+ style="margin:15px; margin-left:0px"
52
+ v-html="text"
53
+ />
54
+ </el-col>
55
+ </el-row>
67
56
  </template>
68
57
 
69
58
  <script>
@@ -121,21 +110,6 @@ export default {
121
110
 
122
111
  return classes
123
112
  }
124
- },
125
-
126
- methods: {
127
- onClick (evt) {
128
- // Permite clicar em link sem fechar Tip
129
- const isLink = evt.target?.nodeName === 'A'
130
- // Permite copiar texto sem fechar Tip
131
- const isContent = evt.target?.closest('[data-tp-tip-content]')
132
-
133
- if (isLink || isContent) {
134
- return
135
- }
136
-
137
- this.closed = !this.closed
138
- }
139
113
  }
140
114
  }
141
115
  </script>
@@ -157,10 +131,6 @@ export default {
157
131
  color: #586d93;
158
132
  }
159
133
 
160
- [data-tp-tip-content] {
161
- cursor: initial
162
- }
163
-
164
134
  .info-text {
165
135
  font-size: 12px;
166
136
  font-stretch: normal;
@@ -202,6 +172,7 @@ export default {
202
172
 
203
173
  .tp-close-button {
204
174
  padding: 10px;
175
+ cursor: pointer;
205
176
  }
206
177
 
207
178
  .tp-title {
@@ -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}`)
42
42
 
43
43
  // Impede de digitar . ou , porque o formatador já adiciona
44
44
  if ((inputString.slice(-1).match(/[.,]/))) {
@@ -90,6 +90,12 @@ 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) {
95
+ // Identifica a segunda vírgula ou ponto e remove
96
+ return input.replace(/([.,])([^.,]*?)([.,])/, '$1$2')
97
+ }
98
+
93
99
  function onlyNumbers (input) {
94
100
  return toStr(input).replace(/\D+/g, '') || '0'
95
101
  }