@solcre-org/core-ui 2.20.0 → 2.20.2

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
@@ -407,28 +407,12 @@ interface DocumentFieldValue {
407
407
  documentNumber: string;
408
408
  }
409
409
 
410
- declare class DocumentFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> {
411
- protected documentTypeControl: FormControl<string | null>;
412
- protected documentNumberControl: FormControl<string | null>;
413
- private isUserEditing;
414
- defaultDocumentOptions: DocumentOption[];
415
- fieldConfig: _angular_core.Signal<DocumentFieldConfig<T>>;
416
- documentTypeOptions: _angular_core.Signal<DocumentOption[]>;
417
- isDisabled: _angular_core.Signal<boolean>;
418
- documentTypeChars: _angular_core.Signal<string>;
419
- documentNumberChars: _angular_core.Signal<string | null>;
420
- constructor();
421
- private emitValue;
422
- onDocumentTypeChange(event: Event): void;
423
- onDocumentNumberChange(event: Event): void;
424
- onDocumentTypeFocus(): void;
425
- onDocumentNumberFocus(): void;
426
- onDocumentTypeBlur(): void;
427
- onDocumentNumberBlur(): void;
428
- getDocumentTypePlaceholder(): string;
429
- getDocumentNumberPlaceholder(): string;
430
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DocumentFieldComponent<any>, never>;
431
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DocumentFieldComponent<any>, "core-document-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
410
+ declare enum AlertType {
411
+ DEFAULT = "default",
412
+ ERROR = "error",
413
+ SUCCESS = "success",
414
+ HIGHLIGHTED = "highlight",
415
+ WAITING = "waiting"
432
416
  }
433
417
 
434
418
  declare enum FileType {
@@ -441,180 +425,6 @@ declare enum FileType {
441
425
  FILE_GROUP = "file_group"
442
426
  }
443
427
 
444
- interface PreviewFileUrl {
445
- id: string;
446
- url: string;
447
- }
448
- interface FileFieldConfig<T extends DataBaseModelInterface> extends ModalFieldConfig<T> {
449
- accept?: string;
450
- multiple?: boolean;
451
- maxFiles?: number;
452
- minFiles?: number;
453
- maxSize?: number;
454
- showPreview?: boolean;
455
- acceptString: string;
456
- previewUrls?: PreviewFileUrl[] | ((row: T) => PreviewFileUrl[]);
457
- onFileRemoved?: (data: {
458
- file: any;
459
- index: number;
460
- fileType: 'existing' | 'selected' | 'preview';
461
- previewFile?: PreviewFileUrl;
462
- }) => void;
463
- onFilesAdded?: (data: {
464
- previewUrls: PreviewFileUrl[];
465
- newFiles: File[];
466
- }) => void;
467
- fileUploadConfig?: {
468
- fileType?: FileType;
469
- fileTypeResolver?: (data: T) => FileType;
470
- companyIdSource?: keyof T;
471
- staticCompanyId?: string;
472
- fileIdTarget?: keyof T;
473
- };
474
- customActions?: {
475
- id: string;
476
- label: string;
477
- icon: string;
478
- action: (value: any) => void;
479
- }[];
480
- }
481
-
482
- interface ServerFile {
483
- id: string;
484
- filename: string;
485
- size?: number;
486
- type?: string;
487
- s3_key?: string;
488
- created_at?: string;
489
- updated_at?: string;
490
- }
491
- declare class FileFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> implements AfterViewInit {
492
- private authService;
493
- selectedFiles: _angular_core.WritableSignal<File[]>;
494
- existingFiles: _angular_core.WritableSignal<ServerFile[]>;
495
- previewUrls: _angular_core.WritableSignal<string[]>;
496
- newFilesPreviews: _angular_core.WritableSignal<string[]>;
497
- previewBlobs: _angular_core.WritableSignal<File[]>;
498
- previewFileIds: _angular_core.WritableSignal<Map<File, string>>;
499
- errorMessage: _angular_core.WritableSignal<string>;
500
- errorParams: _angular_core.WritableSignal<any>;
501
- displayErrorMessage: _angular_core.Signal<{
502
- key: string;
503
- params: any;
504
- } | {
505
- key: string;
506
- params?: undefined;
507
- } | null>;
508
- fieldConfig: _angular_core.Signal<FileFieldConfig<T>>;
509
- isEditMode: _angular_core.Signal<boolean>;
510
- ModalMode: typeof ModalMode;
511
- allFiles: _angular_core.Signal<(File | ServerFile)[]>;
512
- allPreviewUrls: _angular_core.Signal<string[]>;
513
- private previewUrlsEffect;
514
- private valueChangeEffect;
515
- private getPreviewUrls;
516
- private createBlobsFromUrls;
517
- private extractFilenameFromUrl;
518
- ngOnInit(): void;
519
- ngAfterViewInit(): void;
520
- protected initializeFormControl(): void;
521
- private filesCountValidator;
522
- private initializeFiles;
523
- private regeneratePreviewsIfNeeded;
524
- isServerFile(value: any): value is ServerFile;
525
- private generatePreviews;
526
- onFileSelected(event: Event): void;
527
- private setLocalError;
528
- private clearLocalError;
529
- removeFile(index: number): void;
530
- private validateCurrentState;
531
- private emitCurrentValue;
532
- getFileIcon(file: File): string;
533
- formatFileSize(bytes: number): string;
534
- getCurrentDate(): string;
535
- getCurrentUser(): string;
536
- getPreviewIndex(file: any): number;
537
- getPreviewUrlForFile(file: any): string | null;
538
- getPreviewUrl(file: any): string | null;
539
- isPreviewFile(file: any): boolean;
540
- getOriginalUrl(file: any): string | null;
541
- onBlurInput(): void;
542
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileFieldComponent<any>, never>;
543
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileFieldComponent<any>, "core-file-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
544
- }
545
-
546
- declare enum NumberFieldConfigType {
547
- DEFAULT = "default",
548
- WITH_ICON = "with-icon",
549
- OUTSIDE = "outside"
550
- }
551
- interface NumberFieldConfig {
552
- type?: NumberFieldConfigType;
553
- icon?: string;
554
- chars?: number;
555
- disableInput?: boolean;
556
- canUseInput?: boolean;
557
- }
558
- interface NumberModalFieldConfig<T> extends ModalFieldConfig<T> {
559
- numberConfig?: NumberFieldConfig;
560
- }
561
-
562
- declare class NumberFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> implements OnDestroy {
563
- private elementRef;
564
- readonly NumberFieldConfigType: typeof NumberFieldConfigType;
565
- private holdInterval;
566
- private holdTimeout;
567
- private currentHoldDirection;
568
- private holdSpeed;
569
- private minHoldSpeed;
570
- private accelerationRate;
571
- private isHolding;
572
- private wasHeld;
573
- fieldType: _angular_core.Signal<NumberFieldConfigType>;
574
- iconClass: _angular_core.Signal<string | null | undefined>;
575
- getDisableInput(): boolean | null;
576
- getCanUseInput(): boolean;
577
- getCharsWidth(): string | null;
578
- isDisabled(): boolean;
579
- getMinValue(): number;
580
- getMaxValue(): number | null;
581
- isDecrementDisabled(): boolean;
582
- isIncrementDisabled(): boolean;
583
- constructor(elementRef: ElementRef);
584
- ngOnDestroy(): void;
585
- handleMouseDown(event: MouseEvent, direction: number): void;
586
- handleMouseUp(event: MouseEvent): void;
587
- handleTouchStart(event: TouchEvent, direction: number): void;
588
- handleTouchEnd(event: TouchEvent): void;
589
- onControlClick(change: number): void;
590
- private executeIncrement;
591
- private startHold;
592
- private stopHold;
593
- private restartInterval;
594
- onValueChange(newValue: any): void;
595
- onBlurInput(): void;
596
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NumberFieldComponent<any>, never>;
597
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NumberFieldComponent<any>, "core-number-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
598
- }
599
-
600
- declare class PasswordFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> {
601
- showPassword: _angular_core.WritableSignal<boolean>;
602
- constructor();
603
- inputType(): "text" | "password";
604
- togglePasswordVisibility(): void;
605
- onBlurInput(): void;
606
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<PasswordFieldComponent<any>, never>;
607
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PasswordFieldComponent<any>, "core-password-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
608
- }
609
-
610
- declare enum AlertType {
611
- DEFAULT = "default",
612
- ERROR = "error",
613
- SUCCESS = "success",
614
- HIGHLIGHTED = "highlight",
615
- WAITING = "waiting"
616
- }
617
-
618
428
  declare enum NumberRange {
619
429
  MIN = "min",
620
430
  MAX = "max"
@@ -943,6 +753,205 @@ declare enum WeekDay {
943
753
  SUNDAY = 6
944
754
  }
945
755
 
756
+ declare class DocumentFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> {
757
+ protected documentTypeControl: FormControl<string | null>;
758
+ protected documentNumberControl: FormControl<string | null>;
759
+ private isUserEditing;
760
+ defaultDocumentOptions: DocumentOption[];
761
+ fieldConfig: _angular_core.Signal<DocumentFieldConfig<T>>;
762
+ documentTypeOptions: _angular_core.Signal<DocumentOption[]>;
763
+ isDisabled: _angular_core.Signal<boolean>;
764
+ documentTypeChars: _angular_core.Signal<string>;
765
+ documentNumberChars: _angular_core.Signal<string | null>;
766
+ documentFieldConfig: _angular_core.Signal<{
767
+ key: string;
768
+ type: FieldType;
769
+ label: string;
770
+ readonly: boolean;
771
+ clearable: boolean;
772
+ options: DocumentOption[];
773
+ }>;
774
+ constructor();
775
+ private emitValue;
776
+ onDocumentTypeChange(event: Event): void;
777
+ onDocumentNumberChange(event: Event): void;
778
+ onDocumentTypeFocus(): void;
779
+ onDocumentNumberFocus(): void;
780
+ onDocumentTypeBlur(): void;
781
+ onDocumentNumberBlur(): void;
782
+ getDocumentTypePlaceholder(): string;
783
+ getDocumentNumberPlaceholder(): string;
784
+ onDocumentTypeClear(): void;
785
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DocumentFieldComponent<any>, never>;
786
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DocumentFieldComponent<any>, "core-document-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
787
+ }
788
+
789
+ interface PreviewFileUrl {
790
+ id: string;
791
+ url: string;
792
+ }
793
+ interface FileFieldConfig<T extends DataBaseModelInterface> extends ModalFieldConfig<T> {
794
+ accept?: string;
795
+ multiple?: boolean;
796
+ maxFiles?: number;
797
+ minFiles?: number;
798
+ maxSize?: number;
799
+ showPreview?: boolean;
800
+ acceptString: string;
801
+ previewUrls?: PreviewFileUrl[] | ((row: T) => PreviewFileUrl[]);
802
+ onFileRemoved?: (data: {
803
+ file: any;
804
+ index: number;
805
+ fileType: 'existing' | 'selected' | 'preview';
806
+ previewFile?: PreviewFileUrl;
807
+ }) => void;
808
+ onFilesAdded?: (data: {
809
+ previewUrls: PreviewFileUrl[];
810
+ newFiles: File[];
811
+ }) => void;
812
+ fileUploadConfig?: {
813
+ fileType?: FileType;
814
+ fileTypeResolver?: (data: T) => FileType;
815
+ companyIdSource?: keyof T;
816
+ staticCompanyId?: string;
817
+ fileIdTarget?: keyof T;
818
+ };
819
+ customActions?: {
820
+ id: string;
821
+ label: string;
822
+ icon: string;
823
+ action: (value: any) => void;
824
+ }[];
825
+ }
826
+
827
+ interface ServerFile {
828
+ id: string;
829
+ filename: string;
830
+ size?: number;
831
+ type?: string;
832
+ s3_key?: string;
833
+ created_at?: string;
834
+ updated_at?: string;
835
+ }
836
+ declare class FileFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> implements AfterViewInit {
837
+ private authService;
838
+ selectedFiles: _angular_core.WritableSignal<File[]>;
839
+ existingFiles: _angular_core.WritableSignal<ServerFile[]>;
840
+ previewUrls: _angular_core.WritableSignal<string[]>;
841
+ newFilesPreviews: _angular_core.WritableSignal<string[]>;
842
+ previewBlobs: _angular_core.WritableSignal<File[]>;
843
+ previewFileIds: _angular_core.WritableSignal<Map<File, string>>;
844
+ errorMessage: _angular_core.WritableSignal<string>;
845
+ errorParams: _angular_core.WritableSignal<any>;
846
+ displayErrorMessage: _angular_core.Signal<{
847
+ key: string;
848
+ params: any;
849
+ } | {
850
+ key: string;
851
+ params?: undefined;
852
+ } | null>;
853
+ fieldConfig: _angular_core.Signal<FileFieldConfig<T>>;
854
+ isEditMode: _angular_core.Signal<boolean>;
855
+ ModalMode: typeof ModalMode;
856
+ allFiles: _angular_core.Signal<(File | ServerFile)[]>;
857
+ allPreviewUrls: _angular_core.Signal<string[]>;
858
+ private previewUrlsEffect;
859
+ private valueChangeEffect;
860
+ private getPreviewUrls;
861
+ private createBlobsFromUrls;
862
+ private extractFilenameFromUrl;
863
+ ngOnInit(): void;
864
+ ngAfterViewInit(): void;
865
+ protected initializeFormControl(): void;
866
+ private filesCountValidator;
867
+ private initializeFiles;
868
+ private regeneratePreviewsIfNeeded;
869
+ isServerFile(value: any): value is ServerFile;
870
+ private generatePreviews;
871
+ onFileSelected(event: Event): void;
872
+ private setLocalError;
873
+ private clearLocalError;
874
+ removeFile(index: number): void;
875
+ private validateCurrentState;
876
+ private emitCurrentValue;
877
+ getFileIcon(file: File): string;
878
+ formatFileSize(bytes: number): string;
879
+ getCurrentDate(): string;
880
+ getCurrentUser(): string;
881
+ getPreviewIndex(file: any): number;
882
+ getPreviewUrlForFile(file: any): string | null;
883
+ getPreviewUrl(file: any): string | null;
884
+ isPreviewFile(file: any): boolean;
885
+ getOriginalUrl(file: any): string | null;
886
+ onBlurInput(): void;
887
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileFieldComponent<any>, never>;
888
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileFieldComponent<any>, "core-file-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
889
+ }
890
+
891
+ declare enum NumberFieldConfigType {
892
+ DEFAULT = "default",
893
+ WITH_ICON = "with-icon",
894
+ OUTSIDE = "outside"
895
+ }
896
+ interface NumberFieldConfig {
897
+ type?: NumberFieldConfigType;
898
+ icon?: string;
899
+ chars?: number;
900
+ disableInput?: boolean;
901
+ canUseInput?: boolean;
902
+ }
903
+ interface NumberModalFieldConfig<T> extends ModalFieldConfig<T> {
904
+ numberConfig?: NumberFieldConfig;
905
+ }
906
+
907
+ declare class NumberFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> implements OnDestroy {
908
+ private elementRef;
909
+ readonly NumberFieldConfigType: typeof NumberFieldConfigType;
910
+ private holdInterval;
911
+ private holdTimeout;
912
+ private currentHoldDirection;
913
+ private holdSpeed;
914
+ private minHoldSpeed;
915
+ private accelerationRate;
916
+ private isHolding;
917
+ private wasHeld;
918
+ fieldType: _angular_core.Signal<NumberFieldConfigType>;
919
+ iconClass: _angular_core.Signal<string | null | undefined>;
920
+ getDisableInput(): boolean | null;
921
+ getCanUseInput(): boolean;
922
+ getCharsWidth(): string | null;
923
+ isDisabled(): boolean;
924
+ getMinValue(): number;
925
+ getMaxValue(): number | null;
926
+ isDecrementDisabled(): boolean;
927
+ isIncrementDisabled(): boolean;
928
+ constructor(elementRef: ElementRef);
929
+ ngOnDestroy(): void;
930
+ handleMouseDown(event: MouseEvent, direction: number): void;
931
+ handleMouseUp(event: MouseEvent): void;
932
+ handleTouchStart(event: TouchEvent, direction: number): void;
933
+ handleTouchEnd(event: TouchEvent): void;
934
+ onControlClick(change: number): void;
935
+ private executeIncrement;
936
+ private startHold;
937
+ private stopHold;
938
+ private restartInterval;
939
+ onValueChange(newValue: any): void;
940
+ onBlurInput(): void;
941
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NumberFieldComponent<any>, never>;
942
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NumberFieldComponent<any>, "core-number-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
943
+ }
944
+
945
+ declare class PasswordFieldComponent<T extends DataBaseModelInterface> extends BaseFieldComponent<T> {
946
+ showPassword: _angular_core.WritableSignal<boolean>;
947
+ constructor();
948
+ inputType(): "text" | "password";
949
+ togglePasswordVisibility(): void;
950
+ onBlurInput(): void;
951
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PasswordFieldComponent<any>, never>;
952
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PasswordFieldComponent<any>, "core-password-field", never, {}, {}, never, never, true, [{ directive: typeof CoreHostDirective; inputs: {}; outputs: {}; }]>;
953
+ }
954
+
946
955
  interface CountryOption {
947
956
  code: CountryCode;
948
957
  phone: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solcre-org/core-ui",
3
- "version": "2.20.0",
3
+ "version": "2.20.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"