@xosue-utils/inputs 0.1.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/README.md +169 -0
- package/config/inputs-config.d.ts +18 -0
- package/config/media-adapters.d.ts +24 -0
- package/fesm2022/xosue-utils-inputs.mjs +11332 -0
- package/fesm2022/xosue-utils-inputs.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/boolean-entry/boolean-entry.component.d.ts +35 -0
- package/lib/color-picker/color-picker.component.d.ts +49 -0
- package/lib/color-picker/services/color-picker-modal/color-picker-modal.service.d.ts +23 -0
- package/lib/counter-entry/counter-entry.component.d.ts +37 -0
- package/lib/date-picker/date-picker.component.d.ts +85 -0
- package/lib/date-picker/date-picker.types.d.ts +6 -0
- package/lib/date-picker/services/date-picker-modal/date-picker-modal.service.d.ts +45 -0
- package/lib/datetime-picker/datetime-picker.component.d.ts +93 -0
- package/lib/datetime-picker/services/datetime-picker-modal/datetime-picker-modal.service.d.ts +51 -0
- package/lib/decimal-entry/decimal-entry.component.d.ts +31 -0
- package/lib/email-entry/email-entry.component.d.ts +29 -0
- package/lib/index.d.ts +84 -0
- package/lib/input-overlay-coordinator.service.d.ts +16 -0
- package/lib/integer-entry/integer-entry.component.d.ts +30 -0
- package/lib/media-entry/media-entry.component.d.ts +163 -0
- package/lib/month-picker/month-picker.component.d.ts +78 -0
- package/lib/month-picker/services/month-picker-modal/month-picker-modal.service.d.ts +38 -0
- package/lib/multichoice-entry/multichoice-entry.component.d.ts +28 -0
- package/lib/multiselect-combobox/multiselect-combobox.component.d.ts +100 -0
- package/lib/multiselect-combobox/services/multiselect-combobox-modal/multiselect-combobox-modal.service.d.ts +30 -0
- package/lib/only-select/only-select.component.d.ts +90 -0
- package/lib/only-select/only-select.types.d.ts +9 -0
- package/lib/only-select/services/only-select-modal/only-select-modal.service.d.ts +29 -0
- package/lib/onlychoice-entry/onlychoice-entry.component.d.ts +28 -0
- package/lib/otp-entry/otp-entry.component.d.ts +35 -0
- package/lib/password-entry/password-entry.component.d.ts +34 -0
- package/lib/phone-entry/phone-display.util.d.ts +19 -0
- package/lib/phone-entry/phone-entry.component.d.ts +80 -0
- package/lib/phone-entry/phone-entry.types.d.ts +6 -0
- package/lib/phone-entry/services/phone-entry-modal/phone-entry-modal.service.d.ts +24 -0
- package/lib/price-entry/price-entry.component.d.ts +42 -0
- package/lib/range-entry/range-entry.component.d.ts +74 -0
- package/lib/rating-entry/rating-entry.component.d.ts +25 -0
- package/lib/rich-text-entry/caludy-image.node.d.ts +36 -0
- package/lib/rich-text-entry/lexical-editor-theme.d.ts +3 -0
- package/lib/rich-text-entry/rich-text-entry.component.d.ts +92 -0
- package/lib/search-entry/search-entry.component.d.ts +65 -0
- package/lib/search-entry/search-entry.types.d.ts +8 -0
- package/lib/search-entry/services/search-entry-modal/search-entry-modal.service.d.ts +29 -0
- package/lib/signature-entry/signature-entry.component.d.ts +47 -0
- package/lib/slider-entry/slider-entry.component.d.ts +69 -0
- package/lib/switch-entry/switch-entry.component.d.ts +66 -0
- package/lib/tags-entry/tags-entry.component.d.ts +35 -0
- package/lib/text-area-entry/text-area-entry.component.d.ts +27 -0
- package/lib/text-entry/text-entry.component.d.ts +38 -0
- package/lib/time-picker/services/time-picker-modal/time-picker-modal.service.d.ts +30 -0
- package/lib/time-picker/time-picker.component.d.ts +70 -0
- package/lib/url-entry/url-entry.component.d.ts +29 -0
- package/package.json +55 -0
- package/public-api.d.ts +8 -0
- package/vendor/context-menu-service/context-menu-service.component.d.ts +37 -0
- package/vendor/context-menu-service/context-menu.service.d.ts +63 -0
- package/vendor/drag-scroll.directive.d.ts +10 -0
- package/vendor/field-help-tooltip/field-help-tooltip.component.d.ts +9 -0
- package/vendor/file-size.pipe.d.ts +7 -0
- package/vendor/lucide-icon/lucide-icon.component.d.ts +26 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ElementRef, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
interface FileInfo {
|
|
5
|
+
name: string;
|
|
6
|
+
size: number;
|
|
7
|
+
progress: number;
|
|
8
|
+
status: 'loading' | 'success' | 'error';
|
|
9
|
+
type?: string;
|
|
10
|
+
url?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
/** 'uploading' = subiendo chunks; 'processing' = servidor procesando (resoluciones, etc.) */
|
|
13
|
+
phase?: 'uploading' | 'processing';
|
|
14
|
+
file?: File;
|
|
15
|
+
urlEncrypted?: string;
|
|
16
|
+
chunkNumber?: number;
|
|
17
|
+
uploadedBytes?: number;
|
|
18
|
+
}
|
|
19
|
+
type MediaMode = 'file' | 'image' | 'card';
|
|
20
|
+
export declare class MediaEntryComponent implements ControlValueAccessor, AfterViewInit {
|
|
21
|
+
private cdr;
|
|
22
|
+
private elementRef;
|
|
23
|
+
private sanitizer;
|
|
24
|
+
private readonly inputsConfig;
|
|
25
|
+
private mediaPreview;
|
|
26
|
+
/** Visor de previsualización global (consumido desde la plantilla vía `openGeneralMediaPreview`). */
|
|
27
|
+
readonly generalMediaViewer: import("../../config/media-adapters").XosueUtilsMediaViewer;
|
|
28
|
+
/** Preview de imágenes: hash / uploads / URL absoluta (mismo estado que el resto del front). */
|
|
29
|
+
private readonly backendPreviewImgState;
|
|
30
|
+
label: string;
|
|
31
|
+
opcional: boolean;
|
|
32
|
+
description: string;
|
|
33
|
+
placeholder: string;
|
|
34
|
+
mode: MediaMode;
|
|
35
|
+
display: 'items' | 'cards';
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
maxItems: number;
|
|
38
|
+
maxSize: number | null;
|
|
39
|
+
types: string[];
|
|
40
|
+
extensions: string[];
|
|
41
|
+
endpointUpload?: string;
|
|
42
|
+
/** Tamaño de cada chunk en MB. Por defecto 1.5 MB para no superar upload_max_filesize=2M en muchos servidores. */
|
|
43
|
+
chunkSizeMB: number;
|
|
44
|
+
sortable: boolean;
|
|
45
|
+
primaryTag: boolean;
|
|
46
|
+
previewEndpoint?: string;
|
|
47
|
+
/** Ancho máximo en px para imágenes (opcional). Si no se envía, se conserva el tamaño original. */
|
|
48
|
+
imageMaxWidth?: number;
|
|
49
|
+
/** Altura máxima en px para imágenes (opcional). Si no se envía, no se limita. */
|
|
50
|
+
imageMaxHeight?: number;
|
|
51
|
+
get hostDisabledClass(): boolean;
|
|
52
|
+
set disabled(value: boolean);
|
|
53
|
+
uploadFormRef?: ElementRef<HTMLFormElement>;
|
|
54
|
+
sortableContainer?: ElementRef;
|
|
55
|
+
private sortableInstance?;
|
|
56
|
+
private sortableInitialized;
|
|
57
|
+
pending: FileInfo[];
|
|
58
|
+
uploaded: FileInfo[];
|
|
59
|
+
failed: FileInfo[];
|
|
60
|
+
loading: boolean;
|
|
61
|
+
isDisabled: boolean;
|
|
62
|
+
private dragCounter;
|
|
63
|
+
isDragging: boolean;
|
|
64
|
+
get isImageMode(): boolean;
|
|
65
|
+
get isFileMode(): boolean;
|
|
66
|
+
get isCardMode(): boolean;
|
|
67
|
+
get isCardsDisplay(): boolean;
|
|
68
|
+
get isItemsDisplay(): boolean;
|
|
69
|
+
get defaultTypes(): string[];
|
|
70
|
+
get defaultExtensions(): string[];
|
|
71
|
+
get effectiveTypes(): string[];
|
|
72
|
+
get effectiveExtensions(): string[];
|
|
73
|
+
get allowedTypesText(): string;
|
|
74
|
+
get maxSizeText(): string;
|
|
75
|
+
ngAfterViewInit(): void;
|
|
76
|
+
ngAfterViewChecked(): void;
|
|
77
|
+
private onChange;
|
|
78
|
+
private onTouched;
|
|
79
|
+
writeValue(value: string[] | string | null): void;
|
|
80
|
+
/**
|
|
81
|
+
* Obtiene el tamaño del archivo con HEAD. En modo imagen con hash usa CDN (Cloudflare).
|
|
82
|
+
*/
|
|
83
|
+
private fetchFileSize;
|
|
84
|
+
/**
|
|
85
|
+
* Obtiene la URL de preview para mostrar la imagen.
|
|
86
|
+
* En modo imagen, si url es un hash encriptado, resuelve la URL desde el CDN (Cloudflare).
|
|
87
|
+
* Si no, usa el endpoint de preview del backend.
|
|
88
|
+
*/
|
|
89
|
+
getPreviewUrl(url: string | undefined): string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Obtiene la URL a usar para preview (prioriza urlEncrypted, luego url)
|
|
92
|
+
*/
|
|
93
|
+
private getFileUrl;
|
|
94
|
+
registerOnChange(fn: any): void;
|
|
95
|
+
registerOnTouched(fn: any): void;
|
|
96
|
+
setDisabledState(isDisabled: boolean): void;
|
|
97
|
+
onFileInput(event: Event): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Sube un archivo por chunks usando binarios (multipart/form-data) con ping-pong
|
|
100
|
+
*/
|
|
101
|
+
private uploadFileByChunks;
|
|
102
|
+
/**
|
|
103
|
+
* Espera hasta que el backend termine procesamiento + sync a Cloudflare y devuelva el hash final.
|
|
104
|
+
* Mientras tanto, mantiene el item en "pending" (phase=processing).
|
|
105
|
+
*/
|
|
106
|
+
private pollUploadDone;
|
|
107
|
+
/**
|
|
108
|
+
* Envía un chunk binario al servidor mediante POST multipart/form-data (ping-pong).
|
|
109
|
+
* Todas las subidas (imágenes, vídeos, documentos) usan este flujo por fragmentos binarios.
|
|
110
|
+
*/
|
|
111
|
+
private sendChunkBinary;
|
|
112
|
+
private validateImageFile;
|
|
113
|
+
private extractFileName;
|
|
114
|
+
/**
|
|
115
|
+
* Determina el tipo MIME basándose en la extensión del archivo
|
|
116
|
+
*/
|
|
117
|
+
private getMimeTypeFromFileName;
|
|
118
|
+
/**
|
|
119
|
+
* Construye la URL de preview completa usando el endpoint unificado
|
|
120
|
+
* encryptedHash es el finalUrl (urlEncrypted)
|
|
121
|
+
*
|
|
122
|
+
* Inserta "sdz673fuf7348_sf4" después de los primeros 10 caracteres del hash
|
|
123
|
+
* para que el backend pueda identificarlo y extraer el hash original
|
|
124
|
+
*/
|
|
125
|
+
private buildPreviewUrl;
|
|
126
|
+
/**
|
|
127
|
+
* Abre el preview del archivo mediante `MediaViewerService` (UI en `media-viewer-service`).
|
|
128
|
+
* En modo imagen con hash resuelve la URL desde el CDN (Cloudflare) antes de abrir.
|
|
129
|
+
*/
|
|
130
|
+
openGeneralMediaPreview(fileInfo: FileInfo): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Determina si el archivo se puede previsualizar en el navegador
|
|
133
|
+
* El backend maneja todo, así que solo verificamos si tenemos tipo o nombre
|
|
134
|
+
*/
|
|
135
|
+
canPreview(fileType?: string | null, fileName?: string | null): boolean;
|
|
136
|
+
private viewerModeFor;
|
|
137
|
+
/**
|
|
138
|
+
* Determina si el archivo debe mostrarse en iframe (PDFs y documentos)
|
|
139
|
+
* El backend sirve estos archivos directamente, así que usamos iframe para PDFs y documentos Office
|
|
140
|
+
*/
|
|
141
|
+
shouldUseIframe(fileType?: string | null, fileName?: string | null): boolean;
|
|
142
|
+
private moveToUploaded;
|
|
143
|
+
private moveToFailed;
|
|
144
|
+
private emitValues;
|
|
145
|
+
isAllProcessed(): boolean;
|
|
146
|
+
isPrimary(index: number): boolean;
|
|
147
|
+
removeUploaded(index: number): void;
|
|
148
|
+
removeFailed(index: number): void;
|
|
149
|
+
clearAllUploaded(): void;
|
|
150
|
+
clearAllFailed(): void;
|
|
151
|
+
onDragOver(event: DragEvent): void;
|
|
152
|
+
onDragEnter(event: DragEvent): void;
|
|
153
|
+
onDragLeave(event: DragEvent): void;
|
|
154
|
+
onDrop(event: DragEvent): void;
|
|
155
|
+
statusMessage: string | null;
|
|
156
|
+
statusTimeout?: any;
|
|
157
|
+
showStatusMessage(msg: string, durationMs?: number): void;
|
|
158
|
+
private reorderUploadedFromDOM;
|
|
159
|
+
getFileIcon(type: string | undefined): string;
|
|
160
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MediaEntryComponent, never>;
|
|
161
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MediaEntryComponent, "media-entry", never, { "label": { "alias": "label"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "display": { "alias": "display"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "maxItems": { "alias": "maxItems"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "types": { "alias": "types"; "required": false; }; "extensions": { "alias": "extensions"; "required": false; }; "endpointUpload": { "alias": "endpointUpload"; "required": false; }; "chunkSizeMB": { "alias": "chunkSizeMB"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "primaryTag": { "alias": "primaryTag"; "required": false; }; "previewEndpoint": { "alias": "previewEndpoint"; "required": false; }; "imageMaxWidth": { "alias": "imageMaxWidth"; "required": false; }; "imageMaxHeight": { "alias": "imageMaxHeight"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MonthPickerComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
private monthPickerModal;
|
|
8
|
+
private inputOverlayCoordinator;
|
|
9
|
+
private readonly overlayToken;
|
|
10
|
+
private static readonly modalRootSelector;
|
|
11
|
+
private get hostElement();
|
|
12
|
+
label: string;
|
|
13
|
+
opcional: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
format: string;
|
|
17
|
+
get hostDisabledClass(): boolean;
|
|
18
|
+
set disabled(value: boolean);
|
|
19
|
+
selectionChange: EventEmitter<string>;
|
|
20
|
+
private onChange;
|
|
21
|
+
private onTouched;
|
|
22
|
+
writeValue(value: string | null): void;
|
|
23
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
24
|
+
registerOnTouched(fn: () => void): void;
|
|
25
|
+
setDisabledState(isDisabled: boolean): void;
|
|
26
|
+
selectedValue: string;
|
|
27
|
+
private previousSelectedValue;
|
|
28
|
+
selectedYear: number;
|
|
29
|
+
selectedMonth: number | null;
|
|
30
|
+
currentYear: number;
|
|
31
|
+
years: number[];
|
|
32
|
+
months: number[];
|
|
33
|
+
readonly MONTH_NAMES: string[];
|
|
34
|
+
isDisabled: boolean;
|
|
35
|
+
isFocus: boolean;
|
|
36
|
+
showPicker: boolean;
|
|
37
|
+
showMonths: boolean;
|
|
38
|
+
showYears: boolean;
|
|
39
|
+
ngOnInit(): void;
|
|
40
|
+
ngOnDestroy(): void;
|
|
41
|
+
private setFromDate;
|
|
42
|
+
private updateSelectedValue;
|
|
43
|
+
private parseDate;
|
|
44
|
+
onIncrementMonth(): void;
|
|
45
|
+
onDecrementMonth(): void;
|
|
46
|
+
onIncrementYear(): void;
|
|
47
|
+
onDecrementYear(): void;
|
|
48
|
+
onSelectMonth(month: number): void;
|
|
49
|
+
onSelectYear(year: number): void;
|
|
50
|
+
scrollToCurrentMonth(): void;
|
|
51
|
+
scrollToCurrentYear(): void;
|
|
52
|
+
openMonths(): void;
|
|
53
|
+
openYears(): void;
|
|
54
|
+
toggleShowPicker(e: Event): void;
|
|
55
|
+
private applyCancelState;
|
|
56
|
+
onCancel(): void;
|
|
57
|
+
onAccept(): void;
|
|
58
|
+
onClear(): void;
|
|
59
|
+
private buildModalView;
|
|
60
|
+
private syncModalView;
|
|
61
|
+
private openModalPortal;
|
|
62
|
+
private closeModalPortal;
|
|
63
|
+
private onOverlayDismissedByCoordinator;
|
|
64
|
+
private closePicker;
|
|
65
|
+
private buildHandlers;
|
|
66
|
+
focus(): void;
|
|
67
|
+
defocus(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Simula un click en el input interno (si existe) para enfocarlo.
|
|
70
|
+
* @param event Evento del mouse (opcional).
|
|
71
|
+
*/
|
|
72
|
+
manualClick(event?: MouseEvent): void;
|
|
73
|
+
get selectedDateExtended(): string;
|
|
74
|
+
get formattedSelected(): string;
|
|
75
|
+
private generateYears;
|
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MonthPickerComponent, never>;
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MonthPickerComponent, "month-picker", never, { "label": { "alias": "label"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "format": { "alias": "format"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface MonthPickerModalViewModel {
|
|
3
|
+
selectedValue: string;
|
|
4
|
+
years: number[];
|
|
5
|
+
months: number[];
|
|
6
|
+
showYears: boolean;
|
|
7
|
+
selectedYear: number;
|
|
8
|
+
selectedMonth: number | null;
|
|
9
|
+
MONTH_NAMES: readonly string[];
|
|
10
|
+
selectedDateExtended: string;
|
|
11
|
+
formattedSelected: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MonthPickerModalHandlers {
|
|
14
|
+
toggleShowPicker: (e: Event) => void;
|
|
15
|
+
onSelectYear: (y: number, e: Event) => void;
|
|
16
|
+
onDecrementYear: (e: Event) => void;
|
|
17
|
+
onIncrementYear: (e: Event) => void;
|
|
18
|
+
onSelectMonth: (m: number, e: Event) => void;
|
|
19
|
+
openYears: (e: Event) => void;
|
|
20
|
+
onDecrementMonth: (e: Event) => void;
|
|
21
|
+
onIncrementMonth: (e: Event) => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
onClear: () => void;
|
|
24
|
+
onAccept: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface MonthPickerModalSession {
|
|
27
|
+
view: MonthPickerModalViewModel;
|
|
28
|
+
handlers: MonthPickerModalHandlers;
|
|
29
|
+
}
|
|
30
|
+
export declare class MonthPickerModalService {
|
|
31
|
+
private readonly state;
|
|
32
|
+
readonly state$: import("rxjs").Observable<MonthPickerModalSession>;
|
|
33
|
+
open(session: MonthPickerModalSession): void;
|
|
34
|
+
patchView(patch: Partial<MonthPickerModalViewModel>): void;
|
|
35
|
+
close(): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MonthPickerModalService, never>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MonthPickerModalService>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MultichoiceEntryComponent implements ControlValueAccessor {
|
|
4
|
+
private cdr;
|
|
5
|
+
private elementRef;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
opcional: boolean;
|
|
9
|
+
options: {
|
|
10
|
+
value: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
}[];
|
|
13
|
+
get hostDisabledClass(): boolean;
|
|
14
|
+
set disabled(value: boolean);
|
|
15
|
+
selected: string[] | null;
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
private onChange;
|
|
18
|
+
private onTouched;
|
|
19
|
+
writeValue(value: string[] | null): void;
|
|
20
|
+
registerOnChange(fn: (value: string[] | null) => void): void;
|
|
21
|
+
registerOnTouched(fn: () => void): void;
|
|
22
|
+
setDisabledState(disabled: boolean): void;
|
|
23
|
+
toggle(optionValue: string): void;
|
|
24
|
+
isChecked(optionValue: string): boolean;
|
|
25
|
+
iconClass(optionValue: string): string;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultichoiceEntryComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MultichoiceEntryComponent, "multichoice-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { SelectOption } from '../only-select/only-select.types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type { SelectOption } from '../only-select/only-select.types';
|
|
6
|
+
export declare class MultiselectComboboxComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {
|
|
7
|
+
private cdr;
|
|
8
|
+
private http;
|
|
9
|
+
private readonly inputsConfig;
|
|
10
|
+
private multiselectModal;
|
|
11
|
+
private inputOverlayCoordinator;
|
|
12
|
+
private readonly overlayToken;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
opcional: boolean;
|
|
17
|
+
options: SelectOption[];
|
|
18
|
+
api?: string;
|
|
19
|
+
search: boolean;
|
|
20
|
+
minSearch: number;
|
|
21
|
+
/** Parámetros extra en la query del API (p. ej. exclude_id). */
|
|
22
|
+
apiQueryParams: Record<string, string | number | boolean | null | undefined>;
|
|
23
|
+
/** No cargar catálogo completo al iniciar (útil para listas grandes). */
|
|
24
|
+
deferInitialLoad: boolean;
|
|
25
|
+
/** Mensaje cuando no quedan opciones (lista vacía o sin resultados de búsqueda). */
|
|
26
|
+
noOptionsMessage: string;
|
|
27
|
+
get hostDisabledClass(): boolean;
|
|
28
|
+
set disabled(value: boolean);
|
|
29
|
+
selectionChange: EventEmitter<SelectOption[]>;
|
|
30
|
+
isOpenOptions: boolean;
|
|
31
|
+
isFocus: boolean;
|
|
32
|
+
isDisabled: boolean;
|
|
33
|
+
filteredOptions: SelectOption[];
|
|
34
|
+
selectedOptions: SelectOption[];
|
|
35
|
+
private internalOptions;
|
|
36
|
+
private pendingValues;
|
|
37
|
+
private apiReady;
|
|
38
|
+
searchQuery: string;
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
isSearching: boolean;
|
|
41
|
+
private searchSubject;
|
|
42
|
+
private fetchSubject;
|
|
43
|
+
private searchSubscription?;
|
|
44
|
+
private fetchSubscription?;
|
|
45
|
+
private onChange;
|
|
46
|
+
private onTouched;
|
|
47
|
+
writeValue(values: string[] | null): void;
|
|
48
|
+
registerOnChange(fn: (value: string[]) => void): void;
|
|
49
|
+
registerOnTouched(fn: () => void): void;
|
|
50
|
+
setDisabledState(isDisabled: boolean): void;
|
|
51
|
+
private propagateChanges;
|
|
52
|
+
private resolvePendingSelection;
|
|
53
|
+
private buildApiUrl;
|
|
54
|
+
private requestApi;
|
|
55
|
+
ngOnInit(): void;
|
|
56
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
57
|
+
ngOnDestroy(): void;
|
|
58
|
+
onSearchChange(e: Event): void;
|
|
59
|
+
/**
|
|
60
|
+
* Filtra opciones locales (método auxiliar para búsqueda con debounce)
|
|
61
|
+
*/
|
|
62
|
+
private filterLocalOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Calcula un score de relevancia para una opción basado en la búsqueda.
|
|
65
|
+
* - Score más alto = mejor coincidencia
|
|
66
|
+
* - Coincidencia exacta: 100
|
|
67
|
+
* - Comienza con la búsqueda: 80
|
|
68
|
+
* - Contiene la búsqueda: 60
|
|
69
|
+
* - Coincidencia en descripción: 40
|
|
70
|
+
* - Sin coincidencia: 0
|
|
71
|
+
*/
|
|
72
|
+
private calculateRelevanceScore;
|
|
73
|
+
/**
|
|
74
|
+
* Obtiene los headers de autenticación para las peticiones HTTP.
|
|
75
|
+
*/
|
|
76
|
+
private getAuthHeaders;
|
|
77
|
+
private fetchFromApi;
|
|
78
|
+
private loadLocalOptions;
|
|
79
|
+
private buildModalView;
|
|
80
|
+
private syncModalView;
|
|
81
|
+
private openModalPortal;
|
|
82
|
+
private closeModalPortal;
|
|
83
|
+
private onOverlayDismissedByCoordinator;
|
|
84
|
+
/** Quitar chip desde el modal sin propagar el click al backdrop. */
|
|
85
|
+
private removeSelectedFromModal;
|
|
86
|
+
onOptionToggle(option: SelectOption, event: Event): void;
|
|
87
|
+
removeSelected(option: SelectOption): void;
|
|
88
|
+
isSelected(option: SelectOption): boolean;
|
|
89
|
+
toggleOpenOptions(e: Event): void;
|
|
90
|
+
shouldShowSearchInput(): boolean;
|
|
91
|
+
focus(): void;
|
|
92
|
+
defocus(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Simula un click en el input interno (si existe) para enfocarlo.
|
|
95
|
+
* @param event Evento del mouse (opcional).
|
|
96
|
+
*/
|
|
97
|
+
manualClick(event?: MouseEvent): void;
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiselectComboboxComponent, never>;
|
|
99
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MultiselectComboboxComponent, "multiselect-combobox", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "options": { "alias": "options"; "required": false; }; "api": { "alias": "api"; "required": false; }; "search": { "alias": "search"; "required": false; }; "minSearch": { "alias": "minSearch"; "required": false; }; "apiQueryParams": { "alias": "apiQueryParams"; "required": false; }; "deferInitialLoad": { "alias": "deferInitialLoad"; "required": false; }; "noOptionsMessage": { "alias": "noOptionsMessage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SelectOption } from '../../../only-select/only-select.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface MultiselectComboboxModalViewModel {
|
|
4
|
+
searchQuery: string;
|
|
5
|
+
filteredOptions: SelectOption[];
|
|
6
|
+
selectedOptions: SelectOption[];
|
|
7
|
+
shouldShowSearch: boolean;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
isSearching: boolean;
|
|
10
|
+
noOptionsMessage: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MultiselectComboboxModalHandlers {
|
|
13
|
+
onSearchInput: (e: Event) => void;
|
|
14
|
+
onBackdropClick: (e: Event) => void;
|
|
15
|
+
onOptionToggle: (option: SelectOption, event: Event) => void;
|
|
16
|
+
onRemoveSelected: (option: SelectOption, event: Event) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface MultiselectComboboxModalSession {
|
|
19
|
+
view: MultiselectComboboxModalViewModel;
|
|
20
|
+
handlers: MultiselectComboboxModalHandlers;
|
|
21
|
+
}
|
|
22
|
+
export declare class MultiselectComboboxModalService {
|
|
23
|
+
private readonly state;
|
|
24
|
+
readonly state$: import("rxjs").Observable<MultiselectComboboxModalSession>;
|
|
25
|
+
open(session: MultiselectComboboxModalSession): void;
|
|
26
|
+
patchView(patch: Partial<MultiselectComboboxModalViewModel>): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiselectComboboxModalService, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MultiselectComboboxModalService>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { SelectOption } from './only-select.types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type { SelectOption } from './only-select.types';
|
|
6
|
+
export declare class OnlySelectComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {
|
|
7
|
+
private cdr;
|
|
8
|
+
private http;
|
|
9
|
+
private readonly inputsConfig;
|
|
10
|
+
private onlySelectModal;
|
|
11
|
+
private inputOverlayCoordinator;
|
|
12
|
+
private readonly overlayToken;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
opcional: boolean;
|
|
17
|
+
options: SelectOption[];
|
|
18
|
+
/** Texto de ayuda mostrado al pulsar el botón de información. */
|
|
19
|
+
fieldHelp: string;
|
|
20
|
+
api?: string;
|
|
21
|
+
search: boolean;
|
|
22
|
+
minSearch: number;
|
|
23
|
+
/** Mensaje cuando no quedan opciones (lista vacía o sin resultados de búsqueda). */
|
|
24
|
+
noOptionsMessage: string;
|
|
25
|
+
get hostDisabledClass(): boolean;
|
|
26
|
+
set disabled(value: boolean);
|
|
27
|
+
selectionChange: EventEmitter<SelectOption>;
|
|
28
|
+
isOpenOptions: boolean;
|
|
29
|
+
isFocus: boolean;
|
|
30
|
+
isDisabled: boolean;
|
|
31
|
+
filteredOptions: SelectOption[];
|
|
32
|
+
selectedOption: SelectOption | null;
|
|
33
|
+
private internalOptions;
|
|
34
|
+
private pendingValue;
|
|
35
|
+
searchQuery: string;
|
|
36
|
+
isLoading: boolean;
|
|
37
|
+
isSearching: boolean;
|
|
38
|
+
private searchSubject;
|
|
39
|
+
private searchSubscription?;
|
|
40
|
+
private onChange;
|
|
41
|
+
private onTouched;
|
|
42
|
+
writeValue(value: string | null): void;
|
|
43
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
44
|
+
registerOnTouched(fn: () => void): void;
|
|
45
|
+
setDisabledState(isDisabled: boolean): void;
|
|
46
|
+
private propagateChanges;
|
|
47
|
+
ngOnInit(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Obtiene los headers de autenticación para las peticiones HTTP.
|
|
50
|
+
*/
|
|
51
|
+
private getAuthHeaders;
|
|
52
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
53
|
+
ngOnDestroy(): void;
|
|
54
|
+
onSearchChange(e: Event): void;
|
|
55
|
+
/**
|
|
56
|
+
* Filtra opciones locales (método auxiliar para búsqueda con debounce)
|
|
57
|
+
*/
|
|
58
|
+
private filterLocalOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Calcula un score de relevancia para una opción basado en la búsqueda.
|
|
61
|
+
* - Score más alto = mejor coincidencia
|
|
62
|
+
* - Coincidencia exacta: 100
|
|
63
|
+
* - Comienza con la búsqueda: 80
|
|
64
|
+
* - Contiene la búsqueda: 60
|
|
65
|
+
* - Coincidencia en descripción: 40
|
|
66
|
+
* - Sin coincidencia: 0
|
|
67
|
+
*/
|
|
68
|
+
private calculateRelevanceScore;
|
|
69
|
+
private fetchFromApi;
|
|
70
|
+
private loadLocalOptions;
|
|
71
|
+
private buildModalView;
|
|
72
|
+
private syncModalView;
|
|
73
|
+
private openModalPortal;
|
|
74
|
+
private closeModalPortal;
|
|
75
|
+
private onOverlayDismissedByCoordinator;
|
|
76
|
+
onOptionToggle(option: SelectOption): void;
|
|
77
|
+
removeSelected(): void;
|
|
78
|
+
isSelected(option: SelectOption): boolean;
|
|
79
|
+
toggleOpenOptions(e: Event): void;
|
|
80
|
+
shouldShowSearchInput(): boolean;
|
|
81
|
+
focus(): void;
|
|
82
|
+
defocus(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Simula un click en el input interno (si existe) para enfocarlo.
|
|
85
|
+
* @param event Evento del mouse (opcional).
|
|
86
|
+
*/
|
|
87
|
+
manualClick(event?: MouseEvent): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OnlySelectComponent, never>;
|
|
89
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OnlySelectComponent, "only-select", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "options": { "alias": "options"; "required": false; }; "fieldHelp": { "alias": "fieldHelp"; "required": false; }; "api": { "alias": "api"; "required": false; }; "search": { "alias": "search"; "required": false; }; "minSearch": { "alias": "minSearch"; "required": false; }; "noOptionsMessage": { "alias": "noOptionsMessage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SelectOption } from '../../only-select.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface OnlySelectModalViewModel {
|
|
4
|
+
searchQuery: string;
|
|
5
|
+
filteredOptions: SelectOption[];
|
|
6
|
+
selectedOption: SelectOption | null;
|
|
7
|
+
shouldShowSearch: boolean;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
isSearching: boolean;
|
|
10
|
+
noOptionsMessage: string;
|
|
11
|
+
}
|
|
12
|
+
export interface OnlySelectModalHandlers {
|
|
13
|
+
onSearchInput: (e: Event) => void;
|
|
14
|
+
onBackdropClick: (e: Event) => void;
|
|
15
|
+
onOptionSelect: (option: SelectOption) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface OnlySelectModalSession {
|
|
18
|
+
view: OnlySelectModalViewModel;
|
|
19
|
+
handlers: OnlySelectModalHandlers;
|
|
20
|
+
}
|
|
21
|
+
export declare class OnlySelectModalService {
|
|
22
|
+
private readonly state;
|
|
23
|
+
readonly state$: import("rxjs").Observable<OnlySelectModalSession>;
|
|
24
|
+
open(session: OnlySelectModalSession): void;
|
|
25
|
+
patchView(patch: Partial<OnlySelectModalViewModel>): void;
|
|
26
|
+
close(): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OnlySelectModalService, never>;
|
|
28
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OnlySelectModalService>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class OnlychoiceEntryComponent implements ControlValueAccessor {
|
|
4
|
+
private cdr;
|
|
5
|
+
private elementRef;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
opcional: boolean;
|
|
9
|
+
options: {
|
|
10
|
+
value: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
}[];
|
|
13
|
+
get hostDisabledClass(): boolean;
|
|
14
|
+
set disabled(value: boolean);
|
|
15
|
+
selected: string | null;
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
private onChange;
|
|
18
|
+
private onTouched;
|
|
19
|
+
writeValue(value: string | null): void;
|
|
20
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
21
|
+
registerOnTouched(fn: () => void): void;
|
|
22
|
+
setDisabledState(disabled: boolean): void;
|
|
23
|
+
toggle(optionValue: string): void;
|
|
24
|
+
isChecked(optionValue: string): boolean;
|
|
25
|
+
iconClass(optionValue: string): string;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OnlychoiceEntryComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OnlychoiceEntryComponent, "onlychoice-entry", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ElementRef, QueryList, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class OtpEntryComponent implements ControlValueAccessor, AfterViewInit {
|
|
5
|
+
private cdr;
|
|
6
|
+
private elementRef;
|
|
7
|
+
length: number;
|
|
8
|
+
label: string;
|
|
9
|
+
opcional: boolean;
|
|
10
|
+
description: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
get hostDisabledClass(): boolean;
|
|
13
|
+
set disabled(value: boolean);
|
|
14
|
+
inputs: QueryList<ElementRef<HTMLInputElement>>;
|
|
15
|
+
isDisabled: boolean;
|
|
16
|
+
values: string[];
|
|
17
|
+
ngAfterViewInit(): void;
|
|
18
|
+
private onChange;
|
|
19
|
+
private onTouched;
|
|
20
|
+
writeValue(value: string | null): void;
|
|
21
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
22
|
+
registerOnTouched(fn: () => void): void;
|
|
23
|
+
setDisabledState(disabled: boolean): void;
|
|
24
|
+
onInput(event: Event, index: number): void;
|
|
25
|
+
onKeyDown(event: KeyboardEvent, index: number): void;
|
|
26
|
+
handlePaste(event: ClipboardEvent): void;
|
|
27
|
+
private resetValues;
|
|
28
|
+
private updateInputs;
|
|
29
|
+
private updateInput;
|
|
30
|
+
private focus;
|
|
31
|
+
private emit;
|
|
32
|
+
manualClick(event?: MouseEvent): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OtpEntryComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OtpEntryComponent, "otp-entry", never, { "length": { "alias": "length"; "required": false; }; "label": { "alias": "label"; "required": false; }; "opcional": { "alias": "opcional"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
35
|
+
}
|