@apipass/frontend-utils 0.2.16 → 1.0.0

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.
Files changed (43) hide show
  1. package/README.md +33 -33
  2. package/assets/css/buttons.scss +118 -118
  3. package/assets/css/colors.scss +34 -34
  4. package/assets/css/fonts.scss +24 -24
  5. package/assets/css/inputs.scss +197 -197
  6. package/assets/css/pt_sans.scss +143 -143
  7. package/assets/css/spacing.scss +28 -28
  8. package/assets/css/texts.scss +18 -18
  9. package/color-utils.d.ts +5 -5
  10. package/{esm2015/apipass-frontend-utils.js → esm2020/apipass-frontend-utils.mjs} +4 -4
  11. package/{esm2015/color-utils.js → esm2020/color-utils.mjs} +31 -31
  12. package/{esm2015/file.utils.js → esm2020/file.utils.mjs} +11 -11
  13. package/esm2020/form.utils.mjs +44 -0
  14. package/{esm2015/iframe.message.js → esm2020/iframe.message.mjs} +17 -17
  15. package/{esm2015/public-api.js → esm2020/public-api.mjs} +11 -11
  16. package/{esm2015/remove-empty-attributes.js → esm2020/remove-empty-attributes.mjs} +17 -17
  17. package/{esm2015/sass-utils.js → esm2020/sass-utils.mjs} +4 -4
  18. package/{esm2015/sort-utils.js → esm2020/sort-utils.mjs} +8 -8
  19. package/{esm2015/sort.js → esm2020/sort.mjs} +7 -7
  20. package/{esm2015/string-utils.js → esm2020/string-utils.mjs} +5 -5
  21. package/{esm2015/time-utils.js → esm2020/time-utils.mjs} +15 -15
  22. package/fesm2015/{apipass-frontend-utils.js → apipass-frontend-utils.mjs} +145 -145
  23. package/fesm2015/apipass-frontend-utils.mjs.map +1 -0
  24. package/fesm2020/apipass-frontend-utils.mjs +166 -0
  25. package/fesm2020/apipass-frontend-utils.mjs.map +1 -0
  26. package/file.utils.d.ts +1 -1
  27. package/form.utils.d.ts +10 -10
  28. package/iframe.message.d.ts +6 -6
  29. package/{apipass-frontend-utils.d.ts → index.d.ts} +5 -5
  30. package/package.json +33 -21
  31. package/public-api.d.ts +10 -10
  32. package/remove-empty-attributes.d.ts +1 -1
  33. package/sass-utils.d.ts +1 -1
  34. package/sort-utils.d.ts +2 -2
  35. package/sort.d.ts +6 -6
  36. package/string-utils.d.ts +1 -1
  37. package/time-utils.d.ts +1 -1
  38. package/bundles/apipass-frontend-utils.umd.js +0 -535
  39. package/bundles/apipass-frontend-utils.umd.js.map +0 -1
  40. package/bundles/apipass-frontend-utils.umd.min.js +0 -16
  41. package/bundles/apipass-frontend-utils.umd.min.js.map +0 -1
  42. package/esm2015/form.utils.js +0 -51
  43. package/fesm2015/apipass-frontend-utils.js.map +0 -1
