@nocios/crudify-components 2.0.44 → 2.0.61

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 (74) hide show
  1. package/.github/workflows/ci.yml +70 -0
  2. package/.husky/pre-commit +26 -0
  3. package/.husky/pre-push +30 -0
  4. package/.prettierignore +18 -0
  5. package/.prettierrc +9 -0
  6. package/README.md +44 -36
  7. package/README_DEPTH.md +148 -141
  8. package/coverage/coverage-final.json +83 -83
  9. package/coverage/index.html +175 -175
  10. package/coverage/lcov-report/base.css +224 -0
  11. package/coverage/lcov-report/block-navigation.js +87 -0
  12. package/coverage/lcov-report/favicon.png +0 -0
  13. package/coverage/lcov-report/index.html +686 -0
  14. package/coverage/lcov-report/prettify.css +1 -0
  15. package/coverage/lcov-report/prettify.js +2 -0
  16. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  17. package/coverage/lcov-report/sorter.js +210 -0
  18. package/coverage/lcov.info +22388 -0
  19. package/dist/{CrudiaMarkdownField-CXAuu-v2.d.ts → CrudiaMarkdownField-CkiBwG-U.d.ts} +8 -8
  20. package/dist/{CrudiaMarkdownField-TNyMLb-h.d.mts → CrudiaMarkdownField-D-DqiXMQ.d.mts} +8 -8
  21. package/dist/{GlobalNotificationProvider-Zq18OkpI.d.ts → GlobalNotificationProvider-CdwdNv_8.d.mts} +4 -4
  22. package/dist/{GlobalNotificationProvider-Zq18OkpI.d.mts → GlobalNotificationProvider-CdwdNv_8.d.ts} +4 -4
  23. package/dist/chunk-2WAUZ6KI.js +1 -0
  24. package/dist/chunk-3IGZNZCT.mjs +1 -0
  25. package/dist/chunk-43L2PP77.mjs +1 -0
  26. package/dist/chunk-6VS5OT3A.mjs +1 -0
  27. package/dist/chunk-BWJTTMKS.js +1 -0
  28. package/dist/chunk-EMPPCCVU.js +1 -0
  29. package/dist/chunk-J43UPGBE.js +1 -0
  30. package/dist/chunk-K6ZRXOJ7.mjs +1 -0
  31. package/dist/chunk-RYQQZTEP.js +1 -0
  32. package/dist/chunk-VTMSOK4V.mjs +1 -0
  33. package/dist/components.d.mts +3 -3
  34. package/dist/components.d.ts +3 -3
  35. package/dist/components.js +1 -1
  36. package/dist/components.mjs +1 -1
  37. package/dist/{errorTranslation-D-Y7uNN_.d.mts → errorTranslation-BcX8AaK7.d.mts} +5 -5
  38. package/dist/{errorTranslation-DDlAXpMl.d.ts → errorTranslation-CF-5JClP.d.ts} +5 -5
  39. package/dist/hooks.d.mts +3 -3
  40. package/dist/hooks.d.ts +3 -3
  41. package/dist/hooks.js +1 -1
  42. package/dist/hooks.mjs +1 -1
  43. package/dist/{index-U--xRr8A.d.mts → index-D06kTP0C.d.mts} +18 -18
  44. package/dist/{index-dXVRVcEB.d.ts → index-DEDnmsdO.d.ts} +18 -18
  45. package/dist/index.d.mts +361 -361
  46. package/dist/index.d.ts +361 -361
  47. package/dist/index.js +2 -2
  48. package/dist/index.mjs +2 -2
  49. package/dist/{tenantConfig-DqJqQkoR.d.mts → tenantConfig-CYnS9TPV.d.mts} +14 -8
  50. package/dist/{tenantConfig-DqJqQkoR.d.ts → tenantConfig-CYnS9TPV.d.ts} +14 -8
  51. package/dist/utils.d.mts +3 -3
  52. package/dist/utils.d.ts +3 -3
  53. package/dist/utils.js +1 -1
  54. package/dist/utils.mjs +1 -1
  55. package/eslint.config.mjs +140 -0
  56. package/package.json +34 -5
  57. package/scripts/bump-version.cjs +23 -0
  58. package/sonar-project.properties +23 -0
  59. package/tests/helpers/testUtils.tsx +89 -0
  60. package/tests/hooks/useSession/testUtils.tsx +212 -0
  61. package/tests/setup.ts +139 -0
  62. package/tests/vitest.d.ts +1 -0
  63. package/vitest.config.ts +20 -9
  64. package/.github/workflows/test.yml +0 -59
  65. package/dist/chunk-2IOB6HHT.js +0 -1
  66. package/dist/chunk-2WHCDP7V.mjs +0 -1
  67. package/dist/chunk-37WOWEJG.js +0 -1
  68. package/dist/chunk-44VU4TSP.mjs +0 -1
  69. package/dist/chunk-4LMFQECS.js +0 -1
  70. package/dist/chunk-BXFEQ6KP.js +0 -1
  71. package/dist/chunk-MFQKGZI4.js +0 -1
  72. package/dist/chunk-NJERBWND.mjs +0 -1
  73. package/dist/chunk-WMLIOPUC.mjs +0 -1
  74. package/dist/chunk-XMEZUDF6.mjs +0 -1
