valtech-components 2.0.13 → 2.0.15
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/ng-package.json +9 -0
- package/package.json +6 -14
- package/src/lib/assets/fonts/Khula-Bold.ttf +0 -0
- package/src/lib/assets/fonts/Khula-ExtraBold.ttf +0 -0
- package/src/lib/assets/fonts/Khula-Light.ttf +0 -0
- package/src/lib/assets/fonts/Khula-Regular.ttf +0 -0
- package/src/lib/assets/fonts/Khula-SemiBold.ttf +0 -0
- package/src/lib/assets/fonts/OFL.txt +93 -0
- package/src/lib/components/atoms/button/button.component.scss +5 -0
- package/src/lib/components/atoms/button/button.component.ts +54 -0
- package/src/lib/components/atoms/button/factory.ts +378 -0
- package/src/lib/components/atoms/button/types.ts +24 -0
- package/src/lib/components/types.ts +84 -0
- package/src/lib/services/download.service.ts +58 -0
- package/src/lib/services/lang-provider/components/lang-settings.ts +14 -0
- package/src/lib/services/lang-provider/components/theme-settings.ts +16 -0
- package/src/lib/services/lang-provider/content.ts +15 -0
- package/src/lib/services/lang-provider/lang-provider.service.ts +38 -0
- package/src/lib/services/lang-provider/types.ts +25 -0
- package/src/lib/services/local-storage.service.ts +18 -0
- package/src/lib/services/theme.service.ts +102 -0
- package/{lib/services/types.d.ts → src/lib/services/types.ts} +3 -1
- package/src/lib/shared/constants/storage.ts +2 -0
- package/src/lib/shared/utils/dom.ts +20 -0
- package/{public-api.d.ts → src/public-api.ts} +11 -0
- package/styles/fonts.scss +34 -0
- package/styles/overrides.scss +1 -0
- package/styles/utils.scss +5 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/lib/components/atoms/button/button.component.mjs +0 -69
- package/esm2022/lib/components/atoms/button/factory.mjs +0 -217
- package/esm2022/lib/components/atoms/button/types.mjs +0 -2
- package/esm2022/lib/components/types.mjs +0 -29
- package/esm2022/lib/services/download.service.mjs +0 -63
- package/esm2022/lib/services/lang-provider/components/lang-settings.mjs +0 -13
- package/esm2022/lib/services/lang-provider/components/theme-settings.mjs +0 -15
- package/esm2022/lib/services/lang-provider/content.mjs +0 -8
- package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +0 -39
- package/esm2022/lib/services/lang-provider/types.mjs +0 -14
- package/esm2022/lib/services/local-storage.service.mjs +0 -16
- package/esm2022/lib/services/theme.service.mjs +0 -97
- package/esm2022/lib/services/types.mjs +0 -3
- package/esm2022/lib/shared/constants/storage.mjs +0 -3
- package/esm2022/lib/shared/utils/dom.mjs +0 -17
- package/esm2022/public-api.mjs +0 -18
- package/esm2022/valtech-components.mjs +0 -5
- package/fesm2022/valtech-components.mjs +0 -565
- package/fesm2022/valtech-components.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/atoms/button/button.component.d.ts +0 -20
- package/lib/components/atoms/button/factory.d.ts +0 -71
- package/lib/components/atoms/button/types.d.ts +0 -22
- package/lib/components/types.d.ts +0 -78
- package/lib/services/download.service.d.ts +0 -8
- package/lib/services/lang-provider/components/lang-settings.d.ts +0 -3
- package/lib/services/lang-provider/components/theme-settings.d.ts +0 -3
- package/lib/services/lang-provider/content.d.ts +0 -6
- package/lib/services/lang-provider/lang-provider.service.d.ts +0 -17
- package/lib/services/lang-provider/types.d.ts +0 -15
- package/lib/services/local-storage.service.d.ts +0 -6
- package/lib/services/theme.service.d.ts +0 -27
- package/lib/shared/constants/storage.d.ts +0 -2
- package/lib/shared/utils/dom.d.ts +0 -3
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "@angular/core";
|
|
2
|
-
export const ValtechConfigService = new InjectionToken('ValtechConfig');
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy92YWx0ZWNoLWNvbXBvbmVudHMvc3JjL2xpYi9zZXJ2aWNlcy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBTy9DLE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFHLElBQUksY0FBYyxDQUFnQixlQUFlLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGlvblRva2VuIH0gZnJvbSBcIkBhbmd1bGFyL2NvcmVcIjtcbmltcG9ydCB7IFByb3ZpZGVyIH0gZnJvbSBcIi4vbGFuZy1wcm92aWRlci9jb250ZW50XCI7XG5cbmV4cG9ydCBpbnRlcmZhY2UgVmFsdGVjaENvbmZpZyB7XG4gICAgY29udGVudDogUHJvdmlkZXI7XG59XG5cbmV4cG9ydCBjb25zdCBWYWx0ZWNoQ29uZmlnU2VydmljZSA9IG5ldyBJbmplY3Rpb25Ub2tlbjxWYWx0ZWNoQ29uZmlnPignVmFsdGVjaENvbmZpZycpOyJdfQ==
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export const LANG = 'LANG';
|
|
2
|
-
export const THEME = 'THEME';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3ZhbHRlY2gtY29tcG9uZW50cy9zcmMvbGliL3NoYXJlZC9jb25zdGFudHMvc3RvcmFnZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxJQUFJLEdBQUcsTUFBTSxDQUFDO0FBQzNCLE1BQU0sQ0FBQyxNQUFNLEtBQUssR0FBRyxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgTEFORyA9ICdMQU5HJztcbmV4cG9ydCBjb25zdCBUSEVNRSA9ICdUSEVNRSc7Il19
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const goToTop = (id) => {
|
|
2
|
-
const element = document.getElementById(id);
|
|
3
|
-
if (element) {
|
|
4
|
-
element.scrollIntoView({
|
|
5
|
-
block: 'start',
|
|
6
|
-
inline: 'nearest',
|
|
7
|
-
behavior: 'smooth',
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
export const isAtEnd = (elementRef) => {
|
|
12
|
-
const formElement = elementRef.nativeElement;
|
|
13
|
-
const rect = formElement.getBoundingClientRect();
|
|
14
|
-
const windowHeight = window.innerHeight;
|
|
15
|
-
return rect.bottom <= windowHeight;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGVjaC1jb21wb25lbnRzL3NyYy9saWIvc2hhcmVkL3V0aWxzL2RvbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsQ0FBQyxFQUFVLEVBQVEsRUFBRTtJQUMxQyxNQUFNLE9BQU8sR0FBRyxRQUFRLENBQUMsY0FBYyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQzVDLElBQUksT0FBTyxFQUFFLENBQUM7UUFDWixPQUFPLENBQUMsY0FBYyxDQUFDO1lBQ3JCLEtBQUssRUFBRSxPQUFPO1lBQ2QsTUFBTSxFQUFFLFNBQVM7WUFDakIsUUFBUSxFQUFFLFFBQVE7U0FDbkIsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztBQUNILENBQUMsQ0FBQztBQUdGLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxDQUFDLFVBQXNCLEVBQVcsRUFBRTtJQUN6RCxNQUFNLFdBQVcsR0FBRyxVQUFVLENBQUMsYUFBYSxDQUFDO0lBQzdDLE1BQU0sSUFBSSxHQUFHLFdBQVcsQ0FBQyxxQkFBcUIsRUFBRSxDQUFDO0lBQ2pELE1BQU0sWUFBWSxHQUFHLE1BQU0sQ0FBQyxXQUFXLENBQUM7SUFDeEMsT0FBTyxJQUFJLENBQUMsTUFBTSxJQUFJLFlBQVksQ0FBQztBQUNyQyxDQUFDLENBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBFbGVtZW50UmVmIH0gZnJvbSBcIkBhbmd1bGFyL2NvcmVcIjtcblxuZXhwb3J0IGNvbnN0IGdvVG9Ub3AgPSAoaWQ6IHN0cmluZyk6IHZvaWQgPT4ge1xuICBjb25zdCBlbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoaWQpO1xuICBpZiAoZWxlbWVudCkge1xuICAgIGVsZW1lbnQuc2Nyb2xsSW50b1ZpZXcoe1xuICAgICAgYmxvY2s6ICdzdGFydCcsXG4gICAgICBpbmxpbmU6ICduZWFyZXN0JyxcbiAgICAgIGJlaGF2aW9yOiAnc21vb3RoJyxcbiAgICB9KTtcbiAgfVxufTtcblxuXG5leHBvcnQgY29uc3QgaXNBdEVuZCA9IChlbGVtZW50UmVmOiBFbGVtZW50UmVmKTogYm9vbGVhbiA9PiB7XG4gIGNvbnN0IGZvcm1FbGVtZW50ID0gZWxlbWVudFJlZi5uYXRpdmVFbGVtZW50O1xuICBjb25zdCByZWN0ID0gZm9ybUVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gIGNvbnN0IHdpbmRvd0hlaWdodCA9IHdpbmRvdy5pbm5lckhlaWdodDtcbiAgcmV0dXJuIHJlY3QuYm90dG9tIDw9IHdpbmRvd0hlaWdodDtcbn1cbiJdfQ==
|
package/esm2022/public-api.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of valtech-components
|
|
3
|
-
*/
|
|
4
|
-
/*
|
|
5
|
-
* Public API Surface of valtech-components
|
|
6
|
-
*/
|
|
7
|
-
export * from './lib/components/atoms/button/button.component';
|
|
8
|
-
export * from './lib/components/atoms/button/types';
|
|
9
|
-
export * from './lib/components/atoms/button/factory';
|
|
10
|
-
export * from './lib/services/lang-provider/lang-provider.service';
|
|
11
|
-
export * from './lib/services/lang-provider/types';
|
|
12
|
-
export * from './lib/services/local-storage.service';
|
|
13
|
-
export * from './lib/services/theme.service';
|
|
14
|
-
export * from './lib/services/download.service';
|
|
15
|
-
export * from './lib/services/types';
|
|
16
|
-
export * from './lib/shared/utils/dom';
|
|
17
|
-
export * from './lib/components/types';
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3ZhbHRlY2gtY29tcG9uZW50cy9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVIOztHQUVHO0FBRUgsY0FBYyxnREFBZ0QsQ0FBQztBQUMvRCxjQUFjLHFDQUFxQyxDQUFDO0FBQ3BELGNBQWMsdUNBQXVDLENBQUM7QUFFdEQsY0FBYyxvREFBb0QsQ0FBQztBQUNuRSxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMsc0NBQXNDLENBQUM7QUFDckQsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMsc0JBQXNCLENBQUM7QUFFckMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiB2YWx0ZWNoLWNvbXBvbmVudHNcbiAqL1xuXG4vKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHZhbHRlY2gtY29tcG9uZW50c1xuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbXBvbmVudHMvYXRvbXMvYnV0dG9uL2J1dHRvbi5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29tcG9uZW50cy9hdG9tcy9idXR0b24vdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29tcG9uZW50cy9hdG9tcy9idXR0b24vZmFjdG9yeSc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL2xhbmctcHJvdmlkZXIvbGFuZy1wcm92aWRlci5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL2xhbmctcHJvdmlkZXIvdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvbG9jYWwtc3RvcmFnZS5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL3RoZW1lLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvZG93bmxvYWQuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy90eXBlcyc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3NoYXJlZC91dGlscy9kb20nO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29tcG9uZW50cy90eXBlcyc7XG5cbiJdfQ==
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsdGVjaC1jb21wb25lbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvdmFsdGVjaC1jb21wb25lbnRzL3NyYy92YWx0ZWNoLWNvbXBvbmVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
|
@@ -1,565 +0,0 @@
|
|
|
1
|
-
import * as i2 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, EventEmitter, Component, Input, Output, InjectionToken, Inject } from '@angular/core';
|
|
5
|
-
import { IonButton, IonIcon, IonSpinner, IonText } from '@ionic/angular/standalone';
|
|
6
|
-
import { BehaviorSubject } from 'rxjs';
|
|
7
|
-
|
|
8
|
-
const ENABLED = 'ENABLED';
|
|
9
|
-
const DISABLED = 'DISABLED';
|
|
10
|
-
const WORKING = 'WORKING';
|
|
11
|
-
const ERROR = 'ERROR';
|
|
12
|
-
const ComponentStates = { ENABLED, DISABLED, WORKING, ERROR };
|
|
13
|
-
var ActionType;
|
|
14
|
-
(function (ActionType) {
|
|
15
|
-
ActionType[ActionType["BROWSER_NEW_TAB"] = 0] = "BROWSER_NEW_TAB";
|
|
16
|
-
ActionType[ActionType["BROWSER_DOWNLOAD"] = 1] = "BROWSER_DOWNLOAD";
|
|
17
|
-
ActionType[ActionType["NATIVE_DOWNLOAD"] = 2] = "NATIVE_DOWNLOAD";
|
|
18
|
-
ActionType[ActionType["APP_NAVIGATION"] = 3] = "APP_NAVIGATION";
|
|
19
|
-
ActionType[ActionType["BROWSER_NAVIGATION"] = 4] = "BROWSER_NAVIGATION";
|
|
20
|
-
})(ActionType || (ActionType = {}));
|
|
21
|
-
var InputType;
|
|
22
|
-
(function (InputType) {
|
|
23
|
-
InputType[InputType["TEXT"] = 0] = "TEXT";
|
|
24
|
-
InputType[InputType["EMAIL"] = 1] = "EMAIL";
|
|
25
|
-
InputType[InputType["PASSWORD"] = 2] = "PASSWORD";
|
|
26
|
-
InputType[InputType["COMMENT"] = 3] = "COMMENT";
|
|
27
|
-
InputType[InputType["NUMBER"] = 4] = "NUMBER";
|
|
28
|
-
InputType[InputType["PIN_CODE"] = 5] = "PIN_CODE";
|
|
29
|
-
InputType[InputType["DATE"] = 6] = "DATE";
|
|
30
|
-
InputType[InputType["HOUR"] = 7] = "HOUR";
|
|
31
|
-
InputType[InputType["CHECK"] = 8] = "CHECK";
|
|
32
|
-
InputType[InputType["RADIO"] = 9] = "RADIO";
|
|
33
|
-
InputType[InputType["SELECT"] = 10] = "SELECT";
|
|
34
|
-
InputType[InputType["FILE"] = 11] = "FILE";
|
|
35
|
-
})(InputType || (InputType = {}));
|
|
36
|
-
|
|
37
|
-
class DownloadService {
|
|
38
|
-
getFileNameFromUrl(url) {
|
|
39
|
-
try {
|
|
40
|
-
const pathSegments = url.split('/');
|
|
41
|
-
const lastSegment = pathSegments[pathSegments.length - 1];
|
|
42
|
-
const fileName = decodeURIComponent(lastSegment);
|
|
43
|
-
return fileName;
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.error('Error al obtener nombre de archivo: ', JSON.stringify(error));
|
|
47
|
-
return 'filename';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
openNewTab(url) {
|
|
51
|
-
if (url) {
|
|
52
|
-
const fileName = this.getFileNameFromUrl(url);
|
|
53
|
-
const link = document.createElement('a');
|
|
54
|
-
link.href = url;
|
|
55
|
-
link.download = fileName;
|
|
56
|
-
link.target = '_blank';
|
|
57
|
-
document.body.appendChild(link);
|
|
58
|
-
link.click();
|
|
59
|
-
document.body.removeChild(link);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
console.error('La URL no está definida');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
downloadLinkFromBrowser(url) {
|
|
66
|
-
console.log('trying to download file from url');
|
|
67
|
-
if (url) {
|
|
68
|
-
fetch(url)
|
|
69
|
-
.then((response) => response.blob())
|
|
70
|
-
.then((blob) => {
|
|
71
|
-
const url = window.URL.createObjectURL(blob);
|
|
72
|
-
const link = document.createElement('a');
|
|
73
|
-
link.href = url;
|
|
74
|
-
const fileName = this.getFileNameFromUrl(url);
|
|
75
|
-
link.download = `${+new Date()}-${fileName}`;
|
|
76
|
-
link.target = '_self';
|
|
77
|
-
link.click();
|
|
78
|
-
window.URL.revokeObjectURL(url);
|
|
79
|
-
})
|
|
80
|
-
.catch((error) => {
|
|
81
|
-
console.error('Error al descargar el archivo:', JSON.stringify(error));
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
console.error('La URL no está definida');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DownloadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
89
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DownloadService, providedIn: 'root' }); }
|
|
90
|
-
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DownloadService, decorators: [{
|
|
92
|
-
type: Injectable,
|
|
93
|
-
args: [{
|
|
94
|
-
providedIn: 'root',
|
|
95
|
-
}]
|
|
96
|
-
}] });
|
|
97
|
-
|
|
98
|
-
class ButtonComponent {
|
|
99
|
-
constructor(download) {
|
|
100
|
-
this.download = download;
|
|
101
|
-
this.states = ComponentStates;
|
|
102
|
-
this.onClick = new EventEmitter();
|
|
103
|
-
}
|
|
104
|
-
ngOnInit() { }
|
|
105
|
-
clickHandler() {
|
|
106
|
-
if (this.props.download) {
|
|
107
|
-
this.download.downloadLinkFromBrowser(this.props.download);
|
|
108
|
-
}
|
|
109
|
-
if (this.props.state === this.states.DISABLED) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.onClick.emit(this.props.token);
|
|
113
|
-
}
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, deps: [{ token: DownloadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
115
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ButtonComponent, isStandalone: true, selector: "val-button", inputs: { props: "props" }, outputs: { onClick: "onClick" }, ngImport: i0, template: `
|
|
116
|
-
<ion-button
|
|
117
|
-
[type]="props.type"
|
|
118
|
-
[color]="props.color"
|
|
119
|
-
[expand]="props.expand"
|
|
120
|
-
[fill]="props.fill"
|
|
121
|
-
[size]="props.size"
|
|
122
|
-
[href]="props.href"
|
|
123
|
-
[target]="props.target"
|
|
124
|
-
[shape]="props.shape"
|
|
125
|
-
(click)="clickHandler()"
|
|
126
|
-
[disabled]="props.state === states.DISABLED"
|
|
127
|
-
>
|
|
128
|
-
<ion-icon *ngIf="props.icon" [slot]="props.icon.slot" [name]="props.icon.name"></ion-icon>
|
|
129
|
-
<ion-spinner *ngIf="props.state === states.WORKING" name="circular"></ion-spinner>
|
|
130
|
-
<ion-text *ngIf="props.state !== states.WORKING">{{ props.text }}</ion-text>
|
|
131
|
-
</ion-button>
|
|
132
|
-
`, isInline: true, styles: ["ion-button{font-family:var(--ion-default-font),Arial,sans-serif}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }] }); }
|
|
133
|
-
}
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
135
|
-
type: Component,
|
|
136
|
-
args: [{ selector: 'val-button', standalone: true, imports: [CommonModule, IonButton, IonIcon, IonSpinner, IonText], template: `
|
|
137
|
-
<ion-button
|
|
138
|
-
[type]="props.type"
|
|
139
|
-
[color]="props.color"
|
|
140
|
-
[expand]="props.expand"
|
|
141
|
-
[fill]="props.fill"
|
|
142
|
-
[size]="props.size"
|
|
143
|
-
[href]="props.href"
|
|
144
|
-
[target]="props.target"
|
|
145
|
-
[shape]="props.shape"
|
|
146
|
-
(click)="clickHandler()"
|
|
147
|
-
[disabled]="props.state === states.DISABLED"
|
|
148
|
-
>
|
|
149
|
-
<ion-icon *ngIf="props.icon" [slot]="props.icon.slot" [name]="props.icon.name"></ion-icon>
|
|
150
|
-
<ion-spinner *ngIf="props.state === states.WORKING" name="circular"></ion-spinner>
|
|
151
|
-
<ion-text *ngIf="props.state !== states.WORKING">{{ props.text }}</ion-text>
|
|
152
|
-
</ion-button>
|
|
153
|
-
`, styles: ["ion-button{font-family:var(--ion-default-font),Arial,sans-serif}\n"] }]
|
|
154
|
-
}], ctorParameters: () => [{ type: DownloadService }], propDecorators: { props: [{
|
|
155
|
-
type: Input
|
|
156
|
-
}], onClick: [{
|
|
157
|
-
type: Output
|
|
158
|
-
}] } });
|
|
159
|
-
|
|
160
|
-
const Icon = (name, slot) => {
|
|
161
|
-
return {
|
|
162
|
-
name,
|
|
163
|
-
slot,
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
/* name convention: COLOR FILL SIZE [optionals: SHAPE EXPAND ICON HREF/DOWNLOAD] TYPE */
|
|
167
|
-
const BaseDefault = (text, type) => {
|
|
168
|
-
return {
|
|
169
|
-
color: 'primary',
|
|
170
|
-
state: 'ENABLED',
|
|
171
|
-
text,
|
|
172
|
-
size: 'default',
|
|
173
|
-
type,
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
const ClearDefault = (text, type) => {
|
|
177
|
-
return { ...BaseDefault(text, type), fill: 'clear' };
|
|
178
|
-
};
|
|
179
|
-
const ClearDefaultRound = (text, type) => {
|
|
180
|
-
return { ...ClearDefault(text, type), shape: 'round' };
|
|
181
|
-
};
|
|
182
|
-
const SolidDefault = (text, type) => {
|
|
183
|
-
return { ...BaseDefault(text, type), fill: 'solid' };
|
|
184
|
-
};
|
|
185
|
-
const SolidDefaultRound = (text, type) => {
|
|
186
|
-
return { ...SolidDefault(text, type), shape: 'round' };
|
|
187
|
-
};
|
|
188
|
-
const OutlineDefault = (text, type) => {
|
|
189
|
-
return { ...BaseDefault(text, type), fill: 'outline' };
|
|
190
|
-
};
|
|
191
|
-
const OutlineDefaultRound = (text, type) => {
|
|
192
|
-
return { ...OutlineDefault(text, type), shape: 'round' };
|
|
193
|
-
};
|
|
194
|
-
const ClearDefaultFull = (text, type) => {
|
|
195
|
-
return { ...ClearDefault(text, type), expand: 'full' };
|
|
196
|
-
};
|
|
197
|
-
const ClearDefaultRoundFull = (text, type) => {
|
|
198
|
-
return { ...ClearDefaultRound(text, type), expand: 'full' };
|
|
199
|
-
};
|
|
200
|
-
const ClearDefaultBlock = (text, type) => {
|
|
201
|
-
return { ...ClearDefault(text, type), expand: 'block' };
|
|
202
|
-
};
|
|
203
|
-
const ClearDefaultRoundBlock = (text, type) => {
|
|
204
|
-
return { ...ClearDefaultRound(text, type), expand: 'block' };
|
|
205
|
-
};
|
|
206
|
-
const SolidDefaultFull = (text, type) => {
|
|
207
|
-
return { ...SolidDefault(text, type), expand: 'full' };
|
|
208
|
-
};
|
|
209
|
-
const SolidDefaultRoundFull = (text, type) => {
|
|
210
|
-
return { ...SolidDefaultRound(text, type), expand: 'full' };
|
|
211
|
-
};
|
|
212
|
-
const SolidDefaultBlock = (text, type) => {
|
|
213
|
-
return { ...SolidDefault(text, type), expand: 'block' };
|
|
214
|
-
};
|
|
215
|
-
const SolidDefaultRoundBlock = (text, type) => {
|
|
216
|
-
return { ...SolidDefaultRound(text, type), expand: 'block' };
|
|
217
|
-
};
|
|
218
|
-
const OutlineDefaultFull = (text, type) => {
|
|
219
|
-
return { ...OutlineDefault(text, type), expand: 'full' };
|
|
220
|
-
};
|
|
221
|
-
const OutlineDefaultRoundFull = (text, type) => {
|
|
222
|
-
return { ...OutlineDefaultRound(text, type), expand: 'full' };
|
|
223
|
-
};
|
|
224
|
-
const OutlineDefaultBlock = (text, type) => {
|
|
225
|
-
return { ...OutlineDefault(text, type), expand: 'block' };
|
|
226
|
-
};
|
|
227
|
-
const OutlineDefaultRoundBlock = (text, type) => {
|
|
228
|
-
return { ...OutlineDefaultRound(text, type), expand: 'block' };
|
|
229
|
-
};
|
|
230
|
-
const SolidDefaultButton = (text) => {
|
|
231
|
-
return SolidDefault(text, 'button');
|
|
232
|
-
};
|
|
233
|
-
const SolidSmallButton = (text) => {
|
|
234
|
-
return { ...SolidDefault(text, 'button'), size: 'small' };
|
|
235
|
-
};
|
|
236
|
-
const SolidLargeButton = (text) => {
|
|
237
|
-
return { ...SolidDefault(text, 'button'), size: 'large' };
|
|
238
|
-
};
|
|
239
|
-
const SolidDefaultRoundButton = (text) => {
|
|
240
|
-
return SolidDefaultRound(text, 'button');
|
|
241
|
-
};
|
|
242
|
-
const SolidSmallRoundButton = (text) => {
|
|
243
|
-
return { ...SolidDefaultRound(text, 'button'), size: 'small' };
|
|
244
|
-
};
|
|
245
|
-
const SolidLargeRoundButton = (text) => {
|
|
246
|
-
return { ...SolidDefaultRound(text, 'button'), size: 'large' };
|
|
247
|
-
};
|
|
248
|
-
const SolidFullButton = (text) => {
|
|
249
|
-
return SolidDefaultFull(text, 'button');
|
|
250
|
-
};
|
|
251
|
-
const SolidBlockButton = (text) => {
|
|
252
|
-
return SolidDefaultBlock(text, 'button');
|
|
253
|
-
};
|
|
254
|
-
/** PRIMARY */
|
|
255
|
-
const PrimarySolidDefaultRoundButton = (text) => {
|
|
256
|
-
return { ...SolidDefaultRoundButton(text), color: 'primary' };
|
|
257
|
-
};
|
|
258
|
-
const PrimarySolidDefaultRoundIconButton = (text, icon) => {
|
|
259
|
-
return { ...PrimarySolidDefaultRoundButton(text), icon };
|
|
260
|
-
};
|
|
261
|
-
const PrimarySolidDefaultRoundHrefButton = (text, href, target) => {
|
|
262
|
-
return { ...PrimarySolidDefaultRoundButton(text), href, target };
|
|
263
|
-
};
|
|
264
|
-
const PrimarySolidDefaultRoundIconHrefButton = (text, icon, href, target) => {
|
|
265
|
-
return { ...PrimarySolidDefaultRoundIconButton(text, icon), href, target };
|
|
266
|
-
};
|
|
267
|
-
const PrimarySolidSmallRoundButton = (text) => {
|
|
268
|
-
return { ...SolidSmallRoundButton(text), color: 'primary' };
|
|
269
|
-
};
|
|
270
|
-
const PrimarySolidSmallRoundIconButton = (text, icon) => {
|
|
271
|
-
return { ...PrimarySolidSmallRoundButton(text), icon };
|
|
272
|
-
};
|
|
273
|
-
const PrimarySolidSmallRoundHrefButton = (text, href, target) => {
|
|
274
|
-
return { ...PrimarySolidSmallRoundButton(text), href, target };
|
|
275
|
-
};
|
|
276
|
-
const PrimarySolidSmallRoundIconHrefButton = (text, icon, href, target) => {
|
|
277
|
-
return { ...PrimarySolidSmallRoundIconButton(text, icon), href, target };
|
|
278
|
-
};
|
|
279
|
-
const PrimarySolidLargeRoundButton = (text) => {
|
|
280
|
-
return { ...SolidLargeRoundButton(text), color: 'primary' };
|
|
281
|
-
};
|
|
282
|
-
const PrimarySolidLargeRoundIconButton = (text, icon) => {
|
|
283
|
-
return { ...PrimarySolidLargeRoundButton(text), icon };
|
|
284
|
-
};
|
|
285
|
-
const PrimarySolidLargeRoundHrefButton = (text, href, target) => {
|
|
286
|
-
return { ...PrimarySolidLargeRoundButton(text), href, target };
|
|
287
|
-
};
|
|
288
|
-
const PrimarySolidLargeRoundIconHrefButton = (text, icon, href, target) => {
|
|
289
|
-
return { ...PrimarySolidLargeRoundIconButton(text, icon), href, target };
|
|
290
|
-
};
|
|
291
|
-
const PrimarySolidBlockButton = (text) => {
|
|
292
|
-
return { ...SolidBlockButton(text), color: 'primary' };
|
|
293
|
-
};
|
|
294
|
-
const PrimarySolidBlockIconButton = (text, icon) => {
|
|
295
|
-
return { ...PrimarySolidBlockButton(text), icon };
|
|
296
|
-
};
|
|
297
|
-
const PrimarySolidBlockHrefButton = (text, href, target) => {
|
|
298
|
-
return { ...PrimarySolidBlockButton(text), href, target };
|
|
299
|
-
};
|
|
300
|
-
const PrimarySolidBlockIconHrefButton = (text, icon, href, target) => {
|
|
301
|
-
return { ...PrimarySolidBlockIconButton(text, icon), href, target };
|
|
302
|
-
};
|
|
303
|
-
const PrimarySolidFullButton = (text) => {
|
|
304
|
-
return { ...SolidFullButton(text), color: 'primary' };
|
|
305
|
-
};
|
|
306
|
-
const PrimarySolidFullIconButton = (text, icon) => {
|
|
307
|
-
return { ...PrimarySolidFullButton(text), icon };
|
|
308
|
-
};
|
|
309
|
-
const PrimarySolidFullHrefButton = (text, href, target) => {
|
|
310
|
-
return { ...PrimarySolidFullButton(text), href, target };
|
|
311
|
-
};
|
|
312
|
-
const PrimarySolidFullIconHrefButton = (text, icon, href, target) => {
|
|
313
|
-
return { ...PrimarySolidFullIconButton(text, icon), href, target };
|
|
314
|
-
};
|
|
315
|
-
/** SECONDARY */
|
|
316
|
-
const SecondarySolidDefaultRoundButton = (text) => {
|
|
317
|
-
return { ...SolidDefaultRoundButton(text), color: 'secondary' };
|
|
318
|
-
};
|
|
319
|
-
const SecondarySolidDefaultRoundIconButton = (text, icon) => {
|
|
320
|
-
return { ...SecondarySolidDefaultRoundButton(text), icon };
|
|
321
|
-
};
|
|
322
|
-
const SecondarySolidDefaultRoundHrefButton = (text, href, target) => {
|
|
323
|
-
return { ...SecondarySolidDefaultRoundButton(text), href, target };
|
|
324
|
-
};
|
|
325
|
-
const SecondarySolidDefaultRoundIconHrefButton = (text, icon, href, target) => {
|
|
326
|
-
return { ...SecondarySolidDefaultRoundIconButton(text, icon), href, target };
|
|
327
|
-
};
|
|
328
|
-
const SecondarySolidSmallRoundButton = (text) => {
|
|
329
|
-
return { ...SolidSmallRoundButton(text), color: 'secondary' };
|
|
330
|
-
};
|
|
331
|
-
const SecondarySolidSmallRoundIconButton = (text, icon) => {
|
|
332
|
-
return { ...SecondarySolidSmallRoundButton(text), icon };
|
|
333
|
-
};
|
|
334
|
-
const SecondarySolidSmallRoundHrefButton = (text, href, target) => {
|
|
335
|
-
return { ...SecondarySolidSmallRoundButton(text), href, target };
|
|
336
|
-
};
|
|
337
|
-
const SecondarySolidSmallRoundIconHrefButton = (text, icon, href, target) => {
|
|
338
|
-
return { ...SecondarySolidSmallRoundIconButton(text, icon), href, target };
|
|
339
|
-
};
|
|
340
|
-
const SecondarySolidLargeRoundButton = (text) => {
|
|
341
|
-
return { ...SolidLargeRoundButton(text), color: 'secondary' };
|
|
342
|
-
};
|
|
343
|
-
const SecondarySolidLargeRoundIconButton = (text, icon) => {
|
|
344
|
-
return { ...SecondarySolidLargeRoundButton(text), icon };
|
|
345
|
-
};
|
|
346
|
-
const SecondarySolidLargeRoundHrefButton = (text, href, target) => {
|
|
347
|
-
return { ...SecondarySolidLargeRoundButton(text), href, target };
|
|
348
|
-
};
|
|
349
|
-
const SecondarySolidLargeRoundIconHrefButton = (text, icon, href, target) => {
|
|
350
|
-
return { ...SecondarySolidLargeRoundIconButton(text, icon), href, target };
|
|
351
|
-
};
|
|
352
|
-
const SecondarySolidFullButton = (text) => {
|
|
353
|
-
return { ...SolidFullButton(text), color: 'secondary' };
|
|
354
|
-
};
|
|
355
|
-
const SecondarySolidFullIconButton = (text, icon) => {
|
|
356
|
-
return { ...SecondarySolidFullButton(text), icon };
|
|
357
|
-
};
|
|
358
|
-
const SecondarySolidFullHrefButton = (text, href, target) => {
|
|
359
|
-
return { ...SecondarySolidFullButton(text), href, target };
|
|
360
|
-
};
|
|
361
|
-
const SecondarySolidFullIconHrefButton = (text, icon, href, target) => {
|
|
362
|
-
return { ...SecondarySolidFullIconButton(text, icon), href, target };
|
|
363
|
-
};
|
|
364
|
-
const SecondarySolidBlockButton = (text) => {
|
|
365
|
-
return { ...SolidBlockButton(text), color: 'secondary' };
|
|
366
|
-
};
|
|
367
|
-
const SecondarySolidBlockIconButton = (text, icon) => {
|
|
368
|
-
return { ...SecondarySolidBlockButton(text), icon };
|
|
369
|
-
};
|
|
370
|
-
const SecondarySolidBlockHrefButton = (text, href, target) => {
|
|
371
|
-
return { ...SecondarySolidBlockButton(text), href, target };
|
|
372
|
-
};
|
|
373
|
-
const SecondarySolidBlockIconHrefButton = (text, icon, href, target) => {
|
|
374
|
-
return { ...SecondarySolidBlockIconButton(text, icon), href, target };
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
class TextContent {
|
|
378
|
-
constructor(text) {
|
|
379
|
-
this.text = text;
|
|
380
|
-
}
|
|
381
|
-
get Content() {
|
|
382
|
-
return this.text;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
var LangOption;
|
|
386
|
-
(function (LangOption) {
|
|
387
|
-
LangOption["ES"] = "es";
|
|
388
|
-
LangOption["EN"] = "en";
|
|
389
|
-
})(LangOption || (LangOption = {}));
|
|
390
|
-
|
|
391
|
-
class LocalStorageService {
|
|
392
|
-
static set(reference, value) {
|
|
393
|
-
localStorage.setItem(reference, JSON.stringify(value));
|
|
394
|
-
}
|
|
395
|
-
static get(reference) {
|
|
396
|
-
const value = localStorage.getItem(reference);
|
|
397
|
-
return JSON.parse(value);
|
|
398
|
-
}
|
|
399
|
-
static remove(reference) {
|
|
400
|
-
localStorage.removeItem(reference);
|
|
401
|
-
}
|
|
402
|
-
static clear() {
|
|
403
|
-
localStorage.clear();
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
const LANG = 'LANG';
|
|
408
|
-
const THEME = 'THEME';
|
|
409
|
-
|
|
410
|
-
const ValtechConfigService = new InjectionToken('ValtechConfig');
|
|
411
|
-
|
|
412
|
-
class LangService {
|
|
413
|
-
constructor(config) {
|
|
414
|
-
this.default = LangOption.ES;
|
|
415
|
-
console.log('injected config: ', config);
|
|
416
|
-
this.content = config.content;
|
|
417
|
-
this.config = config;
|
|
418
|
-
const current = LocalStorageService.get(LANG);
|
|
419
|
-
this.selectedLang = new BehaviorSubject(current || this.default);
|
|
420
|
-
}
|
|
421
|
-
Text(className) {
|
|
422
|
-
return this.content[className].Content[this.selectedLang.value];
|
|
423
|
-
}
|
|
424
|
-
get Lang() {
|
|
425
|
-
return this.selectedLang.value;
|
|
426
|
-
}
|
|
427
|
-
set Lang(lang) {
|
|
428
|
-
this.selectedLang.next(lang);
|
|
429
|
-
LocalStorageService.set(LANG, lang);
|
|
430
|
-
}
|
|
431
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LangService, deps: [{ token: ValtechConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
432
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LangService, providedIn: 'root' }); }
|
|
433
|
-
}
|
|
434
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LangService, decorators: [{
|
|
435
|
-
type: Injectable,
|
|
436
|
-
args: [{
|
|
437
|
-
providedIn: 'root',
|
|
438
|
-
}]
|
|
439
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
440
|
-
type: Inject,
|
|
441
|
-
args: [ValtechConfigService]
|
|
442
|
-
}] }] });
|
|
443
|
-
|
|
444
|
-
var ThemeOption;
|
|
445
|
-
(function (ThemeOption) {
|
|
446
|
-
ThemeOption["LIGHT"] = "light";
|
|
447
|
-
ThemeOption["DARK"] = "dark";
|
|
448
|
-
ThemeOption["AUTO"] = "auto";
|
|
449
|
-
})(ThemeOption || (ThemeOption = {}));
|
|
450
|
-
class ThemeService {
|
|
451
|
-
constructor() {
|
|
452
|
-
this.lightToggle = false;
|
|
453
|
-
this.darkToggle = false;
|
|
454
|
-
this.autoToggle = false;
|
|
455
|
-
this.currentOption = ThemeOption.AUTO;
|
|
456
|
-
this.themeOptions = ThemeOption;
|
|
457
|
-
this.prefersDark = false;
|
|
458
|
-
this.default = ThemeOption.AUTO;
|
|
459
|
-
const current = LocalStorageService.get(THEME);
|
|
460
|
-
console.log('💡 ThemeConfig current::: ', current);
|
|
461
|
-
this.theme = new BehaviorSubject(current || this.default);
|
|
462
|
-
this.currentOption = this.Theme;
|
|
463
|
-
console.log('💡 ThemeConfig this.currentOption::: ', this.currentOption);
|
|
464
|
-
this.toggleUserPreference(this.currentOption);
|
|
465
|
-
const prefersDarkQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
466
|
-
this.prefersDark = prefersDarkQuery.matches;
|
|
467
|
-
this.handleAutoConfiguration();
|
|
468
|
-
prefersDarkQuery.addEventListener('change', (mediaQuery) => {
|
|
469
|
-
console.log('💡 ThemeConfig addEventListener change::: ', mediaQuery);
|
|
470
|
-
this.prefersDark = mediaQuery.matches;
|
|
471
|
-
this.handleAutoConfiguration();
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
handleAutoConfiguration() {
|
|
475
|
-
if (this.prefersDark && this.currentOption === ThemeOption.AUTO) {
|
|
476
|
-
console.log('💡 ThemeConfig prefersDark::: ', this.prefersDark);
|
|
477
|
-
this.toggleUserPreference(ThemeOption.AUTO);
|
|
478
|
-
}
|
|
479
|
-
if (!this.prefersDark && this.currentOption === ThemeOption.AUTO) {
|
|
480
|
-
console.log('💡 ThemeConfig prefersDark::: ', this.prefersDark);
|
|
481
|
-
this.toggleUserPreference(ThemeOption.AUTO);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
handleDarkPreference() {
|
|
485
|
-
this.toggleTheme(ThemeOption.DARK, true);
|
|
486
|
-
this.toggleTheme(ThemeOption.LIGHT, false);
|
|
487
|
-
}
|
|
488
|
-
handleLightPreference() {
|
|
489
|
-
this.toggleTheme(ThemeOption.LIGHT, true);
|
|
490
|
-
this.toggleTheme(ThemeOption.DARK, false);
|
|
491
|
-
}
|
|
492
|
-
get Theme() {
|
|
493
|
-
return this.theme.value;
|
|
494
|
-
}
|
|
495
|
-
set Theme(theme) {
|
|
496
|
-
this.theme.next(theme);
|
|
497
|
-
LocalStorageService.set(THEME, theme);
|
|
498
|
-
}
|
|
499
|
-
toggleTheme(name, shouldAdd) {
|
|
500
|
-
console.log('toggleTheme::: ', name, shouldAdd);
|
|
501
|
-
document.body.classList.toggle(name, shouldAdd);
|
|
502
|
-
}
|
|
503
|
-
toggleUserPreference(option) {
|
|
504
|
-
this.currentOption = option;
|
|
505
|
-
this.Theme = option;
|
|
506
|
-
this.lightToggle = option === ThemeOption.LIGHT;
|
|
507
|
-
this.darkToggle = option === ThemeOption.DARK;
|
|
508
|
-
this.autoToggle = option === ThemeOption.AUTO;
|
|
509
|
-
switch (option) {
|
|
510
|
-
case ThemeOption.LIGHT:
|
|
511
|
-
this.handleLightPreference();
|
|
512
|
-
break;
|
|
513
|
-
case ThemeOption.DARK:
|
|
514
|
-
this.handleDarkPreference();
|
|
515
|
-
break;
|
|
516
|
-
case ThemeOption.AUTO:
|
|
517
|
-
if (this.prefersDark) {
|
|
518
|
-
this.handleDarkPreference();
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
this.handleLightPreference();
|
|
522
|
-
}
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
527
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
528
|
-
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeService, decorators: [{
|
|
530
|
-
type: Injectable,
|
|
531
|
-
args: [{
|
|
532
|
-
providedIn: 'root',
|
|
533
|
-
}]
|
|
534
|
-
}], ctorParameters: () => [] });
|
|
535
|
-
|
|
536
|
-
const goToTop = (id) => {
|
|
537
|
-
const element = document.getElementById(id);
|
|
538
|
-
if (element) {
|
|
539
|
-
element.scrollIntoView({
|
|
540
|
-
block: 'start',
|
|
541
|
-
inline: 'nearest',
|
|
542
|
-
behavior: 'smooth',
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
const isAtEnd = (elementRef) => {
|
|
547
|
-
const formElement = elementRef.nativeElement;
|
|
548
|
-
const rect = formElement.getBoundingClientRect();
|
|
549
|
-
const windowHeight = window.innerHeight;
|
|
550
|
-
return rect.bottom <= windowHeight;
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
/*
|
|
554
|
-
* Public API Surface of valtech-components
|
|
555
|
-
*/
|
|
556
|
-
/*
|
|
557
|
-
* Public API Surface of valtech-components
|
|
558
|
-
*/
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Generated bundle index. Do not edit.
|
|
562
|
-
*/
|
|
563
|
-
|
|
564
|
-
export { ActionType, BaseDefault, ButtonComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, ComponentStates, DownloadService, Icon, InputType, LangOption, LangService, LocalStorageService, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, TextContent, ThemeOption, ThemeService, ValtechConfigService, goToTop, isAtEnd };
|
|
565
|
-
//# sourceMappingURL=valtech-components.mjs.map
|