valtech-components 2.0.1034 → 2.0.1035

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.
@@ -0,0 +1,50 @@
1
+ import { EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { DatePickerMetadata } from './types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * `val-date-picker` — selector de fecha con calendario propio basado en
6
+ * `vanilla-calendar-pro` (NO ion-datetime → sin el bug del grid de días vacío).
7
+ *
8
+ * Trigger (botón con la fecha formateada o placeholder) que despliega un calendario
9
+ * inline debajo; al elegir un día se aplica y se cierra. Valor manejado como string
10
+ * `YYYY-MM-DD` (fecha local, sin zona horaria). Integra con `FormControl` (`control`)
11
+ * o vía `value` + `(valueChange)`. Auto-registra i18n (`DatePicker`).
12
+ *
13
+ * `ViewEncapsulation.None`: el calendario se crea por JS (fuera del scope emulado),
14
+ * así que los estilos de la lib + overrides de marca deben ser globales.
15
+ *
16
+ * @example
17
+ * <val-date-picker [props]="{ control: fechaControl, label: 'Fecha', locale: 'es-CL' }"
18
+ * (valueChange)="onDate($event)" />
19
+ */
20
+ export declare class DatePickerComponent implements OnChanges, OnDestroy {
21
+ private i18n;
22
+ constructor();
23
+ props: DatePickerMetadata;
24
+ /** Emite el valor (`YYYY-MM-DD` | null) en cada cambio. */
25
+ valueChange: EventEmitter<string>;
26
+ private calRef?;
27
+ open: boolean;
28
+ private calendar?;
29
+ /** id estable del trigger. */
30
+ get triggerId(): string;
31
+ private get locale();
32
+ /** Valor actual (`YYYY-MM-DD` | null) — del control o del prop value. */
33
+ private get current();
34
+ get placeholderText(): string;
35
+ /** Valor formateado a fecha larga local (sin day-shift). '' si vacío. */
36
+ get displayValue(): string;
37
+ ngOnChanges(_changes: SimpleChanges): void;
38
+ ngOnDestroy(): void;
39
+ t(key: string): string;
40
+ toggle(): void;
41
+ private buildCalendar;
42
+ private destroyCalendar;
43
+ private apply;
44
+ clear(): void;
45
+ private setValue;
46
+ /** Parsea `YYYY-MM-DD` a Date LOCAL (evita el shift de zona de new Date(str)). */
47
+ private parseLocal;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, never>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "val-date-picker", never, { "props": { "alias": "props"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
50
+ }
@@ -0,0 +1,3 @@
1
+ import { LanguagesContent } from '../../../services/i18n/types';
2
+ /** Defaults i18n (es/en) de `val-date-picker`. Namespace `DatePicker`. */
3
+ export declare const DATE_PICKER_I18N: LanguagesContent;
@@ -0,0 +1,30 @@
1
+ import { FormControl } from '@angular/forms';
2
+ /**
3
+ * Props (object-first) de `val-date-picker` — selector de fecha basado en
4
+ * `vanilla-calendar-pro` (calendario propio, NO ion-datetime). El valor se maneja
5
+ * como string `YYYY-MM-DD` (fecha local, sin zona horaria → sin day-shift).
6
+ */
7
+ export interface DatePickerMetadata {
8
+ /** FormControl que guarda el valor (`YYYY-MM-DD` | null). Opcional. */
9
+ control?: FormControl<string | null>;
10
+ /** Valor inicial si no se usa `control` (`YYYY-MM-DD`). */
11
+ value?: string | null;
12
+ /** Label arriba del campo. */
13
+ label?: string;
14
+ /** Hint/descripción bajo el label. */
15
+ hint?: string;
16
+ /** Texto del trigger cuando no hay valor. */
17
+ placeholder?: string;
18
+ /** Locale BCP47 para el calendario y el formato (ej. `es-CL`, `en-US`). */
19
+ locale?: string;
20
+ /** Primer día de semana: 0 domingo … 1 lunes (default 1). */
21
+ firstWeekday?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
22
+ /** Fecha mínima seleccionable (`YYYY-MM-DD`). */
23
+ min?: string;
24
+ /** Fecha máxima seleccionable (`YYYY-MM-DD`). */
25
+ max?: string;
26
+ /** Muestra acción "Limpiar" en el panel (default false). */
27
+ clearable?: boolean;
28
+ /** id estable (para a11y / tests). Si se omite se genera. */
29
+ token?: string;
30
+ }
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 = "2.0.1034";
5
+ export declare const VERSION = "2.0.1035";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.1034",
3
+ "version": "2.0.1035",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
@@ -44,7 +44,8 @@
44
44
  "prismjs": "^1.30.0",
45
45
  "qr-code-styling": "^1.9.0",
46
46
  "swiper": "^11.2.8",
47
- "tslib": "^2.3.0"
47
+ "tslib": "^2.3.0",
48
+ "vanilla-calendar-pro": "^3.1.0"
48
49
  },
49
50
  "sideEffects": false,
50
51
  "module": "fesm2022/valtech-components.mjs",
package/public-api.d.ts CHANGED
@@ -310,6 +310,8 @@ export * from './lib/components/organisms/member-detail-modal/types';
310
310
  export * from './lib/components/organisms/member-import-modal/member-import-modal.component';
311
311
  export * from './lib/components/organisms/field-list/field-list.component';
312
312
  export * from './lib/components/organisms/field-list/types';
313
+ export * from './lib/components/molecules/date-picker/date-picker.component';
314
+ export * from './lib/components/molecules/date-picker/types';
313
315
  export * from './lib/components/organisms/api-keys-modal/api-keys-modal.component';
314
316
  export * from './lib/components/organisms/api-key-create-modal/api-key-create-modal.component';
315
317
  export * from './lib/components/organisms/api-keys-view/api-keys-view.component';