@@ -0,0 +1,166 @@
1
+ import { Validators } from '@angular/forms';
2
+ import { isEmptyObject } from 'jquery';
3
+ import * as _ from 'lodash';
4
+ import * as moment from 'moment';
5
+ import tinycolor from 'tinycolor2';
6
+
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);
16
+ }
17
+
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();
59
+ }
60
+
61
+ class IframeMessage {
62
+ static insideIframe() {
63
+ return window !== window.parent;
64
+ }
65
+ static sendMessage(message) {
66
+ if (this.insideIframe()) {
67
+ window.parent.postMessage(message, '*');
68
+ }
69
+ }
70
+ static sendLoadedMessage() {
71
+ this.sendMessage({ loaded: true });
72
+ }
73
+ static sendUnauthorizedMessage() {
74
+ this.sendMessage({ unauthorized: true });
75
+ }
76
+ }
77
+
78
+ function removeEmptyAttributes(obj) {
79
+ if (Array.isArray(obj)) {
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';
92
+ }
93
+
94
+ function getScssVarValue(name) {
95
+ return getComputedStyle(document.body).getPropertyValue(name);
96
+ }
97
+
98
+ class Sort {
99
+ constructor(attributes, directions) {
100
+ this.attributes = attributes;
101
+ this.directions = directions;
102
+ }
103
+ }
104
+
105
+ function orderBy(list, sort) {
106
+ if (!list || !sort || !sort.attributes || !sort.directions) {
107
+ return list;
108
+ }
109
+ return _.orderBy(list, sort.attributes, sort.directions);
110
+ }
111
+
112
+ function getDuration(dateStart, dateEnd) {
113
+ if (!dateStart || !dateEnd) {
114
+ return '--';
115
+ }
116
+ const difTime = moment(dateEnd).diff(moment(dateStart), 'milliseconds');
117
+ if (Number.isNaN(difTime)) {
118
+ return '--';
119
+ }
120
+ if (difTime > 5000) {
121
+ return Math.round(difTime / 1000) + ' sec';
122
+ }
123
+ return difTime + ' ms';
124
+ }
125
+
126
+ function shadeBlendHexColor(hex, percent) {
127
+ return tinycolor(hex).lighten(percent).toString();
128
+ }
129
+ function changePrimaryColor(element, hex) {
130
+ const color = hex;
131
+ changeCssColorVariable(element, '--color-primary', color);
132
+ changeCssColorVariable(element, '--color-primary-hover', shadeBlendHexColor(color, -7));
133
+ changeCssColorVariable(element, '--color-primary-active', shadeBlendHexColor(color, 7));
134
+ }
135
+ function changeSecondaryColor(element, hex) {
136
+ const color = hex;
137
+ changeCssColorVariable(element, '--color-secondary', color);
138
+ changeCssColorVariable(element, '--color-secondary-hover', shadeBlendHexColor(color, -15));
139
+ changeCssColorVariable(element, '--color-secondary-active', shadeBlendHexColor(color, 15));
140
+ }
141
+ function changeTertiaryColor(element, hex) {
142
+ const color = hex;
143
+ changeCssColorVariable(element, '--color-tertiary', color);
144
+ changeCssColorVariable(element, '--color-fonts-tertiary', shadeBlendHexColor(color, -35));
145
+ changeCssColorVariable(element, '--color-tertiary-hover', shadeBlendHexColor(color, -15));
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);
154
+ }
155
+
156
+ function validateEmail(email) {
157
+ 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,}))$/;
158
+ return regularExpression.test(String(email).toLowerCase());
159
+ }
160
+
161
+ /**
162
+ * Generated bundle index. Do not edit.
163
+ */
164
+
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
@@ -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/apipass-frontend-utils.ts"],"sourcesContent":["export function downloadFile(blob: any, filename: string): void {\r\n const url = window.URL.createObjectURL(blob);\r\n const a = document.createElement('a');\r\n a.style.display = 'none';\r\n a.href = url;\r\n a.download = filename;\r\n document.body.appendChild(a);\r\n a.click();\r\n window.URL.revokeObjectURL(url);\r\n}\r\n","import {AbstractControl, FormGroup, Validators} from '@angular/forms';\r\n\r\nexport function markAllFormFieldAsDirty(form: FormGroup): void {\r\n for (const field in form.controls) {\r\n if (form.controls.hasOwnProperty(field)) {\r\n form.controls[field].markAsDirty();\r\n form.controls[field].markAsTouched();\r\n }\r\n }\r\n}\r\n\r\nexport function markAllFormFieldAsPristine(form: FormGroup): void {\r\n for (const field in form.controls) {\r\n if (form.controls.hasOwnProperty(field)) {\r\n form.controls[field].markAsPristine();\r\n form.controls[field].markAsUntouched();\r\n }\r\n }\r\n}\r\n\r\nexport function disableIfEnableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void {\r\n condition ? form?.get(formControlName)?.disable() : form?.get(formControlName)?.enable();\r\n}\r\n\r\nexport function enableIfDisableElseFormControl(form: AbstractControl, formControlName: string, condition: boolean): void {\r\n condition ? form?.get(formControlName)?.enable() : form?.get(formControlName)?.disable();\r\n}\r\n\r\nexport function disableFormControl(form: FormGroup, formControlName: string): void {\r\n form?.get(formControlName)?.disable();\r\n}\r\n\r\nexport function enableFormControl(form: FormGroup, formControlName: string): void {\r\n form?.get(formControlName)?.enable();\r\n}\r\n\r\nexport function habilitarTodosOsCamposDoFormGroup(form: FormGroup): void {\r\n Object.keys(form.controls).forEach((key) => {\r\n form?.get(key)?.enable();\r\n });\r\n}\r\n\r\nexport function desabilitarTodosOsCamposDoFormGroup(form: FormGroup): void {\r\n Object.keys(form.controls).forEach((key) => {\r\n form?.get(key)?.disable();\r\n });\r\n}\r\n\r\nexport function adicionarValidacaoRequiredNoFormControl(form: FormGroup, keyFormControl: string): void {\r\n form?.get(keyFormControl)?.setValidators(Validators.required);\r\n form?.get(keyFormControl)?.updateValueAndValidity();\r\n}\r\n","export class IframeMessage {\r\n\r\n static insideIframe(): boolean {\r\n return window !== window.parent;\r\n }\r\n\r\n static sendMessage(message: any): void {\r\n if (this.insideIframe()) {\r\n window.parent.postMessage(message, '*');\r\n }\r\n }\r\n\r\n static sendLoadedMessage(): void {\r\n this.sendMessage({loaded: true});\r\n }\r\n\r\n static sendUnauthorizedMessage(): void {\r\n this.sendMessage({unauthorized: true});\r\n }\r\n\r\n\r\n\r\n}\r\n","import {isEmptyObject} from 'jquery';\r\n\r\nexport function removeEmptyAttributes(obj: any): any {\r\n if (Array.isArray(obj)) {\r\n return obj\r\n .map(v => (v && isObject(v)) ? removeEmptyAttributes(v) : v)\r\n .filter(v => !(v == null) && !(isEmptyObject(v)));\r\n } else {\r\n return Object.entries(obj)\r\n .map(([k, v]) => [k, v && isObject(v) ? removeEmptyAttributes(v) : v])\r\n .reduce((a: any, [k, v]) => (v == null || isEmptyObject(v) ? a : (a[k] = v, a)), {});\r\n }\r\n}\r\n\r\nfunction isObject(value: any): boolean {\r\n return value !== null && typeof value === 'object';\r\n}\r\n","export function getScssVarValue(name: string): string {\r\n return getComputedStyle(document.body).getPropertyValue(name);\r\n}\r\n","export type Direction = (boolean | 'asc' | 'desc')[];\r\n\r\nexport class Sort {\r\n attributes: string[];\r\n directions: Direction;\r\n\r\n constructor(attributes: string[], directions: Direction) {\r\n this.attributes = attributes;\r\n this.directions = directions;\r\n }\r\n}\r\n","import {Sort} from './sort';\r\nimport * as _ from 'lodash';\r\n\r\nexport function orderBy(list: Array<any>, sort: Sort): Array<any> {\r\n if (!list || !sort || !sort.attributes || !sort.directions) { return list; }\r\n return _.orderBy(list, sort.attributes, sort.directions);\r\n}\r\n","import * as moment from 'moment';\r\n\r\nexport function getDuration(dateStart: Date, dateEnd: Date): string {\r\n if (!dateStart || !dateEnd) { return '--'; }\r\n const difTime = moment(dateEnd).diff(moment(dateStart), 'milliseconds');\r\n if (Number.isNaN(difTime)) { return '--'; }\r\n if (difTime as number > 5000) { return Math.round(difTime / 1000) + ' sec'; }\r\n return difTime + ' ms';\r\n}\r\n","import tinycolor from 'tinycolor2';\r\n\r\nexport function shadeBlendHexColor(hex: string, percent: number): any {\r\n return tinycolor(hex).lighten(percent).toString();\r\n}\r\n\r\nexport function changePrimaryColor(element: string, hex: any): void {\r\n const color = hex;\r\n changeCssColorVariable(element, '--color-primary', color);\r\n changeCssColorVariable(element, '--color-primary-hover', shadeBlendHexColor(color, -7));\r\n changeCssColorVariable(element, '--color-primary-active', shadeBlendHexColor(color, 7));\r\n}\r\n\r\nexport function changeSecondaryColor(element: string, hex: any): void {\r\n const color = hex;\r\n changeCssColorVariable(element, '--color-secondary', color);\r\n changeCssColorVariable(element, '--color-secondary-hover', shadeBlendHexColor(color, -15));\r\n changeCssColorVariable(element, '--color-secondary-active', shadeBlendHexColor(color, 15));\r\n}\r\n\r\nexport function changeTertiaryColor(element: string, hex: any): void {\r\n const color = hex;\r\n changeCssColorVariable(element, '--color-tertiary', color);\r\n changeCssColorVariable(element, '--color-fonts-tertiary', shadeBlendHexColor(color, -35));\r\n changeCssColorVariable(element, '--color-tertiary-hover', shadeBlendHexColor(color, -15));\r\n changeCssColorVariable(element, '--color-tertiary-active', shadeBlendHexColor(color, 15));\r\n}\r\n\r\nexport function changeCssColorVariable(element: string, colorProperty: string, hex: any): void {\r\n if (!element) {\r\n element = ':root';\r\n }\r\n const root: any = document.querySelector(element);\r\n root.style.setProperty(colorProperty, hex);\r\n}\r\n","export function validateEmail(email: string): boolean {\r\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,}))$/;\r\n return regularExpression.test(String(email).toLowerCase());\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAgB,SAAA,YAAY,CAAC,IAAS,EAAE,QAAgB,EAAA;IACtD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACtC,IAAA,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;AACzB,IAAA,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;AACb,IAAA,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACtB,IA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E,kBAAkB,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1F,IAAA,sBAAsB,CAAC,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5F,CAAC;SAEe,sBAAsB,CAAC,OAAe,EAAE,aAAqB,EAAE,GAAQ,EAAA;IACrF,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,OAAO,CAAC;AACnB,KAAA;IACD,MAAM,IAAI,GAAQ,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AAC7C;;AClCM,SAAU,aAAa,CAAC,KAAa,EAAA;IACzC,MAAM,iBAAiB,GAAG,yJAAyJ,CAAC;AACpL,IAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7D;;ACHA;;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;
@@ -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
+ }
@@ -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,39 @@
1
1
  {
2
2
  "name": "@apipass/frontend-utils",
3
- "version": "0.2.16",
3
+ "version": "1.0.0",
4
4
  "peerDependencies": {
5
- "@angular/animations": "^10.0.11",
6
- "@angular/cdk": "^10.1.3",
7
- "@angular/common": "^10.0.11",
8
- "@angular/core": "^10.0.11",
9
- "@angular/forms": "^10.0.11"
5
+ "@angular/animations": "15.0.3",
6
+ "@angular/cdk": "15.0.3",
7
+ "@angular/common": "15.0.3",
8
+ "@angular/core": "15.0.3",
9
+ "@angular/forms": "15.0.3",
10
+ "@angular/material": "15.0.3"
10
11
  },
11
12
  "dependencies": {
12
- "@types/tinycolor2": "^1.4.3",
13
- "tinycolor2": "^1.4.2",
14
- "moment": "^2.29.1",
15
- "tslib": "2.0.0"
13
+ "@types/tinycolor2": "1.4.3",
14
+ "moment": "2.29.4",
15
+ "tinycolor2": "1.6.0",
16
+ "tslib": "2.5.0",
17
+ "jquery": "3.5.1"
16
18
  },
17
- "main": "bundles/apipass-frontend-utils.umd.js",
18
- "module": "fesm2015/apipass-frontend-utils.js",
19
- "es2015": "fesm2015/apipass-frontend-utils.js",
20
- "esm2015": "esm2015/apipass-frontend-utils.js",
21
- "fesm2015": "fesm2015/apipass-frontend-utils.js",
22
- "typings": "apipass-frontend-utils.d.ts",
23
- "sideEffects": false,
24
- "scripts": {
25
- "prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\\nPlease delete and rebuild the package, without compiling with Ivy, before attempting to publish.\\n')\" && exit 1"
26
- }
27
- }
19
+ "module": "fesm2015/apipass-frontend-utils.mjs",
20
+ "es2020": "fesm2020/apipass-frontend-utils.mjs",
21
+ "esm2020": "esm2020/apipass-frontend-utils.mjs",
22
+ "fesm2020": "fesm2020/apipass-frontend-utils.mjs",
23
+ "fesm2015": "fesm2015/apipass-frontend-utils.mjs",
24
+ "typings": "index.d.ts",
25
+ "exports": {
26
+ "./package.json": {
27
+ "default": "./package.json"
28
+ },
29
+ ".": {
30
+ "types": "./index.d.ts",
31
+ "esm2020": "./esm2020/apipass-frontend-utils.mjs",
32
+ "es2020": "./fesm2020/apipass-frontend-utils.mjs",
33
+ "es2015": "./fesm2015/apipass-frontend-utils.mjs",
34
+ "node": "./fesm2015/apipass-frontend-utils.mjs",
35
+ "default": "./fesm2020/apipass-frontend-utils.mjs"
36
+ }
37
+ },
38
+ "sideEffects": false
39
+ }
package/public-api.d.ts CHANGED
@@ -1,10 +1,10 @@
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';
@@ -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 { Sort } from './sort';
2
- export declare function orderBy(list: Array<any>, sort: Sort): Array<any>;
1
+ import { Sort } from './sort';
2
+ export declare function orderBy(list: Array<any>, sort: Sort): Array<any>;
package/sort.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export declare type Direction = (boolean | 'asc' | 'desc')[];
2
- export declare class Sort {
3
- attributes: string[];
4
- directions: Direction;
5
- constructor(attributes: string[], directions: Direction);
6
- }
1
+ export declare type Direction = (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;