ln-20-lib-components 0.0.10 → 0.0.12
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/fesm2022/ln-20-lib-components-selected-items-management.component-xRoZB_NZ.mjs +86 -0
- package/fesm2022/ln-20-lib-components-selected-items-management.component-xRoZB_NZ.mjs.map +1 -0
- package/fesm2022/ln-20-lib-components.mjs +2364 -57
- package/fesm2022/ln-20-lib-components.mjs.map +1 -1
- package/lib/components/origin/aminated-container/aminated-container.component.d.ts +6 -0
- package/lib/components/origin/disabled-container/disabled-container.component.d.ts +6 -0
- package/lib/components/origin/form/components/custom-input/custom-input.component.d.ts +25 -0
- package/lib/components/origin/form/components/form-child/form-child.component.d.ts +13 -0
- package/lib/components/origin/form/components/inline-input/inline-input.component.d.ts +78 -0
- package/lib/components/origin/form/components/inline-input/interfaces/index.d.ts +26 -0
- package/lib/components/origin/form/enums/index.d.ts +36 -0
- package/lib/components/origin/form/form.component.d.ts +19 -0
- package/lib/components/origin/form/index.d.ts +4 -0
- package/lib/components/origin/form/interfaces/index.d.ts +58 -0
- package/lib/components/origin/http-message/http-message.component.d.ts +10 -0
- package/lib/components/origin/http-message/interfaces/index.d.ts +11 -0
- package/lib/components/origin/index.d.ts +1 -2
- package/lib/components/origin/pick-list/interfaces/index.d.ts +12 -0
- package/lib/components/prime-ng/badge/badge-ng.component.d.ts +11 -0
- package/lib/components/prime-ng/badge/interfaces/index.d.ts +8 -0
- package/lib/components/prime-ng/button-ng/button-ng.component.d.ts +1 -1
- package/lib/components/prime-ng/button-ng/interfaces/index.d.ts +1 -1
- package/lib/components/prime-ng/dynamic-dialog/components/base-dialog.component.d.ts +21 -0
- package/lib/components/prime-ng/index.d.ts +2 -0
- package/lib/components/prime-ng/interfaces/index.d.ts +12 -0
- package/lib/components/prime-ng/table-ng/components/selected-items-management/selected-items-management.component.d.ts +17 -0
- package/lib/components/prime-ng/table-ng/interfaces/index.d.ts +191 -0
- package/lib/components/prime-ng/table-ng/services/table-ng-edit.service.d.ts +17 -0
- package/lib/components/prime-ng/table-ng/services/table-ng-general.service.d.ts +7 -0
- package/lib/components/prime-ng/table-ng/services/table-ng.service.d.ts +32 -0
- package/lib/components/prime-ng/table-ng/table-ng.component.d.ts +162 -0
- package/lib/components/prime-ng/toolbar-ng/toolbar-ng.component.d.ts +5 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/pipes/key-to-display-name.pipe.d.ts +7 -0
- package/lib/utils/api-error.util.d.ts +58 -0
- package/lib/utils/cookie.util.d.ts +37 -0
- package/lib/utils/currency.util.d.ts +1 -0
- package/lib/utils/date.util.d.ts +3 -0
- package/lib/utils/documents.util.d.ts +88 -0
- package/lib/utils/id.util.d.ts +1 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/number.util.d.ts +2 -0
- package/lib/utils/objects.util.d.ts +20 -0
- package/lib/utils/prime-ng.util.d.ts +3 -0
- package/ln-20-lib-components-0.0.12.tgz +0 -0
- package/package.json +1 -1
- package/lib/components/origin/button/button.component.d.ts +0 -11
- package/lib/components/origin/empty-message/empty-message.component.d.ts +0 -6
- package/ln-20-lib-components-0.0.10.tgz +0 -0
- package/ln-20-lib-components-0.0.9.tgz +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Signal, WritableSignal } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import type { SortEvent } from 'primeng/api';
|
|
4
|
+
import type { Table } from 'primeng/table';
|
|
5
|
+
import type { IControlConfig } from '../../../origin/form/interfaces';
|
|
6
|
+
import type { IButtonConfig } from '../../button-ng/interfaces';
|
|
7
|
+
import type { IGlobalSearchForm, ITableNgConfig, ITableNgData } from '../interfaces';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class TableNgService {
|
|
10
|
+
private readonly tableNgGeneralService;
|
|
11
|
+
private readonly filterService;
|
|
12
|
+
private initialValue;
|
|
13
|
+
constructor();
|
|
14
|
+
get MOCK_EMPTY_DATE(): Date;
|
|
15
|
+
setInitialValue(data: ITableNgData[]): void;
|
|
16
|
+
customSort(event: SortEvent): void;
|
|
17
|
+
private getFieldValue;
|
|
18
|
+
private compareValues;
|
|
19
|
+
private fb;
|
|
20
|
+
controls: Signal<IControlConfig[]>;
|
|
21
|
+
searchFormGroup: WritableSignal<FormGroup<IGlobalSearchForm>>;
|
|
22
|
+
values: Signal<Partial<{
|
|
23
|
+
search?: string | undefined;
|
|
24
|
+
}> | undefined>;
|
|
25
|
+
submitGlobalSearch(formGroup: FormGroup<IGlobalSearchForm>, dt: Table): void;
|
|
26
|
+
clearSearchInput(): void;
|
|
27
|
+
openModalManagementSelectedItems(selectedItems: WritableSignal<ITableNgData[]>, config?: ITableNgConfig): Promise<void>;
|
|
28
|
+
excelButton: Signal<IButtonConfig>;
|
|
29
|
+
pdfButton: Signal<IButtonConfig>;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableNgService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TableNgService>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { OnDestroy, OnInit, Signal, TemplateRef, WritableSignal } from '@angular/core';
|
|
2
|
+
import { type FormGroup } from '@angular/forms';
|
|
3
|
+
import type { SortEvent } from 'primeng/api';
|
|
4
|
+
import type { Table, TableFilterEvent, TableLazyLoadEvent } from 'primeng/table';
|
|
5
|
+
import { ETypeInput } from '../../origin/form/enums';
|
|
6
|
+
import type { IControlConfig } from '../../origin/form/interfaces';
|
|
7
|
+
import type { IHttpMessage } from '../../origin/http-message/interfaces';
|
|
8
|
+
import type { IPickListElement } from '../../origin/pick-list/interfaces';
|
|
9
|
+
import type { IButtonConfig } from '../button-ng/interfaces';
|
|
10
|
+
import type { IEditTableNgConfig, IErrorConfig, IFooterConfig, IGlobalSearchForm, ILazyLoadResponse, IPipeConfig, ITableNgConfig, ITableNgData } from './interfaces';
|
|
11
|
+
import { IPrimeNgSelection } from '../interfaces';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
export declare class TableNgComponent<T extends Record<string, any> = Record<string, any>> implements OnInit, OnDestroy {
|
|
14
|
+
private readonly tableNgService;
|
|
15
|
+
private readonly tableNgEditService;
|
|
16
|
+
readonly data: import("@angular/core").ModelSignal<ITableNgData<T, unknown>[]>;
|
|
17
|
+
private loadingTimeout;
|
|
18
|
+
protected isLoading: WritableSignal<boolean>;
|
|
19
|
+
protected timeoutExpired: WritableSignal<boolean>;
|
|
20
|
+
readonly config: import("@angular/core").ModelSignal<ITableNgConfig | undefined>;
|
|
21
|
+
readonly editConfig: import("@angular/core").ModelSignal<IEditTableNgConfig<T> | undefined>;
|
|
22
|
+
readonly footerConfig: import("@angular/core").ModelSignal<IFooterConfig | undefined>;
|
|
23
|
+
toolbarButtons: import("@angular/core").ModelSignal<IButtonConfig<any>[]>;
|
|
24
|
+
sourceElements: import("@angular/core").ModelSignal<IPickListElement[]>;
|
|
25
|
+
targetElements: import("@angular/core").ModelSignal<IPickListElement[]>;
|
|
26
|
+
httpMessage: import("@angular/core").ModelSignal<IHttpMessage | undefined>;
|
|
27
|
+
lazyLoading: import("@angular/core").OutputEmitterRef<ILazyLoadResponse>;
|
|
28
|
+
outputChangeData: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>[]>;
|
|
29
|
+
outputHandleEditInitButton: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>>;
|
|
30
|
+
outputAddRow: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>[]>;
|
|
31
|
+
outputDeleteRow: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>>;
|
|
32
|
+
outputRowInlineChange: import("@angular/core").OutputEmitterRef<T>;
|
|
33
|
+
outputRowDataChange: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>>;
|
|
34
|
+
outputEditData: import("@angular/core").OutputEmitterRef<ITableNgData<T, unknown>[]>;
|
|
35
|
+
outputIsEditing: import("@angular/core").OutputEmitterRef<boolean>;
|
|
36
|
+
resetData(): void;
|
|
37
|
+
advancedFiltersPerformed: string[];
|
|
38
|
+
advancedFiltersValues: WritableSignal<Record<string, Record<string, any>>>;
|
|
39
|
+
dt: Table;
|
|
40
|
+
private readonly fb;
|
|
41
|
+
constructor();
|
|
42
|
+
ngOnInit(): void;
|
|
43
|
+
ngOnDestroy(): void;
|
|
44
|
+
get hideToolbar(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Calcula el número total de columnas para el colspan del mensaje vacío
|
|
47
|
+
*/
|
|
48
|
+
protected totalColumns: Signal<number>;
|
|
49
|
+
isPrimeNgSelection(value: any): boolean;
|
|
50
|
+
hasErrorValues(object: Record<string, IErrorConfig>): boolean;
|
|
51
|
+
private rowFieldsValue;
|
|
52
|
+
rowFieldsHasValue: Signal<Record<string, boolean>>;
|
|
53
|
+
inlineChange(value: string | number | boolean | null | IPrimeNgSelection<string | boolean>, key: string): void;
|
|
54
|
+
trackById(index: number, item: {
|
|
55
|
+
id: any;
|
|
56
|
+
}): any;
|
|
57
|
+
frozenHandle(value: boolean | undefined): boolean;
|
|
58
|
+
isDate(value: any): boolean;
|
|
59
|
+
onFilter(event: TableFilterEvent): void;
|
|
60
|
+
resetRowDatas(): void;
|
|
61
|
+
get ETypeInput(): typeof ETypeInput;
|
|
62
|
+
handleAdvancedFiltersPerformed(filters: TableFilterEvent['filters']): void;
|
|
63
|
+
numberOfRecords: Signal<number>;
|
|
64
|
+
hasRecords: Signal<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Computed que valida si al menos una fila tiene datos válidos en rowData.
|
|
67
|
+
* Retorna true si al menos una fila tiene un valor que no sea '', null o undefined.
|
|
68
|
+
* Retorna false si todas las filas tienen valores vacíos, null o undefined.
|
|
69
|
+
*/
|
|
70
|
+
hasValidRowData: Signal<boolean>;
|
|
71
|
+
readonly keys: Signal<string[]>;
|
|
72
|
+
onRowClick(item: ITableNgData<T>): void;
|
|
73
|
+
protected scrollHeight: Signal<string>;
|
|
74
|
+
private parseValue;
|
|
75
|
+
paginatorStyleClass: Signal<string>;
|
|
76
|
+
showBottomToolbar: Signal<boolean>;
|
|
77
|
+
clearFilters(): void;
|
|
78
|
+
get filteredValue(): boolean;
|
|
79
|
+
clearFiltersButton: Signal<IButtonConfig>;
|
|
80
|
+
get controlsGlobalFilter(): IControlConfig[];
|
|
81
|
+
get searchFormGroupGlobalFilter(): FormGroup;
|
|
82
|
+
submitGlobalSearch(formGroup: FormGroup<IGlobalSearchForm>): void;
|
|
83
|
+
customSort(event: SortEvent): void;
|
|
84
|
+
selectedItems: import("@angular/core").ModelSignal<ITableNgData<T, unknown>[]>;
|
|
85
|
+
protected totalItemsSelected: Signal<number>;
|
|
86
|
+
protected showManagementSelectionConfig: Signal<boolean>;
|
|
87
|
+
protected buttonTotalItemsSelected: Signal<IButtonConfig>;
|
|
88
|
+
protected showSelectedItemsManagementButton: Signal<IButtonConfig>;
|
|
89
|
+
openModalManagementSelectedItems(): void;
|
|
90
|
+
inlineFormChanges(inlineValue: unknown, filter: (value: any) => void, typeInput?: ETypeInput, key?: string): void;
|
|
91
|
+
formChanges(formValue: Record<string, any>, filter: (value: any) => void, key: string): void;
|
|
92
|
+
rowDataKey(key: string): string;
|
|
93
|
+
onLazyLoad(event: TableLazyLoadEvent): void;
|
|
94
|
+
private getFiltersWithValue;
|
|
95
|
+
onCellValueChange(): void;
|
|
96
|
+
onRowDataChange(_data: ITableNgData<T>): void;
|
|
97
|
+
onEditData(): void;
|
|
98
|
+
get controlsEdit(): IControlConfig[];
|
|
99
|
+
get searchFormGroupEdit(): FormGroup;
|
|
100
|
+
customControlConfig(key: string, value: any): IControlConfig;
|
|
101
|
+
cellFormGroup: FormGroup;
|
|
102
|
+
addRowButton: Signal<IButtonConfig>;
|
|
103
|
+
addRow(): void;
|
|
104
|
+
private defaultTableNgData;
|
|
105
|
+
private clonedRowData;
|
|
106
|
+
private editingRowId;
|
|
107
|
+
/**
|
|
108
|
+
* Verifica si una fila específica está siendo editada
|
|
109
|
+
*/
|
|
110
|
+
isRowEditing(id: string): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Verifica si hay alguna fila siendo editada actualmente
|
|
113
|
+
*/
|
|
114
|
+
get hasRowInEdit(): boolean;
|
|
115
|
+
onRowEditInit(data: ITableNgData<T>): void;
|
|
116
|
+
private setEditingRowId;
|
|
117
|
+
onRowEditSave(_data: ITableNgData<T>): void;
|
|
118
|
+
onRowEditCancel(data: ITableNgData<T>, index: number): void;
|
|
119
|
+
private updateDataWithTableValue;
|
|
120
|
+
editInitButton: Signal<IButtonConfig>;
|
|
121
|
+
getEditInitButton(productId: string): IButtonConfig;
|
|
122
|
+
editSaveButton: Signal<IButtonConfig>;
|
|
123
|
+
editSaveButtonWithErrors: Signal<IButtonConfig>;
|
|
124
|
+
enableErrors: boolean;
|
|
125
|
+
setEnableErrors(value: boolean): void;
|
|
126
|
+
onEditSaveWithErrors(): void;
|
|
127
|
+
editCancelButton: Signal<IButtonConfig>;
|
|
128
|
+
deleteRowButton: Signal<IButtonConfig>;
|
|
129
|
+
getDeleteRowButton(): IButtonConfig;
|
|
130
|
+
removeRowFromData(data: ITableNgData<T>): void;
|
|
131
|
+
deleteRow(data: ITableNgData<T>): void;
|
|
132
|
+
get footerRows(): import("ln-20-lib-components").IFooterRow[][];
|
|
133
|
+
applyPipe(value: any, pipeConfig?: IPipeConfig): string;
|
|
134
|
+
protected rowExpansionButton(isRowExpanded: boolean): Signal<IButtonConfig>;
|
|
135
|
+
itemTemplateInput: import("@angular/core").InputSignal<TemplateRef<{
|
|
136
|
+
$implicit: T;
|
|
137
|
+
}> | null>;
|
|
138
|
+
itemTemplate: TemplateRef<{
|
|
139
|
+
$implicit: T;
|
|
140
|
+
}>;
|
|
141
|
+
get currentItemTemplate(): TemplateRef<{
|
|
142
|
+
$implicit: T;
|
|
143
|
+
}> | null;
|
|
144
|
+
isThatItemInTheProductSelection(field: string): boolean;
|
|
145
|
+
advancedIdentifierFiltersButton: Signal<IButtonConfig>;
|
|
146
|
+
openAdvancedIdentifierFilters(): void;
|
|
147
|
+
private handleTableValueToSourceElements;
|
|
148
|
+
private handleSelectedItemsToSourceElements;
|
|
149
|
+
private identifiersSelected;
|
|
150
|
+
get excelButton(): IButtonConfig;
|
|
151
|
+
get pdfButton(): IButtonConfig;
|
|
152
|
+
private lazyLoadingConfig;
|
|
153
|
+
private isEnabledLazyLoading;
|
|
154
|
+
private prepareDataForExport;
|
|
155
|
+
exportCSV(data: Record<string, T>[]): void;
|
|
156
|
+
protected exportData(dt: Table, endpoint: 'excel' | 'pdf'): void;
|
|
157
|
+
exportPDF(data: Record<string, T>[]): void;
|
|
158
|
+
enableExcelButton: Signal<boolean>;
|
|
159
|
+
enablePdfButton: Signal<boolean>;
|
|
160
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableNgComponent<any>, never>;
|
|
161
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableNgComponent<any>, "app-table-ng", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "editConfig": { "alias": "editConfig"; "required": false; "isSignal": true; }; "footerConfig": { "alias": "footerConfig"; "required": false; "isSignal": true; }; "toolbarButtons": { "alias": "toolbarButtons"; "required": false; "isSignal": true; }; "sourceElements": { "alias": "sourceElements"; "required": false; "isSignal": true; }; "targetElements": { "alias": "targetElements"; "required": false; "isSignal": true; }; "httpMessage": { "alias": "httpMessage"; "required": false; "isSignal": true; }; "selectedItems": { "alias": "selectedItems"; "required": false; "isSignal": true; }; "itemTemplateInput": { "alias": "itemTemplateInput"; "required": false; "isSignal": true; }; }, { "data": "dataChange"; "config": "configChange"; "editConfig": "editConfigChange"; "footerConfig": "footerConfigChange"; "toolbarButtons": "toolbarButtonsChange"; "sourceElements": "sourceElementsChange"; "targetElements": "targetElementsChange"; "httpMessage": "httpMessageChange"; "lazyLoading": "lazyLoading"; "outputChangeData": "outputChangeData"; "outputHandleEditInitButton": "outputHandleEditInitButton"; "outputAddRow": "outputAddRow"; "outputDeleteRow": "outputDeleteRow"; "outputRowInlineChange": "outputRowInlineChange"; "outputRowDataChange": "outputRowDataChange"; "outputEditData": "outputEditData"; "outputIsEditing": "outputIsEditing"; "selectedItems": "selectedItemsChange"; }, ["itemTemplate"], never, true, never>;
|
|
162
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ToolbarNgComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarNgComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarNgComponent, "app-toolbar-ng", never, {}, {}, never, ["[toolbarStart]", "[toolbarCenter]", "[toolbarEnd]"], true, never>;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './key-to-display-name.pipe';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class KeyToDisplayNamePipe implements PipeTransform {
|
|
4
|
+
transform(key: string, keysNames?: Record<string, string>): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KeyToDisplayNamePipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<KeyToDisplayNamePipe, "keyToDisplayName", true>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
+
export interface IApiError {
|
|
3
|
+
errorCode: string;
|
|
4
|
+
message: string[] | string;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
errors: IFieldError[];
|
|
7
|
+
}
|
|
8
|
+
export interface IFieldError {
|
|
9
|
+
field: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Utilidades para manejar errores de API según la interfaz IApiError
|
|
14
|
+
*/
|
|
15
|
+
export declare class ApiErrorUtil {
|
|
16
|
+
/**
|
|
17
|
+
* Procesa errores de API y extrae el mensaje según la interfaz IApiError
|
|
18
|
+
* @param error - El error HTTP recibido
|
|
19
|
+
* @param fallbackMessage - Mensaje por defecto si no se puede extraer el mensaje del error
|
|
20
|
+
* @returns El mensaje de error procesado
|
|
21
|
+
*/
|
|
22
|
+
static handleApiError(error: HttpErrorResponse, fallbackMessage: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Procesa errores de API con información detallada de campos
|
|
25
|
+
* y muestra tanto el mensaje general como los errores específicos de campo
|
|
26
|
+
* @param error - El error HTTP recibido
|
|
27
|
+
* @param fallbackMessage - Mensaje por defecto si no se puede extraer el mensaje del error
|
|
28
|
+
* @returns El mensaje de error procesado con información de campos si está disponible
|
|
29
|
+
*/
|
|
30
|
+
static handleApiErrorWithFields(error: HttpErrorResponse, fallbackMessage: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Obtiene solo los errores de campo específicos
|
|
33
|
+
* @param error - El error HTTP recibido
|
|
34
|
+
* @returns Array de errores de campo o array vacío si no hay errores
|
|
35
|
+
*/
|
|
36
|
+
static getFieldErrors(error: HttpErrorResponse): Array<{
|
|
37
|
+
field: string;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Verifica si el error tiene errores de campo específicos
|
|
42
|
+
* @param error - El error HTTP recibido
|
|
43
|
+
* @returns true si hay errores de campo, false en caso contrario
|
|
44
|
+
*/
|
|
45
|
+
static hasFieldErrors(error: HttpErrorResponse): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Obtiene el código de error específico
|
|
48
|
+
* @param error - El error HTTP recibido
|
|
49
|
+
* @returns El código de error o undefined si no está disponible
|
|
50
|
+
*/
|
|
51
|
+
static getErrorCode(error: HttpErrorResponse): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Obtiene el timestamp del error
|
|
54
|
+
* @param error - El error HTTP recibido
|
|
55
|
+
* @returns El timestamp del error o undefined si no está disponible
|
|
56
|
+
*/
|
|
57
|
+
static getErrorTimestamp(error: HttpErrorResponse): string | undefined;
|
|
58
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare class CookieUtil {
|
|
2
|
+
/**
|
|
3
|
+
* Obtiene el valor de una cookie por su nombre
|
|
4
|
+
* @param name - Nombre de la cookie
|
|
5
|
+
* @returns El valor de la cookie o null si no existe
|
|
6
|
+
*/
|
|
7
|
+
static getCookie(name: string): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Establece una cookie
|
|
10
|
+
* @param name - Nombre de la cookie
|
|
11
|
+
* @param value - Valor de la cookie
|
|
12
|
+
* @param days - Días hasta que expire (por defecto 365)
|
|
13
|
+
* @param path - Ruta de la cookie (por defecto '/')
|
|
14
|
+
*/
|
|
15
|
+
static setCookie(name: string, value: string, days?: number, path?: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Elimina una cookie
|
|
18
|
+
* @param name - Nombre de la cookie a eliminar
|
|
19
|
+
* @param path - Ruta de la cookie (por defecto '/')
|
|
20
|
+
*/
|
|
21
|
+
static eraseCookie(name: string, path?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Obtiene un valor booleano desde una cookie
|
|
24
|
+
* @param name - Nombre de la cookie
|
|
25
|
+
* @param defaultValue - Valor por defecto si la cookie no existe
|
|
26
|
+
* @returns El valor booleano
|
|
27
|
+
*/
|
|
28
|
+
static getBooleanCookie(name: string, defaultValue?: boolean): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Establece un valor booleano en una cookie
|
|
31
|
+
* @param name - Nombre de la cookie
|
|
32
|
+
* @param value - Valor booleano
|
|
33
|
+
* @param days - Días hasta que expire (por defecto 365)
|
|
34
|
+
* @param path - Ruta de la cookie (por defecto '/')
|
|
35
|
+
*/
|
|
36
|
+
static setBooleanCookie(name: string, value: boolean, days?: number, path?: string): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatCurrency: (amount: number, currency: string) => string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum con los tipos de archivos más relevantes para la aplicación
|
|
3
|
+
*/
|
|
4
|
+
export declare enum EFileType {
|
|
5
|
+
PDF = "application/pdf",
|
|
6
|
+
DOC = "application/msword",
|
|
7
|
+
DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
8
|
+
XLS = "application/vnd.ms-excel",
|
|
9
|
+
XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
10
|
+
PPT = "application/vnd.ms-powerpoint",
|
|
11
|
+
PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
12
|
+
TXT = "text/plain",
|
|
13
|
+
RTF = "application/rtf",
|
|
14
|
+
JPG = "image/jpeg",
|
|
15
|
+
PNG = "image/png",
|
|
16
|
+
GIF = "image/gif",
|
|
17
|
+
BMP = "image/bmp",
|
|
18
|
+
SVG = "image/svg+xml",
|
|
19
|
+
WEBP = "image/webp",
|
|
20
|
+
ZIP = "application/zip",
|
|
21
|
+
RAR = "application/vnd.rar",
|
|
22
|
+
TAR = "application/x-tar",
|
|
23
|
+
GZ = "application/gzip",
|
|
24
|
+
CSV = "text/csv",
|
|
25
|
+
JSON = "application/json",
|
|
26
|
+
XML = "application/xml",
|
|
27
|
+
MP3 = "audio/mpeg",
|
|
28
|
+
WAV = "audio/wav",
|
|
29
|
+
OGG = "audio/ogg",
|
|
30
|
+
MP4 = "video/mp4",
|
|
31
|
+
AVI = "video/x-msvideo",
|
|
32
|
+
MOV = "video/quicktime",
|
|
33
|
+
WMV = "video/x-ms-wmv",
|
|
34
|
+
ALL_IMAGES = "image/*",
|
|
35
|
+
ALL_DOCUMENTS = "application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,text/plain,application/rtf",
|
|
36
|
+
ALL_FILES = "*/*"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Interfaz para el callback del archivo seleccionado
|
|
40
|
+
*/
|
|
41
|
+
export interface IFileSelectedCallback {
|
|
42
|
+
(file: File): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Interfaz para las opciones del trigger de archivo
|
|
46
|
+
*/
|
|
47
|
+
export interface ITriggerFileInputOptions {
|
|
48
|
+
accept?: EFileType;
|
|
49
|
+
multiple?: boolean;
|
|
50
|
+
onFileSelected?: IFileSelectedCallback;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Método mejorado para abrir el selector de archivos
|
|
54
|
+
* @param options - Opciones para configurar el input de archivo
|
|
55
|
+
*/
|
|
56
|
+
export declare const triggerFileInput: (options?: ITriggerFileInputOptions) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Interfaz para las opciones de captura de cámara
|
|
59
|
+
*/
|
|
60
|
+
export interface ICameraOptions {
|
|
61
|
+
width?: number;
|
|
62
|
+
height?: number;
|
|
63
|
+
quality?: number;
|
|
64
|
+
facingMode?: 'user' | 'environment';
|
|
65
|
+
onPhotoTaken?: (file: File) => void;
|
|
66
|
+
onError?: (error: Error) => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Función para capturar una foto usando la cámara
|
|
70
|
+
*/
|
|
71
|
+
export declare const capturePhotoFromCamera: (options?: ICameraOptions) => Promise<void>;
|
|
72
|
+
declare enum EFileIcons {
|
|
73
|
+
FILE = "file",
|
|
74
|
+
IMAGE = "image",
|
|
75
|
+
VIDEO = "video",
|
|
76
|
+
FOLDER = "folder",
|
|
77
|
+
EXCEL = "excel",
|
|
78
|
+
SIGNATURE = "signature",
|
|
79
|
+
CONTRACT = "contract",
|
|
80
|
+
FINGERPRINT = "fingerprint",
|
|
81
|
+
ID_CARD = "id_card",
|
|
82
|
+
FILE_BOX = "file_box",
|
|
83
|
+
SECURE_BUILDING = "secure_building",
|
|
84
|
+
POLICE = "police"
|
|
85
|
+
}
|
|
86
|
+
export declare const DocumentIcon: Record<EFileIcons, string>;
|
|
87
|
+
export declare const downloadFile: (blob: Blob, fileName: string) => void;
|
|
88
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateId: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './api-error.util';
|
|
2
|
+
export * from './cookie.util';
|
|
3
|
+
export * from './currency.util';
|
|
4
|
+
export * from './date.util';
|
|
5
|
+
export * from './documents.util';
|
|
6
|
+
export * from './id.util';
|
|
7
|
+
export * from './number.util';
|
|
8
|
+
export * from './objects.util';
|
|
9
|
+
export * from './prime-ng.util';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IPrimeNgSelection } from '../components/prime-ng/interfaces';
|
|
2
|
+
export declare const hasValues: (obj: Record<string, any>) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Elimina las propiedades de un objeto que tengan valores null o undefined.
|
|
5
|
+
* Retorna un nuevo objeto sin mutar el original.
|
|
6
|
+
* @param obj - Objeto del cual se eliminarán las propiedades null/undefined
|
|
7
|
+
* @returns Nuevo objeto sin las propiedades con valores null o undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare const removeNullUndefined: <T extends Record<string, any>>(obj: T) => Partial<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Realiza un upsert en un array de strings. Si el string ya existe, no hace nada.
|
|
12
|
+
* Si no existe, lo agrega al array.
|
|
13
|
+
* @param targetArray - Array de strings donde se realizará el upsert
|
|
14
|
+
* @param value - String o array de strings a insertar
|
|
15
|
+
* @returns Array actualizado con los nuevos valores
|
|
16
|
+
*/
|
|
17
|
+
export declare const upsertArrayStrings: (targetArray: string[], value: string | string[]) => string[];
|
|
18
|
+
export declare const sameArray: (arr1: unknown[], arr2: unknown[]) => boolean;
|
|
19
|
+
export declare const getOptionByCode: <T>(options: IPrimeNgSelection<T>[], code: T | undefined) => IPrimeNgSelection<T> | undefined;
|
|
20
|
+
export declare const createEnumeratedList: (items: string[]) => string;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ButtonComponent implements OnInit {
|
|
4
|
-
variant: 'primary' | 'secondary';
|
|
5
|
-
disabled: boolean;
|
|
6
|
-
onClick: EventEmitter<void>;
|
|
7
|
-
constructor();
|
|
8
|
-
ngOnInit(): void;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "lib-button", never, { "variant": { "alias": "variant"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onClick": "onClick"; }, never, ["*"], true, never>;
|
|
11
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class EmptyMessageComponent {
|
|
3
|
-
message: import("@angular/core").InputSignal<string>;
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EmptyMessageComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EmptyMessageComponent, "lib-empty-message", never, { "message": { "alias": "message"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6
|
-
}
|
|
Binary file
|
|
Binary file
|