@tagplus/components 4.6.0 → 4.7.1
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/dist/tp.common.js +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.css +11 -11
- package/dist/tp.umd.js +1 -1
- package/dist/tp.umd.js.map +1 -1
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/scss/_helpers.scss +12 -0
- package/src/components/Tip/Tip.vue +35 -25
- package/src/utils/currency.js +4 -10
package/package.json
CHANGED
|
@@ -92,15 +92,27 @@
|
|
|
92
92
|
display: block;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
.flexContent {
|
|
96
|
+
display: flex;
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
.justify-between {
|
|
96
100
|
justify-content: space-between;
|
|
97
101
|
}
|
|
98
102
|
|
|
103
|
+
.justify-content-end {
|
|
104
|
+
justify-content: end;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
.text-helper-info {
|
|
100
108
|
font-size: 13px;
|
|
101
109
|
color: #565b66;
|
|
102
110
|
}
|
|
103
111
|
|
|
112
|
+
.c-pointer {
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
|
|
104
116
|
.no-font-weight {
|
|
105
117
|
font-weight: initial !important;
|
|
106
118
|
}
|
|
@@ -26,33 +26,43 @@
|
|
|
26
26
|
/>
|
|
27
27
|
</el-col>
|
|
28
28
|
</el-row>
|
|
29
|
-
<
|
|
29
|
+
<div
|
|
30
30
|
v-else
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
:class="closed ? 'c-pointer' : ''"
|
|
32
|
+
@click="closed = false"
|
|
33
|
+
>
|
|
34
|
+
<el-row
|
|
35
|
+
:id="`${_id}`"
|
|
36
|
+
type="flex"
|
|
37
|
+
align="middle"
|
|
38
|
+
justify="space-between"
|
|
39
|
+
:class="tptipclasses"
|
|
38
40
|
>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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" @click.stop="closed = !closed" />
|
|
54
|
+
</el-col>
|
|
55
|
+
|
|
56
|
+
<!-- Texto -->
|
|
57
|
+
<el-col :class="'tp-text ' + (closed ? 'tp-vanish' : '' )" :span="24">
|
|
58
|
+
<div
|
|
59
|
+
:id="`${_id}-text`"
|
|
60
|
+
style="margin:15px; margin-left:0px"
|
|
61
|
+
v-html="text"
|
|
62
|
+
/>
|
|
63
|
+
</el-col>
|
|
64
|
+
</el-row>
|
|
65
|
+
</div>
|
|
56
66
|
</template>
|
|
57
67
|
|
|
58
68
|
<script>
|
package/src/utils/currency.js
CHANGED
|
@@ -48,7 +48,7 @@ function formatMoney (input, toString = false, locale = defaults, customPrecisio
|
|
|
48
48
|
const negative = inputString.indexOf('-') >= 0 ? -1 : 1
|
|
49
49
|
|
|
50
50
|
if (toString) {
|
|
51
|
-
input = completeZeros(inputString, locale)
|
|
51
|
+
input = completeZeros(customPrecision, inputString, locale)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const precision = customPrecision || locale.number.precision
|
|
@@ -71,8 +71,8 @@ function formatMoney (input, toString = false, locale = defaults, customPrecisio
|
|
|
71
71
|
return currency * negative
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function completeZeros (input, locale) {
|
|
75
|
-
const precision = locale?.number?.precision || defaults.precision
|
|
74
|
+
function completeZeros (customPrecision, input, locale) {
|
|
75
|
+
const precision = customPrecision || locale?.number?.precision || defaults.precision
|
|
76
76
|
const decimal = locale?.number?.decimal || defaults.decimal
|
|
77
77
|
let i = input.lastIndexOf('.')
|
|
78
78
|
const j = input.lastIndexOf(',')
|
|
@@ -90,12 +90,7 @@ function completeZeros (input, locale) {
|
|
|
90
90
|
return input
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function onlyNumbers (input
|
|
94
|
-
const numbersAfterComma = input.split(/[,.]/)[1]?.length || 0
|
|
95
|
-
// if the numbers after the comma are less than the precision, add zeros
|
|
96
|
-
if (numbersAfterComma < precision) {
|
|
97
|
-
input += '0'.repeat(precision - numbersAfterComma)
|
|
98
|
-
}
|
|
93
|
+
function onlyNumbers (input) {
|
|
99
94
|
return toStr(input).replace(/\D+/g, '') || '0'
|
|
100
95
|
}
|
|
101
96
|
|
|
@@ -111,7 +106,6 @@ function between (min, n, max) {
|
|
|
111
106
|
function numbersToCurrency (numbers, precision) {
|
|
112
107
|
const exp = Math.pow(10, precision)
|
|
113
108
|
const float = parseFloat(numbers) / exp
|
|
114
|
-
console.log('numbersToCurrency -> ', float.toFixed(fixed(precision)))
|
|
115
109
|
return float.toFixed(fixed(precision))
|
|
116
110
|
}
|
|
117
111
|
|