@datarailsshared/datarailsshared 1.4.80-dragons → 1.4.84

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.
Files changed (26) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +295 -24
  2. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  3. package/datarailsshared-datarailsshared-1.4.84.tgz +0 -0
  4. package/datarailsshared-datarailsshared.d.ts +2 -0
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/datarailsshared-datarailsshared.js +3 -1
  7. package/esm2015/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.js +70 -0
  8. package/esm2015/lib/dr-dialog/components/dialog-wrapper/dialog-wrapper.component.js +89 -0
  9. package/esm2015/lib/dr-dialog/dialog.module.js +32 -0
  10. package/esm2015/lib/dr-dialog/interfaces/dialog-data.js +21 -0
  11. package/esm2015/lib/dr-dialog/services/dialog.service.js +75 -0
  12. package/esm2015/lib/dr-inputs/dr-select/dr-select.component.js +3 -5
  13. package/esm2015/lib/stepper/stepper.module.js +3 -3
  14. package/esm2015/public-api.js +5 -2
  15. package/fesm2015/datarailsshared-datarailsshared.js +280 -20
  16. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  17. package/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.d.ts +23 -0
  18. package/lib/dr-dialog/components/dialog-wrapper/dialog-wrapper.component.d.ts +24 -0
  19. package/lib/dr-dialog/dialog.module.d.ts +2 -0
  20. package/lib/dr-dialog/interfaces/dialog-data.d.ts +109 -0
  21. package/lib/dr-dialog/services/dialog.service.d.ts +27 -0
  22. package/lib/dr-inputs/dr-select/dr-select.component.d.ts +0 -1
  23. package/lib/stepper/stepper.module.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/public-api.d.ts +4 -1
  26. package/datarailsshared-datarailsshared-1.4.80-dragons.tgz +0 -0