@@ -1,8 +1,8 @@
1
- import { U as UserProfile, m as CrudifyRequestOptions, f as CrudifyApiResponse, o as TransactionInput, l as CrudifyOperationOptions } from './tenantConfig-DqJqQkoR.js';
1
+ import { U as UserProfile, h as CrudifyRequestOptions, f as CrudifyApiResponse, l as TransactionInput, g as CrudifyOperationOptions } from './tenantConfig-CYnS9TPV.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
  import { CrudifyResponse } from '@nocios/crudify-sdk';
5
- import { b as NotificationSeverity } from './GlobalNotificationProvider-Zq18OkpI.js';
5
+ import { b as NotificationSeverity } from './GlobalNotificationProvider-CdwdNv_8.js';
6
6
 
7
7
  type TokenData = {
8
8
  accessToken: string;
@@ -12,7 +12,7 @@ type TokenData = {
12
12
  apiEndpointAdmin?: string;
13
13
  apiKeyEndpointAdmin?: string;
14
14
  };
15
- type StorageType = "localStorage" | "sessionStorage" | "none";
15
+ type StorageType = 'localStorage' | 'sessionStorage' | 'none';
16
16
  declare class TokenStorage {
17
17
  private static readonly TOKEN_KEY;
18
18
  private static readonly ENCRYPTION_KEY_STORAGE;
@@ -165,12 +165,12 @@ type SessionConfig = {
165
165
  onSessionRestored?: (tokens: TokenData) => void;
166
166
  onLoginSuccess?: (tokens: TokenData) => void;
167
167
  onLogout?: () => void;
168
- showNotification?: (message: string, severity?: "error" | "info" | "success" | "warning") => void;
168
+ showNotification?: (message: string, severity?: 'error' | 'info' | 'success' | 'warning') => void;
169
169
  translateFn?: (key: string) => string;
170
170
  apiEndpointAdmin?: string;
171
171
  apiKeyEndpointAdmin?: string;
172
172
  publicApiKey?: string;
173
- env?: "dev" | "stg" | "api" | "prod";
173
+ env?: 'dev' | 'stg' | 'api' | 'prod';
174
174
  };
175
175
  /**
176
176
  * Response data from a successful login
@@ -314,7 +314,7 @@ declare class SessionManager {
314
314
  * La renovación de tokens se maneja en useSession con lógica de TTL
315
315
  * @returns 'logout' si debe desloguear por inactividad, 'none' si no hace nada
316
316
  */
317
- checkInactivity(): "logout" | "none";
317
+ checkInactivity(): 'logout' | 'none';
318
318
  /**
319
319
  * Limpiar sesión completamente
320
320
  */
@@ -350,12 +350,12 @@ type UseSessionOptions = {
350
350
  enableLogging?: boolean;
351
351
  onSessionExpired?: () => void;
352
352
  onSessionRestored?: (tokens: TokenData) => void;
353
- showNotification?: (message: string, severity?: "error" | "info" | "success" | "warning") => void;
353
+ showNotification?: (message: string, severity?: 'error' | 'info' | 'success' | 'warning') => void;
354
354
  translateFn?: (key: string) => string;
355
355
  apiEndpointAdmin?: string;
356
356
  apiKeyEndpointAdmin?: string;
357
357
  publicApiKey?: string;
358
- env?: "dev" | "stg" | "api" | "prod";
358
+ env?: 'dev' | 'stg' | 'api' | 'prod';
359
359
  };
360
360
  /**
361
361
  * Retorno completo del hook useSession
@@ -408,7 +408,7 @@ type SessionData = {
408
408
  } | null;
409
409
  type CrudifyConfig = {
410
410
  publicApiKey?: string;
411
- env?: "dev" | "stg" | "api" | "prod";
411
+ env?: 'dev' | 'stg' | 'api' | 'prod';
412
412
  appName?: string;
413
413
  loginActions?: string[];
414
414
  logo?: string;
@@ -426,7 +426,7 @@ type SessionContextType = {
426
426
  logout: () => Promise<void>;
427
427
  refreshTokens: () => Promise<boolean>;
428
428
  clearError: () => void;
429
- getTokenInfo: () => ReturnType<typeof useSession>["getTokenInfo"] extends () => infer R ? R : unknown;
429
+ getTokenInfo: () => ReturnType<typeof useSession>['getTokenInfo'] extends () => infer R ? R : unknown;
430
430
  isExpiringSoon: boolean;
431
431
  expiresIn: number;
432
432
  refreshExpiresIn: number;
@@ -436,8 +436,8 @@ type NotificationOptions = {
436
436
  maxNotifications?: number;
437
437
  defaultAutoHideDuration?: number;
438
438
  position?: {
439
- vertical: "top" | "bottom";
440
- horizontal: "left" | "center" | "right";
439
+ vertical: 'top' | 'bottom';
440
+ horizontal: 'left' | 'center' | 'right';
441
441
  };
442
442
  allowHtml?: boolean;
443
443
  };
@@ -465,7 +465,7 @@ declare function SessionDebugInfo(): react_jsx_runtime.JSX.Element;
465
465
  /**
466
466
  * Individual file status
467
467
  */
468
- type FileStatus = "pending" | "uploading" | "completed" | "error" | "removing" | "pendingDeletion";
468
+ type FileStatus = 'pending' | 'uploading' | 'completed' | 'error' | 'removing' | 'pendingDeletion';
469
469
  /**
470
470
  * Represents a file in the system
471
471
  */
@@ -491,7 +491,7 @@ interface FileItem {
491
491
  * File visibility
492
492
  * Extracted from filePath for convenience
493
493
  */
494
- visibility?: "public" | "private";
494
+ visibility?: 'public' | 'private';
495
495
  /** Public URL for public files */
496
496
  publicUrl?: string;
497
497
  /** Preview URL (for images) */
@@ -521,7 +521,7 @@ interface UseFileUploadOptions {
521
521
  * Visibility of uploaded files
522
522
  * @default "private"
523
523
  */
524
- visibility?: "public" | "private";
524
+ visibility?: 'public' | 'private';
525
525
  /** Callback when an upload completes successfully */
526
526
  onUploadComplete?: (file: FileItem) => void;
527
527
  /** Callback when an upload fails */
@@ -531,7 +531,7 @@ interface UseFileUploadOptions {
531
531
  /** Callback when the file list changes */
532
532
  onFilesChange?: (files: FileItem[]) => void;
533
533
  /** Form mode: 'create' or 'edit' - affects delete behavior */
534
- mode?: "create" | "edit";
534
+ mode?: 'create' | 'edit';
535
535
  }
536
536
  /**
537
537
  * Hook return type
@@ -712,7 +712,7 @@ interface UseAuthReturn {
712
712
  isExpiringSoon: boolean;
713
713
  expiresIn: number;
714
714
  refreshExpiresIn: number;
715
- getTokenInfo: () => ReturnType<SessionContextType["getTokenInfo"]>;
715
+ getTokenInfo: () => ReturnType<SessionContextType['getTokenInfo']>;
716
716
  clearError: () => void;
717
717
  }
718
718
  /**
@@ -903,4 +903,4 @@ declare const useCrudifyWithNotifications: (options?: CrudifyWithNotificationsOp
903
903
  shouldShowNotification: typeof shouldShowNotification;
904
904
  };
905
905
 
906
- export { type FileItem as F, type LoginResult as L, type NotificationOptions as N, SessionManager as S, TokenStorage as T, type UseSessionOptions as U, type SessionConfig as a, type TokenData as b, type StorageType as c, type SessionState as d, SessionProvider as e, useSessionContext as f, SessionDebugInfo as g, type SessionProviderProps as h, useUserData as i, type UseUserDataReturn as j, type UseUserDataOptions as k, type UserData as l, useAuth as m, type UseAuthReturn as n, useData as o, type UseDataReturn as p, useUserProfile as q, useFileUpload as r, type UseFileUploadOptions as s, type UseFileUploadReturn as t, useSession as u, type FileStatus as v, useCrudifyWithNotifications as w };
906
+ export { type FileItem as F, type LoginResult as L, type NotificationOptions as N, type SessionConfig as S, type TokenData as T, type UseAuthReturn as U, type FileStatus as a, SessionDebugInfo as b, SessionManager as c, SessionProvider as d, type SessionProviderProps as e, type SessionState as f, type StorageType as g, TokenStorage as h, type UseDataReturn as i, type UseFileUploadOptions as j, type UseFileUploadReturn as k, type UseSessionOptions as l, type UseUserDataOptions as m, type UseUserDataReturn as n, type UserData as o, useCrudifyWithNotifications as p, useData as q, useFileUpload as r, useSession as s, useSessionContext as t, useAuth as u, useUserData as v, useUserProfile as w };