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.
Files changed (65) hide show
  1. package/ng-package.json +9 -0
  2. package/package.json +6 -14
  3. package/src/lib/assets/fonts/Khula-Bold.ttf +0 -0
  4. package/src/lib/assets/fonts/Khula-ExtraBold.ttf +0 -0
  5. package/src/lib/assets/fonts/Khula-Light.ttf +0 -0
  6. package/src/lib/assets/fonts/Khula-Regular.ttf +0 -0
  7. package/src/lib/assets/fonts/Khula-SemiBold.ttf +0 -0
  8. package/src/lib/assets/fonts/OFL.txt +93 -0
  9. package/src/lib/components/atoms/button/button.component.scss +5 -0
  10. package/src/lib/components/atoms/button/button.component.ts +54 -0
  11. package/src/lib/components/atoms/button/factory.ts +378 -0
  12. package/src/lib/components/atoms/button/types.ts +24 -0
  13. package/src/lib/components/types.ts +84 -0
  14. package/src/lib/services/download.service.ts +58 -0
  15. package/src/lib/services/lang-provider/components/lang-settings.ts +14 -0
  16. package/src/lib/services/lang-provider/components/theme-settings.ts +16 -0
  17. package/src/lib/services/lang-provider/content.ts +15 -0
  18. package/src/lib/services/lang-provider/lang-provider.service.ts +38 -0
  19. package/src/lib/services/lang-provider/types.ts +25 -0
  20. package/src/lib/services/local-storage.service.ts +18 -0
  21. package/src/lib/services/theme.service.ts +102 -0
  22. package/{lib/services/types.d.ts → src/lib/services/types.ts} +3 -1
  23. package/src/lib/shared/constants/storage.ts +2 -0
  24. package/src/lib/shared/utils/dom.ts +20 -0
  25. package/{public-api.d.ts → src/public-api.ts} +11 -0
  26. package/styles/fonts.scss +34 -0
  27. package/styles/overrides.scss +1 -0
  28. package/styles/utils.scss +5 -0
  29. package/tsconfig.lib.json +14 -0
  30. package/tsconfig.lib.prod.json +10 -0
  31. package/tsconfig.spec.json +14 -0
  32. package/esm2022/lib/components/atoms/button/button.component.mjs +0 -69
  33. package/esm2022/lib/components/atoms/button/factory.mjs +0 -217
  34. package/esm2022/lib/components/atoms/button/types.mjs +0 -2
  35. package/esm2022/lib/components/types.mjs +0 -29
  36. package/esm2022/lib/services/download.service.mjs +0 -63
  37. package/esm2022/lib/services/lang-provider/components/lang-settings.mjs +0 -13
  38. package/esm2022/lib/services/lang-provider/components/theme-settings.mjs +0 -15
  39. package/esm2022/lib/services/lang-provider/content.mjs +0 -8
  40. package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +0 -39
  41. package/esm2022/lib/services/lang-provider/types.mjs +0 -14
  42. package/esm2022/lib/services/local-storage.service.mjs +0 -16
  43. package/esm2022/lib/services/theme.service.mjs +0 -97
  44. package/esm2022/lib/services/types.mjs +0 -3
  45. package/esm2022/lib/shared/constants/storage.mjs +0 -3
  46. package/esm2022/lib/shared/utils/dom.mjs +0 -17
  47. package/esm2022/public-api.mjs +0 -18
  48. package/esm2022/valtech-components.mjs +0 -5
  49. package/fesm2022/valtech-components.mjs +0 -565
  50. package/fesm2022/valtech-components.mjs.map +0 -1
  51. package/index.d.ts +0 -5
  52. package/lib/components/atoms/button/button.component.d.ts +0 -20
  53. package/lib/components/atoms/button/factory.d.ts +0 -71
  54. package/lib/components/atoms/button/types.d.ts +0 -22
  55. package/lib/components/types.d.ts +0 -78
  56. package/lib/services/download.service.d.ts +0 -8
  57. package/lib/services/lang-provider/components/lang-settings.d.ts +0 -3
  58. package/lib/services/lang-provider/components/theme-settings.d.ts +0 -3
  59. package/lib/services/lang-provider/content.d.ts +0 -6
  60. package/lib/services/lang-provider/lang-provider.service.d.ts +0 -17
  61. package/lib/services/lang-provider/types.d.ts +0 -15
  62. package/lib/services/local-storage.service.d.ts +0 -6
  63. package/lib/services/theme.service.d.ts +0 -27
  64. package/lib/shared/constants/storage.d.ts +0 -2
  65. package/lib/shared/utils/dom.d.ts +0 -3
