@telcomdev/ui 0.1.17 → 0.1.18
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 +80 -0
- package/fesm2022/telcomdev-ui.mjs +540 -1
- package/fesm2022/telcomdev-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/telcomdev-ui.d.ts +151 -2
package/package.json
CHANGED
package/types/telcomdev-ui.d.ts
CHANGED
|
@@ -610,6 +610,97 @@ declare class TdFileViewerService {
|
|
|
610
610
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TdFileViewerService>;
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
+
type TdFileUploadVariant = 'input' | 'dropzone';
|
|
614
|
+
type TdFileUploadValue = File | File[] | null;
|
|
615
|
+
type TdFileUploadRejectReason = 'type' | 'size' | 'maxFiles';
|
|
616
|
+
type TdFileUploadPreviewKind = 'image' | 'pdf' | 'file';
|
|
617
|
+
interface TdFileUploadItem {
|
|
618
|
+
id: string;
|
|
619
|
+
file: File;
|
|
620
|
+
name: string;
|
|
621
|
+
size: number;
|
|
622
|
+
sizeLabel: string;
|
|
623
|
+
type: string;
|
|
624
|
+
extension: string;
|
|
625
|
+
previewKind: TdFileUploadPreviewKind;
|
|
626
|
+
previewUrl?: string;
|
|
627
|
+
}
|
|
628
|
+
interface TdFileUploadRejected {
|
|
629
|
+
file: File;
|
|
630
|
+
reason: TdFileUploadRejectReason;
|
|
631
|
+
message: string;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
declare class TdFileUpload implements ControlValueAccessor {
|
|
635
|
+
private readonly cdr;
|
|
636
|
+
private readonly viewer;
|
|
637
|
+
private readonly generatedId;
|
|
638
|
+
private nativeInput?;
|
|
639
|
+
id: string;
|
|
640
|
+
label: string;
|
|
641
|
+
placeholder: string;
|
|
642
|
+
description: string;
|
|
643
|
+
hint: string;
|
|
644
|
+
accept: string;
|
|
645
|
+
multiple: boolean;
|
|
646
|
+
maxFiles: number;
|
|
647
|
+
maxSizeMb: number;
|
|
648
|
+
variant: TdFileUploadVariant;
|
|
649
|
+
showPreview: boolean;
|
|
650
|
+
clearable: boolean;
|
|
651
|
+
disabled: boolean;
|
|
652
|
+
readonly: boolean;
|
|
653
|
+
required: boolean;
|
|
654
|
+
error: string;
|
|
655
|
+
dark: boolean;
|
|
656
|
+
readonly valueChange: EventEmitter<TdFileUploadValue>;
|
|
657
|
+
readonly filesChange: EventEmitter<File[]>;
|
|
658
|
+
readonly rejected: EventEmitter<TdFileUploadRejected[]>;
|
|
659
|
+
readonly preview: EventEmitter<TdFileUploadItem>;
|
|
660
|
+
readonly removed: EventEmitter<TdFileUploadItem>;
|
|
661
|
+
protected items: TdFileUploadItem[];
|
|
662
|
+
protected dragging: boolean;
|
|
663
|
+
protected touched: boolean;
|
|
664
|
+
protected rejectedItems: TdFileUploadRejected[];
|
|
665
|
+
private onChange;
|
|
666
|
+
private onTouched;
|
|
667
|
+
protected get inputId(): string;
|
|
668
|
+
protected get isDisabled(): boolean;
|
|
669
|
+
protected get selectedText(): string;
|
|
670
|
+
protected get acceptText(): string;
|
|
671
|
+
protected get hasError(): boolean;
|
|
672
|
+
protected get message(): string;
|
|
673
|
+
writeValue(value: TdFileUploadValue): void;
|
|
674
|
+
registerOnChange(fn: (value: TdFileUploadValue) => void): void;
|
|
675
|
+
registerOnTouched(fn: () => void): void;
|
|
676
|
+
setDisabledState(disabled: boolean): void;
|
|
677
|
+
protected browse(): void;
|
|
678
|
+
protected handleInput(event: Event): void;
|
|
679
|
+
protected handleDragOver(event: DragEvent): void;
|
|
680
|
+
protected handleDragLeave(event: DragEvent): void;
|
|
681
|
+
protected handleDrop(event: DragEvent): void;
|
|
682
|
+
protected remove(item: TdFileUploadItem, event?: MouseEvent): void;
|
|
683
|
+
protected clear(event?: MouseEvent): void;
|
|
684
|
+
protected markTouched(): void;
|
|
685
|
+
protected openPreview(item: TdFileUploadItem, event?: MouseEvent): Promise<void>;
|
|
686
|
+
protected iconFor(item: TdFileUploadItem): string;
|
|
687
|
+
private addFiles;
|
|
688
|
+
private resolveAvailableSlots;
|
|
689
|
+
private validateType;
|
|
690
|
+
private validateSize;
|
|
691
|
+
private emitValue;
|
|
692
|
+
private createItem;
|
|
693
|
+
private extensionOf;
|
|
694
|
+
private typeFromExtension;
|
|
695
|
+
private formatSize;
|
|
696
|
+
private fileToDataUrl;
|
|
697
|
+
private isLeavingHost;
|
|
698
|
+
private revokePreviewUrls;
|
|
699
|
+
private revokePreviewUrl;
|
|
700
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TdFileUpload, never>;
|
|
701
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TdFileUpload, "td-file-upload", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "description": { "alias": "description"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "maxFiles": { "alias": "maxFiles"; "required": false; }; "maxSizeMb": { "alias": "maxSizeMb"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "showPreview": { "alias": "showPreview"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "error": { "alias": "error"; "required": false; }; "dark": { "alias": "dark"; "required": false; }; }, { "valueChange": "valueChange"; "filesChange": "filesChange"; "rejected": "rejected"; "preview": "preview"; "removed": "removed"; }, never, never, true, never>;
|
|
702
|
+
}
|
|
703
|
+
|
|
613
704
|
interface TdHeaderNotificacion {
|
|
614
705
|
id: string | number;
|
|
615
706
|
titulo: string;
|
|
@@ -1103,6 +1194,64 @@ declare class TdTextarea implements AfterViewInit, ControlValueAccessor, FormVal
|
|
|
1103
1194
|
static ngAcceptInputType_autoResize: unknown;
|
|
1104
1195
|
}
|
|
1105
1196
|
|
|
1197
|
+
type TdRadioDirection = 'vertical' | 'horizontal';
|
|
1198
|
+
type TdRadioVariant = 'default' | 'card';
|
|
1199
|
+
interface TdRadioOption<T = unknown> {
|
|
1200
|
+
value: T;
|
|
1201
|
+
label: string;
|
|
1202
|
+
description?: string;
|
|
1203
|
+
icon?: string;
|
|
1204
|
+
disabled?: boolean;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
declare class TdRadioGroup<T = unknown> implements ControlValueAccessor, FormValueControl<T | null> {
|
|
1208
|
+
private readonly cdr;
|
|
1209
|
+
private readonly formBridge;
|
|
1210
|
+
private readonly generatedName;
|
|
1211
|
+
options: TdRadioOption<T>[];
|
|
1212
|
+
label: string;
|
|
1213
|
+
hint: string;
|
|
1214
|
+
dark: boolean;
|
|
1215
|
+
direction: TdRadioDirection;
|
|
1216
|
+
variant: TdRadioVariant;
|
|
1217
|
+
compareWith: (first: T | null, second: T | null) => boolean;
|
|
1218
|
+
readonly name: _angular_core.InputSignal<string>;
|
|
1219
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
1220
|
+
readonly disabledReasons: _angular_core.InputSignal<readonly WithOptionalFieldTree<DisabledReason>[]>;
|
|
1221
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
1222
|
+
readonly hidden: _angular_core.InputSignal<boolean>;
|
|
1223
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
1224
|
+
readonly pending: _angular_core.InputSignal<boolean>;
|
|
1225
|
+
readonly dirty: _angular_core.InputSignal<boolean>;
|
|
1226
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
1227
|
+
readonly errors: _angular_core.InputSignal<readonly WithOptionalFieldTree<ValidationError>[]>;
|
|
1228
|
+
readonly touched: _angular_core.ModelSignal<boolean>;
|
|
1229
|
+
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
1230
|
+
readonly error: _angular_core.InputSignal<string>;
|
|
1231
|
+
readonly errorDisplay: _angular_core.InputSignal<TdErrorDisplay>;
|
|
1232
|
+
readonly value: _angular_core.ModelSignal<T | null>;
|
|
1233
|
+
readonly selectionChange: EventEmitter<T | null>;
|
|
1234
|
+
protected readonly isDisabled: _angular_core.Signal<boolean>;
|
|
1235
|
+
protected readonly fieldError: _angular_core.Signal<string>;
|
|
1236
|
+
protected readonly shouldDisplayFieldError: _angular_core.Signal<boolean>;
|
|
1237
|
+
protected readonly displayError: _angular_core.Signal<string>;
|
|
1238
|
+
protected readonly hasError: _angular_core.Signal<boolean>;
|
|
1239
|
+
private onChange;
|
|
1240
|
+
protected get groupName(): string;
|
|
1241
|
+
protected get messageId(): string | null;
|
|
1242
|
+
writeValue(value: T | null): void;
|
|
1243
|
+
registerOnChange(fn: (value: T | null) => void): void;
|
|
1244
|
+
registerOnTouched(fn: () => void): void;
|
|
1245
|
+
setDisabledState(disabled: boolean): void;
|
|
1246
|
+
protected isSelected(option: TdRadioOption<T>): boolean;
|
|
1247
|
+
protected optionId(index: number): string;
|
|
1248
|
+
protected select(option: TdRadioOption<T>): void;
|
|
1249
|
+
protected handleKeydown(event: KeyboardEvent, index: number): void;
|
|
1250
|
+
protected markTouched(): void;
|
|
1251
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TdRadioGroup<any>, never>;
|
|
1252
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TdRadioGroup<any>, "td-radio-group", never, { "options": { "alias": "options"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "dark": { "alias": "dark"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledReasons": { "alias": "disabledReasons"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "pending": { "alias": "pending"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorDisplay": { "alias": "errorDisplay"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "touched": "touchedChange"; "touch": "touch"; "value": "valueChange"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1106
1255
|
interface TdSelectOption<T = unknown> {
|
|
1107
1256
|
value: T;
|
|
1108
1257
|
label: string;
|
|
@@ -1418,5 +1567,5 @@ declare class TdThemeService {
|
|
|
1418
1567
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TdThemeService>;
|
|
1419
1568
|
}
|
|
1420
1569
|
|
|
1421
|
-
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TD_THEME_DARK_COLORS, TD_THEME_LIGHT_COLORS, TdAlerta, TdAutocompleteSelect, TdButton, TdCheckbox, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFileViewer, TdFileViewerService, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdMenu, TdSelect, TdSidebar, TdTab, TdTabs, TdTextarea, TdThemeService, TelcomdevUi, createTdFormControlBridge };
|
|
1422
|
-
export type { MenuSidebar, TdAlertaOpciones, TdAlertaTipo, TdButtonSize, TdButtonTone, TdButtonType, TdButtonVariant, TdDataTableAccion, TdDataTableAccionEvento, TdDataTableAccionesPresentacion, TdDataTableAlineacion, TdDataTableBoton, TdDataTableColumna, TdDataTableImagenConfig, TdDataTableImagenEvento, TdDataTableImagenForma, TdDataTableTipoColumna, TdDataTableTono, TdDatePickerMode, TdDatePickerValue, TdDateRange, TdDialogConfig, TdDialogPanelData, TdDialogRefLike, TdDialogTamano, TdErrorDisplay, TdFileAttachment, TdFileSource, TdFileViewerArchivo, TdFileViewerKind, TdFileViewerOpenOptions, TdFormControlBridge, TdHeaderAccionPerfil, TdHeaderNotificacion, TdIconoDefinicion, TdIconoNombre, TdIconoPersonalizado, TdInputEmptyValue, TdInputMask, TdInputSanitize, TdInputSanitizeFn, TdInputSanitizePreset, TdInputValue, TdMenuItem, TdMenuPosicion, TdMenuSeleccion, TdMenuTono, TdSelectAppearance, TdSelectOption, TdSelectOverflowText, TdSelectScrollBehavior, TdSidebarModoCerrado, TdSidebarSeleccion, TdTabsAlignment, TdTabsVariant, TdTextareaEmptyValue, TdTextareaValue, TdThemeMode, TdThemePaletteColor };
|
|
1570
|
+
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TD_THEME_DARK_COLORS, TD_THEME_LIGHT_COLORS, TdAlerta, TdAutocompleteSelect, TdButton, TdCheckbox, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFileUpload, TdFileViewer, TdFileViewerService, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdMenu, TdRadioGroup, TdSelect, TdSidebar, TdTab, TdTabs, TdTextarea, TdThemeService, TelcomdevUi, createTdFormControlBridge };
|
|
1571
|
+
export type { MenuSidebar, TdAlertaOpciones, TdAlertaTipo, TdButtonSize, TdButtonTone, TdButtonType, TdButtonVariant, TdDataTableAccion, TdDataTableAccionEvento, TdDataTableAccionesPresentacion, TdDataTableAlineacion, TdDataTableBoton, TdDataTableColumna, TdDataTableImagenConfig, TdDataTableImagenEvento, TdDataTableImagenForma, TdDataTableTipoColumna, TdDataTableTono, TdDatePickerMode, TdDatePickerValue, TdDateRange, TdDialogConfig, TdDialogPanelData, TdDialogRefLike, TdDialogTamano, TdErrorDisplay, TdFileAttachment, TdFileSource, TdFileUploadItem, TdFileUploadPreviewKind, TdFileUploadRejectReason, TdFileUploadRejected, TdFileUploadValue, TdFileUploadVariant, TdFileViewerArchivo, TdFileViewerKind, TdFileViewerOpenOptions, TdFormControlBridge, TdHeaderAccionPerfil, TdHeaderNotificacion, TdIconoDefinicion, TdIconoNombre, TdIconoPersonalizado, TdInputEmptyValue, TdInputMask, TdInputSanitize, TdInputSanitizeFn, TdInputSanitizePreset, TdInputValue, TdMenuItem, TdMenuPosicion, TdMenuSeleccion, TdMenuTono, TdRadioDirection, TdRadioOption, TdRadioVariant, TdSelectAppearance, TdSelectOption, TdSelectOverflowText, TdSelectScrollBehavior, TdSidebarModoCerrado, TdSidebarSeleccion, TdTabsAlignment, TdTabsVariant, TdTextareaEmptyValue, TdTextareaValue, TdThemeMode, TdThemePaletteColor };
|