@devjuliovilla/jv-ui 1.8.0 → 1.10.0

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/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@devjuliovilla/jv-ui",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Accessibility-first Angular component library — components, forms, data grids, dialogs, layout, services, and i18n infrastructure built with signals and standalone APIs.",
5
5
  "author": "@devjuliovilla",
6
6
  "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "repository": {
8
11
  "type": "git",
9
12
  "url": "git+https://github.com/devjuliovilla/JV_UI.git"
@@ -214,14 +214,30 @@ declare class JvBadgeComponent {
214
214
 
215
215
  type JvTheme = 'light' | 'dark' | 'high-contrast';
216
216
  type JvDensity = 'compact' | 'normal' | 'comfortable';
217
+ type JvMessagesLocale = 'es' | 'en';
218
+ interface JvUiFormats {
219
+ date: Intl.DateTimeFormatOptions;
220
+ time: Intl.DateTimeFormatOptions;
221
+ datetime: Intl.DateTimeFormatOptions;
222
+ integer: Intl.NumberFormatOptions;
223
+ number: Intl.NumberFormatOptions;
224
+ currency: Intl.NumberFormatOptions;
225
+ percent: Intl.NumberFormatOptions;
226
+ }
217
227
  type JvToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
218
228
  interface JvUiConfig {
219
229
  theme: JvTheme;
220
230
  density: JvDensity;
221
231
  language: string;
222
- locale: string;
232
+ locale?: string;
233
+ messagesLocale: JvMessagesLocale;
234
+ formatLocale: string;
235
+ formats: JvUiFormats;
223
236
  toastPosition: JvToastPosition;
224
237
  }
238
+ type JvUiConfigInput = Omit<Partial<JvUiConfig>, 'formats'> & {
239
+ formats?: Partial<JvUiFormats>;
240
+ };
225
241
  declare const JV_UI_DEFAULT_CONFIG: JvUiConfig;
226
242
 
227
243
  interface JvToastItem {
@@ -232,7 +248,7 @@ interface JvToastItem {
232
248
  duration: number;
233
249
  }
234
250
  interface JvConfirmOptions {
235
- title: string;
251
+ title?: string;
236
252
  message: string;
237
253
  confirmLabel?: string;
238
254
  cancelLabel?: string;
@@ -319,6 +335,23 @@ declare class JvCheckboxComponent implements ControlValueAccessor {
319
335
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<JvCheckboxComponent, "jv-checkbox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "describedBy": { "alias": "describedBy"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
320
336
  }
321
337
 
338
+ type JvCodeFont = 'jetbrains-mono' | 'fira-code' | 'cascadia' | 'consolas' | 'system';
339
+ declare class JvCodeComponent {
340
+ readonly code: _angular_core.InputSignal<string>;
341
+ readonly language: _angular_core.InputSignal<string>;
342
+ readonly title: _angular_core.InputSignal<string>;
343
+ readonly font: _angular_core.InputSignal<JvCodeFont>;
344
+ readonly editable: _angular_core.InputSignal<boolean>;
345
+ readonly width: _angular_core.InputSignal<string>;
346
+ readonly height: _angular_core.InputSignal<string>;
347
+ readonly codeChange: _angular_core.OutputEmitterRef<string>;
348
+ protected readonly fontFamily: _angular_core.Signal<"'Fira Code', 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace" | "'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace" | "'Consolas', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace" | "ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace" | "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace">;
349
+ protected languageLabel(): string;
350
+ protected handleInput(event: Event): void;
351
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<JvCodeComponent, never>;
352
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<JvCodeComponent, "jv-code", never, { "code": { "alias": "code"; "required": true; "isSignal": true; }; "language": { "alias": "language"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "font": { "alias": "font"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, { "codeChange": "codeChange"; }, never, never, true, never>;
353
+ }
354
+
322
355
  declare class JvFormContainerComponent {
323
356
  readonly label: _angular_core.InputSignal<string>;
324
357
  readonly hint: _angular_core.InputSignal<string>;
@@ -381,6 +414,7 @@ declare class JvTranslationService {
381
414
  readonly locale: _angular_core.WritableSignal<JvLocale>;
382
415
  initialize(): void;
383
416
  setLocale(locale: JvLocale): void;
417
+ setMessagesLocale(locale: JvLocale): void;
384
418
  translate(key: string, params?: Record<string, string | number>): string;
385
419
  private resolveLocale;
386
420
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<JvTranslationService, never>;
@@ -394,6 +428,7 @@ interface JvDatePickerCell {
394
428
  }
395
429
  declare class JvDatePickerComponent implements ControlValueAccessor {
396
430
  readonly translation: JvTranslationService;
431
+ private readonly formatService;
397
432
  private readonly announcementService;
398
433
  private readonly instanceId;
399
434
  private readonly calendarRootRef;
@@ -450,6 +485,51 @@ declare class JvDatePickerComponent implements ControlValueAccessor {
450
485
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<JvDatePickerComponent, "jv-date-picker", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "dialogTitle": { "alias": "dialogTitle"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "describedBy": { "alias": "describedBy"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
451
486
  }
452
487
 
488
+ interface JvFileInputRejection {
489
+ files: File[];
490
+ reason: 'accept' | 'maxFiles';
491
+ }
492
+ declare class JvFileInputComponent {
493
+ protected readonly translation: JvTranslationService;
494
+ private readonly instanceId;
495
+ private readonly nativeInputRef;
496
+ readonly label: _angular_core.InputSignal<string>;
497
+ readonly hint: _angular_core.InputSignal<string>;
498
+ readonly error: _angular_core.InputSignal<string>;
499
+ readonly describedBy: _angular_core.InputSignal<string>;
500
+ readonly inputId: _angular_core.InputSignal<string>;
501
+ readonly accept: _angular_core.InputSignal<string>;
502
+ readonly multiple: _angular_core.InputSignal<boolean>;
503
+ readonly maxFiles: _angular_core.InputSignal<number>;
504
+ readonly disabled: _angular_core.InputSignal<boolean>;
505
+ readonly required: _angular_core.InputSignal<boolean>;
506
+ readonly invalid: _angular_core.InputSignal<boolean>;
507
+ readonly filesInput: _angular_core.InputSignal<readonly File[] | null | undefined>;
508
+ readonly filesChange: _angular_core.OutputEmitterRef<File[]>;
509
+ readonly filesRejected: _angular_core.OutputEmitterRef<JvFileInputRejection>;
510
+ protected readonly dragActive: _angular_core.WritableSignal<boolean>;
511
+ protected readonly rejectionMessage: _angular_core.WritableSignal<string>;
512
+ private readonly internalFiles;
513
+ protected readonly currentFiles: _angular_core.Signal<File[]>;
514
+ protected readonly selectionSummary: _angular_core.Signal<string>;
515
+ protected readonly dropzoneAriaLabel: _angular_core.Signal<string>;
516
+ protected openFileDialog(): void;
517
+ protected handleDropzoneKeydown(event: KeyboardEvent): void;
518
+ protected onNativeInputChange(fileList: FileList | null): void;
519
+ protected onDragEnter(event: DragEvent): void;
520
+ protected onDragOver(event: DragEvent): void;
521
+ protected onDragLeave(event: DragEvent): void;
522
+ protected onDrop(event: DragEvent): void;
523
+ protected removeFile(index: number): void;
524
+ protected trackFile(index: number, file: File): string;
525
+ protected formatBytes(size: number): string;
526
+ private consumeFiles;
527
+ private updateFiles;
528
+ private matchesAccept;
529
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<JvFileInputComponent, never>;
530
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<JvFileInputComponent, "jv-file-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "describedBy": { "alias": "describedBy"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxFiles": { "alias": "maxFiles"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "filesInput": { "alias": "files"; "required": false; "isSignal": true; }; }, { "filesChange": "filesChange"; "filesRejected": "filesRejected"; }, never, never, true, never>;
531
+ }
532
+
453
533
  declare class JvModalSelectorComponent implements ControlValueAccessor {
454
534
  private readonly announcementService;
455
535
  protected readonly translation: JvTranslationService;
@@ -619,12 +699,13 @@ interface JvIconDefinition {
619
699
  declare const JV_FALLBACK_ICON_NAME = "circle-alert";
620
700
  declare const JV_LUCIDE_ICON_REGISTRY: Record<string, JvIconDefinition>;
621
701
 
622
- declare const JV_UI_CONFIG: InjectionToken<Partial<JvUiConfig>[]>;
702
+ declare const JV_UI_CONFIG: InjectionToken<JvUiConfigInput[]>;
623
703
  declare const JV_UI_CONFIG_DEFAULTS: InjectionToken<JvUiConfig>;
624
- declare function provideJvUi(config?: Partial<JvUiConfig>): _angular_core.EnvironmentProviders;
704
+ declare function provideJvUi(config?: JvUiConfigInput): _angular_core.EnvironmentProviders;
625
705
 
626
706
  declare class JvDialogService {
627
707
  private readonly announcementService;
708
+ private readonly translation;
628
709
  private readonly document;
629
710
  private readonly activeDialogSignal;
630
711
  private nextId;
@@ -639,6 +720,7 @@ declare class JvDialogService {
639
720
 
640
721
  declare class JvConfirmDialogComponent {
641
722
  protected readonly dialogService: JvDialogService;
723
+ protected readonly translation: JvTranslationService;
642
724
  protected readonly activeDialog: _angular_core.Signal<_devjuliovilla_jv_ui.JvActiveConfirmDialog | null>;
643
725
  protected readonly isOpen: _angular_core.Signal<boolean>;
644
726
  protected readonly dialogTitle: _angular_core.Signal<string>;
@@ -808,6 +890,29 @@ declare class JvAnnouncementService {
808
890
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<JvAnnouncementService>;
809
891
  }
810
892
 
893
+ type JvFormatKind = keyof JvUiFormats;
894
+ type JvFormatOverrides = Intl.DateTimeFormatOptions & Intl.NumberFormatOptions;
895
+ declare class JvFormatService {
896
+ private readonly config;
897
+ readonly formatLocale: _angular_core.WritableSignal<string>;
898
+ readonly formats: _angular_core.WritableSignal<JvUiFormats>;
899
+ readonly firstDayOfWeek: _angular_core.Signal<number>;
900
+ initialize(): void;
901
+ setFormatLocale(locale: string): void;
902
+ setFormats(formats: Partial<JvUiFormats>): void;
903
+ format(kind: JvFormatKind, value: unknown, overrides?: JvFormatOverrides): string;
904
+ toComparable(kind: JvFormatKind, value: unknown): string | number | boolean | null;
905
+ toDate(value: unknown): Date | null;
906
+ toNumber(value: unknown): number | null;
907
+ toSearchValue(kind: JvFormatKind, value: unknown): string;
908
+ private resolveFormats;
909
+ private resolveDateOptions;
910
+ private resolveNumberOptions;
911
+ private resolveFirstDayOfWeek;
912
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<JvFormatService, never>;
913
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<JvFormatService>;
914
+ }
915
+
811
916
  declare class JvListComponent {
812
917
  readonly role: _angular_core.InputSignal<"list" | "navigation">;
813
918
  readonly ariaRole: _angular_core.InputSignal<string | null>;
@@ -918,6 +1023,8 @@ interface JvGridSortState {
918
1023
  columnKey: string;
919
1024
  direction: JvGridSortDirection;
920
1025
  }
1026
+ type JvGridColumnType = 'text' | 'integer' | 'number' | 'currency' | 'percent' | 'date' | 'time' | 'datetime' | 'boolean';
1027
+ type JvGridColumnFormatOptions = Intl.NumberFormatOptions & Intl.DateTimeFormatOptions;
921
1028
  interface JvGridColumn<T = any> {
922
1029
  key: keyof T | string;
923
1030
  header: string;
@@ -932,7 +1039,8 @@ interface JvGridColumn<T = any> {
932
1039
  minWidth?: string;
933
1040
  maxWidth?: string;
934
1041
  align?: 'start' | 'center' | 'end';
935
- type?: 'text' | 'number' | 'currency' | 'date' | 'datetime' | 'boolean';
1042
+ type?: JvGridColumnType;
1043
+ formatOptions?: JvGridColumnFormatOptions;
936
1044
  cellClass?: string;
937
1045
  headerClass?: string;
938
1046
  format?: (value: unknown, row: T) => string;
@@ -1008,6 +1116,7 @@ declare const JV_GRID_DEFAULT_OPTIONS: JvGridOptions;
1008
1116
 
1009
1117
  declare class JvGridComponent<T = any> {
1010
1118
  private readonly gridId;
1119
+ private readonly formatService;
1011
1120
  private readonly translationService;
1012
1121
  readonly data: _angular_core.InputSignal<T[]>;
1013
1122
  readonly columns: _angular_core.InputSignal<JvGridColumn<T>[]>;
@@ -1102,7 +1211,12 @@ declare class JvGridComponent<T = any> {
1102
1211
  protected getRawCellValue(row: T, col: JvGridColumn<T>): unknown;
1103
1212
  protected getCellValue(row: T, col: JvGridColumn<T>): unknown;
1104
1213
  protected getEditValue(row: T, col: JvGridColumn<T>): string;
1105
- protected formatValue(value: unknown, col: JvGridColumn<T>): string;
1214
+ protected formatValue(value: unknown, col: JvGridColumn<T>, _row: T): string;
1215
+ protected getComparableValue(value: unknown, col: JvGridColumn<T>): string | number | boolean | null;
1216
+ protected getSearchValue(value: unknown, col: JvGridColumn<T>): string;
1217
+ protected getExportValue(value: unknown, col: JvGridColumn<T>): string;
1218
+ protected resolveColumnType(col: JvGridColumn<T>): JvGridColumnType;
1219
+ protected getFormatOverrides(col: JvGridColumn<T>): JvFormatOverrides | undefined;
1106
1220
  protected getAriaSort(col: JvGridColumn<T>): 'ascending' | 'descending' | 'none' | null;
1107
1221
  protected getSortLabel(col: JvGridColumn<T>): string;
1108
1222
  protected getColumnWidth(col: JvGridColumn<T>): string | undefined;
@@ -1172,5 +1286,5 @@ declare class JvPaginationComponent {
1172
1286
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<JvPaginationComponent, "jv-pagination", never, { "totalItems": { "alias": "totalItems"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "pageIndex": { "alias": "pageIndex"; "required": false; "isSignal": true; }; "maxVisiblePages": { "alias": "maxVisiblePages"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; }, never, never, true, never>;
1173
1287
  }
1174
1288
 
1175
- export { EN, ES, JV_DEFAULT_LOCALE, JV_FALLBACK_ICON_NAME, JV_GRID_DEFAULT_OPTIONS, JV_LOCALE_DICTIONARIES, JV_LUCIDE_ICON_REGISTRY, JV_UI_CONFIG, JV_UI_CONFIG_DEFAULTS, JV_UI_DEFAULT_CONFIG, JvAccordionComponent, JvAccordionPanelDirective, JvAlertComponent, JvAnnouncementService, JvBadgeComponent, JvBreadcrumbComponent, JvButtonComponent, JvButtonGroupComponent, JvCardComponent, JvChangePasswordPageComponent, JvCheckboxComponent, JvCollapsiblePanelComponent, JvConfirmDialogComponent, JvDashboardShellComponent, JvDatePickerComponent, JvDialogComponent, JvDialogService, JvDividerComponent, JvForgotPasswordPageComponent, JvFormContainerComponent, JvGridComponent, JvIconButtonComponent, JvIconComponent, JvInputComponent, JvListComponent, JvListItemComponent, JvLoaderComponent, JvLoaderService, JvLoginPageComponent, JvModalSelectorComponent, JvPageComponent, JvPaginationComponent, JvRadioComponent, JvSectionComponent, JvSelectComponent, JvSidebarComponent, JvSwitchComponent, JvTabPanelDirective, JvTabsComponent, JvTextareaComponent, JvThemeService, JvToastComponent, JvToastService, JvTooltipDirective, JvTopbarComponent, JvTranslationService, provideJvUi };
1176
- export type { JvAccordionItem, JvActiveConfirmDialog, JvBreadcrumbItem, JvChangePasswordSubmitEvent, JvCollapsiblePanelVariant, JvConfirmOptions, JvDensity, JvForgotPasswordSubmitEvent, JvGridAction, JvGridColumn, JvGridColumnFilter, JvGridColumnReorderEvent, JvGridColumnResizeEvent, JvGridColumnWidth, JvGridFilterOperator, JvGridOptions, JvGridPageEvent, JvGridRowEditEvent, JvGridRowId, JvGridSortDirection, JvGridSortState, JvGridTrackBy, JvIconDefinition, JvIconElement, JvIntent, JvListItemModel, JvLoaderState, JvLocale, JvLoginSubmitEvent, JvModalSelectorOption, JvNavItem, JvPaginationEvent, JvSelectOption, JvTabItem, JvTheme, JvThemeOption, JvToastItem, JvToastPosition, JvToastViewport, JvTone, JvTooltipPosition, JvTopbarAction, JvUiConfig };
1289
+ export { EN, ES, JV_DEFAULT_LOCALE, JV_FALLBACK_ICON_NAME, JV_GRID_DEFAULT_OPTIONS, JV_LOCALE_DICTIONARIES, JV_LUCIDE_ICON_REGISTRY, JV_UI_CONFIG, JV_UI_CONFIG_DEFAULTS, JV_UI_DEFAULT_CONFIG, JvAccordionComponent, JvAccordionPanelDirective, JvAlertComponent, JvAnnouncementService, JvBadgeComponent, JvBreadcrumbComponent, JvButtonComponent, JvButtonGroupComponent, JvCardComponent, JvChangePasswordPageComponent, JvCheckboxComponent, JvCodeComponent, JvCollapsiblePanelComponent, JvConfirmDialogComponent, JvDashboardShellComponent, JvDatePickerComponent, JvDialogComponent, JvDialogService, JvDividerComponent, JvFileInputComponent, JvForgotPasswordPageComponent, JvFormContainerComponent, JvFormatService, JvGridComponent, JvIconButtonComponent, JvIconComponent, JvInputComponent, JvListComponent, JvListItemComponent, JvLoaderComponent, JvLoaderService, JvLoginPageComponent, JvModalSelectorComponent, JvPageComponent, JvPaginationComponent, JvRadioComponent, JvSectionComponent, JvSelectComponent, JvSidebarComponent, JvSwitchComponent, JvTabPanelDirective, JvTabsComponent, JvTextareaComponent, JvThemeService, JvToastComponent, JvToastService, JvTooltipDirective, JvTopbarComponent, JvTranslationService, provideJvUi };
1290
+ export type { JvAccordionItem, JvActiveConfirmDialog, JvBreadcrumbItem, JvChangePasswordSubmitEvent, JvCodeFont, JvCollapsiblePanelVariant, JvConfirmOptions, JvDensity, JvFileInputRejection, JvForgotPasswordSubmitEvent, JvFormatKind, JvFormatOverrides, JvGridAction, JvGridColumn, JvGridColumnFilter, JvGridColumnFormatOptions, JvGridColumnReorderEvent, JvGridColumnResizeEvent, JvGridColumnType, JvGridColumnWidth, JvGridFilterOperator, JvGridOptions, JvGridPageEvent, JvGridRowEditEvent, JvGridRowId, JvGridSortDirection, JvGridSortState, JvGridTrackBy, JvIconDefinition, JvIconElement, JvIntent, JvListItemModel, JvLoaderState, JvLocale, JvLoginSubmitEvent, JvMessagesLocale, JvModalSelectorOption, JvNavItem, JvPaginationEvent, JvSelectOption, JvTabItem, JvTheme, JvThemeOption, JvToastItem, JvToastPosition, JvToastViewport, JvTone, JvTooltipPosition, JvTopbarAction, JvUiConfig, JvUiConfigInput, JvUiFormats };