@apipass/frontend-utils 1.0.7 → 1.0.9
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/README.md +33 -33
- package/color-utils.d.ts +5 -5
- package/{esm2020 → esm2022}/apipass-frontend-utils.mjs +4 -4
- package/{esm2020 → esm2022}/color-utils.mjs +31 -31
- package/esm2022/event.emitter.service.mjs +12 -0
- package/{esm2020 → esm2022}/file.utils.mjs +11 -11
- package/{esm2020 → esm2022}/form.utils.mjs +44 -44
- package/{esm2020 → esm2022}/iframe.message.mjs +17 -17
- package/esm2022/language.util.mjs +25 -0
- package/{esm2020 → esm2022}/public-api.mjs +13 -11
- package/{esm2020 → esm2022}/remove-empty-attributes.mjs +17 -17
- package/{esm2020 → esm2022}/sass-utils.mjs +4 -4
- package/{esm2020 → esm2022}/sort-utils.mjs +8 -8
- package/esm2022/sort.mjs +9 -0
- package/{esm2020 → esm2022}/string-utils.mjs +5 -5
- package/{esm2020 → esm2022}/time-utils.mjs +15 -15
- package/event.emitter.service.d.ts +5 -0
- package/{fesm2020 → fesm2022}/apipass-frontend-utils.mjs +175 -138
- package/fesm2022/apipass-frontend-utils.mjs.map +1 -0
- package/file.utils.d.ts +1 -1
- package/form.utils.d.ts +10 -10
- package/iframe.message.d.ts +6 -6
- package/index.d.ts +5 -5
- package/language.util.d.ts +5 -0
- package/package.json +13 -18
- package/public-api.d.ts +12 -10
- package/remove-empty-attributes.d.ts +1 -1
- package/sass-utils.d.ts +1 -1
- package/sort-utils.d.ts +2 -2
- package/sort.d.ts +6 -6
- package/string-utils.d.ts +1 -1
- package/time-utils.d.ts +1 -1
- package/esm2020/sort.mjs +0 -7
- package/fesm2015/apipass-frontend-utils.mjs +0 -174
- package/fesm2015/apipass-frontend-utils.mjs.map +0 -1
- package/fesm2020/apipass-frontend-utils.mjs.map +0 -1
|
@@ -3,165 +3,202 @@ import { isEmptyObject } from 'jquery';
|
|
|
3
3
|
import * as _ from 'lodash';
|
|
4
4
|
import * as moment from 'moment';
|
|
5
5
|
import tinycolor from 'tinycolor2';
|
|
6
|
+
import { registerLocaleData } from '@angular/common';
|
|
7
|
+
import localePt from '@angular/common/locales/pt';
|
|
8
|
+
import localeEn from '@angular/common/locales/en';
|
|
9
|
+
import { EventEmitter } from '@angular/core';
|
|
6
10
|
|
|
7
|
-
function downloadFile(blob, filename) {
|
|
8
|
-
const url = window.URL.createObjectURL(blob);
|
|
9
|
-
const a = document.createElement('a');
|
|
10
|
-
a.style.display = 'none';
|
|
11
|
-
a.href = url;
|
|
12
|
-
a.download = filename;
|
|
13
|
-
document.body.appendChild(a);
|
|
14
|
-
a.click();
|
|
15
|
-
window.URL.revokeObjectURL(url);
|
|
11
|
+
function downloadFile(blob, filename) {
|
|
12
|
+
const url = window.URL.createObjectURL(blob);
|
|
13
|
+
const a = document.createElement('a');
|
|
14
|
+
a.style.display = 'none';
|
|
15
|
+
a.href = url;
|
|
16
|
+
a.download = filename;
|
|
17
|
+
document.body.appendChild(a);
|
|
18
|
+
a.click();
|
|
19
|
+
window.URL.revokeObjectURL(url);
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
function markAllFormFieldAsDirty(form) {
|
|
19
|
-
for (const field in form.controls) {
|
|
20
|
-
if (form.controls.hasOwnProperty(field)) {
|
|
21
|
-
form.controls[field].markAsDirty();
|
|
22
|
-
form.controls[field].markAsTouched();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function markAllFormFieldAsPristine(form) {
|
|
27
|
-
for (const field in form.controls) {
|
|
28
|
-
if (form.controls.hasOwnProperty(field)) {
|
|
29
|
-
form.controls[field].markAsPristine();
|
|
30
|
-
form.controls[field].markAsUntouched();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function disableIfEnableElseFormControl(form, formControlName, condition) {
|
|
35
|
-
condition ? form?.get(formControlName)?.disable() : form?.get(formControlName)?.enable();
|
|
36
|
-
}
|
|
37
|
-
function enableIfDisableElseFormControl(form, formControlName, condition) {
|
|
38
|
-
condition ? form?.get(formControlName)?.enable() : form?.get(formControlName)?.disable();
|
|
39
|
-
}
|
|
40
|
-
function disableFormControl(form, formControlName) {
|
|
41
|
-
form?.get(formControlName)?.disable();
|
|
42
|
-
}
|
|
43
|
-
function enableFormControl(form, formControlName) {
|
|
44
|
-
form?.get(formControlName)?.enable();
|
|
45
|
-
}
|
|
46
|
-
function habilitarTodosOsCamposDoFormGroup(form) {
|
|
47
|
-
Object.keys(form.controls).forEach((key) => {
|
|
48
|
-
form?.get(key)?.enable();
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function desabilitarTodosOsCamposDoFormGroup(form) {
|
|
52
|
-
Object.keys(form.controls).forEach((key) => {
|
|
53
|
-
form?.get(key)?.disable();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function adicionarValidacaoRequiredNoFormControl(form, keyFormControl) {
|
|
57
|
-
form?.get(keyFormControl)?.setValidators(Validators.required);
|
|
58
|
-
form?.get(keyFormControl)?.updateValueAndValidity();
|
|
22
|
+
function markAllFormFieldAsDirty(form) {
|
|
23
|
+
for (const field in form.controls) {
|
|
24
|
+
if (form.controls.hasOwnProperty(field)) {
|
|
25
|
+
form.controls[field].markAsDirty();
|
|
26
|
+
form.controls[field].markAsTouched();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function markAllFormFieldAsPristine(form) {
|
|
31
|
+
for (const field in form.controls) {
|
|
32
|
+
if (form.controls.hasOwnProperty(field)) {
|
|
33
|
+
form.controls[field].markAsPristine();
|
|
34
|
+
form.controls[field].markAsUntouched();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function disableIfEnableElseFormControl(form, formControlName, condition) {
|
|
39
|
+
condition ? form?.get(formControlName)?.disable() : form?.get(formControlName)?.enable();
|
|
40
|
+
}
|
|
41
|
+
function enableIfDisableElseFormControl(form, formControlName, condition) {
|
|
42
|
+
condition ? form?.get(formControlName)?.enable() : form?.get(formControlName)?.disable();
|
|
43
|
+
}
|
|
44
|
+
function disableFormControl(form, formControlName) {
|
|
45
|
+
form?.get(formControlName)?.disable();
|
|
46
|
+
}
|
|
47
|
+
function enableFormControl(form, formControlName) {
|
|
48
|
+
form?.get(formControlName)?.enable();
|
|
49
|
+
}
|
|
50
|
+
function habilitarTodosOsCamposDoFormGroup(form) {
|
|
51
|
+
Object.keys(form.controls).forEach((key) => {
|
|
52
|
+
form?.get(key)?.enable();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function desabilitarTodosOsCamposDoFormGroup(form) {
|
|
56
|
+
Object.keys(form.controls).forEach((key) => {
|
|
57
|
+
form?.get(key)?.disable();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function adicionarValidacaoRequiredNoFormControl(form, keyFormControl) {
|
|
61
|
+
form?.get(keyFormControl)?.setValidators(Validators.required);
|
|
62
|
+
form?.get(keyFormControl)?.updateValueAndValidity();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
class IframeMessage {
|
|
66
|
+
static insideIframe() {
|
|
67
|
+
return window !== window.parent;
|
|
68
|
+
}
|
|
69
|
+
static sendMessage(message) {
|
|
70
|
+
if (this.insideIframe()) {
|
|
71
|
+
window.parent.postMessage(message, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static sendLoadedMessage() {
|
|
75
|
+
this.sendMessage({ loaded: true });
|
|
76
|
+
}
|
|
77
|
+
static sendUnauthorizedMessage() {
|
|
78
|
+
this.sendMessage({ unauthorized: true });
|
|
79
|
+
}
|
|
59
80
|
}
|
|
60
81
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
82
|
+
function removeEmptyAttributes(obj) {
|
|
83
|
+
if (Array.isArray(obj)) {
|
|
84
|
+
return obj
|
|
85
|
+
.map(v => (v && isObject(v)) ? removeEmptyAttributes(v) : v)
|
|
86
|
+
.filter(v => !(v == null) && !(isEmptyObject(v)));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return Object.entries(obj)
|
|
90
|
+
.map(([k, v]) => [k, v && isObject(v) ? removeEmptyAttributes(v) : v])
|
|
91
|
+
.reduce((a, [k, v]) => (v == null || isEmptyObject(v) ? a : (a[k] = v, a)), {});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function isObject(value) {
|
|
95
|
+
return value !== null && typeof value === 'object';
|
|
76
96
|
}
|
|
77
97
|
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
return obj
|
|
81
|
-
.map(v => (v && isObject(v)) ? removeEmptyAttributes(v) : v)
|
|
82
|
-
.filter(v => !(v == null) && !(isEmptyObject(v)));
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
return Object.entries(obj)
|
|
86
|
-
.map(([k, v]) => [k, v && isObject(v) ? removeEmptyAttributes(v) : v])
|
|
87
|
-
.reduce((a, [k, v]) => (v == null || isEmptyObject(v) ? a : (a[k] = v, a)), {});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function isObject(value) {
|
|
91
|
-
return value !== null && typeof value === 'object';
|
|
98
|
+
function getScssVarValue(name) {
|
|
99
|
+
return getComputedStyle(document.body).getPropertyValue(name);
|
|
92
100
|
}
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
class Sort {
|
|
103
|
+
attributes;
|
|
104
|
+
directions;
|
|
105
|
+
constructor(attributes, directions) {
|
|
106
|
+
this.attributes = attributes;
|
|
107
|
+
this.directions = directions;
|
|
108
|
+
}
|
|
96
109
|
}
|
|
97
110
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
function orderBy(list, sort) {
|
|
112
|
+
if (!list || !sort || !sort.attributes || !sort.directions) {
|
|
113
|
+
return list;
|
|
114
|
+
}
|
|
115
|
+
return _.orderBy(list, sort.attributes, sort.directions);
|
|
103
116
|
}
|
|
104
117
|
|
|
105
|
-
function
|
|
106
|
-
if (!
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
|
|
118
|
+
function getDuration(dateStart, dateEnd) {
|
|
119
|
+
if (!dateStart || !dateEnd) {
|
|
120
|
+
return '--';
|
|
121
|
+
}
|
|
122
|
+
const difTime = moment(dateEnd).diff(moment(dateStart), 'milliseconds');
|
|
123
|
+
if (Number.isNaN(difTime)) {
|
|
124
|
+
return '--';
|
|
125
|
+
}
|
|
126
|
+
if (difTime > 5000) {
|
|
127
|
+
return Math.round(difTime / 1000) + ' sec';
|
|
128
|
+
}
|
|
129
|
+
return difTime + ' ms';
|
|
110
130
|
}
|
|
111
131
|
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
132
|
+
function shadeBlendHexColor(hex, percent) {
|
|
133
|
+
return tinycolor(hex).lighten(percent).toString();
|
|
134
|
+
}
|
|
135
|
+
function changePrimaryColor(element, hex) {
|
|
136
|
+
const color = hex;
|
|
137
|
+
changeCssColorVariable(element, '--color-primary', color);
|
|
138
|
+
changeCssColorVariable(element, '--color-primary-hover', shadeBlendHexColor(color, -7));
|
|
139
|
+
changeCssColorVariable(element, '--color-primary-active', shadeBlendHexColor(color, 7));
|
|
140
|
+
}
|
|
141
|
+
function changeSecondaryColor(element, hex) {
|
|
142
|
+
const color = hex;
|
|
143
|
+
changeCssColorVariable(element, '--color-secondary', color);
|
|
144
|
+
changeCssColorVariable(element, '--color-secondary-hover', shadeBlendHexColor(color, -15));
|
|
145
|
+
changeCssColorVariable(element, '--color-secondary-active', shadeBlendHexColor(color, 15));
|
|
146
|
+
}
|
|
147
|
+
function changeTertiaryColor(element, hex) {
|
|
148
|
+
const color = hex;
|
|
149
|
+
changeCssColorVariable(element, '--color-tertiary', color);
|
|
150
|
+
changeCssColorVariable(element, '--color-fonts-tertiary', shadeBlendHexColor(color, -35));
|
|
151
|
+
changeCssColorVariable(element, '--color-tertiary-hover', shadeBlendHexColor(color, -15));
|
|
152
|
+
changeCssColorVariable(element, '--color-tertiary-active', shadeBlendHexColor(color, 15));
|
|
153
|
+
}
|
|
154
|
+
function changeCssColorVariable(element, colorProperty, hex) {
|
|
155
|
+
if (!element) {
|
|
156
|
+
element = ':root';
|
|
157
|
+
}
|
|
158
|
+
const root = document.querySelector(element);
|
|
159
|
+
root.style.setProperty(colorProperty, hex);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function validateEmail(email) {
|
|
163
|
+
const regularExpression = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
164
|
+
return regularExpression.test(String(email).toLowerCase());
|
|
124
165
|
}
|
|
125
166
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
changeCssColorVariable(element, '--color-tertiary-active', shadeBlendHexColor(color, 15));
|
|
147
|
-
}
|
|
148
|
-
function changeCssColorVariable(element, colorProperty, hex) {
|
|
149
|
-
if (!element) {
|
|
150
|
-
element = ':root';
|
|
151
|
-
}
|
|
152
|
-
const root = document.querySelector(element);
|
|
153
|
-
root.style.setProperty(colorProperty, hex);
|
|
167
|
+
class LanguageUtil {
|
|
168
|
+
static getLanguage() {
|
|
169
|
+
const navigatorLanguage = navigator.language;
|
|
170
|
+
if (navigatorLanguage.split('-')[0] === 'pt') {
|
|
171
|
+
return 'pt-BR';
|
|
172
|
+
}
|
|
173
|
+
return 'en-US';
|
|
174
|
+
}
|
|
175
|
+
static registerLanguage(translate) {
|
|
176
|
+
const language = LanguageUtil.getLanguage();
|
|
177
|
+
if (language === 'pt-BR') {
|
|
178
|
+
registerLocaleData(localePt, language);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
registerLocaleData(localeEn, language);
|
|
182
|
+
}
|
|
183
|
+
if (translate) {
|
|
184
|
+
translate.use(language);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
154
187
|
}
|
|
155
188
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
189
|
+
class EventEmitterService {
|
|
190
|
+
static emitters = {};
|
|
191
|
+
static get(eventName) {
|
|
192
|
+
if (!this.emitters[eventName]) {
|
|
193
|
+
this.emitters[eventName] = new EventEmitter();
|
|
194
|
+
}
|
|
195
|
+
return this.emitters[eventName];
|
|
196
|
+
}
|
|
159
197
|
}
|
|
160
198
|
|
|
161
|
-
/**
|
|
162
|
-
* Generated bundle index. Do not edit.
|
|
199
|
+
/**
|
|
200
|
+
* Generated bundle index. Do not edit.
|
|
163
201
|
*/
|
|
164
202
|
|
|
165
|
-
export { IframeMessage, Sort, adicionarValidacaoRequiredNoFormControl, changeCssColorVariable, changePrimaryColor, changeSecondaryColor, changeTertiaryColor, desabilitarTodosOsCamposDoFormGroup, disableFormControl, disableIfEnableElseFormControl, downloadFile, enableFormControl, enableIfDisableElseFormControl, getDuration, getScssVarValue, habilitarTodosOsCamposDoFormGroup, markAllFormFieldAsDirty, markAllFormFieldAsPristine, orderBy, removeEmptyAttributes, shadeBlendHexColor, validateEmail };
|
|
166
|
-
//# sourceMappingURL=apipass-frontend-utils.mjs.map
|
|
203
|
+
export { EventEmitterService, IframeMessage, LanguageUtil, Sort, adicionarValidacaoRequiredNoFormControl, changeCssColorVariable, changePrimaryColor, changeSecondaryColor, changeTertiaryColor, desabilitarTodosOsCamposDoFormGroup, disableFormControl, disableIfEnableElseFormControl, downloadFile, enableFormControl, enableIfDisableElseFormControl, getDuration, getScssVarValue, habilitarTodosOsCamposDoFormGroup, markAllFormFieldAsDirty, markAllFormFieldAsPristine, orderBy, removeEmptyAttributes, shadeBlendHexColor, validateEmail };
|
|
167
204
|
//# sourceMappingURL=apipass-frontend-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apipass-frontend-utils.mjs","sources":["../../../projects/frontend-utils/src/file.utils.ts","../../../projects/frontend-utils/src/form.utils.ts","../../../projects/frontend-utils/src/iframe.message.ts","../../../projects/frontend-utils/src/remove-empty-attributes.ts","../../../projects/frontend-utils/src/sass-utils.ts","../../../projects/frontend-utils/src/sort.ts","../../../projects/frontend-utils/src/sort-utils.ts","../../../projects/frontend-utils/src/time-utils.ts","../../../projects/frontend-utils/src/color-utils.ts","../../../projects/frontend-utils/src/string-utils.ts","../../../projects/frontend-utils/src/language.util.ts","../../../projects/frontend-utils/src/event.emitter.service.ts","../../../projects/frontend-utils/src/apipass-frontend-utils.ts"],"sourcesContent":["export function downloadFile (blob: any, filename: string): void {\n const url = window.URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.style.display = 'none'\n a.href = url\n a.download = filename\n document.body.appendChild(a)\n a.click()\n window.URL.revokeObjectURL(url)\n}\n","import { AbstractControl, FormGroup, Validators } from '@angular/forms'\n\nexport function markAllFormFieldAsDirty (form: FormGroup): void {\n for (const field in form.controls) {\n if (form.controls.hasOwnProperty(field)) {\n form.controls[field].markAsDirty()\n form.controls[field].markAsTouched()\n }\n }\n}\n\nexport function markAllFormFieldAsPristine (form: FormGroup): void {\n for (const field in form.controls) {\n if (form.controls.hasOwnProperty(field)) {\n form.controls[field].markAsPristine()\n form.controls[field].markAsUntouched()\n }\n }\n}\n\nexport function disableIfEnableElseFormControl (form: AbstractControl, formControlName: string, condition: boolean): void {\n condition ? form?.get(formControlName)?.disable() : form?.get(formControlName)?.enable()\n}\n\nexport function enableIfDisableElseFormControl (form: AbstractControl, formControlName: string, condition: boolean): void {\n condition ? form?.get(formControlName)?.enable() : form?.get(formControlName)?.disable()\n}\n\nexport function disableFormControl (form: FormGroup, formControlName: string): void {\n form?.get(formControlName)?.disable()\n}\n\nexport function enableFormControl (form: FormGroup, formControlName: string): void {\n form?.get(formControlName)?.enable()\n}\n\nexport function habilitarTodosOsCamposDoFormGroup (form: FormGroup): void {\n Object.keys(form.controls).forEach((key) => {\n form?.get(key)?.enable()\n })\n}\n\nexport function desabilitarTodosOsCamposDoFormGroup (form: FormGroup): void {\n Object.keys(form.controls).forEach((key) => {\n form?.get(key)?.disable()\n })\n}\n\nexport function adicionarValidacaoRequiredNoFormControl (form: FormGroup, keyFormControl: string): void {\n form?.get(keyFormControl)?.setValidators(Validators.required)\n form?.get(keyFormControl)?.updateValueAndValidity()\n}\n","export class IframeMessage {\n\n static insideIframe (): boolean {\n return window !== window.parent\n }\n\n static sendMessage (message: any): void {\n if (this.insideIframe()) {\n window.parent.postMessage(message, '*')\n }\n }\n\n static sendLoadedMessage (): void {\n this.sendMessage({ loaded: true })\n }\n\n static sendUnauthorizedMessage (): void {\n this.sendMessage({ unauthorized: true })\n }\n\n}\n","import { isEmptyObject } from 'jquery'\n\nexport function removeEmptyAttributes (obj: any): any {\n if (Array.isArray(obj)) {\n return obj\n .map(v => (v && isObject(v)) ? removeEmptyAttributes(v) : v)\n .filter(v => !(v == null) && !(isEmptyObject(v)))\n } else {\n return Object.entries(obj)\n .map(([k, v]) => [k, v && isObject(v) ? removeEmptyAttributes(v) : v])\n .reduce((a: any, [k, v]) => (v == null || isEmptyObject(v) ? a : (a[k] = v, a)), {})\n }\n}\n\nfunction isObject (value: any): boolean {\n return value !== null && typeof value === 'object'\n}\n","export function getScssVarValue (name: string): string {\n return getComputedStyle(document.body).getPropertyValue(name)\n}\n","export type Direction = Array<boolean | 'asc' | 'desc'>\n\nexport class Sort {\n\n attributes: string[]\n directions: Direction\n\n constructor (attributes: string[], directions: Direction) {\n this.attributes = attributes\n this.directions = directions\n }\n\n}\n","import { type Sort } from './sort'\nimport * as _ from 'lodash'\n\nexport function orderBy (list: any[], sort: Sort): any[] {\n if (!list || !sort || !sort.attributes || !sort.directions) { return list }\n return _.orderBy(list, sort.attributes, sort.directions)\n}\n","import * as moment from 'moment'\n\nexport function getDuration (dateStart: Date, dateEnd: Date): string {\n if (!dateStart || !dateEnd) { return '--' }\n const difTime = moment(dateEnd).diff(moment(dateStart), 'milliseconds')\n if (Number.isNaN(difTime)) { return '--' }\n if (difTime > 5000) { return Math.round(difTime / 1000) + ' sec' }\n return difTime + ' ms'\n}\n","import tinycolor from 'tinycolor2'\n\nexport function shadeBlendHexColor (hex: string, percent: number): any {\n return tinycolor(hex).lighten(percent).toString()\n}\n\nexport function changePrimaryColor (element: string, hex: any): void {\n const color = hex\n changeCssColorVariable(element, '--color-primary', color)\n changeCssColorVariable(element, '--color-primary-hover', shadeBlendHexColor(color, -7))\n changeCssColorVariable(element, '--color-primary-active', shadeBlendHexColor(color, 7))\n}\n\nexport function changeSecondaryColor (element: string, hex: any): void {\n const color = hex\n changeCssColorVariable(element, '--color-secondary', color)\n changeCssColorVariable(element, '--color-secondary-hover', shadeBlendHexColor(color, -15))\n changeCssColorVariable(element, '--color-secondary-active', shadeBlendHexColor(color, 15))\n}\n\nexport function changeTertiaryColor (element: string, hex: any): void {\n const color = hex\n changeCssColorVariable(element, '--color-tertiary', color)\n changeCssColorVariable(element, '--color-fonts-tertiary', shadeBlendHexColor(color, -35))\n changeCssColorVariable(element, '--color-tertiary-hover', shadeBlendHexColor(color, -15))\n changeCssColorVariable(element, '--color-tertiary-active', shadeBlendHexColor(color, 15))\n}\n\nexport function changeCssColorVariable (element: string, colorProperty: string, hex: any): void {\n if (!element) {\n element = ':root'\n }\n const root: any = document.querySelector(element)\n root.style.setProperty(colorProperty, hex)\n}\n","export function validateEmail (email: string): boolean {\n const regularExpression = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n return regularExpression.test(String(email).toLowerCase())\n}\n","import { registerLocaleData } from '@angular/common';\nimport localePt from '@angular/common/locales/pt';\nimport localeEn from '@angular/common/locales/en';\nimport { TranslateService } from '@ngx-translate/core';\n\nexport class LanguageUtil {\n\n static getLanguage(): string {\n const navigatorLanguage = navigator.language;\n if (navigatorLanguage.split('-')[0] === 'pt') {\n return 'pt-BR';\n }\n return 'en-US';\n }\n\n static registerLanguage(translate?: TranslateService): void {\n const language = LanguageUtil.getLanguage();\n if (language === 'pt-BR') {\n registerLocaleData(localePt, language);\n } else {\n registerLocaleData(localeEn, language);\n }\n if (translate) {\n translate.use(language);\n }\n }\n\n}\n","import { EventEmitter } from '@angular/core';\n\nexport class EventEmitterService {\n\n private static emitters: Record<string, EventEmitter<any>> = {};\n\n static get(eventName: string): EventEmitter<any> {\n if (!this.emitters[eventName]) {\n this.emitters[eventName] = new EventEmitter<any>();\n }\n return this.emitters[eventName];\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAgB,SAAA,YAAY,CAAE,IAAS,EAAE,QAAgB,EAAA;IACvD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAC5C,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;AACrC,IAAA,CAAC,CAAC,KAAK,CAAC,OAAO,GAA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AkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACxC,SAAA;AAAM,aAAA;AACL,YAAA,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACxC,SAAA;AACD,QAAA,IAAI,SAAS,EAAE;AACb,YAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACzB,SAAA;KACF;AAEF;;ACzBD,MAAa,mBAAmB,CAAA;AAEtB,IAAA,OAAO,QAAQ,GAAsC,EAAE,CAAC;IAEhE,OAAO,GAAG,CAAC,SAAiB,EAAA;AAC1B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAC7B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,YAAY,EAAO,CAAC;AACpD,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;KACjC;;;ACXH;;AAEG;;;;"}
|
package/file.utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function downloadFile(blob: any, filename: string): void;
|
|
1
|
+
export declare function downloadFile(blob: any, filename: string): void;
|
package/form.utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
2
|
-
export declare function markAllFormFieldAsDirty(form: FormGroup): void;
|
|
3
|
-
export declare function markAllFormFieldAsPristine(form: FormGroup): void;
|
|
4
|
-
export declare function disableIfEnableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void;
|
|
5
|
-
export declare function enableIfDisableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void;
|
|
6
|
-
export declare function disableFormControl(form: FormGroup, formControlName: string): void;
|
|
7
|
-
export declare function enableFormControl(form: FormGroup, formControlName: string): void;
|
|
8
|
-
export declare function habilitarTodosOsCamposDoFormGroup(form: FormGroup): void;
|
|
9
|
-
export declare function desabilitarTodosOsCamposDoFormGroup(form: FormGroup): void;
|
|
10
|
-
export declare function adicionarValidacaoRequiredNoFormControl(form: FormGroup, keyFormControl: string): void;
|
|
1
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
2
|
+
export declare function markAllFormFieldAsDirty(form: FormGroup): void;
|
|
3
|
+
export declare function markAllFormFieldAsPristine(form: FormGroup): void;
|
|
4
|
+
export declare function disableIfEnableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void;
|
|
5
|
+
export declare function enableIfDisableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void;
|
|
6
|
+
export declare function disableFormControl(form: FormGroup, formControlName: string): void;
|
|
7
|
+
export declare function enableFormControl(form: FormGroup, formControlName: string): void;
|
|
8
|
+
export declare function habilitarTodosOsCamposDoFormGroup(form: FormGroup): void;
|
|
9
|
+
export declare function desabilitarTodosOsCamposDoFormGroup(form: FormGroup): void;
|
|
10
|
+
export declare function adicionarValidacaoRequiredNoFormControl(form: FormGroup, keyFormControl: string): void;
|
package/iframe.message.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class IframeMessage {
|
|
2
|
-
static insideIframe(): boolean;
|
|
3
|
-
static sendMessage(message: any): void;
|
|
4
|
-
static sendLoadedMessage(): void;
|
|
5
|
-
static sendUnauthorizedMessage(): void;
|
|
6
|
-
}
|
|
1
|
+
export declare class IframeMessage {
|
|
2
|
+
static insideIframe(): boolean;
|
|
3
|
+
static sendMessage(message: any): void;
|
|
4
|
+
static sendLoadedMessage(): void;
|
|
5
|
+
static sendUnauthorizedMessage(): void;
|
|
6
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@apipass/frontend-utils" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@apipass/frontend-utils" />
|
|
5
|
+
export * from './public-api';
|
package/package.json
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/frontend-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "
|
|
6
|
-
"@angular/cdk": "
|
|
7
|
-
"@angular/common": "
|
|
8
|
-
"@angular/core": "
|
|
9
|
-
"@angular/forms": "
|
|
10
|
-
"@angular/material": "
|
|
5
|
+
"@angular/animations": "16.0.2",
|
|
6
|
+
"@angular/cdk": "16.0.1",
|
|
7
|
+
"@angular/common": "16.0.2",
|
|
8
|
+
"@angular/core": "16.0.2",
|
|
9
|
+
"@angular/forms": "16.0.2",
|
|
10
|
+
"@angular/material": "16.0.1"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@ngx-translate/core": "15.0.0",
|
|
13
14
|
"@types/tinycolor2": "1.4.3",
|
|
14
15
|
"moment": "2.29.4",
|
|
15
16
|
"tinycolor2": "1.6.0",
|
|
16
|
-
"tslib": "2.5.
|
|
17
|
+
"tslib": "2.5.2",
|
|
17
18
|
"jquery": "3.5.1",
|
|
18
19
|
"rxjs": "7.8.1"
|
|
19
20
|
},
|
|
20
|
-
"module": "
|
|
21
|
-
"es2020": "fesm2020/apipass-frontend-utils.mjs",
|
|
22
|
-
"esm2020": "esm2020/apipass-frontend-utils.mjs",
|
|
23
|
-
"fesm2020": "fesm2020/apipass-frontend-utils.mjs",
|
|
24
|
-
"fesm2015": "fesm2015/apipass-frontend-utils.mjs",
|
|
21
|
+
"module": "fesm2022/apipass-frontend-utils.mjs",
|
|
25
22
|
"typings": "index.d.ts",
|
|
26
23
|
"exports": {
|
|
27
24
|
"./package.json": {
|
|
@@ -29,11 +26,9 @@
|
|
|
29
26
|
},
|
|
30
27
|
".": {
|
|
31
28
|
"types": "./index.d.ts",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"node": "./fesm2015/apipass-frontend-utils.mjs",
|
|
36
|
-
"default": "./fesm2020/apipass-frontend-utils.mjs"
|
|
29
|
+
"esm2022": "./esm2022/apipass-frontend-utils.mjs",
|
|
30
|
+
"esm": "./esm2022/apipass-frontend-utils.mjs",
|
|
31
|
+
"default": "./fesm2022/apipass-frontend-utils.mjs"
|
|
37
32
|
}
|
|
38
33
|
},
|
|
39
34
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export * from './file.utils';
|
|
2
|
-
export * from './form.utils';
|
|
3
|
-
export * from './iframe.message';
|
|
4
|
-
export * from './remove-empty-attributes';
|
|
5
|
-
export * from './sass-utils';
|
|
6
|
-
export * from './sort';
|
|
7
|
-
export * from './sort-utils';
|
|
8
|
-
export * from './time-utils';
|
|
9
|
-
export * from './color-utils';
|
|
10
|
-
export * from './string-utils';
|
|
1
|
+
export * from './file.utils';
|
|
2
|
+
export * from './form.utils';
|
|
3
|
+
export * from './iframe.message';
|
|
4
|
+
export * from './remove-empty-attributes';
|
|
5
|
+
export * from './sass-utils';
|
|
6
|
+
export * from './sort';
|
|
7
|
+
export * from './sort-utils';
|
|
8
|
+
export * from './time-utils';
|
|
9
|
+
export * from './color-utils';
|
|
10
|
+
export * from './string-utils';
|
|
11
|
+
export * from './language.util';
|
|
12
|
+
export * from './event.emitter.service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function removeEmptyAttributes(obj: any): any;
|
|
1
|
+
export declare function removeEmptyAttributes(obj: any): any;
|
package/sass-utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getScssVarValue(name: string): string;
|
|
1
|
+
export declare function getScssVarValue(name: string): string;
|
package/sort-utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Sort } from './sort';
|
|
2
|
-
export declare function orderBy(list: any[], sort: Sort): any[];
|
|
1
|
+
import { type Sort } from './sort';
|
|
2
|
+
export declare function orderBy(list: any[], sort: Sort): any[];
|
package/sort.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare class Sort {
|
|
3
|
-
attributes: string[];
|
|
4
|
-
directions: Direction;
|
|
5
|
-
constructor(attributes: string[], directions: Direction);
|
|
6
|
-
}
|
|
1
|
+
export type Direction = Array<boolean | 'asc' | 'desc'>;
|
|
2
|
+
export declare class Sort {
|
|
3
|
+
attributes: string[];
|
|
4
|
+
directions: Direction;
|
|
5
|
+
constructor(attributes: string[], directions: Direction);
|
|
6
|
+
}
|
package/string-utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function validateEmail(email: string): boolean;
|
|
1
|
+
export declare function validateEmail(email: string): boolean;
|
package/time-utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDuration(dateStart: Date, dateEnd: Date): string;
|
|
1
|
+
export declare function getDuration(dateStart: Date, dateEnd: Date): string;
|
package/esm2020/sort.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export class Sort {
|
|
2
|
-
constructor(attributes, directions) {
|
|
3
|
-
this.attributes = attributes;
|
|
4
|
-
this.directions = directions;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2Zyb250ZW5kLXV0aWxzL3NyYy9zb3J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sT0FBTyxJQUFJO0lBSWYsWUFBYSxVQUFvQixFQUFFLFVBQXFCO1FBQ3RELElBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxDQUFBO1FBQzVCLElBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxDQUFBO0lBQzlCLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIERpcmVjdGlvbiA9IEFycmF5PGJvb2xlYW4gfCAnYXNjJyB8ICdkZXNjJz5cclxuXHJcbmV4cG9ydCBjbGFzcyBTb3J0IHtcclxuICBhdHRyaWJ1dGVzOiBzdHJpbmdbXVxyXG4gIGRpcmVjdGlvbnM6IERpcmVjdGlvblxyXG5cclxuICBjb25zdHJ1Y3RvciAoYXR0cmlidXRlczogc3RyaW5nW10sIGRpcmVjdGlvbnM6IERpcmVjdGlvbikge1xyXG4gICAgdGhpcy5hdHRyaWJ1dGVzID0gYXR0cmlidXRlc1xyXG4gICAgdGhpcy5kaXJlY3Rpb25zID0gZGlyZWN0aW9uc1xyXG4gIH1cclxufVxyXG4iXX0=
|