jcinfo-utils 1.0.9 → 1.0.11
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/.gitattributes +2 -0
- package/LICENSE +21 -0
- package/index.d.ts +32 -0
- package/package.json +1 -1
- package/update.css +2 -3
- package/update.js +4 -2
package/.gitattributes
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 jcinfoes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function isMobile(): boolean
|
|
2
|
+
|
|
3
|
+
export function isDesktop(): boolean
|
|
4
|
+
|
|
5
|
+
export function isDarkMode(): boolean
|
|
6
|
+
|
|
7
|
+
export function colorGain(hex: string, gain: number): string
|
|
8
|
+
|
|
9
|
+
export function trunc(valor: number, decimais: number): number
|
|
10
|
+
|
|
11
|
+
export function random(max: number): number
|
|
12
|
+
|
|
13
|
+
export function getDateStr(data: Date): string
|
|
14
|
+
|
|
15
|
+
export function getDateTimeStr(data: Date): string
|
|
16
|
+
|
|
17
|
+
export function getFirstDay(data: Date): string
|
|
18
|
+
|
|
19
|
+
export function getLastDay(data: Date): string
|
|
20
|
+
|
|
21
|
+
export function getMonthName(mes: number): string
|
|
22
|
+
|
|
23
|
+
export function calcularIdade(
|
|
24
|
+
dataNascimento: string,
|
|
25
|
+
dataFalecimento: string,
|
|
26
|
+
): string
|
|
27
|
+
|
|
28
|
+
export function formatValor(
|
|
29
|
+
valor: number,
|
|
30
|
+
decimalScale: number,
|
|
31
|
+
money: boolean,
|
|
32
|
+
): string
|
package/package.json
CHANGED
package/update.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
--margin-down: -120px;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
@keyframes
|
|
6
|
+
@keyframes entrada {
|
|
7
7
|
0% {
|
|
8
8
|
opacity: 0;
|
|
9
9
|
bottom: var(--margin-down);
|
|
@@ -35,10 +35,9 @@
|
|
|
35
35
|
width: auto;
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
user-select: none;
|
|
38
|
-
animation:
|
|
38
|
+
animation: entrada 1s both;
|
|
39
39
|
z-index: 9999991;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
.c-update i {
|
|
43
42
|
color: var(--bs-info);
|
|
44
43
|
font-size: 1.3rem;
|
package/update.js
CHANGED
|
@@ -4,7 +4,9 @@ import './update.css'
|
|
|
4
4
|
const cMessagUpdating =
|
|
5
5
|
'<div class="c-line"></div>' +
|
|
6
6
|
'<i class="fas fa-info-circle"></i>' +
|
|
7
|
-
'Nova versão disponível
|
|
7
|
+
//'Nova versão disponível, atualizando...'
|
|
8
|
+
'<div class="c-msg">Nova versão encontrada!' +
|
|
9
|
+
'<span>Baixando atualizações e reiniciando em seguida...</span></div>'
|
|
8
10
|
|
|
9
11
|
let divUpdate = document.querySelector('#update')
|
|
10
12
|
|
|
@@ -14,7 +16,7 @@ if (!divUpdate) {
|
|
|
14
16
|
document.body.appendChild(divUpdate)
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
function showMessage(isTest = false, closeAfterShow = false) {
|
|
18
20
|
divUpdate.innerHTML = cMessagUpdating
|
|
19
21
|
divUpdate.classList.add('c-update')
|
|
20
22
|
console.info('Mostrando msg...')
|