valtech-components 4.0.145 → 4.0.147
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/esm2022/lib/components/molecules/ticket-card/ticket-card.component.mjs +60 -14
- package/esm2022/lib/services/haptics/haptics.service.mjs +109 -0
- package/esm2022/lib/services/haptics/index.mjs +15 -0
- package/esm2022/lib/services/haptics/types.mjs +2 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/valtech-components.mjs +180 -14
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +2 -2
- package/lib/components/atoms/text/text.component.d.ts +1 -1
- package/lib/components/atoms/user-avatar/user-avatar.component.d.ts +1 -1
- package/lib/components/molecules/cta-card/cta-card.component.d.ts +1 -1
- package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
- package/lib/components/molecules/metric-card/metric-card.component.d.ts +1 -1
- package/lib/components/molecules/ticket-card/ticket-card.component.d.ts +5 -0
- package/lib/components/organisms/account-view/account-view.component.d.ts +1 -1
- package/lib/components/organisms/article/article.component.d.ts +6 -6
- package/lib/components/organisms/auth-cta/auth-cta.component.d.ts +1 -1
- package/lib/components/organisms/organization-view/organization-view.component.d.ts +1 -1
- package/lib/services/haptics/haptics.service.d.ts +45 -0
- package/lib/services/haptics/index.d.ts +14 -0
- package/lib/services/haptics/types.d.ts +8 -0
- package/lib/version.d.ts +1 -1
- package/package.json +5 -1
- package/public-api.d.ts +1 -0
|
@@ -39,11 +39,11 @@ export declare class RightsFooterComponent {
|
|
|
39
39
|
/**
|
|
40
40
|
* Computed helper for align prop in template.
|
|
41
41
|
*/
|
|
42
|
-
propsAlign: import("@angular/core").Signal<"
|
|
42
|
+
propsAlign: import("@angular/core").Signal<"left" | "center" | "right">;
|
|
43
43
|
/**
|
|
44
44
|
* Computed helper for color prop in template.
|
|
45
45
|
*/
|
|
46
|
-
propsColor: import("@angular/core").Signal<"
|
|
46
|
+
propsColor: import("@angular/core").Signal<"success" | "medium" | "primary" | "secondary" | "tertiary" | "warning" | "danger" | "light" | "dark">;
|
|
47
47
|
/**
|
|
48
48
|
* Computed helper for withMargin prop in template.
|
|
49
49
|
*/
|
|
@@ -11,7 +11,7 @@ export declare class TextComponent {
|
|
|
11
11
|
*/
|
|
12
12
|
displayContent: import("@angular/core").Signal<string>;
|
|
13
13
|
propsColor: import("@angular/core").Signal<import("@ionic/core").Color>;
|
|
14
|
-
propsSize: import("@angular/core").Signal<"
|
|
14
|
+
propsSize: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge">;
|
|
15
15
|
propsBold: import("@angular/core").Signal<boolean>;
|
|
16
16
|
propsProcessLinks: import("@angular/core").Signal<boolean>;
|
|
17
17
|
propsAllowPartialBold: import("@angular/core").Signal<boolean>;
|
|
@@ -38,7 +38,7 @@ export declare class UserAvatarComponent {
|
|
|
38
38
|
readonly imageUrl: import("@angular/core").Signal<string>;
|
|
39
39
|
/** Iniciales — 1-2 chars derivados de name (preferred) o email prefix. */
|
|
40
40
|
readonly initials: import("@angular/core").Signal<string>;
|
|
41
|
-
readonly sizeClass: import("@angular/core").Signal<"
|
|
41
|
+
readonly sizeClass: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge" | "xsmall">;
|
|
42
42
|
readonly shapeClass: import("@angular/core").Signal<"circle" | "square">;
|
|
43
43
|
/** Background — explicito o derivado deterministicamente del user. */
|
|
44
44
|
readonly bgColor: import("@angular/core").Signal<string>;
|
|
@@ -35,7 +35,7 @@ export declare class CtaCardComponent {
|
|
|
35
35
|
/** Emitted with the token of the clicked action button */
|
|
36
36
|
onAction: EventEmitter<string>;
|
|
37
37
|
/** Merged configuration with defaults */
|
|
38
|
-
config: import("@angular/core").Signal<CtaCardMetadata & Required<Pick<CtaCardMetadata, "
|
|
38
|
+
config: import("@angular/core").Signal<CtaCardMetadata & Required<Pick<CtaCardMetadata, "borderRadius" | "bordered" | "shadowed" | "align" | "padding">>>;
|
|
39
39
|
getBackground(): string;
|
|
40
40
|
getColor(): string | null;
|
|
41
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<CtaCardComponent, never>;
|
|
@@ -41,7 +41,7 @@ export declare class FeaturesListComponent {
|
|
|
41
41
|
iconColor: string;
|
|
42
42
|
iconSize: number;
|
|
43
43
|
mode: "horizontal" | "vertical";
|
|
44
|
-
gap: "
|
|
44
|
+
gap: "small" | "medium" | "large";
|
|
45
45
|
alignment: "center" | "start";
|
|
46
46
|
imageShape: "circle" | "square";
|
|
47
47
|
maxVisible: number;
|
|
@@ -28,7 +28,7 @@ export declare class MetricCardComponent {
|
|
|
28
28
|
/** Emitted with the token of the clicked action */
|
|
29
29
|
onAction: EventEmitter<string>;
|
|
30
30
|
/** Merged configuration with defaults */
|
|
31
|
-
config: import("@angular/core").Signal<MetricCardMetadata & Required<Pick<MetricCardMetadata, "
|
|
31
|
+
config: import("@angular/core").Signal<MetricCardMetadata & Required<Pick<MetricCardMetadata, "borderRadius" | "bordered" | "shadowed" | "padding">>>;
|
|
32
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<MetricCardComponent, never>;
|
|
33
33
|
static ɵcmp: i0.ɵɵComponentDeclaration<MetricCardComponent, "val-metric-card", never, { "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
34
34
|
}
|
|
@@ -32,6 +32,8 @@ export declare class TicketCardComponent {
|
|
|
32
32
|
readonly failed: import("@angular/core").WritableSignal<boolean>;
|
|
33
33
|
/** True mientras se genera y comparte la tarjeta branded. */
|
|
34
34
|
readonly sharing: import("@angular/core").WritableSignal<boolean>;
|
|
35
|
+
/** True mientras se genera y descarga la tarjeta branded. */
|
|
36
|
+
readonly downloading: import("@angular/core").WritableSignal<boolean>;
|
|
35
37
|
constructor();
|
|
36
38
|
private generate;
|
|
37
39
|
t(key: string): string;
|
|
@@ -40,6 +42,9 @@ export declare class TicketCardComponent {
|
|
|
40
42
|
readonly folioText: import("@angular/core").Signal<string>;
|
|
41
43
|
readonly statusLabel: import("@angular/core").Signal<string>;
|
|
42
44
|
shareCard(): Promise<void>;
|
|
45
|
+
downloadCard(): Promise<void>;
|
|
46
|
+
private buildImageConfig;
|
|
47
|
+
private triggerDownload;
|
|
43
48
|
qrProps(q: QrResult): QrCodeMetadata;
|
|
44
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<TicketCardComponent, never>;
|
|
45
50
|
static ɵcmp: i0.ɵɵComponentDeclaration<TicketCardComponent, "val-ticket-card", never, { "props": { "alias": "props"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -35,7 +35,7 @@ export declare class AccountViewComponent {
|
|
|
35
35
|
* mergea con los defaults — `@Input` gana sobre route data.
|
|
36
36
|
*/
|
|
37
37
|
config?: AccountViewConfig;
|
|
38
|
-
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<AccountViewConfig, "
|
|
38
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<AccountViewConfig, "onOrgSwitched" | "onOrgCreated" | "onLoggedOut" | "onAccountDeleted">> & Pick<AccountViewConfig, "onOrgSwitched" | "onOrgCreated" | "onLoggedOut" | "onAccountDeleted">>;
|
|
39
39
|
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
40
40
|
private get ns();
|
|
41
41
|
readonly orgs: import("@angular/core").WritableSignal<Organization[]>;
|
|
@@ -45,7 +45,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
45
45
|
getVideoElement(element: ArticleElement): ArticleVideoElement;
|
|
46
46
|
getCustomElement(element: ArticleElement): ArticleCustomElement;
|
|
47
47
|
getQuoteTextProps(element: ArticleElement): {
|
|
48
|
-
size: "
|
|
48
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
49
49
|
color: import("@ionic/core").Color;
|
|
50
50
|
content?: string;
|
|
51
51
|
bold: boolean;
|
|
@@ -57,11 +57,11 @@ export declare class ArticleComponent implements OnInit {
|
|
|
57
57
|
linkConfig?: import("valtech-components").LinkProcessorConfig;
|
|
58
58
|
allowPartialBold?: boolean;
|
|
59
59
|
authorColor?: import("@ionic/core").Color;
|
|
60
|
-
alignment?: "
|
|
60
|
+
alignment?: "left" | "center" | "right";
|
|
61
61
|
showQuoteMark?: boolean;
|
|
62
62
|
};
|
|
63
63
|
getHighlightTextProps(element: ArticleElement): {
|
|
64
|
-
size: "
|
|
64
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
65
65
|
color: import("@ionic/core").Color;
|
|
66
66
|
content?: string;
|
|
67
67
|
bold: boolean;
|
|
@@ -76,7 +76,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
76
76
|
getHighlightColor(element: ArticleElement): string;
|
|
77
77
|
getButtonProps(element: ArticleElement): {
|
|
78
78
|
actionType?: import("valtech-components").ActionType;
|
|
79
|
-
expand?: "
|
|
79
|
+
expand?: "full" | "block";
|
|
80
80
|
link?: string;
|
|
81
81
|
href?: string;
|
|
82
82
|
routerLink?: string | any[];
|
|
@@ -92,8 +92,8 @@ export declare class ArticleComponent implements OnInit {
|
|
|
92
92
|
icon?: import("valtech-components").IconMetada;
|
|
93
93
|
shape?: "round";
|
|
94
94
|
size?: "default" | "small" | "large";
|
|
95
|
-
fill?: "
|
|
96
|
-
type: "
|
|
95
|
+
fill?: "default" | "clear" | "outline" | "solid";
|
|
96
|
+
type: "reset" | "submit" | "button";
|
|
97
97
|
token?: string;
|
|
98
98
|
ref?: any;
|
|
99
99
|
handler?: (value: any) => any;
|
|
@@ -35,7 +35,7 @@ export declare class AuthCtaComponent {
|
|
|
35
35
|
onRegister: EventEmitter<void>;
|
|
36
36
|
constructor();
|
|
37
37
|
/** Merged configuration with defaults */
|
|
38
|
-
config: import("@angular/core").Signal<AuthCtaMetadata & Required<Pick<AuthCtaMetadata, "
|
|
38
|
+
config: import("@angular/core").Signal<AuthCtaMetadata & Required<Pick<AuthCtaMetadata, "borderRadius" | "align" | "padding">>>;
|
|
39
39
|
loginLabel: import("@angular/core").Signal<string>;
|
|
40
40
|
registerLabel: import("@angular/core").Signal<string>;
|
|
41
41
|
topLogoProps: import("@angular/core").Signal<{
|
|
@@ -51,7 +51,7 @@ export declare class OrganizationViewComponent {
|
|
|
51
51
|
* `resolvedConfig` mergea con los defaults — `@Input` gana sobre route data.
|
|
52
52
|
*/
|
|
53
53
|
config?: OrganizationViewConfig;
|
|
54
|
-
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<OrganizationViewConfig, "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted"
|
|
54
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<OrganizationViewConfig, "onOrgCreated" | "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted">> & Pick<OrganizationViewConfig, "onOrgCreated" | "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted">>;
|
|
55
55
|
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
56
56
|
private get ns();
|
|
57
57
|
readonly org: import("@angular/core").WritableSignal<Organization>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HapticImpactStyle } from './types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* HapticsService — feedback háptico reutilizable cross-app.
|
|
5
|
+
*
|
|
6
|
+
* Estrategia de dos niveles, best-effort (ningún método lanza):
|
|
7
|
+
*
|
|
8
|
+
* 1. **Nativo (preferido)** — usa `@capacitor/haptics` vía dynamic import. Es un
|
|
9
|
+
* **peer dep OPCIONAL**: instalalo en la app consumer para haptics nativos en
|
|
10
|
+
* iOS/Android (`npm i @capacitor/haptics`, misma major que `@capacitor/core`).
|
|
11
|
+
* Si no está instalado, el import falla silenciosamente y se cae al fallback.
|
|
12
|
+
* 2. **Fallback web/PWA** — `navigator.vibrate(...)` con patrones equivalentes.
|
|
13
|
+
* SSR-safe (chequea `typeof navigator`). En iOS Safari `navigator.vibrate`
|
|
14
|
+
* no existe / se ignora — es **esperado**: no hay vibración en web iOS, solo
|
|
15
|
+
* con el plugin nativo de Capacitor.
|
|
16
|
+
*
|
|
17
|
+
* Mismo patrón de dynamic-import de peer dep opcional que `SplashScreenService`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* private haptics = inject(HapticsService);
|
|
21
|
+
* await this.haptics.success();
|
|
22
|
+
* await this.haptics.impact('light');
|
|
23
|
+
*/
|
|
24
|
+
export declare class HapticsService {
|
|
25
|
+
/** Feedback de éxito (operación completada). */
|
|
26
|
+
success(): Promise<void>;
|
|
27
|
+
/** Feedback de advertencia / estado esperado pero atípico. */
|
|
28
|
+
warning(): Promise<void>;
|
|
29
|
+
/** Feedback de error (operación fallida). */
|
|
30
|
+
error(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Impacto físico (toque/golpe). Default `'medium'`.
|
|
33
|
+
*
|
|
34
|
+
* @param style intensidad del impacto.
|
|
35
|
+
*/
|
|
36
|
+
impact(style?: HapticImpactStyle): Promise<void>;
|
|
37
|
+
/** Tick sutil de selección (al recorrer opciones, cambiar de tab, etc.). */
|
|
38
|
+
selection(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Fallback Vibration API. SSR-safe + feature-detect. Nunca lanza.
|
|
41
|
+
*/
|
|
42
|
+
private vibrate;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HapticsService, never>;
|
|
44
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HapticsService>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Haptics Service
|
|
3
|
+
*
|
|
4
|
+
* Feedback háptico reutilizable: `@capacitor/haptics` (peer dep opcional, nativo
|
|
5
|
+
* iOS/Android) con fallback a la Vibration API (`navigator.vibrate`) en web/PWA.
|
|
6
|
+
*
|
|
7
|
+
* `providedIn: 'root'` — sin provider. Inyectar `HapticsService` directo.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* private haptics = inject(HapticsService);
|
|
11
|
+
* await this.haptics.success();
|
|
12
|
+
*/
|
|
13
|
+
export * from './types';
|
|
14
|
+
export { HapticsService } from './haptics.service';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estilo de impacto háptico.
|
|
3
|
+
*
|
|
4
|
+
* Mapea a `ImpactStyle` de `@capacitor/haptics` cuando el plugin nativo está
|
|
5
|
+
* disponible, y a una intensidad de vibración (ms) en el fallback de la
|
|
6
|
+
* Vibration API.
|
|
7
|
+
*/
|
|
8
|
+
export type HapticImpactStyle = 'light' | 'medium' | 'heavy';
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valtech-components",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.147",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@angular/service-worker": "^18.0.0",
|
|
18
18
|
"@capacitor/app": ">=5.0.0",
|
|
19
19
|
"@capacitor/clipboard": "^6.0.1",
|
|
20
|
+
"@capacitor/haptics": ">=6.0.0",
|
|
20
21
|
"@capacitor/splash-screen": ">=6.0.0",
|
|
21
22
|
"@ionic/angular": "^8.0.0",
|
|
22
23
|
"firebase": "^10.0.0",
|
|
@@ -27,6 +28,9 @@
|
|
|
27
28
|
"@capacitor/app": {
|
|
28
29
|
"optional": true
|
|
29
30
|
},
|
|
31
|
+
"@capacitor/haptics": {
|
|
32
|
+
"optional": true
|
|
33
|
+
},
|
|
30
34
|
"@capacitor/splash-screen": {
|
|
31
35
|
"optional": true
|
|
32
36
|
},
|
package/public-api.d.ts
CHANGED
|
@@ -407,6 +407,7 @@ export * from './lib/components/molecules/request-form/types';
|
|
|
407
407
|
export * from './lib/components/molecules/content-reaction/content-reaction.component';
|
|
408
408
|
export * from './lib/components/molecules/content-reaction/types';
|
|
409
409
|
export * from './lib/services/splash-screen';
|
|
410
|
+
export * from './lib/services/haptics';
|
|
410
411
|
export * from './lib/components/templates/docs-layout/docs-layout.component';
|
|
411
412
|
export * from './lib/components/templates/docs-layout/types';
|
|
412
413
|
export * from './lib/components/organisms/docs-sidebar/docs-sidebar.component';
|