@@ -0,0 +1,23 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { MatDialogRef } from '@angular/material/dialog';
4
+ import { DataProp } from '../../interfaces/dialog-data';
5
+ import { BehaviorSubject, Subject } from 'rxjs';
6
+ import { DialogService } from '../../services/dialog.service';
7
+ export declare class DialogModalWrapperComponent implements OnInit, OnDestroy {
8
+ dialogRef: MatDialogRef<DialogModalWrapperComponent>;
9
+ private dialogService;
10
+ dialogData: DataProp;
11
+ class: import("../../interfaces/dialog-data").SizeModal;
12
+ form: FormGroup;
13
+ saving$: BehaviorSubject<boolean>;
14
+ isLoading: boolean;
15
+ showServerErrorMessage: boolean;
16
+ destroy$: Subject<any>;
17
+ constructor(dialogRef: MatDialogRef<DialogModalWrapperComponent>, dialogService: DialogService, dialogData: DataProp);
18
+ ngOnInit(): void;
19
+ onAccept(): void;
20
+ footerAction(): void;
21
+ closeDialog(): void;
22
+ ngOnDestroy(): void;
23
+ }
@@ -0,0 +1,24 @@
1
+ import { ViewContainerRef, ComponentFactoryResolver, AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { DataProp, SizeModal } from '../../interfaces/dialog-data';
4
+ import { BehaviorSubject, Subject } from 'rxjs';
5
+ import { DialogService } from '../../services/dialog.service';
6
+ export declare class DialogWrapperComponent implements AfterViewInit, OnDestroy {
7
+ dialogRef: MatDialogRef<DialogWrapperComponent>;
8
+ private dialogService;
9
+ private cdr;
10
+ private componentFactoryResolver;
11
+ dialogData: DataProp;
12
+ content: ViewContainerRef;
13
+ class: SizeModal;
14
+ childComponent: any;
15
+ isLoading: boolean;
16
+ saving$: BehaviorSubject<boolean>;
17
+ destroy$: Subject<any>;
18
+ constructor(dialogRef: MatDialogRef<DialogWrapperComponent>, dialogService: DialogService, cdr: ChangeDetectorRef, componentFactoryResolver: ComponentFactoryResolver, dialogData: DataProp);
19
+ ngAfterViewInit(): Error;
20
+ closeDialog(data?: any): void;
21
+ onDecline(): void;
22
+ onAcceptDialog(data?: any): void;
23
+ ngOnDestroy(): void;
24
+ }
@@ -0,0 +1,2 @@
1
+ export declare class DrDialogModule {
2
+ }
@@ -0,0 +1,109 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import { Observable } from 'rxjs';
3
+ export interface DialogData<T = any> {
4
+ data: {
5
+ title?: string;
6
+ searchable?: boolean;
7
+ clearable?: boolean;
8
+ subtitle?: string;
9
+ content?: any;
10
+ contentIcon?: {
11
+ class?: string;
12
+ color?: string;
13
+ };
14
+ acceptButton?: DialogFooterButton;
15
+ cancelButton?: DialogFooterButton;
16
+ customButton?: DialogFooterButton;
17
+ tooltips?: any;
18
+ errorMessage?: string;
19
+ serverErrorMessage?: string;
20
+ child?: ComponentType<T>;
21
+ childData?: Partial<T>;
22
+ theme?: {
23
+ themeSize?: SizeModal;
24
+ type?: 'successful';
25
+ contentNoPadding?: boolean;
26
+ isConfirmation?: boolean;
27
+ noThemeSizeClass?: boolean;
28
+ };
29
+ confirmFn?: any;
30
+ fields?: ModalFormField[];
31
+ hideCloseBtn?: boolean;
32
+ footerTemplateData?: FooterTemplateData;
33
+ };
34
+ panelClass?: string | string[];
35
+ disableClose?: boolean;
36
+ maxWidth?: number | string;
37
+ maxHeight?: number | string;
38
+ }
39
+ export interface ConfirmDialogData {
40
+ title?: string;
41
+ searchable?: boolean;
42
+ clearable?: boolean;
43
+ content?: string;
44
+ contentIcon?: {
45
+ class?: string;
46
+ color?: string;
47
+ };
48
+ acceptButton?: DialogFooterButton;
49
+ cancelButton?: DialogFooterButton;
50
+ customButton?: DialogFooterButton;
51
+ tooltips?: any;
52
+ errorMessage?: string;
53
+ serverErrorMessage?: string;
54
+ hideCloseBtn?: boolean;
55
+ confirmFn?: (response?: any) => Observable<any>;
56
+ fields?: ModalFormField[];
57
+ footerTemplateData?: FooterTemplateData;
58
+ }
59
+ export interface ConfirmDialogModalData extends ConfirmDialogData {
60
+ confirmFn?: any;
61
+ hideCloseBtn?: boolean;
62
+ footerTemplateData?: FooterTemplateData;
63
+ fields?: ModalFormField[];
64
+ }
65
+ export interface FooterTemplateData {
66
+ label: string;
67
+ icon?: string;
68
+ action: (objToSave?: any) => any;
69
+ }
70
+ export interface ModalFormField {
71
+ name: string;
72
+ type: 'input' | 'select';
73
+ label?: string;
74
+ isLabelFullWidth?: boolean;
75
+ items?: any[];
76
+ items$?: Observable<any[]> | Observable<any>;
77
+ default?: any;
78
+ placeholder?: string;
79
+ bindLabel?: string;
80
+ bindValue?: string;
81
+ validators?: any[];
82
+ }
83
+ export declare type SizeModal = 'small-modal' | 'medium-modal' | 'medium-large-modal' | 'large-modal' | 'xl-modal' | 'xl-custom-modal';
84
+ export declare type DataProp<T = any> = DialogData<T>['data'];
85
+ export declare type DialogTheme = DataProp['theme'];
86
+ export declare type DialogFooterButton = {
87
+ label?: string;
88
+ loadingLabel?: string;
89
+ functions?: any;
90
+ loading?: any;
91
+ theme?: any;
92
+ };
93
+ export declare enum DIALOG_SIZE {
94
+ SMALL = "small-modal",
95
+ MEDIUM = "medium-modal",
96
+ MEDIUM_LARGE = "medium-large-modal",
97
+ LARGE = "large-modal",
98
+ X_LARGE = "xl-modal",
99
+ X_CUSTOM_LARGE = "xl-custom-modal"
100
+ }
101
+ export declare enum DIALOG_BUTTON_LABEL {
102
+ SAVE = "Save",
103
+ CANCEL = "Cancel",
104
+ CLOSE = "Close"
105
+ }
106
+ export declare enum DIALOG_FIELD_TYPE {
107
+ INPUT = "input",
108
+ SELECT = "select"
109
+ }
@@ -0,0 +1,27 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
3
+ import { ConfirmDialogData, DialogData } from '../interfaces/dialog-data';
4
+ import { DialogWrapperComponent } from '../components/dialog-wrapper/dialog-wrapper.component';
5
+ import { DialogModalWrapperComponent } from '../components/dialog-modal-wrapper/dialog-modal-wrapper.component';
6
+ import { BehaviorSubject, Observable, Subject } from 'rxjs';
7
+ export declare class DialogService {
8
+ private dialog;
9
+ private wrapperComponent;
10
+ constructor(dialog: MatDialog);
11
+ /**
12
+ * Function to open modal with custom form
13
+ */
14
+ openDialogWrapper<T, D = any, R = any>(componentTypeChild: ComponentType<T>, dialogData: DialogData<T>, componentTypeWrapper?: ComponentType<D>): MatDialogRef<any, any>;
15
+ /**
16
+ * Function to open confirmation modal
17
+ */
18
+ openConfirmDialog<R = any>(confirmDialogData: ConfirmDialogData): MatDialogRef<DialogWrapperComponent, R>;
19
+ /**
20
+ * Function to open confirmation modal with inputs
21
+ */
22
+ openConfirmDialogModal<R = any>(confirmDialogData: ConfirmDialogData): MatDialogRef<DialogModalWrapperComponent, R>;
23
+ close(params?: any): void;
24
+ changeDialogThemeSize(theme: string): void;
25
+ private openDialog;
26
+ throwErr(err: Error, load?: Subject<any> | BehaviorSubject<any>): Observable<any>;
27
+ }
@@ -17,7 +17,6 @@ export declare class DrSelectComponent implements ControlValueAccessor {
17
17
  loading: boolean;
18
18
  readonly: boolean;
19
19
  disabled: boolean;
20
- groupBy: any;
21
20
  optionWithDescription: boolean;
22
21
  id: string;
23
22
  keyDownFn: ($event: KeyboardEvent) => boolean;
@@ -1,2 +1,2 @@
1
- export declare class StepperModule {
1
+ export declare class DrStepperModule {
2
2
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.4.80-dragons",
3
+ "version": "1.4.84",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",
package/public-api.d.ts CHANGED
@@ -40,9 +40,11 @@ export * from './lib/dr-layout/dr-layout.component';
40
40
  export * from './lib/dr-layout/dr-layout-header.component';
41
41
  export * from './lib/dr-layout/dr-layout-body.component';
42
42
  export * from './lib/dr-error/dr-error.component';
43
+ export * from './lib/dr-dialog/services/dialog.service';
43
44
  export { TooltipPosition } from './lib/dr-tooltip/enums/tooltip-position.enum';
44
45
  export { TooltipInfoContext } from './lib/dr-tooltip/interfaces/tooltip-component-context';
45
46
  export { Step } from './lib/stepper/interfaces/stepper';
47
+ export * from './lib/dr-dialog/interfaces/dialog-data';
46
48
  export * from './lib/dr-inputs/dr-model-debounce-change.directive';
47
49
  export * from './lib/models/datePicker';
48
50
  export { TAG_TYPES, ITag, IDateTag, IListTag, ITagForServer } from './lib/models/serverTags';
@@ -64,4 +66,5 @@ export { DrAccordionModule } from './lib/dr-accordion/accordion.module';
64
66
  export { DrSharedUtils } from './lib/utils/dr-shared-utils';
65
67
  export { DrLayoutModule } from './lib/dr-layout/dr-layout.module';
66
68
  export { DrErrorModule } from './lib/dr-error/dr-error.module';
67
- export { StepperModule } from './lib/stepper/stepper.module';
69
+ export { DrStepperModule } from './lib/stepper/stepper.module';
70
+ export { DrDialogModule } from './lib/dr-dialog/dialog.module';