ngx-dsxlibrary 2.21.74 → 2.21.76

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.
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "ngx-dsxlibrary",
4
- "version": "2.21.74",
4
+ "version": "2.21.76",
5
5
  "description": "Libreria para control de código automatizado.",
6
6
  "author": "DevSoftXela",
7
7
  "dependencies": {
@@ -143,14 +143,32 @@ declare class DocxPreviewComponent {
143
143
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DocxPreviewComponent, "app-docx-preview", never, { "visible": { "alias": "visible"; "required": false; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; }, { "visibleChange": "visibleChange"; }, never, never, true, never>;
144
144
  }
145
145
 
146
+ type SupportedMimeType = 'application/pdf' | 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
146
147
  declare class PdfPreviewComponent implements OnDestroy {
147
148
  private sanitizer;
148
149
  visible: _angular_core.ModelSignal<boolean>;
149
150
  blob: _angular_core.InputSignal<Blob | null>;
150
151
  private objectUrl;
151
- pdfUrl: SafeResourceUrl | null;
152
+ fileUrl: SafeResourceUrl | null;
153
+ fileType: SupportedMimeType | null;
154
+ fileName: string;
155
+ fileSize: string;
156
+ private rawBlob;
157
+ private readonly mimeTypeMap;
158
+ private readonly supportedTypes;
159
+ private readonly iconMap;
152
160
  constructor(sanitizer: DomSanitizer);
161
+ private isFileSupported;
162
+ private getFileNameFromBlob;
163
+ private formatFileSize;
153
164
  private limpiarUrlAnterior;
165
+ get isPdf(): boolean;
166
+ get isImage(): boolean;
167
+ get fileTypeLabel(): string;
168
+ getFileIcon(): string;
169
+ downloadFile(): void;
170
+ onImageLoad(): void;
171
+ onImageError(): void;
154
172
  ngOnDestroy(): void;
155
173
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PdfPreviewComponent, never>;
156
174
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PdfPreviewComponent, "app-pdf-preview", never, { "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "blob": { "alias": "blob"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; }, never, never, true, never>;
@@ -17,6 +17,11 @@ declare function createInitialCache<T extends Record<string, string>>(cacheKeys:
17
17
  -readonly [K in keyof T as T[K]]: boolean;
18
18
  };
19
19
 
20
+ interface Holiday {
21
+ dateHoliday: Date | string;
22
+ labelHoliday: string;
23
+ }
24
+
20
25
  interface ExportColumn {
21
26
  title: string;
22
27
  dataKey: string;
@@ -248,4 +253,4 @@ interface DsxValidateUnique {
248
253
  }
249
254
 
250
255
  export { createInitialCache };
251
- export type { AutoCompleteCompleteEvent, Certificacion, Column, Complemento, Complementos, DatosEmision, DatosGenerales, Direccion, DocumentoFelResponse, DsxValidateUnique, Dte, Emisor, ExportColumn, FechasConversion, FilterOption, Frase, Frases, Impuesto, Impuestos, InferCacheKeyType, InferCacheOptions, Item, Items, NITResponse, NumeroAutorizacion, Receptor, ResponseHttpModel, Sat, ServiceResult, ServiceResultVoid, T, TipoFechaConversion, TotalImpuesto, Totales, typeModel };
256
+ export type { AutoCompleteCompleteEvent, Certificacion, Column, Complemento, Complementos, DatosEmision, DatosGenerales, Direccion, DocumentoFelResponse, DsxValidateUnique, Dte, Emisor, ExportColumn, FechasConversion, FilterOption, Frase, Frases, Holiday, Impuesto, Impuestos, InferCacheKeyType, InferCacheOptions, Item, Items, NITResponse, NumeroAutorizacion, Receptor, ResponseHttpModel, Sat, ServiceResult, ServiceResultVoid, T, TipoFechaConversion, TotalImpuesto, Totales, typeModel };
@@ -31,4 +31,25 @@ declare const GTQFormatter: Intl.NumberFormat;
31
31
  */
32
32
  declare function createCurrencyFormatter(locale: string, currency: string): Intl.NumberFormat;
33
33
 
34
- export { GTQFormatter, createCurrencyFormatter };
34
+ /**
35
+ * Guarda un valor en localStorage
36
+ * Soporta: strings, números, objetos, arrays, null, undefined
37
+ */
38
+ declare function setStorage<T>(key: string, value: T): void;
39
+ /**
40
+ * Obtiene un valor desde localStorage
41
+ * @param defaultValue - Valor por defecto si no existe la clave
42
+ * @returns El valor guardado o el defaultValue
43
+ */
44
+ declare function getStorage<T>(key: string, defaultValue?: T): T | undefined;
45
+ declare function setStorageObject<T extends Record<string, any>>(key: string, values?: Partial<T>, merge?: boolean): void;
46
+ /**
47
+ * 🆕 Función para eliminar una clave del storage
48
+ */
49
+ declare function removeStorage(key: string): void;
50
+ /**
51
+ * 🆕 Función para verificar si existe una clave en el storage
52
+ */
53
+ declare function hasStorage(key: string): boolean;
54
+
55
+ export { GTQFormatter, createCurrencyFormatter, getStorage, hasStorage, removeStorage, setStorage, setStorageObject };