valtech-components 4.0.143 → 4.0.146

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.
@@ -26,7 +26,7 @@ export declare class DatePickerComponent implements OnChanges, OnDestroy {
26
26
  private calendar?;
27
27
  get triggerId(): string;
28
28
  private get locale();
29
- private get current();
29
+ get current(): string | null;
30
30
  get placeholderText(): string;
31
31
  get displayValue(): string;
32
32
  ngOnChanges(_changes: SimpleChanges): void;
@@ -38,6 +38,7 @@ export declare class DatePickerComponent implements OnChanges, OnDestroy {
38
38
  private destroyCalendar;
39
39
  private apply;
40
40
  clear(): void;
41
+ onNativeInputChange(event: Event): void;
41
42
  private setValue;
42
43
  private parseLocal;
43
44
  static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, never>;
@@ -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
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.143";
5
+ export declare const VERSION = "4.0.146";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.143",
3
+ "version": "4.0.146",
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';