@@ -0,0 +1,84 @@
1
+ import { ValidatorFn } from "@angular/forms";
2
+ import { ButtonMetadata } from "./atoms/button/types";
3
+
4
+ export type ComponentState = 'ENABLED' | 'DISABLED' | 'WORKING' | 'ERROR';
5
+ const ENABLED: ComponentState = 'ENABLED';
6
+ const DISABLED: ComponentState = 'DISABLED';
7
+ const WORKING: ComponentState = 'WORKING';
8
+ const ERROR: ComponentState = 'ERROR';
9
+ export const ComponentStates = { ENABLED, DISABLED, WORKING, ERROR };
10
+
11
+ export enum ActionType {
12
+ BROWSER_NEW_TAB,
13
+ BROWSER_DOWNLOAD,
14
+ NATIVE_DOWNLOAD,
15
+ APP_NAVIGATION,
16
+ BROWSER_NAVIGATION,
17
+ }
18
+
19
+ export type Action = {
20
+ description: string;
21
+ type: ActionType;
22
+ source: string;
23
+ };
24
+
25
+ export enum InputType {
26
+ TEXT,
27
+ EMAIL,
28
+ PASSWORD,
29
+ COMMENT,
30
+ NUMBER,
31
+ PIN_CODE,
32
+ DATE,
33
+ HOUR,
34
+ CHECK,
35
+ RADIO,
36
+ SELECT,
37
+ FILE,
38
+ }
39
+
40
+ export type InputOption = {
41
+ id: string;
42
+ name: string;
43
+ selected?: boolean;
44
+ order: number;
45
+ };
46
+
47
+ export type InputMetadata = {
48
+ token: string;
49
+ label: string;
50
+ name: string;
51
+ hint: string;
52
+ placeholder: string;
53
+ type: InputType;
54
+ order: number;
55
+ validators: ValidatorFn[];
56
+ options?: InputOption[];
57
+ range?: {
58
+ min: number;
59
+ max: number;
60
+ };
61
+ errors: {
62
+ [key: string]: string;
63
+ };
64
+ value?: string;
65
+ };
66
+
67
+ export type FormSection = {
68
+ name: string;
69
+ order: number;
70
+ fields: InputMetadata[];
71
+ };
72
+
73
+ export type FormSubmit = {
74
+ fields: { key: string; value: string }[];
75
+ token?: string;
76
+ };
77
+
78
+ export type FormMetadata = {
79
+ name: string;
80
+ sections: FormSection[];
81
+ actions: ButtonMetadata;
82
+ state: ComponentState;
83
+ };
84
+
@@ -0,0 +1,58 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root',
5
+ })
6
+ export class DownloadService {
7
+ getFileNameFromUrl(url: string): string {
8
+ try {
9
+ const pathSegments = url.split('/');
10
+ const lastSegment = pathSegments[pathSegments.length - 1];
11
+ const fileName = decodeURIComponent(lastSegment);
12
+ return fileName;
13
+ } catch (error) {
14
+ console.error('Error al obtener nombre de archivo: ', JSON.stringify(error));
15
+ return 'filename';
16
+ }
17
+ }
18
+
19
+ openNewTab(url: string): void {
20
+ if (url) {
21
+ const fileName = this.getFileNameFromUrl(url);
22
+ const link = document.createElement('a');
23
+ link.href = url;
24
+ link.download = fileName;
25
+ link.target = '_blank';
26
+ document.body.appendChild(link);
27
+ link.click();
28
+ document.body.removeChild(link);
29
+ } else {
30
+ console.error('La URL no está definida');
31
+ }
32
+ }
33
+
34
+ downloadLinkFromBrowser(url: string): void {
35
+ console.log('trying to download file from url');
36
+ if (url) {
37
+ fetch(url)
38
+ .then((response) => response.blob())
39
+ .then((blob) => {
40
+ const url = window.URL.createObjectURL(blob);
41
+ const link = document.createElement('a');
42
+ link.href = url;
43
+
44
+ const fileName = this.getFileNameFromUrl(url);
45
+ link.download = `${+new Date()}-${fileName}`;
46
+ link.target = '_self';
47
+ link.click();
48
+
49
+ window.URL.revokeObjectURL(url);
50
+ })
51
+ .catch((error) => {
52
+ console.error('Error al descargar el archivo:', JSON.stringify(error));
53
+ });
54
+ } else {
55
+ console.error('La URL no está definida');
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,14 @@
1
+ import { LanguagesContent, TextContent } from '../types';
2
+
3
+ const text: LanguagesContent = {
4
+ es: {
5
+ spanish: 'Español',
6
+ english: 'Inglés',
7
+ },
8
+ en: {
9
+ spanish: 'Spanish',
10
+ english: 'English',
11
+ },
12
+ };
13
+
14
+ export default new TextContent(text);
@@ -0,0 +1,16 @@
1
+ import { LanguagesContent, TextContent } from "../types";
2
+
3
+ const text: LanguagesContent = {
4
+ es: {
5
+ light: 'Siempre claro',
6
+ dark: 'Siempre oscuro',
7
+ auto: 'Automático',
8
+ },
9
+ en: {
10
+ light: 'Always light',
11
+ dark: 'Always dark',
12
+ auto: 'System settings',
13
+ },
14
+ };
15
+
16
+ export default new TextContent(text);
@@ -0,0 +1,15 @@
1
+ import LangSettings from './components/lang-settings';
2
+ import ThemeSettings from './components/theme-settings';
3
+ import { TextContent } from './types';
4
+
5
+
6
+ export interface Provider {
7
+ [x: string]: TextContent;
8
+ }
9
+
10
+ const content: Provider = {
11
+ LangSettings,
12
+ ThemeSettings,
13
+ };
14
+
15
+ export default content;
@@ -0,0 +1,38 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { Provider } from './content';
4
+ import { LangOption, LanguageText } from './types';
5
+ import { LocalStorageService } from '../local-storage.service';
6
+ import { LANG } from '../../shared/constants/storage';
7
+ import { ValtechConfig, ValtechConfigService } from '../types';
8
+
9
+ @Injectable({
10
+ providedIn: 'root',
11
+ })
12
+ export class LangService {
13
+ content: Provider;
14
+ default = LangOption.ES;
15
+ selectedLang: BehaviorSubject<LangOption>;
16
+ config: ValtechConfig;
17
+
18
+ constructor(@Inject(ValtechConfigService) config: ValtechConfig) {
19
+ console.log('injected config: ', config);
20
+ this.content = config.content;
21
+ this.config = config;
22
+ const current = LocalStorageService.get<LangOption>(LANG);
23
+ this.selectedLang = new BehaviorSubject<LangOption>(current || this.default);
24
+ }
25
+
26
+ Text(className: string): LanguageText {
27
+ return this.content[className].Content[this.selectedLang.value];
28
+ }
29
+
30
+ get Lang(): LangOption {
31
+ return this.selectedLang.value;
32
+ }
33
+
34
+ set Lang(lang: LangOption) {
35
+ this.selectedLang.next(lang);
36
+ LocalStorageService.set<LangOption>(LANG, lang);
37
+ }
38
+ }
@@ -0,0 +1,25 @@
1
+ import { Provider } from "./content";
2
+
3
+ export type LanguageText = {
4
+ [key: string]: string;
5
+ };
6
+
7
+ export type LanguagesContent = {
8
+ [key: string]: LanguageText;
9
+ };
10
+
11
+ export class TextContent {
12
+ text: LanguagesContent;
13
+ constructor(text: LanguagesContent) {
14
+ this.text = text;
15
+ }
16
+
17
+ get Content(): LanguagesContent {
18
+ return this.text;
19
+ }
20
+ }
21
+
22
+ export enum LangOption {
23
+ ES = 'es',
24
+ EN = 'en',
25
+ }
@@ -0,0 +1,18 @@
1
+ export class LocalStorageService {
2
+ static set<T>(reference: string, value: T): void {
3
+ localStorage.setItem(reference, JSON.stringify(value));
4
+ }
5
+
6
+ static get<T>(reference: string): T {
7
+ const value = localStorage.getItem(reference);
8
+ return JSON.parse(value) as T;
9
+ }
10
+
11
+ static remove(reference: string): void {
12
+ localStorage.removeItem(reference);
13
+ }
14
+
15
+ static clear() {
16
+ localStorage.clear();
17
+ }
18
+ }
@@ -0,0 +1,102 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { LocalStorageService } from './local-storage.service';
4
+ import { THEME } from '../shared/constants/storage';
5
+
6
+ export enum ThemeOption {
7
+ LIGHT = 'light',
8
+ DARK = 'dark',
9
+ AUTO = 'auto',
10
+ }
11
+
12
+ @Injectable({
13
+ providedIn: 'root',
14
+ })
15
+ export class ThemeService {
16
+ lightToggle = false;
17
+ darkToggle = false;
18
+ autoToggle = false;
19
+ currentOption = ThemeOption.AUTO;
20
+ themeOptions = ThemeOption;
21
+ prefersDark = false;
22
+ default = ThemeOption.AUTO;
23
+ theme: BehaviorSubject<ThemeOption>;
24
+
25
+ constructor() {
26
+ const current = LocalStorageService.get<ThemeOption>(THEME);
27
+ console.log('💡 ThemeConfig current::: ', current);
28
+ this.theme = new BehaviorSubject<ThemeOption>(current || this.default);
29
+ this.currentOption = this.Theme;
30
+ console.log('💡 ThemeConfig this.currentOption::: ', this.currentOption);
31
+ this.toggleUserPreference(this.currentOption);
32
+
33
+ const prefersDarkQuery = window.matchMedia('(prefers-color-scheme: dark)');
34
+ this.prefersDark = prefersDarkQuery.matches;
35
+ this.handleAutoConfiguration();
36
+
37
+ prefersDarkQuery.addEventListener('change', (mediaQuery) => {
38
+ console.log('💡 ThemeConfig addEventListener change::: ', mediaQuery);
39
+ this.prefersDark = mediaQuery.matches;
40
+ this.handleAutoConfiguration();
41
+ });
42
+ }
43
+
44
+ private handleAutoConfiguration() {
45
+ if (this.prefersDark && this.currentOption === ThemeOption.AUTO) {
46
+ console.log('💡 ThemeConfig prefersDark::: ', this.prefersDark);
47
+ this.toggleUserPreference(ThemeOption.AUTO);
48
+ }
49
+ if (!this.prefersDark && this.currentOption === ThemeOption.AUTO) {
50
+ console.log('💡 ThemeConfig prefersDark::: ', this.prefersDark);
51
+ this.toggleUserPreference(ThemeOption.AUTO);
52
+ }
53
+ }
54
+
55
+ private handleDarkPreference() {
56
+ this.toggleTheme(ThemeOption.DARK, true);
57
+ this.toggleTheme(ThemeOption.LIGHT, false);
58
+ }
59
+
60
+ private handleLightPreference() {
61
+ this.toggleTheme(ThemeOption.LIGHT, true);
62
+ this.toggleTheme(ThemeOption.DARK, false);
63
+ }
64
+
65
+ get Theme(): ThemeOption {
66
+ return this.theme.value;
67
+ }
68
+
69
+ set Theme(theme: ThemeOption) {
70
+ this.theme.next(theme);
71
+ LocalStorageService.set<ThemeOption>(THEME, theme);
72
+ }
73
+
74
+ toggleTheme(name: string, shouldAdd: boolean) {
75
+ console.log('toggleTheme::: ', name, shouldAdd);
76
+ document.body.classList.toggle(name, shouldAdd);
77
+ }
78
+
79
+ toggleUserPreference(option: ThemeOption) {
80
+ this.currentOption = option;
81
+ this.Theme = option;
82
+ this.lightToggle = option === ThemeOption.LIGHT;
83
+ this.darkToggle = option === ThemeOption.DARK;
84
+ this.autoToggle = option === ThemeOption.AUTO;
85
+
86
+ switch (option) {
87
+ case ThemeOption.LIGHT:
88
+ this.handleLightPreference();
89
+ break;
90
+ case ThemeOption.DARK:
91
+ this.handleDarkPreference();
92
+ break;
93
+ case ThemeOption.AUTO:
94
+ if (this.prefersDark) {
95
+ this.handleDarkPreference();
96
+ } else {
97
+ this.handleLightPreference();
98
+ }
99
+ break;
100
+ }
101
+ }
102
+ }
@@ -1,6 +1,8 @@
1
1
  import { InjectionToken } from "@angular/core";
2
2
  import { Provider } from "./lang-provider/content";
3
+
3
4
  export interface ValtechConfig {
4
5
  content: Provider;
5
6
  }
6
- export declare const ValtechConfigService: InjectionToken<ValtechConfig>;
7
+
8
+ export const ValtechConfigService = new InjectionToken<ValtechConfig>('ValtechConfig');
@@ -0,0 +1,2 @@
1
+ export const LANG = 'LANG';
2
+ export const THEME = 'THEME';
@@ -0,0 +1,20 @@
1
+ import { ElementRef } from "@angular/core";
2
+
3
+ export const goToTop = (id: string): void => {
4
+ const element = document.getElementById(id);
5
+ if (element) {
6
+ element.scrollIntoView({
7
+ block: 'start',
8
+ inline: 'nearest',
9
+ behavior: 'smooth',
10
+ });
11
+ }
12
+ };
13
+
14
+
15
+ export const isAtEnd = (elementRef: ElementRef): boolean => {
16
+ const formElement = elementRef.nativeElement;
17
+ const rect = formElement.getBoundingClientRect();
18
+ const windowHeight = window.innerHeight;
19
+ return rect.bottom <= windowHeight;
20
+ }
@@ -1,11 +1,22 @@
1
+ /*
2
+ * Public API Surface of valtech-components
3
+ */
4
+
5
+ /*
6
+ * Public API Surface of valtech-components
7
+ */
8
+
1
9
  export * from './lib/components/atoms/button/button.component';
2
10
  export * from './lib/components/atoms/button/types';
3
11
  export * from './lib/components/atoms/button/factory';
12
+
4
13
  export * from './lib/services/lang-provider/lang-provider.service';
5
14
  export * from './lib/services/lang-provider/types';
6
15
  export * from './lib/services/local-storage.service';
7
16
  export * from './lib/services/theme.service';
8
17
  export * from './lib/services/download.service';
9
18
  export * from './lib/services/types';
19
+
10
20
  export * from './lib/shared/utils/dom';
11
21
  export * from './lib/components/types';
22
+
@@ -0,0 +1,34 @@
1
+ @font-face {
2
+ font-family: 'Khula';
3
+ font-style: normal;
4
+ font-weight: 300;
5
+ src: url('../lib/assets/fonts/Khula-Light.ttf');
6
+ }
7
+
8
+ @font-face {
9
+ font-family: 'Khula';
10
+ font-style: normal;
11
+ font-weight: 400;
12
+ src: url('../lib/assets/fonts/Khula-Regular.ttf');
13
+ }
14
+
15
+ @font-face {
16
+ font-family: 'Khula';
17
+ font-style: normal;
18
+ font-weight: 600;
19
+ src: url('../lib/assets/fonts/Khula-SemiBold.ttf');
20
+ }
21
+
22
+ @font-face {
23
+ font-family: 'Khula';
24
+ font-style: normal;
25
+ font-weight: 700;
26
+ src: url('../lib/assets/fonts/Khula-Bold.ttf');
27
+ }
28
+
29
+ @font-face {
30
+ font-family: 'Khula';
31
+ font-style: normal;
32
+ font-weight: 800;
33
+ src: url('../lib/assets/fonts/Khula-ExtraBold.ttf');
34
+ }
@@ -0,0 +1 @@
1
+ @import '../src/lib/components/styles/overrides.scss';
@@ -0,0 +1,5 @@
1
+ @import '../src/lib/components/styles/media-queries.scss';
2
+ @import '../src/lib/components/styles/variables.scss';
3
+ @import '../src/lib/components/styles/functions.scss';
4
+ @import '../src/lib/components/styles/typography.scss';
5
+ @import '../src/lib/components/styles/mixins.scss';
@@ -0,0 +1,14 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "**/*.spec.ts"
13
+ ]
14
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "include": [
11
+ "**/*.spec.ts",
12
+ "**/*.d.ts"
13
+ ]
14
+ }
@@ -1,69 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, EventEmitter, Input, Output } from '@angular/core';
3
- import { IonButton, IonIcon, IonSpinner, IonText } from '@ionic/angular/standalone';
4
- import { ComponentStates } from '../../types';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "../../../services/download.service";
7
- import * as i2 from "@angular/common";
8
- export class ButtonComponent {
9
- constructor(download) {
10
- this.download = download;
11
- this.states = ComponentStates;
12
- this.onClick = new EventEmitter();
13
- }
14
- ngOnInit() { }
15
- clickHandler() {
16
- if (this.props.download) {
17
- this.download.downloadLinkFromBrowser(this.props.download);
18
- }
19
- if (this.props.state === this.states.DISABLED) {
20
- return;
21
- }
22
- this.onClick.emit(this.props.token);
23
- }
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, deps: [{ token: i1.DownloadService }], target: i0.ɵɵFactoryTarget.Component }); }
25
- 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: `
26
- <ion-button
27
- [type]="props.type"
28
- [color]="props.color"
29
- [expand]="props.expand"
30
- [fill]="props.fill"
31
- [size]="props.size"
32
- [href]="props.href"
33
- [target]="props.target"
34
- [shape]="props.shape"
35
- (click)="clickHandler()"
36
- [disabled]="props.state === states.DISABLED"
37
- >
38
- <ion-icon *ngIf="props.icon" [slot]="props.icon.slot" [name]="props.icon.name"></ion-icon>
39
- <ion-spinner *ngIf="props.state === states.WORKING" name="circular"></ion-spinner>
40
- <ion-text *ngIf="props.state !== states.WORKING">{{ props.text }}</ion-text>
41
- </ion-button>
42
- `, 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"] }] }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ButtonComponent, decorators: [{
45
- type: Component,
46
- args: [{ selector: 'val-button', standalone: true, imports: [CommonModule, IonButton, IonIcon, IonSpinner, IonText], template: `
47
- <ion-button
48
- [type]="props.type"
49
- [color]="props.color"
50
- [expand]="props.expand"
51
- [fill]="props.fill"
52
- [size]="props.size"
53
- [href]="props.href"
54
- [target]="props.target"
55
- [shape]="props.shape"
56
- (click)="clickHandler()"
57
- [disabled]="props.state === states.DISABLED"
58
- >
59
- <ion-icon *ngIf="props.icon" [slot]="props.icon.slot" [name]="props.icon.name"></ion-icon>
60
- <ion-spinner *ngIf="props.state === states.WORKING" name="circular"></ion-spinner>
61
- <ion-text *ngIf="props.state !== states.WORKING">{{ props.text }}</ion-text>
62
- </ion-button>
63
- `, styles: ["ion-button{font-family:var(--ion-default-font),Arial,sans-serif}\n"] }]
64
- }], ctorParameters: () => [{ type: i1.DownloadService }], propDecorators: { props: [{
65
- type: Input
66
- }], onClick: [{
67
- type: Output
68
- }] } });
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3ZhbHRlY2gtY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