@corp-products/ui-components 4.2.8 → 4.3.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/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Button } from 'primeng/button';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { TemplateRef, OnInit, EventEmitter, PipeTransform, OnDestroy, AfterViewInit, SimpleChanges, Type, EnvironmentInjector, ApplicationRef, ViewContainerRef,
|
|
3
|
+
import { TemplateRef, OnInit, EventEmitter, PipeTransform, OnDestroy, AfterViewInit, OnChanges, SimpleChanges, Type, EnvironmentInjector, ApplicationRef, ViewContainerRef, ElementRef, Renderer2 } from '@angular/core';
|
|
4
4
|
import { Params, Router, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import { DynamicDialogRef, DialogService, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
|
6
6
|
import { FormGroup, FormControl, ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
7
|
-
import { AutoCompleteSelectEvent, AutoCompleteCompleteEvent } from 'primeng/autocomplete';
|
|
8
7
|
import * as rxjs from 'rxjs';
|
|
9
8
|
import { Subject, Observable } from 'rxjs';
|
|
9
|
+
import { AutoCompleteSelectEvent, AutoCompleteCompleteEvent } from 'primeng/autocomplete';
|
|
10
10
|
import { SelectButtonChangeEvent } from 'primeng/selectbutton';
|
|
11
11
|
import { SelectChangeEvent } from 'primeng/select';
|
|
12
12
|
import { MenuItem } from 'primeng/api';
|
|
@@ -345,6 +345,104 @@ declare class SwitchComponent {
|
|
|
345
345
|
static ɵcmp: i0.ɵɵComponentDeclaration<SwitchComponent, "stc-switch", never, { "label": { "alias": "label"; "required": false; }; "key": { "alias": "key"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; }, { "onChange": "onChange"; }, never, never, true, never>;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
interface FileUploadResponse {
|
|
349
|
+
documentId: string;
|
|
350
|
+
[key: string]: any;
|
|
351
|
+
}
|
|
352
|
+
interface FileUploadState {
|
|
353
|
+
isUploading: boolean;
|
|
354
|
+
documentId: string | null;
|
|
355
|
+
hasFile: boolean;
|
|
356
|
+
}
|
|
357
|
+
interface AttachmentFile {
|
|
358
|
+
id: string;
|
|
359
|
+
fileName: string;
|
|
360
|
+
size: number;
|
|
361
|
+
mimeType: string;
|
|
362
|
+
createdDate?: string;
|
|
363
|
+
createdBy?: UserProfileData;
|
|
364
|
+
createdByDepartment?: Department;
|
|
365
|
+
}
|
|
366
|
+
interface UploadProgress {
|
|
367
|
+
fileId: string;
|
|
368
|
+
fileName: string;
|
|
369
|
+
progress: number;
|
|
370
|
+
status: UploadStatus;
|
|
371
|
+
error?: string;
|
|
372
|
+
response?: AttachmentFile;
|
|
373
|
+
}
|
|
374
|
+
interface Department {
|
|
375
|
+
id: string;
|
|
376
|
+
nameAr: string;
|
|
377
|
+
nameEn: string;
|
|
378
|
+
}
|
|
379
|
+
interface FileItem extends AttachmentFile {
|
|
380
|
+
progress?: number;
|
|
381
|
+
status?: UploadStatus;
|
|
382
|
+
error?: string;
|
|
383
|
+
file?: File;
|
|
384
|
+
isNew?: boolean;
|
|
385
|
+
}
|
|
386
|
+
interface DownloadRequest {
|
|
387
|
+
attachmentIds: string[];
|
|
388
|
+
}
|
|
389
|
+
interface FileTypeConfig {
|
|
390
|
+
icon: string;
|
|
391
|
+
iconPathCount: number;
|
|
392
|
+
colorClass?: string;
|
|
393
|
+
}
|
|
394
|
+
interface PdfPreviewState {
|
|
395
|
+
visible: boolean;
|
|
396
|
+
blob: Blob | null;
|
|
397
|
+
fileName: string;
|
|
398
|
+
}
|
|
399
|
+
interface Attachment {
|
|
400
|
+
id?: string;
|
|
401
|
+
nameFile: string;
|
|
402
|
+
size: number;
|
|
403
|
+
url?: string | ArrayBuffer | null;
|
|
404
|
+
file?: File;
|
|
405
|
+
isCanceled?: boolean;
|
|
406
|
+
uploadStatus?: UploadStatus;
|
|
407
|
+
status?: AttachmentStatusDisplay;
|
|
408
|
+
serverResponse?: unknown;
|
|
409
|
+
errorMessage?: string;
|
|
410
|
+
}
|
|
411
|
+
interface AttachmentStatusDisplay {
|
|
412
|
+
icon: string;
|
|
413
|
+
label: string;
|
|
414
|
+
labelClass?: string;
|
|
415
|
+
percentage?: number;
|
|
416
|
+
success?: boolean;
|
|
417
|
+
}
|
|
418
|
+
declare enum UploadStatus {
|
|
419
|
+
PENDING = "pending",
|
|
420
|
+
SUCCESS = "success",
|
|
421
|
+
UPLOADING = "uploading",
|
|
422
|
+
FAILED = "failed"
|
|
423
|
+
}
|
|
424
|
+
interface UserProfileData {
|
|
425
|
+
contact: Contact;
|
|
426
|
+
position: Position;
|
|
427
|
+
email: string;
|
|
428
|
+
profileImage: string;
|
|
429
|
+
nameEn: string;
|
|
430
|
+
nameAr: string;
|
|
431
|
+
}
|
|
432
|
+
interface Contact {
|
|
433
|
+
mobile: string;
|
|
434
|
+
work: string;
|
|
435
|
+
}
|
|
436
|
+
interface Position {
|
|
437
|
+
code: string;
|
|
438
|
+
name: string;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
interface FileUploadConfig {
|
|
442
|
+
uploadFn: (file: File) => Observable<FileUploadResponse>;
|
|
443
|
+
acceptedTypes?: string;
|
|
444
|
+
maxFileSize?: number;
|
|
445
|
+
}
|
|
348
446
|
type InputType = 'text' | 'textarea' | 'number';
|
|
349
447
|
type InputContentType = 'text' | 'email' | 'number';
|
|
350
448
|
interface Dropdown<T = unknown> {
|
|
@@ -400,6 +498,7 @@ interface InputsMapData {
|
|
|
400
498
|
minLengthToSearch?: number;
|
|
401
499
|
delay?: number;
|
|
402
500
|
allowedDomains?: string[] | undefined;
|
|
501
|
+
fileUpload?: FileUploadConfig;
|
|
403
502
|
}
|
|
404
503
|
interface InputsMap {
|
|
405
504
|
[key: string]: InputsMapData;
|
|
@@ -411,6 +510,7 @@ interface DynamicFormData {
|
|
|
411
510
|
title?: string;
|
|
412
511
|
isReadOnlyForm?: boolean;
|
|
413
512
|
formValidationErrorsKeys?: string[];
|
|
513
|
+
fileUpload?: FileUploadConfig;
|
|
414
514
|
}
|
|
415
515
|
interface DateRangeInterface {
|
|
416
516
|
min?: Date | null;
|
|
@@ -445,12 +545,17 @@ declare class ConfirmationDialogComponent extends DynamicDialogRef implements On
|
|
|
445
545
|
private readonly _subscription;
|
|
446
546
|
dialogFormData: DynamicFormData;
|
|
447
547
|
uploadedFile: any;
|
|
548
|
+
documentId: string | null;
|
|
549
|
+
uploadState: FileUploadState;
|
|
550
|
+
get hasFileUpload(): boolean;
|
|
551
|
+
get isConfirmDisabled(): boolean;
|
|
448
552
|
ngOnDestroy(): void;
|
|
449
553
|
ngOnInit(): void;
|
|
450
554
|
submit(): void;
|
|
451
555
|
close(): void;
|
|
452
556
|
onPopFilesUploaded(file: any): void;
|
|
453
|
-
onFileDeleted(
|
|
557
|
+
onFileDeleted(): void;
|
|
558
|
+
onUploadStateChange(state: FileUploadState): void;
|
|
454
559
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDialogComponent, never>;
|
|
455
560
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationDialogComponent, "app-confirm-dialog", never, {}, {}, never, never, true, never>;
|
|
456
561
|
}
|
|
@@ -476,7 +581,7 @@ declare class AppAccordionComponent {
|
|
|
476
581
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppAccordionComponent, "app-accordion", never, { "iconName": { "alias": "iconName"; "required": false; }; "iconClass": { "alias": "iconClass"; "required": false; }; "iconPathCount": { "alias": "iconPathCount"; "required": false; }; "title": { "alias": "title"; "required": true; }; "contentBorderTop": { "alias": "contentBorderTop"; "required": false; }; "accordionPanelBorder": { "alias": "accordionPanelBorder"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
477
582
|
}
|
|
478
583
|
|
|
479
|
-
declare class DynamicFormComponent implements OnInit {
|
|
584
|
+
declare class DynamicFormComponent implements OnInit, OnChanges {
|
|
480
585
|
dynamicFormData: DynamicFormData;
|
|
481
586
|
selectButtonChange: EventEmitter<{
|
|
482
587
|
name: string;
|
|
@@ -507,19 +612,26 @@ declare class DynamicFormComponent implements OnInit {
|
|
|
507
612
|
fileId: string;
|
|
508
613
|
isNew: boolean;
|
|
509
614
|
}>;
|
|
615
|
+
uploadStateChange: EventEmitter<FileUploadState>;
|
|
510
616
|
inputsNames: string[];
|
|
511
617
|
formGroup: FormGroup;
|
|
512
618
|
inputsMap: InputsMap;
|
|
619
|
+
standaloneFileControl: FormControl<string | null>;
|
|
513
620
|
readonly fieldType: typeof FormFieldTypeEnum;
|
|
514
621
|
getFormControl: typeof FormUtils.getFormControl;
|
|
622
|
+
get fileUploadConfig(): FileUploadConfig | undefined;
|
|
515
623
|
ngOnInit(): void;
|
|
516
624
|
ngOnChanges(changes: SimpleChanges): void;
|
|
517
625
|
private updateFormState;
|
|
518
|
-
getAcceptedTypes(): string;
|
|
626
|
+
getAcceptedTypes(fileUpload?: FileUploadConfig): string;
|
|
627
|
+
getMaxFileSize(fileUpload?: FileUploadConfig): number;
|
|
628
|
+
getFileUploadConfig(inputName: string): FileUploadConfig | undefined;
|
|
629
|
+
hasUploadFileField(): boolean;
|
|
519
630
|
onFilesUploaded(file: any): void;
|
|
520
631
|
onFileDeleted(file: any): void;
|
|
632
|
+
onUploadStateChange(state: FileUploadState): void;
|
|
521
633
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
|
|
522
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "app-dynamic-form", never, { "dynamicFormData": { "alias": "dynamicFormData"; "required": true; }; }, { "selectButtonChange": "selectButtonChange"; "selectChange": "selectChange"; "selectClicked": "selectClicked"; "switchChange": "switchChange"; "autoCompleteSearch": "autoCompleteSearch"; "autoCompleteSelect": "autoCompleteSelect"; "popUpFilesUploaded": "popUpFilesUploaded"; "fileDeleted": "fileDeleted"; }, never, never, true, never>;
|
|
634
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "app-dynamic-form", never, { "dynamicFormData": { "alias": "dynamicFormData"; "required": true; }; }, { "selectButtonChange": "selectButtonChange"; "selectChange": "selectChange"; "selectClicked": "selectClicked"; "switchChange": "switchChange"; "autoCompleteSearch": "autoCompleteSearch"; "autoCompleteSelect": "autoCompleteSelect"; "popUpFilesUploaded": "popUpFilesUploaded"; "fileDeleted": "fileDeleted"; "uploadStateChange": "uploadStateChange"; }, never, never, true, never>;
|
|
523
635
|
}
|
|
524
636
|
|
|
525
637
|
declare class UserAutocompleteCardComponent {
|
|
@@ -649,6 +761,7 @@ interface ConfirmationDialogData {
|
|
|
649
761
|
hint?: string;
|
|
650
762
|
inputForm?: any;
|
|
651
763
|
breakpoints?: any;
|
|
764
|
+
fileUpload?: FileUploadConfig;
|
|
652
765
|
}
|
|
653
766
|
|
|
654
767
|
declare class ConfirmationDialogService {
|
|
@@ -720,6 +833,7 @@ declare class DualCalendarComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
720
833
|
gregorianModel: NgbDateStruct;
|
|
721
834
|
hijriModel: NgbDateStruct;
|
|
722
835
|
currentLang: i0.WritableSignal<"ar" | "en">;
|
|
836
|
+
disabledDays: number[];
|
|
723
837
|
gregorianUTC: EventEmitter<string>;
|
|
724
838
|
onClose: EventEmitter<boolean>;
|
|
725
839
|
gregorianUTCValue: string;
|
|
@@ -746,7 +860,7 @@ declare class DualCalendarComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
746
860
|
formatHijri(h: NgbDate): string;
|
|
747
861
|
ngOnDestroy(): void;
|
|
748
862
|
static ɵfac: i0.ɵɵFactoryDeclaration<DualCalendarComponent, never>;
|
|
749
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DualCalendarComponent, "app-dual-calendar", never, { "control": { "alias": "control"; "required": false; }; "label": { "alias": "label"; "required": false; }; "name": { "alias": "name"; "required": false; }; "withTime": { "alias": "withTime"; "required": false; }; "isDatePickerShow": { "alias": "isDatePickerShow"; "required": false; }; "currentLang": { "alias": "currentLang"; "required": false; }; "isShown": { "alias": "isShown"; "required": false; }; "appedToBody": { "alias": "appedToBody"; "required": false; }; }, { "gregorianUTC": "gregorianUTC"; "onClose": "onClose"; }, never, never, true, never>;
|
|
863
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DualCalendarComponent, "app-dual-calendar", never, { "control": { "alias": "control"; "required": false; }; "label": { "alias": "label"; "required": false; }; "name": { "alias": "name"; "required": false; }; "withTime": { "alias": "withTime"; "required": false; }; "isDatePickerShow": { "alias": "isDatePickerShow"; "required": false; }; "currentLang": { "alias": "currentLang"; "required": false; }; "disabledDays": { "alias": "disabledDays"; "required": false; }; "isShown": { "alias": "isShown"; "required": false; }; "appedToBody": { "alias": "appedToBody"; "required": false; }; }, { "gregorianUTC": "gregorianUTC"; "onClose": "onClose"; }, never, never, true, never>;
|
|
750
864
|
}
|
|
751
865
|
|
|
752
866
|
declare const WEEKDAYS: {
|
|
@@ -793,89 +907,5 @@ declare class AlertDialogService {
|
|
|
793
907
|
declare const dateRangeValidator: (fromKey: string, toKey: string) => ValidatorFn;
|
|
794
908
|
declare const notFutureDateValidator: (dateKey: string) => ValidatorFn;
|
|
795
909
|
|
|
796
|
-
interface AttachmentFile {
|
|
797
|
-
id: string;
|
|
798
|
-
fileName: string;
|
|
799
|
-
size: number;
|
|
800
|
-
mimeType: string;
|
|
801
|
-
createdDate?: string;
|
|
802
|
-
createdBy?: UserProfileData;
|
|
803
|
-
createdByDepartment?: Department;
|
|
804
|
-
}
|
|
805
|
-
interface UploadProgress {
|
|
806
|
-
fileId: string;
|
|
807
|
-
fileName: string;
|
|
808
|
-
progress: number;
|
|
809
|
-
status: UploadStatus;
|
|
810
|
-
error?: string;
|
|
811
|
-
response?: AttachmentFile;
|
|
812
|
-
}
|
|
813
|
-
interface Department {
|
|
814
|
-
id: string;
|
|
815
|
-
nameAr: string;
|
|
816
|
-
nameEn: string;
|
|
817
|
-
}
|
|
818
|
-
interface FileItem extends AttachmentFile {
|
|
819
|
-
progress?: number;
|
|
820
|
-
status?: UploadStatus;
|
|
821
|
-
error?: string;
|
|
822
|
-
file?: File;
|
|
823
|
-
isNew?: boolean;
|
|
824
|
-
}
|
|
825
|
-
interface DownloadRequest {
|
|
826
|
-
attachmentIds: string[];
|
|
827
|
-
}
|
|
828
|
-
interface FileTypeConfig {
|
|
829
|
-
icon: string;
|
|
830
|
-
iconPathCount: number;
|
|
831
|
-
colorClass?: string;
|
|
832
|
-
}
|
|
833
|
-
interface PdfPreviewState {
|
|
834
|
-
visible: boolean;
|
|
835
|
-
blob: Blob | null;
|
|
836
|
-
fileName: string;
|
|
837
|
-
}
|
|
838
|
-
interface Attachment {
|
|
839
|
-
id?: string;
|
|
840
|
-
nameFile: string;
|
|
841
|
-
size: number;
|
|
842
|
-
url?: string | ArrayBuffer | null;
|
|
843
|
-
file?: File;
|
|
844
|
-
isCanceled?: boolean;
|
|
845
|
-
uploadStatus?: UploadStatus;
|
|
846
|
-
status?: AttachmentStatusDisplay;
|
|
847
|
-
serverResponse?: unknown;
|
|
848
|
-
errorMessage?: string;
|
|
849
|
-
}
|
|
850
|
-
interface AttachmentStatusDisplay {
|
|
851
|
-
icon: string;
|
|
852
|
-
label: string;
|
|
853
|
-
labelClass?: string;
|
|
854
|
-
percentage?: number;
|
|
855
|
-
success?: boolean;
|
|
856
|
-
}
|
|
857
|
-
declare enum UploadStatus {
|
|
858
|
-
PENDING = "pending",
|
|
859
|
-
SUCCESS = "success",
|
|
860
|
-
UPLOADING = "uploading",
|
|
861
|
-
FAILED = "failed"
|
|
862
|
-
}
|
|
863
|
-
interface UserProfileData {
|
|
864
|
-
contact: Contact;
|
|
865
|
-
position: Position;
|
|
866
|
-
email: string;
|
|
867
|
-
profileImage: string;
|
|
868
|
-
nameEn: string;
|
|
869
|
-
nameAr: string;
|
|
870
|
-
}
|
|
871
|
-
interface Contact {
|
|
872
|
-
mobile: string;
|
|
873
|
-
work: string;
|
|
874
|
-
}
|
|
875
|
-
interface Position {
|
|
876
|
-
code: string;
|
|
877
|
-
name: string;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
910
|
export { AlertDialogComponent, AlertDialogService, AppAccordionComponent, AppBreadcrumbComponent, AppButtonComponent, AppDropdownMenuComponent, AppTabsComponent, AutoCompleteComponent, BasicErrorKeysEnum, BottomSheetComponent, ConfirmationDialogComponent, ConfirmationDialogService, DatePickerComponent, DualCalendarComponent, DynamicFormComponent, DynamicSidebarService, DynamicSidebarV2Service, ErrorsWithValuesKeysEnum, FormFieldTypeEnum, FormUtils, FormValidationService, IcoMoonIconComponent, InputComponent, MONTHS_GREGORIAN, MONTHS_HIJRI, ReadMoreComponent, SelectButtonComponent, SelectComponent, SideBarComponent, SidebarConfigDefaults, SwitchComponent, UploadStatus, UserAutocompleteCardComponent, UserInfoComponent, ValidationErrorsPipe, WEEKDAYS, dateRangeValidator, emailStcValidator, getGregorianMonthName, getHijriMonthName, getWeekdayName, maxRepeatedCharsValidator, notFutureDateValidator, numbersOnlyValidator, saudiPhoneValidator };
|
|
881
|
-
export type { AlertDialogData, AppButtonIconPos, AppButtonSeverity, AppButtonSize, AppButtonVariant, AppTabs, Attachment, AttachmentFile, AttachmentStatusDisplay, BreadCrumbExtraData, BreadCrumbPosition, BreadcrumbItem, ConfirmationDialogData, Contact, DateRangeInterface, Department, DownloadRequest, Dropdown, DropdownMenuItem, DropdownTextColor, DynamicFormData, DynamicSidebarV2Actions, DynamicSidebarV2Config, FileItem, FileTypeConfig, InputContentType, InputType, InputsMap, InputsMapData, LabelValue, OptionTemplateConfig, PdfPreviewState, Position, RoutedTab, SidebarActionConfig, SidebarActionV2Config, SidebarConfig, SidebarV2Actions, TemplateTab, UploadProgress, UserProfileData };
|
|
911
|
+
export type { AlertDialogData, AppButtonIconPos, AppButtonSeverity, AppButtonSize, AppButtonVariant, AppTabs, Attachment, AttachmentFile, AttachmentStatusDisplay, BreadCrumbExtraData, BreadCrumbPosition, BreadcrumbItem, ConfirmationDialogData, Contact, DateRangeInterface, Department, DownloadRequest, Dropdown, DropdownMenuItem, DropdownTextColor, DynamicFormData, DynamicSidebarV2Actions, DynamicSidebarV2Config, FileItem, FileTypeConfig, FileUploadConfig, FileUploadResponse, FileUploadState, InputContentType, InputType, InputsMap, InputsMapData, LabelValue, OptionTemplateConfig, PdfPreviewState, Position, RoutedTab, SidebarActionConfig, SidebarActionV2Config, SidebarConfig, SidebarV2Actions, TemplateTab, UploadProgress, UserProfileData };
|